/// /// /// /// class ActionDropDown extends Action { public static check = new Rulebook("Check Stand"); public static carry = new Rulebook("Carry out Stand"); public constructor (actor : Thing, ...nouns : Array) { super(actor, ...nouns); this.requiresNoun = false; this.requiresVisibility = false; } public getCommandText () { return "stand up" } public static checkStand = ActionDropDown.check.createAndAddRule({ name : "Stand - Can get down?", code : (rulebook) => { // TODO: Check if being held up } }); public static carryStand = ActionDropDown.carry.createAndAddRule({ name : "Stand - Go doggy", code : (runner : RulebookRunner) => { let actor = runner.noun.actor; if (actor instanceof Person) { actor.stance = PersonStance.ALLFOURS; if (actor == WorldState.player) { runner.noun.say.add("You get down on all fours."); } else { runner.noun.say.add(runner.noun.actor, " gets down."); } } } }); } Elements.HyperlinkHandler.CommonActionsRulebook.addRule(new Rule( { name : "Hyperlink - Stand up!", firstPriority : Rule.PRIORITY_MEDIUM, code : (rulebook : RulebookRunner) => { if (WorldState.player.stance != PersonStance.ALLFOURS) { Elements.HyperlinkHandler.addCommonAction("Get down", new ActionDropDown(WorldState.player)); } } } ));