1 |
- {"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,OA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CAAC,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<any>) {\r\n for(var i=0; i<a.length; ++i) {\r\n for(var j=i+1; j<a.length; ++j) {\r\n if(a[i] === a[j])\r\n a.splice(j--, 1);\r\n }\r\n }\r\n return a;\r\n}\r\n\r\nfunction arrayUniqueNewArray(a : Array<any>) {\r\n a = a.slice();\r\n arrayUnique(a);\r\n return a;\r\n}","module Controls {\r\n\r\n}","/// <reference path=\"../Controls.ts\" />\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 ((<HTMLElement> 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<Array<string>> = [\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<Array<string>> = [\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<Array<string>> = [\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<Array<string>> = [];\r\n export var available2 : Array<Array<string>> = [];\r\n export var available3 : Array<Array<string>> = [];\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<string>) {\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});","/// <reference path=\"../Elements.ts\" />\r\nmodule Elements.CurrentTurnHandler {\r\n export var mainPage = document.getElementById(\"mainPage\");\r\n export var currentTurnTab = <HTMLElement> document.getElementById(\"currentTurnTab\");\r\n export var currentTurn = <HTMLElement> 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<any>) : Promise<any> {\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<HTMLElement>) {\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<HTMLElement>) {\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}","/// <reference path=\"../../Elements/Modules/CurrentTurnHandler.ts\" />\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}","/// <reference path=\"../../Functions.ts\" />\r\ninterface RulebookOptions<T> {\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<T> {\r\n public noun : T;\r\n private rulesToExecute : Array<Rule> = [];\r\n public rulebook : Rulebook<T>;\r\n public rule : Rule;\r\n private ruleRunner : number = -1;\r\n\r\n public constructor (rulebook : Rulebook<T>, noun : T) {\r\n this.rulebook = rulebook;\r\n this.noun = noun;\r\n }\r\n\r\n public addRulebooks (...rulebooks : Array<Rulebook<T>>) {\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<T> {\r\n public rules : Array<Rule> = [];\r\n public name : string;\r\n public static indentation = 0;\r\n public static rulebookStack : Array<Rulebook<any> | 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<any> | 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<any>) {\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<T>, ...rulebooks) : Promise<any>{\r\n options = options == undefined ? {} : options;\r\n\r\n let runner = new RulebookRunner<T>(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<T>) {\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}","/// <reference path=\"../Settings.ts\" />\r\ninterface RuleOptions<T> {\r\n name : string;\r\n firstPriority? : number;\r\n priority? : number;\r\n code : (runner? : RulebookRunner<T>) => (Promise<any> | any);\r\n conditions? : (runner? : RulebookRunner<T>) => (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<any>) => (boolean);\r\n\r\n public constructor (options : RuleOptions<any>) {\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<any>) : Promise<any> {\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 */","/// <reference path=\"../Say.ts\" />\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<any>) {\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}","/// <reference path=\"../Say.ts\" />\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}","/// <reference path=\"../../World/Classes/Rulebook.ts\" />\n/// <reference path=\"../../World/Classes/Rule.ts\" />\n/// <reference path=\"Say/OneOf.ts\" />\n/// <reference path=\"Say/SayImage.ts\" />\n\ninterface Printable {\n getPrintedName () : string;\n}\n\ninterface PrintableElement {\n getPrintedElement () : Array<Element>;\n}\n\ninterface SayNoun {\n say : Say;\n noun : any;\n}\n\nclass SayableObject {}\n\nclass Say {\n public sequence : Array <Object> = [];\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<Say | OneOf | Object | Printable | string | number | String | ((say : Say) => 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<Array<Element | Text>>;\n public currentParagraph : Array<Element | Text>;\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<string> {\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<Array<Array<Element|Text>>> {\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<Array<Element|Text>> {\n if (typeof obj == \"string\" || obj instanceof String) {\n return [document.createTextNode(<string> obj)];\n } else if (typeof obj == \"number\" || obj instanceof Number) {\n return [document.createTextNode((parseFloat((<number> 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<Element | Text>) => {\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<Array<Element | Text>> {\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<string>, singleParagraph? : boolean) : Promise<Array<HTMLElement>> {\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 = <HTMLElement> 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<Array<HTMLElement>> {\n return this.getHTML(\"p\", [\"content\"]);\n }\n\n public static beforePrinting = new Rulebook<any>(\"Before printing the name of something\");\n public static printing = new Rulebook<any>(\"Printing the name of something\");\n public static afterPrinting = new Rulebook<any>(\"After printing the name of something\");\n\n public currentNoun : any;\n public currentNounElements : Array<Element | Text>;\n\n public async printName (thing : any) : Promise<Array<Element | Text>> {\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<any>) => {\n let say = <Say> rulebook.noun;\n if ((<any> say.currentNoun).getPrintedElement) {\n say.currentNounElements.push(...(<PrintableElement> 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<any>) => {\n let say = <Say> rulebook.noun;\n if ((<any> say.currentNoun).getPrintedName) {\n let thingEle = document.createTextNode(\n (<Printable> 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<any>) => {\n let say = <Say> rulebook.noun;\n if ((<any> say.currentNoun).getPrintedName) {\n say.currentNounElements.push(\n (document.createTextNode((<Object> 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<Array<Element | Text>> {\n let next = say.sequence[say.sequenceRunner + 1];\n if (next == undefined) {\n this.node.nodeValue = \"\";\n } else {\n if (next instanceof Thing && ((<Thing> next).unique)) {\n if (!(<Thing> 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;;<e9;1x;2;m;;1;d;6;;o;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3e;d;1;a;7;;x;;b; 23;hw;;';6;;,1;c;;.2;a;;8o;47;;b5;f;;k;13;;l1;8;;md;x;1;a7;;;t;c;;y4y;e;1; ;a;;y6atn;ca;1;l1;c;;{6s;r;1;a;7;;|58;m;1;a1;b;;£6cs;8l;1;82b;6o;;À;9;;Áa;o;;Ä3;c;;Å2;k;;Æ4;k;;Éf;2q;;Ò;c;;Ó1;1d;;Öa;16;;Ü4;v;;à7;v;;á5;l;;æ1;m;;è;6;;é4c;bg;1;t3h;29;3;a4;1n;;o;a;;u1;b;;í;5;;ö2;e;;üd;r;1; 7;;;Ā1;b;;ā3;s;;ī;5;;İ4;o;;Ō3;o;;ō;2m;;œ;8;;Ω2;e;;α1c;c1;;ε5;1s;;ω7;1x;;ϵ;8;;е;5;;–3a;1k;2;e;a;;i;9;;ℓ;d;;\";\n var root = {};\n function fill(prefix, node, dict) {\n var a = dict.split(';', 3)\n , n = a.map(function (x) { return parseInt(x, 36)||0; });\n node.data={\n aCount:n[0],\n anCount:n[1],\n prefix:prefix,\n article:n[0]>=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})();","/// <reference path=\"../Say.ts\" />\r\nclass SayBold extends Say {\r\n public async getPureElements () : Promise<Array<Element | Text>> {\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}","/// <reference path=\"../Say.ts\" />\r\nclass SayIf extends Say {\r\n private condition : () => boolean;\r\n public constructor (condition : () => boolean, ...objs : Array<any>) {\r\n super(...objs);\r\n this.condition = condition != undefined ? condition : () => { return true; };\r\n }\r\n\r\n public async getPureElements () : Promise<Array<Element | Text>> {\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}","/// <reference path=\"../Elements.ts\" />\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 = <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}","/// <reference path=\"../Elements.ts\" />\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);","/// <reference path=\"../Elements.ts\" />\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<Element | Text>) {\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<Element | Text>) {\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}","/// <reference path=\"../Elements.ts\" />\r\n/// <reference path=\"../../World/Classes/Rulebook.ts\" />\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<any>) {\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<Thing>(\"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<void>(\"Common Actions Rulebook\");\r\n}","/// <reference path=\"Rulebook.ts\" />\r\n/// <reference path=\"Rule.ts\" />\r\n/// <reference path=\"../../Elements/Classes/Say.ts\" />\r\nclass Action {\r\n public static check = new Rulebook<Action>(\"Check any Action\");\r\n public static carry = new Rulebook<Action>(\"Carry out any Action\");\r\n\r\n public extraChecks : Array<Rulebook<Action>> = [];\r\n public extraCarries : Array<Rulebook<Action>> = [];\r\n\r\n public _actor : Thing;\r\n public nouns : Array<Thing> = [];\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<any>) {\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<Say> {\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 = <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<Action>) => {\r\n let action = <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<Action>) => {\r\n let action = <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);","/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n/// <reference path=\"../../../Elements/Classes/Say/SayBold.ts\" />\r\n\r\nclass ActionExamine extends Action {\r\n public requiresTurn = false;\r\n\r\n public static check = new Rulebook<ActionExamine>(\"Check Examining\");\r\n public static carry = new Rulebook<ActionExamine>(\"Carry out Examining\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array<any>) {\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((<Thing> action.getNoun(0)).getPrintedDescription());\r\n }\r\n });\r\n}","abstract class RelationHandler {\r\n protected relations : Array<Relation>;\r\n\r\n public constructor (...relations : Array <Relation>) {\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}","/// <reference path=\"../Relation.ts\" />\r\n/// <reference path=\"../../../Functions.ts\" />\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<any, Array<any>>();\r\n private manyMap = new Map<any, any>();\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}","/// <reference path=\"../../Elements/Classes/Say.ts\" />\r\n/// <reference path=\"Relations/RelationOneToMany.ts\" />\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 = (<any> 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 | Room> 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<Thing>) {\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}","/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n/// <reference path=\"../../../Elements/Classes/Say/SayBold.ts\" />\r\n/// <reference path=\"../../../Elements/Modules/HyperlinkHandler.ts\" />\r\n\r\nclass ActionTake extends Action {\r\n public static check : Rulebook<ActionTake> = new Rulebook(\"Check Taking\");\r\n public static carry : Rulebook<ActionTake> = new Rulebook(\"Carry out Taking\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array<any>) {\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<ActionTake>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<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((<Thing> action.getNoun(0)).getPrintedName() + \": \"), \"Taken.\");\r\n } else {\r\n action.say.add(actor.getPrintedName() + \" takes \" + (<Thing> 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<ActionTake>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<Thing>action.getNoun(0));\r\n let owner = <Thing> 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<ActionTake>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<Thing>action.getNoun(0));\r\n let owner = <Thing> 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<ActionTake>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<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<Thing>) => {\r\n let thing = <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));","/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n\r\nclass ActionGo extends Action {\r\n public static check = new Rulebook<ActionGo>(\"Check Going\");\r\n public static carry = new Rulebook<ActionGo>(\"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<any>) {\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 \" + (<Room> 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 = <ActionGo> 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 = <ActionGo> 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 = <ActionGo> 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 = <ActionGo> 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 = <ActionGo> 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}","/// <reference path=\"../Elements.ts\" />\r\n/// <reference path=\"../../World/Classes/Action/ActionExamine.ts\" />\r\n/// <reference path=\"../../World/Classes/Action/ActionGo.ts\" />\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(<HTMLElement> 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 : <VisibleThingsOptions> {\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<Thing>\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<VisibleThingsOptions>) => {\r\n let noun = <VisibleThingsOptions> 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<VisibleThingsOptions>) => {\r\n let noun = <VisibleThingsOptions> 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<VisibleThingsOptions>) => {\r\n let noun = <VisibleThingsOptions> rulebook.noun;\r\n noun.container.appendChild(document.createTextNode(\" here.\"));\r\n }\r\n });\r\n PrintingVisibleThingsRulebook.addRule(PrintOutroToVisibleThingsRule);\r\n}","/// <reference path=\"../Thing.ts\" />\r\n/// <reference path=\"../Action/ActionTake.ts\" />\r\n/// <reference path=\"../../../Elements/Modules/RoomHandler.ts\" />\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<ActionTake>) => {\r\n let action = <ActionTake> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<CoinPouch>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 (<CoinPouch> 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<ActionTake>) => {\r\n return ((<ActionTake> 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<Say>) => {\r\n let say = <Say> rulebook.noun;\r\n let pouch = <CoinPouch> say.currentNoun;\r\n say.currentNounElements.push(document.createTextNode(\" with \" + pouch.getCoins().toString() + \" coins\"));\r\n },\r\n conditions : (rulebook : RulebookRunner<Say>) => {\r\n return Elements.RoomHandler.PrintingVisibleThingsRulebook.isRunning()\r\n && (<Say> rulebook.noun).currentNoun instanceof CoinPouch\r\n && (<CoinPouch> (<Say> 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<ActionExamine>) => {\r\n let action = <ActionExamine> rulebook.noun;\r\n let thing = <CoinPouch> 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<ActionExamine>) => {\r\n return ((<ActionExamine> rulebook.noun).getNoun(0) instanceof CoinPouch);\r\n }\r\n}));","/// <reference path=\"../Elements.ts\" />\r\n/// <reference path=\"../../World/Classes/Rulebook.ts\" />\r\n/// <reference path=\"../../World/Classes/Rule.ts\" />\r\n/// <reference path=\"../../World/Classes/Action/ActionExamine.ts\" />\r\n/// <reference path=\"../../World/Classes/Things/CoinPouch.ts\" />\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<Thing>(\"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 = <Array<CoinPouch>> 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}","/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n\r\nclass ActionRetrace extends Action {\r\n public static check = new Rulebook<ActionRetrace>(\"Check Retracing\");\r\n public static carry = new Rulebook<ActionRetrace>(\"Carry out Retracing\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array<any>) {\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 = (<Room> 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<ActionRetrace>) => {\r\n let action = <ActionGo> 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<ActionRetrace>) => {\r\n let action = <ActionRetrace> 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","/// <reference path=\"../../World/Classes/Action/ActionRetrace.ts\" />\r\n/// <reference path=\"../../World/Classes/Action/ActionGo.ts\" />\r\n/// <reference path=\"../../Controls/Modules/Links.ts\" />\r\n/// <reference path=\"../Elements.ts\" />\r\n/// <reference path=\"HoverInfo.ts\" />\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 = <RegionRandom> 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}","/// <reference path=\"Rulebook.ts\" />\r\n/// <reference path=\"Rule.ts\" />\r\n/// <reference path=\"../../Functions.ts\" />\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<Action>}\r\n */\r\n public async execute (actor : Thing) : Promise<Action> {\r\n let promise : Promise<Action>;\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<Rulebook<Thing>>) {\r\n this.extraRules.push(...books)\r\n arrayUnique(this.extraRules);\r\n }\r\n\r\n public addCombatRulesBook (...books : Array<Rulebook<Thing>>) {\r\n this.extraCombatRules.push(...books)\r\n arrayUnique(this.extraCombatRules);\r\n }\r\n\r\n public static rules = new Rulebook<Thing>(\"Default AI Rules\");\r\n public extraRules : Array<Rulebook<Thing>> = [];\r\n public static combatRules = new Rulebook<Thing>(\"Default AI Combat Rules\");\r\n public extraCombatRules : Array<Rulebook<Thing>> = [];\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}","/// <reference path=\"../Thing.ts\" />\r\n/// <reference path=\"../AI.ts\" />\r\n/// <reference path=\"../Skills.ts\" />\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}","/// <reference path=\"./Classes/Rulebook.ts\" />\r\n/// <reference path=\"./Classes/Rule.ts\" />\r\n/// <reference path=\"Classes/Things/Person.ts\" />\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}","/// <reference path=\"./Classes/Rulebook.ts\" />\r\n/// <reference path=\"./Classes/Rule.ts\" />\r\n\r\nmodule PlayBegins {\r\n export var rulebook = new Rulebook<void>(\"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<void>) => {\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<void>) => {\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}","/// <reference path=\"./Classes/Rulebook.ts\" />\r\n/// <reference path=\"./Classes/Rule.ts\" />\r\n\r\nmodule TurnSequence {\r\n export var rulebook = new Rulebook<Action>(\"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<Action>) {\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<Action>) => {\r\n let playerAction = <Action> 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<Action>) {\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 = <Action> 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}","/// <reference path=\"../../Elements/Classes/Say.ts\" />\r\n\r\nclass Room implements Printable {\r\n private name : string;\r\n public connections : Array<Room>;\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<Thing> {\r\n return <Array<Thing>> Thing.InsideRoomRelation.getRight(this);\r\n }\r\n\r\n public getContainedAndVisible () : Array<Thing> {\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<Room>, 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<number>, 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}","/// <reference path=\"../Thing.ts\" />\r\n/// <reference path=\"../Room.ts\" />\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<Room> = [];\r\n public regions : Array<Region> = [];\r\n\r\n public addRoom (...rooms : Array<Room>) {\r\n rooms.forEach((room) => {\r\n this.rooms.push(room);\r\n });\r\n }\r\n\r\n public addRegion (...regions : Array<Region>) {\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}","/// <reference path=\"../Thing.ts\" />\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<number> = [];\r\n public visibleSlots : Array<number> = [];\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 = <Array<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}","/// <reference path=\"../Bodypart.ts\" />\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<number>) {\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}","/// <reference path=\"../../Bodypart.ts\" />\r\n/// <reference path=\"../../Humanoid/Humanoid.ts\" />\r\n/// <reference path=\"../SexStick.ts\" />\r\n/// <reference path=\"../SexHole.ts\" />\r\n/// <reference path=\"../../../Measure.ts\" />\r\nclass HumanoidSkin extends Bodypart {\r\n public sorenessWeight = 0;\r\n public genderWeight = Bodypart.WEIGHT_MEDIUM;\r\n public slots : Array<number> = [\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<number> = [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<number> = [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<number> = [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<number> = [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<number> = [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<number> = [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<number> = [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<number> = [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<number> = [Humanoid.SLOT_CROTCH_FRONT];\r\n public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;\r\n public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;\r\n}","/// <reference path=\"../Thing.ts\" />\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<number> = [];\r\n public transparentSlots : Array<number> = [];\r\n public layer : number = Clothing.LAYER_MEDIUM;\r\n public isVisible = false;\r\n public visibleOn : Array<number> = [];\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","/// <reference path=\"../Things/Clothing.ts\" />\r\n/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n/// <reference path=\"../../../Elements/Classes/Say/SayBold.ts\" />\r\n/// <reference path=\"../../../Elements/Modules/HyperlinkHandler.ts\" />\r\n\r\nclass ActionRemove extends Action {\r\n public static check: Rulebook<ActionRemove> = new Rulebook(\"Check Removing\");\r\n public static carry: Rulebook<ActionRemove> = new Rulebook(\"Carry out Removing\");\r\n\r\n public constructor(actor: Thing, ...nouns: Array<any>) {\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<ActionRemove>) => {\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<ActionRemove>) => {\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<ActionRemove>) => {\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 = (<Thing>action.getNoun(0));\r\n\r\n if (actor == WorldState.player) {\r\n action.say.add(new SayBold((<Thing> action.getNoun(0)).getPrintedName() + \": \"), \"Removed.\");\r\n } else {\r\n action.say.add(actor.getPrintedName() + \" takes off the \" + (<Thing> 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<Thing>) => {\r\n let thing = <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<Thing>) => {\r\n let thing = <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));","/// <reference path=\"../Things/Clothing.ts\" />\n/// <reference path=\"../Action.ts\" />\n/// <reference path=\"../Rule.ts\" />\n/// <reference path=\"../Rulebook.ts\" />\n/// <reference path=\"../../../Elements/Classes/Say/SayBold.ts\" />\n/// <reference path=\"../../../Elements/Modules/HyperlinkHandler.ts\" />\n\nclass ActionWear extends Action {\n public static check: Rulebook<ActionWear> = new Rulebook(\"Check Wearing\");\n public static carry: Rulebook<ActionWear> = new Rulebook(\"Carry out Wearing\");\n\n public constructor(actor: Thing, ...nouns: Array<any>) {\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<ActionWear>) => {\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<ActionWear>) => {\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<ActionWear>) => {\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 = (<Thing>action.getNoun(0));\n\n if (actor == WorldState.player) {\n action.say.add(new SayBold((<Thing> action.getNoun(0)).getPrintedName() + \": \"), \"Worn.\");\n } else {\n action.say.add(actor.getPrintedName() + \" puts on the \" + (<Thing> 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<Thing>) => {\n let thing = <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<Thing>) => {\n let thing = <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));","/// <reference path=\"../Person.ts\" />\r\n/// <reference path=\"../Bodypart/Humanoid/HumanoidParts.ts\" />\r\n/// <reference path=\"../../Action/ActionRemove.ts\" />\r\n/// <reference path=\"../../Action/ActionWear.ts\" />\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<number> = [];\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 = <Array<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<number>) {\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 = <Array<Bodypart>> 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 = <Array<Clothing>> 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<Clothing>) {\r\n this.isBreastTight = false;\r\n this.isBreastLoose = true;\r\n let breasts = <HumanoidBreasts> 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<Clothing>) {\r\n this.isCrotchTight = false;\r\n this.crotchVisibleSize = 0;\r\n let penis = <HumanoidPenis> Thing.PartRelation.getRightTypeOne(this, HumanoidPenis);\r\n let testicles = <HumanoidTesticles> 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<Clothing>) {\r\n this.isButtTight = false;\r\n let butt = <HumanoidButt> 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<Action>) => {\r\n (<Humanoid> runner.noun.actor).invalidateCaches();\r\n },\r\n conditions : (runner : RulebookRunner<Action>) => {\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);","/// <reference path=\"Humanoid.ts\" />\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 = <HumanoidBreasts> Thing.PartRelation.getRightTypeOne(this, HumanoidBreasts);\r\n if (breasts != undefined) {\r\n breasts.size = 3;\r\n }\r\n }\r\n}","/// <reference path=\"Classes/Things/Person.ts\" />\r\n/// <reference path=\"Classes/Things/MapNote.ts\" />\r\n/// <reference path=\"Classes/Things/Humanoid/HumanoidGenders.ts\" />\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<Room> = [];\r\n var rememberedFodder : Array<Room> = [];\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 = <Array<MapNote>> 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<Room>) {\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<Dialogue> = [];\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}","/// <reference path=\"../Settings.ts\" />\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> | 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> | 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}","/// <reference path=\"Relations/RelationOneToMany.ts\" />\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<Room | Region>) {\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 = <Array<Room>> Region.RegionRoom.getRight(this);\r\n Region.RegionRegion.getRight(this).forEach((region : Region) => {\r\n (<Array<Room>> 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<T> {\r\n private array : Array<T>;\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<T>, 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<T> {\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}","/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n/// <reference path=\"../../../Elements/Classes/Say/SayBold.ts\" />\r\n/// <reference path=\"../../../Elements/Modules/HyperlinkHandler.ts\" />\r\n/// <reference path=\"../../../Elements/Modules/InventoryHandler.ts\" />\r\n\r\nclass ActionDrop extends Action {\r\n public static check = new Rulebook<ActionDrop>(\"Check Dropping\");\r\n public static carry = new Rulebook<ActionDrop>(\"Carry out Dropping\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array<any>) {\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<ActionDrop>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<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<ActionDrop>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<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<ActionDrop>) => {\r\n let action = <ActionGo> rulebook.noun;\r\n let actor = action.actor;\r\n let thing = (<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((<Thing> action.getNoun(0)).getPrintedName() + \": \"), \"Dropped.\");\r\n } else {\r\n action.say.add(actor.getPrintedName() + \" drops \" + (<Thing> 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<Thing>) => {\r\n let thing = <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<Thing>) => {\r\n let thing = <Thing> rulebook.noun;\r\n\r\n Elements.InventoryHandler.printThingLink(\"D\", new ActionDrop(WorldState.player, thing));\r\n }\r\n }\r\n));","/// <reference path=\"../Action.ts\" />\r\n/// <reference path=\"../../../Elements/Modules/HyperlinkHandler.ts\" />\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<ActionWait> = new Rulebook(\"Check Waiting\");\r\n public static carry : Rulebook<ActionWait> = new Rulebook(\"Carry out Waiting\");\r\n\r\n public constructor (actor : Thing, ...nouns : Array<any>) {\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<void>) => {\r\n Elements.HyperlinkHandler.addCommonAction(\"Wait\", new ActionWait(WorldState.player));\r\n }\r\n}));","/// <reference path=\"../../../Functions.ts\" />\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<BranchingOption> = [];\r\n private resolve : Function;\r\n\r\n public constructor (...options : Array<BranchingOption>) {\r\n this.addOptions(...options);\r\n }\r\n\r\n public addOptions (...options : Array<BranchingOption>) {\r\n this.options.push(...options);\r\n arrayUnique(this.options);\r\n }\r\n\r\n public async getChosenOption () : Promise<BranchingOption> {\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<BranchingOption> = 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}","/// <reference path=\"../Room.ts\" />\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<number>;\r\n distance : number;\r\n}\r\n\r\nclass RoomRandom extends Room {\r\n public connectableOn : Array<number> = [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<number>(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(<RoomRandom> 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 (<number> a[2]) - (<number> 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<RoomRandomNode> = [];\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(<RoomRandom> node.room.connections[direction])) {\r\n let coordinates = Room.shift(node.coordinates, direction);\r\n neighbors.push({\r\n room : <RoomRandom> node.room.connections[direction],\r\n coordinates : coordinates,\r\n distance : distance(coordinates, endNode.coordinates)\r\n });\r\n visited.push(<RoomRandom> 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<Array<RoomRandomNode>> = [[startNode]];\r\n let closed : Array<Array<RoomRandomNode>> = [];\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<RoomRandom> = [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...]","/// <reference path=\"../Room.ts\" />\r\n/// <reference path=\"RoomRandom.ts\" />\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<Room, Array<number>>();\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<Array<MapCoordinates>>;\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 = <MapCoordinates> {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 = <MapCoordinates> {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<number> {\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}","/// <reference path=\"RoomRandom.ts\" />\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}","/// <reference path=\"../Region.ts\" />\r\n/// <reference path=\"../Shuffler.ts\" />\r\n/// <reference path=\"RoomRandomMap.ts\" />\r\n/// <reference path=\"RoomRandom.ts\" />\r\n/// <reference path=\"RoomRandomFodder.ts\" />\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<RoomRandom> = [];\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<Region>(\"Randomizing Random Region something\");\r\n public static rulebookPlaceRoom = new Rulebook<RandomizingRoomOptions>(\"Placing Random Room something\");\r\n public static rulebookBeforePlaceRoom = new Rulebook<RandomizingRoomOptions>(\"Before placing Random Room something\");\r\n public static rulebookAfterPlaceRoom = new Rulebook<RandomizingRoomOptions>(\"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 = <RegionRandom> 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 = <RegionRandom> 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 = <RandomizingRoomOptions> {\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 = <RandomizingRoomOptions> {\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 = <RegionRandom> 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<number>(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 = <RandomizingRoomOptions> 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 = <RandomizingRoomOptions> runner.noun;\r\n let directionShuffler = new Shuffler<number>(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 = <RandomizingRoomOptions> runner.noun;\r\n let placedRooms = <Array<RoomRandom>> 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 = <TrickierOptions> {\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 = <TrickierOptions> {\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<number>(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<T> {\n id : string;\n value : T;\n}\n\nclass StoredVariable<T> {\n public id : string;\n public value : T;\n public defValue : T;\n\n public constructor (options : StoredVariableOptions<T>) {\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<any>} = {};\n\n public static registerVariable (variable : StoredVariable<any>) {\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}","/// <reference path=\"../Thing.ts\" />\r\n/// <reference path=\"../../../Elements/Classes/Say/OneOf.ts\" />\r\n/// <reference path=\"../Rulebook.ts\" />\r\n/// <reference path=\"../Rule.ts\" />\r\ninterface LiquidOptions extends ThingOptions {\r\n taste? : OneOf;\r\n}\r\n\r\ninterface LiquidContainer {\r\n liquidContents : Array<Liquid>;\r\n}\r\n\r\ninterface LiquidMixture {\r\n quantities : Map<any, number>;\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<LiquidContainer>}\r\n */\r\n public static rulebookMixing = new Rulebook<LiquidContainer>(\"Mixing the liquid contents of something\"); // noun = LiquidContainer\r\n public static mixtures : Array<LiquidMixture> = [];\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// }","/// <reference path=\"../Thing.ts\" />\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}","/// <reference path=\"../Liquid.ts\" />\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}"]}
|