123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- 'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
- $jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}();
- $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};
- $jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();var b=a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
- $jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
- $jscomp.asyncExecutePromiseGenerator=function(a){function b(b){return a.next(b)}function c(b){return a.throw(b)}return new Promise(function(d,e){function f(a){a.done?d(a.value):Promise.resolve(a.value).then(b,c).then(f,e)}f(a.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(a){return $jscomp.asyncExecutePromiseGenerator(a())};
- $jscomp.polyfill("Array.prototype.includes",function(a){return a?a:function(a,c){var b=this;b instanceof String&&(b=String(b));var e=b.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=b[c];if(f===a||Object.is(f,a))return!0}return!1}},"es7","es3");function arrayUnique(a){for(var b=0;b<a.length;++b)for(var c=b+1;c<a.length;++c)a[b]===a[c]&&a.splice(c--,1);return a}function arrayUniqueNewArray(a){a=a.slice();arrayUnique(a);return a}
- class StoredVariable{constructor(a){this.id=a.id;this.defValue=this.value=a.value;StoredVariable.registerVariable(this)}reset(){this.value=this.defValue}updateFromObject(a){this.value=a}exportAsObject(){return this.value}static registerVariable(a){void 0==StoredVariable.storedVariables[a.id]?StoredVariable.storedVariables[a.id]=a:console.warn("[StoredVariable] "+a.id+" already defined. Ignoring:",a)}static getVariable(a){return StoredVariable.storedVariables[a]}static getVariables(){let a=[];for(let b in StoredVariable.storedVariables)a.push(StoredVariable.storedVariables[b]);
- return a}static exportAsObject(){let a={};for(let b in StoredVariable.storedVariables)a[b]=StoredVariable.storedVariables[b].value;return a}static updateFromObject(a){for(let b in StoredVariable.storedVariables)void 0!=a[b]?StoredVariable.storedVariables[b].updateFromObject(a[b]):StoredVariable.storedVariables[b].reset()}}StoredVariable.storedVariables={};
- class RulebookRunner{constructor(a,b){this.rulesToExecute=[];this.ruleRunner=-1;this.rulebook=a;this.noun=b}addRulebooks(...a){a=arrayUniqueNewArray(a);a.forEach((a)=>{this.addRules(...a.rules)})}addRules(...a){0>this.ruleRunner&&this.rulesToExecute.push(...a)}skipRule(a){if(0<=this.ruleRunner){let b=this.rulesToExecute.indexOf(a);b>this.ruleRunner?(this.rulesToExecute.splice(b,1),console.debug("[Rulebook]"+this.rulebook.name+", skipping Rule "+a.name+" due to request.")):console.warn("[Rulebook]"+
- this.rulebook.name+": uname to skip Rule"+a.name+" due to it being too late to stop it.")}}execute(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){arrayUnique(a.rulesToExecute).sort(function(a,c){return a.compareTo(c)});for(a.ruleRunner=0;a.ruleRunner<a.rulesToExecute.length;a.ruleRunner++){a.rule=a.rulesToExecute[a.ruleRunner];let b=yield a.rule.execute(a);if(void 0!=b)return b}})}}
- class Rulebook{constructor(a){this.rules=[];this.name=a}static getIndentation(){return" ".repeat(Rulebook.indentantionSpaces).repeat(Rulebook.rulebookStack.length)}static increaseIndentation(a){Rulebook.rulebookStack.push(a)}static decreaseIndentation(){Rulebook.rulebookStack.pop()}static isRunning(a){return-1!=Rulebook.rulebookStack.indexOf(a)}isRunning(){return Rulebook.isRunning(this)}execute(a,...b){const c=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){a=void 0==a?{}:a;
- var d=new RulebookRunner(c,a.noun);d.addRulebooks(c,...b);var e=[];for(let a=0;a<b.length;a++)b[a]!==c&&e.push(b[a].name);console.debug(Rulebook.getIndentation()+"[RULEBOOK] "+c.name+(0<e.length?" merged with "+e.join(", "):""));Rulebook.increaseIndentation(c);d=yield d.execute();Rulebook.decreaseIndentation();return d})}createAndAddRule(a){a=new Rule(a);this.addRule(a);return a}addRule(a){this.rules.push(a)}sortRules(){this.rules.sort(function(a,b){return a.compareTo(b)})}}
- Rulebook.indentantionSpaces=2;Rulebook.rulebookStack=[];var Settings;(function(a){var b=console.debug,c=()=>{};a.hardDebug=!1;a.sayTurnTime=!0;a.setDebug=function(a){console.debug=a?b:c};a.setHardDebug=function(b){a.hardDebug=b}})(Settings||(Settings={}));
- class Rule{constructor(a){this.firstPriority=this._priority=0;this.priority=void 0!=a.priority?a.priority:Rule.PRIORITY_MEDIUM;this.firstPriority=void 0!=a.firstPriority?a.firstPriority:Rule.PRIORITY_MEDIUM;this.name=a.name;this.code=a.code;this.createdWhere=Error();this.conditions=void 0!=a.conditions?a.conditions:()=>!0}execute(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(b.conditions(a)){console.debug(Rulebook.getIndentation()+"[RULE] "+b.name);Settings.hardDebug&&
- console.debug(b.name,b.createdWhere);Rulebook.increaseIndentation(b);a.rule=b;var c=b.code(a);c instanceof Promise&&(c=yield c);void 0!=c&&console.debug(Rulebook.getIndentation()+"Result:",c);Rulebook.decreaseIndentation();return c}})}get priority(){return this._priority}set priority(a){this._priority=a}compareTo(a){return a.firstPriority<this.firstPriority?-1:this.firstPriority<a.firstPriority?1:a.priority<this.priority?-1:this.priority<a.priority?1:0}}Rule.PRIORITY_HIGHEST=20;
- Rule.PRIORITY_HIGH=15;Rule.PRIORITY_MEDIUM=10;Rule.PRIORITY_LOW=5;Rule.PRIORITY_LOWEST=0;var TurnSequence;
- (function(a){a.rulebook=new Rulebook("Turn Sequence");a.playerActions=[];a.lastTurnTime=0;a.execute=function(b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(1==a.playerActions.push(b)){let c=performance.now();console.debug(Rulebook.getIndentation()+" Player Action: "+(b?b.getCommandText():"none"));yield a.rulebook.execute({noun:b});a.playerActions=[];let d=performance.now();a.lastTurnTime=d-c;console.debug("Total: "+(d-c)+" milliseconds.");Settings.sayTurnTime&&Elements.CurrentTurnHandler.printAsContent(new Say(new SayBold("Time taken for turn: "),
- d-c," milliseconds."))}})};a.PrepareElementsRule=new Rule({firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_MEDIUM,name:"Begin Turn (Elements Side)",code:function(a){Elements.CurrentTurnHandler.startTurn(a.noun)}});a.rulebook.addRule(a.PrepareElementsRule);a.PlayerActionRule=new Rule({firstPriority:Rule.PRIORITY_HIGH,priority:Rule.PRIORITY_MEDIUM,name:"Do Player Action",code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun;void 0!=b&&(yield b.execute(),Elements.CurrentTurnHandler.printAsContent(b.say),
- b.requiresTurn&&WorldState.incrementPlayerTurn())})});a.rulebook.addRule(a.PlayerActionRule);a.RunEveryTurnRulesRule=new Rule({firstPriority:Rule.PRIORITY_MEDIUM,priority:Rule.PRIORITY_MEDIUM,name:"Run Every Turn Rules",code:function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){for(;WorldState.isTurnWaiting();)yield EveryTurn.EveryTurn.execute({})})}});a.rulebook.addRule(a.RunEveryTurnRulesRule);a.RemoveTurnFromElementsRule=new Rule({firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_MEDIUM,
- name:"End Turn (Elements/Controls Side)",code:function(a){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){Elements.CurrentTurnHandler.endTurn();Controls.KeyHandler.reset();yield Elements.HyperlinkHandler.hyperlinkCommonActions();yield Elements.RoomHandler.updateRoom();yield Elements.RememberedHandler.updateMap();let b=a.noun;b?yield Elements.HyperlinkHandler.hyperlinkObject(b.getNoun(0)):yield Elements.HyperlinkHandler.hyperlinkObject();yield Elements.InventoryHandler.updateInventory();
- yield Elements.AppearanceHandler.updateAppearance()})}});a.rulebook.addRule(a.RemoveTurnFromElementsRule)})(TurnSequence||(TurnSequence={}));var SaveHandler;
- (function(a){function b(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let a=document.createElement("input");a.type="file";a.accept=".obsav";let b=new Promise((b,c)=>{a.onchange=()=>{if(0==a.files.length)b(void 0);else{var c=new FileReader;c.onload=(a)=>{b(a.target.result)};c.readAsText(a.files[0])}}});a.click();return b})}function c(a){let b;if(a.Unique)b=Thing.getUnique(a.Name);else{let c=Thing.getNonUnique(a.Name);0<c.length&&(b=c[0]);if(void 0==b){a=a.Name+" no longer exists.";
- console.error("[SaveHandler] "+a);l.push(a);return}b=b.clone(!0)}b.setChanges(a.Changes);return b}function d(a){let b=WorldState.player;StoredVariable.updateFromObject(a.Variables);WorldState.setCurrentTurn(a.Rounds);Thing.WearRelation.getRight(b).forEach((a)=>{Thing.WearRelation.unsetRight(a)});Thing.WieldRelation.getRight(b).forEach((a)=>{Thing.WieldRelation.unsetRight(a)});Thing.CarryRelation.getRight(b).forEach((a)=>{Thing.CarryRelation.unsetRight(a)});a.Wielded.forEach((a)=>{a=c(a);void 0!=a&&
- WorldState.player.setWielded(a)});a.Worn.forEach((a)=>{a=c(a);void 0!=a&&WorldState.player.setWorn(a)});a.Carried.forEach((a)=>{a=c(a);void 0!=a&&WorldState.player.setCarried(a)});a=a.Player;b.setName(a.Name);b.setChanges(a.PlayerChanges);a.Parts.forEach((a)=>{let c=b.getPartsByName(a.Name);void 0!=c&&c[0].setChanges(a.Changes)})}function e(a){let b=[];for(let c=0;c<a.length;c++){let d=a[c];b.push({Unique:d.isUnique(),Name:d.getName(),Changes:d.getChanges()})}return b}function f(){var a=StoredVariable.getVariables(),
- b={};for(var c=0;c<a.length;c++)b[a[c].id]=a[c].exportAsObject();a=Thing.WieldRelation.getRight(player);c=Thing.WearRelation.getRight(player);let d=Thing.CarryRelation.getRight(player);b={Variables:b,Wielded:e(a),Worn:e(c),Carried:e(d),Player:{Name:WorldState.player.getName(),PlayerChanges:WorldState.player.getChanges(),Parts:e(WorldState.player.getParts())},Rounds:WorldState.getCurrentTurn(),Date:(new Date).toLocaleString()};console.debug("[SaveHandler] Created Save Structure",b);return b}function g(a){return JSON.parse(decodeURIComponent(atob(a)))}
- let h=0,l=[],k=!1;a.readFile=b;a.loadSave=function(){let b=document.createElement("input");b.type="file";b.accept=".obsav";document.body.appendChild(b);b.addEventListener("change",()=>{let c=new FileReader;c.onload=()=>{a.loadGame(c.result)};c.readAsText(b.files[0])});b.click();document.body.removeChild(b)};a.loadGame=d;a.getSaveStructure=f;a.setSlot=function(a){h=a};a.saveToStorage=function(){Controls.Memory.setValue("save_"+h,f())};a.loadFromStorage=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(!k){let a=
- Controls.Memory.getValue("save_"+h,void 0);if(void 0!=a)return d(a)}yield CharacterCreation.rulebook.execute({})})};a.loadFromFile=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){PlayBegins.LOAD_FAILED=!1;let a=b(),c,e=new Promise((a)=>{c=a}),f=new Say("No save file was loaded.",Say.PARAGRAPH_BREAK,Say.CENTERED,new SayBold("Press any key to return.")),k=yield Elements.CurrentTurnHandler.getSayElementsAsContent(f);Elements.CurrentTurnHandler.print(...k);let h=Controls.KeyHandler.getNextKey();
- a.then((a)=>{Controls.KeyHandler.stopGivingNextKey(h);Elements.CurrentTurnHandler.unprint(...k);d(g(a));c()});h.then((a)=>{PlayBegins.LOAD_FAILED=!0;c()});yield e})};a.getSayForSlot=function(a){a=Controls.Memory.getValue("save_"+a,void 0);return void 0==a?new Say("New Game"):new Say(k?"(ERASE) - ":"",a.Player.Name+" - Turns: "+a.Rounds+" - Last Played: "+a.Date)};a.getFromFile=g;a.saveToFile=function(){var a=btoa(unescape(encodeURIComponent(JSON.stringify(f())))),b=document.createElement("a");b.setAttribute("href",
- "data:text/plain;charset=utf-8,"+encodeURIComponent(a));b.setAttribute("download","Obelisk_Save.obsav");b.style.display="none";document.body.appendChild(b);b.click();document.body.removeChild(b)};a.isErasing=function(){return k};a.toggleErasing=function(){k=!k}})(SaveHandler||(SaveHandler={}));TurnSequence.rulebook.createAndAddRule({name:"Save game to Storage",priority:Rule.PRIORITY_LOWEST,firstPriority:Rule.PRIORITY_LOWEST,code:()=>{SaveHandler.saveToStorage()}});var Version;
- (function(a){function b(){let b=a.currentVersion;return b[0]+"."+b[1]+"."+b[2]}a.currentVersion=[0,1,0];a.compareVersion=function(a,b){return a[0]<b[0]?-1:a[0]>b[0]?1:a[1]<b[1]?-1:a[1]>b[1]?1:a[2]<b[2]?-1:a[2]>b[2]?1:0};a.getCurrentVersion=b;document.title=document.title+" ["+b()+"] "})(Version||(Version={}));
- class CharacterOrigin{constructor(a){this.id=a;CharacterOrigin.storeOrigin(this)}static storeOrigin(a){CharacterOrigin.origins[a.id]=a}static getOrigin(a){return CharacterOrigin.origins[a]}static getOrigins(){let a=[];for(let b in CharacterOrigin.origins)a.push(CharacterOrigin.origins[b]);return a}}CharacterOrigin.origins={};var CharacterCreation;
- (function(a){a.ChampionOrigin=new CharacterOrigin("Champion");a.ChampionOrigin.name="Champion";a.ChampionOrigin.description="You were born in the small village of Southwood in the post-Tower world. Chosen by the village elder, you were trained relentlessly as soon as you became able to walk. Your mission: get to the Tower and find a way to destroy it. Unbeknownst to you, this is little more than a sacrifice ritual and you are just it's latest victim. The village doesn't actually expect you to succeed, you are merely a gift to the Tower, so that it will not destroy Southwood.";a.ChampionOrigin.bonusStats=
- "This origin grants a +1 Bonus to every attribute, but you will be stuck with some perks gained through your training."})(CharacterCreation||(CharacterCreation={}));(function(a){a.PlayerOrigin=new StoredVariable({id:"Player Origin",value:a.ChampionOrigin.id});a.rulebook=new Rulebook("Character Creation")})(CharacterCreation||(CharacterCreation={}));var Controls;
- (function(a){(function(b){function c(a,b){a=localStorage.getItem("obelisk_"+a);return void 0==a?b:JSON.parse(a)}function d(a,b){localStorage.setItem("obelisk_"+a,JSON.stringify(b));e||(e=!0,c("Version",Version.currentVersion),d("Version",Version.currentVersion))}let e=!1,f={};b.getValue=c;b.setValue=d;b.registerMemory=function(b){if(void 0!=f[b.getId()])console.error("[Controls.Memory] Memory already registered on id "+b.getId(),"Old:",f[b.getId()],"New:",b);else{f[b.getId()]=b;b.setValue(c(b.getId(),
- b.getValue()));let d=()=>{a.Memory.setValue(b.getId(),b.getValue())};b.addListener(d);d()}}})(a.Memory||(a.Memory={}))})(Controls||(Controls={}));
- class StoredMemory{constructor(a,b){this.listeners=[];this.id=a;this.value=b;Controls.Memory.registerMemory(this)}setValue(a){this.value=a}storeValue(a){JSON.stringify(a)!==JSON.stringify(this.value)&&(this.value=a,this.triggerListeners())}getValue(){return this.value}getId(){return this.id}addListener(a){this.listeners.push(a)}triggerListeners(){for(var a=0;a<this.listeners.length;a++)this.listeners[a](this)}}
- class OneOf{constructor(a,...b){this.cyclingOrder=0;this.randomMode=a;this.possibilities=b;this.randomMode==OneOf.ROTATING_RANDOM&&(this.availablePossibilites=this.possibilities.slice())}getOne(){if(this.randomMode==OneOf.PURELY_AT_RANDOM)return this.possibilities[Math.floor(Math.random()*this.possibilities.length)];if(this.randomMode==OneOf.ROTATING_RANDOM)return 1>this.availablePossibilites.length&&(this.availablePossibilites=this.possibilities.slice()),this.availablePossibilites.splice(Math.floor(Math.random()*
- this.availablePossibilites.length),1)[0];if(this.randomMode==OneOf.CYCLING){var a=this.possibilities[this.cyclingOrder++];this.cyclingOrder>this.possibilities.length&&(this.cyclingOrder=0);return a}}}OneOf.PURELY_AT_RANDOM=0;OneOf.ROTATING_RANDOM=1;OneOf.CYCLING=2;
- (function(a){(function(a){function b(a){g.splice(g.indexOf(a),1);h.splice(g.indexOf(a),1)}function d(a){let b=a.key.toUpperCase(),c=b,d=a.code;a.shiftKey&&(b="Shift + "+b,d="Sh"+d,c="S"+c);a.altKey&&(b="Alt + "+b,d="Al"+d,c="A"+c);a.ctrlKey&&(b="Control + "+b,d="Ct"+d,c="C"+c);return{evCode:d,name:b,representation:c}}function e(a,b,c){let d=[];for(let e=0;4>e;e++)if(0==e||1==c[e])for(let c=0;c<a.length;c++){let f=b[c],k=b[c],h=a[c];1==e&&(f="Shift + "+f,h="Sh"+h,k="S"+k);2==e&&(f="Alt + "+f,h="Al"+
- h,k="A"+k);3==e&&(f="Control + "+f,h="Ct"+h,k="C"+k);d.push({evCode:h,representation:k,name:f})}return d}function f(a){return l[a].getValue()}let g=[],h=[];a.rejectPromise=b;a.createKeyCode=d;window.addEventListener("mousedown",function(a){a={representation:"Click",evCode:"Click",name:"Click"};let b=g.shift();void 0!=b&&(b(a),h.shift())});window.addEventListener("keydown",function(b){let c=d(b);b=g.shift();if(void 0!=b)b(c),h.shift();else if(c.evCode==a.scrollKeyCode.getValue().evCode)Elements.CurrentTurnHandler.scrollSpace();
- else if(c.evCode==a.imageKeyCode.getValue().evCode)"block"==SayImage.imageViewer.style.display?SayImage.imageViewer.style.display="none":(b=Elements.CurrentTurnHandler.currentTurnTab.getElementsByClassName("contentImage"),0<b.length&&b[b.length-1].click());else{var e;Elements.getLinkElements().some((a)=>{a=a.getElementsByClassName("keyable");for(let b=0;b<a.length;b++)if(a[b].dataset.shortcutcode==c.evCode)return e=a[b],!0;return!1});void 0!=e&&e.click()}});a.createKeyCodes=e;a.scrollKeyCode=new StoredMemory("scrollKeyCode",
- {evCode:"Space",representation:"Space"});a.imageKeyCode=new StoredMemory("imageKeyCode",{evCode:"KeyI",representation:"I"});a.keyCodes1=new StoredMemory("keyCodesRoom",e(["Digit1","Digit2","Digit3","Digit4","Digit5"],["1","2","3","4","5"],[!0,!0,!0,!0]));a.keyCodes2=new StoredMemory("keyCodesActions",e(["KeyQ","KeyW","KeyE","KeyR","KeyT"],["Q","W","E","R","T"],[!0,!0,!0,!0]));a.keyCodes3=new StoredMemory("keyCodesGlobal",e(["KeyF","KeyV","KeyG","KeyB"],["F","V","G","B"],[!0,!0,!0,!0]));a.keyCodeNorth=
- new StoredMemory("keyCodeNorth",{evCode:"KeyS",representation:"S"});a.keyCodeEast=new StoredMemory("keyCodeEast",{evCode:"KeyC",representation:"C"});a.keyCodeSouth=new StoredMemory("keyCodeSouth",{evCode:"KeyX",representation:"X"});a.keyCodeWest=new StoredMemory("keyCodeWest",{evCode:"KeyZ",representation:"Z"});a.keyCodeUp=new StoredMemory("keyCodeUp",{evCode:"KeyA",representation:"A"});a.keyCodeDown=new StoredMemory("keyCodeDown",{evCode:"KeyD",representation:"D"});var l=[a.keyCodeNorth,void 0,a.keyCodeEast,
- void 0,a.keyCodeSouth,void 0,a.keyCodeWest,void 0,a.keyCodeUp,a.keyCodeDown];a.getDirectionCode=function(a){return f(Room.DIRECTIONS.indexOf(a))};a.getDirectionCodeByIndex=f;a.available1=[];a.available2=[];a.available3=[];a.reset=function(){a.available1=a.keyCodes1.getValue().slice();a.available2=a.keyCodes2.getValue().slice();a.available3=a.keyCodes3.getValue().slice()};a.applyCode=function(a,b){void 0==b?(delete a.dataset.shortcut,delete a.dataset.shortcutcode,a.classList.remove("keyable")):(a.dataset.shortcutcode=
- b.evCode,a.dataset.shortcut=b.representation,a.classList.add("keyable"))};a.getFirstKeyCode=function(){let b=0<a.available1.length?a.available1:0<a.available2.length?a.available2:0<a.available3.length?a.available3:void 0;if(void 0!=b)return b.shift()};a.getSecondKeyCode=function(){let b=0<a.available2.length?a.available2:0<a.available3.length?a.available3:void 0;if(void 0!=b)return b.splice(0,1)[0]};a.getThirdKeyCode=function(){let b=0<a.available3.length?a.available3:void 0;if(void 0!=b)return b.splice(0,
- 1)[0]};a.getNextKey=function(b){let c,d=new Promise((d,e)=>{g.push(d);void 0!=b&&(c=setTimeout(()=>{a.rejectPromise(d);e()},1E3*b))});d.then(()=>{clearTimeout(c)});return d};a.stopGivingNextKey=function(a){a=h.indexOf(a);-1!=a&&b(g[a])}})(a.KeyHandler||(a.KeyHandler={}))})(Controls||(Controls={}));var MachineBegins;(function(a){a.rulebook=new Rulebook("Machine Begins");a.execute=function(){a.rulebook.execute({})}})(MachineBegins||(MachineBegins={}));
- document.addEventListener("DOMContentLoaded",()=>{MachineBegins.execute()});
- class SayImage{constructor(a){this.imgName=a;SayImage.loadTimeCheck||-1!=SayImage.imageNames.indexOf(this)||SayImage.imageNames.push(this)}isImageDefined(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a].rules||document.styleSheets[a].cssRules,c;for(c in b)if("string"==typeof b[c].selectorText&&b[c].selectorText=="."+this.imgName)return!0}return!1}getImageElement(){let a=document.createElement("div");this.isImageDefined()?(a.classList.add(this.imgName),a.classList.add("contentImage")):
- (a.classList.add("error"),a.appendChild(document.createTextNode('Image "'+this.imgName+'" not found.')));a.addEventListener("click",()=>{SayImage.showInViewer(this)});Controls.KeyHandler.applyCode(a,Controls.KeyHandler.imageKeyCode.getValue());return a}getPrintedElement(){return[this.getImageElement()]}static doLoadTimeCheck(){for(let a=0;a<SayImage.imageNames.length;a++){let b=SayImage.imageNames[a];b.isImageDefined()||(Settings.hardDebug&&Elements.CurrentTurnHandler.printAsError('Image "'+b.imgName+
- '" was not found.'),console.error('Image "'+b.imgName+'" was not found.'))}SayImage.loadTimeCheck=!0}static showInViewer(a){"block"!=SayImage.imageViewer.style.display?(SayImage.imageViewer.addEventListener("click",()=>{SayImage.imageViewer.style.display="none"}),SayImage.imageViewer.className=a.imgName,SayImage.imageViewer.style.display="block"):SayImage.imageViewer.style.display="none"}}SayImage.imageNames=[];SayImage.loadTimeCheck=!1;SayImage.imageViewer=document.getElementById("imageViewer");
- (function(a){a.ImageLoadTimeCheck=a.rulebook.createAndAddRule({firstPriority:Rule.PRIORITY_HIGHEST,name:"Check for undefined images",code:()=>{SayImage.doLoadTimeCheck()}})})(MachineBegins||(MachineBegins={}));class SayableObject{}
- class Say{constructor(...a){this.sequence=[];this.centered=this.skipbreaks=!1;this.add(...a)}add(...a){this.sequence.push(...a)}remove(...a){for(let b=0;b<a.length;b++){let c=this.sequence.indexOf(a[b]);0<=c&&this.sequence.splice(c,1)}}isEmpty(){return 1>this.sequence.length}getTextOf(a,b){const c=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let d=yield c.getElementFor(a,b),e=document.createElement("div");for(let a=0;a<d.length;a++)"number"!=typeof d[a]&&e.appendChild(d[a]);
- return e.innerText})}doLineBreak(){if(0<this.currentParagraph.length&&!this.skipbreaks){let a=document.createElement("br");a.classList.add("linebreak");let b=document.createElement("span");b.classList.add("textIndenter");this.currentParagraph.push(a,b)}}doParagraphBreak(){0<this.currentParagraph.length&&!this.skipbreaks&&(this.paragraphs.push(this.currentParagraph),this.currentParagraph=[])}getParagraphs(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){a.paragraphs=[];
- a.currentParagraph=[];a.skipbreaks=!1;for(a.sequenceRunner=0;a.sequenceRunner<a.sequence.length;a.sequenceRunner++){var b=a.sequence[a.sequenceRunner];b instanceof OneOf&&(b=b.getOne());if(b==Say.CENTERED)a.setCentered(!0);else if(b==Say.b){b=[];for(var c=a.sequenceRunner+1;c<a.sequence.length;c++)if(a.sequenceRunner[c]==Say.b){a.sequence.splice(c,1);break}else b.push(a.sequence.splice(c,1));0<b.length&&(b=new SayBold(...b),a.sequence.splice(a.sequenceRunner+1,0,b))}else if(b==Say.COCK)void 0!=HumanoidPenis&&
- (b=HumanoidPenis.getSynonym(),a.currentParagraph.push(document.createTextNode(b)));else if(b==Say.PUSSY)void 0!=HumanoidVagina&&(b=HumanoidVagina.getSynonym(),a.currentParagraph.push(document.createTextNode(b)));else if(b==Say.LINE_BREAK)a.doLineBreak();else if(b==Say.PARAGRAPH_BREAK)a.doParagraphBreak();else if(b==Say.RUN_PARAGRAPH)a.skipbreaks=!0;else if(b==Say.RUN_PARAGRAPH_OFF)a.skipbreaks=!1;else if("function"==typeof b){b=b(a);if(Array.isArray(b))for(c=b.length-1;0<=c;c--)a.sequence.splice(a.sequenceRunner+
- 1,0,b[c]);else void 0!=b&&a.sequence.splice(a.sequenceRunner+1,0,b);a.sequence.splice(a.sequenceRunner,1);a.sequenceRunner--}else if(b.constructor==a.constructor){for(c=b.sequence.length-1;0<=c;c--)a.sequence.splice(a.sequenceRunner+1,0,b.sequence[c]);a.sequence.splice(a.sequenceRunner,1);a.sequenceRunner--}else if(void 0!=b)for(b=yield a.getElementFor(a.sequenceRunner,b),c=0;c<b.length;c++)b[c]===Say.DO_LINE_BREAK?a.doLineBreak():b[c]===Say.DO_PARAGRAPH_BREAK?a.doParagraphBreak():a.currentParagraph.push(b[c])}0<
- a.currentParagraph.length&&a.paragraphs.push(a.currentParagraph);return a.paragraphs})}getElementFor(a,b){const c=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){b instanceof Promise&&(b=yield b);if("string"==typeof b||b instanceof String)return[document.createTextNode(b)];if("number"==typeof b||b instanceof Number)return[document.createTextNode((parseFloat(b.toFixed(2))/1).toString())];if("function"==typeof b)return yield c.getElementFor(-1,b(c));if(b instanceof SayImage)return[b.getImageElement()];
- if(b instanceof Say)return yield b.getPureElements(c);if(c.isProperElement(b))return[b];if(b instanceof Object)return yield c.printName(b)})}getPureElements(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let a=yield b.getParagraphs();return 1==a.length?a[0]:Array.prototype.concat.apply([],a)})}setCentered(a){this.centered=a}getHTML(a,b,c){const d=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let e=yield d.getParagraphs();1==c&&1<e.length&&(e=
- [Array.prototype.concat.apply([],e)]);let f=[];for(let c=0,h=e[c];void 0!=h;h=e[++c]){let c=document.createElement(a);0<b.length&&c.classList.add(...b);for(let a=0,b=h[a];void 0!=b;b=h[++a])c.appendChild(b);f.push(c);d.centered&&c.classList.add("centered")}return f})}getHTMLContent(){return this.getHTML("p",["content"])}isProperElement(a){return("object"===typeof Node?a instanceof Node:a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName)||("object"===typeof HTMLElement?
- a instanceof HTMLElement:a&&"object"===typeof a&&null!==a&&1===a.nodeType&&"string"===typeof a.nodeName)}printName(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){b.currentNoun=a;b.currentNounElements=[];yield Say.beforePrinting.execute({noun:b});yield Say.printing.execute({noun:b});yield Say.afterPrinting.execute({noun:b});return b.currentNounElements})}static hisHersIts(a,b){return new SayHisHersIts(a)}}Say.LINE_BREAK=new SayableObject;Say.PARAGRAPH_BREAK=new SayableObject;
- Say.RUN_PARAGRAPH=new SayableObject;Say.RUN_PARAGRAPH_OFF=new SayableObject;Say.CENTERED=new SayableObject;Say.b=new SayableObject;Say.DO_PARAGRAPH_BREAK=new SayableObject;Say.DO_LINE_BREAK=new SayableObject;Say.COCK=new SayableObject;Say.PUSSY=new SayableObject;Say.beforePrinting=new Rulebook("Before printing the name of something");Say.printing=new Rulebook("Printing the name of something");Say.afterPrinting=new Rulebook("After printing the name of something");
- Say.printing.addRule(new Rule({name:"Printing the name of a Printable Element",firstPriority:Rule.PRIORITY_LOW,code:(a)=>{a=a.noun;if(a.currentNoun.getPrintedElement)return a.currentNounElements.push(...a.currentNoun.getPrintedElement()),!0}}));Say.printing.addRule(new Rule({name:"Printing the name of a Printable",firstPriority:Rule.PRIORITY_LOW,code:(a)=>{a=a.noun;if(a.currentNoun.getPrintedName){let b=document.createTextNode(a.currentNoun.getPrintedName());a.currentNounElements.push(b);return!0}}}));
- Say.printing.addRule(new Rule({name:"Printing the name of an unknown object",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_LOWEST,code:(a)=>{a=a.noun;if(a.currentNoun.getPrintedName)return a.currentNounElements.push(document.createTextNode(a.currentNoun.toString())),!0}}));var ContentHandler;
- (function(a){let b={},c=[];a.registerContentType=function(a){void 0!=b[a.getId()]?console.error("[ContentHandler} Can't register the content.",a,"Old:",b[a.getId()]):(b[a.getId()]=a,c.push(a))};a.getContentTypes=function(){return c.slice()}})(ContentHandler||(ContentHandler={}));
- class ContentType extends StoredMemory{constructor(a){super(ContentType.memoryPrefix+a.id,a.defaultValue);this.valueDescription=()=>new Say(JSON.stringify(this.getValue()));this.changeable=!0;this.description=a.description instanceof Say?a.description:new Say(a.description);this.valueDescription=void 0==a.currentValueDescription?this.valueDescription:a.currentValueDescription;0==a.changeable&&(this.setValue(a.defaultValue),this.changeable=!1);ContentHandler.registerContentType(this)}getDescription(){return this.description}getValueDescription(){let a=
- this.valueDescription(this);return a instanceof Say?a:new Say(a)}toggle(){this.changeable&&this.setValue(!this.getValue())}isAllowed(){return this.getValue()}}ContentType.memoryPrefix="ct_";ContentType.MM=new ContentType({changeable:!1,description:"Homosexual (M/M) sexual events",id:"MM",defaultValue:!0});ContentType.FF=new ContentType({changeable:!1,description:"Homosexual (F/F) sexual events",id:"FF",defaultValue:!0});
- ContentType.MF=new ContentType({changeable:!1,description:"Heterosexual (M/F) sexual events",id:"MF",defaultValue:!0});ContentType.Beast=new ContentType({changeable:!0,description:"Sexual events with either monsters or magical beasts. MM/MF/FF take precedence over this one if blocked. Sufficiently human creatures do not get counted into this.",id:"Beast",defaultValue:!0});ContentType.Scat=new ContentType({changeable:!1,description:"Scatologic sexual events",id:"Scat",defaultValue:!1});
- ContentType.Pee=new ContentType({changeable:!1,description:"Sexual events with urine",id:"Urophilia",defaultValue:!1});var Elements;
- (function(a){function b(){a.mainPage.classList.add("turn")}function c(){a.mainPage.classList.remove("turn")}function d(){return a.mainPage.classList.contains("turn")}function e(){0!=g&&console.error("A menu wasn't finished properly. Please correct the dialogue.");g=0;f=!1;a.mainPage.classList.remove("mainmenu")}a.animationTime=1E3;a.isMobile=/Mobi/i.test(navigator.userAgent);a.screenWidth=document.body.clientWidth;a.screenHeight=document.body.clientHeight;a.getLinkElements=function(b){return void 0==
- a.CurrentTurnHandler?[]:a.CurrentTurnHandler.isTurn()||b?[a.CurrentTurnHandler.currentTurnTab]:[a.HyperlinkHandler.linkedActionsTab,a.RoomHandler.currentRoomTab,a.HyperlinkHandler.commonActionsTab,a.CurrentTurnHandler.currentTurnTab]};a.updateScreenSize=function(){a.screenWidth=document.body.clientWidth;a.screenHeight=document.body.clientHeight};a.mainPage=document.getElementById("mainPage");a.startTurn=b;a.endTurn=c;a.isInTurn=d;let f=!1,g=0;a.startMenu=function(){d()||(f=!0,b());a.mainPage.classList.add("mainmenu");
- g++;a.CurrentTurnHandler.clear();Controls.KeyHandler.reset()};a.endMenu=function(){a.CurrentTurnHandler.clear();0==--g&&(f&&c(),e())};a.resetMenus=e;a.clearMainScreen=function(){a.CurrentTurnHandler.clear()};let h=document.getElementById("loadingScreen");a.stopLoading=function(){document.body.removeChild(h)};a.waitForAnyKey=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=yield(new Say(Say.CENTERED,new SayBold("Press any key to continue."))).getHTML("p",["content"]);
- a.CurrentTurnHandler.print(...b);yield Controls.KeyHandler.getNextKey();a.CurrentTurnHandler.unprint(...b)})};a.waitForSpaceKey=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=yield(new Say(Say.CENTERED,new SayBold("Press Space to continue."))).getHTML("p",["content"]);a.CurrentTurnHandler.print(...b);let c="notSpace";for(;"Space"!=c&&"Click"!=c;)c=(yield Controls.KeyHandler.getNextKey()).evCode;a.CurrentTurnHandler.unprint(...b)})};a.printObeliskLogo=function(){let b=
- new Say(Say.CENTERED,new SayImage("introLogo"),Say.LINE_BREAK,new SayItalic("The Obelisk is an adult interactive fiction game set in a post-apocalyptic world ravaged by a magical structure."));a.CurrentTurnHandler.printAsContent(b)}})(Elements||(Elements={}));window.addEventListener("resize",function(){Elements.updateScreenSize()});(function(a){a.HideLoadingDivRule=a.rulebook.createAndAddRule({name:"Hide loading div",code:(a)=>{Elements.stopLoading()}})})(MachineBegins||(MachineBegins={}));
- (function(a){a.LazilyFixMenus=a.rulebook.createAndAddRule({name:"Fix menus that were never closed because the dev is stupid",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_LOWEST,code:()=>{Elements.resetMenus()}})})(TurnSequence||(TurnSequence={}));
- (function(a){(function(b){function c(a){return a.getHTML("p",["content"])}function d(a){let b=f();c(a).then((a)=>{g(a,b);h(b)})}function e(...a){0<a.length&&(a.forEach((a)=>{b.currentTurnTab.appendChild(a)}),k(b.lastReadOffset))}function f(){let a=document.createTextNode("");b.currentTurnTab.appendChild(a);return a}function g(a,c){a.forEach((a)=>{b.currentTurnTab.insertBefore(a,c)});k(b.lastReadOffset)}function h(...a){a.forEach((a)=>{a.parentElement==b.currentTurnTab&&b.currentTurnTab.removeChild(a)})}
- function l(){let a=b.turnHr.offsetTop+b.turnHr.offsetHeight;b.lastReadOffset=a;a<b.currentTurn.scrollTop||k(a)}function k(c){c<=b.lastReadOffset&&(n=b.currentTurn.scrollTop,q=c,p=(new Date).getTime(),t=p+a.animationTime,u=t-p,m())}function m(){void 0==r&&(r=requestAnimationFrame(b.updateFrame))}b.currentTurnTab=document.getElementById("currentTurnTab");b.currentTurn=document.getElementById("currentTurn");b.turnHr=document.createElement("p");b.lastReadOffset=b.currentTurnTab.clientHeight/2;b.turnHr.classList.add("turnStart");
- b.turnHr.appendChild(document.createTextNode("Start of Turn"));b.startTurn=function(c){c=b.currentTurnTab.getElementsByClassName("content");for(let a=0;a<c.length;a++)c[a].classList.add("contentOld"),c[a].classList.remove("content");b.currentTurnTab.appendChild(b.turnHr);a.startTurn();l()};b.isTurn=function(){return a.isInTurn()};b.endTurn=function(){a.endTurn()};b.getSayElementsAsContent=c;b.printAsContent=d;b.simplePrint=function(...a){d(new Say(...a))};b.printAsError=function(a){if(a instanceof
- Say)a.getHTML("div",["error"],!0).then((a)=>{e(...a)});else{let b=document.createElement("div");b.classList.add("error");b.appendChild(document.createTextNode(a));e(b)}};b.clear=function(){for(;void 0!=b.currentTurnTab.firstChild;)b.currentTurnTab.removeChild(b.currentTurnTab.firstChild)};b.print=e;b.getMarker=f;b.insertBefore=g;b.unprint=h;b.scrollToNewTurn=l;b.scrollToBottom=function(){k(b.currentTurn.scrollHeight-b.currentTurn.clientHeight)};b.scrollSpace=function(){k(b.currentTurn.scrollTop+b.currentTurn.clientHeight/
- 2)};b.currentTurn.addEventListener("scroll",()=>{let a=b.currentTurn.scrollTop+b.currentTurn.clientHeight;a>b.lastReadOffset&&(b.lastReadOffset=a)});var n,q,p,t,u,r;b.scrollTo=k;b.startScrolling=m;b.updateFrame=()=>{r=void 0;let a=q-n,c=(new Date).getTime()-p,d=b.currentTurn.scrollHeight-b.currentTurn.clientHeight;b.currentTurn.scrollTop=n+c/u*a;b.currentTurn.scrollTop<q&&b.currentTurn.scrollTop<d&&m()}})(a.CurrentTurnHandler||(a.CurrentTurnHandler={}))})(Elements||(Elements={}));
- (function(a){(function(a){a.makeLink=function(a,b){a.addEventListener("mouseover",()=>{Elements.HyperlinkHandler.hoverAction(b)});a.addEventListener("mouseout",()=>{Elements.HyperlinkHandler.unhoverAction()});a.addEventListener("click",(a)=>{TurnSequence.execute(b);Elements.HyperlinkHandler.unhoverAction();a.stopPropagation();a.preventDefault()})}})(a.Links||(a.Links={}))})(Controls||(Controls={}));
- class RoomNode{constructor(a){this.mainDiv=document.createElement("div");this.room=a;this.mainDiv.classList.add("mapRoom");void 0!=a&&(this.mainDiv.classList.add("linked",a.getBackgroundClass()),Room.DIRECTIONS.forEach((b)=>{if(void 0!=a.connections[b]){let a=document.createElement("div");a.classList.add("mapRoomConnection"+DirectionNames[Direction[b]]);this.mainDiv.appendChild(a)}}),Controls.Links.makeLink(this.mainDiv,new ActionGo(WorldState.player,a)))}createRoomNameFloater(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(void 0!=
- a.room){let b=document.createElement("div");yield(new Say(a.room)).getPureElements().then((c)=>{c.forEach((a)=>{b.appendChild(a)});Elements.HoverInfo.makeHoverable(a.mainDiv,c)})}})}update(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){void 0!=a.room&&(WorldState.player.getRoom()==a.room?a.mainDiv.classList.add("current"):a.mainDiv.classList.remove("current"),(yield WorldState.isRoomRemembered(a.room))?a.mainDiv.classList.remove("unknown"):a.mainDiv.classList.add("unknown"))})}getElement(){return this.mainDiv}}
- class SayAn extends Say{constructor(a){super();this.node=document.createTextNode("a ");this.uppercase=!0;void 0!=a&&(this.uppercase=a)}getPureElements(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var c=a.sequence[a.sequenceRunner+1];void 0==c||c instanceof Thing&&c.properlyNamed?b.node.nodeValue="":(c=AvsAn.query((yield a.getTextOf(a.sequenceRunner+1,c)).trim()),""!=c.prefix&&(b.node.nodeValue=c.article+" "),b.uppercase&&0==a.currentParagraph.length&&(b.node.nodeValue=
- b.node.nodeValue.charAt(0).toUpperCase()+b.node.nodeValue.substr(1,b.node.nodeValue.length-1)),b.node.nodeValue+=" ");return[b.node]})}}
- var AvsAn=function(){function a(b,d,e){var c=e.split(";",3),g=c.map(function(a){return parseInt(a,36)||0});d.data={aCount:g[0],anCount:g[1],prefix:b,article:g[0]>=g[1]?"a":"an"};e=e.substr(1+c.join(";").length);for(c=0;c<g[2];c++)e=a(b+e[0],d[e[0]]={},e.substr(1));return e}var b={};a("",b,"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;;\u20135;;;31x;jc;1; 12;2;;41w;kq;2; z;4;;\u20135;;;559;sp;5; 2k;1;;,h;;;h7;;;kd;;;m6;;;62p;rm;2; 1b;5;;k5;;;72n;y6;2; 14;;;\u20135;;;82r;192;2; 19;4;;,5;;;93i;1ig;2; 10;4;;\u20135;;;8ys;nsu;;<e9;1x;2;m;;1;d;6;;o;6;;=kq;1x;1;=3m;g;1;E;6;;@16;2a;;A3wn;bu7d;6;Abr;y1;1;A8b;5o;1;S3;e;;i2g;4rh;1;r26;4dg;1;ob;2;;mg9;5490;1;a1k;140;1;rv;1e;1; t;1;;n6n;gfl;1;d25;1ae;1;a1c;5b;1;l1b;4c;1;u1b;3r;1;c18;c;1;i;;1;a;;1;n;6;;s3f;feu;1;tn;sc;1;uh;1t;1;rh;1s;1;ih;1q;1;ah;1q;1;sg;1;;t71;41h;1;h53;112;1;l4x;7i;1;e4w;6m;1;t4w;6m;1;e4w;2j;1;s;f;;B7cel;sz;2;hlb;42;2;aaw;28;1;ij;1y;1;rf;1s;1;ae;;;\u00e1;11;;olhj;28;1;r1cy;j;1;des;f;1; 3;f;;C8l05;10j;3;a29ng;5t;1;i9c;b;1;s;;1;s5;;;h1ska;9p;4;aa1a;1x;2;i115;o;1;s5;g;1;e5;;;o5p;7;1;i;6;;l17;l;1;\u00e1;f;;rkxk;19;1;o9t;a;1;\u00ed;5;;u2re;y;2;i1;a;;r2fq;e;1;re;5;1;a;5;;o1vrk;88;1;njpy;1m;1;g380;f;1;j;5;;D40dx;hh;7;aj56;1y;1;o35;6;1;q;5;;ijhc;2t;2;nbw;j;1;a17;f;1;s4;f;;ogz;g;1;t1;9;;uivv;1r;1;ad2;7;1;lci;7;1;c;7;;\u00e130;7;1; ;5;;\u00f2;5;;\u00f91;e;;\u01b0;7;;Efoe;42zy;7;U3t;zk;1;R1r;4;;be;42;1;oc;1t;1;lb;p;1;ib;;;m2k;73m;1;pw;13w;1;eh;91;1;zd;;;n7x;27zz;1;af;14;1;md;3;;syp;35x;1;pws;9c;5;awn;p;1;c;7;;e4;7d;;h;5;;o;b;;r;h;;udjl;hc;1;lj;6o;1;o6;;;wr;1e;1;id;2;;F4eta;hhx;11; cf;1rz;;,;17;;.2j;6h;;/i;29;;05;2y;;128;e1;;216;9g;;311;7d;;418;8i;;5i;5u;;69;z;;7;;1;0a;;;86;j;;97;l;;A404;5ij;e;Be;3;;Ct9;my;;Dx;9;;Fc;;;I;;2;L8;;;Rq;;;K11;;;Ll;4;;M1x;1;;Ny;2;;P13;2;;Q9h;5j;;Rad;3p;;S1n;9;;T2t;2;;B57;1ji;;C4s;jp;1;Mb;1;;D2g;ak;;E7r;39;2;C6;k;;I5;f;;F33;64;1;r5;;;Hz;1u;;I1vx;bk;3;A24;45;1;Tm;1;;R;;1; w;30;;U2;a;;J5;f;;Lkk;g1;3;C2p;3v;;N4;e;;P1;f;;M6w;1ds;;Og3;2e;1; 5;i;;Ps4;w7;1;.7i;53;;R8v;3z;2;A1e;g;1; 3;e;;Se;y;;S3g;91;;T8a;1ah;1;S1x;6;;Uel;3m;2;,2;b;;.;k;;Xm;1o;;Yz;5w;1;V6;;;c3;l;;f;;1;o7;;;h1;31;;\u03c31;i;;G55z0;ig;7;e1sct;3h;1;r1fvh;1n;1;n;;1;e;a;;h1sd;31;1;a17k;2e;3;e;q;;i;n;;o;6;;i4b9;s;1;alt;c;1;nl0;b;1;g1;a;;ovi2;2d;2;f;;1; ;b;;t238;f;1;t2z;7;1; ;6;;r17jv;32;1;iql;e;1;a;9;;w43;6;1;a1p;5;1;rd;5;1;r;5;;\u00fa;5;;H24sn;cwd;s; 5i;mk;;&b;17;;,1;f;;.37;42;2;Ai;;;Ie;4;;1i;1j;;2r;22;;39;n;;5a;19;;72;a;;B2z;cx;1;P7;;;C1q;35;;Dd1;tb;;F1l;2x;;Gl;14;;Hy;30;1;I5;;;I80;i9;6;Cc;1;;G10;2;;Nb;1;;Pq;2;;S;;1;D1;j;;Tf;1;;K4k;1w;1;9;7;;L1e;35;;M36;6u;1;.c;;;Ny;2v;;O95;3g;2; 7;t;;Vc;16;;P4b;bf;;R2v;4v;1;Tn;7;;S;;1;F5;;;T9c;115;;V1k;3u;;eaox;7p;2;im1;11;1;r4;o;;r29t;2m;1;r1d;7;1;n;5;;ohh1;6d0;2;n3jr;65v;6;d121;v;;e4c;1m;1;s7;1m;;g21f;e;;kp;;;oad;61b;2;l26;1;;r7c;5jz;1;i;;1;f;5;;v6;;;u2q4;32;1;r2;2x;;I266;4mgb;3;I4o;8f;2;*6;;;I1v;j;;nij;1hm4;1;d9p;wtp;1;e1c;3wy;1;p12;3r6;1;e12;3r6;1;n12;3r4;1;d12;3r4;2;et;3qw;1;nt;3qw;1;c7;41;1;i6;;;\u00ea8;;;s4h;cif;1;l2i;42z;1;a2h;3yr;1;ne;gy;1;de;gy;1;sd;3;;J24b6;7h;1;iw9;t;1;a;;1;o2;o;;L2u98;abe;y; 5s;17t;;,2;s;;.25;9q;;1l;1t;;2j;2h;;3a;10;;48;l;;8;c;;Anc;ce;3; 1e;6q;;Po;2t;;X1;a;;B1j;2r;;C59;r4;;D42;lc;;Ejg;hg;2; 2;i;;D4x;e9;;F20;3s;1;Ti;2;;G8s;ko;;H;;1;Dk;6;;Idy;1m;1;Rd;u;;Lc0;25k;;M3k;94;;N26;51;;P63;1g0;;R23;6z;;S2z;f6;1;m7;;;T36;86;;U1s;n;1; 5;h;;V14;35;1;C7;;;W;;1;T;5;;Z9;t;;^;5;;am5d;3g;1;o91;e;1;i;;1;g;e;;oln2;3r;1;c2ik;19;1;h1s;11;1;a7;z;1;b6;;;p1;h;;u51i;1q;1;s4p;x;1;hg;w;1;ob;;;\u1ed9;5;;M5bhu;skd;15; 6n;n2;;&b;1h;;,;g;;.1kr;5er;1;Alm;2kf;1;.kf;2ht;1;Sa;2;;/4;1f;;14f;f4;;22a;6k;;3y;31;;41j;5h;;5n;1a;;6r;3q;;7t;1f;;87;11;;A1fx;2mt;i;B5;;;C9q;1;;D2d;3;;F12;4;;G17;4;;J38;;;L11;2;;Mv;1;;N2i;a;;P2f;6;;R2o;;;S2t;6;;T2l;f;;Vc;2;;W7;;;X1h;;;Ya;;;Z7;;;Bbv;39s;1;Sb;r;1;T9;;;C5e;ni;;D5e;na;;Efj;d4;3;P1j;9f;1;S7;;;W;7;;n6;i;;F64;14y;;G31;az;;H2i;7d;;Izq;ij;4; f;w;;5;2o;;6f;35;;T25;7y;1;Mi;1;;K1o;3c;;Lcl;17r;;Mcc;rp;;N1i;40;;Osl;av;1;U17;2c;;Pel;3xz;;Qa;1g;;R4l;nw;;Sku;1ld;;Tai;yj;1;R1y;w;;Uas;1t;2; 2;i;;V3;d;;V3s;a5;;Xq;2p;;b1a;i;1;ur;d;1;m1;a;;f2q;ek;;hf;1g;;om4z;7h;2;D;;1;e7;;;U2b;34;1;.5;;;p;;1;31;b;;s23;h;1;c3;c;;N3qyx;ipi;y; 7p;qe;;+;9;;.;;1;Eg;5;;46;k;;7;7;;8;7;;:;5;;A4ga;in;3;A3g;6j;1;Fo;2;;I1m;52;;S2l3;1x;1;Lb;1b;;B8k;2gd;;Ckh;2ib;;D2t;aq;;Ejp;9r;3;A10;2r;;H5;16;;S;;1; 1y;2v;;Fas;2sm;1;Uc;2;;G5x;zb;;H8o;1oq;;I;;7;C1w;j;;D;;1; ;9;;Ka;;;Ld;2;;Nj;;;O8;;;S20;n;;K1c;4g;;L2t;94;;M1s;9a;1;M5;;;Ndl;36;2;R1;d;;T4;h;;P;;1;O25k;1j4;1;V24y;1i8;1;/;;1;B;5;;R9n;f6;2;Je;3;;T3y;e;;Sby;lt;1;W5m;g;;T3m;9h;1;L;;1;D5;;;U60;1a;1;S4;i;;V1a;4h;;W64;4n;2;Au;30;;O;;1;H;8;;Xp;4p;;Ys5;af;3;C64;1i;1;L;6;;P1k;3t;;Uj;1p;;a10pz;8f;1;sq1;d;1;a;;1;n1;8;;t;;1;h1;a;;vk;1c;;\u00b2;7;;\u00d7;5;;O1n9;1g7f;5;N17;3l;1;E12;2;;l29;8yb;1;vl;2;;nuh;1ti;2;c;;1;ec;2;;etc;21;1;i2;1k;;oi;3e;1;pf;1;;u3x;1ey;1;i3c;b;;P5dsg;kg;1;hmb6;3r;2;i39j;v;1;a;9;;o128;1s;2;bh;19;2;i8;;;o9;;;i1;j;;Qb3c;1l;1;i8c;t;1;n61;l;1;g4x;l;1;x1;f;;R3te6;u0n;z; 6h;119;;&8t;ze;;,;k;;.2r;4t;1;Jj;3;;/a;q;;11s;3k;;4a;r;;67;j;;A12c;ym;3; d;1o;;.1;a;;F7v;ra;1;Tf;;;B4b;v4;1;Rk;3;;C52;l7;;D34;9b;;Enp;3a;3; b;q;;S3z;q;1;Pa;p;;U;5;;Fxl;5cg;;G11;5w;;H1x;1a;1;S4;f;;If2;6o;2;A17;3s;;C;;1; a;1c;;Jn;2e;;Kz;5g;;L1h;2k;1;P6;;;M5u;cg;5;1e;4;;26;;;36;;;59;;;65;;;N4y;q3;;Ogs;86;2;Hk;16;;T1n;3b;2;Av;;;O7;;;P4u;q7;;Q8;q;;R21;37;1;F6;;;S1pl;1up;4;,85;6b;;.ba;7l;;?2l;y;;Tv;6;;T5t;iz;;U23;4u;4;B5;;;M5;;;Nb;;;S9;1;;V1h;8u;;Xa;o;;c;8;;f3qh;db8;1;M;;1;.h;4;;h1xk;1a;2;A;5;;B;5;;\u00f2;5;;S7ldf;ea7;11; 9n;18a;;&1o;3s;;,2;f;;.e8;91;4;E7;m;;Mc;10;;Oa;18;;T;;1;.;;3;B2;b;;D3;c;;M2;c;;1m;29;;35;o;;4b;s;;55;i;;68;s;;84;i;;92;b;;A1b1;l3;3; 2a;7d;;8;5;;S2v;3t;2;Ep;4;;I6;;;B30;74;;Clf;a7;3;A2z;15;1; 3;y;;R;;2;Ap;;;U5;;;T6;s;;D66;ns;;Eri;jq;6; s;1g;;5;7;;C3g;ba;3;Ac;;;Oh;;;Rh;3;;I;;1;F9;;;O1a;28;;U;5;;F58;7w;3;&5;;;H6;;;O;;1;S8;;;G24;5v;1;Df;5;;H6m;3t;3;25;h;;32;g;;L;7;;It0;83;2; f;50;;S;;1;O6;;;K;;2;I9;1;;Yh;;;L6z;8m;3;A2k;o;2; 1;g;;.;5;;Iu;e;1; 3;c;;Om;5;;M9j;lh;3;A28;o;1; 4;m;;Ii;5;;U;;1;R6;;;N;;5;A1e;b;;C;;3;A8;;;B5;;;C8;1;;E18;o;;Fa;;;O4g;1;;Oi7;dc;5; c;u;;A4c;1h;1;I5;g;;Eg;1m;;Sv;5m;1;U5;;;V9;p;;P1r8;320;7;A102;1dn;7;Aa;;;Ch;;;D22;;;Mr;;;Ne;;;R2f;;;S8;1;;E3k;j;1; 4;g;;Ib9;155;4;Co;;;D6;;;N5;;;R5;;;L13;26;1;O6;;;O18;e;;U1x;5;;Y5;;;Q;;1; 1;e;;R3i;9z;;Sf7;1kv;1;We;;;Tjg;e7;9;A46;w;1; 8;s;;C7;r;;Dn;2z;;F4;n;;Iq;1c;;L6;k;;Mm;15;;Sb;12;;V5;12;;U;;7;Bn;1;;L42;28;;Mj;;;N18;;;P15;2;;Rf;;;Sf;;;V6j;y7;;Whe;2v;1;R5;m;;X;;1;M2;c;;ha9m;14;1;i2m7;i;1;g;;1;a;;1;o;7;;pxbl;3u;1;i1lg;s;1;o6;j;1;n6;;;tpmv;33;2;B;5;;ikz;b;1;c5b;a;1;i;8;;T3dav;if;4;aczy;4f;2;i1wj;15;2;g;;1;a6;;;s;;1;c;8;;v1q;q;1;e17;h;1;s;h;;ega6;29;1;a1o2;o;1;mg2;6;1;p;6;;uc4t;22;1;i;;2;l1;8;;r;8;;\u00e01;n;;U2oh8;a1j;m;.jqk;80;1;N78;h;1;.70;h;1;C;f;;/2r;f;1;1;9;;1;;1; c;;;24b;x;1;17;k;;L3q;j;1;T;6;;M7h;1d;1;N8;q;;N4bp;am;4;C2u;k;1;L;5;;D;;2; 6;;;P14;2;;K;5;;R;;1; 5;;;a3;40;;b2r;43;2;am;4;;is;9;;de;16;;glp;3a;1;l;1n;;i;;1;gq;a;;l2u;14r;2;ig;4;;yc;;;my;8n;;ntrc;2uh;o; 5;k;;a;;1;n1e;b;;b3;1q;;ce;9w;;d1u;x2;;e19;1t;1;s16;2;;f3;2d;;g;l;;h6;l;;itj3;kb;2;d3;e;;n2;65;;j;7;;k3;55;;l3;2c;;m5;1e;;n2;t;;o4;13;;p2;1p;;q;5;;r6;71;;s5;2u;;t11;4a;;u6;v;;v1;a;;w1;10;;p12;ze;;r1ap;1rs;3;a4h;k;;ea;;;uz5;e2;1;k1;d;;s1at;41;3; ;7;;h9;t;;tw;1r;1;rp;1;;tla;49;4;h2;a;;n1;n;;ra;u;;t7;j;;x2;j;;z2d;dy;;\u00ed2;e;;W3fzh;1xp;2;Pgh8;1kw;1;:dtp;1jr;4;A;;1;Fp;1b;;I;;2;B1;9;;N;;1;H8;1;;Oe2;7b;1;V;a;;R1n7;cv;1;F;;1;C;;2;N5;;;U1b;e;;i150z;6l;1;kucb;5n;1;iu0s;5l;1;El;8;1;l;;1;i1;8;;X18k;5ru;7;a2o;6;;e7o;5;;h22;;;i8v;c;;om;4;;ux;4;;yt;4;;Ydr1;5s;3;e1xq;v;1;t35;a;1;h2;a;;p3;d;;s1;8;;[1f3;b3;5;A6;m;;E;b;;I1;a;;ai;13;;ed;30;;_1pde;5f3;2;_1pa2;5em;1;i;6;;e;5;;`4j;19;3;a1;g;;e;5;;i;7;;aa4e;1k1cr;7; 2e6;1r4;;m6h;1bmc;1;a2k;gdk;1;r;;1; 9;;;n1yq;4tcz;1;dsz;136;2; sm;69;;\u011b5;;;p8x;2tn1;1;rj;e8;1;t6;;;r1ql;dm6d;1;t1bb;7rrp;1;\u00ed6;;;uat;271y;1;sc;wm;1;s6;l;1;i;;1; 5;;;v31;2qsv;1;u5;21;1;t5;;;d14132;4sp;3;a4bh7;3i;1;s1q3;1j;1; ;1h;;edez2;3tl;2;mosa;1n;1; 2;10;;r9oc;3b1;1; 1;3an;;idsd0;ky;2;cfg1;k;1;hdj;d;1; ;c;;e57k;6w;1;s1rl;l;1;e1pp;k;2;m;5;;r;5;;e7wn;zlrz;8;c2u;mo2;1;o1z;egy;1;n1g;bbv;1;o1e;bbg;1;m1e;bbc;1;i1b;9c8;1;a6;;;ee;15d;1;w8;;;lbr;2yiq;1;it;5bi;1;tj;3qh;1;eg;3hs;1;i5;;;m8g;1t5c;1;p2z;oie;1;ed;v6;1;zd;;;nyp;6b4j;1;t7j;1g2s;1;e16;5d4;1;n5;r;1;d5;;;s96;1ypr;2;a;;1; 5;;;t45;1716;4;a2g;c3l;1; d;;;e8;i0;1; 6;;;il;tl8;1;ml;tl5;1;al;tl4;1;r5;;;rd;bo;1;u;;1;t6;;;u2qo;74;1;p11a;2j;1; ;i;;w2e;o;;f1n9ht;1ct;3; 1b;44;;M7;2j;;y1l;7;1;i;7;;hpp6o;1t04;9; 37;kq;;,1;9;;.;5;;C2;1d;;a4tpe;la;1;u1je;1r;1;tn;1j;1;b5;;;e3q3g;3wn;2;iajd;24b;1;r1z;232;1;a15;1;;rjaj;1ep;1;m1uj;14;1;a83;e;1;n;5;;o63t5;1eb3;4;mymg;1rd;2;a16t;1mn;1; 6;;;mm;1g;;n1aw;owo;8; a;1;;b8;;;df;;;ez3;32r;3; 6;;;de;;;yvn;1;;ga;;;if;1;;k4e;;;vd;;;ro27;7b;1;sc8c;1v;1; 8;15;;u1lyy;mvr;1;r26;mus;;ry;7;1; ;5;;t2t;51;1;t1e;24;1;p1e;24;1;:u;f;;i550;t5c8;6;bc;3a;1;n7;;;e9;l;1;r7;;;n2x3;jmka;2;fbo;1jnw;2;l1s;fl3;1;u17;cuh;1;\u00ea9;;;o6p;gaj;1;ad;1;;s84;1pv1;1;t3y;whk;1;a17;9gq;1;ld;21c;1;a5;;;r2j;ekg;1; 8;1;;sqz;1agk;1; jd;4q;;u16;8;;k3v63;5f;1;urs;n;1; 3;n;;l1ewzo;zp;3;cj;7;1;d;6;;sl;5;1; ;5;;vm;8;1;a;8;;m1ql98;243;a; 1b;93;;,;7;;Rs;3e;;b;;1;a5;;;egur2;9r;1;i2c;d;1;n3;d;;f5;g;;pz;6b;;t;;1;aa;;;u5ql8;5t;1;l193t;2t;1;t17us;2t;1;i17ty;2t;1;c1d4;8;1;a4z;6;1;mo;6;1;p;;1;i;6;;\u00d7;a;;n14seq;3b7;6; 9r;1ei;;V7;w;;W4;q;;dx;1n;1; e;;;te;u;;\u00d71;b;;o1po1;gmse;8;c2l;ewy;2;hb;4w;1;oa;1;;u7;6u;1;p7;;;d21;6ii;1;d1o;59e;1;ya;;;fkz;2cg9;1; br;51;;gp;fd;1;ge;11;1;ia;;;n1muy;151v;o; 4a;6y6;;';5;;,;8;;/1;3t;;a1;e;;b;db;;c1qc;se;1;o3;rn;;d1;n;;e1kqx;bu;2;i;b;;r6;3a;;f;9;;g1t;adm;;i3;ca;;l6q;jw7;;m4;14;;n;c;;o2;57;;r;1a;;s6;10f;;t6;hb;;u1;1l;;w1;1k;;y;15;;z;7;;\u2013;6;;rht;2sas;1;i30;gwn;1;g2p;fl4;1;e6;;;t37;50i;1;r;;1;s;8;;u7j;1e6t;1;i16;6;;r1fxi6;1u1;3; 14;6g;;&1;8;;f12;52;;s3aro5;3io;9;,;e;;?;5;;R2;h;;f;;2;e8;;;o8;;;iggn8;b9;1;c1vp;18;1;hb;17;;l20u4;1m;1; ;5;;pbado;de;2;33;j;;ipic;12;1; ;5;;r1t;k;1;g;c;;v;;3;ae;;;e11;;;i6;;;t1c1p7;1mt;2;A1;9;;S3;2u;;u4dhq;8rnc;c; 7x;n;;.9;;;beh;3f;2;e7;1m;;l;5;;fl;6;;k6h;2e;2;ae;11;;i8;n;;m1j;4kj;1;a;;1; f;5;;n2eo5;6zny;3;a3ln;7j0;3; 1r;4;;n3dz;in;5;a2;c;;c;8;;n5;a7;;s;37;;t;3h;;r4a;jh;1;y46;4;;e28;a8m;2; m;;;i7;;;i29p3;wfu;8;c14a;17;2;oeg;i;1;rcl;h;1;p;a;;u;;1;m;6;;d4x;2b9;1;i4d;f;1;o;7;;g;;1;n;5;;lsl;17;1;l;i;;m2i;r9;1;o2a;2;;n3y;ssp;;s9j;m;1;s;f;;vhg5;5x;1;oj;17;1;cd;3;;r1cb;bd4;5;aco;r;;e3v;h;;ih7;i;;l7m;1j;;o47;k;;s1szw;1ig;3; h;3f;;h1;9f;;u1bh;iv;1;rda;gs;2;eq;a;;pcd;gg;3;a3b;1y;;e7q;36;;ig;;;t33j;1ai;2;m;r;;ta;16b;;v3c;c;;w3e;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;;\u00a36cs;8l;1;82b;6o;;\u00c0;9;;\u00c1a;o;;\u00c43;c;;\u00c52;k;;\u00c64;k;;\u00c9f;2q;;\u00d2;c;;\u00d31;1d;;\u00d6a;16;;\u00dc4;v;;\u00e07;v;;\u00e15;l;;\u00e61;m;;\u00e8;6;;\u00e94c;bg;1;t3h;29;3;a4;1n;;o;a;;u1;b;;\u00ed;5;;\u00f62;e;;\u00fcd;r;1; 7;;;\u01001;b;;\u01013;s;;\u012b;5;;\u01304;o;;\u014c3;o;;\u014d;2m;;\u0153;8;;\u03a92;e;;\u03b11c;c1;;\u03b55;1s;;\u03c97;1x;;\u03f5;8;;\u0435;5;;\u20133a;1k;2;e;a;;i;9;;\u2113;d;;");return{raw:b,
- query:function(a){var c=b,e=0;do var f=a[e++];while(0<="\"\u2018\u2019\u201c\u201d$'-(".indexOf(f));for(;;){var g=c.data||g;c=c[f];if(!c)return g;f=a[e++]||" "}}}}();class SayBold extends Say{getPureElements(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var b=yield a.getParagraphs();b=1==b.length?b[0]:Array.prototype.concat.apply([],b);let c=document.createElement("b");b.forEach((a)=>{c.appendChild(a)});return[c]})}}
- class SayHeSheIt extends Say{constructor(a,b){super();this.node=document.createTextNode("a ");this.uppercase=!0;this.target=a;void 0!=b&&(this.uppercase=b)}getPureElements(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var c=b.target;void 0==c?b.node.nodeValue="":(c instanceof Humanoid?(c=c.getGenderValue(),b.node.nodeValue=65<c.genderValueCorrected?"she ":35>c.genderValueCorrected?"he ":c.hasPenisBulge||c.hasPenis?"he ":c.hasVagina||c.hasTits?"she ":"they "):b.node.nodeValue=
- "it ",b.uppercase&&0==a.currentParagraph.length&&(b.node.nodeValue=b.node.nodeValue.charAt(0).toUpperCase()+b.node.nodeValue.substr(1,b.node.nodeValue.length-1)));return[b.node]})}}
- class SayHimHerIt extends Say{constructor(a,b){super();this.node=document.createTextNode("a ");this.uppercase=!0;this.target=a;void 0!=b&&(this.uppercase=b)}getPureElements(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var c=b.target;void 0==c?b.node.nodeValue="":(c instanceof Humanoid?(c=c.getGenderValue(),b.node.nodeValue=65<c.genderValueCorrected?"her ":35>c.genderValueCorrected?"him ":c.hasPenisBulge||c.hasPenis?"him ":c.hasVagina||c.hasTits?"her ":"them "):b.node.nodeValue=
- "it ",b.uppercase&&0==a.currentParagraph.length&&(b.node.nodeValue=b.node.nodeValue.charAt(0).toUpperCase()+b.node.nodeValue.substr(1,b.node.nodeValue.length-1)));return[b.node]})}}
- class SayHisHersIts extends Say{constructor(a,b){super();this.node=document.createTextNode("a ");this.uppercase=!0;this.target=a;void 0!=b&&(this.uppercase=b)}getPureElements(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var c=b.target;void 0==c?b.node.nodeValue="":(c instanceof Humanoid?(c=c.getGenderValue(),b.node.nodeValue=65<c.genderValueCorrected?"hers ":35>c.genderValueCorrected?"his ":c.hasPenisBulge||c.hasPenis?"his ":c.hasVagina||c.hasTits?"hers ":"their "):
- b.node.nodeValue="its ",b.uppercase&&0==a.currentParagraph.length&&(b.node.nodeValue=b.node.nodeValue.charAt(0).toUpperCase()+b.node.nodeValue.substr(1,b.node.nodeValue.length-1)));return[b.node]})}}
- class SayIf extends Say{constructor(a,...b){super(...b);this.condition=void 0!=a?a:()=>!0}getPureElements(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(a.condition()){let b=yield a.getParagraphs();return 1==b.length?b[0]:Array.prototype.concat.apply([],b)}return[]})}}
- class SayItalic extends Say{getPureElements(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var b=yield a.getParagraphs();b=1==b.length?b[0]:Array.prototype.concat.apply([],b);let c=document.createElement("i");b.forEach((a)=>{c.appendChild(a)});return[c]})}}
- class SayLink extends Say{setAction(a){this.linkedAction=a}getPureElements(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){var b=yield a.getParagraphs();b=1==b.length?b[0]:Array.prototype.concat.apply([],b);let c=document.createElement("b");c.classList.add("textLink");b.forEach((a)=>{c.appendChild(a)});Controls.Links.makeLink(c,a.linkedAction);return[c]})}}
- class SayThe extends Say{constructor(a,b){super();this.node=document.createTextNode("");this.uppercase=!0;this.alwaysPrint=!1;void 0!=a&&(this.uppercase=a);b&&(this.alwaysPrint=b)}getPureElements(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let c=a.sequence[a.sequenceRunner+1];b.node.nodeValue=b.alwaysPrint?"the ":void 0==c?"":c instanceof Thing?c.properlyNamed?"":"the ":"";""!=b.node.nodeValue&&b.uppercase&&0==a.currentParagraph.length&&(b.node.nodeValue=b.node.nodeValue.charAt(0).toUpperCase()+
- b.node.nodeValue.substr(1,b.node.nodeValue.length-1));return[b.node]})}}
- (function(a){(function(a){function b(a){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield a.getHTML("p",["appearanceDescription"]).then((a)=>{for(let b=0;b<a.length;b++)d.appendChild(a[b])})})}var d=document.getElementById("appearanceTarget");a.print=b;a.updateAppearance=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){for(;d.firstChild;)d.removeChild(d.firstChild);var a=WorldState.player,c=a.getGenderValue(),g=a.getSluttiness(),h=new SayLink("You");h.setAction(new ActionExamine(WorldState.player,
- WorldState.player));h=new Say(h," are presenting as ",new SayAn,a.getShortestDescription(),".");g.naked?h.add(" You are naked."):g.halfNaked&&h.add(" You are almost naked.");var l=Thing.PartRelation.getRightTypeOne(a,HumanoidBreasts);g=Thing.PartRelation.getRightTypeOne(a,HumanoidPenis);a=a.getBulges();if(0<a.breasts||60<c.genderValueCorrected){c=l.getSizeText();let b=HumanoidBreasts.getSizeText(a.breasts);h.add(" You have "+c+" breasts");a.breasts!=l.getSize()&&c!=b?h.add(", padded to appear as "+
- b+" through your clothing."):l.isUncovered()?h.add("."):h.add(", safely covered.")}void 0==g?h.add(" You have ",new SayAn,HumanoidPenis.getSizeText(a.crotch)+" crotch bulge visible through your clothing."):(c=g.getSizeText(),l=HumanoidPenis.getSizeText(a.crotch),h.add(" You have ",new SayAn,c+" dick"),g.getActualSize()!=a.crotch&&c!=l?h.add(", which looks like it is "+l+" due to your clothing."):g.isUncovered()?h.add("."):h.add(", which is covered."));yield b(h)})}})(a.AppearanceHandler||(a.AppearanceHandler=
- {}))})(Elements||(Elements={}));function updateFontSize(){var a=Elements.isMobile?800:1280;document.documentElement.style["font-size"]=(document.body.clientWidth<a?a:document.body.clientWidth)*(Elements.isMobile?17:14.5)/1280+"px"}updateFontSize();window.addEventListener("resize",updateFontSize);
- (function(a){(function(b){function c(b){let c=b.clientX-f/2,e=b.clientY-g-6;0>e&&(e=b.clientY+6);c<f&&(c=f);c+f>a.screenWidth&&(c=a.screenWidth-f);d.style.left=Math.round(c)+"px";d.style.top=Math.round(e)+"px"}var d=document.getElementById("hoverInfo"),e=document.getElementById("hoverContent"),f=0,g=0;b.makeHoverable=function(b,c){b.addEventListener("mouseenter",(b)=>{a.HoverInfo.hoverStart(b,c)});b.addEventListener("mousemove",(b)=>{a.HoverInfo.hoverMove(b)});b.addEventListener("mouseout",(b)=>{a.HoverInfo.hoverEnd()})};
- b.hoverStart=function(a,b){for(;void 0!=e.firstChild;)e.removeChild(e.firstChild);for(let a=0;a<b.length;a++)e.appendChild(b[a]);d.style.display="block";d.style.left="0px";d.style.top="0px";f=d.offsetWidth;g=d.offsetHeight;c(a)};b.hoverMove=c;b.hoverEnd=function(){d.style.display="none"}})(a.HoverInfo||(a.HoverInfo={}))})(Elements||(Elements={}));
- (function(a){(function(a){function b(){for(g.splice(0,g.length);a.commonActionsTab.firstChild;)a.commonActionsTab.removeChild(a.commonActionsTab.firstChild)}function d(a){let b=document.createElement("a");b.appendChild(document.createTextNode(a[0]));Controls.Links.makeLink(b,a[1]);return b}a.linkedActionsTab=document.getElementById("linkActions");a.commonActionsTab=document.getElementById("commonActionsTab");var e=document.createTextNode("");document.getElementById("currentCommand").appendChild(e);
- var f=document.createTextNode("");document.getElementById("linkTarget").appendChild(f);var g=[],h=[];a.resetCommonActions=b;a.addCommonAction=function(a,b){g.push([a,b])};a.addAvailableAction=function(a,b){h.push([a,b])};a.hoverAction=function(a){e.nodeValue=a.getCommandText().toLowerCase()};a.unhoverAction=function(){e.nodeValue=""};a.hyperlinkObject=function(b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){h=[];for(f.nodeValue="";a.linkedActionsTab.firstChild;)a.linkedActionsTab.removeChild(a.linkedActionsTab.firstChild);
- if(b instanceof Thing&&b!=WorldState.player){yield a.HyperlinkingRulebook.execute({noun:b});f.nodeValue=b.getPrintedName()+": ";for(let b=0,c=h[b];void 0!=c;c=h[++b]){let b=d(c);b.classList.add("columnLink");Controls.KeyHandler.applyCode(b,Controls.KeyHandler.getSecondKeyCode());a.linkedActionsTab.appendChild(b)}}})};a.hyperlinkCommonActions=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){b();yield a.CommonActionsRulebook.execute({});for(let b=0,c=g[b];void 0!=c;c=g[++b]){let b=
- d(c);b.classList.add("lineLink");Controls.KeyHandler.applyCode(b,Controls.KeyHandler.getThirdKeyCode());a.commonActionsTab.appendChild(b)}})};a.HyperlinkingRulebook=new Rulebook("Hyperlinking something");a.CommonActionsRulebook=new Rulebook("Common Actions Rulebook")})(a.HyperlinkHandler||(a.HyperlinkHandler={}))})(Elements||(Elements={}));
- class Action{constructor(a,...b){this.extraChecks=[];this.extraCarries=[];this.nouns=[];this.say=new Say;this.actingSubmissively=this.actingAgressively=!1;this.requiresVisibility=this.requiresNoun=this.requiresTurn=!0;this.actor=a;b.forEach((a,b,e)=>{this.setNoun(b,a)})}execute(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){a.say=new Say;let b=yield Action.check.execute({noun:a},...a.extraChecks);if(0!=b)if(b instanceof Action)console.debug(Rulebook.getIndentation()+
- "[ACTION] Instead of..."),yield b.execute(),a.say.add(b.say),a.nouns=b.nouns;else return yield Action.carry.execute({noun:a},...a.extraCarries),a.say})}get actor(){return this._actor}set actor(a){this._actor=a}getNoun(a){if(this.nouns.length>a)return this.nouns[a]}setNoun(a,b){for(;this.nouns.length<a;)this.nouns.push(void 0);this.nouns[a]=b}getCommandText(){return"do"}stop(){this.requiresTurn=!1}}Action.check=new Rulebook("Check any Action");Action.carry=new Rulebook("Carry out any Action");
- Action.check.addRule(new Rule({name:"Check any Action - Requires Noun",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{if(void 0==a.noun.getNoun(0))return!1},conditions:(a)=>a.noun.requiresNoun}));Action.check.addRule(new Rule({name:"Check any Action - Requires Visibility",code:(a)=>{a=a.noun;let b=a.actor;if(!a.getNoun(0).isVisibleTo(b))return!1},conditions:(a)=>a.noun.requiresVisibility}));
- class ActionExamine extends Action{constructor(a,...b){super(a,...b);this.requiresTurn=!1;this.extraChecks.push(ActionExamine.check);this.extraCarries.push(ActionExamine.carry)}getCommandText(){return this.getNoun(0)==WorldState.player?"examine myself":"examine "+(void 0!=this.getNoun(0)?this.getNoun(0).getPrintedName():"")}}ActionExamine.check=new Rulebook("Check Examining");ActionExamine.carry=new Rulebook("Carry out Examining");
- ActionExamine.PrintDescriptionOfExaminedThingRule=ActionExamine.carry.createAndAddRule({name:"Examine - Print Description of Examined Thing",code:(a)=>{a=a.noun;let b=a.getNoun(0);b instanceof Thing&&void 0!=b.image&&a.say.add(b.image,Say.PARAGRAPH_BREAK);a.say.add(a.getNoun(0).getPrintedDescription())}});
- Elements.HyperlinkHandler.CommonActionsRulebook.addRule(new Rule({name:"Look at me!",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_HIGH,code:(a)=>{Elements.HyperlinkHandler.addCommonAction("Inspect",new ActionExamine(WorldState.player,WorldState.player))}}));class RelationHandler{constructor(...a){a.forEach((a)=>{a.setHandler(this)});this.relations=a}addRelation(a){this.relations.push(a);a.setHandler(this)}}
- class Relation{setHandler(a){this.handler=a}hasHandler(){return void 0!=this.handler}static createString(a,b){if(a instanceof Object&&b instanceof Object)return a=Relation.getId(a),b=Relation.getId(b),a<b?a+";"+b:b+";"+a}static getId(a){void 0==a[Relation.objectIdField]&&(a[Relation.objectIdField]=Relation.objectCount++);return a[Relation.objectIdField]}}Relation.objectCount=0;Relation.objectIdField="_RELATIONINTERNALID";
- class RelationHandlerStrictOneToMany extends RelationHandler{setRelation(a,b,c,d){if(-1!=this.getAllLeft(b).indexOf(c))return console.warn("[Relation] Attempt to create a circular relation:",this,b,c),!1;this.unsetRight(c);return!0}unset(a){this.unsetLeft(a);this.unsetRight(a)}unsetLeft(a){this.relations.forEach((b)=>{b.unsetLeft(a)})}unsetRight(a){this.relations.forEach((b)=>{b.unsetRight(a)})}getLeft(a){let b;for(let c=0;c<this.relations.length;c++)if(b=this.relations[c].getLeft(a),void 0!=b)return b}getAllLeft(a){a=
- this.getLeft(a);let b=[];for(;void 0!=a;)b.push(a),a=this.getLeft(a);return b}getAllLeftType(a,b){return this.getAllLeft(a).filter((a)=>a instanceof b)}getLastLeft(a){a=this.getLeft(a);let b=this.getLeft(a);for(;void 0!=b;)a=b,b=this.getLeft(a);return a}getAllRight(a){let b=[];this.relations.forEach((c)=>{b.push(...c.getRight(a))});arrayUnique(b);return b}getAllRightTypes(a,b){return this.getAllRight(a).filter((a)=>a instanceof b)}}
- class RelationOneToMany extends Relation{constructor(){super(...arguments);this.valuesHash={};this.oneMap=new Map;this.manyMap=new Map}getValue(a,b){return this.valuesHash[Relation.createString(a,b)]}setValue(a,b,c){this.manyMap.get(b)==a&&(a=Relation.createString(a,b),void 0!=a&&(this.valuesHash[a]=c))}setRelation(a,b,c){var d;void 0!=this.handler&&(d=this.handler.setRelation(this,a,b,c));d&&(this.unsetRight(a),this.unsetLeft(b),this.unsetRight(b),d=Relation.createString(a,b),void 0!=d&&(this.valuesHash[d]=
- c),this.manyMap.set(b,a),void 0==this.oneMap.get(a)?this.oneMap.set(a,[b]):this.oneMap.get(a).push(b))}getLeft(a){return this.manyMap.get(a)}getAnyRight(){let a=[];this.oneMap.forEach((b)=>{a.push(...b)});arrayUnique(a);return a}getAnyRightType(a){return this.getAnyRight().filter((b)=>b instanceof a)}isRight(a,b){a=this.oneMap.get(a);return void 0!=a?-1!=a.indexOf(b):!1}getRight(a){a=this.oneMap.get(a);return void 0!=a?[].concat(...a):[]}getRightType(a,b){return this.getRight(a).filter((a)=>a instanceof
- b)}getRightTypeOne(a,b){a=this.getRightType(a,b);if(0<a.length)return a[0]}getRelationValue(a,b){return this.valuesHash[Relation.createString(a,b)]}unsetRight(a){let b=this.manyMap.get(a);if(void 0!=b){let c=this.oneMap.get(b);c.splice(c.indexOf(a),1);this.manyMap.delete(a);0==c.length&&this.oneMap.delete(b);a=Relation.createString(b,a);void 0!=a&&delete this.valuesHash[a]}}unsetLeft(a){let b=this.oneMap.get(a);void 0!=b&&(b.forEach((b)=>{this.manyMap.delete(b);b=Relation.createString(a,b);void 0!=
- b&&delete this.valuesHash[b]}),this.oneMap.delete(a))}}
- class Thing{constructor(a){this.animated=this.fixedInPlace=this.scenery=this.properlyNamed=!1;this.visible=!0;this.shiny=this.unique=!1;this.setAlterations=[];this.getAlterations=[];this.clone=function(){throw Error("Non-unique Objects can't be cloned.");};a=void 0==a?{}:a;void 0!=a.properName?(this.name=a.properName,this.properlyNamed=!0):this.name=void 0!=a.name?a.name:this.constructor.name;void 0!=a.description&&(this.description=a.description instanceof Say?a.description:new Say(a.description));
- a.unique?(Thing.storeUnique(this),this.unique=!0):(Thing.storeNonUnique(this),this.cloneOptions=a,this.clone=(a)=>{let b=new (eval(this.constructor.name))(this.cloneOptions);(void 0==a||a)&&b.setChanges(this.getChanges());return b});void 0!=a.image&&(this.image=a.image instanceof SayImage?a.image:new SayImage(a.image));this.shiny=1==a.shiny}addGetAlterations(a){this.getAlterations.push(a)}addSetAlterations(a){this.setAlterations.push(a)}getChanges(){let a={};for(let b=0;b<this.getAlterations.length;b++){let c=
- this.getAlterations[b](this);for(let b in c)a[b]=c[b]}return a}setChanges(a){for(let b=0;b<this.setAlterations.length;b++)this.setAlterations[b](this,a)}getShiny(){return this.shiny}setName(a){this.name=a}getName(){return this.name}static storeNonUnique(a){void 0==Thing.things[a.name]?Thing.things[a.name]=[a]:Thing.things[a.name].push(a)}static getNonUnique(a){return void 0==Thing.things[a]?[]:Thing.things[a]}static getOneThing(a){let b=Thing.getUnique(a);void 0==b&&(a=Thing.getNonUnique(a),0<a.length&&
- (b=a[0]));return b}static storeUnique(a){void 0!=Thing.uniqueThings[a.name]?console.warn(a.name,Thing.uniqueThings[a.name],Error("Unique Thing Already Exists")):Thing.uniqueThings[a.name]=a}static getUnique(a){return Thing.uniqueThings[a]}getPrintedName(){return this.name}getPrintedDescription(){return void 0==this.description?new Say("You see nothing special about ",new SayThe,this,"."):this.description}getPartOne(){return Thing.PartRelation.getLeft(this)}getCarryOne(){return Thing.CarryRelation.getLeft(this)}getWieldOne(){return Thing.WieldRelation.getLeft(this)}getWearOne(){return Thing.WearRelation.getLeft(this)}getEnclosedOne(){return Thing.EnclosedRelation.getLeft(this)}removeParts(a){a=
- this.getParts(a);for(let b=0;b<a.length;b++)Thing.PartRelation.unsetRight(a[b])}getParts(a){return void 0!=a?Thing.PartRelation.getRightType(this,a):Thing.PartRelation.getRight(this)}getPartsByName(a){return this.getParts().filter((b)=>b.getName()==a)}getPart(a){return void 0!=a?Thing.PartRelation.getRightTypeOne(this,a):Thing.PartRelation.getRight(this)}getHighestEnclosedOne(){return Thing.EnclosedRelation.getLastLeft(this)}getHighestEnclosedOneNotRoom(){let a=Thing.EnclosedRelation.getLeft(this);
- if(void 0!=a){let b=Thing.EnclosedRelation.getLeft(a);for(;void 0!=b;)a=b,b=Thing.EnclosedRelation.getLeft(a);return a}return this}getRoom(){var a=Thing.EnclosedRelation.getLeft(this);if(a instanceof Room)return a;if(a instanceof Thing)return a.getRoom()}removeFromRoom(){this.getRoom().remove(this)}isVisibleTo(a){return this.getRoom()==a.getRoom()&&this.visible}isPlayer(){return!1}addParts(...a){a.forEach((a)=>{Thing.PartRelation.setRelation(this,a)})}isUnique(){return this.unique}setCarried(a){Thing.CarryRelation.setRelation(this,
- a)}setWorn(a){Thing.WearRelation.setRelation(this,a)}setWielded(a){Thing.WieldRelation.setRelation(this,a)}unsetCarried(a){-1!=Thing.EnclosedRelation.getAllRight(this).indexOf(a)&&(Thing.EnclosedRelation.unsetRight(a),this.getRoom().place(a))}destroy(){let a=Thing.EnclosedRelation.getAllRight(this);a.push(this);a.forEach((a)=>{Thing.EnclosedRelation.unset(a)})}}Thing.uniqueThings={};Thing.things={};Thing.InsideRoomRelation=new RelationOneToMany;Thing.PartRelation=new RelationOneToMany;
- Thing.CarryRelation=new RelationOneToMany;Thing.WieldRelation=new RelationOneToMany;Thing.WearRelation=new RelationOneToMany;Thing.EnclosedRelation=new RelationHandlerStrictOneToMany(Thing.InsideRoomRelation,Thing.PartRelation,Thing.CarryRelation,Thing.WieldRelation,Thing.WearRelation);
- class ActionTake extends Action{constructor(a,...b){super(a,...b);this.extraChecks.push(ActionTake.check);this.extraCarries.push(ActionTake.carry)}getCommandText(){return"take "+(void 0!=this.getNoun(0)?this.getNoun(0).getPrintedName():"")}}ActionTake.check=new Rulebook("Check Taking");ActionTake.carry=new Rulebook("Carry out Taking");
- ActionTake.defaultCarryTakingRule=new Rule({name:"Taking - Add the thing to your inventory",code:(a)=>{a=a.noun;let b=a.actor,c=a.getNoun(0);void 0!=c.getEnclosedOne()?Thing.EnclosedRelation.unsetRight(c):c.removeFromRoom();Thing.CarryRelation.setRelation(b,a.getNoun(0));b==WorldState.player?a.say.add(new SayBold(a.getNoun(0).getPrintedName()+": "),"Taken."):a.say.add(new SayThe,b," takes ",new SayThe(void 0,!0),a.getNoun(0),".")}});
- ActionTake.check.addRule(new Rule({name:"Check Taking - Who has it, really?",priority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;let b=a.actor,c=a.getNoun(0).getEnclosedOne();if(c==b)return c==WorldState.player&&a.say.add("You already have it."),!1}}));ActionTake.check.addRule(new Rule({name:"Check Taking - Donut steal",code:(a)=>{a=a.noun;let b=a.actor,c=a.getNoun(0).getEnclosedOne();if(void 0!=c&&c.animated)return b==WorldState.player&&a.say.add(c.getPrintedName()+" wouldn't like that."),!1}}));
- ActionTake.check.addRule(new Rule({name:"Check Taking - Can't take fixed in place",code:(a)=>{a=a.noun;let b=a.actor;if(a.getNoun(0).fixedInPlace)return b==WorldState.player&&a.say.add("You can't take that."),!1}}));ActionTake.carry.addRule(ActionTake.defaultCarryTakingRule);
- Elements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule({name:"Hyperlink - Take",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;!a.animated&&!a.fixedInPlace&&a.getRoom()==WorldState.player.getRoom()&&a.getEnclosedOne()instanceof Room&&Elements.HyperlinkHandler.addAvailableAction("Take",new ActionTake(WorldState.player,a))}}));
- class ActionGo extends Action{constructor(a,...b){super(a,...b);this.originalTarget=b[0];this.extraChecks.push(ActionGo.check);this.extraCarries.push(ActionGo.carry);this.requiresVisibility=this.requiresNoun=!1}getCommandText(){let a;"number"==typeof this.originalTarget?a=DirectionNames[Direction[this.originalTarget]]:this.originalTarget instanceof Room&&(a="to "+this.originalTarget.getPrintedName());return"go "+a}}ActionGo.check=new Rulebook("Check Going");ActionGo.carry=new Rulebook("Carry out Going");
- ActionGo.ruleCheckRestoreOriginalNoun=ActionGo.check.createAndAddRule({firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_HIGHEST,name:"Check Going - Restore original noun",code:(a)=>{a=a.noun;a.setNoun(0,a.originalTarget)}});ActionGo.ruleCheckIsthereactor=ActionGo.check.createAndAddRule({firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_HIGHEST,name:"Check Going - Is there an actor?",code:(a)=>{if(void 0==a.noun.actor)return!1}});
- ActionGo.ruleCheckConvertRoomToDirection=ActionGo.check.createAndAddRule({firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_HIGH,name:"Change Room to Direction",code:(a)=>{a=a.noun;if(a.getNoun(0)instanceof RoomRandom){let c=a.actor,d=c.getRoom();if(d instanceof RoomRandom){let e=a.getNoun(0);if(d==e)return c.isPlayer()&&a.say.add("You are already there!"),!1;var b;c==WorldState.player&&(b=(a)=>WorldState.isRoomRemembered(a));b=d.getAStarBestDirectionTo(e,b);if(void 0==b)return c.isPlayer()&&
- a.say.add("You don't remember how to get there."),!1;a.setNoun(0,b)}}}});ActionGo.ruleCheckIstheredirectionandroom=ActionGo.check.createAndAddRule({name:"Check Going - is there a direction? Does it lead anywhere?",code:(a)=>{a=a.noun;var b=a.actor.getRoom();if(void 0==b)return!1;let c=a.getNoun(0);if(void 0==c)return!1;b=b.connections[c];if(void 0==b)return!1;a.roomGoneFrom=a.actor.getRoom();a.roomGoneTo=b}});
- ActionGo.ruleCarryMove=ActionGo.carry.createAndAddRule({name:"Going - Move Actor to Next Room",code:(a)=>{a=a.noun;var b=a.actor.getRoom();let c=a.getNoun(0);b.connections[c].place(a.actor);let d=a.actor;d==WorldState.player?a.say.add("You go "+DirectionNames[Direction[c]].toLowerCase()+"."):b==WorldState.player.getRoom()?a.say.add(new SayThe,d," goes "+DirectionNames[Direction[c]].toLowerCase()+"."):(b=DirectionNames[OppositeDirection[c]],a.say.add(new SayThe,d," arrives from the "+b.toLowerCase()+
- "."))}});ActionGo.ruleCarryRememberRooms=ActionGo.carry.createAndAddRule({name:"Going - Remember the involved rooms",code:(a)=>{var b=a.noun;a=b.actor;let c=b.actor.getRoom();b=b.getNoun(0);b=c.connections[OppositeDirection[Direction[b]]];a.isPlayer()&&WorldState.rememberRoom(b,c)}});
- (function(a){(function(a){function b(){for(;a.currentRoomDescription.firstChild;)a.currentRoomDescription.removeChild(a.currentRoomDescription.firstChild);for(;a.currentRoomExits.firstChild;)a.currentRoomExits.removeChild(a.currentRoomExits.firstChild);a.currentRoomName.nodeValue=""}a.currentRoomTab=document.getElementById("currentRoomTab");a.currentRoomDescription=document.getElementById("roomDescription");a.currentRoomExits=document.getElementById("roomExits");a.currentRoomName=document.createTextNode("");
- document.getElementById("roomName").appendChild(a.currentRoomName);a.linkObjects=function(){let b=a.currentRoomTab.getElementsByClassName("roomObject");for(let a=0;a<b.length;a++){let c=Controls.KeyHandler.getFirstKeyCode();Controls.KeyHandler.applyCode(b[a],c)}};a.emptyRoom=b;a.updateRoom=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){b();let c=WorldState.player.getRoom();if(void 0!=c){a.currentRoomName.nodeValue=c.getPrintedName();yield c.description.getHTML("p",["roomDescription"]).then((b)=>
- {for(let c=0,d=b[c];void 0!=d;d=b[++c])a.currentRoomDescription.appendChild(d)});var e=c.getContainedAndVisible();if(0<e.length){var f=document.createElement("p");f.classList.add("roomDescription");yield a.PrintingVisibleThingsRulebook.execute({noun:{things:e,container:f}});a.currentRoomDescription.appendChild(f)}for(let b=0,d=c.connections[b];b<c.connections.length;d=c.connections[++b])void 0!=d&&(e=document.createElement("p"),e.classList.add("roomExit"),f=document.createElement("a"),f.classList.add("roomDirection"),
- f.appendChild(document.createTextNode(DirectionNames[Direction[b]])),Controls.Links.makeLink(f,new ActionGo(WorldState.player,b)),Controls.KeyHandler.applyCode(f,Controls.KeyHandler.getDirectionCodeByIndex(b)),e.appendChild(f),f=": ",f=WorldState.isRoomRemembered(d)?f+d.getPrintedName():f+"A new place",e.appendChild(document.createTextNode(f)),a.currentRoomExits.appendChild(e))}})};a.PrintingVisibleThingsRulebook=new Rulebook("Printing the name of visible things in a room");a.PrintIntroToVisibleThingsRule=
- new Rule({name:'Print "You can see" text',firstPriority:Rule.PRIORITY_HIGH,code:(a)=>{a.noun.container.appendChild(document.createTextNode("You can see "))}});a.PrintingVisibleThingsRulebook.addRule(a.PrintIntroToVisibleThingsRule);a.PrintVisibleThingsRule=new Rule({name:"Print all visible things",code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun;for(let a=0;a<b.things.length;a++){let c=b.things[a],d=document.createElement("a");d.classList.add("roomObject");yield(c instanceof
- Thing&&c.unique?new Say(new SayThe(!1),c):new Say(new SayAn(!1),c)).getPureElements().then((a)=>{for(let b=0,c=a[b];void 0!=c;c=a[++b])d.appendChild(c)});Controls.Links.makeLink(d,new ActionExamine(WorldState.player,c));Controls.KeyHandler.applyCode(d,Controls.KeyHandler.getFirstKeyCode());b.container.appendChild(d);a+1<b.things.length&&b.container.appendChild(document.createTextNode(", "))}})});a.PrintingVisibleThingsRulebook.addRule(a.PrintVisibleThingsRule);a.PrintOutroToVisibleThingsRule=new Rule({name:'Print "... here" text',
- firstPriority:Rule.PRIORITY_LOW,code:(a)=>{a.noun.container.appendChild(document.createTextNode(" here."))}});a.PrintingVisibleThingsRulebook.addRule(a.PrintOutroToVisibleThingsRule)})(a.RoomHandler||(a.RoomHandler={}))})(Elements||(Elements={}));
- class CoinPouch extends Thing{constructor(a){super(a);this.coins=0;this.addGetAlterations((a)=>({coins:a.getCoins()}));this.addSetAlterations((a,c)=>{a.coins=c.coins})}addCoins(a){this.coins+=a}removeCoins(a){this.coins-=a}getCoins(){return this.coins}getShiny(){return 0<this.coins}}
- CoinPouch.carryOutTakingCoinPouches=new Rule({name:"Carry out taking coin pouches",firstPriority:ActionTake.defaultCarryTakingRule.firstPriority,priority:ActionTake.defaultCarryTakingRule.priority+1,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun,c=b.actor,d=b.getNoun(0),e=Thing.CarryRelation.getRightType(c,CoinPouch);if(0<e.length){var f=d.getCoins();if(0<f)a.skipRule(ActionTake.defaultCarryTakingRule),e[0].addCoins(f),d.removeCoins(d.getCoins()),c==WorldState.player?
- b.say.add("You empty ",new SayThe,d," into your ",e[0],". Your ",e[0]," now has "+e[0].getCoins().toString()+" coins."):b.say.add(new SayThe,c," empties ",new SayThe,d," into ",Say.hisHersIts(c),e[0],".");else if(f=e[0].getCoins(),e[0].removeCoins(f),d.addCoins(f),c==WorldState.player&&b.say.add("You empty your ",e[0]," into ",new SayThe,d,".",Say.PARAGRAPH_BREAK),yield(new ActionDrop(c,e[0])).execute(),Thing.EnclosedRelation.getLeft(e[0])==c)return c==WorldState.player&&b.say.add("You can't get rid of your ",
- e[0],"!"),!1}}),conditions:(a)=>a.noun.getNoun(0)instanceof CoinPouch});ActionTake.carry.addRule(CoinPouch.carryOutTakingCoinPouches);Say.afterPrinting.addRule(new Rule({name:"Include contents of Coin Pouch while Printing Visible Things in a Room",code:(a)=>{a=a.noun;a.currentNounElements.push(document.createTextNode(" with "+a.currentNoun.getCoins().toString()+" coins"))},conditions:(a)=>Elements.RoomHandler.PrintingVisibleThingsRulebook.isRunning()&&a.noun.currentNoun instanceof CoinPouch&&0<a.noun.currentNoun.getCoins()}));
- ActionExamine.carry.addRule(new Rule({name:"Print description of coins in Coin Pouch",firstPriority:ActionExamine.PrintDescriptionOfExaminedThingRule.firstPriority,priority:ActionExamine.PrintDescriptionOfExaminedThingRule.priority-1,code:(a)=>{a=a.noun;let b=a.getNoun(0);0<b.getCoins()?a.say.add(" There are "+b.getCoins().toString()+" coins in it."):a.say.add(" There are no coins in it.")},conditions:(a)=>a.noun.getNoun(0)instanceof CoinPouch}));
- (function(a){(function(a){function b(a){let b=document.createElement("p");b.classList.add("inventoryHeader");b.appendChild(document.createTextNode(a+":"));f.appendChild(b)}function d(b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){g=document.createElement("div");g.classList.add("inventoryRow");let c=document.createElement("div");c.classList.add("inventoryLink","name");c.appendChild(document.createTextNode(b.getPrintedName()));g.appendChild(c);Controls.Links.makeLink(c,new ActionExamine(WorldState.player,
- b));yield a.LinkingThing.execute({noun:b});f.appendChild(g)})}function e(a,b){a=a.getPrintedName().toLowerCase();b=b.getPrintedName().toLowerCase();return a<b?-1:a>b?1:0}var f=document.getElementById("inventoryTarget");let g;a.LinkingThing=new Rulebook("Inventory - Links for a Thing");a.printThingLink=function(a,b){let c=document.createElement("div");c.classList.add("inventoryLink");c.appendChild(document.createTextNode(a));g.appendChild(c);Controls.Links.makeLink(c,b)};a.thingSort=e;a.updateInventory=
- function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){for(var a=WorldState.player;f.firstChild;)f.removeChild(f.firstChild);var c=Thing.WieldRelation.getRight(a).sort(e),g=Thing.WearRelation.getRight(a).sort(e);a=Thing.CarryRelation.getRight(a).sort(e);if(0<c.length){b("Wielded");for(let a=0;a<c.length;a++)yield d(c[a])}if(0<g.length)for(b("Worn"),c=0;c<g.length;c++)yield d(g[c]);if(0<a.length)for(b("Carried"),g=0;g<a.length;g++)yield d(a[g]);g=Thing.CarryRelation.getRightType(WorldState.player,
- CoinPouch);if(0<g.length){let a=document.createElement("p");a.classList.add("inventoryGold");yield(0<g[0].getCoins()?new Say("There are "+g[0].getCoins().toString()+" coins in your ",g[0],"."):new Say("There are no coins in your ",g[0],".")).getPureElements().then((b)=>{b.forEach((b)=>{a.appendChild(b)})});f.appendChild(a)}})}})(a.InventoryHandler||(a.InventoryHandler={}))})(Elements||(Elements={}));
- class ActionRetrace extends Action{constructor(a,...b){super(a,...b);this.extraChecks.push(ActionRetrace.check);this.extraCarries.push(ActionRetrace.carry);this.requiresTurn=this.requiresVisibility=this.requiresNoun=!1}getCommandText(){let a;"number"==typeof this.getNoun(0)?a=DirectionNames[Direction[this.getNoun(0)]]:this.getNoun(0)instanceof Room&&(a=this.getNoun(0).getPrintedName());return"think about how to get to "+a}}ActionRetrace.check=new Rulebook("Check Retracing");ActionRetrace.carry=new Rulebook("Carry out Retracing");
- ActionRetrace.check.addRule(new Rule({firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_HIGH,name:"Change Room to Direction",code:(a)=>{a=a.noun;if(a.getNoun(0)instanceof Room){let c=a.actor,d=c.getRoom();if(void 0==d)return!1;let e=a.getNoun(0);if(d==e)return c.isPlayer()&&a.say.add("You are already there!"),!1;var b;c==WorldState.player&&(b=(a)=>WorldState.isRoomRemembered(a));b=d.bestDirectionTo(e,b);if(void 0==b)return c.isPlayer()&&a.say.add("You don't remember how to get there."),!1;
- a.setNoun(0,b)}}}));ActionRetrace.carry.addRule(new Rule({name:"Retracing - Find Direction",code:(a)=>{a=a.noun;a.say.add("To get there, you should go "+DirectionNames[Direction[a.getNoun(0)]]+".")}}));
- (function(a){(function(a){function b(){g={};for(f=void 0;e.firstChild;)e.removeChild(e.firstChild)}function d(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let a=f;for(let b=a.highestY;b>=a.lowestY;b--)for(let c=a.lowestX;c<=a.highestX;c++)yield g[c.toString()+";"+b.toString()].update()})}var e=document.getElementById("mapTarget"),f,g;a.empty=b;a.updateMap=function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){console.debug(Rulebook.getIndentation()+"[MAP] Creating Map");
- Rulebook.increaseIndentation("Creating map");var a=Region.InRelation.getAllLeftType(WorldState.player.getRoom(),RegionRandom);a=a[a.length-1];if(void 0==a)b();else if(a.map!=f){b();f=a=a.map;a.updateAllLimits();for(let b=a.highestY;b>=a.lowestY;b--){let d=document.createElement("div");d.classList.add("mapRow");for(let e=a.lowestX;e<=a.highestX;e++){var c=a.getRoom(e,b);c=new RoomNode(c);yield c.createRoomNameFloater();let f=c.getElement();d.appendChild(f);g[e.toString()+";"+b.toString()]=c}e.appendChild(d)}yield d();
- Rulebook.decreaseIndentation()}else yield d()})};a.updateOldMap=d})(a.RememberedHandler||(a.RememberedHandler={}))})(Elements||(Elements={}));var Debug;
- (function(a){a.knowdewae=function(){let a=new MapNote({name:"De Wae",description:"This map shows de wae all de wae to Zimbabwe."});a.addRoom(...Region.RegionRoom.getAnyRightType(RoomRandom));WorldState.player.setCarried(a)};a.hurt=function(a,c){let b;if(a instanceof Person){if(b=a.getPart(HumanoidTorso),void 0==b)return}else a instanceof Bodypart&&(b=a);b.changeSoreness(c)};a.goTo=function(a){}})(Debug||(Debug={}));
- class AI{constructor(a){this.wanderer=!0;this.wanderChance=50;this.picksShinies=!0;this.extraRules=[];this.extraCombatRules=[];for(let b in a)this[b]=a[b]}execute(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let c;c=void 0!=c?AI.combatRules.execute({noun:a},...b.extraCombatRules):AI.rules.execute({noun:a},...b.extraRules);return yield c})}addRulesBook(...a){this.extraRules.push(...a);arrayUnique(this.extraRules)}addCombatRulesBook(...a){this.extraCombatRules.push(...a);
- arrayUnique(this.extraCombatRules)}}AI.rules=new Rulebook("Default AI Rules");AI.combatRules=new Rulebook("Default AI Combat Rules");var AIRules;(function(a){a.PRIORITY_ACTING_ON_SITUATION=5;a.PRIORITY_ACTING_ON_PLACE=3;a.PRIORITY_ACTING_ON_IDLE=1})(AIRules||(AIRules={}));
- class PersonStat{constructor(a,b){this.defaultValue=0;this.maxValue=10;this.id=a;this.description=void 0==b?"Not defined":b}getDescription(a){return"string"==typeof this.description||this.description instanceof Say?this.description:this.description(a)}}
- class Attribute extends PersonStat{constructor(a,b,c,d){super(a,b);this.defaultValue=2;this.maxValue=5;void 0!=c&&(this.defaultValue=c);void 0!=d&&(this.maxValue=d)}static getAttributes(){let a=[];for(let b in Attribute.Attributes)a.push(Attribute.Attributes[b]);return a}static getAttribute(a){return Attribute.Attributes[a]}}Attribute.Attributes={};var Attributes;
- (function(a){a.Strength=new Attribute("Strength",(a)=>{switch(a){case 5:return"Hercules' Bigger Cousin";case 4:return"Circus Strong"+(WorldState.player.isMale()?"man":"woman");case 3:return"Beach Bully";case 2:return"Average "+(WorldState.player.isMale()?"Joe":"Jane");case 1:return"Wet Noodle";default:return"Out of bounds."}});a.Agility=new Attribute("Agility",(a)=>{switch(a){case 5:return"Catlike";case 4:return"Gymnast";case 3:return"Accurate";case 2:return"Common";case 1:return"Accident-prone";
- default:return"Out of bounds."}});a.Intelligence=new Attribute("Intelligence",(a)=>{switch(a){case 5:return"Genius";case 4:return"Gifted";case 3:return"Knowledgeable";case 2:return"Normal";case 1:return"Door";default:return"Out of bounds."}});a.Charm=new Attribute("Charm",(a)=>{switch(a){case 5:return WorldState.player.isMale()?"Casanova":"Seductress";case 4:return"Diplomat";case 3:return"Cheery Sales"+(WorldState.player.isMale()?"man":"woman");case 2:return"Not even trying";case 1:return"Unpleasant";
- default:return"Out of bounds."}});a.Corruption=new Attribute("Corruption",(a)=>"Not defined",0,100);a.GenderIdentity=new Attribute("Gender Identity",(a)=>75<=a?"You strongly feel, and act, like a woman.":60<=a?"You feel, and act, like a woman.":40<=a?"You don't feel nor act like any particular gender.":20<=a?"You feel, and act, like a man.":"You strongly feel, and act, like a man.",50,100);a.Degeneration=new Attribute("Degeneration",(a)=>75<=a?"Sex is about the only thing on your mind, and you don't even try to hide it anymore.":
- 60<=a?"Sometimes you can't hide how naughty you'd like to be.":40<=a?"":20<=a?"Your composure is prudish and calm.":"You have the composure of a saint.",30,100)})(Attributes||(Attributes={}));class Skill extends PersonStat{constructor(){super(...arguments);this.defaultValue=0;this.maxValue=5}static getSkills(){let a=[];for(let b in Skill.Skills)a.push(Skill.Skills[b]);return a}static getSkill(a){return Skill.Skills[a]}}Skill.Skills={};var Skills;
- (function(a){a.Survival=new Skill("Survival",(a)=>"Measures your ability to survive out there.")})(Skills||(Skills={}));
- class Person extends Thing{constructor(a){super(a);this.AI=new AI({});this.animated=!0;this.lastHealthUpdate=this.soreness=0;this.stamina=10;this.lastStaminaUpdate=0;this.staminaPerTurn=1;this.attributeValue={};this.skillValue={};this.addGetAlterations((a)=>({Stats:this.attributeValue,Skills:this.skillValue}));this.addSetAlterations((a,c)=>{if(void 0!=c.Stats)for(var b in c.Stats)a=Attribute.getAttribute(b),void 0!=a&&this.setStat(a,c.Stats[b]);if(void 0!=c.Skills)for(let a in c.Skills)b=Skill.getSkill(a),
- void 0!=b&&this.setSkill(b,c.Skills[a])})}changeHealth(a){let b=this.getParts(Bodypart);for(let c=0;c<b.length;c++)b[c].changeSoreness(a);this.updateHealth()}getHealthOnScale(){return Math.round(10*this.getHealth()/(2*this.getStat(Attributes.Strength)))}getHealth(a){!0!==a&&this.lastHealthUpdate==WorldState.getCurrentTurn()||this.updateHealth();return this.soreness/(this.getStat(Attributes.Strength)*Person.STRENGTH_SORENESS_MULTIPLIER)}updateHealth(){let a=0,b=this.getParts(Bodypart);for(let c=0;c<
- b.length;c++)a+=b[c].getWeightedSoreness();this.soreness=a;this.lastHealthUpdate=WorldState.getCurrentTurn()}changeStamina(a){this.updateStamina();this.stamina+=a;this.stamina>Person.MAX_STAMINA?this.stamina=Person.MAX_STAMINA:0>this.stamina&&(this.stamina=0)}getStaminaOnScale(){return Math.round(10*this.stamina/Person.MAX_STAMINA)}updateStamina(){var a=WorldState.getCurrentTurn()-this.lastStaminaUpdate;this.stamina+=this.staminaPerTurn*a;this.stamina>Person.MAX_STAMINA&&(this.stamina=Person.MAX_STAMINA)}isPlayer(){return this==
- WorldState.player}getStat(a){void 0==this.attributeValue[a.id]&&(this.attributeValue[a.id]=a.defaultValue);return this.attributeValue[a.id]}setStat(a,b){this.attributeValue[a.id]=b}getSkill(a){void 0==this.skillValue[a.id]&&(this.skillValue[a.id]=a.defaultValue);return this.skillValue[a.id]}setSkill(a,b){this.skillValue[a.id]=b}}Person.MAX_STAMINA=10;Person.STRENGTH_SORENESS_MULTIPLIER=4;var EveryTurn;
- (function(a){a.EveryTurn=new Rulebook("Every Turn");a.RunAIRule=a.EveryTurn.createAndAddRule({name:"Run NPC AI Rule",code:function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let a=Thing.InsideRoomRelation.getAnyRightType(Person).filter(function(a){return a!=WorldState.player&&a.getRoom()instanceof RoomRandom&&a.getRoom().placed});for(let b=0;b<a.length;b++){var c=yield a[b].AI.execute(a[b]);let d=a[b],f=a[b].isVisibleTo(WorldState.player);void 0!=c&&(c=yield c.execute(),(f||
- d.isVisibleTo(WorldState.player))&&void 0!=c&&Elements.CurrentTurnHandler.printAsContent(c))}})}});a.incrementTurnCounterRule=a.EveryTurn.createAndAddRule({firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_LOWEST,name:"Increment Turn Counter",code:function(){WorldState.incrementWorldTurn()}})})(EveryTurn||(EveryTurn={}));var PlayBegins;
- (function(a){a.rulebook=new Rulebook("Play Begins");a.execute=function(){a.rulebook.execute({})};a.RememberFirstRoomRule=new Rule({name:"Remember the First Room Rule",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>{WorldState.rememberRoom(WorldState.player.getRoom())}});a.rulebook.addRule(a.RememberFirstRoomRule);a.RunEmptyTurnSequenceRule=new Rule({name:"Run Empty Turn Sequence Rule",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_LOWEST,code:(a)=>{TurnSequence.execute()}});a.rulebook.addRule(a.RunEmptyTurnSequenceRule)})(PlayBegins||
- (PlayBegins={}));(function(a){a.RunPlayBegins=a.rulebook.createAndAddRule({firstPriority:Rule.PRIORITY_LOW,name:"Run Play Begins",code:()=>{PlayBegins.execute()}})})(MachineBegins||(MachineBegins={}));var Tests;(function(a){function b(){return Math.floor(Math.random()*(a.MAX_DICE-a.MIN_DICE))+1+a.MIN_DICE}a.MIN_DICE=0;a.MAX_DICE=3;a.rollDice=b;a.test=function(a,d){return a+b()>=d}})(Tests||(Tests={}));var Direction;
- (function(a){a[a.NORTH=0]="NORTH";a[a.NORTHEAST=1]="NORTHEAST";a[a.EAST=2]="EAST";a[a.SOUTHEAST=3]="SOUTHEAST";a[a.SOUTH=4]="SOUTH";a[a.SOUTHWEST=5]="SOUTHWEST";a[a.WEST=6]="WEST";a[a.NORTHWEST=7]="NORTHWEST";a[a.UP=8]="UP";a[a.DOWN=9]="DOWN"})(Direction||(Direction={}));
- var DirectionNames=(()=>{let a;var b=a||(a={});b.NORTH="North";b.SOUTH="South";b.EAST="East";b.WEST="West";b.SOUTHEAST="Southeast";b.NORTHWEST="Northwest";b.SOUTHWEST="Southwest";b.NORTHEAST="Northeast";b.UP="Down";b.DOWN="Up";b={};for(let c in a)b[c]=a[c],b[Direction[c]]=a[c];return b})(),OppositeDirection=(()=>{let a={};a[Direction.NORTH]=Direction.SOUTH;a[Direction.SOUTH]=Direction.NORTH;a[Direction.EAST]=Direction.WEST;a[Direction.WEST]=Direction.EAST;a[Direction.SOUTHEAST]=Direction.NORTHWEST;
- a[Direction.NORTHWEST]=Direction.SOUTHEAST;a[Direction.SOUTHWEST]=Direction.NORTHEAST;a[Direction.NORTHEAST]=Direction.SOUTHWEST;a[Direction.UP]=Direction.DOWN;a[Direction.DOWN]=Direction.UP;for(let b=0;b<Object.keys(Direction).length/2;b++)a[Direction[b]]=a[b];return a})();
- class Room{constructor(a){this.description=new Say;this.name=void 0==a?"Room":a;this.connections=Array(Room.DIRECTIONS.length)}place(a){Thing.InsideRoomRelation.setRelation(this,a)}remove(a){Thing.InsideRoomRelation.getLeft(a)==this&&Thing.InsideRoomRelation.unsetRight(a)}getContained(){return Thing.InsideRoomRelation.getRight(this)}getContainedAndVisibleTo(a){let b=[];this.getContained().forEach((c)=>{c.visible&&c!==a&&b.push(c)});return b}getContainedAndVisible(){return this.getContainedAndVisibleTo(WorldState.player)}mapRoom(a,
- b){let c=OppositeDirection[b];void 0!=this.connections[b]&&(console.warn("Replacing a connected room.",this," connected through ",b," to ",this.connections[b]),this.connections[b].unmapRoom(c));this.connections[b]=a;void 0!=a.connections[c]&&(console.warn("Replacing a connected room.",a," connected through ",c," to ",a.connections[c]),a.unmapRoom(c));a.connections[c]=this}unmapRoom(a){if(void 0!=this.connections[a]){let b=this.connections[a];this.connections[a]=void 0;b.unmapRoom(OppositeDirection[a])}}getPrintedName(){return this.name}bestDirectionTo(a,
- b){void 0==b&&(b=()=>!0);let c=10;c=c>WorldState.getMaximumRememberedRooms()?c:WorldState.getMaximumRememberedRooms();let d=(a,e,f)=>{if(b(e)){if(e==f)return c=c>a.length?a.length:c,a;if(!(a.length>c)){{let c=[];for(let h in Room.DIRECTIONS){var g=e.connections[Room.DIRECTIONS[h]];void 0!=g&&-1==a.indexOf(g)&&b(g)&&(g=d(a.concat([g]),g,f),void 0!=g&&c.push(g))}let h=0;c.forEach((a,b,d)=>{a.length<c[h].length&&(h=b)});return c[h]}}}},e=Array(Room.DIRECTIONS.length),f;for(let b in Room.DIRECTIONS){let c=
- Room.DIRECTIONS[b],g=this.connections[c];void 0!=g&&(e[c]=d([this,g],g,a),void 0!=e[c]&&(void 0==f||e[f].length>e[c].length)&&(f=c))}return f}static getDirectionXYZ(a){var b=0;-1!=[Direction.NORTH,Direction.NORTHEAST,Direction.NORTHWEST].indexOf(a)?b=1:-1!=[Direction.SOUTH,Direction.SOUTHEAST,Direction.SOUTHWEST].indexOf(a)&&(b=-1);var c=0;-1!=[Direction.EAST,Direction.SOUTHEAST,Direction.NORTHEAST].indexOf(a)?c=1:-1!=[Direction.WEST,Direction.SOUTHWEST,Direction.NORTHWEST].indexOf(a)&&(c=-1);return[c,
- b,a==Direction.UP?1:a==Direction.DOWN?-1:0]}static shift(a,b){let c=Room.getDirectionXYZ(b);a.forEach((b,e,f)=>{c[e]+=a[e]});return c}}Room.DIRECTIONS=(()=>{let a=[];for(let b=0;b<Object.keys(Direction).length/2;b++)a.push(b);return a})();
- class MapNote extends Thing{constructor(){super(...arguments);this.rooms=[];this.regions=[]}addRoom(...a){a.forEach((a)=>{this.rooms.push(a)})}addRegion(...a){a.forEach((a)=>{this.regions.push(a)})}contains(a){if(-1!=this.rooms.indexOf(a))return!0;for(var b=0;b<this.regions.length;b++)if(-1!=this.regions[b].getRooms().indexOf(a))return!0}}
- class Bodypart extends Thing{constructor(a){super(a);this.sorenessWeight=1;this.soreness=0;this.sorenessPerTurn=.05;this.lastSorenessUpdate=0;this.slots=[];this.visibleSlots=[];this.genderValue=Bodypart.GENDER_MEDIUM_ANDROGYNE;this.genderWeight=1;this.sluttiness=10;this.sluttinessWeight=Bodypart.WEIGHT_LOWEST;this.addGetAlterations((a)=>({Soreness:a.soreness,GenderValue:a.genderValue,Sluttiness:a.getSluttiness()}));this.addSetAlterations((a,c)=>{this.soreness=c.Soreness;this.genderValue=c.GenderValue;
- this.sluttiness=c.Sluttiness})}updateSoreness(){let a=WorldState.getCurrentTurn();a>this.lastSorenessUpdate&&(0<this.soreness&&(this.soreness-=this.sorenessPerTurn*(a-this.lastSorenessUpdate),0>this.soreness&&(this.soreness=0)),this.lastSorenessUpdate=a)}changeSoreness(a){this.updateSoreness();this.soreness+=a;0>this.soreness&&(this.soreness=0)}getSoreness(){this.updateSoreness();return this.soreness}getWeightedSoreness(){return this.getSoreness()*this.sorenessWeight}getSorenessWeight(){return this.sorenessWeight}getGenderWeight(){return 0==
- this.slots.length?0:this.visibleSlots.length/this.slots.length*this.genderWeight}getGenderValue(){return this.genderValue}getWeightedGenderValue(){return this.getGenderValue()*this.getGenderWeight()}getSluttiness(){return this.sluttiness}getSluttinessWeight(){return 0==this.slots.length?0:this.visibleSlots.length/this.slots.length*this.sluttinessWeight}getWeightedSluttinessValue(){return this.getSluttiness()*this.getSluttinessWeight()}updateVisibility(){this.visibleSlots=this.slots.slice(0);var a=
- Thing.PartRelation.getLeft(this);if(void 0!=a){a=Thing.WearRelation.getRight(a);for(let b=0;b<a.length;b++){let c=a[b].getCoveringSlots();for(let a=0;a<c.length;a++){let b=this.visibleSlots.indexOf(c[a]);0<=b&&this.visibleSlots.splice(b,1)}if(0==this.visibleSlots.length)break}}}isUncovered(){this.updateVisibility();return this.visibleSlots.length==this.slots.length&&0<this.slots.length}updateStatus(){this.updateVisibility()}static getSoreness(a){let b=0;Thing.PartRelation.getRightType(a,Bodypart).forEach((a)=>
- {b+=a.getWeightedSoreness()});return b}static getGenderValueOn(a){let b=0,c=0;Thing.PartRelation.getRightType(a,Bodypart).forEach((a)=>{b+=a.getGenderWeight();c+=a.getWeightedGenderValue()});return{weight:b,value:c}}static getSluttinessValueOn(a){let b=0,c=0;Thing.PartRelation.getRightType(a,Bodypart).forEach((a)=>{b+=a.getSluttinessWeight();c+=a.getWeightedSluttinessValue()});return{weight:b,value:c}}arrangeGenderValue(a){this.genderValue=a;this.getPartOne().invalidateCaches()}increaseFemininity(a){let b=
- this.getGenderValue();this.arrangeGenderValue(b+5*a)}increaseMasculinity(a){let b=this.getGenderValue();this.arrangeGenderValue(b-5*a)}}Bodypart.WEIGHT_LOWEST=1;Bodypart.WEIGHT_LOW=3;Bodypart.WEIGHT_MEDIUM=5;Bodypart.WEIGHT_HIGH=7;Bodypart.WEIGHT_HIGHEST=9;Bodypart.SLUTTINESS_LOWEST_SAINTLY=0;Bodypart.SLUTTINESS_LOW_PRUDE=25;Bodypart.SLUTTINESS_MEDIUM_AVERAGE=50;Bodypart.SLUTTINESS_HIGH_SLUT=75;Bodypart.SLUTTINESS_HIGHEST_WHORE=100;Bodypart.GENDER_LOWEST_MANLIEST=0;Bodypart.GENDER_LOW_MANLY=25;
- Bodypart.GENDER_MEDIUM_ANDROGYNE=50;Bodypart.GENDER_HIGH_FEMININE=75;Bodypart.GENDER_HIGHEST_FEMININEST=100;class SexStick extends Bodypart{}class SexHole extends Bodypart{}
- class Measure{constructor(...a){this.superscript=" \u00b2 \u00b3 \u2074 \u2075 \u2076 \u2077 \u2078 \u2079".split(" ");this.units=1;a.forEach((a)=>{this.units*=a});this.sides=a.length}getText(){let a=Math.pow(this.sides,100);return this.units>a?(+(this.units/a).toFixed(2)).toString()+"m"+this.superscript[this.sides]:this.units.toString()+"cm"+this.superscript[this.sides]}getNumber(){return this.units}getSides(){return this.sides}static fromInches(a){return 2.54*a}static fromFeet(a){return 30.48*
- a}}class MeasureLiquid{constructor(a){this.units=a}getText(){return 1E3<this.units?(+(this.units/1E3).toFixed(2)).toString()+"L":this.units.toString()+"mL"}static fromLiters(a){return 1E3*a}}
- class HumanoidArms extends Bodypart{constructor(){super(...arguments);this.sorenessWeight=Bodypart.WEIGHT_LOW;this.genderWeight=Bodypart.WEIGHT_MEDIUM;this.slots=[Humanoid.SLOT_ARMS]}get sluttinessWeight(){return this.getPartOne().isMale()?Bodypart.WEIGHT_HIGHEST:Bodypart.WEIGHT_MEDIUM}set sluttinessWeight(a){}getSluttiness(){return this.getPartOne().isMale()?this.getGenderValue():100-this.getGenderValue()}getDescription(){let a=this.getPartOne().getStat(Attributes.Strength);return 4<a?"Your arms and legs are ridiculously huge, showing off just how strong you are.":
- 2<a?"Your arms and legs are pretty big because of your muscles.":2==a?"":"You look like you don't even lift."}getGenderValue(){return 20*this.getPartOne().getStat(Attributes.Strength)}}
- class HumanoidBreasts extends Bodypart{constructor(a){super(a);this.milk=this.silicone=this.size=0;this.sorenessWeight=Bodypart.WEIGHT_MEDIUM;this.genderWeight=Bodypart.WEIGHT_HIGH;this.slots=[Humanoid.SLOT_BREASTS];this.sluttiness=Bodypart.SLUTTINESS_HIGH_SLUT;this.sluttinessWeight=Bodypart.WEIGHT_MEDIUM;this.addGetAlterations((a)=>({Size:this.size,Silicone:this.silicone,Milk:this.milk}));this.addSetAlterations((a,c)=>{this.size=c.Size;this.silicone=c.Silicone;this.milk=c.Milk})}getSize(){return this.size+
- this.silicone+this.milk}getSizeText(){return HumanoidBreasts.getSizeText(this.getSize())}static getSizeText(a){let b="flat AA-cup A-cup B-cup C-cup D-cup E-cup F-cup G-cup H-cup".split(" ");return a>=b.length?"HUGE":b[a]}getGenderValue(){return HumanoidBreasts.getGenderFromSize(this.getSize())}getSluttiness(){return this.getGenderValue()}static getGenderFromSize(a){return 0>=a?20:3>=a?20*a:80}arrangeGenderValue(a){20>=a?this.milk=this.silicone=this.size=0:this.size=80>a?Math.round(a/20):4}}
- class HumanoidButt extends Bodypart{constructor(a){super(a);this.silicone=this.size=0;this.genderWeight=this.sorenessWeight=Bodypart.WEIGHT_MEDIUM;this.slots=[Humanoid.SLOT_BUTT];this.sluttiness=Bodypart.SLUTTINESS_HIGH_SLUT;this.sluttinessWeight=Bodypart.WEIGHT_MEDIUM;this.addGetAlterations((a)=>({Size:this.size,Silicone:this.silicone}));this.addSetAlterations((a,c)=>{this.size=c.Size;this.silicone=c.Silicone})}getSluttiness(){return 33*this.getSize()}getSize(){return this.size+this.silicone}getSizeText(){return HumanoidButt.getSizeText(this.getSize())}static getSizeText(a){let b=
- ["flat","tiny","round","plump"];return a>=b.length?"gargantuan":b[a]}getGenderValue(){return HumanoidBreasts.getGenderFromSize(this.getSize())}static getGenderFromSize(a){return 0>=a?20:2>=a?30*a:80}arrangeGenderValue(a){this.size=20>=a?0:60>=a?1:3}}
- class HumanoidExtremity extends Bodypart{constructor(a){super(a);this.nailsPainted=!1;this.nailColor=0;this.addGetAlterations((a)=>({Painted:this.nailsPainted,Color:this.nailColor}));this.addSetAlterations((a,c)=>{this.nailsPainted=c.Painted;this.nailColor=c.Color})}static getColor(a){return HumanoidExtremity.nailColorNames[a]}getSluttiness(){return this.getGenderValue()}getGenderValue(){let a=this.nailsPainted?3:0,b=this.genderWeight;return(this.genderValue*b+50*this.nailColor*a)/(b+a)}arrangeGenderValue(a){this.genderValue=
- a;if(this.nailsPainted=60<a)this.nailColor=70<a?2:1;this.getPartOne().invalidateCaches()}}HumanoidExtremity.nailColorNames=["none","red","pink"];
- class HumanoidFeet extends HumanoidExtremity{constructor(){super(...arguments);this.genderWeight=this.sorenessWeight=Bodypart.WEIGHT_LOW;this.slots=[Humanoid.SLOT_FEET]}getDescription(){let a=new Say;55<this.genderValue?a.add("Your feet are small and cute."):45>this.genderValue&&a.add("Your feet are big and mannish.");this.nailsPainted&&a.add(" Your toenails are painted "+HumanoidExtremity.getColor(this.nailColor)+".");return a}}
- class HumanoidHands extends HumanoidExtremity{constructor(){super(...arguments);this.sorenessWeight=Bodypart.WEIGHT_LOW;this.genderWeight=Bodypart.WEIGHT_MEDIUM;this.slots=[Humanoid.SLOT_HANDS]}getDescription(){let a=new Say;55<this.genderValue?a.add("Your hands are delicate and slender."):45>this.genderValue&&a.add("Your hands are rough and large.");this.nailsPainted&&a.add(" Your toenails are painted "+HumanoidExtremity.getColor(this.nailColor)+".");return a}}
- class HumanoidHead extends Bodypart{constructor(){super(...arguments);this.sorenessWeight=Bodypart.WEIGHT_MEDIUM;this.genderWeight=Bodypart.WEIGHT_LOW;this.slots=[Humanoid.SLOT_HEADGEAR,Humanoid.SLOT_HAIR,Humanoid.SLOT_EARS,Humanoid.SLOT_FACE,Humanoid.SLOT_EYES,,Humanoid.SLOT_NOSE,Humanoid.SLOT_MOUTH]}}
- class HumanoidPenis extends SexStick{constructor(a){super(a);this.sorenessWeight=Bodypart.WEIGHT_HIGH;this.genderValue=25;this.genderWeight=Bodypart.WEIGHT_HIGHEST;this.slots=[Humanoid.SLOT_CROTCH_FRONT];this.sluttiness=Bodypart.SLUTTINESS_HIGH_SLUT;this.sluttinessWeight=Bodypart.WEIGHT_MEDIUM;this.flaccidSize=new Measure(6);this.flaccidWidth=new Measure(3);this.erectSize=new Measure(15);this.erectWidth=new Measure(6);this.arousalMinimum=5;this.arousalErect=25;this.flaccidMult=.5<=Math.random()?.33:
- .77;this.addGetAlterations((a)=>({FSize:this.flaccidSize.getNumber(),FWidth:this.flaccidWidth.getNumber(),ESize:this.erectSize.getNumber(),EWidth:this.erectWidth.getNumber(),AMin:this.arousalMinimum,AErect:this.arousalErect,FMult:this.flaccidMult}));this.addSetAlterations((a,c)=>{this.flaccidSize=new Measure(c.FSize);this.flaccidWidth=new Measure(c.FWidth);this.erectSize=new Measure(c.ESize);this.erectWidth=new Measure(c.EWidth);this.arousalMinimum=c.AMin;this.arousalErect=c.AErect;this.flaccidMult=
- c.FMult})}getSluttiness(){return 3*this.getBulgeSize()}isGrower(){return.5>this.flaccidMult}getActualSize(){let a=this.flaccidSize.getNumber(),b=this.erectSize.getNumber();return a+(b-a)*this.getArousalPerc()}isBig(){return 22<this.getBulgeSize()}getArousalPerc(){let a=(0-this.arousalMinimum)/(this.arousalErect-this.arousalMinimum);return 0>a?0:1<a?1:a}isFlaccid(){return.6>this.getArousalPerc()}isErect(){return!this.isFlaccid()}getActualWidth(){let a=this.flaccidWidth.getNumber(),b=this.erectWidth.getNumber(),
- c=(0-this.arousalMinimum)/(this.arousalErect-this.arousalMinimum);return a+(b-a)*(0>c?0:1<c?1:c)}getLong(){return new Measure(this.getActualSize())}getWide(){return new Measure(this.getActualWidth())}getBulgeSize(){return this.getActualSize()+3*this.getActualWidth()}getSizeText(){return HumanoidPenis.getSizeText(this.getBulgeSize())}static getSizeText(a){let b=[[0,"nonexistent"],[1,"tiny"],[20,"small"],[23,"medium"],[27,"big"],[32,"huge"],[36,"monstrous"]],c;for(c=1;c<b.length&&b[c][0]<a;c++);return b[c-
- 1][1]}getGenderValue(){let a=[[10,60],[20,45],[23,35],[27,28],[32,24],[36,18]],b;for(b=1;b<a.length&&a[b][0]<this.getActualSize();b++);return a[b-1][1]}arrangeGenderValue(a){let b=[[60,3,2],[45,10,3],[35,14,3],[28,17,3],[24,19,4],[18,22,4.5]],c;for(c=1;c<b.length&&b[c][0]>a;c++);this.flaccidSize=new Measure(this.flaccidMult*b[c-1][1]);this.flaccidWidth=new Measure(this.flaccidMult*b[c-1][2]);this.erectSize=new Measure(b[c-1][1]);this.erectWidth=new Measure(b[c-1][2]);this.getPartOne().invalidateCaches()}static getSynonym(){return(new OneOf(OneOf.PURELY_AT_RANDOM,
- ...["cock","dick"])).getOne()}}
- class HumanoidSkin extends Bodypart{constructor(a){super(a);this.sorenessWeight=0;this.genderWeight=Bodypart.WEIGHT_MEDIUM;this.slots=[Humanoid.SLOT_FACE,Humanoid.SLOT_NECK,Humanoid.SLOT_SHOULDERS,Humanoid.SLOT_ARMS,Humanoid.SLOT_HANDS,Humanoid.SLOT_UPPER_CHEST,Humanoid.SLOT_MIDRIFF,Humanoid.SLOT_WAIST,Humanoid.SLOT_BACK,Humanoid.SLOT_HIPS,Humanoid.SLOT_BUTT,Humanoid.SLOT_LEG_UPPER,Humanoid.SLOT_LEG_LOWER];this.skinSoftness=5;this.skinHairiness=2;this.addGetAlterations((a)=>({Softness:this.skinSoftness,
- Hairiness:this.skinHairiness}));this.addSetAlterations((a,c)=>{this.skinSoftness=c.Softness;this.skinHairiness=c.Hairiness})}getSluttiness(){return this.getGenderValue()}getDescription(){let a=50<this.getPartOne().getStat(Attributes.Corruption),b=new Say("Your skin is ");7<this.skinSoftness?b.add("perfectly smooth"):4<this.skinSoftness?b.add("smooth"):b.add("rough");b.add(" and ");8<this.skinHairiness?b.add("hairy, like a gorilla's"):6<this.skinHairiness?b.add("hairy"):3<this.skinHairiness?b.add("somewhat hairless"):
- b.add("completely hairless");b.add(".");a&&b.add(" The taint of your corruption has turned your skin green, like an orc's.");return b}getGenderValue(){return(100*this.skinSoftness+(1E3-100*this.skinHairiness))/20}arrangeGenderValue(a){a/=10;this.skinHairiness=10-Math.round(a);this.skinSoftness=Math.round(a);this.getPartOne().invalidateCaches()}}
- class HumanoidTesticles extends Bodypart{constructor(a){super(a);this.size=1;this.sorenessWeight=Bodypart.WEIGHT_HIGH;this.genderWeight=Bodypart.WEIGHT_HIGHEST;this.slots=[Humanoid.SLOT_CROTCH_FRONT];this.sluttiness=Bodypart.SLUTTINESS_MEDIUM_AVERAGE;this.sluttinessWeight=Bodypart.WEIGHT_MEDIUM;this.addGetAlterations((a)=>({Size:this.size}));this.addSetAlterations((a,c)=>{this.size=c.Size})}getBulgeSize(){return this.size}getGenderWeight(){return 80}}
- class HumanoidVagina extends SexHole{constructor(){super(...arguments);this.genderValue=85;this.genderWeight=Bodypart.WEIGHT_HIGHEST;this.slots=[Humanoid.SLOT_CROTCH_FRONT];this.sluttiness=50;this.sluttinessWeight=Bodypart.WEIGHT_MEDIUM}getSluttiness(){return 100-this.genderValue}getDescription(){let a=new Say("Your "),b=55<=this.genderValue,c=70<this.genderValue;80<=this.genderValue?a.add("hairless ",Say.PUSSY):a.add("hairy ",Say.PUSSY);a.add(" ");c?a.add("is usually completely covered by its lips"):
- a.add("has some curtains escaping its lips");b||a.add(" and has an oversized clit");a.add(".");return a}arrangeGenderValue(a){this.genderValue=a/2+50;this.getPartOne().invalidateCaches()}static getSynonym(){return(new OneOf(OneOf.PURELY_AT_RANDOM,...["pussy","womanhood"])).getOne()}}class HumanoidTorso extends Bodypart{constructor(){super(...arguments);this.sluttinessWeight=this.genderWeight=0}}
- class Clothing extends Thing{constructor(){super(...arguments);this.slots=[];this.transparentSlots=[];this.layer=Clothing.LAYER_MEDIUM;this.isVisible=!1;this.visibleOn=[];this.breastPadding=0;this.tightBreastSize=this.maxBreastSize=-1;this.crotchPadding=this.looseBreastSize=0;this.tightCrotchSize=this.maxCrotchSize=-1;this.buttPadding=this.looseCrotchSize=0;this.tightButtSize=this.maxButtSize=-1;this.looseButtSize=0;this.genderValue=50;this.sluttinessValue=40}updateStatus(){this.visibleOn=[];this.visibleOn.push(...this.slots);
- var a=Thing.WearRelation.getLeft(this);if(void 0!=a){a=Thing.WearRelation.getRight(a);var b=[];for(let c=0;c<a.length;c++){let d=a[c];d!=this&&d.layer>this.layer&&b.push(...d.getCoveringSlots())}this.visibleOn=this.visibleOn.filter((a)=>-1==b.indexOf(a));this.isVisible=0<this.visibleOn.length}}getCoveringSlots(){return 0==this.transparentSlots.length?this.slots.slice(0):this.slots.filter((a,b,c)=>-1==this.transparentSlots.indexOf(a))}getGenderWeight(){return this.visibleOn.length}getGenderValue(){return this.genderValue}getSluttinessWeight(){return this.visibleOn.length}getSluttinessValue(){return this.sluttinessValue}static getGenderValueOn(a){let b=
- 0,c=0;a=Thing.WearRelation.getRight(a);for(let d=0;d<a.length;d++)b+=a[d].getGenderWeight(),c+=a[d].getGenderWeight()*a[d].getGenderValue();return{weight:b,value:c}}static getSluttinessValueOn(a){let b=0,c=0;a=Thing.WearRelation.getRight(a);for(let d=0;d<a.length;d++)b+=a[d].getSluttinessWeight(),c+=a[d].getSluttinessWeight()*a[d].getSluttinessValue();return{weight:b,value:c}}}Clothing.LAYER_LOWEST=0;Clothing.LAYER_LOW=5;Clothing.LAYER_MEDIUM=10;Clothing.LAYER_HIGH=15;Clothing.LAYER_HIGHEST=20;
- class ActionRemove extends Action{constructor(a,...b){super(a,...b);this.extraChecks.push(ActionRemove.check);this.extraCarries.push(ActionRemove.carry)}getCommandText(){return"take off "+(void 0!=this.getNoun(0)?this.getNoun(0).getPrintedName():"")}getClothing(){return this.getNoun(0)}}ActionRemove.check=new Rulebook("Check Removing");ActionRemove.carry=new Rulebook("Carry out Removing");
- ActionRemove.checkIsWearable=ActionRemove.check.createAndAddRule({name:"Is noun a clothing",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;if(!(a.getClothing()instanceof Clothing))return a.actor==WorldState.player&&a.say.add("You can only remove Clothing."),!1}});
- ActionRemove.checkIsHeld=ActionRemove.check.createAndAddRule({name:"Is noun worn",firstPriority:Rule.PRIORITY_HIGH,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun,c=b.getClothing();if(!Thing.WearRelation.isRight(b.actor,c))return b.actor==WorldState.player&&b.say.add("You are not wearing it."),!1})});
- ActionRemove.carryDefault=ActionRemove.carry.createAndAddRule({name:"Set Clothing as Carried",firstPriority:Rule.PRIORITY_MEDIUM,code:(a)=>{a=a.noun;var b=a.getClothing();Thing.CarryRelation.setRelation(a.actor,b);b=a.actor;let c=a.getNoun(0);b==WorldState.player?a.say.add(new SayBold(c,": "),"Removed."):a.say.add(new SayThe,b," takes off ",new SayThe,c,".")}});
- Elements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule({name:"Hyperlink - Remove",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;a instanceof Clothing&&Thing.WearRelation.isRight(WorldState.player,a)&&Elements.HyperlinkHandler.addAvailableAction("Remove",new ActionRemove(WorldState.player,a))}}));
- Elements.InventoryHandler.LinkingThing.addRule(new Rule({name:"Inventory - Remove",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>{a=a.noun;a instanceof Clothing&&Thing.WearRelation.isRight(WorldState.player,a)&&Elements.InventoryHandler.printThingLink("R",new ActionRemove(WorldState.player,a))}}));
- class ActionWear extends Action{constructor(a,...b){super(a,...b);this.extraChecks.push(ActionWear.check);this.extraCarries.push(ActionWear.carry)}getCommandText(){return"wear "+(void 0!=this.getNoun(0)?this.getNoun(0).getPrintedName():"")}getClothing(){return this.getNoun(0)}}ActionWear.check=new Rulebook("Check Wearing");ActionWear.carry=new Rulebook("Carry out Wearing");
- ActionWear.checkIsWearable=ActionWear.check.createAndAddRule({name:"Is noun a clothing",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;if(!(a.getClothing()instanceof Clothing))return a.actor==WorldState.player&&a.say.add("You can only wear Clothing."),!1}});
- ActionWear.checkIsHeld=ActionWear.check.createAndAddRule({name:"Is noun held",firstPriority:Rule.PRIORITY_HIGH,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun,c=b.getClothing();if(!Thing.CarryRelation.isRight(b.actor,c)){b.actor==WorldState.player&&b.say.add("(first taking the ",c,")",Say.LINE_BREAK);let a=new ActionTake(b.actor,c);yield a.execute();b.say.add(a.say);if(!Thing.CarryRelation.isRight(b.actor,c))return!1}})});
- ActionWear.carryDefault=ActionWear.carry.createAndAddRule({name:"Set Clothing as Worn",firstPriority:Rule.PRIORITY_MEDIUM,code:(a)=>{a=a.noun;var b=a.getClothing();Thing.WearRelation.setRelation(a.actor,b);b=a.actor;let c=a.getNoun(0);b==WorldState.player?a.say.add(new SayBold(c,": "),"Worn."):a.say.add(new SayThe,b," puts on ",new SayThe,c,".")}});
- Elements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule({name:"Hyperlink - Wear",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;a instanceof Clothing&&!Thing.WearRelation.isRight(WorldState.player,a)&&Elements.HyperlinkHandler.addAvailableAction("Wear",new ActionWear(WorldState.player,a))}}));
- Elements.InventoryHandler.LinkingThing.addRule(new Rule({name:"Inventory - Wear",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>{a=a.noun;a instanceof Clothing&&!Thing.WearRelation.isRight(WorldState.player,a)&&Elements.InventoryHandler.printThingLink("W",new ActionWear(WorldState.player,a))}}));
- class Humanoid extends Person{constructor(a){super(a);this.breastVisibleSize=0;this.isBreastLoose=this.isBreastTight=this.isBreastVisible=!1;this.crotchVisibleSize=0;this.isCrotchTight=this.isCrotchVisible=!1;this.buttVisibleSize=0;this.isSluttinessCached=this.isGenderCached=this.isButtTight=this.isButtVisible=!1;this.uncoveredSlots=[];this.addParts(new HumanoidSkin,new HumanoidHead,new HumanoidArms,new HumanoidHands,new HumanoidBreasts,new HumanoidFeet,new HumanoidTorso,new HumanoidButt);a.isMale?
- (this.addMaleParts(),this.setGenderValue(25)):(this.addFemaleParts(),this.setGenderValue(75));this.addGetAlterations((a)=>({HumanoidGender:a.isMale()?Humanoid.SEX_MALE:a.isFemale()?Humanoid.SEX_FEMALE:Humanoid.SEX_HERM}));this.addSetAlterations((a,c)=>{a.removeGenderedParts();c.HumanoidGender==Humanoid.SEX_MALE?a.addMaleParts():(c.HumanoidGender!=Humanoid.SEX_FEMALE&&a.addMaleParts(),a.addFemaleParts())})}invalidateCaches(){this.isSluttinessCached=this.isGenderCached=!1}getGenderValue(){this.isSluttinessCached||
- this.updateCaches();return this.cachedGenderValue}getSluttiness(){this.isSluttinessCached||this.updateCaches();return this.cachedSluttiness}getBulges(){this.isGenderCached||this.updateCaches();return this.cachedBulges}updateCaches(){this.updateClothing();this.updateSlots();this.updateBodyparts();this.updateBulges();this.updateGenderValue();this.updateSluttiness()}updateSlots(){this.uncoveredSlots=[];for(var a=0;a<Humanoid.SLOT_SLOT_COUNT;a++)this.uncoveredSlots.push(a);a=Thing.WearRelation.getRightType(this,
- Clothing);for(let b=0;b<a.length;b++){let c=a[b].getCoveringSlots();for(let a=0;a<c.length;a++){let b=this.uncoveredSlots.indexOf(c[a]);0<=b&&this.uncoveredSlots.splice(b,1)}if(0==this.uncoveredSlots.length)break}}updateGenderValue(){var a=Clothing.getGenderValueOn(this),b=Bodypart.getGenderValueOn(this);let c=a.weight+b.weight;a=a.value+b.value;b=Bodypart.WEIGHT_HIGHEST;let d=this.getStat(Attributes.GenderIdentity)*Bodypart.WEIGHT_HIGHEST,e=!1,f=!1;this.isCrotchVisible&&(void 0!=Thing.PartRelation.getRightTypeOne(this,
- HumanoidPenis)?(e=!0,f=!1,d+=0*Bodypart.WEIGHT_LOWEST,b+=Bodypart.WEIGHT_LOWEST):void 0!=Thing.PartRelation.getRightTypeOne(this,HumanoidVagina)&&(e=!1,f=!0,d+=100*Bodypart.WEIGHT_LOWEST,b+=Bodypart.WEIGHT_LOWEST));0<this.breastVisibleSize&&(d+=100*Bodypart.WEIGHT_LOWEST,b+=Bodypart.WEIGHT_LOWEST);0<this.crotchVisibleSize&&!f&&(d+=0*Bodypart.WEIGHT_LOWEST,b+=Bodypart.WEIGHT_LOWEST);this.cachedGenderValue={hasTits:1<this.breastVisibleSize,hasPenisBulge:0<this.crotchVisibleSize&&!f,hasPenis:e,hasVagina:f,
- genderValue:a/c,genderValueCorrected:(a+d)/(c+b)};this.isGenderCached=!0}isVisibleOn(a){return-1!=this.uncoveredSlots.indexOf(a)}updateSluttiness(){var a=Clothing.getSluttinessValueOn(this),b=Bodypart.getSluttinessValueOn(this);let c=a.weight+b.weight;a=a.value+b.value;let d=b=0;var e=[Humanoid.SLOT_MIDRIFF,Humanoid.SLOT_LEG_UPPER,Humanoid.SLOT_WAIST,Humanoid.SLOT_HIPS,Humanoid.SLOT_BACK];for(var f=0;f<e.length;f++)this.isVisibleOn(e[f])&&(b+=1,d+=75);e=[Humanoid.SLOT_BREASTS,Humanoid.SLOT_CROTCH_FRONT,
- Humanoid.SLOT_CROTCH_BACK,Humanoid.SLOT_BUTT];for(f=0;f<e.length;f++)this.isVisibleOn(e[f])&&(b+=3,d+=75);if(.75<this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT)for(e=[Humanoid.SLOT_BREASTS,Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK,Humanoid.SLOT_BUTT],f=0;f<e.length;f++)this.isVisibleOn(e[f])&&(b+=5,d+=85);this.isMale()?this.hasBreasts()?(e=.5>this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT&&!this.isVisibleOnArray([Humanoid.SLOT_BREASTS,Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK]),
- f=.3>this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT&&this.isVisibleOnArray([Humanoid.SLOT_BREASTS,Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK,Humanoid.SLOT_BUTT])):(e=.5>this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT&&!this.isVisibleOnArray([Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK]),f=.3>this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT&&this.isVisibleOnArray([Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK,Humanoid.SLOT_BUTT])):(e=.5>this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT&&
- !this.isVisibleOnArray([Humanoid.SLOT_BREASTS,Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK]),f=.3>this.isVisibleOn.length/Humanoid.SLOT_SLOT_COUNT&&this.isVisibleOnArray([Humanoid.SLOT_BREASTS,Humanoid.SLOT_CROTCH_FRONT,Humanoid.SLOT_CROTCH_BACK,Humanoid.SLOT_BUTT]));this.cachedSluttiness={halfNaked:e,naked:f,sluttiness:a/c,sluttinessCorrected:(a+d)/(c+b)};this.isSluttinessCached=!0}isVisibleOnArray(a){for(let b=0;b<a.length;b++)if(!this.isVisibleOn(a[b]))return!1;return!0}addMaleParts(){this.isMale()||
- this.isHerm()||this.addParts(new HumanoidTesticles,new HumanoidPenis);this.invalidateCaches()}addFemaleParts(){this.isFemale()||this.isHerm()||this.addParts(new HumanoidVagina);this.invalidateCaches()}removeGenderedParts(){this.removeParts(HumanoidVagina);this.removeParts(HumanoidPenis);this.removeParts(HumanoidTesticles);this.invalidateCaches()}setGenderValue(a){let b=this.getParts(Bodypart);for(let c=0;c<b.length;c++)b[c]instanceof HumanoidBreasts&&this.isMale()?b[c].arrangeGenderValue(0):b[c].arrangeGenderValue(a)}updateBodyparts(){let a=
- Thing.PartRelation.getRightType(this,Bodypart);for(let b=0;b<a.length;b++)a[b].updateStatus()}updateClothing(){let a=Thing.WearRelation.getRightType(this,Clothing);for(let b=0;b<a.length;b++)a[b].updateStatus()}updateBulges(){let a=Thing.WearRelation.getRightType(this,Clothing).sort(function(a,b){return a.layer-b.layer});this.isButtVisible=this.isCrotchVisible=this.isBreastVisible=!0;let b=[],c=[],d=[];a.forEach((a)=>{a.updateStatus();-1!=a.slots.indexOf(Humanoid.SLOT_BREASTS)&&(b.push(a),-1==a.transparentSlots.indexOf(Humanoid.SLOT_BREASTS)&&
- (this.isBreastVisible=!1));-1!=a.slots.indexOf(Humanoid.SLOT_BUTT)&&(c.push(a),-1==a.transparentSlots.indexOf(Humanoid.SLOT_BUTT)&&(this.isButtVisible=!1));-1!=a.slots.indexOf(Humanoid.SLOT_CROTCH_FRONT)&&(d.push(a),-1==a.transparentSlots.indexOf(Humanoid.SLOT_CROTCH_FRONT)&&(this.isCrotchVisible=!1))});this.updateBreastSizes(b);this.updateCrotchSizes(d);this.updateButtSizes(c);this.cachedBulges={breasts:this.breastVisibleSize,butt:this.buttVisibleSize,crotch:this.crotchVisibleSize,waist:0}}getTopClothOn(a){return Thing.WearRelation.getRightType(this,
- Clothing).filter((b)=>b.visibleOn.includes(a)).sort((a,c)=>a.layer-c.layer)[0]}updateBreastSizes(a){this.isBreastTight=!1;this.isBreastLoose=!0;this.breastVisibleSize=Thing.PartRelation.getRightTypeOne(this,HumanoidBreasts).getSize();a.forEach((a)=>{0<=a.tightBreastSize&&this.breastVisibleSize>a.tightBreastSize&&(this.isBreastTight=!0);0<=a.maxBreastSize&&this.breastVisibleSize>a.maxBreastSize&&(this.breastVisibleSize=a.maxBreastSize);this.breastVisibleSize>=a.looseBreastSize&&(this.isBreastLoose=
- !1);this.breastVisibleSize+=a.breastPadding;0>this.breastVisibleSize&&(this.breastVisibleSize=0)})}updateCrotchSizes(a){this.isCrotchTight=!1;this.crotchVisibleSize=0;let b=Thing.PartRelation.getRightTypeOne(this,HumanoidPenis),c=Thing.PartRelation.getRightTypeOne(this,HumanoidTesticles);this.crotchVisibleSize=0;void 0!=b&&(this.crotchVisibleSize+=b.getBulgeSize());void 0!=c&&(this.crotchVisibleSize+=c.getBulgeSize());this.crotchVisibleSize=Math.floor(10*this.crotchVisibleSize)/10;a.forEach((a)=>
- {0<=a.tightCrotchSize&&this.crotchVisibleSize>a.tightCrotchSize&&(this.isCrotchTight=!0);0<=a.maxCrotchSize&&this.crotchVisibleSize>a.maxCrotchSize&&(this.crotchVisibleSize=a.maxCrotchSize);this.crotchVisibleSize+=a.crotchPadding;0>this.crotchVisibleSize&&(this.crotchVisibleSize=0)})}updateButtSizes(a){this.isButtTight=!1;let b=Thing.PartRelation.getRightTypeOne(this,HumanoidButt);this.buttVisibleSize=void 0==b?0:b.getSize();a.forEach((a)=>{0<=a.tightButtSize&&this.buttVisibleSize>a.tightButtSize&&
- (this.isButtTight=!0);0<=a.maxButtSize&&this.buttVisibleSize>a.maxButtSize&&(this.buttVisibleSize=a.maxButtSize);this.buttVisibleSize+=a.buttPadding;0>this.buttVisibleSize&&(this.buttVisibleSize=0)})}hasBreasts(){return 1<this.getPart(HumanoidBreasts).size?!0:!1}isMale(){return 0<this.getParts(HumanoidPenis).length&&0==this.getParts(HumanoidVagina).length}isFemale(){return 0==this.getParts(HumanoidPenis).length&&0<this.getParts(HumanoidVagina).length}isHerm(){return 0<this.getParts(HumanoidPenis).length&&
- 0<this.getParts(HumanoidVagina).length}getShortestDescription(){let a=this.getGenderValue(),b=this.getSluttiness(),c="";75<b.sluttinessCorrected?c+="slutty, ":35<b.sluttinessCorrected||(c=20<b.sluttinessCorrected?c+"prude, ":c+"saintly, ");c=40>a.genderValueCorrected?c+"masculine ":60>a.genderValueCorrected?c+"androgynous ":c+"feminine ";a.hasTits?a.hasPenis||a.hasPenisBulge?c+="shemale":a.hasVagina&&(c+="woman"):a.hasPenis?c=60>a.genderValueCorrected?c+"man":c+"trap":a.hasPenisBulge?c=60>a.genderValueCorrected?
- c+"man":c+"trap":a.hasVagina&&(c+="woman");return c}static getPlayerDescription(){let a=new Say;a.add("You are ");let b=WorldState.player;var c=0<b.getParts(HumanoidPenis).length,d=0<b.getParts(HumanoidVagina).length;c&&d?a.add("hermaphrodite"):c?a.add("male"):a.add("female");a.add(". You are presenting as ",new SayAn,b.getShortestDescription()+". ");a.add(Attributes.GenderIdentity.getDescription(b.getStat(Attributes.GenderIdentity)));d=b.getSluttiness();var e=b.getBulges();c=1-b.uncoveredSlots.length/
- Humanoid.SLOT_SLOT_COUNT;a.add(" ",b.getPart(HumanoidSkin).getDescription());d.halfNaked?a.add(" You are almost naked. "):d.naked?a.add(" You are naked. "):.2>c&&a.add("You are not showing much of it, though.");a.add(Attributes.Degeneration.getDescription(b.getStat(Attributes.Degeneration)));a.add(Say.PARAGRAPH_BREAK);a.add(b.getPart(HumanoidArms).getDescription()," ");a.add(b.getPart(HumanoidHands).getDescription()," ");a.add(b.getPart(HumanoidFeet).getDescription()," ");var f=b.getPart(HumanoidPenis),
- g=b.getPart(HumanoidVagina);void 0!=f?(a.add("You have a ",f.getSizeText(),f.isFlaccid()?" flaccid ":" erect ",Say.COCK," between your legs"),!f.isBig()&&f.isGrower()&&f.isFlaccid()&&a.add(", which is okay, since you're a grower, not a shower"),f.isUncovered()&&(g=new OneOf(OneOf.PURELY_AT_RANDOM,...[", it is not covered by any clothing",", it is not covered by any clothes",", it is uncovered",", it is visible to all",", it is hanging freely"]),a.add(g.getOne())),g=b.getPart(HumanoidTesticles),HumanoidPenis.getSizeText(e.crotch)!=
- HumanoidPenis.getSizeText(f.getBulgeSize()+g.getBulgeSize())&&a.add(", but it looks like it's actually ",HumanoidPenis.getSizeText(e.crotch)," due to your clothing"),a.add(". ")):a.add(g.getDescription());a.add(" ");f=b.getPart(HumanoidBreasts);g=b.getPart(HumanoidButt);a.add("You have ",f.getSizeText()," breasts and a ",g.getSizeText()," butt.");e.breasts!=f.getSize()&&e.butt!=g.getSize()?a.add(" Your clothing makes your breasts look like they're actually ",HumanoidBreasts.getSizeText(e.breasts),
- " and make your butt appear ",HumanoidButt.getSizeText(e.butt),"."):e.breasts!=f.getSize()?a.add(" Your clothing makes your breasts look like they're actually ",HumanoidBreasts.getSizeText(e.breasts),"."):e.butt!=g.getSize()&&a.add(" Your clothing makes your butt appear ",HumanoidButt.getSizeText(e.butt),".");a.add(Say.PARAGRAPH_BREAK);f=Clothing.getSluttinessValueOn(b);e=Bodypart.getSluttinessValueOn(b);0<f.weight&&(f=f.value/f.weight,75<f?a.add('Your outfit can only be described as "whore-ish", it is far too nasty.'):
- 60<f?a.add("Your clothing are obviously making you look a bit naughty."):30>f&&30>d.sluttinessCorrected?a.add("Your clothing are definitely a bit prude."):15>f&&30>d.sluttinessCorrected&&a.add("Your outfit is so prude that it could be worn by a saint."));a.add(" ");0<e.weight&&(d=e.value/e.weight,75<d?(a.add("The way your body is makes you look like you were made purely for sex"),.7<c?a.add(", thankfully it's mostly covered"):.2>c&&a.add(", and you didn't even bother covering it up"),a.add(".")):
- 60<d?(a.add("Your body definitely has a lot of sex-appeal going on"),.7<c?a.add(", although it's covered"):.2>c&&a.add(", proudly displayed for all to see"),a.add(".")):30>d&&(a.add("You have very little sex-appeal, maybe you are a kitchen table?"),.7<c?a.add(" At least you covered it up."):.2>c&&a.add(" Maybe you could cover it up a bit.")));a.add(Say.PARAGRAPH_BREAK);a.add(new SayBold("Strength: "),Attributes.Strength.getDescription(b.getStat(Attributes.Strength)));a.add(Say.LINE_BREAK);a.add(new SayBold("Agility: "),
- Attributes.Agility.getDescription(b.getStat(Attributes.Agility)));a.add(Say.LINE_BREAK);a.add(new SayBold("Charm: "),Attributes.Charm.getDescription(b.getStat(Attributes.Charm)));a.add(Say.LINE_BREAK);a.add(new SayBold("Intelligence: "),Attributes.Intelligence.getDescription(b.getStat(Attributes.Intelligence)));return a}}Humanoid.SEX_MALE=0;Humanoid.SEX_FEMALE=1;Humanoid.SEX_HERM=2;Humanoid.SLOT_HAIR=0;Humanoid.SLOT_HEADGEAR=1;Humanoid.SLOT_FACE=2;Humanoid.SLOT_EARS=3;Humanoid.SLOT_EYES=4;
- Humanoid.SLOT_NOSE=5;Humanoid.SLOT_MOUTH=6;Humanoid.SLOT_NECK=7;Humanoid.SLOT_SHOULDERS=8;Humanoid.SLOT_ARMS=9;Humanoid.SLOT_HANDS=10;Humanoid.SLOT_FINGERS=11;Humanoid.SLOT_FINGERNAILS=12;Humanoid.SLOT_UPPER_CHEST=13;Humanoid.SLOT_MIDRIFF=14;Humanoid.SLOT_WAIST=15;Humanoid.SLOT_BACK=16;Humanoid.SLOT_HIPS=17;Humanoid.SLOT_CROTCH_FRONT=18;Humanoid.SLOT_CROTCH_BACK=19;Humanoid.SLOT_BUTT=20;Humanoid.SLOT_LEG_UPPER=21;Humanoid.SLOT_LEG_LOWER=22;Humanoid.SLOT_FEET=23;Humanoid.SLOT_FEET_NAILS=24;
- Humanoid.SLOT_BREASTS=25;Humanoid.SLOT_SLOT_COUNT=26;Humanoid.cacheInvalidationActionRule=new Rule({name:"Invalidate humanoid caches",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>{a.noun.actor.invalidateCaches()},conditions:(a)=>a.noun.actor instanceof Humanoid});ActionWear.carry.addRule(Humanoid.cacheInvalidationActionRule);ActionRemove.carry.addRule(Humanoid.cacheInvalidationActionRule);var WorldState;
- (function(a){function b(){let b=2*a.player.getStat(Attributes.Intelligence),c=1*a.player.getSkill(Skills.Survival);return b+c}function c(){for(;f.length>b();)f.pop()}var d=0,e=0;a.player=new Humanoid({isMale:!0});a.player.description=Humanoid.getPlayerDescription;var f=[],g=[];a.RememberingRoomRulebook=new Rulebook("Remembering Room something");a.isTurnWaiting=function(){return d<e};a.incrementWorldTurn=function(){d++};a.incrementPlayerTurn=function(){e++};a.getCurrentTurn=function(){return e};a.setCurrentTurn=
- function(a){d=e=a};a.RememberingRoomInList=a.RememberingRoomRulebook.createAndAddRule({name:"Is room listed in remembered rooms?",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_LOW,code:(a)=>{if(-1!=f.indexOf(a.noun)||-1!=g.indexOf(a.noun))return!0}});a.RememberingRoomInMap=a.RememberingRoomRulebook.createAndAddRule({name:"Is room shown on a map?",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_LOWEST,code:(b)=>{let c=Thing.CarryRelation.getRightType(a.player,MapNote);for(let a=
- 0;a<c.length;a++)if(c[a].contains(b.noun))return!0}});a.isRoomRemembered=function(b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){return 1==(yield a.RememberingRoomRulebook.execute({noun:b}))})};a.getRememberedRooms=function(){return f};a.getMaximumRememberedRooms=b;a.truncateRooms=c;a.rememberRoom=function(...a){a.forEach((a)=>{if(a instanceof Room){let b=f.indexOf(a);-1!=b&&f.splice(b,1);f.unshift(a)}});c()};a.saveState=function(){return{Things:{carried:[],worn:[],wielded:[]}}}})(WorldState||
- (WorldState={}));
- class Region{constructor(a){this.name=a}place(...a){a.forEach((a)=>{a instanceof Room?Region.RegionRoom.setRelation(this,a):Region.RegionRegion.setRelation(this,a)})}getRooms(){let a=Region.RegionRoom.getRight(this);Region.RegionRegion.getRight(this).forEach((b)=>{Region.RegionRoom.getRight(b).forEach((b)=>{a.push(b)})});return a}containsRoom(a){return Region.RegionRoom.getLeft(a)==this?!0:void 0!=Region.RegionRegion.getLeft(this)?-1!=this.getRooms().indexOf(a):!1}contains(a){a=a.getRoom();return void 0==
- a?!1:-1!=Region.InRelation.getAllLeft(a).indexOf(this)}}Region.RegionRoom=new RelationOneToMany;Region.RegionRegion=new RelationOneToMany;Region.InRelation=new RelationHandlerStrictOneToMany(Region.RegionRegion,Region.RegionRoom);
- class Shuffler{constructor(a,b){this.position=0;this.rng=void 0==b?Math.random:b;this.array=a}restart(){this.position=0}getOne(){if(!(this.position>=this.array.length)){var a=Math.floor(this.rng()*(this.array.length-this.position))+this.position,b=this.array[this.position];this.array[this.position]=this.array[a];this.array[a]=b;return this.array[this.position++]}}getShuffled(){let a=this.array.slice(0);for(var b=a.length,c,d;b;)d=Math.floor(this.rng()*b--),c=a[b],a[b]=a[d],a[d]=c;return a}}
- (function(a){a.PickShiny=AI.rules.createAndAddRule({name:"Pick Shinies",firstPriority:a.PRIORITY_ACTING_ON_PLACE,conditions:(a)=>a.noun.AI.picksShinies,code:(a)=>{a=a.noun;let b=a.getRoom().getContainedAndVisibleTo(a);if(0<b.length)for(let c=0;c<b.length;c++)if(!b[c].fixedInPlace&&b[c].getShiny())return new ActionTake(a,b[c])}})})(AIRules||(AIRules={}));
- (function(a){a.Wander=AI.rules.createAndAddRule({name:"Wander",firstPriority:a.PRIORITY_ACTING_ON_IDLE,conditions:(a)=>{a=a.noun;return a.AI.wanderer&&100*Math.random()>a.AI.wanderChance},code:(a)=>{a=a.noun;var b=a.getRoom();if(void 0!=a.AI.wandersOn){if(a.AI.wandersOn.containsRoom(b)){b=b.connections.slice();let c=[];for(let d=0;d<b.length;d++)void 0!=b[d]&&a.AI.wandersOn.containsRoom(b[d])&&c.push(d);b=(new Shuffler(c)).getOne();return new ActionGo(a,b)}b=a.AI.wandersOn.getRooms().filter((a)=>
- {if(a instanceof RoomRandom&&a.placed)return!0});b.sort((a,b)=>{a=a.getDistanceTo(b);return void 0!=a?-a:0});b=b.pop();return new ActionGo(a,b)}b=b.getConnectedDirection();return new ActionGo(a,b)}})})(AIRules||(AIRules={}));class ActionDrop extends Action{constructor(a,...b){super(a,...b);this.extraChecks.push(ActionDrop.check);this.extraCarries.push(ActionDrop.carry)}getCommandText(){return"drop "+(void 0!=this.getNoun(0)?this.getNoun(0).getPrintedName():"")}}ActionDrop.check=new Rulebook("Check Dropping");
- ActionDrop.carry=new Rulebook("Carry out Dropping");
- ActionDrop.check.addRule(new Rule({name:"Check Dropping - Are you Wearing it?",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun,c=b.actor,d=b.getNoun(0);if(Thing.WearRelation.getLeft(d)==c||Thing.WieldRelation.getLeft(d)==c){b.actor==WorldState.player&&b.say.add("(first taking off the ",d,")",Say.LINE_BREAK);let a=new ActionRemove(c,d);yield a.execute();b.say.add(a.say);if(Thing.WearRelation.getLeft(d)==c||Thing.WieldRelation.getLeft(d)==
- c)return!1;b.say.add(Say.LINE_BREAK)}})}));ActionDrop.check.addRule(new Rule({name:"Check Dropping - Do you have it??",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>{a=a.noun;let b=a.actor,c=a.getNoun(0);if(Thing.CarryRelation.getLeft(c)!=b)return b==WorldState.player&&a.say.add("You don't have it."),!1}}));
- ActionDrop.carry.addRule(new Rule({name:"Dropping - Place the noun on the floor",code:(a)=>{a=a.noun;let b=a.actor,c=a.getNoun(0);Thing.EnclosedRelation.unsetRight(c);b.getRoom().place(c);b==WorldState.player?a.say.add(new SayBold(a.getNoun(0).getPrintedName()+": "),"Dropped."):a.say.add(new SayThe,b," drops ",new SayThe,a.getNoun(0)," on the floor.")}}));
- Elements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule({name:"Hyperlink - Drop",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;Thing.CarryRelation.getLeft(a)!=WorldState.player&&Thing.WieldRelation.getLeft(a)!=WorldState.player&&Thing.WearRelation.getLeft(a)!=WorldState.player||Elements.HyperlinkHandler.addAvailableAction("Drop",new ActionDrop(WorldState.player,a))}}));
- Elements.InventoryHandler.LinkingThing.addRule(new Rule({name:"Inventory - Drop",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>{Elements.InventoryHandler.printThingLink("D",new ActionDrop(WorldState.player,a.noun))}}));class ActionTalk extends Action{constructor(a,...b){super(a,...b);this.extraChecks.push(ActionTalk.check);this.extraCarries.push(ActionTalk.carry)}getCommandText(){return"talk to "+(void 0!=this.getNoun(0)?this.getNoun(0).getPrintedName():"")}}
- ActionTalk.PRIORITY_SITUATION_DIALOGUE=9;ActionTalk.PRIORITY_POSSESSION_DIALOGUE=7;ActionTalk.PRIORITY_LOCATION_DIALOGUE=5;ActionTalk.PRIORITY_COMMON_DIALOGUE=3;ActionTalk.PRIORITY_GLOBAL_DIALOGUE=1;ActionTalk.check=new Rulebook("Check Talking");ActionTalk.carry=new Rulebook("Carry out Talking");
- ActionTalk.defaultCarryTalkingRule=ActionTalk.carry.createAndAddRule({name:"Talking - Doesn't want to talk",firstPriority:-1,priority:-1,code:(a)=>{a=a.noun;let b=a.getNoun(0);a.say=b instanceof Person?new Say("It doesn't look like ",new SayHeSheIt(b)," wants to talk."):new Say("How are you going to talk to that?")}});
- Elements.HyperlinkHandler.HyperlinkingRulebook.addRule(new Rule({name:"Hyperlink - Talk",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;a instanceof Person&&a.getRoom()==WorldState.player.getRoom()&&Elements.HyperlinkHandler.addAvailableAction("Talk",new ActionTalk(WorldState.player,a))}}));
- class ActionWait extends Action{constructor(a,...b){super(a,...b);this.requiresTurn=!0;this.requiresVisibility=this.requiresNoun=!1;this.extraChecks.push(ActionWait.check);this.extraCarries.push(ActionWait.carry)}getCommandText(){return"wait"}}ActionWait.check=new Rulebook("Check Waiting");ActionWait.carry=new Rulebook("Carry out Waiting");ActionWait.carry.addRule(new Rule({name:"Print waiting message",code:(a)=>{a.noun.actor==WorldState.player&&a.noun.say.add("You wait.")}}));
- Elements.HyperlinkHandler.CommonActionsRulebook.addRule(new Rule({name:"Add Wait Command Rule",firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_MEDIUM,code:(a)=>{Elements.HyperlinkHandler.addCommonAction("Wait",new ActionWait(WorldState.player))}}));class BranchingOption{constructor(a,b){this.previouslyPicked=!1;this.say=a;this.appearCondition=b}}
- class BranchingDialogue{constructor(...a){this.options=[];this.addOptions(...a)}addOptions(...a){this.options.push(...a);arrayUnique(this.options)}getChosenOption(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=[];for(let c=0,d=a.options[c];void 0!=d;d=a.options[++c])(void 0==d.appearCondition||"function"==typeof d.appearCondition&&d.appearCondition()||d.appearCondition)&&b.push(d);let c=[];for(var d=0;d<b.length;d++){let a=b[d],f=["choice"];a.previouslyPicked&&
- f.push("picked");c.push((yield a.say.getHTML("p",f))[0])}d=new Promise((b,c)=>{a.resolve=b});Controls.KeyHandler.reset();for(let d=0,f=c[d];void 0!=f;f=c[++d])Controls.KeyHandler.applyCode(f,Controls.KeyHandler.getFirstKeyCode()),f.addEventListener("click",(c)=>{b[d].previouslyPicked=!0;a.resolve(b[d]);c.preventDefault()});yield Elements.CurrentTurnHandler.print(...c);d=yield d;yield Elements.CurrentTurnHandler.unprint(...c);return d})}}var NodeType;
- (function(a){a[a.Node=0]="Node";a[a.Tree=1]="Tree";a[a.Text=2]="Text";a[a.Set=3]="Set";a[a.Choice=4]="Choice";a[a.Branch=5]="Branch"})(NodeType||(NodeType={}));class DialogueNode{constructor(a){this.type=NodeType.Node;this.id=a}setName(a){this.name=a}setNext(a){this.next=a}getNext(){return this.next}setChoices(a){this.choices=a}hasChoices(){return void 0!=this.choices&&0<this.choices.length}}
- class DialogueBranch extends DialogueNode{constructor(){super(...arguments);this.type=NodeType.Branch;this.variable=()=>!1;this.branchIds=[];this.branchConditions=[]}setVariable(a){this.variable=a}addBranch(a,b){this.branchIds.push(a);this.branchConditions.push(b)}getNext(){let a=this.variable();for(let b=0;b<this.branchIds.length;b++)if(this.branchConditions[b]()==a)return this.branchIds[b];return this.next}}
- class DialogueText extends DialogueNode{constructor(){super(...arguments);this.type=NodeType.Text}setSay(a){this.sayCreator=a}getSay(){return this.sayCreator()}}class DialogueChoice extends DialogueText{constructor(){super(...arguments);this.type=NodeType.Choice;this.conditions=()=>!0}isAvailable(){return this.conditions()}setConditions(a){this.conditions=a}}class DialogueNodeTree extends DialogueNode{constructor(){super(...arguments);this.type=NodeType.Tree}setTree(a){this.tree=a}}
- class DialogueSet extends DialogueNode{constructor(){super(...arguments);this.type=NodeType.Set}setFunction(a){this.code=a}run(){return this.code()}}
- class DialogueTree{constructor(a){this.nodes={};this.startNode=void 0;this.repeatChoices=!0;this.id=a}addNode(a){this.nodes[a.id]=a;a.type==NodeType.Node&&(this.nodes[a.name]=a)}addStartNode(a){this.addNode(a);this.startNode=a}getNode(a){return this.nodes[a]}getNext(a){return void 0!=a.getNext()?this.getNode(a.getNext()):void 0}setRepeatChoices(a){this.repeatChoices=a}execute(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){console.debug(Rulebook.getIndentation()+"[DialogueTree] Running "+
- b.id);Rulebook.increaseIndentation(b);let c;c=void 0==a?b.startNode:b.getNode(a);if(void 0==c)Elements.CurrentTurnHandler.printAsError("Unable to start dialogue "+b.id+": A starting node could not be found.");else{for(var d;void 0!=c;){let a=yield b.processNode(c,d);d=c;c=a}Rulebook.decreaseIndentation()}})}processNode(a,b){const c=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){console.debug(Rulebook.getIndentation()+"["+a.type+"] "+a.id);Rulebook.increaseIndentation(a);var b=
- a.hasChoices();if(a.type==NodeType.Tree)yield a.tree().execute();else if(a.type==NodeType.Text){var e=a.getSay();Elements.CurrentTurnHandler.printAsContent(e)}else a.type==NodeType.Set&&(e=a.run(),e instanceof Promise&&(yield e));if(b){var f=new BranchingDialogue;b=a.choices;e=[];for(let a=0;a<b.length;a++){var g=c.getNode(b[a]);g=new BranchingOption(g.getSay(),g.isAvailable());e.push(g);f.addOptions(g)}f=yield f.getChosenOption();b=b[e.indexOf(f)];e=c.getNode(b);c.repeatChoices&&(f=new Say(new SayBold(" > ",
- e.getSay())),c.lastPrintedChoice=yield Elements.CurrentTurnHandler.getSayElementsAsContent(f),yield Elements.CurrentTurnHandler.print(...c.lastPrintedChoice));console.debug(Rulebook.getIndentation()+"[Choice] Picked "+b);console.debug(Rulebook.getIndentation()+"[Choice] Going to "+e.getNext());Rulebook.increaseIndentation(b);Rulebook.decreaseIndentation();Rulebook.decreaseIndentation();return c.getNext(e)}Rulebook.decreaseIndentation();return c.getNext(a)})}unprintLastChoice(){Elements.CurrentTurnHandler.unprint(...this.lastPrintedChoice)}}
- var DialogueTrees;
- (function(a){a.findUnusedTrees=function(){var b=document.getElementById("appCode").innerHTML,c={};let d=[];for(let k in a)if("findUnusedTrees"!=k){var e=b;var f="DialogueTrees."+k;e+="";f+="";if(0>=f.length)e=e.length+1;else{for(var g=0,h=0,l=f.length;;)if(h=e.indexOf(f,h),0<=h)++g,h+=l;else break;e=g}--e;0<e?c[k]=e:d.push(k)}for(let a in c)b=c[a],console.debug("[DialogueUsage] "+a+" is referenced "+b+(1<b?" times.":" time."));for(c=0;c<d.length;c++)console.error("[DialogueUsage] "+d[c]+" is never referenced and will not appear in-game.")}})(DialogueTrees||
- (DialogueTrees={}));
- class RoomRandom extends Room{constructor(a){super(a);this.connectableOn=[Direction.NORTH,Direction.SOUTH,Direction.EAST,Direction.WEST];this.randomizable=!0;this.placed=!1;this.extraConnectionChance=this.appearChance=75;this.backgroundImage="tomato"}getBackgroundClass(){return this.isImageDefined()?this.backgroundImage:"tomato"}isImageDefined(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a].rules||document.styleSheets[a].cssRules,c;for(c in b)if("string"==typeof b[c].selectorText&&
- b[c].selectorText=="."+this.backgroundImage)return!0}return!1}isConnectableOn(a){return-1!=this.connectableOn.indexOf(a)}getAnyDirection(a){let b=new Shuffler(this.connectableOn);for(var c=b.getOne();void 0!=c;c=b.getOne()){let b=OppositeDirection[Direction[c]];var d=a.map.getCoordinates(a.otherRoom);d=Room.shift(d,b);c={otherRoom:a.otherRoom,otherRoomDirection:b,trickyRoomDirection:c,map:a.map,region:a.region,x:d[0],y:d[1]};if(this.isPlaceable(c))return c}}isPlaceable(a){return this.isConnectableOn(a.trickyRoomDirection)&&
- a.map.isFree(a.x,a.y)&&void 0!=a.otherRoom&&a.otherRoom.isConnectableOn(a.otherRoomDirection)?void 0!=this.trickyCode?this.trickyCode(a):!0:!1}getDistanceTo(a){let b=this.lastMap.getCoordinates(this);a=this.lastMap.getCoordinates(a);if(void 0!=b&&void 0!=a)return Math.abs(b[0]-a[0])+Math.abs(b[1]-a[1])}findPathTo(a,b){b=void 0==b?()=>!0:b;let c=this.lastMap,d=c.getCoordinates(a),e=[],f=(a,c,f)=>{let g=[];for(let h=0;h<a.connections.length;h++){let k=a.connections[h];if(void 0!=k&&-1==e.indexOf(k)&&
- b(k)){let a=Room.shift([c,f],h);g.push([k,a,Math.abs(d[0]-a[0])+Math.abs(d[1]-a[1])])}}return g.sort((a,b)=>a[2]-b[2])},g={length:c.getRoomCount()},h=g,l=[],k=(b)=>{var c=b[0];l.push(b);if(c==a)g.length>=l.length&&(g=l.slice(0));else if(g.length>l.length){e.push(c);b=f(c,b[1][0],b[1][1]);for(c=0;c<b.length;c++)l.length+1<g.length&&k(b[c]);e.pop()}l.pop()};k([this,c.getCoordinates(this)]);return g!=h?g:void 0}getBestDirectionTo(a,b){a=this.findPathTo(a,b);if(void 0!=a)return 1==a.length?void 0:this.connections.indexOf(a[1][0])}getAStarPathTo(a,
- b){b=void 0!=b?b:()=>!0;let c=(a,b)=>Math.abs(a[0]-b[0])+Math.abs(a[1]-b[1]);var d=(a)=>{let d=[];for(let e=0;e<a.room.connections.length;e++)if(void 0!=a.room.connections[e]&&-1==m.indexOf(a.room.connections[e])&&b(a.room.connections[e])){let b=Room.shift(a.coordinates,e);d.push({room:a.room.connections[e],coordinates:b,distance:c(b,f.coordinates)});m.push(a.room.connections[e])}return d};let e=()=>{let a=0;for(let b=1;b<g.length;b++)g[b][g[b].length-1].distance<g[a][g[a].length-1].distance&&(a=
- b);return a},f={room:a,coordinates:this.lastMap.getCoordinates(a),distance:0};a=this.lastMap.getCoordinates(this);let g=[[{room:this,coordinates:a,distance:c(a,f.coordinates)}]];a=[];let h=this.lastMap.getRoomCount(),l;var k=0;let m=[this];for(;0<g.length;){k=g.splice(k,1)[0];if(0==k[k.length-1].distance){d=a.push(k);k.length<h&&(h=k.length,l=d-1);break}else{let a=d(k[k.length-1]);for(let b=0;b<a.length;b++)g.push(k.concat([a[b]]))}for(k=g.length-1;0<=k;k--)g[k].length>=h&&g.splice(k,1);k=e()}return a[l]}getAStarBestDirectionTo(a,
- b){a=this.getAStarPathTo(a,b);if(void 0!=a)return 1==a.length?void 0:this.connections.indexOf(a[1].room)}getConnectedDirection(){let a=new Shuffler(Room.DIRECTIONS);for(let b=a.getOne();void 0!=b;b=a.getOne())if(void 0!=this.connections[b])return b}static getActive(a){}}
- class RoomRandomMap{constructor(){this.positionTable={};this.roomMap=new Map;this.highestY=this.highestX=this.lowestY=this.lowestX=0;this.limitsInvalid=!1}emptyCache(){this.availableConnections=[];Room.DIRECTIONS.forEach(()=>{this.availableConnections.push([])});this.rooms=0}getAvailableConnections(){return this.availableConnections.reduce((a,b,c,d)=>a+b.length,0)}removeFromCache(a,b){b=this.availableConnections[b];for(let c=0,d=b[c];void 0!=d;d=b[++c])if(d.x==a.x&&d.y==a.y){b.splice(c,1);break}}addToCache(a,
- b){b=this.availableConnections[b];for(let c=0,d=b[c];void 0!=d;d=b[++c])if(d.x==a.x&&d.y==a.y)return;b.push(a)}getAnyFromCache(a){a=this.availableConnections[a];if(0<a.length&&(a=a[Math.floor(Math.random()*a.length)],void 0!=a))return this.getRoom(a.x,a.y)}isFree(a,b){return void 0==this.positionTable[a]||void 0===this.positionTable[a][b]}block(a,b){this.isFree(a,b)&&(void 0==this.positionTable[a]&&(this.positionTable[a]={}),this.positionTable[a][b]=null,this.updateCacheOnPosition(a,b),this.updateLimits(a,
- b))}updateAllLimits(){this.lowestY=this.lowestX=this.highestY=this.highestX=0;for(let a in this.positionTable)for(let b in this.positionTable[a])void 0!=this.positionTable[a][b]&&null!=this.positionTable[a][b]&&this.updateLimits(parseInt(a),parseInt(b));this.limitsInvalid=!1}updateLimits(a,b){a>this.highestX&&(this.highestX=a);b>this.highestY&&(this.highestY=b);b<this.lowestY&&(this.lowestY=b);a<this.lowestX&&(this.lowestX=a)}map(a,b,c){void 0==this.positionTable[b]&&(this.positionTable[b]={});this.positionTable[b][c]=
- a;this.roomMap.set(a,[b,c]);this.updateCacheOnPosition(b,c);this.updateLimits(b,c);a.placed=!0;a.lastMap=this;this.rooms++}unmap(a,b){void 0!=this.positionTable[a]&&void 0!=this.positionTable[a][b]&&(this.roomMap.delete(this.positionTable[a][b]),delete this.positionTable[a][b],this.rooms--,this.updateCacheOnPosition(a,b),this.limitsInvalid=!0)}updateCacheOnPosition(a,b){let c=[a,b,0],d={x:a,y:b},e=!this.isFree(a,b),f=this.getRoom(a,b);Room.DIRECTIONS.forEach((a)=>{let b=OppositeDirection[Direction[a]];
- var g=Room.shift(c,a);let k={x:g[0],y:g[1]},m=!this.isFree(g[0],g[1]);g=this.getRoom(g[0],g[1]);void 0!=f?m?this.removeFromCache(d,a):f.isConnectableOn(a)&&this.addToCache(d,a):this.removeFromCache(d,a);void 0!=g?e?this.removeFromCache(k,b):g.isConnectableOn(b)&&this.addToCache(k,b):this.removeFromCache(k,b)})}getRoom(a,b){if(void 0!=this.positionTable[a]&&null!=this.positionTable[a][b])return this.positionTable[a][b]}getCoordinates(a){return this.roomMap.get(a)}getRoomCount(){return this.roomMap.size}getWidth(){return this.highestX-
- this.lowestX}getHeight(){return this.highestY-this.lowestY}getPreferredGrowth(){let a=this.getHeight()/this.getWidth();return.5>Math.abs(a-2.5)?RoomRandomMap.PREFERRED_GROWTH_ANY:2.5>a?RoomRandomMap.PREFERRED_GROWTH_VERTICAL:RoomRandomMap.PREFERRED_GROWTH_HORIZONTAL}static isDirectionPreferred(a,b){return b==RoomRandomMap.PREFERRED_GROWTH_ANY?!0:a==Direction.NORTH||a==Direction.SOUTH?b==RoomRandomMap.PREFERRED_GROWTH_VERTICAL:b==RoomRandomMap.PREFERRED_GROWTH_HORIZONTAL}}
- RoomRandomMap.PREFERRED_GROWTH_HORIZONTAL=0;RoomRandomMap.PREFERRED_GROWTH_VERTICAL=1;RoomRandomMap.PREFERRED_GROWTH_ANY=2;class ShufflerDirection extends Shuffler{constructor(a,b,c){super(a,c);this.runner=0;this.preferredGrowth=b;a=[];b=[];for(c=this.getOne();void 0!=c;c=this.getOne())RoomRandomMap.isDirectionPreferred(c,this.preferredGrowth)?a.push(c):b.push(c);this.directionsArray=a.concat(b)}getDirection(){return this.directionsArray[this.runner++]}}
- class RoomRandomFodder extends RoomRandom{constructor(a){super(a)}}class RegionRandom extends Region{constructor(a,b){super(a);this.randomized=!1;this.fodderRoomClass=RoomRandomFodder;this.placedRooms=[];this.map=void 0==b?new RoomRandomMap:b}randomize(){const a=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){a.randomized||(yield RegionRandom.rulebookRandomizeRegion.execute({noun:a}))})}}RegionRandom.rng=()=>Math.random();RegionRandom.rulebookRandomizeRegion=new Rulebook("Randomizing Random Region something");
- RegionRandom.rulebookPlaceRoom=new Rulebook("Placing Random Room something");RegionRandom.rulebookBeforePlaceRoom=new Rulebook("Before placing Random Room something");RegionRandom.rulebookAfterPlaceRoom=new Rulebook("After placing Random Room something");RegionRandom.ruleFirstRandomizeRegion=RegionRandom.rulebookRandomizeRegion.createAndAddRule({name:"Empty map cache to start randomizing region",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a.noun.map.emptyCache()}});
- RegionRandom.ruleBasicRandomizeRegion=RegionRandom.rulebookRandomizeRegion.createAndAddRule({name:"Randomize all unplaced, randomizable rooms in region something",code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=a.noun,c=new Shuffler(Region.InRelation.getAllRightTypes(b,RoomRandom).filter((a)=>a.randomizable&&!a.placed&&(a==WorldState.player.getRoom()||100*RegionRandom.rng()<=a.appearChance)),RegionRandom.rng);for(let a=c.getOne();void 0!=a;a=c.getOne()){for(;0<b.map.rooms&&
- 4>b.map.getAvailableConnections();){var d=new b.fodderRoomClass;let a={map:b.map,room:d,region:b};b.place(d);yield RegionRandom.rulebookBeforePlaceRoom.execute({noun:a});yield RegionRandom.rulebookPlaceRoom.execute({noun:a});yield RegionRandom.rulebookAfterPlaceRoom.execute({noun:a})}d={map:b.map,room:a,region:b};yield RegionRandom.rulebookBeforePlaceRoom.execute({noun:d});yield RegionRandom.rulebookPlaceRoom.execute({noun:d});yield RegionRandom.rulebookAfterPlaceRoom.execute({noun:d});a.placed||
- Elements.CurrentTurnHandler.printAsError(new Say("Was unable to place room ",a,". Game might be unplayable."))}})});
- RegionRandom.ruleAddExtraConnections=RegionRandom.rulebookRandomizeRegion.createAndAddRule({firstPriority:Rule.PRIORITY_LOWEST,name:"Add extra connections to rooms in region",code:(a)=>{let b=a.noun;Region.InRelation.getAllRightTypes(b,RoomRandom).filter((a)=>a.randomizable&&a.placed).forEach((a)=>{let c=b.map.getCoordinates(a),e=new Shuffler(a.connectableOn.slice(0),RegionRandom.rng);for(let d=e.getOne();void 0!=d&&100*RegionRandom.rng()<=a.extraConnectionChance;d=e.getOne())if(void 0==a.connections[d]){var f=
- Room.shift(c,d);f=b.map.getRoom(f[0],f[1]);void 0!=f&&f.randomizable&&f.isConnectableOn(OppositeDirection[Direction[d]])&&100*RegionRandom.rng()<=f.extraConnectionChance&&a.mapRoom(f,d)}})}});RegionRandom.rulePlaceFirstRoom=RegionRandom.rulebookPlaceRoom.createAndAddRule({name:"Placing First room something",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>{a=a.noun;if(a.map.isFree(0,0))return a.map.map(a.room,0,0),!0},conditions:(a)=>0==a.noun.map.rooms});
- RegionRandom.rulePlaceNonTrickyRoom=RegionRandom.rulebookPlaceRoom.createAndAddRule({name:"Placing non-tricky room something",firstPriority:Rule.PRIORITY_HIGH,code:(a)=>{a=a.noun;var b=a.map.getPreferredGrowth(),c=new ShufflerDirection(a.room.connectableOn,b);for(b=c.getDirection();void 0!=b;b=c.getDirection()){var d=OppositeDirection[Direction[b]];let e=a.map.getAnyFromCache(d);if(void 0!=e)return c=a.map.getCoordinates(e),d=Room.shift(c,d),a.room.mapRoom(e,b),a.map.map(a.room,d[0],d[1]),!0}},conditions:(a)=>
- void 0==a.noun.room.trickyCode});
- RegionRandom.rulePlaceTrickyRoom=RegionRandom.rulebookPlaceRoom.createAndAddRule({name:"Placing tricky room something",code:(a)=>{let b=a.noun;a=b.region.getRooms().filter((a)=>a instanceof RoomRandom&&a.placed);if(0==a.length)return Elements.CurrentTurnHandler.printAsError("Unable to place room "+b.room.getPrintedName()+": There are no rooms to connect to!"),!1;a=new Shuffler(a,RegionRandom.rng);for(var c=a.getOne();void 0!=c;c=a.getOne()){var d=b.room.getAnyDirection({region:b.region,map:b.map,
- otherRoom:c});if(void 0!=d)return b.room.mapRoom(c,d.trickyRoomDirection),b.map.map(b.room,d.x,d.y),!0}let e=(a,c)=>{var d={region:b.region,map:b.map,otherRoom:c};if(0==a)return b.room.getAnyDirection(d);d=new b.region.fodderRoomClass;var f=b.map.getPreferredGrowth();f=new ShufflerDirection(b.room.connectableOn,f);for(var g=f.getDirection();void 0!=g;g=f.getDirection()){var m=OppositeDirection[Direction[g]],n=b.map.getCoordinates(c);n=Room.shift(n,m);g={otherRoom:c,otherRoomDirection:m,trickyRoomDirection:g,
- map:b.map,region:b.region,x:n[0],y:n[1]};if(d.isPlaceable(g)){d.mapRoom(c,g.trickyRoomDirection);b.map.map(d,g.x,g.y);m=e(a-1,d);if(void 0!=m)return b.region.place(d),m;d.unmapRoom(g.trickyRoomDirection);b.map.unmap(g.x,g.y)}}};for(c=1;10>c;c++)for(a.restart(),d=a.getOne();void 0!=d;d=a.getOne())if(d=e(c,d),void 0!=d)return b.room.mapRoom(d.otherRoom,d.trickyRoomDirection),b.map.map(b.room,d.x,d.y),!0;Elements.CurrentTurnHandler.printAsError("Unable to place room "+b.room.getPrintedName()+": All attempts failed");
- return!1}});class SavedEvent extends StoredVariable{constructor(a){super(a);this.description=a.description;this.getValueDescription=a.valueDescription}getDescription(){return this.description}}let EVENT_ORC_CHIEF_KILLED=new SavedEvent({id:"EVENT_ORC_CHIEF_KILLED",description:"Describer whether the orc chief is alive or dead.",value:!1,valueDescription:(a)=>EVENT_ORC_CHIEF_KILLED.value?"The orc chief has been killed.":"The orc chief is alive."});
- class Dice{constructor(a){this.range=[0,0,1,1];this.minResult=0;this.testString=a}roll(a){let b=this.range.slice();10<=a?b.push(2,1):7<=a?b.push(1,1):4<=a&&b.push(1);let c=[];for(let d=0;d<a;d++)c.push(b[Math.floor(Math.random()*b.length)]);return c}static sum(a,b){return a+b}getSay(a){let b=a.reduce(Dice.sum);return new Say(new SayBold("[",this.testString,"] ")," = [",a.join("] ["),"]",1==a.length?"":" = "+b)}static testAgainstRoll(a,b){a=(new Dice(a.name)).roll(a.value);b=(new Dice(b.name)).roll(b.value);
- return a.reduce(Dice.sum)-b.reduce(Dice.sum)}static testAgainstDifficulty(a,b){return(new Dice(a.name)).roll(a.value).reduce(Dice.sum)-b}}
- class DiceCommon extends Dice{constructor(){super(...arguments);this.range=[-1,0,0,0,1,1,1];this.minResult=-1}static testAgainstRoll(a,b){a=(new DiceCommon(a.name)).roll(a.value);b=(new DiceCommon(b.name)).roll(b.value);return a.reduce(Dice.sum)-b.reduce(Dice.sum)}static testAgainstDifficulty(a,b){return(new DiceCommon(a.name)).roll(a.value).reduce(Dice.sum)-b}}
- class DiceDangerous extends Dice{constructor(){super(...arguments);this.range=[-2,-1,0,0,0,0,1,1,1,1];this.minResult=-2}static testAgainstRoll(a,b){a=(new DiceDangerous(a.name)).roll(a.value);b=(new DiceDangerous(b.name)).roll(b.value);return a.reduce(Dice.sum)-b.reduce(Dice.sum)}static testAgainstDifficulty(a,b){return(new DiceDangerous(a.name)).roll(a.value).reduce(Dice.sum)-b}}
- class Liquid extends Thing{constructor(a){super(a);a=void 0==a?{}:a;this.taste=void 0!=a.taste?a.taste:new OneOf(OneOf.ROTATING_RANDOM,"It goes easily through your throat with no particular taste.","You taste nothing as it softly slides through your tongue.")}static mix(a){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=yield Liquid.rulebookMixing.execute({noun:a});if(void 0!=b){let c=void 0!=b.quantityMultiplier?b.quantityMultiplier*a.liquidContents.length:a.liquidContents.length;
- a.liquidContents=Array(c);for(let d=0;d<c;d++)a.liquidContents[d]=b.result}})}static getMixtures(){if(Liquid.sortedMixtures)return Liquid.mixtures;Liquid.mixtures.sort((a,b)=>b.firstPriority<a.firstPriority?-1:a.firstPriority<b.firstPriority?1:b.priority<a.priority?-1:a.priority<b.priority?1:0);Liquid.sortedMixtures=!0;return Liquid.mixtures}static addMixture(a){Liquid.mixtures.push(a);Liquid.sortedMixtures=!1}}Liquid.rulebookMixing=new Rulebook("Mixing the liquid contents of something");
- Liquid.mixtures=[];Liquid.sortedMixtures=!1;
- Liquid.ruleDefaultMixing=Liquid.rulebookMixing.createAndAddRule({name:"Mixing through Mixtures",code:(a)=>{if(0!=a.noun.liquidContents.length)for(let d=0;d<Liquid.mixtures.length;d++){var b=Liquid.mixtures[d];let e=[],f=b.quantities.entries();for(var c=f.next();!c.done;c=f.next()){let b=c.value[0];c=c.value[1];let d=0;a.noun.liquidContents.forEach((a)=>{try{(a==b||"function"==typeof b&&(a instanceof b||b(a)))&&d++}catch(k){}});e.push(d/c)}if(e.every(function(a,b,c){return a===c[0]}))return b}}});
- class Scenery extends Thing{constructor(){super(...arguments);this.scenery=this.fixedInPlace=!0}}class OrcDebugger extends Humanoid{constructor(){var a=OrcDebugger.nameModifier.getOne();void 0==a&&(a=(OrcDebugger.counter++).toString());a+=" Orc";super({isMale:!0,name:a,unique:!0,description:"This is one extremely ugly fellow."});this.AI.wanderer=!0;this.AI.picksShinies=!0}}OrcDebugger.nameModifier=new Shuffler("Ugly Muscular Veiny Angry Sad Smart Agile Short Bulging Intense Smouldering".split(" "));
- OrcDebugger.counter=1;
- ActionTalk.carry.createAndAddRule({name:"Talking to the orc",firstPriority:ActionTalk.PRIORITY_GLOBAL_DIALOGUE,priority:ActionTalk.PRIORITY_COMMON_DIALOGUE,conditions:(a)=>a.noun.getNoun(0)instanceof OrcDebugger,code:(a)=>{a=a.noun.getNoun(0);0<Dice.testAgainstRoll({name:"Charm + 2",value:WorldState.player.getStat(Attributes.Charm)+2},{name:"Orc's wits + 2",value:a.getStat(Attributes.Intelligence)+2})?Elements.CurrentTurnHandler.printAsContent(new Say("You win!")):Elements.CurrentTurnHandler.printAsContent(new Say("You lose."));return!0}});
- class Semen extends Liquid{constructor(a,b){super(b);this.cummer=a}}var rooma=new RoomRandom("Room A");rooma.description=new Say("You are inside a box of metal painted blue. Your head almost touches the ceiling, making the room look smaller than it really is.",Say.LINE_BREAK,new SayIf(()=>Thing.InsideRoomRelation.getLeft(vase)==rooma||Thing.InsideRoomRelation.getLeft(urn)==rooma," Still, there are some things thrown about."));rooma.place(WorldState.player);
- let paddedBra=new Clothing({name:"Padded Bra",unique:!0});paddedBra.breastPadding=3;paddedBra.slots=[Humanoid.SLOT_BREASTS];let paddedUnderwear=new Clothing({name:"Padded Underwear",unique:!0});paddedUnderwear.crotchPadding=15;paddedUnderwear.slots=[Humanoid.SLOT_CROTCH_BACK,Humanoid.SLOT_CROTCH_FRONT];let player=WorldState.player;WorldState.player=player;var vase=new Thing({name:"Vase"});vase.description=new Say("This is an ornamental vase that'd look very nice on your lap. Why? Who knows.");rooma.place(vase);
- let mapOfTest=new MapNote({name:"Map of this Region",description:"This is a simple map showing all the rooms here.",unique:!0});rooma.place(mapOfTest);let urn=new Thing({unique:!0,name:"Urn of Dreams",image:"image001"});urn.description=new Say("This appears to be a simple, black urn containing the ashes of your dreams.");rooma.place(urn);var roomb=new RoomRandom("Room B");roomb.place(vase);let frillyPouch=new CoinPouch({name:"Frilly Pouch",description:new Say("This is a very gay little pink pouch full of little hearts.")});
- frillyPouch.addCoins(502);rooma.place(frillyPouch);let bigSack=new CoinPouch({name:"Big Sack"});bigSack.addCoins(100);rooma.place(bigSack);let region=new RegionRandom("Test Region");region.place(rooma,roomb);for(let a=1;30>a;a++){let b=new RoomRandom("Room "+a.toString());region.place(b)}mapOfTest.addRegion(region);let southestRoom=new RoomRandom("Southest Room");region.place(southestRoom);southestRoom.appearChance=100;southestRoom.backgroundImage="bloo";
- southestRoom.trickyCode=(a)=>{let b=[a.x,a.y];for(let c=0;c<Room.DIRECTIONS.length;c++){let d=Room.DIRECTIONS[c];if(d!=Direction.NORTH){let c=Room.shift(b,d);if(!a.map.isFree(c[0],c[1]))return!1;c=Room.shift(c,d);if(!a.map.isFree(c[0],c[1]))return!1}}return!0};
- RegionRandom.rulebookAfterPlaceRoom.addRule(new Rule({name:"After placing the southest room",code:(a)=>{a=a.noun;let b=a.map.getCoordinates(a.room);if(void 0!=b)for(let c=0;c<Room.DIRECTIONS.length;c++){let d=Room.DIRECTIONS[c];if(d!=Direction.NORTH){let c=Room.shift(b,d);a.map.block(c[0],c[1]);c=Room.shift(c,d);a.map.block(c[0],c[1])}}},conditions:(a)=>a.noun.room==southestRoom}));Thing.CarryRelation.setRelation(WorldState.player,mapOfTest);
- PlayBegins.rulebook.addRule(new Rule({name:"randomize region",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield region.randomize()})}));
- RegionRandom.rulebookRandomizeRegion.addRule(new Rule({name:"Add room A and B to region",firstPriority:Rule.PRIORITY_HIGHEST,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield RegionRandom.rulebookPlaceRoom.execute({noun:{map:region.map,room:rooma,region}}).then();yield RegionRandom.rulebookPlaceRoom.execute({noun:{map:region.map,room:roomb,region}}).then()}),conditions:(a)=>a.noun==region}));
- function getPath(a,b){console.debug("The best path from "+a.getPrintedName()+" to "+b.getPrintedName()+" is:");let c;c=performance.now();a=a.bestDirectionTo(b);b=performance.now();void 0!=a?console.debug(DirectionNames[Direction[a]]):console.debug("There is no path.");console.debug("Call to doSomething took "+(b-c)+" milliseconds.")}let wanderRegion=new RegionRandom("OrcableRegion");wanderRegion.place(rooma,roomb);region.place(wanderRegion);let rooms=region.getRooms(),shuffler=new Shuffler(rooms);
- for(let a=0;0>a;a++)AI.rules.createAndAddRule({name:"Pick Shinies",firstPriority:AIRules.PRIORITY_ACTING_ON_PLACE,conditions:(b)=>b.noun.AI.picksShinies,code:(b)=>{b=b.noun;let c=b.getRoom().getContainedAndVisibleTo(b);if(0<c.length)for(let a=0;a<c.length;a++)if(!c[a].fixedInPlace&&c[a].getShiny())return new ActionTake(b,c[a])}});for(let a=0;10>a;a++){let a=new OrcDebugger;a.AI.wanderer=!0;a.AI.picksShinies=!0;a.AI.wandersOn=wanderRegion;(new Shuffler(region.getRooms())).getOne().place(a)}
- (function(a){a.CreationIntro=function(){let a=new DialogueTree("CreationIntro");var c=new DialogueNode("ae981322-9151-49c8-a889-94455db7c262");c.setNext("81582dea-ba27-4baa-8df2-a77fbb5ed9ef");a.addStartNode(c);c=new DialogueText("f892db48-56e7-4d0f-b479-a82a848ff1b8");c.setSay(()=>new Say(Say.CENTERED,new SayImage("introLogo"),Say.LINE_BREAK,new SayItalic("The Obelisk is an adult interactive fiction game set in a post-apocalyptic world ravaged by a magical structure.")));c.setNext("f72bf099-bae2-49df-9433-c9c3ec6a020d");
- a.addNode(c);c=new DialogueText("f72bf099-bae2-49df-9433-c9c3ec6a020d");c.setSay(()=>new Say("As you approach the Obelisk, many dreams and nightmares will become reality as it attempts to dissuade you from getting too close, with the intensity increasing the closer you get to your objective.",Say.PARAGRAPH_BREAK,"Ultimately, the Obelisk wishes you no harm, for it is better to have you around as a protector than as a dead enemy, so the Obelisk will attempt to give you exactly what you want deep in your heart, trying to make you completely satisfied so that you no longer wish for the Obelisk's destruction or become unable to continue your quest. Of course, what your heart wants is not necessarily what you think it wants.",
- Say.PARAGRAPH_BREAK,"Orcs, the most common creature to come out of the Obelisk, are nothing more than humans warped by their own desire for unbridled violence. What will the Obelisk do to you?",Say.PARAGRAPH_BREAK,"On the following screens, you will define who you will be in this story. Please confirm carefully, as there is no turning back."));c.setNext("66d4b27a-ff40-4a8e-a749-2b5e8237695a");a.addNode(c);c=new DialogueSet("81582dea-ba27-4baa-8df2-a77fbb5ed9ef");c.setFunction(()=>{Elements.startMenu()});
- c.setNext("f892db48-56e7-4d0f-b479-a82a848ff1b8");a.addNode(c);c=new DialogueSet("0b4fec87-a2b0-4e3b-81ed-a4150f94fc10");c.setFunction(()=>{Elements.endMenu()});a.addNode(c);c=new DialogueSet("66d4b27a-ff40-4a8e-a749-2b5e8237695a");c.setFunction(()=>Elements.waitForAnyKey());c.setNext("0b4fec87-a2b0-4e3b-81ed-a4150f94fc10");a.addNode(c);return a}()})(DialogueTrees||(DialogueTrees={}));
- (function(a){a.LOAD_FAILED=!1;a.CONTINUE_FAILED=!1;a.IntroMenuRule=a.rulebook.createAndAddRule({name:"Intro Menu Rule",firstPriority:Rule.PRIORITY_LOWEST,code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield DialogueTrees.IntroMenu.execute()})})})(PlayBegins||(PlayBegins={}));
- (function(a){a.IntroMenu=function(){let a=new DialogueTree("IntroMenu");var c=new DialogueNode("b018bb28-4efc-493b-ac37-31634c4e6406");c.setNext("f448e718-9d24-4191-9913-ccc36d97c4c0");a.addStartNode(c);c=new DialogueChoice("3b8c8bcb-0ac8-40dc-9f62-4abbde0d0f7f");c.setSay(()=>new Say("Start Game"));c.setNext("719e71dd-9989-4015-93af-9fb7096002c1");a.addNode(c);c=new DialogueChoice("53710087-4002-41b7-b089-cadabedbcafd");c.setSay(()=>new Say("Load from file"));c.setNext("f25f6525-dad6-45d7-a391-246c1b02b569");
- a.addNode(c);c=new DialogueChoice("b4593a36-ca83-4afc-b01b-e71344ca6e1f");c.setSay(()=>new Say("Settings"));c.setNext("d4a379b5-06c9-4fca-a25c-b1a31b6bf93d");a.addNode(c);c=new DialogueChoice("4c5032a5-5509-4a00-b8c7-788e7ddbf17d");c.setSay(()=>new Say("About"));c.setNext("6b3f385b-8283-4635-9c73-e2303d77642d");a.addNode(c);c=new DialogueNode("674841a6-3752-4c81-977d-19e111536203");c.setName("2");c.setChoices(["3b8c8bcb-0ac8-40dc-9f62-4abbde0d0f7f","53710087-4002-41b7-b089-cadabedbcafd","4c5032a5-5509-4a00-b8c7-788e7ddbf17d",
- "b4593a36-ca83-4afc-b01b-e71344ca6e1f","a55f46fa-98a9-4dff-9f1c-4f88c18ce8dd"]);a.addNode(c);c=new DialogueText("bc32e411-3c54-4747-ad79-506fc5a9d6c9");c.setSay(()=>new Say(Say.CENTERED,new SayImage("introLogo"),Say.LINE_BREAK,new SayItalic("The Obelisk is an adult interactive fiction game set in a post-apocalyptic world ravaged by a magical structure.")));c.setNext("36da9ea6-909c-4c0c-94d1-a17fef44452d");a.addNode(c);c=new DialogueText("36da9ea6-909c-4c0c-94d1-a17fef44452d");c.setSay(()=>new Say("A sleek, black obelisk appeared, monsters pouring from it, threatening the world. Many tried to reach the obelisk, only to return changed - monstrous. Civilization was unable to cope with the creatures and humanity soon returned to its old, tribal ways, humans becoming rarer with each passing day. Centuries have passed and technology is now scarce, with people leading simpler lives in small settlements.",
- Say.PARAGRAPH_BREAK,"You were born in the ashes of the old world, living in isolation as you and your fellow men attempt to stay safe from the evils of The Obelisk. ",Say.PARAGRAPH_BREAK,"Now, fate has decided you must go, reach The Obelisk and destroy it. Will you succeed in stopping it, or will you lose yourself to all the changes it will bring to you?"));c.setNext("674841a6-3752-4c81-977d-19e111536203");a.addNode(c);c=new DialogueNode("9f11871f-eebd-4b9a-b3db-ed9be8cf78e7");c.setName("1");c.setNext("9eeb2100-917d-41fd-b756-6d3b80e92463");
- a.addNode(c);c=new DialogueBranch("5d1dfb86-abd9-4ad6-bf07-8ced5476e401");c.setVariable(()=>PlayBegins.LOAD_FAILED);c.addBranch("415dc32a-1549-429d-9ac4-8cd1b4c92c14",()=>!0);c.setNext("f82fc177-b4bd-4f06-b7ab-216259e056a5");a.addNode(c);c=new DialogueSet("f82fc177-b4bd-4f06-b7ab-216259e056a5");c.setFunction(()=>{Elements.endMenu()});a.addNode(c);c=new DialogueSet("9eeb2100-917d-41fd-b756-6d3b80e92463");c.setFunction(()=>{Elements.clearMainScreen()});c.setNext("bc32e411-3c54-4747-ad79-506fc5a9d6c9");
- a.addNode(c);c=new DialogueNode("415dc32a-1549-429d-9ac4-8cd1b4c92c14");c.setNext("1");a.addNode(c);c=new DialogueSet("f448e718-9d24-4191-9913-ccc36d97c4c0");c.setFunction(()=>{Elements.startMenu();a.setRepeatChoices(!1)});c.setNext("9f11871f-eebd-4b9a-b3db-ed9be8cf78e7");a.addNode(c);c=new DialogueChoice("ef9253b9-5c24-46cc-8e2d-5562a1544f07");c.setSay(()=>new Say(SaveHandler.getSayForSlot(0)));c.setNext("9594cf06-6062-4952-b378-6aedaafe2951");a.addNode(c);c=new DialogueChoice("82c512c6-0115-4d72-a413-5728a623f04b");
- c.setSay(()=>new Say(SaveHandler.getSayForSlot(1)));c.setNext("fe95cfb3-b9f5-4b12-83aa-94d26e5bcac0");a.addNode(c);c=new DialogueChoice("7315835a-4d95-4377-828c-8a4ca7e49f87");c.setSay(()=>new Say(SaveHandler.getSayForSlot(2)));c.setNext("dc884974-7bb2-436f-b3a4-cdf8550bd494");a.addNode(c);c=new DialogueChoice("50afd6f8-87ce-49bf-b689-4819bc5dc8e7");c.setSay(()=>new Say(SaveHandler.getSayForSlot(3)));c.setNext("62f5ea88-c6f0-4469-87f2-ea3b37638509");a.addNode(c);c=new DialogueChoice("d79e9955-f81e-4ac9-8246-a02b0bd49dae");
- c.setSay(()=>new Say(SaveHandler.getSayForSlot(4)));c.setNext("ee4ecd8b-59e2-43a6-8150-8a835d6eeae1");a.addNode(c);c=new DialogueNode("719e71dd-9989-4015-93af-9fb7096002c1");c.setName("SlotChoices");c.setChoices("ef9253b9-5c24-46cc-8e2d-5562a1544f07 82c512c6-0115-4d72-a413-5728a623f04b 7315835a-4d95-4377-828c-8a4ca7e49f87 50afd6f8-87ce-49bf-b689-4819bc5dc8e7 d79e9955-f81e-4ac9-8246-a02b0bd49dae 9483a087-04d0-48dd-884f-946930771b95 defe0f4c-4452-40f3-aff1-ba076263fcbc".split(" "));a.addNode(c);c=new DialogueSet("9594cf06-6062-4952-b378-6aedaafe2951");
- c.setFunction(()=>{SaveHandler.setSlot(0)});c.setNext("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");a.addNode(c);c=new DialogueSet("fe95cfb3-b9f5-4b12-83aa-94d26e5bcac0");c.setFunction(()=>{SaveHandler.setSlot(1)});c.setNext("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");a.addNode(c);c=new DialogueSet("dc884974-7bb2-436f-b3a4-cdf8550bd494");c.setFunction(()=>{SaveHandler.setSlot(2)});c.setNext("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");a.addNode(c);c=new DialogueSet("62f5ea88-c6f0-4469-87f2-ea3b37638509");c.setFunction(()=>
- {SaveHandler.setSlot(3)});c.setNext("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");a.addNode(c);c=new DialogueSet("ee4ecd8b-59e2-43a6-8150-8a835d6eeae1");c.setFunction(()=>{SaveHandler.setSlot(4)});c.setNext("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");a.addNode(c);c=new DialogueSet("f25f6525-dad6-45d7-a391-246c1b02b569");c.setFunction(()=>SaveHandler.loadFromFile());c.setNext("5d1dfb86-abd9-4ad6-bf07-8ced5476e401");a.addNode(c);c=new DialogueChoice("9483a087-04d0-48dd-884f-946930771b95");c.setSay(()=>new Say("Erase a save"));
- c.setConditions(()=>!SaveHandler.isErasing());c.setNext("ee65c84a-021f-44d3-aa34-50235f438c96");a.addNode(c);c=new DialogueChoice("defe0f4c-4452-40f3-aff1-ba076263fcbc");c.setSay(()=>new Say("Don't erase my saves!"));c.setConditions(()=>SaveHandler.isErasing());c.setNext("ee65c84a-021f-44d3-aa34-50235f438c96");a.addNode(c);c=new DialogueSet("ee65c84a-021f-44d3-aa34-50235f438c96");c.setFunction(()=>{SaveHandler.toggleErasing()});c.setNext("6f15f7d6-4944-4b93-9d47-7046e8ae1f15");a.addNode(c);c=new DialogueNode("6f15f7d6-4944-4b93-9d47-7046e8ae1f15");
- c.setNext("SlotChoices");a.addNode(c);c=new DialogueSet("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");c.setFunction(()=>SaveHandler.loadFromStorage());c.setNext("f82fc177-b4bd-4f06-b7ab-216259e056a5");a.addNode(c);c=new DialogueNode("d4a379b5-06c9-4fca-a25c-b1a31b6bf93d");c.setNext("Settings");a.addNode(c);c=new DialogueNode("6b3f385b-8283-4635-9c73-e2303d77642d");c.setNext("About");a.addNode(c);c=new DialogueNode("b75c038c-654c-4c62-8f49-2f4518f52cff");c.setName("Settings");c.setNext("d33456b8-72b6-4214-90b3-3eba2442b287");
- a.addNode(c);c=new DialogueText("d33456b8-72b6-4214-90b3-3eba2442b287");c.setSay(()=>new Say("Not implemented."));c.setNext("bc24b446-d6a2-4284-93fb-67ad3598fcd1");a.addNode(c);c=new DialogueSet("bc24b446-d6a2-4284-93fb-67ad3598fcd1");c.setFunction(()=>Elements.waitForAnyKey());c.setNext("81f9d62b-907e-48ae-84fe-78c7cecc4fe3");a.addNode(c);c=new DialogueNode("81f9d62b-907e-48ae-84fe-78c7cecc4fe3");c.setNext("1");a.addNode(c);c=new DialogueNode("c342e112-5c73-4c82-8882-47ca3a71c914");c.setName("About");
- c.setNext("d33456b8-72b6-4214-90b3-3eba2442b287");a.addNode(c);c=new DialogueChoice("a55f46fa-98a9-4dff-9f1c-4f88c18ce8dd");c.setSay(()=>new Say("Note about content (Spoiler Alert)"));c.setNext("7c2060aa-66ce-4dbb-88d2-0c8f190e0a6c");a.addNode(c);c=new DialogueText("59a3cb30-d4ba-4b46-8157-b900fc7022dd");c.setSay(()=>new Say(Say.CENTERED,new SayImage("introLogo"),Say.LINE_BREAK,new SayItalic("The Obelisk is an adult interactive fiction game set in a post-apocalyptic world ravaged by a magical structure.")));
- c.setNext("1b8bdc9d-a4bf-40aa-a382-f7813c158840");a.addNode(c);c=new DialogueSet("c27829b7-7199-4b1e-9334-536258546cfc");c.setFunction(()=>Elements.waitForAnyKey());c.setNext("42401145-9154-40c3-a9d3-4f83df97b89e");a.addNode(c);c=new DialogueNode("42401145-9154-40c3-a9d3-4f83df97b89e");c.setNext("1");a.addNode(c);c=new DialogueSet("7c2060aa-66ce-4dbb-88d2-0c8f190e0a6c");c.setFunction(()=>{Elements.clearMainScreen()});c.setNext("59a3cb30-d4ba-4b46-8157-b900fc7022dd");a.addNode(c);c=new DialogueText("1b8bdc9d-a4bf-40aa-a382-f7813c158840");
- c.setSay(()=>new Say("In this story, the Obelisk will attempt to give the player exactly what the player wants, but that's not always what the player thinks they want. This is a pornographic game first and a roleplaying game second, which means that it is assumed that the player character wants sex - even if they don't act like it.",Say.PARAGRAPH_BREAK,'Therefore, this game will "fit" for players who go in with that mentality, but it ',new SayBold("will")," look differently for players with a different point of view for their characters. While roleplaying is encouraged, that is not how the game was written, so if you're playing it that way, it's just your choice.",
- Say.PARAGRAPH_BREAK,"There is no sex without explicit consent from the NPCs: implicit consent is only used for the player character, because that's part of the story. It is possible to remove the player's consent, thereby having no unwanted sex scenes occur, by setting up the content options, which will disable content without explicit consent (i.e. disabling M/M Sex Scenes means this kind of thing will only happen if you actively ask an NPC for it).",Say.PARAGRAPH_BREAK,"While the content options are there to tailor your experience, the game is made with \"all content is available\" in mind, which might result in a playthrough that's not much fun if you disable too many things. Still, that's your choice. Game on."));
- c.setNext("c27829b7-7199-4b1e-9334-536258546cfc");a.addNode(c);return a}()})(DialogueTrees||(DialogueTrees={}));(function(a){a.CreationIntro=a.rulebook.createAndAddRule({name:"Show small Intro",firstPriority:Rule.PRIORITY_HIGHEST,priority:Rule.PRIORITY_HIGHEST,code:()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield DialogueTrees.CreationIntro.execute()})})})(CharacterCreation||(CharacterCreation={}));
- (function(a){function b(a){let b=document.createTextNode(String(a.value)),c=document.createElement("div");c.classList.add("ccOption");if(void 0!=a.topLabel){var f=document.createElement("div");f.classList.add("ccOptionTopLabel");f.appendChild(document.createTextNode(a.topLabel+":"));c.appendChild(f)}f=document.createElement("div");if(0!=a.showValue){f.classList.add("rangeValue");if(void 0!=a.label){var g=document.createElement("b");g.appendChild(document.createTextNode(a.label+": "));f.appendChild(g)}f.appendChild(b)}let h=
- document.createElement("input");h.classList.add("ccRange");h.type="range";h.min=a.minValue.toString();h.max=a.maxValue.toString();h.step=a.step.toString();h.value=a.value.toString();let l=()=>{b.nodeValue=h.value;a.onChange(Number(h.value),b,h)};h.addEventListener("change",l);g=document.createElement("a");g.classList.add("ccButton");g.addEventListener("click",()=>{h.value=String(Number(h.value)-a.step);l()});Controls.KeyHandler.applyCode(g,Controls.KeyHandler.getFirstKeyCode());void 0!=a.leftLabel&&
- g.appendChild(document.createTextNode(a.leftLabel));let k=document.createElement("a");k.classList.add("ccButton");k.addEventListener("click",()=>{h.value=String(Number(h.value)+a.step);l()});Controls.KeyHandler.applyCode(k,Controls.KeyHandler.getFirstKeyCode());void 0!=a.rightLabel&&k.appendChild(document.createTextNode(a.rightLabel));c.appendChild(g);c.appendChild(h);c.appendChild(k);c.appendChild(f);l();return c}a.CCSexStats=a.rulebook.createAndAddRule({name:"Character Creation - Sex and Stats",
- firstPriority:Rule.PRIORITY_HIGH,priority:Rule.PRIORITY_HIGH,code:()=>{Elements.startMenu();let a=document.createElement("div");a.id="characterCreation";var d=document.createElement("div");d.id="ccLeft";a.appendChild(d);let e=document.createElement("div");e.id="ccRight";a.appendChild(e);let f=()=>{(new Say(WorldState.player.description)).getHTMLContent().then((a)=>{for(;e.firstChild;)e.removeChild(e.firstChild);a.forEach((a)=>{e.appendChild(a)})})};d.appendChild(b({minValue:0,maxValue:1,step:1,value:0,
- leftLabel:"Male",rightLabel:"Female",topLabel:"Sex",onChange:(b,c,d)=>{c.nodeValue=0==b?"Male":"Female";WorldState.player.removeGenderedParts();0==b?WorldState.player.addMaleParts():WorldState.player.addFemaleParts();b=a.getElementsByTagName("input");for(c=0;c<b.length;c++){let a=b[c];a!=d&&a.dispatchEvent(new Event("change"))}f()}}));d.appendChild(b({minValue:0,maxValue:4,step:1,value:2,leftLabel:"Masculine",rightLabel:"Feminine",topLabel:"Gender",onChange:(a,b)=>{b.nodeValue=["Masculine","Somewhat masculine",
- "Androgynous","Somewhat feminine","Feminine"][a];a=WorldState.player.isMale()?[10,25,50,55,60][a]:[35,40,50,65,75][a];WorldState.player.setGenderValue(a);WorldState.player.setStat(Attributes.GenderIdentity,a);f()}}));let g=document.createElement("div");d.appendChild(g);g.classList.add("ccHeader");g.appendChild(document.createTextNode("Stats ("));let h=document.createTextNode("4 points remaining");g.appendChild(h);g.appendChild(document.createTextNode(")"));let l=(a,b,c)=>{player.setStat(a,b);a=12-
- player.getStat(Attributes.Strength)-player.getStat(Attributes.Agility)-player.getStat(Attributes.Intelligence)-player.getStat(Attributes.Charm);0>a?(c.value=(b+a).toString(),c.dispatchEvent(new Event("change"))):h.nodeValue=0==a?"Done":1<a?a.toString()+" points remaining":a.toString()+" point remaining"};d.appendChild(b({minValue:1,maxValue:5,step:1,value:2,leftLabel:"-",rightLabel:"+",topLabel:"Strength",onChange:(a,b,c)=>{l(Attributes.Strength,a,c);f()}}));d.appendChild(b({minValue:1,maxValue:5,
- step:1,value:2,leftLabel:"-",rightLabel:"+",topLabel:"Agility",onChange:(a,b,c)=>{l(Attributes.Agility,a,c);f()}}));d.appendChild(b({minValue:1,maxValue:5,step:1,value:2,leftLabel:"-",rightLabel:"+",topLabel:"Charm",onChange:(a,b,c)=>{l(Attributes.Charm,a,c);f()}}));d.appendChild(b({minValue:1,maxValue:5,step:1,value:2,leftLabel:"-",rightLabel:"+",topLabel:"Intelligence",onChange:(a,b,c)=>{l(Attributes.Intelligence,a,c);f()}}));d=new Promise((a)=>{(new Say("Confirm")).getHTML("p",["choice"]).then((b)=>
- {b[0].addEventListener("click",()=>{Elements.endMenu();a()});Controls.KeyHandler.applyCode(b[0],Controls.KeyHandler.getSecondKeyCode());Elements.CurrentTurnHandler.print(b[0])})});Elements.CurrentTurnHandler.print(a);return d}})})(CharacterCreation||(CharacterCreation={}));
- (function(a){a.FalselyAccused=new CharacterOrigin("Falsely Accused");a.FalselyAccused.name="Champion";a.FalselyAccused.description=new Say("You made some allegations against a powerful man in your village. Whether those were true or not didn't matter, he was most displeased with your actions and did all he could to end your life as you knew it. Just as you were about to be executed for your inexistent crimes, the man asked for mercy. You thought he wasn't willing to go this far with his lies, only to have your hopes crushed when you noticed a smirk in his evil face.\n",Say.PARAGRAPH_BREAK,
- "The man claimed he wanted to forgive you, but would need proof of your regret. You received an alternative sentence: go to the Tower and find a way to destroy it. Surely an impossible task. Surely just another death sentence... or worse. But it's not like you have a choice in the matter.");a.FalselyAccused.bonusStats="This origin confers no bonuses, but you have complete freedom with your perks."})(CharacterCreation||(CharacterCreation={}));
- class ActionInventory extends Action{constructor(a,...b){super(a,...b);this.requiresVisibility=this.requiresNoun=this.requiresTurn=!1;this.extraChecks.push(ActionInventory.check);this.extraCarries.push(ActionInventory.carry)}getCommandText(){return"take inventory"}static createButton(a,b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){let c=document.createElement("p");c.classList.add("choice");(yield(new Say(a)).getPureElements()).forEach((a)=>{c.appendChild(a)});c.addEventListener("click",
- ()=>{b(a)});Controls.KeyHandler.applyCode(c,Controls.KeyHandler.getFirstKeyCode());return c})}}ActionInventory.check=new Rulebook("Check Taking Inventory");ActionInventory.carry=new Rulebook("Carry out Taking Inventory");
- ActionInventory.checkInventoryRule=ActionInventory.check.createAndAddRule({name:"List inventory as options",code:(a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){var b=WorldState.player;let c=Thing.WieldRelation.getRight(b).sort(Elements.InventoryHandler.thingSort),d=Thing.WearRelation.getRight(b).sort(Elements.InventoryHandler.thingSort),e=Thing.CarryRelation.getRight(b).sort(Elements.InventoryHandler.thingSort),f;b=yield new Promise((a)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){Controls.KeyHandler.reset();
- let b=new Say;if(0<c.length){b.add(new SayBold("Wielded:"),Say.LINE_BREAK);for(var g=0;g<c.length;g++)b.add(yield ActionInventory.createButton(c[g],a))}if(0<d.length)for(0<b.sequence.length&&b.add(Say.PARAGRAPH_BREAK),b.add(new SayBold("Worn:"),Say.LINE_BREAK),g=0;g<d.length;g++)b.add(yield ActionInventory.createButton(d[g],a));if(0<e.length)for(0<b.sequence.length&&b.add(Say.PARAGRAPH_BREAK),b.add(new SayBold("Carried:"),Say.LINE_BREAK),g=0;g<e.length;g++)b.add(yield ActionInventory.createButton(e[g],
- a));if(0==b.sequence.length)return a(void 0);f=yield b.getHTMLContent();Elements.CurrentTurnHandler.print(...f)}));if(void 0!=b)return Elements.CurrentTurnHandler.unprint(...f),Controls.KeyHandler.reset(),new ActionExamine(WorldState.player,b);a.noun.say.add("You have nothing.");return!1})});
- Elements.HyperlinkHandler.CommonActionsRulebook.addRule(new Rule({name:"Add Take Inventory Command Rule",firstPriority:Rule.PRIORITY_LOWEST,priority:Rule.PRIORITY_MEDIUM,code:(a)=>{Elements.HyperlinkHandler.addCommonAction("Inventory",new ActionInventory(WorldState.player))}}));
|