/// /// /// class ActionTalk extends Action { public static PRIORITY_SITUATION_DIALOGUE = 9; public static PRIORITY_POSSESSION_DIALOGUE = 7; public static PRIORITY_LOCATION_DIALOGUE = 5; public static PRIORITY_COMMON_DIALOGUE = 3; public static PRIORITY_GLOBAL_DIALOGUE = 1; public static check: Rulebook = new Rulebook("Check Talking"); public static carry: Rulebook = new Rulebook("Carry out Talking"); public static defaultCarryTalkingRule = ActionTalk.carry.createAndAddRule({ name : "Talking - Doesn't want to talk", firstPriority : -1, priority : -1, code : (rulebook : RulebookRunner) => { let action = rulebook.noun; //let actor = action.actor; let thing = (action.getNoun(0)); if (thing instanceof Person) { action.say = new Say("It doesn't look like ", new SayHeSheIt(thing), " wants to talk."); } else { action.say = new Say("How are you going to talk to that?") } } }); public getCommandText () { return "talk to " + (this.getNoun(0) != undefined ? this.getNoun(0).getPrintedName() : ""); } } Elements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule( { name : "Hyperlink - Talk", firstPriority : Rule.PRIORITY_HIGHEST, code : (rulebook : RulebookRunner) => { let thing = rulebook.noun; if (thing instanceof Person && thing.getRoom() == WorldState.player.getRoom()) { Elements.HyperlinkHandler.addAvailableAction("Talk", new ActionTalk(WorldState.player, thing)); } } } ));