assassin-bug/app_web/game.js

2 lines
324 KiB
JavaScript
Raw Normal View History

2021-11-05 13:28:01 +00:00
(()=>{"use strict";var t={729:t=>{var e=Object.prototype.hasOwnProperty,s="~";function i(){}function n(t,e,s){this.fn=t,this.context=e,this.once=s||!1}function a(t,e,i,a,h){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new n(i,a||t,h),u=s?s+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],r]:t._events[u].push(r):(t._events[u]=r,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function r(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(s=!1)),r.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(s?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},r.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,a=i.length,h=new Array(a);n<a;n++)h[n]=i[n].fn;return h},r.prototype.listenerCount=function(t){var e=s?s+t:t,i=this._events[e];return i?i.fn?1:i.length:0},r.prototype.emit=function(t,e,i,n,a,h){var r=s?s+t:t;if(!this._events[r])return!1;var u,l,o=this._events[r],c=arguments.length;if(o.fn){switch(o.once&&this.removeListener(t,o.fn,void 0,!0),c){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,e),!0;case 3:return o.fn.call(o.context,e,i),!0;case 4:return o.fn.call(o.context,e,i,n),!0;case 5:return o.fn.call(o.context,e,i,n,a),!0;case 6:return o.fn.call(o.context,e,i,n,a,h),!0}for(l=1,u=new Array(c-1);l<c;l++)u[l-1]=arguments[l];o.fn.apply(o.context,u)}else{var v,y=o.length;for(l=0;l<y;l++)switch(o[l].once&&this.removeListener(t,o[l].fn,void 0,!0),c){case 1:o[l].fn.call(o[l].context);break;case 2:o[l].fn.call(o[l].context,e);break;case 3:o[l].fn.call(o[l].context,e,i);break;case 4:o[l].fn.call(o[l].context,e,i,n);break;default:if(!u)for(v=1,u=new Array(c-1);v<c;v++)u[v-1]=arguments[v];o[l].fn.apply(o[l].context,u)}}return!0},r.prototype.on=function(t,e,s){return a(this,t,e,s,!1)},r.prototype.once=function(t,e,s){return a(this,t,e,s,!0)},r.prototype.removeListener=function(t,e,i,n){var a=s?s+t:t;if(!this._events[a])return this;if(!e)return h(this,a),this;var r=this._events[a];if(r.fn)r.fn!==e||n&&!r.once||i&&r.context!==i||h(this,a);else{for(var u=0,l=[],o=r.length;u<o;u++)(r[u].fn!==e||n&&!r[u].once||i&&r[u].context!==i)&&l.push(r[u]);l.length?this._events[a]=1===l.length?l[0]:l:h(this,a)}return this},r.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&h(this,e)):(this._events=new i,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=s,r.EventEmitter=r,t.exports=r}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,s),a.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{const t=new class{constructor(){this.states=new Map}get(t){return this.states.has(t)?this.states.get(t):null}set(t,e){return this.states.set(t,e)}};class e{constructor(){this.inventory=[],this.currentRoom="start",this.context=null}addItem(t){this.inventory.push(t)}removeItem(t){this.inventory=this.inventory.filter((e=>e!=t))}getInventory(){return this.inventory.map((t=>this.context.getItem(t)))}}class i{speak(t){}stop(){}setOptions(t){}}class n extends i{constructor(t={}){super(),this.timeout=100,this.timeout=t.timeout||100,this.init()}init(){this.container=document.createElement("div"),this.container.setAttribute("aria-live","polite"),this.speechDisplay=document.createElement("div"),this.speechDisplay.setAttribute("aria-live","polite"),this.container.append(this.speechDisplay),document.body.appendChild(this.container),document.body.insertBefore(this.container,document.body.firstChild)}speak(t){this.clearDisplay();const e=document.createTextNode(t),s=document.create
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2FtZS5qcyIsIm1hcHBpbmdzIjoia0NBRUEsSUFBSUEsRUFBTUMsT0FBT0MsVUFBVUMsZUFDdkJDLEVBQVMsSUFTYixTQUFTQyxLQTRCVCxTQUFTQyxFQUFHQyxFQUFJQyxFQUFTQyxHQUN2QkMsS0FBS0gsR0FBS0EsRUFDVkcsS0FBS0YsUUFBVUEsRUFDZkUsS0FBS0QsS0FBT0EsSUFBUSxFQWN0QixTQUFTRSxFQUFZQyxFQUFTQyxFQUFPTixFQUFJQyxFQUFTQyxHQUNoRCxHQUFrQixtQkFBUEYsRUFDVCxNQUFNLElBQUlPLFVBQVUsbUNBR3RCLElBQUlDLEVBQVcsSUFBSVQsRUFBR0MsRUFBSUMsR0FBV0ksRUFBU0gsR0FDMUNPLEVBQU1aLEVBQVNBLEVBQVNTLEVBQVFBLEVBTXBDLE9BSktELEVBQVFLLFFBQVFELEdBQ1hKLEVBQVFLLFFBQVFELEdBQUtULEdBQzFCSyxFQUFRSyxRQUFRRCxHQUFPLENBQUNKLEVBQVFLLFFBQVFELEdBQU1ELEdBRGhCSCxFQUFRSyxRQUFRRCxHQUFLRSxLQUFLSCxJQURsQ0gsRUFBUUssUUFBUUQsR0FBT0QsRUFBVUgsRUFBUU8sZ0JBSTdEUCxFQVVULFNBQVNRLEVBQVdSLEVBQVNJLEdBQ0ksS0FBekJKLEVBQVFPLGFBQW9CUCxFQUFRSyxRQUFVLElBQUlaLFNBQzVDTyxFQUFRSyxRQUFRRCxHQVU5QixTQUFTSyxJQUNQWCxLQUFLTyxRQUFVLElBQUlaLEVBQ25CSyxLQUFLUyxhQUFlLEVBeEVsQmxCLE9B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