· 5 years ago · Nov 06, 2020, 08:18 PM
1/// ==UserScript==
2// @name cps 13091301817391 me
3// @namespace
4// @version
5// @description
6// @author
7// @match *://moomoo.io/*
8// @match *://dev.moomoo.io/*
9// @match *://sandbox.moomoo.io/*
10// @grant none
11// @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
12// @require http://code.jquery.com/jquery-3.3.1.min.js
13// @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
14// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
15// @icon
16// @downloadURL none
17// ==/UserScript==
18
19!(function(e) {
20 var t = {};
21
22 function n(i) {
23 if (t[i]) return t[i].exports;
24 var r = (t[i] = {
25 i: i,
26 l: !1,
27 exports: {}
28 });
29 return e[i].call(r.exports, r, r.exports, n), (r.l = !0), r.exports;
30 }
31
32 (n.m = e),
33 (n.c = t),
34 (n.d = function(e, t, i) {
35 n.o(e, t) ||
36 Object.defineProperty(e, t, {
37 enumerable: !0,
38 get: i
39 });
40 }),
41 (n.r = function(e) {
42 "undefined" != typeof Symbol &&
43 Symbol.toStringTag &&
44 Object.defineProperty(e, Symbol.toStringTag, {
45 value: "Module"
46 }),
47 Object.defineProperty(e, "__esModule", {
48 value: !0
49 });
50 }),
51 (n.t = function(e, t) {
52 if ((1 & t && (e = n(e)), 8 & t)) return e;
53 if (4 & t && "object" == typeof e && e && e.__esModule) return e;
54 var i = Object.create(null);
55 if (
56 (n.r(i),
57 Object.defineProperty(i, "default", {
58 enumerable: !0,
59 value: e
60 }),
61 2 & t && "string" != typeof e)
62 )
63 for (var r in e)
64 n.d(
65 i,
66 r,
67 function(t) {
68 return e[t];
69 }.bind(null, r)
70 );
71 return i;
72 }),
73 (n.n = function(e) {
74 var t =
75 e && e.__esModule
76 ? function() {
77 return e.default;
78 }
79 : function() {
80 return e;
81 };
82 return n.d(t, "a", t), t;
83 }),
84 (n.o = function(e, t) {
85 return Object.prototype.hasOwnProperty.call(e, t);
86 }),
87 (n.p = ""),
88 n((n.s = 21));
89})([
90 function(e, t, n) {
91 var i = (t.global = n(25)),
92 r = (t.hasBuffer = i && !!i.isBuffer),
93 s = (t.hasArrayBuffer = "undefined" != typeof ArrayBuffer),
94 a = (t.isArray = n(5));
95 t.isArrayBuffer = s
96 ? function(e) {
97 return e instanceof ArrayBuffer || p(e);
98 }
99 : m;
100 var o = (t.isBuffer = r ? i.isBuffer : m),
101 c = (t.isView = s ? ArrayBuffer.isView || y("ArrayBuffer", "buffer") : m);
102 (t.alloc = d),
103 (t.concat = function(e, n) {
104 n ||
105 ((n = 0),
106 Array.prototype.forEach.call(e, function(e) {
107 n += e.length;
108 }));
109 var i = (this !== t && this) || e[0],
110 r = d.call(i, n),
111 s = 0;
112 return (
113 Array.prototype.forEach.call(e, function(e) {
114 s += f.copy.call(e, r, s);
115 }),
116 r
117 );
118 }),
119 (t.from = function(e) {
120 return "string" == typeof e
121 ? function(e) {
122 var t = 3 * e.length,
123 n = d.call(this, t),
124 i = f.write.call(n, e);
125 return t !== i && (n = f.slice.call(n, 0, i)), n;
126 }.call(this, e)
127 : g(this).from(e);
128 });
129 var l = (t.Array = n(28)),
130 h = (t.Buffer = n(29)),
131 u = (t.Uint8Array = n(30)),
132 f = (t.prototype = n(6));
133
134 function d(e) {
135 return g(this).alloc(e);
136 }
137 var p = y("ArrayBuffer");
138
139 function g(e) {
140 return o(e) ? h : c(e) ? u : a(e) ? l : r ? h : s ? u : l;
141 }
142
143 function m() {
144 return !1;
145 }
146
147 function y(e, t) {
148 return (
149 (e = "[object " + e + "]"),
150 function(n) {
151 return null != n && {}.toString.call(t ? n[t] : n) === e;
152 }
153 );
154 }
155 },
156 function(e, t, n) {
157 var i = n(5);
158 (t.createCodec = o),
159 (t.install = function(e) {
160 for (var t in e) s.prototype[t] = a(s.prototype[t], e[t]);
161 }),
162 (t.filter = function(e) {
163 return i(e)
164 ? (function(e) {
165 return (
166 (e = e.slice()),
167 function(n) {
168 return e.reduce(t, n);
169 }
170 );
171
172 function t(e, t) {
173 return t(e);
174 }
175 })(e)
176 : e;
177 });
178 var r = n(0);
179
180 function s(e) {
181 if (!(this instanceof s)) return new s(e);
182 (this.options = e), this.init();
183 }
184
185 function a(e, t) {
186 return e && t
187 ? function() {
188 return e.apply(this, arguments), t.apply(this, arguments);
189 }
190 : e || t;
191 }
192
193 function o(e) {
194 return new s(e);
195 }
196 (s.prototype.init = function() {
197 var e = this.options;
198 return e && e.uint8array && (this.bufferish = r.Uint8Array), this;
199 }),
200 (t.preset = o({
201 preset: !0
202 }));
203 },
204 function(e, t, n) {
205 var i = n(3).ExtBuffer,
206 r = n(32),
207 s = n(33),
208 a = n(1);
209
210 function o() {
211 var e = this.options;
212 return (
213 (this.encode = (function(e) {
214 var t = s.getWriteType(e);
215 return function(e, n) {
216 var i = t[typeof n];
217 if (!i)
218 throw new Error('Unsupported type "' + typeof n + '": ' + n);
219 i(e, n);
220 };
221 })(e)),
222 e && e.preset && r.setExtPackers(this),
223 this
224 );
225 }
226 a.install({
227 addExtPacker: function(e, t, n) {
228 n = a.filter(n);
229 var r = t.name;
230 r && "Object" !== r
231 ? ((this.extPackers || (this.extPackers = {}))[r] = s)
232 : (this.extEncoderList || (this.extEncoderList = [])).unshift([t, s]);
233
234 function s(t) {
235 return n && (t = n(t)), new i(t, e);
236 }
237 },
238 getExtPacker: function(e) {
239 var t = this.extPackers || (this.extPackers = {}),
240 n = e.constructor,
241 i = n && n.name && t[n.name];
242 if (i) return i;
243 for (
244 var r = this.extEncoderList || (this.extEncoderList = []),
245 s = r.length,
246 a = 0;
247 a < s;
248 a++
249 ) {
250 var o = r[a];
251 if (n === o[0]) return o[1];
252 }
253 },
254 init: o
255 }),
256 (t.preset = o.call(a.preset));
257 },
258 function(e, t, n) {
259 t.ExtBuffer = function e(t, n) {
260 if (!(this instanceof e)) return new e(t, n);
261 (this.buffer = i.from(t)), (this.type = n);
262 };
263 var i = n(0);
264 },
265 function(e, t) {
266 (t.read = function(e, t, n, i, r) {
267 var s,
268 a,
269 o = 8 * r - i - 1,
270 c = (1 << o) - 1,
271 l = c >> 1,
272 h = -7,
273 u = n ? r - 1 : 0,
274 f = n ? -1 : 1,
275 d = e[t + u];
276 for (
277 u += f, s = d & ((1 << -h) - 1), d >>= -h, h += o;
278 h > 0;
279 s = 256 * s + e[t + u], u += f, h -= 8
280 );
281 for (
282 a = s & ((1 << -h) - 1), s >>= -h, h += i;
283 h > 0;
284 a = 256 * a + e[t + u], u += f, h -= 8
285 );
286 if (0 === s) s = 1 - l;
287 else {
288 if (s === c) return a ? NaN : (1 / 0) * (d ? -1 : 1);
289 (a += Math.pow(2, i)), (s -= l);
290 }
291 return (d ? -1 : 1) * a * Math.pow(2, s - i);
292 }),
293 (t.write = function(e, t, n, i, r, s) {
294 var a,
295 o,
296 c,
297 l = 8 * s - r - 1,
298 h = (1 << l) - 1,
299 u = h >> 1,
300 f = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
301 d = i ? 0 : s - 1,
302 p = i ? 1 : -1,
303 g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
304 for (
305 t = Math.abs(t),
306 isNaN(t) || t === 1 / 0
307 ? ((o = isNaN(t) ? 1 : 0), (a = h))
308 : ((a = Math.floor(Math.log(t) / Math.LN2)),
309 t * (c = Math.pow(2, -a)) < 1 && (a--, (c *= 2)),
310 (t += a + u >= 1 ? f / c : f * Math.pow(2, 1 - u)) * c >= 2 &&
311 (a++, (c /= 2)),
312 a + u >= h
313 ? ((o = 0), (a = h))
314 : a + u >= 1
315 ? ((o = (t * c - 1) * Math.pow(2, r)), (a += u))
316 : ((o = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
317 r >= 8;
318 e[n + d] = 255 & o, d += p, o /= 256, r -= 8
319 );
320 for (
321 a = (a << r) | o, l += r;
322 l > 0;
323 e[n + d] = 255 & a, d += p, a /= 256, l -= 8
324 );
325 e[n + d - p] |= 128 * g;
326 });
327 },
328 function(e, t) {
329 var n = {}.toString;
330 e.exports =
331 Array.isArray ||
332 function(e) {
333 return "[object Array]" == n.call(e);
334 };
335 },
336 function(e, t, n) {
337 var i = n(31);
338 (t.copy = c),
339 (t.slice = l),
340 (t.toString = function(e, t, n) {
341 return (!a && r.isBuffer(this) ? this.toString : i.toString).apply(
342 this,
343 arguments
344 );
345 }),
346 (t.write = (function(e) {
347 return function() {
348 return (this[e] || i[e]).apply(this, arguments);
349 };
350 })("write"));
351 var r = n(0),
352 s = r.global,
353 a = r.hasBuffer && "TYPED_ARRAY_SUPPORT" in s,
354 o = a && !s.TYPED_ARRAY_SUPPORT;
355
356 function c(e, t, n, s) {
357 var a = r.isBuffer(this),
358 c = r.isBuffer(e);
359 if (a && c) return this.copy(e, t, n, s);
360 if (o || a || c || !r.isView(this) || !r.isView(e))
361 return i.copy.call(this, e, t, n, s);
362 var h = n || null != s ? l.call(this, n, s) : this;
363 return e.set(h, t), h.length;
364 }
365
366 function l(e, t) {
367 var n = this.slice || (!o && this.subarray);
368 if (n) return n.call(this, e, t);
369 var i = r.alloc.call(this, t - e);
370 return c.call(this, i, 0, e, t), i;
371 }
372 },
373 function(e, t, n) {
374 (function(e) {
375 !(function(t) {
376 var n,
377 i = "undefined",
378 r = i !== typeof e && e,
379 s = i !== typeof Uint8Array && Uint8Array,
380 a = i !== typeof ArrayBuffer && ArrayBuffer,
381 o = [0, 0, 0, 0, 0, 0, 0, 0],
382 c =
383 Array.isArray ||
384 function(e) {
385 return (
386 !!e && "[object Array]" == Object.prototype.toString.call(e)
387 );
388 },
389 l = 4294967296;
390
391 function h(e, c, h) {
392 var b = c ? 0 : 4,
393 x = c ? 4 : 0,
394 S = c ? 0 : 3,
395 T = c ? 1 : 2,
396 I = c ? 2 : 1,
397 E = c ? 3 : 0,
398 M = c ? y : v,
399 A = c ? k : w,
400 P = O.prototype,
401 B = "is" + e,
402 C = "_" + B;
403 return (
404 (P.buffer = void 0),
405 (P.offset = 0),
406 (P[C] = !0),
407 (P.toNumber = R),
408 (P.toString = function(e) {
409 var t = this.buffer,
410 n = this.offset,
411 i = _(t, n + b),
412 r = _(t, n + x),
413 s = "",
414 a = !h && 2147483648 & i;
415 for (a && ((i = ~i), (r = l - r)), e = e || 10; ; ) {
416 var o = (i % e) * l + r;
417 if (
418 ((i = Math.floor(i / e)),
419 (r = Math.floor(o / e)),
420 (s = (o % e).toString(e) + s),
421 !i && !r)
422 )
423 break;
424 }
425 return a && (s = "-" + s), s;
426 }),
427 (P.toJSON = R),
428 (P.toArray = u),
429 r && (P.toBuffer = f),
430 s && (P.toArrayBuffer = d),
431 (O[B] = function(e) {
432 return !(!e || !e[C]);
433 }),
434 (t[e] = O),
435 O
436 );
437
438 function O(e, t, r, c) {
439 return this instanceof O
440 ? (function(e, t, r, c, h) {
441 if (
442 (s &&
443 a &&
444 (t instanceof a && (t = new s(t)),
445 c instanceof a && (c = new s(c))),
446 t || r || c || n)
447 ) {
448 if (!p(t, r))
449 (h = r), (c = t), (r = 0), (t = new (n || Array)(8));
450 (e.buffer = t),
451 (e.offset = r |= 0),
452 i !== typeof c &&
453 ("string" == typeof c
454 ? (function(e, t, n, i) {
455 var r = 0,
456 s = n.length,
457 a = 0,
458 o = 0;
459 "-" === n[0] && r++;
460 for (var c = r; r < s; ) {
461 var h = parseInt(n[r++], i);
462 if (!(h >= 0)) break;
463 (o = o * i + h),
464 (a = a * i + Math.floor(o / l)),
465 (o %= l);
466 }
467 c && ((a = ~a), o ? (o = l - o) : a++),
468 j(e, t + b, a),
469 j(e, t + x, o);
470 })(t, r, c, h || 10)
471 : p(c, h)
472 ? g(t, r, c, h)
473 : "number" == typeof h
474 ? (j(t, r + b, c), j(t, r + x, h))
475 : c > 0
476 ? M(t, r, c)
477 : c < 0
478 ? A(t, r, c)
479 : g(t, r, o, 0));
480 } else e.buffer = m(o, 0);
481 })(this, e, t, r, c)
482 : new O(e, t, r, c);
483 }
484
485 function R() {
486 var e = this.buffer,
487 t = this.offset,
488 n = _(e, t + b),
489 i = _(e, t + x);
490 return h || (n |= 0), n ? n * l + i : i;
491 }
492
493 function j(e, t, n) {
494 (e[t + E] = 255 & n),
495 (n >>= 8),
496 (e[t + I] = 255 & n),
497 (n >>= 8),
498 (e[t + T] = 255 & n),
499 (n >>= 8),
500 (e[t + S] = 255 & n);
501 }
502
503 function _(e, t) {
504 return (
505 16777216 * e[t + S] +
506 (e[t + T] << 16) +
507 (e[t + I] << 8) +
508 e[t + E]
509 );
510 }
511 }
512
513 function u(e) {
514 var t = this.buffer,
515 i = this.offset;
516 return (
517 (n = null),
518 !1 !== e && 0 === i && 8 === t.length && c(t) ? t : m(t, i)
519 );
520 }
521
522 function f(t) {
523 var i = this.buffer,
524 s = this.offset;
525 if (((n = r), !1 !== t && 0 === s && 8 === i.length && e.isBuffer(i)))
526 return i;
527 var a = new r(8);
528 return g(a, 0, i, s), a;
529 }
530
531 function d(e) {
532 var t = this.buffer,
533 i = this.offset,
534 r = t.buffer;
535 if (
536 ((n = s),
537 !1 !== e && 0 === i && r instanceof a && 8 === r.byteLength)
538 )
539 return r;
540 var o = new s(8);
541 return g(o, 0, t, i), o.buffer;
542 }
543
544 function p(e, t) {
545 var n = e && e.length;
546 return (t |= 0), n && t + 8 <= n && "string" != typeof e[t];
547 }
548
549 function g(e, t, n, i) {
550 (t |= 0), (i |= 0);
551 for (var r = 0; r < 8; r++) e[t++] = 255 & n[i++];
552 }
553
554 function m(e, t) {
555 return Array.prototype.slice.call(e, t, t + 8);
556 }
557
558 function y(e, t, n) {
559 for (var i = t + 8; i > t; ) (e[--i] = 255 & n), (n /= 256);
560 }
561
562 function k(e, t, n) {
563 var i = t + 8;
564 for (n++; i > t; ) (e[--i] = (255 & -n) ^ 255), (n /= 256);
565 }
566
567 function v(e, t, n) {
568 for (var i = t + 8; t < i; ) (e[t++] = 255 & n), (n /= 256);
569 }
570
571 function w(e, t, n) {
572 var i = t + 8;
573 for (n++; t < i; ) (e[t++] = (255 & -n) ^ 255), (n /= 256);
574 }
575 h("Uint64BE", !0, !0),
576 h("Int64BE", !0, !1),
577 h("Uint64LE", !1, !0),
578 h("Int64LE", !1, !1);
579 })("string" != typeof t.nodeName ? t : this || {});
580 }.call(this, n(11).Buffer));
581 },
582 function(e, t, n) {
583 var i = n(3).ExtBuffer,
584 r = n(35),
585 s = n(17).readUint8,
586 a = n(36),
587 o = n(1);
588
589 function c() {
590 var e = this.options;
591 return (
592 (this.decode = (function(e) {
593 var t = a.getReadToken(e);
594 return function(e) {
595 var n = s(e),
596 i = t[n];
597 if (!i)
598 throw new Error(
599 "Invalid type: " + (n ? "0x" + n.toString(16) : n)
600 );
601 return i(e);
602 };
603 })(e)),
604 e && e.preset && r.setExtUnpackers(this),
605 this
606 );
607 }
608 o.install({
609 addExtUnpacker: function(e, t) {
610 (this.extUnpackers || (this.extUnpackers = []))[e] = o.filter(t);
611 },
612 getExtUnpacker: function(e) {
613 return (
614 (this.extUnpackers || (this.extUnpackers = []))[e] ||
615 function(t) {
616 return new i(t, e);
617 }
618 );
619 },
620 init: c
621 }),
622 (t.preset = c.call(o.preset));
623 },
624 function(e, t, n) {
625 t.encode = function(e, t) {
626 var n = new i(t);
627 return n.write(e), n.read();
628 };
629 var i = n(10).EncodeBuffer;
630 },
631 function(e, t, n) {
632 t.EncodeBuffer = r;
633 var i = n(2).preset;
634
635 function r(e) {
636 if (!(this instanceof r)) return new r(e);
637 if (e && ((this.options = e), e.codec)) {
638 var t = (this.codec = e.codec);
639 t.bufferish && (this.bufferish = t.bufferish);
640 }
641 }
642 n(14).FlexEncoder.mixin(r.prototype),
643 (r.prototype.codec = i),
644 (r.prototype.write = function(e) {
645 this.codec.encode(this, e);
646 });
647 },
648 function(e, t, n) {
649 "use strict";
650 (function(e) {
651 /*!
652 * The buffer module from node.js, for the browser.
653 *
654 * @author Feross Aboukhadijeh <http://feross.org>
655 * @license MIT
656 */
657 var i = n(26),
658 r = n(4),
659 s = n(27);
660
661 function a() {
662 return c.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
663 }
664
665 function o(e, t) {
666 if (a() < t) throw new RangeError("Invalid typed array length");
667 return (
668 c.TYPED_ARRAY_SUPPORT
669 ? ((e = new Uint8Array(t)).__proto__ = c.prototype)
670 : (null === e && (e = new c(t)), (e.length = t)),
671 e
672 );
673 }
674
675 function c(e, t, n) {
676 if (!(c.TYPED_ARRAY_SUPPORT || this instanceof c))
677 return new c(e, t, n);
678 if ("number" == typeof e) {
679 if ("string" == typeof t)
680 throw new Error(
681 "If encoding is specified then the first argument must be a string"
682 );
683 return u(this, e);
684 }
685 return l(this, e, t, n);
686 }
687
688 function l(e, t, n, i) {
689 if ("number" == typeof t)
690 throw new TypeError('"value" argument must not be a number');
691 return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer
692 ? (function(e, t, n, i) {
693 if ((t.byteLength, n < 0 || t.byteLength < n))
694 throw new RangeError("'offset' is out of bounds");
695 if (t.byteLength < n + (i || 0))
696 throw new RangeError("'length' is out of bounds");
697 return (
698 (t =
699 void 0 === n && void 0 === i
700 ? new Uint8Array(t)
701 : void 0 === i
702 ? new Uint8Array(t, n)
703 : new Uint8Array(t, n, i)),
704 c.TYPED_ARRAY_SUPPORT
705 ? ((e = t).__proto__ = c.prototype)
706 : (e = f(e, t)),
707 e
708 );
709 })(e, t, n, i)
710 : "string" == typeof t
711 ? (function(e, t, n) {
712 if (
713 (("string" == typeof n && "" !== n) || (n = "utf8"),
714 !c.isEncoding(n))
715 )
716 throw new TypeError(
717 '"encoding" must be a valid string encoding'
718 );
719 var i = 0 | p(t, n),
720 r = (e = o(e, i)).write(t, n);
721 return r !== i && (e = e.slice(0, r)), e;
722 })(e, t, n)
723 : (function(e, t) {
724 if (c.isBuffer(t)) {
725 var n = 0 | d(t.length);
726 return 0 === (e = o(e, n)).length || t.copy(e, 0, 0, n), e;
727 }
728 if (t) {
729 if (
730 ("undefined" != typeof ArrayBuffer &&
731 t.buffer instanceof ArrayBuffer) ||
732 "length" in t
733 )
734 return "number" != typeof t.length ||
735 (function(e) {
736 return e != e;
737 })(t.length)
738 ? o(e, 0)
739 : f(e, t);
740 if ("Buffer" === t.type && s(t.data)) return f(e, t.data);
741 }
742 throw new TypeError(
743 "First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."
744 );
745 })(e, t);
746 }
747
748 function h(e) {
749 if ("number" != typeof e)
750 throw new TypeError('"size" argument must be a number');
751 if (e < 0) throw new RangeError('"size" argument must not be negative');
752 }
753
754 function u(e, t) {
755 if ((h(t), (e = o(e, t < 0 ? 0 : 0 | d(t))), !c.TYPED_ARRAY_SUPPORT))
756 for (var n = 0; n < t; ++n) e[n] = 0;
757 return e;
758 }
759
760 function f(e, t) {
761 var n = t.length < 0 ? 0 : 0 | d(t.length);
762 e = o(e, n);
763 for (var i = 0; i < n; i += 1) e[i] = 255 & t[i];
764 return e;
765 }
766
767 function d(e) {
768 if (e >= a())
769 throw new RangeError(
770 "Attempt to allocate Buffer larger than maximum size: 0x" +
771 a().toString(16) +
772 " bytes"
773 );
774 return 0 | e;
775 }
776
777 function p(e, t) {
778 if (c.isBuffer(e)) return e.length;
779 if (
780 "undefined" != typeof ArrayBuffer &&
781 "function" == typeof ArrayBuffer.isView &&
782 (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
783 )
784 return e.byteLength;
785 "string" != typeof e && (e = "" + e);
786 var n = e.length;
787 if (0 === n) return 0;
788 for (var i = !1; ; )
789 switch (t) {
790 case "ascii":
791 case "latin1":
792 case "binary":
793 return n;
794 case "utf8":
795 case "utf-8":
796 case void 0:
797 return z(e).length;
798 case "ucs2":
799 case "ucs-2":
800 case "utf16le":
801 case "utf-16le":
802 return 2 * n;
803 case "hex":
804 return n >>> 1;
805 case "base64":
806 return H(e).length;
807 default:
808 if (i) return z(e).length;
809 (t = ("" + t).toLowerCase()), (i = !0);
810 }
811 }
812
813 function g(e, t, n) {
814 var i = e[t];
815 (e[t] = e[n]), (e[n] = i);
816 }
817
818 function m(e, t, n, i, r) {
819 if (0 === e.length) return -1;
820 if (
821 ("string" == typeof n
822 ? ((i = n), (n = 0))
823 : n > 2147483647
824 ? (n = 2147483647)
825 : n < -2147483648 && (n = -2147483648),
826 (n = +n),
827 isNaN(n) && (n = r ? 0 : e.length - 1),
828 n < 0 && (n = e.length + n),
829 n >= e.length)
830 ) {
831 if (r) return -1;
832 n = e.length - 1;
833 } else if (n < 0) {
834 if (!r) return -1;
835 n = 0;
836 }
837 if (("string" == typeof t && (t = c.from(t, i)), c.isBuffer(t)))
838 return 0 === t.length ? -1 : y(e, t, n, i, r);
839 if ("number" == typeof t)
840 return (
841 (t &= 255),
842 c.TYPED_ARRAY_SUPPORT &&
843 "function" == typeof Uint8Array.prototype.indexOf
844 ? r
845 ? Uint8Array.prototype.indexOf.call(e, t, n)
846 : Uint8Array.prototype.lastIndexOf.call(e, t, n)
847 : y(e, [t], n, i, r)
848 );
849 throw new TypeError("val must be string, number or Buffer");
850 }
851
852 function y(e, t, n, i, r) {
853 var s,
854 a = 1,
855 o = e.length,
856 c = t.length;
857 if (
858 void 0 !== i &&
859 ("ucs2" === (i = String(i).toLowerCase()) ||
860 "ucs-2" === i ||
861 "utf16le" === i ||
862 "utf-16le" === i)
863 ) {
864 if (e.length < 2 || t.length < 2) return -1;
865 (a = 2), (o /= 2), (c /= 2), (n /= 2);
866 }
867
868 function l(e, t) {
869 return 1 === a ? e[t] : e.readUInt16BE(t * a);
870 }
871 if (r) {
872 var h = -1;
873 for (s = n; s < o; s++)
874 if (l(e, s) === l(t, -1 === h ? 0 : s - h)) {
875 if ((-1 === h && (h = s), s - h + 1 === c)) return h * a;
876 } else -1 !== h && (s -= s - h), (h = -1);
877 } else
878 for (n + c > o && (n = o - c), s = n; s >= 0; s--) {
879 for (var u = !0, f = 0; f < c; f++)
880 if (l(e, s + f) !== l(t, f)) {
881 u = !1;
882 break;
883 }
884 if (u) return s;
885 }
886 return -1;
887 }
888
889 function k(e, t, n, i) {
890 n = Number(n) || 0;
891 var r = e.length - n;
892 i ? (i = Number(i)) > r && (i = r) : (i = r);
893 var s = t.length;
894 if (s % 2 != 0) throw new TypeError("Invalid hex string");
895 i > s / 2 && (i = s / 2);
896 for (var a = 0; a < i; ++a) {
897 var o = parseInt(t.substr(2 * a, 2), 16);
898 if (isNaN(o)) return a;
899 e[n + a] = o;
900 }
901 return a;
902 }
903
904 function v(e, t, n, i) {
905 return V(z(t, e.length - n), e, n, i);
906 }
907
908 function w(e, t, n, i) {
909 return V(
910 (function(e) {
911 for (var t = [], n = 0; n < e.length; ++n)
912 t.push(255 & e.charCodeAt(n));
913 return t;
914 })(t),
915 e,
916 n,
917 i
918 );
919 }
920
921 function b(e, t, n, i) {
922 return w(e, t, n, i);
923 }
924
925 function x(e, t, n, i) {
926 return V(H(t), e, n, i);
927 }
928
929 function S(e, t, n, i) {
930 return V(
931 (function(e, t) {
932 for (
933 var n, i, r, s = [], a = 0;
934 a < e.length && !((t -= 2) < 0);
935 ++a
936 )
937 (i = (n = e.charCodeAt(a)) >> 8),
938 (r = n % 256),
939 s.push(r),
940 s.push(i);
941 return s;
942 })(t, e.length - n),
943 e,
944 n,
945 i
946 );
947 }
948
949 function T(e, t, n) {
950 return 0 === t && n === e.length
951 ? i.fromByteArray(e)
952 : i.fromByteArray(e.slice(t, n));
953 }
954
955 function I(e, t, n) {
956 n = Math.min(e.length, n);
957 for (var i = [], r = t; r < n; ) {
958 var s,
959 a,
960 o,
961 c,
962 l = e[r],
963 h = null,
964 u = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
965 if (r + u <= n)
966 switch (u) {
967 case 1:
968 l < 128 && (h = l);
969 break;
970 case 2:
971 128 == (192 & (s = e[r + 1])) &&
972 (c = ((31 & l) << 6) | (63 & s)) > 127 &&
973 (h = c);
974 break;
975 case 3:
976 (s = e[r + 1]),
977 (a = e[r + 2]),
978 128 == (192 & s) &&
979 128 == (192 & a) &&
980 (c = ((15 & l) << 12) | ((63 & s) << 6) | (63 & a)) >
981 2047 &&
982 (c < 55296 || c > 57343) &&
983 (h = c);
984 break;
985 case 4:
986 (s = e[r + 1]),
987 (a = e[r + 2]),
988 (o = e[r + 3]),
989 128 == (192 & s) &&
990 128 == (192 & a) &&
991 128 == (192 & o) &&
992 (c =
993 ((15 & l) << 18) |
994 ((63 & s) << 12) |
995 ((63 & a) << 6) |
996 (63 & o)) > 65535 &&
997 c < 1114112 &&
998 (h = c);
999 }
1000 null === h
1001 ? ((h = 65533), (u = 1))
1002 : h > 65535 &&
1003 ((h -= 65536),
1004 i.push(((h >>> 10) & 1023) | 55296),
1005 (h = 56320 | (1023 & h))),
1006 i.push(h),
1007 (r += u);
1008 }
1009 return (function(e) {
1010 var t = e.length;
1011 if (t <= E) return String.fromCharCode.apply(String, e);
1012 for (var n = "", i = 0; i < t; )
1013 n += String.fromCharCode.apply(String, e.slice(i, (i += E)));
1014 return n;
1015 })(i);
1016 }
1017 (t.Buffer = c),
1018 (t.SlowBuffer = function(e) {
1019 return +e != e && (e = 0), c.alloc(+e);
1020 }),
1021 (t.INSPECT_MAX_BYTES = 50),
1022 (c.TYPED_ARRAY_SUPPORT =
1023 void 0 !== e.TYPED_ARRAY_SUPPORT
1024 ? e.TYPED_ARRAY_SUPPORT
1025 : (function() {
1026 try {
1027 var e = new Uint8Array(1);
1028 return (
1029 (e.__proto__ = {
1030 __proto__: Uint8Array.prototype,
1031 foo: function() {
1032 return 42;
1033 }
1034 }),
1035 42 === e.foo() &&
1036 "function" == typeof e.subarray &&
1037 0 === e.subarray(1, 1).byteLength
1038 );
1039 } catch (e) {
1040 return !1;
1041 }
1042 })()),
1043 (t.kMaxLength = a()),
1044 (c.poolSize = 8192),
1045 (c._augment = function(e) {
1046 return (e.__proto__ = c.prototype), e;
1047 }),
1048 (c.from = function(e, t, n) {
1049 return l(null, e, t, n);
1050 }),
1051 c.TYPED_ARRAY_SUPPORT &&
1052 ((c.prototype.__proto__ = Uint8Array.prototype),
1053 (c.__proto__ = Uint8Array),
1054 "undefined" != typeof Symbol &&
1055 Symbol.species &&
1056 c[Symbol.species] === c &&
1057 Object.defineProperty(c, Symbol.species, {
1058 value: null,
1059 configurable: !0
1060 })),
1061 (c.alloc = function(e, t, n) {
1062 return (function(e, t, n, i) {
1063 return (
1064 h(t),
1065 t <= 0
1066 ? o(e, t)
1067 : void 0 !== n
1068 ? "string" == typeof i
1069 ? o(e, t).fill(n, i)
1070 : o(e, t).fill(n)
1071 : o(e, t)
1072 );
1073 })(null, e, t, n);
1074 }),
1075 (c.allocUnsafe = function(e) {
1076 return u(null, e);
1077 }),
1078 (c.allocUnsafeSlow = function(e) {
1079 return u(null, e);
1080 }),
1081 (c.isBuffer = function(e) {
1082 return !(null == e || !e._isBuffer);
1083 }),
1084 (c.compare = function(e, t) {
1085 if (!c.isBuffer(e) || !c.isBuffer(t))
1086 throw new TypeError("Arguments must be Buffers");
1087 if (e === t) return 0;
1088 for (
1089 var n = e.length, i = t.length, r = 0, s = Math.min(n, i);
1090 r < s;
1091 ++r
1092 )
1093 if (e[r] !== t[r]) {
1094 (n = e[r]), (i = t[r]);
1095 break;
1096 }
1097 return n < i ? -1 : i < n ? 1 : 0;
1098 }),
1099 (c.isEncoding = function(e) {
1100 switch (String(e).toLowerCase()) {
1101 case "hex":
1102 case "utf8":
1103 case "utf-8":
1104 case "ascii":
1105 case "latin1":
1106 case "binary":
1107 case "base64":
1108 case "ucs2":
1109 case "ucs-2":
1110 case "utf16le":
1111 case "utf-16le":
1112 return !0;
1113 default:
1114 return !1;
1115 }
1116 }),
1117 (c.concat = function(e, t) {
1118 if (!s(e))
1119 throw new TypeError('"list" argument must be an Array of Buffers');
1120 if (0 === e.length) return c.alloc(0);
1121 var n;
1122 if (void 0 === t)
1123 for (t = 0, n = 0; n < e.length; ++n) t += e[n].length;
1124 var i = c.allocUnsafe(t),
1125 r = 0;
1126 for (n = 0; n < e.length; ++n) {
1127 var a = e[n];
1128 if (!c.isBuffer(a))
1129 throw new TypeError(
1130 '"list" argument must be an Array of Buffers'
1131 );
1132 a.copy(i, r), (r += a.length);
1133 }
1134 return i;
1135 }),
1136 (c.byteLength = p),
1137 (c.prototype._isBuffer = !0),
1138 (c.prototype.swap16 = function() {
1139 var e = this.length;
1140 if (e % 2 != 0)
1141 throw new RangeError("Buffer size must be a multiple of 16-bits");
1142 for (var t = 0; t < e; t += 2) g(this, t, t + 1);
1143 return this;
1144 }),
1145 (c.prototype.swap32 = function() {
1146 var e = this.length;
1147 if (e % 4 != 0)
1148 throw new RangeError("Buffer size must be a multiple of 32-bits");
1149 for (var t = 0; t < e; t += 4)
1150 g(this, t, t + 3), g(this, t + 1, t + 2);
1151 return this;
1152 }),
1153 (c.prototype.swap64 = function() {
1154 var e = this.length;
1155 if (e % 8 != 0)
1156 throw new RangeError("Buffer size must be a multiple of 64-bits");
1157 for (var t = 0; t < e; t += 8)
1158 g(this, t, t + 7),
1159 g(this, t + 1, t + 6),
1160 g(this, t + 2, t + 5),
1161 g(this, t + 3, t + 4);
1162 return this;
1163 }),
1164 (c.prototype.toString = function() {
1165 var e = 0 | this.length;
1166 return 0 === e
1167 ? ""
1168 : 0 === arguments.length
1169 ? I(this, 0, e)
1170 : function(e, t, n) {
1171 var i = !1;
1172 if (((void 0 === t || t < 0) && (t = 0), t > this.length))
1173 return "";
1174 if (
1175 ((void 0 === n || n > this.length) && (n = this.length),
1176 n <= 0)
1177 )
1178 return "";
1179 if ((n >>>= 0) <= (t >>>= 0)) return "";
1180 for (e || (e = "utf8"); ; )
1181 switch (e) {
1182 case "hex":
1183 return P(this, t, n);
1184 case "utf8":
1185 case "utf-8":
1186 return I(this, t, n);
1187 case "ascii":
1188 return M(this, t, n);
1189 case "latin1":
1190 case "binary":
1191 return A(this, t, n);
1192 case "base64":
1193 return T(this, t, n);
1194 case "ucs2":
1195 case "ucs-2":
1196 case "utf16le":
1197 case "utf-16le":
1198 return B(this, t, n);
1199 default:
1200 if (i) throw new TypeError("Unknown encoding: " + e);
1201 (e = (e + "").toLowerCase()), (i = !0);
1202 }
1203 }.apply(this, arguments);
1204 }),
1205 (c.prototype.equals = function(e) {
1206 if (!c.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
1207 return this === e || 0 === c.compare(this, e);
1208 }),
1209 (c.prototype.inspect = function() {
1210 var e = "",
1211 n = t.INSPECT_MAX_BYTES;
1212 return (
1213 this.length > 0 &&
1214 ((e = this.toString("hex", 0, n)
1215 .match(/.{2}/g)
1216 .join(" ")),
1217 this.length > n && (e += " ... ")),
1218 "<Buffer " + e + ">"
1219 );
1220 }),
1221 (c.prototype.compare = function(e, t, n, i, r) {
1222 if (!c.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
1223 if (
1224 (void 0 === t && (t = 0),
1225 void 0 === n && (n = e ? e.length : 0),
1226 void 0 === i && (i = 0),
1227 void 0 === r && (r = this.length),
1228 t < 0 || n > e.length || i < 0 || r > this.length)
1229 )
1230 throw new RangeError("out of range index");
1231 if (i >= r && t >= n) return 0;
1232 if (i >= r) return -1;
1233 if (t >= n) return 1;
1234 if (this === e) return 0;
1235 for (
1236 var s = (r >>>= 0) - (i >>>= 0),
1237 a = (n >>>= 0) - (t >>>= 0),
1238 o = Math.min(s, a),
1239 l = this.slice(i, r),
1240 h = e.slice(t, n),
1241 u = 0;
1242 u < o;
1243 ++u
1244 )
1245 if (l[u] !== h[u]) {
1246 (s = l[u]), (a = h[u]);
1247 break;
1248 }
1249 return s < a ? -1 : a < s ? 1 : 0;
1250 }),
1251 (c.prototype.includes = function(e, t, n) {
1252 return -1 !== this.indexOf(e, t, n);
1253 }),
1254 (c.prototype.indexOf = function(e, t, n) {
1255 return m(this, e, t, n, !0);
1256 }),
1257 (c.prototype.lastIndexOf = function(e, t, n) {
1258 return m(this, e, t, n, !1);
1259 }),
1260 (c.prototype.write = function(e, t, n, i) {
1261 if (void 0 === t) (i = "utf8"), (n = this.length), (t = 0);
1262 else if (void 0 === n && "string" == typeof t)
1263 (i = t), (n = this.length), (t = 0);
1264 else {
1265 if (!isFinite(t))
1266 throw new Error(
1267 "Buffer.write(string, encoding, offset[, length]) is no longer supported"
1268 );
1269 (t |= 0),
1270 isFinite(n)
1271 ? ((n |= 0), void 0 === i && (i = "utf8"))
1272 : ((i = n), (n = void 0));
1273 }
1274 var r = this.length - t;
1275 if (
1276 ((void 0 === n || n > r) && (n = r),
1277 (e.length > 0 && (n < 0 || t < 0)) || t > this.length)
1278 )
1279 throw new RangeError("Attempt to write outside buffer bounds");
1280 i || (i = "utf8");
1281 for (var s = !1; ; )
1282 switch (i) {
1283 case "hex":
1284 return k(this, e, t, n);
1285 case "utf8":
1286 case "utf-8":
1287 return v(this, e, t, n);
1288 case "ascii":
1289 return w(this, e, t, n);
1290 case "latin1":
1291 case "binary":
1292 return b(this, e, t, n);
1293 case "base64":
1294 return x(this, e, t, n);
1295 case "ucs2":
1296 case "ucs-2":
1297 case "utf16le":
1298 case "utf-16le":
1299 return S(this, e, t, n);
1300 default:
1301 if (s) throw new TypeError("Unknown encoding: " + i);
1302 (i = ("" + i).toLowerCase()), (s = !0);
1303 }
1304 }),
1305 (c.prototype.toJSON = function() {
1306 return {
1307 type: "Buffer",
1308 data: Array.prototype.slice.call(this._arr || this, 0)
1309 };
1310 });
1311 var E = 4096;
1312
1313 function M(e, t, n) {
1314 var i = "";
1315 n = Math.min(e.length, n);
1316 for (var r = t; r < n; ++r) i += String.fromCharCode(127 & e[r]);
1317 return i;
1318 }
1319
1320 function A(e, t, n) {
1321 var i = "";
1322 n = Math.min(e.length, n);
1323 for (var r = t; r < n; ++r) i += String.fromCharCode(e[r]);
1324 return i;
1325 }
1326
1327 function P(e, t, n) {
1328 var i = e.length;
1329 (!t || t < 0) && (t = 0), (!n || n < 0 || n > i) && (n = i);
1330 for (var r = "", s = t; s < n; ++s) r += F(e[s]);
1331 return r;
1332 }
1333
1334 function B(e, t, n) {
1335 for (var i = e.slice(t, n), r = "", s = 0; s < i.length; s += 2)
1336 r += String.fromCharCode(i[s] + 256 * i[s + 1]);
1337 return r;
1338 }
1339
1340 function C(e, t, n) {
1341 if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
1342 if (e + t > n)
1343 throw new RangeError("Trying to access beyond buffer length");
1344 }
1345
1346 function O(e, t, n, i, r, s) {
1347 if (!c.isBuffer(e))
1348 throw new TypeError('"buffer" argument must be a Buffer instance');
1349 if (t > r || t < s)
1350 throw new RangeError('"value" argument is out of bounds');
1351 if (n + i > e.length) throw new RangeError("Index out of range");
1352 }
1353
1354 function R(e, t, n, i) {
1355 t < 0 && (t = 65535 + t + 1);
1356 for (var r = 0, s = Math.min(e.length - n, 2); r < s; ++r)
1357 e[n + r] =
1358 (t & (255 << (8 * (i ? r : 1 - r)))) >>> (8 * (i ? r : 1 - r));
1359 }
1360
1361 function j(e, t, n, i) {
1362 t < 0 && (t = 4294967295 + t + 1);
1363 for (var r = 0, s = Math.min(e.length - n, 4); r < s; ++r)
1364 e[n + r] = (t >>> (8 * (i ? r : 3 - r))) & 255;
1365 }
1366
1367 function _(e, t, n, i, r, s) {
1368 if (n + i > e.length) throw new RangeError("Index out of range");
1369 if (n < 0) throw new RangeError("Index out of range");
1370 }
1371
1372 function U(e, t, n, i, s) {
1373 return s || _(e, 0, n, 4), r.write(e, t, n, i, 23, 4), n + 4;
1374 }
1375
1376 function D(e, t, n, i, s) {
1377 return s || _(e, 0, n, 8), r.write(e, t, n, i, 52, 8), n + 8;
1378 }
1379 (c.prototype.slice = function(e, t) {
1380 var n,
1381 i = this.length;
1382 if (
1383 ((e = ~~e) < 0 ? (e += i) < 0 && (e = 0) : e > i && (e = i),
1384 (t = void 0 === t ? i : ~~t) < 0
1385 ? (t += i) < 0 && (t = 0)
1386 : t > i && (t = i),
1387 t < e && (t = e),
1388 c.TYPED_ARRAY_SUPPORT)
1389 )
1390 (n = this.subarray(e, t)).__proto__ = c.prototype;
1391 else {
1392 var r = t - e;
1393 n = new c(r, void 0);
1394 for (var s = 0; s < r; ++s) n[s] = this[s + e];
1395 }
1396 return n;
1397 }),
1398 (c.prototype.readUIntLE = function(e, t, n) {
1399 (e |= 0), (t |= 0), n || C(e, t, this.length);
1400 for (var i = this[e], r = 1, s = 0; ++s < t && (r *= 256); )
1401 i += this[e + s] * r;
1402 return i;
1403 }),
1404 (c.prototype.readUIntBE = function(e, t, n) {
1405 (e |= 0), (t |= 0), n || C(e, t, this.length);
1406 for (var i = this[e + --t], r = 1; t > 0 && (r *= 256); )
1407 i += this[e + --t] * r;
1408 return i;
1409 }),
1410 (c.prototype.readUInt8 = function(e, t) {
1411 return t || C(e, 1, this.length), this[e];
1412 }),
1413 (c.prototype.readUInt16LE = function(e, t) {
1414 return t || C(e, 2, this.length), this[e] | (this[e + 1] << 8);
1415 }),
1416 (c.prototype.readUInt16BE = function(e, t) {
1417 return t || C(e, 2, this.length), (this[e] << 8) | this[e + 1];
1418 }),
1419 (c.prototype.readUInt32LE = function(e, t) {
1420 return (
1421 t || C(e, 4, this.length),
1422 (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) +
1423 16777216 * this[e + 3]
1424 );
1425 }),
1426 (c.prototype.readUInt32BE = function(e, t) {
1427 return (
1428 t || C(e, 4, this.length),
1429 16777216 * this[e] +
1430 ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
1431 );
1432 }),
1433 (c.prototype.readIntLE = function(e, t, n) {
1434 (e |= 0), (t |= 0), n || C(e, t, this.length);
1435 for (var i = this[e], r = 1, s = 0; ++s < t && (r *= 256); )
1436 i += this[e + s] * r;
1437 return i >= (r *= 128) && (i -= Math.pow(2, 8 * t)), i;
1438 }),
1439 (c.prototype.readIntBE = function(e, t, n) {
1440 (e |= 0), (t |= 0), n || C(e, t, this.length);
1441 for (var i = t, r = 1, s = this[e + --i]; i > 0 && (r *= 256); )
1442 s += this[e + --i] * r;
1443 return s >= (r *= 128) && (s -= Math.pow(2, 8 * t)), s;
1444 }),
1445 (c.prototype.readInt8 = function(e, t) {
1446 return (
1447 t || C(e, 1, this.length),
1448 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
1449 );
1450 }),
1451 (c.prototype.readInt16LE = function(e, t) {
1452 t || C(e, 2, this.length);
1453 var n = this[e] | (this[e + 1] << 8);
1454 return 32768 & n ? 4294901760 | n : n;
1455 }),
1456 (c.prototype.readInt16BE = function(e, t) {
1457 t || C(e, 2, this.length);
1458 var n = this[e + 1] | (this[e] << 8);
1459 return 32768 & n ? 4294901760 | n : n;
1460 }),
1461 (c.prototype.readInt32LE = function(e, t) {
1462 return (
1463 t || C(e, 4, this.length),
1464 this[e] |
1465 (this[e + 1] << 8) |
1466 (this[e + 2] << 16) |
1467 (this[e + 3] << 24)
1468 );
1469 }),
1470 (c.prototype.readInt32BE = function(e, t) {
1471 return (
1472 t || C(e, 4, this.length),
1473 (this[e] << 24) |
1474 (this[e + 1] << 16) |
1475 (this[e + 2] << 8) |
1476 this[e + 3]
1477 );
1478 }),
1479 (c.prototype.readFloatLE = function(e, t) {
1480 return t || C(e, 4, this.length), r.read(this, e, !0, 23, 4);
1481 }),
1482 (c.prototype.readFloatBE = function(e, t) {
1483 return t || C(e, 4, this.length), r.read(this, e, !1, 23, 4);
1484 }),
1485 (c.prototype.readDoubleLE = function(e, t) {
1486 return t || C(e, 8, this.length), r.read(this, e, !0, 52, 8);
1487 }),
1488 (c.prototype.readDoubleBE = function(e, t) {
1489 return t || C(e, 8, this.length), r.read(this, e, !1, 52, 8);
1490 }),
1491 (c.prototype.writeUIntLE = function(e, t, n, i) {
1492 (e = +e),
1493 (t |= 0),
1494 (n |= 0),
1495 i || O(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
1496 var r = 1,
1497 s = 0;
1498 for (this[t] = 255 & e; ++s < n && (r *= 256); )
1499 this[t + s] = (e / r) & 255;
1500 return t + n;
1501 }),
1502 (c.prototype.writeUIntBE = function(e, t, n, i) {
1503 (e = +e),
1504 (t |= 0),
1505 (n |= 0),
1506 i || O(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
1507 var r = n - 1,
1508 s = 1;
1509 for (this[t + r] = 255 & e; --r >= 0 && (s *= 256); )
1510 this[t + r] = (e / s) & 255;
1511 return t + n;
1512 }),
1513 (c.prototype.writeUInt8 = function(e, t, n) {
1514 return (
1515 (e = +e),
1516 (t |= 0),
1517 n || O(this, e, t, 1, 255, 0),
1518 c.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
1519 (this[t] = 255 & e),
1520 t + 1
1521 );
1522 }),
1523 (c.prototype.writeUInt16LE = function(e, t, n) {
1524 return (
1525 (e = +e),
1526 (t |= 0),
1527 n || O(this, e, t, 2, 65535, 0),
1528 c.TYPED_ARRAY_SUPPORT
1529 ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
1530 : R(this, e, t, !0),
1531 t + 2
1532 );
1533 }),
1534 (c.prototype.writeUInt16BE = function(e, t, n) {
1535 return (
1536 (e = +e),
1537 (t |= 0),
1538 n || O(this, e, t, 2, 65535, 0),
1539 c.TYPED_ARRAY_SUPPORT
1540 ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
1541 : R(this, e, t, !1),
1542 t + 2
1543 );
1544 }),
1545 (c.prototype.writeUInt32LE = function(e, t, n) {
1546 return (
1547 (e = +e),
1548 (t |= 0),
1549 n || O(this, e, t, 4, 4294967295, 0),
1550 c.TYPED_ARRAY_SUPPORT
1551 ? ((this[t + 3] = e >>> 24),
1552 (this[t + 2] = e >>> 16),
1553 (this[t + 1] = e >>> 8),
1554 (this[t] = 255 & e))
1555 : j(this, e, t, !0),
1556 t + 4
1557 );
1558 }),
1559 (c.prototype.writeUInt32BE = function(e, t, n) {
1560 return (
1561 (e = +e),
1562 (t |= 0),
1563 n || O(this, e, t, 4, 4294967295, 0),
1564 c.TYPED_ARRAY_SUPPORT
1565 ? ((this[t] = e >>> 24),
1566 (this[t + 1] = e >>> 16),
1567 (this[t + 2] = e >>> 8),
1568 (this[t + 3] = 255 & e))
1569 : j(this, e, t, !1),
1570 t + 4
1571 );
1572 }),
1573 (c.prototype.writeIntLE = function(e, t, n, i) {
1574 if (((e = +e), (t |= 0), !i)) {
1575 var r = Math.pow(2, 8 * n - 1);
1576 O(this, e, t, n, r - 1, -r);
1577 }
1578 var s = 0,
1579 a = 1,
1580 o = 0;
1581 for (this[t] = 255 & e; ++s < n && (a *= 256); )
1582 e < 0 && 0 === o && 0 !== this[t + s - 1] && (o = 1),
1583 (this[t + s] = (((e / a) >> 0) - o) & 255);
1584 return t + n;
1585 }),
1586 (c.prototype.writeIntBE = function(e, t, n, i) {
1587 if (((e = +e), (t |= 0), !i)) {
1588 var r = Math.pow(2, 8 * n - 1);
1589 O(this, e, t, n, r - 1, -r);
1590 }
1591 var s = n - 1,
1592 a = 1,
1593 o = 0;
1594 for (this[t + s] = 255 & e; --s >= 0 && (a *= 256); )
1595 e < 0 && 0 === o && 0 !== this[t + s + 1] && (o = 1),
1596 (this[t + s] = (((e / a) >> 0) - o) & 255);
1597 return t + n;
1598 }),
1599 (c.prototype.writeInt8 = function(e, t, n) {
1600 return (
1601 (e = +e),
1602 (t |= 0),
1603 n || O(this, e, t, 1, 127, -128),
1604 c.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
1605 e < 0 && (e = 255 + e + 1),
1606 (this[t] = 255 & e),
1607 t + 1
1608 );
1609 }),
1610 (c.prototype.writeInt16LE = function(e, t, n) {
1611 return (
1612 (e = +e),
1613 (t |= 0),
1614 n || O(this, e, t, 2, 32767, -32768),
1615 c.TYPED_ARRAY_SUPPORT
1616 ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
1617 : R(this, e, t, !0),
1618 t + 2
1619 );
1620 }),
1621 (c.prototype.writeInt16BE = function(e, t, n) {
1622 return (
1623 (e = +e),
1624 (t |= 0),
1625 n || O(this, e, t, 2, 32767, -32768),
1626 c.TYPED_ARRAY_SUPPORT
1627 ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
1628 : R(this, e, t, !1),
1629 t + 2
1630 );
1631 }),
1632 (c.prototype.writeInt32LE = function(e, t, n) {
1633 return (
1634 (e = +e),
1635 (t |= 0),
1636 n || O(this, e, t, 4, 2147483647, -2147483648),
1637 c.TYPED_ARRAY_SUPPORT
1638 ? ((this[t] = 255 & e),
1639 (this[t + 1] = e >>> 8),
1640 (this[t + 2] = e >>> 16),
1641 (this[t + 3] = e >>> 24))
1642 : j(this, e, t, !0),
1643 t + 4
1644 );
1645 }),
1646 (c.prototype.writeInt32BE = function(e, t, n) {
1647 return (
1648 (e = +e),
1649 (t |= 0),
1650 n || O(this, e, t, 4, 2147483647, -2147483648),
1651 e < 0 && (e = 4294967295 + e + 1),
1652 c.TYPED_ARRAY_SUPPORT
1653 ? ((this[t] = e >>> 24),
1654 (this[t + 1] = e >>> 16),
1655 (this[t + 2] = e >>> 8),
1656 (this[t + 3] = 255 & e))
1657 : j(this, e, t, !1),
1658 t + 4
1659 );
1660 }),
1661 (c.prototype.writeFloatLE = function(e, t, n) {
1662 return U(this, e, t, !0, n);
1663 }),
1664 (c.prototype.writeFloatBE = function(e, t, n) {
1665 return U(this, e, t, !1, n);
1666 }),
1667 (c.prototype.writeDoubleLE = function(e, t, n) {
1668 return D(this, e, t, !0, n);
1669 }),
1670 (c.prototype.writeDoubleBE = function(e, t, n) {
1671 return D(this, e, t, !1, n);
1672 }),
1673 (c.prototype.copy = function(e, t, n, i) {
1674 if (
1675 (n || (n = 0),
1676 i || 0 === i || (i = this.length),
1677 t >= e.length && (t = e.length),
1678 t || (t = 0),
1679 i > 0 && i < n && (i = n),
1680 i === n)
1681 )
1682 return 0;
1683 if (0 === e.length || 0 === this.length) return 0;
1684 if (t < 0) throw new RangeError("targetStart out of bounds");
1685 if (n < 0 || n >= this.length)
1686 throw new RangeError("sourceStart out of bounds");
1687 if (i < 0) throw new RangeError("sourceEnd out of bounds");
1688 i > this.length && (i = this.length),
1689 e.length - t < i - n && (i = e.length - t + n);
1690 var r,
1691 s = i - n;
1692 if (this === e && n < t && t < i)
1693 for (r = s - 1; r >= 0; --r) e[r + t] = this[r + n];
1694 else if (s < 1e3 || !c.TYPED_ARRAY_SUPPORT)
1695 for (r = 0; r < s; ++r) e[r + t] = this[r + n];
1696 else Uint8Array.prototype.set.call(e, this.subarray(n, n + s), t);
1697 return s;
1698 }),
1699 (c.prototype.fill = function(e, t, n, i) {
1700 if ("string" == typeof e) {
1701 if (
1702 ("string" == typeof t
1703 ? ((i = t), (t = 0), (n = this.length))
1704 : "string" == typeof n && ((i = n), (n = this.length)),
1705 1 === e.length)
1706 ) {
1707 var r = e.charCodeAt(0);
1708 r < 256 && (e = r);
1709 }
1710 if (void 0 !== i && "string" != typeof i)
1711 throw new TypeError("encoding must be a string");
1712 if ("string" == typeof i && !c.isEncoding(i))
1713 throw new TypeError("Unknown encoding: " + i);
1714 } else "number" == typeof e && (e &= 255);
1715 if (t < 0 || this.length < t || this.length < n)
1716 throw new RangeError("Out of range index");
1717 if (n <= t) return this;
1718 var s;
1719 if (
1720 ((t >>>= 0),
1721 (n = void 0 === n ? this.length : n >>> 0),
1722 e || (e = 0),
1723 "number" == typeof e)
1724 )
1725 for (s = t; s < n; ++s) this[s] = e;
1726 else {
1727 var a = c.isBuffer(e) ? e : z(new c(e, i).toString()),
1728 o = a.length;
1729 for (s = 0; s < n - t; ++s) this[s + t] = a[s % o];
1730 }
1731 return this;
1732 });
1733 var L = /[^+\/0-9A-Za-z-_]/g;
1734
1735 function F(e) {
1736 return e < 16 ? "0" + e.toString(16) : e.toString(16);
1737 }
1738
1739 function z(e, t) {
1740 var n;
1741 t = t || 1 / 0;
1742 for (var i = e.length, r = null, s = [], a = 0; a < i; ++a) {
1743 if ((n = e.charCodeAt(a)) > 55295 && n < 57344) {
1744 if (!r) {
1745 if (n > 56319) {
1746 (t -= 3) > -1 && s.push(239, 191, 189);
1747 continue;
1748 }
1749 if (a + 1 === i) {
1750 (t -= 3) > -1 && s.push(239, 191, 189);
1751 continue;
1752 }
1753 r = n;
1754 continue;
1755 }
1756 if (n < 56320) {
1757 (t -= 3) > -1 && s.push(239, 191, 189), (r = n);
1758 continue;
1759 }
1760 n = 65536 + (((r - 55296) << 10) | (n - 56320));
1761 } else r && (t -= 3) > -1 && s.push(239, 191, 189);
1762 if (((r = null), n < 128)) {
1763 if ((t -= 1) < 0) break;
1764 s.push(n);
1765 } else if (n < 2048) {
1766 if ((t -= 2) < 0) break;
1767 s.push((n >> 6) | 192, (63 & n) | 128);
1768 } else if (n < 65536) {
1769 if ((t -= 3) < 0) break;
1770 s.push((n >> 12) | 224, ((n >> 6) & 63) | 128, (63 & n) | 128);
1771 } else {
1772 if (!(n < 1114112)) throw new Error("Invalid code point");
1773 if ((t -= 4) < 0) break;
1774 s.push(
1775 (n >> 18) | 240,
1776 ((n >> 12) & 63) | 128,
1777 ((n >> 6) & 63) | 128,
1778 (63 & n) | 128
1779 );
1780 }
1781 }
1782 return s;
1783 }
1784
1785 function H(e) {
1786 return i.toByteArray(
1787 (function(e) {
1788 if (
1789 (e = (function(e) {
1790 return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
1791 })(e).replace(L, "")).length < 2
1792 )
1793 return "";
1794 for (; e.length % 4 != 0; ) e += "=";
1795 return e;
1796 })(e)
1797 );
1798 }
1799
1800 function V(e, t, n, i) {
1801 for (var r = 0; r < i && !(r + n >= t.length || r >= e.length); ++r)
1802 t[r + n] = e[r];
1803 return r;
1804 }
1805 }.call(this, n(12)));
1806 },
1807 function(e, t) {
1808 var n;
1809 n = (function() {
1810 return this;
1811 })();
1812 try {
1813 n = n || new Function("return this")();
1814 } catch (e) {
1815 "object" == typeof window && (n = window);
1816 }
1817 e.exports = n;
1818 },
1819 function(e, t) {
1820 for (var n = (t.uint8 = new Array(256)), i = 0; i <= 255; i++) n[i] = r(i);
1821
1822 function r(e) {
1823 return function(t) {
1824 var n = t.reserve(1);
1825 t.buffer[n] = e;
1826 };
1827 }
1828 },
1829 function(e, t, n) {
1830 (t.FlexDecoder = s), (t.FlexEncoder = a);
1831 var i = n(0),
1832 r = "BUFFER_SHORTAGE";
1833
1834 function s() {
1835 if (!(this instanceof s)) return new s();
1836 }
1837
1838 function a() {
1839 if (!(this instanceof a)) return new a();
1840 }
1841
1842 function o() {
1843 throw new Error("method not implemented: write()");
1844 }
1845
1846 function c() {
1847 throw new Error("method not implemented: fetch()");
1848 }
1849
1850 function l() {
1851 return this.buffers && this.buffers.length
1852 ? (this.flush(), this.pull())
1853 : this.fetch();
1854 }
1855
1856 function h(e) {
1857 (this.buffers || (this.buffers = [])).push(e);
1858 }
1859
1860 function u() {
1861 return (this.buffers || (this.buffers = [])).shift();
1862 }
1863
1864 function f(e) {
1865 return function(t) {
1866 for (var n in e) t[n] = e[n];
1867 return t;
1868 };
1869 }
1870 (s.mixin = f({
1871 bufferish: i,
1872 write: function(e) {
1873 var t = this.offset
1874 ? i.prototype.slice.call(this.buffer, this.offset)
1875 : this.buffer;
1876 (this.buffer = t ? (e ? this.bufferish.concat([t, e]) : t) : e),
1877 (this.offset = 0);
1878 },
1879 fetch: c,
1880 flush: function() {
1881 for (; this.offset < this.buffer.length; ) {
1882 var e,
1883 t = this.offset;
1884 try {
1885 e = this.fetch();
1886 } catch (e) {
1887 if (e && e.message != r) throw e;
1888 this.offset = t;
1889 break;
1890 }
1891 this.push(e);
1892 }
1893 },
1894 push: h,
1895 pull: u,
1896 read: l,
1897 reserve: function(e) {
1898 var t = this.offset,
1899 n = t + e;
1900 if (n > this.buffer.length) throw new Error(r);
1901 return (this.offset = n), t;
1902 },
1903 offset: 0
1904 })),
1905 s.mixin(s.prototype),
1906 (a.mixin = f({
1907 bufferish: i,
1908 write: o,
1909 fetch: function() {
1910 var e = this.start;
1911 if (e < this.offset) {
1912 var t = (this.start = this.offset);
1913 return i.prototype.slice.call(this.buffer, e, t);
1914 }
1915 },
1916 flush: function() {
1917 for (; this.start < this.offset; ) {
1918 var e = this.fetch();
1919 e && this.push(e);
1920 }
1921 },
1922 push: h,
1923 pull: function() {
1924 var e = this.buffers || (this.buffers = []),
1925 t = e.length > 1 ? this.bufferish.concat(e) : e[0];
1926 return (e.length = 0), t;
1927 },
1928 read: l,
1929 reserve: function(e) {
1930 var t = 0 | e;
1931 if (this.buffer) {
1932 var n = this.buffer.length,
1933 i = 0 | this.offset,
1934 r = i + t;
1935 if (r < n) return (this.offset = r), i;
1936 this.flush(),
1937 (e = Math.max(e, Math.min(2 * n, this.maxBufferSize)));
1938 }
1939 return (
1940 (e = Math.max(e, this.minBufferSize)),
1941 (this.buffer = this.bufferish.alloc(e)),
1942 (this.start = 0),
1943 (this.offset = t),
1944 0
1945 );
1946 },
1947 send: function(e) {
1948 var t = e.length;
1949 if (t > this.minBufferSize) this.flush(), this.push(e);
1950 else {
1951 var n = this.reserve(t);
1952 i.prototype.copy.call(e, this.buffer, n);
1953 }
1954 },
1955 maxBufferSize: 65536,
1956 minBufferSize: 2048,
1957 offset: 0,
1958 start: 0
1959 })),
1960 a.mixin(a.prototype);
1961 },
1962 function(e, t, n) {
1963 t.decode = function(e, t) {
1964 var n = new i(t);
1965 return n.write(e), n.read();
1966 };
1967 var i = n(16).DecodeBuffer;
1968 },
1969 function(e, t, n) {
1970 t.DecodeBuffer = r;
1971 var i = n(8).preset;
1972
1973 function r(e) {
1974 if (!(this instanceof r)) return new r(e);
1975 if (e && ((this.options = e), e.codec)) {
1976 var t = (this.codec = e.codec);
1977 t.bufferish && (this.bufferish = t.bufferish);
1978 }
1979 }
1980 n(14).FlexDecoder.mixin(r.prototype),
1981 (r.prototype.codec = i),
1982 (r.prototype.fetch = function() {
1983 return this.codec.decode(this);
1984 });
1985 },
1986 function(e, t, n) {
1987 var i = n(4),
1988 r = n(7),
1989 s = r.Uint64BE,
1990 a = r.Int64BE;
1991 (t.getReadFormat = function(e) {
1992 var t = o.hasArrayBuffer && e && e.binarraybuffer,
1993 n = e && e.int64;
1994 return {
1995 map: l && e && e.usemap ? u : h,
1996 array: f,
1997 str: d,
1998 bin: t ? g : p,
1999 ext: m,
2000 uint8: y,
2001 uint16: v,
2002 uint32: b,
2003 uint64: S(8, n ? E : T),
2004 int8: k,
2005 int16: w,
2006 int32: x,
2007 int64: S(8, n ? M : I),
2008 float32: S(4, A),
2009 float64: S(8, P)
2010 };
2011 }),
2012 (t.readUint8 = y);
2013 var o = n(0),
2014 c = n(6),
2015 l = "undefined" != typeof Map;
2016
2017 function h(e, t) {
2018 var n,
2019 i = {},
2020 r = new Array(t),
2021 s = new Array(t),
2022 a = e.codec.decode;
2023 for (n = 0; n < t; n++) (r[n] = a(e)), (s[n] = a(e));
2024 for (n = 0; n < t; n++) i[r[n]] = s[n];
2025 return i;
2026 }
2027
2028 function u(e, t) {
2029 var n,
2030 i = new Map(),
2031 r = new Array(t),
2032 s = new Array(t),
2033 a = e.codec.decode;
2034 for (n = 0; n < t; n++) (r[n] = a(e)), (s[n] = a(e));
2035 for (n = 0; n < t; n++) i.set(r[n], s[n]);
2036 return i;
2037 }
2038
2039 function f(e, t) {
2040 for (var n = new Array(t), i = e.codec.decode, r = 0; r < t; r++)
2041 n[r] = i(e);
2042 return n;
2043 }
2044
2045 function d(e, t) {
2046 var n = e.reserve(t),
2047 i = n + t;
2048 return c.toString.call(e.buffer, "utf-8", n, i);
2049 }
2050
2051 function p(e, t) {
2052 var n = e.reserve(t),
2053 i = n + t,
2054 r = c.slice.call(e.buffer, n, i);
2055 return o.from(r);
2056 }
2057
2058 function g(e, t) {
2059 var n = e.reserve(t),
2060 i = n + t,
2061 r = c.slice.call(e.buffer, n, i);
2062 return o.Uint8Array.from(r).buffer;
2063 }
2064
2065 function m(e, t) {
2066 var n = e.reserve(t + 1),
2067 i = e.buffer[n++],
2068 r = n + t,
2069 s = e.codec.getExtUnpacker(i);
2070 if (!s)
2071 throw new Error("Invalid ext type: " + (i ? "0x" + i.toString(16) : i));
2072 return s(c.slice.call(e.buffer, n, r));
2073 }
2074
2075 function y(e) {
2076 var t = e.reserve(1);
2077 return e.buffer[t];
2078 }
2079
2080 function k(e) {
2081 var t = e.reserve(1),
2082 n = e.buffer[t];
2083 return 128 & n ? n - 256 : n;
2084 }
2085
2086 function v(e) {
2087 var t = e.reserve(2),
2088 n = e.buffer;
2089 return (n[t++] << 8) | n[t];
2090 }
2091
2092 function w(e) {
2093 var t = e.reserve(2),
2094 n = e.buffer,
2095 i = (n[t++] << 8) | n[t];
2096 return 32768 & i ? i - 65536 : i;
2097 }
2098
2099 function b(e) {
2100 var t = e.reserve(4),
2101 n = e.buffer;
2102 return 16777216 * n[t++] + (n[t++] << 16) + (n[t++] << 8) + n[t];
2103 }
2104
2105 function x(e) {
2106 var t = e.reserve(4),
2107 n = e.buffer;
2108 return (n[t++] << 24) | (n[t++] << 16) | (n[t++] << 8) | n[t];
2109 }
2110
2111 function S(e, t) {
2112 return function(n) {
2113 var i = n.reserve(e);
2114 return t.call(n.buffer, i, !0);
2115 };
2116 }
2117
2118 function T(e) {
2119 return new s(this, e).toNumber();
2120 }
2121
2122 function I(e) {
2123 return new a(this, e).toNumber();
2124 }
2125
2126 function E(e) {
2127 return new s(this, e);
2128 }
2129
2130 function M(e) {
2131 return new a(this, e);
2132 }
2133
2134 function A(e) {
2135 return i.read(this, e, !1, 23, 4);
2136 }
2137
2138 function P(e) {
2139 return i.read(this, e, !1, 52, 8);
2140 }
2141 },
2142 function(e, t, n) {
2143 !(function(t) {
2144 e.exports = t;
2145 var n = "listeners",
2146 i = {
2147 on: function(e, t) {
2148 return a(this, e).push(t), this;
2149 },
2150 once: function(e, t) {
2151 var n = this;
2152 return (i.originalListener = t), a(n, e).push(i), n;
2153
2154 function i() {
2155 s.call(n, e, i), t.apply(this, arguments);
2156 }
2157 },
2158 off: s,
2159 emit: function(e, t) {
2160 var n = this,
2161 i = a(n, e, !0);
2162 if (!i) return !1;
2163 var r = arguments.length;
2164 if (1 === r)
2165 i.forEach(function(e) {
2166 e.call(n);
2167 });
2168 else if (2 === r)
2169 i.forEach(function(e) {
2170 e.call(n, t);
2171 });
2172 else {
2173 var s = Array.prototype.slice.call(arguments, 1);
2174 i.forEach(function(e) {
2175 e.apply(n, s);
2176 });
2177 }
2178 return !!i.length;
2179 }
2180 };
2181
2182 function r(e) {
2183 for (var t in i) e[t] = i[t];
2184 return e;
2185 }
2186
2187 function s(e, t) {
2188 var i;
2189 if (arguments.length) {
2190 if (t) {
2191 if ((i = a(this, e, !0))) {
2192 if (
2193 !(i = i.filter(function(e) {
2194 return e !== t && e.originalListener !== t;
2195 })).length
2196 )
2197 return s.call(this, e);
2198 this[n][e] = i;
2199 }
2200 } else if ((i = this[n]) && (delete i[e], !Object.keys(i).length))
2201 return s.call(this);
2202 } else delete this[n];
2203 return this;
2204 }
2205
2206 function a(e, t, i) {
2207 if (!i || e[n]) {
2208 var r = e[n] || (e[n] = {});
2209 return r[t] || (r[t] = []);
2210 }
2211 }
2212 r(t.prototype), (t.mixin = r);
2213 })(
2214 /**
2215 * event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
2216 *
2217 * @copyright Yusuke Kawasaki
2218 * @license MIT
2219 * @constructor
2220 * @see https://github.com/kawanet/event-lite
2221 * @see http://kawanet.github.io/event-lite/EventLite.html
2222 * @example
2223 * var EventLite = require("event-lite");
2224 *
2225 * function MyClass() {...} // your class
2226 *
2227 * EventLite.mixin(MyClass.prototype); // import event methods
2228 *
2229 * var obj = new MyClass();
2230 * obj.on("foo", function() {...}); // add event listener
2231 * obj.once("bar", function() {...}); // add one-time event listener
2232 * obj.emit("foo"); // dispatch event
2233 * obj.emit("bar"); // dispatch another event
2234 * obj.off("foo"); // remove event listener
2235 */
2236 function e() {
2237 if (!(this instanceof e)) return new e();
2238 }
2239 );
2240 },
2241 function(e, t, n) {
2242 (function(t) {
2243 (e.exports.maxScreenWidth = 2120),
2244 (e.exports.maxScreenHeight = 1180),
2245 (e.exports.serverUpdateRate = 9),
2246 (e.exports.maxPlayers = 50),
2247 (e.exports.maxPlayersHard = 50),
2248 (e.exports.collisionDepth = 6),
2249 (e.exports.minimapRate = 3e3),
2250 (e.exports.colGrid = 10),
2251 (e.exports.clientSendRate = 5),
2252 (e.exports.healthBarWidth = 50),
2253 (e.exports.healthBarPad = 4.5),
2254 (e.exports.iconPadding = 15),
2255 (e.exports.iconPad = 0.9),
2256 (e.exports.SamMODFadeout = 1),
2257 (e.exports.crownIconScale = 60),
2258 (e.exports.crownPad = 35),
2259 (e.exports.chatCountdown = 3000),
2260 (e.exports.chatCooldown = 0),
2261 (e.exports.inSandbox = t && "mm_exp" === t.env.VULTR_SCHEME),
2262 (e.exports.maxAge = 100),
2263 (e.exports.gatherAngle = Math.PI / 2.6),
2264 (e.exports.gatherWiggle = 10),
2265 (e.exports.hitReturnRatio = 0.25),
2266 (e.exports.hitAngle = Math.PI / 2),
2267 (e.exports.playerScale = 35),
2268 (e.exports.playerSpeed = 0.0016),
2269 (e.exports.playerDecel = 0.993),
2270 (e.exports.nameY = 34),
2271 (e.exports.skinColors = [
2272 "#bf8f54",
2273 "#cbb091",
2274 "#896c4b",
2275 "#fadadc",
2276 "#ececec",
2277 "#c37373",
2278 "#4c4c4c",
2279 "#ecaff7",
2280 "#738cc3",
2281 "#8bc373"
2282 ]),
2283 (e.exports.animalCount = 7),
2284 (e.exports.aiTurnRandom = 0.06),
2285 (e.exports.cowNames = [
2286 "Lovable",
2287 "Nuro.",
2288 "MythicalPenguin",
2289 "A cool guy",
2290 "DaPenguin"
2291 ]),
2292 (e.exports.shieldAngle = Math.PI / 3),
2293 (e.exports.weaponVariants = [
2294 {
2295 id: 0,
2296 src: "",
2297 xp: 0,
2298 val: 1
2299 },
2300 {
2301 id: 1,
2302 src: "_g",
2303 xp: 3e3,
2304 val: 1.1
2305 },
2306 {
2307 id: 2,
2308 src: "_d",
2309 xp: 7e3,
2310 val: 1.18
2311 },
2312 {
2313 id: 3,
2314 src: "_r",
2315 poison: !0,
2316 xp: 12e3,
2317 val: 1.18
2318 }
2319 ]),
2320 (e.exports.fetchVariant = function(t) {
2321 for (
2322 var n = t.weaponXP[t.weaponIndex] || 0,
2323 i = e.exports.weaponVariants.length - 1;
2324 i >= 0;
2325 --i
2326 )
2327 if (n >= e.exports.weaponVariants[i].xp)
2328 return e.exports.weaponVariants[i];
2329 }),
2330 (e.exports.resourceTypes = ["wood", "food", "stone", "points"]),
2331 (e.exports.areaCount = 7),
2332 (e.exports.treesPerArea = 9),
2333 (e.exports.bushesPerArea = 3),
2334 (e.exports.totalRocks = 32),
2335 (e.exports.goldOres = 7),
2336 (e.exports.riverWidth = 724),
2337 (e.exports.riverPadding = 114),
2338 (e.exports.waterCurrent = 0.0011),
2339 (e.exports.waveSpeed = 1e-4),
2340 (e.exports.waveMax = 1.3),
2341 (e.exports.treeScales = [150, 160, 165, 175]),
2342 (e.exports.bushScales = [80, 85, 95]),
2343 (e.exports.rockScales = [80, 85, 90]),
2344 (e.exports.snowBiomeTop = 2400),
2345 (e.exports.snowSpeed = 0.75),
2346 (e.exports.maxNameLength = 15),
2347 (e.exports.mapScale = 14400),
2348 (e.exports.mapPingScale = 40),
2349 (e.exports.mapPingTime = 2200);
2350 }.call(this, n(41)));
2351 },
2352 function(e, t) {
2353 var n = {
2354 utf8: {
2355 stringToBytes: function(e) {
2356 return n.bin.stringToBytes(unescape(encodeURIComponent(e)));
2357 },
2358 bytesToString: function(e) {
2359 return decodeURIComponent(escape(n.bin.bytesToString(e)));
2360 }
2361 },
2362 bin: {
2363 stringToBytes: function(e) {
2364 for (var t = [], n = 0; n < e.length; n++)
2365 t.push(255 & e.charCodeAt(n));
2366 return t;
2367 },
2368 bytesToString: function(e) {
2369 for (var t = [], n = 0; n < e.length; n++)
2370 t.push(String.fromCharCode(e[n]));
2371 return t.join("");
2372 }
2373 }
2374 };
2375 e.exports = n;
2376 },
2377 function(e, t, n) {
2378 "use strict";
2379 window.loadedScript = !0;
2380 var i =
2381 "127.0.0.1" !== location.hostname &&
2382 !location.hostname.startsWith("192.168.");
2383 n(22);
2384 var r = n(23),
2385 s = n(42),
2386 a = n(43),
2387 o = n(19),
2388 c = n(44),
2389 l = n(45),
2390 h = (n(46), n(47)),
2391 u = n(48),
2392 f = n(55),
2393 d = n(56),
2394 p = n(57),
2395 g = n(58).obj,
2396 m = new a.TextManager(),
2397 y = new (n(59))("moomoo.io", 3e3, o.maxPlayers, 5, !1);
2398 y.debugLog = !1;
2399 var k = !1;
2400
2401 function v() {
2402 ht &&
2403 ut &&
2404 ((k = !0),
2405 i
2406 ? window.grecaptcha
2407 .execute("6LevKusUAAAAAAFknhlV8sPtXAk5Z5dGP5T2FYIZ", {
2408 action: "homepage"
2409 })
2410 .then(function(e) {
2411 w(e);
2412 })
2413 : w(null));
2414 }
2415
2416 function w(e) {
2417 y.start(
2418 function(t, n, a) {
2419 var c = (i ? "wss" : "ws") + "://" + t + ":8008/?gameIndex=" + a;
2420 e && (c += "&token=" + encodeURIComponent(e)),
2421 r.connect(
2422 c,
2423 function(e) {
2424 Bi(),
2425 setInterval(() => Bi(), 2500),
2426 e
2427 ? ft(e)
2428 : ((ue.onclick = s.checkTrusted(function() {
2429 !(function() {
2430 var e = ++bt > 1,
2431 t = Date.now() - wt > vt;
2432 e && t ? ((wt = Date.now()), xt()) : Tn();
2433 })();
2434 })),
2435 s.hookTouchEvents(ue),
2436 (fe.onclick = s.checkTrusted(function() {
2437 Oi("https://krunker.io");
2438 })),
2439 s.hookTouchEvents(fe),
2440 (pe.onclick = s.checkTrusted(function() {
2441 setTimeout(function() {
2442 !(function() {
2443 var e = xe.value,
2444 t = prompt("party key", e);
2445 t &&
2446 ((window.onbeforeunload = void 0),
2447 (window.location.href = "/?server=" + t));
2448 })();
2449 }, 10);
2450 })),
2451 s.hookTouchEvents(pe),
2452 (ge.onclick = s.checkTrusted(function() {
2453 Ae.classList.contains("showing")
2454 ? (Ae.classList.remove("showing"),
2455 (me.innerText = "Settings"))
2456 : (Ae.classList.add("showing"),
2457 (me.innerText = "Close"));
2458 })),
2459 s.hookTouchEvents(ge),
2460 (ye.onclick = s.checkTrusted(function() {
2461 yn(),
2462 "block" != Ye.style.display
2463 ? Ut()
2464 : (Ye.style.display = "none");
2465 })),
2466 s.hookTouchEvents(ye),
2467 (ke.onclick = s.checkTrusted(function() {
2468 "block" != Qe.style.display
2469 ? ((Qe.style.display = "block"),
2470 (Ye.style.display = "none"),
2471 an(),
2472 Gt())
2473 : (Qe.style.display = "none");
2474 })),
2475 s.hookTouchEvents(ke),
2476 (ve.onclick = s.checkTrusted(function() {
2477 rn();
2478 })),
2479 s.hookTouchEvents(ve),
2480 (Ne.onclick = s.checkTrusted(function() {
2481 xn();
2482 })),
2483 s.hookTouchEvents(Ne),
2484 (function() {
2485 for (var e = 0; e < jn.length; ++e) {
2486 var t = new Image();
2487 (t.onload = function() {
2488 this.isLoaded = !0;
2489 }),
2490 (t.src = ".././img/icons/" + jn[e] + ".png"),
2491 (Rn[jn[e]] = t);
2492 }
2493 })(),
2494 (Pe.style.display = "none"),
2495 (Me.style.display = "block"),
2496 (Le.value = E("moo_name") || ""),
2497 (function() {
2498 var e = E("native_resolution");
2499 Zt(e ? "true" == e : "undefined" != typeof cordova),
2500 (A = "true" == E("show_ping")),
2501 (Ie.hidden = !A),
2502 E("moo_moosic"),
2503 setInterval(function() {
2504 window.cordova &&
2505 (document
2506 .getElementById("downloadButtonContainer")
2507 .classList.add("cordova"),
2508 document
2509 .getElementById("mobileDownloadButtonContainer")
2510 .classList.add("cordova"));
2511 }, 1e3),
2512 en(),
2513 s.removeAllChildren(Ce);
2514 for (
2515 var t = 0;
2516 t < l.weapons.length + l.list.length;
2517 ++t
2518 )
2519 !(function(e) {
2520 s.generateElement({
2521 id: "actionBarItem" + e,
2522 class: "actionBarItem",
2523 style: "display:none",
2524 onmouseout: function() {
2525 Tt();
2526 },
2527 parent: Ce
2528 });
2529 })(t);
2530 for (t = 0; t < l.list.length + l.weapons.length; ++t)
2531 !(function(e) {
2532 var t = document.createElement("canvas");
2533 t.width = t.height = 66;
2534 var n = t.getContext("2d");
2535 if (
2536 (n.translate(t.width / 2, t.height / 2),
2537 (n.imageSmoothingEnabled = !1),
2538 (n.webkitImageSmoothingEnabled = !1),
2539 (n.mozImageSmoothingEnabled = !1),
2540 l.weapons[e])
2541 ) {
2542 n.rotate(Math.PI / 4 + Math.PI);
2543 var i = new Image();
2544 (Zn[l.weapons[e].src] = i),
2545 (i.onload = function() {
2546 this.isLoaded = !0;
2547 var i = 1 / (this.height / this.width),
2548 r = l.weapons[e].iPad || 1;
2549 n.drawImage(
2550 this,
2551 (-t.width * r * o.iconPad * i) / 2,
2552 (-t.height * r * o.iconPad) / 2,
2553 t.width * r * i * o.iconPad,
2554 t.height * r * o.iconPad
2555 ),
2556 (n.fillStyle = "rgba(0, 0, 70, 0.1)"),
2557 (n.globalCompositeOperation =
2558 "source-atop"),
2559 n.fillRect(
2560 -t.width / 2,
2561 -t.height / 2,
2562 t.width,
2563 t.height
2564 ),
2565 (document.getElementById(
2566 "actionBarItem" + e
2567 ).style.backgroundImage =
2568 "url(" + t.toDataURL() + ")");
2569 }),
2570 (i.src =
2571 ".././img/weapons/" +
2572 l.weapons[e].src +
2573 ".png"),
2574 ((r = document.getElementById(
2575 "actionBarItem" + e
2576 )).onmouseover = s.checkTrusted(function() {
2577 Tt(l.weapons[e], !0);
2578 })),
2579 (r.onclick = s.checkTrusted(function() {
2580 Sn(e, !0);
2581 })),
2582 s.hookTouchEvents(r);
2583 } else {
2584 i = ri(l.list[e - l.weapons.length], !0);
2585 var r,
2586 a = Math.min(t.width - o.iconPadding, i.width);
2587 (n.globalAlpha = 1),
2588 n.drawImage(i, -a / 2, -a / 2, a, a),
2589 (n.fillStyle = "rgba(0, 0, 70, 0.1)"),
2590 (n.globalCompositeOperation = "source-atop"),
2591 n.fillRect(-a / 2, -a / 2, a, a),
2592 (document.getElementById(
2593 "actionBarItem" + e
2594 ).style.backgroundImage =
2595 "url(" + t.toDataURL() + ")"),
2596 ((r = document.getElementById(
2597 "actionBarItem" + e
2598 )).onmouseover = s.checkTrusted(function() {
2599 Tt(l.list[e - l.weapons.length]);
2600 })),
2601 (r.onclick = s.checkTrusted(function() {
2602 Sn(e - l.weapons.length);
2603 })),
2604 s.hookTouchEvents(r);
2605 }
2606 })(t);
2607 (Le.ontouchstart = s.checkTrusted(function(e) {
2608 e.preventDefault();
2609 var t = prompt("enter name", e.currentTarget.value);
2610 e.currentTarget.value = t.slice(0, 15);
2611 })),
2612 (Se.checked = M),
2613 (Se.onchange = s.checkTrusted(function(e) {
2614 Zt(e.target.checked);
2615 })),
2616 (Te.checked = A),
2617 (Te.onchange = s.checkTrusted(function(e) {
2618 (A = Te.checked),
2619 (Ie.hidden = !A),
2620 I("show_ping", A ? "true" : "false");
2621 }));
2622 })());
2623 },
2624 {
2625 id: st,
2626 d: ft,
2627 1: En,
2628 2: vi,
2629 4: wi,
2630 33: Ti,
2631 5: Ln,
2632 6: li,
2633 a: gi,
2634 aa: pi,
2635 7: Wn,
2636 8: hi,
2637 sp: ui,
2638 9: xi,
2639 h: Si,
2640 11: Pn,
2641 12: Cn,
2642 13: Bn,
2643 14: bi,
2644 15: Dn,
2645 16: Un,
2646 17: $t,
2647 18: fi,
2648 19: di,
2649 20: Ci,
2650 ac: Ot,
2651 ad: _t,
2652 an: Bt,
2653 st: Rt,
2654 sa: jt,
2655 us: Nt,
2656 ch: hn,
2657 mm: Wt,
2658 t: Mn,
2659 p: Yt,
2660 pp: Pi
2661 }
2662 ),
2663 pt(),
2664 setTimeout(() => gt(), 3e3);
2665 },
2666 function(e) {
2667 console.error("Vultr error:", e),
2668 alert("Error:\n" + e),
2669 ft("disconnected");
2670 }
2671 );
2672 }
2673 var b,
2674 x = new g(o, s),
2675 S = Math.PI,
2676 T = 2 * S;
2677
2678 function I(e, t) {
2679 b && localStorage.setItem(e, t);
2680 }
2681
2682 function E(e) {
2683 return b ? localStorage.getItem(e) : null;
2684 }
2685 (Math.lerpAngle = function(e, t, n) {
2686 Math.abs(t - e) > S && (e > t ? (t += T) : (e += T));
2687 var i = t + (e - t) * n;
2688 return i >= 0 && i <= T ? i : i % T;
2689 }),
2690 (CanvasRenderingContext2D.prototype.roundRect = function(e, t, n, i, r) {
2691 return (
2692 n < 2 * r && (r = n / 2),
2693 i < 2 * r && (r = i / 2),
2694 r < 0 && (r = 0),
2695 this.beginPath(),
2696 this.moveTo(e + r, t),
2697 this.arcTo(e + n, t, e + n, t + i, r),
2698 this.arcTo(e + n, t + i, e, t + i, r),
2699 this.arcTo(e, t + i, e, t, r),
2700 this.arcTo(e, t, e + n, t, r),
2701 this.closePath(),
2702 this
2703 );
2704 }),
2705 "undefined" != typeof Storage && (b = !0),
2706 E("consent") || (consentBlock.style.display = "block"),
2707 (window.checkTerms = function(e) {
2708 e
2709 ? ((consentBlock.style.display = "none"), I("consent", 1))
2710 : $("#consentShake").effect("shake");
2711 });
2712 var M,
2713 A,
2714 P,
2715 B,
2716 C,
2717 O,
2718 R,
2719 j,
2720 _,
2721 U,
2722 D,
2723 L,
2724 F,
2725 z,
2726 H = E("moofoll"),
2727 V = 1,
2728 q = Date.now(),
2729 Y = [],
2730 W = [],
2731 X = [],
2732 N = [],
2733 G = [],
2734 J = new p(d, G, W, Y, nt, l, o, s),
2735 K = n(70),
2736 Q = n(71),
2737 Z = new K(Y, Q, W, l, null, o, s),
2738 ee = 1,
2739 te = 0,
2740 ne = 0,
2741 ie = 0,
2742 re = {
2743 id: -1,
2744 startX: 0,
2745 startY: 0,
2746 currentX: 0,
2747 currentY: 0
2748 },
2749 se = {
2750 id: -1,
2751 startX: 0,
2752 startY: 0,
2753 currentX: 0,
2754 currentY: 0
2755 },
2756 ae = 0,
2757 oe = o.maxScreenWidth,
2758 ce = o.maxScreenHeight,
2759 le = !1,
2760 he =
2761 (document.getElementById("ad-container"),
2762 document.getElementById("mainMenu")),
2763 ue = document.getElementById("enterGame"),
2764 fe = document.getElementById("promoImg"),
2765 de = document.getElementById("partyButton"),
2766 pe = document.getElementById("joinPartyButton"),
2767 ge = document.getElementById("settingsButton"),
2768 me = ge.getElementsByTagName("span")[0],
2769 ye = document.getElementById("allianceButton"),
2770 ke = document.getElementById("storeButton"),
2771 ve = document.getElementById("chatButton"),
2772 we = document.getElementById("gameCanvas"),
2773 be = we.getContext("2d"),
2774 xe = document.getElementById("serverBrowser"),
2775 Se = document.getElementById("nativeResolution"),
2776 Te = document.getElementById("showPing"),
2777 Ie =
2778 (document.getElementById("playMusic"),
2779 document.getElementById("pingDisplay")),
2780 Ee = document.getElementById("shutdownDisplay"),
2781 Me = document.getElementById("menuCardHolder"),
2782 Ae = document.getElementById("guideCard"),
2783 Pe = document.getElementById("loadingText"),
2784 Be = document.getElementById("gameUI"),
2785 Ce = document.getElementById("actionBar"),
2786 Oe = document.getElementById("scoreDisplay"),
2787 Re = document.getElementById("foodDisplay"),
2788 je = document.getElementById("woodDisplay"),
2789 _e = document.getElementById("stoneDisplay"),
2790 Ue = document.getElementById("killCounter"),
2791 De = document.getElementById("leaderboardData"),
2792 Le = document.getElementById("nameInput"),
2793 Fe = document.getElementById("itemInfoHolder"),
2794 ze = document.getElementById("ageText"),
2795 He = document.getElementById("ageBarBody"),
2796 Ve = document.getElementById("upgradeHolder"),
2797 qe = document.getElementById("upgradeCounter"),
2798 Ye = document.getElementById("allianceMenu"),
2799 We = document.getElementById("allianceHolder"),
2800 Xe = document.getElementById("allianceManager"),
2801 Ne = document.getElementById("mapDisplay"),
2802 Ge = document.getElementById("diedText"),
2803 Je = document.getElementById("skinColorHolder"),
2804 Ke = Ne.getContext("2d");
2805 (Ne.width = 300), (Ne.height = 300);
2806 var Qe = document.getElementById("storeMenu"),
2807 $e = document.getElementById("storeHolder"),
2808 Ze = document.getElementById("noticationDisplay"),
2809 et = f.hats,
2810 tt = f.accessories,
2811 nt = new h(c, N, s, o),
2812 it = "#525252",
2813 rt = "#3d3f42";
2814
2815 function st(e) {
2816 X = e.teams;
2817 }
2818 var at = document.getElementById("featuredYoutube"),
2819 ot = [{}],
2820 ct = ot[s.randInt(0, ot.length - 1)];
2821 at.innerHTML =
2822 "<a target='_blank' class='ytLink' href='" +
2823 ct.link +
2824 "'><i class='material-icons' style='vertical-align: top;'></i> " +
2825 ct.name +
2826 "</a>";
2827 var lt = !0,
2828 ht = !1,
2829 ut = !1;
2830
2831 function ft(e) {
2832 r.close(), dt(e);
2833 }
2834
2835 function dt(e) {
2836 (he.style.display = "block"),
2837 (Be.style.display = "none"),
2838 (Me.style.display = "none"),
2839 (Ge.style.display = "none"),
2840 (Pe.style.display = "block"),
2841 (Pe.innerHTML =
2842 e +
2843 "<a href='javascript:window.location.href=window.location.href' class='ytLink'>reload</a>");
2844 }
2845 (window.onblur = function() {
2846 lt = !1;
2847 }),
2848 (window.onfocus = function() {
2849 (lt = !0), R && R.alive && yn();
2850 }),
2851 (window.onload = function() {
2852 (ht = !0),
2853 v(),
2854 setTimeout(function() {
2855 k || (alert("Captcha failed to load"), window.location.reload());
2856 }, 2e4);
2857 }),
2858 (window.captchaCallback = function() {
2859 (ut = !0), v();
2860 }),
2861 (we.oncontextmenu = function() {
2862 return !1;
2863 });
2864
2865 function pt() {
2866 var e,
2867 t,
2868 n = "",
2869 i = 0;
2870 for (var r in y.servers) {
2871 for (var s = y.servers[r], a = 0, c = 0; c < s.length; c++)
2872 for (var l = 0; l < s[c].games.length; l++)
2873 a += s[c].games[l].playerCount;
2874 i += a;
2875 var h = y.regionInfo[r].name;
2876 n += "<option disabled>" + h + " - " + a + " players</option>";
2877 for (var u = 0; u < s.length; u++)
2878 for (var f = s[u], d = 0; d < f.games.length; d++) {
2879 var p = f.games[d],
2880 g = 1 * f.index + d + 1,
2881 m =
2882 y.server &&
2883 y.server.region === f.region &&
2884 y.server.index === f.index &&
2885 y.gameIndex == d,
2886 k =
2887 h +
2888 " " +
2889 g +
2890 " [" +
2891 Math.min(p.playerCount, o.maxPlayers) +
2892 "/" +
2893 o.maxPlayers +
2894 "]";
2895 let e = y.stripRegion(r) + ":" + u + ":" + d;
2896 m && (de.getElementsByTagName("span")[0].innerText = e),
2897 (n +=
2898 "<option value='" +
2899 e +
2900 "' " +
2901 (m ? "selected" : "") +
2902 ">" +
2903 k +
2904 "</option>");
2905 }
2906 n += "<option disabled></option>";
2907 }
2908 (n += "<option disabled>All Servers - " + i + " players</option>"),
2909 (xe.innerHTML = n),
2910 "sandbox.moomoo.io" == location.hostname
2911 ? ((e = "Back to MooMoo"), (t = "//moomoo.io/"))
2912 : ((e = "Try the sandbox"), (t = "//sandbox.moomoo.io/")),
2913 (document.getElementById("altServer").innerHTML =
2914 "<a href='" +
2915 t +
2916 "'>" +
2917 e +
2918 "<i class='material-icons' style='font-size:10px;vertical-align:middle'>arrow_forward_ios</i></a>");
2919 }
2920
2921 function gt() {
2922 var e = new XMLHttpRequest();
2923 (e.onreadystatechange = function() {
2924 4 == this.readyState &&
2925 (200 == this.status
2926 ? ((window.vultr = JSON.parse(this.responseText)),
2927 y.processServers(vultr.servers),
2928 pt())
2929 : console.error(
2930 "Failed to load server data with status code:",
2931 this.status
2932 ));
2933 }),
2934 e.open("GET", "/serverData", !0),
2935 e.send();
2936 }
2937 xe.addEventListener(
2938 "change",
2939 s.checkTrusted(function() {
2940 let e = xe.value.split(":");
2941 y.switchServer(e[0], e[1], e[2]);
2942 })
2943 );
2944 var mt = document.getElementById("pre-content-container"),
2945 yt = null,
2946 kt = null;
2947 window.cpmstarAPI(function(e) {
2948 e.game.setTarget(mt), (kt = e);
2949 });
2950 var vt = 3e5,
2951 wt = 0,
2952 bt = 0;
2953
2954 function xt() {
2955 if (!cpmstarAPI || !kt)
2956 return (
2957 console.log("Failed to load video ad API", !!cpmstarAPI, !!kt),
2958 void Tn()
2959 );
2960 (yt = new kt.game.RewardedVideoView("rewardedvideo")).addEventListener(
2961 "ad_closed",
2962 function(e) {
2963 console.log("Video ad closed"), St();
2964 }
2965 ),
2966 yt.addEventListener("loaded", function(e) {
2967 console.log("Video ad loaded"), yt.show();
2968 }),
2969 yt.addEventListener("load_failed", function(e) {
2970 console.log("Video ad load failed", e), St();
2971 }),
2972 yt.load(),
2973 (mt.style.display = "block");
2974 }
2975
2976 function St() {
2977 (mt.style.display = "none"), Tn();
2978 }
2979
2980 function Tt(e, t, n) {
2981 if (R && e)
2982 if (
2983 (s.removeAllChildren(Fe),
2984 Fe.classList.add("visible"),
2985 s.generateElement({
2986 id: "itemInfoName",
2987 text: s.capitalizeFirst(e.name),
2988 parent: Fe
2989 }),
2990 s.generateElement({
2991 id: "itemInfoDesc",
2992 text: e.desc,
2993 parent: Fe
2994 }),
2995 n)
2996 );
2997 else if (t)
2998 s.generateElement({
2999 class: "itemInfoReq",
3000 text: e.type ? "secondary" : "primary",
3001 parent: Fe
3002 });
3003 else {
3004 for (var i = 0; i < e.req.length; i += 2)
3005 s.generateElement({
3006 class: "itemInfoReq",
3007 html:
3008 e.req[i] +
3009 "<span class='itemInfoReqVal'> x" +
3010 e.req[i + 1] +
3011 "</span>",
3012 parent: Fe
3013 });
3014 e.group.limit &&
3015 s.generateElement({
3016 class: "itemInfoLmt",
3017 text: (R.itemCounts[e.group.id] || 0) + "/" + e.group.limit,
3018 parent: Fe
3019 });
3020 }
3021 else Fe.classList.remove("visible");
3022 }
3023 window.showPreAd = xt;
3024 var It,
3025 Et,
3026 Mt,
3027 At = [],
3028 Pt = [];
3029
3030 function Bt(e, t) {
3031 At.push({
3032 sid: e,
3033 name: t
3034 }),
3035 Ct();
3036 }
3037
3038 function Ct() {
3039 if (At[0]) {
3040 var e = At[0];
3041 s.removeAllChildren(Ze),
3042 (Ze.style.display = "block"),
3043 s.generateElement({
3044 class: "notificationText",
3045 text: e.name,
3046 parent: Ze
3047 }),
3048 s.generateElement({
3049 class: "notifButton",
3050 html:
3051 "<i class='material-icons' style='font-size:28px;color:red;'></i>",
3052 parent: Ze,
3053 onclick: function() {
3054 Dt(0);
3055 },
3056 hookTouch: !0
3057 }),
3058 s.generateElement({
3059 class: "notifButton",
3060 html:
3061 "<i class='material-icons' style='font-size:28px;color:red;'></i>",
3062 parent: Ze,
3063 onclick: function() {
3064 Dt(1);
3065 },
3066 hookTouch: !0
3067 });
3068 } else Ze.style.display = "none";
3069 }
3070
3071 function Ot(e) {
3072 X.push(e), "block" == Ye.style.display && Ut();
3073 }
3074
3075 function Rt(e, t) {
3076 R && ((R.team = e), (R.isOwner = t), "block" == Ye.style.display && Ut());
3077 }
3078
3079 function jt(e) {
3080 (Pt = e), "block" == Ye.style.display && Ut();
3081 }
3082
3083 function _t(e) {
3084 for (var t = X.length - 1; t >= 0; t--) X[t].sid == e && X.splice(t, 1);
3085 "block" == Ye.style.display && Ut();
3086 }
3087
3088 function Ut() {
3089 if (R && R.alive) {
3090 if (
3091 (an(),
3092 (Qe.style.display = "none"),
3093 (Ye.style.display = "block"),
3094 s.removeAllChildren(We),
3095 R.team)
3096 )
3097 for (var e = 0; e < Pt.length; e += 2)
3098 !(function(e) {
3099 var t = s.generateElement({
3100 class: "allianceItem",
3101 style:
3102 "color:" +
3103 (Pt[e] == R.sid ? "white" : "rgba(255,255,255,0.6)"),
3104 text: Pt[e + 1],
3105 parent: We
3106 });
3107 R.isOwner &&
3108 Pt[e] != R.sid &&
3109 s.generateElement({
3110 class: "joinAlBtn",
3111 text: "Kick",
3112 onclick: function() {
3113 Lt(Pt[e]);
3114 },
3115 hookTouch: !0,
3116 parent: t
3117 });
3118 })(e);
3119 else if (X.length)
3120 for (e = 0; e < X.length; ++e)
3121 !(function(e) {
3122 var t = s.generateElement({
3123 class: "allianceItem",
3124 style:
3125 "color:" +
3126 (X[e].sid == R.team ? "white" : "rgba(255,255,255,0.6)"),
3127 text: X[e].sid,
3128 parent: We
3129 });
3130 s.generateElement({
3131 class: "joinAlBtn",
3132 text: "Join",
3133 onclick: function() {
3134 Ft(e);
3135 },
3136 hookTouch: !0,
3137 parent: t
3138 });
3139 })(e);
3140 else
3141 s.generateElement({
3142 class: "allianceItem",
3143 text: "No Tribes Yet",
3144 parent: We
3145 });
3146 s.removeAllChildren(Xe),
3147 R.team
3148 ? s.generateElement({
3149 class: "allianceButtonM",
3150 style: "width: 360px",
3151 text: R.isOwner ? "Delete Tribe" : "Leave Tribe",
3152 onclick: function() {
3153 Ht();
3154 },
3155 hookTouch: !0,
3156 parent: Xe
3157 })
3158 : (s.generateElement({
3159 tag: "input",
3160 type: "text",
3161 id: "allianceInput",
3162 maxLength: 7,
3163 placeholder: "unique name",
3164 ontouchstart: function(e) {
3165 e.preventDefault();
3166 var t = prompt("unique name", e.currentTarget.value);
3167 e.currentTarget.value = t.slice(0, 7);
3168 },
3169 parent: Xe
3170 }),
3171 s.generateElement({
3172 tag: "div",
3173 class: "allianceButtonM",
3174 style: "width: 140px;",
3175 text: "Create",
3176 onclick: function() {
3177 zt();
3178 },
3179 hookTouch: !0,
3180 parent: Xe
3181 }));
3182 }
3183 }
3184
3185 function Dt(e) {
3186 r.send("11", At[0].sid, e), At.splice(0, 1), Ct();
3187 }
3188
3189 document.onkeydown = function(e) {
3190 // Ñпам едой. ÐЕУБЕРÐЙТЕ ЗÐДЕРЖКУ!! Ðу еÑли вообще кто то Ñто видит то Ñто по тому что еÑли вы уберете ее то в конце от Ñамого клиета будет нажата q тобишь еда ))
3191 if (e.keyCode == 101) {
3192 Sn(R.items[0]);
3193 r.send("c", 1);
3194 r.send("c", 0);
3195 Sn(R.items[0]);
3196 r.send("c", 1);
3197 r.send("c", 0);
3198 Sn(R.items[0]);
3199 r.send("c", 1);
3200 r.send("c", 0);
3201 Sn(R.items[0]);
3202 r.send("c", 1);
3203 r.send("c", 0);
3204 setTimeout(() => {
3205 r.send("5");
3206 }, 1);
3207 }
3208 };
3209 //r.send("5") = прошлое "главное" оружие
3210 //Sn(R.items[0]) = еда
3211 //Sn(R.items[1]) = Ñтена
3212 //Sn(R.items[2]) = Ñпайк или же шип
3213 //Sn(R.items[3]) = мельница
3214 //Sn(R.items[4]) = трапка или же буÑÑ‚(еÑли Ñтого предмета нету то ты береш примари или Ñекондари оружие
3215 //Sn(R.items[5]) = тут мои Ð¿Ð¾Ð»Ð½Ð¾Ð¼Ð¾Ñ‡Ð¸Ñ ÑƒÐ¶Ðµ вÑе, окончены
3216 var repeater = function(key, action, interval) {
3217 let _isKeyDown = false;
3218 let _intervalId = undefined;
3219
3220 return {
3221 start(keycode) {
3222 if (
3223 keycode == key &&
3224 document.activeElement.id.toLowerCase() !== "chatbox"
3225 ) {
3226 _isKeyDown = true;
3227 if (_intervalId === undefined) {
3228 _intervalId = setInterval(() => {
3229 action();
3230 if (!_isKeyDown) {
3231 clearInterval(_intervalId);
3232 _intervalId = undefined;
3233 console.log("claered");
3234 }
3235 }, interval);
3236 }
3237 }
3238 },
3239
3240 stop(keycode) {
3241 if (
3242 keycode == key &&
3243 document.activeElement.id.toLowerCase() !== "chatbox"
3244 ) {
3245 _isKeyDown = false;
3246 }
3247 }
3248 };
3249 };
3250
3251 function Lt(e) {
3252 r.send("12", e);
3253 }
3254
3255 function Ft(e) {
3256 r.send("10", X[e].sid);
3257 }
3258 function zt() {
3259 r.send("8", document.getElementById("allianceInput").value);
3260 }
3261
3262 function Ht() {
3263 (At = []), Ct(), r.send("9");
3264 }
3265 var Vt,
3266 qt = [];
3267
3268 function Yt(e, t) {
3269 for (var n = 0; n < qt.length; ++n)
3270 if (!qt[n].active) {
3271 Vt = qt[n];
3272 break;
3273 }
3274 Vt ||
3275 ((Vt = new (function() {
3276 (this.init = function(e, t) {
3277 (this.scale = 0), (this.x = e), (this.y = t), (this.active = !0);
3278 }),
3279 (this.update = function(e, t) {
3280 this.active &&
3281 ((this.scale += 0.01 * t),
3282 this.scale >= o.mapPingScale
3283 ? (this.active = !1)
3284 : ((e.globalAlpha =
3285 1 - Math.max(0, this.scale / o.mapPingScale)),
3286 e.beginPath(),
3287 e.arc(
3288 (this.x / o.mapScale) * Ne.width,
3289 (this.y / o.mapScale) * Ne.width,
3290 this.scale,
3291 0,
3292 20 * Math.PI
3293 ),
3294 e.stroke()));
3295 });
3296 })()),
3297 qt.push(Vt)),
3298 Vt.init(e, t);
3299 }
3300
3301 function Wt(e) {
3302 Et = e;
3303 }
3304 var Xt = 0;
3305
3306 function Nt(e, t, n) {
3307 n
3308 ? e
3309 ? (R.tailIndex = t)
3310 : (R.tails[t] = 1)
3311 : e
3312 ? (R.skinIndex = t)
3313 : (R.skins[t] = 1),
3314 "block" == Qe.style.display && Gt();
3315 }
3316
3317 function Gt() {
3318 if (R) {
3319 s.removeAllChildren($e);
3320 for (var e = Xt, t = e ? tt : et, n = 0; n < t.length; ++n)
3321 t[n].dontSell ||
3322 (function(n) {
3323 var i = s.generateElement({
3324 id: "storeDisplay" + n,
3325 class: "storeItem",
3326 onmouseout: function() {
3327 Tt();
3328 },
3329 onmouseover: function() {
3330 Tt(t[n], !1, !0);
3331 },
3332 parent: $e
3333 });
3334 s.hookTouchEvents(i, !0),
3335 s.generateElement({
3336 tag: "img",
3337 class: "hatPreview",
3338 src:
3339 "../img/" +
3340 (e ? "accessories/access_" : "hats/hat_") +
3341 t[n].id +
3342 (t[n].topSprite ? "_p" : "") +
3343 ".png",
3344 parent: i
3345 }),
3346 s.generateElement({
3347 tag: "span",
3348 text: t[n].name,
3349 parent: i
3350 }),
3351 (e
3352 ? R.tails[t[n].id]
3353 : R.skins[t[n].id])
3354 ? (e ? R.tailIndex : R.skinIndex) == t[n].id
3355 ? s.generateElement({
3356 class: "joinAlBtn",
3357 style: "margin-top: 5px",
3358 text: "Unequip",
3359 onclick: function() {
3360 Jt(0, e);
3361 },
3362 hookTouch: !0,
3363 parent: i
3364 })
3365 : s.generateElement({
3366 class: "joinAlBtn",
3367 style: "margin-top: 5px",
3368 text: "Equip",
3369 onclick: function() {
3370 Jt(t[n].id, e);
3371 },
3372 hookTouch: !0,
3373 parent: i
3374 })
3375 : (s.generateElement({
3376 class: "joinAlBtn",
3377 style: "margin-top: 5px",
3378 text: "Buy",
3379 onclick: function() {
3380 Kt(t[n].id, e);
3381 },
3382 hookTouch: !0,
3383 parent: i
3384 }),
3385 s.generateElement({
3386 tag: "span",
3387 class: "itemPrice",
3388 text: t[n].price,
3389 parent: i
3390 }));
3391 })(n);
3392 }
3393 }
3394
3395 function Jt(e, t) {
3396 r.send("13c", 0, e, t);
3397 }
3398
3399 function Kt(e, t) {
3400 r.send("13c", 1, e, t);
3401 }
3402
3403 function Qt() {
3404 (Qe.style.display = "none"), (Ye.style.display = "none"), an();
3405 }
3406
3407 function $t(e, t) {
3408 e && (t ? (R.weapons = e) : (R.items = e));
3409 for (var n = 0; n < l.list.length; ++n) {
3410 var i = l.weapons.length + n;
3411 document.getElementById("actionBarItem" + i).style.display =
3412 R.items.indexOf(l.list[n].id) >= 0 ? "inline-block" : "none";
3413 }
3414 for (n = 0; n < l.weapons.length; ++n)
3415 document.getElementById("actionBarItem" + n).style.display =
3416 R.weapons[l.weapons[n].type] == l.weapons[n].id
3417 ? "inline-block"
3418 : "none";
3419 }
3420
3421 function Zt(e) {
3422 (M = e),
3423 (V = (e && window.devicePixelRatio) || 0),
3424 1,
3425 (Se.checked = e),
3426 I("native_resolution", e.toString()),
3427 un();
3428 }
3429
3430 function en() {
3431 for (var e = "", t = 0; t < o.skinColors.length; ++t)
3432 e +=
3433 t == ae
3434 ? "<div class='skinColorItem activeSkin' style='background-color:" +
3435 o.skinColors[t] +
3436 "' onclick='selectSkinColor(" +
3437 t +
3438 ")'></div>"
3439 : "<div class='skinColorItem' style='background-color:" +
3440 o.skinColors[t] +
3441 "' onclick='selectSkinColor(" +
3442 t +
3443 ")'></div>";
3444 Je.innerHTML = e;
3445 }
3446 var tn = document.getElementById("chatBox"),
3447 nn = document.getElementById("chatHolder");
3448
3449 function rn() {
3450 on
3451 ? setTimeout(function() {
3452 var e = prompt("chat message");
3453 e && sn(e);
3454 }, 1)
3455 : "block" == nn.style.display
3456 ? (tn.value && sn(tn.value), an())
3457 : ((Qe.style.display = "none"),
3458 (Ye.style.display = "none"),
3459 (nn.style.display = "block"),
3460 tn.focus(),
3461 yn()),
3462 (tn.value = "");
3463 }
3464
3465 function sn(e) {
3466 r.send("ch", e.slice(0, 30));
3467 }
3468
3469 function an() {
3470 (tn.value = ""), (nn.style.display = "none");
3471 }
3472 var on,
3473 cn,
3474 ln = ["motherfucking"];
3475
3476 function hn(e, t) {
3477 var n = Ii(e);
3478 n &&
3479 ((n.chatMessage = (function(e) {
3480 for (var t, n = 0; n < ln.length; ++n)
3481 if (e.indexOf(ln[n]) > -1) {
3482 t = "";
3483 for (var i = 0; i < ln[n].length; ++i) t += t.length ? "o" : "M";
3484 var r = new RegExp(ln[n], "g");
3485 e = e.replace(r, t);
3486 }
3487 return e;
3488 })(t)),
3489 (n.chatCountdown = o.chatCountdown));
3490 }
3491
3492 function un() {
3493 (F = window.innerWidth), (z = window.innerHeight);
3494 var e = Math.max(F / oe, z / ce) * V;
3495 (we.width = F * V),
3496 (we.height = z * V),
3497 (we.style.width = F + "px"),
3498 (we.style.height = z + "px"),
3499 be.setTransform(e, 0, 0, e, (F * V - oe * e) / 2, (z * V - ce * e) / 2);
3500 }
3501
3502 function fn(e) {
3503 (on = e) ? Ae.classList.add("touch") : Ae.classList.remove("touch");
3504 }
3505
3506 function dn(e) {
3507 e.preventDefault(), e.stopPropagation(), fn(!0);
3508 for (var t = 0; t < e.changedTouches.length; t++) {
3509 var n = e.changedTouches[t];
3510 n.identifier == re.id
3511 ? ((re.id = -1), bn())
3512 : n.identifier == se.id &&
3513 ((se.id = -1), R.buildIndex >= 0 && ((O = 1), vn()), (O = 0), vn());
3514 }
3515 }
3516
3517 function pn() {
3518 return R
3519 ? (-1 != se.id
3520 ? (cn = Math.atan2(
3521 se.currentY - se.startY,
3522 se.currentX - se.startX
3523 ))
3524 : R.lockDir || on || (cn = Math.atan2(ie - z / 2, ne - F / 2)),
3525 s.fixTo(cn || 0, 2))
3526 : 0;
3527 }
3528 window.addEventListener("resize", s.checkTrusted(un)),
3529 un(),
3530 fn(!1),
3531 (window.setUsingTouch = fn),
3532 we.addEventListener(
3533 "touchmove",
3534 s.checkTrusted(function(e) {
3535 e.preventDefault(), e.stopPropagation(), fn(!0);
3536 for (var t = 0; t < e.changedTouches.length; t++) {
3537 var n = e.changedTouches[t];
3538 n.identifier == re.id
3539 ? ((re.currentX = n.pageX), (re.currentY = n.pageY), bn())
3540 : n.identifier == se.id &&
3541 ((se.currentX = n.pageX), (se.currentY = n.pageY), (O = 1));
3542 }
3543 }),
3544 !1
3545 ),
3546 we.addEventListener(
3547 "touchstart",
3548 s.checkTrusted(function(e) {
3549 e.preventDefault(), e.stopPropagation(), fn(!0);
3550 for (var t = 0; t < e.changedTouches.length; t++) {
3551 var n = e.changedTouches[t];
3552 n.pageX < document.body.scrollWidth / 2 && -1 == re.id
3553 ? ((re.id = n.identifier),
3554 (re.startX = re.currentX = n.pageX),
3555 (re.startY = re.currentY = n.pageY),
3556 bn())
3557 : n.pageX > document.body.scrollWidth / 2 &&
3558 -1 == se.id &&
3559 ((se.id = n.identifier),
3560 (se.startX = se.currentX = n.pageX),
3561 (se.startY = se.currentY = n.pageY),
3562 R.buildIndex < 0 && ((O = 1), vn()));
3563 }
3564 }),
3565 !1
3566 ),
3567 we.addEventListener("touchend", s.checkTrusted(dn), !1),
3568 we.addEventListener("touchcancel", s.checkTrusted(dn), !1),
3569 we.addEventListener("touchleave", s.checkTrusted(dn), !1),
3570 we.addEventListener(
3571 "mousemove",
3572 function(e) {
3573 e.preventDefault(),
3574 e.stopPropagation(),
3575 fn(!1),
3576 (ne = e.clientX),
3577 (ie = e.clientY);
3578 },
3579 !1
3580 ),
3581 we.addEventListener(
3582 "mousedown",
3583 function(e) {
3584 fn(!1), 1 != O && ((O = 1), vn());
3585 },
3586 !1
3587 ),
3588 we.addEventListener(
3589 "mouseup",
3590 function(e) {
3591 fn(!1), 0 != O && ((O = 0), vn());
3592 },
3593 !1
3594 );
3595 var gn = {},
3596 mn = {
3597 87: [0, -1],
3598 38: [0, -1],
3599 83: [0, 1],
3600 40: [0, 1],
3601 65: [-1, 0],
3602 37: [-1, 0],
3603 68: [1, 0],
3604 39: [1, 0]
3605 };
3606
3607 function yn() {
3608 (gn = {}), r.send("rmd");
3609 }
3610
3611 function kn() {
3612 return "block" != Ye.style.display && "block" != nn.style.display;
3613 }
3614
3615 function vn() {
3616 R && R.alive && r.send("c", O, R.buildIndex >= 0 ? pn() : null);
3617 }
3618 window.addEventListener(
3619 "keydown",
3620 s.checkTrusted(function(e) {
3621 var t = e.which || e.keyCode || 0;
3622 27 == t
3623 ? Qt()
3624 : R &&
3625 R.alive &&
3626 kn() &&
3627 (gn[t] ||
3628 ((gn[t] = 1),
3629 69 == t
3630 ? r.send("7", 1)
3631 : 67 == t
3632 ? (Mt || (Mt = {}), (Mt.x = R.x), (Mt.y = R.y))
3633 : 88 == t
3634 ? ((R.lockDir = R.lockDir ? 0 : 1), r.send("7", 0))
3635 : null != R.weapons[t - 49]
3636 ? Sn(R.weapons[t - 49], !0)
3637 : null != R.items[t - 49 - R.weapons.length]
3638 ? Sn(R.items[t - 49 - R.weapons.length])
3639 : 81 == t
3640 ? Sn(R.items[0])
3641 : 82 == t
3642 ? xn()
3643 : mn[t]
3644 ? bn()
3645 : 32 == t && ((O = 1), vn())));
3646 })
3647 ),
3648 window.addEventListener(
3649 "keyup",
3650 s.checkTrusted(function(e) {
3651 if (R && R.alive) {
3652 var t = e.which || e.keyCode || 0;
3653 13 == t
3654 ? rn()
3655 : kn() &&
3656 gn[t] &&
3657 ((gn[t] = 0), mn[t] ? bn() : 32 == t && ((O = 0), vn()));
3658 }
3659 })
3660 );
3661 var wn = void 0;
3662
3663 function bn() {
3664 var e = (function() {
3665 var e = 0,
3666 t = 0;
3667 if (-1 != re.id)
3668 (e += re.currentX - re.startX), (t += re.currentY - re.startY);
3669 else
3670 for (var n in mn) {
3671 var i = mn[n];
3672 (e += !!gn[n] * i[0]), (t += !!gn[n] * i[1]);
3673 }
3674 return 0 == e && 0 == t ? void 0 : s.fixTo(Math.atan2(t, e), 2);
3675 })();
3676 (null == wn || null == e || Math.abs(e - wn) > 0.3) &&
3677 (r.send("33", e), (wn = e));
3678 }
3679
3680 function xn() {
3681 r.send("14", 1);
3682 }
3683
3684 function Sn(e, t) {
3685 r.send("5", e, t);
3686 }
3687
3688 function Tn() {
3689 I("moo_name", Le.value),
3690 !le &&
3691 r.connected &&
3692 ((le = !0),
3693 x.stop("menu"),
3694 dt("Loading..."),
3695 r.send("sp", {
3696 name: Le.value,
3697 moofoll: H,
3698 skin: ae
3699 }));
3700 }
3701 var In = !0;
3702
3703 function En(e) {
3704 (Pe.style.display = "none"),
3705 (Me.style.display = "block"),
3706 (he.style.display = "none"),
3707 (gn = {}),
3708 (j = e),
3709 (O = 0),
3710 (le = !0),
3711 In && ((In = !1), (N.length = 0));
3712 }
3713
3714 function Mn(e, t, n, i) {
3715 m.showText(e, t, 50, 0.18, 500, Math.abs(n), n >= 0 ? "#fff" : "#8ecc51");
3716 }
3717 var An = 99999;
3718
3719 function Pn() {
3720 le = !1;
3721 try {
3722 factorem.refreshAds([2], !0);
3723 } catch (e) {}
3724 (Be.style.display = "none"),
3725 Qt(),
3726 (It = {
3727 x: R.x,
3728 y: R.y
3729 }),
3730 (Pe.style.display = "none"),
3731 (Ge.style.display = "block"),
3732 (Ge.style.fontSize = "0px"),
3733 (An = 0),
3734 setTimeout(function() {
3735 (Me.style.display = "block"),
3736 (he.style.display = "block"),
3737 (Ge.style.display = "none");
3738 }, o.SamMODFadeout),
3739 gt();
3740 }
3741
3742 function Bn(e) {
3743 R && nt.removeAllItems(e);
3744 }
3745
3746 function Cn(e) {
3747 nt.disableBySid(e);
3748 }
3749
3750 function On() {
3751 (Oe.innerText = R.points),
3752 (Re.innerText = R.food),
3753 (je.innerText = R.wood),
3754 (_e.innerText = R.stone),
3755 (Ue.innerText = R.kills);
3756 }
3757 var Rn = {},
3758 jn = ["crown", "skull"],
3759 _n = [];
3760
3761 function Un(e, t) {
3762 if (((R.upgradePoints = e), (R.upgrAge = t), e > 0)) {
3763 (_n.length = 0), s.removeAllChildren(Ve);
3764 for (var n = 0; n < l.weapons.length; ++n)
3765 l.weapons[n].age == t &&
3766 (null == l.weapons[n].pre ||
3767 R.weapons.indexOf(l.weapons[n].pre) >= 0) &&
3768 ((s.generateElement({
3769 id: "upgradeItem" + n,
3770 class: "actionBarItem",
3771 onmouseout: function() {
3772 Tt();
3773 },
3774 parent: Ve
3775 }).style.backgroundImage = document.getElementById(
3776 "actionBarItem" + n
3777 ).style.backgroundImage),
3778 _n.push(n));
3779 for (n = 0; n < l.list.length; ++n)
3780 if (
3781 l.list[n].age == t &&
3782 (null == l.list[n].pre || R.items.indexOf(l.list[n].pre) >= 0)
3783 ) {
3784 var i = l.weapons.length + n;
3785 (s.generateElement({
3786 id: "upgradeItem" + i,
3787 class: "actionBarItem",
3788 onmouseout: function() {
3789 Tt();
3790 },
3791 parent: Ve
3792 }).style.backgroundImage = document.getElementById(
3793 "actionBarItem" + i
3794 ).style.backgroundImage),
3795 _n.push(i);
3796 }
3797 for (n = 0; n < _n.length; n++)
3798 !(function(e) {
3799 var t = document.getElementById("upgradeItem" + e);
3800 (t.onmouseover = function() {
3801 l.weapons[e]
3802 ? Tt(l.weapons[e], !0)
3803 : Tt(l.list[e - l.weapons.length]);
3804 }),
3805 (t.onclick = s.checkTrusted(function() {
3806 r.send("6", e);
3807 })),
3808 s.hookTouchEvents(t);
3809 })(_n[n]);
3810 _n.length
3811 ? ((Ve.style.display = "block"),
3812 (qe.style.display = "block"),
3813 (qe.innerHTML = "SELECT ITEMS (" + e + ")"))
3814 : ((Ve.style.display = "none"), (qe.style.display = "none"), Tt());
3815 } else (Ve.style.display = "none"), (qe.style.display = "none"), Tt();
3816 }
3817
3818 function Dn(e, t, n) {
3819 null != e && (R.XP = e),
3820 null != t && (R.maxXP = t),
3821 null != n && (R.age = n),
3822 n == o.maxAge
3823 ? ((ze.innerHTML = "MAX AGE"), (He.style.width = "100%"))
3824 : ((ze.innerHTML = "AGE " + R.age),
3825 (He.style.width = (R.XP / R.maxXP) * 100 + "%"));
3826 }
3827
3828 function Ln(e) {
3829 s.removeAllChildren(De);
3830 for (var t = 1, n = 0; n < e.length; n += 3)
3831 !(function(n) {
3832 s.generateElement({
3833 class: "leaderHolder",
3834 parent: De,
3835 children: [
3836 s.generateElement({
3837 class: "leaderboardItem",
3838 style:
3839 "color:" + (e[n] == j ? "white" : "rgba(255,255,255,0.6)"),
3840 text: t + ". " + ("" != e[n + 1] ? e[n + 1] : "unknown")
3841 }),
3842 s.generateElement({
3843 class: "leaderScore",
3844 text: s.kFormat(e[n + 2]) || "0"
3845 })
3846 ]
3847 });
3848 })(n),
3849 t++;
3850 }
3851
3852 function Fn(e, t, n, i) {
3853 be.save(), be.setTransform(1, 0, 0, 1, 0, 0), be.scale(V, V);
3854 var r = 50;
3855 be.beginPath(),
3856 be.arc(e, t, r, 0, 2 * Math.PI, !1),
3857 be.closePath(),
3858 (be.fillStyle = "rgba(255, 255, 255, 0.3)"),
3859 be.fill(),
3860 (r = 50);
3861 var s = n - e,
3862 a = i - t,
3863 o = Math.sqrt(Math.pow(s, 2) + Math.pow(a, 2)),
3864 c = o > r ? o / r : 1;
3865 (s /= c),
3866 (a /= c),
3867 be.beginPath(),
3868 be.arc(e + s, t + a, 0.5 * r, 0, 2 * Math.PI, !1),
3869 be.closePath(),
3870 (be.fillStyle = "white"),
3871 be.fill(),
3872 be.restore();
3873 }
3874
3875 function zn(e, t, n) {
3876 for (var i = 0; i < G.length; ++i)
3877 (_ = G[i]).active &&
3878 _.layer == e &&
3879 (_.update(P),
3880 _.active &&
3881 ki(_.x - t, _.y - n, _.scale) &&
3882 (be.save(),
3883 be.translate(_.x - t, _.y - n),
3884 be.rotate(_.dir),
3885 Vn(0, 0, _, be, 1),
3886 be.restore()));
3887 }
3888 var Hn = {};
3889
3890 function Vn(e, t, n, i, r) {
3891 if (n.src) {
3892 var s = l.projectiles[n.indx].src,
3893 a = Hn[s];
3894 a ||
3895 (((a = new Image()).onload = function() {
3896 this.isLoaded = !0;
3897 }),
3898 (a.src = ".././img/weapons/" + s + ".png"),
3899 (Hn[s] = a)),
3900 a.isLoaded &&
3901 i.drawImage(a, e - n.scale / 2, t - n.scale / 2, n.scale, n.scale);
3902 } else 1 == n.indx && ((i.fillStyle = "#939393"), si(e, t, n.scale, i));
3903 }
3904
3905 function qn(e, t, n, i) {
3906 var r = o.riverWidth + i,
3907 s = o.mapScale / 2 - t - r / 2;
3908 s < ce && s + r > 0 && n.fillRect(0, s, oe, r);
3909 }
3910
3911 function Yn(e, t, n) {
3912 for (var i, r, s, a = 0; a < N.length; ++a)
3913 (_ = N[a]).active &&
3914 ((r = _.x + _.xWiggle - t),
3915 (s = _.y + _.yWiggle - n),
3916 0 == e && _.update(P),
3917 _.layer == e &&
3918 ki(r, s, _.scale + (_.blocker || 0)) &&
3919 ((be.globalAlpha = _.hideFromEnemy ? 0.6 : 1),
3920 _.isItem
3921 ? ((i = ri(_)),
3922 be.save(),
3923 be.translate(r, s),
3924 be.rotate(_.dir),
3925 be.drawImage(i, -i.width / 2, -i.height / 2),
3926 _.blocker &&
3927 ((be.strokeStyle = "#db6e6e"),
3928 (be.globalAlpha = 0.3),
3929 (be.lineWidth = 6),
3930 si(0, 0, _.blocker, be, !1, !0)),
3931 be.restore())
3932 : ((i = ni(_)),
3933 be.drawImage(i, r - i.width / 2, s - i.height / 2))));
3934 }
3935
3936 function Wn(e, t, n) {
3937 (_ = Ii(e)) && _.startAnim(t, n);
3938 }
3939
3940 function Xn(e, t, n) {
3941 be.globalAlpha = 1;
3942 for (var i = 0; i < W.length; ++i)
3943 (_ = W[i]).zIndex == n &&
3944 (_.animate(P),
3945 _.visible &&
3946 ((_.skinRot += 0.002 * P),
3947 (L = (_ == R ? pn() : _.dir) + _.dirPlus),
3948 be.save(),
3949 be.translate(_.x - e, _.y - t),
3950 be.rotate(L),
3951 Nn(_, be),
3952 be.restore()));
3953 }
3954
3955 function Nn(e, t) {
3956 ((t = t || be).lineWidth = 5.5), (t.lineJoin = "miter");
3957 var n = (Math.PI / 4) * (l.weapons[e.weaponIndex].armS || 1),
3958 i = (e.buildIndex < 0 && l.weapons[e.weaponIndex].hndS) || 1,
3959 r = (e.buildIndex < 0 && l.weapons[e.weaponIndex].hndD) || 1;
3960 if (
3961 (e.tailIndex > 0 &&
3962 (function(e, t, n) {
3963 if (!(Gn = Qn[e])) {
3964 var i = new Image();
3965 (i.onload = function() {
3966 (this.isLoaded = !0), (this.onload = null);
3967 }),
3968 (i.src = ".././img/accessories/access_" + e + ".png"),
3969 (Qn[e] = i),
3970 (Gn = i);
3971 }
3972 var r = $n[e];
3973 if (!r) {
3974 for (var s = 0; s < tt.length; ++s)
3975 if (tt[s].id == e) {
3976 r = tt[s];
3977 break;
3978 }
3979 $n[e] = r;
3980 }
3981 Gn.isLoaded &&
3982 (t.save(),
3983 t.translate(-20 - (r.xOff || 0), 0),
3984 r.spin && t.rotate(n.skinRot),
3985 t.drawImage(Gn, -r.scale / 2, -r.scale / 2, r.scale, r.scale),
3986 t.restore());
3987 })(e.tailIndex, t, e),
3988 e.buildIndex < 0 &&
3989 !l.weapons[e.weaponIndex].aboveHand &&
3990 (ei(
3991 l.weapons[e.weaponIndex],
3992 o.weaponVariants[e.weaponVariant].src,
3993 e.scale,
3994 0,
3995 t
3996 ),
3997 null == l.weapons[e.weaponIndex].projectile ||
3998 l.weapons[e.weaponIndex].hideProjectile ||
3999 Vn(
4000 e.scale,
4001 0,
4002 l.projectiles[l.weapons[e.weaponIndex].projectile],
4003 be
4004 )),
4005 (t.fillStyle = o.skinColors[e.skinColor]),
4006 si(e.scale * Math.cos(n), e.scale * Math.sin(n), 14),
4007 si(e.scale * r * Math.cos(-n * i), e.scale * r * Math.sin(-n * i), 14),
4008 e.buildIndex < 0 &&
4009 l.weapons[e.weaponIndex].aboveHand &&
4010 (ei(
4011 l.weapons[e.weaponIndex],
4012 o.weaponVariants[e.weaponVariant].src,
4013 e.scale,
4014 0,
4015 t
4016 ),
4017 null == l.weapons[e.weaponIndex].projectile ||
4018 l.weapons[e.weaponIndex].hideProjectile ||
4019 Vn(
4020 e.scale,
4021 0,
4022 l.projectiles[l.weapons[e.weaponIndex].projectile],
4023 be
4024 )),
4025 e.buildIndex >= 0)
4026 ) {
4027 var s = ri(l.list[e.buildIndex]);
4028 t.drawImage(s, e.scale - l.list[e.buildIndex].holdOffset, -s.width / 2);
4029 }
4030 si(0, 0, e.scale, t),
4031 e.skinIndex > 0 &&
4032 (t.rotate(Math.PI / 2),
4033 (function e(t, n, i, r) {
4034 if (!(Gn = Jn[t])) {
4035 var s = new Image();
4036 (s.onload = function() {
4037 (this.isLoaded = !0), (this.onload = null);
4038 }),
4039 (s.src = ".././img/hats/hat_" + t + ".png"),
4040 (Jn[t] = s),
4041 (Gn = s);
4042 }
4043 var a = i || Kn[t];
4044 if (!a) {
4045 for (var o = 0; o < et.length; ++o)
4046 if (et[o].id == t) {
4047 a = et[o];
4048 break;
4049 }
4050 Kn[t] = a;
4051 }
4052 Gn.isLoaded &&
4053 n.drawImage(Gn, -a.scale / 2, -a.scale / 2, a.scale, a.scale),
4054 !i &&
4055 a.topSprite &&
4056 (n.save(),
4057 n.rotate(r.skinRot),
4058 e(t + "_top", n, a, r),
4059 n.restore());
4060 })(e.skinIndex, t, null, e));
4061 }
4062 var Gn,
4063 Jn = {},
4064 Kn = {},
4065 Qn = {},
4066 $n = {},
4067 Zn = {};
4068
4069 function ei(e, t, n, i, r) {
4070 var s = e.src + (t || ""),
4071 a = Zn[s];
4072 a ||
4073 (((a = new Image()).onload = function() {
4074 this.isLoaded = !0;
4075 }),
4076 (a.src = ".././img/weapons/" + s + ".png"),
4077 (Zn[s] = a)),
4078 a.isLoaded &&
4079 r.drawImage(
4080 a,
4081 n + e.xOff - e.length / 2,
4082 i + e.yOff - e.width / 2,
4083 e.length,
4084 e.width
4085 );
4086 }
4087 var ti = {};
4088
4089 function ni(e) {
4090 var t =
4091 e.y >= o.mapScale - o.snowBiomeTop
4092 ? 2
4093 : e.y <= o.snowBiomeTop
4094 ? 1
4095 : 0,
4096 n = e.type + "_" + e.scale + "_" + t,
4097 i = ti[n];
4098 if (!i) {
4099 var r = document.createElement("canvas");
4100 r.width = r.height = 2.1 * e.scale + 5.5;
4101 var a = r.getContext("2d");
4102 if (
4103 (a.translate(r.width / 2, r.height / 2),
4104 a.rotate(s.randFloat(0, Math.PI)),
4105 (a.strokeStyle = it),
4106 (a.lineWidth = 5.5),
4107 0 == e.type)
4108 )
4109 for (var c, l = 0; l < 2; ++l)
4110 ai(a, 7, (c = _.scale * (l ? 0.5 : 1)), 0.7 * c),
4111 (a.fillStyle = t
4112 ? l
4113 ? "#fff"
4114 : "#e3f1f4"
4115 : l
4116 ? "#b4db62"
4117 : "#9ebf57"),
4118 a.fill(),
4119 l || a.stroke();
4120 else if (1 == e.type)
4121 if (2 == t)
4122 (a.fillStyle = "#606060"),
4123 ai(a, 6, 0.3 * e.scale, 0.71 * e.scale),
4124 a.fill(),
4125 a.stroke(),
4126 (a.fillStyle = "#89a54c"),
4127 si(0, 0, 0.55 * e.scale, a),
4128 (a.fillStyle = "#a5c65b"),
4129 si(0, 0, 0.3 * e.scale, a, !0);
4130 else {
4131 var h;
4132 !(function(e, t, n, i) {
4133 var r,
4134 a = (Math.PI / 2) * 3,
4135 o = Math.PI / 6;
4136 e.beginPath(), e.moveTo(0, -i);
4137 for (var c = 0; c < 6; c++)
4138 (r = s.randInt(n + 0.9, 1.2 * n)),
4139 e.quadraticCurveTo(
4140 Math.cos(a + o) * r,
4141 Math.sin(a + o) * r,
4142 Math.cos(a + 2 * o) * i,
4143 Math.sin(a + 2 * o) * i
4144 ),
4145 (a += 2 * o);
4146 e.lineTo(0, -i), e.closePath();
4147 })(a, 0, _.scale, 0.7 * _.scale),
4148 (a.fillStyle = t ? "#e3f1f4" : "#89a54c"),
4149 a.fill(),
4150 a.stroke(),
4151 (a.fillStyle = t ? "#6a64af" : "#c15555");
4152 var u = T / 4;
4153 for (l = 0; l < 4; ++l)
4154 si(
4155 (h = s.randInt(_.scale / 3.5, _.scale / 2.3)) * Math.cos(u * l),
4156 h * Math.sin(u * l),
4157 s.randInt(10, 12),
4158 a
4159 );
4160 }
4161 else
4162 (2 != e.type && 3 != e.type) ||
4163 ((a.fillStyle =
4164 2 == e.type ? (2 == t ? "#938d77" : "#939393") : "#e0c655"),
4165 ai(a, 3, e.scale, e.scale),
4166 a.fill(),
4167 a.stroke(),
4168 (a.fillStyle =
4169 2 == e.type ? (2 == t ? "#b2ab90" : "#bcbcbc") : "#ebdca3"),
4170 ai(a, 3, 0.55 * e.scale, 0.65 * e.scale),
4171 a.fill());
4172 (i = r), (ti[n] = i);
4173 }
4174 return i;
4175 }
4176 var ii = [];
4177
4178 function ri(e, t) {
4179 var n = ii[e.id];
4180 if (!n || t) {
4181 var i = document.createElement("canvas");
4182 i.width = i.height =
4183 2.5 * e.scale + 5.5 + (l.list[e.id].spritePadding || 0);
4184 var r = i.getContext("2d");
4185 if (
4186 (r.translate(i.width / 2, i.height / 2),
4187 r.rotate(t ? 0 : Math.PI / 2),
4188 (r.strokeStyle = it),
4189 (r.lineWidth = 5.5 * (t ? i.width / 81 : 1)),
4190 "apple" == e.name)
4191 ) {
4192 (r.fillStyle = "#c15555"),
4193 si(0, 0, e.scale, r),
4194 (r.fillStyle = "#89a54c");
4195 var a = -Math.PI / 2;
4196 !(function(e, t, n, i, r) {
4197 var s = e + 25 * Math.cos(i),
4198 a = t + 25 * Math.sin(i);
4199 r.moveTo(e, t),
4200 r.beginPath(),
4201 r.quadraticCurveTo(
4202 (e + s) / 2 + 10 * Math.cos(i + Math.PI / 2),
4203 (t + a) / 2 + 10 * Math.sin(i + Math.PI / 2),
4204 s,
4205 a
4206 ),
4207 r.quadraticCurveTo(
4208 (e + s) / 2 - 10 * Math.cos(i + Math.PI / 2),
4209 (t + a) / 2 - 10 * Math.sin(i + Math.PI / 2),
4210 e,
4211 t
4212 ),
4213 r.closePath(),
4214 r.fill(),
4215 r.stroke();
4216 })(
4217 e.scale * Math.cos(a),
4218 e.scale * Math.sin(a),
4219 0,
4220 a + Math.PI / 2,
4221 r
4222 );
4223 } else if ("cookie" == e.name) {
4224 (r.fillStyle = "#cca861"),
4225 si(0, 0, e.scale, r),
4226 (r.fillStyle = "#937c4b");
4227 for (var o = T / (h = 4), c = 0; c < h; ++c)
4228 si(
4229 (u = s.randInt(e.scale / 2.5, e.scale / 1.7)) * Math.cos(o * c),
4230 u * Math.sin(o * c),
4231 s.randInt(4, 5),
4232 r,
4233 !0
4234 );
4235 } else if ("cheese" == e.name) {
4236 var h, u;
4237 for (
4238 r.fillStyle = "#f4f3ac",
4239 si(0, 0, e.scale, r),
4240 r.fillStyle = "#c3c28b",
4241 o = T / (h = 4),
4242 c = 0;
4243 c < h;
4244 ++c
4245 )
4246 si(
4247 (u = s.randInt(e.scale / 2.5, e.scale / 1.7)) * Math.cos(o * c),
4248 u * Math.sin(o * c),
4249 s.randInt(4, 5),
4250 r,
4251 !0
4252 );
4253 } else if (
4254 "wood wall" == e.name ||
4255 "stone wall" == e.name ||
4256 "castle wall" == e.name
4257 ) {
4258 r.fillStyle =
4259 "castle wall" == e.name
4260 ? "#83898e"
4261 : "wood wall" == e.name
4262 ? "#a5974c"
4263 : "#939393";
4264 var f = "castle wall" == e.name ? 4 : 3;
4265 ai(r, f, 1.1 * e.scale, 1.1 * e.scale),
4266 r.fill(),
4267 r.stroke(),
4268 (r.fillStyle =
4269 "castle wall" == e.name
4270 ? "#9da4aa"
4271 : "wood wall" == e.name
4272 ? "#c9b758"
4273 : "#bcbcbc"),
4274 ai(r, f, 0.65 * e.scale, 0.65 * e.scale),
4275 r.fill();
4276 } else if (
4277 "spikes" == e.name ||
4278 "greater spikes" == e.name ||
4279 "poison spikes" == e.name ||
4280 "spinning spikes" == e.name
4281 ) {
4282 r.fillStyle = "poison spikes" == e.name ? "#7b935d" : "#939393";
4283 var d = 0.6 * e.scale;
4284 ai(r, "spikes" == e.name ? 5 : 6, e.scale, d),
4285 r.fill(),
4286 r.stroke(),
4287 (r.fillStyle = "#a5974c"),
4288 si(0, 0, d, r),
4289 (r.fillStyle = "#c9b758"),
4290 si(0, 0, d / 2, r, !0);
4291 } else if (
4292 "windmill" == e.name ||
4293 "faster windmill" == e.name ||
4294 "power mill" == e.name
4295 )
4296 (r.fillStyle = "#a5974c"),
4297 si(0, 0, e.scale, r),
4298 (r.fillStyle = "#c9b758"),
4299 ci(0, 0, 0 * e.scale, 0, 0, r),
4300 (r.fillStyle = "#a5974c"),
4301 si(0, 0, 0.5 * e.scale, r);
4302 else if ("mine" == e.name)
4303 (r.fillStyle = "#939393"),
4304 ai(r, 3, e.scale, e.scale),
4305 r.fill(),
4306 r.stroke(),
4307 (r.fillStyle = "#bcbcbc"),
4308 ai(r, 3, 0.55 * e.scale, 0.65 * e.scale),
4309 r.fill();
4310 else if ("sapling" == e.name)
4311 for (c = 0; c < 2; ++c)
4312 ai(r, 7, (d = e.scale * (c ? 0.5 : 1)), 0.7 * d),
4313 (r.fillStyle = c ? "#b4db62" : "#9ebf57"),
4314 r.fill(),
4315 c || r.stroke();
4316 else if ("pit trap" == e.name)
4317 (r.fillStyle = "#a5974c"),
4318 ai(r, 3, 1.1 * e.scale, 1.1 * e.scale),
4319 r.fill(),
4320 r.stroke(),
4321 (r.fillStyle = it),
4322 ai(r, 3, 0.65 * e.scale, 0.65 * e.scale),
4323 r.fill();
4324 else if ("boost pad" == e.name)
4325 (r.fillStyle = "#7e7f82"),
4326 oi(0, 0, 2 * e.scale, 2 * e.scale, r),
4327 r.fill(),
4328 r.stroke(),
4329 (r.fillStyle = "#dbd97d"),
4330 (function(e, t) {
4331 t = t || be;
4332 var n = e * (Math.sqrt(3) / 2);
4333 t.beginPath(),
4334 t.moveTo(0, -n / 2),
4335 t.lineTo(-e / 2, n / 2),
4336 t.lineTo(e / 2, n / 2),
4337 t.lineTo(0, -n / 2),
4338 t.fill(),
4339 t.closePath();
4340 })(1 * e.scale, r);
4341 else if ("turret" == e.name)
4342 (r.fillStyle = "#a5974c"),
4343 si(0, 0, e.scale, r),
4344 r.fill(),
4345 r.stroke(),
4346 (r.fillStyle = "#939393"),
4347 oi(0, -25, 0.9 * e.scale, 50, r),
4348 si(0, 0, 0.6 * e.scale, r),
4349 r.fill(),
4350 r.stroke();
4351 else if ("platform" == e.name) {
4352 r.fillStyle = "#cebd5f";
4353 var p = 2 * e.scale,
4354 g = p / 4,
4355 m = -e.scale / 2;
4356 for (c = 0; c < 4; ++c)
4357 oi(m - g / 2, 0, g, 2 * e.scale, r),
4358 r.fill(),
4359 r.stroke(),
4360 (m += p / 4);
4361 } else
4362 "healing pad" == e.name
4363 ? ((r.fillStyle = "#7e7f82"),
4364 oi(0, 0, 2 * e.scale, 2 * e.scale, r),
4365 r.fill(),
4366 r.stroke(),
4367 (r.fillStyle = "#db6e6e"),
4368 ci(0, 0, 0.65 * e.scale, 20, 4, r, !0))
4369 : "spawn pad" == e.name
4370 ? ((r.fillStyle = "#7e7f82"),
4371 oi(0, 0, 2 * e.scale, 2 * e.scale, r),
4372 r.fill(),
4373 r.stroke(),
4374 (r.fillStyle = "#71aad6"),
4375 si(0, 0, 0.6 * e.scale, r))
4376 : "blocker" == e.name
4377 ? ((r.fillStyle = "#7e7f82"),
4378 si(0, 0, e.scale, r),
4379 r.fill(),
4380 r.stroke(),
4381 r.rotate(Math.PI / 4),
4382 (r.fillStyle = "#db6e6e"),
4383 ci(0, 0, 0.65 * e.scale, 20, 4, r, !0))
4384 : "teleporter" == e.name &&
4385 ((r.fillStyle = "#7e7f82"),
4386 si(0, 0, e.scale, r),
4387 r.fill(),
4388 r.stroke(),
4389 r.rotate(Math.PI / 4),
4390 (r.fillStyle = "#d76edb"),
4391 si(0, 0, 0.5 * e.scale, r, !0));
4392 (n = i), t || (ii[e.id] = n);
4393 }
4394 return n;
4395 }
4396
4397 function si(e, t, n, i, r, s) {
4398 (i = i || be).beginPath(),
4399 i.arc(e, t, n, 0, 2 * Math.PI),
4400 s || i.fill(),
4401 r || i.stroke();
4402 }
4403
4404 function ai(e, t, n, i) {
4405 var r,
4406 s,
4407 a = (Math.PI / 2) * 3,
4408 o = Math.PI / t;
4409 e.beginPath(), e.moveTo(0, -n);
4410 for (var c = 0; c < t; c++)
4411 (r = Math.cos(a) * n),
4412 (s = Math.sin(a) * n),
4413 e.lineTo(r, s),
4414 (a += o),
4415 (r = Math.cos(a) * i),
4416 (s = Math.sin(a) * i),
4417 e.lineTo(r, s),
4418 (a += o);
4419 e.lineTo(0, -n), e.closePath();
4420 }
4421
4422 function oi(e, t, n, i, r, s) {
4423 r.fillRect(e - n / 2, t - i / 2, n, i),
4424 s || r.strokeRect(e - n / 2, t - i / 2, n, i);
4425 }
4426
4427 function ci(e, t, n, i, r, s, a) {
4428 s.save(), s.translate(e, t), (r = Math.ceil(r / 2));
4429 for (var o = 0; o < r; o++)
4430 oi(0, 0, 2 * n, i, s, a), s.rotate(Math.PI / r);
4431 s.restore();
4432 }
4433
4434 function li(e) {
4435 for (var t = 0; t < e.length; )
4436 nt.add(
4437 e[t],
4438 e[t + 1],
4439 e[t + 2],
4440 e[t + 3],
4441 e[t + 4],
4442 e[t + 5],
4443 l.list[e[t + 6]],
4444 !0,
4445 e[t + 7] >= 0
4446 ? {
4447 sid: e[t + 7]
4448 }
4449 : null
4450 ),
4451 (t += 8);
4452 }
4453
4454 function hi(e, t) {
4455 (_ = Mi(t)) &&
4456 ((_.xWiggle += o.gatherWiggle * Math.cos(e)),
4457 (_.yWiggle += o.gatherWiggle * Math.sin(e)));
4458 }
4459
4460 function ui(e, t) {
4461 (_ = Mi(e)) &&
4462 ((_.dir = t),
4463 (_.xWiggle += o.gatherWiggle * Math.cos(t + Math.PI)),
4464 (_.yWiggle += o.gatherWiggle * Math.sin(t + Math.PI)));
4465 }
4466
4467 function fi(e, t, n, i, r, s, a, o) {
4468 lt && (J.addProjectile(e, t, n, i, r, s, null, null, a).sid = o);
4469 }
4470
4471 function di(e, t) {
4472 for (var n = 0; n < G.length; ++n) G[n].sid == e && (G[n].range = t);
4473 }
4474
4475 function pi(e) {
4476 (_ = Ei(e)) && _.startAnim();
4477 }
4478
4479 function gi(e) {
4480 for (var t = 0; t < Y.length; ++t)
4481 (Y[t].forcePos = !Y[t].visible), (Y[t].visible = !1);
4482 if (e) {
4483 var n = Date.now();
4484 for (t = 0; t < e.length; )
4485 (_ = Ei(e[t]))
4486 ? ((_.index = e[t + 1]),
4487 (_.t1 = void 0 === _.t2 ? n : _.t2),
4488 (_.t2 = n),
4489 (_.x1 = _.x),
4490 (_.y1 = _.y),
4491 (_.x2 = e[t + 2]),
4492 (_.y2 = e[t + 3]),
4493 (_.d1 = void 0 === _.d2 ? e[t + 4] : _.d2),
4494 (_.d2 = e[t + 4]),
4495 (_.health = e[t + 5]),
4496 (_.dt = 0),
4497 (_.visible = !0))
4498 : (((_ = Z.spawn(e[t + 2], e[t + 3], e[t + 4], e[t + 1])).x2 = _.x),
4499 (_.y2 = _.y),
4500 (_.d2 = _.dir),
4501 (_.health = e[t + 5]),
4502 Z.aiTypes[e[t + 1]].name || (_.name = o.cowNames[e[t + 6]]),
4503 (_.forcePos = !0),
4504 (_.sid = e[t]),
4505 (_.visible = !0)),
4506 (t += 7);
4507 }
4508 }
4509 var mi = {};
4510
4511 function yi(e, t) {
4512 var n = e.index,
4513 i = mi[n];
4514 if (!i) {
4515 var r = new Image();
4516 (r.onload = function() {
4517 (this.isLoaded = !0), (this.onload = null);
4518 }),
4519 (r.src = ".././img/animals/" + e.src + ".png"),
4520 (i = r),
4521 (mi[n] = i);
4522 }
4523 if (i.isLoaded) {
4524 var s = 1.2 * e.scale * (e.spriteMlt || 1);
4525 t.drawImage(i, -s, -s, 2 * s, 2 * s);
4526 }
4527 }
4528
4529 function ki(e, t, n) {
4530 return e + n >= 0 && e - n <= oe && t + n >= 0 && t - n <= ce;
4531 }
4532
4533 function vi(e, t) {
4534 var n = (function(e) {
4535 for (var t = 0; t < W.length; ++t) if (W[t].id == e) return W[t];
4536 return null;
4537 })(e[0]);
4538 n || ((n = new u(e[0], e[1], o, s, J, nt, W, Y, l, et, tt)), W.push(n)),
4539 n.spawn(t ? H : null),
4540 (n.visible = !1),
4541 (n.x2 = void 0),
4542 (n.y2 = void 0),
4543 n.setData(e),
4544 t &&
4545 ((U = (R = n).x),
4546 (D = R.y),
4547 $t(),
4548 On(),
4549 Dn(),
4550 Un(0),
4551 (Be.style.display = "block"));
4552 }
4553
4554 function wi(e) {
4555 for (var t = 0; t < W.length; t++)
4556 if (W[t].id == e) {
4557 W.splice(t, 1);
4558 break;
4559 }
4560 }
4561
4562 function bi(e, t) {
4563 R && (R.itemCounts[e] = t);
4564 }
4565
4566 function xi(e, t, n) {
4567 R && ((R[e] = t), n && On());
4568 }
4569
4570 function Si(e, t) {
4571 (_ = Ii(e)) && (_.health = t);
4572 }
4573
4574 function Ti(e) {
4575 for (var t = Date.now(), n = 0; n < W.length; ++n)
4576 (W[n].forcePos = !W[n].visible), (W[n].visible = !1);
4577 for (n = 0; n < e.length; )
4578 (_ = Ii(e[n])) &&
4579 ((_.t1 = void 0 === _.t2 ? t : _.t2),
4580 (_.t2 = t),
4581 (_.x1 = _.x),
4582 (_.y1 = _.y),
4583 (_.x2 = e[n + 1]),
4584 (_.y2 = e[n + 2]),
4585 (_.d1 = void 0 === _.d2 ? e[n + 3] : _.d2),
4586 (_.d2 = e[n + 3]),
4587 (_.dt = 0),
4588 (_.buildIndex = e[n + 4]),
4589 (_.weaponIndex = e[n + 5]),
4590 (_.weaponVariant = e[n + 6]),
4591 (_.team = e[n + 7]),
4592 (_.isLeader = e[n + 8]),
4593 (_.skinIndex = e[n + 9]),
4594 (_.tailIndex = e[n + 10]),
4595 (_.iconIndex = e[n + 11]),
4596 (_.zIndex = e[n + 12]),
4597 (_.visible = !0)),
4598 (n += 13);
4599 }
4600
4601 function Ii(e) {
4602 for (var t = 0; t < W.length; ++t) if (W[t].sid == e) return W[t];
4603 return null;
4604 }
4605
4606 function Ei(e) {
4607 for (var t = 0; t < Y.length; ++t) if (Y[t].sid == e) return Y[t];
4608 return null;
4609 }
4610
4611 function Mi(e) {
4612 for (var t = 0; t < N.length; ++t) if (N[t].sid == e) return N[t];
4613 return null;
4614 }
4615 var Ai = -1;
4616
4617 function Pi() {
4618 var e = Date.now() - Ai;
4619 (window.pingTime = e), (Ie.innerText = "Ping: " + e + " ms");
4620 }
4621
4622 function Bi() {
4623 (Ai = Date.now()), r.send("pp");
4624 }
4625
4626 function Ci(e) {
4627 if (!(e < 0)) {
4628 var t = Math.floor(e / 60),
4629 n = e % 60;
4630 (n = ("0" + n).slice(-2)),
4631 (Ee.innerText = "Server restarting in " + t + ":" + n),
4632 (Ee.hidden = !1);
4633 }
4634 }
4635
4636 function Oi(e) {
4637 window.open(e, "_blank");
4638 }
4639 (window.requestAnimFrame =
4640 window.requestAnimationFrame ||
4641 window.webkitRequestAnimationFrame ||
4642 window.mozRequestAnimationFrame ||
4643 function(e) {
4644 window.setTimeout(e, 1e3 / 60);
4645 }),
4646 (function() {
4647 var e = o.mapScale / 2;
4648 nt.add(0, e, e + 200, 0, o.treeScales[3], 0),
4649 nt.add(1, e, e - 480, 0, o.treeScales[3], 0),
4650 nt.add(2, e + 300, e + 450, 0, o.treeScales[3], 0),
4651 nt.add(3, e - 950, e - 130, 0, o.treeScales[2], 0),
4652 nt.add(4, e - 750, e - 400, 0, o.treeScales[3], 0),
4653 nt.add(5, e - 700, e + 400, 0, o.treeScales[2], 0),
4654 nt.add(6, e + 800, e - 200, 0, o.treeScales[3], 0),
4655 nt.add(7, e - 260, e + 340, 0, o.bushScales[3], 1),
4656 nt.add(8, e + 760, e + 310, 0, o.bushScales[3], 1),
4657 nt.add(9, e - 800, e + 100, 0, o.bushScales[3], 1),
4658 nt.add(
4659 10,
4660 e - 800,
4661 e + 300,
4662 0,
4663 l.list[4].scale,
4664 l.list[4].id,
4665 l.list[10]
4666 ),
4667 nt.add(
4668 11,
4669 e + 650,
4670 e - 390,
4671 0,
4672 l.list[4].scale,
4673 l.list[4].id,
4674 l.list[10]
4675 ),
4676 nt.add(12, e - 400, e - 450, 0, o.rockScales[2], 2);
4677 })(),
4678 (function e() {
4679 (B = Date.now()),
4680 (P = B - q),
4681 (q = B),
4682 (function() {
4683 if (
4684 (R &&
4685 (!C || B - C >= 1e3 / o.clientSendRate) &&
4686 ((C = B), r.send("2", pn())),
4687 An < 120 &&
4688 ((An += 0.1 * P),
4689 (Ge.style.fontSize = Math.min(Math.round(An), 120) + "px")),
4690 R)
4691 ) {
4692 var e = s.getDistance(U, D, R.x, R.y),
4693 t = s.getDirection(R.x, R.y, U, D),
4694 n = Math.min(0.01 * e * P, e);
4695 e > 0.05
4696 ? ((U += n * Math.cos(t)), (D += n * Math.sin(t)))
4697 : ((U = R.x), (D = R.y));
4698 } else (U = o.mapScale / 2), (D = o.mapScale / 2);
4699 for (
4700 var i = B - 1e3 / o.serverUpdateRate, a = 0;
4701 a < W.length + Y.length;
4702 ++a
4703 )
4704 if ((_ = W[a] || Y[a - W.length]) && _.visible)
4705 if (_.forcePos) (_.x = _.x2), (_.y = _.y2), (_.dir = _.d2);
4706 else {
4707 var c = _.t2 - _.t1,
4708 l = (i - _.t1) / c;
4709 _.dt += P;
4710 var h = Math.min(1.7, _.dt / 170),
4711 u = _.x2 - _.x1;
4712 (_.x = _.x1 + u * h),
4713 (u = _.y2 - _.y1),
4714 (_.y = _.y1 + u * h),
4715 (_.dir = Math.lerpAngle(_.d2, _.d1, Math.min(1.2, l)));
4716 }
4717 var f = U - oe / 2,
4718 d = D - ce / 2;
4719 o.snowBiomeTop - d <= 0 && o.mapScale - o.snowBiomeTop - d >= ce
4720 ? ((be.fillStyle = "#b6db66"), be.fillRect(0, 0, oe, ce))
4721 : o.mapScale - o.snowBiomeTop - d <= 0
4722 ? ((be.fillStyle = "#dbc666"), be.fillRect(0, 0, oe, ce))
4723 : o.snowBiomeTop - d >= ce
4724 ? ((be.fillStyle = "#fff"), be.fillRect(0, 0, oe, ce))
4725 : o.snowBiomeTop - d >= 0
4726 ? ((be.fillStyle = "#fff"),
4727 be.fillRect(0, 0, oe, o.snowBiomeTop - d),
4728 (be.fillStyle = "#b6db66"),
4729 be.fillRect(
4730 0,
4731 o.snowBiomeTop - d,
4732 oe,
4733 ce - (o.snowBiomeTop - d)
4734 ))
4735 : ((be.fillStyle = "#b6db66"),
4736 be.fillRect(0, 0, oe, o.mapScale - o.snowBiomeTop - d),
4737 (be.fillStyle = "#dbc666"),
4738 be.fillRect(
4739 0,
4740 o.mapScale - o.snowBiomeTop - d,
4741 oe,
4742 ce - (o.mapScale - o.snowBiomeTop - d)
4743 )),
4744 In ||
4745 ((ee += te * o.waveSpeed * P) >= o.waveMax
4746 ? ((ee = o.waveMax), (te = -1))
4747 : ee <= 1 && (ee = te = 1),
4748 (be.globalAlpha = 1),
4749 (be.fillStyle = "#dbc666"),
4750 qn(f, d, be, o.riverPadding),
4751 (be.fillStyle = "#91b2db"),
4752 qn(f, d, be, 250 * (ee - 1))),
4753 (be.lineWidth = 4),
4754 (be.strokeStyle = "#000"),
4755 (be.globalAlpha = 0.06),
4756 be.beginPath();
4757 for (var p = -U; p < oe; p += ce / 18)
4758 p > 0 && (be.moveTo(p, 0), be.lineTo(p, ce));
4759 for (var g = -D; g < ce; g += ce / 18)
4760 p > 0 && (be.moveTo(0, g), be.lineTo(oe, g));
4761 for (
4762 be.stroke(),
4763 be.globalAlpha = 1,
4764 be.strokeStyle = it,
4765 Yn(-1, f, d),
4766 be.globalAlpha = 1,
4767 be.lineWidth = 5.5,
4768 zn(0, f, d),
4769 Xn(f, d, 0),
4770 be.globalAlpha = 1,
4771 a = 0;
4772 a < Y.length;
4773 ++a
4774 )
4775 (_ = Y[a]).active &&
4776 _.visible &&
4777 (_.animate(P),
4778 be.save(),
4779 be.translate(_.x - f, _.y - d),
4780 be.rotate(_.dir + _.dirPlus - Math.PI / 2),
4781 yi(_, be),
4782 be.restore());
4783 if (
4784 (Yn(0, f, d),
4785 zn(1, f, d),
4786 Yn(1, f, d),
4787 Xn(f, d, 1),
4788 Yn(2, f, d),
4789 Yn(3, f, d),
4790 (be.fillStyle = "#000"),
4791 (be.globalAlpha = 0.09),
4792 f <= 0 && be.fillRect(0, 0, -f, ce),
4793 o.mapScale - f <= oe)
4794 ) {
4795 var y = Math.max(0, -d);
4796 be.fillRect(o.mapScale - f, y, oe - (o.mapScale - f), ce - y);
4797 }
4798 if (
4799 (d <= 0 && be.fillRect(-f, 0, oe + f, -d), o.mapScale - d <= ce)
4800 ) {
4801 var k = Math.max(0, -f),
4802 v = 0;
4803 o.mapScale - f <= oe && (v = oe - (o.mapScale - f)),
4804 be.fillRect(
4805 k,
4806 o.mapScale - d,
4807 oe - k - v,
4808 ce - (o.mapScale - d)
4809 );
4810 }
4811 for (
4812 be.globalAlpha = 1,
4813 be.fillStyle = "rgba(0, 0, 70, 0.35)",
4814 be.fillRect(0, 0, oe, ce),
4815 be.strokeStyle = rt,
4816 a = 0;
4817 a < W.length + Y.length;
4818 ++a
4819 )
4820 if (
4821 (_ = W[a] || Y[a - W.length]).visible &&
4822 (10 != _.skinIndex || _ == R || (_.team && _.team == R.team))
4823 ) {
4824 //if u want blank un // the thing bellow
4825 //var w = (_.team?"["+_.team+"] ":"")+(_.name||"")
4826 var w =
4827 (_.team ? "[" + _.team + "]" : "") +
4828 (_.isPlayer && _.sid ? " " : "") +
4829 (_.name + " [" + _.sid + "]" || "");
4830 if ("" != w) {
4831 if (
4832 ((be.font = (_.nameScale || 30) + "px Hammersmith One"),
4833 (be.fillStyle = "#fff"),
4834 (be.textBaseline = "middle"),
4835 (be.textAlign = "center"),
4836 (be.lineWidth = _.nameScale ? 11 : 8),
4837 (be.lineJoin = "round"),
4838 (be.strokeStyle = "black"),
4839 be.strokeText(w, _.x - f, _.y - d - _.scale - o.nameY),
4840 be.fillText(w, _.x - f, _.y - d - _.scale - o.nameY),
4841 _.isLeader && Rn.crown.isLoaded)
4842 ) {
4843 var b = o.crownIconScale;
4844 (k =
4845 _.x -
4846 f -
4847 b / 2 -
4848 be.measureText(w).width / 2 -
4849 o.crownPad),
4850 be.drawImage(
4851 Rn.crown,
4852 k,
4853 _.y - d - _.scale - o.nameY - b / 2 - 5,
4854 b,
4855 b
4856 );
4857 }
4858 1 == _.iconIndex &&
4859 Rn.skull.isLoaded &&
4860 ((b = o.crownIconScale),
4861 (k =
4862 _.x -
4863 f -
4864 b / 2 +
4865 be.measureText(w).width / 2 +
4866 o.crownPad),
4867 be.drawImage(
4868 Rn.skull,
4869 k,
4870 _.y - d - _.scale - o.nameY - b / 2 - 5,
4871 b,
4872 b
4873 ));
4874 }
4875 window.items = R.items;
4876 window.w = R.weapons;
4877 if (HP == true) {
4878 (be.textAlign = "center"),
4879 (be.fillStyle = "#fff"),
4880 (be.lineJoin = "round"),
4881 (be.font = "20px Hammersmith One"),
4882 (be.lineWidth = 6),
4883 be.strokeText(
4884 `\nHP:${_.health}/${_.maxHealth}`,
4885 _.x - f,
4886 _.y - d + _.scale + o.nameY - 160.6
4887 ),
4888 be.fillText(
4889 `\nHP:${_.health}/${_.maxHealth}`,
4890 _.x - f,
4891 _.y - d + _.scale + o.nameY - 160.6
4892 );
4893 }
4894 if (_.isPlayer && _ != R && _.team && _.team == R.team) {
4895 //tribe tracers
4896 be.lineCap = "round";
4897 be.strokeStyle = "transparent";
4898 be.lineWidth = 3;
4899 be.beginPath();
4900 be.moveTo(R.x - f, R.y - d);
4901 be.lineTo(_.x - f, _.y - d);
4902 be.stroke();
4903 be.strokeStyle = nt;
4904 }
4905 if (
4906 EnemyRadar == true &&
4907 _.isPlayer &&
4908 _ != R &&
4909 (_.team != R.team || !_.team)
4910 ) {
4911 be.lineCap = "round";
4912 be.strokeStyle = "#000000";
4913 be.lineWidth = 3;
4914 be.beginPath();
4915 be.moveTo(R.x - f, R.y - d);
4916 be.lineTo(_.x - f, _.y - d);
4917 be.stroke();
4918 be.strokeStyle = nt;
4919 }
4920 if (animalRadar == true && !_.isPlayer) {
4921 be.lineCap = "round";
4922 be.strokeStyle = "#221abf";
4923 be.lineWidth = 3;
4924 be.beginPath();
4925 be.moveTo(R.x - f, R.y - d);
4926 be.lineTo(_.x - f, _.y - d);
4927 be.stroke();
4928 be.strokeStyle = nt;
4929 }
4930 if (
4931 showname == true &&
4932 _.isPlayer &&
4933 _ != R &&
4934 (_.team != R.team || !_.team)
4935 ) {
4936 (be.font = (_.nameScale || 30) + "px Hammersmith One"),
4937 (be.fillStyle = "white"),
4938 (be.textBaseline = "middle"),
4939 (be.textAlign = "center"),
4940 (be.lineWidth = _.nameScale ? 11 : 8),
4941 (be.lineJoin = "round"),
4942 (be.strokeStyle = "trapsparent"),
4943 be.strokeText(
4944 _.name,
4945 (R.x - f + _.x - f) / 2,
4946 (R.y - d + _.y - d) / 2
4947 ),
4948 be.fillText(
4949 _.name,
4950 (R.x - f + _.x - f) / 2,
4951 (R.y - d + _.y - d) / 2
4952 );
4953 }
4954 _.health > 0 &&
4955 (o.healthBarWidth,
4956 (be.fillStyle = rt),
4957 be.roundRect(
4958 _.x - f - o.healthBarWidth - o.healthBarPad,
4959 _.y - d + _.scale + o.nameY,
4960 2 * o.healthBarWidth + 2 * o.healthBarPad,
4961 17,
4962 8
4963 ),
4964 be.fill(),
4965 (be.fillStyle =
4966 _ == R || (_.team && _.team == R.team)
4967 ? "#8ecc51"
4968 : "#cc5151"),
4969 be.roundRect(
4970 _.x - f - o.healthBarWidth,
4971 _.y - d + _.scale + o.nameY + o.healthBarPad,
4972 2 * o.healthBarWidth * (_.health / _.maxHealth),
4973 17 - 2 * o.healthBarPad,
4974 7
4975 ),
4976 be.fill());
4977 }
4978 for (m.update(P, be, f, d), a = 0; a < W.length; ++a)
4979 if ((_ = W[a]).visible && _.chatCountdown > 0) {
4980 (_.chatCountdown -= P),
4981 _.chatCountdown <= 0 && (_.chatCountdown = 0),
4982 (be.font = "32px Hammersmith One");
4983 var x = be.measureText(_.chatMessage);
4984 (be.textBaseline = "middle"),
4985 (be.textAlign = "center"),
4986 (k = _.x - f),
4987 (y = _.y - _.scale - d - 90);
4988 var S = x.width + 17;
4989 (be.fillStyle = "rgba(0,0,0,0.2)"),
4990 be.roundRect(k - S / 2, y - 23.5, S, 47, 6),
4991 be.fill(),
4992 (be.fillStyle = "#fff"),
4993 be.fillText(_.chatMessage, k, y);
4994 }
4995 !(function(e) {
4996 if (R && R.alive) {
4997 Ke.clearRect(0, 0, Ne.width, Ne.height),
4998 (Ke.strokeStyle = "#fff"),
4999 (Ke.lineWidth = 4);
5000 for (var t = 0; t < qt.length; ++t) (Vt = qt[t]).update(Ke, e);
5001 if (
5002 ((Ke.globalAlpha = 1),
5003 (Ke.fillStyle = "#fff"),
5004 si(
5005 (R.x / o.mapScale) * Ne.width,
5006 (R.y / o.mapScale) * Ne.height,
5007 7,
5008 Ke,
5009 !0
5010 ),
5011 (Ke.fillStyle = "rgba(255,255,255,0.35)"),
5012 R.team && Et)
5013 )
5014 for (t = 0; t < Et.length; )
5015 si(
5016 (Et[t] / o.mapScale) * Ne.width,
5017 (Et[t + 1] / o.mapScale) * Ne.height,
5018 7,
5019 Ke,
5020 !0
5021 ),
5022 (t += 2);
5023 It &&
5024 ((Ke.fillStyle = "#0a0a0a"),
5025 (Ke.font = "34px Hammersmith One"),
5026 (Ke.textBaseline = "middle"),
5027 (Ke.textAlign = "center"),
5028 Ke.fillText(
5029 "x",
5030 (It.x / o.mapScale) * Ne.width,
5031 (It.y / o.mapScale) * Ne.height
5032 )),
5033 Mt &&
5034 ((Ke.fillStyle = "#fff"),
5035 (Ke.font = "34px Hammersmith One"),
5036 (Ke.textBaseline = "middle"),
5037 (Ke.textAlign = "center"),
5038 Ke.fillText(
5039 "x",
5040 (Mt.x / o.mapScale) * Ne.width,
5041 (Mt.y / o.mapScale) * Ne.height
5042 ));
5043 }
5044 })(P),
5045 -1 !== re.id &&
5046 Fn(re.startX, re.startY, re.currentX, re.currentY),
5047 -1 !== se.id &&
5048 Fn(se.startX, se.startY, se.currentX, se.currentY);
5049 })(),
5050 requestAnimFrame(e);
5051 })(),
5052 (window.openLink = Oi),
5053 (window.aJoinReq = Dt),
5054 (window.follmoo = function() {
5055 H || ((H = !0), I("moofoll", 1));
5056 }),
5057 (window.kickFromClan = Lt),
5058 (window.sendJoin = Ft),
5059 (window.leaveAlliance = Ht),
5060 (window.createAlliance = zt),
5061 (window.storeBuy = Kt),
5062 (window.storeEquip = Jt),
5063 (window.showItemInfo = Tt),
5064 (window.selectSkinColor = function(e) {
5065 (ae = e), en();
5066 }),
5067 (window.changeStoreIndex = function(e) {
5068 Xt != e && ((Xt = e), Gt());
5069 }),
5070 (window.config = o);
5071 },
5072 function(e, t) {
5073 !(function(e, t, n) {
5074 function i(e, t) {
5075 return typeof e === t;
5076 }
5077 var r = [],
5078 s = [],
5079 a = {
5080 _version: "3.5.0",
5081 _config: {
5082 classPrefix: "",
5083 enableClasses: !0,
5084 enableJSClass: !0,
5085 usePrefixes: !0
5086 },
5087 _q: [],
5088 on: function(e, t) {
5089 var n = this;
5090 setTimeout(function() {
5091 t(n[e]);
5092 }, 0);
5093 },
5094 addTest: function(e, t, n) {
5095 s.push({
5096 name: e,
5097 fn: t,
5098 options: n
5099 });
5100 },
5101 addAsyncTest: function(e) {
5102 s.push({
5103 name: null,
5104 fn: e
5105 });
5106 }
5107 },
5108 o = function() {};
5109 (o.prototype = a), (o = new o());
5110 var c = t.documentElement,
5111 l = "svg" === c.nodeName.toLowerCase();
5112 o.addTest("passiveeventlisteners", function() {
5113 var t = !1;
5114 try {
5115 var n = Object.defineProperty({}, "passive", {
5116 get: function() {
5117 t = !0;
5118 }
5119 });
5120 e.addEventListener("test", null, n);
5121 } catch (e) {}
5122 return t;
5123 }),
5124 (function() {
5125 var e, t, n, a, c, l;
5126 for (var h in s)
5127 if (s.hasOwnProperty(h)) {
5128 if (
5129 ((e = []),
5130 (t = s[h]).name &&
5131 (e.push(t.name.toLowerCase()),
5132 t.options && t.options.aliases && t.options.aliases.length))
5133 )
5134 for (n = 0; n < t.options.aliases.length; n++)
5135 e.push(t.options.aliases[n].toLowerCase());
5136 for (
5137 a = i(t.fn, "function") ? t.fn() : t.fn, c = 0;
5138 c < e.length;
5139 c++
5140 )
5141 1 === (l = e[c].split(".")).length
5142 ? (o[l[0]] = a)
5143 : (!o[l[0]] ||
5144 o[l[0]] instanceof Boolean ||
5145 (o[l[0]] = new Boolean(o[l[0]])),
5146 (o[l[0]][l[1]] = a)),
5147 r.push((a ? "" : "no-") + l.join("-"));
5148 }
5149 })(),
5150 (function(e) {
5151 var t = c.className,
5152 n = o._config.classPrefix || "";
5153 if ((l && (t = t.baseVal), o._config.enableJSClass)) {
5154 var i = new RegExp("(^|\\s)" + n + "no-js(\\s|$)");
5155 t = t.replace(i, "$1" + n + "js$2");
5156 }
5157 o._config.enableClasses &&
5158 ((t += " " + n + e.join(" " + n)),
5159 l ? (c.className.baseVal = t) : (c.className = t));
5160 })(r),
5161 delete a.addTest,
5162 delete a.addAsyncTest;
5163 for (var h = 0; h < o._q.length; h++) o._q[h]();
5164 e.Modernizr = o;
5165 })(window, document);
5166 },
5167 function(e, t, n) {
5168 var i = n(24);
5169 n(19),
5170 (e.exports = {
5171 socket: null,
5172 connected: !1,
5173 socketId: -1,
5174 connect: function(e, t, n) {
5175 if (!this.socket) {
5176 var r = this;
5177 try {
5178 var s = !1,
5179 a = e;
5180 (this.socket = new WebSocket(a)),
5181 (this.socket.binaryType = "arraybuffer"),
5182 (this.socket.onmessage = function(e) {
5183 var t = new Uint8Array(e.data),
5184 s = i.decode(t),
5185 a = s[0];
5186 (t = s[1]),
5187 "io-init" == a
5188 ? (r.socketId = t[0])
5189 : n[a].apply(void 0, t);
5190 }),
5191 (this.socket.onopen = function() {
5192 (r.connected = !0), t();
5193 }),
5194 (this.socket.onclose = function(e) {
5195 (r.connected = !1),
5196 4001 == e.code
5197 ? t("Invalid Connection")
5198 : s || t("disconnected");
5199 }),
5200 (this.socket.onerror = function(e) {
5201 this.socket &&
5202 this.socket.readyState != WebSocket.OPEN &&
5203 ((s = !0),
5204 console.error("Socket error", arguments),
5205 t("Socket error"));
5206 });
5207 } catch (e) {
5208 console.warn("Socket connection error:", e), t(e);
5209 }
5210 }
5211 },
5212 send: function(e) {
5213 var t = Array.prototype.slice.call(arguments, 1),
5214 n = i.encode([e, t]);
5215 this.socket.send(n);
5216 },
5217 socketReady: function() {
5218 return this.socket && this.connected;
5219 },
5220 close: function() {
5221 this.socket && this.socket.close();
5222 }
5223 });
5224 },
5225 function(e, t, n) {
5226 (t.encode = n(9).encode),
5227 (t.decode = n(15).decode),
5228 (t.Encoder = n(37).Encoder),
5229 (t.Decoder = n(38).Decoder),
5230 (t.createCodec = n(39).createCodec),
5231 (t.codec = n(40).codec);
5232 },
5233 function(e, t, n) {
5234 (function(t) {
5235 function n(e) {
5236 return e && e.isBuffer && e;
5237 }
5238 e.exports =
5239 n(void 0 !== t && t) ||
5240 n(this.Buffer) ||
5241 n("undefined" != typeof window && window.Buffer) ||
5242 this.Buffer;
5243 }.call(this, n(11).Buffer));
5244 },
5245 function(e, t, n) {
5246 "use strict";
5247 (t.byteLength = function(e) {
5248 var t = l(e),
5249 n = t[0],
5250 i = t[1];
5251 return (3 * (n + i)) / 4 - i;
5252 }),
5253 (t.toByteArray = function(e) {
5254 var t,
5255 n,
5256 i = l(e),
5257 a = i[0],
5258 o = i[1],
5259 c = new s(
5260 (function(e, t, n) {
5261 return (3 * (t + n)) / 4 - n;
5262 })(0, a, o)
5263 ),
5264 h = 0,
5265 u = o > 0 ? a - 4 : a;
5266 for (n = 0; n < u; n += 4)
5267 (t =
5268 (r[e.charCodeAt(n)] << 18) |
5269 (r[e.charCodeAt(n + 1)] << 12) |
5270 (r[e.charCodeAt(n + 2)] << 6) |
5271 r[e.charCodeAt(n + 3)]),
5272 (c[h++] = (t >> 16) & 255),
5273 (c[h++] = (t >> 8) & 255),
5274 (c[h++] = 255 & t);
5275 return (
5276 2 === o &&
5277 ((t = (r[e.charCodeAt(n)] << 2) | (r[e.charCodeAt(n + 1)] >> 4)),
5278 (c[h++] = 255 & t)),
5279 1 === o &&
5280 ((t =
5281 (r[e.charCodeAt(n)] << 10) |
5282 (r[e.charCodeAt(n + 1)] << 4) |
5283 (r[e.charCodeAt(n + 2)] >> 2)),
5284 (c[h++] = (t >> 8) & 255),
5285 (c[h++] = 255 & t)),
5286 c
5287 );
5288 }),
5289 (t.fromByteArray = function(e) {
5290 for (
5291 var t, n = e.length, r = n % 3, s = [], a = 0, o = n - r;
5292 a < o;
5293 a += 16383
5294 )
5295 s.push(u(e, a, a + 16383 > o ? o : a + 16383));
5296 return (
5297 1 === r
5298 ? ((t = e[n - 1]), s.push(i[t >> 2] + i[(t << 4) & 63] + "=="))
5299 : 2 === r &&
5300 ((t = (e[n - 2] << 8) + e[n - 1]),
5301 s.push(i[t >> 10] + i[(t >> 4) & 63] + i[(t << 2) & 63] + "=")),
5302 s.join("")
5303 );
5304 });
5305 for (
5306 var i = [],
5307 r = [],
5308 s = "undefined" != typeof Uint8Array ? Uint8Array : Array,
5309 a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
5310 o = 0,
5311 c = a.length;
5312 o < c;
5313 ++o
5314 )
5315 (i[o] = a[o]), (r[a.charCodeAt(o)] = o);
5316
5317 function l(e) {
5318 var t = e.length;
5319 if (t % 4 > 0)
5320 throw new Error("Invalid string. Length must be a multiple of 4");
5321 var n = e.indexOf("=");
5322 return -1 === n && (n = t), [n, n === t ? 0 : 4 - (n % 4)];
5323 }
5324
5325 function h(e) {
5326 return (
5327 i[(e >> 18) & 63] + i[(e >> 12) & 63] + i[(e >> 6) & 63] + i[63 & e]
5328 );
5329 }
5330
5331 function u(e, t, n) {
5332 for (var i, r = [], s = t; s < n; s += 3)
5333 (i =
5334 ((e[s] << 16) & 16711680) +
5335 ((e[s + 1] << 8) & 65280) +
5336 (255 & e[s + 2])),
5337 r.push(h(i));
5338 return r.join("");
5339 }
5340 (r["-".charCodeAt(0)] = 62), (r["_".charCodeAt(0)] = 63);
5341 },
5342 function(e, t) {
5343 var n = {}.toString;
5344 e.exports =
5345 Array.isArray ||
5346 function(e) {
5347 return "[object Array]" == n.call(e);
5348 };
5349 },
5350 function(e, t, n) {
5351 var i = n(0);
5352
5353 function r(e) {
5354 return new Array(e);
5355 }
5356 ((t = e.exports = r(0)).alloc = r),
5357 (t.concat = i.concat),
5358 (t.from = function(e) {
5359 if (!i.isBuffer(e) && i.isView(e)) e = i.Uint8Array.from(e);
5360 else if (i.isArrayBuffer(e)) e = new Uint8Array(e);
5361 else {
5362 if ("string" == typeof e) return i.from.call(t, e);
5363 if ("number" == typeof e)
5364 throw new TypeError('"value" argument must not be a number');
5365 }
5366 return Array.prototype.slice.call(e);
5367 });
5368 },
5369 function(e, t, n) {
5370 var i = n(0),
5371 r = i.global;
5372
5373 function s(e) {
5374 return new r(e);
5375 }
5376 ((t = e.exports = i.hasBuffer ? s(0) : []).alloc =
5377 (i.hasBuffer && r.alloc) || s),
5378 (t.concat = i.concat),
5379 (t.from = function(e) {
5380 if (!i.isBuffer(e) && i.isView(e)) e = i.Uint8Array.from(e);
5381 else if (i.isArrayBuffer(e)) e = new Uint8Array(e);
5382 else {
5383 if ("string" == typeof e) return i.from.call(t, e);
5384 if ("number" == typeof e)
5385 throw new TypeError('"value" argument must not be a number');
5386 }
5387 return r.from && 1 !== r.from.length ? r.from(e) : new r(e);
5388 });
5389 },
5390 function(e, t, n) {
5391 var i = n(0);
5392
5393 function r(e) {
5394 return new Uint8Array(e);
5395 }
5396 ((t = e.exports = i.hasArrayBuffer ? r(0) : []).alloc = r),
5397 (t.concat = i.concat),
5398 (t.from = function(e) {
5399 if (i.isView(e)) {
5400 var n = e.byteOffset,
5401 r = e.byteLength;
5402 (e = e.buffer).byteLength !== r &&
5403 (e.slice
5404 ? (e = e.slice(n, n + r))
5405 : (e = new Uint8Array(e)).byteLength !== r &&
5406 (e = Array.prototype.slice.call(e, n, n + r)));
5407 } else {
5408 if ("string" == typeof e) return i.from.call(t, e);
5409 if ("number" == typeof e)
5410 throw new TypeError('"value" argument must not be a number');
5411 }
5412 return new Uint8Array(e);
5413 });
5414 },
5415 function(e, t) {
5416 (t.copy = function(e, t, n, i) {
5417 var r;
5418 n || (n = 0), i || 0 === i || (i = this.length), t || (t = 0);
5419 var s = i - n;
5420 if (e === this && n < t && t < i)
5421 for (r = s - 1; r >= 0; r--) e[r + t] = this[r + n];
5422 else for (r = 0; r < s; r++) e[r + t] = this[r + n];
5423 return s;
5424 }),
5425 (t.toString = function(e, t, n) {
5426 var i = 0 | t;
5427 n || (n = this.length);
5428 for (var r = "", s = 0; i < n; )
5429 (s = this[i++]) < 128
5430 ? (r += String.fromCharCode(s))
5431 : (192 == (224 & s)
5432 ? (s = ((31 & s) << 6) | (63 & this[i++]))
5433 : 224 == (240 & s)
5434 ? (s =
5435 ((15 & s) << 12) |
5436 ((63 & this[i++]) << 6) |
5437 (63 & this[i++]))
5438 : 240 == (248 & s) &&
5439 (s =
5440 ((7 & s) << 18) |
5441 ((63 & this[i++]) << 12) |
5442 ((63 & this[i++]) << 6) |
5443 (63 & this[i++])),
5444 s >= 65536
5445 ? ((s -= 65536),
5446 (r += String.fromCharCode(
5447 55296 + (s >>> 10),
5448 56320 + (1023 & s)
5449 )))
5450 : (r += String.fromCharCode(s)));
5451 return r;
5452 }),
5453 (t.write = function(e, t) {
5454 for (var n = t || (t |= 0), i = e.length, r = 0, s = 0; s < i; )
5455 (r = e.charCodeAt(s++)) < 128
5456 ? (this[n++] = r)
5457 : r < 2048
5458 ? ((this[n++] = 192 | (r >>> 6)), (this[n++] = 128 | (63 & r)))
5459 : r < 55296 || r > 57343
5460 ? ((this[n++] = 224 | (r >>> 12)),
5461 (this[n++] = 128 | ((r >>> 6) & 63)),
5462 (this[n++] = 128 | (63 & r)))
5463 : ((r =
5464 65536 + (((r - 55296) << 10) | (e.charCodeAt(s++) - 56320))),
5465 (this[n++] = 240 | (r >>> 18)),
5466 (this[n++] = 128 | ((r >>> 12) & 63)),
5467 (this[n++] = 128 | ((r >>> 6) & 63)),
5468 (this[n++] = 128 | (63 & r)));
5469 return n - t;
5470 });
5471 },
5472 function(e, t, n) {
5473 t.setExtPackers = function(e) {
5474 e.addExtPacker(14, Error, [u, c]),
5475 e.addExtPacker(1, EvalError, [u, c]),
5476 e.addExtPacker(2, RangeError, [u, c]),
5477 e.addExtPacker(3, ReferenceError, [u, c]),
5478 e.addExtPacker(4, SyntaxError, [u, c]),
5479 e.addExtPacker(5, TypeError, [u, c]),
5480 e.addExtPacker(6, URIError, [u, c]),
5481 e.addExtPacker(10, RegExp, [h, c]),
5482 e.addExtPacker(11, Boolean, [l, c]),
5483 e.addExtPacker(12, String, [l, c]),
5484 e.addExtPacker(13, Date, [Number, c]),
5485 e.addExtPacker(15, Number, [l, c]),
5486 "undefined" != typeof Uint8Array &&
5487 (e.addExtPacker(17, Int8Array, a),
5488 e.addExtPacker(18, Uint8Array, a),
5489 e.addExtPacker(19, Int16Array, a),
5490 e.addExtPacker(20, Uint16Array, a),
5491 e.addExtPacker(21, Int32Array, a),
5492 e.addExtPacker(22, Uint32Array, a),
5493 e.addExtPacker(23, Float32Array, a),
5494 "undefined" != typeof Float64Array &&
5495 e.addExtPacker(24, Float64Array, a),
5496 "undefined" != typeof Uint8ClampedArray &&
5497 e.addExtPacker(25, Uint8ClampedArray, a),
5498 e.addExtPacker(26, ArrayBuffer, a),
5499 e.addExtPacker(29, DataView, a)),
5500 r.hasBuffer && e.addExtPacker(27, s, r.from);
5501 };
5502 var i,
5503 r = n(0),
5504 s = r.global,
5505 a = r.Uint8Array.from,
5506 o = {
5507 name: 1,
5508 message: 1,
5509 stack: 1,
5510 columnNumber: 1,
5511 fileName: 1,
5512 lineNumber: 1
5513 };
5514
5515 function c(e) {
5516 return i || (i = n(9).encode), i(e);
5517 }
5518
5519 function l(e) {
5520 return e.valueOf();
5521 }
5522
5523 function h(e) {
5524 (e = RegExp.prototype.toString.call(e).split("/")).shift();
5525 var t = [e.pop()];
5526 return t.unshift(e.join("/")), t;
5527 }
5528
5529 function u(e) {
5530 var t = {};
5531 for (var n in o) t[n] = e[n];
5532 return t;
5533 }
5534 },
5535 function(e, t, n) {
5536 var i = n(5),
5537 r = n(7),
5538 s = r.Uint64BE,
5539 a = r.Int64BE,
5540 o = n(0),
5541 c = n(6),
5542 l = n(34),
5543 h = n(13).uint8,
5544 u = n(3).ExtBuffer,
5545 f = "undefined" != typeof Uint8Array,
5546 d = "undefined" != typeof Map,
5547 p = [];
5548 (p[1] = 212),
5549 (p[2] = 213),
5550 (p[4] = 214),
5551 (p[8] = 215),
5552 (p[16] = 216),
5553 (t.getWriteType = function(e) {
5554 var t = l.getWriteToken(e),
5555 n = e && e.useraw,
5556 r = f && e && e.binarraybuffer,
5557 g = r ? o.isArrayBuffer : o.isBuffer,
5558 m = r
5559 ? function(e, t) {
5560 w(e, new Uint8Array(t));
5561 }
5562 : w,
5563 y =
5564 d && e && e.usemap
5565 ? function(e, n) {
5566 if (!(n instanceof Map)) return b(e, n);
5567 var i = n.size;
5568 t[i < 16 ? 128 + i : i <= 65535 ? 222 : 223](e, i);
5569 var r = e.codec.encode;
5570 n.forEach(function(t, n, i) {
5571 r(e, n), r(e, t);
5572 });
5573 }
5574 : b;
5575 return {
5576 boolean: function(e, n) {
5577 t[n ? 195 : 194](e, n);
5578 },
5579 function: v,
5580 number: function(e, n) {
5581 var i = 0 | n;
5582 n === i
5583 ? t[
5584 -32 <= i && i <= 127
5585 ? 255 & i
5586 : 0 <= i
5587 ? i <= 255
5588 ? 204
5589 : i <= 65535
5590 ? 205
5591 : 206
5592 : -128 <= i
5593 ? 208
5594 : -32768 <= i
5595 ? 209
5596 : 210
5597 ](e, i)
5598 : t[203](e, n);
5599 },
5600 object: n
5601 ? function(e, n) {
5602 if (g(n))
5603 return (function(e, n) {
5604 var i = n.length;
5605 t[i < 32 ? 160 + i : i <= 65535 ? 218 : 219](e, i),
5606 e.send(n);
5607 })(e, n);
5608 k(e, n);
5609 }
5610 : k,
5611 string: (function(e) {
5612 return function(n, i) {
5613 var r = i.length,
5614 s = 5 + 3 * r;
5615 n.offset = n.reserve(s);
5616 var a = n.buffer,
5617 o = e(r),
5618 l = n.offset + o;
5619 r = c.write.call(a, i, l);
5620 var h = e(r);
5621 if (o !== h) {
5622 var u = l + h - o,
5623 f = l + r;
5624 c.copy.call(a, a, u, l, f);
5625 }
5626 t[1 === h ? 160 + r : h <= 3 ? 215 + h : 219](n, r),
5627 (n.offset += r);
5628 };
5629 })(
5630 n
5631 ? function(e) {
5632 return e < 32 ? 1 : e <= 65535 ? 3 : 5;
5633 }
5634 : function(e) {
5635 return e < 32 ? 1 : e <= 255 ? 2 : e <= 65535 ? 3 : 5;
5636 }
5637 ),
5638 symbol: v,
5639 undefined: v
5640 };
5641
5642 function k(e, n) {
5643 if (null === n) return v(e, n);
5644 if (g(n)) return m(e, n);
5645 if (i(n))
5646 return (function(e, n) {
5647 var i = n.length;
5648 t[i < 16 ? 144 + i : i <= 65535 ? 220 : 221](e, i);
5649 for (var r = e.codec.encode, s = 0; s < i; s++) r(e, n[s]);
5650 })(e, n);
5651 if (s.isUint64BE(n))
5652 return (function(e, n) {
5653 t[207](e, n.toArray());
5654 })(e, n);
5655 if (a.isInt64BE(n))
5656 return (function(e, n) {
5657 t[211](e, n.toArray());
5658 })(e, n);
5659 var r = e.codec.getExtPacker(n);
5660 if ((r && (n = r(n)), n instanceof u))
5661 return (function(e, n) {
5662 var i = n.buffer,
5663 r = i.length,
5664 s = p[r] || (r < 255 ? 199 : r <= 65535 ? 200 : 201);
5665 t[s](e, r), h[n.type](e), e.send(i);
5666 })(e, n);
5667 y(e, n);
5668 }
5669
5670 function v(e, n) {
5671 t[192](e, n);
5672 }
5673
5674 function w(e, n) {
5675 var i = n.length;
5676 t[i < 255 ? 196 : i <= 65535 ? 197 : 198](e, i), e.send(n);
5677 }
5678
5679 function b(e, n) {
5680 var i = Object.keys(n),
5681 r = i.length;
5682 t[r < 16 ? 128 + r : r <= 65535 ? 222 : 223](e, r);
5683 var s = e.codec.encode;
5684 i.forEach(function(t) {
5685 s(e, t), s(e, n[t]);
5686 });
5687 }
5688 });
5689 },
5690 function(e, t, n) {
5691 var i = n(4),
5692 r = n(7),
5693 s = r.Uint64BE,
5694 a = r.Int64BE,
5695 o = n(13).uint8,
5696 c = n(0),
5697 l = c.global,
5698 h = c.hasBuffer && "TYPED_ARRAY_SUPPORT" in l && !l.TYPED_ARRAY_SUPPORT,
5699 u = (c.hasBuffer && l.prototype) || {};
5700
5701 function f() {
5702 var e = o.slice();
5703 return (
5704 (e[196] = d(196)),
5705 (e[197] = p(197)),
5706 (e[198] = g(198)),
5707 (e[199] = d(199)),
5708 (e[200] = p(200)),
5709 (e[201] = g(201)),
5710 (e[202] = m(202, 4, u.writeFloatBE || v, !0)),
5711 (e[203] = m(203, 8, u.writeDoubleBE || w, !0)),
5712 (e[204] = d(204)),
5713 (e[205] = p(205)),
5714 (e[206] = g(206)),
5715 (e[207] = m(207, 8, y)),
5716 (e[208] = d(208)),
5717 (e[209] = p(209)),
5718 (e[210] = g(210)),
5719 (e[211] = m(211, 8, k)),
5720 (e[217] = d(217)),
5721 (e[218] = p(218)),
5722 (e[219] = g(219)),
5723 (e[220] = p(220)),
5724 (e[221] = g(221)),
5725 (e[222] = p(222)),
5726 (e[223] = g(223)),
5727 e
5728 );
5729 }
5730
5731 function d(e) {
5732 return function(t, n) {
5733 var i = t.reserve(2),
5734 r = t.buffer;
5735 (r[i++] = e), (r[i] = n);
5736 };
5737 }
5738
5739 function p(e) {
5740 return function(t, n) {
5741 var i = t.reserve(3),
5742 r = t.buffer;
5743 (r[i++] = e), (r[i++] = n >>> 8), (r[i] = n);
5744 };
5745 }
5746
5747 function g(e) {
5748 return function(t, n) {
5749 var i = t.reserve(5),
5750 r = t.buffer;
5751 (r[i++] = e),
5752 (r[i++] = n >>> 24),
5753 (r[i++] = n >>> 16),
5754 (r[i++] = n >>> 8),
5755 (r[i] = n);
5756 };
5757 }
5758
5759 function m(e, t, n, i) {
5760 return function(r, s) {
5761 var a = r.reserve(t + 1);
5762 (r.buffer[a++] = e), n.call(r.buffer, s, a, i);
5763 };
5764 }
5765
5766 function y(e, t) {
5767 new s(this, t, e);
5768 }
5769
5770 function k(e, t) {
5771 new a(this, t, e);
5772 }
5773
5774 function v(e, t) {
5775 i.write(this, e, t, !1, 23, 4);
5776 }
5777
5778 function w(e, t) {
5779 i.write(this, e, t, !1, 52, 8);
5780 }
5781 t.getWriteToken = function(e) {
5782 return e && e.uint8array
5783 ? (function() {
5784 var e = f();
5785 return (e[202] = m(202, 4, v)), (e[203] = m(203, 8, w)), e;
5786 })()
5787 : h || (c.hasBuffer && e && e.safe)
5788 ? (function() {
5789 var e = o.slice();
5790 return (
5791 (e[196] = m(196, 1, l.prototype.writeUInt8)),
5792 (e[197] = m(197, 2, l.prototype.writeUInt16BE)),
5793 (e[198] = m(198, 4, l.prototype.writeUInt32BE)),
5794 (e[199] = m(199, 1, l.prototype.writeUInt8)),
5795 (e[200] = m(200, 2, l.prototype.writeUInt16BE)),
5796 (e[201] = m(201, 4, l.prototype.writeUInt32BE)),
5797 (e[202] = m(202, 4, l.prototype.writeFloatBE)),
5798 (e[203] = m(203, 8, l.prototype.writeDoubleBE)),
5799 (e[204] = m(204, 1, l.prototype.writeUInt8)),
5800 (e[205] = m(205, 2, l.prototype.writeUInt16BE)),
5801 (e[206] = m(206, 4, l.prototype.writeUInt32BE)),
5802 (e[207] = m(207, 8, y)),
5803 (e[208] = m(208, 1, l.prototype.writeInt8)),
5804 (e[209] = m(209, 2, l.prototype.writeInt16BE)),
5805 (e[210] = m(210, 4, l.prototype.writeInt32BE)),
5806 (e[211] = m(211, 8, k)),
5807 (e[217] = m(217, 1, l.prototype.writeUInt8)),
5808 (e[218] = m(218, 2, l.prototype.writeUInt16BE)),
5809 (e[219] = m(219, 4, l.prototype.writeUInt32BE)),
5810 (e[220] = m(220, 2, l.prototype.writeUInt16BE)),
5811 (e[221] = m(221, 4, l.prototype.writeUInt32BE)),
5812 (e[222] = m(222, 2, l.prototype.writeUInt16BE)),
5813 (e[223] = m(223, 4, l.prototype.writeUInt32BE)),
5814 e
5815 );
5816 })()
5817 : f();
5818 };
5819 },
5820 function(e, t, n) {
5821 t.setExtUnpackers = function(e) {
5822 e.addExtUnpacker(14, [o, l(Error)]),
5823 e.addExtUnpacker(1, [o, l(EvalError)]),
5824 e.addExtUnpacker(2, [o, l(RangeError)]),
5825 e.addExtUnpacker(3, [o, l(ReferenceError)]),
5826 e.addExtUnpacker(4, [o, l(SyntaxError)]),
5827 e.addExtUnpacker(5, [o, l(TypeError)]),
5828 e.addExtUnpacker(6, [o, l(URIError)]),
5829 e.addExtUnpacker(10, [o, c]),
5830 e.addExtUnpacker(11, [o, h(Boolean)]),
5831 e.addExtUnpacker(12, [o, h(String)]),
5832 e.addExtUnpacker(13, [o, h(Date)]),
5833 e.addExtUnpacker(15, [o, h(Number)]),
5834 "undefined" != typeof Uint8Array &&
5835 (e.addExtUnpacker(17, h(Int8Array)),
5836 e.addExtUnpacker(18, h(Uint8Array)),
5837 e.addExtUnpacker(19, [u, h(Int16Array)]),
5838 e.addExtUnpacker(20, [u, h(Uint16Array)]),
5839 e.addExtUnpacker(21, [u, h(Int32Array)]),
5840 e.addExtUnpacker(22, [u, h(Uint32Array)]),
5841 e.addExtUnpacker(23, [u, h(Float32Array)]),
5842 "undefined" != typeof Float64Array &&
5843 e.addExtUnpacker(24, [u, h(Float64Array)]),
5844 "undefined" != typeof Uint8ClampedArray &&
5845 e.addExtUnpacker(25, h(Uint8ClampedArray)),
5846 e.addExtUnpacker(26, u),
5847 e.addExtUnpacker(29, [u, h(DataView)])),
5848 r.hasBuffer && e.addExtUnpacker(27, h(s));
5849 };
5850 var i,
5851 r = n(0),
5852 s = r.global,
5853 a = {
5854 name: 1,
5855 message: 1,
5856 stack: 1,
5857 columnNumber: 1,
5858 fileName: 1,
5859 lineNumber: 1
5860 };
5861
5862 function o(e) {
5863 return i || (i = n(15).decode), i(e);
5864 }
5865
5866 function c(e) {
5867 return RegExp.apply(null, e);
5868 }
5869
5870 function l(e) {
5871 return function(t) {
5872 var n = new e();
5873 for (var i in a) n[i] = t[i];
5874 return n;
5875 };
5876 }
5877
5878 function h(e) {
5879 return function(t) {
5880 return new e(t);
5881 };
5882 }
5883
5884 function u(e) {
5885 return new Uint8Array(e).buffer;
5886 }
5887 },
5888 function(e, t, n) {
5889 var i = n(17);
5890
5891 function r(e) {
5892 var t,
5893 n = new Array(256);
5894 for (t = 0; t <= 127; t++) n[t] = s(t);
5895 for (t = 128; t <= 143; t++) n[t] = o(t - 128, e.map);
5896 for (t = 144; t <= 159; t++) n[t] = o(t - 144, e.array);
5897 for (t = 160; t <= 191; t++) n[t] = o(t - 160, e.str);
5898 for (
5899 n[192] = s(null),
5900 n[193] = null,
5901 n[194] = s(!1),
5902 n[195] = s(!0),
5903 n[196] = a(e.uint8, e.bin),
5904 n[197] = a(e.uint16, e.bin),
5905 n[198] = a(e.uint32, e.bin),
5906 n[199] = a(e.uint8, e.ext),
5907 n[200] = a(e.uint16, e.ext),
5908 n[201] = a(e.uint32, e.ext),
5909 n[202] = e.float32,
5910 n[203] = e.float64,
5911 n[204] = e.uint8,
5912 n[205] = e.uint16,
5913 n[206] = e.uint32,
5914 n[207] = e.uint64,
5915 n[208] = e.int8,
5916 n[209] = e.int16,
5917 n[210] = e.int32,
5918 n[211] = e.int64,
5919 n[212] = o(1, e.ext),
5920 n[213] = o(2, e.ext),
5921 n[214] = o(4, e.ext),
5922 n[215] = o(8, e.ext),
5923 n[216] = o(16, e.ext),
5924 n[217] = a(e.uint8, e.str),
5925 n[218] = a(e.uint16, e.str),
5926 n[219] = a(e.uint32, e.str),
5927 n[220] = a(e.uint16, e.array),
5928 n[221] = a(e.uint32, e.array),
5929 n[222] = a(e.uint16, e.map),
5930 n[223] = a(e.uint32, e.map),
5931 t = 224;
5932 t <= 255;
5933 t++
5934 )
5935 n[t] = s(t - 256);
5936 return n;
5937 }
5938
5939 function s(e) {
5940 return function() {
5941 return e;
5942 };
5943 }
5944
5945 function a(e, t) {
5946 return function(n) {
5947 var i = e(n);
5948 return t(n, i);
5949 };
5950 }
5951
5952 function o(e, t) {
5953 return function(n) {
5954 return t(n, e);
5955 };
5956 }
5957 t.getReadToken = function(e) {
5958 var t = i.getReadFormat(e);
5959 return e && e.useraw
5960 ? (function(e) {
5961 var t,
5962 n = r(e).slice();
5963 for (
5964 n[217] = n[196], n[218] = n[197], n[219] = n[198], t = 160;
5965 t <= 191;
5966 t++
5967 )
5968 n[t] = o(t - 160, e.bin);
5969 return n;
5970 })(t)
5971 : r(t);
5972 };
5973 },
5974 function(e, t, n) {
5975 t.Encoder = s;
5976 var i = n(18),
5977 r = n(10).EncodeBuffer;
5978
5979 function s(e) {
5980 if (!(this instanceof s)) return new s(e);
5981 r.call(this, e);
5982 }
5983 (s.prototype = new r()),
5984 i.mixin(s.prototype),
5985 (s.prototype.encode = function(e) {
5986 this.write(e), this.emit("data", this.read());
5987 }),
5988 (s.prototype.end = function(e) {
5989 arguments.length && this.encode(e), this.flush(), this.emit("end");
5990 });
5991 },
5992 function(e, t, n) {
5993 t.Decoder = s;
5994 var i = n(18),
5995 r = n(16).DecodeBuffer;
5996
5997 function s(e) {
5998 if (!(this instanceof s)) return new s(e);
5999 r.call(this, e);
6000 }
6001 (s.prototype = new r()),
6002 i.mixin(s.prototype),
6003 (s.prototype.decode = function(e) {
6004 arguments.length && this.write(e), this.flush();
6005 }),
6006 (s.prototype.push = function(e) {
6007 this.emit("data", e);
6008 }),
6009 (s.prototype.end = function(e) {
6010 this.decode(e), this.emit("end");
6011 });
6012 },
6013 function(e, t, n) {
6014 n(8), n(2), (t.createCodec = n(1).createCodec);
6015 },
6016 function(e, t, n) {
6017 n(8),
6018 n(2),
6019 (t.codec = {
6020 preset: n(1).preset
6021 });
6022 },
6023 function(e, t) {
6024 var n,
6025 i,
6026 r = (e.exports = {});
6027
6028 function s() {
6029 throw new Error("setTimeout has not been defined");
6030 }
6031
6032 function a() {
6033 throw new Error("clearTimeout has not been defined");
6034 }
6035
6036 function o(e) {
6037 if (n === setTimeout) return setTimeout(e, 0);
6038 if ((n === s || !n) && setTimeout)
6039 return (n = setTimeout), setTimeout(e, 0);
6040 try {
6041 return n(e, 0);
6042 } catch (t) {
6043 try {
6044 return n.call(null, e, 0);
6045 } catch (t) {
6046 return n.call(this, e, 0);
6047 }
6048 }
6049 }
6050 !(function() {
6051 try {
6052 n = "function" == typeof setTimeout ? setTimeout : s;
6053 } catch (e) {
6054 n = s;
6055 }
6056 try {
6057 i = "function" == typeof clearTimeout ? clearTimeout : a;
6058 } catch (e) {
6059 i = a;
6060 }
6061 })();
6062 var c,
6063 l = [],
6064 h = !1,
6065 u = -1;
6066
6067 function f() {
6068 h &&
6069 c &&
6070 ((h = !1), c.length ? (l = c.concat(l)) : (u = -1), l.length && d());
6071 }
6072
6073 function d() {
6074 if (!h) {
6075 var e = o(f);
6076 h = !0;
6077 for (var t = l.length; t; ) {
6078 for (c = l, l = []; ++u < t; ) c && c[u].run();
6079 (u = -1), (t = l.length);
6080 }
6081 (c = null),
6082 (h = !1),
6083 (function(e) {
6084 if (i === clearTimeout) return clearTimeout(e);
6085 if ((i === a || !i) && clearTimeout)
6086 return (i = clearTimeout), clearTimeout(e);
6087 try {
6088 i(e);
6089 } catch (t) {
6090 try {
6091 return i.call(null, e);
6092 } catch (t) {
6093 return i.call(this, e);
6094 }
6095 }
6096 })(e);
6097 }
6098 }
6099
6100 function p(e, t) {
6101 (this.fun = e), (this.array = t);
6102 }
6103
6104 function g() {}
6105 (r.nextTick = function(e) {
6106 var t = new Array(arguments.length - 1);
6107 if (arguments.length > 1)
6108 for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
6109 l.push(new p(e, t)), 1 !== l.length || h || o(d);
6110 }),
6111 (p.prototype.run = function() {
6112 this.fun.apply(null, this.array);
6113 }),
6114 (r.title = "browser"),
6115 (r.browser = !0),
6116 (r.env = {}),
6117 (r.argv = []),
6118 (r.version = ""),
6119 (r.versions = {}),
6120 (r.on = g),
6121 (r.addListener = g),
6122 (r.once = g),
6123 (r.off = g),
6124 (r.removeListener = g),
6125 (r.removeAllListeners = g),
6126 (r.emit = g),
6127 (r.prependListener = g),
6128 (r.prependOnceListener = g),
6129 (r.listeners = function(e) {
6130 return [];
6131 }),
6132 (r.binding = function(e) {
6133 throw new Error("process.binding is not supported");
6134 }),
6135 (r.cwd = function() {
6136 return "/";
6137 }),
6138 (r.chdir = function(e) {
6139 throw new Error("process.chdir is not supported");
6140 }),
6141 (r.umask = function() {
6142 return 0;
6143 });
6144 },
6145 function(e, t) {
6146 var n = Math.abs,
6147 i = (Math.cos, Math.sin, Math.pow, Math.sqrt),
6148 r = ((n = Math.abs), Math.atan2),
6149 s = Math.PI;
6150 (e.exports.randInt = function(e, t) {
6151 return Math.floor(Math.random() * (t - e + 1)) + e;
6152 }),
6153 (e.exports.randFloat = function(e, t) {
6154 return Math.random() * (t - e + 1) + e;
6155 }),
6156 (e.exports.lerp = function(e, t, n) {
6157 return e + (t - e) * n;
6158 }),
6159 (e.exports.decel = function(e, t) {
6160 return (
6161 e > 0 ? (e = Math.max(0, e - t)) : e < 0 && (e = Math.min(0, e + t)),
6162 e
6163 );
6164 }),
6165 (e.exports.getDistance = function(e, t, n, r) {
6166 return i((n -= e) * n + (r -= t) * r);
6167 }),
6168 (e.exports.getDirection = function(e, t, n, i) {
6169 return r(t - i, e - n);
6170 }),
6171 (e.exports.getAngleDist = function(e, t) {
6172 var i = n(t - e) % (2 * s);
6173 return i > s ? 2 * s - i : i;
6174 }),
6175 (e.exports.isNumber = function(e) {
6176 return "number" == typeof e && !isNaN(e) && isFinite(e);
6177 }),
6178 (e.exports.isString = function(e) {
6179 return e && "string" == typeof e;
6180 }),
6181 (e.exports.kFormat = function(e) {
6182 return e > 999 ? (e / 1e3).toFixed(1) + "k" : e;
6183 }),
6184 (e.exports.capitalizeFirst = function(e) {
6185 return e.charAt(0).toUpperCase() + e.slice(1);
6186 }),
6187 (e.exports.fixTo = function(e, t) {
6188 return parseFloat(e.toFixed(t));
6189 }),
6190 (e.exports.sortByPoints = function(e, t) {
6191 return parseFloat(t.points) - parseFloat(e.points);
6192 }),
6193 (e.exports.lineInRect = function(e, t, n, i, r, s, a, o) {
6194 var c = r,
6195 l = a;
6196 if (
6197 (r > a && ((c = a), (l = r)),
6198 l > n && (l = n),
6199 c < e && (c = e),
6200 c > l)
6201 )
6202 return !1;
6203 var h = s,
6204 u = o,
6205 f = a - r;
6206 if (Math.abs(f) > 1e-7) {
6207 var d = (o - s) / f,
6208 p = s - d * r;
6209 (h = d * c + p), (u = d * l + p);
6210 }
6211 if (h > u) {
6212 var g = u;
6213 (u = h), (h = g);
6214 }
6215 return u > i && (u = i), h < t && (h = t), !(h > u);
6216 }),
6217 (e.exports.containsPoint = function(e, t, n) {
6218 var i = e.getBoundingClientRect(),
6219 r = i.left + window.scrollX,
6220 s = i.top + window.scrollY,
6221 a = i.width,
6222 o = i.height;
6223 return t > r && t < r + a && n > s && n < s + o;
6224 }),
6225 (e.exports.mousifyTouchEvent = function(e) {
6226 var t = e.changedTouches[0];
6227 (e.screenX = t.screenX),
6228 (e.screenY = t.screenY),
6229 (e.clientX = t.clientX),
6230 (e.clientY = t.clientY),
6231 (e.pageX = t.pageX),
6232 (e.pageY = t.pageY);
6233 }),
6234 (e.exports.hookTouchEvents = function(t, n) {
6235 var i = !n,
6236 r = !1;
6237
6238 function s(n) {
6239 e.exports.mousifyTouchEvent(n),
6240 window.setUsingTouch(!0),
6241 i && (n.preventDefault(), n.stopPropagation()),
6242 r &&
6243 (t.onclick && t.onclick(n),
6244 t.onmouseout && t.onmouseout(n),
6245 (r = !1));
6246 }
6247 t.addEventListener(
6248 "touchstart",
6249 e.exports.checkTrusted(function(n) {
6250 e.exports.mousifyTouchEvent(n),
6251 window.setUsingTouch(!0),
6252 i && (n.preventDefault(), n.stopPropagation()),
6253 t.onmouseover && t.onmouseover(n),
6254 (r = !0);
6255 }),
6256 !1
6257 ),
6258 t.addEventListener(
6259 "touchmove",
6260 e.exports.checkTrusted(function(n) {
6261 e.exports.mousifyTouchEvent(n),
6262 window.setUsingTouch(!0),
6263 i && (n.preventDefault(), n.stopPropagation()),
6264 e.exports.containsPoint(t, n.pageX, n.pageY)
6265 ? r || (t.onmouseover && t.onmouseover(n), (r = !0))
6266 : r && (t.onmouseout && t.onmouseout(n), (r = !1));
6267 }),
6268 !1
6269 ),
6270 t.addEventListener("touchend", e.exports.checkTrusted(s), !1),
6271 t.addEventListener("touchcancel", e.exports.checkTrusted(s), !1),
6272 t.addEventListener("touchleave", e.exports.checkTrusted(s), !1);
6273 }),
6274 (e.exports.removeAllChildren = function(e) {
6275 for (; e.hasChildNodes(); ) e.removeChild(e.lastChild);
6276 }),
6277 (e.exports.generateElement = function(t) {
6278 var n = document.createElement(t.tag || "div");
6279
6280 function i(e, i) {
6281 t[e] && (n[i] = t[e]);
6282 }
6283 for (var r in (i("text", "textContent"),
6284 i("html", "innerHTML"),
6285 i("class", "className"),
6286 t)) {
6287 switch (r) {
6288 case "tag":
6289 case "text":
6290 case "html":
6291 case "class":
6292 case "style":
6293 case "hookTouch":
6294 case "parent":
6295 case "children":
6296 continue;
6297 }
6298 n[r] = t[r];
6299 }
6300 if (
6301 (n.onclick && (n.onclick = e.exports.checkTrusted(n.onclick)),
6302 n.onmouseover &&
6303 (n.onmouseover = e.exports.checkTrusted(n.onmouseover)),
6304 n.onmouseout && (n.onmouseout = e.exports.checkTrusted(n.onmouseout)),
6305 t.style && (n.style.cssText = t.style),
6306 t.hookTouch && e.exports.hookTouchEvents(n),
6307 t.parent && t.parent.appendChild(n),
6308 t.children)
6309 )
6310 for (var s = 0; s < t.children.length; s++)
6311 n.appendChild(t.children[s]);
6312 return n;
6313 }),
6314 (e.exports.eventIsTrusted = function(e) {
6315 return !e || "boolean" != typeof e.isTrusted || e.isTrusted;
6316 }),
6317 (e.exports.checkTrusted = function(t) {
6318 return function(n) {
6319 n && n instanceof Event && e.exports.eventIsTrusted(n) && t(n);
6320 };
6321 }),
6322 (e.exports.randomString = function(e) {
6323 for (
6324 var t = "",
6325 n =
6326 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
6327 i = 0;
6328 i < e;
6329 i++
6330 )
6331 t += n.charAt(Math.floor(Math.random() * n.length));
6332 return t;
6333 }),
6334 (e.exports.countInArray = function(e, t) {
6335 for (var n = 0, i = 0; i < e.length; i++) e[i] === t && n++;
6336 return n;
6337 });
6338 },
6339 function(e, t) {
6340 (e.exports.AnimText = function() {
6341 (this.init = function(e, t, n, i, r, s, a) {
6342 (this.x = e),
6343 (this.y = t),
6344 (this.color = a),
6345 (this.scale = n),
6346 (this.startScale = this.scale),
6347 (this.maxScale = 1.5 * n),
6348 (this.scaleSpeed = 0.7),
6349 (this.speed = i),
6350 (this.life = r),
6351 (this.text = s);
6352 }),
6353 (this.update = function(e) {
6354 this.life &&
6355 ((this.life -= e),
6356 (this.y -= this.speed * e),
6357 (this.scale += this.scaleSpeed * e),
6358 this.scale >= this.maxScale
6359 ? ((this.scale = this.maxScale), (this.scaleSpeed *= -1))
6360 : this.scale <= this.startScale &&
6361 ((this.scale = this.startScale), (this.scaleSpeed = 0)),
6362 this.life <= 0 && (this.life = 0));
6363 }),
6364 (this.render = function(e, t, n) {
6365 (e.fillStyle = this.color),
6366 (e.font = this.scale + "px Hammersmith One"),
6367 e.fillText(this.text, this.x - t, this.y - n);
6368 });
6369 }),
6370 (e.exports.TextManager = function() {
6371 (this.texts = []),
6372 (this.update = function(e, t, n, i) {
6373 (t.textBaseline = "middle"), (t.textAlign = "center");
6374 for (var r = 0; r < this.texts.length; ++r)
6375 this.texts[r].life &&
6376 (this.texts[r].update(e), this.texts[r].render(t, n, i));
6377 }),
6378 (this.showText = function(t, n, i, r, s, a, o) {
6379 for (var c, l = 0; l < this.texts.length; ++l)
6380 if (!this.texts[l].life) {
6381 c = this.texts[l];
6382 break;
6383 }
6384 c || ((c = new e.exports.AnimText()), this.texts.push(c)),
6385 c.init(t, n, i, r, s, a, o);
6386 });
6387 });
6388 },
6389 function(e, t) {
6390 e.exports = function(e) {
6391 (this.sid = e),
6392 (this.init = function(e, t, n, i, r, s, a) {
6393 (s = s || {}),
6394 (this.sentTo = {}),
6395 (this.gridLocations = []),
6396 (this.active = !0),
6397 (this.doUpdate = s.doUpdate),
6398 (this.x = e),
6399 (this.y = t),
6400 (this.dir = n),
6401 (this.xWiggle = 0),
6402 (this.yWiggle = 0),
6403 (this.scale = i),
6404 (this.type = r),
6405 (this.id = s.id),
6406 (this.owner = a),
6407 (this.name = s.name),
6408 (this.isItem = null != this.id),
6409 (this.group = s.group),
6410 (this.health = s.health),
6411 (this.layer = 2),
6412 null != this.group
6413 ? (this.layer = this.group.layer)
6414 : 0 == this.type
6415 ? (this.layer = 3)
6416 : 2 == this.type
6417 ? (this.layer = 0)
6418 : 4 == this.type && (this.layer = -1),
6419 (this.colDiv = s.colDiv || 1),
6420 (this.blocker = s.blocker),
6421 (this.ignoreCollision = s.ignoreCollision),
6422 (this.dontGather = s.dontGather),
6423 (this.hideFromEnemy = s.hideFromEnemy),
6424 (this.friction = s.friction),
6425 (this.projDmg = s.projDmg),
6426 (this.dmg = s.dmg),
6427 (this.pDmg = s.pDmg),
6428 (this.pps = s.pps),
6429 (this.zIndex = s.zIndex || 0),
6430 (this.turnSpeed = s.turnSpeed),
6431 (this.req = s.req),
6432 (this.trap = s.trap),
6433 (this.healCol = s.healCol),
6434 (this.teleport = s.teleport),
6435 (this.boostSpeed = s.boostSpeed),
6436 (this.projectile = s.projectile),
6437 (this.shootRange = s.shootRange),
6438 (this.shootRate = s.shootRate),
6439 (this.shootCount = this.shootRate),
6440 (this.spawnPoint = s.spawnPoint);
6441 }),
6442 (this.changeHealth = function(e, t) {
6443 return (this.health += e), this.health <= 0;
6444 }),
6445 (this.getScale = function(e, t) {
6446 return (
6447 (e = e || 1),
6448 this.scale *
6449 (this.isItem || 2 == this.type || 3 == this.type || 4 == this.type
6450 ? 1
6451 : 0.6 * e) *
6452 (t ? 1 : this.colDiv)
6453 );
6454 }),
6455 (this.visibleToPlayer = function(e) {
6456 return (
6457 !this.hideFromEnemy ||
6458 (this.owner &&
6459 (this.owner == e ||
6460 (this.owner.team && e.team == this.owner.team)))
6461 );
6462 }),
6463 (this.update = function(e) {
6464 this.active &&
6465 (this.xWiggle && (this.xWiggle *= Math.pow(0.99, e)),
6466 this.yWiggle && (this.yWiggle *= Math.pow(0.99, e)),
6467 this.turnSpeed && (this.dir += this.turnSpeed * e));
6468 });
6469 };
6470 },
6471 function(e, t) {
6472 (e.exports.groups = [
6473 {
6474 id: 0,
6475 name: "food",
6476 layer: 0
6477 },
6478 {
6479 id: 1,
6480 name: "walls",
6481 place: !0,
6482 limit: 30,
6483 layer: 0
6484 },
6485 {
6486 id: 2,
6487 name: "spikes",
6488 place: !0,
6489 limit: 15,
6490 layer: 0
6491 },
6492 {
6493 id: 3,
6494 name: "mill",
6495 place: !0,
6496 limit: 7,
6497 layer: 1
6498 },
6499 {
6500 id: 4,
6501 name: "mine",
6502 place: !0,
6503 limit: 1,
6504 layer: 0
6505 },
6506 {
6507 id: 5,
6508 name: "trap",
6509 place: !0,
6510 limit: 6,
6511 layer: -1
6512 },
6513 {
6514 id: 6,
6515 name: "booster",
6516 place: !0,
6517 limit: 12,
6518 layer: -1
6519 },
6520 {
6521 id: 7,
6522 name: "turret",
6523 place: !0,
6524 limit: 2,
6525 layer: 1
6526 },
6527 {
6528 id: 8,
6529 name: "watchtower",
6530 place: !0,
6531 limit: 12,
6532 layer: 1
6533 },
6534 {
6535 id: 9,
6536 name: "buff",
6537 place: !0,
6538 limit: 4,
6539 layer: -1
6540 },
6541 {
6542 id: 10,
6543 name: "spawn",
6544 place: !0,
6545 limit: 1,
6546 layer: -1
6547 },
6548 {
6549 id: 11,
6550 name: "sapling",
6551 place: !0,
6552 limit: 2,
6553 layer: 0
6554 },
6555 {
6556 id: 12,
6557 name: "blocker",
6558 place: !0,
6559 limit: 3,
6560 layer: -1
6561 },
6562 {
6563 id: 13,
6564 name: "teleporter",
6565 place: !0,
6566 limit: 2,
6567 layer: -1
6568 }
6569 ]),
6570 (t.projectiles = [
6571 {
6572 indx: 0,
6573 layer: 0,
6574 src: "arrow_1",
6575 dmg: 25,
6576 speed: 1.6,
6577 scale: 103,
6578 range: 1e3
6579 },
6580 {
6581 indx: 1,
6582 layer: 1,
6583 dmg: 25,
6584 scale: 20
6585 },
6586 {
6587 indx: 0,
6588 layer: 0,
6589 src: "arrow_1",
6590 dmg: 35,
6591 speed: 2.5,
6592 scale: 103,
6593 range: 1200
6594 },
6595 {
6596 indx: 0,
6597 layer: 0,
6598 src: "arrow_1",
6599 dmg: 30,
6600 speed: 2,
6601 scale: 103,
6602 range: 1200
6603 },
6604 {
6605 indx: 1,
6606 layer: 1,
6607 dmg: 16,
6608 scale: 20
6609 },
6610 {
6611 indx: 0,
6612 layer: 0,
6613 src: "bullet_1",
6614 dmg: 50,
6615 speed: 3.6,
6616 scale: 160,
6617 range: 1400
6618 }
6619 ]),
6620 (t.weapons = [
6621 {
6622 id: 0,
6623 type: 0,
6624 name: "tool hammer",
6625 desc: "tool for gathering all resources",
6626 src: "hammer_1",
6627 length: 140,
6628 width: 140,
6629 xOff: -3,
6630 yOff: 18,
6631 dmg: 25,
6632 range: 65,
6633 gather: 1,
6634 speed: 300
6635 },
6636 {
6637 id: 1,
6638 type: 0,
6639 age: 2,
6640 name: "hand axe",
6641 desc: "gathers resources at a higher rate",
6642 src: "axe_1",
6643 length: 140,
6644 width: 140,
6645 xOff: 3,
6646 yOff: 24,
6647 dmg: 30,
6648 spdMult: 1,
6649 range: 70,
6650 gather: 2,
6651 speed: 400
6652 },
6653 {
6654 id: 2,
6655 type: 0,
6656 age: 8,
6657 name: "great axe",
6658 desc: "deal more damage and gather more resources",
6659 src: "great_axe_1",
6660 length: 140,
6661 width: 140,
6662 xOff: -8,
6663 yOff: 25,
6664 dmg: 35,
6665 spdMult: 1,
6666 range: 75,
6667 gather: 4,
6668 speed: 400
6669 },
6670 {
6671 id: 3,
6672 type: 0,
6673 age: 2,
6674 name: "short sword",
6675 desc: "increased attack power but slower move speed",
6676 src: "sword_1",
6677 iPad: 1.3,
6678 length: 130,
6679 width: 210,
6680 xOff: -8,
6681 yOff: 46,
6682 dmg: 35,
6683 spdMult: 0.85,
6684 range: 110,
6685 gather: 1,
6686 speed: 300
6687 },
6688 {
6689 id: 4,
6690 type: 0,
6691 age: 8,
6692 name: "katana",
6693 desc: "greater range and damage",
6694 src: "samurai_1",
6695 iPad: 1.3,
6696 length: 130,
6697 width: 210,
6698 xOff: -8,
6699 yOff: 59,
6700 dmg: 40,
6701 spdMult: 0.8,
6702 range: 118,
6703 gather: 1,
6704 speed: 300
6705 },
6706 {
6707 id: 5,
6708 type: 0,
6709 age: 2,
6710 name: "polearm",
6711 desc: "long range melee weapon",
6712 src: "spear_1",
6713 iPad: 1.3,
6714 length: 130,
6715 width: 210,
6716 xOff: -8,
6717 yOff: 53,
6718 dmg: 45,
6719 knock: 0.2,
6720 spdMult: 0.82,
6721 range: 142,
6722 gather: 1,
6723 speed: 700
6724 },
6725 {
6726 id: 6,
6727 type: 0,
6728 age: 2,
6729 name: "bat",
6730 desc: "fast long range melee weapon",
6731 src: "bat_1",
6732 iPad: 1.3,
6733 length: 110,
6734 width: 180,
6735 xOff: -8,
6736 yOff: 53,
6737 dmg: 20,
6738 knock: 0.7,
6739 range: 110,
6740 gather: 1,
6741 speed: 300
6742 },
6743 {
6744 id: 7,
6745 type: 0,
6746 age: 2,
6747 name: "daggers",
6748 desc: "really fast short range weapon",
6749 src: "dagger_1",
6750 iPad: 0.8,
6751 length: 110,
6752 width: 110,
6753 xOff: 18,
6754 yOff: 0,
6755 dmg: 20,
6756 knock: 0.1,
6757 range: 65,
6758 gather: 1,
6759 hitSlow: 0.1,
6760 spdMult: 1.13,
6761 speed: 100
6762 },
6763 {
6764 id: 8,
6765 type: 0,
6766 age: 2,
6767 name: "stick",
6768 desc: "great for gathering but very weak",
6769 src: "stick_1",
6770 length: 140,
6771 width: 140,
6772 xOff: 3,
6773 yOff: 24,
6774 dmg: 1,
6775 spdMult: 1,
6776 range: 70,
6777 gather: 7,
6778 speed: 400
6779 },
6780 {
6781 id: 9,
6782 type: 1,
6783 age: 6,
6784 name: "hunting bow",
6785 desc: "bow used for ranged combat and hunting",
6786 src: "bow_1",
6787 req: ["wood", 4],
6788 length: 120,
6789 width: 120,
6790 xOff: -6,
6791 yOff: 0,
6792 projectile: 0,
6793 spdMult: 0.75,
6794 speed: 600
6795 },
6796 {
6797 id: 10,
6798 type: 1,
6799 age: 6,
6800 name: "great hammer",
6801 desc: "hammer used for destroying structures",
6802 src: "great_hammer_1",
6803 length: 140,
6804 width: 140,
6805 xOff: -9,
6806 yOff: 25,
6807 dmg: 10,
6808 spdMult: 0.88,
6809 range: 75,
6810 sDmg: 7.5,
6811 gather: 1,
6812 speed: 400
6813 },
6814 {
6815 id: 11,
6816 type: 1,
6817 age: 6,
6818 name: "wooden shield",
6819 desc: "blocks projectiles and reduces melee damage",
6820 src: "shield_1",
6821 length: 120,
6822 width: 120,
6823 shield: 0.2,
6824 xOff: 6,
6825 yOff: 0,
6826 spdMult: 0.7
6827 },
6828 {
6829 id: 12,
6830 type: 1,
6831 age: 8,
6832 name: "crossbow",
6833 desc: "deals more damage and has greater range",
6834 src: "crossbow_1",
6835 req: ["wood", 5],
6836 aboveHand: !0,
6837 armS: 0.75,
6838 length: 120,
6839 width: 120,
6840 xOff: -4,
6841 yOff: 0,
6842 projectile: 2,
6843 spdMult: 0.7,
6844 speed: 700
6845 },
6846 {
6847 id: 13,
6848 type: 1,
6849 age: 9,
6850 name: "repeater crossbow",
6851 desc: "high firerate crossbow with reduced damage",
6852 src: "crossbow_2",
6853 req: ["wood", 10],
6854 aboveHand: !0,
6855 armS: 0.75,
6856 length: 120,
6857 width: 120,
6858 xOff: -4,
6859 yOff: 0,
6860 projectile: 3,
6861 spdMult: 0.7,
6862 speed: 230
6863 },
6864 {
6865 id: 14,
6866 type: 1,
6867 age: 6,
6868 name: "mc grabby",
6869 desc: "steals resources from enemies",
6870 src: "grab_1",
6871 length: 130,
6872 width: 210,
6873 xOff: -8,
6874 yOff: 53,
6875 dmg: 0,
6876 steal: 250,
6877 knock: 0.2,
6878 spdMult: 1.05,
6879 range: 125,
6880 gather: 0,
6881 speed: 700
6882 },
6883 {
6884 id: 15,
6885 type: 1,
6886 age: 9,
6887 name: "musket",
6888 desc: "slow firerate but high damage and range",
6889 src: "musket_1",
6890 req: ["stone", 10],
6891 aboveHand: !0,
6892 rec: 0.35,
6893 armS: 0.6,
6894 hndS: 0.3,
6895 hndD: 1.6,
6896 length: 205,
6897 width: 205,
6898 xOff: 25,
6899 yOff: 0,
6900 projectile: 5,
6901 hideProjectile: !0,
6902 spdMult: 0.6,
6903 speed: 1500
6904 }
6905 ]),
6906 (e.exports.list = [
6907 {
6908 group: e.exports.groups[0],
6909 name: "apple",
6910 desc: "restores 20 health when consumed",
6911 req: ["food", 10],
6912 consume: function(e) {
6913 return e.changeHealth(20, e);
6914 },
6915 scale: 22,
6916 holdOffset: 15
6917 },
6918 {
6919 age: 3,
6920 group: e.exports.groups[0],
6921 name: "cookie",
6922 desc: "restores 40 health when consumed",
6923 req: ["food", 15],
6924 consume: function(e) {
6925 return e.changeHealth(40, e);
6926 },
6927 scale: 27,
6928 holdOffset: 15
6929 },
6930 {
6931 age: 7,
6932 group: e.exports.groups[0],
6933 name: "cheese",
6934 desc: "restores 30 health and another 50 over 5 seconds",
6935 req: ["food", 25],
6936 consume: function(e) {
6937 return (
6938 !!(e.changeHealth(30, e) || e.health < 100) &&
6939 ((e.dmgOverTime.dmg = -10),
6940 (e.dmgOverTime.doer = e),
6941 (e.dmgOverTime.time = 5),
6942 !0)
6943 );
6944 },
6945 scale: 27,
6946 holdOffset: 15
6947 },
6948 {
6949 group: e.exports.groups[1],
6950 name: "wood wall",
6951 desc: "provides protection for your village",
6952 req: ["wood", 10],
6953 projDmg: !0,
6954 health: 380,
6955 scale: 50,
6956 holdOffset: 20,
6957 placeOffset: -5
6958 },
6959 {
6960 age: 3,
6961 group: e.exports.groups[1],
6962 name: "stone wall",
6963 desc: "provides improved protection for your village",
6964 req: ["stone", 25],
6965 health: 900,
6966 scale: 50,
6967 holdOffset: 20,
6968 placeOffset: -5
6969 },
6970 {
6971 age: 7,
6972 group: e.exports.groups[1],
6973 name: "castle wall",
6974 desc: "provides powerful protection for your village",
6975 req: ["stone", 35],
6976 health: 1500,
6977 scale: 52,
6978 holdOffset: 20,
6979 placeOffset: -5
6980 },
6981 {
6982 group: e.exports.groups[2],
6983 name: "spikes",
6984 desc: "damages enemies when they touch them",
6985 req: ["wood", 20, "stone", 5],
6986 health: 400,
6987 dmg: 20,
6988 scale: 49,
6989 spritePadding: -23,
6990 holdOffset: 8,
6991 placeOffset: -5
6992 },
6993 {
6994 age: 5,
6995 group: e.exports.groups[2],
6996 name: "greater spikes",
6997 desc: "damages enemies when they touch them",
6998 req: ["wood", 30, "stone", 10],
6999 health: 500,
7000 dmg: 35,
7001 scale: 52,
7002 spritePadding: -23,
7003 holdOffset: 8,
7004 placeOffset: -5
7005 },
7006 {
7007 age: 9,
7008 group: e.exports.groups[2],
7009 name: "poison spikes",
7010 desc: "poisons enemies when they touch them",
7011 req: ["wood", 35, "stone", 15],
7012 health: 600,
7013 dmg: 30,
7014 pDmg: 5,
7015 scale: 52,
7016 spritePadding: -23,
7017 holdOffset: 8,
7018 placeOffset: -5
7019 },
7020 {
7021 age: 9,
7022 group: e.exports.groups[2],
7023 name: "spinning spikes",
7024 desc: "damages enemies when they touch them",
7025 req: ["wood", 30, "stone", 20],
7026 health: 500,
7027 dmg: 45,
7028 turnSpeed: 0.003,
7029 scale: 52,
7030 spritePadding: -23,
7031 holdOffset: 8,
7032 placeOffset: -5
7033 },
7034 {
7035 group: e.exports.groups[3],
7036 name: "windmill",
7037 desc: "generates gold over time",
7038 req: ["wood", 50, "stone", 10],
7039 health: 400,
7040 pps: 1,
7041 turnSpeed: 0.0016,
7042 spritePadding: 25,
7043 iconLineMult: 12,
7044 scale: 45,
7045 holdOffset: 20,
7046 placeOffset: 5
7047 },
7048 {
7049 age: 5,
7050 group: e.exports.groups[3],
7051 name: "faster windmill",
7052 desc: "generates more gold over time",
7053 req: ["wood", 60, "stone", 20],
7054 health: 500,
7055 pps: 1.5,
7056 turnSpeed: 0.0025,
7057 spritePadding: 25,
7058 iconLineMult: 12,
7059 scale: 47,
7060 holdOffset: 20,
7061 placeOffset: 5
7062 },
7063 {
7064 age: 8,
7065 group: e.exports.groups[3],
7066 name: "power mill",
7067 desc: "generates more gold over time",
7068 req: ["wood", 100, "stone", 50],
7069 health: 800,
7070 pps: 2,
7071 turnSpeed: 0.005,
7072 spritePadding: 25,
7073 iconLineMult: 12,
7074 scale: 47,
7075 holdOffset: 20,
7076 placeOffset: 5
7077 },
7078 {
7079 age: 5,
7080 group: e.exports.groups[4],
7081 type: 2,
7082 name: "mine",
7083 desc: "allows you to mine stone",
7084 req: ["wood", 20, "stone", 100],
7085 iconLineMult: 12,
7086 scale: 65,
7087 holdOffset: 20,
7088 placeOffset: 0
7089 },
7090 {
7091 age: 5,
7092 group: e.exports.groups[11],
7093 type: 0,
7094 name: "sapling",
7095 desc: "allows you to farm wood",
7096 req: ["wood", 150],
7097 iconLineMult: 12,
7098 colDiv: 0.5,
7099 scale: 110,
7100 holdOffset: 50,
7101 placeOffset: -15
7102 },
7103 {
7104 age: 4,
7105 group: e.exports.groups[5],
7106 name: "pit trap",
7107 desc: "pit that traps enemies if they walk over it",
7108 req: ["wood", 10, "stone", 10],
7109 trap: !0,
7110 ignoreCollision: !0,
7111 hideFromEnemy: !0,
7112 health: 500,
7113 colDiv: 0.2,
7114 scale: 50,
7115 holdOffset: 20,
7116 placeOffset: -5
7117 },
7118 {
7119 age: 4,
7120 group: e.exports.groups[6],
7121 name: "boost pad",
7122 desc: "provides boost when stepped on",
7123 req: ["stone", 20, "wood", 5],
7124 ignoreCollision: !0,
7125 boostSpeed: 1.5,
7126 health: 150,
7127 colDiv: 0.7,
7128 scale: 45,
7129 holdOffset: 20,
7130 placeOffset: -5
7131 },
7132 {
7133 age: 7,
7134 group: e.exports.groups[7],
7135 doUpdate: !0,
7136 name: "turret",
7137 desc: "defensive structure that shoots at enemies",
7138 req: ["wood", 200, "stone", 150],
7139 health: 800,
7140 projectile: 1,
7141 shootRange: 700,
7142 shootRate: 2200,
7143 scale: 43,
7144 holdOffset: 20,
7145 placeOffset: -5
7146 },
7147 {
7148 age: 7,
7149 group: e.exports.groups[8],
7150 name: "platform",
7151 desc: "platform to shoot over walls and cross over water",
7152 req: ["wood", 20],
7153 ignoreCollision: !0,
7154 zIndex: 1,
7155 health: 300,
7156 scale: 43,
7157 holdOffset: 20,
7158 placeOffset: -5
7159 },
7160 {
7161 age: 7,
7162 group: e.exports.groups[9],
7163 name: "healing pad",
7164 desc: "standing on it will slowly heal you",
7165 req: ["wood", 30, "food", 10],
7166 ignoreCollision: !0,
7167 healCol: 15,
7168 health: 400,
7169 colDiv: 0.7,
7170 scale: 45,
7171 holdOffset: 20,
7172 placeOffset: -5
7173 },
7174 {
7175 age: 9,
7176 group: e.exports.groups[10],
7177 name: "spawn pad",
7178 desc: "you will spawn here when you die but it will dissapear",
7179 req: ["wood", 100, "stone", 100],
7180 health: 400,
7181 ignoreCollision: !0,
7182 spawnPoint: !0,
7183 scale: 45,
7184 holdOffset: 20,
7185 placeOffset: -5
7186 },
7187 {
7188 age: 7,
7189 group: e.exports.groups[12],
7190 name: "blocker",
7191 desc: "blocks building in radius",
7192 req: ["wood", 30, "stone", 25],
7193 ignoreCollision: !0,
7194 blocker: 300,
7195 health: 400,
7196 colDiv: 0.7,
7197 scale: 45,
7198 holdOffset: 20,
7199 placeOffset: -5
7200 },
7201 {
7202 age: 7,
7203 group: e.exports.groups[13],
7204 name: "teleporter",
7205 desc: "teleports you to a random point on the map",
7206 req: ["wood", 60, "stone", 60],
7207 ignoreCollision: !0,
7208 teleport: !0,
7209 health: 200,
7210 colDiv: 0.7,
7211 scale: 45,
7212 holdOffset: 20,
7213 placeOffset: -5
7214 }
7215 ]);
7216 for (var n = 0; n < e.exports.list.length; ++n)
7217 (e.exports.list[n].id = n),
7218 e.exports.list[n].pre &&
7219 (e.exports.list[n].pre = n - e.exports.list[n].pre);
7220 },
7221 function(e, t) {
7222 e.exports = {};
7223 },
7224 function(e, t) {
7225 var n = Math.floor,
7226 i = Math.abs,
7227 r = Math.cos,
7228 s = Math.sin,
7229 a = (Math.pow, Math.sqrt);
7230 e.exports = function(e, t, o, c, l, h) {
7231 var u, f;
7232 (this.objects = t), (this.grids = {}), (this.updateObjects = []);
7233 var d = c.mapScale / c.colGrid;
7234 (this.setObjectGrids = function(e) {
7235 for (
7236 var t = Math.min(c.mapScale, Math.max(0, e.x)),
7237 n = Math.min(c.mapScale, Math.max(0, e.y)),
7238 i = 0;
7239 i < c.colGrid;
7240 ++i
7241 ) {
7242 u = i * d;
7243 for (var r = 0; r < c.colGrid; ++r)
7244 (f = r * d),
7245 t + e.scale >= u &&
7246 t - e.scale <= u + d &&
7247 n + e.scale >= f &&
7248 n - e.scale <= f + d &&
7249 (this.grids[i + "_" + r] || (this.grids[i + "_" + r] = []),
7250 this.grids[i + "_" + r].push(e),
7251 e.gridLocations.push(i + "_" + r));
7252 }
7253 }),
7254 (this.removeObjGrid = function(e) {
7255 for (var t, n = 0; n < e.gridLocations.length; ++n)
7256 (t = this.grids[e.gridLocations[n]].indexOf(e)) >= 0 &&
7257 this.grids[e.gridLocations[n]].splice(t, 1);
7258 }),
7259 (this.disableObj = function(e) {
7260 if (((e.active = !1), h)) {
7261 e.owner && e.pps && (e.owner.pps -= e.pps), this.removeObjGrid(e);
7262 var t = this.updateObjects.indexOf(e);
7263 t >= 0 && this.updateObjects.splice(t, 1);
7264 }
7265 }),
7266 (this.hitObj = function(e, t) {
7267 for (var n = 0; n < l.length; ++n)
7268 l[n].active &&
7269 (e.sentTo[l[n].id] &&
7270 (e.active
7271 ? l[n].canSee(e) && h.send(l[n].id, "8", o.fixTo(t, 1), e.sid)
7272 : h.send(l[n].id, "12", e.sid)),
7273 e.active ||
7274 e.owner != l[n] ||
7275 l[n].changeItemCount(e.group.id, -1));
7276 });
7277 var p,
7278 g,
7279 m = [];
7280 (this.getGridArrays = function(e, t, i) {
7281 (u = n(e / d)), (f = n(t / d)), (m.length = 0);
7282 try {
7283 this.grids[u + "_" + f] && m.push(this.grids[u + "_" + f]),
7284 e + i >= (u + 1) * d &&
7285 ((p = this.grids[u + 1 + "_" + f]) && m.push(p),
7286 f && t - i <= f * d
7287 ? (p = this.grids[u + 1 + "_" + (f - 1)]) && m.push(p)
7288 : t + i >= (f + 1) * d &&
7289 (p = this.grids[u + 1 + "_" + (f + 1)]) &&
7290 m.push(p)),
7291 u &&
7292 e - i <= u * d &&
7293 ((p = this.grids[u - 1 + "_" + f]) && m.push(p),
7294 f && t - i <= f * d
7295 ? (p = this.grids[u - 1 + "_" + (f - 1)]) && m.push(p)
7296 : t + i >= (f + 1) * d &&
7297 (p = this.grids[u - 1 + "_" + (f + 1)]) &&
7298 m.push(p)),
7299 t + i >= (f + 1) * d &&
7300 (p = this.grids[u + "_" + (f + 1)]) &&
7301 m.push(p),
7302 f &&
7303 t - i <= f * d &&
7304 (p = this.grids[u + "_" + (f - 1)]) &&
7305 m.push(p);
7306 } catch (e) {}
7307 return m;
7308 }),
7309 (this.add = function(n, i, r, s, a, o, c, l, u) {
7310 g = null;
7311 for (var f = 0; f < t.length; ++f)
7312 if (t[f].sid == n) {
7313 g = t[f];
7314 break;
7315 }
7316 if (!g)
7317 for (f = 0; f < t.length; ++f)
7318 if (!t[f].active) {
7319 g = t[f];
7320 break;
7321 }
7322 g || ((g = new e(n)), t.push(g)),
7323 l && (g.sid = n),
7324 g.init(i, r, s, a, o, c, u),
7325 h &&
7326 (this.setObjectGrids(g),
7327 g.doUpdate && this.updateObjects.push(g));
7328 }),
7329 (this.disableBySid = function(e) {
7330 for (var n = 0; n < t.length; ++n)
7331 if (t[n].sid == e) {
7332 this.disableObj(t[n]);
7333 break;
7334 }
7335 }),
7336 (this.removeAllItems = function(e, n) {
7337 for (var i = 0; i < t.length; ++i)
7338 t[i].active &&
7339 t[i].owner &&
7340 t[i].owner.sid == e &&
7341 this.disableObj(t[i]);
7342 n && n.broadcast("13", e);
7343 }),
7344 (this.fetchSpawnObj = function(e) {
7345 for (var n = null, i = 0; i < t.length; ++i)
7346 if (
7347 (g = t[i]).active &&
7348 g.owner &&
7349 g.owner.sid == e &&
7350 g.spawnPoint
7351 ) {
7352 (n = [g.x, g.y]),
7353 this.disableObj(g),
7354 h.broadcast("12", g.sid),
7355 g.owner && g.owner.changeItemCount(g.group.id, -1);
7356 break;
7357 }
7358 return n;
7359 }),
7360 (this.checkItemLocation = function(e, n, i, r, s, a, l) {
7361 for (var h = 0; h < t.length; ++h) {
7362 var u = t[h].blocker ? t[h].blocker : t[h].getScale(r, t[h].isItem);
7363 if (t[h].active && o.getDistance(e, n, t[h].x, t[h].y) < i + u)
7364 return !1;
7365 }
7366 return !(
7367 !a &&
7368 18 != s &&
7369 n >= c.mapScale / 2 - c.riverWidth / 2 &&
7370 n <= c.mapScale / 2 + c.riverWidth / 2
7371 );
7372 }),
7373 (this.addProjectile = function(e, t, n, i, r) {
7374 for (
7375 var s, a = items.projectiles[r], c = 0;
7376 c < projectiles.length;
7377 ++c
7378 )
7379 if (!projectiles[c].active) {
7380 s = projectiles[c];
7381 break;
7382 }
7383 s || ((s = new Projectile(l, o)), projectiles.push(s)),
7384 s.init(r, e, t, n, a.speed, i, a.scale);
7385 }),
7386 (this.checkCollision = function(e, t, n) {
7387 n = n || 1;
7388 var l = e.x - t.x,
7389 h = e.y - t.y,
7390 u = e.scale + t.scale;
7391 if (i(l) <= u || i(h) <= u) {
7392 u = e.scale + (t.getScale ? t.getScale() : t.scale);
7393 var f = a(l * l + h * h) - u;
7394 if (f <= 0) {
7395 if (t.ignoreCollision)
7396 !t.trap ||
7397 e.noTrap ||
7398 t.owner == e ||
7399 (t.owner && t.owner.team && t.owner.team == e.team)
7400 ? t.boostSpeed
7401 ? ((e.xVel +=
7402 n * t.boostSpeed * (t.weightM || 1) * r(t.dir)),
7403 (e.yVel +=
7404 n * t.boostSpeed * (t.weightM || 1) * s(t.dir)))
7405 : t.healCol
7406 ? (e.healCol = t.healCol)
7407 : t.teleport &&
7408 ((e.x = o.randInt(0, c.mapScale)),
7409 (e.y = o.randInt(0, c.mapScale)))
7410 : ((e.lockMove = !0), (t.hideFromEnemy = !1));
7411 else {
7412 var d = o.getDirection(e.x, e.y, t.x, t.y);
7413 if (
7414 (o.getDistance(e.x, e.y, t.x, t.y),
7415 t.isPlayer
7416 ? ((f = (-1 * f) / 2),
7417 (e.x += f * r(d)),
7418 (e.y += f * s(d)),
7419 (t.x -= f * r(d)),
7420 (t.y -= f * s(d)))
7421 : ((e.x = t.x + u * r(d)),
7422 (e.y = t.y + u * s(d)),
7423 (e.xVel *= 0.75),
7424 (e.yVel *= 0.75)),
7425 t.dmg &&
7426 t.owner != e &&
7427 (!t.owner || !t.owner.team || t.owner.team != e.team))
7428 ) {
7429 e.changeHealth(-t.dmg, t.owner, t);
7430 var p = 1.5 * (t.weightM || 1);
7431 (e.xVel += p * r(d)),
7432 (e.yVel += p * s(d)),
7433 !t.pDmg ||
7434 (e.skin && e.skin.poisonRes) ||
7435 ((e.dmgOverTime.dmg = t.pDmg),
7436 (e.dmgOverTime.time = 5),
7437 (e.dmgOverTime.doer = t.owner)),
7438 e.colDmg &&
7439 t.health &&
7440 (t.changeHealth(-e.colDmg) && this.disableObj(t),
7441 this.hitObj(t, o.getDirection(e.x, e.y, t.x, t.y)));
7442 }
7443 }
7444 return t.zIndex > e.zIndex && (e.zIndex = t.zIndex), !0;
7445 }
7446 }
7447 return !1;
7448 });
7449 };
7450 },
7451 function(e, t, n) {
7452 var i = new (n(49))();
7453 i.addWords(
7454 "jew",
7455 "black",
7456 "baby",
7457 "child",
7458 "white",
7459 "porn",
7460 "pedo",
7461 "trump",
7462 "clinton",
7463 "hitler",
7464 "nazi",
7465 "gay",
7466 "pride",
7467 "sex",
7468 "pleasure",
7469 "touch",
7470 "poo",
7471 "kids",
7472 "rape",
7473 "white power",
7474 "nigga",
7475 "nig nog",
7476 "doggy",
7477 "rapist",
7478 "boner",
7479 "nigger",
7480 "nigg",
7481 "finger",
7482 "nogger",
7483 "nagger",
7484 "nig",
7485 "fag",
7486 "gai",
7487 "pole",
7488 "stripper",
7489 "penis",
7490 "vagina",
7491 "pussy",
7492 "nazi",
7493 "hitler",
7494 "stalin",
7495 "burn",
7496 "chamber",
7497 "cock",
7498 "peen",
7499 "dick",
7500 "spick",
7501 "nieger",
7502 "die",
7503 "satan",
7504 "n|ig",
7505 "nlg",
7506 "cunt",
7507 "c0ck",
7508 "fag",
7509 "lick",
7510 "condom",
7511 "anal",
7512 "shit",
7513 "phile",
7514 "little",
7515 "kids",
7516 "free KR",
7517 "tiny",
7518 "sidney",
7519 "ass",
7520 "kill",
7521 ".io",
7522 "(dot)",
7523 "[dot]",
7524 "mini",
7525 "whiore",
7526 "whore",
7527 "faggot",
7528 "github",
7529 "1337",
7530 "666",
7531 "satan",
7532 "senpa",
7533 "discord",
7534 "d1scord",
7535 "mistik",
7536 ".io",
7537 "senpa.io",
7538 "sidney",
7539 "sid",
7540 "senpaio",
7541 "vries",
7542 "asa"
7543 );
7544 var r = Math.abs,
7545 s = Math.cos,
7546 a = Math.sin,
7547 o = Math.pow,
7548 c = Math.sqrt;
7549 e.exports = function(e, t, n, l, h, u, f, d, p, g, m, y, k, v) {
7550 (this.id = e),
7551 (this.sid = t),
7552 (this.tmpScore = 0),
7553 (this.team = null),
7554 (this.skinIndex = 0),
7555 (this.tailIndex = 0),
7556 (this.hitTime = 0),
7557 (this.tails = {});
7558 for (var w = 0; w < m.length; ++w)
7559 m[w].price <= 0 && (this.tails[m[w].id] = 1);
7560 for (this.skins = {}, w = 0; w < g.length; ++w)
7561 g[w].price <= 0 && (this.skins[g[w].id] = 1);
7562 (this.points = 0),
7563 (this.dt = 0),
7564 (this.hidden = !1),
7565 (this.itemCounts = {}),
7566 (this.isPlayer = !0),
7567 (this.pps = 0),
7568 (this.moveDir = void 0),
7569 (this.skinRot = 0),
7570 (this.lastPing = 0),
7571 (this.iconIndex = 0),
7572 (this.skinColor = 0),
7573 (this.spawn = function(e) {
7574 (this.active = !0),
7575 (this.alive = !0),
7576 (this.lockMove = !1),
7577 (this.lockDir = !1),
7578 (this.minimapCounter = 0),
7579 (this.chatCountdown = 0),
7580 (this.shameCount = 0),
7581 (this.shameTimer = 0),
7582 (this.sentTo = {}),
7583 (this.gathering = 0),
7584 (this.autoGather = 0),
7585 (this.animTime = 0),
7586 (this.animSpeed = 0),
7587 (this.mouseState = 0),
7588 (this.buildIndex = -1),
7589 (this.weaponIndex = 0),
7590 (this.dmgOverTime = {}),
7591 (this.noMovTimer = 0),
7592 (this.maxXP = 300),
7593 (this.XP = 0),
7594 (this.age = 1),
7595 (this.kills = 0),
7596 (this.upgrAge = 2),
7597 (this.upgradePoints = 0),
7598 (this.x = 0),
7599 (this.y = 0),
7600 (this.zIndex = 0),
7601 (this.xVel = 0),
7602 (this.yVel = 0),
7603 (this.slowMult = 1),
7604 (this.dir = 0),
7605 (this.dirPlus = 0),
7606 (this.targetDir = 0),
7607 (this.targetAngle = 0),
7608 (this.maxHealth = 100),
7609 (this.health = this.maxHealth),
7610 (this.scale = n.playerScale),
7611 (this.speed = n.playerSpeed),
7612 this.resetMoveDir(),
7613 this.resetResources(e),
7614 (this.items = [0, 3, 6, 10]),
7615 (this.weapons = [0]),
7616 (this.shootCount = 0),
7617 (this.weaponXP = []),
7618 (this.reloads = {});
7619 }),
7620 (this.resetMoveDir = function() {
7621 this.moveDir = void 0;
7622 }),
7623 (this.resetResources = function(e) {
7624 for (var t = 0; t < n.resourceTypes.length; ++t)
7625 this[n.resourceTypes[t]] = e ? 100 : 0;
7626 }),
7627 (this.addItem = function(e) {
7628 var t = p.list[e];
7629 if (t) {
7630 for (var n = 0; n < this.items.length; ++n)
7631 if (p.list[this.items[n]].group == t.group)
7632 return (
7633 this.buildIndex == this.items[n] && (this.buildIndex = e),
7634 (this.items[n] = e),
7635 !0
7636 );
7637 return this.items.push(e), !0;
7638 }
7639 return !1;
7640 }),
7641 (this.setUserData = function(e) {
7642 if (e) {
7643 this.name = "unknown";
7644 var t = e.name + "",
7645 r = !1,
7646 s = (t = (t = (t = (t = t.slice(0, n.maxNameLength)).replace(
7647 /[^\w:\(\)\/? -]+/gim,
7648 " "
7649 )).replace(/[^\x00-\x7F]/g, " ")).trim())
7650 .toLowerCase()
7651 .replace(/\s/g, "")
7652 .replace(/1/g, "i")
7653 .replace(/0/g, "o")
7654 .replace(/5/g, "s");
7655 for (var a of i.list)
7656 if (-1 != s.indexOf(a)) {
7657 r = !0;
7658 break;
7659 }
7660 t.length > 0 && !r && (this.name = t),
7661 (this.skinColor = 0),
7662 n.skinColors[e.skin] && (this.skinColor = e.skin);
7663 }
7664 }),
7665 (this.getData = function() {
7666 return [
7667 this.id,
7668 this.sid,
7669 this.name,
7670 l.fixTo(this.x, 2),
7671 l.fixTo(this.y, 2),
7672 l.fixTo(this.dir, 3),
7673 this.health,
7674 this.maxHealth,
7675 this.scale,
7676 this.skinColor
7677 ];
7678 }),
7679 (this.setData = function(e) {
7680 (this.id = e[0]),
7681 (this.sid = e[1]),
7682 (this.name = e[2]),
7683 (this.x = e[3]),
7684 (this.y = e[4]),
7685 (this.dir = e[5]),
7686 (this.health = e[6]),
7687 (this.maxHealth = e[7]),
7688 (this.scale = e[8]),
7689 (this.skinColor = e[9]);
7690 });
7691 var b = 0;
7692 (this.update = function(e) {
7693 if (this.alive) {
7694 if (
7695 (this.shameTimer > 0 &&
7696 ((this.shameTimer -= e),
7697 this.shameTimer <= 0 &&
7698 ((this.shameTimer = 0), (this.shameCount = 0))),
7699 (b -= e) <= 0)
7700 ) {
7701 var t =
7702 (this.skin && this.skin.healthRegen ? this.skin.healthRegen : 0) +
7703 (this.tail && this.tail.healthRegen ? this.tail.healthRegen : 0);
7704 t && this.changeHealth(t, this),
7705 this.dmgOverTime.dmg &&
7706 (this.changeHealth(
7707 -this.dmgOverTime.dmg,
7708 this.dmgOverTime.doer
7709 ),
7710 (this.dmgOverTime.time -= 1),
7711 this.dmgOverTime.time <= 0 && (this.dmgOverTime.dmg = 0)),
7712 this.healCol && this.changeHealth(this.healCol, this),
7713 (b = 1e3);
7714 }
7715 if (this.alive) {
7716 if (
7717 (this.slowMult < 1 &&
7718 ((this.slowMult += 8e-4 * e),
7719 this.slowMult > 1 && (this.slowMult = 1)),
7720 (this.noMovTimer += e),
7721 (this.xVel || this.yVel) && (this.noMovTimer = 0),
7722 this.lockMove)
7723 )
7724 (this.xVel = 0), (this.yVel = 0);
7725 else {
7726 var i =
7727 (this.buildIndex >= 0 ? 0.5 : 1) *
7728 (p.weapons[this.weaponIndex].spdMult || 1) *
7729 ((this.skin && this.skin.spdMult) || 1) *
7730 ((this.tail && this.tail.spdMult) || 1) *
7731 (this.y <= n.snowBiomeTop
7732 ? this.skin && this.skin.coldM
7733 ? 1
7734 : n.snowSpeed
7735 : 1) *
7736 this.slowMult;
7737 !this.zIndex &&
7738 this.y >= n.mapScale / 2 - n.riverWidth / 2 &&
7739 this.y <= n.mapScale / 2 + n.riverWidth / 2 &&
7740 (this.skin && this.skin.watrImm
7741 ? ((i *= 0.75), (this.xVel += 0.4 * n.waterCurrent * e))
7742 : ((i *= 0.33), (this.xVel += n.waterCurrent * e)));
7743 var r = null != this.moveDir ? s(this.moveDir) : 0,
7744 d = null != this.moveDir ? a(this.moveDir) : 0,
7745 g = c(r * r + d * d);
7746 0 != g && ((r /= g), (d /= g)),
7747 r && (this.xVel += r * this.speed * i * e),
7748 d && (this.yVel += d * this.speed * i * e);
7749 }
7750 var m;
7751 (this.zIndex = 0), (this.lockMove = !1), (this.healCol = 0);
7752 for (
7753 var y = l.getDistance(0, 0, this.xVel * e, this.yVel * e),
7754 k = Math.min(4, Math.max(1, Math.round(y / 40))),
7755 v = 1 / k,
7756 w = 0;
7757 w < k;
7758 ++w
7759 ) {
7760 this.xVel && (this.x += this.xVel * e * v),
7761 this.yVel && (this.y += this.yVel * e * v),
7762 (m = u.getGridArrays(this.x, this.y, this.scale));
7763 for (var x = 0; x < m.length; ++x)
7764 for (var S = 0; S < m[x].length; ++S)
7765 m[x][S].active && u.checkCollision(this, m[x][S], v);
7766 }
7767 for (w = (I = f.indexOf(this)) + 1; w < f.length; ++w)
7768 f[w] != this && f[w].alive && u.checkCollision(this, f[w]);
7769 if (
7770 (this.xVel &&
7771 ((this.xVel *= o(n.playerDecel, e)),
7772 this.xVel <= 0.01 && this.xVel >= -0.01 && (this.xVel = 0)),
7773 this.yVel &&
7774 ((this.yVel *= o(n.playerDecel, e)),
7775 this.yVel <= 0.01 && this.yVel >= -0.01 && (this.yVel = 0)),
7776 this.x - this.scale < 0
7777 ? (this.x = this.scale)
7778 : this.x + this.scale > n.mapScale &&
7779 (this.x = n.mapScale - this.scale),
7780 this.y - this.scale < 0
7781 ? (this.y = this.scale)
7782 : this.y + this.scale > n.mapScale &&
7783 (this.y = n.mapScale - this.scale),
7784 this.buildIndex < 0)
7785 )
7786 if (this.reloads[this.weaponIndex] > 0)
7787 (this.reloads[this.weaponIndex] -= e),
7788 (this.gathering = this.mouseState);
7789 else if (this.gathering || this.autoGather) {
7790 var T = !0;
7791 if (null != p.weapons[this.weaponIndex].gather) this.gather(f);
7792 else if (
7793 null != p.weapons[this.weaponIndex].projectile &&
7794 this.hasRes(
7795 p.weapons[this.weaponIndex],
7796 this.skin ? this.skin.projCost : 0
7797 )
7798 ) {
7799 this.useRes(
7800 p.weapons[this.weaponIndex],
7801 this.skin ? this.skin.projCost : 0
7802 ),
7803 (this.noMovTimer = 0);
7804 var I = p.weapons[this.weaponIndex].projectile,
7805 E = 2 * this.scale,
7806 M = this.skin && this.skin.aMlt ? this.skin.aMlt : 1;
7807 p.weapons[this.weaponIndex].rec &&
7808 ((this.xVel -=
7809 p.weapons[this.weaponIndex].rec * s(this.dir)),
7810 (this.yVel -=
7811 p.weapons[this.weaponIndex].rec * a(this.dir))),
7812 h.addProjectile(
7813 this.x + E * s(this.dir),
7814 this.y + E * a(this.dir),
7815 this.dir,
7816 p.projectiles[I].range * M,
7817 p.projectiles[I].speed * M,
7818 I,
7819 this,
7820 null,
7821 this.zIndex
7822 );
7823 } else T = !1;
7824 (this.gathering = this.mouseState),
7825 T &&
7826 (this.reloads[this.weaponIndex] =
7827 p.weapons[this.weaponIndex].speed *
7828 ((this.skin && this.skin.atkSpd) || 1));
7829 }
7830 }
7831 }
7832 }),
7833 (this.addWeaponXP = function(e) {
7834 this.weaponXP[this.weaponIndex] ||
7835 (this.weaponXP[this.weaponIndex] = 0),
7836 (this.weaponXP[this.weaponIndex] += e);
7837 }),
7838 (this.earnXP = function(e) {
7839 this.age < n.maxAge &&
7840 ((this.XP += e),
7841 this.XP >= this.maxXP
7842 ? (this.age < n.maxAge
7843 ? (this.age++, (this.XP = 0), (this.maxXP *= 1.2))
7844 : (this.XP = this.maxXP),
7845 this.upgradePoints++,
7846 y.send(this.id, "16", this.upgradePoints, this.upgrAge),
7847 y.send(
7848 this.id,
7849 "15",
7850 this.XP,
7851 l.fixTo(this.maxXP, 1),
7852 this.age
7853 ))
7854 : y.send(this.id, "15", this.XP));
7855 }),
7856 (this.changeHealth = function(e, t) {
7857 if (e > 0 && this.health >= this.maxHealth) return !1;
7858 e < 0 && this.skin && (e *= this.skin.dmgMult || 1),
7859 e < 0 && this.tail && (e *= this.tail.dmgMult || 1),
7860 e < 0 && (this.hitTime = Date.now()),
7861 (this.health += e),
7862 this.health > this.maxHealth &&
7863 ((e -= this.health - this.maxHealth),
7864 (this.health = this.maxHealth)),
7865 this.health <= 0 && this.kill(t);
7866 for (var n = 0; n < f.length; ++n)
7867 this.sentTo[f[n].id] &&
7868 y.send(f[n].id, "h", this.sid, Math.round(this.health));
7869 return (
7870 !t ||
7871 !t.canSee(this) ||
7872 (t == this && e < 0) ||
7873 y.send(
7874 t.id,
7875 "t",
7876 Math.round(this.x),
7877 Math.round(this.y),
7878 Math.round(-e),
7879 1
7880 ),
7881 !0
7882 );
7883 }),
7884 (this.kill = function(e) {
7885 e &&
7886 e.alive &&
7887 (e.kills++,
7888 e.skin && e.skin.goldSteal
7889 ? k(e, Math.round(this.points / 2))
7890 : k(
7891 e,
7892 Math.round(
7893 100 * this.age * (e.skin && e.skin.kScrM ? e.skin.kScrM : 1)
7894 )
7895 ),
7896 y.send(e.id, "9", "kills", e.kills, 1)),
7897 (this.alive = !1),
7898 y.send(this.id, "11"),
7899 v();
7900 }),
7901 (this.addResource = function(e, t, i) {
7902 !i && t > 0 && this.addWeaponXP(t),
7903 3 == e
7904 ? k(this, t, !0)
7905 : ((this[n.resourceTypes[e]] += t),
7906 y.send(
7907 this.id,
7908 "9",
7909 n.resourceTypes[e],
7910 this[n.resourceTypes[e]],
7911 1
7912 ));
7913 }),
7914 (this.changeItemCount = function(e, t) {
7915 (this.itemCounts[e] = this.itemCounts[e] || 0),
7916 (this.itemCounts[e] += t),
7917 y.send(this.id, "14", e, this.itemCounts[e]);
7918 }),
7919 (this.buildItem = function(e) {
7920 var t = this.scale + e.scale + (e.placeOffset || 0),
7921 n = this.x + t * s(this.dir),
7922 i = this.y + t * a(this.dir);
7923 if (
7924 this.canBuild(e) &&
7925 !(e.consume && this.skin && this.skin.noEat) &&
7926 (e.consume ||
7927 u.checkItemLocation(n, i, e.scale, 0.6, e.id, !1, this))
7928 ) {
7929 var r = !1;
7930 if (e.consume) {
7931 if (this.hitTime) {
7932 var o = Date.now() - this.hitTime;
7933 (this.hitTime = 0),
7934 o <= 120
7935 ? (this.shameCount++,
7936 this.shameCount >= 8 &&
7937 ((this.shameTimer = 3e4), (this.shameCount = 0)))
7938 : ((this.shameCount -= 2),
7939 this.shameCount <= 0 && (this.shameCount = 0));
7940 }
7941 this.shameTimer <= 0 && (r = e.consume(this));
7942 } else
7943 (r = !0),
7944 e.group.limit && this.changeItemCount(e.group.id, 1),
7945 e.pps && (this.pps += e.pps),
7946 u.add(
7947 u.objects.length,
7948 n,
7949 i,
7950 this.dir,
7951 e.scale,
7952 e.type,
7953 e,
7954 !1,
7955 this
7956 );
7957 r && (this.useRes(e), (this.buildIndex = -1));
7958 }
7959 }),
7960 (this.hasRes = function(e, t) {
7961 for (var n = 0; n < e.req.length; ) {
7962 if (this[e.req[n]] < Math.round(e.req[n + 1] * (t || 1))) return !1;
7963 n += 2;
7964 }
7965 return !0;
7966 }),
7967 (this.useRes = function(e, t) {
7968 if (!n.inSandbox)
7969 for (var i = 0; i < e.req.length; )
7970 this.addResource(
7971 n.resourceTypes.indexOf(e.req[i]),
7972 -Math.round(e.req[i + 1] * (t || 1))
7973 ),
7974 (i += 2);
7975 }),
7976 (this.canBuild = function(e) {
7977 return (
7978 !!n.inSandbox ||
7979 (!(e.group.limit && this.itemCounts[e.group.id] >= e.group.limit) &&
7980 this.hasRes(e))
7981 );
7982 }),
7983 (this.gather = function() {
7984 (this.noMovTimer = 0),
7985 (this.slowMult -= p.weapons[this.weaponIndex].hitSlow || 0.3),
7986 this.slowMult < 0 && (this.slowMult = 0);
7987 for (
7988 var e,
7989 t,
7990 i,
7991 r = n.fetchVariant(this),
7992 o = r.poison,
7993 c = r.val,
7994 h = {},
7995 g = u.getGridArrays(
7996 this.x,
7997 this.y,
7998 p.weapons[this.weaponIndex].range
7999 ),
8000 m = 0;
8001 m < g.length;
8002 ++m
8003 )
8004 for (var y = 0; y < g[m].length; ++y)
8005 if (
8006 (t = g[m][y]).active &&
8007 !t.dontGather &&
8008 !h[t.sid] &&
8009 t.visibleToPlayer(this) &&
8010 l.getDistance(this.x, this.y, t.x, t.y) - t.scale <=
8011 p.weapons[this.weaponIndex].range &&
8012 ((e = l.getDirection(t.x, t.y, this.x, this.y)),
8013 l.getAngleDist(e, this.dir) <= n.gatherAngle)
8014 ) {
8015 if (((h[t.sid] = 1), t.health)) {
8016 if (
8017 t.changeHealth(
8018 -p.weapons[this.weaponIndex].dmg *
8019 c *
8020 (p.weapons[this.weaponIndex].sDmg || 1) *
8021 (this.skin && this.skin.bDmg ? this.skin.bDmg : 1),
8022 this
8023 )
8024 ) {
8025 for (var k = 0; k < t.req.length; )
8026 this.addResource(
8027 n.resourceTypes.indexOf(t.req[k]),
8028 t.req[k + 1]
8029 ),
8030 (k += 2);
8031 u.disableObj(t);
8032 }
8033 } else {
8034 this.earnXP(4 * p.weapons[this.weaponIndex].gather);
8035 var v =
8036 p.weapons[this.weaponIndex].gather + (3 == t.type ? 4 : 0);
8037 this.skin && this.skin.extraGold && this.addResource(3, 1),
8038 this.addResource(t.type, v);
8039 }
8040 (i = !0), u.hitObj(t, e);
8041 }
8042 for (y = 0; y < f.length + d.length; ++y)
8043 if (
8044 (t = f[y] || d[y - f.length]) != this &&
8045 t.alive &&
8046 (!t.team || t.team != this.team) &&
8047 l.getDistance(this.x, this.y, t.x, t.y) - 1.8 * t.scale <=
8048 p.weapons[this.weaponIndex].range &&
8049 ((e = l.getDirection(t.x, t.y, this.x, this.y)),
8050 l.getAngleDist(e, this.dir) <= n.gatherAngle)
8051 ) {
8052 var w = p.weapons[this.weaponIndex].steal;
8053 w &&
8054 t.addResource &&
8055 ((w = Math.min(t.points || 0, w)),
8056 this.addResource(3, w),
8057 t.addResource(3, -w));
8058 var b = c;
8059 null != t.weaponIndex &&
8060 p.weapons[t.weaponIndex].shield &&
8061 l.getAngleDist(e + Math.PI, t.dir) <= n.shieldAngle &&
8062 (b = p.weapons[t.weaponIndex].shield);
8063 var x =
8064 p.weapons[this.weaponIndex].dmg *
8065 (this.skin && this.skin.dmgMultO ? this.skin.dmgMultO : 1) *
8066 (this.tail && this.tail.dmgMultO ? this.tail.dmgMultO : 1),
8067 S =
8068 0.3 * (t.weightM || 1) +
8069 (p.weapons[this.weaponIndex].knock || 0);
8070 (t.xVel += S * s(e)),
8071 (t.yVel += S * a(e)),
8072 this.skin &&
8073 this.skin.healD &&
8074 this.changeHealth(x * b * this.skin.healD, this),
8075 this.tail &&
8076 this.tail.healD &&
8077 this.changeHealth(x * b * this.tail.healD, this),
8078 t.skin &&
8079 t.skin.dmg &&
8080 1 == b &&
8081 this.changeHealth(-x * t.skin.dmg, t),
8082 t.tail &&
8083 t.tail.dmg &&
8084 1 == b &&
8085 this.changeHealth(-x * t.tail.dmg, t),
8086 !(t.dmgOverTime && this.skin && this.skin.poisonDmg) ||
8087 (t.skin && t.skin.poisonRes) ||
8088 ((t.dmgOverTime.dmg = this.skin.poisonDmg),
8089 (t.dmgOverTime.time = this.skin.poisonTime || 1),
8090 (t.dmgOverTime.doer = this)),
8091 !t.dmgOverTime ||
8092 !o ||
8093 (t.skin && t.skin.poisonRes) ||
8094 ((t.dmgOverTime.dmg = 5),
8095 (t.dmgOverTime.time = 5),
8096 (t.dmgOverTime.doer = this)),
8097 t.skin &&
8098 t.skin.dmgK &&
8099 ((this.xVel -= t.skin.dmgK * s(e)),
8100 (this.yVel -= t.skin.dmgK * a(e))),
8101 t.changeHealth(-x * b, this, this);
8102 }
8103 this.sendAnimation(i ? 1 : 0);
8104 }),
8105 (this.sendAnimation = function(e) {
8106 for (var t = 0; t < f.length; ++t)
8107 this.sentTo[f[t].id] &&
8108 this.canSee(f[t]) &&
8109 y.send(f[t].id, "7", this.sid, e ? 1 : 0, this.weaponIndex);
8110 });
8111 var x = 0,
8112 S = 0;
8113 (this.animate = function(e) {
8114 this.animTime > 0 &&
8115 ((this.animTime -= e),
8116 this.animTime <= 0
8117 ? ((this.animTime = 0), (this.dirPlus = 0), (x = 0), (S = 0))
8118 : 0 == S
8119 ? ((x += e / (this.animSpeed * n.hitReturnRatio)),
8120 (this.dirPlus = l.lerp(0, this.targetAngle, Math.min(1, x))),
8121 x >= 1 && ((x = 1), (S = 1)))
8122 : ((x -= e / (this.animSpeed * (1 - n.hitReturnRatio))),
8123 (this.dirPlus = l.lerp(0, this.targetAngle, Math.max(0, x)))));
8124 }),
8125 (this.startAnim = function(e, t) {
8126 (this.animTime = this.animSpeed = p.weapons[t].speed),
8127 (this.targetAngle = e ? -n.hitAngle : -Math.PI),
8128 (x = 0),
8129 (S = 0);
8130 }),
8131 (this.canSee = function(e) {
8132 if (!e) return !1;
8133 if (e.skin && e.skin.invisTimer && e.noMovTimer >= e.skin.invisTimer)
8134 return !1;
8135 var t = r(e.x - this.x) - e.scale,
8136 i = r(e.y - this.y) - e.scale;
8137 return (
8138 t <= (n.maxScreenWidth / 2) * 1.3 &&
8139 i <= (n.maxScreenHeight / 2) * 1.3
8140 );
8141 });
8142 };
8143 },
8144 function(e, t, n) {
8145 const i = n(50).words,
8146 r = n(51).array;
8147 e.exports = class {
8148 constructor(e = {}) {
8149 Object.assign(this, {
8150 list:
8151 (e.emptyList && []) ||
8152 Array.prototype.concat.apply(i, [r, e.list || []]),
8153 exclude: e.exclude || [],
8154 placeHolder: e.placeHolder || "*",
8155 regex: e.regex || /[^a-zA-Z0-9|\$|\@]|\^/g,
8156 replaceRegex: e.replaceRegex || /\w/g
8157 });
8158 }
8159 isProfane(e) {
8160 return (
8161 this.list.filter(t => {
8162 const n = new RegExp(`\\b${t.replace(/(\W)/g, "\\$1")}\\b`, "gi");
8163 return !this.exclude.includes(t.toLowerCase()) && n.test(e);
8164 }).length > 0 || !1
8165 );
8166 }
8167 replaceWord(e) {
8168 return e
8169 .replace(this.regex, "")
8170 .replace(this.replaceRegex, this.placeHolder);
8171 }
8172 clean(e) {
8173 return e
8174 .split(/\b/)
8175 .map(e => (this.isProfane(e) ? this.replaceWord(e) : e))
8176 .join("");
8177 }
8178 addWords() {
8179 let e = Array.from(arguments);
8180 this.list.push(...e),
8181 e
8182 .map(e => e.toLowerCase())
8183 .forEach(e => {
8184 this.exclude.includes(e) &&
8185 this.exclude.splice(this.exclude.indexOf(e), 1);
8186 });
8187 }
8188 removeWords() {
8189 this.exclude.push(...Array.from(arguments).map(e => e.toLowerCase()));
8190 }
8191 };
8192 },
8193 function(e) {
8194 e.exports = {
8195 words: ["damn", "bloody"]
8196 };
8197 },
8198 function(e, t, n) {
8199 e.exports = {
8200 object: n(52),
8201 array: n(53),
8202 regex: n(54)
8203 };
8204 },
8205 function(e, t) {
8206 e.exports = {
8207 damn: 1,
8208 bloody: 1
8209 };
8210 },
8211 function(e, t) {
8212 e.exports = ["damn", "bloody"];
8213 },
8214 function(e, t) {
8215 e.exports = /\b(damn|bloody)\b/gi;
8216 },
8217 function(e, t) {
8218 (e.exports.hats = [
8219 {
8220 id: 45,
8221 name: "Shame!",
8222 dontSell: !0,
8223 price: 0,
8224 scale: 120,
8225 desc: "hacks are for losers"
8226 },
8227 {
8228 id: 51,
8229 name: "Moo Cap",
8230 price: 0,
8231 scale: 120,
8232 desc: "coolest mooer around"
8233 },
8234 {
8235 id: 50,
8236 name: "Apple Cap",
8237 price: 0,
8238 scale: 120,
8239 desc: "apple farms remembers"
8240 },
8241 {
8242 id: 28,
8243 name: "Moo Head",
8244 price: 0,
8245 scale: 120,
8246 desc: "no effect"
8247 },
8248 {
8249 id: 29,
8250 name: "Pig Head",
8251 price: 0,
8252 scale: 120,
8253 desc: "no effect"
8254 },
8255 {
8256 id: 30,
8257 name: "Fluff Head",
8258 price: 0,
8259 scale: 120,
8260 desc: "no effect"
8261 },
8262 {
8263 id: 36,
8264 name: "Pandou Head",
8265 price: 0,
8266 scale: 120,
8267 desc: "no effect"
8268 },
8269 {
8270 id: 37,
8271 name: "Bear Head",
8272 price: 0,
8273 scale: 120,
8274 desc: "no effect"
8275 },
8276 {
8277 id: 38,
8278 name: "Monkey Head",
8279 price: 0,
8280 scale: 120,
8281 desc: "no effect"
8282 },
8283 {
8284 id: 44,
8285 name: "Polar Head",
8286 price: 0,
8287 scale: 120,
8288 desc: "no effect"
8289 },
8290 {
8291 id: 35,
8292 name: "Fez Hat",
8293 price: 0,
8294 scale: 120,
8295 desc: "no effect"
8296 },
8297 {
8298 id: 42,
8299 name: "Enigma Hat",
8300 price: 0,
8301 scale: 120,
8302 desc: "join the enigma army"
8303 },
8304 {
8305 id: 43,
8306 name: "Blitz Hat",
8307 price: 0,
8308 scale: 120,
8309 desc: "hey everybody i'm blitz"
8310 },
8311 {
8312 id: 49,
8313 name: "Bob XIII Hat",
8314 price: 0,
8315 scale: 120,
8316 desc: "like and subscribe"
8317 },
8318 {
8319 id: 57,
8320 name: "Pumpkin",
8321 price: 50,
8322 scale: 120,
8323 desc: "Spooooky"
8324 },
8325 {
8326 id: 8,
8327 name: "Bummle Hat",
8328 price: 100,
8329 scale: 120,
8330 desc: "no effect"
8331 },
8332 {
8333 id: 2,
8334 name: "Straw Hat",
8335 price: 500,
8336 scale: 120,
8337 desc: "no effect"
8338 },
8339 {
8340 id: 15,
8341 name: "Winter Cap",
8342 price: 600,
8343 scale: 120,
8344 desc: "allows you to move at normal speed in snow",
8345 coldM: 1
8346 },
8347 {
8348 id: 5,
8349 name: "Cowboy Hat",
8350 price: 1e3,
8351 scale: 120,
8352 desc: "no effect"
8353 },
8354 {
8355 id: 4,
8356 name: "Ranger Hat",
8357 price: 2e3,
8358 scale: 120,
8359 desc: "no effect"
8360 },
8361 {
8362 id: 18,
8363 name: "Explorer Hat",
8364 price: 2e3,
8365 scale: 120,
8366 desc: "no effect"
8367 },
8368 {
8369 id: 31,
8370 name: "Flipper Hat",
8371 price: 2500,
8372 scale: 120,
8373 desc: "have more control while in water",
8374 watrImm: !0
8375 },
8376 {
8377 id: 1,
8378 name: "Marksman Cap",
8379 price: 3e3,
8380 scale: 120,
8381 desc: "increases arrow speed and range",
8382 aMlt: 1.3
8383 },
8384 {
8385 id: 10,
8386 name: "Bush Gear",
8387 price: 3e3,
8388 scale: 160,
8389 desc: "allows you to disguise yourself as a bush"
8390 },
8391 {
8392 id: 48,
8393 name: "Halo",
8394 price: 3e3,
8395 scale: 120,
8396 desc: "no effect"
8397 },
8398 {
8399 id: 6,
8400 name: "Soldier Helmet",
8401 price: 4e3,
8402 scale: 120,
8403 desc: "reduces damage taken but slows movement",
8404 spdMult: 0.94,
8405 dmgMult: 0.75
8406 },
8407 {
8408 id: 23,
8409 name: "Anti Venom Gear",
8410 price: 4e3,
8411 scale: 120,
8412 desc: "makes you immune to poison",
8413 poisonRes: 1
8414 },
8415 {
8416 id: 13,
8417 name: "Medic Gear",
8418 price: 5e3,
8419 scale: 110,
8420 desc: "slowly regenerates health over time",
8421 healthRegen: 3
8422 },
8423 {
8424 id: 9,
8425 name: "Miners Helmet",
8426 price: 5e3,
8427 scale: 120,
8428 desc: "earn 1 extra gold per resource",
8429 extraGold: 1
8430 },
8431 {
8432 id: 32,
8433 name: "Musketeer Hat",
8434 price: 5e3,
8435 scale: 120,
8436 desc: "reduces cost of projectiles",
8437 projCost: 0.5
8438 },
8439 {
8440 id: 7,
8441 name: "Bull Helmet",
8442 price: 6e3,
8443 scale: 120,
8444 desc: "increases damage done but drains health",
8445 healthRegen: -5,
8446 dmgMultO: 1.5,
8447 spdMult: 0.96
8448 },
8449 {
8450 id: 22,
8451 name: "Emp Helmet",
8452 price: 6e3,
8453 scale: 120,
8454 desc: "turrets won't attack but you move slower",
8455 antiTurret: 1,
8456 spdMult: 0.7
8457 },
8458 {
8459 id: 12,
8460 name: "Booster Hat",
8461 price: 6e3,
8462 scale: 120,
8463 desc: "increases your movement speed",
8464 spdMult: 1.16
8465 },
8466 {
8467 id: 26,
8468 name: "Barbarian Armor",
8469 price: 8e3,
8470 scale: 120,
8471 desc: "knocks back enemies that attack you",
8472 dmgK: 0.6
8473 },
8474 {
8475 id: 21,
8476 name: "Plague Mask",
8477 price: 1e4,
8478 scale: 120,
8479 desc: "melee attacks deal poison damage",
8480 poisonDmg: 5,
8481 poisonTime: 6
8482 },
8483 {
8484 id: 46,
8485 name: "Bull Mask",
8486 price: 1e4,
8487 scale: 120,
8488 desc: "bulls won't target you unless you attack them",
8489 bullRepel: 1
8490 },
8491 {
8492 id: 14,
8493 name: "Windmill Hat",
8494 topSprite: !0,
8495 price: 1e4,
8496 scale: 120,
8497 desc: "generates points while worn",
8498 pps: 1.5
8499 },
8500 {
8501 id: 11,
8502 name: "Spike Gear",
8503 topSprite: !0,
8504 price: 1e4,
8505 scale: 120,
8506 desc: "deal damage to players that damage you",
8507 dmg: 0.45
8508 },
8509 {
8510 id: 53,
8511 name: "Turret Gear",
8512 topSprite: !0,
8513 price: 1e4,
8514 scale: 120,
8515 desc: "you become a walking turret",
8516 turret: {
8517 proj: 1,
8518 range: 700,
8519 rate: 2500
8520 },
8521 spdMult: 0.7
8522 },
8523 {
8524 id: 20,
8525 name: "Samurai Armor",
8526 price: 12e3,
8527 scale: 120,
8528 desc: "increased attack speed and fire rate",
8529 atkSpd: 0.78
8530 },
8531 {
8532 id: 58,
8533 name: "Dark Knight",
8534 price: 12e3,
8535 scale: 120,
8536 desc: "restores health when you deal damage",
8537 healD: 0.4
8538 },
8539 {
8540 id: 27,
8541 name: "Scavenger Gear",
8542 price: 15e3,
8543 scale: 120,
8544 desc: "earn double points for each kill",
8545 kScrM: 2
8546 },
8547 {
8548 id: 40,
8549 name: "Tank Gear",
8550 price: 15e3,
8551 scale: 120,
8552 desc: "increased damage to buildings but slower movement",
8553 spdMult: 0.3,
8554 bDmg: 3.3
8555 },
8556 {
8557 id: 52,
8558 name: "Thief Gear",
8559 price: 15e3,
8560 scale: 120,
8561 desc: "steal half of a players gold when you kill them",
8562 goldSteal: 0.5
8563 },
8564 {
8565 id: 55,
8566 name: "Bloodthirster",
8567 price: 2e4,
8568 scale: 120,
8569 desc: "Restore Health when dealing damage. And increased damage",
8570 healD: 0.25,
8571 dmgMultO: 1.2
8572 },
8573 {
8574 id: 56,
8575 name: "Assassin Gear",
8576 price: 2e4,
8577 scale: 120,
8578 desc: "Go invisible when not moving. Can't eat. Increased speed",
8579 noEat: !0,
8580 spdMult: 1.1,
8581 invisTimer: 1e3
8582 }
8583 ]),
8584 (e.exports.accessories = [
8585 {
8586 id: 12,
8587 name: "Snowball",
8588 price: 1e3,
8589 scale: 105,
8590 xOff: 18,
8591 desc: "no effect"
8592 },
8593 {
8594 id: 9,
8595 name: "Tree Cape",
8596 price: 1e3,
8597 scale: 90,
8598 desc: "no effect"
8599 },
8600 {
8601 id: 10,
8602 name: "Stone Cape",
8603 price: 1e3,
8604 scale: 90,
8605 desc: "no effect"
8606 },
8607 {
8608 id: 3,
8609 name: "Cookie Cape",
8610 price: 1500,
8611 scale: 90,
8612 desc: "no effect"
8613 },
8614 {
8615 id: 8,
8616 name: "Cow Cape",
8617 price: 2e3,
8618 scale: 90,
8619 desc: "no effect"
8620 },
8621 {
8622 id: 11,
8623 name: "Monkey Tail",
8624 price: 2e3,
8625 scale: 97,
8626 xOff: 25,
8627 desc: "Super speed but reduced damage",
8628 spdMult: 1.35,
8629 dmgMultO: 0.2
8630 },
8631 {
8632 id: 17,
8633 name: "Apple Basket",
8634 price: 3e3,
8635 scale: 80,
8636 xOff: 12,
8637 desc: "slowly regenerates health over time",
8638 healthRegen: 1
8639 },
8640 {
8641 id: 6,
8642 name: "Winter Cape",
8643 price: 3e3,
8644 scale: 90,
8645 desc: "no effect"
8646 },
8647 {
8648 id: 4,
8649 name: "Skull Cape",
8650 price: 4e3,
8651 scale: 90,
8652 desc: "no effect"
8653 },
8654 {
8655 id: 5,
8656 name: "Dash Cape",
8657 price: 5e3,
8658 scale: 90,
8659 desc: "no effect"
8660 },
8661 {
8662 id: 2,
8663 name: "Dragon Cape",
8664 price: 6e3,
8665 scale: 90,
8666 desc: "no effect"
8667 },
8668 {
8669 id: 1,
8670 name: "Super Cape",
8671 price: 8e3,
8672 scale: 90,
8673 desc: "no effect"
8674 },
8675 {
8676 id: 7,
8677 name: "Troll Cape",
8678 price: 8e3,
8679 scale: 90,
8680 desc: "no effect"
8681 },
8682 {
8683 id: 14,
8684 name: "Thorns",
8685 price: 1e4,
8686 scale: 115,
8687 xOff: 20,
8688 desc: "no effect"
8689 },
8690 {
8691 id: 15,
8692 name: "Blockades",
8693 price: 1e4,
8694 scale: 95,
8695 xOff: 15,
8696 desc: "no effect"
8697 },
8698 {
8699 id: 20,
8700 name: "Devils Tail",
8701 price: 1e4,
8702 scale: 95,
8703 xOff: 20,
8704 desc: "no effect"
8705 },
8706 {
8707 id: 16,
8708 name: "Sawblade",
8709 price: 12e3,
8710 scale: 90,
8711 spin: !0,
8712 xOff: 0,
8713 desc: "deal damage to players that damage you",
8714 dmg: 0.15
8715 },
8716 {
8717 id: 13,
8718 name: "Angel Wings",
8719 price: 15e3,
8720 scale: 138,
8721 xOff: 22,
8722 desc: "slowly regenerates health over time",
8723 healthRegen: 3
8724 },
8725 {
8726 id: 19,
8727 name: "Shadow Wings",
8728 price: 15e3,
8729 scale: 138,
8730 xOff: 22,
8731 desc: "increased movement speed",
8732 spdMult: 1.1
8733 },
8734 {
8735 id: 18,
8736 name: "Blood Wings",
8737 price: 2e4,
8738 scale: 178,
8739 xOff: 26,
8740 desc: "restores health when you deal damage",
8741 healD: 0.2
8742 },
8743 {
8744 id: 21,
8745 name: "Corrupt X Wings",
8746 price: 2e4,
8747 scale: 178,
8748 xOff: 26,
8749 desc: "deal damage to players that damage you",
8750 dmg: 0.25
8751 }
8752 ]);
8753 },
8754 function(e, t) {
8755 e.exports = function(e, t, n, i, r, s, a) {
8756 this.init = function(e, t, n, i, r, s, o, c, l) {
8757 (this.active = !0),
8758 (this.indx = e),
8759 (this.x = t),
8760 (this.y = n),
8761 (this.dir = i),
8762 (this.skipMov = !0),
8763 (this.speed = r),
8764 (this.dmg = s),
8765 (this.scale = c),
8766 (this.range = o),
8767 (this.owner = l),
8768 a && (this.sentTo = {});
8769 };
8770 var o,
8771 c = [];
8772 this.update = function(l) {
8773 if (this.active) {
8774 var h,
8775 u = this.speed * l;
8776 if (
8777 (this.skipMov
8778 ? (this.skipMov = !1)
8779 : ((this.x += u * Math.cos(this.dir)),
8780 (this.y += u * Math.sin(this.dir)),
8781 (this.range -= u),
8782 this.range <= 0 &&
8783 ((this.x += this.range * Math.cos(this.dir)),
8784 (this.y += this.range * Math.sin(this.dir)),
8785 (u = 1),
8786 (this.range = 0),
8787 (this.active = !1))),
8788 a)
8789 ) {
8790 for (var f = 0; f < e.length; ++f)
8791 !this.sentTo[e[f].id] &&
8792 e[f].canSee(this) &&
8793 ((this.sentTo[e[f].id] = 1),
8794 a.send(
8795 e[f].id,
8796 "18",
8797 s.fixTo(this.x, 1),
8798 s.fixTo(this.y, 1),
8799 s.fixTo(this.dir, 2),
8800 s.fixTo(this.range, 1),
8801 this.speed,
8802 this.indx,
8803 this.layer,
8804 this.sid
8805 ));
8806 for (c.length = 0, f = 0; f < e.length + t.length; ++f)
8807 !(o = e[f] || t[f - e.length]).alive ||
8808 o == this.owner ||
8809 (this.owner.team && o.team == this.owner.team) ||
8810 (s.lineInRect(
8811 o.x - o.scale,
8812 o.y - o.scale,
8813 o.x + o.scale,
8814 o.y + o.scale,
8815 this.x,
8816 this.y,
8817 this.x + u * Math.cos(this.dir),
8818 this.y + u * Math.sin(this.dir)
8819 ) &&
8820 c.push(o));
8821 for (
8822 var d = n.getGridArrays(this.x, this.y, this.scale), p = 0;
8823 p < d.length;
8824 ++p
8825 )
8826 for (var g = 0; g < d[p].length; ++g)
8827 (h = (o = d[p][g]).getScale()),
8828 o.active &&
8829 this.ignoreObj != o.sid &&
8830 this.layer <= o.layer &&
8831 c.indexOf(o) < 0 &&
8832 !o.ignoreCollision &&
8833 s.lineInRect(
8834 o.x - h,
8835 o.y - h,
8836 o.x + h,
8837 o.y + h,
8838 this.x,
8839 this.y,
8840 this.x + u * Math.cos(this.dir),
8841 this.y + u * Math.sin(this.dir)
8842 ) &&
8843 c.push(o);
8844 if (c.length > 0) {
8845 var m = null,
8846 y = null,
8847 k = null;
8848 for (f = 0; f < c.length; ++f)
8849 (k = s.getDistance(this.x, this.y, c[f].x, c[f].y)),
8850 (null == y || k < y) && ((y = k), (m = c[f]));
8851 if (m.isPlayer || m.isAI) {
8852 var v = 0.3 * (m.weightM || 1);
8853 (m.xVel += v * Math.cos(this.dir)),
8854 (m.yVel += v * Math.sin(this.dir)),
8855 (null != m.weaponIndex &&
8856 i.weapons[m.weaponIndex].shield &&
8857 s.getAngleDist(this.dir + Math.PI, m.dir) <=
8858 r.shieldAngle) ||
8859 m.changeHealth(-this.dmg, this.owner, this.owner);
8860 } else
8861 for (
8862 m.projDmg &&
8863 m.health &&
8864 m.changeHealth(-this.dmg) &&
8865 n.disableObj(m),
8866 f = 0;
8867 f < e.length;
8868 ++f
8869 )
8870 e[f].active &&
8871 (m.sentTo[e[f].id] &&
8872 (m.active
8873 ? e[f].canSee(m) &&
8874 a.send(e[f].id, "8", s.fixTo(this.dir, 2), m.sid)
8875 : a.send(e[f].id, "12", m.sid)),
8876 m.active ||
8877 m.owner != e[f] ||
8878 e[f].changeItemCount(m.group.id, -1));
8879 for (this.active = !1, f = 0; f < e.length; ++f)
8880 this.sentTo[e[f].id] &&
8881 a.send(e[f].id, "19", this.sid, s.fixTo(y, 1));
8882 }
8883 }
8884 }
8885 };
8886 };
8887 },
8888 function(e, t) {
8889 e.exports = function(e, t, n, i, r, s, a, o, c) {
8890 this.addProjectile = function(l, h, u, f, d, p, g, m, y) {
8891 for (var k, v = s.projectiles[p], w = 0; w < t.length; ++w)
8892 if (!t[w].active) {
8893 k = t[w];
8894 break;
8895 }
8896 return (
8897 k || (((k = new e(n, i, r, s, a, o, c)).sid = t.length), t.push(k)),
8898 k.init(p, l, h, u, d, v.dmg, f, v.scale, g),
8899 (k.ignoreObj = m),
8900 (k.layer = y || v.layer),
8901 (k.src = v.src),
8902 k
8903 );
8904 };
8905 };
8906 },
8907 function(e, t) {
8908 e.exports.obj = function(e, t) {
8909 var n;
8910 (this.sounds = []),
8911 (this.active = !0),
8912 (this.play = function(t, i, r) {
8913 i &&
8914 this.active &&
8915 ((n = this.sounds[t]) ||
8916 ((n = new Howl({
8917 src: ".././sound/" + t + ".mp3"
8918 })),
8919 (this.sounds[t] = n)),
8920 (r && n.isPlaying) ||
8921 ((n.isPlaying = !0),
8922 n.play(),
8923 n.volume((i || 1) * e.volumeMult),
8924 n.loop(r)));
8925 }),
8926 (this.toggleMute = function(e, t) {
8927 (n = this.sounds[e]) && n.mute(t);
8928 }),
8929 (this.stop = function(e) {
8930 (n = this.sounds[e]) && (n.stop(), (n.isPlaying = !1));
8931 });
8932 };
8933 },
8934 function(e, t, n) {
8935 var i = n(60),
8936 r = n(67);
8937
8938 function s(e, t, n, i, r) {
8939 "localhost" == location.hostname &&
8940 (window.location.hostname = "127.0.0.1"),
8941 (this.debugLog = !1),
8942 (this.baseUrl = e),
8943 (this.lobbySize = n),
8944 (this.devPort = t),
8945 (this.lobbySpread = i),
8946 (this.rawIPs = !!r),
8947 (this.server = void 0),
8948 (this.gameIndex = void 0),
8949 (this.callback = void 0),
8950 (this.errorCallback = void 0),
8951 this.processServers(vultr.servers);
8952 }
8953 (s.prototype.regionInfo = {
8954 0: {
8955 name: "Local",
8956 latitude: 0,
8957 longitude: 0
8958 },
8959 "vultr:1": {
8960 name: "New Jersey",
8961 latitude: 40.1393329,
8962 longitude: -75.8521818
8963 },
8964 "vultr:2": {
8965 name: "Chicago",
8966 latitude: 41.8339037,
8967 longitude: -87.872238
8968 },
8969 "vultr:3": {
8970 name: "Dallas",
8971 latitude: 32.8208751,
8972 longitude: -96.8714229
8973 },
8974 "vultr:4": {
8975 name: "Seattle",
8976 latitude: 47.6149942,
8977 longitude: -122.4759879
8978 },
8979 "vultr:5": {
8980 name: "Los Angeles",
8981 latitude: 34.0207504,
8982 longitude: -118.691914
8983 },
8984 "vultr:6": {
8985 name: "Atlanta",
8986 latitude: 33.7676334,
8987 longitude: -84.5610332
8988 },
8989 "vultr:7": {
8990 name: "Amsterdam",
8991 latitude: 52.3745287,
8992 longitude: 4.7581878
8993 },
8994 "vultr:8": {
8995 name: "London",
8996 latitude: 51.5283063,
8997 longitude: -0.382486
8998 },
8999 "vultr:9": {
9000 name: "Frankfurt",
9001 latitude: 50.1211273,
9002 longitude: 8.496137
9003 },
9004 "vultr:12": {
9005 name: "Silicon Valley",
9006 latitude: 37.4024714,
9007 longitude: -122.3219752
9008 },
9009 "vultr:19": {
9010 name: "Sydney",
9011 latitude: -33.8479715,
9012 longitude: 150.651084
9013 },
9014 "vultr:24": {
9015 name: "Paris",
9016 latitude: 48.8588376,
9017 longitude: 2.2773454
9018 },
9019 "vultr:25": {
9020 name: "Tokyo",
9021 latitude: 35.6732615,
9022 longitude: 139.569959
9023 },
9024 "vultr:39": {
9025 name: "Miami",
9026 latitude: 25.7823071,
9027 longitude: -80.3012156
9028 },
9029 "vultr:40": {
9030 name: "Singapore",
9031 latitude: 1.3147268,
9032 longitude: 103.7065876
9033 }
9034 }),
9035 (s.prototype.start = function(e, t) {
9036 (this.callback = e), (this.errorCallback = t);
9037 var n = this.parseServerQuery();
9038 n
9039 ? (this.log("Found server in query."),
9040 (this.password = n[3]),
9041 this.connect(n[0], n[1], n[2]))
9042 : (this.log("Pinging servers..."), this.pingServers());
9043 }),
9044 (s.prototype.parseServerQuery = function() {
9045 var e = i.parse(location.href, !0),
9046 t = e.query.server;
9047 if ("string" == typeof t) {
9048 var n = t.split(":");
9049 if (3 == n.length) {
9050 var r = n[0],
9051 s = parseInt(n[1]),
9052 a = parseInt(n[2]);
9053 return (
9054 "0" == r || r.startsWith("vultr:") || (r = "vultr:" + r),
9055 [r, s, a, e.query.password]
9056 );
9057 }
9058 this.errorCallback("Invalid number of server parameters in " + t);
9059 }
9060 }),
9061 (s.prototype.findServer = function(e, t) {
9062 var n = this.servers[e];
9063 if (Array.isArray(n)) {
9064 for (var i = 0; i < n.length; i++) {
9065 var r = n[i];
9066 if (r.index == t) return r;
9067 }
9068 console.warn(
9069 "Could not find server in region " + e + " with index " + t + "."
9070 );
9071 } else this.errorCallback("No server list for region " + e);
9072 }),
9073 (s.prototype.pingServers = function() {
9074 var e = this,
9075 t = [];
9076 for (var n in this.servers)
9077 if (this.servers.hasOwnProperty(n)) {
9078 var i = this.servers[n],
9079 r = i[Math.floor(Math.random() * i.length)];
9080 null != r
9081 ? (function(i, r) {
9082 var s = new XMLHttpRequest();
9083 s.onreadystatechange = function(i) {
9084 var s = i.target;
9085 if (4 == s.readyState)
9086 if (200 == s.status) {
9087 for (var a = 0; a < t.length; a++) t[a].abort();
9088 e.log("Connecting to region", r.region);
9089 var o = e.seekServer(r.region);
9090 e.connect(o[0], o[1], o[2]);
9091 } else
9092 console.warn(
9093 "Error pinging " + r.ip + " in region " + n
9094 );
9095 };
9096 var a =
9097 "//" +
9098 e.serverAddress(r.ip, !0) +
9099 ":" +
9100 e.serverPort(r) +
9101 "/ping";
9102 s.open("GET", a, !0),
9103 s.send(null),
9104 e.log("Pinging", a),
9105 t.push(s);
9106 })(0, r)
9107 : console.log("No target server for region " + n);
9108 }
9109 }),
9110 (s.prototype.seekServer = function(e, t, n) {
9111 null == n && (n = "random"), null == t && (t = !1);
9112 const i = ["random"];
9113 var r = this.lobbySize,
9114 s = this.lobbySpread,
9115 a = this.servers[e]
9116 .flatMap(function(e) {
9117 var t = 0;
9118 return e.games.map(function(n) {
9119 var i = t++;
9120 return {
9121 region: e.region,
9122 index: e.index * e.games.length + i,
9123 gameIndex: i,
9124 gameCount: e.games.length,
9125 playerCount: n.playerCount,
9126 isPrivate: n.isPrivate
9127 };
9128 });
9129 })
9130 .filter(function(e) {
9131 return !e.isPrivate;
9132 })
9133 .filter(function(e) {
9134 return (
9135 !t || (0 == e.playerCount && e.gameIndex >= e.gameCount / 2)
9136 );
9137 })
9138 .filter(function(e) {
9139 return "random" == n || i[e.index % i.length].key == n;
9140 })
9141 .sort(function(e, t) {
9142 return t.playerCount - e.playerCount;
9143 })
9144 .filter(function(e) {
9145 return e.playerCount < r;
9146 });
9147 if ((t && a.reverse(), 0 != a.length)) {
9148 var o = Math.min(s, a.length),
9149 c = Math.floor(Math.random() * o),
9150 l = a[(c = Math.min(c, a.length - 1))],
9151 h = l.region,
9152 u =
9153 ((c = Math.floor(l.index / l.gameCount)), l.index % l.gameCount);
9154 return this.log("Found server."), [h, c, u];
9155 }
9156 this.errorCallback("No open servers.");
9157 }),
9158 (s.prototype.connect = function(e, t, n) {
9159 if (!this.connected) {
9160 var i = this.findServer(e, t);
9161 null != i
9162 ? (this.log("Connecting to server", i, "with game index", n),
9163 i.games[n].playerCount >= this.lobbySize
9164 ? this.errorCallback("Server is already full.")
9165 : (window.history.replaceState(
9166 document.title,
9167 document.title,
9168 this.generateHref(e, t, n, this.password)
9169 ),
9170 (this.server = i),
9171 (this.gameIndex = n),
9172 this.log(
9173 "Calling callback with address",
9174 this.serverAddress(i.ip),
9175 "on port",
9176 this.serverPort(i),
9177 "with game index",
9178 n
9179 ),
9180 this.callback(
9181 this.serverAddress(i.ip),
9182 this.serverPort(i),
9183 n
9184 )))
9185 : this.errorCallback(
9186 "Failed to find server for region " + e + " and index " + t
9187 );
9188 }
9189 }),
9190 (s.prototype.switchServer = function(e, t, n, i) {
9191 (this.switchingServers = !0),
9192 (window.location.href = this.generateHref(e, t, n, i));
9193 }),
9194 (s.prototype.generateHref = function(e, t, n, i) {
9195 var r = "/?server=" + (e = this.stripRegion(e)) + ":" + t + ":" + n;
9196 return i && (r += "&password=" + encodeURIComponent(i)), r;
9197 }),
9198 (s.prototype.serverAddress = function(e, t) {
9199 return "127.0.0.1" == e ||
9200 "7f000001" == e ||
9201 "903d62ef5d1c2fecdcaeb5e7dd485eff" == e
9202 ? window.location.hostname
9203 : this.rawIPs
9204 ? t
9205 ? "ip_" + this.hashIP(e) + "." + this.baseUrl
9206 : e
9207 : "ip_" + e + "." + this.baseUrl;
9208 }),
9209 (s.prototype.serverPort = function(e) {
9210 return 0 == e.region
9211 ? this.devPort
9212 : location.protocol.startsWith("https")
9213 ? 443
9214 : 80;
9215 }),
9216 (s.prototype.processServers = function(e) {
9217 for (var t = {}, n = 0; n < e.length; n++) {
9218 var i = e[n],
9219 r = t[i.region];
9220 null == r && ((r = []), (t[i.region] = r)), r.push(i);
9221 }
9222 for (var s in t)
9223 t[s] = t[s].sort(function(e, t) {
9224 return e.index - t.index;
9225 });
9226 this.servers = t;
9227 }),
9228 (s.prototype.ipToHex = function(e) {
9229 return e
9230 .split(".")
9231 .map(e => ("00" + parseInt(e).toString(16)).substr(-2))
9232 .join("")
9233 .toLowerCase();
9234 }),
9235 (s.prototype.hashIP = function(e) {
9236 return r(this.ipToHex(e));
9237 }),
9238 (s.prototype.log = function() {
9239 return this.debugLog
9240 ? console.log.apply(void 0, arguments)
9241 : console.verbose
9242 ? console.verbose.apply(void 0, arguments)
9243 : void 0;
9244 }),
9245 (s.prototype.stripRegion = function(e) {
9246 return (
9247 e.startsWith("vultr:")
9248 ? (e = e.slice(6))
9249 : e.startsWith("do:") && (e = e.slice(3)),
9250 e
9251 );
9252 }),
9253 (window.testVultrClient = function() {
9254 var e = 1;
9255
9256 function t(t, n) {
9257 (t = "" + t) == (n = "" + n)
9258 ? console.log(`Assert ${e} passed.`)
9259 : console.warn(`Assert ${e} failed. Expected ${n}, got ${t}.`),
9260 e++;
9261 }
9262 var n = new s("test.io", -1, 5, 1, !1);
9263 (n.errorCallback = function(e) {}),
9264 n.processServers(
9265 (function(e) {
9266 var t = [];
9267 for (var n in e)
9268 for (var i = e[n], r = 0; r < i.length; r++)
9269 t.push({
9270 ip: n + ":" + r,
9271 scheme: "testing",
9272 region: n,
9273 index: r,
9274 games: i[r].map(e => ({
9275 playerCount: e,
9276 isPrivate: !1
9277 }))
9278 });
9279 return t;
9280 })({
9281 1: [[0, 0, 0, 0], [0, 0, 0, 0]],
9282 2: [[5, 1, 0, 0], [0, 0, 0, 0]],
9283 3: [[5, 0, 1, 5], [0, 0, 0, 0]],
9284 4: [[5, 1, 1, 5], [1, 0, 0, 0]],
9285 5: [[5, 1, 1, 5], [1, 0, 4, 0]],
9286 6: [[5, 5, 5, 5], [2, 3, 1, 4]],
9287 7: [[5, 5, 5, 5], [5, 5, 5, 5]]
9288 })
9289 ),
9290 t(n.seekServer(1, !1), [1, 0, 0]),
9291 t(n.seekServer(1, !0), [1, 1, 3]),
9292 t(n.seekServer(2, !1), [2, 0, 1]),
9293 t(n.seekServer(2, !0), [2, 1, 3]),
9294 t(n.seekServer(3, !1), [3, 0, 2]),
9295 t(n.seekServer(3, !0), [3, 1, 3]),
9296 t(n.seekServer(4, !1), [4, 0, 1]),
9297 t(n.seekServer(4, !0), [4, 1, 3]),
9298 t(n.seekServer(5, !1), [5, 1, 2]),
9299 t(n.seekServer(5, !0), [5, 1, 3]),
9300 t(n.seekServer(6, !1), [6, 1, 3]),
9301 t(n.seekServer(6, !0), void 0),
9302 t(n.seekServer(7, !1), void 0),
9303 t(n.seekServer(7, !0), void 0),
9304 console.log("Tests passed.");
9305 });
9306 var a = function(e, t) {
9307 return e.concat(t);
9308 };
9309 (Array.prototype.flatMap = function(e) {
9310 return (function(e, t) {
9311 return t.map(e).reduce(a, []);
9312 })(e, this);
9313 }),
9314 (e.exports = s);
9315 },
9316 function(e, t, n) {
9317 "use strict";
9318 var i = n(61),
9319 r = n(63);
9320
9321 function s() {
9322 (this.protocol = null),
9323 (this.slashes = null),
9324 (this.auth = null),
9325 (this.host = null),
9326 (this.port = null),
9327 (this.hostname = null),
9328 (this.hash = null),
9329 (this.search = null),
9330 (this.query = null),
9331 (this.pathname = null),
9332 (this.path = null),
9333 (this.href = null);
9334 }
9335 (t.parse = v),
9336 (t.resolve = function(e, t) {
9337 return v(e, !1, !0).resolve(t);
9338 }),
9339 (t.resolveObject = function(e, t) {
9340 return e ? v(e, !1, !0).resolveObject(t) : t;
9341 }),
9342 (t.format = function(e) {
9343 return (
9344 r.isString(e) && (e = v(e)),
9345 e instanceof s ? e.format() : s.prototype.format.call(e)
9346 );
9347 }),
9348 (t.Url = s);
9349 var a = /^([a-z0-9.+-]+:)/i,
9350 o = /:[0-9]*$/,
9351 c = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
9352 l = ["{", "}", "|", "\\", "^", "`"].concat([
9353 "<",
9354 ">",
9355 '"',
9356 "`",
9357 " ",
9358 "\r",
9359 "\n",
9360 "\t"
9361 ]),
9362 h = ["'"].concat(l),
9363 u = ["%", "/", "?", ";", "#"].concat(h),
9364 f = ["/", "?", "#"],
9365 d = /^[+a-z0-9A-Z_-]{0,63}$/,
9366 p = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
9367 g = {
9368 javascript: !0,
9369 "javascript:": !0
9370 },
9371 m = {
9372 javascript: !0,
9373 "javascript:": !0
9374 },
9375 y = {
9376 http: !0,
9377 https: !0,
9378 ftp: !0,
9379 gopher: !0,
9380 file: !0,
9381 "http:": !0,
9382 "https:": !0,
9383 "ftp:": !0,
9384 "gopher:": !0,
9385 "file:": !0
9386 },
9387 k = n(64);
9388
9389 function v(e, t, n) {
9390 if (e && r.isObject(e) && e instanceof s) return e;
9391 var i = new s();
9392 return i.parse(e, t, n), i;
9393 }
9394 (s.prototype.parse = function(e, t, n) {
9395 if (!r.isString(e))
9396 throw new TypeError(
9397 "Parameter 'url' must be a string, not " + typeof e
9398 );
9399 var s = e.indexOf("?"),
9400 o = -1 !== s && s < e.indexOf("#") ? "?" : "#",
9401 l = e.split(o);
9402 l[0] = l[0].replace(/\\/g, "/");
9403 var v = (e = l.join(o));
9404 if (((v = v.trim()), !n && 1 === e.split("#").length)) {
9405 var w = c.exec(v);
9406 if (w)
9407 return (
9408 (this.path = v),
9409 (this.href = v),
9410 (this.pathname = w[1]),
9411 w[2]
9412 ? ((this.search = w[2]),
9413 (this.query = t
9414 ? k.parse(this.search.substr(1))
9415 : this.search.substr(1)))
9416 : t && ((this.search = ""), (this.query = {})),
9417 this
9418 );
9419 }
9420 var b = a.exec(v);
9421 if (b) {
9422 var x = (b = b[0]).toLowerCase();
9423 (this.protocol = x), (v = v.substr(b.length));
9424 }
9425 if (n || b || v.match(/^\/\/[^@\/]+@[^@\/]+/)) {
9426 var S = "//" === v.substr(0, 2);
9427 !S || (b && m[b]) || ((v = v.substr(2)), (this.slashes = !0));
9428 }
9429 if (!m[b] && (S || (b && !y[b]))) {
9430 for (var T, I, E = -1, M = 0; M < f.length; M++)
9431 -1 !== (A = v.indexOf(f[M])) && (-1 === E || A < E) && (E = A);
9432 for (
9433 -1 !== (I = -1 === E ? v.lastIndexOf("@") : v.lastIndexOf("@", E)) &&
9434 ((T = v.slice(0, I)),
9435 (v = v.slice(I + 1)),
9436 (this.auth = decodeURIComponent(T))),
9437 E = -1,
9438 M = 0;
9439 M < u.length;
9440 M++
9441 ) {
9442 var A;
9443 -1 !== (A = v.indexOf(u[M])) && (-1 === E || A < E) && (E = A);
9444 }
9445 -1 === E && (E = v.length),
9446 (this.host = v.slice(0, E)),
9447 (v = v.slice(E)),
9448 this.parseHost(),
9449 (this.hostname = this.hostname || "");
9450 var P =
9451 "[" === this.hostname[0] &&
9452 "]" === this.hostname[this.hostname.length - 1];
9453 if (!P)
9454 for (
9455 var B = this.hostname.split(/\./), C = ((M = 0), B.length);
9456 M < C;
9457 M++
9458 ) {
9459 var O = B[M];
9460 if (O && !O.match(d)) {
9461 for (var R = "", j = 0, _ = O.length; j < _; j++)
9462 O.charCodeAt(j) > 127 ? (R += "x") : (R += O[j]);
9463 if (!R.match(d)) {
9464 var U = B.slice(0, M),
9465 D = B.slice(M + 1),
9466 L = O.match(p);
9467 L && (U.push(L[1]), D.unshift(L[2])),
9468 D.length && (v = "/" + D.join(".") + v),
9469 (this.hostname = U.join("."));
9470 break;
9471 }
9472 }
9473 }
9474 this.hostname.length > 255
9475 ? (this.hostname = "")
9476 : (this.hostname = this.hostname.toLowerCase()),
9477 P || (this.hostname = i.toASCII(this.hostname));
9478 var F = this.port ? ":" + this.port : "",
9479 z = this.hostname || "";
9480 (this.host = z + F),
9481 (this.href += this.host),
9482 P &&
9483 ((this.hostname = this.hostname.substr(
9484 1,
9485 this.hostname.length - 2
9486 )),
9487 "/" !== v[0] && (v = "/" + v));
9488 }
9489 if (!g[x])
9490 for (M = 0, C = h.length; M < C; M++) {
9491 var H = h[M];
9492 if (-1 !== v.indexOf(H)) {
9493 var V = encodeURIComponent(H);
9494 V === H && (V = escape(H)), (v = v.split(H).join(V));
9495 }
9496 }
9497 var q = v.indexOf("#");
9498 -1 !== q && ((this.hash = v.substr(q)), (v = v.slice(0, q)));
9499 var Y = v.indexOf("?");
9500 if (
9501 (-1 !== Y
9502 ? ((this.search = v.substr(Y)),
9503 (this.query = v.substr(Y + 1)),
9504 t && (this.query = k.parse(this.query)),
9505 (v = v.slice(0, Y)))
9506 : t && ((this.search = ""), (this.query = {})),
9507 v && (this.pathname = v),
9508 y[x] && this.hostname && !this.pathname && (this.pathname = "/"),
9509 this.pathname || this.search)
9510 ) {
9511 F = this.pathname || "";
9512 var W = this.search || "";
9513 this.path = F + W;
9514 }
9515 return (this.href = this.format()), this;
9516 }),
9517 (s.prototype.format = function() {
9518 var e = this.auth || "";
9519 e &&
9520 ((e = (e = encodeURIComponent(e)).replace(/%3A/i, ":")), (e += "@"));
9521 var t = this.protocol || "",
9522 n = this.pathname || "",
9523 i = this.hash || "",
9524 s = !1,
9525 a = "";
9526 this.host
9527 ? (s = e + this.host)
9528 : this.hostname &&
9529 ((s =
9530 e +
9531 (-1 === this.hostname.indexOf(":")
9532 ? this.hostname
9533 : "[" + this.hostname + "]")),
9534 this.port && (s += ":" + this.port)),
9535 this.query &&
9536 r.isObject(this.query) &&
9537 Object.keys(this.query).length &&
9538 (a = k.stringify(this.query));
9539 var o = this.search || (a && "?" + a) || "";
9540 return (
9541 t && ":" !== t.substr(-1) && (t += ":"),
9542 this.slashes || ((!t || y[t]) && !1 !== s)
9543 ? ((s = "//" + (s || "")),
9544 n && "/" !== n.charAt(0) && (n = "/" + n))
9545 : s || (s = ""),
9546 i && "#" !== i.charAt(0) && (i = "#" + i),
9547 o && "?" !== o.charAt(0) && (o = "?" + o),
9548 t +
9549 s +
9550 (n = n.replace(/[?#]/g, function(e) {
9551 return encodeURIComponent(e);
9552 })) +
9553 (o = o.replace("#", "%23")) +
9554 i
9555 );
9556 }),
9557 (s.prototype.resolve = function(e) {
9558 return this.resolveObject(v(e, !1, !0)).format();
9559 }),
9560 (s.prototype.resolveObject = function(e) {
9561 if (r.isString(e)) {
9562 var t = new s();
9563 t.parse(e, !1, !0), (e = t);
9564 }
9565 for (var n = new s(), i = Object.keys(this), a = 0; a < i.length; a++) {
9566 var o = i[a];
9567 n[o] = this[o];
9568 }
9569 if (((n.hash = e.hash), "" === e.href)) return (n.href = n.format()), n;
9570 if (e.slashes && !e.protocol) {
9571 for (var c = Object.keys(e), l = 0; l < c.length; l++) {
9572 var h = c[l];
9573 "protocol" !== h && (n[h] = e[h]);
9574 }
9575 return (
9576 y[n.protocol] &&
9577 n.hostname &&
9578 !n.pathname &&
9579 (n.path = n.pathname = "/"),
9580 (n.href = n.format()),
9581 n
9582 );
9583 }
9584 if (e.protocol && e.protocol !== n.protocol) {
9585 if (!y[e.protocol]) {
9586 for (var u = Object.keys(e), f = 0; f < u.length; f++) {
9587 var d = u[f];
9588 n[d] = e[d];
9589 }
9590 return (n.href = n.format()), n;
9591 }
9592 if (((n.protocol = e.protocol), e.host || m[e.protocol]))
9593 n.pathname = e.pathname;
9594 else {
9595 for (
9596 var p = (e.pathname || "").split("/");
9597 p.length && !(e.host = p.shift());
9598
9599 );
9600 e.host || (e.host = ""),
9601 e.hostname || (e.hostname = ""),
9602 "" !== p[0] && p.unshift(""),
9603 p.length < 2 && p.unshift(""),
9604 (n.pathname = p.join("/"));
9605 }
9606 if (
9607 ((n.search = e.search),
9608 (n.query = e.query),
9609 (n.host = e.host || ""),
9610 (n.auth = e.auth),
9611 (n.hostname = e.hostname || e.host),
9612 (n.port = e.port),
9613 n.pathname || n.search)
9614 ) {
9615 var g = n.pathname || "",
9616 k = n.search || "";
9617 n.path = g + k;
9618 }
9619 return (n.slashes = n.slashes || e.slashes), (n.href = n.format()), n;
9620 }
9621 var v = n.pathname && "/" === n.pathname.charAt(0),
9622 w = e.host || (e.pathname && "/" === e.pathname.charAt(0)),
9623 b = w || v || (n.host && e.pathname),
9624 x = b,
9625 S = (n.pathname && n.pathname.split("/")) || [],
9626 T =
9627 ((p = (e.pathname && e.pathname.split("/")) || []),
9628 n.protocol && !y[n.protocol]);
9629 if (
9630 (T &&
9631 ((n.hostname = ""),
9632 (n.port = null),
9633 n.host && ("" === S[0] ? (S[0] = n.host) : S.unshift(n.host)),
9634 (n.host = ""),
9635 e.protocol &&
9636 ((e.hostname = null),
9637 (e.port = null),
9638 e.host && ("" === p[0] ? (p[0] = e.host) : p.unshift(e.host)),
9639 (e.host = null)),
9640 (b = b && ("" === p[0] || "" === S[0]))),
9641 w)
9642 )
9643 (n.host = e.host || "" === e.host ? e.host : n.host),
9644 (n.hostname =
9645 e.hostname || "" === e.hostname ? e.hostname : n.hostname),
9646 (n.search = e.search),
9647 (n.query = e.query),
9648 (S = p);
9649 else if (p.length)
9650 S || (S = []),
9651 S.pop(),
9652 (S = S.concat(p)),
9653 (n.search = e.search),
9654 (n.query = e.query);
9655 else if (!r.isNullOrUndefined(e.search))
9656 return (
9657 T &&
9658 ((n.hostname = n.host = S.shift()),
9659 (P =
9660 !!(n.host && n.host.indexOf("@") > 0) && n.host.split("@")) &&
9661 ((n.auth = P.shift()), (n.host = n.hostname = P.shift()))),
9662 (n.search = e.search),
9663 (n.query = e.query),
9664 (r.isNull(n.pathname) && r.isNull(n.search)) ||
9665 (n.path =
9666 (n.pathname ? n.pathname : "") + (n.search ? n.search : "")),
9667 (n.href = n.format()),
9668 n
9669 );
9670 if (!S.length)
9671 return (
9672 (n.pathname = null),
9673 n.search ? (n.path = "/" + n.search) : (n.path = null),
9674 (n.href = n.format()),
9675 n
9676 );
9677 for (
9678 var I = S.slice(-1)[0],
9679 E =
9680 ((n.host || e.host || S.length > 1) &&
9681 ("." === I || ".." === I)) ||
9682 "" === I,
9683 M = 0,
9684 A = S.length;
9685 A >= 0;
9686 A--
9687 )
9688 "." === (I = S[A])
9689 ? S.splice(A, 1)
9690 : ".." === I
9691 ? (S.splice(A, 1), M++)
9692 : M && (S.splice(A, 1), M--);
9693 if (!b && !x) for (; M--; M) S.unshift("..");
9694 !b || "" === S[0] || (S[0] && "/" === S[0].charAt(0)) || S.unshift(""),
9695 E && "/" !== S.join("/").substr(-1) && S.push("");
9696 var P,
9697 B = "" === S[0] || (S[0] && "/" === S[0].charAt(0));
9698 return (
9699 T &&
9700 ((n.hostname = n.host = B ? "" : S.length ? S.shift() : ""),
9701 (P = !!(n.host && n.host.indexOf("@") > 0) && n.host.split("@")) &&
9702 ((n.auth = P.shift()), (n.host = n.hostname = P.shift()))),
9703 (b = b || (n.host && S.length)) && !B && S.unshift(""),
9704 S.length
9705 ? (n.pathname = S.join("/"))
9706 : ((n.pathname = null), (n.path = null)),
9707 (r.isNull(n.pathname) && r.isNull(n.search)) ||
9708 (n.path =
9709 (n.pathname ? n.pathname : "") + (n.search ? n.search : "")),
9710 (n.auth = e.auth || n.auth),
9711 (n.slashes = n.slashes || e.slashes),
9712 (n.href = n.format()),
9713 n
9714 );
9715 }),
9716 (s.prototype.parseHost = function() {
9717 var e = this.host,
9718 t = o.exec(e);
9719 t &&
9720 (":" !== (t = t[0]) && (this.port = t.substr(1)),
9721 (e = e.substr(0, e.length - t.length))),
9722 e && (this.hostname = e);
9723 });
9724 },
9725 function(e, t, n) {
9726 (function(e, i) {
9727 var r; /*! https://mths.be/punycode v1.4.1 by @mathias */
9728 !(function(s) {
9729 t && t.nodeType, e && e.nodeType;
9730 var a = "object" == typeof i && i;
9731 a.global !== a && a.window !== a && a.self;
9732 var o,
9733 c = 2147483647,
9734 l = 36,
9735 h = /^xn--/,
9736 u = /[^\x20-\x7E]/,
9737 f = /[\x2E\u3002\uFF0E\uFF61]/g,
9738 d = {
9739 overflow: "Overflow: input needs wider integers to process",
9740 "not-basic": "Illegal input >= 0x80 (not a basic code point)",
9741 "invalid-input": "Invalid input"
9742 },
9743 p = Math.floor,
9744 g = String.fromCharCode;
9745
9746 function m(e) {
9747 throw new RangeError(d[e]);
9748 }
9749
9750 function y(e, t) {
9751 for (var n = e.length, i = []; n--; ) i[n] = t(e[n]);
9752 return i;
9753 }
9754
9755 function k(e, t) {
9756 var n = e.split("@"),
9757 i = "";
9758 return (
9759 n.length > 1 && ((i = n[0] + "@"), (e = n[1])),
9760 i + y((e = e.replace(f, ".")).split("."), t).join(".")
9761 );
9762 }
9763
9764 function v(e) {
9765 for (var t, n, i = [], r = 0, s = e.length; r < s; )
9766 (t = e.charCodeAt(r++)) >= 55296 && t <= 56319 && r < s
9767 ? 56320 == (64512 & (n = e.charCodeAt(r++)))
9768 ? i.push(((1023 & t) << 10) + (1023 & n) + 65536)
9769 : (i.push(t), r--)
9770 : i.push(t);
9771 return i;
9772 }
9773
9774 function w(e) {
9775 return y(e, function(e) {
9776 var t = "";
9777 return (
9778 e > 65535 &&
9779 ((t += g((((e -= 65536) >>> 10) & 1023) | 55296)),
9780 (e = 56320 | (1023 & e))),
9781 t + g(e)
9782 );
9783 }).join("");
9784 }
9785
9786 function b(e) {
9787 return e - 48 < 10
9788 ? e - 22
9789 : e - 65 < 26
9790 ? e - 65
9791 : e - 97 < 26
9792 ? e - 97
9793 : l;
9794 }
9795
9796 function x(e, t) {
9797 return e + 22 + 75 * (e < 26) - ((0 != t) << 5);
9798 }
9799
9800 function S(e, t, n) {
9801 var i = 0;
9802 for (e = n ? p(e / 700) : e >> 1, e += p(e / t); e > 455; i += l)
9803 e = p(e / 35);
9804 return p(i + (36 * e) / (e + 38));
9805 }
9806
9807 function T(e) {
9808 var t,
9809 n,
9810 i,
9811 r,
9812 s,
9813 a,
9814 o,
9815 h,
9816 u,
9817 f,
9818 d = [],
9819 g = e.length,
9820 y = 0,
9821 k = 128,
9822 v = 72;
9823 for ((n = e.lastIndexOf("-")) < 0 && (n = 0), i = 0; i < n; ++i)
9824 e.charCodeAt(i) >= 128 && m("not-basic"), d.push(e.charCodeAt(i));
9825 for (r = n > 0 ? n + 1 : 0; r < g; ) {
9826 for (
9827 s = y, a = 1, o = l;
9828 r >= g && m("invalid-input"),
9829 ((h = b(e.charCodeAt(r++))) >= l || h > p((c - y) / a)) &&
9830 m("overflow"),
9831 (y += h * a),
9832 !(h < (u = o <= v ? 1 : o >= v + 26 ? 26 : o - v));
9833 o += l
9834 )
9835 a > p(c / (f = l - u)) && m("overflow"), (a *= f);
9836 (v = S(y - s, (t = d.length + 1), 0 == s)),
9837 p(y / t) > c - k && m("overflow"),
9838 (k += p(y / t)),
9839 (y %= t),
9840 d.splice(y++, 0, k);
9841 }
9842 return w(d);
9843 }
9844
9845 function I(e) {
9846 var t,
9847 n,
9848 i,
9849 r,
9850 s,
9851 a,
9852 o,
9853 h,
9854 u,
9855 f,
9856 d,
9857 y,
9858 k,
9859 w,
9860 b,
9861 T = [];
9862 for (y = (e = v(e)).length, t = 128, n = 0, s = 72, a = 0; a < y; ++a)
9863 (d = e[a]) < 128 && T.push(g(d));
9864 for (i = r = T.length, r && T.push("-"); i < y; ) {
9865 for (o = c, a = 0; a < y; ++a) (d = e[a]) >= t && d < o && (o = d);
9866 for (
9867 o - t > p((c - n) / (k = i + 1)) && m("overflow"),
9868 n += (o - t) * k,
9869 t = o,
9870 a = 0;
9871 a < y;
9872 ++a
9873 )
9874 if (((d = e[a]) < t && ++n > c && m("overflow"), d == t)) {
9875 for (
9876 h = n, u = l;
9877 !(h < (f = u <= s ? 1 : u >= s + 26 ? 26 : u - s));
9878 u += l
9879 )
9880 (b = h - f),
9881 (w = l - f),
9882 T.push(g(x(f + (b % w), 0))),
9883 (h = p(b / w));
9884 T.push(g(x(h, 0))), (s = S(n, k, i == r)), (n = 0), ++i;
9885 }
9886 ++n, ++t;
9887 }
9888 return T.join("");
9889 }
9890 (o = {
9891 version: "1.4.1",
9892 ucs2: {
9893 decode: v,
9894 encode: w
9895 },
9896 decode: T,
9897 encode: I,
9898 toASCII: function(e) {
9899 return k(e, function(e) {
9900 return u.test(e) ? "xn--" + I(e) : e;
9901 });
9902 },
9903 toUnicode: function(e) {
9904 return k(e, function(e) {
9905 return h.test(e) ? T(e.slice(4).toLowerCase()) : e;
9906 });
9907 }
9908 }),
9909 void 0 ===
9910 (r = function() {
9911 return o;
9912 }.call(t, n, t, e)) || (e.exports = r);
9913 })();
9914 }.call(this, n(62)(e), n(12)));
9915 },
9916 function(e, t) {
9917 e.exports = function(e) {
9918 return (
9919 e.webpackPolyfill ||
9920 ((e.deprecate = function() {}),
9921 (e.paths = []),
9922 e.children || (e.children = []),
9923 Object.defineProperty(e, "loaded", {
9924 enumerable: !0,
9925 get: function() {
9926 return e.l;
9927 }
9928 }),
9929 Object.defineProperty(e, "id", {
9930 enumerable: !0,
9931 get: function() {
9932 return e.i;
9933 }
9934 }),
9935 (e.webpackPolyfill = 1)),
9936 e
9937 );
9938 };
9939 },
9940 function(e, t, n) {
9941 "use strict";
9942 e.exports = {
9943 isString: function(e) {
9944 return "string" == typeof e;
9945 },
9946 isObject: function(e) {
9947 return "object" == typeof e && null !== e;
9948 },
9949 isNull: function(e) {
9950 return null === e;
9951 },
9952 isNullOrUndefined: function(e) {
9953 return null == e;
9954 }
9955 };
9956 },
9957 function(e, t, n) {
9958 "use strict";
9959 (t.decode = t.parse = n(65)), (t.encode = t.stringify = n(66));
9960 },
9961 function(e, t, n) {
9962 "use strict";
9963
9964 function i(e, t) {
9965 return Object.prototype.hasOwnProperty.call(e, t);
9966 }
9967 e.exports = function(e, t, n, s) {
9968 (t = t || "&"), (n = n || "=");
9969 var a = {};
9970 if ("string" != typeof e || 0 === e.length) return a;
9971 var o = /\+/g;
9972 e = e.split(t);
9973 var c = 1e3;
9974 s && "number" == typeof s.maxKeys && (c = s.maxKeys);
9975 var l = e.length;
9976 c > 0 && l > c && (l = c);
9977 for (var h = 0; h < l; ++h) {
9978 var u,
9979 f,
9980 d,
9981 p,
9982 g = e[h].replace(o, "%20"),
9983 m = g.indexOf(n);
9984 m >= 0
9985 ? ((u = g.substr(0, m)), (f = g.substr(m + 1)))
9986 : ((u = g), (f = "")),
9987 (d = decodeURIComponent(u)),
9988 (p = decodeURIComponent(f)),
9989 i(a, d) ? (r(a[d]) ? a[d].push(p) : (a[d] = [a[d], p])) : (a[d] = p);
9990 }
9991 return a;
9992 };
9993 var r =
9994 Array.isArray ||
9995 function(e) {
9996 return "[object Array]" === Object.prototype.toString.call(e);
9997 };
9998 },
9999 function(e, t, n) {
10000 "use strict";
10001 var i = function(e) {
10002 switch (typeof e) {
10003 case "string":
10004 return e;
10005 case "boolean":
10006 return e ? "true" : "false";
10007 case "number":
10008 return isFinite(e) ? e : "";
10009 default:
10010 return "";
10011 }
10012 };
10013 e.exports = function(e, t, n, o) {
10014 return (
10015 (t = t || "&"),
10016 (n = n || "="),
10017 null === e && (e = void 0),
10018 "object" == typeof e
10019 ? s(a(e), function(a) {
10020 var o = encodeURIComponent(i(a)) + n;
10021 return r(e[a])
10022 ? s(e[a], function(e) {
10023 return o + encodeURIComponent(i(e));
10024 }).join(t)
10025 : o + encodeURIComponent(i(e[a]));
10026 }).join(t)
10027 : o
10028 ? encodeURIComponent(i(o)) + n + encodeURIComponent(i(e))
10029 : ""
10030 );
10031 };
10032 var r =
10033 Array.isArray ||
10034 function(e) {
10035 return "[object Array]" === Object.prototype.toString.call(e);
10036 };
10037
10038 function s(e, t) {
10039 if (e.map) return e.map(t);
10040 for (var n = [], i = 0; i < e.length; i++) n.push(t(e[i], i));
10041 return n;
10042 }
10043 var a =
10044 Object.keys ||
10045 function(e) {
10046 var t = [];
10047 for (var n in e)
10048 Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
10049 return t;
10050 };
10051 },
10052 function(e, t, n) {
10053 !(function() {
10054 var t = n(68),
10055 i = n(20).utf8,
10056 r = n(69),
10057 s = n(20).bin,
10058 a = function(e, n) {
10059 e.constructor == String
10060 ? (e =
10061 n && "binary" === n.encoding
10062 ? s.stringToBytes(e)
10063 : i.stringToBytes(e))
10064 : r(e)
10065 ? (e = Array.prototype.slice.call(e, 0))
10066 : Array.isArray(e) || (e = e.toString());
10067 for (
10068 var o = t.bytesToWords(e),
10069 c = 8 * e.length,
10070 l = 1732584193,
10071 h = -271733879,
10072 u = -1732584194,
10073 f = 271733878,
10074 d = 0;
10075 d < o.length;
10076 d++
10077 )
10078 o[d] =
10079 (16711935 & ((o[d] << 8) | (o[d] >>> 24))) |
10080 (4278255360 & ((o[d] << 24) | (o[d] >>> 8)));
10081 (o[c >>> 5] |= 128 << c % 32), (o[14 + (((c + 64) >>> 9) << 4)] = c);
10082 var p = a._ff,
10083 g = a._gg,
10084 m = a._hh,
10085 y = a._ii;
10086 for (d = 0; d < o.length; d += 16) {
10087 var k = l,
10088 v = h,
10089 w = u,
10090 b = f;
10091 (h = y(
10092 (h = y(
10093 (h = y(
10094 (h = y(
10095 (h = m(
10096 (h = m(
10097 (h = m(
10098 (h = m(
10099 (h = g(
10100 (h = g(
10101 (h = g(
10102 (h = g(
10103 (h = p(
10104 (h = p(
10105 (h = p(
10106 (h = p(
10107 h,
10108 (u = p(
10109 u,
10110 (f = p(
10111 f,
10112 (l = p(
10113 l,
10114 h,
10115 u,
10116 f,
10117 o[d + 0],
10118 7,
10119 -680876936
10120 )),
10121 h,
10122 u,
10123 o[d + 1],
10124 12,
10125 -389564586
10126 )),
10127 l,
10128 h,
10129 o[d + 2],
10130 17,
10131 606105819
10132 )),
10133 f,
10134 l,
10135 o[d + 3],
10136 22,
10137 -1044525330
10138 )),
10139 (u = p(
10140 u,
10141 (f = p(
10142 f,
10143 (l = p(
10144 l,
10145 h,
10146 u,
10147 f,
10148 o[d + 4],
10149 7,
10150 -176418897
10151 )),
10152 h,
10153 u,
10154 o[d + 5],
10155 12,
10156 1200080426
10157 )),
10158 l,
10159 h,
10160 o[d + 6],
10161 17,
10162 -1473231341
10163 )),
10164 f,
10165 l,
10166 o[d + 7],
10167 22,
10168 -45705983
10169 )),
10170 (u = p(
10171 u,
10172 (f = p(
10173 f,
10174 (l = p(
10175 l,
10176 h,
10177 u,
10178 f,
10179 o[d + 8],
10180 7,
10181 1770035416
10182 )),
10183 h,
10184 u,
10185 o[d + 9],
10186 12,
10187 -1958414417
10188 )),
10189 l,
10190 h,
10191 o[d + 10],
10192 17,
10193 -42063
10194 )),
10195 f,
10196 l,
10197 o[d + 11],
10198 22,
10199 -1990404162
10200 )),
10201 (u = p(
10202 u,
10203 (f = p(
10204 f,
10205 (l = p(
10206 l,
10207 h,
10208 u,
10209 f,
10210 o[d + 12],
10211 7,
10212 1804603682
10213 )),
10214 h,
10215 u,
10216 o[d + 13],
10217 12,
10218 -40341101
10219 )),
10220 l,
10221 h,
10222 o[d + 14],
10223 17,
10224 -1502002290
10225 )),
10226 f,
10227 l,
10228 o[d + 15],
10229 22,
10230 1236535329
10231 )),
10232 (u = g(
10233 u,
10234 (f = g(
10235 f,
10236 (l = g(
10237 l,
10238 h,
10239 u,
10240 f,
10241 o[d + 1],
10242 5,
10243 -165796510
10244 )),
10245 h,
10246 u,
10247 o[d + 6],
10248 9,
10249 -1069501632
10250 )),
10251 l,
10252 h,
10253 o[d + 11],
10254 14,
10255 643717713
10256 )),
10257 f,
10258 l,
10259 o[d + 0],
10260 20,
10261 -373897302
10262 )),
10263 (u = g(
10264 u,
10265 (f = g(
10266 f,
10267 (l = g(
10268 l,
10269 h,
10270 u,
10271 f,
10272 o[d + 5],
10273 5,
10274 -701558691
10275 )),
10276 h,
10277 u,
10278 o[d + 10],
10279 9,
10280 38016083
10281 )),
10282 l,
10283 h,
10284 o[d + 15],
10285 14,
10286 -660478335
10287 )),
10288 f,
10289 l,
10290 o[d + 4],
10291 20,
10292 -405537848
10293 )),
10294 (u = g(
10295 u,
10296 (f = g(
10297 f,
10298 (l = g(l, h, u, f, o[d + 9], 5, 568446438)),
10299 h,
10300 u,
10301 o[d + 14],
10302 9,
10303 -1019803690
10304 )),
10305 l,
10306 h,
10307 o[d + 3],
10308 14,
10309 -187363961
10310 )),
10311 f,
10312 l,
10313 o[d + 8],
10314 20,
10315 1163531501
10316 )),
10317 (u = g(
10318 u,
10319 (f = g(
10320 f,
10321 (l = g(
10322 l,
10323 h,
10324 u,
10325 f,
10326 o[d + 13],
10327 5,
10328 -1444681467
10329 )),
10330 h,
10331 u,
10332 o[d + 2],
10333 9,
10334 -51403784
10335 )),
10336 l,
10337 h,
10338 o[d + 7],
10339 14,
10340 1735328473
10341 )),
10342 f,
10343 l,
10344 o[d + 12],
10345 20,
10346 -1926607734
10347 )),
10348 (u = m(
10349 u,
10350 (f = m(
10351 f,
10352 (l = m(l, h, u, f, o[d + 5], 4, -378558)),
10353 h,
10354 u,
10355 o[d + 8],
10356 11,
10357 -2022574463
10358 )),
10359 l,
10360 h,
10361 o[d + 11],
10362 16,
10363 1839030562
10364 )),
10365 f,
10366 l,
10367 o[d + 14],
10368 23,
10369 -35309556
10370 )),
10371 (u = m(
10372 u,
10373 (f = m(
10374 f,
10375 (l = m(l, h, u, f, o[d + 1], 4, -1530992060)),
10376 h,
10377 u,
10378 o[d + 4],
10379 11,
10380 1272893353
10381 )),
10382 l,
10383 h,
10384 o[d + 7],
10385 16,
10386 -155497632
10387 )),
10388 f,
10389 l,
10390 o[d + 10],
10391 23,
10392 -1094730640
10393 )),
10394 (u = m(
10395 u,
10396 (f = m(
10397 f,
10398 (l = m(l, h, u, f, o[d + 13], 4, 681279174)),
10399 h,
10400 u,
10401 o[d + 0],
10402 11,
10403 -358537222
10404 )),
10405 l,
10406 h,
10407 o[d + 3],
10408 16,
10409 -722521979
10410 )),
10411 f,
10412 l,
10413 o[d + 6],
10414 23,
10415 76029189
10416 )),
10417 (u = m(
10418 u,
10419 (f = m(
10420 f,
10421 (l = m(l, h, u, f, o[d + 9], 4, -640364487)),
10422 h,
10423 u,
10424 o[d + 12],
10425 11,
10426 -421815835
10427 )),
10428 l,
10429 h,
10430 o[d + 15],
10431 16,
10432 530742520
10433 )),
10434 f,
10435 l,
10436 o[d + 2],
10437 23,
10438 -995338651
10439 )),
10440 (u = y(
10441 u,
10442 (f = y(
10443 f,
10444 (l = y(l, h, u, f, o[d + 0], 6, -198630844)),
10445 h,
10446 u,
10447 o[d + 7],
10448 10,
10449 1126891415
10450 )),
10451 l,
10452 h,
10453 o[d + 14],
10454 15,
10455 -1416354905
10456 )),
10457 f,
10458 l,
10459 o[d + 5],
10460 21,
10461 -57434055
10462 )),
10463 (u = y(
10464 u,
10465 (f = y(
10466 f,
10467 (l = y(l, h, u, f, o[d + 12], 6, 1700485571)),
10468 h,
10469 u,
10470 o[d + 3],
10471 10,
10472 -1894986606
10473 )),
10474 l,
10475 h,
10476 o[d + 10],
10477 15,
10478 -1051523
10479 )),
10480 f,
10481 l,
10482 o[d + 1],
10483 21,
10484 -2054922799
10485 )),
10486 (u = y(
10487 u,
10488 (f = y(
10489 f,
10490 (l = y(l, h, u, f, o[d + 8], 6, 1873313359)),
10491 h,
10492 u,
10493 o[d + 15],
10494 10,
10495 -30611744
10496 )),
10497 l,
10498 h,
10499 o[d + 6],
10500 15,
10501 -1560198380
10502 )),
10503 f,
10504 l,
10505 o[d + 13],
10506 21,
10507 1309151649
10508 )),
10509 (u = y(
10510 u,
10511 (f = y(
10512 f,
10513 (l = y(l, h, u, f, o[d + 4], 6, -145523070)),
10514 h,
10515 u,
10516 o[d + 11],
10517 10,
10518 -1120210379
10519 )),
10520 l,
10521 h,
10522 o[d + 2],
10523 15,
10524 718787259
10525 )),
10526 f,
10527 l,
10528 o[d + 9],
10529 21,
10530 -343485551
10531 )),
10532 (l = (l + k) >>> 0),
10533 (h = (h + v) >>> 0),
10534 (u = (u + w) >>> 0),
10535 (f = (f + b) >>> 0);
10536 }
10537 return t.endian([l, h, u, f]);
10538 };
10539 (a._ff = function(e, t, n, i, r, s, a) {
10540 var o = e + ((t & n) | (~t & i)) + (r >>> 0) + a;
10541 return ((o << s) | (o >>> (32 - s))) + t;
10542 }),
10543 (a._gg = function(e, t, n, i, r, s, a) {
10544 var o = e + ((t & i) | (n & ~i)) + (r >>> 0) + a;
10545 return ((o << s) | (o >>> (32 - s))) + t;
10546 }),
10547 (a._hh = function(e, t, n, i, r, s, a) {
10548 var o = e + (t ^ n ^ i) + (r >>> 0) + a;
10549 return ((o << s) | (o >>> (32 - s))) + t;
10550 }),
10551 (a._ii = function(e, t, n, i, r, s, a) {
10552 var o = e + (n ^ (t | ~i)) + (r >>> 0) + a;
10553 return ((o << s) | (o >>> (32 - s))) + t;
10554 }),
10555 (a._blocksize = 16),
10556 (a._digestsize = 16),
10557 (e.exports = function(e, n) {
10558 if (null == e) throw new Error("Illegal argument " + e);
10559 var i = t.wordsToBytes(a(e, n));
10560 return n && n.asBytes
10561 ? i
10562 : n && n.asString
10563 ? s.bytesToString(i)
10564 : t.bytesToHex(i);
10565 });
10566 })();
10567 },
10568 function(e, t) {
10569 !(function() {
10570 var t =
10571 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
10572 n = {
10573 rotl: function(e, t) {
10574 return (e << t) | (e >>> (32 - t));
10575 },
10576 rotr: function(e, t) {
10577 return (e << (32 - t)) | (e >>> t);
10578 },
10579 endian: function(e) {
10580 if (e.constructor == Number)
10581 return (16711935 & n.rotl(e, 8)) | (4278255360 & n.rotl(e, 24));
10582 for (var t = 0; t < e.length; t++) e[t] = n.endian(e[t]);
10583 return e;
10584 },
10585 randomBytes: function(e) {
10586 for (var t = []; e > 0; e--)
10587 t.push(Math.floor(256 * Math.random()));
10588 return t;
10589 },
10590 bytesToWords: function(e) {
10591 for (var t = [], n = 0, i = 0; n < e.length; n++, i += 8)
10592 t[i >>> 5] |= e[n] << (24 - (i % 32));
10593 return t;
10594 },
10595 wordsToBytes: function(e) {
10596 for (var t = [], n = 0; n < 32 * e.length; n += 8)
10597 t.push((e[n >>> 5] >>> (24 - (n % 32))) & 255);
10598 return t;
10599 },
10600 bytesToHex: function(e) {
10601 for (var t = [], n = 0; n < e.length; n++)
10602 t.push((e[n] >>> 4).toString(16)),
10603 t.push((15 & e[n]).toString(16));
10604 return t.join("");
10605 },
10606 hexToBytes: function(e) {
10607 for (var t = [], n = 0; n < e.length; n += 2)
10608 t.push(parseInt(e.substr(n, 2), 16));
10609 return t;
10610 },
10611 bytesToBase64: function(e) {
10612 for (var n = [], i = 0; i < e.length; i += 3)
10613 for (
10614 var r = (e[i] << 16) | (e[i + 1] << 8) | e[i + 2], s = 0;
10615 s < 4;
10616 s++
10617 )
10618 8 * i + 6 * s <= 8 * e.length
10619 ? n.push(t.charAt((r >>> (6 * (3 - s))) & 63))
10620 : n.push("=");
10621 return n.join("");
10622 },
10623 base64ToBytes: function(e) {
10624 e = e.replace(/[^A-Z0-9+\/]/gi, "");
10625 for (var n = [], i = 0, r = 0; i < e.length; r = ++i % 4)
10626 0 != r &&
10627 n.push(
10628 ((t.indexOf(e.charAt(i - 1)) &
10629 (Math.pow(2, -2 * r + 8) - 1)) <<
10630 (2 * r)) |
10631 (t.indexOf(e.charAt(i)) >>> (6 - 2 * r))
10632 );
10633 return n;
10634 }
10635 };
10636 e.exports = n;
10637 })();
10638 },
10639 function(e, t) {
10640 function n(e) {
10641 return (
10642 !!e.constructor &&
10643 "function" == typeof e.constructor.isBuffer &&
10644 e.constructor.isBuffer(e)
10645 );
10646 }
10647 /*!
10648 * Determine if an object is a Buffer
10649 *
10650 * @author Feross Aboukhadijeh <https://feross.org>
10651 * @license MIT
10652 */
10653 e.exports = function(e) {
10654 return (
10655 null != e &&
10656 (n(e) ||
10657 (function(e) {
10658 return (
10659 "function" == typeof e.readFloatLE &&
10660 "function" == typeof e.slice &&
10661 n(e.slice(0, 0))
10662 );
10663 })(e) ||
10664 !!e._isBuffer)
10665 );
10666 };
10667 },
10668 function(e, t) {
10669 e.exports = function(e, t, n, i, r, s, a, o, c) {
10670 (this.aiTypes = [
10671 {
10672 id: 0,
10673 src: "cow_1",
10674 killScore: 150,
10675 health: 500,
10676 weightM: 0.8,
10677 speed: 95e-5,
10678 turnSpeed: 0.001,
10679 scale: 72,
10680 drop: ["food", 50]
10681 },
10682 {
10683 id: 1,
10684 src: "pig_1",
10685 killScore: 200,
10686 health: 800,
10687 weightM: 0.6,
10688 speed: 85e-5,
10689 turnSpeed: 0.001,
10690 scale: 72,
10691 drop: ["food", 80]
10692 },
10693 {
10694 id: 2,
10695 name: "Bull",
10696 src: "bull_2",
10697 hostile: !0,
10698 dmg: 20,
10699 killScore: 1e3,
10700 health: 1800,
10701 weightM: 0.5,
10702 speed: 94e-5,
10703 turnSpeed: 74e-5,
10704 scale: 78,
10705 viewRange: 800,
10706 chargePlayer: !0,
10707 drop: ["food", 100]
10708 },
10709 {
10710 id: 3,
10711 name: "Bully",
10712 src: "bull_1",
10713 hostile: !0,
10714 dmg: 20,
10715 killScore: 2e3,
10716 health: 2800,
10717 weightM: 0.45,
10718 speed: 0.001,
10719 turnSpeed: 8e-4,
10720 scale: 90,
10721 viewRange: 900,
10722 chargePlayer: !0,
10723 drop: ["food", 400]
10724 },
10725 {
10726 id: 4,
10727 name: "Wolf",
10728 src: "wolf_1",
10729 hostile: !0,
10730 dmg: 8,
10731 killScore: 500,
10732 health: 300,
10733 weightM: 0.45,
10734 speed: 0.001,
10735 turnSpeed: 0.002,
10736 scale: 84,
10737 viewRange: 800,
10738 chargePlayer: !0,
10739 drop: ["food", 200]
10740 },
10741 {
10742 id: 5,
10743 name: "GOLD GIFT [Quack]",
10744 src: "chicken_1",
10745 dmg: 8,
10746 killScore: 2e3,
10747 noTrap: !0,
10748 health: 300,
10749 weightM: 0.2,
10750 speed: 0.0018,
10751 turnSpeed: 0.006,
10752 scale: 70,
10753 drop: ["food", 100]
10754 },
10755 {
10756 id: 6,
10757 name: " Moostafa",
10758 nameScale: 50,
10759 src: "enemy",
10760 hostile: !0,
10761 dontRun: !0,
10762 fixedSpawn: !0,
10763 spawnDelay: 6e4,
10764 noTrap: !0,
10765 colDmg: 100,
10766 dmg: 40,
10767 killScore: 8e3,
10768 health: 18e3,
10769 weightM: 0.4,
10770 speed: 7e-4,
10771 turnSpeed: 0.01,
10772 scale: 80,
10773 spriteMlt: 1.8,
10774 leapForce: 0.9,
10775 viewRange: 1e3,
10776 hitRange: 210,
10777 hitDelay: 1e3,
10778 chargePlayer: !0,
10779 drop: ["food", 100]
10780 },
10781 {
10782 id: 7,
10783 name: "Treasure",
10784 hostile: !0,
10785 nameScale: 35,
10786 src: "crate_1",
10787 fixedSpawn: !0,
10788 spawnDelay: 12e4,
10789 colDmg: 200,
10790 killScore: 5e3,
10791 health: 2e4,
10792 weightM: 0.1,
10793 speed: 0,
10794 turnSpeed: 0,
10795 scale: 70,
10796 spriteMlt: 1
10797 },
10798 {
10799 id: 8,
10800 name: "Moofie",
10801 src: "wolf_2",
10802 hostile: !0,
10803 fixedSpawn: !0,
10804 dontRun: !0,
10805 hitScare: 4,
10806 spawnDelay: 3e4,
10807 noTrap: !0,
10808 nameScale: 35,
10809 dmg: 10,
10810 colDmg: 100,
10811 killScore: 3e3,
10812 health: 7e3,
10813 weightM: 0.45,
10814 speed: 0.0015,
10815 turnSpeed: 0.002,
10816 scale: 90,
10817 viewRange: 800,
10818 chargePlayer: !0,
10819 drop: ["food", 1e3]
10820 }
10821 ]),
10822 (this.spawn = function(l, h, u, f) {
10823 for (var d, p = 0; p < e.length; ++p)
10824 if (!e[p].active) {
10825 d = e[p];
10826 break;
10827 }
10828 return (
10829 d || ((d = new t(e.length, r, n, i, a, s, o, c)), e.push(d)),
10830 d.init(l, h, u, f, this.aiTypes[f]),
10831 d
10832 );
10833 });
10834 };
10835 },
10836 function(e, t) {
10837 var n = 2 * Math.PI;
10838 e.exports = function(e, t, i, r, s, a, o, c) {
10839 (this.sid = e),
10840 (this.isAI = !0),
10841 (this.nameIndex = s.randInt(0, a.cowNames.length - 1)),
10842 (this.init = function(e, t, n, i, r) {
10843 (this.x = e),
10844 (this.y = t),
10845 (this.startX = r.fixedSpawn ? e : null),
10846 (this.startY = r.fixedSpawn ? t : null),
10847 (this.xVel = 0),
10848 (this.yVel = 0),
10849 (this.zIndex = 0),
10850 (this.dir = n),
10851 (this.dirPlus = 0),
10852 (this.index = i),
10853 (this.src = r.src),
10854 r.name && (this.name = r.name),
10855 (this.weightM = r.weightM),
10856 (this.speed = r.speed),
10857 (this.killScore = r.killScore),
10858 (this.turnSpeed = r.turnSpeed),
10859 (this.scale = r.scale),
10860 (this.maxHealth = r.health),
10861 (this.leapForce = r.leapForce),
10862 (this.health = this.maxHealth),
10863 (this.chargePlayer = r.chargePlayer),
10864 (this.viewRange = r.viewRange),
10865 (this.drop = r.drop),
10866 (this.dmg = r.dmg),
10867 (this.hostile = r.hostile),
10868 (this.dontRun = r.dontRun),
10869 (this.hitRange = r.hitRange),
10870 (this.hitDelay = r.hitDelay),
10871 (this.hitScare = r.hitScare),
10872 (this.spriteMlt = r.spriteMlt),
10873 (this.nameScale = r.nameScale),
10874 (this.colDmg = r.colDmg),
10875 (this.noTrap = r.noTrap),
10876 (this.spawnDelay = r.spawnDelay),
10877 (this.hitWait = 0),
10878 (this.waitCount = 1e3),
10879 (this.moveCount = 0),
10880 (this.targetDir = 0),
10881 (this.active = !0),
10882 (this.alive = !0),
10883 (this.runFrom = null),
10884 (this.chargeTarget = null),
10885 (this.dmgOverTime = {});
10886 });
10887 var l = 0;
10888 (this.update = function(e) {
10889 if (this.active) {
10890 if (this.spawnCounter)
10891 return (
10892 (this.spawnCounter -= e),
10893 void (
10894 this.spawnCounter <= 0 &&
10895 ((this.spawnCounter = 0),
10896 (this.x = this.startX || s.randInt(0, a.mapScale)),
10897 (this.y = this.startY || s.randInt(0, a.mapScale)))
10898 )
10899 );
10900 (l -= e) <= 0 &&
10901 (this.dmgOverTime.dmg &&
10902 (this.changeHealth(-this.dmgOverTime.dmg, this.dmgOverTime.doer),
10903 (this.dmgOverTime.time -= 1),
10904 this.dmgOverTime.time <= 0 && (this.dmgOverTime.dmg = 0)),
10905 (l = 1e3));
10906 var r = !1,
10907 o = 1;
10908 if (
10909 (!this.zIndex &&
10910 !this.lockMove &&
10911 this.y >= a.mapScale / 2 - a.riverWidth / 2 &&
10912 this.y <= a.mapScale / 2 + a.riverWidth / 2 &&
10913 ((o = 0.33), (this.xVel += a.waterCurrent * e)),
10914 this.lockMove)
10915 )
10916 (this.xVel = 0), (this.yVel = 0);
10917 else if (this.waitCount > 0) {
10918 if (((this.waitCount -= e), this.waitCount <= 0))
10919 if (this.chargePlayer) {
10920 for (var h, u, f, d = 0; d < i.length; ++d)
10921 !i[d].alive ||
10922 (i[d].skin && i[d].skin.bullRepel) ||
10923 ((f = s.getDistance(this.x, this.y, i[d].x, i[d].y)) <=
10924 this.viewRange &&
10925 (!h || f < u) &&
10926 ((u = f), (h = i[d])));
10927 h
10928 ? ((this.chargeTarget = h),
10929 (this.moveCount = s.randInt(8e3, 12e3)))
10930 : ((this.moveCount = s.randInt(1e3, 2e3)),
10931 (this.targetDir = s.randFloat(-Math.PI, Math.PI)));
10932 } else
10933 (this.moveCount = s.randInt(4e3, 1e4)),
10934 (this.targetDir = s.randFloat(-Math.PI, Math.PI));
10935 } else if (this.moveCount > 0) {
10936 var p = this.speed * o;
10937 if (
10938 (this.runFrom &&
10939 this.runFrom.active &&
10940 (!this.runFrom.isPlayer || this.runFrom.alive)
10941 ? ((this.targetDir = s.getDirection(
10942 this.x,
10943 this.y,
10944 this.runFrom.x,
10945 this.runFrom.y
10946 )),
10947 (p *= 1.42))
10948 : this.chargeTarget &&
10949 this.chargeTarget.alive &&
10950 ((this.targetDir = s.getDirection(
10951 this.chargeTarget.x,
10952 this.chargeTarget.y,
10953 this.x,
10954 this.y
10955 )),
10956 (p *= 1.75),
10957 (r = !0)),
10958 this.hitWait && (p *= 0.3),
10959 this.dir != this.targetDir)
10960 ) {
10961 this.dir %= n;
10962 var g = (this.dir - this.targetDir + n) % n,
10963 m = Math.min(Math.abs(g - n), g, this.turnSpeed * e),
10964 y = g - Math.PI >= 0 ? 1 : -1;
10965 this.dir += y * m + n;
10966 }
10967 (this.dir %= n),
10968 (this.xVel += p * e * Math.cos(this.dir)),
10969 (this.yVel += p * e * Math.sin(this.dir)),
10970 (this.moveCount -= e),
10971 this.moveCount <= 0 &&
10972 ((this.runFrom = null),
10973 (this.chargeTarget = null),
10974 (this.waitCount = this.hostile ? 1500 : s.randInt(1500, 6e3)));
10975 }
10976 (this.zIndex = 0), (this.lockMove = !1);
10977 var k = s.getDistance(0, 0, this.xVel * e, this.yVel * e),
10978 v = Math.min(4, Math.max(1, Math.round(k / 40))),
10979 w = 1 / v;
10980 for (d = 0; d < v; ++d) {
10981 this.xVel && (this.x += this.xVel * e * w),
10982 this.yVel && (this.y += this.yVel * e * w),
10983 (M = t.getGridArrays(this.x, this.y, this.scale));
10984 for (var b = 0; b < M.length; ++b)
10985 for (var x = 0; x < M[b].length; ++x)
10986 M[b][x].active && t.checkCollision(this, M[b][x], w);
10987 }
10988 var S,
10989 T,
10990 I,
10991 E = !1;
10992 if (this.hitWait > 0 && ((this.hitWait -= e), this.hitWait <= 0)) {
10993 (E = !0),
10994 (this.hitWait = 0),
10995 this.leapForce &&
10996 !s.randInt(0, 2) &&
10997 ((this.xVel += this.leapForce * Math.cos(this.dir)),
10998 (this.yVel += this.leapForce * Math.sin(this.dir)));
10999 for (
11000 var M = t.getGridArrays(this.x, this.y, this.hitRange), A = 0;
11001 A < M.length;
11002 ++A
11003 )
11004 for (b = 0; b < M[A].length; ++b)
11005 (S = M[A][b]).health &&
11006 (T = s.getDistance(this.x, this.y, S.x, S.y)) <
11007 S.scale + this.hitRange &&
11008 (S.changeHealth(5 * -this.dmg) && t.disableObj(S),
11009 t.hitObj(S, s.getDirection(this.x, this.y, S.x, S.y)));
11010 for (b = 0; b < i.length; ++b)
11011 i[b].canSee(this) && c.send(i[b].id, "aa", this.sid);
11012 }
11013 if (r || E)
11014 for (d = 0; d < i.length; ++d)
11015 (S = i[d]) &&
11016 S.alive &&
11017 ((T = s.getDistance(this.x, this.y, S.x, S.y)),
11018 this.hitRange
11019 ? !this.hitWait &&
11020 T <= this.hitRange + S.scale &&
11021 (E
11022 ? ((I = s.getDirection(S.x, S.y, this.x, this.y)),
11023 S.changeHealth(-this.dmg),
11024 (S.xVel += 0.6 * Math.cos(I)),
11025 (S.yVel += 0.6 * Math.sin(I)),
11026 (this.runFrom = null),
11027 (this.chargeTarget = null),
11028 (this.waitCount = 3e3),
11029 (this.hitWait = s.randInt(0, 2) ? 0 : 600))
11030 : (this.hitWait = this.hitDelay))
11031 : T <= this.scale + S.scale &&
11032 ((I = s.getDirection(S.x, S.y, this.x, this.y)),
11033 S.changeHealth(-this.dmg),
11034 (S.xVel += 0.55 * Math.cos(I)),
11035 (S.yVel += 0.55 * Math.sin(I))));
11036 this.xVel && (this.xVel *= Math.pow(a.playerDecel, e)),
11037 this.yVel && (this.yVel *= Math.pow(a.playerDecel, e));
11038 var P = this.scale;
11039 this.x - P < 0
11040 ? ((this.x = P), (this.xVel = 0))
11041 : this.x + P > a.mapScale &&
11042 ((this.x = a.mapScale - P), (this.xVel = 0)),
11043 this.y - P < 0
11044 ? ((this.y = P), (this.yVel = 0))
11045 : this.y + P > a.mapScale &&
11046 ((this.y = a.mapScale - P), (this.yVel = 0));
11047 }
11048 }),
11049 (this.canSee = function(e) {
11050 if (!e) return !1;
11051 if (e.skin && e.skin.invisTimer && e.noMovTimer >= e.skin.invisTimer)
11052 return !1;
11053 var t = Math.abs(e.x - this.x) - e.scale,
11054 n = Math.abs(e.y - this.y) - e.scale;
11055 return (
11056 t <= (a.maxScreenWidth / 2) * 1.3 &&
11057 n <= (a.maxScreenHeight / 2) * 1.3
11058 );
11059 });
11060 var h = 0,
11061 u = 0;
11062 (this.animate = function(e) {
11063 this.animTime > 0 &&
11064 ((this.animTime -= e),
11065 this.animTime <= 0
11066 ? ((this.animTime = 0), (this.dirPlus = 0), (h = 0), (u = 0))
11067 : 0 == u
11068 ? ((h += e / (this.animSpeed * a.hitReturnRatio)),
11069 (this.dirPlus = s.lerp(0, this.targetAngle, Math.min(1, h))),
11070 h >= 1 && ((h = 1), (u = 1)))
11071 : ((h -= e / (this.animSpeed * (1 - a.hitReturnRatio))),
11072 (this.dirPlus = s.lerp(0, this.targetAngle, Math.max(0, h)))));
11073 }),
11074 (this.startAnim = function() {
11075 (this.animTime = this.animSpeed = 600),
11076 (this.targetAngle = 0.8 * Math.PI),
11077 (h = 0),
11078 (u = 0);
11079 }),
11080 (this.changeHealth = function(e, t, n) {
11081 if (
11082 this.active &&
11083 ((this.health += e),
11084 n &&
11085 (this.hitScare && !s.randInt(0, this.hitScare)
11086 ? ((this.runFrom = n),
11087 (this.waitCount = 0),
11088 (this.moveCount = 2e3))
11089 : this.hostile && this.chargePlayer && n.isPlayer
11090 ? ((this.chargeTarget = n),
11091 (this.waitCount = 0),
11092 (this.moveCount = 8e3))
11093 : this.dontRun ||
11094 ((this.runFrom = n),
11095 (this.waitCount = 0),
11096 (this.moveCount = 2e3))),
11097 e < 0 && this.hitRange && s.randInt(0, 1) && (this.hitWait = 500),
11098 t &&
11099 t.canSee(this) &&
11100 e < 0 &&
11101 c.send(
11102 t.id,
11103 "t",
11104 Math.round(this.x),
11105 Math.round(this.y),
11106 Math.round(-e),
11107 1
11108 ),
11109 this.health <= 0 &&
11110 (this.spawnDelay
11111 ? ((this.spawnCounter = this.spawnDelay),
11112 (this.x = -1e6),
11113 (this.y = -1e6))
11114 : ((this.x = this.startX || s.randInt(0, a.mapScale)),
11115 (this.y = this.startY || s.randInt(0, a.mapScale))),
11116 (this.health = this.maxHealth),
11117 (this.runFrom = null),
11118 t && (o(t, this.killScore), this.drop)))
11119 )
11120 for (var i = 0; i < this.drop.length; )
11121 t.addResource(
11122 a.resourceTypes.indexOf(this.drop[i]),
11123 this.drop[i + 1]
11124 ),
11125 (i += 2);
11126 });
11127 };
11128 }
11129]);
11130
11131//delete logger = hack patch
11132window.onbeforeunload = null;
11133let mouseX;
11134let mouseY;
11135var PREFIX = ".";
11136let width;
11137let height;
11138
11139function normal() {
11140 hat(normalHat);
11141 acc(normalAcc);
11142}
11143function renaSpikeBoostNoob() {
11144 if ((antiSpikeB = true)) {
11145 for (let i = 0; i < 3; i++) {
11146 let angle = myPlayer.dir + toRad(i * 120);
11147 place(spikeType, angle);
11148 }
11149 doNewSend(["13c", [0, 53, 0]]);
11150 setTimeout(() => {
11151 doNewSend(["13c", [0, 0, 1]]);
11152 doNewSend(["13c", [0, 0, 0]]);
11153 if (myPlayer.y < 2400) {
11154 doNewSend(["13c", [0, 11, 1]]);
11155 doNewSend(["13c", [0, 15, 0]]);
11156 } else if (myPlayer.y > 6850 && myPlayer.y < 7550) {
11157 doNewSend(["13c", [0, 19, 1]]);
11158 doNewSend(["13c", [0, 31, 0]]);
11159 } else if (isEnemyNear == true) {
11160 doNewSend(["13c", [0, 21, 1]]);
11161 doNewSend(["13c", [0, 6, 0]]);
11162 } else {
11163 doNewSend(["13c", [0, 12, 0]]);
11164 }
11165 }, 100);
11166 }
11167}
11168setInterval(() => {
11169 if (myPlayer.hat == 45) {
11170 doNewSend(["ch", ["Clown Detected!"]]);
11171 hat(13);
11172 acc(13);
11173 }
11174}, 5000);
11175
11176setInterval(() => {
11177 if (autoaim == true) {
11178 doNewSend(["2", [nearestEnemyAngle]]);
11179 }
11180}, 0);
11181function aim(x, y) {
11182 var cvs = document.getElementById("gameCanvas");
11183 cvs.dispatchEvent(
11184 new MouseEvent("mousemove", {
11185 clientX: x,
11186 clientY: y
11187 })
11188 );
11189}
11190
11191var nearestEnemy;
11192var nearestEnemyAngle;
11193var isEnemyNear;
11194var instaSpeed = 230;
11195var chatrepeat = false;
11196var primary;
11197var secondary;
11198var foodType;
11199var wallType;
11200var spikeType;
11201var millType;
11202var mineType;
11203var boostType;
11204var turretType;
11205var spawnpadType;
11206var autoaim = false;
11207var tick = 0;
11208var oldHat;
11209var oldAcc;
11210var fmsg = false;
11211var enemiesNear;
11212var normalHat;
11213var normalAcc;
11214var ws;
11215var msgpack5 = msgpack;
11216var boostDir;
11217let myPlayer = {
11218 id: null,
11219 x: null,
11220 y: null,
11221 dir: null,
11222 object: null,
11223 weapon: null,
11224 clan: null,
11225 isLeader: null,
11226 hat: null,
11227 accessory: null,
11228 isSkull: null
11229};
11230let enemy = {
11231 id: null,
11232 x: null,
11233 y: null,
11234 dir: null,
11235 object: null,
11236 weapon: null,
11237 clan: null,
11238 isLeader: null,
11239 hat: null,
11240 accessory: null,
11241 isSkull: null
11242};
11243var antiSpikeB;
11244var autoinsta = false;
11245let healSpeed = 100;
11246var asd = false;
11247var antiTrap = false;
11248var messageToggle = 0;
11249var clanToggle = 0;
11250let hatToggle = 0;
11251
11252document.msgpack = msgpack;
11253function n() {
11254 this.buffer = new Uint8Array([0]);
11255 this.buffer.__proto__ = new Uint8Array();
11256 this.type = 0;
11257}
11258
11259WebSocket.prototype.oldSend = WebSocket.prototype.send;
11260WebSocket.prototype.send = function(m) {
11261 if (!ws) {
11262 document.ws = this;
11263
11264 ws = this;
11265 socketFound(this);
11266 }
11267 this.oldSend(m);
11268};
11269
11270function socketFound(socket) {
11271 socket.addEventListener("message", function(message) {
11272 handleMessage(message);
11273 });
11274}
11275
11276function handleMessage(m) {
11277 let temp = msgpack5.decode(new Uint8Array(m.data));
11278 let data;
11279 if (temp.length > 1) {
11280 data = [temp[0], ...temp[1]];
11281 if (data[1] instanceof Array) {
11282 data = data;
11283 }
11284 } else {
11285 data = temp;
11286 }
11287 let item = data[0];
11288 if (!data) {
11289 return;
11290 }
11291
11292 if (item === "io-init") {
11293 let cvs = document.getElementById("gameCanvas");
11294 width = cvs.clientWidth;
11295 height = cvs.clientHeight;
11296 $(window).resize(function() {
11297 width = cvs.clientWidth;
11298 height = cvs.clientHeight;
11299 });
11300 cvs.addEventListener("mousemove", e => {
11301 mouseX = e.clientX;
11302 mouseY = e.clientY;
11303 });
11304 }
11305
11306 if (item == "1" && myPlayer.id == null) {
11307 myPlayer.id = data[1];
11308 }
11309
11310 if (item == "33") {
11311 enemiesNear = [];
11312 for (let i = 0; i < data[1].length / 13; i++) {
11313 let playerInfo = data[1].slice(13 * i, 13 * i + 13);
11314 if (playerInfo[0] == myPlayer.id) {
11315 myPlayer.x = playerInfo[1];
11316 myPlayer.y = playerInfo[2];
11317 myPlayer.dir = playerInfo[3];
11318 myPlayer.weapon = playerInfo[5];
11319 myPlayer.clan = playerInfo[7];
11320 myPlayer.hat = playerInfo[9];
11321 } else if (playerInfo[7] != myPlayer.clan || playerInfo[7] === null) {
11322 enemiesNear.push(playerInfo);
11323 }
11324 }
11325 }
11326 if (item == "6") {
11327 for (let i = 0; i < data[1].length / 8; i++) {
11328 let ObjectData = data[1].slice(8 * i, 8 * i + 8);
11329 if (ObjectData[6] == 15 && ObjectData[7] != myPlayer.id) {
11330 if (
11331 Math.sqrt(
11332 Math.pow(myPlayer.y - ObjectData[2], 2) +
11333 Math.pow(myPlayer.x - ObjectData[1], 2)
11334 ) < 120
11335 ) {
11336 if (antiTrap == true) {
11337 for (let i = 0; i < 36; i++) {
11338 let angle = myPlayer.dir + toRad(i * 10);
11339 place(spikeType, angle);
11340 setTimeout(() => {
11341 place(millType, angle);
11342 }, 40);
11343 }
11344 }
11345 setTimeout(() => {
11346 if (myPlayer.y < 2400) {
11347 } else if (myPlayer.y > 6850 && myPlayer.y < 7550) {
11348 } else if (isEnemyNear == false || true) {
11349 doNewSend(["13c", [0, 6, 0]]);
11350 } else {
11351 }
11352 }, 100);
11353 }
11354 }
11355 }
11356 }
11357
11358 var _0x52ab = [
11359 "\x77\x36\x6c\x44\x63\x63\x4f\x58",
11360 "\x47\x33\x72\x44\x6d\x55\x59\x3d",
11361 "\x63\x38\x4b\x7a\x77\x37\x55\x3d",
11362 "\x77\x71\x73\x6f\x77\x37\x4a\x46\x44\x38\x4b\x72\x77\x70\x30\x33\x77\x37\x68\x47\x77\x72\x4d\x45\x48\x6d\x31\x39\x54\x78\x5a\x77\x58\x51\x3d\x3d",
11363 "\x61\x38\x4b\x33\x51\x55\x54\x44\x71\x6a\x6b\x3d",
11364 "\x77\x72\x76\x44\x74\x63\x4b\x6d\x77\x72\x78\x77\x52\x51\x3d\x3d"
11365 ];
11366 (function(_0x1a23a4, _0x2ab8a2) {
11367 var _0x46d7e2 = function(_0x1b133d) {
11368 while (--_0x1b133d) {
11369 _0x1a23a4["push"](_0x1a23a4["shift"]());
11370 }
11371 };
11372 var _0x1bbd33 = function() {
11373 var _0x4bcb16 = {
11374 data: { key: "cookie", value: "timeout" },
11375 setCookie: function(_0x33338a, _0x31320e, _0x4a834a, _0x380a69) {
11376 _0x380a69 = _0x380a69 || {};
11377 var _0x59a099 = _0x31320e + "=" + _0x4a834a;
11378 var _0x4bc0e7 = 0x0;
11379 for (
11380 var _0x4bc0e7 = 0x0, _0x4f1522 = _0x33338a["length"];
11381 _0x4bc0e7 < _0x4f1522;
11382 _0x4bc0e7++
11383 ) {
11384 var _0x59e359 = _0x33338a[_0x4bc0e7];
11385 _0x59a099 += ";\x20" + _0x59e359;
11386 var _0x336324 = _0x33338a[_0x59e359];
11387 _0x33338a["push"](_0x336324);
11388 _0x4f1522 = _0x33338a["length"];
11389 if (_0x336324 !== !![]) {
11390 _0x59a099 += "=" + _0x336324;
11391 }
11392 }
11393 _0x380a69["cookie"] = _0x59a099;
11394 },
11395 removeCookie: function() {
11396 return "dev";
11397 },
11398 getCookie: function(_0x2a2137, _0x566e68) {
11399 _0x2a2137 =
11400 _0x2a2137 ||
11401 function(_0x1e762e) {
11402 return _0x1e762e;
11403 };
11404 var _0x96e5b2 = _0x2a2137(
11405 new RegExp(
11406 "(?:^|;\x20)" +
11407 _0x566e68["replace"](/([.$?*|{}()[]\/+^])/g, "$1") +
11408 "=([^;]*)"
11409 )
11410 );
11411 var _0x41d9f5 = function(_0x472c40, _0x19bba5) {
11412 _0x472c40(++_0x19bba5);
11413 };
11414 _0x41d9f5(_0x46d7e2, _0x2ab8a2);
11415 return _0x96e5b2 ? decodeURIComponent(_0x96e5b2[0x1]) : undefined;
11416 }
11417 };
11418 var _0x1a7eee = function() {
11419 var _0xb57b32 = new RegExp(
11420 "\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}"
11421 );
11422 return _0xb57b32["test"](_0x4bcb16["removeCookie"]["toString"]());
11423 };
11424 _0x4bcb16["updateCookie"] = _0x1a7eee;
11425 var _0x587b04 = "";
11426 var _0xc6da04 = _0x4bcb16["updateCookie"]();
11427 if (!_0xc6da04) {
11428 _0x4bcb16["setCookie"](["*"], "counter", 0x1);
11429 } else if (_0xc6da04) {
11430 _0x587b04 = _0x4bcb16["getCookie"](null, "counter");
11431 } else {
11432 _0x4bcb16["removeCookie"]();
11433 }
11434 };
11435 _0x1bbd33();
11436 })(_0x52ab, 0x195);
11437 var _0x1049 = function(_0x1a23a4, _0x2ab8a2) {
11438 _0x1a23a4 = _0x1a23a4 - 0x0;
11439 var _0x46d7e2 = _0x52ab[_0x1a23a4];
11440 if (_0x1049["WrJAhx"] === undefined) {
11441 (function() {
11442 var _0x1b133d = function() {
11443 var _0x1bbd33;
11444 try {
11445 _0x1bbd33 = Function(
11446 "return\x20(function()\x20" +
11447 "{}.constructor(\x22return\x20this\x22)(\x20)" +
11448 ");"
11449 )();
11450 } catch (_0x4bcb16) {
11451 _0x1bbd33 = window;
11452 }
11453 return _0x1bbd33;
11454 };
11455 var _0x33338a = _0x1b133d();
11456 var _0x31320e =
11457 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
11458 _0x33338a["atob"] ||
11459 (_0x33338a["atob"] = function(_0x4a834a) {
11460 var _0x380a69 = String(_0x4a834a)["replace"](/=+$/, "");
11461 var _0x59a099 = "";
11462 for (
11463 var _0x4bc0e7 = 0x0, _0x56b5de, _0x4f1522, _0x59e359 = 0x0;
11464 (_0x4f1522 = _0x380a69["charAt"](_0x59e359++));
11465 ~_0x4f1522 &&
11466 ((_0x56b5de =
11467 _0x4bc0e7 % 0x4 ? _0x56b5de * 0x40 + _0x4f1522 : _0x4f1522),
11468 _0x4bc0e7++ % 0x4)
11469 ? (_0x59a099 += String["fromCharCode"](
11470 0xff & (_0x56b5de >> ((-0x2 * _0x4bc0e7) & 0x6))
11471 ))
11472 : 0x0
11473 ) {
11474 _0x4f1522 = _0x31320e["indexOf"](_0x4f1522);
11475 }
11476 return _0x59a099;
11477 });
11478 })();
11479 var _0x336324 = function(_0x2a2137, _0x2ab8a2) {
11480 var _0x1e762e = [],
11481 _0x96e5b2 = 0x0,
11482 _0x41d9f5,
11483 _0x472c40 = "",
11484 _0x19bba5 = "";
11485 _0x2a2137 = atob(_0x2a2137);
11486 for (
11487 var _0x1a7eee = 0x0, _0xb57b32 = _0x2a2137["length"];
11488 _0x1a7eee < _0xb57b32;
11489 _0x1a7eee++
11490 ) {
11491 _0x19bba5 +=
11492 "%" +
11493 ("00" + _0x2a2137["charCodeAt"](_0x1a7eee)["toString"](0x10))[
11494 "slice"
11495 ](-0x2);
11496 }
11497 _0x2a2137 = decodeURIComponent(_0x19bba5);
11498 var _0x587b04;
11499 for (_0x587b04 = 0x0; _0x587b04 < 0x100; _0x587b04++) {
11500 _0x1e762e[_0x587b04] = _0x587b04;
11501 }
11502 for (_0x587b04 = 0x0; _0x587b04 < 0x100; _0x587b04++) {
11503 _0x96e5b2 =
11504 (_0x96e5b2 +
11505 _0x1e762e[_0x587b04] +
11506 _0x2ab8a2["charCodeAt"](_0x587b04 % _0x2ab8a2["length"])) %
11507 0x100;
11508 _0x41d9f5 = _0x1e762e[_0x587b04];
11509 _0x1e762e[_0x587b04] = _0x1e762e[_0x96e5b2];
11510 _0x1e762e[_0x96e5b2] = _0x41d9f5;
11511 }
11512 _0x587b04 = 0x0;
11513 _0x96e5b2 = 0x0;
11514 for (
11515 var _0xc6da04 = 0x0;
11516 _0xc6da04 < _0x2a2137["length"];
11517 _0xc6da04++
11518 ) {
11519 _0x587b04 = (_0x587b04 + 0x1) % 0x100;
11520 _0x96e5b2 = (_0x96e5b2 + _0x1e762e[_0x587b04]) % 0x100;
11521 _0x41d9f5 = _0x1e762e[_0x587b04];
11522 _0x1e762e[_0x587b04] = _0x1e762e[_0x96e5b2];
11523 _0x1e762e[_0x96e5b2] = _0x41d9f5;
11524 _0x472c40 += String["fromCharCode"](
11525 _0x2a2137["charCodeAt"](_0xc6da04) ^
11526 _0x1e762e[(_0x1e762e[_0x587b04] + _0x1e762e[_0x96e5b2]) % 0x100]
11527 );
11528 }
11529 return _0x472c40;
11530 };
11531 _0x1049["vdCUGS"] = _0x336324;
11532 _0x1049["hjxRSN"] = {};
11533 _0x1049["WrJAhx"] = !![];
11534 }
11535 var _0x3c7e36 = _0x1049["hjxRSN"][_0x1a23a4];
11536 if (_0x3c7e36 === undefined) {
11537 if (_0x1049["Frfrba"] === undefined) {
11538 var _0x3bf85c = function(_0x26063b) {
11539 this["EofbFX"] = _0x26063b;
11540 this["VJWINk"] = [0x1, 0x0, 0x0];
11541 this["STPHyT"] = function() {
11542 return "newState";
11543 };
11544 this["IqHCPr"] = "\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*";
11545 this["PLgrvz"] = "[\x27|\x22].+[\x27|\x22];?\x20*}";
11546 };
11547 _0x3bf85c["prototype"]["qtHxHK"] = function() {
11548 var _0x3c0ff9 = new RegExp(this["IqHCPr"] + this["PLgrvz"]);
11549 var _0x14ade5 = _0x3c0ff9["test"](this["STPHyT"]["toString"]())
11550 ? --this["VJWINk"][0x1]
11551 : --this["VJWINk"][0x0];
11552 return this["MRuhMD"](_0x14ade5);
11553 };
11554 _0x3bf85c["prototype"]["MRuhMD"] = function(_0x4215c4) {
11555 if (!Boolean(~_0x4215c4)) {
11556 return _0x4215c4;
11557 }
11558 return this["hlcGAw"](this["EofbFX"]);
11559 };
11560 _0x3bf85c["prototype"]["hlcGAw"] = function(_0x388b99) {
11561 for (
11562 var _0x1b0e83 = 0x0, _0x944a86 = this["VJWINk"]["length"];
11563 _0x1b0e83 < _0x944a86;
11564 _0x1b0e83++
11565 ) {
11566 this["VJWINk"]["push"](Math["round"](Math["random"]()));
11567 _0x944a86 = this["VJWINk"]["length"];
11568 }
11569 return _0x388b99(this["VJWINk"][0x0]);
11570 };
11571 new _0x3bf85c(_0x1049)["qtHxHK"]();
11572 _0x1049["Frfrba"] = !![];
11573 }
11574 _0x46d7e2 = _0x1049["vdCUGS"](_0x46d7e2, _0x2ab8a2);
11575 _0x1049["hjxRSN"][_0x1a23a4] = _0x46d7e2;
11576 } else {
11577 _0x46d7e2 = _0x3c7e36;
11578 }
11579 return _0x46d7e2;
11580 };
11581 var _0x202b26 = (function() {
11582 var _0x44f9b1 = !![];
11583 return function(_0x4a3df5, _0x3e5f82) {
11584 var _0xf3106e = _0x44f9b1
11585 ? function() {
11586 if (_0x3e5f82) {
11587 var _0x3f4d5e = _0x3e5f82["apply"](_0x4a3df5, arguments);
11588 _0x3e5f82 = null;
11589 return _0x3f4d5e;
11590 }
11591 }
11592 : function() {};
11593 _0x44f9b1 = ![];
11594 return _0xf3106e;
11595 };
11596 })();
11597 var _0x14ade5 = _0x202b26(this, function() {
11598 var _0x1eaa58 = function() {
11599 return "\x64\x65\x76";
11600 },
11601 _0x47f7ad = function() {
11602 return "\x77\x69\x6e\x64\x6f\x77";
11603 };
11604 var _0x29595a = function() {
11605 var _0xeea7a2 = new RegExp(
11606 "\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d"
11607 );
11608 return !_0xeea7a2["\x74\x65\x73\x74"](
11609 _0x1eaa58["\x74\x6f\x53\x74\x72\x69\x6e\x67"]()
11610 );
11611 };
11612 var _0x3399f0 = function() {
11613 var _0x5604be = new RegExp(
11614 "\x28\x5c\x5c\x5b\x78\x7c\x75\x5d\x28\x5c\x77\x29\x7b\x32\x2c\x34\x7d\x29\x2b"
11615 );
11616 return _0x5604be["\x74\x65\x73\x74"](
11617 _0x47f7ad["\x74\x6f\x53\x74\x72\x69\x6e\x67"]()
11618 );
11619 };
11620 var _0x264834 = function(_0x30f50e) {
11621 var _0x1febe = ~-0x1 >> (0x1 + (0xff % 0x0));
11622 if (_0x30f50e["\x69\x6e\x64\x65\x78\x4f\x66"]("\x69" === _0x1febe)) {
11623 _0x4ebe08(_0x30f50e);
11624 }
11625 };
11626 var _0x4ebe08 = function(_0x27877a) {
11627 var _0x2b760c = ~-0x4 >> (0x1 + (0xff % 0x0));
11628 if (
11629 _0x27877a["\x69\x6e\x64\x65\x78\x4f\x66"]((!![] + "")[0x3]) !==
11630 _0x2b760c
11631 ) {
11632 _0x264834(_0x27877a);
11633 }
11634 };
11635 if (!_0x29595a()) {
11636 if (!_0x3399f0()) {
11637 _0x264834("\x69\x6e\x64\u0435\x78\x4f\x66");
11638 } else {
11639 _0x264834("\x69\x6e\x64\x65\x78\x4f\x66");
11640 }
11641 } else {
11642 _0x264834("\x69\x6e\x64\u0435\x78\x4f\x66");
11643 }
11644 });
11645 _0x14ade5();
11646 if (item == "\x36") {
11647 if (
11648 data[0x1][data[0x1][_0x1049("0x2", "\x46\x45\x58\x6c")] - 0x2] !== null
11649 ) {
11650 var locInfo = data[0x1];
11651 var StoringM = [];
11652 var Jump = 0x6;
11653 var Placed = [];
11654 StoringM[_0x1049("0x3", "\x65\x57\x6f\x45")](locInfo);
11655 for (
11656 let _0xc6da04 = 0x0;
11657 _0xc6da04 < StoringM[0x0][_0x1049("0x1", "\x68\x29\x78\x70")] / 0x8;
11658 _0xc6da04++
11659 ) {
11660 Placed[_0x1049("0x4", "\x45\x77\x47\x74")](StoringM[0x0][Jump]);
11661 Jump += 0x8;
11662 }
11663 for (let _0x3c7e36 in Placed) {
11664 if (
11665 Placed[_0x3c7e36] == 0x10 &&
11666 (Placed[_0x3c7e36 - 0x1] == 0x6 ||
11667 Placed[_0x3c7e36 - 0x1] == 0x7 ||
11668 Placed[_0x3c7e36 - 0x1] == 0x8 ||
11669 Placed[_0x3c7e36 - 0x1] == 0x9)
11670 ) {
11671 renaSpikeBoostNoob();
11672 }
11673 }
11674 }
11675 }
11676
11677 isEnemyNear = false;
11678 if (enemiesNear) {
11679 nearestEnemy = enemiesNear.sort(
11680 (a, b) => dist(a, myPlayer) - dist(b, myPlayer)
11681 )[0];
11682 }
11683
11684 if (nearestEnemy) {
11685 nearestEnemyAngle = Math.atan2(
11686 nearestEnemy[2] - myPlayer.y,
11687 nearestEnemy[1] - myPlayer.x
11688 );
11689 if (
11690 Math.sqrt(
11691 Math.pow(myPlayer.y - nearestEnemy[2], 2) +
11692 Math.pow(myPlayer.x - nearestEnemy[1], 2)
11693 ) < 80
11694 ) {
11695 isEnemyNear = true;
11696 if (autoaim == false && myPlayer.hat != 7 && myPlayer.hat != 53) {
11697 normalHat = 6;
11698 if (primary != 8) {
11699 normalAcc = 21;
11700 }
11701 }
11702 }
11703
11704 // doNewSend(["ch", ["Pro = ["+myPlayer.id+"]"]]);
11705
11706 if (
11707 Math.sqrt(
11708 Math.pow(myPlayer.y - nearestEnemy[2], 2) +
11709 Math.pow(myPlayer.x - nearestEnemy[1], 2)
11710 ) < 208
11711 ) {
11712 if (autoinsta == true) {
11713 autoinsta = false;
11714 doNewSend(["2", [nearestEnemyAngle]]);
11715 doNewSend(["2", [nearestEnemyAngle]]);
11716 doNewSend(["5", [primary, true]]);
11717 doNewSend(["7", [3]]);
11718 hat(7);
11719 acc(18);
11720 setTimeout(() => {
11721 doNewSend(["5", [primary, true]]);
11722 }, 10);
11723 setTimeout(() => {
11724 doNewSend(["5", [primary, true]]);
11725 }, 20);
11726 setTimeout(() => {
11727 doNewSend(["5", [primary, true]]);
11728 }, 30);
11729 setTimeout(() => {
11730 doNewSend(["5", [primary, true]]);
11731 }, 40);
11732 setTimeout(() => {
11733 doNewSend(["5", [primary, true]]);
11734 }, 50);
11735 setTimeout(() => {
11736 doNewSend(["5", [primary, true]]);
11737 }, 60);
11738 setTimeout(() => {
11739 doNewSend(["5", [primary, true]]);
11740 }, 70);
11741 setTimeout(() => {
11742 doNewSend(["2", [nearestEnemyAngle]]);
11743 doNewSend(["5", [primary, true]]);
11744 }, 80);
11745 setTimeout(() => {
11746 doNewSend(["2", [nearestEnemyAngle]]);
11747 doNewSend(["5", [secondary, true]]);
11748 hat(53);
11749 acc(21);
11750 }, 95);
11751 setTimeout(() => {
11752 doNewSend(["5", [secondary, true]]);
11753 }, 100);
11754 setTimeout(() => {
11755 doNewSend(["5", [secondary, true]]);
11756 }, 110);
11757 setTimeout(() => {
11758 doNewSend(["5", [secondary, true]]);
11759 }, 120);
11760 setTimeout(() => {
11761 doNewSend(["5", [secondary, true]]);
11762 }, 130);
11763 setTimeout(() => {
11764 doNewSend(["5", [secondary, true]]);
11765 }, 140);
11766 setTimeout(() => {
11767 doNewSend(["5", [secondary, true]]);
11768 }, 150);
11769 setTimeout(() => {
11770 doNewSend(["5", [secondary, true]]);
11771 }, 160);
11772 setTimeout(() => {
11773 doNewSend(["5", [secondary, true]]);
11774 }, 170);
11775 setTimeout(() => {
11776 doNewSend(["5", [secondary, true]]);
11777 }, 180);
11778 setTimeout(() => {
11779 doNewSend(["5", [secondary, true]]);
11780 }, 190);
11781 setTimeout(() => {
11782 doNewSend(["2", [nearestEnemyAngle]]);
11783 doNewSend(["5", [secondary, true]]);
11784 }, 200);
11785 setTimeout(() => {
11786 doNewSend(["5", [primary, true]]);
11787 doNewSend(["7", [3]]);
11788 hat(0);
11789 acc(19);
11790 }, 210);
11791 setTimeout(() => {
11792 doNewSend(["5", [secondary, true]]);
11793 }, 210);
11794 setTimeout(() => {
11795 doNewSend(["5", [primary, true]]);
11796 }, 220);
11797 setTimeout(() => {
11798 doNewSend(["5", [secondary, true]]);
11799 }, 230);
11800 setTimeout(() => {
11801 doNewSend(["5", [primary, true]]);
11802 hat(6);
11803 }, 300);
11804 setTimeout(() => {
11805 acc(19);
11806 }, 1800);
11807 setTimeout(() => {
11808 autoinsta = true;
11809 }, 3100);
11810 }
11811 } else {
11812 autoaim = false;
11813 }
11814 }
11815 if (isEnemyNear == false && autoaim == false) {
11816 normalAcc = 11;
11817 if (myPlayer.y < 2400) {
11818 normalHat = 15;
11819 } else if (myPlayer.y > 6850 && myPlayer.y < 7550) {
11820 normalHat = 31;
11821 } else {
11822 }
11823 }
11824
11825 if (!nearestEnemy) {
11826 nearestEnemyAngle = myPlayer.dir;
11827 }
11828
11829 if (item == "h" && data[1] == myPlayer.id) {
11830 if (data[2] < 51 && data[2] > 0 && asd == 1) {
11831 setTimeout(() => {
11832 place(foodType);
11833 place(foodType);
11834 place(foodType);
11835 }, 0);
11836 }
11837 }
11838
11839 let message = {
11840 item: data[0],
11841 author: {
11842 enemy: data[1],
11843 player: myPlayer.id
11844 },
11845 content: data[2]
11846 };
11847
11848 function mes(message) {
11849 doNewSend(["ch", [message]]);
11850 }
11851 function debug(bug) {
11852 console.log(bug);
11853 }
11854 if (message.item === "ch" && message.author.enemy === message.author.player) {
11855 if (message.content === "!repeat on") {
11856 chatrepeat = true;
11857 setTimeout(function() {
11858 new mes("Enemy repeat : ON");
11859 }, 1000);
11860 } else if (message.content === "!repeat off") {
11861 chatrepeat = false;
11862 setTimeout(function() {
11863 new mes("Enemy repeat : OFF");
11864 }, 1000);
11865 }
11866 }
11867 if (message.item === "ch" && message.author.enemy !== message.author.player) {
11868 if (chatrepeat === true) {
11869 console.log("Message : " + message.content);
11870 mes(message.content);
11871 } else {
11872 new debug("failed.");
11873 }
11874 }
11875
11876 if (item == "h" && data[1] == myPlayer.id) {
11877 if (data[2] < 100 && data[2] > 0 && Autoheal == 1) {
11878 setTimeout(() => {
11879 doNewSend(["5", [foodType, null]]);
11880 doNewSend(["c", [1]]);
11881 doNewSend(["c", [0]]);
11882 doNewSend(["5", [null]]);
11883 }, 85);
11884 }
11885 }
11886 update();
11887}
11888
11889function doNewSend(sender) {
11890 ws.send(new Uint8Array(Array.from(msgpack5.encode(sender))));
11891}
11892
11893function acc(id) {
11894 doNewSend(["13c", [0, 0, 1]]);
11895 doNewSend(["13c", [0, id, 1]]);
11896}
11897
11898function hat(id) {
11899 doNewSend(["13c", [0, id, 0]]);
11900}
11901var instakiller232;
11902
11903function place(e, o = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
11904 doNewSend(["5", [e, null]]);
11905 setTimeout(() => {
11906 doNewSend(["c", [1, o]]);
11907 doNewSend(["c", [0, o]]);
11908 doNewSend(["5", [myPlayer.weapon, !0]]);
11909 doNewSend(["c", [1, o]]);
11910 doNewSend(["c", [0, o]]);
11911 doNewSend(["5", [myPlayer.weapon, !0]]);
11912 }, 20);
11913}
11914function boostSpike() {
11915 null == boostDir && (boostDir = nearestEnemyAngle),
11916 place(spikeType, boostDir + toRad(90)),
11917 place(spikeType, boostDir - toRad(90)),
11918 place(boostType, boostDir),
11919 doNewSend(["33", [boostDir]]);
11920}
11921
11922function boostWall() {
11923 if (boostDir == null) {
11924 boostDir = nearestEnemyAngle;
11925 }
11926 place(wallType, boostDir + toRad(90));
11927 place(wallType, boostDir - toRad(90));
11928 place(boostType, boostDir);
11929 doNewSend(["33", [boostDir]]);
11930}
11931
11932var repeater = function(i, am, cps, pro, lag) {
11933 let _isKeyDown = false;
11934 let _intervalId = undefined;
11935
11936 return {
11937 start(keycode) {
11938 if (
11939 keycode == i &&
11940 document.activeElement.id.toLowerCase() !== "chatbox"
11941 ) {
11942 _isKeyDown = true;
11943 if (_intervalId === undefined) {
11944 _intervalId = setInterval(() => {
11945 am();
11946 if (!_isKeyDown) {
11947 clearInterval(_intervalId);
11948 _intervalId = undefined;
11949 console.log("claered");
11950 }
11951 }, 15);
11952 }
11953 }
11954 },
11955
11956 stop(keycode) {
11957 if (
11958 keycode == i &&
11959 document.activeElement.id.toLowerCase() !== "chatbox"
11960 ) {
11961 _isKeyDown = false;
11962 }
11963 }
11964 };
11965};
11966
11967var IloveLova = false;
11968const healer = repeater(
11969 81,
11970 () => {
11971 place(foodType);
11972 },
11973 20
11974);
11975const boostPlacer = repeater(
11976 70,
11977 () => {
11978 place(boostType);
11979 },
11980 15
11981);
11982const spikePlacer = repeater(
11983 86,
11984 () => {
11985 place(spikeType);
11986 },
11987 15
11988);
11989const millPlacer = repeater(
11990 54,
11991 () => {
11992 place(millType);
11993 },
11994 20
11995);
11996const turretPlacer = repeater(
11997 56,
11998 () => {
11999 place(turretType);
12000 },
12001 60
12002);
12003const boostSpiker = repeater(0, boostSpike, 0);
12004const boostWaller = repeater(0, boostWall, 0);
12005const wallPlacer = repeater(
12006 52,
12007 () => {
12008 place(wallType);
12009 },
12010 40
12011);
12012
12013document.addEventListener("keydown", e => {
12014 spikePlacer.start(e.keyCode);
12015 healer.start(e.keyCode);
12016 boostPlacer.start(e.keyCode);
12017 boostWaller.start(e.keyCode);
12018 boostSpiker.start(e.keyCode);
12019 millPlacer.start(e.keyCode);
12020 turretPlacer.start(e.keyCode);
12021 wallPlacer.start(e.keyCode);
12022
12023 if (
12024 e.keyCode == 82 &&
12025 document.activeElement.id.toLowerCase() !== "chatbox"
12026 ) {
12027 autoinsta = true;
12028 doNewSend(["ch", ["PLAYERID:[" + myPlayer.id + "]"]]);
12029 setTimeout(() => {
12030 doNewSend(["ch", ["autoInsta:ON"]]);
12031 }, 600);
12032 }
12033 if (
12034 e.keyCode == 46 &&
12035 document.activeElement.id.toLowerCase() !== "chatbox"
12036 ) {
12037 autoinsta = false;
12038 doNewSend(["ch", ["PLAYERID:[" + myPlayer.id + "]"]]);
12039 setTimeout(() => {
12040 doNewSend(["ch", ["autoInsta:OFF"]]);
12041 }, 600);
12042 }
12043
12044 if (
12045 e.keyCode == 113 &&
12046 document.activeElement.id.toLowerCase() !== "chatbox"
12047 ) {
12048 doNewSend(["2", [nearestEnemyAngle]]);
12049 doNewSend(["5", [secondary, true]]);
12050 doNewSend(["13c", [0, 53, 0]]);
12051 doNewSend(["c", [1]]);
12052
12053 setTimeout(() => {
12054 doNewSend(["2", [nearestEnemyAngle]]);
12055 doNewSend(["6", [12]]);
12056 }, 95);
12057
12058 setTimeout(() => {
12059 doNewSend(["2", [nearestEnemyAngle]]);
12060 doNewSend(["6", [15]]);
12061 }, 185);
12062
12063 setTimeout(() => {
12064 doNewSend(["c", [0]]);
12065 }, 285);
12066 }
12067
12068 if (
12069 e.keyCode == 38 &&
12070 document.activeElement.id.toLowerCase() !== "chatbox"
12071 ) {
12072 doNewSend(["ch", ["i love lovable <3"]]);
12073 var IloveLova = true;
12074 for (let i = 0; i < 4; i++) {
12075 let angle = myPlayer.dir + toRad(i * 90);
12076 place(spikeType, angle);
12077 place(spikeType, angle);
12078 place(spikeType, angle);
12079 place(spikeType, angle);
12080 place(spikeType, angle);
12081 place(spikeType, angle);
12082 place(spikeType, angle);
12083 place(spikeType, angle);
12084 place(spikeType, angle);
12085 place(spikeType, angle);
12086 place(spikeType, angle);
12087 place(spikeType, angle);
12088 place(spikeType, angle);
12089 place(spikeType, angle);
12090 place(spikeType, angle);
12091 place(spikeType, angle);
12092 place(spikeType, angle);
12093 place(spikeType, angle);
12094 place(spikeType, angle);
12095 place(spikeType, angle);
12096 place(spikeType, angle);
12097 place(spikeType, angle);
12098 place(spikeType, angle);
12099 place(spikeType, angle);
12100 place(spikeType, angle);
12101 place(spikeType, angle);
12102 place(spikeType, angle);
12103 place(spikeType, angle);
12104 place(spikeType, angle);
12105 place(spikeType, angle);
12106 place(spikeType, angle);
12107 place(spikeType, angle);
12108 place(spikeType, angle);
12109 place(spikeType, angle);
12110 place(spikeType, angle);
12111 place(spikeType, angle);
12112 place(spikeType, angle);
12113 place(spikeType, angle);
12114 place(spikeType, angle);
12115 place(spikeType, angle);
12116 place(spikeType, angle);
12117 place(spikeType, angle);
12118 place(spikeType, angle);
12119 place(spikeType, angle);
12120 place(spikeType, angle);
12121 place(spikeType, angle);
12122 place(spikeType, angle);
12123 place(spikeType, angle);
12124 place(spikeType, angle);
12125 place(spikeType, angle);
12126 place(spikeType, angle);
12127 place(spikeType, angle);
12128 place(spikeType, angle);
12129 place(spikeType, angle);
12130 place(spikeType, angle);
12131 place(spikeType, angle);
12132 place(spikeType, angle);
12133 place(spikeType, angle);
12134 place(spikeType, angle);
12135 place(spikeType, angle);
12136 place(spikeType, angle);
12137 place(spikeType, angle);
12138 place(spikeType, angle);
12139 place(spikeType, angle);
12140 place(spikeType, angle);
12141 place(spikeType, angle);
12142 place(spikeType, angle);
12143 place(spikeType, angle);
12144 place(spikeType, angle);
12145 place(spikeType, angle);
12146 place(spikeType, angle);
12147 place(spikeType, angle);
12148 place(spikeType, angle);
12149 place(spikeType, angle);
12150 place(spikeType, angle);
12151 place(spikeType, angle);
12152 place(spikeType, angle);
12153 place(spikeType, angle);
12154 place(spikeType, angle);
12155 place(spikeType, angle);
12156 place(spikeType, angle);
12157 place(spikeType, angle);
12158 place(spikeType, angle);
12159 place(spikeType, angle);
12160 place(spikeType, angle);
12161 place(spikeType, angle);
12162 place(spikeType, angle);
12163 place(spikeType, angle);
12164 place(spikeType, angle);
12165 place(spikeType, angle);
12166 place(spikeType, angle);
12167 place(spikeType, angle);
12168 place(spikeType, angle);
12169 place(spikeType, angle);
12170 place(spikeType, angle);
12171 place(spikeType, angle);
12172 place(spikeType, angle);
12173 place(spikeType, angle);
12174 place(spikeType, angle);
12175 place(spikeType, angle);
12176 place(spikeType, angle);
12177 place(spikeType, angle);
12178 place(spikeType, angle);
12179 place(spikeType, angle);
12180 place(spikeType, angle);
12181 place(spikeType, angle);
12182 place(spikeType, angle);
12183 place(spikeType, angle);
12184 place(spikeType, angle);
12185 place(spikeType, angle);
12186 place(spikeType, angle);
12187 place(spikeType, angle);
12188 place(spikeType, angle);
12189 place(spikeType, angle);
12190 place(spikeType, angle);
12191 place(spikeType, angle);
12192 place(spikeType, angle);
12193 place(spikeType, angle);
12194 place(spikeType, angle);
12195 place(spikeType, angle);
12196 place(spikeType, angle);
12197 place(spikeType, angle);
12198 place(spikeType, angle);
12199 place(spikeType, angle);
12200 place(spikeType, angle);
12201 place(spikeType, angle);
12202 place(spikeType, angle);
12203 place(spikeType, angle);
12204 place(spikeType, angle);
12205 place(spikeType, angle);
12206 place(spikeType, angle);
12207 place(spikeType, angle);
12208 place(spikeType, angle);
12209 place(spikeType, angle);
12210 place(spikeType, angle);
12211 place(spikeType, angle);
12212 place(spikeType, angle);
12213 place(spikeType, angle);
12214 place(spikeType, angle);
12215 place(spikeType, angle);
12216 place(spikeType, angle);
12217 place(spikeType, angle);
12218 place(spikeType, angle);
12219 place(spikeType, angle);
12220 place(spikeType, angle);
12221 place(spikeType, angle);
12222 place(spikeType, angle);
12223 place(spikeType, angle);
12224 place(spikeType, angle);
12225 place(spikeType, angle);
12226 place(spikeType, angle);
12227 place(spikeType, angle);
12228 place(spikeType, angle);
12229 place(spikeType, angle);
12230 place(spikeType, angle);
12231 place(spikeType, angle);
12232 place(spikeType, angle);
12233 place(spikeType, angle);
12234 place(spikeType, angle);
12235 place(spikeType, angle);
12236 place(spikeType, angle);
12237 place(spikeType, angle);
12238 place(spikeType, angle);
12239 place(spikeType, angle);
12240 place(spikeType, angle);
12241 place(spikeType, angle);
12242 place(spikeType, angle);
12243 place(spikeType, angle);
12244 place(spikeType, angle);
12245 place(spikeType, angle);
12246 place(spikeType, angle);
12247 place(spikeType, angle);
12248 place(spikeType, angle);
12249 place(spikeType, angle);
12250 place(spikeType, angle);
12251 place(spikeType, angle);
12252 place(spikeType, angle);
12253 place(spikeType, angle);
12254 place(spikeType, angle);
12255 place(spikeType, angle);
12256 place(spikeType, angle);
12257 place(spikeType, angle);
12258 place(spikeType, angle);
12259 place(spikeType, angle);
12260 place(spikeType, angle);
12261 place(spikeType, angle);
12262 place(spikeType, angle);
12263 place(spikeType, angle);
12264 place(spikeType, angle);
12265 place(spikeType, angle);
12266 place(spikeType, angle);
12267 place(spikeType, angle);
12268 place(spikeType, angle);
12269 place(spikeType, angle);
12270 place(spikeType, angle);
12271 place(spikeType, angle);
12272 place(spikeType, angle);
12273 place(spikeType, angle);
12274 place(spikeType, angle);
12275 place(spikeType, angle);
12276 place(spikeType, angle);
12277 place(spikeType, angle);
12278 place(spikeType, angle);
12279 place(spikeType, angle);
12280 place(spikeType, angle);
12281 place(spikeType, angle);
12282 place(spikeType, angle);
12283 place(spikeType, angle);
12284 place(spikeType, angle);
12285 place(spikeType, angle);
12286 place(spikeType, angle);
12287 place(spikeType, angle);
12288 place(spikeType, angle);
12289 place(spikeType, angle);
12290 place(spikeType, angle);
12291 place(spikeType, angle);
12292 place(spikeType, angle);
12293 place(spikeType, angle);
12294 place(spikeType, angle);
12295 place(spikeType, angle);
12296 place(spikeType, angle);
12297 place(spikeType, angle);
12298 place(spikeType, angle);
12299 place(spikeType, angle);
12300 place(spikeType, angle);
12301 place(spikeType, angle);
12302 place(spikeType, angle);
12303 place(spikeType, angle);
12304 place(spikeType, angle);
12305 place(spikeType, angle);
12306 place(spikeType, angle);
12307 place(spikeType, angle);
12308 place(spikeType, angle);
12309 place(spikeType, angle);
12310 place(spikeType, angle);
12311 place(spikeType, angle);
12312 place(spikeType, angle);
12313 place(spikeType, angle);
12314 place(spikeType, angle);
12315 place(spikeType, angle);
12316 place(spikeType, angle);
12317 place(spikeType, angle);
12318 place(spikeType, angle);
12319 place(spikeType, angle);
12320 place(spikeType, angle);
12321 place(spikeType, angle);
12322 place(spikeType, angle);
12323 place(spikeType, angle);
12324 place(spikeType, angle);
12325 place(spikeType, angle);
12326 place(spikeType, angle);
12327 place(spikeType, angle);
12328 place(spikeType, angle);
12329 place(spikeType, angle);
12330 place(spikeType, angle);
12331 place(spikeType, angle);
12332 place(spikeType, angle);
12333 place(spikeType, angle);
12334 place(spikeType, angle);
12335 place(spikeType, angle);
12336 place(spikeType, angle);
12337 place(spikeType, angle);
12338 place(spikeType, angle);
12339 place(spikeType, angle);
12340 place(spikeType, angle);
12341 place(spikeType, angle);
12342 place(spikeType, angle);
12343 place(spikeType, angle);
12344 place(spikeType, angle);
12345 place(spikeType, angle);
12346 place(spikeType, angle);
12347 place(spikeType, angle);
12348 place(spikeType, angle);
12349 place(spikeType, angle);
12350 place(spikeType, angle);
12351 place(spikeType, angle);
12352 place(spikeType, angle);
12353 place(spikeType, angle);
12354 place(spikeType, angle);
12355 place(spikeType, angle);
12356 place(spikeType, angle);
12357 place(spikeType, angle);
12358 place(spikeType, angle);
12359 place(spikeType, angle);
12360 place(spikeType, angle);
12361 place(spikeType, angle);
12362 place(spikeType, angle);
12363 place(spikeType, angle);
12364 place(spikeType, angle);
12365 place(spikeType, angle);
12366 place(spikeType, angle);
12367 place(spikeType, angle);
12368 place(spikeType, angle);
12369 place(spikeType, angle);
12370 place(spikeType, angle);
12371 place(spikeType, angle);
12372 place(spikeType, angle);
12373 place(spikeType, angle);
12374 place(spikeType, angle);
12375 place(spikeType, angle);
12376 place(spikeType, angle);
12377 place(spikeType, angle);
12378 place(spikeType, angle);
12379 place(spikeType, angle);
12380 place(spikeType, angle);
12381 place(spikeType, angle);
12382 place(spikeType, angle);
12383 place(spikeType, angle);
12384 place(spikeType, angle);
12385 place(spikeType, angle);
12386 place(spikeType, angle);
12387 place(spikeType, angle);
12388 place(spikeType, angle);
12389 place(spikeType, angle);
12390 place(spikeType, angle);
12391 place(spikeType, angle);
12392 place(spikeType, angle);
12393 place(spikeType, angle);
12394 place(spikeType, angle);
12395 place(spikeType, angle);
12396 place(spikeType, angle);
12397 place(spikeType, angle);
12398 place(spikeType, angle);
12399 place(spikeType, angle);
12400 place(spikeType, angle);
12401 place(spikeType, angle);
12402 place(spikeType, angle);
12403 place(spikeType, angle);
12404 place(spikeType, angle);
12405 place(spikeType, angle);
12406 place(spikeType, angle);
12407 place(spikeType, angle);
12408 place(spikeType, angle);
12409 place(spikeType, angle);
12410 place(spikeType, angle);
12411 place(spikeType, angle);
12412 place(spikeType, angle);
12413 place(spikeType, angle);
12414 place(spikeType, angle);
12415 place(spikeType, angle);
12416 place(spikeType, angle);
12417 place(spikeType, angle);
12418 place(spikeType, angle);
12419 place(spikeType, angle);
12420 place(spikeType, angle);
12421 place(spikeType, angle);
12422 place(spikeType, angle);
12423 place(spikeType, angle);
12424 place(spikeType, angle);
12425 place(spikeType, angle);
12426 place(spikeType, angle);
12427 place(spikeType, angle);
12428 place(spikeType, angle);
12429 place(spikeType, angle);
12430 place(spikeType, angle);
12431 place(spikeType, angle);
12432 place(spikeType, angle);
12433 place(spikeType, angle);
12434 place(spikeType, angle);
12435 place(spikeType, angle);
12436 place(spikeType, angle);
12437 place(spikeType, angle);
12438 place(spikeType, angle);
12439 place(spikeType, angle);
12440 place(spikeType, angle);
12441 place(spikeType, angle);
12442 place(spikeType, angle);
12443 place(spikeType, angle);
12444 place(spikeType, angle);
12445 place(spikeType, angle);
12446 place(spikeType, angle);
12447 place(spikeType, angle);
12448 place(spikeType, angle);
12449 place(spikeType, angle);
12450 place(spikeType, angle);
12451 place(spikeType, angle);
12452 place(spikeType, angle);
12453 place(spikeType, angle);
12454 place(spikeType, angle);
12455 place(spikeType, angle);
12456 place(spikeType, angle);
12457 place(spikeType, angle);
12458 place(spikeType, angle);
12459 place(spikeType, angle);
12460 place(spikeType, angle);
12461 place(spikeType, angle);
12462 place(spikeType, angle);
12463 place(spikeType, angle);
12464 place(spikeType, angle);
12465 place(spikeType, angle);
12466 place(spikeType, angle);
12467 place(spikeType, angle);
12468 place(spikeType, angle);
12469 place(spikeType, angle);
12470 place(spikeType, angle);
12471 place(spikeType, angle);
12472 place(spikeType, angle);
12473 place(spikeType, angle);
12474 place(spikeType, angle);
12475 place(spikeType, angle);
12476 place(spikeType, angle);
12477 place(spikeType, angle);
12478 place(spikeType, angle);
12479 place(spikeType, angle);
12480 place(spikeType, angle);
12481 place(spikeType, angle);
12482 place(spikeType, angle);
12483 place(spikeType, angle);
12484 place(spikeType, angle);
12485 place(spikeType, angle);
12486 place(spikeType, angle);
12487 place(spikeType, angle);
12488 place(spikeType, angle);
12489 place(spikeType, angle);
12490 place(spikeType, angle);
12491 place(spikeType, angle);
12492 place(spikeType, angle);
12493 place(spikeType, angle);
12494 place(spikeType, angle);
12495 place(spikeType, angle);
12496 place(spikeType, angle);
12497 place(spikeType, angle);
12498 place(spikeType, angle);
12499 place(spikeType, angle);
12500 place(spikeType, angle);
12501 place(spikeType, angle);
12502 place(spikeType, angle);
12503 place(spikeType, angle);
12504 place(spikeType, angle);
12505 place(spikeType, angle);
12506 place(spikeType, angle);
12507 place(spikeType, angle);
12508 place(spikeType, angle);
12509 place(spikeType, angle);
12510 place(spikeType, angle);
12511 place(spikeType, angle);
12512 place(spikeType, angle);
12513 place(spikeType, angle);
12514 place(spikeType, angle);
12515 place(spikeType, angle);
12516 place(spikeType, angle);
12517 place(spikeType, angle);
12518 place(spikeType, angle);
12519 place(spikeType, angle);
12520 place(spikeType, angle);
12521 place(spikeType, angle);
12522 place(spikeType, angle);
12523 place(spikeType, angle);
12524 place(spikeType, angle);
12525 place(spikeType, angle);
12526 place(spikeType, angle);
12527 place(spikeType, angle);
12528 place(spikeType, angle);
12529 place(spikeType, angle);
12530 place(spikeType, angle);
12531 place(spikeType, angle);
12532 place(spikeType, angle);
12533 place(spikeType, angle);
12534 place(spikeType, angle);
12535 place(spikeType, angle);
12536 place(spikeType, angle);
12537 place(spikeType, angle);
12538 place(spikeType, angle);
12539 place(spikeType, angle);
12540 place(spikeType, angle);
12541 place(spikeType, angle);
12542 place(spikeType, angle);
12543 place(spikeType, angle);
12544 place(spikeType, angle);
12545 place(spikeType, angle);
12546 place(spikeType, angle);
12547 place(spikeType, angle);
12548 place(spikeType, angle);
12549 place(spikeType, angle);
12550 place(spikeType, angle);
12551 place(spikeType, angle);
12552 place(spikeType, angle);
12553 place(spikeType, angle);
12554 place(spikeType, angle);
12555 place(spikeType, angle);
12556 place(spikeType, angle);
12557 place(spikeType, angle);
12558 place(spikeType, angle);
12559 place(spikeType, angle);
12560 place(spikeType, angle);
12561 place(spikeType, angle);
12562 place(spikeType, angle);
12563 place(spikeType, angle);
12564 place(spikeType, angle);
12565 place(spikeType, angle);
12566 place(spikeType, angle);
12567 place(spikeType, angle);
12568 place(spikeType, angle);
12569 place(spikeType, angle);
12570 place(spikeType, angle);
12571 place(spikeType, angle);
12572 place(spikeType, angle);
12573 place(spikeType, angle);
12574 place(spikeType, angle);
12575 place(spikeType, angle);
12576 place(spikeType, angle);
12577 place(spikeType, angle);
12578 place(spikeType, angle);
12579 place(spikeType, angle);
12580 place(spikeType, angle);
12581 place(spikeType, angle);
12582 place(spikeType, angle);
12583 place(spikeType, angle);
12584 place(spikeType, angle);
12585 place(spikeType, angle);
12586 place(spikeType, angle);
12587 place(spikeType, angle);
12588 place(spikeType, angle);
12589 place(spikeType, angle);
12590 place(spikeType, angle);
12591 place(spikeType, angle);
12592 place(spikeType, angle);
12593 place(spikeType, angle);
12594 place(spikeType, angle);
12595 place(spikeType, angle);
12596 place(spikeType, angle);
12597 place(spikeType, angle);
12598 place(spikeType, angle);
12599 place(spikeType, angle);
12600 place(spikeType, angle);
12601 place(spikeType, angle);
12602 place(spikeType, angle);
12603 place(spikeType, angle);
12604 place(spikeType, angle);
12605 place(spikeType, angle);
12606 place(spikeType, angle);
12607 place(spikeType, angle);
12608 place(spikeType, angle);
12609 place(spikeType, angle);
12610 place(spikeType, angle);
12611 place(spikeType, angle);
12612 place(spikeType, angle);
12613 place(spikeType, angle);
12614 place(spikeType, angle);
12615 place(spikeType, angle);
12616 place(spikeType, angle);
12617 place(spikeType, angle);
12618 place(spikeType, angle);
12619 place(spikeType, angle);
12620 place(spikeType, angle);
12621 place(spikeType, angle);
12622 place(spikeType, angle);
12623 place(spikeType, angle);
12624 place(spikeType, angle);
12625 place(spikeType, angle);
12626 place(spikeType, angle);
12627 place(spikeType, angle);
12628 place(spikeType, angle);
12629 place(spikeType, angle);
12630 place(spikeType, angle);
12631 place(spikeType, angle);
12632 place(spikeType, angle);
12633 place(spikeType, angle);
12634 place(spikeType, angle);
12635 place(spikeType, angle);
12636 place(spikeType, angle);
12637 place(spikeType, angle);
12638 place(spikeType, angle);
12639 place(spikeType, angle);
12640 place(spikeType, angle);
12641 place(spikeType, angle);
12642 place(spikeType, angle);
12643 place(spikeType, angle);
12644 place(spikeType, angle);
12645 place(spikeType, angle);
12646 place(spikeType, angle);
12647 place(spikeType, angle);
12648 place(spikeType, angle);
12649 place(spikeType, angle);
12650 place(spikeType, angle);
12651 place(spikeType, angle);
12652 place(spikeType, angle);
12653 place(spikeType, angle);
12654 place(spikeType, angle);
12655 place(spikeType, angle);
12656 place(spikeType, angle);
12657 place(spikeType, angle);
12658 place(spikeType, angle);
12659 place(spikeType, angle);
12660 place(spikeType, angle);
12661 place(spikeType, angle);
12662 place(spikeType, angle);
12663 place(spikeType, angle);
12664 place(spikeType, angle);
12665 place(spikeType, angle);
12666 place(spikeType, angle);
12667 place(spikeType, angle);
12668 place(spikeType, angle);
12669 place(spikeType, angle);
12670 place(spikeType, angle);
12671 place(spikeType, angle);
12672 place(spikeType, angle);
12673 place(spikeType, angle);
12674 place(spikeType, angle);
12675 place(spikeType, angle);
12676 place(spikeType, angle);
12677 place(spikeType, angle);
12678 place(spikeType, angle);
12679 place(spikeType, angle);
12680 place(spikeType, angle);
12681 place(spikeType, angle);
12682 place(spikeType, angle);
12683 place(spikeType, angle);
12684 place(spikeType, angle);
12685 place(spikeType, angle);
12686 place(spikeType, angle);
12687 place(spikeType, angle);
12688 place(spikeType, angle);
12689 place(spikeType, angle);
12690 place(spikeType, angle);
12691 place(spikeType, angle);
12692 place(spikeType, angle);
12693 place(spikeType, angle);
12694 place(spikeType, angle);
12695 place(spikeType, angle);
12696 place(spikeType, angle);
12697 place(spikeType, angle);
12698 place(spikeType, angle);
12699 place(spikeType, angle);
12700 place(spikeType, angle);
12701 place(spikeType, angle);
12702 place(spikeType, angle);
12703 place(spikeType, angle);
12704 place(spikeType, angle);
12705 place(spikeType, angle);
12706 place(spikeType, angle);
12707 place(spikeType, angle);
12708 place(spikeType, angle);
12709 place(spikeType, angle);
12710 place(spikeType, angle);
12711 place(spikeType, angle);
12712 place(spikeType, angle);
12713 place(spikeType, angle);
12714 place(spikeType, angle);
12715 place(spikeType, angle);
12716 place(spikeType, angle);
12717 place(spikeType, angle);
12718 place(spikeType, angle);
12719 place(spikeType, angle);
12720 place(spikeType, angle);
12721 place(spikeType, angle);
12722 place(spikeType, angle);
12723 place(spikeType, angle);
12724 place(spikeType, angle);
12725 place(spikeType, angle);
12726 place(spikeType, angle);
12727 place(spikeType, angle);
12728 place(spikeType, angle);
12729 place(spikeType, angle);
12730 place(spikeType, angle);
12731 place(spikeType, angle);
12732 place(spikeType, angle);
12733 place(spikeType, angle);
12734 place(spikeType, angle);
12735 place(spikeType, angle);
12736 place(spikeType, angle);
12737 place(spikeType, angle);
12738 place(spikeType, angle);
12739 place(spikeType, angle);
12740 place(spikeType, angle);
12741 place(spikeType, angle);
12742 place(spikeType, angle);
12743 place(spikeType, angle);
12744 place(spikeType, angle);
12745 place(spikeType, angle);
12746 place(spikeType, angle);
12747 place(spikeType, angle);
12748 place(spikeType, angle);
12749 place(spikeType, angle);
12750 place(spikeType, angle);
12751 place(spikeType, angle);
12752 place(spikeType, angle);
12753 place(spikeType, angle);
12754 place(spikeType, angle);
12755 place(spikeType, angle);
12756 place(spikeType, angle);
12757 place(spikeType, angle);
12758 place(spikeType, angle);
12759 place(spikeType, angle);
12760 place(spikeType, angle);
12761 place(spikeType, angle);
12762 place(spikeType, angle);
12763 place(spikeType, angle);
12764 place(spikeType, angle);
12765 place(spikeType, angle);
12766 place(spikeType, angle);
12767 place(spikeType, angle);
12768 place(spikeType, angle);
12769 place(spikeType, angle);
12770 place(spikeType, angle);
12771 place(spikeType, angle);
12772 place(spikeType, angle);
12773 place(spikeType, angle);
12774 place(spikeType, angle);
12775 place(spikeType, angle);
12776 place(spikeType, angle);
12777 place(spikeType, angle);
12778 place(spikeType, angle);
12779 place(spikeType, angle);
12780 place(spikeType, angle);
12781 place(spikeType, angle);
12782 place(spikeType, angle);
12783 place(spikeType, angle);
12784 place(spikeType, angle);
12785 place(spikeType, angle);
12786 place(spikeType, angle);
12787 place(spikeType, angle);
12788 place(spikeType, angle);
12789 place(spikeType, angle);
12790 place(spikeType, angle);
12791 place(spikeType, angle);
12792 place(spikeType, angle);
12793 place(spikeType, angle);
12794 place(spikeType, angle);
12795 place(spikeType, angle);
12796 place(spikeType, angle);
12797 place(spikeType, angle);
12798 place(spikeType, angle);
12799 place(spikeType, angle);
12800 place(spikeType, angle);
12801 place(spikeType, angle);
12802 place(spikeType, angle);
12803 place(spikeType, angle);
12804 place(spikeType, angle);
12805 place(spikeType, angle);
12806 place(spikeType, angle);
12807 place(spikeType, angle);
12808 place(spikeType, angle);
12809 place(spikeType, angle);
12810 place(spikeType, angle);
12811 place(spikeType, angle);
12812 place(spikeType, angle);
12813 place(spikeType, angle);
12814 place(spikeType, angle);
12815 place(spikeType, angle);
12816 place(spikeType, angle);
12817 place(spikeType, angle);
12818 place(spikeType, angle);
12819 place(spikeType, angle);
12820 place(spikeType, angle);
12821 place(spikeType, angle);
12822 place(spikeType, angle);
12823 place(spikeType, angle);
12824 place(spikeType, angle);
12825 place(spikeType, angle);
12826 place(spikeType, angle);
12827 place(spikeType, angle);
12828 place(spikeType, angle);
12829 place(spikeType, angle);
12830 place(spikeType, angle);
12831 place(spikeType, angle);
12832 place(spikeType, angle);
12833 place(spikeType, angle);
12834 place(spikeType, angle);
12835 place(spikeType, angle);
12836 place(spikeType, angle);
12837 place(spikeType, angle);
12838 place(spikeType, angle);
12839 place(spikeType, angle);
12840 place(spikeType, angle);
12841 place(spikeType, angle);
12842 place(spikeType, angle);
12843 place(spikeType, angle);
12844 place(spikeType, angle);
12845 place(spikeType, angle);
12846 place(spikeType, angle);
12847 place(spikeType, angle);
12848 place(spikeType, angle);
12849 place(spikeType, angle);
12850 place(spikeType, angle);
12851 IloveLova = false;
12852 }
12853 }
12854
12855 if (
12856 e.keyCode == 16 &&
12857 document.activeElement.id.toLowerCase() !== "chatbox"
12858 ) {
12859 doNewSend(["13c", [0, 0, 1]]);
12860 }
12861 if (
12862 e.keyCode == 89 &&
12863 document.activeElement.id.toLowerCase() !== "chatbox"
12864 ) {
12865 doNewSend(["13c", [0, 19, 1]]);
12866 }
12867 if (
12868 e.keyCode == 72 &&
12869 document.activeElement.id.toLowerCase() !== "chatbox"
12870 ) {
12871 doNewSend(["13c", [0, 21, 1]]);
12872 }
12873 if (
12874 e.keyCode == 66 &&
12875 document.activeElement.id.toLowerCase() !== "chatbox"
12876 ) {
12877 doNewSend(["13c", [0, 13, 1]]);
12878 }
12879
12880 if (
12881 e.keyCode == 40 &&
12882 document.activeElement.id.toLowerCase() !== "chatbox"
12883 ) {
12884 asd = (asd + 1) % 2;
12885 if (hatToggle == 0) {
12886 if (asd == 0) {
12887 doNewSend(["ch", ["AutohealFast:OFF[" + myPlayer.id + "]"]]);
12888 } else {
12889 doNewSend(["ch", ["AutohealFast:ON[" + myPlayer.id + "]"]]);
12890 }
12891 } else {
12892 if (asd == 0) {
12893 doNewSend(["ch", ["AutohealFast:OFF[" + myPlayer.id + "]"]]);
12894 } else {
12895 doNewSend(["ch", ["AutohealFast:ON[" + myPlayer.id + "]"]]);
12896 }
12897 }
12898 }
12899});
12900
12901document.addEventListener("keyup", e => {
12902 spikePlacer.stop(e.keyCode);
12903 boostPlacer.stop(e.keyCode);
12904 boostWaller.stop(e.keyCode);
12905 boostSpiker.stop(e.keyCode);
12906 millPlacer.stop(e.keyCode);
12907 turretPlacer.stop(e.keyCode);
12908 wallPlacer.stop(e.keyCode);
12909 healer.stop(e.keyCode);
12910 if (e.keyCode == 0 && document.activeElement.id.toLowerCase() !== "chatbox") {
12911 setTimeout(() => {
12912 doNewSend(["33", [null]]);
12913 boostDir = null;
12914 }, 10);
12915 }
12916});
12917function isElementVisible(e) {
12918 return e.offsetParent !== null;
12919}
12920
12921function toRad(angle) {
12922 return angle * (Math.PI / 180);
12923}
12924function dist(a, b) {
12925 return Math.sqrt(Math.pow(b.y - a[2], 2) + Math.pow(b.x - a[1], 2));
12926}
12927
12928function update() {
12929 for (let i = 0; i < 9; i++) {
12930 if (
12931 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12932 ) {
12933 primary = i;
12934 }
12935 }
12936
12937 for (let i = 9; i < 16; i++) {
12938 if (
12939 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12940 ) {
12941 secondary = i;
12942 }
12943 }
12944
12945 for (let i = 16; i < 19; i++) {
12946 if (
12947 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12948 ) {
12949 foodType = i - 16;
12950 }
12951 }
12952
12953 for (let i = 19; i < 22; i++) {
12954 if (
12955 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12956 ) {
12957 wallType = i - 16;
12958 }
12959 }
12960
12961 for (let i = 22; i < 26; i++) {
12962 if (
12963 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12964 ) {
12965 spikeType = i - 16;
12966 }
12967 }
12968
12969 for (let i = 26; i < 29; i++) {
12970 if (
12971 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12972 ) {
12973 millType = i - 16;
12974 }
12975 }
12976
12977 for (let i = 29; i < 31; i++) {
12978 if (
12979 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12980 ) {
12981 mineType = i - 16;
12982 }
12983 }
12984
12985 for (let i = 31; i < 33; i++) {
12986 if (
12987 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12988 ) {
12989 boostType = i - 16;
12990 }
12991 }
12992
12993 for (let i = 33; i < 36; i++) {
12994 if (
12995 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
12996 ) {
12997 turretType = i - 16;
12998 }
12999 }
13000
13001 for (let i = 36; i < 37; i++) {
13002 if (
13003 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
13004 ) {
13005 spawnpadType = i - 16;
13006 }
13007 }
13008
13009 for (let i = 37; i < 39; i++) {
13010 if (
13011 isElementVisible(document.getElementById("actionBarItem" + i.toString()))
13012 ) {
13013 turretType = i - 16;
13014 }
13015 }
13016}
13017function createTribe(name) {
13018 leaveTribe();
13019 doNewSend(["8", [name]]);
13020}
13021
13022function leaveTribe() {
13023 doNewSend(["9", [null]]);
13024}
13025// ==UserScript==
13026// @name Hats
13027// @namespace
13028// @version 2
13029// @description try to take over the world!
13030// @author Lovable
13031// @match *://moomoo.io/*
13032// @match *://dev.moomoo.io/*
13033// @match *://sandbox.moomoo.io/*
13034// @grant none
13035// ==/UserScript==
13036
13037var menuChange = document.createElement("div");
13038menuChange.className = "menuCard";
13039menuChange.id = "mainSettings";
13040menuChange.innerHTML = `
13041 <div id="simpleModal" class="modal">
13042 <div class="modal-content">
13043 <div class="modal-header">
13044 <span class="closeBtn">×</span>
13045 <h2 style="font-size: 17px;">Settings</h2>
13046 </div>
13047 <div class="modal-body" style="font-size: 15px;">
13048 <div class="flexControl">
13049 <label class="container">anti Trap
13050 <input type="checkbox" id="a01">
13051 <span class="checkmark"></span></label>
13052 <label class="container">Show Players Name
13053 <input type="checkbox" id="a0">
13054 <span class="checkmark"></span></label>
13055 <label class="container">Animal Radar
13056 <input type="checkbox" id="a1">
13057 <span class="checkmark"></span></label>
13058 <label class="container">Enemy Radar
13059 <input type="checkbox" id="a2">
13060 <span class="checkmark"></span></label>
13061 <label class="container">Autoheal
13062 <input type="checkbox" id="a3">
13063 <span class="checkmark"></span></label>
13064 <label class="container">Anti Boost Spiker
13065 <input type="checkbox" id="re1">
13066 <span class="checkmark"></span></label>
13067 <label class="container">show HP
13068 <input type="checkbox" id="a4">
13069 <span class="checkmark"></span></label>
13070 </div>
13071 </div>
13072 <div class="modal-footer">
13073 </div>
13074 </div>
13075 </div>
13076 `;
13077document.body.appendChild(menuChange);
13078var styleItem1 = document.createElement("style");
13079styleItem1.type = "text/css";
13080styleItem1.appendChild(
13081 document.createTextNode(`
13082 .keyPressLow {
13083 margin-left: 8px;
13084 font-size: 16px;
13085 margin-right: 8px;
13086 height: 25px;
13087 width: 50px;
13088 background-color: #fcfcfc;
13089 border-radius: 3.5px;
13090 border: none;
13091 text-align: center;
13092 color: #4A4A4A;
13093 border: 0.5px solid #f2f2f2;
13094 }
13095 .menuPrompt {
13096 font-size: 17px;
13097 font-family: 'Hammersmith One';
13098 color: #4A4A4A;
13099 flex: 0.2;
13100 text-align: center;
13101 margin-top: 10px;
13102 display: inline-block;
13103 }
13104 .modal {
13105 display: none;
13106 position: fixed;
13107 z-index: 1;
13108 left: 0;
13109 top: 0;
13110 overflow: auto;
13111 height: 100%;
13112 width: 100%;
13113 }
13114 .modal-content {
13115 margin: 10% auto;
13116 width: 40%;
13117 box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.17);
13118 font-size: 14px;
13119 line-height: 1.6;
13120 }
13121 .modal-header h2,
13122 .modal-footer h3 {
13123 margin: 0;
13124 }
13125 .modal-header {
13126 background: #000000;
13127 padding: 15px;
13128 color: #fff;
13129 border-top-left-radius: 5px;
13130 border-top-right-radius: 5px;
13131 }
13132 .modal-body {
13133 padding: 10px 20px;
13134 background: #fff;
13135 }
13136 .modal-footer {
13137 background: #000000;
13138 padding: 10px;
13139 color: #fff;
13140 text-align: center;
13141 border-bottom-left-radius: 5px;
13142 border-bottom-right-radius: 5px;
13143 }
13144 .closeBtn {
13145 color: #000;
13146 float: right;
13147 font-size: 30px;
13148 color: red;
13149 }
13150 .closeBtn:hover,
13151 .closeBtn:focus {
13152 color: #000;
13153 text-decoration: none;
13154 cursor: pointer;
13155 }
13156 .container {
13157 display: block;
13158 position: relative;
13159 padding-left: 35px;
13160 margin-bottom: 12px;
13161 cursor: pointer;
13162 font-size: 16px;
13163 -webkit-user-select: none;
13164 -moz-user-select: none;
13165 -ms-user-select: none;
13166 user-select: none;
13167 }
13168 .container input {
13169 position: absolute;
13170 opacity: 0;
13171 cursor: pointer;
13172 height: 0;
13173 width: 0;
13174 }
13175 .checkmark {
13176 position: absolute;
13177 top: 0;
13178 left: 0;
13179 height: 25px;
13180 width: 25px;
13181 background-color: black;
13182 }
13183 .container:hover input ~ .checkmark {
13184 background-color: #ccc;
13185 }
13186 .container input:checked ~ .checkmark {
13187 background-color: #000;
13188 }
13189 .checkmark:after {
13190 content: "";
13191 position: absolute;
13192 display: none;
13193 }
13194 .container input:checked ~ .checkmark:after {
13195 display: block;
13196 }
13197 .container .checkmark:after {
13198 left: 9px;
13199 top: 5px;
13200 width: 5px;
13201 height: 10px;
13202 border: solid white;
13203 border-width: 0 3px 3px 0;
13204 -webkit-transform: rotate(45deg);
13205 -ms-transform: rotate(45deg);
13206 transform: rotate(45deg);
13207 }
13208 `)
13209);
13210document.head.appendChild(styleItem1);
13211
13212document.addEventListener("keydown", function(e) {
13213 if (e.keyCode == 27) {
13214 if ((modal.style.display = "none")) {
13215 modal.style.display = "block";
13216 } else if ((modal.style.display = "block")) {
13217 modal.style.display = "none";
13218 }
13219 }
13220});
13221
13222var modal = document.getElementById("simpleModal");
13223var closeBtn = document.getElementsByClassName("closeBtn")[0];
13224
13225closeBtn.addEventListener("click", closeModal);
13226window.addEventListener("click", outsideClick);
13227
13228function closeModal() {
13229 modal.style.display = "none";
13230}
13231function outsideClick(e) {
13232 if (e.target == modal) {
13233 modal.style.display = "none";
13234 }
13235}
13236
13237var HP;
13238var EnemyRadar;
13239var Autoheal;
13240var animalRadar;
13241var showname;
13242
13243var antiTrap1 = document.querySelector("#a01");
13244antiTrap1.addEventListener("change", function() {
13245 if (this.checked) {
13246 antiTrap = true;
13247 doNewSend(["ch", ["antiTrap:ON Player-[" + myPlayer.id + "]"]]);
13248 } else {
13249 antiTrap = false;
13250 doNewSend(["ch", ["antiTrap:OFF Player-[" + myPlayer.id + "]"]]);
13251 }
13252});
13253var showname1 = document.querySelector("#a0");
13254showname1.addEventListener("change", function() {
13255 if (this.checked) {
13256 showname = true;
13257 } else {
13258 showname = false;
13259 }
13260});
13261var animalRadar1 = document.querySelector("#a1");
13262animalRadar1.addEventListener("change", function() {
13263 if (this.checked) {
13264 animalRadar = true;
13265 } else {
13266 animalRadar = false;
13267 }
13268});
13269var EnemyRadar1 = document.querySelector("#a2");
13270EnemyRadar1.addEventListener("change", function() {
13271 if (this.checked) {
13272 EnemyRadar = true;
13273 } else {
13274 EnemyRadar = false;
13275 }
13276});
13277var AUTO1 = document.querySelector("#a3");
13278AUTO1.addEventListener("change", function() {
13279 if (this.checked) {
13280 Autoheal = true;
13281 } else {
13282 Autoheal = false;
13283 }
13284});
13285var antiSpikeB1 = document.querySelector("#re1");
13286antiSpikeB1.addEventListener("change", function() {
13287 if (this.checked) {
13288 antiSpikeB = true;
13289 } else {
13290 antiSpikeB = false;
13291 }
13292});
13293var HP1 = document.querySelector("#a4");
13294HP1.addEventListener("change", function() {
13295 if (this.checked) {
13296 HP = true;
13297 } else {
13298 HP = false;
13299 }
13300});
13301