{"version":3,"file":"Application.js","sourceRoot":"","sources":["../app/Functions.ts","../app/Controls/Controls.ts","../app/Controls/Modules/KeyHandler.ts","../app/Elements/Elements.ts","../app/Elements/Modules/CurrentTurnHandler.ts","../app/Controls/Modules/Links.ts","../app/World/Classes/Rulebook.ts","../app/World/Settings.ts","../app/World/Classes/Rule.ts","../app/Elements/Classes/Say/OneOf.ts","../app/Elements/Classes/Say/SayImage.ts","../app/Elements/Classes/Say.ts","../app/Elements/Classes/Say/SayAn.ts","../app/Elements/Classes/Say/SayBold.ts","../app/Elements/Classes/Say/SayIf.ts","../app/Elements/Modules/AppearanceHandler.ts","../app/Elements/Modules/FontSize.ts","../app/Elements/Modules/HoverInfo.ts","../app/Elements/Modules/HyperlinkHandler.ts","../app/World/Classes/Action.ts","../app/World/Classes/Action/ActionExamine.ts","../app/World/Classes/Relation.ts","../app/World/Classes/Relations/RelationOneToMany.ts","../app/World/Classes/Thing.ts","../app/World/Classes/Action/ActionTake.ts","../app/World/Classes/Action/ActionGo.ts","../app/Elements/Modules/RoomHandler.ts","../app/World/Classes/Things/CoinPouch.ts","../app/Elements/Modules/InventoryHandler.ts","../app/World/Classes/Action/ActionRetrace.ts","../app/Elements/Modules/RememberedHandler.ts","../app/World/Classes/AI.ts","../app/World/Classes/Skills.ts","../app/World/Classes/Things/Person.ts","../app/World/EveryTurn.ts","../app/World/PlayBegins.ts","../app/World/Tests.ts","../app/World/TurnSequence.ts","../app/World/Classes/Room.ts","../app/World/Classes/Things/MapNote.ts","../app/World/Classes/Things/Bodypart.ts","../app/World/Classes/Things/Bodypart/SexStick.ts","../app/World/Classes/Things/Bodypart/SexHole.ts","../app/World/Classes/Measure.ts","../app/World/Classes/Things/Bodypart/Humanoid/HumanoidParts.ts","../app/World/Classes/Things/Clothing.ts","../app/World/Classes/Action/ActionRemove.ts","../app/World/Classes/Action/ActionWear.ts","../app/World/Classes/Things/Humanoid/Humanoid.ts","../app/World/Classes/Things/Humanoid/HumanoidGenders.ts","../app/World/WorldState.ts","../app/World/Classes/Conversation.ts","../app/World/Classes/Dialogue.ts","../app/World/Classes/Region.ts","../app/World/Classes/Shuffler.ts","../app/World/Classes/Action/ActionDrop.ts","../app/World/Classes/Action/ActionWait.ts","../app/World/Classes/Dialogue/BranchingOptions.ts","../app/World/Classes/RandomDungeons/RoomRandom.ts","../app/World/Classes/RandomDungeons/RoomRandomMap.ts","../app/World/Classes/RandomDungeons/RoomRandomFodder.ts","../app/World/Classes/RandomDungeons/RegionRandom.ts","../app/World/Classes/Save/StoredVariable.ts","../app/World/Classes/Things/Liquid.ts","../app/World/Classes/Things/Scenery.ts","../app/World/Classes/Things/ThingDefiningGender.ts","../app/World/Classes/Things/ThingDefiningSluttiness.ts","../app/World/Classes/Things/Liquids/Semen.ts"],"names":[],"mappings":"AAKA,qBAAqB,CAAc;IAC/B,KAAI,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAC1B,KAAI,IAAI,CAAC,GAAC,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAC5B,IAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACZ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SACxB;KACJ;IACD,OAAO,CAAC,CAAC;AACb,CAAC;AAED,6BAA6B,CAAc;IACvC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACd,WAAW,CAAC,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,CAAC;AACb,CAAC;AElBD,IAAO,QAAQ,CAyGd;AAzGD,WAAO,QAAQ;IAAC,IAAA,UAAU,CAyGzB;IAzGe,WAAA,UAAU;QACtB,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE;YAC3C,IAAI,EAAE,CAAC,IAAI,IAAI,OAAO,EA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CAAC,CAAC;gBAEH,WAAW,CAAC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC;aACvD;YAGD,IAAI,WAAW,CAAC,KAAK,CAAC,UAAS,OAAO,EAAE,KAAK,EAAE,KAAK;gBAC5C,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;YAChC,CAAC,CAAC,EAAE;gBACJ,OAAO,OAAO,CAAC;aAClB;SACJ;IACL,CAAC;CACJ,CAAC,CAAC;ACzHP,aAAc,SAAQ,KAAK;IAA3B;;QACW,iBAAY,GAAG,IAAI,CAAC;QACpB,YAAO,GAAG,IAAI,CAAC;IAC1B,CAAC;CAAA;AGFD,WAAY,SAAQ,MAAM;IAGtB,YAAoB,MAAe,EAAE,OAAuB;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ","sourcesContent":["/**\r\n * Makes the array a have unique elements.\r\n * WARNING: WILL ALTER THE ARRAY GIVEN\r\n * @param a\r\n */\r\nfunction arrayUnique(a : Array) {\r\n for(var i=0; i) {\r\n a = a.slice();\r\n arrayUnique(a);\r\n return a;\r\n}","module Controls {\r\n\r\n}","/// \r\nmodule Controls.KeyHandler {\r\n window.addEventListener(\"keydown\", function (ev) {\r\n if (ev.code == \"Space\") {\r\n Elements.CurrentTurnHandler.scrollSpace();\r\n return;\r\n }\r\n\r\n let ele;\r\n\r\n Elements.getLinkElements().some((element : HTMLElement) => {\r\n let keyables = element.getElementsByClassName(\"keyable\");\r\n for (let i = 0; i < keyables.length; i++) {\r\n if (( keyables[i]).dataset['shortcutcode'] == ev.code) {\r\n ele = keyables[i];\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n\r\n if (ele != undefined) {\r\n ele.click();\r\n }\r\n });\r\n\r\n export var keyCodes1 : Array> = [\r\n [\"Digit1\", \"1\"],\r\n [\"Digit2\", \"2\"],\r\n [\"Digit3\", \"3\"],\r\n [\"Digit4\", \"4\"],\r\n [\"Digit5\", \"5\"]\r\n ];\r\n\r\n export var keyCodes2 : Array> = [\r\n [\"KeyQ\", \"Q\"],\r\n [\"KeyW\", \"W\"],\r\n [\"KeyE\", \"E\"],\r\n [\"KeyR\", \"R\"],\r\n [\"KeyT\", \"T\"]\r\n ];\r\n\r\n export var keyCodes3 : Array> = [\r\n [\"KeyF\", \"F\"],\r\n [\"KeyV\", \"V\"],\r\n [\"KeyG\", \"G\"],\r\n [\"KeyB\", \"B\"]\r\n ];\r\n\r\n export var keyCodeNorth = [\"KeyS\", \"S\"];\r\n export var keyCodeEast = [\"KeyC\", \"C\"];\r\n export var keyCodeSouth = [\"KeyX\", \"X\"];\r\n export var keyCodeWest = [\"KeyZ\", \"Z\"];\r\n export var keyCodeUp = [\"KeyA\", \"A\"];\r\n export var keyCodeDown = [\"KeyD\", \"D\"];\r\n export var directionCodeByIndex = [keyCodeNorth, undefined, keyCodeEast, undefined,\r\n keyCodeSouth, undefined, keyCodeWest, undefined, keyCodeUp, keyCodeDown];\r\n\r\n export var available1 : Array> = [];\r\n export var available2 : Array> = [];\r\n export var available3 : Array> = [];\r\n\r\n export function reset () {\r\n available1 = keyCodes1.slice();\r\n available2 = keyCodes2.slice();\r\n available3 = keyCodes3.slice();\r\n }\r\n\r\n export function applyCode (element : HTMLElement, code : Array) {\r\n if (code == undefined) {\r\n delete(element.dataset['shortcut'])\r\n delete(element.dataset['shortcutcode']);\r\n element.classList.remove(\"keyable\");\r\n } else {\r\n element.dataset['shortcutcode'] = code[0];\r\n element.dataset['shortcut'] = code[1];\r\n element.classList.add(\"keyable\");\r\n }\r\n }\r\n\r\n export function getFirstKeyCode () {\r\n let chosen = available1.length > 0 ? available1 :\r\n available2.length > 0 ? available2 :\r\n available3.length > 0 ? available3 : undefined;\r\n if (chosen != undefined) {\r\n return chosen.splice(0, 1)[0];\r\n }\r\n return undefined;\r\n }\r\n\r\n export function getSecondKeyCode () {\r\n let chosen = available2.length > 0 ? available2 :\r\n available3.length > 0 ? available3 : undefined;\r\n if (chosen != undefined) {\r\n return chosen.splice(0, 1)[0];\r\n }\r\n return undefined;\r\n }\r\n\r\n export function getThirdKeyCode () {\r\n let chosen = available3.length > 0 ? available3 : undefined;\r\n if (chosen != undefined) {\r\n return chosen.splice(0, 1)[0];\r\n }\r\n return undefined;\r\n }\r\n}","module Elements {\r\n export var animationTime = 1000;\r\n export var isMobile = /Mobi/i.test(navigator.userAgent); // This correctly lets Mobile users who requested the Desktop app or are on a sufficiently big tablet to get the right desktop version\r\n\r\n export var screenWidth = document.body.clientWidth;\r\n export var screenHeight = document.body.clientHeight;\r\n\r\n export function getLinkElements () {\r\n if (CurrentTurnHandler == undefined) return [];\r\n if (CurrentTurnHandler.isTurn()) {\r\n return [CurrentTurnHandler.currentTurnTab];\r\n } else {\r\n return [HyperlinkHandler.linkedActionsTab, RoomHandler.currentRoomTab, HyperlinkHandler.commonActionsTab];\r\n }\r\n }\r\n\r\n export function updateScreenSize () {\r\n screenWidth = document.body.clientWidth;\r\n screenHeight = document.body.clientHeight;\r\n }\r\n}\r\n\r\nwindow.addEventListener(\"resize\", function () {\r\n Elements.updateScreenSize();\r\n});","/// \r\nmodule Elements.CurrentTurnHandler {\r\n export var mainPage = document.getElementById(\"mainPage\");\r\n export var currentTurnTab = document.getElementById(\"currentTurnTab\");\r\n export var currentTurn = document.getElementById(\"currentTurn\");\r\n export var turnHr = document.createElement(\"p\");\r\n export var lastReadOffset = currentTurnTab.clientHeight / 2;\r\n turnHr.classList.add(\"turnStart\");\r\n turnHr.appendChild(document.createTextNode(\"Start of Turn\"));\r\n\r\n /**\r\n * Creates the \"Start of Turn\" elements and scrolls the content panel until the start of the new turn.\r\n */\r\n export function startTurn (action? : Action) {\r\n\r\n let oldContent = currentTurnTab.getElementsByClassName(\"content\");\r\n for (let i = 0; i < oldContent.length; i++) {\r\n oldContent[i].classList.add(\"contentOld\");\r\n oldContent[i].classList.remove(\"content\");\r\n }\r\n\r\n currentTurnTab.appendChild(turnHr);\r\n\r\n mainPage.classList.add(\"turn\");\r\n\r\n scrollToNewTurn();\r\n }\r\n\r\n /**\r\n * Are we in the middle of a turn?\r\n */\r\n export function isTurn () {\r\n return mainPage.classList.contains(\"turn\");\r\n }\r\n\r\n /**\r\n * Removes the blur effect around the turn panel\r\n */\r\n export function endTurn () {\r\n mainPage.classList.remove(\"turn\");\r\n }\r\n\r\n /**\r\n * Prints given Say directly\r\n * @param say\r\n */\r\n export async function printAsContent (say : Say) {\r\n await say.getHTML(\"p\", [\"content\"]).then(value => {\r\n print(...value);\r\n });\r\n }\r\n\r\n /**\r\n * Creates a say for sayValues and then prints it as content.\r\n * @param sayValues\r\n */\r\n export function simplePrint (...sayValues : Array) : Promise {\r\n return printAsContent(new Say(...sayValues));\r\n }\r\n\r\n export function printAsError (msg : Say | string) {\r\n if (msg instanceof Say) {\r\n msg.getHTML(\"div\", [\"error\"], true).then(value => {\r\n print(...value);\r\n });\r\n } else {\r\n let div = document.createElement(\"div\");\r\n div.classList.add(\"error\");\r\n div.appendChild(document.createTextNode(msg));\r\n print(div);\r\n }\r\n }\r\n\r\n /**\r\n * Includes the given elements as content.\r\n * This is the only correct way of printing elements.\r\n * @param elements\r\n */\r\n export function print (...elements : Array) {\r\n if(elements.length > 0) {\r\n elements.forEach((element) => {\r\n currentTurnTab.appendChild(element);\r\n });\r\n\r\n scrollTo(lastReadOffset);\r\n }\r\n }\r\n\r\n /**\r\n * Removes elements that have been printed in the past.\r\n * @param elements\r\n */\r\n export function unprint (...elements : Array) {\r\n elements.forEach((element) => {\r\n if (element.parentElement == currentTurnTab) {\r\n currentTurnTab.removeChild(element);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Scrolls to the first current turn element. (Or rather, to just after the Start of Turn element)\r\n * This is used internally as a new turn begins.\r\n */\r\n export function scrollToNewTurn () {\r\n let target = turnHr.offsetTop + turnHr.offsetHeight;\r\n lastReadOffset = target;\r\n\r\n //turnHr.scrollIntoView({behavior : \"smooth\", block : \"start\"});\r\n if (target < currentTurn.scrollTop) {\r\n return; // We don't want to scroll UP.\r\n }\r\n\r\n scrollTo(target);\r\n }\r\n\r\n /**\r\n * Scrolls to the very bottom of the content panel.\r\n */\r\n export function scrollToBottom () {\r\n scrollTo(currentTurn.scrollHeight - currentTurn.clientHeight);\r\n }\r\n\r\n /**\r\n * Scroll half a screen forward\r\n */\r\n export function scrollSpace () {\r\n scrollTo(currentTurn.scrollTop + (currentTurn.clientHeight / 2));\r\n }\r\n\r\n /**\r\n * Update text that was read as player scrolls\r\n */\r\n currentTurn.addEventListener(\"scroll\", () => {\r\n let currentRead = currentTurn.scrollTop + currentTurn.clientHeight;\r\n if (currentRead > lastReadOffset) {\r\n lastReadOffset = currentRead;\r\n }\r\n });\r\n\r\n\r\n /**\r\n * Animation... removing jquery\r\n */\r\n var startOffset : number;\r\n var targetOffset : number;\r\n var startTime : number;\r\n var finishTime : number;\r\n var totalTime : number;\r\n var animationRequest : number;\r\n\r\n export function scrollTo (offset : number) {\r\n if (offset <= lastReadOffset) {\r\n startOffset = currentTurn.scrollTop;\r\n targetOffset = offset;\r\n startTime = new Date().getTime();\r\n finishTime = startTime + Elements.animationTime;\r\n totalTime = finishTime - startTime;\r\n startScrolling();\r\n }\r\n }\r\n\r\n export function startScrolling () {\r\n if (animationRequest == undefined) {\r\n animationRequest = requestAnimationFrame(updateFrame);\r\n }\r\n }\r\n\r\n export let updateFrame = () => {\r\n animationRequest = undefined;\r\n\r\n let movingOffset = (targetOffset - startOffset);\r\n let timePassed = new Date().getTime() - startTime;\r\n let idealOffset = movingOffset * (timePassed / totalTime);\r\n\r\n let maxScroll = currentTurn.scrollHeight - currentTurn.clientHeight;\r\n\r\n currentTurn.scrollTop = startOffset + idealOffset;\r\n\r\n if (currentTurn.scrollTop < targetOffset && currentTurn.scrollTop < maxScroll) {\r\n startScrolling();\r\n }\r\n }\r\n}","/// \r\nmodule Controls.Links {\r\n export function makeLink (element : Element, action : Action) {\r\n element.addEventListener(\"mouseover\", () => {\r\n Elements.HyperlinkHandler.hoverAction(action);\r\n });\r\n\r\n element.addEventListener(\"mouseout\", () => {\r\n Elements.HyperlinkHandler.unhoverAction();\r\n });\r\n\r\n element.addEventListener(\"click\", () => {\r\n TurnSequence.execute(action);\r\n Elements.HyperlinkHandler.unhoverAction();\r\n });\r\n }\r\n}","/// \r\ninterface RulebookOptions {\r\n noun? : T;\r\n}\r\n\r\n/**\r\n * Without the Runner, Rulebooks were not \"thread-safe\", so we need the runner.\r\n */\r\nclass RulebookRunner {\r\n public noun : T;\r\n private rulesToExecute : Array = [];\r\n public rulebook : Rulebook;\r\n public rule : Rule;\r\n private ruleRunner : number = -1;\r\n\r\n public constructor (rulebook : Rulebook, noun : T) {\r\n this.rulebook = rulebook;\r\n this.noun = noun;\r\n }\r\n\r\n public addRulebooks (...rulebooks : Array>) {\r\n rulebooks = arrayUniqueNewArray(rulebooks);\r\n rulebooks.forEach((rulebook) => {\r\n this.addRules(...rulebook.rules);\r\n });\r\n }\r\n\r\n public addRules (...rules) {\r\n if (this.ruleRunner < 0) {\r\n this.rulesToExecute.push(...rules);\r\n }\r\n }\r\n\r\n public skipRule (rule : Rule) {\r\n if (this.ruleRunner >= 0) {\r\n let index = this.rulesToExecute.indexOf(rule);\r\n if (index > this.ruleRunner) {\r\n this.rulesToExecute.splice(index, 1);\r\n console.debug(\"[Rulebook]\" + this.rulebook.name + \", skipping Rule \" + rule.name + \" due to request.\");\r\n } else {\r\n console.warn(\"[Rulebook]\" + this.rulebook.name + \": uname to skip Rule\" + rule.name + \" due to it being too late to stop it.\");\r\n }\r\n }\r\n }\r\n\r\n public async execute () {\r\n arrayUnique(this.rulesToExecute).sort(function (a: Rule, b: Rule) {\r\n return a.compareTo(b);\r\n });\r\n\r\n for (this.ruleRunner = 0; this.ruleRunner < this.rulesToExecute.length; this.ruleRunner++) {\r\n this.rule = this.rulesToExecute[this.ruleRunner];\r\n let promise = this.rule.execute(this);\r\n let promiseResult;\r\n\r\n await promise.then((result) => {\r\n promiseResult = result;\r\n });\r\n\r\n if (promiseResult != undefined) {\r\n return promiseResult;\r\n }\r\n }\r\n }\r\n}\r\n\r\nclass Rulebook {\r\n public rules : Array = [];\r\n public name : string;\r\n public static indentation = 0;\r\n public static rulebookStack : Array | Rule> = [];\r\n\r\n public static getIndentation () {\r\n return \" \".repeat(Rulebook.indentation);\r\n }\r\n\r\n public static increaseIndentation (rulebook : Rulebook | Rule) {\r\n Rulebook.rulebookStack.push(rulebook);\r\n Rulebook.indentation += 4;\r\n }\r\n\r\n public static decreaseIndentation () {\r\n Rulebook.rulebookStack.pop();\r\n Rulebook.indentation -= 4;\r\n }\r\n\r\n public static isRunning (r : Rule | Rulebook) {\r\n return Rulebook.rulebookStack.indexOf(r) != -1;\r\n }\r\n\r\n public isRunning () {\r\n return Rulebook.isRunning(this);\r\n }\r\n\r\n public constructor (name : string) {\r\n this.name = name;\r\n }\r\n\r\n public async execute (options : RulebookOptions, ...rulebooks) : Promise{\r\n options = options == undefined ? {} : options;\r\n\r\n let runner = new RulebookRunner(this, options.noun); // duplicate array\r\n runner.addRulebooks(this, ...rulebooks);\r\n\r\n var names = [];\r\n for (let i = 0; i < rulebooks.length; i++) {\r\n if (rulebooks[i] === this) continue;\r\n names.push(rulebooks[i].name);\r\n }\r\n\r\n console.debug(Rulebook.getIndentation() + \"[RULEBOOK] \" + this.name + (names.length > 0 ? (\" merged with \" + names.join(\", \")) : \"\"));\r\n Rulebook.increaseIndentation(this);\r\n\r\n let result;\r\n await runner.execute().then(value => {\r\n result = value;\r\n });\r\n\r\n Rulebook.decreaseIndentation();\r\n return result;\r\n }\r\n\r\n public createAndAddRule (r : RuleOptions) {\r\n let rule = new Rule(r);\r\n this.addRule(rule);\r\n return rule;\r\n }\r\n\r\n public addRule (r : Rule) {\r\n this.rules.push(r);\r\n }\r\n\r\n public sortRules () {\r\n this.rules.sort(function (a : Rule, b : Rule) {\r\n return a.compareTo(b);\r\n });\r\n }\r\n}","module Settings {\r\n var debug = console.debug;\r\n var debugEmpty = () => {};\r\n\r\n export var hardDebug = false;\r\n\r\n export function setDebug (isDebug : boolean) {\r\n if (isDebug) {\r\n console.debug = debug;\r\n } else {\r\n console.debug = debugEmpty;\r\n }\r\n }\r\n\r\n export function setHardDebug (isHardDebug : boolean) {\r\n hardDebug = isHardDebug;\r\n }\r\n}","/// \r\ninterface RuleOptions {\r\n name : string;\r\n firstPriority? : number;\r\n priority? : number;\r\n code : (runner? : RulebookRunner) => (Promise | any);\r\n conditions? : (runner? : RulebookRunner) => (boolean);\r\n}\r\n\r\nclass Rule {\r\n private _priority : number = 0;\r\n public firstPriority : number = 0;\r\n public name : string;\r\n\r\n private code : Function;\r\n private result : boolean;\r\n private createdWhere : Error;\r\n private conditions : (rulebook? : RulebookRunner) => (boolean);\r\n\r\n public constructor (options : RuleOptions) {\r\n this.priority = options.priority != undefined ? options.priority : Rule.PRIORITY_MEDIUM;\r\n this.firstPriority = options.firstPriority != undefined ? options.firstPriority : Rule.PRIORITY_MEDIUM;\r\n this.name = options.name;\r\n this.code = options.code;\r\n this.createdWhere = (new Error());\r\n\r\n this.conditions = options.conditions != undefined ? options.conditions : () => { return true; };\r\n }\r\n\r\n public async execute (rulebook? : RulebookRunner) : Promise {\r\n if (!this.conditions(rulebook)) {\r\n return;\r\n }\r\n console.debug(Rulebook.getIndentation() + \"[RULE] \" + this.name);\r\n Settings.hardDebug && console.debug(this.name, this.createdWhere);\r\n Rulebook.increaseIndentation(this);\r\n this.result = undefined;\r\n\r\n rulebook.rule = this;\r\n let result = this.code(rulebook);\r\n // Was the function async?\r\n if (result instanceof Promise) {\r\n await result.then((innerResult) => {\r\n result = innerResult;\r\n });\r\n }\r\n\r\n if (result != undefined) {\r\n console.debug(Rulebook.getIndentation() + \"Result:\", result);\r\n }\r\n\r\n Rulebook.decreaseIndentation();\r\n\r\n return result;\r\n }\r\n\r\n get priority(): number {\r\n return this._priority;\r\n }\r\n\r\n set priority(value: number) {\r\n this._priority = value;\r\n }\r\n\r\n public compareTo (b : Rule) {\r\n var a = this;\r\n // Higher priority goes first as this is a rolling array\r\n if (b.firstPriority < a.firstPriority) return -1;\r\n if (a.firstPriority < b.firstPriority) return 1;\r\n if (b.priority < a.priority) return -1;\r\n if (a.priority < b.priority) return 1;\r\n return 0;\r\n }\r\n\r\n public static PRIORITY_HIGHEST : number = 20;\r\n public static PRIORITY_HIGH : number = 15;\r\n public static PRIORITY_MEDIUM : number = 10;\r\n public static PRIORITY_LOW : number = 5;\r\n public static PRIORITY_LOWEST : number = 0;\r\n}\r\n\r\n// var goblinJumpingRule = new Rule({\r\n// name : \"Goblin Jumping Rule\",\r\n// code : async (rule : Rule, ruleResolver : Function) => {\r\n// console.debug(\"weee\");\r\n// }\r\n// });\r\n//\r\n// goblinJumpingRule.execute();\r\n\r\n/**\r\n var goblinJumpingRule = new Rule({name : \"Goblin Jumping Rule\", code : (function () {\r\n return function () {\r\n // this is now the Rule and has access to this.currentRulebook\r\n // If there is no need for own module, it's okay to use a simple function\r\n // IF YOUR FUNCTION SHOULD NOT COMPLETE AUTOMATICALLY, IT NEEDS TO RETURN FALSE\r\n // FUNCTIONS THAT RETURN ANYTHING ELSE WILL AUTO COMPLETE AT THE END OF THEIR CODE\r\n\r\n // If your rule does not auto-complete, then it must complete manually, or the game will STALL.\r\n\r\n // If a rule must return either \"true\" or \"false\" to the rulebook, you need to set the rule's result that way:\r\n // this.result = true (or false)\r\n };\r\n })()});\r\n */","/// \r\nclass OneOf {\r\n private possibilities = [];\r\n private availablePossibilites;\r\n private randomMode : number;\r\n\r\n public static PURELY_AT_RANDOM : number = 0;\r\n public static ROTATING_RANDOM : number = 1;\r\n public static CYCLING : number = 2;\r\n\r\n private cyclingOrder : number = 0;\r\n\r\n public constructor (randomMode : number, ...poss : Array) {\r\n this.randomMode = randomMode;\r\n this.possibilities = poss;\r\n\r\n if (this.randomMode == OneOf.ROTATING_RANDOM) {\r\n this.availablePossibilites = this.possibilities.slice();\r\n }\r\n }\r\n\r\n public getOne () {\r\n if (this.randomMode == OneOf.PURELY_AT_RANDOM) {\r\n return this.possibilities[Math.floor(Math.random() * this.possibilities.length)];\r\n } else if (this.randomMode == OneOf.ROTATING_RANDOM) {\r\n if (this.availablePossibilites.length < 1) {\r\n this.availablePossibilites = this.possibilities.slice();\r\n }\r\n return this.availablePossibilites.splice(Math.floor(Math.random() * this.availablePossibilites.length), 1)[0]\r\n } else if (this.randomMode == OneOf.CYCLING) {\r\n var r = this.possibilities[this.cyclingOrder++];\r\n if (this.cyclingOrder > this.possibilities.length) {\r\n this.cyclingOrder = 0;\r\n }\r\n return r;\r\n }\r\n }\r\n}","/// \nclass SayImage implements PrintableElement {\n private imgName : string;\n\n private isImageDefined () {\n for(var i = 0; i < document.styleSheets.length; i++) {\n var rules = document.styleSheets[i]['rules'] || document.styleSheets[i]['cssRules'];\n for(var x in rules) {\n if(typeof rules[x].selectorText == 'string' && rules[x].selectorText == \".\" + this.imgName) {\n return true;\n }\n }\n }\n return false;\n }\n\n public constructor (imgName : string) {\n this.imgName = imgName;\n }\n\n public getImageElement () : Element {\n let img = document.createElement(\"div\");\n if (this.isImageDefined()) {\n img.classList.add(this.imgName);\n } else {\n img.classList.add(\"error\");\n img.appendChild(document.createTextNode(\"Image \\\"\" + this.imgName + \"\\\" not found.\"));\n }\n return img;\n }\n\n public getPrintedElement () {\n return [this.getImageElement()];\n }\n}","/// \n/// \n/// \n/// \n\ninterface Printable {\n getPrintedName () : string;\n}\n\ninterface PrintableElement {\n getPrintedElement () : Array;\n}\n\ninterface SayNoun {\n say : Say;\n noun : any;\n}\n\nclass SayableObject {}\n\nclass Say {\n public sequence : Array = [];\n public skipbreaks : boolean = false;\n\n public static LINE_BREAK : Object = new SayableObject();\n public static PARAGRAPH_BREAK : Object = new SayableObject();\n public static RUN_PARAGRAPH : Object = new SayableObject();\n public static RUN_PARAGRAPH_OFF : Object = new SayableObject();\n public static DO_PARAGRAPH_BREAK = 1;\n public static DO_LINE_BREAK = 2;\n\n public constructor (...objs) {\n this.add(...objs);\n }\n\n public add (...objs : Array string)>) {\n this.sequence.push(...objs);\n }\n\n public remove (...objs) {\n for (let i = 0; i < objs.length; i++) {\n let index = this.sequence.indexOf(objs[i]);\n if (index >= 0) {\n this.sequence.splice(index, 1);\n }\n }\n }\n\n public isEmpty () {\n return this.sequence.length < 1;\n }\n\n public paragraphs : Array>;\n public currentParagraph : Array;\n public sequenceRunner : number;\n\n // TODO: Create a single function to get the element of anything\n public async getTextOf (index : number, seq : any) : Promise {\n let elements;\n await this.getElementFor(index, seq).then((value) => {\n elements = value;\n });\n\n let div = document.createElement(\"div\");\n for (let i = 0; i < elements.length; i++) {\n if (typeof elements[i] != \"number\") {\n div.appendChild(elements[i]);\n }\n }\n return div.innerText;\n }\n\n public doLineBreak () {\n if (this.currentParagraph.length > 0 && !this.skipbreaks) {\n let br = document.createElement(\"br\");\n br.classList.add(\"linebreak\");\n let ti = document.createElement(\"span\");\n ti.classList.add(\"textIndenter\");\n this.currentParagraph.push(br, ti);\n }\n }\n\n public doParagraphBreak () {\n if (this.currentParagraph.length > 0 && !this.skipbreaks) {\n this.paragraphs.push(this.currentParagraph);\n this.currentParagraph = [];\n }\n }\n\n public async getParagraphs () : Promise>> {\n this.paragraphs = [];\n this.currentParagraph = [];\n this.skipbreaks = false;\n\n for (this.sequenceRunner = 0; this.sequenceRunner < this.sequence.length; this.sequenceRunner++) {\n let seq = this.sequence[this.sequenceRunner];\n if (seq instanceof OneOf) {\n seq = seq.getOne();\n }\n\n if (seq == Say.LINE_BREAK) {\n this.doLineBreak();\n } else if (seq == Say.PARAGRAPH_BREAK) {\n this.doParagraphBreak();\n } else if (seq == Say.RUN_PARAGRAPH) {\n this.skipbreaks = true;\n } else if (seq == Say.RUN_PARAGRAPH_OFF) {\n this.skipbreaks = false;\n } else {\n let elements;\n await this.getElementFor(this.sequenceRunner, seq).then(value => {\n elements = value;\n });\n for (let i = 0; i < elements.length; i++) {\n if (elements[i] === Say.DO_LINE_BREAK) {\n this.doLineBreak();\n } else if (elements[i] === Say.DO_PARAGRAPH_BREAK) {\n this.doParagraphBreak();\n } else {\n this.currentParagraph.push(elements[i]);\n }\n }\n }\n }\n\n // TODO: Remove line break + text indenter if they are the last in the say\n if (this.currentParagraph.length > 0) {\n this.paragraphs.push(this.currentParagraph);\n }\n\n return this.paragraphs;\n }\n\n public async getElementFor (index : number, obj : Say | OneOf | Object | Printable | string | number | String | ((say : Say) => string)) : Promise> {\n if (typeof obj == \"string\" || obj instanceof String) {\n return [document.createTextNode( obj)];\n } else if (typeof obj == \"number\" || obj instanceof Number) {\n return [document.createTextNode((parseFloat(( obj).toFixed(2))/1).toString())];\n } else if (typeof obj == \"function\") {\n let elements;\n await this.getElementFor(-1, obj(this)).then(value => {\n elements = value;\n });\n return elements;\n } else if (obj instanceof SayImage) {\n return [obj.getImageElement()];\n } else if (obj instanceof Say) {\n let elements = [];\n await obj.getPureElements(this).then((value : Array) => {\n elements.push(...value);\n });\n return elements;\n } else if (obj instanceof Object) {\n let promise = this.printName(obj);\n let elements = [];\n await promise.then(value => {\n elements.push(...value);\n });\n return elements;\n }\n }\n\n public async getPureElements (say? : Say) : Promise> {\n let promise = this.getParagraphs();\n let paragraphs;\n await promise.then(value => {\n paragraphs = value;\n });\n return paragraphs.length == 1 ? paragraphs[0] : Array.prototype.concat.apply([], paragraphs);\n }\n\n public async getHTML (tagName : string, classList : Array, singleParagraph? : boolean) : Promise> {\n let promise = this.getParagraphs();\n let paragraphs;\n await promise.then(value => {\n paragraphs = value;\n });\n\n // Reduce to single paragraph\n if (singleParagraph == true && paragraphs.length > 1) {\n paragraphs = [Array.prototype.concat.apply([], paragraphs)];\n }\n\n let elements = [];\n\n\n for (let i = 0, paragraph = paragraphs[i]; paragraph != undefined; paragraph = paragraphs[++i]) {\n let parent = document.createElement(tagName);\n if (classList.length > 0) {\n parent.classList.add(...classList);\n }\n\n for (let k = 0, ele = paragraph[k]; ele!= undefined; ele = paragraph[++k]) {\n parent.appendChild(ele);\n }\n elements.push(parent);\n }\n\n return elements;\n }\n\n public getHTMLContent () : Promise> {\n return this.getHTML(\"p\", [\"content\"]);\n }\n\n public static beforePrinting = new Rulebook(\"Before printing the name of something\");\n public static printing = new Rulebook(\"Printing the name of something\");\n public static afterPrinting = new Rulebook(\"After printing the name of something\");\n\n public currentNoun : any;\n public currentNounElements : Array;\n\n public async printName (thing : any) : Promise> {\n this.currentNoun = thing;\n this.currentNounElements = [];\n let before = Say.beforePrinting.execute({noun : this});\n await before;\n let print = Say.printing.execute({noun : this});\n await print;\n let after = Say.afterPrinting.execute({noun : this});\n await after;\n return this.currentNounElements;\n }\n\n public static hisHersIts (target : Thing, startOfSentence? : boolean) {\n let result : String;\n if (target == WorldState.player) {\n result = \"your\";\n } else if (target instanceof Person) {\n // TODO: Figure out whether target is male or female\n result = \"his\";\n } else {\n result = \"its\";\n }\n if (startOfSentence == true) {\n result = result.charAt(0).toUpperCase() + result.substr(1, result.length -1);\n }\n return result;\n }\n}\n\nSay.printing.addRule(new Rule({\n name : \"Printing the name of a Printable Element\",\n firstPriority : Rule.PRIORITY_LOW,\n code : (rulebook : RulebookRunner) => {\n let say = rulebook.noun;\n if (( say.currentNoun).getPrintedElement) {\n say.currentNounElements.push(...( say.currentNoun).getPrintedElement());\n return true; // We only want to print something once, so return true to stop others from running\n }\n }\n}));\n\nSay.printing.addRule(new Rule({\n name : \"Printing the name of a Printable\",\n firstPriority : Rule.PRIORITY_LOW,\n code : (rulebook : RulebookRunner) => {\n let say = rulebook.noun;\n if (( say.currentNoun).getPrintedName) {\n let thingEle = document.createTextNode(\n ( say.currentNoun).getPrintedName()\n );\n say.currentNounElements.push(thingEle);\n return true; // We only want to print something once, so return true to stop others from running\n }\n }\n}));\n\nSay.printing.addRule(new Rule({\n name : \"Printing the name of an unknown object\",\n firstPriority : Rule.PRIORITY_LOWEST,\n priority : Rule.PRIORITY_LOWEST,\n code : (rulebook : RulebookRunner) => {\n let say = rulebook.noun;\n if (( say.currentNoun).getPrintedName) {\n say.currentNounElements.push(\n (document.createTextNode(( say.currentNoun).toString()))\n );\n return true; // We only want to print something once, so return true to stop others from running\n }\n }\n}));\n\n// var msg = new Say (\"Hello! Welcome to The Obelisk! This is a game with \", johnTheOgre, \" so you must be careful!\");\n//\n// var otherSay = new Say (msg, \"Will have to learn how to handle dots.\");","class SayAn extends Say {\n private node = document.createTextNode(\"a \");\n private uppercase = true;\n\n public constructor (autoUppercase? : boolean) {\n super();\n if (autoUppercase != undefined) {\n this.uppercase = autoUppercase;\n }\n }\n\n public async getPureElements (say : Say) : Promise> {\n let next = say.sequence[say.sequenceRunner + 1];\n if (next == undefined) {\n this.node.nodeValue = \"\";\n } else {\n if (next instanceof Thing && (( next).unique)) {\n if (!( next).properlyNamed) {\n this.node.nodeValue = \"the \";\n } else {\n this.node.nodeValue = \"\";\n }\n } else {\n await say.getTextOf(say.sequenceRunner + 1, next).then((value) => {\n let aan = AvsAn.query(value.trim());\n if (aan.prefix != \"\") { // avoid \"a 52 coins\"\n this.node.nodeValue = aan.article + \" \";\n }\n });\n }\n\n if (this.uppercase && say.currentParagraph.length == 0) {\n this.node.nodeValue = this.node.nodeValue.charAt(0).toUpperCase()\n + this.node.nodeValue.substr(1, this.node.nodeValue.length - 1);\n }\n }\n return [this.node];\n }\n}\n\n//by Eamon Nerbonne (from http://home.nerbonne.org/A-vs-An), Apache 2.0 license\nvar AvsAn = (function () {\n var dict = \"p3ezz;4wrlg;2h;#2rg;22;2;a;7;;if;z;;&4h;1c;1;N;6;;*yp;6a;4;a2;q;;e1;q;;i1;h;;o;7;;/op;5n;9;a3;i;;e5;h;;h;;1;o5;;;i;r;;l;;1;/;6;;n;;1;o6;;;o1;a;;r;;1;e7;;;s;;1;/2;j;;09pa;y3;1;8e;10;;17qoq;qmm;2;12hp;7nw;a;0o4;45;1;0n;2w;;15r;1n;2;8;7;;9;5;;28s;x;;34q;z;1;7;5;;45n;n;;598;w;;65k;u;;74j;y;;850;y;;93x;g;;81ux;hgk;a;0zb;el;a;0p;4h;;11;16;;21;10;;32;15;;4;18;;54;v;;6;12;;7;s;;8;v;;9;17;;11k;bq;1; v;2;;229;f3;2; 1a;3;;–5;;;31x;jc;1; 12;2;;41w;kq;2; z;4;;–5;;;559;sp;5; 2k;1;;,h;;;h7;;;kd;;;m6;;;62p;rm;2; 1b;5;;k5;;;72n;y6;2; 14;;;–5;;;82r;192;2; 19;4;;,5;;;93i;1ig;2; 10;4;;–5;;;8ys;nsu;;=n[1]?\"a\":\"an\"\n }\n dict = dict.substr(1 + a.join(';').length);\n for (var i = 0; i < n[2]; i++)\n dict = fill(prefix + dict[0], node[dict[0]] = {}, dict.substr(1));\n return dict;\n }\n fill(\"\", root, dict);\n return {\n raw: root,\n //Usage example: AvsAn.query(\"example \")\n //Note that the terminal space indicates this is a complete word - this is sometimes significant, particularly for acronyms!\n //returns: {\n // prefix: \"e\", //the prefix sufficient to determine the article\n // aCount: 9682, //the number of times \"a\" was seen for this prefix\n // anCount: 1028246, //the number of times \"an\" was seen for this prefix\n // article: \"an\", //the most common article\n //}\n query: function (word) {\n\n var node : any = root, sI = 0, result, c;\n do {\n c = word[sI++];\n } while ('\"‘’“”$\\'-('.indexOf(c) >= 0);//also terminates on end-of-string \"undefined\".\n\n while (1) {\n result = node.data || result;\n node = node[c];\n if (!node) return result;\n c = word[sI++] || \" \";\n }\n }\n };\n})();","/// \r\nclass SayBold extends Say {\r\n public async getPureElements () : Promise> {\r\n let promise = this.getParagraphs();\r\n let paragraphs;\r\n await promise.then(value => {\r\n paragraphs = value;\r\n });\r\n\r\n let elements = paragraphs.length == 1 ? paragraphs[0] : Array.prototype.concat.apply([], paragraphs);\r\n\r\n let b = document.createElement(\"b\");\r\n elements.forEach((element) => {\r\n b.appendChild(element);\r\n });\r\n return [b];\r\n }\r\n}","/// \r\nclass SayIf extends Say {\r\n private condition : () => boolean;\r\n public constructor (condition : () => boolean, ...objs : Array) {\r\n super(...objs);\r\n this.condition = condition != undefined ? condition : () => { return true; };\r\n }\r\n\r\n public async getPureElements () : Promise> {\r\n if (this.condition()) {\r\n let promise = this.getParagraphs();\r\n let paragraphs;\r\n await promise.then(value => {\r\n paragraphs = value;\r\n });\r\n return paragraphs.length == 1 ? paragraphs[0] : Array.prototype.concat.apply([], paragraphs);\r\n }\r\n return [];\r\n }\r\n}","/// \r\nmodule Elements.AppearanceHandler {\r\n var target = document.getElementById(\"appearanceTarget\");\r\n\r\n function empty () {\r\n while (target.firstChild) {\r\n target.removeChild(target.firstChild);\r\n }\r\n }\r\n\r\n export async function print (say : Say) {\r\n await say.getHTML(\"p\", [\"appearanceDescription\"]).then(value => {\r\n for (let i = 0; i < value.length; i++) {\r\n target.appendChild(value[i]);\r\n }\r\n });\r\n }\r\n\r\n export async function updateAppearance () {\r\n empty();\r\n let player: Humanoid = WorldState.player;\r\n\r\n let playerGender = player.getGenderValue();\r\n let playerSluttiness = player.getSluttiness();\r\n let playerTop = player.getTopClothOn(Humanoid.SLOT_BREASTS);\r\n let playerBottom = player.getTopClothOn(Humanoid.SLOT_LEG_UPPER);\r\n let playerShoes = player.getTopClothOn(Humanoid.SLOT_FEET);\r\n\r\n let presentation = new Say(\"You are presenting as \", new SayAn(),);\r\n\r\n if (playerSluttiness.sluttinessCorrected > 70) {\r\n presentation.add(\"slutty, \");\r\n } else if (playerSluttiness.sluttinessCorrected > 45) {\r\n\r\n } else if (playerSluttiness.sluttinessCorrected > 20) {\r\n presentation.add(\"prude, \");\r\n } else {\r\n presentation.add(\"saintly, \");\r\n }\r\n\r\n if (playerGender.hasTits) {\r\n if (playerGender.hasPenis) {\r\n // Shemale Status (Tits + Penis)\r\n if (playerGender.genderValueCorrected < 40) {\r\n presentation.add(\"masculine shemale.\");\r\n } else if (playerGender.genderValueCorrected < 60) {\r\n presentation.add(\"androgynous shemale.\");\r\n } else {\r\n presentation.add(\"feminine shemale.\");\r\n }\r\n } else if (playerGender.hasPenisBulge) {\r\n // Possible Shemale status - has bulge and tits maybe get better terms sometime\r\n if (playerGender.genderValueCorrected < 40) {\r\n presentation.add(\"masculine shemale.\");\r\n } else if (playerGender.genderValueCorrected < 60) {\r\n presentation.add(\"androgynous shemale.\");\r\n } else {\r\n presentation.add(\"feminine shemale.\");\r\n }\r\n } else if (playerGender.hasVagina) {\r\n // is a woman\r\n if (playerGender.genderValueCorrected < 40) {\r\n presentation.add(\"masculine woman.\");\r\n } else if (playerGender.genderValueCorrected < 60) {\r\n presentation.add(\"androgynous woman.\");\r\n } else {\r\n presentation.add(\"feminine woman.\");\r\n }\r\n }\r\n } else {\r\n // No tits\r\n if (playerGender.hasPenis) {\r\n // Shemale Status (Tits + Penis)\r\n if (playerGender.genderValueCorrected < 40) {\r\n presentation.add(\"masculine man.\");\r\n } else if (playerGender.genderValueCorrected < 60) {\r\n presentation.add(\"androgynous man.\");\r\n } else {\r\n presentation.add(\"feminine trap.\");\r\n }\r\n } else if (playerGender.hasPenisBulge) {\r\n // Possible Shemale status - has bulge and tits maybe get better terms sometime\r\n if (playerGender.genderValueCorrected < 40) {\r\n presentation.add(\"masculine man.\");\r\n } else if (playerGender.genderValueCorrected < 60) {\r\n presentation.add(\"androgynous man.\");\r\n } else {\r\n presentation.add(\"feminine trap.\");\r\n }\r\n } else if (playerGender.hasVagina) {\r\n // is a woman\r\n if (playerGender.genderValueCorrected < 40) {\r\n presentation.add(\"masculine woman.\");\r\n } else if (playerGender.genderValueCorrected < 60) {\r\n presentation.add(\"androgynous woman.\");\r\n } else {\r\n presentation.add(\"feminine woman.\");\r\n }\r\n }\r\n }\r\n\r\n if (playerSluttiness.naked) {\r\n presentation.add(\" You are naked.\");\r\n } else if (playerSluttiness.halfNaked) {\r\n presentation.add(\" You are almost naked.\");\r\n }\r\n\r\n let tits = Thing.PartRelation.getRightTypeOne(player, HumanoidBreasts);\r\n let penis = Thing.PartRelation.getRightTypeOne(player, HumanoidPenis);\r\n let bulges = player.getBulges();\r\n\r\n presentation.add(Say.PARAGRAPH_BREAK, new SayBold(\"Gender Value: \"), playerGender.genderValueCorrected);\r\n presentation.add(Say.PARAGRAPH_BREAK, new SayBold(\"Sluttiness Value: \"), playerSluttiness.sluttinessCorrected);\r\n presentation.add(Say.PARAGRAPH_BREAK, new SayBold(\"Breasts: \"), tits.getSizeText(), \" (Visible as \" + HumanoidBreasts.getSizeText(bulges.breasts) + \")\");\r\n\r\n if (penis == undefined) {\r\n if (bulges.crotch > 0) {\r\n presentation.add(Say.PARAGRAPH_BREAK, \"You have \", new SayAn(), HumanoidPenis.getSizeText(bulges.crotch) + \" bulge visible on your crotch.\");\r\n }\r\n } else {\r\n presentation.add(Say.PARAGRAPH_BREAK, new SayBold(\"Dick: \"), penis.getSizeText(), \" (Visible as \", new SayAn(), + HumanoidPenis.getSizeText(bulges.crotch) + \")\");\r\n }\r\n\r\n await print(presentation);\r\n }\r\n}","/// \r\n\r\n/**\r\n * Update font sizes according to screen resolution and/or mobile status\r\n */\r\nfunction updateFontSize () {\r\n var minWidth = Elements.isMobile? 800 : 1280;\r\n var proportion = Elements.isMobile ? 17 : 14.5;\r\n var width = document.body.clientWidth < minWidth ? minWidth : document.body.clientWidth;\r\n document.documentElement.style[ \"font-size\" ] = (width * proportion / 1280) + \"px\";\r\n}\r\n\r\nupdateFontSize();\r\nwindow.addEventListener(\"resize\", updateFontSize);","/// \r\nmodule Elements.HoverInfo {\r\n var hoverbox = document.getElementById(\"hoverInfo\");\r\n var contentTarget = document.getElementById(\"hoverContent\");\r\n var width = 0;\r\n var height = 0;\r\n\r\n function empty () {\r\n while (contentTarget.firstChild != undefined) {\r\n contentTarget.removeChild(contentTarget.firstChild);\r\n }\r\n }\r\n\r\n export function makeHoverable (element : Element, contents : Array) {\r\n element.addEventListener(\"mouseenter\", (e : MouseEvent) => {\r\n Elements.HoverInfo.hoverStart(e, contents);\r\n });\r\n\r\n element.addEventListener(\"mousemove\", (e : MouseEvent) => {\r\n Elements.HoverInfo.hoverMove(e);\r\n });\r\n\r\n element.addEventListener(\"mouseout\", (e : MouseEvent) => {\r\n Elements.HoverInfo.hoverEnd();\r\n });\r\n }\r\n\r\n export function hoverStart (e : MouseEvent, contents : Array) {\r\n empty();\r\n for (let i = 0; i < contents.length; i++) {\r\n contentTarget.appendChild(contents[i]);\r\n }\r\n hoverbox.style.display = \"block\";\r\n\r\n\r\n hoverbox.style.left = \"0px\";\r\n hoverbox.style.top = \"0px\";\r\n width = hoverbox.offsetWidth;\r\n height = hoverbox.offsetHeight;\r\n\r\n hoverMove(e);\r\n }\r\n\r\n export function hoverMove (e : MouseEvent) {\r\n let left = e.clientX - (width/2);\r\n let top = e.clientY - (height) - 6;\r\n\r\n if (top < 0) {\r\n top = e.clientY + 6;\r\n }\r\n\r\n if (left < width) {\r\n left = width;\r\n }\r\n\r\n // Width seems to not be considering the border, even though we applied border-box\r\n // I don't care enough to figure this out so there's a margin on the side!\r\n if (left + width > Elements.screenWidth) {\r\n left = Elements.screenWidth - width;\r\n }\r\n\r\n hoverbox.style.left = Math.round(left) + \"px\";\r\n hoverbox.style.top = Math.round(top) + \"px\";\r\n }\r\n\r\n export function hoverEnd () {\r\n hoverbox.style.display = \"none\";\r\n }\r\n}","/// \r\n/// \r\nmodule Elements.HyperlinkHandler {\r\n export var linkedActionsTab = document.getElementById(\"linkActions\");\r\n export var commonActionsTab = document.getElementById(\"commonActionsTab\");\r\n\r\n var currentCommand = document.createTextNode(\"\");\r\n document.getElementById(\"currentCommand\").appendChild(currentCommand);\r\n\r\n var currentActionTarget = document.createTextNode(\"\");\r\n document.getElementById(\"linkTarget\").appendChild(currentActionTarget);\r\n\r\n var commonActions = [];\r\n var availableActions = [];\r\n\r\n export function resetCommonActions () {\r\n commonActions.splice(0, commonActions.length);\r\n while (commonActionsTab.firstChild) {\r\n commonActionsTab.removeChild(commonActionsTab.firstChild);\r\n }\r\n }\r\n\r\n export function addCommonAction (name : string, action : Action) {\r\n commonActions.push([name, action]);\r\n }\r\n\r\n function resetAvailableActions () {\r\n availableActions = [];\r\n currentActionTarget.nodeValue = \"\";\r\n while (linkedActionsTab.firstChild) {\r\n linkedActionsTab.removeChild(linkedActionsTab.firstChild);\r\n }\r\n }\r\n\r\n export function addAvailableAction (name : string, action : Action) {\r\n availableActions.push([name, action]);\r\n }\r\n\r\n export function hoverAction (action : Action) {\r\n currentCommand.nodeValue = action.getCommandText().toLowerCase();\r\n }\r\n\r\n export function unhoverAction () {\r\n currentCommand.nodeValue = \"\";\r\n }\r\n\r\n export async function hyperlinkObject (thing? : any) {\r\n resetAvailableActions();\r\n if (thing instanceof Thing) {\r\n let promise = HyperlinkingRulebook.execute({noun: thing});\r\n await promise.then(value => {});\r\n\r\n currentActionTarget.nodeValue = thing.getPrintedName() + \": \";\r\n\r\n for (let i = 0, value = availableActions[i]; value != undefined; value = availableActions[++i]) {\r\n let link = createLink(value);\r\n link.classList.add(\"columnLink\");\r\n Controls.KeyHandler.applyCode(link, Controls.KeyHandler.getSecondKeyCode());\r\n linkedActionsTab.appendChild(link);\r\n }\r\n }\r\n }\r\n\r\n function createLink (value : Array) {\r\n let link = document.createElement(\"a\");\r\n link.appendChild(document.createTextNode(value[0]));\r\n Controls.Links.makeLink(link, value[1]);\r\n return link;\r\n }\r\n\r\n export async function hyperlinkCommonActions () {\r\n resetCommonActions();\r\n\r\n let promise = CommonActionsRulebook.execute({});\r\n await promise.then(value => {});\r\n\r\n for (let i = 0, value = commonActions[i]; value != undefined; value = commonActions[++i]) {\r\n let link = createLink(value);\r\n link.classList.add(\"lineLink\");\r\n Controls.KeyHandler.applyCode(link, Controls.KeyHandler.getThirdKeyCode());\r\n commonActionsTab.appendChild(link);\r\n }\r\n }\r\n\r\n /**\r\n * The hyperlinking rulebook is ran over the last thing the player interacted with.\r\n * It populates the hyperlinks tab with information on the thing that was interacted with.\r\n * @type {Rulebook}\r\n */\r\n export var HyperlinkingRulebook = new Rulebook(\"Hyperlinking something\");\r\n\r\n /**\r\n * The common actions rulebook serves to set up all the available common actions for the player.\r\n * It should check the player's current state to see if a command is applicable and\r\n * then ADD said command to the HyperlinkHandler.\r\n * @type {Rulebook}\r\n */\r\n export var CommonActionsRulebook = new Rulebook(\"Common Actions Rulebook\");\r\n}","/// \r\n/// \r\n/// \r\nclass Action {\r\n public static check = new Rulebook(\"Check any Action\");\r\n public static carry = new Rulebook(\"Carry out any Action\");\r\n\r\n public extraChecks : Array> = [];\r\n public extraCarries : Array> = [];\r\n\r\n public _actor : Thing;\r\n public nouns : Array = [];\r\n public say : Say = new Say();\r\n\r\n public actingAgressively = false;\r\n public actingSubmissively = false;\r\n public requiresTurn = true;\r\n public requiresNoun = true;\r\n public requiresVisibility = true; // First noun must be visible and in the same room\r\n\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n this.actor = actor;\r\n nouns.forEach((value, index, array) => {\r\n this.setNoun(index, value);\r\n });\r\n }\r\n\r\n\r\n public async execute () : Promise {\r\n this.say = new Say();\r\n\r\n /**\r\n * Check if action goes through\r\n */\r\n let promise = Action.check.execute({\r\n noun : this\r\n }, ...this.extraChecks);\r\n\r\n let result;\r\n await promise.then((r) => {result = r});\r\n\r\n // Either True or Undefined\r\n if (result == false) {\r\n return;\r\n }\r\n\r\n /**\r\n * Carry Out\r\n */\r\n promise = Action.carry.execute({\r\n noun : this\r\n }, ...this.extraCarries);\r\n\r\n await promise.then(() => {}); // Result is meaningless for carry out\r\n\r\n return this.say;\r\n }\r\n\r\n get actor(): Thing {\r\n return this._actor;\r\n }\r\n\r\n set actor(value: Thing) {\r\n this._actor = value;\r\n }\r\n\r\n public getNoun (n : number) : any {\r\n if (this.nouns.length > n) {\r\n return this.nouns[n];\r\n }\r\n return undefined;\r\n }\r\n\r\n public setNoun (n : number, noun : any) {\r\n while (this.nouns.length < n) {\r\n this.nouns.push(undefined);\r\n }\r\n this.nouns[n] = noun;\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {string}\r\n */\r\n public getCommandText () {\r\n return \"do\";\r\n }\r\n\r\n /**\r\n * If an action is stopped, it means it failed so spectacularly that it didn't even begin.\r\n * Which means if the player is doing it, it'll not take a turn.\r\n */\r\n public stop () {\r\n this.requiresTurn = false;\r\n }\r\n}\r\n\r\n// Action.addCarryRule(new Rule({\r\n// name : \"Testing say in actions rule\",\r\n// priority : Rule.PRIORITY_LOWEST,\r\n// firstPriority : Rule.PRIORITY_LOWEST,\r\n// code : (rule, rulebook) => {\r\n// let action = rulebook.noun;\r\n// action.say.add(\"You do nothing all turn. What was the point, really?\");\r\n// }\r\n// }))\r\n\r\nAction.check.addRule(\r\n new Rule({\r\n name : \"Check any Action - Requires Noun\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n if (action.getNoun(0) == undefined) {\r\n return false;\r\n }\r\n },\r\n conditions : runner => {\r\n return runner.noun.requiresNoun;\r\n }\r\n })\r\n);\r\n\r\nAction.check.addRule(\r\n new Rule({\r\n name : \"Check any Action - Requires Visibility\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n if (!action.getNoun(0).isVisibleTo(actor)) {\r\n return false;\r\n }\r\n },\r\n conditions : runner => {\r\n return runner.noun.requiresVisibility;\r\n }\r\n })\r\n);","/// \r\n/// \r\n/// \r\n/// \r\n\r\nclass ActionExamine extends Action {\r\n public requiresTurn = false;\r\n\r\n public static check = new Rulebook(\"Check Examining\");\r\n public static carry = new Rulebook(\"Carry out Examining\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n super(actor, ...nouns);\r\n this.extraChecks.push(ActionExamine.check);\r\n this.extraCarries.push(ActionExamine.carry);\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {Say}\r\n */\r\n public getCommandText () {\r\n return \"examine \" + (this.getNoun(0) != undefined ? this.getNoun(0).getPrintedName() : \"\");\r\n }\r\n\r\n public static PrintDescriptionOfExaminedThingRule = ActionExamine.carry.createAndAddRule({\r\n name : \"Examine - Print Description of Examined Thing\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n\r\n action.say.add(new SayBold(action.getNoun(0), \": \"));\r\n action.say.add(( action.getNoun(0)).getPrintedDescription());\r\n }\r\n });\r\n}","abstract class RelationHandler {\r\n protected relations : Array;\r\n\r\n public constructor (...relations : Array ) {\r\n relations.forEach(relation => {\r\n relation.setHandler(this);\r\n });\r\n this.relations = relations;\r\n }\r\n\r\n public addRelation (relation : Relation) {\r\n this.relations.push(relation);\r\n relation.setHandler(this);\r\n }\r\n\r\n public abstract setRelation (relation : Relation, left : any, right : any, value? : any) : boolean;\r\n}\r\n\r\nabstract class Relation {\r\n public handler : RelationHandler;\r\n\r\n public setHandler (handler : RelationHandler) {\r\n this.handler = handler;\r\n }\r\n\r\n public hasHandler () {\r\n return this.handler != undefined;\r\n }\r\n\r\n public abstract setRelation (left : any, right : any, value? : any) : void;\r\n public abstract unsetRight (right : any) : void;\r\n public abstract unsetLeft (left : any) : void;\r\n public abstract getLeft (right : any) : any;\r\n public abstract getRight (left : any) : any;\r\n\r\n public static createString (obj1 : any, obj2 : any) : string {\r\n if (obj1 instanceof Object && obj2 instanceof Object) {\r\n let id1 = Relation.getId(obj1);\r\n let id2 = Relation.getId(obj2);\r\n return id1 < id2 ?\r\n (id1 + \";\" + id2) :\r\n (id2 + \";\" + id1);\r\n }\r\n }\r\n\r\n private static objectCount = 0;\r\n private static objectIdField = \"_RELATIONINTERNALID\";\r\n\r\n /**\r\n * if getId >= 0, then obj is NOT an Object\r\n * if getId < 0, then obj is an Object\r\n * @param obj\r\n * @returns {number}\r\n */\r\n public static getId (obj : Object) : number {\r\n if (obj[Relation.objectIdField] == undefined) {\r\n obj[Relation.objectIdField] = Relation.objectCount++;\r\n }\r\n return obj[Relation.objectIdField];\r\n }\r\n}","/// \r\n/// \r\nclass RelationHandlerStrictOneToMany extends RelationHandler {\r\n\r\n public setRelation (relation : Relation, left : any, right : any, value? : any) : boolean {\r\n // a LEFT must not circle in on itself\r\n // Is right any of the left's parents?\r\n let parents = this.getAllLeft(left);\r\n if (parents.indexOf(right) != -1) {\r\n console.warn(\"[Relation] Attempt to create a circular relation:\", this, left, right);\r\n return false; // Allowing this would create a circular relation\r\n }\r\n\r\n // from this point on we'll guarantee that the new relation can be made.\r\n // Changes will occur, so \"return false\" is no longer acceptable.\r\n // a RIGHT can only point to a single LEFT\r\n this.unsetRight(right);\r\n\r\n return true;\r\n }\r\n\r\n public unset (thing : any) {\r\n this.unsetLeft(thing);\r\n this.unsetRight(thing);\r\n }\r\n\r\n public unsetLeft (left: any) {\r\n this.relations.forEach(relation => {\r\n relation.unsetLeft(left);\r\n });\r\n }\r\n\r\n public unsetRight (right : any) {\r\n this.relations.forEach(relation => {\r\n relation.unsetRight(right);\r\n });\r\n }\r\n\r\n // A many can only have one one\r\n public getLeft (right : any) {\r\n let result;\r\n for (let i = 0; i < this.relations.length; i++) {\r\n result = this.relations[i].getLeft(right);\r\n if (result != undefined) {\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This returns all ones that are relevant.\r\n * So in a relationship like A -> B -> C and asking for C, this will return\r\n * B because it's related to C and then A because that's related to B.\r\n * @param right\r\n * @returns {Array}\r\n */\r\n public getAllLeft (right : any) {\r\n let newParent = this.getLeft(right);\r\n let parents = [];\r\n while (newParent != undefined ) {\r\n parents.push(newParent);\r\n newParent = this.getLeft(newParent);\r\n }\r\n return parents;\r\n }\r\n\r\n public getAllLeftType (right : any, type : any) {\r\n return this.getAllLeft(right).filter(left => {\r\n return left instanceof type;\r\n });\r\n }\r\n\r\n /**\r\n * Returns the highest One that can be found.\r\n * for A -> B -> C and asking for C, this would return A\r\n * as that's the one \"originating\" the other relations.\r\n * @param right\r\n * @returns {any}\r\n */\r\n public getLastLeft (right : any) {\r\n let parent = this.getLeft(right);\r\n let newParent = this.getLeft(parent);\r\n while (newParent != undefined) {\r\n parent = newParent;\r\n newParent = this.getLeft(parent);\r\n }\r\n return parent;\r\n }\r\n\r\n public getAllRight (left : any) {\r\n let rights = [];\r\n this.relations.forEach(relation => {\r\n rights.push(...relation.getRight(left));\r\n });\r\n arrayUnique(rights);\r\n return rights;\r\n }\r\n\r\n public getAllRightTypes (left : any, rightType : any) {\r\n return this.getAllRight(left).filter(right => {\r\n return right instanceof rightType;\r\n });\r\n }\r\n}\r\n\r\nclass RelationOneToMany extends Relation {\r\n private valuesHash : {[idid : string] : any} = {};\r\n private oneMap = new Map>();\r\n private manyMap = new Map();\r\n\r\n public getValue (left : any, right : any) {\r\n return this.valuesHash[Relation.createString(left, right)];\r\n }\r\n\r\n /**\r\n * Only relationships between Objets can have values\r\n * @param left\r\n * @param right\r\n * @param value\r\n */\r\n public setValue (left : any, right : any, value : any) {\r\n if (this.manyMap.get(right) == left) {\r\n let string = Relation.createString(left, right);\r\n if (string != undefined) {\r\n this.valuesHash[string] = value;\r\n }\r\n }\r\n }\r\n\r\n public setRelation (left : any, right : any, value? : any) {\r\n let proceed;\r\n if (this.handler != undefined) {\r\n proceed = this.handler.setRelation(this, left, right, value);\r\n }\r\n\r\n if (proceed) {\r\n // something on the left can't be on the right\r\n this.unsetRight(left);\r\n\r\n // something on the right can't be on the left\r\n this.unsetLeft(right);\r\n\r\n // something on the right can only have one left\r\n this.unsetRight(right);\r\n\r\n let string = Relation.createString(left, right);\r\n if (string != undefined) {\r\n this.valuesHash[string] = value;\r\n }\r\n this.manyMap.set(right, left);\r\n if (this.oneMap.get(left) == undefined) {\r\n this.oneMap.set(left, [right]);\r\n } else {\r\n this.oneMap.get(left).push(right);\r\n }\r\n }\r\n }\r\n\r\n public getLeft (right : any) {\r\n return this.manyMap.get(right);\r\n }\r\n\r\n public getAnyRight () {\r\n let rights = [];\r\n this.oneMap.forEach((value) => {\r\n rights.push(...value);\r\n });\r\n arrayUnique(rights);\r\n return rights;\r\n }\r\n\r\n public getAnyRightType (type : any) {\r\n return this.getAnyRight().filter(value => {\r\n return value instanceof type;\r\n });\r\n }\r\n\r\n public isRight (left : any, needle : any) {\r\n let right = this.oneMap.get(left);\r\n if (right != undefined) {\r\n return right.indexOf(needle) != -1;\r\n }\r\n return false;\r\n }\r\n\r\n public getRight (left : any) {\r\n let right = this.oneMap.get(left);\r\n if (right != undefined) {\r\n return [].concat(...right);\r\n }\r\n return [];\r\n }\r\n\r\n public getRightType (left : any, type : any) {\r\n return this.getRight(left).filter(right => {\r\n return right instanceof type;\r\n });\r\n }\r\n\r\n public getRightTypeOne (left : any, type : any) {\r\n let rights = this.getRightType(left, type);\r\n if (rights.length > 0) {\r\n return rights[0];\r\n }\r\n }\r\n\r\n public getRelationValue (left : any, right : any) {\r\n return this.valuesHash[Relation.createString(left, right)];\r\n }\r\n\r\n public unsetRight (right : any) {\r\n let left = this.manyMap.get(right);\r\n if (left != undefined) {\r\n let allRight = this.oneMap.get(left);\r\n allRight.splice(allRight.indexOf(right), 1);\r\n this.manyMap.delete(right);\r\n if (allRight.length == 0) {\r\n this.oneMap.delete(left);\r\n }\r\n let string = Relation.createString(left, right);\r\n if (string != undefined) {\r\n delete(this.valuesHash[string]);\r\n }\r\n }\r\n }\r\n\r\n public unsetLeft (left : any) {\r\n let allRight = this.oneMap.get(left);\r\n if (allRight != undefined) {\r\n allRight.forEach((right : any) => {\r\n this.manyMap.delete(right);\r\n let string = Relation.createString(left, right);\r\n if (string != undefined) {\r\n delete(this.valuesHash[string]);\r\n }\r\n });\r\n this.oneMap.delete(left);\r\n }\r\n }\r\n}","/// \r\n/// \r\n\r\ninterface ThingOptions {\r\n name? : string;\r\n properName? : string;\r\n description? : Say | any;\r\n unique? : boolean;\r\n}\r\n\r\n// A thing is something that exists in the World\r\nclass Thing implements Printable {\r\n protected name : string;\r\n public properlyNamed : boolean = false;\r\n\r\n public scenery : boolean = false;\r\n public fixedInPlace : boolean = false;\r\n public animated : boolean = false;\r\n public visible : boolean = true;\r\n public unique : boolean = false;\r\n\r\n public description : Say;\r\n\r\n public static uniqueThings : {[id : string] : Thing} = {};\r\n\r\n public constructor (options? : ThingOptions) {\r\n options = options == undefined ? {} : options;\r\n\r\n if (options.properName != undefined) {\r\n this.name = options.properName;\r\n this.properlyNamed = true;\r\n } else if (options.name != undefined) {\r\n this.name = options.name;\r\n } else {\r\n this.name = ( this.constructor).name; // If there is no name, use Class as name\r\n }\r\n\r\n if (options.description != undefined) {\r\n if (options.description instanceof Say) {\r\n this.description = options.description;\r\n } else {\r\n this.description = new Say(options.description);\r\n }\r\n }\r\n\r\n if (options.unique) {\r\n Thing.storeUnique(this);\r\n this.unique = true;\r\n }\r\n }\r\n\r\n public static storeUnique (unique : Thing) {\r\n if (Thing.uniqueThings[unique.name] != undefined) {\r\n console.log(unique.name, Thing.uniqueThings[unique.name], new Error(\"Unique Thing Already Exists\"));\r\n } else {\r\n Thing.uniqueThings[unique.name] = unique;\r\n }\r\n }\r\n\r\n public getPrintedName() {\r\n return this.name;\r\n }\r\n\r\n public getPrintedDescription () {\r\n if (this.description == undefined) {\r\n return new Say (\"You see nothing special about \" + (this instanceof Person ? \"\" : \"the \"), new Say(this), \".\");\r\n } else {\r\n return this.description;\r\n }\r\n }\r\n\r\n public static InsideRoomRelation : RelationOneToMany= new RelationOneToMany();\r\n public static PartRelation = new RelationOneToMany();\r\n public static CarryRelation = new RelationOneToMany();\r\n public static WieldRelation = new RelationOneToMany();\r\n public static WearRelation = new RelationOneToMany();\r\n public static EnclosedRelation = new RelationHandlerStrictOneToMany(Thing.InsideRoomRelation, Thing.PartRelation, Thing.CarryRelation, Thing.WieldRelation, Thing.WearRelation);\r\n\r\n public getPartOne () {\r\n return Thing.PartRelation.getLeft(this);\r\n }\r\n\r\n public getCarryOne () {\r\n return Thing.CarryRelation.getLeft(this);\r\n }\r\n\r\n public getWieldOne () {\r\n return Thing.WieldRelation.getLeft(this);\r\n }\r\n\r\n public getWearOne () {\r\n return Thing.WearRelation.getLeft(this);\r\n }\r\n\r\n public getEnclosedOne () : Thing | Room {\r\n return Thing.EnclosedRelation.getLeft(this);\r\n }\r\n\r\n public getParts (partType? : any) {\r\n if (partType != undefined) {\r\n return Thing.PartRelation.getRightType(this, partType);\r\n }\r\n return Thing.PartRelation.getRight(this);\r\n }\r\n\r\n // Will usually return the room at which this is.\r\n // Will return the highest parent if that parent is out of world.\r\n public getHighestEnclosedOne () : Thing | Room {\r\n return Thing.EnclosedRelation.getLastLeft(this);\r\n }\r\n\r\n public getHighestEnclosedOneNotRoom () : Thing {\r\n let parent = Thing.EnclosedRelation.getLeft(this);\r\n if (parent != undefined) {\r\n let newParent = Thing.EnclosedRelation.getLeft(parent);\r\n while (newParent != undefined) {\r\n parent = newParent;\r\n newParent = Thing.EnclosedRelation.getLeft(parent);\r\n }\r\n return parent;\r\n }\r\n return this;\r\n }\r\n\r\n public getRoom () : Room {\r\n var partOf = Thing.EnclosedRelation.getLeft(this);\r\n if (partOf instanceof Room) {\r\n return partOf;\r\n } else if (partOf instanceof Thing) {\r\n return partOf.getRoom();\r\n }\r\n }\r\n\r\n public removeFromRoom () {\r\n this.getRoom().remove(this);\r\n }\r\n\r\n public isVisibleTo (thing : Thing) {\r\n // Either in the same room or part of /wielded / carried by person\r\n return (this.getRoom() == thing.getRoom() && this.visible);\r\n // TODO : Update this code for the cases where a creature is not visible but the observer can see them anyway\r\n }\r\n\r\n public isPlayer () {\r\n return false;\r\n }\r\n\r\n public addParts (...parts : Array) {\r\n parts.forEach(part => {\r\n Thing.PartRelation.setRelation(this, part);\r\n });\r\n }\r\n\r\n /**\r\n * So long as a thing is in a relation, it can't be garbage cleaned.\r\n * If you're throwing a thing away, do run destroy.\r\n * Warning: this will also destroy everything that's below it.\r\n */\r\n public destroy () {\r\n let relatedRight = Thing.EnclosedRelation.getAllRight(this);\r\n relatedRight.push(this);\r\n relatedRight.forEach(related => {\r\n Thing.EnclosedRelation.unset(related);\r\n });\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nclass ActionTake extends Action {\r\n public static check : Rulebook = new Rulebook(\"Check Taking\");\r\n public static carry : Rulebook = new Rulebook(\"Carry out Taking\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n super(actor, ...nouns);\r\n this.extraChecks.push(ActionTake.check);\r\n this.extraCarries.push(ActionTake.carry);\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {Say}\r\n */\r\n public getCommandText () {\r\n return \"take \" + (this.getNoun(0) != undefined ? this.getNoun(0).getPrintedName() : \"\");\r\n }\r\n\r\n public static defaultCarryTakingRule = new Rule({\r\n name : \"Taking - Add the thing to your inventory\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n\r\n if (thing.getEnclosedOne() != undefined) {\r\n // Remove Part Of, Carried or Wielded. It's essentially stealing.\r\n Thing.EnclosedRelation.unsetRight(thing);\r\n } else {\r\n thing.removeFromRoom();\r\n }\r\n\r\n Thing.CarryRelation.setRelation(actor, action.getNoun(0));\r\n\r\n if (actor == WorldState.player) {\r\n action.say.add(new SayBold(( action.getNoun(0)).getPrintedName() + \": \"), \"Taken.\");\r\n } else {\r\n action.say.add(actor.getPrintedName() + \" takes \" + ( action.getNoun(0)).getPrintedName());\r\n }\r\n }\r\n });\r\n}\r\n\r\nActionTake.check.addRule(\r\n new Rule({\r\n name : \"Check Taking - Who has it, really?\",\r\n priority : Rule.PRIORITY_HIGHEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n let owner = thing.getEnclosedOne();\r\n\r\n if (owner == actor){\r\n if (owner == WorldState.player) {\r\n action.say.add(\"You already have it.\");\r\n }\r\n return false;\r\n }\r\n }\r\n })\r\n);\r\n\r\nActionTake.check.addRule(\r\n new Rule({\r\n name : \"Check Taking - Donut steal\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n let owner = thing.getEnclosedOne();\r\n\r\n if (owner != undefined && owner.animated){\r\n if (actor == WorldState.player) {\r\n action.say.add(owner.getPrintedName() + \" wouldn't like that.\");\r\n }\r\n return false;\r\n }\r\n }\r\n })\r\n);\r\n\r\nActionTake.check.addRule(\r\n new Rule({\r\n name : \"Check Taking - Can't take fixed in place\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n\r\n if (thing.fixedInPlace){\r\n if (actor == WorldState.player) {\r\n action.say.add(\"You can't take that.\");\r\n }\r\n return false;\r\n }\r\n }\r\n })\r\n);\r\n\r\nActionTake.carry.addRule(\r\n ActionTake.defaultCarryTakingRule\r\n);\r\n\r\nElements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule(\r\n {\r\n name : \"Hyperlink - Take\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let thing = rulebook.noun;\r\n\r\n if (!thing.animated && !thing.fixedInPlace && thing.getRoom() == WorldState.player.getRoom() && thing.getEnclosedOne() instanceof Room) {\r\n Elements.HyperlinkHandler.addAvailableAction(\"Take\", new ActionTake(WorldState.player, thing));\r\n }\r\n }\r\n }\r\n));","/// \r\n/// \r\n/// \r\n\r\nclass ActionGo extends Action {\r\n public static check = new Rulebook(\"Check Going\");\r\n public static carry = new Rulebook(\"Carry out Going\");\r\n\r\n public roomGoneFrom : Room;\r\n public roomGoneTo : Room;\r\n public originalTarget : Room | number;\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n super(actor, ...nouns);\r\n this.originalTarget = nouns[0];\r\n this.extraChecks.push(ActionGo.check);\r\n this.extraCarries.push(ActionGo.carry);\r\n this.requiresNoun = false;\r\n this.requiresVisibility = false;\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {string}\r\n */\r\n public getCommandText () {\r\n let name;\r\n if (typeof this.originalTarget == \"number\") {\r\n name = Room.DIRECTIONS_NAMES[this.originalTarget];\r\n } else if (this.originalTarget instanceof Room) {\r\n name = \"to \" + ( this.originalTarget).getPrintedName();\r\n }\r\n return \"go \" + name;\r\n }\r\n\r\n public static ruleCheckRestoreOriginalNoun = ActionGo.check.createAndAddRule({\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n priority : Rule.PRIORITY_HIGHEST,\r\n name : \"Check Going - Restore original noun\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n action.setNoun(0, action.originalTarget);\r\n }\r\n });\r\n\r\n public static ruleCheckIsthereactor = ActionGo.check.createAndAddRule({\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n priority : Rule.PRIORITY_HIGHEST,\r\n name : \"Check Going - Is there an actor?\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n if (action.actor == undefined) {\r\n return false; // Rule fails\r\n }\r\n }\r\n });\r\n\r\n public static ruleCheckConvertRoomToDirection = ActionGo.check.createAndAddRule({\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n priority : Rule.PRIORITY_HIGH,\r\n name : \"Change Room to Direction\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n\r\n // Someone asked for a room...\r\n if (action.getNoun(0) instanceof RoomRandom) {\r\n let actor = action.actor;\r\n let cRoom = actor.getRoom();\r\n if (cRoom instanceof RoomRandom) {\r\n let dRoom = action.getNoun(0);\r\n\r\n if (cRoom == dRoom) {\r\n if (actor.isPlayer()) {\r\n action.say.add(\"You are already there!\");\r\n }\r\n return false;\r\n }\r\n\r\n let code;\r\n\r\n if (actor == WorldState.player) {\r\n code = (room: Room) => {\r\n return WorldState.isRoomRemembered(room);\r\n }\r\n }\r\n\r\n let direction = cRoom.getAStarBestDirectionTo(dRoom, code);\r\n if (direction == undefined) {\r\n if (actor.isPlayer()) {\r\n action.say.add(\"You don't remember how to get there.\");\r\n }\r\n return false;\r\n } else {\r\n action.setNoun(0, direction);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n\r\n public static ruleCheckIstheredirectionandroom = ActionGo.check.createAndAddRule({\r\n name : \"Check Going - is there a direction? Does it lead anywhere?\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n let cRoom = action.actor.getRoom();\r\n if (cRoom == undefined) {\r\n return false; // Rule fails, actor is out of world\r\n }\r\n let direction = action.getNoun(0);\r\n if (direction == undefined) {\r\n return false; // Rule fails, no direction\r\n }\r\n let nextRoom = cRoom.connections[direction];\r\n if (nextRoom == undefined) {\r\n return false; // Rule fails, can't go direction that doesn't have a room\r\n }\r\n\r\n action.roomGoneFrom = action.actor.getRoom();\r\n action.roomGoneTo = nextRoom;\r\n }\r\n });\r\n\r\n public static ruleCarryMove = ActionGo.carry.createAndAddRule({\r\n name : \"Going - Move Actor to Next Room\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n let roomGoneFrom = action.actor.getRoom();\r\n let direction = action.getNoun(0);\r\n let roomGoneInto = roomGoneFrom.connections[direction];\r\n roomGoneInto.place(action.actor);\r\n\r\n let actor = action.actor;\r\n if (actor == WorldState.player) {\r\n action.say.add(\"You go \" + Room.DIRECTIONS_NAMES[direction].toLowerCase() + \".\");\r\n } else {\r\n if (roomGoneFrom == WorldState.player.getRoom()) {\r\n action.say.add(actor, \" goes \" + Room.DIRECTIONS_NAMES[direction].toLowerCase() + \".\");\r\n } else {\r\n action.say.add(actor, \" arrives from the \" + Room.DIRECTIONS_NAMES[Room.oppositeDirection(direction)].toLowerCase() + \".\");\r\n }\r\n }\r\n }\r\n });\r\n\r\n public static ruleCarryRememberRooms = ActionGo.carry.createAndAddRule({\r\n name : \"Going - Remember the involved rooms\",\r\n code : (rulebook) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let roomGoneInto = action.actor.getRoom();\r\n let direction = action.getNoun(0);\r\n let roomGoneFrom = roomGoneInto.connections[Room.oppositeDirection(direction)];\r\n\r\n if (actor.isPlayer()) {\r\n WorldState.rememberRoom(roomGoneFrom, roomGoneInto);\r\n }\r\n }\r\n });\r\n}","/// \r\n/// \r\n/// \r\nmodule Elements.RoomHandler {\r\n export var currentRoomTab = document.getElementById(\"currentRoomTab\");\r\n export var currentRoomDescription = document.getElementById(\"roomDescription\");\r\n export var currentRoomExits = document.getElementById(\"roomExits\");\r\n\r\n export var currentRoomName : Text = document.createTextNode(\"\");\r\n document.getElementById(\"roomName\").appendChild(currentRoomName);\r\n\r\n export function linkObjects () {\r\n let objs = currentRoomTab.getElementsByClassName(\"roomObject\");\r\n\r\n for (let i = 0; i < objs.length; i++) {\r\n let linkKeyCode = Controls.KeyHandler.getFirstKeyCode();\r\n Controls.KeyHandler.applyCode( objs[i], linkKeyCode);\r\n }\r\n }\r\n\r\n export function emptyRoom () {\r\n while (currentRoomDescription.firstChild) {\r\n currentRoomDescription.removeChild(currentRoomDescription.firstChild);\r\n }\r\n\r\n while (currentRoomExits.firstChild) {\r\n currentRoomExits.removeChild(currentRoomExits.firstChild);\r\n }\r\n\r\n currentRoomName.nodeValue = \"\";\r\n }\r\n\r\n export async function updateRoom () {\r\n emptyRoom();\r\n\r\n let room = WorldState.player.getRoom();\r\n\r\n if (room != undefined) {\r\n currentRoomName.nodeValue = room.getPrintedName();\r\n\r\n let description = room.description.getHTML(\"p\", [\"roomDescription\"]);\r\n await description.then(value => {\r\n for (let i = 0, p = value[i]; p != undefined; p = value[++i]) {\r\n currentRoomDescription.appendChild(p);\r\n }\r\n });\r\n\r\n let things = room.getContainedAndVisible();\r\n if (things.length > 0) {\r\n let thingList = document.createElement(\"p\");\r\n thingList.classList.add(\"roomDescription\");\r\n\r\n await PrintingVisibleThingsRulebook.execute({\r\n noun : {\r\n things : things,\r\n container : thingList\r\n }\r\n });\r\n\r\n currentRoomDescription.appendChild(thingList);\r\n }\r\n\r\n for (let index = 0, value = room.connections[index]; index < room.connections.length; value = room.connections[++index]) {\r\n if (value != undefined) {\r\n let p = document.createElement(\"p\");\r\n p.classList.add(\"roomExit\");\r\n\r\n let link = document.createElement(\"a\");\r\n link.classList.add(\"roomDirection\");\r\n link.appendChild(document.createTextNode(Room.DIRECTIONS_NAMES[index]));\r\n\r\n Controls.Links.makeLink(link, new ActionGo(WorldState.player, index));\r\n Controls.KeyHandler.applyCode(link, Controls.KeyHandler.directionCodeByIndex[index]);\r\n\r\n p.appendChild(link);\r\n\r\n let directionResult = \": \";\r\n if (WorldState.isRoomRemembered(value)) {\r\n directionResult += value.getPrintedName();\r\n } else {\r\n directionResult += \"A new place\";\r\n }\r\n\r\n p.appendChild(document.createTextNode(directionResult));\r\n\r\n currentRoomExits.appendChild(p);\r\n }\r\n }\r\n }\r\n }\r\n\r\n export interface VisibleThingsOptions {\r\n container : HTMLElement,\r\n things : Array\r\n }\r\n\r\n /**\r\n * Noun = VisibleThingsOptions\r\n * @type {Rulebook}\r\n */\r\n export var PrintingVisibleThingsRulebook = new Rulebook(\"Printing the name of visible things in a room\");\r\n\r\n export var PrintIntroToVisibleThingsRule = new Rule({\r\n name : \"Print \\\"You can see\\\" text\",\r\n firstPriority : Rule.PRIORITY_HIGH,\r\n code : (rulebook : RulebookRunner) => {\r\n let noun = rulebook.noun;\r\n noun.container.appendChild(document.createTextNode(\"You can see \"));\r\n }\r\n });\r\n PrintingVisibleThingsRulebook.addRule(PrintIntroToVisibleThingsRule);\r\n\r\n export var PrintVisibleThingsRule = new Rule({\r\n name : \"Print all visible things\",\r\n code : async (rulebook : RulebookRunner) => {\r\n let noun = rulebook.noun;\r\n for (let i = 0; i < noun.things.length; i++) {\r\n let value = noun.things[i];\r\n let link = document.createElement(\"a\");\r\n link.classList.add(\"roomObject\");\r\n\r\n let say = new Say(new SayAn(false), value);\r\n await say.getPureElements().then(value2 => {\r\n for (let i = 0, element = value2[i]; element != undefined; element = value2[++i]) {\r\n link.appendChild(element);\r\n }\r\n });\r\n\r\n Controls.Links.makeLink(link, new ActionExamine(WorldState.player, value));\r\n Controls.KeyHandler.applyCode(link, Controls.KeyHandler.getFirstKeyCode());\r\n\r\n noun.container.appendChild(link);\r\n\r\n if ((i + 1) < noun.things.length) {\r\n noun.container.appendChild(document.createTextNode(\", \"));\r\n }\r\n }\r\n }\r\n });\r\n PrintingVisibleThingsRulebook.addRule(PrintVisibleThingsRule);\r\n\r\n export var PrintOutroToVisibleThingsRule = new Rule({\r\n name : \"Print \\\"... here\\\" text\",\r\n firstPriority : Rule.PRIORITY_LOW,\r\n code : (rulebook : RulebookRunner) => {\r\n let noun = rulebook.noun;\r\n noun.container.appendChild(document.createTextNode(\" here.\"));\r\n }\r\n });\r\n PrintingVisibleThingsRulebook.addRule(PrintOutroToVisibleThingsRule);\r\n}","/// \r\n/// \r\n/// \r\n\r\nclass CoinPouch extends Thing {\r\n private coins : number = 0;\r\n\r\n public addCoins (coins : number) {\r\n this.coins += coins;\r\n }\r\n\r\n public removeCoins (coins : number) {\r\n this.coins -= coins;\r\n }\r\n\r\n public getCoins () {\r\n return this.coins;\r\n }\r\n\r\n public static carryOutTakingCoinPouches = new Rule({\r\n name : \"Carry out taking coin pouches\",\r\n firstPriority : ActionTake.defaultCarryTakingRule.firstPriority,\r\n priority : ActionTake.defaultCarryTakingRule.priority + 1,\r\n code : async (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n let actorPouches = Thing.CarryRelation.getRightType(actor, CoinPouch);\r\n\r\n if (actorPouches.length > 0) {\r\n let thingCoins = thing.getCoins();\r\n if (thingCoins > 0) {\r\n rulebook.skipRule(ActionTake.defaultCarryTakingRule);\r\n\r\n ( actorPouches[0]).addCoins(thingCoins);\r\n thing.removeCoins(thing.getCoins());\r\n\r\n if (actor == WorldState.player) {\r\n action.say.add(\"You empty the \", thing, \" into your \", actorPouches[0], \". Your \", actorPouches[0], \" now has \" + actorPouches[0].getCoins().toString() + \" coins.\");\r\n } else {\r\n action.say.add(actor, \" empties the \", thing, \" into \" + Say.hisHersIts(actor) + \" \", actorPouches[0], \".\");\r\n }\r\n } else {\r\n // give them the ol' switcharoo\r\n let myCoins = actorPouches[0].getCoins();\r\n actorPouches[0].removeCoins(myCoins);\r\n thing.addCoins(myCoins);\r\n if (actor == WorldState.player) {\r\n action.say.add(\"You empty your \", actorPouches[0], \" into the \", thing, \".\", Say.PARAGRAPH_BREAK);\r\n }\r\n let drop = new ActionDrop(actor, actorPouches[0]);\r\n await drop.execute().then();\r\n\r\n if (Thing.EnclosedRelation.getLeft(actorPouches[0]) == actor) {\r\n if (actor == WorldState.player) {\r\n action.say.add(\"You can't get rid of your \", actorPouches[0], \"!\");\r\n }\r\n return false;\r\n }\r\n }\r\n }\r\n },\r\n conditions : (rulebook : RulebookRunner) => {\r\n return (( rulebook.noun).getNoun(0) instanceof CoinPouch);\r\n }\r\n });\r\n}\r\n\r\nActionTake.carry.addRule(CoinPouch.carryOutTakingCoinPouches);\r\n\r\nSay.afterPrinting.addRule(new Rule(\r\n {\r\n name : \"Include contents of Coin Pouch while Printing Visible Things in a Room\",\r\n code : (rulebook : RulebookRunner) => {\r\n let say = rulebook.noun;\r\n let pouch = say.currentNoun;\r\n say.currentNounElements.push(document.createTextNode(\" with \" + pouch.getCoins().toString() + \" coins\"));\r\n },\r\n conditions : (rulebook : RulebookRunner) => {\r\n return Elements.RoomHandler.PrintingVisibleThingsRulebook.isRunning()\r\n && ( rulebook.noun).currentNoun instanceof CoinPouch\r\n && ( ( rulebook.noun).currentNoun).getCoins() > 0;\r\n }\r\n }\r\n));\r\n\r\nActionExamine.carry.addRule(new Rule({\r\n name : \"Print description of coins in Coin Pouch\",\r\n firstPriority : ActionExamine.PrintDescriptionOfExaminedThingRule.firstPriority,\r\n priority : ActionExamine.PrintDescriptionOfExaminedThingRule.priority - 1,\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let thing = action.getNoun(0);\r\n if (thing.getCoins() > 0) {\r\n action.say.add(\" There are \" + thing.getCoins().toString() + \" coins in it.\");\r\n } else {\r\n action.say.add(\" There are no coins in it.\");\r\n }\r\n },\r\n conditions : (rulebook : RulebookRunner) => {\r\n return (( rulebook.noun).getNoun(0) instanceof CoinPouch);\r\n }\r\n}));","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\nmodule Elements.InventoryHandler {\r\n var container = document.getElementById(\"inventoryTarget\");\r\n\r\n function empty () {\r\n while (container.firstChild) {\r\n container.removeChild(container.firstChild);\r\n }\r\n }\r\n\r\n function printHeader (header : string) {\r\n let p = document.createElement(\"p\");\r\n p.classList.add(\"inventoryHeader\");\r\n p.appendChild(document.createTextNode(header + \":\"));\r\n container.appendChild(p);\r\n }\r\n\r\n let currentRow : HTMLElement;\r\n\r\n export let LinkingThing = new Rulebook(\"Inventory - Links for a Thing\");\r\n\r\n export function printThingLink (shortcut : string, action : Action) {\r\n let nameLink = document.createElement(\"div\");\r\n nameLink.classList.add(\"inventoryLink\");\r\n nameLink.appendChild(document.createTextNode(shortcut));\r\n currentRow.appendChild(nameLink);\r\n\r\n Controls.Links.makeLink(nameLink, action);\r\n }\r\n\r\n async function printThing (thing : Thing) {\r\n currentRow = document.createElement(\"div\");\r\n currentRow.classList.add(\"inventoryRow\");\r\n\r\n let nameLink = document.createElement(\"div\");\r\n nameLink.classList.add(\"inventoryLink\", \"name\");\r\n nameLink.appendChild(document.createTextNode(thing.getPrintedName()));\r\n currentRow.appendChild(nameLink);\r\n\r\n Controls.Links.makeLink(nameLink, new ActionExamine(WorldState.player, thing));\r\n\r\n await LinkingThing.execute({noun : thing});\r\n\r\n container.appendChild(currentRow);\r\n }\r\n\r\n function thingSort (a : Thing, b : Thing) {\r\n let na = a.getPrintedName().toLowerCase();\r\n let nb = b.getPrintedName().toLowerCase();\r\n if (na < nb) return -1;\r\n if (na > nb) return 1;\r\n return 0;\r\n }\r\n\r\n export async function updateInventory () {\r\n let player = WorldState.player;\r\n\r\n empty();\r\n\r\n let wielded = Thing.WieldRelation.getRight(player).sort(thingSort);\r\n let worn = Thing.WearRelation.getRight(player).sort(thingSort);\r\n let carried = Thing.CarryRelation.getRight(player).sort(thingSort);\r\n\r\n if (wielded.length > 0) {\r\n printHeader(\"Wielded\");\r\n for (let i = 0; i < wielded.length; i++) {\r\n await printThing(wielded[i]);\r\n }\r\n }\r\n\r\n if (worn.length > 0) {\r\n printHeader(\"Worn\");\r\n for (let i = 0; i < worn.length; i++) {\r\n await printThing(worn[i]);\r\n }\r\n }\r\n\r\n if (carried.length > 0) {\r\n printHeader(\"Carried\");\r\n for (let i = 0; i < carried.length; i++) {\r\n await printThing(carried[i]);\r\n }\r\n }\r\n\r\n let pouch = > Thing.CarryRelation.getRightType(WorldState.player, CoinPouch);\r\n if (pouch.length > 0) {\r\n let p = document.createElement(\"p\");\r\n p.classList.add(\"inventoryGold\");\r\n let s : Say;\r\n if (pouch[0].getCoins() > 0) {\r\n s = new Say(\"There are \" + pouch[0].getCoins().toString() + \" coins in your \", pouch[0], \".\");\r\n } else {\r\n s = new Say(\"There are no coins in your \", pouch[0], \".\");\r\n }\r\n await s.getPureElements().then(elements => {\r\n elements.forEach(element => {\r\n p.appendChild(element);\r\n });\r\n });\r\n container.appendChild(p);\r\n }\r\n }\r\n}","/// \r\n/// \r\n/// \r\n\r\nclass ActionRetrace extends Action {\r\n public static check = new Rulebook(\"Check Retracing\");\r\n public static carry = new Rulebook(\"Carry out Retracing\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n super(actor, ...nouns);\r\n this.extraChecks.push(ActionRetrace.check);\r\n this.extraCarries.push(ActionRetrace.carry);\r\n this.requiresNoun = false;\r\n this.requiresVisibility = false;\r\n this.requiresTurn = false;\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {string}\r\n */\r\n public getCommandText () {\r\n let name;\r\n if (typeof this.getNoun(0) == \"number\") {\r\n name = Room.DIRECTIONS_NAMES[this.getNoun(0)];\r\n } else if (this.getNoun(0) instanceof Room) {\r\n name = ( this.getNoun(0)).getPrintedName();\r\n }\r\n return \"think about how to get to \" + name;\r\n }\r\n}\r\n\r\n\r\nActionRetrace.check.addRule(new Rule({\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n priority : Rule.PRIORITY_HIGH,\r\n name : \"Change Room to Direction\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n\r\n // Someone asked for a room...\r\n if (action.getNoun(0) instanceof Room) {\r\n let actor = action.actor;\r\n let cRoom = actor.getRoom();\r\n if (cRoom == undefined) {\r\n return false;\r\n }\r\n let dRoom = action.getNoun(0);\r\n\r\n if (cRoom == dRoom) {\r\n if (actor.isPlayer()) {\r\n action.say.add(\"You are already there!\");\r\n }\r\n return false;\r\n }\r\n\r\n let code;\r\n\r\n if (actor == WorldState.player) {\r\n code = (room : Room) => {\r\n return WorldState.isRoomRemembered(room);\r\n }\r\n }\r\n\r\n let direction = cRoom.bestDirectionTo(dRoom, code);\r\n if (direction == undefined) {\r\n if (actor.isPlayer()) {\r\n action.say.add(\"You don't remember how to get there.\");\r\n }\r\n return false;\r\n } else {\r\n action.setNoun(0, direction);\r\n }\r\n }\r\n }\r\n}));\r\n\r\nActionRetrace.carry.addRule(new Rule({\r\n name : \"Retracing - Find Direction\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n\r\n action.say.add(\"To get there, you should go \" + Room.DIRECTIONS_NAMES[action.getNoun(0)] + \".\");\r\n }\r\n}));\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\nmodule Elements.RememberedHandler {\r\n //var target = document.getElementById(\"rememberedRoomsTarget\");\r\n var mapTarget = document.getElementById(\"mapTarget\");\r\n var lastMap : RoomRandomMap;\r\n var elements : { [xy : string] : HTMLElement};\r\n\r\n export function empty () {\r\n // while (target.firstChild) {\r\n // target.removeChild(target.firstChild);\r\n // }\r\n\r\n elements = {};\r\n lastMap = undefined;\r\n\r\n while (mapTarget.firstChild) {\r\n mapTarget.removeChild(mapTarget.firstChild);\r\n }\r\n }\r\n\r\n // export function updateList () {\r\n // empty();\r\n // let rooms = [];\r\n // rooms.push(...(WorldState.getRememberedRooms()).sort((a : Room, b: Room) => {\r\n // let na = a.getPrintedName().toLowerCase();\r\n // let nb = b.getPrintedName().toLowerCase();\r\n // if (na < nb) return -1;\r\n // if (nb < na) return 1;\r\n // return 0;\r\n // }));\r\n // if (rooms.length == 0) {\r\n // let p = document.createElement(\"p\");\r\n // p.appendChild(document.createTextNode(\"You don't remember any room.\"));\r\n // target.appendChild(p);\r\n // } else {\r\n // rooms.forEach((room : Room) => {\r\n // let row = document.createElement(\"div\");\r\n // row.classList.add(\"rememberedRoomRow\");\r\n // target.appendChild(row);\r\n //\r\n // let nameLink = document.createElement(\"div\");\r\n // nameLink.classList.add(\"rememberedRoomLink\");\r\n // nameLink.classList.add(\"name\");\r\n // nameLink.appendChild(document.createTextNode(room.getPrintedName()));\r\n // row.appendChild(nameLink);\r\n //\r\n //\r\n // if (WorldState.player.getRoom() == room) {\r\n // row.classList.add(\"currentRoom\");\r\n // return;\r\n // }\r\n //\r\n // Controls.Links.makeLink(nameLink, new ActionGo(WorldState.player, room));\r\n //\r\n // let thinkLink = document.createElement(\"div\");\r\n // thinkLink.classList.add(\"rememberedRoomLink\");\r\n // thinkLink.appendChild(document.createTextNode(\"?\"));\r\n // Controls.Links.makeLink(thinkLink, new ActionRetrace(WorldState.player, room));\r\n // row.appendChild(thinkLink);\r\n // });\r\n // }\r\n // }\r\n\r\n export async function updateMap () {\r\n let regions = Region.InRelation.getAllLeftType(WorldState.player.getRoom(), RegionRandom);\r\n let biggestRegion = regions[regions.length - 1];\r\n if (biggestRegion == undefined) {\r\n empty();\r\n return;\r\n }\r\n\r\n if (biggestRegion.map != lastMap) {\r\n empty();\r\n } else {\r\n updateOldMap();\r\n return;\r\n }\r\n\r\n let map = biggestRegion.map;\r\n lastMap = map;\r\n\r\n map.updateAllLimits();\r\n\r\n for (let y = map.highestY; y >= map.lowestY; y--) {\r\n let row = document.createElement(\"div\");\r\n row.classList.add(\"mapRow\");\r\n for (let x = map.lowestX; x <= map.highestX; x++) {\r\n let room = map.getRoom(x, y);\r\n\r\n let roomDiv = document.createElement(\"div\");\r\n roomDiv.classList.add(\"mapRoom\");\r\n if (WorldState.player.getRoom() == room) {\r\n roomDiv.classList.add(\"current\");\r\n }\r\n\r\n if (room != undefined) {\r\n roomDiv.classList.add(\"linked\", room.getBackgroundClass());\r\n\r\n let roomName = document.createElement(\"div\");\r\n\r\n let sayName = new Say(room);\r\n await sayName.getPureElements().then(value => {\r\n value.forEach(element => {\r\n roomName.appendChild(element);\r\n });\r\n\r\n Elements.HoverInfo.makeHoverable(roomDiv, value);\r\n });\r\n\r\n //roomDiv.appendChild(roomName);\r\n\r\n Room.DIRECTIONS.forEach((direction) => {\r\n if (room.connections[direction] != undefined) {\r\n let directionDiv = document.createElement(\"div\");\r\n directionDiv.classList.add(\"mapRoomConnection\" + Room.DIRECTIONS_NAMES[direction]);\r\n roomDiv.appendChild(directionDiv);\r\n }\r\n });\r\n\r\n Controls.Links.makeLink(roomDiv, new ActionGo(WorldState.player, room));\r\n }\r\n\r\n if (!WorldState.isRoomRemembered(room)) {\r\n roomDiv.classList.add(\"unknown\");\r\n }\r\n\r\n row.appendChild(roomDiv);\r\n\r\n elements[x.toString() + \";\" + y.toString()] = roomDiv;\r\n }\r\n mapTarget.appendChild(row);\r\n }\r\n }\r\n\r\n export function updateOldMap () {\r\n let map = lastMap;\r\n for (let y = map.highestY; y >= map.lowestY; y--) {\r\n for (let x = map.lowestX; x <= map.highestX; x++) {\r\n let room = map.getRoom(x, y);\r\n\r\n if (room != undefined) {\r\n if (WorldState.isRoomRemembered(room)) {\r\n elements[x.toString() + \";\" + y.toString()].classList.remove(\"unknown\");\r\n } else {\r\n elements[x.toString() + \";\" + y.toString()].classList.add(\"unknown\");\r\n }\r\n\r\n if (WorldState.player.getRoom() == room) {\r\n elements[x.toString() + \";\" + y.toString()].classList.add(\"current\");\r\n } else {\r\n elements[x.toString() + \";\" + y.toString()].classList.remove(\"current\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}","/// \r\n/// \r\n/// \r\n\r\ninterface AIOptions {\r\n wanderer? : boolean,\r\n wandersOn? : Region,\r\n picksShinies? : boolean\r\n}\r\n\r\nclass AI {\r\n public wanderer = true;\r\n public wandersOn : Region;\r\n public picksShinies = true;\r\n\r\n public constructor (options : AIOptions) {\r\n for (let key in options) {\r\n this[key] = options[key];\r\n }\r\n }\r\n\r\n /**\r\n * Executing an AI returns an Action. DOESN'T execute the action, just finds it!\r\n * @returns {Promise}\r\n */\r\n public async execute (actor : Thing) : Promise {\r\n let promise : Promise;\r\n // TODO: if actor.isInCombat();\r\n if (promise != undefined) {\r\n promise = AI.combatRules.execute({\r\n noun : actor\r\n }, this.extraCombatRules);\r\n } else {\r\n promise = AI.rules.execute({\r\n noun : actor\r\n }, this.extraRules);\r\n }\r\n\r\n let result : Action;\r\n await promise.then(value => {\r\n result = value;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n public addRulesBook (...books : Array>) {\r\n this.extraRules.push(...books)\r\n arrayUnique(this.extraRules);\r\n }\r\n\r\n public addCombatRulesBook (...books : Array>) {\r\n this.extraCombatRules.push(...books)\r\n arrayUnique(this.extraCombatRules);\r\n }\r\n\r\n public static rules = new Rulebook(\"Default AI Rules\");\r\n public extraRules : Array> = [];\r\n public static combatRules = new Rulebook(\"Default AI Combat Rules\");\r\n public extraCombatRules : Array> = [];\r\n}\r\n\r\n","class Skill {\r\n private level : number = 0;\r\n private maxLevel : number = 10;\r\n private upgradeChance : number;\r\n public name : string;\r\n public used : number = 0;\r\n\r\n public constructor(name : string, upgradeChance? : number) {\r\n this.name = name;\r\n this.upgradeChance = upgradeChance != undefined ? upgradeChance : 1;\r\n }\r\n\r\n public increaseLevel (levels : number) {\r\n this.level += levels;\r\n if (this.level > this.maxLevel) {\r\n this.level = this.maxLevel;\r\n }\r\n }\r\n\r\n public decreaseLevel (levels : number) {\r\n this.level -= levels;\r\n if (this.level < 0) {\r\n this.level = 0;\r\n }\r\n }\r\n\r\n public getLevel () {\r\n this.used++;\r\n if (Math.random() * 100 < this.upgradeChance) {\r\n this.increaseLevel(1);\r\n }\r\n return this.level;\r\n }\r\n}\r\n\r\nclass SkillList {\r\n public combat = new Skill(\"Combat\");\r\n}","/// \r\n/// \r\n/// \r\n/**\r\n * A person is a thing that happens to be \"alive\" in some significant way, not necessarily human.\r\n * A robot is a person.\r\n * A dog is a person.\r\n *\r\n * Fuck your standards.\r\n */\r\nclass Person extends Thing {\r\n public AI = new AI({});\r\n public skills = new SkillList();\r\n public animated = true;\r\n\r\n public strength = 3;\r\n public agility = 3;\r\n public intelligence = 3;\r\n\r\n public maxHealthStats = 10;\r\n public health = 10;\r\n public lastHealthUpdate = 0;\r\n public stamina = 10;\r\n public lastStaminaUpdate = 0;\r\n\r\n public healthPerTurn = 0.1;\r\n public staminaPerTurn = 1;\r\n\r\n public getIntelligence () {\r\n return this.intelligence; // TODO : Sum with effects\r\n }\r\n\r\n public changeHealth (n : number) {\r\n this.updateHealth();\r\n this.health += n;\r\n if (this.health > this.maxHealthStats) {\r\n this.health = this.maxHealthStats;\r\n }\r\n }\r\n\r\n /**\r\n * Returns health as a number from 0 to 10.\r\n */\r\n public getHealthOnScale () {\r\n return Math.round(\r\n ((this.health * 10) / this.maxHealthStats)\r\n );\r\n }\r\n\r\n /**\r\n * Lazy updates allow us to count Health/Stamina for NPCs without overloading the Every Turn rulebook.\r\n */\r\n public updateHealth () {\r\n var nTurns = WorldState.getCurrentTurn() - this.lastHealthUpdate;\r\n this.health += this.healthPerTurn * nTurns;\r\n if (this.health > this.maxHealthStats) {\r\n this.health = this.maxHealthStats;\r\n }\r\n }\r\n\r\n public changeStamina (n : number) {\r\n this.updateStamina();\r\n this.stamina += n;\r\n if (this.stamina > this.maxHealthStats) {\r\n this.stamina = this.maxHealthStats;\r\n }\r\n }\r\n\r\n /**\r\n * Returns stamina as a number from 0 to 10.\r\n */\r\n public getStaminaOnScale () {\r\n return Math.round(\r\n ((this.stamina * 10) / this.maxHealthStats)\r\n );\r\n }\r\n\r\n public updateStamina () {\r\n var nTurns = WorldState.getCurrentTurn() - this.lastStaminaUpdate;\r\n this.stamina += this.staminaPerTurn * nTurns;\r\n if (this.stamina > this.maxHealthStats) {\r\n this.stamina = this.maxHealthStats;\r\n }\r\n }\r\n\r\n public isPlayer () {\r\n return this == WorldState.player;\r\n }\r\n\r\n}","/// \r\n/// \r\n/// \r\nmodule EveryTurn {\r\n export var EveryTurn = new Rulebook(\"Every Turn\");\r\n\r\n export var RunAIRule = new Rule ({\r\n name : \"Run NPC AI Rule\",\r\n code : function () {\r\n let people = Thing.InsideRoomRelation.getAnyRightType(Person);\r\n }\r\n });\r\n\r\n export var incrementTurnCounterRule = EveryTurn.createAndAddRule({\r\n firstPriority: Rule.PRIORITY_LOWEST,\r\n priority: Rule.PRIORITY_MEDIUM,\r\n name: \"Increment Turn Counter\",\r\n code: function () {\r\n WorldState.incrementWorldTurn();\r\n }\r\n });\r\n}","/// \r\n/// \r\n\r\nmodule PlayBegins {\r\n export var rulebook = new Rulebook(\"Play Begins\");\r\n\r\n export function execute () {\r\n rulebook.execute({});\r\n }\r\n\r\n export var RememberFirstRoomRule = new Rule({\r\n name : \"Remember the First Room Rule\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n code : (rulebook2 : RulebookRunner) => {\r\n WorldState.rememberRoom(WorldState.player.getRoom());\r\n }\r\n });\r\n rulebook.addRule(RememberFirstRoomRule);\r\n\r\n export var RunEmptyTurnSequenceRule = new Rule ({\r\n name : \"Run Empty Turn Sequence Rule\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n priority : Rule.PRIORITY_LOWEST,\r\n code : (rulebook2 : RulebookRunner) => {\r\n TurnSequence.execute();\r\n }\r\n });\r\n rulebook.addRule(RunEmptyTurnSequenceRule);\r\n}","module Tests {\r\n export var MIN_DICE = 0; // Dices can be < 0\r\n export var MAX_DICE = 3; // Dices can go real high\r\n\r\n export function rollDice () {\r\n return Math.floor(Math.random() * (MAX_DICE - MIN_DICE)) + 1 + MIN_DICE;\r\n }\r\n\r\n export function test (attr : number, difficulty : number) {\r\n return (attr + rollDice()) >= difficulty;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule TurnSequence {\r\n export var rulebook = new Rulebook(\"Turn Sequence\");\r\n export var playerActions = [];\r\n var turnSequencePromise;\r\n\r\n export async function execute (action? : Action) {\r\n // Only one action at a time\r\n if (playerActions.push(action) == 1) {\r\n let t0 = performance.now();\r\n console.debug(\"=== Player Action: \" + (action ? action.getCommandText() : \"none\"));\r\n turnSequencePromise = rulebook.execute({\r\n noun: action\r\n });\r\n\r\n await turnSequencePromise.then(() => {\r\n playerActions = [];\r\n });\r\n let t1 = performance.now();\r\n console.debug(\"Total: \" + (t1 - t0) + \" milliseconds.\");\r\n }\r\n }\r\n\r\n /**\r\n * This is the Prepare Elements for the turn rule.\r\n * @type {Rule}\r\n */\r\n export var PrepareElementsRule = new Rule({\r\n firstPriority: Rule.PRIORITY_HIGHEST, // This will be about the first Rule to be executed\r\n priority: Rule.PRIORITY_MEDIUM, // This needs to be done before the majority of the rules, but we don't want it to be the very first no matter what\r\n name: \"Begin Turn (Elements Side)\",\r\n code: function (runner : RulebookRunner) {\r\n Elements.CurrentTurnHandler.startTurn(runner.noun);\r\n }\r\n });\r\n TurnSequence.rulebook.addRule(PrepareElementsRule);\r\n\r\n /**\r\n * This is the Do Player Action Rule.\r\n * @type {Rule}\r\n */\r\n export let PlayerActionRule = new Rule({\r\n firstPriority: Rule.PRIORITY_HIGH,\r\n priority: Rule.PRIORITY_MEDIUM,\r\n name: \"Do Player Action\",\r\n code: async (rulebook : RulebookRunner) => {\r\n let playerAction = rulebook.noun;\r\n if (playerAction != undefined) {\r\n let promise = playerAction.execute();\r\n\r\n await promise;\r\n\r\n await Elements.CurrentTurnHandler.printAsContent(playerAction.say);\r\n\r\n if (playerAction.requiresTurn) {\r\n WorldState.incrementPlayerTurn();\r\n }\r\n }\r\n }\r\n });\r\n rulebook.addRule(PlayerActionRule);\r\n\r\n /**\r\n * This is the Run Every Turn Rules.\r\n * @type {Rule}\r\n */\r\n export var RunEveryTurnRulesRule = new Rule({\r\n firstPriority: Rule.PRIORITY_MEDIUM,\r\n priority: Rule.PRIORITY_MEDIUM,\r\n name: \"Run Every Turn Rules\",\r\n code: async function () {\r\n while (WorldState.isTurnWaiting()) {\r\n let promise = EveryTurn.EveryTurn.execute({});\r\n await promise.then((result) => {});\r\n }\r\n }\r\n });\r\n rulebook.addRule(RunEveryTurnRulesRule);\r\n\r\n /**\r\n * This is the Inform Elements the turn has ended rule.\r\n * @type {Rule}\r\n */\r\n export var RemoveTurnFromElementsRule = new Rule({\r\n firstPriority: Rule.PRIORITY_LOWEST, // This will be about the last rule to be executed\r\n priority: Rule.PRIORITY_MEDIUM, // This needs to be done after the majority of the rules, but we don't care if it's the very last or not\r\n name: \"End Turn (Elements/Controls Side)\",\r\n code: async function (rulebook : RulebookRunner) {\r\n Elements.CurrentTurnHandler.endTurn();\r\n\r\n Controls.KeyHandler.reset();\r\n\r\n Elements.HyperlinkHandler.hyperlinkCommonActions();\r\n await Elements.RoomHandler.updateRoom();\r\n Elements.RememberedHandler.updateMap();\r\n\r\n let playerAction = rulebook.noun;\r\n if (playerAction) {\r\n Elements.HyperlinkHandler.hyperlinkObject(playerAction.getNoun(0));\r\n } else {\r\n Elements.HyperlinkHandler.hyperlinkObject();\r\n }\r\n\r\n Elements.InventoryHandler.updateInventory();\r\n\r\n Elements.AppearanceHandler.updateAppearance();\r\n }\r\n });\r\n TurnSequence.rulebook.addRule(RemoveTurnFromElementsRule);\r\n}","/// \r\n\r\nclass Room implements Printable {\r\n private name : string;\r\n public connections : Array;\r\n public description : Say = new Say();\r\n\r\n\r\n public constructor (id? : string) {\r\n this.name = id == undefined ? \"Room\" : id;\r\n this.connections = new Array(Room.DIRECTIONS.length); // Array the same size as directions, but filled with undefined\r\n }\r\n\r\n public place (thing : Thing) {\r\n Thing.InsideRoomRelation.setRelation(this, thing);\r\n }\r\n\r\n public remove (thing : Thing) {\r\n // Don't remove stuff from other rooms\r\n if (Thing.InsideRoomRelation.getLeft(thing) == this) {\r\n Thing.InsideRoomRelation.unsetRight(thing);\r\n }\r\n }\r\n\r\n public getContained () : Array {\r\n return > Thing.InsideRoomRelation.getRight(this);\r\n }\r\n\r\n public getContainedAndVisible () : Array {\r\n let contained = this.getContained();\r\n let result = [];\r\n\r\n contained.forEach((value) => {\r\n if (value.visible && value !== WorldState.player) {\r\n result.push(value);\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n public mapRoom (r : Room, direction : number) {\r\n let oppositeDirection = Room.oppositeDirection(direction);\r\n if (this.connections[direction] != undefined) {\r\n console.warn(\"Replacing a connected room.\", this, \" connected through \", direction, \" to \", this.connections[direction]);\r\n this.connections[direction].unmapRoom(oppositeDirection);\r\n }\r\n this.connections[direction] = r;\r\n\r\n if (r.connections[oppositeDirection] != undefined) {\r\n console.warn(\"Replacing a connected room.\", r, \" connected through \", oppositeDirection, \" to \", r.connections[oppositeDirection]);\r\n r.unmapRoom(oppositeDirection);\r\n }\r\n r.connections[oppositeDirection] = this;\r\n }\r\n\r\n public unmapRoom (direction : number) {\r\n if (this.connections[direction] != undefined) {\r\n let r = this.connections[direction];\r\n this.connections[direction] = undefined;\r\n r.unmapRoom(Room.oppositeDirection(direction));\r\n }\r\n }\r\n\r\n public getPrintedName () {\r\n return this.name;\r\n }\r\n\r\n /**\r\n * This returns the best direction to follow if going from the current room to another room.\r\n * THIS CODE IS REALLY EXPENSIVE AND SHOULD ONLY BE USED AS A LAST RESORT\r\n * WARNING: THIS CODE WILL FAIL IF THE TARGET ROOM IS TOO FAR FROM THE CURRENT ROOM (FOR SECURITY REASONS).\r\n * This code runs through every. single. room. to find the best route to take.\r\n * If you need an NPC to stick to a region, don't let it go out of it in the first place!\r\n * @param room\r\n * @param validityCode\r\n * @returns {any}\r\n */\r\n // TODO: Make this shit fast\r\n public bestDirectionTo (room : Room, validityCode? : (room : Room) => boolean) {\r\n if (validityCode == undefined) validityCode = () => {return true};\r\n\r\n /**\r\n * Maximum amount of steps that will be considered for a route.\r\n * This is useful to prevent the code from spanning too many rooms, as each room can have Room.DIRECTIONS.length directions to make another call, etc.\r\n *\r\n * @type {number}\r\n */\r\n let maxSteps = 10;\r\n maxSteps = maxSteps > WorldState.getMaximumRememberedRooms() ? maxSteps : WorldState.getMaximumRememberedRooms();\r\n\r\n let recursiveBestPath = (cPath : Array, cRoom : Room, destination : Room) => {\r\n // Ignore \"bad\" rooms\r\n if (!validityCode(cRoom)) {\r\n return;\r\n }\r\n // Prevent the code from straying too far\r\n if (cRoom == destination) {\r\n maxSteps = maxSteps > cPath.length ? cPath.length : maxSteps; // Stop considering worse routes\r\n return cPath;\r\n } else if (cPath.length > maxSteps) {\r\n return undefined;\r\n } else {\r\n let paths = [];\r\n Room.DIRECTIONS.forEach(direction => {\r\n let nextRoom = cRoom.connections[direction];\r\n if (nextRoom != undefined && cPath.indexOf(nextRoom) == -1 && validityCode(nextRoom)) {\r\n let path = recursiveBestPath(cPath.concat([nextRoom]), nextRoom, destination);\r\n if (path != undefined) {\r\n paths.push(path);\r\n }\r\n }\r\n });\r\n let shortestIndex = 0;\r\n paths.forEach((value, index, array) => {\r\n if (value.length < paths[shortestIndex].length) {\r\n shortestIndex = index;\r\n }\r\n });\r\n return paths[shortestIndex];\r\n }\r\n };\r\n\r\n let paths = Array(Room.DIRECTIONS.length);\r\n let shortestIndex;\r\n Room.DIRECTIONS.forEach(direction => {\r\n let nextRoom = this.connections[direction];\r\n if (nextRoom != undefined) {\r\n paths[direction] = recursiveBestPath([this, nextRoom], nextRoom, room);\r\n if (paths[direction] != undefined && (shortestIndex == undefined || paths[shortestIndex].length > paths[direction].length)) {\r\n shortestIndex = direction;\r\n }\r\n }\r\n });\r\n return shortestIndex;\r\n }\r\n\r\n public static NORTH = 0;\r\n public static NORTHEAST = 1;\r\n public static EAST = 2;\r\n public static SOUTHEAST = 3;\r\n public static SOUTH = 4;\r\n public static SOUTHWEST = 5;\r\n public static WEST = 6;\r\n public static NORTHWEST = 7;\r\n public static UP = 8;\r\n public static DOWN = 9;\r\n public static DIRECTIONS = [Room.NORTH, Room.NORTHEAST, Room.EAST, Room.SOUTHEAST,\r\n Room.SOUTH, Room.SOUTHWEST, Room.WEST, Room.NORTHWEST, Room.UP, Room.DOWN];\r\n public static OPPOSITE_DIRECTIONS = [Room.SOUTH, Room.SOUTHWEST, Room.WEST, Room.NORTHWEST,\r\n Room.NORTH, Room.NORTHEAST, Room.EAST, Room.SOUTHEAST, Room.DOWN, Room.UP];\r\n public static DIRECTIONS_NAMES = [\"North\", \"Northeast\", \"East\", \"Southeast\",\r\n \"South\", \"Southwest\", \"West\", \"Northwest\", \"Up\", \"Down\"];\r\n\r\n public static oppositeDirection (direction : number) {\r\n return Room.OPPOSITE_DIRECTIONS[direction];\r\n // if (direction == Room.NORTH) return Room.SOUTH;\r\n // if (direction == Room.SOUTH) return Room.NORTH;\r\n // if (direction == Room.NORTHEAST) return Room.SOUTHWEST;\r\n // if (direction == Room.SOUTHWEST) return Room.NORTHEAST;\r\n // if (direction == Room.EAST) return Room.WEST;\r\n // if (direction == Room.WEST) return Room.EAST;\r\n // if (direction == Room.SOUTHEAST) return Room.NORTHWEST;\r\n // if (direction == Room.NORTHWEST) return Room.SOUTHEAST;\r\n // if (direction == Room.UP) return Room.DOWN;\r\n // if (direction == Room.DOWN) return Room.UP;\r\n }\r\n\r\n public static getDirectionXYZ (direction : number) {\r\n var y = 0;\r\n if ((direction >= 0 && direction < 2) || (direction == 7)) {\r\n y = 1;\r\n } else if (direction >= 3 && direction <= 5) {\r\n y = -1;\r\n }\r\n\r\n var x = 0;\r\n if (direction >= 1 && direction <= 3) {\r\n x = 1;\r\n } else if (direction >= 5 && direction <= 7) {\r\n x = -1;\r\n }\r\n\r\n var z = direction == Room.UP ? 1 :\r\n direction == Room.DOWN ? -1 : 0;\r\n\r\n return [x, y, z];\r\n }\r\n public static shift (coordinates : Array, direction : number) {\r\n let coordinatesVector = Room.getDirectionXYZ(direction);\r\n coordinates.forEach((value, index, array) => {\r\n coordinatesVector[index] += coordinates[index];\r\n });\r\n return coordinatesVector;\r\n }\r\n}","/// \r\n/// \r\n/**\r\n * Maps can hold information of certain rooms or a region.\r\n * If a player has a map, all the rooms in the map are always remembered.\r\n */\r\nclass MapNote extends Thing {\r\n public rooms : Array = [];\r\n public regions : Array = [];\r\n\r\n public addRoom (...rooms : Array) {\r\n rooms.forEach((room) => {\r\n this.rooms.push(room);\r\n });\r\n }\r\n\r\n public addRegion (...regions : Array) {\r\n regions.forEach(region => {\r\n this.regions.push(region);\r\n });\r\n }\r\n\r\n public contains (room : Room) {\r\n if(this.rooms.indexOf(room) != -1) {\r\n return true;\r\n } else {\r\n for (var i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].getRooms().indexOf(room) != -1) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n}","/// \r\ninterface BodypartValueResult {\r\n value : number;\r\n weight : number;\r\n}\r\n\r\nclass Bodypart extends Thing {\r\n public static WEIGHT_LOWEST = 1;\r\n public static WEIGHT_LOW = 3;\r\n public static WEIGHT_MEDIUM = 5;\r\n public static WEIGHT_HIGH = 7;\r\n public static WEIGHT_HIGHEST = 9;\r\n\r\n public static SLUTTINESS_LOWEST_SAINTLY = 0;\r\n public static SLUTTINESS_LOW_PRUDE = 25;\r\n public static SLUTTINESS_MEDIUM_AVERAGE = 50;\r\n public static SLUTTINESS_HIGH_SLUT = 75;\r\n public static SLUTTINESS_HIGHEST_WHORE = 100;\r\n\r\n public static GENDER_LOWEST_MANLIEST = 0;\r\n public static GENDER_LOW_MANLY = 25;\r\n public static GENDER_MEDIUM_ANDROGYNE = 50;\r\n public static GENDER_HIGH_FEMININE = 75;\r\n public static GENDER_HIGHEST_FEMININEST = 100;\r\n\r\n // The higher this number, the more the bodypart will be worth for health.\r\n // For instance, HEAD should be worth more than FINGERNAIL.\r\n public sorenessWeight : number = 1;\r\n\r\n // 0 to 10\r\n // says how fucked up the bodypart is\r\n public soreness : number = 0;\r\n\r\n // How much soreness is healed every turn\r\n public sorenessPerTurn : number = 2;\r\n\r\n // Last turn soreness got updated\r\n public lastSorenessUpdate : number = 0;\r\n\r\n public updateSoreness () {\r\n let cTurn = WorldState.getCurrentTurn();\r\n if (cTurn > this.lastSorenessUpdate) {\r\n if (this.soreness > 0) {\r\n this.soreness -= (this.sorenessPerTurn * (cTurn - this.lastSorenessUpdate));\r\n\r\n if (this.soreness < 0) {\r\n this.soreness = 0;\r\n }\r\n }\r\n this.lastSorenessUpdate = cTurn;\r\n }\r\n }\r\n\r\n public addSoreness (soreness : number) {\r\n this.updateSoreness();\r\n this.soreness += soreness;\r\n }\r\n\r\n public getSoreness () {\r\n this.updateSoreness();\r\n return this.soreness;\r\n }\r\n\r\n\r\n public getWeightedSoreness() {\r\n return this.getSoreness() * this.sorenessWeight;\r\n }\r\n\r\n // These are the slots the bodypart is visible on\r\n // Should use Humanoid.SLOT_* !\r\n public slots : Array = [];\r\n public visibleSlots : Array = [];\r\n\r\n // GenderValue is how masculine/feminine this bodypart is.\r\n // At 0 = the most masculine possible, at 100 = the most feminine eveter\r\n // 50 would be completely androgynous\r\n public genderValue : number = Bodypart.GENDER_MEDIUM_ANDROGYNE;\r\n\r\n // Like with health, the weight makes this bodypart matter more for deciding gender.\r\n // Gender presentation is not about prettiness, so, for instance, having huge breasts will\r\n // strongly push you to the \"is a woman\" side, even if you're manly as fuck everywhere else.\r\n // If you're too manly everywhere else, though, you'll probably end up closer on the spectrum to male\r\n // or at least androgynous, which might result in not passing.\r\n public genderWeight : number = 1;\r\n\r\n /**\r\n * Sluttiness goes from 0 to 100.\r\n * A bodypart's sluttiness is dependent on it being seen.\r\n * @type {number}\r\n */\r\n public sluttiness : number = 10;\r\n\r\n public sluttinessWeight : number = Bodypart.WEIGHT_LOWEST;\r\n\r\n public getGenderWeight () {\r\n return this.genderWeight * (this.visibleSlots.length / this.slots.length);\r\n }\r\n\r\n public getGenderValue () {\r\n return this.genderValue;\r\n }\r\n\r\n public getWeightedGenderValue () {\r\n return this.getGenderValue() * this.getGenderWeight();\r\n }\r\n\r\n public getSluttinessWeight () {\r\n return this.sluttinessWeight * (this.visibleSlots.length / this.slots.length);\r\n }\r\n\r\n public getWeightedSluttinessValue () {\r\n return this.sluttiness * this.getSluttinessWeight();\r\n }\r\n\r\n public updateVisibility () {\r\n this.visibleSlots = this.slots.slice(0);\r\n let parent = Thing.PartRelation.getLeft(this);\r\n if (parent != undefined) {\r\n let clothing = >Thing.WearRelation.getRight(parent);\r\n for (let i = 0; i < clothing.length; i++) {\r\n let covering = clothing[i].getCoveringSlots();\r\n for (let k = 0; k < covering.length; k++) {\r\n let idx = this.visibleSlots.indexOf(covering[k]);\r\n if (idx >= 0) {\r\n this.visibleSlots.splice(idx, 1);\r\n }\r\n }\r\n\r\n if (this.visibleSlots.length == 0) break;\r\n }\r\n }\r\n }\r\n\r\n public updateStatus () {\r\n this.updateVisibility();\r\n }\r\n\r\n public static getSoreness (thing : Thing) {\r\n let bodyparts = Thing.PartRelation.getRightType(thing, Bodypart);\r\n let soreness = 0;\r\n bodyparts.forEach((bodypart : Bodypart) => {\r\n soreness += bodypart.getWeightedSoreness();\r\n });\r\n return soreness;\r\n }\r\n\r\n public static getGenderValueOn (thing : Thing) : BodypartValueResult {\r\n let weight = 0;\r\n let value = 0;\r\n\r\n let bodyparts = Thing.PartRelation.getRightType(thing, Bodypart);\r\n bodyparts.forEach((bodypart : Bodypart) => {\r\n weight += bodypart.getGenderWeight();\r\n value += bodypart.getWeightedGenderValue();\r\n });\r\n\r\n return {\r\n weight : weight,\r\n value : value\r\n };\r\n }\r\n\r\n public static getSluttinessValueOn (thing : Thing) : BodypartValueResult {\r\n let weight = 0;\r\n let value = 0;\r\n\r\n let bodyparts = Thing.PartRelation.getRightType(thing, Bodypart);\r\n bodyparts.forEach((bodypart : Bodypart) => {\r\n weight += bodypart.getSluttinessWeight();\r\n value += bodypart.getWeightedSluttinessValue();\r\n });\r\n\r\n return {\r\n weight : weight,\r\n value : value\r\n };\r\n }\r\n}","/// \r\nabstract class SexStick extends Bodypart {\r\n /**\r\n * Returns how wide the member is. If this SexStick dependso n arousal, this function needs to ocnsider that.\r\n * This is relevant to how much a SexHole will be stretched out by this SexStick.\r\n * @returns {number}\r\n */\r\n public abstract getWide () : Measure;\r\n\r\n /**\r\n * Returns how long the member is. If this SexStick depends on arousal, this function needs to consider that.\r\n * This is relevant to how much a SexHole will be stretched out by this SexStick.\r\n * @returns {number}\r\n */\r\n public abstract getLong () : Measure;\r\n}","class SexHole extends Bodypart {\r\n\r\n}","interface Measurement {\r\n getText : () => string;\r\n}\r\n\r\n/**\r\n * A measure is ALWAYS created in Centimeters.\r\n * How a measure gets displayed can get changed later, so always use this class for measures!\r\n * If you're american, use the helper static functions fromInches, fromFeet to get centimeters.\r\n * For instance, 5'10\" would get created as:\r\n * new Measure(Measure.fromFeet(5) + Measure.fromInches(10)\r\n *\r\n * If multiple measurements are added, it's treated as area of something simple like rectangles or cubes or whatever, they're just multiplied.\r\n */\r\nclass Measure implements Measurement {\r\n private units : number;\r\n private sides : number;\r\n\r\n public constructor (...sides : Array) {\r\n this.units = 1;\r\n sides.forEach((side) => {\r\n this.units *= side;\r\n });\r\n this.sides = sides.length;\r\n }\r\n\r\n // [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]\r\n private superscript = [\"\" , \"\" , \"²\", \"³\", \"⁴\", \"⁵\", \"⁶\", \"⁷\", \"⁸\", \"⁹\"];\r\n\r\n public getText () {\r\n let meters = Math.pow(this.sides, 100);\r\n if (this.units > meters) {\r\n return (+(this.units / meters).toFixed(2)).toString() + \"m\" + this.superscript[this.sides];\r\n } else {\r\n return this.units.toString() + \"cm\" + this.superscript[this.sides];\r\n }\r\n }\r\n\r\n public getNumber () {\r\n return this.units;\r\n }\r\n\r\n public getSides () {\r\n return this.sides;\r\n }\r\n\r\n public static fromInches (inches : number) {\r\n return inches * 2.54;\r\n }\r\n\r\n public static fromFeet (feet : number) {\r\n return feet * 30.48;\r\n }\r\n}\r\n\r\nclass MeasureLiquid implements Measurement {\r\n private units : number;\r\n\r\n public constructor (milliliters : number) {\r\n this.units = milliliters;\r\n }\r\n\r\n public getText () {\r\n if (this.units > 1000) {\r\n return (+(this.units / 1000).toFixed(2)).toString() + \"L\";\r\n } else {\r\n return this.units.toString() + \"mL\";\r\n }\r\n }\r\n\r\n public static fromLiters (liters : number) {\r\n return liters * 1000;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\nclass HumanoidSkin extends Bodypart {\r\n public sorenessWeight = 0;\r\n public genderWeight = Bodypart.WEIGHT_MEDIUM;\r\n public slots : Array = [\r\n Humanoid.SLOT_FACE, Humanoid.SLOT_NECK, Humanoid.SLOT_SHOULDERS,\r\n Humanoid.SLOT_ARMS, Humanoid.SLOT_HANDS, Humanoid.SLOT_UPPER_CHEST,\r\n Humanoid.SLOT_MIDRIFF, Humanoid.SLOT_WAIST, Humanoid.SLOT_BACK,\r\n Humanoid.SLOT_HIPS, Humanoid.SLOT_BUTT, Humanoid.SLOT_LEG_UPPER,\r\n Humanoid.SLOT_LEG_LOWER\r\n ];\r\n}\r\n\r\nclass HumanoidHead extends Bodypart {\r\n public sorenessWeight = Bodypart.WEIGHT_MEDIUM;\r\n public genderWeight = Bodypart.WEIGHT_LOW;\r\n // TODO: make these slots as own bodyparts so that they can be handled better\r\n public slots : Array = [Humanoid.SLOT_HEADGEAR, Humanoid.SLOT_HAIR, Humanoid.SLOT_EARS, Humanoid.SLOT_FACE, Humanoid.SLOT_EYES, , Humanoid.SLOT_NOSE, Humanoid.SLOT_MOUTH];\r\n}\r\n\r\n// TODO: Add neck if there's a point to it\r\n\r\nclass HumanoidArms extends Bodypart {\r\n public sorenessWeight = Bodypart.WEIGHT_LOW;\r\n public genderWeight = Bodypart.WEIGHT_LOW;\r\n public slots : Array = [Humanoid.SLOT_ARMS];\r\n}\r\n\r\nclass HumanoidFeet extends Bodypart {\r\n public sorenessWeight = Bodypart.WEIGHT_LOW;\r\n public genderWeight = Bodypart.WEIGHT_LOW;\r\n public slots : Array = [Humanoid.SLOT_FEET];\r\n}\r\n\r\nclass HumanoidHands extends Bodypart {\r\n public sorenessWeight = Bodypart.WEIGHT_LOW;\r\n public genderWeight = Bodypart.WEIGHT_MEDIUM;\r\n public slots : Array = [Humanoid.SLOT_HANDS];\r\n}\r\n\r\nclass HumanoidButt extends Bodypart {\r\n public size : number = 0;\r\n public silicone : number = 0;\r\n\r\n public sorenessWeight = Bodypart.WEIGHT_MEDIUM;\r\n public genderWeight = Bodypart.WEIGHT_MEDIUM;\r\n public slots : Array = [Humanoid.SLOT_BUTT];\r\n public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;\r\n public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;\r\n\r\n public getSize () {\r\n return this.size + this.silicone;\r\n }\r\n\r\n public static getSizeText (size : number) {\r\n let names = [\"flat\", \"tiny\", \"round\", \"plump\"]; // TODO: finish this\r\n if (size >= names.length) {\r\n return \"gargantuan\";\r\n } else {\r\n return names[size];\r\n }\r\n }\r\n\r\n public getGenderValue () {\r\n return HumanoidBreasts.getGenderFromSize(this.getSize());\r\n }\r\n\r\n public static getGenderFromSize (size : number) {\r\n if (size <= 0) {\r\n return 20;\r\n } else if (size <= 2) {\r\n return 30 * size;\r\n } else {\r\n return 80;\r\n }\r\n }\r\n}\r\n\r\nclass HumanoidBreasts extends Bodypart {\r\n public size : number = 0;\r\n public silicone : number = 0;\r\n public milk : number = 0;\r\n\r\n public sorenessWeight = Bodypart.WEIGHT_MEDIUM;\r\n public genderWeight = Bodypart.WEIGHT_HIGH;\r\n public slots : Array = [Humanoid.SLOT_BREASTS];\r\n public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;\r\n public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;\r\n\r\n public getSize () {\r\n return this.size + this.silicone + this.milk;\r\n }\r\n\r\n public getSizeText () {\r\n return HumanoidBreasts.getSizeText(this.getSize());\r\n }\r\n\r\n public static getSizeText (size : number) {\r\n let names = [\"flat\", \"AA-cup\", \"A-cup\", \"B-cup\", \"C-cup\", \"D-cup\", \"E-cup\", \"F-cup\", \"G-cup\", \"H-cup\"];\r\n if (size >= names.length) {\r\n return \"too big\";\r\n } else {\r\n return names[size];\r\n }\r\n }\r\n\r\n public getGenderValue () {\r\n return HumanoidBreasts.getGenderFromSize(this.getSize());\r\n }\r\n\r\n public static getGenderFromSize (size : number) {\r\n if (size <= 0) {\r\n return 20;\r\n } else if (size <= 3) {\r\n return 20 * size;\r\n } else {\r\n return 80;\r\n }\r\n }\r\n}\r\n\r\n// TODO: Decide whther there will be a semen-producing bodypart\r\nclass HumanoidTesticles extends Bodypart {\r\n public size : number = 1; // \"Normal\"\r\n\r\n public sorenessWeight = Bodypart.WEIGHT_HIGH;\r\n public genderWeight = Bodypart.WEIGHT_HIGHEST;\r\n public slots : Array = [Humanoid.SLOT_CROTCH_FRONT];\r\n public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;\r\n public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;\r\n}\r\n\r\nclass HumanoidPenis extends SexStick {\r\n public flaccidSize = new Measure(6);\r\n public flaccidWidth = new Measure(3);\r\n public erectSize = new Measure(15);\r\n public erectWidth = new Measure(6);\r\n\r\n private arousalMinimum : number = 5;\r\n private arousalErect : number = 25;\r\n\r\n public sorenessWeight = Bodypart.WEIGHT_HIGH;\r\n public genderValue = 25;\r\n public genderWeight = Bodypart.WEIGHT_HIGHEST;\r\n public slots : Array = [Humanoid.SLOT_CROTCH_FRONT];\r\n public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;\r\n public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;\r\n\r\n public getActualSize () {\r\n let min = this.flaccidSize.getNumber();\r\n let max = this.erectSize.getNumber();\r\n let variableSize = (max - min);\r\n let numSteps = this.arousalErect - this.arousalMinimum;\r\n\r\n //TODO: Get arousal from owner\r\n let arousal = 0;\r\n let arousalPerc = (arousal - this.arousalMinimum) / numSteps;\r\n arousalPerc = arousalPerc < 0 ? 0 :\r\n arousalPerc > 1 ? 1 :\r\n arousalPerc;\r\n\r\n let finalSize = min + (variableSize * arousalPerc);\r\n return finalSize;\r\n }\r\n\r\n public getActualWidth () {\r\n let min = this.flaccidWidth.getNumber();\r\n let max = this.erectWidth.getNumber();\r\n let variableSize = (max - min);\r\n let numSteps = this.arousalErect - this.arousalMinimum;\r\n\r\n //TODO: Get arousal from owner\r\n let arousal = 0;\r\n let arousalPerc = (arousal - this.arousalMinimum) / numSteps;\r\n arousalPerc = arousalPerc < 0 ? 0 :\r\n arousalPerc > 1 ? 1 :\r\n arousalPerc;\r\n\r\n let finalSize = min + (variableSize * arousalPerc);\r\n return finalSize;\r\n }\r\n\r\n public getLong () {\r\n return new Measure(this.getActualSize());\r\n }\r\n\r\n public getWide () {\r\n return new Measure(this.getActualWidth());\r\n }\r\n\r\n public getBulgeSize () {\r\n return this.getActualSize() + this.getActualWidth();\r\n }\r\n\r\n public getSizeText () {\r\n return HumanoidPenis.getSizeText(this.getBulgeSize());\r\n }\r\n\r\n public static getSizeText (size : number) {\r\n // size = long + width\r\n return \"tiny\";\r\n }\r\n}\r\n\r\nclass HumanoidVagina extends SexHole {\r\n public genderValue = 85;\r\n public genderWeight = Bodypart.WEIGHT_HIGHEST;\r\n public slots : Array = [Humanoid.SLOT_CROTCH_FRONT];\r\n public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;\r\n public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;\r\n}","/// \r\ninterface ClothingOptions extends ThingOptions {\r\n topDescription? : Say;\r\n bottomDescription? : Say;\r\n feetDescription? : Say;\r\n}\r\n\r\ninterface ClothingWearerValue {\r\n weight : number;\r\n value : number;\r\n}\r\n\r\nclass Clothing extends Thing {\r\n public slots : Array = [];\r\n public transparentSlots : Array = [];\r\n public layer : number = Clothing.LAYER_MEDIUM;\r\n public isVisible = false;\r\n public visibleOn : Array = [];\r\n\r\n // Padding: gets added to current size. Can be negative\r\n // max: If current size > max, current size = max. On -1 this is not considered.\r\n // tight: If current size > tight, person becomes tight. On -1 this is not considered.\r\n // loose: if current size < loose, person becomes loose - can be overriden by covering clothes\r\n // If something is not used, leave as undefined\r\n // Would be fun to make them burst if too much over max, but that's not going to be used right now\r\n public breastPadding : number = 0;\r\n public maxBreastSize : number = -1;\r\n public tightBreastSize : number = -1;\r\n public looseBreastSize : number = 0;\r\n\r\n // Padding: gets added to current size. Can be negative\r\n // max: If current size > max, current size = max. On -1 this is not considered.\r\n // tight: If current size > tight, person becomes tight. On -1 this is not considered.\r\n // loose: if current size < loose, person becomes loose - can be overriden by covering clothes\r\n // If something is not used, leave as undefined\r\n // Would be fun to make them burst if too much over max, but that's not going to be used right now\r\n public crotchPadding : number = 0;\r\n public maxCrotchSize : number = -1;\r\n public tightCrotchSize : number = -1;\r\n public looseCrotchSize : number = 0;\r\n\r\n // Padding: gets added to current size. Can be negative\r\n // max: If current size > max, current size = max. On -1 this is not considered.\r\n // tight: If current size > tight, person becomes tight. On -1 this is not considered.\r\n // loose: if current size < loose, person becomes loose - can be overriden by covering clothes\r\n // If something is not used, leave as undefined\r\n // Would be fun to make them burst if too much over max, but that's not going to be used right now\r\n public buttPadding : number = 0;\r\n public maxButtSize : number = -1;\r\n public tightButtSize : number = -1;\r\n public looseButtSize : number = 0;\r\n\r\n /**\r\n * This function must be called any time anything could change clothing on a person.\r\n * Ripped a clothing? Update all clothes.\r\n * Changed breast size? Update all clothes.\r\n */\r\n public updateStatus () {\r\n this.visibleOn = [];\r\n this.visibleOn.push(...this.slots);\r\n let wearer = Thing.WearRelation.getLeft(this);\r\n if (wearer == undefined) return;\r\n\r\n let cloths = Thing.WearRelation.getRight(wearer);\r\n let coveredSlots = [];\r\n for (let i = 0; i < cloths.length; i++) {\r\n let worn = cloths[i];\r\n if ((worn != this) && worn.layer > this.layer) {\r\n coveredSlots.push(...worn.getCoveringSlots());\r\n }\r\n }\r\n\r\n this.visibleOn = this.visibleOn.filter(visible => {\r\n return coveredSlots.indexOf(visible) == -1;\r\n });\r\n\r\n this.isVisible = this.visibleOn.length > 0;\r\n }\r\n\r\n public getCoveringSlots () {\r\n if (this.transparentSlots.length == 0) {\r\n return this.slots.slice(0);\r\n }\r\n\r\n return this.slots.filter((value, index, array) => {\r\n return this.transparentSlots.indexOf(value) == -1;\r\n });\r\n }\r\n\r\n public static LAYER_LOWEST = 0;\r\n public static LAYER_LOW = 5;\r\n public static LAYER_MEDIUM = 10;\r\n public static LAYER_HIGH = 15;\r\n public static LAYER_HIGHEST = 20;\r\n\r\n public genderValue : number = 50;\r\n public sluttinessValue : number = 40;\r\n\r\n public getGenderWeight () {\r\n return this.visibleOn.length;\r\n }\r\n\r\n public getGenderValue () {\r\n return this.genderValue;\r\n }\r\n\r\n public getSluttinessWeight () {\r\n return this.visibleOn.length;\r\n }\r\n\r\n public getSluttinessValue () {\r\n return this.sluttinessValue;\r\n }\r\n\r\n public static getGenderValueOn (p : Thing) : ClothingWearerValue {\r\n let weight = 0;\r\n let value = 0;\r\n let clothes = Thing.WearRelation.getRight(p);\r\n for (let i = 0; i < clothes.length; i++) {\r\n weight += clothes[i].getGenderWeight();\r\n value += clothes[i].getGenderWeight() * clothes[i].getGenderValue();\r\n }\r\n return {\r\n weight : weight,\r\n value : value\r\n };\r\n }\r\n\r\n public static getSluttinessValueOn (p : Thing) : ClothingWearerValue {\r\n let weight = 0;\r\n let value = 0;\r\n let clothes = Thing.WearRelation.getRight(p);\r\n for (let i = 0; i < clothes.length; i++) {\r\n weight += clothes[i].getSluttinessWeight();\r\n value += clothes[i].getSluttinessWeight() * clothes[i].getSluttinessValue();\r\n }\r\n return {\r\n weight : weight,\r\n value : value\r\n };\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nclass ActionRemove extends Action {\r\n public static check: Rulebook = new Rulebook(\"Check Removing\");\r\n public static carry: Rulebook = new Rulebook(\"Carry out Removing\");\r\n\r\n public constructor(actor: Thing, ...nouns: Array) {\r\n super(actor, ...nouns);\r\n this.extraChecks.push(ActionRemove.check);\r\n this.extraCarries.push(ActionRemove.carry);\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {Say}\r\n */\r\n public getCommandText () {\r\n return \"take off \" + (this.getNoun(0) != undefined ? this.getNoun(0).getPrintedName() : \"\");\r\n }\r\n\r\n public getClothing () : Clothing{\r\n return this.getNoun(0);\r\n }\r\n\r\n public static checkIsWearable = ActionRemove.check.createAndAddRule({\r\n name : \"Is noun a clothing\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : (runner : RulebookRunner) => {\r\n let action = runner.noun;\r\n let noun = action.getClothing();\r\n if (!(noun instanceof Clothing)) {\r\n if (action.actor == WorldState.player) {\r\n action.say.add(\"You can only remove Clothing.\");\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n\r\n public static checkIsHeld = ActionRemove.check.createAndAddRule({\r\n name : \"Is noun worn\",\r\n firstPriority : Rule.PRIORITY_HIGH,\r\n code : async (runner : RulebookRunner) => {\r\n let action = runner.noun;\r\n let noun = action.getClothing();\r\n if (!Thing.WearRelation.isRight(action.actor, noun)) {\r\n if (action.actor == WorldState.player) {\r\n action.say.add(\"You are not wearing it.\");\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n\r\n public static carryDefault = ActionRemove.carry.createAndAddRule({\r\n name : \"Set Clothing as Carried\",\r\n firstPriority : Rule.PRIORITY_MEDIUM,\r\n code : (runner : RulebookRunner) => {\r\n let action = runner.noun;\r\n let noun = action.getClothing();\r\n Thing.CarryRelation.setRelation(action.actor, noun);\r\n\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n\r\n if (actor == WorldState.player) {\r\n action.say.add(new SayBold(( action.getNoun(0)).getPrintedName() + \": \"), \"Removed.\");\r\n } else {\r\n action.say.add(actor.getPrintedName() + \" takes off the \" + ( action.getNoun(0)).getPrintedName() + \".\");\r\n }\r\n }\r\n });\r\n}\r\n/**\r\n * Hyperlinking\r\n */\r\nElements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule(\r\n {\r\n name : \"Hyperlink - Remove\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let thing = rulebook.noun;\r\n\r\n if (thing instanceof Clothing && (Thing.WearRelation.isRight(WorldState.player, thing))) {\r\n Elements.HyperlinkHandler.addAvailableAction(\"Remove\", new ActionRemove(WorldState.player, thing));\r\n }\r\n }\r\n }\r\n));\r\n\r\n/**\r\n Inventory\r\n */\r\nElements.InventoryHandler.LinkingThing.addRule(new Rule(\r\n {\r\n name : \"Inventory - Remove\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let thing = rulebook.noun;\r\n\r\n if (thing instanceof Clothing && (Thing.WearRelation.isRight(WorldState.player, thing))) {\r\n Elements.InventoryHandler.printThingLink(\"R\", new ActionRemove(WorldState.player, thing));\r\n }\r\n }\r\n }\r\n));","/// \n/// \n/// \n/// \n/// \n/// \n\nclass ActionWear extends Action {\n public static check: Rulebook = new Rulebook(\"Check Wearing\");\n public static carry: Rulebook = new Rulebook(\"Carry out Wearing\");\n\n public constructor(actor: Thing, ...nouns: Array) {\n super(actor, ...nouns);\n this.extraChecks.push(ActionWear.check);\n this.extraCarries.push(ActionWear.carry);\n }\n\n /**\n * Needs to return a string explaining what the player will do if he does this action.\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\n * which would read as \"take thing\".\n * remember that things implement PRINTABLE interface, so you can get their names.\n * @returns {Say}\n */\n public getCommandText () {\n return \"wear \" + (this.getNoun(0) != undefined ? this.getNoun(0).getPrintedName() : \"\");\n }\n\n public getClothing () : Clothing{\n return this.getNoun(0);\n }\n\n public static checkIsWearable = ActionWear.check.createAndAddRule({\n name : \"Is noun a clothing\",\n firstPriority : Rule.PRIORITY_HIGHEST,\n code : (runner : RulebookRunner) => {\n let action = runner.noun;\n let noun = action.getClothing();\n if (!(noun instanceof Clothing)) {\n if (action.actor == WorldState.player) {\n action.say.add(\"You can only wear Clothing.\");\n }\n return false;\n }\n }\n });\n\n public static checkIsHeld = ActionWear.check.createAndAddRule({\n name : \"Is noun held\",\n firstPriority : Rule.PRIORITY_HIGH,\n code : async (runner : RulebookRunner) => {\n let action = runner.noun;\n let noun = action.getClothing();\n if (!Thing.CarryRelation.isRight(action.actor, noun)) {\n if (action.actor == WorldState.player) {\n action.say.add(\"(first taking the \", noun, \")\", Say.LINE_BREAK);\n }\n let takingAction = new ActionTake(action.actor, noun);\n let p = takingAction.execute();\n await p.then();\n action.say.add(takingAction.say);\n if (!Thing.CarryRelation.isRight(action.actor, noun)) {\n return false;\n }\n }\n }\n });\n\n public static carryDefault = ActionWear.carry.createAndAddRule({\n name : \"Set Clothing as Worn\",\n firstPriority : Rule.PRIORITY_MEDIUM,\n code : (runner : RulebookRunner) => {\n let action = runner.noun;\n let noun = action.getClothing();\n Thing.WearRelation.setRelation(action.actor, noun);\n\n let actor = action.actor;\n let thing = (action.getNoun(0));\n\n if (actor == WorldState.player) {\n action.say.add(new SayBold(( action.getNoun(0)).getPrintedName() + \": \"), \"Worn.\");\n } else {\n action.say.add(actor.getPrintedName() + \" puts on the \" + ( action.getNoun(0)).getPrintedName() + \".\");\n }\n }\n });\n}\n\n/**\n * Hyperlinking\n */\nElements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule(\n {\n name : \"Hyperlink - Wear\",\n firstPriority : Rule.PRIORITY_HIGHEST,\n code : (rulebook : RulebookRunner) => {\n let thing = rulebook.noun;\n\n if (thing instanceof Clothing && !(Thing.WearRelation.isRight(WorldState.player, thing))) {\n Elements.HyperlinkHandler.addAvailableAction(\"Wear\", new ActionWear(WorldState.player, thing));\n }\n }\n }\n));\n\n/**\n Inventory\n */\nElements.InventoryHandler.LinkingThing.addRule(new Rule(\n {\n name : \"Inventory - Wear\",\n firstPriority : Rule.PRIORITY_LOWEST,\n code : (rulebook : RulebookRunner) => {\n let thing = rulebook.noun;\n\n if (thing instanceof Clothing && !(Thing.WearRelation.isRight(WorldState.player, thing))) {\n Elements.InventoryHandler.printThingLink(\"W\", new ActionWear(WorldState.player, thing));\n }\n }\n }\n));","/// \r\n/// \r\n/// \r\n/// \r\n// TODO : Implements LiquidContainer for Milk udders. Maybe prostates.\r\n\r\ninterface HumanoidGender {\r\n hasPenis : boolean;\r\n hasPenisBulge : boolean;\r\n hasVagina : boolean;\r\n hasTits : boolean;\r\n genderValue : number; // Only includes clothing and bodyparts, good measure for bisexual NPCs\r\n genderValueCorrected : number; // Includes sexual characteristics being visible: breast size existing, a crotch bulge, etc. Heavily altered by a penis/vagina being out in the open\r\n}\r\n\r\ninterface HumanoidSluttiness {\r\n halfNaked : boolean;\r\n naked : boolean;\r\n sluttiness : number; // Only includes clothing\r\n sluttinessCorrected : number; // Includes mannerisms caused by personality\r\n}\r\n\r\ninterface HumanoidBulges {\r\n breasts : number;\r\n crotch : number;\r\n butt : number;\r\n waist : number;\r\n}\r\n\r\nclass Humanoid extends Person {\r\n public breastVisibleSize = 0;\r\n public isBreastVisible = false;\r\n public isBreastTight = false;\r\n public isBreastLoose = false;\r\n\r\n public crotchVisibleSize = 0;\r\n public isCrotchVisible = false;\r\n public isCrotchTight = false;\r\n\r\n public buttVisibleSize = 0;\r\n public isButtVisible = false;\r\n public isButtTight = false;\r\n\r\n public isGenderCached : boolean = false;\r\n public isSluttinessCached : boolean = false;\r\n public cachedGenderValue : HumanoidGender;\r\n public cachedSluttiness : HumanoidSluttiness;\r\n public cachedBulges : HumanoidBulges;\r\n\r\n public uncoveredSlots : Array = [];\r\n\r\n public invalidateCaches () {\r\n this.isGenderCached = false;\r\n this.isSluttinessCached = false;\r\n }\r\n\r\n public getGenderValue () : HumanoidGender {\r\n if (!this.isSluttinessCached) {\r\n this.updateCaches();\r\n }\r\n\r\n return this.cachedGenderValue;\r\n }\r\n\r\n public getSluttiness () : HumanoidSluttiness {\r\n if (!this.isSluttinessCached) {\r\n this.updateCaches();\r\n }\r\n\r\n return this.cachedSluttiness;\r\n }\r\n\r\n public getBulges () {\r\n if (!this.isGenderCached) {\r\n this.updateCaches();\r\n }\r\n return this.cachedBulges;\r\n }\r\n\r\n public updateCaches () {\r\n this.updateClothing();\r\n this.updateSlots();\r\n this.updateBodyparts();\r\n this.updateBulges();\r\n this.updateGenderValue();\r\n this.updateSluttiness();\r\n }\r\n\r\n public updateSlots () {\r\n this.uncoveredSlots = [];\r\n for (let i = 0; i < Humanoid.SLOT_SLOT_COUNT; i++) { this.uncoveredSlots.push(i); }\r\n\r\n let clothing = >Thing.WearRelation.getRightType(this, Clothing);\r\n for (let i = 0; i < clothing.length; i++) {\r\n let covering = clothing[i].getCoveringSlots();\r\n for (let k = 0; k < covering.length; k++) {\r\n let idx = this.uncoveredSlots.indexOf(covering[k]);\r\n if (idx >= 0) {\r\n this.uncoveredSlots.splice(idx, 1);\r\n }\r\n }\r\n\r\n if (this.uncoveredSlots.length == 0) break;\r\n }\r\n }\r\n\r\n public updateGenderValue () {\r\n let clothingGender = Clothing.getGenderValueOn(this);\r\n let bodypartGender = Bodypart.getGenderValueOn(this);\r\n\r\n let genderWeight = clothingGender.weight + bodypartGender.weight;\r\n let genderValue = clothingGender.value + bodypartGender.value;\r\n let correctionWeight = 0;\r\n let correctionValue = 0;\r\n\r\n let hasPenis : boolean = false;\r\n let hasVagina : boolean = false;\r\n if (this.isCrotchVisible) {\r\n // Does this have a vagina or not? It's visible, so it affects OBVIOUSLY MALE/FEMALE\r\n if (Thing.PartRelation.getRightTypeOne(this, HumanoidPenis) != undefined) {\r\n hasPenis = true;\r\n hasVagina = false;\r\n correctionValue += 0 * Bodypart.WEIGHT_HIGHEST;\r\n correctionWeight += Bodypart.WEIGHT_HIGHEST;\r\n } else if (Thing.PartRelation.getRightTypeOne(this, HumanoidVagina) != undefined) {\r\n hasPenis = false;\r\n hasVagina = true;\r\n correctionValue += 100 * Bodypart.WEIGHT_HIGHEST;\r\n correctionWeight += Bodypart.WEIGHT_HIGHEST;\r\n }\r\n }\r\n\r\n if (this.breastVisibleSize > 0) {\r\n correctionValue += 80;\r\n correctionWeight += Bodypart.WEIGHT_HIGH;\r\n }\r\n\r\n if (this.crotchVisibleSize > 0 && !hasVagina) {\r\n correctionValue += 20;\r\n correctionWeight += Bodypart.WEIGHT_HIGH;\r\n }\r\n\r\n let genderValueFinal = genderValue / genderWeight;\r\n let genderValueCorrected = (genderValue + correctionValue) / (genderWeight + correctionWeight);\r\n\r\n this.cachedGenderValue = {\r\n hasTits : this.breastVisibleSize > 0,\r\n hasPenisBulge : this.crotchVisibleSize > 0 && !hasVagina, //safe guard against puffy vaginas if they ever come up\r\n hasPenis : hasPenis,\r\n hasVagina : hasVagina,\r\n genderValue : genderValueFinal,\r\n genderValueCorrected : genderValueCorrected\r\n };\r\n this.isGenderCached = true;\r\n }\r\n\r\n public isVisibleOn (slot : number) {\r\n return this.uncoveredSlots.indexOf(slot) != -1;\r\n }\r\n\r\n public updateSluttiness () {\r\n let clothingSluttiness = Clothing.getSluttinessValueOn(this);\r\n let bodypartSluttiness = Bodypart.getSluttinessValueOn(this);\r\n\r\n let sluttinessWeight = clothingSluttiness.weight + bodypartSluttiness.weight;\r\n let sluttinessValue = clothingSluttiness.value + bodypartSluttiness.value;\r\n\r\n let correctionWeight = 0;\r\n let correctionValue = 0;\r\n\r\n let somewhatSlutty = [Humanoid.SLOT_MIDRIFF, Humanoid.SLOT_LEG_UPPER, Humanoid.SLOT_WAIST, Humanoid.SLOT_HIPS, Humanoid.SLOT_BACK];\r\n for (let i = 0; i < somewhatSlutty.length; i++) {\r\n if (this.isVisibleOn(somewhatSlutty[i])) {\r\n correctionWeight += 1;\r\n correctionValue += 75;\r\n }\r\n }\r\n\r\n let verySlutty = [Humanoid.SLOT_BREASTS, Humanoid.SLOT_CROTCH_FRONT, Humanoid.SLOT_CROTCH_BACK, Humanoid.SLOT_BUTT];\r\n for (let i = 0; i < verySlutty.length; i++) {\r\n if (this.isVisibleOn(verySlutty[i])) {\r\n correctionWeight += 3;\r\n correctionValue += 75;\r\n }\r\n }\r\n\r\n if ((this.isVisibleOn.length / Humanoid.SLOT_SLOT_COUNT) > 0.75) {\r\n let extremeSlutty = [Humanoid.SLOT_BREASTS, Humanoid.SLOT_CROTCH_FRONT, Humanoid.SLOT_CROTCH_BACK, Humanoid.SLOT_BUTT];\r\n for (let i = 0; i < extremeSlutty.length; i++) {\r\n if (this.isVisibleOn(extremeSlutty[i])) {\r\n correctionWeight += 5;\r\n correctionValue += 85;\r\n }\r\n }\r\n }\r\n\r\n let sluttinessValueFinal = sluttinessValue / sluttinessWeight;\r\n let sluttinessCorrected = (sluttinessValue + correctionValue) / (sluttinessWeight + correctionWeight);\r\n\r\n this.cachedSluttiness = {\r\n halfNaked : (this.isVisibleOn.length / Humanoid.SLOT_SLOT_COUNT) < 0.4,\r\n naked : (this.isVisibleOn.length / Humanoid.SLOT_SLOT_COUNT) < 0.4 &&\r\n this.isVisibleOnArray([Humanoid.SLOT_BREASTS, Humanoid.SLOT_CROTCH_FRONT, Humanoid.SLOT_CROTCH_BACK, Humanoid.SLOT_BUTT]),\r\n sluttiness : sluttinessValueFinal,\r\n sluttinessCorrected : sluttinessCorrected\r\n };\r\n this.isSluttinessCached = true;\r\n }\r\n\r\n public isVisibleOnArray (arr : Array) {\r\n for (let i =0 ; i < arr.length; i++) {\r\n if (!this.isVisibleOn(arr[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public constructor (options? : ThingOptions) {\r\n super(options);\r\n this.addParts(\r\n new HumanoidSkin(), new HumanoidHead(), new HumanoidArms(),\r\n new HumanoidHands(), new HumanoidBreasts(), new HumanoidFeet()\r\n );\r\n }\r\n\r\n public updateBodyparts () {\r\n let parts = > Thing.PartRelation.getRightType(this, Bodypart);\r\n for (let i = 0; i < parts.length; i++) {\r\n parts[i].updateStatus();\r\n }\r\n }\r\n\r\n public updateClothing () {\r\n let clothes = > Thing.WearRelation.getRightType(this, Clothing);\r\n for (let i = 0; i < clothes.length; i++) {\r\n clothes[i].updateStatus();\r\n }\r\n }\r\n\r\n public updateBulges () {\r\n let clothes = Thing.WearRelation.getRightType(this, Clothing).sort(function (a : Clothing, b : Clothing) {\r\n return a.layer - b.layer;\r\n });\r\n\r\n this.isBreastVisible = true;\r\n this.isCrotchVisible = true;\r\n this.isButtVisible = true;\r\n\r\n let bras = [];\r\n let butts = [];\r\n let junks = [];\r\n\r\n clothes.forEach((cloth : Clothing) => {\r\n cloth.updateStatus();\r\n if (cloth.slots.indexOf(Humanoid.SLOT_BREASTS) != -1) {\r\n bras.push(cloth);\r\n if (cloth.transparentSlots.indexOf(Humanoid.SLOT_BREASTS) == -1) {\r\n this.isBreastVisible = false;\r\n }\r\n }\r\n if (cloth.slots.indexOf(Humanoid.SLOT_BUTT) != -1) {\r\n butts.push(cloth);\r\n if (cloth.transparentSlots.indexOf(Humanoid.SLOT_BUTT) == -1) {\r\n this.isButtVisible = false;\r\n }\r\n }\r\n if (cloth.slots.indexOf(Humanoid.SLOT_CROTCH_FRONT) != -1) {\r\n junks.push(cloth);\r\n if (cloth.transparentSlots.indexOf(Humanoid.SLOT_CROTCH_FRONT) == -1) {\r\n this.isCrotchVisible = false;\r\n }\r\n }\r\n });\r\n\r\n this.updateBreastSizes(bras);\r\n this.updateCrotchSizes(junks);\r\n this.updateButtSizes(butts);\r\n\r\n this.cachedBulges = {\r\n breasts : this.breastVisibleSize,\r\n butt : this.buttVisibleSize,\r\n crotch : this.crotchVisibleSize,\r\n waist : 0\r\n };\r\n }\r\n\r\n public getTopClothOn (slot : number) {\r\n return Thing.WearRelation.getRightType(this, Clothing).filter(otherCloth => {\r\n return otherCloth.visibleOn.includes(slot);\r\n }).sort((a : Clothing, b : Clothing) => {\r\n return a.layer - b.layer;\r\n })[0];\r\n }\r\n\r\n public updateBreastSizes (bras : Array) {\r\n this.isBreastTight = false;\r\n this.isBreastLoose = true;\r\n let breasts = Thing.PartRelation.getRightTypeOne(this, HumanoidBreasts);\r\n this.breastVisibleSize = breasts.getSize();\r\n bras.forEach((bra : Clothing) => {\r\n if (bra.tightBreastSize >= 0 && this.breastVisibleSize > bra.tightBreastSize) {\r\n this.isBreastTight = true;\r\n }\r\n\r\n if (bra.maxBreastSize >= 0 && this.breastVisibleSize > bra.maxBreastSize) {\r\n this.breastVisibleSize = bra.maxBreastSize;\r\n }\r\n\r\n if (this.breastVisibleSize >= bra.looseBreastSize) {\r\n this.isBreastLoose = false;\r\n }\r\n\r\n this.breastVisibleSize += bra.breastPadding;\r\n if (this.breastVisibleSize < 0) {\r\n this.breastVisibleSize = 0;\r\n }\r\n });\r\n }\r\n\r\n public updateCrotchSizes (cloths : Array) {\r\n this.isCrotchTight = false;\r\n this.crotchVisibleSize = 0;\r\n let penis = Thing.PartRelation.getRightTypeOne(this, HumanoidPenis);\r\n let testicles = Thing.PartRelation.getRightTypeOne(this, HumanoidTesticles);\r\n this.crotchVisibleSize = 0;\r\n if (penis != undefined) {\r\n this.crotchVisibleSize += penis.getBulgeSize();\r\n }\r\n if (testicles != undefined) {\r\n this.crotchVisibleSize += testicles.size;\r\n }\r\n\r\n cloths.forEach((worn : Clothing) => {\r\n if (worn.tightCrotchSize >= 0 && this.crotchVisibleSize > worn.tightCrotchSize) {\r\n this.isCrotchTight = true;\r\n }\r\n\r\n if (worn.maxCrotchSize >= 0 && this.crotchVisibleSize > worn.maxCrotchSize) {\r\n this.crotchVisibleSize = worn.maxCrotchSize;\r\n }\r\n\r\n this.crotchVisibleSize += worn.crotchPadding;\r\n if (this.crotchVisibleSize < 0) {\r\n this.crotchVisibleSize = 0;\r\n }\r\n });\r\n }\r\n\r\n public updateButtSizes (cloths : Array) {\r\n this.isButtTight = false;\r\n let butt = Thing.PartRelation.getRightTypeOne(this, HumanoidButt);\r\n this.buttVisibleSize = butt == undefined ? 0 : butt.getSize();\r\n\r\n cloths.forEach((worn : Clothing) => {\r\n if (worn.tightButtSize >= 0 && this.buttVisibleSize > worn.tightButtSize) {\r\n this.isButtTight = true;\r\n }\r\n\r\n if (worn.maxButtSize >= 0 && this.buttVisibleSize > worn.maxButtSize) {\r\n this.buttVisibleSize = worn.maxButtSize;\r\n }\r\n\r\n this.buttVisibleSize += worn.buttPadding;\r\n if (this.buttVisibleSize < 0) {\r\n this.buttVisibleSize = 0;\r\n }\r\n });\r\n }\r\n\r\n public static SLOT_HAIR = 0;\r\n public static SLOT_HEADGEAR = 1;\r\n public static SLOT_FACE = 2;\r\n public static SLOT_EARS = 3;\r\n public static SLOT_EYES = 4;\r\n public static SLOT_NOSE = 5;\r\n public static SLOT_MOUTH = 6;\r\n public static SLOT_NECK = 7;\r\n public static SLOT_SHOULDERS = 8;\r\n public static SLOT_ARMS = 9;\r\n public static SLOT_HANDS = 10;\r\n public static SLOT_FINGERS = 11;\r\n public static SLOT_FINGERNAILS = 12;\r\n public static SLOT_UPPER_CHEST = 13;\r\n public static SLOT_MIDRIFF = 14;\r\n public static SLOT_WAIST = 15;\r\n public static SLOT_BACK = 16;\r\n public static SLOT_HIPS = 17;\r\n public static SLOT_CROTCH_FRONT = 18;\r\n public static SLOT_CROTCH_BACK = 19;\r\n public static SLOT_BUTT = 20;\r\n public static SLOT_LEG_UPPER = 21;\r\n public static SLOT_LEG_LOWER = 22;\r\n public static SLOT_FEET = 23;\r\n public static SLOT_FEET_NAILS = 24;\r\n public static SLOT_BREASTS = 25;\r\n public static SLOT_SLOT_COUNT = 26;\r\n\r\n public static cacheInvalidationActionRule = new Rule({\r\n name : \"Invalidate humanoid caches\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n code : (runner : RulebookRunner) => {\r\n ( runner.noun.actor).invalidateCaches();\r\n },\r\n conditions : (runner : RulebookRunner) => {\r\n return runner.noun.actor instanceof Humanoid;\r\n }\r\n });\r\n}\r\n\r\nActionWear.carry.addRule(Humanoid.cacheInvalidationActionRule);\r\nActionRemove.carry.addRule(Humanoid.cacheInvalidationActionRule);","/// \r\nclass HumanoidMale extends Humanoid {\r\n public constructor (options? : ThingOptions) {\r\n super(options);\r\n this.addParts(\r\n new HumanoidTesticles(), new HumanoidPenis()\r\n );\r\n }\r\n}\r\n\r\nclass HumanoidFemale extends Humanoid {\r\n public constructor (options? : ThingOptions) {\r\n super(options);\r\n this.addParts(\r\n new HumanoidVagina()\r\n );\r\n\r\n let breasts = Thing.PartRelation.getRightTypeOne(this, HumanoidBreasts);\r\n if (breasts != undefined) {\r\n breasts.size = 3;\r\n }\r\n }\r\n}","/// \r\n/// \r\n/// \r\n\r\nmodule WorldState {\r\n var worldTurn : number = 0;\r\n var playerTurn : number = 0;\r\n export var player : Person = new HumanoidFemale();\r\n\r\n var rememberedRooms : Array = [];\r\n var rememberedFodder : Array = [];\r\n\r\n export function isTurnWaiting () {\r\n return worldTurn < playerTurn;\r\n }\r\n\r\n export function incrementWorldTurn () {\r\n worldTurn++;\r\n }\r\n\r\n export function incrementPlayerTurn () {\r\n playerTurn++;\r\n }\r\n\r\n export function getCurrentTurn () {\r\n return worldTurn;\r\n }\r\n\r\n export function isRoomInMap (room : Room) {\r\n let maps = > Thing.CarryRelation.getRightType(player, MapNote);\r\n for (let i = 0; i < maps.length; i++) {\r\n if (maps[i].contains(room)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n export function isRoomRemembered (room : Room) {\r\n return rememberedRooms.indexOf(room) != -1 || rememberedFodder.indexOf(room) != -1\r\n || isRoomInMap(room);\r\n }\r\n\r\n export function getRememberedRooms () {\r\n return rememberedRooms;\r\n }\r\n\r\n export function getMaximumRememberedRooms () {\r\n return player.getIntelligence() * 2;\r\n }\r\n\r\n export function truncateRooms () {\r\n while (rememberedRooms.length > getMaximumRememberedRooms()){\r\n rememberedRooms.pop();\r\n }\r\n }\r\n\r\n export function rememberRoom (...rooms : Array) {\r\n rooms.forEach((value) => {\r\n if (value instanceof Room) {\r\n let idx = rememberedRooms.indexOf(value);\r\n if (idx != -1) {\r\n rememberedRooms.splice(idx, 1);\r\n }\r\n rememberedRooms.unshift(value);\r\n }\r\n });\r\n truncateRooms();\r\n }\r\n\r\n export function saveState () {\r\n let things = {\r\n carried : [],\r\n worn : [],\r\n wielded : []\r\n }\r\n }\r\n}","class Conversation {\r\n private nodes : Array = [];\r\n private sorted : boolean = false;\r\n private lastNode : Dialogue;\r\n\r\n public async execute () {\r\n if (!this.sorted) this.sort();\r\n let nodeRunner = 0;\r\n this.lastNode = undefined;\r\n\r\n let nextNode = this.nodes[nodeRunner];\r\n while (nextNode != undefined) {\r\n if (nextNode.isValid()) {\r\n let p = nextNode.execute();\r\n let result;\r\n await p.then((innerResult) => {\r\n result = innerResult;\r\n });\r\n if (result instanceof Dialogue) {\r\n nextNode = result;\r\n continue;\r\n } else {\r\n return;\r\n }\r\n }\r\n nextNode = this.nodes[++nodeRunner]\r\n }\r\n }\r\n\r\n public sort () {\r\n this.nodes.sort(function (a : Dialogue, b : Dialogue) {\r\n return a.compareTo(b);\r\n });\r\n this.sorted = true;\r\n }\r\n\r\n public addNode (node : Dialogue) {\r\n this.sorted = false;\r\n this.nodes.push(node);\r\n }\r\n}","/// \r\ninterface DialogueOptions {\r\n name : string;\r\n firstPriority? : number;\r\n priority? : number;\r\n nodeCondition? : () => boolean;\r\n nodeCode : (dialogue : Dialogue) => (Promise | Dialogue | void);\r\n}\r\n\r\nclass Dialogue {\r\n private name : string;\r\n private priority : number = 0;\r\n private firstPriority : number = 0;\r\n public nodeCondition : () => boolean;\r\n public nodeCode : (dialogue : Dialogue) => (Promise | Dialogue | void);\r\n public codeLocation : Error;\r\n\r\n public constructor (options : DialogueOptions) {\r\n this.priority = options.priority != undefined ? options.priority : Rule.PRIORITY_MEDIUM;\r\n this.firstPriority = options.firstPriority != undefined ? options.firstPriority : Rule.PRIORITY_MEDIUM;\r\n this.name = options.name;\r\n this.nodeCondition = options.nodeCondition;\r\n this.nodeCode = options.nodeCode;\r\n this.codeLocation = new Error();\r\n }\r\n\r\n public async execute () {\r\n Settings.hardDebug && console.debug(\"Dialogue: \" + this.name, this.codeLocation);\r\n var p = this.nodeCode(this);\r\n\r\n if (p instanceof Promise) {\r\n let result;\r\n await p.then((innerResult) => {\r\n result = innerResult;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n return p;\r\n }\r\n\r\n public isValid () {\r\n if (this.nodeCondition != undefined) {\r\n return this.nodeCondition.apply(this);\r\n }\r\n return true;\r\n }\r\n\r\n public compareTo (b : Dialogue) {\r\n var a = this;\r\n // Higher priority goes first as this is a rolling array\r\n if (b.firstPriority < a.firstPriority) return -1;\r\n if (a.firstPriority < b.firstPriority) return 1;\r\n if (b.priority < a.priority) return -1;\r\n if (a.priority < b.priority) return 1;\r\n return 0;\r\n }\r\n\r\n public static PRIORITY_HIGHEST : number = 20;\r\n public static PRIORITY_HIGH : number = 15;\r\n public static PRIORITY_MEDIUM : number = 10;\r\n public static PRIORITY_LOW : number = 5;\r\n public static PRIORITY_LOWEST : number = 0;\r\n}","/// \r\nclass Region {\r\n public name : string;\r\n\r\n public constructor (name : string) {\r\n this.name = name;\r\n }\r\n\r\n public static RegionRoom = new RelationOneToMany();\r\n public static RegionRegion = new RelationOneToMany();\r\n public static InRelation = new RelationHandlerStrictOneToMany(Region.RegionRegion, Region.RegionRoom);\r\n\r\n public place (...rooms : Array) {\r\n rooms.forEach(room => {\r\n if (room instanceof Room) {\r\n Region.RegionRoom.setRelation(this, room);\r\n } else {\r\n Region.RegionRegion.setRelation(this, room);\r\n }\r\n });\r\n }\r\n\r\n public getRooms () {\r\n let rooms = > Region.RegionRoom.getRight(this);\r\n Region.RegionRegion.getRight(this).forEach((region : Region) => {\r\n (> Region.RegionRoom.getRight(region)).forEach((room : Room) => {\r\n rooms.push(room);\r\n });\r\n });\r\n return rooms;\r\n }\r\n\r\n public contains (thing : Thing) {\r\n let room = thing.getRoom();\r\n if (room == undefined) {\r\n return false;\r\n } else {\r\n let regions = Region.InRelation.getAllLeft(room);\r\n return regions.indexOf(this) != -1;\r\n }\r\n }\r\n}","/**\r\n * Warning: Shufflers will alter the given array\r\n */\r\nclass Shuffler {\r\n private array : Array;\r\n private position = 0;\r\n\r\n /**\r\n * Maybe use seeded random some day\r\n */\r\n private rng : () => number;\r\n\r\n public constructor (array : Array, rng? : () => number) {\r\n this.rng = rng == undefined ? Math.random : rng;\r\n this.array = array;\r\n }\r\n\r\n public restart () {\r\n this.position = 0;\r\n }\r\n\r\n /**\r\n * Gets a random element from the Shuffler Array\r\n * Can be called repeatedly\r\n * When there are no more elements left, returns undefined\r\n * @returns {T}\r\n */\r\n public getOne () : T {\r\n // get a random element from this.position to (array.length - 1)\r\n // store it locally\r\n // switch it with array[this.position]\r\n // return it\r\n if (this.position >= this.array.length) {\r\n return undefined;\r\n }\r\n let randomIndex = Math.floor(this.rng() * (this.array.length - this.position)) + this.position;\r\n let localCopy = this.array[this.position];\r\n this.array[this.position] = this.array[randomIndex];\r\n this.array[randomIndex] = localCopy;\r\n return this.array[this.position++];\r\n }\r\n\r\n /**\r\n * There should be no reason to use this with the \"getOne\" code above.\r\n * @returns {T[]}\r\n */\r\n public getShuffled () : Array {\r\n let array = this.array.slice(0);\r\n var m = array.length, t, i;\r\n while (m) {\r\n i = Math.floor(this.rng() * m--);\r\n t = array[m];\r\n array[m] = array[i];\r\n array[i] = t;\r\n }\r\n\r\n return array;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nclass ActionDrop extends Action {\r\n public static check = new Rulebook(\"Check Dropping\");\r\n public static carry = new Rulebook(\"Carry out Dropping\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n super(actor, ...nouns);\r\n this.extraChecks.push(ActionDrop.check);\r\n this.extraCarries.push(ActionDrop.carry);\r\n }\r\n\r\n /**\r\n * Needs to return a string explaining what the player will do if he does this action.\r\n * For instance, ActionTaking should return something like return \"take \" + this.nouns[0].getName(),\r\n * which would read as \"take thing\".\r\n * remember that things implement PRINTABLE interface, so you can get their names.\r\n * @returns {Say}\r\n */\r\n public getCommandText () {\r\n return \"drop \" + (this.getNoun(0) != undefined ? this.getNoun(0).getPrintedName() : \"\");\r\n }\r\n}\r\n\r\nActionDrop.check.addRule(\r\n new Rule({\r\n name : \"Check Dropping - Are you Wearing it?\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n code : async (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n\r\n if (Thing.WearRelation.getLeft(thing) == actor || Thing.WieldRelation.getLeft(thing) == actor){\r\n if (action.actor == WorldState.player) {\r\n action.say.add(\"(first taking off the \", thing, \")\", Say.LINE_BREAK);\r\n }\r\n let takingAction = new ActionRemove(actor, thing);\r\n let p = takingAction.execute();\r\n await p.then();\r\n action.say.add(takingAction.say);\r\n if (Thing.WearRelation.getLeft(thing) == actor || Thing.WieldRelation.getLeft(thing) == actor) {\r\n return false;\r\n }\r\n action.say.add(Say.LINE_BREAK);\r\n }\r\n }\r\n })\r\n);\r\n\r\nActionDrop.check.addRule(\r\n new Rule({\r\n name : \"Check Dropping - Do you have it??\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n\r\n if (Thing.CarryRelation.getLeft(thing) != actor){\r\n if (actor == WorldState.player) {\r\n action.say.add(\"You don't have it.\");\r\n }\r\n return false;\r\n }\r\n }\r\n })\r\n);\r\n\r\nActionDrop.carry.addRule(\r\n new Rule({\r\n name : \"Dropping - Place the noun on the floor\",\r\n code : (rulebook : RulebookRunner) => {\r\n let action = rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (action.getNoun(0));\r\n\r\n Thing.EnclosedRelation.unsetRight(thing);\r\n\r\n actor.getRoom().place(thing);\r\n\r\n if (actor == WorldState.player) {\r\n action.say.add(new SayBold(( action.getNoun(0)).getPrintedName() + \": \"), \"Dropped.\");\r\n } else {\r\n action.say.add(actor.getPrintedName() + \" drops \" + ( action.getNoun(0)).getPrintedName() + \" on the floor.\");\r\n }\r\n }\r\n })\r\n);\r\n\r\n/**\r\n * Hyperlinking\r\n */\r\nElements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule(\r\n {\r\n name : \"Hyperlink - Drop\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let thing = rulebook.noun;\r\n\r\n if (Thing.CarryRelation.getLeft(thing) == WorldState.player || Thing.WieldRelation.getLeft(thing) == WorldState.player || Thing.WearRelation.getLeft(thing) == WorldState.player) {\r\n Elements.HyperlinkHandler.addAvailableAction(\"Drop\", new ActionDrop(WorldState.player, thing));\r\n }\r\n }\r\n }\r\n));\r\n\r\n/**\r\n Inventory\r\n */\r\nElements.InventoryHandler.LinkingThing.addRule(new Rule(\r\n {\r\n name : \"Inventory - Drop\",\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n code : (rulebook : RulebookRunner) => {\r\n let thing = rulebook.noun;\r\n\r\n Elements.InventoryHandler.printThingLink(\"D\", new ActionDrop(WorldState.player, thing));\r\n }\r\n }\r\n));","/// \r\n/// \r\nclass ActionWait extends Action {\r\n public requiresTurn = true;\r\n public requiresNoun = false;\r\n public requiresVisibility = false;\r\n public static check : Rulebook = new Rulebook(\"Check Waiting\");\r\n public static carry : Rulebook = new Rulebook(\"Carry out Waiting\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array) {\r\n super(actor, ...nouns);\r\n this.extraChecks.push(ActionWait.check);\r\n this.extraCarries.push(ActionWait.carry);\r\n }\r\n\r\n public getCommandText () {\r\n return \"wait\";\r\n }\r\n}\r\n\r\nActionWait.carry.addRule(new Rule({\r\n name : \"Print waiting message\",\r\n code : runner => {\r\n if (runner.noun.actor == WorldState.player) {\r\n runner.noun.say.add(\"You wait.\");\r\n }\r\n }\r\n}));\r\n\r\nElements.HyperlinkHandler.CommonActionsRulebook.addRule(new Rule({\r\n name : \"Add Wait Command Rule\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n priority : Rule.PRIORITY_MEDIUM,\r\n code : (rulebook : RulebookRunner) => {\r\n Elements.HyperlinkHandler.addCommonAction(\"Wait\", new ActionWait(WorldState.player));\r\n }\r\n}));","/// \r\nclass BranchingOption {\r\n public say : Say;\r\n public appearCondition : () => boolean;\r\n public previouslyPicked : boolean = false;\r\n\r\n public constructor (say : Say, appearCondition? : () => boolean) {\r\n this.say = say;\r\n this.appearCondition = appearCondition;\r\n }\r\n}\r\n\r\nclass BranchingDialogue {\r\n private options : Array = [];\r\n private resolve : Function;\r\n\r\n public constructor (...options : Array) {\r\n this.addOptions(...options);\r\n }\r\n\r\n public addOptions (...options : Array) {\r\n this.options.push(...options);\r\n arrayUnique(this.options);\r\n }\r\n\r\n public async getChosenOption () : Promise {\r\n let validOptions = [];\r\n\r\n for (let i = 0, value = this.options[i]; value != undefined; value = this.options[++i]) {\r\n if (value.appearCondition == undefined || value.appearCondition()) {\r\n validOptions.push(value);\r\n }\r\n }\r\n\r\n let choiceButtons = [];\r\n\r\n for (let i = 0; i < validOptions.length; i++) {\r\n let value = validOptions[i];\r\n let classes = [\"choice\"];\r\n if (value.previouslyPicked) {\r\n classes.push(\"picked\");\r\n }\r\n await value.say.getHTML(\"p\", classes).then(elements => {\r\n choiceButtons.push(elements[0]);\r\n });\r\n }\r\n\r\n let PlayerInput : Promise = new Promise((resolve, reject) => {\r\n this.resolve = resolve;\r\n });\r\n\r\n Controls.KeyHandler.reset();\r\n\r\n for (let index = 0, value = choiceButtons[index]; value != undefined; value = choiceButtons[++index]) {\r\n Controls.KeyHandler.applyCode(value, Controls.KeyHandler.getFirstKeyCode());\r\n value.addEventListener(\"click\", () => {\r\n validOptions[index].previouslyPicked = true;\r\n this.resolve(validOptions[index]);\r\n });\r\n }\r\n\r\n Elements.CurrentTurnHandler.print(...choiceButtons);\r\n\r\n let choice;\r\n\r\n await PlayerInput.then(value => {\r\n choice = value;\r\n });\r\n\r\n Elements.CurrentTurnHandler.unprint(...choiceButtons);\r\n\r\n return choice;\r\n }\r\n}","/// \r\ninterface TrickierOptions {\r\n region : RegionRandom;\r\n map : RoomRandomMap;\r\n otherRoom : RoomRandom;\r\n}\r\n\r\ninterface TrickyOptions extends TrickierOptions {\r\n otherRoomDirection : number;\r\n trickyRoomDirection : number;\r\n x : number;\r\n y : number;\r\n}\r\n\r\ninterface RoomRandomNode {\r\n room : RoomRandom;\r\n coordinates : Array;\r\n distance : number;\r\n}\r\n\r\nclass RoomRandom extends Room {\r\n public connectableOn : Array = [Room.NORTH, Room.SOUTH, Room.EAST, Room.WEST];\r\n public randomizable = true; // non-randomizable rooms don't get placed automatically\r\n public placed = false;\r\n public appearChance = 75;\r\n public extraConnectionChance = 75; // Requires two successes\r\n public backgroundImage = \"tomato\";\r\n\r\n public lastMap : RoomRandomMap;\r\n\r\n public getBackgroundClass () {\r\n if (this.isImageDefined()) {\r\n return this.backgroundImage;\r\n }\r\n return \"tomato\";\r\n }\r\n\r\n private isImageDefined () {\r\n for(var i = 0; i < document.styleSheets.length; i++) {\r\n var rules = document.styleSheets[i]['rules'] || document.styleSheets[i]['cssRules'];\r\n for(var x in rules) {\r\n if(typeof rules[x].selectorText == 'string' && rules[x].selectorText == \".\" + this.backgroundImage) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public isConnectableOn (oppositeDirection : number) {\r\n return this.connectableOn.indexOf(oppositeDirection) != -1;\r\n }\r\n\r\n public trickyCode : (options : TrickyOptions) => boolean;\r\n\r\n public getAnyDirection (options : TrickierOptions) : TrickyOptions {\r\n let directionShuffler = new Shuffler(this.connectableOn);\r\n for (let direction = directionShuffler.getOne(); direction != undefined; direction = directionShuffler.getOne()) {\r\n let oppositeDirection = Room.oppositeDirection(direction);\r\n let otherCoordinates = options.map.getCoordinates(options.otherRoom);\r\n let wouldbeCoordinates = Room.shift(otherCoordinates, oppositeDirection);\r\n let trickyOptions = {\r\n otherRoom : options.otherRoom,\r\n otherRoomDirection : oppositeDirection,\r\n trickyRoomDirection : direction,\r\n map : options.map,\r\n region : options.region,\r\n x : wouldbeCoordinates[0],\r\n y : wouldbeCoordinates[1]\r\n };\r\n\r\n if (this.isPlaceable(trickyOptions)) {\r\n return trickyOptions;\r\n }\r\n }\r\n }\r\n\r\n public isPlaceable (options : TrickyOptions) {\r\n if (!this.isConnectableOn(options.trickyRoomDirection) || !options.map.isFree(options.x, options.y)) {\r\n // This can't connect through that!\r\n // That coordinate isn't free!\r\n return false;\r\n }\r\n\r\n if (options.otherRoom == undefined || !options.otherRoom.isConnectableOn(options.otherRoomDirection)) {\r\n // There is no other room there?\r\n // The other room doesn't like it this way\r\n return false;\r\n }\r\n\r\n // Do I have my own tricky code?\r\n if (this.trickyCode != undefined) {\r\n return this.trickyCode(options);\r\n }\r\n\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * This implementation is sufficiently fast for constant use.\r\n * @param pathEnd\r\n * @param map\r\n * @param availableRooms\r\n * @returns {Array}\r\n */\r\n public findPathTo (pathEnd : RoomRandom, validRoom? : (room : RoomRandom) => boolean) {\r\n validRoom = validRoom == undefined ? () => {return true;} : validRoom;\r\n let map = this.lastMap;\r\n let endPosition = map.getCoordinates(pathEnd);\r\n let open = [];\r\n\r\n let distance = (c1, c2) => {\r\n return Math.abs(c1[0] - c2[0]) + Math.abs(c1[1] - c2[1]);\r\n };\r\n\r\n let neighbors = (room : RoomRandom, x : number, y : number) => {\r\n let neighs = [];\r\n for (let direction = 0; direction < room.connections.length; direction++) {\r\n let otherRoom = room.connections[direction];\r\n if (otherRoom != undefined && open.indexOf(otherRoom) == -1 && validRoom( otherRoom)) {\r\n let dirCoordinates = Room.shift([x, y], direction);\r\n let dir = [otherRoom, dirCoordinates, distance(endPosition, dirCoordinates)];\r\n neighs.push(dir);\r\n }\r\n }\r\n return neighs.sort((a,b) => { return ( a[2]) - ( b[2]);});\r\n };\r\n\r\n\r\n let shortestPath = {\r\n length : map.getRoomCount()\r\n };\r\n let noPath = shortestPath;\r\n let cPath = [];\r\n let findPath = (myArray) => {\r\n let room = myArray[0];\r\n cPath.push(myArray);\r\n if (room == pathEnd) {\r\n if (shortestPath.length >= cPath.length) {\r\n shortestPath = cPath.slice(0);\r\n }\r\n } else if (shortestPath.length > (cPath.length)) {\r\n open.push(room);\r\n let otherRooms = neighbors(room, myArray[1][0], myArray[1][1]);\r\n for (let i = 0; i < otherRooms.length; i++) {\r\n if ((cPath.length + 1) < shortestPath.length) {\r\n findPath(otherRooms[i]);\r\n }\r\n }\r\n open.pop();\r\n }\r\n cPath.pop();\r\n };\r\n\r\n findPath([this, map.getCoordinates(this)]);\r\n return shortestPath != noPath ? shortestPath : undefined;\r\n }\r\n\r\n public getBestDirectionTo (otherRoom : RoomRandom, validRoom? : (room : RoomRandom) => boolean) {\r\n let path = this.findPathTo(otherRoom, validRoom);\r\n if (path != undefined) {\r\n if (path.length == 1) {\r\n return undefined;\r\n }\r\n return this.connections.indexOf(path[1][0]);\r\n }\r\n }\r\n\r\n public getAStarPathTo (otherRoom : RoomRandom, validRoom? : (room : RoomRandom) => boolean) {\r\n validRoom = validRoom != undefined ? validRoom : () => {return true};\r\n\r\n let distance = (c1, c2) => {\r\n return Math.abs(c1[0] - c2[0]) + Math.abs(c1[1] - c2[1]);\r\n };\r\n\r\n let isVisited = (room) => {\r\n return visited.indexOf(room) != -1;\r\n };\r\n\r\n let getNeighbors = (node : RoomRandomNode) => {\r\n let neighbors : Array = [];\r\n for (let direction = 0; direction < node.room.connections.length; direction++) {\r\n if (node.room.connections[direction] != undefined && !isVisited(node.room.connections[direction]) && validRoom( node.room.connections[direction])) {\r\n let coordinates = Room.shift(node.coordinates, direction);\r\n neighbors.push({\r\n room : node.room.connections[direction],\r\n coordinates : coordinates,\r\n distance : distance(coordinates, endNode.coordinates)\r\n });\r\n visited.push( node.room.connections[direction]);\r\n }\r\n }\r\n return neighbors;\r\n };\r\n\r\n let getClosestPath = () => {\r\n let shortest = 0;\r\n for (let i = 1; i < open.length; i++) {\r\n let lastPoint = open[i][open[i].length - 1];\r\n if (lastPoint.distance < open[shortest][open[shortest].length - 1].distance) {\r\n shortest = i;\r\n }\r\n }\r\n return shortest;\r\n };\r\n\r\n\r\n let endNode = {room : otherRoom, coordinates : this.lastMap.getCoordinates(otherRoom), distance : 0};\r\n let startCoordinates = this.lastMap.getCoordinates(this);\r\n let startNode = {room : this, coordinates : startCoordinates, distance : distance(startCoordinates, endNode.coordinates)};\r\n let open : Array> = [[startNode]];\r\n let closed : Array> = [];\r\n let shortestPath = this.lastMap.getRoomCount();\r\n let shortestIndex;\r\n let myPath;\r\n let closest = 0;\r\n let visited : Array = [this];\r\n while (open.length > 0) {\r\n myPath = open.splice(closest, 1)[0];\r\n\r\n if (myPath[myPath.length - 1].distance == 0) {\r\n let push = closed.push(myPath);\r\n if (myPath.length < shortestPath) {\r\n shortestPath = myPath.length;\r\n shortestIndex = push - 1;\r\n }\r\n // lazy, first path is very likely to be the best\r\n break;\r\n } else {\r\n let neighbors = getNeighbors(myPath[myPath.length - 1]);\r\n for (let i = 0; i < neighbors.length; i++) {\r\n open.push(myPath.concat([neighbors[i]]));\r\n }\r\n }\r\n for (let i = open.length - 1; i >= 0; i--) {\r\n if (open[i].length >= shortestPath) {\r\n open.splice(i, 1);\r\n }\r\n }\r\n closest = getClosestPath();\r\n }\r\n\r\n return closed[shortestIndex];\r\n }\r\n\r\n public getAStarBestDirectionTo (otherRoom : RoomRandom, validRoom? : (room : RoomRandom) => boolean) {\r\n let path = this.getAStarPathTo(otherRoom, validRoom);\r\n if (path != undefined) {\r\n if (path.length == 1) {\r\n return undefined;\r\n }\r\n return this.connections.indexOf(path[1].room);\r\n }\r\n }\r\n}\r\n\r\n// random = new RoomRandom...\r\n// random.connectableOn = [Room.DIRECTION_NORTH, Room.DIRECTION_SOUTH...]","/// \r\n/// \r\n\r\ninterface MapCoordinates {\r\n x : number;\r\n y : number;\r\n z : number;\r\n}\r\n\r\nclass RoomRandomMap {\r\n private positionTable : {[x : number] : {[y : number] : RoomRandom}} = {};\r\n private roomMap = new Map>();\r\n public lowestX = 0;\r\n public lowestY = 0;\r\n public highestX = 0;\r\n public highestY = 0;\r\n public limitsInvalid = false;\r\n\r\n /**\r\n * This is a count of how many connections are actually available, assuming rooms that can connect through some direction.\r\n * @type {number}\r\n */\r\n public availableConnections : Array>;\r\n\r\n /**\r\n * This is a count of rooms since the last cache clear. Used to mean more, but now is just a count of how many rooms were placed from the current region.\r\n * @type {number}\r\n */\r\n public rooms;\r\n\r\n /**\r\n * Clears the current room cache and creates a new one that is empty\r\n */\r\n public emptyCache () {\r\n this.availableConnections = [];\r\n Room.DIRECTIONS.forEach(() => {\r\n this.availableConnections.push([]);\r\n });\r\n this.rooms = 0;\r\n }\r\n\r\n public getAvailableConnections () {\r\n return this.availableConnections.reduce((previousValue, currentValue, currentIndex, array) => {\r\n return previousValue + (currentValue.length);\r\n }, 0);\r\n }\r\n\r\n public removeFromCache (coordinatesToRemove : MapCoordinates, direction : number) {\r\n let directionArray = this.availableConnections[direction];\r\n for (let k = 0, coordinates = directionArray[k]; coordinates != undefined; coordinates = directionArray[++k]) {\r\n if (coordinates.x == coordinatesToRemove.x && coordinates.y == coordinatesToRemove.y) {\r\n directionArray.splice(k, 1);\r\n return;\r\n }\r\n }\r\n }\r\n\r\n public addToCache (coordinatesToAdd : MapCoordinates, direction : number) {\r\n let directionArray = this.availableConnections[direction];\r\n for (let k = 0, coordinates = directionArray[k]; coordinates != undefined; coordinates = directionArray[++k]) {\r\n if (coordinates.x == coordinatesToAdd.x && coordinates.y == coordinatesToAdd.y) {\r\n return;\r\n }\r\n }\r\n directionArray.push(coordinatesToAdd);\r\n }\r\n\r\n public getAnyFromCache (direction : number) : RoomRandom {\r\n let array = this.availableConnections[direction];\r\n if (array.length > 0) {\r\n let randomIndex = Math.floor(Math.random() * (array.length));\r\n let randomCoordinates = array[randomIndex];\r\n if (randomCoordinates != undefined) {\r\n return this.getRoom(randomCoordinates.x, randomCoordinates.y);\r\n }\r\n }\r\n }\r\n\r\n public isFree (x : number, y : number) {\r\n return (this.positionTable[x] == undefined || this.positionTable[x][y] === undefined);\r\n }\r\n\r\n public block (x : number, y : number) {\r\n if (this.isFree(x, y)) {\r\n if (this.positionTable[x] == undefined) {\r\n this.positionTable[x] = {};\r\n }\r\n this.positionTable[x][y] = null;\r\n this.updateCacheOnPosition(x, y);\r\n this.updateLimits(x, y);\r\n }\r\n }\r\n\r\n // TODO: Figure out why this is giving out wrong sizes when fodder is added and then removed. This is causing maps to not center correctly in those cases.\r\n public updateAllLimits () {\r\n if (this.limitsInvalid) {\r\n this.highestX = 0;\r\n this.highestY = 0;\r\n this.lowestX = 0;\r\n this.lowestY = 0;\r\n for (let x in this.positionTable) {\r\n for (let y in this.positionTable[x]) {\r\n this.updateLimits(parseInt(x), parseInt(y));\r\n }\r\n }\r\n this.limitsInvalid = false;\r\n }\r\n }\r\n\r\n public updateLimits (x, y) {\r\n if (x > this.highestX) this.highestX = x;\r\n if (y > this.highestY) this.highestY = y;\r\n if (y < this.lowestY) this.lowestY = y;\r\n if (x < this.lowestX) this.lowestX = x;\r\n }\r\n\r\n public map (room : RoomRandom, x : number, y : number) {\r\n if (this.positionTable[x] == undefined) {\r\n this.positionTable[x] = {};\r\n }\r\n this.positionTable[x][y] = room;\r\n this.roomMap.set(room, [x, y]);\r\n\r\n this.updateCacheOnPosition(x, y);\r\n\r\n // If we ever want to draw maps, this will be useful\r\n this.updateLimits(x, y);\r\n\r\n room.placed = true;\r\n room.lastMap = this;\r\n\r\n this.rooms++;\r\n }\r\n\r\n public unmap (x : number, y : number) {\r\n if (this.positionTable[x] != undefined && this.positionTable[x][y] != undefined) {\r\n this.roomMap.delete(this.positionTable[x][y]);\r\n delete (this.positionTable[x][y]);\r\n this.rooms--;\r\n this.updateCacheOnPosition(x, y);\r\n this.limitsInvalid = true;\r\n }\r\n }\r\n\r\n private updateCacheOnPosition (x : number, y : number) {\r\n let coordinates = [x, y, 0];\r\n let coordinatesMap = {x : x, y : y};\r\n let coordinatesBlocked = !this.isFree(x, y);\r\n let coordinatesRoom = this.getRoom(x, y);\r\n\r\n Room.DIRECTIONS.forEach(direction => {\r\n let oppositeDirection = Room.oppositeDirection(direction);\r\n let shifted = Room.shift(coordinates, direction);\r\n let shiftedMap = {x : shifted[0], y : shifted[1]};\r\n let shiftedBlocked = !this.isFree(shifted[0], shifted[1]);\r\n let shiftedRoom = this.getRoom(shifted[0], shifted[1]);\r\n\r\n if (coordinatesRoom != undefined) {\r\n if (shiftedBlocked) {\r\n this.removeFromCache(coordinatesMap, direction);\r\n } else if (coordinatesRoom.isConnectableOn(direction)) {\r\n this.addToCache(coordinatesMap, direction);\r\n }\r\n } else {\r\n this.removeFromCache(coordinatesMap, direction);\r\n }\r\n\r\n if (shiftedRoom != undefined) {\r\n if (coordinatesBlocked) {\r\n this.removeFromCache(shiftedMap, oppositeDirection);\r\n } else if (shiftedRoom.isConnectableOn(oppositeDirection)) {\r\n this.addToCache(shiftedMap, oppositeDirection);\r\n }\r\n } else {\r\n this.removeFromCache(shiftedMap, oppositeDirection);\r\n }\r\n });\r\n }\r\n\r\n public getRoom (x : number, y : number) {\r\n if (this.positionTable[x] != undefined) {\r\n if (this.positionTable[x][y] != null) {\r\n return this.positionTable[x][y];\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n public getCoordinates (room : Room) : Array {\r\n return this.roomMap.get(room);\r\n }\r\n\r\n public getRoomCount () {\r\n return this.roomMap.size;\r\n }\r\n}","/// \r\n/**\r\n * Fodder is exactly the same as a random room, except:\r\n * 1 - It must be created as needed by a RegionRandom as it attempts to place Tricky rooms.\r\n * 2 - It doesn't count towards a player's maximum remembered rooms\r\n */\r\nclass RoomRandomFodder extends RoomRandom {\r\n\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\ninterface RandomizingRoomOptions {\r\n region : RegionRandom;\r\n room : RoomRandom;\r\n map : RoomRandomMap;\r\n}\r\n\r\nclass RegionRandom extends Region {\r\n private randomized = false;\r\n public map : RoomRandomMap;\r\n public fodderRoomClass : typeof RoomRandom = RoomRandomFodder;\r\n public placedRooms : Array = [];\r\n\r\n public constructor (name : string, map? : RoomRandomMap) {\r\n super(name);\r\n this.map = map == undefined ? new RoomRandomMap() : map;\r\n }\r\n\r\n public async randomize () {\r\n if (!this.randomized) {\r\n await RegionRandom.rulebookRandomizeRegion.execute({\r\n noun : this\r\n });\r\n }\r\n }\r\n\r\n public static rng : () => number = () => { return Math.random(); };\r\n\r\n public static rulebookRandomizeRegion = new Rulebook(\"Randomizing Random Region something\");\r\n public static rulebookPlaceRoom = new Rulebook(\"Placing Random Room something\");\r\n public static rulebookBeforePlaceRoom = new Rulebook(\"Before placing Random Room something\");\r\n public static rulebookAfterPlaceRoom = new Rulebook(\"After placing Random Room something\");\r\n\r\n public static ruleFirstRandomizeRegion = RegionRandom.rulebookRandomizeRegion.createAndAddRule({\r\n name : \"Empty map cache to start randomizing region\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : runner => {\r\n let region = runner.noun;\r\n\r\n // We don't want to connect a region to another region unintentionally\r\n region.map.emptyCache();\r\n }\r\n });\r\n\r\n public static ruleBasicRandomizeRegion = RegionRandom.rulebookRandomizeRegion.createAndAddRule({\r\n name : \"Randomize all unplaced, randomizable rooms in region something\",\r\n code : async runner => {\r\n let region = runner.noun;\r\n\r\n let roomShuffler = new Shuffler(\r\n Region.InRelation.getAllRightTypes(region, RoomRandom).filter((room : RoomRandom) => {\r\n return room.randomizable && !room.placed &&\r\n (room == WorldState.player.getRoom() || (RegionRandom.rng() * 100) <= room.appearChance);\r\n }), RegionRandom.rng\r\n );\r\n\r\n for (let room = roomShuffler.getOne(); room != undefined; room = roomShuffler.getOne()) {\r\n // Prevent available connections from getting too low\r\n // If we're placing rooms with too few availableConnections, we might end up reaching 0 availableConnections\r\n // Which would mean no more rooms can be placed.\r\n while (region.map.rooms > 0 && region.map.getAvailableConnections() < 4) {\r\n let fodder = new region.fodderRoomClass();\r\n let options = {\r\n map : region.map,\r\n room : fodder,\r\n region : region\r\n };\r\n\r\n region.place(fodder);\r\n\r\n await RegionRandom.rulebookBeforePlaceRoom.execute({noun : options}).then();\r\n await RegionRandom.rulebookPlaceRoom.execute({noun : options}).then();\r\n await RegionRandom.rulebookAfterPlaceRoom.execute({noun : options}).then();\r\n }\r\n\r\n let options = {\r\n map : region.map,\r\n room : room,\r\n region : region\r\n };\r\n await RegionRandom.rulebookBeforePlaceRoom.execute({noun : options}).then();\r\n await RegionRandom.rulebookPlaceRoom.execute({noun : options}).then();\r\n await RegionRandom.rulebookAfterPlaceRoom.execute({noun : options}).then();\r\n\r\n if (!room.placed) {\r\n Elements.CurrentTurnHandler.printAsError(new Say(\"Was unable to place room \", room, \". Game might be unplayable.\"));\r\n }\r\n }\r\n }\r\n });\r\n\r\n public static ruleAddExtraConnections = RegionRandom.rulebookRandomizeRegion.createAndAddRule({\r\n firstPriority : Rule.PRIORITY_LOWEST,\r\n name : \"Add extra connections to rooms in region\",\r\n code : runner => {\r\n let region = runner.noun;\r\n let placedRooms = Region.InRelation.getAllRightTypes(region, RoomRandom).filter((room : RoomRandom) => {\r\n return room.randomizable && room.placed;\r\n });\r\n\r\n placedRooms.forEach((room : RoomRandom) => {\r\n let myCoordinates = region.map.getCoordinates(room);\r\n let directionShuffler = new Shuffler(room.connectableOn.slice(0), RegionRandom.rng);\r\n for (let direction = directionShuffler.getOne(); direction != undefined && (RegionRandom.rng() * 100) <= room.extraConnectionChance; direction = directionShuffler.getOne()) {\r\n if (room.connections[direction] == undefined) {\r\n let otherCoordinates = Room.shift(myCoordinates, direction);\r\n let otherRoom = region.map.getRoom(otherCoordinates[0], otherCoordinates[1]);\r\n if (otherRoom != undefined && otherRoom.randomizable\r\n && otherRoom.isConnectableOn(Room.oppositeDirection(direction))\r\n && (RegionRandom.rng() * 100) <= otherRoom.extraConnectionChance) {\r\n room.mapRoom(otherRoom, direction);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n public static rulePlaceFirstRoom = RegionRandom.rulebookPlaceRoom.createAndAddRule({\r\n name : \"Placing First room something\",\r\n firstPriority : Rule.PRIORITY_HIGHEST,\r\n code : runner => {\r\n let placingOptions = runner.noun;\r\n\r\n if (placingOptions.map.isFree(0, 0)) {\r\n placingOptions.map.map(placingOptions.room, 0, 0);\r\n return true;\r\n }\r\n },\r\n conditions : runner => {\r\n return runner.noun.map.rooms == 0;\r\n }\r\n });\r\n\r\n public static rulePlaceNonTrickyRoom = RegionRandom.rulebookPlaceRoom.createAndAddRule({\r\n name : \"Placing non-tricky room something\",\r\n firstPriority : Rule.PRIORITY_HIGH,\r\n code : runner => {\r\n let placingOptions = runner.noun;\r\n let directionShuffler = new Shuffler(placingOptions.room.connectableOn);\r\n for (let direction = directionShuffler.getOne(); direction != undefined; direction = directionShuffler.getOne()) {\r\n let oppositeDirection = Room.oppositeDirection(direction);\r\n let connectableRoom = placingOptions.map.getAnyFromCache(oppositeDirection);\r\n if (connectableRoom != undefined) {\r\n let otherCoordinates = placingOptions.map.getCoordinates(connectableRoom);\r\n let myCoordinates = Room.shift(otherCoordinates, oppositeDirection);\r\n placingOptions.room.mapRoom(connectableRoom, direction);\r\n placingOptions.map.map(placingOptions.room, myCoordinates[0], myCoordinates[1]);\r\n return true;\r\n }\r\n }\r\n },\r\n conditions : runner => {\r\n return runner.noun.room.trickyCode == undefined;\r\n }\r\n });\r\n\r\n public static rulePlaceTrickyRoom = RegionRandom.rulebookPlaceRoom.createAndAddRule({\r\n name : \"Placing tricky room something\",\r\n code : runner => {\r\n let placingOptions = runner.noun;\r\n let placedRooms = > placingOptions.region.getRooms().filter((room) => {\r\n return room instanceof RoomRandom && room.placed;\r\n });\r\n\r\n if (placedRooms.length == 0) {\r\n Elements.CurrentTurnHandler.printAsError(\"Unable to place room \" + placingOptions.room.getPrintedName() + \": There are no rooms to connect to!\");\r\n return false;\r\n }\r\n\r\n let roomShuffler = new Shuffler(placedRooms, RegionRandom.rng);\r\n for (let connectableRoom = roomShuffler.getOne(); connectableRoom != undefined; connectableRoom = roomShuffler.getOne()) {\r\n let trickier = {\r\n region : placingOptions.region,\r\n map : placingOptions.map,\r\n otherRoom : connectableRoom\r\n };\r\n let tricky = placingOptions.room.getAnyDirection(trickier);\r\n if (tricky != undefined) {\r\n placingOptions.room.mapRoom(connectableRoom, tricky.trickyRoomDirection);\r\n placingOptions.map.map(placingOptions.room, tricky.x, tricky.y);\r\n return true;\r\n }\r\n }\r\n\r\n // THIS WORKS\r\n // I DON'T KNOW WHY\r\n // I DON'T CARE WHY\r\n // LEAVE\r\n let connectableThroughFodder = (fodderStep : number, connectingRoom : RoomRandom) => {\r\n let trickier = {\r\n region : placingOptions.region,\r\n map : placingOptions.map,\r\n otherRoom : connectingRoom\r\n };\r\n\r\n if (fodderStep == 0) {\r\n return placingOptions.room.getAnyDirection(trickier);\r\n } else {\r\n let newFodder = new (placingOptions.region.fodderRoomClass)();\r\n let directionShuffler = new Shuffler(newFodder.connectableOn, RegionRandom.rng);\r\n for (let direction = directionShuffler.getOne(); direction != undefined; direction = directionShuffler.getOne()) {\r\n let oppositeDirection = Room.oppositeDirection(direction);\r\n let otherCoordinates = placingOptions.map.getCoordinates(connectingRoom);\r\n let wouldbeCoordinates = Room.shift(otherCoordinates, oppositeDirection);\r\n let fodderTricky = {\r\n otherRoom : connectingRoom,\r\n otherRoomDirection : oppositeDirection,\r\n trickyRoomDirection : direction,\r\n map : placingOptions.map,\r\n region : placingOptions.region,\r\n x : wouldbeCoordinates[0],\r\n y : wouldbeCoordinates[1]\r\n };\r\n\r\n if (newFodder.isPlaceable(fodderTricky)) {\r\n newFodder.mapRoom(connectingRoom, fodderTricky.trickyRoomDirection);\r\n placingOptions.map.map(newFodder, fodderTricky.x, fodderTricky.y);\r\n\r\n let nextTricky = connectableThroughFodder(fodderStep - 1, newFodder);\r\n if (nextTricky != undefined) {\r\n placingOptions.region.place(newFodder);\r\n return nextTricky;\r\n } else {\r\n newFodder.unmapRoom(fodderTricky.trickyRoomDirection);\r\n placingOptions.map.unmap(fodderTricky.x, fodderTricky.y);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n for (let fodderLevel = 1; fodderLevel < 10; fodderLevel++) {\r\n roomShuffler.restart();\r\n for (let connectableRoom = roomShuffler.getOne(); connectableRoom != undefined; connectableRoom = roomShuffler.getOne()) {\r\n let tricky = connectableThroughFodder(fodderLevel, connectableRoom);\r\n if (tricky != undefined) {\r\n placingOptions.room.mapRoom(tricky.otherRoom, tricky.trickyRoomDirection);\r\n placingOptions.map.map(placingOptions.room, tricky.x, tricky.y);\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n Elements.CurrentTurnHandler.printAsError(\"Unable to place room \" + placingOptions.room.getPrintedName() + \": All attempts failed\");\r\n return false;\r\n }\r\n });\r\n}","interface StoredVariableOptions {\n id : string;\n value : T;\n}\n\nclass StoredVariable {\n public id : string;\n public value : T;\n public defValue : T;\n\n public constructor (options : StoredVariableOptions) {\n this.id = options.id;\n this.value = options.value;\n this.defValue = this.value;\n\n StoredVariable.registerVariable(this);\n }\n\n public reset () {\n this.value = this.defValue;\n }\n\n public updateFromObject (obj : T) {\n this.value = obj;\n }\n\n public exportAsObject () {\n return this.value;\n }\n\n private static storedVariables : {[id : string] : StoredVariable} = {};\n\n public static registerVariable (variable : StoredVariable) {\n if (StoredVariable.storedVariables[variable.id] == undefined) {\n StoredVariable.storedVariables[variable.id] = variable;\n } else {\n console.warn(\"[StoredVariable] \" + variable.id + \" already defined. Ignoring:\", variable);\n }\n }\n\n public static getVariable (id : string) {\n return StoredVariable.storedVariables[id];\n }\n\n public static getVariables () {\n let list = [];\n for (let key in StoredVariable.storedVariables) {\n list.push(StoredVariable.storedVariables[key]);\n }\n return list;\n }\n\n public static exportAsObject () : {[id : string] : any} {\n let list = {};\n for (let key in StoredVariable.storedVariables) {\n list[key] = StoredVariable.storedVariables[key].value;\n }\n return list;\n }\n\n public static updateFromObject (obj : {[id : string] : any}) {\n for (let key in StoredVariable.storedVariables) {\n if (obj[key] != undefined) {\n StoredVariable.storedVariables[key].updateFromObject(obj[key]);\n } else {\n StoredVariable.storedVariables[key].reset();\n }\n }\n }\n}","/// \r\n/// \r\n/// \r\n/// \r\ninterface LiquidOptions extends ThingOptions {\r\n taste? : OneOf;\r\n}\r\n\r\ninterface LiquidContainer {\r\n liquidContents : Array;\r\n}\r\n\r\ninterface LiquidMixture {\r\n quantities : Map;\r\n result : Liquid;\r\n quantityMultiplier? : number;\r\n firstPriority : number;\r\n priority : number;\r\n}\r\n\r\nclass Liquid extends Thing {\r\n public taste : OneOf;\r\n public constructor (options? : LiquidOptions) {\r\n super(options);\r\n options = options == undefined ? {} : options;\r\n if (options.taste != undefined) {\r\n this.taste = options.taste;\r\n } else {\r\n this.taste = new OneOf(\r\n OneOf.ROTATING_RANDOM,\r\n \"It goes easily through your throat with no particular taste.\",\r\n \"You taste nothing as it softly slides through your tongue.\"\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * This rulebook will return a LiquidMixture\r\n * @type {Rulebook}\r\n */\r\n public static rulebookMixing = new Rulebook(\"Mixing the liquid contents of something\"); // noun = LiquidContainer\r\n public static mixtures : Array = [];\r\n public static sortedMixtures = false;\r\n\r\n public static async mix (container : LiquidContainer) {\r\n await Liquid.rulebookMixing.execute({noun : container}).then((result : LiquidMixture) => {\r\n // Did we find a liquid?\r\n if (result != undefined) {\r\n let finalQuantity = result.quantityMultiplier != undefined ?\r\n (result.quantityMultiplier * container.liquidContents.length)\r\n :\r\n (container.liquidContents.length);\r\n\r\n\r\n container.liquidContents = new Array(finalQuantity);\r\n for (let i = 0; i < finalQuantity; i++) {\r\n container.liquidContents[i] = result.result;\r\n }\r\n }\r\n });\r\n }\r\n\r\n public static getMixtures () {\r\n if (Liquid.sortedMixtures) {\r\n return Liquid.mixtures;\r\n }\r\n Liquid.mixtures.sort((a, b) => {\r\n if (b.firstPriority < a.firstPriority) return -1;\r\n if (a.firstPriority < b.firstPriority) return 1;\r\n if (b.priority < a.priority) return -1;\r\n if (a.priority < b.priority) return 1;\r\n return 0;\r\n });\r\n Liquid.sortedMixtures = true;\r\n return Liquid.mixtures;\r\n }\r\n\r\n public static addMixture(mixture : LiquidMixture) {\r\n Liquid.mixtures.push(mixture);\r\n Liquid.sortedMixtures = false;\r\n }\r\n\r\n public static ruleDefaultMixing = Liquid.rulebookMixing.createAndAddRule({\r\n name : \"Mixing through Mixtures\",\r\n code : runner => {\r\n if (runner.noun.liquidContents.length == 0) {\r\n return;\r\n }\r\n\r\n let mixture : LiquidMixture;\r\n for (let i = 0; i < Liquid.mixtures.length; i++) {\r\n mixture = Liquid.mixtures[i];\r\n let proportions = [];\r\n let mixtureIterator = mixture.quantities.entries();\r\n for (let mixtureLiquid = mixtureIterator.next(); !mixtureLiquid.done; mixtureLiquid = mixtureIterator.next()) {\r\n let mixtureType = mixtureLiquid.value[0];\r\n let mixtureQuantity = mixtureLiquid.value[1];\r\n let matchedQuantity = 0;\r\n runner.noun.liquidContents.forEach((liquidType) => {\r\n try {\r\n if (liquidType == mixtureType ||\r\n (typeof mixtureType == \"function\" &&\r\n (liquidType instanceof mixtureType || mixtureType(liquidType))\r\n )\r\n ) {\r\n matchedQuantity++;\r\n }\r\n // mixtureType is not always callable\r\n } catch (e) {}\r\n });\r\n\r\n proportions.push(matchedQuantity / mixtureQuantity);\r\n }\r\n\r\n // If this is a valid mix, then every part of the recipe is represented proportionally\r\n if (proportions.every(function(element, index, array) {\r\n return element === array[0];\r\n })) {\r\n return mixture;\r\n }\r\n }\r\n }\r\n });\r\n}\r\n\r\n// class Semen extends Liquid {}\r\n// class OrcSemen extends Semen {}\r\n// class MinotaurSemen extends Semen {}\r\n// class PowerfulDrink extends Liquid {}\r\n//\r\n// let powerfulDrinkQuantities = new Map();\r\n// powerfulDrinkQuantities.set(OrcSemen, 2);\r\n// powerfulDrinkQuantities.set(MinotaurSemen, 1);\r\n// Liquid.addMixture({\r\n// firstPriority : Rule.PRIORITY_HIGHEST,\r\n// priority : Rule.PRIORITY_MEDIUM,\r\n// quantityMultiplier : 0.5,\r\n// result : new PowerfulDrink(\"Powerful Drink\"),\r\n// quantities : powerfulDrinkQuantities\r\n// });\r\n// let recipient = new Recipient(\"Cup\");\r\n// recipient.liquidContents.push(new OrcSemen(\"Semen of the Chief\"));\r\n// recipient.liquidContents.push(new OrcSemen(\"Semen of the Chief\"));\r\n// recipient.liquidContents.push(new OrcSemen(\"Semen of the Chief\"));\r\n// recipient.liquidContents.push(new OrcSemen(\"Semen of the Chief\"));\r\n// recipient.liquidContents.push(new MinotaurSemen(\"Semen of Harold\"));\r\n// recipient.liquidContents.push(new MinotaurSemen(\"Semen of Harold\"));\r\n//\r\n// {\r\n// Settings.setDebug(false);\r\n// let t1 = performance.now();\r\n// let t0 = performance.now();\r\n// Liquid.mix(recipient);\r\n// t1 = performance.now();\r\n// console.log(t1 - t0);\r\n// }","/// \r\nclass Scenery extends Thing {\r\n public fixedInPlace = true;\r\n public scenery = true;\r\n}","interface ThingDefiningGender {\n getGenderWeight () : number;\n getGenderValue () : number;\n}","interface ThingDefiningSluttiness {\n getSluttinessWeight () : number;\n getSluttinessValue () : number;\n}","/// \r\n\r\nclass Semen extends Liquid {\r\n public cummer : Person;\r\n\r\n public constructor (cummer : Person, options? : ThingOptions) {\r\n super(options);\r\n this.cummer = cummer;\r\n }\r\n}"]}