12345678910111213141516171819202122232425262728293031 |
- /// <reference path="../Action.ts" />
- /// <reference path="../../../Elements/Modules/HyperlinkHandler.ts" />
- class ActionWait extends Action {
- public requiresTurn = true;
- public requiresNoun = false;
- public requiresVisibility = false;
- public static check : Rulebook<ActionWait> = new Rulebook("Check Waiting");
- public static carry : Rulebook<ActionWait> = new Rulebook("Carry out Waiting");
- public getCommandText () {
- return "wait";
- }
- }
- ActionWait.carry.addRule(new Rule({
- name : "Print waiting message",
- code : runner => {
- if (runner.noun.actor == WorldState.player) {
- runner.noun.say.add("You wait.");
- }
- }
- }));
- Elements.HyperlinkHandler.CommonActionsRulebook.addRule(new Rule({
- name : "Add Wait Command Rule",
- firstPriority : Rule.PRIORITY_HIGHEST,
- priority : Rule.PRIORITY_MEDIUM,
- code : (rulebook : RulebookRunner<void>) => {
- Elements.HyperlinkHandler.addCommonAction("Wait", new ActionWait(WorldState.player));
- }
- }));
|