Updating the storylet API

This commit is contained in:
David Masad
2021-01-27 18:02:34 -05:00
parent dc8d36b4de
commit 7a14ae671b
3 changed files with 55 additions and 46 deletions

View File

@ -1,11 +1,6 @@
// Set up narrative model
// -----------------------------------------------------------------------
// Set up NPCs
// ------------------------------------------
@ -44,8 +39,10 @@ for (let id=0; id<nChars; id++) {
// Set up storylets themselves
// ------------------------------------------
NarrativeManager.storyletMakers = {
"Dance": function() {
NarrativeManager.storylets["Dance"] = {
name: "Dance",
tags: ["interaction"],
generate: function() {
let storylets = [];
if (State.variables.location != "Ballroom") return storylets;
for (let id in State.variables.characters) {
@ -61,8 +58,14 @@ NarrativeManager.storyletMakers = {
}
}
return storylets;
},
"Conversation": function() {
}
};
NarrativeManager.storylets["Conversation"] = {
name: "Conversation",
tags: ["interaction"],
generate: function() {
let storylets = [];
if (State.variables.location != "Library") return storylets;
for (let id in State.variables.characters) {
@ -78,5 +81,5 @@ NarrativeManager.storyletMakers = {
}
}
return storylets;
},
}
}
};