Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save confraria/2cc58338a884eb985bed7728906a8b88 to your computer and use it in GitHub Desktop.
Save confraria/2cc58338a884eb985bed7728906a8b88 to your computer and use it in GitHub Desktop.
private addStep(step) {
step.id = `scriptStep${this.stepId++}`;
this.ctxQuest.lastStep = step;
this.ctxQuest.steps.push(step);
step.quest = this.ctxQuest;
if (this.state !== 'directC' && step.type === DIRECT_COMMUNICATION_SEND_DIRECT_MESSAGE) {
this.state = 'directC';
}
if (this.state === 'directC' && ![DIRECT_COMMUNICATION_SEND_DIRECT_MESSAGE, ADD_DECISION].includes(step.type)) {
this.state = undefined;
this.addStep({
type: DIRECT_COMMUNICATION_END_DIRECT_MESSAGES
});
}
if (step.type === DIRECT_COMMUNICATION_END_DIRECT_MESSAGES) {
this.state = undefined;
this.when(DIRECT_COMMUNICATION_SHOW_NEXT_MESSAGE);
}
this.steps.push(step);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment