///
///
///
///
class ActionStand 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 = ActionStand.check.createAndAddRule({
name : "Stand - Can stand?",
code : (rulebook) => {
// TODO: Check if being held down
// TODO: Check if incapacitated
}
});
public static carryStand = ActionStand.carry.createAndAddRule({
name : "Stand - Rise up!",
code : (runner : RulebookRunner) => {
let actor = runner.noun.actor;
if (actor instanceof Person) {
actor.stance = PersonStance.STANDING;
if (actor == WorldState.player) {
runner.noun.say.add("You get up.");
} else {
runner.noun.say.add(runner.noun.actor, " rises up.");
}
}
}
});
}
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 up", new ActionStand(WorldState.player));
}
}
}
));