assassin-bug/app_web/game.js

2 lines
364 KiB
JavaScript
Raw Normal View History

2021-11-10 19:55:21 +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),o=s?s+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],r]:t._events[o].push(r):(t._events[o]=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 o,u,l=this._events[r],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,a),!0;case 6:return l.fn.call(l.context,e,i,n,a,h),!0}for(u=1,o=new Array(c-1);u<c;u++)o[u-1]=arguments[u];l.fn.apply(l.context,o)}else{var v,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,i);break;case 4:l[u].fn.call(l[u].context,e,i,n);break;default:if(!o)for(v=1,o=new Array(c-1);v<c;v++)o[v-1]=arguments[v];l[u].fn.apply(l[u].context,o)}}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 o=0,u=[],l=r.length;o<l;o++)(r[o].fn!==e||n&&!r[o].once||i&&r[o].context!==i)&&u.push(r[o]);u.length?this._events[a]=1===u.length?u[0]:u: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)}serialize(){const t=this.states.entries(),e=[];for(let s of t)e.push(s);return e}deserialize(t){this.states=new Map(t)}};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(thi
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2FtZS5qcyIsIm1hcHBpbmdzIjoia0NBRUEsSUFBSUEsRUFBTUMsT0FBT0MsVUFBVUMsZUFDdkJDLEVBQVMsSUFTYixTQUFTQyxLQTRCVCxTQUFTQyxFQUFHQyxFQUFJQyxFQUFTQyxHQUN2QkMsS0FBS0gsR0FBS0EsRUFDVkcsS0FBS0YsUUFBVUEsRUFDZkUsS0FBS0QsS0FBT0EsSUFBUSxFQWN0QixTQUFTRSxFQUFZQyxFQUFTQyxFQUFPTixFQUFJQyxFQUFTQyxHQUNoRCxHQUFrQixtQkFBUEYsRUFDVCxNQUFNLElBQUlPLFVBQVUsbUNBR3RCLElBQUlDLEVBQVcsSUFBSVQsRUFBR0MsRUFBSUMsR0FBV0ksRUFBU0gsR0FDMUNPLEVBQU1aLEVBQVNBLEVBQVNTLEVBQVFBLEVBTXBDLE9BSktELEVBQVFLLFFBQVFELEdBQ1hKLEVBQVFLLFFBQVFELEdBQUtULEdBQzFCSyxFQUFRSyxRQUFRRCxHQUFPLENBQUNKLEVBQVFLLFFBQVFELEdBQU1ELEdBRGhCSCxFQUFRSyxRQUFRRCxHQUFLRSxLQUFLSCxJQURsQ0gsRUFBUUssUUFBUUQsR0FBT0QsRUFBVUgsRUFBUU8sZ0JBSTdEUCxFQVVULFNBQVNRLEVBQVdSLEVBQVNJLEdBQ0ksS0FBekJKLEVBQVFPLGFBQW9CUCxFQUFRSyxRQUFVLElBQUlaLFNBQzVDTyxFQUFRSyxRQUFRRCxHQVU5QixTQUFTSyxJQUNQWCxLQUFLTyxRQUFVLElBQUlaLEVBQ25CSyxLQUFLUyxhQUFlLEVBeE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