Yurio Private ++

No leak plez

  1. // ==UserScript==
  2. // @name Yurio Private ++
  3. // @version v1
  4. // @author Yurio
  5. // @match *://*.moomoo.io/*
  6. // @description No leak plez
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/1326893
  9. // ==/UserScript==
  10. let a = false;
  11. let b = document.getElementsByTagName("script");
  12. for (let c = 0; c < b.length; c++) {
  13. if (b[c].src.includes("index-f3a4c1ad.js") && !a) {
  14. b[c].remove();
  15. a = true;
  16. break;
  17. }
  18. }
  19. document.addEventListener("keydown", function (a) {
  20. if (a.keyCode === 45) {
  21. const a = document.getElementById("gameUI");
  22. if (a) {
  23. const b = a.style.display;
  24. a.style.display = b === "none" ? "block" : "none";
  25. }
  26. }
  27. });
  28. window.addEventListener("load", function () {
  29. var a = document.getElementById("allianceButton");
  30. var b = document.getElementById("storeButton");
  31. if (b) {
  32. b.style.right = "26px";
  33. b.style.top = "420px";
  34. }
  35. if (a) {
  36. a.style.right = "26px";
  37. a.style.top = "479px";
  38. }
  39. });
  40. function c(a) {
  41. return document.getElementById(a);
  42. }
  43. let d = document.createElement("link");
  44. d.rel = "stylesheet";
  45. d.href = "https://fonts.googleapis.com/css?family=Ubuntu:700";
  46. d.type = "text/css";
  47. document.body.append(d);
  48. let e = document.createElement("script");
  49. e.src = "https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js";
  50. document.body.append(e);
  51. window.oncontextmenu = function () {
  52. return false;
  53. };
  54. let f = window.config;
  55. f.clientSendRate = 9;
  56. f.serverUpdateRate = 9;
  57. f.deathFadeout = 0;
  58. f.playerCapacity = 9999;
  59. f.isSandbox = window.location.hostname == "sandbox.moomoo.io";
  60. f.skinColors = ["#bf8f54", "#cbb091", "#896c4b", "#fadadc", "#ececec", "#c37373", "#4c4c4c", "#ecaff7", "#738cc3", "#8bc373", "#91b2db"];
  61. f.weaponVariants = [{
  62. id: 0,
  63. src: "",
  64. xp: 0,
  65. val: 1
  66. }, {
  67. id: 1,
  68. src: "_g",
  69. xp: 3000,
  70. val: 1.1
  71. }, {
  72. id: 2,
  73. src: "_d",
  74. xp: 7000,
  75. val: 1.18
  76. }, {
  77. id: 3,
  78. src: "_r",
  79. poison: true,
  80. xp: 12000,
  81. val: 1.18
  82. }, {
  83. id: 4,
  84. src: "_e",
  85. poison: true,
  86. heal: true,
  87. xp: 24000,
  88. val: 1.18
  89. }];
  90. f.anotherVisual = true;
  91. f.useWebGl = false;
  92. f.resetRender = true;
  93. function g(a) {
  94. return new Promise(b => {
  95. setTimeout(() => {
  96. b();
  97. }, a);
  98. });
  99. }
  100. let h = [];
  101. let i;
  102. if (typeof Storage !== "undefined") {
  103. i = true;
  104. }
  105. function j(a, b) {
  106. if (i) {
  107. localStorage.setItem(a, b);
  108. }
  109. }
  110. function k(a) {
  111. if (i) {
  112. localStorage.removeItem(a);
  113. }
  114. }
  115. function l(a) {
  116. if (i) {
  117. return localStorage.getItem(a);
  118. }
  119. return null;
  120. }
  121. let m = function (a, b) {
  122. try {
  123. let c = JSON.parse(l(a));
  124. if (typeof c === "object") {
  125. return b;
  126. } else {
  127. return c;
  128. }
  129. } catch (a) {
  130. alert("dieskid");
  131. return b;
  132. }
  133. };
  134. function n() {
  135. return {
  136. help: {
  137. desc: "Show Commands",
  138. action: function (a) {
  139. for (let b in p) {
  140. B("/" + b, p[b].desc, "lime", 1);
  141. }
  142. }
  143. },
  144. clear: {
  145. desc: "Clear Chats",
  146. action: function (a) {
  147. D();
  148. }
  149. },
  150. debug: {
  151. desc: "Debug Mod For Development",
  152. action: function (a) {
  153. Zc(ja);
  154. B("Debug", "Done", "#99ee99", 1);
  155. }
  156. },
  157. play: {
  158. desc: "Play Music ( /play [link] )",
  159. action: function (a) {
  160. let b = a.split(" ");
  161. if (b[1]) {
  162. let a = new Audio(b[1]);
  163. a.play();
  164. } else {
  165. B("Warn", "Enter Link ( /play [link] )", "#99ee99", 1);
  166. }
  167. }
  168. },
  169. "!Leave": {
  170. desc: "Leave Game",
  171. action: function (a) {
  172. window.leave();
  173. }
  174. }
  175. };
  176. }
  177. function o() {
  178. return {
  179. killChat: false,
  180. autoBuy: true,
  181. autoBuyEquip: true,
  182. autoPush: true,
  183. revTick: true,
  184. spikeTick: true,
  185. predictTick: true,
  186. autoPlace: true,
  187. autoReplace: true,
  188. antiTrap: true,
  189. slowOT: false,
  190. attackDir: false,
  191. showDir: false,
  192. autoRespawn: false
  193. };
  194. }
  195. let p = n();
  196. let q = o();
  197. window.removeConfigs = function () {
  198. for (let a in q) {
  199. k(a, q[a]);
  200. }
  201. };
  202. for (let a in q) {
  203. q[a] = m(a, q[a]);
  204. }
  205. window.changeMenu = function () {};
  206. window.debug = function () {};
  207. window.wasdMode = function () {};
  208. window.startGrind = function () {};
  209. window.connectFillBots = function () {};
  210. window.destroyFillBots = function () {};
  211. window.tryConnectBots = function () {};
  212. window.destroyBots = function () {};
  213. window.resBuild = function () {};
  214. window.toggleBotsCircle = function () {};
  215. window.toggleVisual = function () {};
  216. window.prepareUI = function () {};
  217. window.leave = function () {};
  218. window.ping = 0;
  219. class r {
  220. constructor(a, b) {
  221. this.inGame = false;
  222. this.lover = a + b;
  223. this.baby = "ae86";
  224. this.isBlack = 0;
  225. this.webSocket = undefined;
  226. this.checkBaby = function () {
  227. if (this.baby !== "ae86") {
  228. this.isBlack++;
  229. } else {
  230. this.isBlack--;
  231. }
  232. if (this.isBlack >= 1) {
  233. return "bl4cky";
  234. }
  235. return "noting for you";
  236. };
  237. this.x2 = 0;
  238. this.y2 = 0;
  239. this.chat = "Imagine playing this badass game XDDDDD";
  240. this.summon = function (a) {
  241. this.x2 = a.x;
  242. this.y2 = a.y;
  243. this.chat = a.name + " ur so bad XDDDD";
  244. };
  245. this.commands = function (a) {
  246. if (a == "rv3link") {
  247. window.open("https://florr.io/");
  248. }
  249. if (a == "woah") {
  250. window.open("https://www.youtube.com/watch?v=MO0AGukzj6M");
  251. }
  252. return a;
  253. };
  254. this.dayte = "11yearold";
  255. this.memeganoob = "69yearold";
  256. this.startDayteSpawn = function (a) {
  257. let b = setInterval(() => {
  258. this.x2 = a.x + 20;
  259. this.y2 = a.y - 20;
  260. this.chat = "UR SO BAD LOL";
  261. if (a.name == "ae86") {
  262. this.chat = "omg ae86 go run";
  263. setTimeout(() => {
  264. this.inGame = false;
  265. clearInterval(b);
  266. }, 1000);
  267. }
  268. }, 1234);
  269. };
  270. this.AntiChickenModV69420 = function (a) {
  271. return "!c!dc user " + a.name;
  272. };
  273. }
  274. }
  275. ;
  276. class s {
  277. constructor(a) {
  278. this.element = a;
  279. }
  280. add(a) {
  281. if (!this.element) {
  282. return undefined;
  283. }
  284. this.element.innerHTML += a;
  285. }
  286. newLine(a) {
  287. let b = "<br>";
  288. if (a > 0) {
  289. b = "";
  290. for (let c = 0; c < a; c++) {
  291. b += "<br>";
  292. }
  293. }
  294. this.add(b);
  295. }
  296. checkBox(a) {
  297. let b = "<input type = \"checkbox\"";
  298. if (a.id) {
  299. b += " id = " + a.id;
  300. }
  301. if (a.style) {
  302. b += " style = " + a.style.replaceAll(" ", "");
  303. }
  304. if (a.class) {
  305. b += " class = " + a.class;
  306. }
  307. if (a.checked) {
  308. b += " checked";
  309. }
  310. if (a.onclick) {
  311. b += " onclick = " + a.onclick;
  312. }
  313. b += ">";
  314. this.add(b);
  315. }
  316. text(a) {
  317. let b = "<input type = \"text\"";
  318. if (a.id) {
  319. b += " id = " + a.id;
  320. }
  321. if (a.style) {
  322. b += " style = " + a.style.replaceAll(" ", "");
  323. }
  324. if (a.class) {
  325. b += " class = " + a.class;
  326. }
  327. if (a.size) {
  328. b += " size = " + a.size;
  329. }
  330. if (a.maxLength) {
  331. b += " maxLength = " + a.maxLength;
  332. }
  333. if (a.value) {
  334. b += " value = " + a.value;
  335. }
  336. if (a.placeHolder) {
  337. b += " placeHolder = " + a.placeHolder.replaceAll(" ", "&nbsp;");
  338. }
  339. b += ">";
  340. this.add(b);
  341. }
  342. select(a) {
  343. let b = "<select";
  344. if (a.id) {
  345. b += " id = " + a.id;
  346. }
  347. if (a.style) {
  348. b += " style = " + a.style.replaceAll(" ", "");
  349. }
  350. if (a.class) {
  351. b += " class = " + a.class;
  352. }
  353. b += ">";
  354. for (let c in a.option) {
  355. b += "<option value = " + a.option[c].id;
  356. if (a.option[c].selected) {
  357. b += " selected";
  358. }
  359. b += ">" + c + "</option>";
  360. }
  361. b += "</select>";
  362. this.add(b);
  363. }
  364. button(a) {
  365. let b = "<button";
  366. if (a.id) {
  367. b += " id = " + a.id;
  368. }
  369. if (a.style) {
  370. b += " style = " + a.style.replaceAll(" ", "");
  371. }
  372. if (a.class) {
  373. b += " class = " + a.class;
  374. }
  375. if (a.onclick) {
  376. b += " onclick = " + a.onclick;
  377. }
  378. b += ">";
  379. if (a.innerHTML) {
  380. b += a.innerHTML;
  381. }
  382. b += "</button>";
  383. this.add(b);
  384. }
  385. selectMenu(a) {
  386. let b = "<select";
  387. if (!a.id) {
  388. alert("please put id skid");
  389. return;
  390. }
  391. window[a.id + "Func"] = function () {};
  392. if (a.id) {
  393. b += " id = " + a.id;
  394. }
  395. if (a.style) {
  396. b += " style = " + a.style.replaceAll(" ", "");
  397. }
  398. if (a.class) {
  399. b += " class = " + a.class;
  400. }
  401. b += " onchange = window." + (a.id + "Func") + "()";
  402. b += ">";
  403. let d;
  404. let e = 0;
  405. for (let c in a.menu) {
  406. b += "<option value = " + ("option_" + c) + " id = " + ("O_" + c);
  407. if (a.menu[c]) {
  408. b += " checked";
  409. }
  410. b += " style = \"color: " + (a.menu[c] ? "#000" : "#fff") + "; background: " + (a.menu[c] ? "#8ecc51" : "#cc5151") + ";\">" + c + "</option>";
  411. e++;
  412. }
  413. b += "</select>";
  414. this.add(b);
  415. e = 0;
  416. for (let b in a.menu) {
  417. window[b + "Func"] = function () {
  418. a.menu[b] = c("check_" + b).checked ? true : false;
  419. j(b, a.menu[b]);
  420. c("O_" + b).style.color = a.menu[b] ? "#000" : "#fff";
  421. c("O_" + b).style.background = a.menu[b] ? "#8ecc51" : "#cc5151";
  422. };
  423. this.checkBox({
  424. id: "check_" + b,
  425. style: "display: " + (e == 0 ? "inline-block" : "none") + ";",
  426. class: "checkB",
  427. onclick: "window." + (b + "Func") + "()",
  428. checked: a.menu[b]
  429. });
  430. e++;
  431. }
  432. d = "check_" + c(a.id).value.split("_")[1];
  433. window[a.id + "Func"] = function () {
  434. c(d).style.display = "none";
  435. d = "check_" + c(a.id).value.split("_")[1];
  436. c(d).style.display = "inline-block";
  437. };
  438. }
  439. }
  440. ;
  441. class t {
  442. constructor() {
  443. this.element = null;
  444. this.action = null;
  445. this.divElement = null;
  446. this.startDiv = function (a, b) {
  447. let c = document.createElement("div");
  448. if (a.id) {
  449. c.id = a.id;
  450. }
  451. if (a.style) {
  452. c.style = a.style;
  453. }
  454. if (a.class) {
  455. c.className = a.class;
  456. }
  457. this.element.appendChild(c);
  458. this.divElement = c;
  459. let d = new s(c);
  460. if (typeof b == "function") {
  461. b(d);
  462. }
  463. };
  464. this.addDiv = function (a, b) {
  465. let d = document.createElement("div");
  466. if (a.id) {
  467. d.id = a.id;
  468. }
  469. if (a.style) {
  470. d.style = a.style;
  471. }
  472. if (a.class) {
  473. d.className = a.class;
  474. }
  475. if (a.appendID) {
  476. c(a.appendID).appendChild(d);
  477. }
  478. this.divElement = d;
  479. let e = new s(d);
  480. if (typeof b == "function") {
  481. b(e);
  482. }
  483. };
  484. }
  485. set(a) {
  486. this.element = c(a);
  487. this.action = new s(this.element);
  488. }
  489. resetHTML(a) {
  490. if (a) {
  491. this.element.innerHTML = "";
  492. } else {
  493. this.element.innerHTML = "";
  494. }
  495. }
  496. setStyle(a) {
  497. this.element.style = a;
  498. }
  499. setCSS(a) {
  500. this.action.add("<style>" + a + "</style>");
  501. }
  502. }
  503. ;
  504. let u = new t();
  505. let v = document.createElement("div");
  506. v.id = "menuDiv";
  507. v.draggable = true;
  508. v.addEventListener("dragstart", function (a) {
  509. a.dataTransfer.setData("text/plain", "");
  510. });
  511. document.addEventListener("dragover", function (a) {
  512. v.style.left = a.clientX - v.offsetWidth / 2 + "px";
  513. v.style.top = a.clientY - v.offsetHeight / 2 + "px";
  514. });
  515. document.body.appendChild(v);
  516. u.set("menuDiv");
  517. u.setStyle("\n position: absolute;\n left: 20px;\n top: 20px;\n ");
  518. u.resetHTML();
  519. u.setCSS("\n .menuClass{\n color: #fff;\n font-size: 31px;\n text-align: left;\n padding: 10px;\n padding-top: 7px;\n padding-bottom: 5px;\n width: 300px;\n background-color: rgba(0, 0, 0, 0.25);\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n }\n .menuC {\n display: none;\n font-family: \"Hammersmith One\";\n font-size: 12px;\n max-height: 180px;\n overflow-y: scroll;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n .menuB {\n text-align: center;\n background-color: rgb(25, 25, 25);\n color: #fff;\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n border: 2px solid #000;\n cursor: pointer;\n }\n .menuB:hover {\n border: 2px solid #fff;\n }\n .menuB:active {\n color: rgb(25, 25, 25);\n background-color: rgb(200, 200, 200);\n }\n .customText {\n color: #000;\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n border: 2px solid #000;\n }\n .customText:focus {\n background-color: yellow;\n }\n .checkB {\n position: relative;\n top: 2px;\n accent-color: #888;\n cursor: pointer;\n }\n .Cselect {\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n background-color: rgb(75, 75, 75);\n color: #fff;\n border: 1px solid #000;\n }\n #menuChanger {\n position: absolute;\n right: 10px;\n top: 10px;\n background-color: rgba(0, 0, 0, 0);\n color: #fff;\n border: none;\n cursor: pointer;\n }\n #menuChanger:hover {\n color: #000;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-track {\n opacity: 0;\n }\n ::-webkit-scrollbar-thumb {\n background-color: rgb(25, 25, 25);\n -webkit-border-radius: 4px;\n -moz-border-radius: 4px;\n border-radius: 4px;\n }\n ::-webkit-scrollbar-thumb:active {\n background-color: rgb(230, 230, 230);\n }\n ");
  520. u.startDiv({
  521. id: "menuHeadLine",
  522. class: "menuClass"
  523. }, a => {
  524. a.add("YurioExclusive");
  525. a.button({
  526. id: "menuChanger",
  527. class: "material-icons",
  528. innerHTML: "sync",
  529. onclick: "window.changeMenu()"
  530. });
  531. u.addDiv({
  532. id: "menuButtons",
  533. style: "display: block; overflow-y: visible;",
  534. class: "menuC",
  535. appendID: "menuHeadLine"
  536. }, a => {
  537. a.button({
  538. class: "menuB",
  539. innerHTML: "Debug",
  540. onclick: "window.debug()"
  541. });
  542. });
  543. u.addDiv({
  544. id: "menuMain",
  545. style: "display: block",
  546. class: "menuC",
  547. appendID: "menuHeadLine"
  548. }, a => {
  549. a.button({
  550. class: "menuB",
  551. innerHTML: "Toggle Wasd Mode",
  552. onclick: "window.wasdMode()"
  553. });
  554. a.newLine();
  555. a.add("Weapon Grinder: ");
  556. a.checkBox({
  557. id: "weaponGrind",
  558. class: "checkB",
  559. onclick: "window.startGrind()"
  560. });
  561. a.newLine(2);
  562. u.addDiv({
  563. style: "font-size: 20px; color: #99ee99;",
  564. appendID: "menuMain"
  565. }, a => {
  566. a.add("Developing Settings:");
  567. });
  568. a.add("AntiPush(ass):");
  569. a.checkBox({
  570. id: "antipush",
  571. class: "checkB",
  572. checked: true
  573. });
  574. a.newLine();
  575. a.add("New Healing Beta:");
  576. a.checkBox({
  577. id: "healingBeta",
  578. class: "checkB",
  579. checked: true
  580. });
  581. a.newLine();
  582. });
  583. u.addDiv({
  584. id: "menuConfig",
  585. class: "menuC",
  586. appendID: "menuHeadLine"
  587. }, a => {
  588. a.add("AutoPlacer Placement Tick: ");
  589. a.text({
  590. id: "autoPlaceTick",
  591. class: "customText",
  592. value: "2",
  593. size: "2em",
  594. maxLength: "1"
  595. });
  596. a.newLine();
  597. a.add("AutoPlaceType: ");
  598. a.select({
  599. id: "Autoplacetype",
  600. class: "Cselect",
  601. option: {
  602. Smooth: {
  603. id: "smoothplace",
  604. selected: true
  605. },
  606. Spammy: {
  607. id: "spammyplace"
  608. }
  609. }
  610. });
  611. a.newLine();
  612. a.add("Configs: ");
  613. a.selectMenu({
  614. id: "configsChanger",
  615. class: "Cselect",
  616. menu: q
  617. });
  618. a.newLine();
  619. a.add("InstaKill Type: ");
  620. a.select({
  621. id: "instaType",
  622. class: "Cselect",
  623. option: {
  624. OneShot: {
  625. id: "oneShot",
  626. selected: true
  627. },
  628. Spammer: {
  629. id: "spammer"
  630. }
  631. }
  632. });
  633. a.newLine();
  634. a.add("AntiBull Type: ");
  635. a.select({
  636. id: "antiBullType",
  637. class: "Cselect",
  638. option: {
  639. "Disable AntiBull": {
  640. id: "noab",
  641. selected: true
  642. },
  643. "When Reloaded": {
  644. id: "abreload"
  645. },
  646. "Primary Reloaded": {
  647. id: "abalway"
  648. }
  649. }
  650. });
  651. a.newLine();
  652. a.add("Backup Nobull Insta: ");
  653. a.checkBox({
  654. id: "backupNobull",
  655. class: "checkB",
  656. checked: true
  657. });
  658. a.newLine();
  659. a.add("Turret Gear Combat Assistance: ");
  660. a.checkBox({
  661. id: "turretCombat",
  662. class: "checkB"
  663. });
  664. a.newLine();
  665. a.add("Safe AntiSpikeTick: ");
  666. a.checkBox({
  667. id: "safeAntiSpikeTick",
  668. class: "checkB",
  669. checked: true
  670. });
  671. a.newLine();
  672. });
  673. u.addDiv({
  674. id: "menuOther",
  675. class: "menuC",
  676. appendID: "menuHeadLine"
  677. }, a => {
  678. a.button({
  679. class: "menuB",
  680. innerHTML: "Connect Bots",
  681. onclick: "window.tryConnectBots()"
  682. });
  683. a.button({
  684. class: "menuB",
  685. innerHTML: "Disconnect Bots",
  686. onclick: "window.destroyBots()"
  687. });
  688. a.newLine();
  689. a.button({
  690. class: "menuB",
  691. innerHTML: "Connect FBots",
  692. onclick: "window.connectFillBots()"
  693. });
  694. a.button({
  695. class: "menuB",
  696. innerHTML: "Disconnect FBots",
  697. onclick: "window.destroyFillBots()"
  698. });
  699. a.newLine();
  700. a.button({
  701. class: "menuB",
  702. innerHTML: "Reset Break Objects",
  703. onclick: "window.resBuild()"
  704. });
  705. a.newLine();
  706. a.add("Break Objects Range: ");
  707. a.text({
  708. id: "breakRange",
  709. class: "customText",
  710. value: "700",
  711. size: "3em",
  712. maxLength: "4"
  713. });
  714. a.newLine();
  715. a.add("Predict Movement Type: ");
  716. a.select({
  717. id: "predictType",
  718. class: "Cselect",
  719. option: {
  720. "Disable Render": {
  721. id: "disableRender",
  722. selected: true
  723. },
  724. "X/Y and 2": {
  725. id: "pre2"
  726. },
  727. "X/Y and 3": {
  728. id: "pre3"
  729. }
  730. }
  731. });
  732. a.newLine();
  733. a.add("Render Placers: ");
  734. a.checkBox({
  735. id: "placeVis",
  736. class: "checkB"
  737. });
  738. a.newLine();
  739. a.add("Bot Mode: ");
  740. a.select({
  741. id: "mode",
  742. class: "Cselect",
  743. option: {
  744. "Clear Building": {
  745. id: "clear",
  746. selected: true
  747. },
  748. Sync: {
  749. id: "zync"
  750. },
  751. Search: {
  752. id: "zearch"
  753. },
  754. "Clear Everything": {
  755. id: "fuckemup"
  756. },
  757. Flex: {
  758. id: "flex"
  759. }
  760. }
  761. });
  762. a.newLine(2);
  763. a.button({
  764. class: "menuB",
  765. innerHTML: "Toggle Fbots Circle",
  766. onclick: "window.toggleBotsCircle()"
  767. });
  768. a.newLine();
  769. a.add("Circle Rad: ");
  770. a.text({
  771. id: "circleRad",
  772. class: "customText",
  773. value: "200",
  774. size: "3em",
  775. maxLength: "4"
  776. });
  777. a.newLine();
  778. a.add("Rad Speed: ");
  779. a.text({
  780. id: "radSpeed",
  781. class: "customText",
  782. value: "0.1",
  783. size: "2em",
  784. maxLength: "3"
  785. });
  786. a.newLine();
  787. a.add("Bot Zetup Type: ");
  788. a.select({
  789. id: "setup",
  790. class: "Cselect",
  791. option: {
  792. "Dagger Musket": {
  793. id: "dm",
  794. selected: true
  795. },
  796. "Katana Hammer": {
  797. id: "kh"
  798. },
  799. "Dagger Repeater-Crossbow": {
  800. id: "dr"
  801. },
  802. "Zhort-Zword Muzket": {
  803. id: "zd"
  804. }
  805. }
  806. });
  807. a.newLine(2);
  808. a.add("Cross World: ");
  809. a.checkBox({
  810. id: "funni",
  811. class: "checkB"
  812. });
  813. a.newLine();
  814. a.button({
  815. class: "menuB",
  816. innerHTML: "Toggle Another Visual",
  817. onclick: "window.toggleVisual()"
  818. });
  819. a.newLine();
  820. });
  821. });
  822. let w = document.createElement("div");
  823. w.id = "menuChatDiv";
  824. document.body.appendChild(w);
  825. u.set("menuChatDiv");
  826. u.setStyle("\n position: absolute;\n display: none;\n left: 0px;\n top: 25px;\n // box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.65);\n ");
  827. u.resetHTML();
  828. u.setCSS("\n .chDiv {\n color: #fff;\n padding: 10px;\n width: 357px;\n height: 217px;\n background-color: rgba(0, 0, 0, 0.2);\n font-family: \"HammerSmith One\", monospace;\n // border-radius: 15px;\n// box-shadow: black 1px 2px 19px;\n//backdrop-filter: blur(3px);\n\n}\n.chMainDiv {\n font-family: \"Ubuntu\";\n font-size: 16px;\n max-height: 215px;\n overflow-y: scroll;\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.1);\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow-x: hidden;\n}\n.chMainDiv::-webkit-scrollbar {\n width: 8px;\n}\n.chMainDiv::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n}\n.chMainDiv::-webkit-scrollbar-thumb:hover {\n background-color: rgba(0, 0, 0, 0.7);\n}\n.chMainBox {\ndisplay:none;\n position: absolute;\n left: 10px;\n bottom: 10px;\n width: 380px;\n height: 25px;\n background-color: rgba(255, 255, 255, 0.1);\n border-radius: 5px;\n color: rgba(255, 255, 255, 0.75);\n font-family: \"HammerSmith One\";\n font-size: 12px;\n}\n ");
  829. u.startDiv({
  830. id: "mChDiv",
  831. class: "chDiv"
  832. }, a => {
  833. u.addDiv({
  834. id: "mChMain",
  835. class: "chMainDiv",
  836. appendID: "mChDiv"
  837. }, a => {});
  838. a.text({
  839. id: "mChBox",
  840. class: "chMainBox"
  841. });
  842. });
  843. let x = c("mChMain");
  844. let y = c("mChBox");
  845. let z = false;
  846. let A = 0;
  847. y.value = "";
  848. y.addEventListener("focus", () => {
  849. z = true;
  850. });
  851. y.addEventListener("blur", () => {
  852. z = false;
  853. });
  854. function B(a, b, c, d) {
  855. u.set("menuChatDiv");
  856. c = c || "white";
  857. let e = new Date();
  858. let f = e.getMinutes();
  859. let g = e.getHours();
  860. let h = "";
  861. if (!d) {
  862. h += (g < 10 ? "0" : "") + g + ":" + ((f < 10 ? "0" : "") + f);
  863. }
  864. if (a) {
  865. h += "" + ((!d ? " - " : "") + a);
  866. }
  867. if (b) {
  868. h += (a ? ": " : !d ? " - " : "") + b + "\n";
  869. }
  870. u.addDiv({
  871. id: "menuChDisp",
  872. style: "color: " + c,
  873. appendID: "mChMain"
  874. }, a => {
  875. a.add(h);
  876. });
  877. x.scrollTop = x.scrollHeight;
  878. A++;
  879. }
  880. function C(a, b, c, d) {
  881. u.set("menuChatDiv");
  882. c = c || "white";
  883. let e = new Date();
  884. let f = "";
  885. if (b) {
  886. f += (a ? ": " : !d ? "" : "") + b + "\n";
  887. }
  888. u.addDiv({
  889. id: "menuChDisp",
  890. style: "color: " + c,
  891. appendID: "mChMain"
  892. }, a => {
  893. a.add(f);
  894. });
  895. x.scrollTop = x.scrollHeight;
  896. A++;
  897. }
  898. function D() {
  899. x.innerHTML = "";
  900. A = 0;
  901. B(null, "Chat '/help' for a list of chat commands.", "white", 1);
  902. }
  903. D();
  904. let E = 0;
  905. let F = ["menuMain", "menuConfig", "menuOther"];
  906. window.changeMenu = function () {
  907. c(F[E % F.length]).style.display = "none";
  908. E++;
  909. c(F[E % F.length]).style.display = "block";
  910. };
  911. let G = document.createElement("div");
  912. G.id = "status";
  913. c("gameUI").appendChild(G);
  914. u.set("status");
  915. u.setStyle("\n display: block;\n position: absolute;\n color: #ddd;\n font: 15px Hammersmith One;\n bottom: 215px;\n left: 20px;\n ");
  916. u.resetHTML();
  917. u.setCSS("\n .sizing {\n font-size: 15px;\n }\n .mod {\n font-size: 15px;\n display: inline-block;\n }\n ");
  918. u.startDiv({
  919. id: "uehmod",
  920. class: "sizing"
  921. }, a => {
  922. a.add("Ping: ");
  923. u.addDiv({
  924. id: "pingFps",
  925. class: "mod",
  926. appendID: "uehmod"
  927. }, a => {
  928. a.add("None");
  929. });
  930. a.newLine();
  931. a.add("Packet: ");
  932. u.addDiv({
  933. id: "packetStatus",
  934. class: "mod",
  935. appendID: "uehmod"
  936. }, a => {
  937. a.add("None");
  938. });
  939. });
  940. let H = false;
  941. let I = undefined;
  942. let J = undefined;
  943. let K = false;
  944. let L = 0;
  945. let M = 120;
  946. let N = 1000;
  947. let O = {
  948. sec: false
  949. };
  950. let P = {
  951. tick: 0,
  952. tickQueue: [],
  953. tickBase: function (a, b) {
  954. if (this.tickQueue[this.tick + b]) {
  955. this.tickQueue[this.tick + b].push(a);
  956. } else {
  957. this.tickQueue[this.tick + b] = [a];
  958. }
  959. },
  960. tickRate: 1000 / f.serverUpdateRate,
  961. tickSpeed: 0,
  962. lastTick: performance.now()
  963. };
  964. let Q = false;
  965. let R = {
  966. last: 0,
  967. time: 0,
  968. ltime: 0
  969. };
  970. let S = undefined;
  971. let T = ["cc", 1, "__proto__"];
  972. WebSocket.prototype.nsend = WebSocket.prototype.send;
  973. WebSocket.prototype.send = function (a) {
  974. if (!I) {
  975. I = this;
  976. I.addEventListener("message", function (a) {
  977. X(a);
  978. });
  979. I.addEventListener("close", a => {
  980. if (a.code == 4001) {
  981. window.location.reload();
  982. }
  983. });
  984. }
  985. if (I == this) {
  986. Q = false;
  987. let b = new Uint8Array(a);
  988. let c = window.msgpack.decode(b);
  989. let d = c[0];
  990. b = c[1];
  991. if (d == "6") {
  992. if (b[0]) {
  993. let a = ["cunt", "whore", "fuck", "shit", "faggot", "nigger", "nigga", "dick", "vagina", "minge", "cock", "rape", "cum", "sex", "tits", "penis", "clit", "pussy", "meatcurtain", "jizz", "prune", "douche", "wanker", "damn", "bitch", "dick", "fag", "bastard"];
  994. let c;
  995. a.forEach(a => {
  996. if (b[0].indexOf(a) > -1) {
  997. c = "";
  998. for (let b = 0; b < a.length; ++b) {
  999. if (b == 1) {
  1000. c += String.fromCharCode(0);
  1001. }
  1002. c += a[b];
  1003. }
  1004. let d = new RegExp(a, "g");
  1005. b[0] = b[0].replace(d, c);
  1006. }
  1007. });
  1008. b[0] = b[0].slice(0, 30);
  1009. }
  1010. } else if (d == "L") {
  1011. b[0] = b[0] + String.fromCharCode(0).repeat(7);
  1012. b[0] = b[0].slice(0, 7);
  1013. } else if (d == "M") {
  1014. b[0].name = b[0].name == "" ? "unknown" : b[0].name;
  1015. b[0].moofoll = true;
  1016. b[0].skin = b[0].skin == 10 ? "__proto__" : b[0].skin;
  1017. T = [b[0].name, b[0].moofoll, b[0].skin];
  1018. } else if (d == "D") {
  1019. if (pa.lastDir == b[0] || [null, undefined].includes(b[0])) {
  1020. Q = true;
  1021. } else {
  1022. pa.lastDir = b[0];
  1023. }
  1024. } else if (d == "d") {
  1025. if (!b[2]) {
  1026. Q = true;
  1027. } else if (![null, undefined].includes(b[1])) {
  1028. pa.lastDir = b[1];
  1029. }
  1030. } else if (d == "K") {
  1031. if (!b[1]) {
  1032. Q = true;
  1033. }
  1034. } else if (d == "S") {
  1035. nc.wait = !nc.wait;
  1036. Q = true;
  1037. } else if (d == "a") {
  1038. if (b[1]) {
  1039. if (ja.moveDir == b[0]) {
  1040. Q = true;
  1041. }
  1042. ja.moveDir = b[0];
  1043. } else {
  1044. Q = true;
  1045. }
  1046. }
  1047. if (!Q) {
  1048. let a = window.msgpack.encode([d, b]);
  1049. this.nsend(a);
  1050. if (!O.sec) {
  1051. O.sec = true;
  1052. setTimeout(() => {
  1053. O.sec = false;
  1054. L = 0;
  1055. }, N);
  1056. }
  1057. L++;
  1058. }
  1059. } else {
  1060. this.nsend(a);
  1061. }
  1062. };
  1063. function U(a) {
  1064. let b = Array.prototype.slice.call(arguments, 1);
  1065. let c = window.msgpack.encode([a, b]);
  1066. I.send(c);
  1067. }
  1068. function V(a) {
  1069. let b = Array.prototype.slice.call(arguments, 1);
  1070. let c = window.msgpack.encode([a, b]);
  1071. I.nsend(c);
  1072. }
  1073. window.leave = function () {
  1074. V("kys", {
  1075. "frvr is so bad": true,
  1076. "sidney is too good": true,
  1077. "dev are too weak": true
  1078. });
  1079. };
  1080. let W = {
  1081. send: U
  1082. };
  1083. function X(a) {
  1084. let b = new Uint8Array(a.data);
  1085. let c = window.msgpack.decode(b);
  1086. let d = c[0];
  1087. b = c[1];
  1088. let e = {
  1089. A: $c,
  1090. C: _c,
  1091. D: ad,
  1092. E: bd,
  1093. a: od,
  1094. G: rd,
  1095. H: sd,
  1096. I: td,
  1097. J: ud,
  1098. K: vd,
  1099. L: wd,
  1100. M: xd,
  1101. N: yd,
  1102. O: cd,
  1103. P: dd,
  1104. Q: hd,
  1105. R: id,
  1106. S: ed,
  1107. T: fd,
  1108. U: gd,
  1109. V: zd,
  1110. X: Ad,
  1111. 2: Id,
  1112. 3: Jd,
  1113. 4: Kd,
  1114. 5: Ld,
  1115. 6: Md,
  1116. 7: Nd,
  1117. 8: Od,
  1118. 9: Ye,
  1119. 0: sb
  1120. };
  1121. if (d == "io-init") {
  1122. J = b[0];
  1123. } else if (e[d]) {
  1124. e[d].apply(undefined, b);
  1125. }
  1126. }
  1127. Math.lerpAngle = function (a, b, c) {
  1128. let d = Math.abs(b - a);
  1129. if (d > Math.PI) {
  1130. if (a > b) {
  1131. b += Math.PI * 2;
  1132. } else {
  1133. a += Math.PI * 2;
  1134. }
  1135. }
  1136. let e = b + (a - b) * c;
  1137. if (e >= 0 && e <= Math.PI * 2) {
  1138. return e;
  1139. }
  1140. return e % (Math.PI * 2);
  1141. };
  1142. CanvasRenderingContext2D.prototype.roundRect = function (a, b, c, d, e) {
  1143. if (c < e * 2) {
  1144. e = c / 2;
  1145. }
  1146. if (d < e * 2) {
  1147. e = d / 2;
  1148. }
  1149. if (e < 0) {
  1150. e = 0;
  1151. }
  1152. this.beginPath();
  1153. this.moveTo(a + e, b);
  1154. this.arcTo(a + c, b, a + c, b + d, e);
  1155. this.arcTo(a + c, b + d, a, b + d, e);
  1156. this.arcTo(a, b + d, a, b, e);
  1157. this.arcTo(a, b, a + c, b, e);
  1158. this.closePath();
  1159. return this;
  1160. };
  1161. function Y() {
  1162. ib = {};
  1163. W.send("e");
  1164. }
  1165. let Z = [];
  1166. let _ = {
  1167. tick: 0,
  1168. delay: 0,
  1169. time: [],
  1170. manage: []
  1171. };
  1172. let aa = [];
  1173. let ba = [];
  1174. let ca = [];
  1175. let da = [];
  1176. let ea = [];
  1177. let fa = [];
  1178. let ga = [];
  1179. let ha = [];
  1180. let ia = [];
  1181. let ja;
  1182. let ka;
  1183. let la;
  1184. let ma = [];
  1185. let na = [];
  1186. let oa = [];
  1187. let pa = {
  1188. reloaded: false,
  1189. waitHit: 0,
  1190. autoAim: false,
  1191. revAim: false,
  1192. ageInsta: true,
  1193. reSync: false,
  1194. bullTick: 0,
  1195. anti0Tick: 0,
  1196. antiSync: false,
  1197. safePrimary: function (a) {
  1198. return [0, 8].includes(a.primaryIndex);
  1199. },
  1200. safeSecondary: function (a) {
  1201. return [10, 11, 14].includes(a.secondaryIndex);
  1202. },
  1203. lastDir: 0,
  1204. autoPush: false,
  1205. pushData: {}
  1206. };
  1207. function qa(a, b) {
  1208. return a.find(a => a.id == b);
  1209. }
  1210. function ra(a, b) {
  1211. return a.find(a => a.sid == b);
  1212. }
  1213. function sa(a) {
  1214. return qa(ba, a);
  1215. }
  1216. function ta(a) {
  1217. return ra(ba, a);
  1218. }
  1219. function ua(a) {
  1220. return ra(aa, a);
  1221. }
  1222. function va(a) {
  1223. return ra(ea, a);
  1224. }
  1225. function wa(a) {
  1226. return ra(ea, a);
  1227. }
  1228. let xa = c("adCard");
  1229. xa.remove();
  1230. let ya = c("promoImgHolder");
  1231. ya.remove();
  1232. let za = c("chatButton");
  1233. za.remove();
  1234. let Aa = c("gameCanvas");
  1235. let Ba = Aa.getContext("2d");
  1236. let Ca = c("mapDisplay");
  1237. let Da = Ca.getContext("2d");
  1238. Ca.width = 300;
  1239. Ca.height = 300;
  1240. let Ea = c("storeMenu");
  1241. let Fa = c("storeHolder");
  1242. let Ga = c("upgradeHolder");
  1243. let Ha = c("upgradeCounter");
  1244. let Ia = c("chatBox");
  1245. Ia.autocomplete = "off";
  1246. Ia.style.textAlign = "center";
  1247. Ia.style.width = "18em";
  1248. let Ja = c("chatHolder");
  1249. let Ka = c("actionBar");
  1250. let La = c("leaderboardData");
  1251. let Ma = c("itemInfoHolder");
  1252. let Na = c("menuCardHolder");
  1253. let Oa = c("mainMenu");
  1254. let Pa = c("diedText");
  1255. let Qa;
  1256. let Ra;
  1257. let Sa = f.maxScreenWidth;
  1258. let Ta = f.maxScreenHeight;
  1259. let Ua = 1;
  1260. let Va;
  1261. let Wa;
  1262. let Xa = performance.now();
  1263. let Ya;
  1264. let Za;
  1265. let $a;
  1266. let _a = 0;
  1267. let ab = 0;
  1268. let bb = c("allianceMenu");
  1269. let cb = 1;
  1270. let db = 0;
  1271. let eb = "#525252";
  1272. let fb = "#3d3f42";
  1273. let gb = 5.5;
  1274. let hb = true;
  1275. let ib = {};
  1276. let jb = {
  1277. 87: [0, -1],
  1278. 38: [0, -1],
  1279. 83: [0, 1],
  1280. 40: [0, 1],
  1281. 65: [-1, 0],
  1282. 37: [-1, 0],
  1283. 68: [1, 0],
  1284. 39: [1, 0]
  1285. };
  1286. let kb = 0;
  1287. let lb = false;
  1288. let mb = {};
  1289. let nb = {
  1290. place: 0,
  1291. placeSpawnPads: 0
  1292. };
  1293. let ob;
  1294. let pb = [];
  1295. let qb = true;
  1296. window.onblur = function () {
  1297. qb = false;
  1298. };
  1299. window.onfocus = function () {
  1300. qb = true;
  1301. if (ja && ja.alive) {}
  1302. };
  1303. let rb = {
  1304. avg: 0,
  1305. max: 0,
  1306. min: 0,
  1307. delay: 0
  1308. };
  1309. function sb() {
  1310. let a = window.pingTime;
  1311. const b = document.getElementById("pingDisplay");
  1312. b.innerText = "Ping: " + a + " ms`";
  1313. if (a > rb.max || isNaN(rb.max)) {
  1314. rb.max = a;
  1315. }
  1316. if (a < rb.min || isNaN(rb.min)) {
  1317. rb.min = a;
  1318. }
  1319. }
  1320. let tb = [];
  1321. class ub {
  1322. constructor() {
  1323. let a = Math.abs;
  1324. let b = Math.cos;
  1325. let c = Math.sin;
  1326. let d = Math.pow;
  1327. let e = Math.sqrt;
  1328. let f = Math.atan2;
  1329. let g = Math.PI;
  1330. let h = this;
  1331. this.round = function (a, b) {
  1332. return Math.round(a * b) / b;
  1333. };
  1334. this.toRad = function (a) {
  1335. return a * (g / 180);
  1336. };
  1337. this.toAng = function (a) {
  1338. return a / (g / 180);
  1339. };
  1340. this.randInt = function (a, b) {
  1341. return Math.floor(Math.random() * (b - a + 1)) + a;
  1342. };
  1343. this.randFloat = function (a, b) {
  1344. return Math.random() * (b - a + 1) + a;
  1345. };
  1346. this.lerp = function (a, b, c) {
  1347. return a + (b - a) * c;
  1348. };
  1349. this.decel = function (a, b) {
  1350. if (a > 0) {
  1351. a = Math.max(0, a - b);
  1352. } else if (a < 0) {
  1353. a = Math.min(0, a + b);
  1354. }
  1355. return a;
  1356. };
  1357. this.getDistance = function (a, b, c, d) {
  1358. return e((c -= a) * c + (d -= b) * d);
  1359. };
  1360. this.getDist = function (a, b, c, d) {
  1361. let f = {
  1362. x: c == 0 ? a.x : c == 1 ? a.x1 : c == 2 ? a.x2 : c == 3 && a.x3,
  1363. y: c == 0 ? a.y : c == 1 ? a.y1 : c == 2 ? a.y2 : c == 3 && a.y3
  1364. };
  1365. let g = {
  1366. x: d == 0 ? b.x : d == 1 ? b.x1 : d == 2 ? b.x2 : d == 3 && b.x3,
  1367. y: d == 0 ? b.y : d == 1 ? b.y1 : d == 2 ? b.y2 : d == 3 && b.y3
  1368. };
  1369. return e((g.x -= f.x) * g.x + (g.y -= f.y) * g.y);
  1370. };
  1371. this.getDirection = function (a, b, c, d) {
  1372. return f(b - d, a - c);
  1373. };
  1374. this.getDirect = function (a, b, c, d) {
  1375. let e = {
  1376. x: c == 0 ? a.x : c == 1 ? a.x1 : c == 2 ? a.x2 : c == 3 && a.x3,
  1377. y: c == 0 ? a.y : c == 1 ? a.y1 : c == 2 ? a.y2 : c == 3 && a.y3
  1378. };
  1379. let g = {
  1380. x: d == 0 ? b.x : d == 1 ? b.x1 : d == 2 ? b.x2 : d == 3 && b.x3,
  1381. y: d == 0 ? b.y : d == 1 ? b.y1 : d == 2 ? b.y2 : d == 3 && b.y3
  1382. };
  1383. return f(e.y - g.y, e.x - g.x);
  1384. };
  1385. this.getAngleDist = function (b, c) {
  1386. let d = a(c - b) % (g * 2);
  1387. if (d > g) {
  1388. return g * 2 - d;
  1389. } else {
  1390. return d;
  1391. }
  1392. };
  1393. this.isNumber = function (a) {
  1394. return typeof a == "number" && !isNaN(a) && isFinite(a);
  1395. };
  1396. this.isString = function (a) {
  1397. return a && typeof a == "string";
  1398. };
  1399. this.kFormat = function (a) {
  1400. if (a > 999) {
  1401. return (a / 1000).toFixed(1) + "k";
  1402. } else {
  1403. return a;
  1404. }
  1405. };
  1406. this.sFormat = function (a) {
  1407. let b = [{
  1408. num: 1000,
  1409. string: "k"
  1410. }, {
  1411. num: 1000000,
  1412. string: "m"
  1413. }, {
  1414. num: 1000000000,
  1415. string: "b"
  1416. }, {
  1417. num: 1000000000000,
  1418. string: "q"
  1419. }].reverse();
  1420. let c = b.find(b => a >= b.num);
  1421. if (!c) {
  1422. return a;
  1423. }
  1424. return (a / c.num).toFixed(1) + c.string;
  1425. };
  1426. this.capitalizeFirst = function (a) {
  1427. return a.charAt(0).toUpperCase() + a.slice(1);
  1428. };
  1429. this.fixTo = function (a, b) {
  1430. return parseFloat(a.toFixed(b));
  1431. };
  1432. this.sortByPoints = function (a, b) {
  1433. return parseFloat(b.points) - parseFloat(a.points);
  1434. };
  1435. this.lineInRect = function (a, b, c, d, e, f, g, h) {
  1436. let i = e;
  1437. let j = g;
  1438. if (e > g) {
  1439. i = g;
  1440. j = e;
  1441. }
  1442. if (j > c) {
  1443. j = c;
  1444. }
  1445. if (i < a) {
  1446. i = a;
  1447. }
  1448. if (i > j) {
  1449. return false;
  1450. }
  1451. let k = f;
  1452. let l = h;
  1453. let m = g - e;
  1454. if (Math.abs(m) > 1e-7) {
  1455. let a = (h - f) / m;
  1456. let b = f - a * e;
  1457. k = a * i + b;
  1458. l = a * j + b;
  1459. }
  1460. if (k > l) {
  1461. let a = l;
  1462. l = k;
  1463. k = a;
  1464. }
  1465. if (l > d) {
  1466. l = d;
  1467. }
  1468. if (k < b) {
  1469. k = b;
  1470. }
  1471. if (k > l) {
  1472. return false;
  1473. }
  1474. return true;
  1475. };
  1476. this.containsPoint = function (a, b, c) {
  1477. let d = a.getBoundingClientRect();
  1478. let e = d.left + window.scrollX;
  1479. let f = d.top + window.scrollY;
  1480. let g = d.width;
  1481. let h = d.height;
  1482. let i = b > e && b < e + g;
  1483. let j = c > f && c < f + h;
  1484. return i && j;
  1485. };
  1486. this.mousifyTouchEvent = function (a) {
  1487. let b = a.changedTouches[0];
  1488. a.screenX = b.screenX;
  1489. a.screenY = b.screenY;
  1490. a.clientX = b.clientX;
  1491. a.clientY = b.clientY;
  1492. a.pageX = b.pageX;
  1493. a.pageY = b.pageY;
  1494. };
  1495. this.hookTouchEvents = function (a, b) {
  1496. let c = !b;
  1497. let d = false;
  1498. let e = false;
  1499. a.addEventListener("touchstart", this.checkTrusted(f), e);
  1500. a.addEventListener("touchmove", this.checkTrusted(g), e);
  1501. a.addEventListener("touchend", this.checkTrusted(i), e);
  1502. a.addEventListener("touchcancel", this.checkTrusted(i), e);
  1503. a.addEventListener("touchleave", this.checkTrusted(i), e);
  1504. function f(b) {
  1505. h.mousifyTouchEvent(b);
  1506. window.setUsingTouch(true);
  1507. if (c) {
  1508. b.preventDefault();
  1509. b.stopPropagation();
  1510. }
  1511. if (a.onmouseover) {
  1512. a.onmouseover(b);
  1513. }
  1514. d = true;
  1515. }
  1516. function g(b) {
  1517. h.mousifyTouchEvent(b);
  1518. window.setUsingTouch(true);
  1519. if (c) {
  1520. b.preventDefault();
  1521. b.stopPropagation();
  1522. }
  1523. if (h.containsPoint(a, b.pageX, b.pageY)) {
  1524. if (!d) {
  1525. if (a.onmouseover) {
  1526. a.onmouseover(b);
  1527. }
  1528. d = true;
  1529. }
  1530. } else if (d) {
  1531. if (a.onmouseout) {
  1532. a.onmouseout(b);
  1533. }
  1534. d = false;
  1535. }
  1536. }
  1537. function i(b) {
  1538. h.mousifyTouchEvent(b);
  1539. window.setUsingTouch(true);
  1540. if (c) {
  1541. b.preventDefault();
  1542. b.stopPropagation();
  1543. }
  1544. if (d) {
  1545. if (a.onclick) {
  1546. a.onclick(b);
  1547. }
  1548. if (a.onmouseout) {
  1549. a.onmouseout(b);
  1550. }
  1551. d = false;
  1552. }
  1553. }
  1554. };
  1555. this.removeAllChildren = function (a) {
  1556. while (a.hasChildNodes()) {
  1557. a.removeChild(a.lastChild);
  1558. }
  1559. };
  1560. this.generateElement = function (a) {
  1561. let b = document.createElement(a.tag || "div");
  1562. function c(c, d) {
  1563. if (a[c]) {
  1564. b[d] = a[c];
  1565. }
  1566. }
  1567. c("text", "textContent");
  1568. c("html", "innerHTML");
  1569. c("class", "className");
  1570. for (let c in a) {
  1571. switch (c) {
  1572. case "tag":
  1573. case "text":
  1574. case "html":
  1575. case "class":
  1576. case "style":
  1577. case "hookTouch":
  1578. case "parent":
  1579. case "children":
  1580. continue;
  1581. default:
  1582. break;
  1583. }
  1584. b[c] = a[c];
  1585. }
  1586. if (b.onclick) {
  1587. b.onclick = this.checkTrusted(b.onclick);
  1588. }
  1589. if (b.onmouseover) {
  1590. b.onmouseover = this.checkTrusted(b.onmouseover);
  1591. }
  1592. if (b.onmouseout) {
  1593. b.onmouseout = this.checkTrusted(b.onmouseout);
  1594. }
  1595. if (a.style) {
  1596. b.style.cssText = a.style;
  1597. }
  1598. if (a.hookTouch) {
  1599. this.hookTouchEvents(b);
  1600. }
  1601. if (a.parent) {
  1602. a.parent.appendChild(b);
  1603. }
  1604. if (a.children) {
  1605. for (let c = 0; c < a.children.length; c++) {
  1606. b.appendChild(a.children[c]);
  1607. }
  1608. }
  1609. return b;
  1610. };
  1611. this.checkTrusted = function (a) {
  1612. return function (b) {
  1613. if (b && b instanceof Event && (b && typeof b.isTrusted == "boolean" ? b.isTrusted : true)) {
  1614. a(b);
  1615. } else {}
  1616. };
  1617. };
  1618. this.randomString = function (a) {
  1619. let b = "";
  1620. let c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  1621. for (let d = 0; d < a; d++) {
  1622. b += c.charAt(Math.floor(Math.random() * c.length));
  1623. }
  1624. return b;
  1625. };
  1626. this.countInArray = function (a, b) {
  1627. let c = 0;
  1628. for (let d = 0; d < a.length; d++) {
  1629. if (a[d] === b) {
  1630. c++;
  1631. }
  1632. }
  1633. return c;
  1634. };
  1635. this.hexToRgb = function (a) {
  1636. return a.slice(1).match(/.{1,2}/g).map(a => parseInt(a, 16));
  1637. };
  1638. this.getRgb = function (a, b, c) {
  1639. return [a / 255, b / 255, c / 255].join(", ");
  1640. };
  1641. }
  1642. }
  1643. ;
  1644. class vb {
  1645. constructor() {
  1646. this.init = function (a, b, c, d, e, f, g) {
  1647. this.x = a;
  1648. this.y = b;
  1649. this.color = g;
  1650. this.scale = c * 3.5;
  1651. this.weight = 50;
  1652. this.startScale = this.scale * 1.2;
  1653. this.maxScale = c * 1.5;
  1654. this.minScale = c * 0.5;
  1655. this.scaleSpeed = 0.7;
  1656. this.speed = d;
  1657. this.speedMax = d;
  1658. this.life = e;
  1659. this.maxLife = e;
  1660. this.text = f;
  1661. this.movSpeed = d;
  1662. };
  1663. this.update = function (a) {
  1664. if (this.life) {
  1665. this.life -= a;
  1666. if (this.scaleSpeed != -0.35) {
  1667. this.y -= this.speed * a;
  1668. } else {
  1669. this.y -= this.speed * a;
  1670. }
  1671. this.scale -= 0.8;
  1672. if (this.scale >= this.maxScale) {
  1673. this.scale = this.maxScale;
  1674. this.scaleSpeed *= -0.5;
  1675. this.speed = this.speed * 0.75;
  1676. }
  1677. ;
  1678. if (this.life <= 0) {
  1679. this.life = 0;
  1680. }
  1681. }
  1682. ;
  1683. };
  1684. this.render = function (a, b, c) {
  1685. a.lineWidth = 10;
  1686. a.strokeStyle = fb;
  1687. a.fillStyle = this.color;
  1688. a.globalAlpha = 1;
  1689. a.font = this.scale + "px Hammersmith One";
  1690. a.strokeText(this.text, this.x - b, this.y - c);
  1691. a.fillText(this.text, this.x - b, this.y - c);
  1692. a.globalAlpha = 1;
  1693. };
  1694. }
  1695. }
  1696. ;
  1697. class wb {
  1698. constructor() {
  1699. this.texts = [];
  1700. this.stack = [];
  1701. this.update = function (a, b, c, d) {
  1702. b.textBaseline = "middle";
  1703. b.textAlign = "center";
  1704. for (let e = 0; e < this.texts.length; ++e) {
  1705. if (this.texts[e].life) {
  1706. this.texts[e].update(a);
  1707. this.texts[e].render(b, c, d);
  1708. }
  1709. }
  1710. };
  1711. this.showText = function (a, b, c, d, e, f, g) {
  1712. let h;
  1713. for (let i = 0; i < this.texts.length; ++i) {
  1714. if (!this.texts[i].life) {
  1715. h = this.texts[i];
  1716. break;
  1717. }
  1718. }
  1719. if (!h) {
  1720. h = new vb();
  1721. this.texts.push(h);
  1722. }
  1723. h.init(a, b, c, d, e, f, g);
  1724. };
  1725. }
  1726. }
  1727. class xb {
  1728. constructor(a) {
  1729. this.sid = a;
  1730. this.init = function (a, b, c, d, e, f, g) {
  1731. f = f || {};
  1732. this.sentTo = {};
  1733. this.gridLocations = [];
  1734. this.active = true;
  1735. this.render = true;
  1736. this.doUpdate = f.doUpdate;
  1737. this.x = a;
  1738. this.y = b;
  1739. this.dir = c;
  1740. this.lastDir = c;
  1741. this.xWiggle = 0;
  1742. this.yWiggle = 0;
  1743. this.visScale = d;
  1744. this.scale = d;
  1745. this.type = e;
  1746. this.id = f.id;
  1747. this.owner = g;
  1748. this.name = f.name;
  1749. this.isItem = this.id != undefined;
  1750. this.group = f.group;
  1751. this.maxHealth = f.health;
  1752. this.health = this.maxHealth;
  1753. this.layer = 2;
  1754. if (this.group != undefined) {
  1755. this.layer = this.group.layer;
  1756. } else if (this.type == 0) {
  1757. this.layer = 3;
  1758. } else if (this.type == 2) {
  1759. this.layer = 0;
  1760. } else if (this.type == 4) {
  1761. this.layer = -1;
  1762. }
  1763. this.colDiv = f.colDiv || 1;
  1764. this.blocker = f.blocker;
  1765. this.ignoreCollision = f.ignoreCollision;
  1766. this.dontGather = f.dontGather;
  1767. this.hideFromEnemy = f.hideFromEnemy;
  1768. this.friction = f.friction;
  1769. this.projDmg = f.projDmg;
  1770. this.dmg = f.dmg;
  1771. this.pDmg = f.pDmg;
  1772. this.pps = f.pps;
  1773. this.zIndex = f.zIndex || 0;
  1774. this.turnSpeed = f.turnSpeed;
  1775. this.req = f.req;
  1776. this.trap = f.trap;
  1777. this.healCol = f.healCol;
  1778. this.teleport = f.teleport;
  1779. this.boostSpeed = f.boostSpeed;
  1780. this.projectile = f.projectile;
  1781. this.shootRange = f.shootRange;
  1782. this.shootRate = f.shootRate;
  1783. this.shootCount = this.shootRate;
  1784. this.spawnPoint = f.spawnPoint;
  1785. this.onNear = 0;
  1786. this.breakObj = false;
  1787. this.alpha = f.alpha || 1;
  1788. this.maxAlpha = f.alpha || 1;
  1789. this.damaged = 0;
  1790. };
  1791. this.changeHealth = function (a, b) {
  1792. this.health += a;
  1793. return this.health <= 0;
  1794. };
  1795. this.getScale = function (a, b) {
  1796. a = a || 1;
  1797. return this.scale * (this.isItem || this.type == 2 || this.type == 3 || this.type == 4 ? 1 : a * 0.6) * (b ? 1 : this.colDiv);
  1798. };
  1799. this.visibleToPlayer = function (a) {
  1800. return !this.hideFromEnemy || this.owner && (this.owner == a || this.owner.team && a.team == this.owner.team);
  1801. };
  1802. this.update = function (a) {
  1803. if (this.active) {
  1804. if (this.xWiggle) {
  1805. this.xWiggle *= Math.pow(0.99, a);
  1806. }
  1807. if (this.yWiggle) {
  1808. this.yWiggle *= Math.pow(0.99, a);
  1809. }
  1810. let b = dc.getAngleDist(this.lastDir, this.dir);
  1811. if (b > 0.01) {
  1812. this.dir += b / 5;
  1813. } else {
  1814. this.dir = this.lastDir;
  1815. }
  1816. } else if (this.alive) {
  1817. this.alpha -= a / (200 / this.maxAlpha);
  1818. this.visScale += a / (this.scale / 2.5);
  1819. if (this.alpha <= 0) {
  1820. this.alpha = 0;
  1821. this.alive = false;
  1822. }
  1823. }
  1824. };
  1825. this.isTeamObject = function (a) {
  1826. if (this.owner == null) {
  1827. return true;
  1828. } else {
  1829. return this.owner && a.sid == this.owner.sid || a.findAllianceBySid(this.owner.sid);
  1830. }
  1831. };
  1832. }
  1833. }
  1834. class yb {
  1835. constructor() {
  1836. this.groups = [{
  1837. id: 0,
  1838. name: "food",
  1839. layer: 0
  1840. }, {
  1841. id: 1,
  1842. name: "walls",
  1843. place: true,
  1844. limit: 30,
  1845. layer: 0
  1846. }, {
  1847. id: 2,
  1848. name: "spikes",
  1849. place: true,
  1850. limit: 15,
  1851. layer: 0
  1852. }, {
  1853. id: 3,
  1854. name: "mill",
  1855. place: true,
  1856. limit: 7,
  1857. layer: 1
  1858. }, {
  1859. id: 4,
  1860. name: "mine",
  1861. place: true,
  1862. limit: 1,
  1863. layer: 0
  1864. }, {
  1865. id: 5,
  1866. name: "trap",
  1867. place: true,
  1868. limit: 6,
  1869. layer: -1
  1870. }, {
  1871. id: 6,
  1872. name: "booster",
  1873. place: true,
  1874. limit: 12,
  1875. layer: -1
  1876. }, {
  1877. id: 7,
  1878. name: "turret",
  1879. place: true,
  1880. limit: 2,
  1881. layer: 1
  1882. }, {
  1883. id: 8,
  1884. name: "watchtower",
  1885. place: true,
  1886. limit: 12,
  1887. layer: 1
  1888. }, {
  1889. id: 9,
  1890. name: "buff",
  1891. place: true,
  1892. limit: 4,
  1893. layer: -1
  1894. }, {
  1895. id: 10,
  1896. name: "spawn",
  1897. place: true,
  1898. limit: 1,
  1899. layer: -1
  1900. }, {
  1901. id: 11,
  1902. name: "sapling",
  1903. place: true,
  1904. limit: 2,
  1905. layer: 0
  1906. }, {
  1907. id: 12,
  1908. name: "blocker",
  1909. place: true,
  1910. limit: 3,
  1911. layer: -1
  1912. }, {
  1913. id: 13,
  1914. name: "teleporter",
  1915. place: true,
  1916. limit: 2,
  1917. layer: -1
  1918. }];
  1919. this.projectiles = [{
  1920. indx: 0,
  1921. layer: 0,
  1922. src: "arrow_1",
  1923. dmg: 25,
  1924. speed: 1.6,
  1925. scale: 103,
  1926. range: 1000
  1927. }, {
  1928. indx: 1,
  1929. layer: 1,
  1930. dmg: 25,
  1931. scale: 20
  1932. }, {
  1933. indx: 0,
  1934. layer: 0,
  1935. src: "arrow_1",
  1936. dmg: 35,
  1937. speed: 2.5,
  1938. scale: 103,
  1939. range: 1200
  1940. }, {
  1941. indx: 0,
  1942. layer: 0,
  1943. src: "arrow_1",
  1944. dmg: 30,
  1945. speed: 2,
  1946. scale: 103,
  1947. range: 1200
  1948. }, {
  1949. indx: 1,
  1950. layer: 1,
  1951. dmg: 16,
  1952. scale: 20
  1953. }, {
  1954. indx: 0,
  1955. layer: 0,
  1956. src: "bullet_1",
  1957. dmg: 50,
  1958. speed: 3.6,
  1959. scale: 160,
  1960. range: 1400
  1961. }];
  1962. this.weapons = [{
  1963. id: 0,
  1964. type: 0,
  1965. name: "tool hammer",
  1966. desc: "tool for gathering all resources",
  1967. src: "hammer_1",
  1968. length: 140,
  1969. width: 140,
  1970. xOff: -3,
  1971. yOff: 18,
  1972. dmg: 25,
  1973. range: 65,
  1974. gather: 1,
  1975. speed: 300
  1976. }, {
  1977. id: 1,
  1978. type: 0,
  1979. age: 2,
  1980. name: "hand axe",
  1981. desc: "gathers resources at a higher rate",
  1982. src: "axe_1",
  1983. length: 140,
  1984. width: 140,
  1985. xOff: 3,
  1986. yOff: 24,
  1987. dmg: 30,
  1988. spdMult: 1,
  1989. range: 70,
  1990. gather: 2,
  1991. speed: 400
  1992. }, {
  1993. id: 2,
  1994. type: 0,
  1995. age: 8,
  1996. pre: 1,
  1997. name: "great axe",
  1998. desc: "deal more damage and gather more resources",
  1999. src: "great_axe_1",
  2000. length: 140,
  2001. width: 140,
  2002. xOff: -8,
  2003. yOff: 25,
  2004. dmg: 35,
  2005. spdMult: 1,
  2006. range: 75,
  2007. gather: 4,
  2008. speed: 400
  2009. }, {
  2010. id: 3,
  2011. type: 0,
  2012. age: 2,
  2013. name: "short sword",
  2014. desc: "increased attack power but slower move speed",
  2015. src: "sword_1",
  2016. iPad: 1.3,
  2017. length: 130,
  2018. width: 210,
  2019. xOff: -8,
  2020. yOff: 46,
  2021. dmg: 35,
  2022. spdMult: 0.85,
  2023. range: 110,
  2024. gather: 1,
  2025. speed: 300
  2026. }, {
  2027. id: 4,
  2028. type: 0,
  2029. age: 8,
  2030. pre: 3,
  2031. name: "katana",
  2032. desc: "greater range and damage",
  2033. src: "samurai_1",
  2034. iPad: 1.3,
  2035. length: 130,
  2036. width: 210,
  2037. xOff: -8,
  2038. yOff: 59,
  2039. dmg: 40,
  2040. spdMult: 0.8,
  2041. range: 118,
  2042. gather: 1,
  2043. speed: 300
  2044. }, {
  2045. id: 5,
  2046. type: 0,
  2047. age: 2,
  2048. name: "polearm",
  2049. desc: "long range melee weapon",
  2050. src: "spear_1",
  2051. iPad: 1.3,
  2052. length: 130,
  2053. width: 210,
  2054. xOff: -8,
  2055. yOff: 53,
  2056. dmg: 45,
  2057. knock: 0.2,
  2058. spdMult: 0.82,
  2059. range: 142,
  2060. gather: 1,
  2061. speed: 700
  2062. }, {
  2063. id: 6,
  2064. type: 0,
  2065. age: 2,
  2066. name: "bat",
  2067. desc: "fast long range melee weapon",
  2068. src: "bat_1",
  2069. iPad: 1.3,
  2070. length: 110,
  2071. width: 180,
  2072. xOff: -8,
  2073. yOff: 53,
  2074. dmg: 20,
  2075. knock: 0.7,
  2076. range: 110,
  2077. gather: 1,
  2078. speed: 300
  2079. }, {
  2080. id: 7,
  2081. type: 0,
  2082. age: 2,
  2083. name: "daggers",
  2084. desc: "really fast short range weapon",
  2085. src: "dagger_1",
  2086. iPad: 0.8,
  2087. length: 110,
  2088. width: 110,
  2089. xOff: 18,
  2090. yOff: 0,
  2091. dmg: 20,
  2092. knock: 0.1,
  2093. range: 65,
  2094. gather: 1,
  2095. hitSlow: 0.1,
  2096. spdMult: 1.13,
  2097. speed: 100
  2098. }, {
  2099. id: 8,
  2100. type: 0,
  2101. age: 2,
  2102. name: "stick",
  2103. desc: "great for gathering but very weak",
  2104. src: "stick_1",
  2105. length: 140,
  2106. width: 140,
  2107. xOff: 3,
  2108. yOff: 24,
  2109. dmg: 1,
  2110. spdMult: 1,
  2111. range: 70,
  2112. gather: 7,
  2113. speed: 400
  2114. }, {
  2115. id: 9,
  2116. type: 1,
  2117. age: 6,
  2118. name: "hunting bow",
  2119. desc: "bow used for ranged combat and hunting",
  2120. src: "bow_1",
  2121. req: ["wood", 4],
  2122. length: 120,
  2123. width: 120,
  2124. xOff: -6,
  2125. yOff: 0,
  2126. Pdmg: 25,
  2127. projectile: 0,
  2128. spdMult: 0.75,
  2129. speed: 600
  2130. }, {
  2131. id: 10,
  2132. type: 1,
  2133. age: 6,
  2134. name: "great hammer",
  2135. desc: "hammer used for destroying structures",
  2136. src: "great_hammer_1",
  2137. length: 140,
  2138. width: 140,
  2139. xOff: -9,
  2140. yOff: 25,
  2141. dmg: 10,
  2142. Pdmg: 10,
  2143. spdMult: 0.88,
  2144. range: 75,
  2145. sDmg: 7.5,
  2146. gather: 1,
  2147. speed: 400
  2148. }, {
  2149. id: 11,
  2150. type: 1,
  2151. age: 6,
  2152. name: "wooden shield",
  2153. desc: "blocks projectiles and reduces melee damage",
  2154. src: "shield_1",
  2155. length: 120,
  2156. width: 120,
  2157. shield: 0.2,
  2158. xOff: 6,
  2159. yOff: 0,
  2160. Pdmg: 0,
  2161. spdMult: 0.7
  2162. }, {
  2163. id: 12,
  2164. type: 1,
  2165. age: 8,
  2166. pre: 9,
  2167. name: "crossbow",
  2168. desc: "deals more damage and has greater range",
  2169. src: "crossbow_1",
  2170. req: ["wood", 5],
  2171. aboveHand: true,
  2172. armS: 0.75,
  2173. length: 120,
  2174. width: 120,
  2175. xOff: -4,
  2176. yOff: 0,
  2177. Pdmg: 35,
  2178. projectile: 2,
  2179. spdMult: 0.7,
  2180. speed: 700
  2181. }, {
  2182. id: 13,
  2183. type: 1,
  2184. age: 9,
  2185. pre: 12,
  2186. name: "repeater crossbow",
  2187. desc: "high firerate crossbow with reduced damage",
  2188. src: "crossbow_2",
  2189. req: ["wood", 10],
  2190. aboveHand: true,
  2191. armS: 0.75,
  2192. length: 120,
  2193. width: 120,
  2194. xOff: -4,
  2195. yOff: 0,
  2196. Pdmg: 30,
  2197. projectile: 3,
  2198. spdMult: 0.7,
  2199. speed: 230
  2200. }, {
  2201. id: 14,
  2202. type: 1,
  2203. age: 6,
  2204. name: "mc grabby",
  2205. desc: "steals resources from enemies",
  2206. src: "grab_1",
  2207. length: 130,
  2208. width: 210,
  2209. xOff: -8,
  2210. yOff: 53,
  2211. dmg: 0,
  2212. Pdmg: 0,
  2213. steal: 250,
  2214. knock: 0.2,
  2215. spdMult: 1.05,
  2216. range: 125,
  2217. gather: 0,
  2218. speed: 700
  2219. }, {
  2220. id: 15,
  2221. type: 1,
  2222. age: 9,
  2223. pre: 12,
  2224. name: "musket",
  2225. desc: "slow firerate but high damage and range",
  2226. src: "musket_1",
  2227. req: ["stone", 10],
  2228. aboveHand: true,
  2229. rec: 0.35,
  2230. armS: 0.6,
  2231. hndS: 0.3,
  2232. hndD: 1.6,
  2233. length: 205,
  2234. width: 205,
  2235. xOff: 25,
  2236. yOff: 0,
  2237. Pdmg: 50,
  2238. projectile: 5,
  2239. hideProjectile: true,
  2240. spdMult: 0.6,
  2241. speed: 1500
  2242. }];
  2243. this.list = [{
  2244. group: this.groups[0],
  2245. name: "apple",
  2246. desc: "restores 20 health when consumed",
  2247. req: ["food", 10],
  2248. consume: function (a) {
  2249. return a.changeHealth(20, a);
  2250. },
  2251. scale: 22,
  2252. holdOffset: 15,
  2253. healing: 20,
  2254. itemID: 0,
  2255. itemAID: 16
  2256. }, {
  2257. age: 3,
  2258. group: this.groups[0],
  2259. name: "cookie",
  2260. desc: "restores 40 health when consumed",
  2261. req: ["food", 15],
  2262. consume: function (a) {
  2263. return a.changeHealth(40, a);
  2264. },
  2265. scale: 27,
  2266. holdOffset: 15,
  2267. healing: 40,
  2268. itemID: 1,
  2269. itemAID: 17
  2270. }, {
  2271. age: 7,
  2272. group: this.groups[0],
  2273. name: "cheese",
  2274. desc: "restores 30 health and another 50 over 5 seconds",
  2275. req: ["food", 25],
  2276. consume: function (a) {
  2277. if (a.changeHealth(30, a) || a.health < 100) {
  2278. a.dmgOverTime.dmg = -10;
  2279. a.dmgOverTime.doer = a;
  2280. a.dmgOverTime.time = 5;
  2281. return true;
  2282. }
  2283. return false;
  2284. },
  2285. scale: 27,
  2286. holdOffset: 15,
  2287. healing: 30,
  2288. itemID: 2,
  2289. itemAID: 18
  2290. }, {
  2291. group: this.groups[1],
  2292. name: "wood wall",
  2293. desc: "provides protection for your village",
  2294. req: ["wood", 10],
  2295. projDmg: true,
  2296. health: 380,
  2297. scale: 50,
  2298. holdOffset: 20,
  2299. placeOffset: -5,
  2300. itemID: 3,
  2301. itemAID: 19
  2302. }, {
  2303. age: 3,
  2304. group: this.groups[1],
  2305. name: "stone wall",
  2306. desc: "provides improved protection for your village",
  2307. req: ["stone", 25],
  2308. health: 900,
  2309. scale: 50,
  2310. holdOffset: 20,
  2311. placeOffset: -5,
  2312. itemID: 4,
  2313. itemAID: 20
  2314. }, {
  2315. age: 7,
  2316. group: this.groups[1],
  2317. name: "castle wall",
  2318. desc: "provides powerful protection for your village",
  2319. req: ["stone", 35],
  2320. health: 1500,
  2321. scale: 52,
  2322. holdOffset: 20,
  2323. placeOffset: -5,
  2324. itemID: 5,
  2325. itemAID: 21
  2326. }, {
  2327. group: this.groups[2],
  2328. name: "spikes",
  2329. desc: "damages enemies when they touch them",
  2330. req: ["wood", 20, "stone", 5],
  2331. health: 400,
  2332. dmg: 20,
  2333. scale: 49,
  2334. spritePadding: -23,
  2335. holdOffset: 8,
  2336. placeOffset: -5,
  2337. itemID: 6,
  2338. itemAID: 22,
  2339. shadow: {
  2340. offsetX: 5,
  2341. offsetY: 5,
  2342. blur: 20,
  2343. color: "rgba(0, 0, 0, 0.5)"
  2344. }
  2345. }, {
  2346. age: 5,
  2347. group: this.groups[2],
  2348. name: "greater spikes",
  2349. desc: "damages enemies when they touch them",
  2350. req: ["wood", 30, "stone", 10],
  2351. health: 500,
  2352. dmg: 35,
  2353. scale: 52,
  2354. spritePadding: -23,
  2355. holdOffset: 8,
  2356. placeOffset: -5,
  2357. itemID: 7,
  2358. itemAID: 23
  2359. }, {
  2360. age: 9,
  2361. group: this.groups[2],
  2362. name: "poison spikes",
  2363. desc: "poisons enemies when they touch them",
  2364. req: ["wood", 35, "stone", 15],
  2365. health: 600,
  2366. dmg: 30,
  2367. pDmg: 5,
  2368. scale: 52,
  2369. spritePadding: -23,
  2370. holdOffset: 8,
  2371. placeOffset: -5,
  2372. itemID: 8,
  2373. itemAID: 24
  2374. }, {
  2375. age: 9,
  2376. group: this.groups[2],
  2377. name: "spinning spikes",
  2378. desc: "damages enemies when they touch them",
  2379. req: ["wood", 30, "stone", 20],
  2380. health: 500,
  2381. dmg: 45,
  2382. turnSpeed: 0.003,
  2383. scale: 52,
  2384. spritePadding: -23,
  2385. holdOffset: 8,
  2386. placeOffset: -5,
  2387. itemID: 9,
  2388. itemAID: 25
  2389. }, {
  2390. group: this.groups[3],
  2391. name: "windmill",
  2392. desc: "generates gold over time",
  2393. req: ["wood", 50, "stone", 10],
  2394. health: 400,
  2395. pps: 1,
  2396. turnSpeed: 0.0016,
  2397. spritePadding: 25,
  2398. iconLineMult: 12,
  2399. scale: 45,
  2400. holdOffset: 20,
  2401. placeOffset: 5,
  2402. itemID: 10,
  2403. itemAID: 26
  2404. }, {
  2405. age: 5,
  2406. group: this.groups[3],
  2407. name: "faster windmill",
  2408. desc: "generates more gold over time",
  2409. req: ["wood", 60, "stone", 20],
  2410. health: 500,
  2411. pps: 1.5,
  2412. turnSpeed: 0.0025,
  2413. spritePadding: 25,
  2414. iconLineMult: 12,
  2415. scale: 47,
  2416. holdOffset: 20,
  2417. placeOffset: 5,
  2418. itemID: 11,
  2419. itemAID: 27
  2420. }, {
  2421. age: 8,
  2422. group: this.groups[3],
  2423. name: "power mill",
  2424. desc: "generates more gold over time",
  2425. req: ["wood", 100, "stone", 50],
  2426. health: 800,
  2427. pps: 2,
  2428. turnSpeed: 0.005,
  2429. spritePadding: 25,
  2430. iconLineMult: 12,
  2431. scale: 47,
  2432. holdOffset: 20,
  2433. placeOffset: 5,
  2434. itemID: 12,
  2435. itemAID: 28
  2436. }, {
  2437. age: 5,
  2438. group: this.groups[4],
  2439. type: 2,
  2440. name: "mine",
  2441. desc: "allows you to mine stone",
  2442. req: ["wood", 20, "stone", 100],
  2443. iconLineMult: 12,
  2444. scale: 65,
  2445. holdOffset: 20,
  2446. placeOffset: 0,
  2447. itemID: 13,
  2448. itemAID: 29
  2449. }, {
  2450. age: 5,
  2451. group: this.groups[11],
  2452. type: 0,
  2453. name: "sapling",
  2454. desc: "allows you to farm wood",
  2455. req: ["wood", 150],
  2456. iconLineMult: 12,
  2457. colDiv: 0.5,
  2458. scale: 110,
  2459. holdOffset: 50,
  2460. placeOffset: -15,
  2461. itemID: 14,
  2462. itemAID: 30
  2463. }, {
  2464. age: 4,
  2465. group: this.groups[5],
  2466. name: "pit trap",
  2467. desc: "pit that traps enemies if they walk over it",
  2468. req: ["wood", 30, "stone", 30],
  2469. trap: true,
  2470. ignoreCollision: true,
  2471. hideFromEnemy: true,
  2472. health: 500,
  2473. colDiv: 0.2,
  2474. scale: 50,
  2475. holdOffset: 20,
  2476. placeOffset: -5,
  2477. alpha: 0.6,
  2478. itemID: 15,
  2479. itemAID: 31
  2480. }, {
  2481. age: 4,
  2482. group: this.groups[6],
  2483. name: "boost pad",
  2484. desc: "provides boost when stepped on",
  2485. req: ["stone", 20, "wood", 5],
  2486. ignoreCollision: true,
  2487. boostSpeed: 1.5,
  2488. health: 150,
  2489. colDiv: 0.7,
  2490. scale: 45,
  2491. holdOffset: 20,
  2492. placeOffset: -5,
  2493. itemID: 16,
  2494. itemAID: 32
  2495. }, {
  2496. age: 7,
  2497. group: this.groups[7],
  2498. doUpdate: true,
  2499. name: "turret",
  2500. desc: "defensive structure that shoots at enemies",
  2501. req: ["wood", 200, "stone", 150],
  2502. health: 800,
  2503. projectile: 1,
  2504. shootRange: 700,
  2505. shootRate: 2200,
  2506. scale: 43,
  2507. holdOffset: 20,
  2508. placeOffset: -5,
  2509. itemID: 17,
  2510. itemAID: 33
  2511. }, {
  2512. age: 7,
  2513. group: this.groups[8],
  2514. name: "platform",
  2515. desc: "platform to shoot over walls and cross over water",
  2516. req: ["wood", 20],
  2517. ignoreCollision: true,
  2518. zIndex: 1,
  2519. health: 300,
  2520. scale: 43,
  2521. holdOffset: 20,
  2522. placeOffset: -5,
  2523. itemID: 18,
  2524. itemAID: 34
  2525. }, {
  2526. age: 7,
  2527. group: this.groups[9],
  2528. name: "healing pad",
  2529. desc: "standing on it will slowly heal you",
  2530. req: ["wood", 30, "food", 10],
  2531. ignoreCollision: true,
  2532. healCol: 15,
  2533. health: 400,
  2534. colDiv: 0.7,
  2535. scale: 45,
  2536. holdOffset: 20,
  2537. placeOffset: -5,
  2538. itemID: 19,
  2539. itemAID: 35
  2540. }, {
  2541. age: 9,
  2542. group: this.groups[10],
  2543. name: "spawn pad",
  2544. desc: "you will spawn here when you die but it will dissapear",
  2545. req: ["wood", 100, "stone", 100],
  2546. health: 400,
  2547. ignoreCollision: true,
  2548. spawnPoint: true,
  2549. scale: 45,
  2550. holdOffset: 20,
  2551. placeOffset: -5,
  2552. itemID: 20,
  2553. itemAID: 36
  2554. }, {
  2555. age: 7,
  2556. group: this.groups[12],
  2557. name: "blocker",
  2558. desc: "blocks building in radius",
  2559. req: ["wood", 30, "stone", 25],
  2560. ignoreCollision: true,
  2561. blocker: 300,
  2562. health: 400,
  2563. colDiv: 0.7,
  2564. scale: 45,
  2565. holdOffset: 20,
  2566. placeOffset: -5,
  2567. itemID: 21,
  2568. itemAID: 37
  2569. }, {
  2570. age: 7,
  2571. group: this.groups[13],
  2572. name: "teleporter",
  2573. desc: "teleports you to a random point on the map",
  2574. req: ["wood", 60, "stone", 60],
  2575. ignoreCollision: true,
  2576. teleport: true,
  2577. health: 200,
  2578. colDiv: 0.7,
  2579. scale: 45,
  2580. holdOffset: 20,
  2581. placeOffset: -5,
  2582. itemID: 22,
  2583. itemAID: 38
  2584. }];
  2585. this.checkItem = {
  2586. index: function (a, b) {
  2587. if ([0, 1, 2].includes(a)) {
  2588. return 0;
  2589. } else if ([3, 4, 5].includes(a)) {
  2590. return 1;
  2591. } else if ([6, 7, 8, 9].includes(a)) {
  2592. return 2;
  2593. } else if ([10, 11, 12].includes(a)) {
  2594. return 3;
  2595. } else if ([13, 14].includes(a)) {
  2596. return 5;
  2597. } else if ([15, 16].includes(a)) {
  2598. return 4;
  2599. } else if ([17, 18, 19, 21, 22].includes(a)) {
  2600. if ([13, 14].includes(b)) {
  2601. return 6;
  2602. } else {
  2603. return 5;
  2604. }
  2605. } else if (a == 20) {
  2606. if ([13, 14].includes(b)) {
  2607. return 7;
  2608. } else {
  2609. return 6;
  2610. }
  2611. } else {
  2612. return undefined;
  2613. }
  2614. }
  2615. };
  2616. for (let a = 0; a < this.list.length; ++a) {
  2617. this.list[a].id = a;
  2618. if (this.list[a].pre) {
  2619. this.list[a].pre = a - this.list[a].pre;
  2620. }
  2621. }
  2622. if (typeof window !== "undefined") {
  2623. function a(a) {
  2624. for (let b = a.length - 1; b > 0; b--) {
  2625. const c = Math.floor(Math.random() * (b + 1));
  2626. [a[b], a[c]] = [a[c], a[b]];
  2627. }
  2628. return a;
  2629. }
  2630. }
  2631. }
  2632. }
  2633. class zb {
  2634. constructor(a, b, c, d, e, f) {
  2635. let g = Math.floor;
  2636. let h = Math.abs;
  2637. let i = Math.cos;
  2638. let j = Math.sin;
  2639. let k = Math.pow;
  2640. let l = Math.sqrt;
  2641. this.ignoreAdd = false;
  2642. this.hitObj = [];
  2643. this.disableObj = function (a) {
  2644. a.active = false;
  2645. };
  2646. let m;
  2647. this.add = function (b, c, d, e, f, g, h, i, j) {
  2648. m = va(b);
  2649. if (!m) {
  2650. m = ea.find(a => !a.active);
  2651. if (!m) {
  2652. m = new a(b);
  2653. ea.push(m);
  2654. }
  2655. }
  2656. if (i) {
  2657. m.sid = b;
  2658. }
  2659. m.init(c, d, e, f, g, h, j);
  2660. };
  2661. this.disableBySid = function (a) {
  2662. let b = va(a);
  2663. if (b) {
  2664. this.disableObj(b);
  2665. }
  2666. };
  2667. this.removeAllItems = function (a, b) {
  2668. ea.filter(b => b.active && b.owner && b.owner.sid == a).forEach(a => this.disableObj(a));
  2669. };
  2670. this.checkItemLocation = function (a, e, f, g, h, i, j) {
  2671. let k = b.find(b => b.active && c.getDistance(a, e, b.x, b.y) < f + (b.blocker ? b.blocker : b.getScale(g, b.isItem)));
  2672. if (k) {
  2673. return false;
  2674. }
  2675. if (!i && h != 18 && e >= d.mapScale / 2 - d.riverWidth / 2 && e <= d.mapScale / 2 + d.riverWidth / 2) {
  2676. return false;
  2677. }
  2678. return true;
  2679. };
  2680. }
  2681. }
  2682. class Ab {
  2683. constructor(a, b, c, d, e, f, g) {
  2684. this.init = function (a, b, c, d, e, f, g, h, i) {
  2685. this.active = true;
  2686. this.tickActive = true;
  2687. this.indx = a;
  2688. this.x = b;
  2689. this.y = c;
  2690. this.x2 = b;
  2691. this.y2 = c;
  2692. this.dir = d;
  2693. this.skipMov = true;
  2694. this.speed = e;
  2695. this.dmg = f;
  2696. this.scale = h;
  2697. this.range = g;
  2698. this.r2 = g;
  2699. this.owner = i;
  2700. };
  2701. this.update = function (a) {
  2702. if (this.active) {
  2703. let b = this.speed * a;
  2704. if (!this.skipMov) {
  2705. this.x += b * Math.cos(this.dir);
  2706. this.y += b * Math.sin(this.dir);
  2707. this.range -= b;
  2708. if (this.range <= 0) {
  2709. this.x += this.range * Math.cos(this.dir);
  2710. this.y += this.range * Math.sin(this.dir);
  2711. b = 1;
  2712. this.range = 0;
  2713. this.active = false;
  2714. }
  2715. } else {
  2716. this.skipMov = false;
  2717. }
  2718. }
  2719. };
  2720. this.tickUpdate = function (a) {
  2721. if (this.tickActive) {
  2722. let b = this.speed * a;
  2723. if (!this.skipMov) {
  2724. this.x2 += b * Math.cos(this.dir);
  2725. this.y2 += b * Math.sin(this.dir);
  2726. this.r2 -= b;
  2727. if (this.r2 <= 0) {
  2728. this.x2 += this.r2 * Math.cos(this.dir);
  2729. this.y2 += this.r2 * Math.sin(this.dir);
  2730. b = 1;
  2731. this.r2 = 0;
  2732. this.tickActive = false;
  2733. }
  2734. } else {
  2735. this.skipMov = false;
  2736. }
  2737. }
  2738. };
  2739. }
  2740. }
  2741. ;
  2742. class Bb {
  2743. constructor() {
  2744. this.hats = [{
  2745. id: 45,
  2746. name: "Shame!",
  2747. dontSell: true,
  2748. price: 0,
  2749. scale: 120,
  2750. desc: "hacks are for winners"
  2751. }, {
  2752. id: 51,
  2753. name: "Moo Cap",
  2754. price: 0,
  2755. scale: 120,
  2756. desc: "coolest mooer around"
  2757. }, {
  2758. id: 50,
  2759. name: "Apple Cap",
  2760. price: 0,
  2761. scale: 120,
  2762. desc: "apple farms remembers"
  2763. }, {
  2764. id: 28,
  2765. name: "Moo Head",
  2766. price: 0,
  2767. scale: 120,
  2768. desc: "no effect"
  2769. }, {
  2770. id: 29,
  2771. name: "Pig Head",
  2772. price: 0,
  2773. scale: 120,
  2774. desc: "no effect"
  2775. }, {
  2776. id: 30,
  2777. name: "Fluff Head",
  2778. price: 0,
  2779. scale: 120,
  2780. desc: "no effect"
  2781. }, {
  2782. id: 36,
  2783. name: "Pandou Head",
  2784. price: 0,
  2785. scale: 120,
  2786. desc: "no effect"
  2787. }, {
  2788. id: 37,
  2789. name: "Bear Head",
  2790. price: 0,
  2791. scale: 120,
  2792. desc: "no effect"
  2793. }, {
  2794. id: 38,
  2795. name: "Monkey Head",
  2796. price: 0,
  2797. scale: 120,
  2798. desc: "no effect"
  2799. }, {
  2800. id: 44,
  2801. name: "Polar Head",
  2802. price: 0,
  2803. scale: 120,
  2804. desc: "no effect"
  2805. }, {
  2806. id: 35,
  2807. name: "Fez Hat",
  2808. price: 0,
  2809. scale: 120,
  2810. desc: "no effect"
  2811. }, {
  2812. id: 42,
  2813. name: "Enigma Hat",
  2814. price: 0,
  2815. scale: 120,
  2816. desc: "join the enigma army"
  2817. }, {
  2818. id: 43,
  2819. name: "Blitz Hat",
  2820. price: 0,
  2821. scale: 120,
  2822. desc: "hey everybody i'm blitz"
  2823. }, {
  2824. id: 49,
  2825. name: "Bob XIII Hat",
  2826. price: 0,
  2827. scale: 120,
  2828. desc: "like and subscribe"
  2829. }, {
  2830. id: 57,
  2831. name: "Pumpkin",
  2832. price: 50,
  2833. scale: 120,
  2834. desc: "Spooooky"
  2835. }, {
  2836. id: 8,
  2837. name: "Bummle Hat",
  2838. price: 100,
  2839. scale: 120,
  2840. desc: "no effect"
  2841. }, {
  2842. id: 2,
  2843. name: "Straw Hat",
  2844. price: 500,
  2845. scale: 120,
  2846. desc: "no effect"
  2847. }, {
  2848. id: 15,
  2849. name: "Winter Cap",
  2850. price: 600,
  2851. scale: 120,
  2852. desc: "allows you to move at normal speed in snow",
  2853. coldM: 1
  2854. }, {
  2855. id: 5,
  2856. name: "Cowboy Hat",
  2857. price: 1000,
  2858. scale: 120,
  2859. desc: "no effect"
  2860. }, {
  2861. id: 4,
  2862. name: "Ranger Hat",
  2863. price: 2000,
  2864. scale: 120,
  2865. desc: "no effect"
  2866. }, {
  2867. id: 18,
  2868. name: "Explorer Hat",
  2869. price: 2000,
  2870. scale: 120,
  2871. desc: "no effect"
  2872. }, {
  2873. id: 31,
  2874. name: "Flipper Hat",
  2875. price: 2500,
  2876. scale: 120,
  2877. desc: "have more control while in water",
  2878. watrImm: true
  2879. }, {
  2880. id: 1,
  2881. name: "Marksman Cap",
  2882. price: 3000,
  2883. scale: 120,
  2884. desc: "increases arrow speed and range",
  2885. aMlt: 1.3
  2886. }, {
  2887. id: 10,
  2888. name: "Bush Gear",
  2889. price: 3000,
  2890. scale: 160,
  2891. desc: "allows you to disguise yourself as a bush"
  2892. }, {
  2893. id: 48,
  2894. name: "Halo",
  2895. price: 3000,
  2896. scale: 120,
  2897. desc: "no effect"
  2898. }, {
  2899. id: 6,
  2900. name: "Soldier Helmet",
  2901. price: 4000,
  2902. scale: 120,
  2903. desc: "reduces damage taken but slows movement",
  2904. spdMult: 0.94,
  2905. dmgMult: 0.75
  2906. }, {
  2907. id: 23,
  2908. name: "Anti Venom Gear",
  2909. price: 4000,
  2910. scale: 120,
  2911. desc: "makes you immune to poison",
  2912. poisonRes: 1
  2913. }, {
  2914. id: 13,
  2915. name: "Medic Gear",
  2916. price: 5000,
  2917. scale: 110,
  2918. desc: "slowly regenerates health over time",
  2919. healthRegen: 3
  2920. }, {
  2921. id: 9,
  2922. name: "Miners Helmet",
  2923. price: 5000,
  2924. scale: 120,
  2925. desc: "earn 1 extra gold per resource",
  2926. extraGold: 1
  2927. }, {
  2928. id: 32,
  2929. name: "Musketeer Hat",
  2930. price: 5000,
  2931. scale: 120,
  2932. desc: "reduces cost of projectiles",
  2933. projCost: 0.5
  2934. }, {
  2935. id: 7,
  2936. name: "Bull Helmet",
  2937. price: 6000,
  2938. scale: 120,
  2939. desc: "increases damage done but drains health",
  2940. healthRegen: -5,
  2941. dmgMultO: 1.5,
  2942. spdMult: 0.96
  2943. }, {
  2944. id: 22,
  2945. name: "Emp Helmet",
  2946. price: 6000,
  2947. scale: 120,
  2948. desc: "turrets won't attack but you move slower",
  2949. antiTurret: 1,
  2950. spdMult: 0.7
  2951. }, {
  2952. id: 12,
  2953. name: "Booster Hat",
  2954. price: 6000,
  2955. scale: 120,
  2956. desc: "increases your movement speed",
  2957. spdMult: 1.16
  2958. }, {
  2959. id: 26,
  2960. name: "Barbarian Armor",
  2961. price: 8000,
  2962. scale: 120,
  2963. desc: "knocks back enemies that attack you",
  2964. dmgK: 0.6
  2965. }, {
  2966. id: 21,
  2967. name: "Plague Mask",
  2968. price: 10000,
  2969. scale: 120,
  2970. desc: "melee attacks deal poison damage",
  2971. poisonDmg: 5,
  2972. poisonTime: 6
  2973. }, {
  2974. id: 46,
  2975. name: "Bull Mask",
  2976. price: 10000,
  2977. scale: 120,
  2978. desc: "bulls won't target you unless you attack them",
  2979. bullRepel: 1
  2980. }, {
  2981. id: 14,
  2982. name: "Windmill Hat",
  2983. topSprite: true,
  2984. price: 10000,
  2985. scale: 120,
  2986. desc: "generates points while worn",
  2987. pps: 1.5
  2988. }, {
  2989. id: 11,
  2990. name: "Spike Gear",
  2991. topSprite: true,
  2992. price: 10000,
  2993. scale: 120,
  2994. desc: "deal damage to players that damage you",
  2995. dmg: 0.45
  2996. }, {
  2997. id: 53,
  2998. name: "Turret Gear",
  2999. topSprite: true,
  3000. price: 10000,
  3001. scale: 120,
  3002. desc: "you become a walking turret",
  3003. turret: {
  3004. proj: 1,
  3005. range: 700,
  3006. rate: 2500
  3007. },
  3008. spdMult: 0.7
  3009. }, {
  3010. id: 20,
  3011. name: "Samurai Armor",
  3012. price: 12000,
  3013. scale: 120,
  3014. desc: "increased attack speed and fire rate",
  3015. atkSpd: 0.78
  3016. }, {
  3017. id: 58,
  3018. name: "Dark Knight",
  3019. price: 12000,
  3020. scale: 120,
  3021. desc: "restores health when you deal damage",
  3022. healD: 0.4
  3023. }, {
  3024. id: 27,
  3025. name: "Scavenger Gear",
  3026. price: 15000,
  3027. scale: 120,
  3028. desc: "earn double points for each kill",
  3029. kScrM: 2
  3030. }, {
  3031. id: 40,
  3032. name: "Tank Gear",
  3033. price: 15000,
  3034. scale: 120,
  3035. desc: "increased damage to buildings but slower movement",
  3036. spdMult: 0.3,
  3037. bDmg: 3.3
  3038. }, {
  3039. id: 52,
  3040. name: "Thief Gear",
  3041. price: 15000,
  3042. scale: 120,
  3043. desc: "steal half of a players gold when you kill them",
  3044. goldSteal: 0.5
  3045. }, {
  3046. id: 55,
  3047. name: "Bloodthirster",
  3048. price: 20000,
  3049. scale: 120,
  3050. desc: "Restore Health when dealing damage. And increased damage",
  3051. healD: 0.25,
  3052. dmgMultO: 1.2
  3053. }, {
  3054. id: 56,
  3055. name: "Assassin Gear",
  3056. price: 20000,
  3057. scale: 120,
  3058. desc: "Go invisible when not moving. Can't eat. Increased speed",
  3059. noEat: true,
  3060. spdMult: 1.1,
  3061. invisTimer: 1000
  3062. }];
  3063. this.accessories = [{
  3064. id: 12,
  3065. name: "Snowball",
  3066. price: 1000,
  3067. scale: 105,
  3068. xOff: 18,
  3069. desc: "no effect"
  3070. }, {
  3071. id: 9,
  3072. name: "Tree Cape",
  3073. price: 1000,
  3074. scale: 90,
  3075. desc: "no effect"
  3076. }, {
  3077. id: 10,
  3078. name: "Stone Cape",
  3079. price: 1000,
  3080. scale: 90,
  3081. desc: "no effect"
  3082. }, {
  3083. id: 3,
  3084. name: "Cookie Cape",
  3085. price: 1500,
  3086. scale: 90,
  3087. desc: "no effect"
  3088. }, {
  3089. id: 8,
  3090. name: "Cow Cape",
  3091. price: 2000,
  3092. scale: 90,
  3093. desc: "no effect"
  3094. }, {
  3095. id: 11,
  3096. name: "Monkey Tail",
  3097. price: 2000,
  3098. scale: 97,
  3099. xOff: 25,
  3100. desc: "Super speed but reduced damage",
  3101. spdMult: 1.35,
  3102. dmgMultO: 0.2
  3103. }, {
  3104. id: 17,
  3105. name: "Apple Basket",
  3106. price: 3000,
  3107. scale: 80,
  3108. xOff: 12,
  3109. desc: "slowly regenerates health over time",
  3110. healthRegen: 1
  3111. }, {
  3112. id: 6,
  3113. name: "Winter Cape",
  3114. price: 3000,
  3115. scale: 90,
  3116. desc: "no effect"
  3117. }, {
  3118. id: 4,
  3119. name: "Skull Cape",
  3120. price: 4000,
  3121. scale: 90,
  3122. desc: "no effect"
  3123. }, {
  3124. id: 5,
  3125. name: "Dash Cape",
  3126. price: 5000,
  3127. scale: 90,
  3128. desc: "no effect"
  3129. }, {
  3130. id: 2,
  3131. name: "Dragon Cape",
  3132. price: 6000,
  3133. scale: 90,
  3134. desc: "no effect"
  3135. }, {
  3136. id: 1,
  3137. name: "Super Cape",
  3138. price: 8000,
  3139. scale: 90,
  3140. desc: "no effect"
  3141. }, {
  3142. id: 7,
  3143. name: "Troll Cape",
  3144. price: 8000,
  3145. scale: 90,
  3146. desc: "no effect"
  3147. }, {
  3148. id: 14,
  3149. name: "Thorns",
  3150. price: 10000,
  3151. scale: 115,
  3152. xOff: 20,
  3153. desc: "no effect"
  3154. }, {
  3155. id: 15,
  3156. name: "Blockades",
  3157. price: 10000,
  3158. scale: 95,
  3159. xOff: 15,
  3160. desc: "no effect"
  3161. }, {
  3162. id: 20,
  3163. name: "Devils Tail",
  3164. price: 10000,
  3165. scale: 95,
  3166. xOff: 20,
  3167. desc: "no effect"
  3168. }, {
  3169. id: 16,
  3170. name: "Sawblade",
  3171. price: 12000,
  3172. scale: 90,
  3173. spin: true,
  3174. xOff: 0,
  3175. desc: "deal damage to players that damage you",
  3176. dmg: 0.15
  3177. }, {
  3178. id: 13,
  3179. name: "Angel Wings",
  3180. price: 15000,
  3181. scale: 138,
  3182. xOff: 22,
  3183. desc: "slowly regenerates health over time",
  3184. healthRegen: 3
  3185. }, {
  3186. id: 19,
  3187. name: "Shadow Wings",
  3188. price: 15000,
  3189. scale: 138,
  3190. xOff: 22,
  3191. desc: "increased movement speed",
  3192. spdMult: 1.1
  3193. }, {
  3194. id: 18,
  3195. name: "Blood Wings",
  3196. price: 20000,
  3197. scale: 178,
  3198. xOff: 26,
  3199. desc: "restores health when you deal damage",
  3200. healD: 0.2
  3201. }, {
  3202. id: 21,
  3203. name: "Corrupt X Wings",
  3204. price: 20000,
  3205. scale: 178,
  3206. xOff: 26,
  3207. desc: "deal damage to players that damage you",
  3208. dmg: 0.25
  3209. }];
  3210. }
  3211. }
  3212. ;
  3213. class Cb {
  3214. constructor(a, b, c, d, e, f, g, h, i) {
  3215. this.addProjectile = function (j, k, l, m, n, o, p, q, r, s) {
  3216. let t = f.projectiles[o];
  3217. let u;
  3218. for (let a = 0; a < b.length; ++a) {
  3219. if (!b[a].active) {
  3220. u = b[a];
  3221. break;
  3222. }
  3223. }
  3224. if (!u) {
  3225. u = new a(c, d, e, f, g, h, i);
  3226. u.sid = b.length;
  3227. b.push(u);
  3228. }
  3229. u.init(o, j, k, l, n, t.dmg, m, t.scale, p);
  3230. u.ignoreObj = q;
  3231. u.layer = r || t.layer;
  3232. u.inWindow = s;
  3233. u.src = t.src;
  3234. return u;
  3235. };
  3236. }
  3237. }
  3238. ;
  3239. class Db {
  3240. constructor(a, b, c, d, e, f, g, h, i) {
  3241. this.aiTypes = [{
  3242. id: 0,
  3243. src: "cow_1",
  3244. killScore: 150,
  3245. health: 500,
  3246. weightM: 0.8,
  3247. speed: 0.00095,
  3248. turnSpeed: 0.001,
  3249. scale: 72,
  3250. drop: ["food", 50]
  3251. }, {
  3252. id: 1,
  3253. src: "pig_1",
  3254. killScore: 200,
  3255. health: 800,
  3256. weightM: 0.6,
  3257. speed: 0.00085,
  3258. turnSpeed: 0.001,
  3259. scale: 72,
  3260. drop: ["food", 80]
  3261. }, {
  3262. id: 2,
  3263. name: "Bull",
  3264. src: "bull_2",
  3265. hostile: true,
  3266. dmg: 20,
  3267. killScore: 1000,
  3268. health: 1800,
  3269. weightM: 0.5,
  3270. speed: 0.00094,
  3271. turnSpeed: 0.00074,
  3272. scale: 78,
  3273. viewRange: 800,
  3274. chargePlayer: true,
  3275. drop: ["food", 100]
  3276. }, {
  3277. id: 3,
  3278. name: "Bully",
  3279. src: "bull_1",
  3280. hostile: true,
  3281. dmg: 20,
  3282. killScore: 2000,
  3283. health: 2800,
  3284. weightM: 0.45,
  3285. speed: 0.001,
  3286. turnSpeed: 0.0008,
  3287. scale: 90,
  3288. viewRange: 900,
  3289. chargePlayer: true,
  3290. drop: ["food", 400]
  3291. }, {
  3292. id: 4,
  3293. name: "Wolf",
  3294. src: "wolf_1",
  3295. hostile: true,
  3296. dmg: 8,
  3297. killScore: 500,
  3298. health: 300,
  3299. weightM: 0.45,
  3300. speed: 0.001,
  3301. turnSpeed: 0.002,
  3302. scale: 84,
  3303. viewRange: 800,
  3304. chargePlayer: true,
  3305. drop: ["food", 200]
  3306. }, {
  3307. id: 5,
  3308. name: "Quack",
  3309. src: "chicken_1",
  3310. dmg: 8,
  3311. killScore: 2000,
  3312. noTrap: true,
  3313. health: 300,
  3314. weightM: 0.2,
  3315. speed: 0.0018,
  3316. turnSpeed: 0.006,
  3317. scale: 70,
  3318. drop: ["food", 100]
  3319. }, {
  3320. id: 6,
  3321. name: "MOOSTAFA",
  3322. nameScale: 50,
  3323. src: "enemy",
  3324. hostile: true,
  3325. dontRun: true,
  3326. fixedSpawn: true,
  3327. spawnDelay: 60000,
  3328. noTrap: true,
  3329. colDmg: 100,
  3330. dmg: 40,
  3331. killScore: 8000,
  3332. health: 18000,
  3333. weightM: 0.4,
  3334. speed: 0.0007,
  3335. turnSpeed: 0.01,
  3336. scale: 80,
  3337. spriteMlt: 1.8,
  3338. leapForce: 0.9,
  3339. viewRange: 1000,
  3340. hitRange: 210,
  3341. hitDelay: 1000,
  3342. chargePlayer: true,
  3343. drop: ["food", 100]
  3344. }, {
  3345. id: 7,
  3346. name: "Treasure",
  3347. hostile: true,
  3348. nameScale: 35,
  3349. src: "crate_1",
  3350. fixedSpawn: true,
  3351. spawnDelay: 120000,
  3352. colDmg: 200,
  3353. killScore: 5000,
  3354. health: 20000,
  3355. weightM: 0.1,
  3356. speed: 0,
  3357. turnSpeed: 0,
  3358. scale: 70,
  3359. spriteMlt: 1
  3360. }, {
  3361. id: 8,
  3362. name: "MOOFIE",
  3363. src: "wolf_2",
  3364. hostile: true,
  3365. fixedSpawn: true,
  3366. dontRun: true,
  3367. hitScare: 4,
  3368. spawnDelay: 30000,
  3369. noTrap: true,
  3370. nameScale: 35,
  3371. dmg: 10,
  3372. colDmg: 100,
  3373. killScore: 3000,
  3374. health: 7000,
  3375. weightM: 0.45,
  3376. speed: 0.0015,
  3377. turnSpeed: 0.002,
  3378. scale: 90,
  3379. viewRange: 800,
  3380. chargePlayer: true,
  3381. drop: ["food", 1000]
  3382. }];
  3383. this.spawn = function (j, k, l, m) {
  3384. let n = a.find(a => !a.active);
  3385. if (!n) {
  3386. n = new b(a.length, e, c, d, g, f, h, i);
  3387. a.push(n);
  3388. }
  3389. n.init(j, k, l, m, this.aiTypes[m]);
  3390. return n;
  3391. };
  3392. }
  3393. }
  3394. ;
  3395. class Eb {
  3396. constructor(a, b, c, d, e, f, g, h) {
  3397. this.sid = a;
  3398. this.isAI = true;
  3399. this.nameIndex = e.randInt(0, f.cowNames.length - 1);
  3400. this.init = function (a, b, c, d, e) {
  3401. this.x = a;
  3402. this.y = b;
  3403. this.startX = e.fixedSpawn ? a : null;
  3404. this.startY = e.fixedSpawn ? b : null;
  3405. this.xVel = 0;
  3406. this.yVel = 0;
  3407. this.zIndex = 0;
  3408. this.dir = c;
  3409. this.dirPlus = 0;
  3410. this.showName = "aaa";
  3411. this.index = d;
  3412. this.src = e.src;
  3413. if (e.name) {
  3414. this.name = e.name;
  3415. }
  3416. this.weightM = e.weightM;
  3417. this.speed = e.speed;
  3418. this.killScore = e.killScore;
  3419. this.turnSpeed = e.turnSpeed;
  3420. this.scale = e.scale;
  3421. this.maxHealth = e.health;
  3422. this.leapForce = e.leapForce;
  3423. this.health = this.maxHealth;
  3424. this.chargePlayer = e.chargePlayer;
  3425. this.viewRange = e.viewRange;
  3426. this.drop = e.drop;
  3427. this.dmg = e.dmg;
  3428. this.hostile = e.hostile;
  3429. this.dontRun = e.dontRun;
  3430. this.hitRange = e.hitRange;
  3431. this.hitDelay = e.hitDelay;
  3432. this.hitScare = e.hitScare;
  3433. this.spriteMlt = e.spriteMlt;
  3434. this.nameScale = e.nameScale;
  3435. this.colDmg = e.colDmg;
  3436. this.noTrap = e.noTrap;
  3437. this.spawnDelay = e.spawnDelay;
  3438. this.hitWait = 0;
  3439. this.waitCount = 1000;
  3440. this.moveCount = 0;
  3441. this.targetDir = 0;
  3442. this.active = true;
  3443. this.alive = true;
  3444. this.runFrom = null;
  3445. this.chargeTarget = null;
  3446. this.dmgOverTime = {};
  3447. };
  3448. let i = 0;
  3449. let j = 0;
  3450. this.animate = function (a) {
  3451. if (this.animTime > 0) {
  3452. this.animTime -= a;
  3453. if (this.animTime <= 0) {
  3454. this.animTime = 0;
  3455. this.dirPlus = 0;
  3456. i = 0;
  3457. j = 0;
  3458. } else if (j == 0) {
  3459. i += a / (this.animSpeed * f.hitReturnRatio);
  3460. this.dirPlus = e.lerp(0, this.targetAngle, Math.min(1, i));
  3461. if (i >= 1) {
  3462. i = 1;
  3463. j = 1;
  3464. }
  3465. } else {
  3466. i -= a / (this.animSpeed * (1 - f.hitReturnRatio));
  3467. this.dirPlus = e.lerp(0, this.targetAngle, Math.max(0, i));
  3468. }
  3469. }
  3470. };
  3471. this.startAnim = function () {
  3472. this.animTime = this.animSpeed = 600;
  3473. this.targetAngle = Math.PI * 0.8;
  3474. i = 0;
  3475. j = 0;
  3476. };
  3477. }
  3478. }
  3479. ;
  3480. class Fb {
  3481. constructor(a, b, c, d) {
  3482. this.x = a;
  3483. this.y = b;
  3484. this.alpha = 0;
  3485. this.active = true;
  3486. this.alive = false;
  3487. this.chat = c;
  3488. this.owner = d;
  3489. }
  3490. }
  3491. ;
  3492. class Gb {
  3493. constructor(a, b, c, d, e, f, g, h, i) {
  3494. this.x = a;
  3495. this.y = b;
  3496. this.lastDir = c;
  3497. this.dir = c + Math.PI;
  3498. this.buildIndex = d;
  3499. this.weaponIndex = e;
  3500. this.weaponVariant = f;
  3501. this.skinColor = g;
  3502. this.scale = h;
  3503. this.visScale = 0;
  3504. this.name = i;
  3505. this.alpha = 1;
  3506. this.active = true;
  3507. this.animate = function (a) {
  3508. let b = dc.getAngleDist(this.lastDir, this.dir);
  3509. if (b > 0.01) {
  3510. this.dir += b / 20;
  3511. } else {
  3512. this.dir = this.lastDir;
  3513. }
  3514. if (this.visScale < this.scale) {
  3515. this.visScale += a / (this.scale / 2);
  3516. if (this.visScale >= this.scale) {
  3517. this.visScale = this.scale;
  3518. }
  3519. }
  3520. this.alpha -= a / 30000;
  3521. if (this.alpha <= 0) {
  3522. this.alpha = 0;
  3523. this.active = false;
  3524. }
  3525. };
  3526. }
  3527. }
  3528. ;
  3529. class Hb {
  3530. constructor(a, b, d, e, f, g, h, i, j, k, l, m, n, o) {
  3531. this.id = a;
  3532. this.sid = b;
  3533. this.tmpScore = 0;
  3534. this.team = null;
  3535. this.latestSkin = 0;
  3536. this.oldSkinIndex = 0;
  3537. this.skinIndex = 0;
  3538. this.latestTail = 0;
  3539. this.oldTailIndex = 0;
  3540. this.tailIndex = 0;
  3541. this.hitTime = 0;
  3542. this.lastHit = 0;
  3543. this.showName = "NOOO";
  3544. this.tails = {};
  3545. for (let c = 0; c < l.length; ++c) {
  3546. if (l[c].price <= 0) {
  3547. this.tails[l[c].id] = 1;
  3548. }
  3549. }
  3550. this.skins = {};
  3551. for (let c = 0; c < k.length; ++c) {
  3552. if (k[c].price <= 0) {
  3553. this.skins[k[c].id] = 1;
  3554. }
  3555. }
  3556. this.points = 0;
  3557. this.dt = 0;
  3558. this.hidden = false;
  3559. this.itemCounts = {};
  3560. this.isPlayer = true;
  3561. this.pps = 0;
  3562. this.moveDir = undefined;
  3563. this.skinRot = 0;
  3564. this.lastPing = 0;
  3565. this.iconIndex = 0;
  3566. this.skinColor = 0;
  3567. this.dist2 = 0;
  3568. this.aim2 = 0;
  3569. this.maxSpeed = 1;
  3570. this.chat = {
  3571. message: null,
  3572. count: 0
  3573. };
  3574. this.backupNobull = true;
  3575. this.circle = false;
  3576. this.circleRad = 200;
  3577. this.circleRadSpd = 0.1;
  3578. this.cAngle = 0;
  3579. this.spawn = function (a) {
  3580. this.attacked = false;
  3581. this.timeDamaged = 0;
  3582. this.timeHealed = 0;
  3583. this.pinge = 0;
  3584. this.millPlace = "NOOO";
  3585. this.lastshamecount = 0;
  3586. this.death = false;
  3587. this.spinDir = 0;
  3588. this.sync = false;
  3589. this.antiBull = 0;
  3590. this.bullTimer = 0;
  3591. this.poisonTimer = 0;
  3592. this.active = true;
  3593. this.alive = true;
  3594. this.lockMove = false;
  3595. this.lockDir = false;
  3596. this.minimapCounter = 0;
  3597. this.chatCountdown = 0;
  3598. this.shameCount = 0;
  3599. this.shameTimer = 0;
  3600. this.sentTo = {};
  3601. this.gathering = 0;
  3602. this.gatherIndex = 0;
  3603. this.shooting = {};
  3604. this.shootIndex = 9;
  3605. this.autoGather = 0;
  3606. this.animTime = 0;
  3607. this.animSpeed = 0;
  3608. this.mouseState = 0;
  3609. this.buildIndex = -1;
  3610. this.weaponIndex = 0;
  3611. this.weaponCode = 0;
  3612. this.weaponVariant = 0;
  3613. this.primaryIndex = undefined;
  3614. this.secondaryIndex = undefined;
  3615. this.dmgOverTime = {};
  3616. this.noMovTimer = 0;
  3617. this.maxXP = 300;
  3618. this.XP = 0;
  3619. this.age = 1;
  3620. this.kills = 0;
  3621. this.upgrAge = 2;
  3622. this.upgradePoints = 0;
  3623. this.x = 0;
  3624. this.y = 0;
  3625. this.oldXY = {
  3626. x: 0,
  3627. y: 0
  3628. };
  3629. this.zIndex = 0;
  3630. this.xVel = 0;
  3631. this.yVel = 0;
  3632. this.slowMult = 1;
  3633. this.dir = 0;
  3634. this.dirPlus = 0;
  3635. this.targetDir = 0;
  3636. this.targetAngle = 0;
  3637. this.maxHealth = 100;
  3638. this.health = this.maxHealth;
  3639. this.oldHealth = this.maxHealth;
  3640. this.damaged = 0;
  3641. this.scale = d.playerScale;
  3642. this.speed = d.playerSpeed;
  3643. this.resetMoveDir();
  3644. this.resetResources(a);
  3645. this.items = [0, 3, 6, 10];
  3646. this.weapons = [0];
  3647. this.shootCount = 0;
  3648. this.weaponXP = [];
  3649. this.reloads = {
  3650. 0: 0,
  3651. 1: 0,
  3652. 2: 0,
  3653. 3: 0,
  3654. 4: 0,
  3655. 5: 0,
  3656. 6: 0,
  3657. 7: 0,
  3658. 8: 0,
  3659. 9: 0,
  3660. 10: 0,
  3661. 11: 0,
  3662. 12: 0,
  3663. 13: 0,
  3664. 14: 0,
  3665. 15: 0,
  3666. 53: 0
  3667. };
  3668. this.bowThreat = {
  3669. 9: 0,
  3670. 12: 0,
  3671. 13: 0,
  3672. 15: 0
  3673. };
  3674. this.damageThreat = 0;
  3675. this.inTrap = false;
  3676. this.canEmpAnti = false;
  3677. this.empAnti = false;
  3678. this.soldierAnti = false;
  3679. this.poisonTick = 0;
  3680. this.bullTick = 0;
  3681. this.setPoisonTick = false;
  3682. this.setBullTick = false;
  3683. this.antiTimer = 2;
  3684. };
  3685. this.resetMoveDir = function () {
  3686. this.moveDir = undefined;
  3687. };
  3688. this.resetResources = function (a) {
  3689. for (let b = 0; b < d.resourceTypes.length; ++b) {
  3690. this[d.resourceTypes[b]] = a ? 100 : 0;
  3691. }
  3692. };
  3693. this.getItemType = function (a) {
  3694. let b = this.items.findIndex(b => b == a);
  3695. if (b != -1) {
  3696. return b;
  3697. } else {
  3698. return j.checkItem.index(a, this.items);
  3699. }
  3700. };
  3701. this.setData = function (a) {
  3702. this.id = a[0];
  3703. this.sid = a[1];
  3704. this.name = a[2];
  3705. this.x = a[3];
  3706. this.y = a[4];
  3707. this.dir = a[5];
  3708. this.health = a[6];
  3709. this.maxHealth = a[7];
  3710. this.scale = a[8];
  3711. this.skinColor = a[9];
  3712. };
  3713. this.updateTimer = function () {
  3714. this.bullTimer -= 1;
  3715. if (this.bullTimer <= 0) {
  3716. this.setBullTick = false;
  3717. this.bullTick = P.tick - 1;
  3718. this.bullTimer = d.serverUpdateRate;
  3719. }
  3720. this.poisonTimer -= 1;
  3721. if (this.poisonTimer <= 0) {
  3722. this.setPoisonTick = false;
  3723. this.poisonTick = P.tick - 1;
  3724. this.poisonTimer = d.serverUpdateRate;
  3725. }
  3726. };
  3727. this.update = function (a) {
  3728. if (this.sid == ka) {
  3729. this.circleRad = parseInt(c("circleRad").value) || 0;
  3730. this.circleRadSpd = parseFloat(c("radSpeed").value) || 0;
  3731. this.cAngle += this.circleRadSpd;
  3732. }
  3733. if (this.active) {
  3734. let a = {
  3735. skin: qa(k, this.skinIndex),
  3736. tail: qa(l, this.tailIndex)
  3737. };
  3738. let b = (this.buildIndex >= 0 ? 0.5 : 1) * (j.weapons[this.weaponIndex].spdMult || 1) * (a.skin ? a.skin.spdMult || 1 : 1) * (a.tail ? a.tail.spdMult || 1 : 1) * (this.y <= d.snowBiomeTop ? a.skin && a.skin.coldM ? 1 : d.snowSpeed : 1) * this.slowMult;
  3739. this.maxSpeed = b;
  3740. }
  3741. };
  3742. let p = 0;
  3743. let q = 0;
  3744. this.animate = function (a) {
  3745. if (this.animTime > 0) {
  3746. this.animTime -= a;
  3747. if (this.animTime <= 0) {
  3748. this.animTime = 0;
  3749. this.dirPlus = 0;
  3750. p = 0;
  3751. q = 0;
  3752. } else if (q == 0) {
  3753. p += a / (this.animSpeed * d.hitReturnRatio);
  3754. this.dirPlus = e.lerp(0, this.targetAngle, Math.min(1, p));
  3755. if (p >= 1) {
  3756. p = 1;
  3757. q = 1;
  3758. }
  3759. } else {
  3760. p -= a / (this.animSpeed * (1 - d.hitReturnRatio));
  3761. this.dirPlus = e.lerp(0, this.targetAngle, Math.max(0, p));
  3762. }
  3763. }
  3764. };
  3765. this.startAnim = function (a, b) {
  3766. this.animTime = this.animSpeed = j.weapons[b].speed;
  3767. this.targetAngle = a ? -d.hitAngle : -Math.PI;
  3768. p = 0;
  3769. q = 0;
  3770. };
  3771. this.canSee = function (a) {
  3772. if (!a) {
  3773. return false;
  3774. }
  3775. let b = Math.abs(a.x - this.x) - a.scale;
  3776. let c = Math.abs(a.y - this.y) - a.scale;
  3777. return b <= d.maxScreenWidth / 2 * 1.3 && c <= d.maxScreenHeight / 2 * 1.3;
  3778. };
  3779. this.judgeShame = function () {
  3780. this.lastshamecount = this.shameCount;
  3781. if (this.oldHealth < this.health) {
  3782. if (this.hitTime) {
  3783. let a = P.tick - this.hitTime;
  3784. this.lastHit = P.tick;
  3785. this.hitTime = 0;
  3786. if (a < 2) {
  3787. this.shameCount++;
  3788. } else {
  3789. this.shameCount = Math.max(0, this.shameCount - 2);
  3790. }
  3791. }
  3792. } else if (this.oldHealth > this.health) {
  3793. this.hitTime = P.tick;
  3794. }
  3795. };
  3796. this.addShameTimer = function () {
  3797. this.shameCount = 0;
  3798. this.shameTimer = 30;
  3799. let a = setInterval(() => {
  3800. this.shameTimer--;
  3801. if (this.shameTimer <= 0) {
  3802. clearInterval(a);
  3803. }
  3804. }, 1000);
  3805. };
  3806. this.isTeam = function (a) {
  3807. return this == a || this.team && this.team == a.team;
  3808. };
  3809. this.findAllianceBySid = function (a) {
  3810. if (this.team) {
  3811. return da.find(b => b === a);
  3812. } else {
  3813. return null;
  3814. }
  3815. };
  3816. this.checkCanInsta = function (a) {
  3817. let b = 0;
  3818. if (this.alive && lb) {
  3819. let c = {
  3820. weapon: this.weapons[0],
  3821. variant: this.primaryVariant,
  3822. dmg: this.weapons[0] == undefined ? 0 : j.weapons[this.weapons[0]].dmg
  3823. };
  3824. let e = {
  3825. weapon: this.weapons[1],
  3826. variant: this.secondaryVariant,
  3827. dmg: this.weapons[1] == undefined ? 0 : j.weapons[this.weapons[1]].Pdmg
  3828. };
  3829. let f = this.skins[7] && !a ? 1.5 : 1;
  3830. let g = c.variant != undefined ? d.weaponVariants[c.variant].val : 1;
  3831. if (c.weapon != undefined && this.reloads[c.weapon] == 0) {
  3832. b += c.dmg * g * f;
  3833. }
  3834. if (e.weapon != undefined && this.reloads[e.weapon] == 0) {
  3835. b += e.dmg;
  3836. }
  3837. if (this.skins[53] && this.reloads[53] <= (ja.weapons[1] == 10 ? 0 : P.tickRate) && oa.skinIndex != 22) {
  3838. b += 25;
  3839. }
  3840. b *= oa.skinIndex == 6 ? 0.75 : 1;
  3841. return b;
  3842. }
  3843. return 0;
  3844. };
  3845. this.manageReload = function () {
  3846. if (this.shooting[53]) {
  3847. this.shooting[53] = 0;
  3848. this.reloads[53] = 2500 - P.tickRate;
  3849. } else if (this.reloads[53] > 0) {
  3850. this.reloads[53] = Math.max(0, this.reloads[53] - P.tickRate);
  3851. }
  3852. if (this.reloads[this.weaponIndex] <= 1000 / 9) {
  3853. let a = this.weaponIndex;
  3854. let b = fa.filter(a => (a.active || a.alive) && a.health < a.maxHealth && a.group !== undefined && e.getDist(a, ja, 0, 2) <= j.weapons[ja.weaponIndex].range + a.scale);
  3855. for (let c = 0; c < b.length; c++) {
  3856. let e = b[c];
  3857. let f = j.weapons[a].dmg * d.weaponVariants[la[(a < 9 ? "prima" : "seconda") + "ryVariant"]].val * (j.weapons[a].sDmg || 1) * 3.3;
  3858. let g = j.weapons[a].dmg * d.weaponVariants[la[(a < 9 ? "prima" : "seconda") + "ryVariant"]].val * (j.weapons[a].sDmg || 1);
  3859. if (e.health - g <= 0 && oa.length) {
  3860. Qb(oa.dist2 < oa.scale * 1.8 + 50 ? 4 : 2, kd(e, ja) + Math.PI);
  3861. }
  3862. }
  3863. }
  3864. if (this.gathering || this.shooting[1]) {
  3865. if (this.gathering) {
  3866. this.gathering = 0;
  3867. this.reloads[this.gatherIndex] = j.weapons[this.gatherIndex].speed * (this.skinIndex == 20 ? 0.78 : 1);
  3868. this.attacked = true;
  3869. }
  3870. if (this.shooting[1]) {
  3871. this.shooting[1] = 0;
  3872. this.reloads[this.shootIndex] = j.weapons[this.shootIndex].speed * (this.skinIndex == 20 ? 0.78 : 1);
  3873. this.attacked = true;
  3874. }
  3875. } else {
  3876. this.attacked = false;
  3877. if (this.buildIndex < 0) {
  3878. if (this.reloads[this.weaponIndex] > 0) {
  3879. this.reloads[this.weaponIndex] = Math.max(0, this.reloads[this.weaponIndex] - 110);
  3880. if (this == ja) {
  3881. if (c("weaponGrind").checked) {
  3882. for (let a = 0; a < Math.PI * 2; a += Math.PI / 2) {
  3883. Rb(ja.getItemType(22), a);
  3884. }
  3885. }
  3886. }
  3887. if (this.reloads[this.primaryIndex] == 0 && this.reloads[this.weaponIndex] == 0) {
  3888. this.antiBull++;
  3889. P.tickBase(() => {
  3890. this.antiBull = 0;
  3891. }, 1);
  3892. }
  3893. }
  3894. }
  3895. }
  3896. };
  3897. this.addDamageThreat = function (a) {
  3898. let b = {
  3899. weapon: this.primaryIndex,
  3900. variant: this.primaryVariant
  3901. };
  3902. b.dmg = b.weapon == undefined ? 45 : j.weapons[b.weapon].dmg;
  3903. let c = {
  3904. weapon: this.secondaryIndex,
  3905. variant: this.secondaryVariant
  3906. };
  3907. c.dmg = c.weapon == undefined ? 75 : j.weapons[c.weapon].Pdmg;
  3908. let e = 1.5;
  3909. let f = b.variant != undefined ? d.weaponVariants[b.variant].val : 1.18;
  3910. let g = c.variant != undefined ? [9, 12, 13, 15].includes(c.weapon) ? 1 : d.weaponVariants[c.variant].val : 1.18;
  3911. if (b.weapon == undefined ? true : this.reloads[b.weapon] == 0) {
  3912. this.damageThreat += b.dmg * f * e;
  3913. }
  3914. if (c.weapon == undefined ? true : this.reloads[c.weapon] == 0) {
  3915. this.damageThreat += c.dmg * g;
  3916. }
  3917. if (this.reloads[53] <= P.tickRate) {
  3918. this.damageThreat += 25;
  3919. }
  3920. this.damageThreat *= a.skinIndex == 6 ? 0.75 : 1;
  3921. if (!this.isTeam(a)) {
  3922. if (this.dist2 <= 300) {
  3923. a.damageThreat += this.damageThreat;
  3924. }
  3925. }
  3926. };
  3927. }
  3928. }
  3929. ;
  3930. function Ib(a) {
  3931. ja.reloads[a] = 0;
  3932. U("H", a);
  3933. }
  3934. function Jb(a, b) {
  3935. U("c", 0, a, b);
  3936. }
  3937. function Kb(a, b) {
  3938. U("c", 1, a, b);
  3939. }
  3940. function Lb(a, b) {
  3941. let c = ja.skins[6] ? 6 : 0;
  3942. if (ja.alive && lb) {
  3943. if (b == 0) {
  3944. if (ja.skins[a]) {
  3945. if (ja.latestSkin != a) {
  3946. U("c", 0, a, 0);
  3947. }
  3948. } else if (q.autoBuyEquip) {
  3949. let b = qa(hc, a);
  3950. if (b) {
  3951. if (ja.points >= b.price) {
  3952. U("c", 1, a, 0);
  3953. U("c", 0, a, 0);
  3954. } else if (ja.latestSkin != c) {
  3955. U("c", 0, c, 0);
  3956. }
  3957. } else if (ja.latestSkin != c) {
  3958. U("c", 0, c, 0);
  3959. }
  3960. } else if (ja.latestSkin != c) {
  3961. U("c", 0, c, 0);
  3962. }
  3963. } else if (b == 1) {
  3964. if (K && a != 11 && a != 0) {
  3965. if (ja.latestTail != 0) {
  3966. U("c", 0, 0, 1);
  3967. }
  3968. return;
  3969. }
  3970. if (ja.tails[a]) {
  3971. if (ja.latestTail != a) {
  3972. U("c", 0, a, 1);
  3973. }
  3974. } else if (q.autoBuyEquip) {
  3975. let b = qa(ic, a);
  3976. if (b) {
  3977. if (ja.points >= b.price) {
  3978. U("c", 1, a, 1);
  3979. U("c", 0, a, 1);
  3980. } else if (ja.latestTail != 0) {
  3981. U("c", 0, 0, 1);
  3982. }
  3983. } else if (ja.latestTail != 0) {
  3984. U("c", 0, 0, 1);
  3985. }
  3986. } else if (ja.latestTail != 0) {
  3987. U("c", 0, 0, 1);
  3988. }
  3989. }
  3990. }
  3991. }
  3992. function Mb(a, b) {
  3993. U("G", a, b);
  3994. }
  3995. function Nb(a, b) {
  3996. if (!b) {
  3997. ja.weaponCode = a;
  3998. }
  3999. U("G", a, 1);
  4000. }
  4001. function Ob() {
  4002. U("K", 1, 1);
  4003. }
  4004. function Pb(a, b) {
  4005. U("d", a, b, 1);
  4006. }
  4007. function Qb(a, b, d) {
  4008. try {
  4009. if (a == undefined) {
  4010. return;
  4011. }
  4012. let e = ec.list[ja.items[a]];
  4013. let g = ja.scale + e.scale + (e.placeOffset || 0);
  4014. let h = ja.x2 + g * Math.cos(b);
  4015. let i = ja.y2 + g * Math.sin(b);
  4016. if (ja.alive && lb && ja.itemCounts[e.group.id] == undefined ? true : ja.itemCounts[e.group.id] < (f.isSandbox ? 299 : e.group.limit ? e.group.limit : 99)) {
  4017. Mb(ja.items[a]);
  4018. Pb(1, b);
  4019. Nb(ja.weaponCode, 1);
  4020. if (d && c("placeVis").checked) {
  4021. tb.push({
  4022. x: h,
  4023. y: i,
  4024. name: e.name,
  4025. scale: e.scale,
  4026. dir: b
  4027. });
  4028. P.tickBase(() => {
  4029. tb.shift();
  4030. }, 1);
  4031. }
  4032. }
  4033. } catch (a) {}
  4034. }
  4035. function Rb(a, b) {
  4036. try {
  4037. if (a == undefined) {
  4038. return;
  4039. }
  4040. let c = ec.list[ja.items[a]];
  4041. let d = ja.scale + c.scale + (c.placeOffset || 0);
  4042. let e = ja.x2 + d * Math.cos(b);
  4043. let f = ja.y2 + d * Math.sin(b);
  4044. if (fc.checkItemLocation(e, f, c.scale, 0.6, c.id, false, ja)) {
  4045. Qb(a, b, 1);
  4046. }
  4047. } catch (a) {}
  4048. }
  4049. function Sb() {
  4050. if (ja.latestSkin == 6) {
  4051. return 0.75;
  4052. } else {
  4053. return 1;
  4054. }
  4055. }
  4056. function Tb() {
  4057. if (ja.health == 100) {
  4058. return 0;
  4059. }
  4060. if (ja.skinIndex != 45 && ja.skinIndex != 56) {
  4061. return Math.ceil((100 - ja.health) / ec.list[ja.items[0]].healing);
  4062. }
  4063. return 0;
  4064. }
  4065. function Ub(a) {
  4066. let b = ma.filter(a => {
  4067. let b = {
  4068. three: a.attacked
  4069. };
  4070. return b.three;
  4071. });
  4072. return b;
  4073. }
  4074. function Vb() {
  4075. for (let a = 0; a < Tb(); a++) {
  4076. Qb(0, Oc());
  4077. }
  4078. }
  4079. function Wb(a) {
  4080. pa.antiSync = true;
  4081. let b = setInterval(() => {
  4082. if (ja.shameCount < 5) {
  4083. Qb(0, Oc());
  4084. }
  4085. }, 75);
  4086. setTimeout(() => {
  4087. clearInterval(b);
  4088. setTimeout(() => {
  4089. pa.antiSync = false;
  4090. }, P.tickRate);
  4091. }, P.tickRate);
  4092. }
  4093. function Xb(a, b) {
  4094. if (ja.y2 >= f.mapScale / 2 - f.riverWidth / 2 && ja.y2 <= f.mapScale / 2 + f.riverWidth / 2) {
  4095. if (b) {
  4096. return 31;
  4097. }
  4098. Lb(31, 0);
  4099. } else if (ja.y2 <= f.snowBiomeTop) {
  4100. if (b) {
  4101. if (a && ja.moveDir == undefined) {
  4102. return 6;
  4103. } else {
  4104. return 15;
  4105. }
  4106. }
  4107. Lb(a && ja.moveDir == undefined ? 6 : 15, 0);
  4108. } else {
  4109. if (b) {
  4110. if (a && ja.moveDir == undefined) {
  4111. return 6;
  4112. } else {
  4113. return 12;
  4114. }
  4115. }
  4116. Lb(a && ja.moveDir == undefined ? 6 : 12, 0);
  4117. }
  4118. if (b) {
  4119. return 0;
  4120. }
  4121. }
  4122. function Yb(a) {
  4123. Lb(a && ja.moveDir == undefined ? 0 : 11, 1);
  4124. }
  4125. class Zb {
  4126. constructor(a, b) {
  4127. this.dist = 0;
  4128. this.aim = 0;
  4129. this.inTrap = false;
  4130. this.replaced = false;
  4131. this.antiTrapped = false;
  4132. this.info = {};
  4133. this.notFast = function () {
  4134. return ja.weapons[1] == 10 && (this.info.health > b.weapons[ja.weapons[0]].dmg || ja.weapons[0] == 5);
  4135. };
  4136. this.testCanPlace = function (c, d = undefined, e = undefined, g = undefined, h, i, j) {
  4137. if (d === undefined) d = -(Math.PI / 2);
  4138. if (e === undefined) e = Math.PI / 2;
  4139. if (g === undefined) g = Math.PI / 18;
  4140. try {
  4141. let k = b.list[ja.items[c]];
  4142. let l = ja.scale + k.scale + (k.placeOffset || 0);
  4143. let m = {
  4144. attempts: 0,
  4145. placed: 0
  4146. };
  4147. let n = [];
  4148. fa.forEach(a => {
  4149. n.push({
  4150. x: a.x,
  4151. y: a.y,
  4152. active: a.active,
  4153. blocker: a.blocker,
  4154. scale: a.scale,
  4155. isItem: a.isItem,
  4156. type: a.type,
  4157. colDiv: a.colDiv,
  4158. getScale: function (a, b) {
  4159. a = a || 1;
  4160. return this.scale * (this.isItem || this.type == 2 || this.type == 3 || this.type == 4 ? 1 : a * 0.6) * (b ? 1 : this.colDiv);
  4161. }
  4162. });
  4163. });
  4164. for (let b = d; b < e; b += g) {
  4165. m.attempts++;
  4166. let d = h + b;
  4167. let e = ja.x2 + l * Math.cos(d);
  4168. let g = ja.y2 + l * Math.sin(d);
  4169. let o = n.find(b => b.active && a.getDistance(e, g, b.x, b.y) < k.scale + (b.blocker ? b.blocker : b.getScale(0.6, b.isItem)));
  4170. if (o) {
  4171. continue;
  4172. }
  4173. if (k.id != 18 && g >= f.mapScale / 2 - f.riverWidth / 2 && g <= f.mapScale / 2 + f.riverWidth / 2) {
  4174. continue;
  4175. }
  4176. if (!i && j) {
  4177. if (j.inTrap) {
  4178. if (a.getAngleDist(oa.aim2 + Math.PI, d + Math.PI) <= Math.PI * 1.3) {
  4179. Qb(2, d, 1);
  4180. } else if (ja.items[4] == 15) {
  4181. Qb(4, d, 1);
  4182. }
  4183. } else if (a.getAngleDist(oa.aim2, d) <= f.gatherAngle / 2.6) {
  4184. Qb(2, d, 1);
  4185. } else if (ja.items[4] == 15) {
  4186. Qb(4, d, 1);
  4187. }
  4188. } else {
  4189. Qb(c, d, 1);
  4190. }
  4191. n.push({
  4192. x: e,
  4193. y: g,
  4194. active: true,
  4195. blocker: k.blocker,
  4196. scale: k.scale,
  4197. isItem: true,
  4198. type: null,
  4199. colDiv: k.colDiv,
  4200. getScale: function () {
  4201. return this.scale;
  4202. }
  4203. });
  4204. if (a.getAngleDist(oa.aim2, d) <= 1) {
  4205. m.placed++;
  4206. }
  4207. }
  4208. if (m.placed > 0 && i && k.dmg) {
  4209. if (oa.dist2 <= b.weapons[ja.weapons[0]].range + ja.scale * 1.8 && q.spikeTick) {
  4210. nc.canSpikeTick = true;
  4211. }
  4212. }
  4213. } catch (a) {}
  4214. };
  4215. this.checkSpikeTick = function () {
  4216. try {
  4217. if (![3, 4, 5].includes(oa.primaryIndex)) {
  4218. return false;
  4219. }
  4220. if (c("safeAntiSpikeTick").checked || pa.autoPush ? false : oa.primaryIndex == undefined ? true : oa.reloads[oa.primaryIndex] > P.tickRate) {
  4221. return false;
  4222. }
  4223. if (oa.dist2 <= b.weapons[oa.primaryIndex || 5].range + oa.scale * 1.8) {
  4224. let c = b.list[9];
  4225. let d = oa.scale + c.scale + (c.placeOffset || 0);
  4226. let e = 0;
  4227. let g = {
  4228. attempts: 0,
  4229. block: "unblocked"
  4230. };
  4231. for (let b = -1; b <= 1; b += 1 / 10) {
  4232. g.attempts++;
  4233. let h = a.getDirect(ja, oa, 2, 2) + b;
  4234. let i = oa.x2 + d * Math.cos(h);
  4235. let j = oa.y2 + d * Math.sin(h);
  4236. let k = fa.find(b => b.active && a.getDistance(i, j, b.x, b.y) < c.scale + (b.blocker ? b.blocker : b.getScale(0.6, b.isItem)));
  4237. if (k) {
  4238. continue;
  4239. }
  4240. if (j >= f.mapScale / 2 - f.riverWidth / 2 && j <= f.mapScale / 2 + f.riverWidth / 2) {
  4241. continue;
  4242. }
  4243. e++;
  4244. g.block = "blocked";
  4245. break;
  4246. }
  4247. if (e) {
  4248. pa.anti0Tick = 1;
  4249. return true;
  4250. }
  4251. }
  4252. } catch (a) {
  4253. return null;
  4254. }
  4255. return false;
  4256. };
  4257. function d(a, b) {
  4258. try {
  4259. return Math.hypot((b.y2 || b.y) - (a.y2 || a.y), (b.x2 || b.x) - (a.x2 || a.x));
  4260. } catch (a) {
  4261. return Infinity;
  4262. }
  4263. }
  4264. this.protect = function (a) {
  4265. if (!q.antiTrap) {
  4266. return;
  4267. }
  4268. if (d(oa, ja) > d(oa, mc.info)) {
  4269. for (let a = -(Math.PI / 2); a < Math.PI / 2; a += Math.PI / 18) {
  4270. Rb(2, oa.aim2 + a);
  4271. }
  4272. } else if (d(oa, mc.info) > d(oa, ja)) {
  4273. for (let a = -(Math.PI / 2); a < Math.PI / 2; a += Math.PI / 18) {
  4274. Rb(4, oa.aim2 + a);
  4275. }
  4276. }
  4277. };
  4278. this.autoPlace = function () {
  4279. if (ma.length && q.autoPlace && !nc.ticking) {
  4280. if (P.tick % (Math.max(1, parseInt(c("autoPlaceTick").value)) || 1) === 0) {
  4281. if (fa.length) {
  4282. let b = {
  4283. inTrap: false
  4284. };
  4285. let c = fa.filter(b => b.trap && b.active && b.isTeamObject(ja) && a.getDist(b, oa, 0, 2) <= oa.scale + b.getScale() + 5).sort(function (b, c) {
  4286. return a.getDist(b, oa, 0, 2) - a.getDist(c, oa, 0, 2);
  4287. })[0];
  4288. if (c) {
  4289. b.inTrap = true;
  4290. } else {
  4291. b.inTrap = false;
  4292. }
  4293. if (oa.dist3 <= 450) {
  4294. if (oa.dist3 <= 200) {
  4295. this.testCanPlace(4, 0, Math.PI * 2, Math.PI / 24, oa.aim2, 0, {
  4296. inTrap: b.inTrap
  4297. });
  4298. } else if (ja.items[4] == 15) {
  4299. this.testCanPlace(4, 0, Math.PI * 2, Math.PI / 24, oa.aim2);
  4300. }
  4301. }
  4302. } else if (oa.dist3 <= 450) {
  4303. if (ja.items[4] == 15) {
  4304. this.testCanPlace(4, 0, Math.PI * 2, Math.PI / 24, oa.aim2);
  4305. }
  4306. }
  4307. }
  4308. }
  4309. };
  4310. this.replacer = function (d) {
  4311. if (!d || !q.autoReplace) {
  4312. return;
  4313. }
  4314. if (!lb) {
  4315. return;
  4316. }
  4317. if (this.antiTrapped) {
  4318. return;
  4319. }
  4320. P.tickBase(() => {
  4321. let e = a.getDirect(d, ja, 0, 2);
  4322. let f = a.getDist(d, ja, 0, 2);
  4323. if (c("weaponGrind").checked && f <= b.weapons[ja.weaponIndex].range + ja.scale) {
  4324. return;
  4325. }
  4326. if (f <= 400 && oa.dist2 <= 400) {
  4327. let a = this.checkSpikeTick();
  4328. if (!a && oa.dist3 <= b.weapons[oa.primaryIndex || 5].range + oa.scale * 1.8) {
  4329. this.testCanPlace(2, 0, Math.PI * 2, Math.PI / 24, e, 1);
  4330. } else if (ja.items[4] == 15) {
  4331. this.testCanPlace(4, 0, Math.PI * 2, Math.PI / 24, e, 1);
  4332. }
  4333. this.replaced = true;
  4334. }
  4335. }, 1);
  4336. };
  4337. }
  4338. }
  4339. ;
  4340. class $b {
  4341. constructor() {
  4342. this.wait = false;
  4343. this.can = false;
  4344. this.isTrue = false;
  4345. this.nobull = false;
  4346. this.ticking = false;
  4347. this.canSpikeTick = false;
  4348. this.startTick = false;
  4349. this.readyTick = false;
  4350. this.canCounter = false;
  4351. this.revTick = false;
  4352. this.syncHit = false;
  4353. this.changeType = function (a) {
  4354. this.wait = false;
  4355. this.isTrue = true;
  4356. pa.autoAim = true;
  4357. let b = [a];
  4358. let c = oa.backupNobull;
  4359. oa.backupNobull = false;
  4360. if (a == "rev") {
  4361. Nb(ja.weapons[1]);
  4362. Lb(53, 0);
  4363. Ob();
  4364. setTimeout(() => {
  4365. Nb(ja.weapons[0]);
  4366. Lb(7, 0);
  4367. setTimeout(() => {
  4368. Ob();
  4369. this.isTrue = false;
  4370. pa.autoAim = false;
  4371. }, 225);
  4372. }, 100);
  4373. } else if (a == "nobull") {
  4374. Nb(ja.weapons[0]);
  4375. Lb(7, 0);
  4376. Ob();
  4377. setTimeout(() => {
  4378. Nb(ja.weapons[1]);
  4379. Lb(ja.reloads[53] == 0 ? 53 : 6, 0);
  4380. setTimeout(() => {
  4381. Ob();
  4382. this.isTrue = false;
  4383. pa.autoAim = false;
  4384. }, 255);
  4385. }, 105);
  4386. } else if (a == "normal") {
  4387. Nb(ja.weapons[0]);
  4388. Lb(7, 0);
  4389. Ob();
  4390. setTimeout(() => {
  4391. Nb(ja.weapons[1]);
  4392. Lb(ja.reloads[53] == 0 ? 53 : 6, 0);
  4393. setTimeout(() => {
  4394. Ob();
  4395. this.isTrue = false;
  4396. pa.autoAim = false;
  4397. }, 255);
  4398. }, 100);
  4399. } else {
  4400. setTimeout(() => {
  4401. this.isTrue = false;
  4402. pa.autoAim = false;
  4403. }, 50);
  4404. }
  4405. };
  4406. this.spikeTickType = function () {
  4407. this.isTrue = true;
  4408. pa.autoAim = true;
  4409. Nb(ja.weapons[0]);
  4410. Lb(7, 0);
  4411. Ob();
  4412. P.tickBase(() => {
  4413. Nb(ja.weapons[0]);
  4414. Lb(53, 0);
  4415. P.tickBase(() => {
  4416. Ob();
  4417. this.isTrue = false;
  4418. pa.autoAim = false;
  4419. }, 1);
  4420. }, 1);
  4421. };
  4422. this.counterType = function () {
  4423. this.isTrue = true;
  4424. pa.autoAim = true;
  4425. Nb(ja.weapons[0]);
  4426. Lb(7, 0);
  4427. Ob();
  4428. P.tickBase(() => {
  4429. Nb(ja.weapons[0]);
  4430. Lb(53, 0);
  4431. P.tickBase(() => {
  4432. Ob();
  4433. this.isTrue = false;
  4434. pa.autoAim = false;
  4435. }, 1);
  4436. }, 1);
  4437. };
  4438. this.rangeType = function (a) {
  4439. this.isTrue = true;
  4440. pa.autoAim = true;
  4441. if (a == "ageInsta") {
  4442. pa.ageInsta = false;
  4443. if (ja.items[5] == 18) {
  4444. Qb(5, oa.aim2);
  4445. }
  4446. U("a", undefined, 1);
  4447. Lb(22, 0);
  4448. Lb(21, 1);
  4449. P.tickBase(() => {
  4450. Nb(ja.weapons[1]);
  4451. Lb(53, 0);
  4452. Lb(21, 1);
  4453. Ob();
  4454. P.tickBase(() => {
  4455. Ib(12);
  4456. Nb(ja.weapons[1]);
  4457. Lb(53, 0);
  4458. Lb(21, 1);
  4459. P.tickBase(() => {
  4460. Ib(15);
  4461. Nb(ja.weapons[1]);
  4462. Lb(53, 0);
  4463. Lb(21, 1);
  4464. P.tickBase(() => {
  4465. Ob();
  4466. this.isTrue = false;
  4467. pa.autoAim = false;
  4468. }, 1);
  4469. }, 1);
  4470. }, 1);
  4471. }, 1);
  4472. } else {
  4473. Nb(ja.weapons[1]);
  4474. if (ja.reloads[53] == 0 && oa.dist2 <= 700 && oa.skinIndex != 22) {
  4475. Lb(53, 0);
  4476. } else {
  4477. Lb(20, 0);
  4478. }
  4479. Lb(11, 1);
  4480. Ob();
  4481. P.tickBase(() => {
  4482. Ob();
  4483. this.isTrue = false;
  4484. pa.autoAim = false;
  4485. }, 1);
  4486. }
  4487. };
  4488. this.oneTickType = function () {
  4489. this.isTrue = true;
  4490. pa.autoAim = true;
  4491. Nb(ja.weapons[1]);
  4492. Lb(53, 0);
  4493. Lb(11, 1);
  4494. U("a", oa.aim2, 1);
  4495. if (ja.weapons[1] == 15) {
  4496. pa.revAim = true;
  4497. Ob();
  4498. }
  4499. P.tickBase(() => {
  4500. pa.revAim = false;
  4501. Nb(ja.weapons[0]);
  4502. Lb(7, 0);
  4503. Lb(19, 1);
  4504. U("a", oa.aim2, 1);
  4505. if (ja.weapons[1] != 15) {
  4506. Ob();
  4507. }
  4508. P.tickBase(() => {
  4509. Ob();
  4510. this.isTrue = false;
  4511. pa.autoAim = false;
  4512. U("a", undefined, 1);
  4513. }, 1);
  4514. }, 1);
  4515. };
  4516. this.threeOneTickType = function () {
  4517. this.isTrue = true;
  4518. pa.autoAim = true;
  4519. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4520. Xb();
  4521. Lb(11, 1);
  4522. U("a", oa.aim2, 1);
  4523. P.tickBase(() => {
  4524. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4525. Lb(53, 0);
  4526. Lb(11, 1);
  4527. U("a", oa.aim2, 1);
  4528. P.tickBase(() => {
  4529. Nb(ja.weapons[0]);
  4530. Lb(7, 0);
  4531. Lb(19, 1);
  4532. Ob();
  4533. U("a", oa.aim2, 1);
  4534. P.tickBase(() => {
  4535. Ob();
  4536. this.isTrue = false;
  4537. pa.autoAim = false;
  4538. U("a", undefined, 1);
  4539. }, 1);
  4540. }, 1);
  4541. }, 1);
  4542. };
  4543. this.kmTickType = function () {
  4544. this.isTrue = true;
  4545. pa.autoAim = true;
  4546. pa.revAim = true;
  4547. Nb(ja.weapons[1]);
  4548. Lb(53, 0);
  4549. Lb(11, 1);
  4550. Ob();
  4551. U("a", oa.aim2, 1);
  4552. P.tickBase(() => {
  4553. pa.revAim = false;
  4554. Nb(ja.weapons[0]);
  4555. Lb(7, 0);
  4556. Lb(19, 1);
  4557. U("a", oa.aim2, 1);
  4558. P.tickBase(() => {
  4559. Ob();
  4560. this.isTrue = false;
  4561. pa.autoAim = false;
  4562. U("a", undefined, 1);
  4563. }, 1);
  4564. }, 1);
  4565. };
  4566. this.boostTickType = function () {
  4567. this.isTrue = true;
  4568. pa.autoAim = true;
  4569. Xb();
  4570. Lb(11, 1);
  4571. U("a", oa.aim2, 1);
  4572. P.tickBase(() => {
  4573. if (ja.weapons[1] == 15) {
  4574. pa.revAim = true;
  4575. }
  4576. Nb(ja.weapons[[9, 12, 13, 15].includes(ja.weapons[1]) ? 1 : 0]);
  4577. Lb(53, 0);
  4578. Lb(11, 1);
  4579. if ([9, 12, 13, 15].includes(ja.weapons[1])) {
  4580. Ob();
  4581. }
  4582. U("a", oa.aim2, 1);
  4583. Qb(4, oa.aim2);
  4584. P.tickBase(() => {
  4585. pa.revAim = false;
  4586. Nb(ja.weapons[0]);
  4587. Lb(7, 0);
  4588. Lb(19, 1);
  4589. if (![9, 12, 13, 15].includes(ja.weapons[1])) {
  4590. Ob();
  4591. }
  4592. U("a", oa.aim2, 1);
  4593. P.tickBase(() => {
  4594. Ob();
  4595. this.isTrue = false;
  4596. pa.autoAim = false;
  4597. U("a", undefined, 1);
  4598. }, 1);
  4599. }, 1);
  4600. }, 1);
  4601. };
  4602. this.gotoGoal = function (a, b) {
  4603. let c = a => a * f.playerScale;
  4604. let d = {
  4605. a: a - b,
  4606. b: a + b,
  4607. c: a - c(1),
  4608. d: a + c(1),
  4609. e: a - c(2),
  4610. f: a + c(2),
  4611. g: a - c(4),
  4612. h: a + c(4)
  4613. };
  4614. let e = function (a, b) {
  4615. if (ja.y2 >= f.mapScale / 2 - f.riverWidth / 2 && ja.y2 <= f.mapScale / 2 + f.riverWidth / 2 && b == 0) {
  4616. Lb(31, 0);
  4617. } else {
  4618. Lb(a, b);
  4619. }
  4620. };
  4621. if (ma.length) {
  4622. let a = oa.dist2;
  4623. this.ticking = true;
  4624. if (a >= d.a && a <= d.b) {
  4625. e(22, 0);
  4626. e(11, 1);
  4627. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4628. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4629. }
  4630. return {
  4631. dir: undefined,
  4632. action: 1
  4633. };
  4634. } else {
  4635. if (a < d.a) {
  4636. if (a >= d.g) {
  4637. if (a >= d.e) {
  4638. if (a >= d.c) {
  4639. e(40, 0);
  4640. e(10, 1);
  4641. if (q.slowOT) {
  4642. if (ja.buildIndex != ja.items[1]) {
  4643. Mb(ja.items[1]);
  4644. }
  4645. } else if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4646. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4647. }
  4648. } else {
  4649. e(22, 0);
  4650. e(19, 1);
  4651. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4652. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4653. }
  4654. }
  4655. } else {
  4656. e(6, 0);
  4657. e(12, 1);
  4658. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4659. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4660. }
  4661. }
  4662. } else {
  4663. Xb();
  4664. e(11, 1);
  4665. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4666. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4667. }
  4668. }
  4669. return {
  4670. dir: oa.aim2 + Math.PI,
  4671. action: 0
  4672. };
  4673. } else if (a > d.b) {
  4674. if (a <= d.h) {
  4675. if (a <= d.f) {
  4676. if (a <= d.d) {
  4677. e(40, 0);
  4678. e(9, 1);
  4679. if (q.slowOT) {
  4680. if (ja.buildIndex != ja.items[1]) {
  4681. Mb(ja.items[1]);
  4682. }
  4683. } else if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4684. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4685. }
  4686. } else {
  4687. e(22, 0);
  4688. e(19, 1);
  4689. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4690. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4691. }
  4692. }
  4693. } else {
  4694. e(6, 0);
  4695. e(12, 1);
  4696. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4697. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4698. }
  4699. }
  4700. } else {
  4701. Xb();
  4702. e(11, 1);
  4703. if (ja.weaponIndex != ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0] || ja.buildIndex > -1) {
  4704. Nb(ja.weapons[[10, 14].includes(ja.weapons[1]) ? 1 : 0]);
  4705. }
  4706. }
  4707. return {
  4708. dir: oa.aim2,
  4709. action: 0
  4710. };
  4711. }
  4712. return {
  4713. dir: undefined,
  4714. action: 0
  4715. };
  4716. }
  4717. } else {
  4718. this.ticking = false;
  4719. return {
  4720. dir: undefined,
  4721. action: 0
  4722. };
  4723. }
  4724. };
  4725. this.bowMovement = function () {
  4726. let a = this.gotoGoal(685, 3);
  4727. if (a.action) {
  4728. if (ja.reloads[53] == 0 && !this.isTrue) {
  4729. this.rangeType("ageInsta");
  4730. } else {
  4731. U("a", a.dir, 1);
  4732. }
  4733. } else {
  4734. U("a", a.dir, 1);
  4735. }
  4736. };
  4737. this.tickMovement = function () {
  4738. let a = this.gotoGoal([10, 14].includes(ja.weapons[1]) && ja.y2 > f.snowBiomeTop ? 240 : ja.weapons[1] == 15 ? 250 : ja.y2 <= f.snowBiomeTop ? [10, 14].includes(ja.weapons[1]) ? 270 : 265 : 275, 3);
  4739. if (a.action) {
  4740. if (![6, 22].includes(oa.skinIndex) && ja.reloads[53] == 0 && !this.isTrue) {
  4741. if ([10, 14].includes(ja.weapons[1]) && ja.y2 > f.snowBiomeTop || ja.weapons[1] == 15) {
  4742. this.oneTickType();
  4743. } else {
  4744. this.threeOneTickType();
  4745. }
  4746. } else {
  4747. U("a", a.dir, 1);
  4748. }
  4749. } else {
  4750. U("a", a.dir, 1);
  4751. }
  4752. };
  4753. this.kmTickMovement = function () {
  4754. let a = this.gotoGoal(240, 3);
  4755. if (a.action) {
  4756. if (oa.skinIndex != 22 && ja.reloads[53] == 0 && !this.isTrue && (P.tick - oa.poisonTick) % f.serverUpdateRate == 8) {
  4757. this.kmTickType();
  4758. } else {
  4759. U("a", a.dir, 1);
  4760. }
  4761. } else {
  4762. U("a", a.dir, 1);
  4763. }
  4764. };
  4765. this.boostTickMovement = function () {
  4766. let a = ja.weapons[1] == 9 ? 365 : ja.weapons[1] == 12 ? 380 : ja.weapons[1] == 13 ? 390 : ja.weapons[1] == 15 ? 365 : 370;
  4767. let b = ja.weapons[1] == 9 ? 2 : ja.weapons[1] == 12 ? 1.5 : ja.weapons[1] == 13 ? 1.5 : ja.weapons[1] == 15 ? 2 : 3;
  4768. let c = this.gotoGoal(a, b);
  4769. if (c.action) {
  4770. if (ja.reloads[53] == 0 && !this.isTrue) {
  4771. this.boostTickType();
  4772. } else {
  4773. U("a", c.dir, 1);
  4774. }
  4775. } else {
  4776. U("a", c.dir, 1);
  4777. }
  4778. };
  4779. this.perfCheck = function (a, b) {
  4780. if (b.weaponIndex == 11 && dc.getAngleDist(b.aim2 + Math.PI, b.d2) <= f.shieldAngle) {
  4781. return false;
  4782. }
  4783. if (![9, 12, 13, 15].includes(ja.weapons[1])) {
  4784. return true;
  4785. }
  4786. let c = {
  4787. x: b.x2 + Math.cos(b.aim2 + Math.PI) * 70,
  4788. y: b.y2 + Math.sin(b.aim2 + Math.PI) * 70
  4789. };
  4790. if (dc.lineInRect(a.x2 - a.scale, a.y2 - a.scale, a.x2 + a.scale, a.y2 + a.scale, c.x, c.y, c.x, c.y)) {
  4791. return true;
  4792. }
  4793. let d = aa.filter(a => a.visible).find(a => {
  4794. if (dc.lineInRect(a.x2 - a.scale, a.y2 - a.scale, a.x2 + a.scale, a.y2 + a.scale, c.x, c.y, c.x, c.y)) {
  4795. return true;
  4796. }
  4797. });
  4798. if (d) {
  4799. return false;
  4800. }
  4801. d = fa.filter(a => a.active).find(a => {
  4802. let b = a.getScale();
  4803. if (!a.ignoreCollision && dc.lineInRect(a.x - b, a.y - b, a.x + b, a.y + b, c.x, c.y, c.x, c.y)) {
  4804. return true;
  4805. }
  4806. });
  4807. if (d) {
  4808. return false;
  4809. }
  4810. return true;
  4811. };
  4812. }
  4813. }
  4814. ;
  4815. class _b {
  4816. constructor(a, b) {
  4817. this.hat = function () {
  4818. a.forEach(a => {
  4819. let b = qa(hc, a);
  4820. if (b && !ja.skins[a] && ja.points >= b.price) {
  4821. U("c", 1, a, 0);
  4822. }
  4823. });
  4824. };
  4825. this.acc = function () {
  4826. b.forEach(a => {
  4827. let b = qa(ic, a);
  4828. if (b && !ja.tails[a] && ja.points >= b.price) {
  4829. U("c", 1, a, 1);
  4830. }
  4831. });
  4832. };
  4833. }
  4834. }
  4835. ;
  4836. class ac {
  4837. constructor() {
  4838. this.sb = function (a) {
  4839. a(3);
  4840. a(17);
  4841. a(31);
  4842. a(23);
  4843. a(9);
  4844. a(38);
  4845. };
  4846. this.kh = function (a) {
  4847. a(3);
  4848. a(17);
  4849. a(31);
  4850. a(23);
  4851. a(10);
  4852. a(38);
  4853. a(4);
  4854. a(25);
  4855. };
  4856. this.pb = function (a) {
  4857. a(5);
  4858. a(17);
  4859. a(32);
  4860. a(23);
  4861. a(9);
  4862. a(38);
  4863. };
  4864. this.ph = function (a) {
  4865. a(5);
  4866. a(17);
  4867. a(32);
  4868. a(23);
  4869. a(10);
  4870. a(38);
  4871. a(28);
  4872. a(25);
  4873. };
  4874. this.db = function (a) {
  4875. a(7);
  4876. a(17);
  4877. a(31);
  4878. a(23);
  4879. a(9);
  4880. a(34);
  4881. };
  4882. this.km = function (a) {
  4883. a(7);
  4884. a(17);
  4885. a(31);
  4886. a(23);
  4887. a(10);
  4888. a(38);
  4889. a(4);
  4890. a(15);
  4891. };
  4892. }
  4893. }
  4894. ;
  4895. class bc {
  4896. constructor(a) {
  4897. this.calcDmg = function (a, b) {
  4898. return a * b;
  4899. };
  4900. this.getAllDamage = function (a) {
  4901. return [this.calcDmg(a, 0.75), a, this.calcDmg(a, 1.125), this.calcDmg(a, 1.5)];
  4902. };
  4903. this.weapons = [];
  4904. for (let b = 0; b < a.weapons.length; b++) {
  4905. let c = a.weapons[b];
  4906. let d = c.name.split(" ").length <= 1 ? c.name : c.name.split(" ")[0] + "_" + c.name.split(" ")[1];
  4907. this.weapons.push(this.getAllDamage(b > 8 ? c.Pdmg : c.dmg));
  4908. this[d] = this.weapons[b];
  4909. }
  4910. }
  4911. }
  4912. let cc = [];
  4913. let dc = new ub();
  4914. let ec = new yb();
  4915. let fc = new zb(xb, ea, dc, f);
  4916. let gc = new Bb();
  4917. let hc = gc.hats;
  4918. let ic = gc.accessories;
  4919. let jc = new Cb(Ab, ga, ba, aa, fc, ec, f, dc);
  4920. let kc = new Db(aa, Eb, ba, ec, null, f, dc);
  4921. let lc = new wb();
  4922. let mc = new Zb(dc, ec);
  4923. let nc = new $b();
  4924. let oc = new _b([6, 7, 22, 12, 53, 40, 15, 31, 20], [11, 13, 19, 18, 21]);
  4925. let pc = new ac();
  4926. let qc;
  4927. let rc;
  4928. let sc = {};
  4929. let tc = [];
  4930. let uc;
  4931. let vc = [];
  4932. function wc(a) {
  4933. U("6", a.slice(0, 30));
  4934. }
  4935. let xc = [];
  4936. function yc(a, b, c, d, e, g, h, i) {
  4937. let j = g == 0 ? 9 : g == 2 ? 12 : g == 3 ? 13 : g == 5 && 15;
  4938. let k = f.playerScale * 2;
  4939. let l = {
  4940. x: g == 1 ? a : a - k * Math.cos(c),
  4941. y: g == 1 ? b : b - k * Math.sin(c)
  4942. };
  4943. let m = ba.filter(a => a.visible && dc.getDist(l, a, 0, 2) <= a.scale).sort(function (a, b) {
  4944. return dc.getDist(l, a, 0, 2) - dc.getDist(l, b, 0, 2);
  4945. })[0];
  4946. if (m) {
  4947. if (g == 1) {
  4948. m.shooting[53] = 1;
  4949. } else {
  4950. m.shootIndex = j;
  4951. m.shooting[1] = 1;
  4952. Ac(m, c, d, e, g, j);
  4953. }
  4954. }
  4955. }
  4956. let zc = 0;
  4957. function Ac(a, b, c, d, e, f) {
  4958. if (!a.isTeam(ja)) {
  4959. $a = dc.getDirect(ja, a, 2, 2);
  4960. if (dc.getAngleDist($a, b) <= 0.2) {
  4961. a.bowThreat[f]++;
  4962. if (e == 5) {
  4963. zc++;
  4964. }
  4965. setTimeout(() => {
  4966. a.bowThreat[f]--;
  4967. if (e == 5) {
  4968. zc--;
  4969. }
  4970. }, c / d);
  4971. if (a.bowThreat[9] >= 1 && (a.bowThreat[12] >= 1 || a.bowThreat[15] >= 1)) {
  4972. Qb(1, a.aim2);
  4973. pa.anti0Tick = 4;
  4974. if (!pa.antiSync) {
  4975. Wb(4);
  4976. }
  4977. } else if (zc >= 2) {
  4978. Qb(1, a.aim2);
  4979. pa.anti0Tick = 4;
  4980. if (!pa.antiSync) {
  4981. Wb(4);
  4982. }
  4983. }
  4984. }
  4985. }
  4986. }
  4987. function Bc(a, b, c) {
  4988. if (ja && a) {
  4989. dc.removeAllChildren(Ma);
  4990. Ma.classList.add("visible");
  4991. dc.generateElement({
  4992. id: "itemInfoName",
  4993. text: dc.capitalizeFirst(a.name),
  4994. parent: Ma
  4995. });
  4996. dc.generateElement({
  4997. id: "itemInfoDesc",
  4998. text: a.desc,
  4999. parent: Ma
  5000. });
  5001. if (c) {} else if (b) {
  5002. dc.generateElement({
  5003. class: "itemInfoReq",
  5004. text: !a.type ? "primary" : "secondary",
  5005. parent: Ma
  5006. });
  5007. } else {
  5008. for (let b = 0; b < a.req.length; b += 2) {
  5009. dc.generateElement({
  5010. class: "itemInfoReq",
  5011. html: a.req[b] + "<span class='itemInfoReqVal'> x" + a.req[b + 1] + "</span>",
  5012. parent: Ma
  5013. });
  5014. }
  5015. if (a.group.limit) {
  5016. dc.generateElement({
  5017. class: "itemInfoLmt",
  5018. text: (ja.itemCounts[a.group.id] || 0) + "/" + (f.isSandbox ? 99 : a.group.limit),
  5019. parent: Ma
  5020. });
  5021. }
  5022. }
  5023. } else {
  5024. Ma.classList.remove("visible");
  5025. }
  5026. }
  5027. window.addEventListener("resize", dc.checkTrusted(Cc));
  5028. function Cc() {
  5029. Qa = window.innerWidth;
  5030. Ra = window.innerHeight;
  5031. let a = Math.max(Qa / Sa, Ra / Ta) * Ua;
  5032. Aa.width = Qa * Ua;
  5033. Aa.height = Ra * Ua;
  5034. Aa.style.width = Qa + "px";
  5035. Aa.style.height = Ra + "px";
  5036. Ba.setTransform(a, 0, 0, a, (Qa * Ua - Sa * a) / 2, (Ra * Ua - Ta * a) / 2);
  5037. }
  5038. Cc();
  5039. var Dc;
  5040. const Ec = document.getElementById("touch-controls-fullscreen");
  5041. Ec.style.display = "block";
  5042. Ec.addEventListener("mousemove", Fc, false);
  5043. function Fc(a) {
  5044. _a = a.clientX;
  5045. ab = a.clientY;
  5046. }
  5047. let Gc = {
  5048. left: false,
  5049. middle: false,
  5050. right: false
  5051. };
  5052. Ec.addEventListener("mousedown", Hc, false);
  5053. function Hc(a) {
  5054. if (kb != 1) {
  5055. kb = 1;
  5056. if (a.button == 0) {
  5057. Gc.left = true;
  5058. } else if (a.button == 1) {
  5059. Gc.middle = true;
  5060. } else if (a.button == 2) {
  5061. Gc.right = true;
  5062. }
  5063. }
  5064. }
  5065. Ec.addEventListener("mouseup", dc.checkTrusted(Ic));
  5066. function Ic(a) {
  5067. if (kb != 0) {
  5068. kb = 0;
  5069. if (a.button == 0) {
  5070. Gc.left = false;
  5071. } else if (a.button == 1) {
  5072. Gc.middle = false;
  5073. } else if (a.button == 2) {
  5074. Gc.right = false;
  5075. }
  5076. }
  5077. }
  5078. Ec.addEventListener("wheel", Jc, false);
  5079. function Jc(a) {
  5080. if (a.deltaY < 0) {
  5081. wbe += 0.005;
  5082. Sa = f.maxScreenWidth * wbe;
  5083. Ta = f.maxScreenHeight * wbe;
  5084. Cc();
  5085. } else {
  5086. wbe -= 0.005;
  5087. Sa = f.maxScreenWidth * wbe;
  5088. Ta = f.maxScreenHeight * wbe;
  5089. Cc();
  5090. }
  5091. }
  5092. function Kc() {
  5093. let a = 0;
  5094. let b = 0;
  5095. for (let c in jb) {
  5096. let d = jb[c];
  5097. a += !!ib[c] * d[0];
  5098. b += !!ib[c] * d[1];
  5099. }
  5100. if (a == 0 && b == 0) {
  5101. return undefined;
  5102. } else {
  5103. return Math.atan2(b, a);
  5104. }
  5105. }
  5106. function Lc() {
  5107. if (!ja) {
  5108. return 0;
  5109. }
  5110. if (!ja.lockDir) {
  5111. ob = Math.atan2(ab - Ra / 2, _a - Qa / 2);
  5112. }
  5113. return ob || 0;
  5114. }
  5115. let Mc = 0;
  5116. let Nc = Date.now();
  5117. function Oc() {
  5118. if (ja && Date.now() - Nc >= 235 && !Gc.right && !Gc.left) {
  5119. Mc += Math.random() * (Math.PI * 2);
  5120. Nc = Date.now();
  5121. }
  5122. if (!ja) {
  5123. return "0";
  5124. }
  5125. if (pa.autoAim || (Gc.left || K && oa.dist2 <= ec.weapons[ja.weapons[0]].range + oa.scale * 1.8 && !mc.inTrap) && ja.reloads[ja.weapons[0]] == 0) {
  5126. ob = c("weaponGrind").checked ? Lc() : ma.length ? oa.aim2 : Lc();
  5127. } else if (Gc.right && ja.reloads[ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]] == 0) {
  5128. ob = Lc();
  5129. } else if (mc.inTrap) {
  5130. ob = mc.aim;
  5131. } else if (!ja.lockDir) {
  5132. if (!ja.lockDir && nd.stopspin) {
  5133. if (K) {
  5134. ob = ob;
  5135. } else {
  5136. ob = Lc();
  5137. }
  5138. }
  5139. }
  5140. return ob;
  5141. }
  5142. function Pc() {
  5143. if (!ja) {
  5144. return 0;
  5145. }
  5146. ob = Lc();
  5147. return ob || 0;
  5148. }
  5149. function Qc() {
  5150. return bb.style.display != "block" && Ja.style.display != "block" && !z;
  5151. }
  5152. function Rc() {
  5153. if (w.style.display != "none") {
  5154. let a = function (a) {
  5155. return {
  5156. found: a.startsWith("/") && p[a.slice(1).split(" ")[0]],
  5157. fv: p[a.slice(1).split(" ")[0]]
  5158. };
  5159. };
  5160. let b = a(y.value);
  5161. if (b.found) {
  5162. if (typeof b.fv.action === "function") {
  5163. b.fv.action(y.value);
  5164. }
  5165. } else {
  5166. wc(y.value);
  5167. }
  5168. y.value = "";
  5169. y.blur();
  5170. } else if (z) {
  5171. y.blur();
  5172. } else {
  5173. y.focus();
  5174. }
  5175. }
  5176. function Sc(a) {
  5177. let b = a.which || a.keyCode || 0;
  5178. if (ja && ja.alive && Qc()) {
  5179. if (!ib[b]) {
  5180. ib[b] = 1;
  5181. mb[a.key] = 1;
  5182. if (b == 27) {
  5183. H = !H;
  5184. $("#menuDiv").toggle();
  5185. $("#menuChatDiv").toggle();
  5186. } else if (b == 69) {
  5187. Ob();
  5188. } else if (b == 67) {
  5189. Ze();
  5190. } else if (ja.weapons[b - 49] != undefined) {
  5191. ja.weaponCode = ja.weapons[b - 49];
  5192. } else if (jb[b]) {
  5193. Uc();
  5194. } else if (a.key == "m") {
  5195. nb.placeSpawnPads = !nb.placeSpawnPads;
  5196. } else if (a.key == "z") {
  5197. nb.place = !nb.place;
  5198. } else if (a.key == "z") {
  5199. W.send("6", "holding V rn XD");
  5200. } else if (a.key == "Z") {
  5201. if (typeof window.debug == "function") {
  5202. window.debug();
  5203. }
  5204. } else if (b == 32) {
  5205. U("d", 1, Lc(), 1);
  5206. U("d", 0, Lc(), 1);
  5207. } else if (a.key == ",") {
  5208. W.send("6", "syncon");
  5209. Gd.send(JSON.stringify(["tezt", "ratio"]));
  5210. for (let a = 0; a < Ud.length; a++) {
  5211. Ud[a][0].zync(oa);
  5212. console.log(Ud[a][0]);
  5213. }
  5214. }
  5215. }
  5216. }
  5217. }
  5218. addEventListener("keydown", dc.checkTrusted(Sc));
  5219. function Tc(a) {
  5220. if (ja && ja.alive) {
  5221. let b = a.which || a.keyCode || 0;
  5222. if (b == 13) {
  5223. Rc();
  5224. } else if (Qc()) {
  5225. if (ib[b]) {
  5226. ib[b] = 0;
  5227. mb[a.key] = 0;
  5228. if (jb[b]) {
  5229. Uc();
  5230. } else if (a.key == ",") {
  5231. ja.sync = false;
  5232. }
  5233. }
  5234. }
  5235. }
  5236. }
  5237. window.addEventListener("keyup", dc.checkTrusted(Tc));
  5238. function Uc() {
  5239. if (ld) {
  5240. U("a", undefined, 1);
  5241. } else {
  5242. let a = Kc();
  5243. if (S == undefined || a == undefined || Math.abs(a - S) > 0.3) {
  5244. if (!pa.autoPush && !ld) {
  5245. U("a", a, 1);
  5246. }
  5247. S = a;
  5248. }
  5249. }
  5250. }
  5251. function Vc() {}
  5252. Vc();
  5253. let Wc = [];
  5254. function Xc(a = undefined) {
  5255. if (a === undefined) a = undefined;
  5256. for (let b = 3; b < ec.list.length; ++b) {
  5257. let d = ec.list[b].group.id;
  5258. let e = ec.weapons.length + b;
  5259. if (!Wc[e]) {
  5260. Wc[e] = document.createElement("div");
  5261. Wc[e].id = "itemCount" + e;
  5262. c("actionBarItem" + e).appendChild(Wc[e]);
  5263. Wc[e].style = "\n display: block;\n position: absolute;\n padding-left: 5px;\n font-size: 2em;\n color: #fff;\n ";
  5264. Wc[e].innerHTML = ja.itemCounts[d] || 0;
  5265. } else if (a == d) {
  5266. Wc[e].innerHTML = ja.itemCounts[a] || 0;
  5267. }
  5268. }
  5269. }
  5270. function Yc() {
  5271. let a = fa.filter(a => a.trap && a.active && a.isTeamObject(ja) && dc.getDist(a, oa, 0, 2) <= oa.scale + a.getScale() + 5).sort(function (a, b) {
  5272. return dc.getDist(a, oa, 0, 2) - dc.getDist(b, oa, 0, 2);
  5273. })[0];
  5274. if (a) {
  5275. let b = fa.filter(b => b.dmg && b.active && b.isTeamObject(ja) && dc.getDist(b, a, 0, 0) <= oa.scale + a.scale + b.scale).sort(function (a, b) {
  5276. return dc.getDist(a, oa, 0, 2) - dc.getDist(b, oa, 0, 2);
  5277. })[0];
  5278. if (b) {
  5279. let a = Math.atan2(oa.y2 - b.y, oa.x2 - b.x);
  5280. pa.autoPush = true;
  5281. pa.pushData = {
  5282. x: b.x + Math.cos(a),
  5283. y: b.y + Math.sin(a),
  5284. x2: ja.x2 + 30,
  5285. y2: ja.y2 + 30
  5286. };
  5287. let c = {
  5288. x: oa.x2 + Math.cos(a) * 30,
  5289. y: oa.y2 + Math.sin(a) * 60
  5290. };
  5291. let d = Math.atan2(c.y - ja.y2, c.x - ja.x2);
  5292. U("a", d, 1);
  5293. } else if (pa.autoPush) {
  5294. pa.autoPush = false;
  5295. U("a", S || undefined, 1);
  5296. }
  5297. } else if (pa.autoPush) {
  5298. pa.autoPush = false;
  5299. U("a", S || undefined, 1);
  5300. }
  5301. }
  5302. function Zc(a) {
  5303. ha.push(new Gb(a.x, a.y, a.dir, a.buildIndex, a.weaponIndex, a.weaponVariant, a.skinColor, a.scale, a.name));
  5304. }
  5305. function $c(a) {
  5306. ca = a.teams;
  5307. }
  5308. function _c(a) {
  5309. ib = {};
  5310. mb = {};
  5311. ka = a;
  5312. kb = 0;
  5313. lb = true;
  5314. U("d", 0, Oc(), 1);
  5315. pa.ageInsta = true;
  5316. if (hb) {
  5317. hb = false;
  5318. ea.length = 0;
  5319. fa.length = 0;
  5320. }
  5321. }
  5322. function ad(a, b) {
  5323. let c = sa(a[0]);
  5324. if (!c) {
  5325. c = new Hb(a[0], a[1], f, dc, jc, fc, ba, aa, ec, hc, ic);
  5326. ba.push(c);
  5327. if (a[1] != ka) {
  5328. B(null, "Found " + a[2] + " {" + a[1] + "}", "lime");
  5329. }
  5330. } else if (a[1] != ka) {
  5331. B(null, "Found " + a[2] + " {" + a[1] + "}", "lime");
  5332. }
  5333. c.spawn(b ? true : null);
  5334. c.visible = false;
  5335. c.oldPos = {
  5336. x2: undefined,
  5337. y2: undefined
  5338. };
  5339. c.x2 = undefined;
  5340. c.y2 = undefined;
  5341. c.x3 = undefined;
  5342. c.y3 = undefined;
  5343. c.setData(a);
  5344. if (b) {
  5345. if (!ja) {
  5346. window.prepareUI(c);
  5347. }
  5348. ja = c;
  5349. Ya = ja.x;
  5350. Za = ja.y;
  5351. pa.lastDir = 0;
  5352. zd();
  5353. fd();
  5354. Xc();
  5355. if (ja.skins[7]) {
  5356. pa.reSync = true;
  5357. }
  5358. }
  5359. }
  5360. function bd(a) {
  5361. for (let b = 0; b < ba.length; b++) {
  5362. if (ba[b].id == a) {
  5363. B("Game", ba[b].name + "[" + ba[b].sid + "] left the game", "red");
  5364. ba.splice(b, 1);
  5365. break;
  5366. }
  5367. }
  5368. }
  5369. function cd(a, b) {
  5370. la = ta(a);
  5371. if (la) {
  5372. la.oldHealth = la.health;
  5373. la.health = b;
  5374. la.judgeShame();
  5375. if (la.oldHealth > la.health) {
  5376. la.timeDamaged = Date.now();
  5377. la.damaged = la.oldHealth - la.health;
  5378. let b = la.damaged;
  5379. la = ta(a);
  5380. let c = false;
  5381. if (la.health <= 0) {
  5382. if (!la.death) {
  5383. la.death = true;
  5384. if (la != ja) {
  5385. if (la.skinIndex == 45) {
  5386. B("Game", la.name + "[" + la.sid + "] has died due to clown", "red");
  5387. } else if (la.shameCount >= 5) {
  5388. B("Game", la.name + "[" + la.sid + "] has died due to high shame", "red");
  5389. } else {
  5390. B("Game", la.name + "[" + la.sid + "] has died", "red");
  5391. }
  5392. }
  5393. Zc(la);
  5394. }
  5395. }
  5396. if (la == ja) {
  5397. if (la.skinIndex == 7 && (b == 5 || la.latestTail == 13 && b == 2)) {
  5398. if (pa.reSync) {
  5399. pa.reSync = false;
  5400. la.setBullTick = true;
  5401. }
  5402. c = true;
  5403. }
  5404. if (lb) {
  5405. let a = Ub(b);
  5406. let d = [0.25, 0.45].map(a => a * ec.weapons[ja.weapons[0]].dmg * Sb());
  5407. let e = !c && d.includes(b);
  5408. let f = 95;
  5409. let g = function (a) {
  5410. setTimeout(() => {
  5411. Vb();
  5412. }, a);
  5413. };
  5414. if (oa.length && oa.damageThreat(ja) - (ja.canEmpAnti || ja.empAnti ? 25 : 0) >= 85) {
  5415. ja.canEmpAnti = true;
  5416. ja.antiTimer = P.tick;
  5417. let a = 4;
  5418. if (ja.shameCount < a) {
  5419. Vb();
  5420. } else {
  5421. g(f);
  5422. }
  5423. } else {
  5424. g(f);
  5425. }
  5426. }
  5427. } else if (!la.setPoisonTick && (la.damaged == 5 || la.latestTail == 13 && la.damaged == 2)) {
  5428. la.setPoisonTick = true;
  5429. }
  5430. } else {
  5431. la.timeHealed = Date.now();
  5432. }
  5433. if (la.health <= 0) {
  5434. Pd.forEach(a => {
  5435. a.whyDie = la.name;
  5436. });
  5437. }
  5438. }
  5439. }
  5440. function dd() {
  5441. lb = false;
  5442. qc = {
  5443. x: ja.x,
  5444. y: ja.y
  5445. };
  5446. }
  5447. function ed(a, b) {
  5448. if (ja) {
  5449. ja.itemCounts[a] = b;
  5450. Xc(a);
  5451. }
  5452. }
  5453. function fd(a, b, c) {
  5454. if (a != undefined) {
  5455. ja.XP = a;
  5456. }
  5457. if (b != undefined) {
  5458. ja.maxXP = b;
  5459. }
  5460. if (c != undefined) {
  5461. ja.age = c;
  5462. }
  5463. }
  5464. function gd(a, b) {
  5465. ja.upgradePoints = a;
  5466. ja.upgrAge = b;
  5467. if (a > 0) {
  5468. cc.length = 0;
  5469. dc.removeAllChildren(Ga);
  5470. for (let a = 0; a < ec.weapons.length; ++a) {
  5471. if (ec.weapons[a].age == b && (ec.weapons[a].pre == undefined || ja.weapons.indexOf(ec.weapons[a].pre) >= 0)) {
  5472. let b = dc.generateElement({
  5473. id: "upgradeItem" + a,
  5474. class: "actionBarItem",
  5475. onmouseout: function () {
  5476. Bc();
  5477. },
  5478. parent: Ga
  5479. });
  5480. b.style.backgroundImage = c("actionBarItem" + a).style.backgroundImage;
  5481. cc.push(a);
  5482. }
  5483. }
  5484. for (let a = 0; a < ec.list.length; ++a) {
  5485. if (ec.list[a].age == b && (ec.list[a].pre == undefined || ja.items.indexOf(ec.list[a].pre) >= 0)) {
  5486. let b = ec.weapons.length + a;
  5487. let d = dc.generateElement({
  5488. id: "upgradeItem" + b,
  5489. class: "actionBarItem",
  5490. onmouseout: function () {
  5491. Bc();
  5492. },
  5493. parent: Ga
  5494. });
  5495. d.style.backgroundImage = c("actionBarItem" + b).style.backgroundImage;
  5496. cc.push(b);
  5497. }
  5498. }
  5499. for (let a = 0; a < cc.length; a++) {
  5500. (function (a) {
  5501. let b = c("upgradeItem" + a);
  5502. b.onclick = dc.checkTrusted(function () {
  5503. U("H", a);
  5504. });
  5505. dc.hookTouchEvents(b);
  5506. })(cc[a]);
  5507. }
  5508. if (cc.length) {
  5509. Ga.style.display = "block";
  5510. Ha.style.display = "block";
  5511. Ha.innerHTML = "SELECT ITEMS (" + a + ")";
  5512. } else {
  5513. Ga.style.display = "none";
  5514. Ha.style.display = "none";
  5515. Bc();
  5516. }
  5517. } else {
  5518. Ga.style.display = "none";
  5519. Ha.style.display = "none";
  5520. Bc();
  5521. }
  5522. }
  5523. function hd(a) {
  5524. let b = va(a);
  5525. fc.disableBySid(a);
  5526. if (ja) {
  5527. for (let b = 0; b < ia.length; b++) {
  5528. if (ia[b].sid == a) {
  5529. ia.splice(b, 1);
  5530. break;
  5531. }
  5532. }
  5533. if (!ja.canSee(b)) {
  5534. vc.push({
  5535. x: b.x,
  5536. y: b.y
  5537. });
  5538. }
  5539. if (vc.length > 8) {
  5540. vc.shift();
  5541. }
  5542. mc.replacer(b);
  5543. }
  5544. }
  5545. function id(a) {
  5546. if (ja) {
  5547. fc.removeAllItems(a);
  5548. }
  5549. }
  5550. function jd(a, b) {
  5551. if (!_.manage[_.tick + b]) {
  5552. _.manage[_.tick + b] = [a];
  5553. } else {
  5554. _.manage[_.tick + b].push(a);
  5555. }
  5556. }
  5557. function kd(a, b) {
  5558. try {
  5559. return Math.atan2((b.y2 || b.y) - (a.y2 || a.y), (b.x2 || b.x) - (a.x2 || a.x));
  5560. } catch (a) {
  5561. return 0;
  5562. }
  5563. }
  5564. let ld = false;
  5565. let md = false;
  5566. let nd = {
  5567. insta: {
  5568. todo: false,
  5569. wait: false,
  5570. count: 4,
  5571. shame: 5
  5572. },
  5573. bull: false,
  5574. antibull: 0,
  5575. reloaded: false,
  5576. stopspin: true
  5577. };
  5578. function od(a) {
  5579. function b(a, b) {
  5580. a = a % (Math.PI * 2);
  5581. b = b % (Math.PI * 2);
  5582. let c = Math.abs(a - b);
  5583. if (c > Math.PI) {
  5584. c = Math.PI * 2 - c;
  5585. }
  5586. return c;
  5587. }
  5588. P.tick++;
  5589. ma = [];
  5590. na = [];
  5591. oa = [];
  5592. P.tickSpeed = performance.now() - P.lastTick;
  5593. P.lastTick = performance.now();
  5594. ba.forEach(a => {
  5595. a.forcePos = !a.visible;
  5596. a.visible = false;
  5597. if (a.timeHealed - a.timeDamaged > 0 && a.lastshamecount < a.shameCount) {
  5598. a.pinge = a.timeHealed - a.timeDamaged;
  5599. }
  5600. });
  5601. for (let b = 0; b < a.length;) {
  5602. la = ta(a[b]);
  5603. if (la) {
  5604. la.t1 = la.t2 === undefined ? P.lastTick : la.t2;
  5605. la.t2 = P.lastTick;
  5606. la.oldPos.x2 = la.x2;
  5607. la.oldPos.y2 = la.y2;
  5608. la.x1 = la.x;
  5609. la.y1 = la.y;
  5610. la.x2 = a[b + 1];
  5611. la.y2 = a[b + 2];
  5612. la.x3 = la.x2 + (la.x2 - la.oldPos.x2);
  5613. la.y3 = la.y2 + (la.y2 - la.oldPos.y2);
  5614. la.d1 = la.d2 === undefined ? a[b + 3] : la.d2;
  5615. la.d2 = a[b + 3];
  5616. la.dt = 0;
  5617. la.buildIndex = a[b + 4];
  5618. la.weaponIndex = a[b + 5];
  5619. la.weaponVariant = a[b + 6];
  5620. la.team = a[b + 7];
  5621. la.isLeader = a[b + 8];
  5622. la.oldSkinIndex = la.skinIndex;
  5623. la.oldTailIndex = la.tailIndex;
  5624. la.skinIndex = a[b + 9];
  5625. la.tailIndex = a[b + 10];
  5626. la.iconIndex = a[b + 11];
  5627. la.zIndex = a[b + 12];
  5628. la.visible = true;
  5629. la.update(P.tickSpeed);
  5630. la.dist2 = dc.getDist(la, ja, 2, 2);
  5631. la.aim2 = dc.getDirect(la, ja, 2, 2);
  5632. la.dist3 = dc.getDist(la, ja, 3, 3);
  5633. la.aim3 = dc.getDirect(la, ja, 3, 3);
  5634. la.damageThreat = 0;
  5635. if (la.skinIndex == 45 && la.shameTimer <= 0) {
  5636. la.addShameTimer();
  5637. }
  5638. if (la.oldSkinIndex == 45 && la.skinIndex != 45) {
  5639. la.shameTimer = 0;
  5640. la.shameCount = 0;
  5641. if (la == ja) {
  5642. Vb();
  5643. }
  5644. }
  5645. h.forEach(a => {
  5646. a.showName = "YEAHHH";
  5647. });
  5648. for (let a = 0; a < ba.length; a++) {
  5649. for (let a = 0; a < h.length; a++) {
  5650. if (ja.id === a.id) {
  5651. a.showName = "YEAHHHHHH";
  5652. }
  5653. }
  5654. }
  5655. if (ja.shameCount < 4 && oa.dist3 <= 300 && oa.reloads[oa.primaryIndex] <= P.tickRate * (window.pingTime >= 200 ? 2 : 1)) {
  5656. md = true;
  5657. Vb();
  5658. } else {
  5659. if (md) {
  5660. Vb();
  5661. }
  5662. md = false;
  5663. }
  5664. if (la == ja) {
  5665. if (fa.length) {
  5666. fa.forEach(a => {
  5667. a.onNear = false;
  5668. if (a.active) {
  5669. if (!a.onNear && dc.getDist(a, la, 0, 2) <= a.scale + ec.weapons[la.weapons[0]].range) {
  5670. a.onNear = true;
  5671. }
  5672. if (a.isItem && a.owner) {
  5673. if (!a.pps && la.sid == a.owner.sid && dc.getDist(a, la, 0, 2) > (parseInt(c("breakRange").value) || 0) && !a.breakObj && ![13, 14, 20].includes(a.id)) {
  5674. a.breakObj = true;
  5675. ia.push({
  5676. x: a.x,
  5677. y: a.y,
  5678. sid: a.sid
  5679. });
  5680. }
  5681. }
  5682. }
  5683. });
  5684. let a = fa.filter(a => a.trap && a.active && dc.getDist(a, la, 0, 2) <= la.scale + a.getScale() + 25 && !a.isTeamObject(la)).sort(function (a, b) {
  5685. return dc.getDist(a, la, 0, 2) - dc.getDist(b, la, 0, 2);
  5686. })[0];
  5687. if (a) {
  5688. let b = ea.filter(b => b.dmg && ef(la, b) <= la.scale + a.scale / 2 && !b.isTeamObject(la) && b.active)[0];
  5689. mc.dist = dc.getDist(a, la, 0, 2);
  5690. mc.aim = dc.getDirect(b ? b : a, la, 0, 2);
  5691. mc.protect(kd(a, la) - Math.PI);
  5692. mc.inTrap = true;
  5693. mc.info = a;
  5694. } else {
  5695. mc.inTrap = false;
  5696. mc.info = {};
  5697. }
  5698. } else {
  5699. mc.inTrap = false;
  5700. }
  5701. }
  5702. if (la.weaponIndex < 9) {
  5703. la.primaryIndex = la.weaponIndex;
  5704. la.primaryVariant = la.weaponVariant;
  5705. } else if (la.weaponIndex > 8) {
  5706. la.secondaryIndex = la.weaponIndex;
  5707. la.secondaryVariant = la.weaponVariant;
  5708. }
  5709. }
  5710. b += 13;
  5711. }
  5712. if (lc.stack.length) {
  5713. let a = 0;
  5714. let b = 0;
  5715. let c = {
  5716. x: null,
  5717. y: null
  5718. };
  5719. let d = {
  5720. x: null,
  5721. y: null
  5722. };
  5723. lc.stack.forEach(e => {
  5724. if (e.value >= 0) {
  5725. if (a == 0) {
  5726. c = {
  5727. x: e.x,
  5728. y: e.y
  5729. };
  5730. }
  5731. a += Math.abs(e.value);
  5732. } else {
  5733. if (b == 0) {
  5734. d = {
  5735. x: e.x,
  5736. y: e.y
  5737. };
  5738. }
  5739. b += Math.abs(e.value);
  5740. }
  5741. });
  5742. if (b > 0) {
  5743. lc.showText(d.x, d.y, Math.max(45, Math.min(50, b)), 0.18, 500, b, "#8ecc51");
  5744. }
  5745. if (a > 0) {
  5746. lc.showText(c.x, c.y, Math.max(45, Math.min(50, a)), 0.18, 500, a, "#fff");
  5747. }
  5748. lc.stack = [];
  5749. }
  5750. if (xc.length) {
  5751. xc.forEach(a => {
  5752. yc(...a);
  5753. });
  5754. xc = [];
  5755. }
  5756. for (let b = 0; b < a.length;) {
  5757. la = ta(a[b]);
  5758. if (la) {
  5759. if (!la.isTeam(ja)) {
  5760. ma.push(la);
  5761. if (la.dist2 <= ec.weapons[la.primaryIndex == undefined ? 5 : la.primaryIndex].range + ja.scale * 2) {
  5762. na.push(la);
  5763. }
  5764. }
  5765. la.manageReload();
  5766. if (la != ja) {
  5767. la.addDamageThreat(ja);
  5768. }
  5769. }
  5770. b += 13;
  5771. }
  5772. if (ja && ja.alive) {
  5773. if (ma.length) {
  5774. oa = ma.sort(function (a, b) {
  5775. return a.dist2 - b.dist2;
  5776. })[0];
  5777. } else {}
  5778. if (P.tickQueue[P.tick]) {
  5779. P.tickQueue[P.tick].forEach(a => {
  5780. a();
  5781. });
  5782. P.tickQueue[P.tick] = null;
  5783. }
  5784. ba.forEach(a => {
  5785. if (!a.visible && ja != a) {
  5786. a.reloads = {
  5787. 0: 0,
  5788. 1: 0,
  5789. 2: 0,
  5790. 3: 0,
  5791. 4: 0,
  5792. 5: 0,
  5793. 6: 0,
  5794. 7: 0,
  5795. 8: 0,
  5796. 9: 0,
  5797. 10: 0,
  5798. 11: 0,
  5799. 12: 0,
  5800. 13: 0,
  5801. 14: 0,
  5802. 15: 0,
  5803. 53: 0
  5804. };
  5805. }
  5806. if (a.setBullTick) {
  5807. a.bullTimer = 0;
  5808. }
  5809. if (a.setPoisonTick) {
  5810. a.poisonTimer = 0;
  5811. }
  5812. a.updateTimer();
  5813. });
  5814. if (lb) {
  5815. if (ma.length) {
  5816. if (ja.canEmpAnti) {
  5817. ja.canEmpAnti = false;
  5818. if (oa.dist2 <= 300 && !pa.safePrimary(oa) && !pa.safeSecondary(oa)) {
  5819. if (oa.reloads[53] == 0) {
  5820. ja.empAnti = true;
  5821. ja.soldierAnti = false;
  5822. } else {
  5823. ja.empAnti = false;
  5824. ja.soldierAnti = true;
  5825. }
  5826. }
  5827. }
  5828. let a = fa.filter(a => a.dmg && a.active && a.isTeamObject(ja) && dc.getDist(a, oa, 0, 3) <= a.scale + oa.scale).sort(function (a, b) {
  5829. return dc.getDist(a, oa, 0, 2) - dc.getDist(b, oa, 0, 2);
  5830. })[0];
  5831. if (a) {
  5832. if (oa.dist3 <= ec.weapons[ja.weapons[0]].range + ja.scale * 1.8 && q.predictTick) {
  5833. nc.canSpikeTick = true;
  5834. nc.syncHit = true;
  5835. if (q.revTick && ja.weapons[1] == 15 && ja.reloads[53] == 0 && nc.perfCheck(ja, oa)) {
  5836. nc.revTick = true;
  5837. }
  5838. }
  5839. }
  5840. let b = fa.filter(a => a.dmg && a.active && !a.isTeamObject(ja) && dc.getDist(a, ja, 0, 3) < a.scale + ja.scale).sort(function (a, b) {
  5841. return dc.getDist(a, ja, 0, 2) - dc.getDist(b, ja, 0, 2);
  5842. })[0];
  5843. if (b && !mc.inTrap) {
  5844. if (oa.dist3 <= ec.weapons[5].range + oa.scale * 1.8) {
  5845. pa.anti0Tick = 1;
  5846. }
  5847. }
  5848. }
  5849. if ((K ? true : (ja.checkCanInsta(true) >= 100 ? ja.checkCanInsta(true) : ja.checkCanInsta(false)) >= (ja.weapons[1] == 10 ? 95 : 100)) && oa.dist2 <= ec.weapons[ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]].range + oa.scale * 1.8 && (nc.wait || K && Math.floor(Math.random() * 5) == 0) && !nc.isTrue && !pa.waitHit && ja.reloads[ja.weapons[0]] == 0 && ja.reloads[ja.weapons[1]] == 0 && (K ? true : c("instaType").value == "oneShot" ? ja.reloads[53] <= (ja.weapons[1] == 10 ? 0 : P.tickRate) : true) && nc.perfCheck(ja, oa)) {
  5850. if (ja.checkCanInsta(true) >= 100) {
  5851. nc.nobull = K ? false : nc.canSpikeTick ? false : true;
  5852. } else {
  5853. nc.nobull = false;
  5854. }
  5855. nc.can = true;
  5856. } else {
  5857. nc.can = false;
  5858. }
  5859. if (mb.q) {
  5860. Qb(0, Oc());
  5861. }
  5862. if (mb.f) {
  5863. Qb(4, Lc());
  5864. }
  5865. if (mb.v) {
  5866. Qb(2, Lc());
  5867. }
  5868. if (mb.y) {
  5869. Qb(5, Lc());
  5870. }
  5871. if (mb.h) {
  5872. Qb(ja.getItemType(22), Lc());
  5873. }
  5874. if (mb.n) {
  5875. Qb(3, Lc());
  5876. }
  5877. if (P.tick % 1 == 0) {
  5878. if (nb.place) {
  5879. let a = 7.7;
  5880. for (let b = -a; b <= a; b += a) {
  5881. Rb(3, dc.getDirect(ja.oldPos, ja, 2, 2) + b);
  5882. }
  5883. } else if (nb.placeSpawnPads) {
  5884. for (let a = 0; a < Math.PI * 2; a += Math.PI / 2) {
  5885. Rb(ja.getItemType(20), dc.getDirect(ja.oldPos, ja, 2, 2) + a);
  5886. }
  5887. }
  5888. }
  5889. if (nc.can) {
  5890. nc.changeType(ja.weapons[1] == 10 ? "rev" : "normal");
  5891. }
  5892. if (nc.canCounter) {
  5893. nc.canCounter = false;
  5894. if (ja.reloads[ja.weapons[0]] == 0 && !nc.isTrue) {
  5895. nc.counterType();
  5896. }
  5897. }
  5898. if (nc.canSpikeTick) {
  5899. nc.canSpikeTick = false;
  5900. if (nc.revTick) {
  5901. nc.revTick = false;
  5902. if ([1, 2, 3, 4, 5, 6].includes(ja.weapons[0]) && ja.reloads[ja.weapons[1]] == 0 && !nc.isTrue) {
  5903. nc.changeType("rev");
  5904. C(null, "[RevSyncHit]", "yellow");
  5905. }
  5906. } else if ([1, 2, 3, 4, 5, 6].includes(ja.weapons[0]) && ja.reloads[ja.weapons[0]] == 0 && !nc.isTrue) {
  5907. nc.spikeTickType();
  5908. if (nc.syncHit) {
  5909. C(null, "[SyncHit]", "yellow");
  5910. }
  5911. }
  5912. }
  5913. if (!Gc.middle && (Gc.left || Gc.right) && !nc.isTrue) {
  5914. if (ja.weaponIndex != (Gc.right && ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]) || ja.buildIndex > -1) {
  5915. Nb(Gc.right && ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]);
  5916. }
  5917. if (ja.reloads[Gc.right && ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]] == 0 && !pa.waitHit) {
  5918. Ob();
  5919. pa.waitHit = 1;
  5920. P.tickBase(() => {
  5921. Ob();
  5922. pa.waitHit = 0;
  5923. }, 1);
  5924. }
  5925. }
  5926. if (K && !Gc.left && !Gc.right && !nc.isTrue && oa.dist2 <= ec.weapons[ja.weapons[0]].range + oa.scale * 1.8 && !mc.inTrap) {
  5927. if (ja.weaponIndex != ja.weapons[0] || ja.buildIndex > -1) {
  5928. Nb(ja.weapons[0]);
  5929. }
  5930. if (ja.reloads[ja.weapons[0]] == 0 && !pa.waitHit) {
  5931. Ob();
  5932. pa.waitHit = 1;
  5933. P.tickBase(() => {
  5934. Ob();
  5935. pa.waitHit = 0;
  5936. }, 1);
  5937. }
  5938. }
  5939. if (mc.inTrap) {
  5940. if (!Gc.left && !Gc.right && !nc.isTrue) {
  5941. if (ja.weaponIndex != (mc.notFast() ? ja.weapons[1] : ja.weapons[0]) || ja.buildIndex > -1) {
  5942. Nb(mc.notFast() ? ja.weapons[1] : ja.weapons[0]);
  5943. }
  5944. if (ja.reloads[mc.notFast() ? ja.weapons[1] : ja.weapons[0]] == 0 && !pa.waitHit) {
  5945. Ob();
  5946. pa.waitHit = 1;
  5947. P.tickBase(() => {
  5948. Ob();
  5949. pa.waitHit = 0;
  5950. }, 1);
  5951. }
  5952. }
  5953. }
  5954. if (Gc.middle && !mc.inTrap) {
  5955. if (!nc.isTrue && ja.reloads[ja.weapons[1]] == 0) {
  5956. if (pa.ageInsta && ja.weapons[0] != 4 && ja.weapons[1] == 9 && ja.age >= 9 && ma.length) {
  5957. nc.bowMovement();
  5958. } else {
  5959. nc.rangeType();
  5960. }
  5961. }
  5962. }
  5963. if (mb.t && !mc.inTrap) {
  5964. if (!nc.isTrue && ja.reloads[ja.weapons[0]] == 0 && (ja.weapons[1] == 15 ? ja.reloads[ja.weapons[1]] == 0 : true) && (ja.weapons[0] == 5 || ja.weapons[0] == 4 && ja.weapons[1] == 15)) {
  5965. nc[ja.weapons[0] == 4 && ja.weapons[1] == 15 ? "kmTickMovement" : "tickMovement"]();
  5966. }
  5967. }
  5968. if (mb["."] && !mc.inTrap) {
  5969. if (!nc.isTrue && ja.reloads[ja.weapons[0]] == 0 && ([9, 12, 13, 15].includes(ja.weapons[1]) ? ja.reloads[ja.weapons[1]] == 0 : true)) {
  5970. nc.boostTickMovement();
  5971. }
  5972. }
  5973. if (ja.weapons[1] && !Gc.left && !Gc.right && !mc.inTrap && !nc.isTrue && (!K || oa.dist2 > ec.weapons[ja.weapons[0]].range + oa.scale * 1.8)) {
  5974. if (ja.reloads[ja.weapons[0]] == 0 && ja.reloads[ja.weapons[1]] == 0) {
  5975. if (!pa.reloaded) {
  5976. pa.reloaded = true;
  5977. let a = ec.weapons[ja.weapons[0]].spdMult < ec.weapons[ja.weapons[1]].spdMult ? 1 : 0;
  5978. if (ja.weaponIndex != ja.weapons[a] || ja.buildIndex > -1) {
  5979. Nb(ja.weapons[a]);
  5980. }
  5981. }
  5982. } else {
  5983. pa.reloaded = false;
  5984. if (K) {
  5985. nd.stopspin = false;
  5986. }
  5987. if (ja.reloads[ja.weapons[0]] > 0) {
  5988. if (ja.weaponIndex != ja.weapons[0] || ja.buildIndex > -1) {
  5989. Nb(ja.weapons[0]);
  5990. }
  5991. } else if (ja.reloads[ja.weapons[0]] == 0 && ja.reloads[ja.weapons[1]] > 0) {
  5992. if (ja.weaponIndex != ja.weapons[1] || ja.buildIndex > -1) {
  5993. Nb(ja.weapons[1]);
  5994. }
  5995. if (K) {
  5996. if (!nd.stopspin) {
  5997. setTimeout(() => {
  5998. nd.stopspin = true;
  5999. }, 750);
  6000. }
  6001. }
  6002. }
  6003. }
  6004. }
  6005. if (!nc.isTrue && !mc.inTrap && !mc.replaced) {
  6006. mc.autoPlace();
  6007. }
  6008. if (!mb.q && !mb.f && !mb.v && !mb.h && !mb.n) {
  6009. U("D", Oc());
  6010. }
  6011. let a = function () {
  6012. if (pa.anti0Tick > 0) {
  6013. Lb(6, 0);
  6014. } else if (Gc.left || Gc.right) {
  6015. if (Gc.left) {
  6016. Lb(ja.reloads[ja.weapons[0]] == 0 ? c("weaponGrind").checked ? 40 : 7 : ja.empAnti ? 22 : ja.soldierAnti ? 6 : c("antiBullType").value == "abreload" && oa.antiBull > 0 ? 11 : oa.dist2 <= 300 ? c("antiBullType").value == "abalway" && oa.reloads[oa.primaryIndex] == 0 ? 11 : 6 : Xb(1, 1), 0);
  6017. } else if (Gc.right) {
  6018. Lb(ja.reloads[Gc.right && ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]] == 0 ? 40 : c("antiBullType").value == "abreload" && oa.antiBull > 0 ? 11 : oa.dist2 <= 300 ? c("antiBullType").value == "abalway" && oa.reloads[oa.primaryIndex] == 0 ? 11 : 6 : Xb(1, 1), 0);
  6019. }
  6020. } else if (mc.inTrap) {
  6021. if (mc.info.health <= ec.weapons[ja.weaponIndex].dmg ? false : ja.reloads[ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]] == 0) {
  6022. if (oa.dist3 <= 300 && mc.info.health <= 300 && ec.weapons[oa.weapons[0]] == 0) {
  6023. Lb(6, 0);
  6024. } else {
  6025. Lb(40, 0);
  6026. }
  6027. } else {
  6028. Lb(6, 0);
  6029. }
  6030. } else if (ja.empAnti) {
  6031. Lb(ja.empAnti ? 22 : 6, 0);
  6032. } else {
  6033. Lb(6, 0);
  6034. }
  6035. };
  6036. let b = function () {
  6037. if (oa.dist2 <= 300) {
  6038. Lb(0, 1);
  6039. } else if (Gc.left) {
  6040. Lb(0, 1);
  6041. } else {
  6042. Lb(11, 1);
  6043. }
  6044. };
  6045. let d = function () {
  6046. if (pa.anti0Tick > 0) {
  6047. Lb(6, 0);
  6048. } else if (Gc.left || Gc.right) {
  6049. if (Gc.left) {
  6050. Lb(ja.reloads[ja.weapons[0]] == 0 ? c("weaponGrind").checked ? 40 : 7 : ja.empAnti ? 22 : 6, 0);
  6051. } else if (Gc.right) {
  6052. Lb(ja.reloads[Gc.right && ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]] == 0 ? 40 : ja.empAnti ? 22 : 6, 0);
  6053. }
  6054. } else if (oa.dist2 <= ec.weapons[ja.weapons[0]].range + oa.scale * 1.8 && !mc.inTrap) {
  6055. Lb(ja.reloads[ja.weapons[0]] == 0 ? 7 : ja.empAnti ? 22 : 6, 0);
  6056. } else if (mc.inTrap) {
  6057. if (mc.info.health <= ec.weapons[ja.weaponIndex].dmg ? false : ja.reloads[ja.weapons[1] == 10 ? ja.weapons[1] : ja.weapons[0]] == 0) {
  6058. Lb(40, 0);
  6059. } else if (ja.shameCount > 4320 && (P.tick - ja.bullTick) % f.serverUpdateRate === 0 && ja.skinIndex != 45 || pa.reSync) {
  6060. Lb(7, 0);
  6061. } else {
  6062. Lb(ja.empAnti ? 22 : 6, 0);
  6063. }
  6064. } else if (ja.empAnti) {
  6065. Lb(22, 0);
  6066. } else if (ja.shameCount > 4320 && (P.tick - ja.bullTick) % f.serverUpdateRate === 0 && ja.skinIndex != 45 || pa.reSync) {
  6067. Lb(7, 0);
  6068. } else {
  6069. Lb(6, 0);
  6070. }
  6071. if (Gc.left || Gc.right) {
  6072. if (Gc.left) {
  6073. Lb(0, 1);
  6074. }
  6075. } else if (oa.dist2 <= ec.weapons[ja.weapons[0]].range + oa.scale * 1.8 && !mc.inTrap) {
  6076. Lb(0, 1);
  6077. } else if (mc.inTrap) {
  6078. Lb(0, 1);
  6079. } else {
  6080. Lb(11, 1);
  6081. }
  6082. };
  6083. if (Ea.style.display != "block" && !nc.isTrue && !nc.ticking) {
  6084. if (K) {
  6085. d();
  6086. } else {
  6087. a();
  6088. b();
  6089. }
  6090. }
  6091. if (q.autoPush && ma.length && !mc.inTrap && !nc.ticking) {
  6092. Yc();
  6093. } else if (pa.autoPush) {
  6094. pa.autoPush = false;
  6095. U("a", S || undefined, 1);
  6096. }
  6097. nc.ticking &&= false;
  6098. nc.syncHit &&= false;
  6099. ja.empAnti &&= false;
  6100. ja.soldierAnti &&= false;
  6101. if (pa.anti0Tick > 0) {
  6102. pa.anti0Tick--;
  6103. }
  6104. mc.replaced &&= false;
  6105. mc.antiTrapped &&= false;
  6106. const e = (a, b) => {
  6107. const c = b.weapons[1] === 10 && !ja.reloads[b.weapons[1]] ? 1 : 0;
  6108. const d = b.weapons[c];
  6109. if (ja.reloads[d]) {
  6110. return 0;
  6111. }
  6112. const e = ec.weapons[d];
  6113. const f = ef(a, b) <= a.getScale() + e.range;
  6114. if (b.visible && f) {
  6115. return e.dmg * (e.sDmg || 1) * 3.3;
  6116. } else {
  6117. return 0;
  6118. }
  6119. };
  6120. const g = () => {
  6121. const a = [];
  6122. const b = ja.x;
  6123. const c = ja.y;
  6124. const d = ea.length;
  6125. for (let b = 0; b < d; b++) {
  6126. const c = ea[b];
  6127. if (c.isItem && c.active && c.health > 0) {
  6128. const b = ec.list[c.id];
  6129. const d = 35 + b.scale + (b.placeOffset || 0);
  6130. const f = ef(c, ja) <= d * 2;
  6131. if (f) {
  6132. let b = 0;
  6133. const d = ba.length;
  6134. for (let a = 0; a < d; a++) {
  6135. b += e(c, ba[a]);
  6136. }
  6137. if (c.health <= b) {
  6138. a.push(c);
  6139. }
  6140. }
  6141. }
  6142. }
  6143. const f = (a, b, c) => {
  6144. if (!c) {
  6145. return null;
  6146. }
  6147. const d = Math.PI * 2;
  6148. const e = Math.PI / 360;
  6149. const f = ec.list[a.items[b]];
  6150. let g = Math.atan2(c.y - a.y, c.x - a.x);
  6151. let h = a.scale + (f.scale || 1) + (f.placeOffset || 0);
  6152. for (let f = 0; f < d; f += e) {
  6153. let a = [(g + f) % d, (g - f + d) % d];
  6154. for (let b of a) {
  6155. return b;
  6156. }
  6157. }
  6158. return null;
  6159. };
  6160. const g = () => {
  6161. let b = fa.filter(a => a.trap && a.active && a.isTeamObject(ja) && ef(a, ja) <= a.getScale() + 5);
  6162. let c = ea.find(a => a.dmg && a.active && a.isTeamObject(ja) && ef(a, ja) < 87 && !b.length);
  6163. const d = c ? 4 : 2;
  6164. a.forEach(a => {
  6165. let b = f(ja, d, a);
  6166. if (b !== null) {
  6167. Qb(d, b);
  6168. lc.showText(a.x, a.y, 20, 0.15, 1850, "⭐", "#fff", 2);
  6169. }
  6170. });
  6171. };
  6172. if (oa && oa.dist3 <= 360) {
  6173. g();
  6174. }
  6175. g;
  6176. };
  6177. }
  6178. }
  6179. if (h.length) {
  6180. h.forEach(a => {
  6181. if (true) {
  6182. a[0].showName = "YEAHHH";
  6183. }
  6184. });
  6185. }
  6186. }
  6187. for (var pd = 0; pd < fa.length; pd++) {
  6188. if (fa[pd].active && fa[pd].health > 0 && dc.getDist(fa[pd], ja, 0, 2) < 150 && c("antipush").checked) {
  6189. if (fa[pd].name.includes("spike") && fa[pd]) {
  6190. if (fa[pd].owner.sid != ja.sid && Gc.left == false && la.reloads[la.secondaryIndex] == 0) {
  6191. Nb(ja.weapons[1]);
  6192. Lb(40, 0);
  6193. U("D", dc.getDirect(fa[pd], ja, 0, 2));
  6194. jd(() => {
  6195. Lb(6, 0);
  6196. }, 1);
  6197. }
  6198. }
  6199. }
  6200. }
  6201. function qd(a, b, c) {
  6202. a.fillStyle = "rgba(0, 255, 255, 0.2)";
  6203. a.beginPath();
  6204. a.arc(b, c, 55, 0, Math.PI * 2);
  6205. a.fill();
  6206. a.closePath();
  6207. a.globalAlpha = 1;
  6208. }
  6209. function rd(a) {
  6210. pb = a;
  6211. return;
  6212. dc.removeAllChildren(La);
  6213. let b = 1;
  6214. for (let c = 0; c < a.length; c += 3) {
  6215. (function (c) {
  6216. dc.generateElement({
  6217. class: "leaderHolder",
  6218. parent: La,
  6219. children: [dc.generateElement({
  6220. class: "leaderboardItem",
  6221. style: "color:" + (a[c] == ka ? "#fff" : "rgba(255,255,255,0.6)"),
  6222. text: b + ". " + (a[c + 1] != "" ? a[c + 1] : "unknown")
  6223. }), dc.generateElement({
  6224. class: "leaderScore",
  6225. text: dc.sFormat(a[c + 2]) || "0"
  6226. })]
  6227. });
  6228. })(c);
  6229. b++;
  6230. }
  6231. }
  6232. function sd(a) {
  6233. for (let b = 0; b < a.length;) {
  6234. fc.add(a[b], a[b + 1], a[b + 2], a[b + 3], a[b + 4], a[b + 5], ec.list[a[b + 6]], true, a[b + 7] >= 0 ? {
  6235. sid: a[b + 7]
  6236. } : null);
  6237. b += 8;
  6238. }
  6239. }
  6240. function td(a) {
  6241. for (let b = 0; b < aa.length; ++b) {
  6242. aa[b].forcePos = !aa[b].visible;
  6243. aa[b].visible = false;
  6244. }
  6245. if (a) {
  6246. let b = performance.now();
  6247. for (let c = 0; c < a.length;) {
  6248. la = ua(a[c]);
  6249. if (la) {
  6250. la.index = a[c + 1];
  6251. la.t1 = la.t2 === undefined ? b : la.t2;
  6252. la.t2 = b;
  6253. la.x1 = la.x;
  6254. la.y1 = la.y;
  6255. la.x2 = a[c + 2];
  6256. la.y2 = a[c + 3];
  6257. la.d1 = la.d2 === undefined ? a[c + 4] : la.d2;
  6258. la.d2 = a[c + 4];
  6259. la.health = a[c + 5];
  6260. la.dt = 0;
  6261. la.visible = true;
  6262. } else {
  6263. la = kc.spawn(a[c + 2], a[c + 3], a[c + 4], a[c + 1]);
  6264. la.x2 = la.x;
  6265. la.y2 = la.y;
  6266. la.d2 = la.dir;
  6267. la.health = a[c + 5];
  6268. if (!kc.aiTypes[a[c + 1]].name) {
  6269. la.name = f.cowNames[a[c + 6]];
  6270. }
  6271. la.forcePos = true;
  6272. la.sid = a[c];
  6273. la.visible = true;
  6274. }
  6275. c += 7;
  6276. }
  6277. }
  6278. }
  6279. function ud(a) {
  6280. la = ua(a);
  6281. if (la) {
  6282. la.startAnim();
  6283. }
  6284. }
  6285. function vd(a, b, c) {
  6286. la = ta(a);
  6287. if (la) {
  6288. la.startAnim(b, c);
  6289. la.gatherIndex = c;
  6290. la.gathering = 1;
  6291. if (b) {
  6292. let b = fc.hitObj;
  6293. fc.hitObj = [];
  6294. P.tickBase(() => {
  6295. la = ta(a);
  6296. let d = ec.weapons[c].dmg * f.weaponVariants[la[(c < 9 ? "prima" : "seconda") + "ryVariant"]].val * (ec.weapons[c].sDmg || 1) * (la.skinIndex == 40 ? 3.3 : 1);
  6297. b.forEach(a => {
  6298. a.health -= d;
  6299. });
  6300. }, 1);
  6301. }
  6302. }
  6303. }
  6304. function wd(a, b) {
  6305. la = va(b);
  6306. if (la) {
  6307. la.xWiggle += f.gatherWiggle * Math.cos(a);
  6308. la.yWiggle += f.gatherWiggle * Math.sin(a);
  6309. if (la.health) {
  6310. fc.hitObj.push(la);
  6311. }
  6312. }
  6313. }
  6314. function xd(a, b) {
  6315. la = va(a);
  6316. if (la) {
  6317. if (f.anotherVisual) {
  6318. la.lastDir = b;
  6319. } else {
  6320. la.dir = b;
  6321. }
  6322. la.xWiggle += f.gatherWiggle * Math.cos(b + Math.PI);
  6323. la.yWiggle += f.gatherWiggle * Math.sin(b + Math.PI);
  6324. }
  6325. }
  6326. function yd(a, b, c) {
  6327. if (ja) {
  6328. ja[a] = b;
  6329. if (a == "points") {
  6330. if (q.autoBuy) {
  6331. oc.hat();
  6332. oc.acc();
  6333. }
  6334. } else if (a == "kills") {
  6335. if (q.killChat) {
  6336. wc("Ass Kids: " + b);
  6337. }
  6338. }
  6339. }
  6340. }
  6341. function zd(a, b) {
  6342. if (a) {
  6343. if (b) {
  6344. ja.weapons = a;
  6345. ja.primaryIndex = ja.weapons[0];
  6346. ja.secondaryIndex = ja.weapons[1];
  6347. if (!nc.isTrue) {
  6348. Nb(ja.weapons[0]);
  6349. }
  6350. } else {
  6351. ja.items = a;
  6352. }
  6353. }
  6354. for (let d = 0; d < ec.list.length; d++) {
  6355. let a = ec.weapons.length + d;
  6356. let b = c("actionBarItem" + a);
  6357. b.style.display = ja.items.indexOf(ec.list[d].id) >= 0 ? "inline-block" : "none";
  6358. document.getElementsByTagName("button").style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
  6359. }
  6360. for (let d = 0; d < ec.weapons.length; d++) {
  6361. let a = c("actionBarItem" + d);
  6362. a.style.display = ja.weapons[ec.weapons[d].type] == ec.weapons[d].id ? "inline-block" : "none";
  6363. document.getElementsByTagName("button").style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
  6364. }
  6365. let d = ja.weapons[0] == 3 && ja.weapons[1] == 15;
  6366. if (d) {
  6367. c("actionBarItem3").style.display = "none";
  6368. c("actionBarItem4").style.display = "inline-block";
  6369. }
  6370. }
  6371. function Ad(a, b, c, d, e, f, g, h) {
  6372. jc.addProjectile(a, b, c, d, e, f, null, null, g, qb).sid = h;
  6373. xc.push(Array.prototype.slice.call(arguments));
  6374. }
  6375. function Bd(a, b) {
  6376. for (let c = 0; c < ga.length; ++c) {
  6377. if (ga[c].sid == a) {
  6378. ga[c].range = b;
  6379. let a = fc.hitObj;
  6380. fc.hitObj = [];
  6381. P.tickBase(() => {
  6382. let b = ga[c].dmg;
  6383. a.forEach(a => {
  6384. if (a.projDmg) {
  6385. a.health -= b;
  6386. }
  6387. });
  6388. }, 1);
  6389. }
  6390. }
  6391. }
  6392. let Cd = false;
  6393. let Dd = true;
  6394. var Ed = location.hostname !== "127.0.0.1" && !location.hostname.startsWith("192.168.");
  6395. let Fd = Ed ? "wss" : "ws";
  6396. let Gd = new WebSocket(Fd + "://beautiful-sapphire-toad.glitch.me");
  6397. let Hd = false;
  6398. Gd.binaryType = "arraybuffer";
  6399. Gd.onmessage = function (a) {
  6400. let b = a.data;
  6401. if (b == "isready") {
  6402. Dd = true;
  6403. }
  6404. if (b == "fine") {
  6405. Cd = false;
  6406. }
  6407. if (b == "tezt") {
  6408. B(ja.name + "[" + ja.sid + "]", "EEEEEEEEEEE", "white");
  6409. }
  6410. if (b == "yeswearesyncer") {
  6411. Hd = true;
  6412. if (ja) {
  6413. lc.showText(ja.x, ja.y, 35, 0.1, 500, "Sync: " + window.pingTime + "ms", "#fff");
  6414. console.log("synced!!!!!!!! also delay: " + window.pingTime + "ms");
  6415. }
  6416. }
  6417. };
  6418. Gd.onopen = function () {
  6419. var a = c("gameName");
  6420. a.innerText = "Yurio Modded v1";
  6421. };
  6422. function Id(a, b) {
  6423. let c = ra(Pd, a);
  6424. if (c) {}
  6425. }
  6426. function Jd(a, b) {
  6427. if (ja) {
  6428. ja.team = a;
  6429. ja.isOwner = b;
  6430. if (a == null) {
  6431. da = [];
  6432. }
  6433. }
  6434. }
  6435. function Kd(a) {
  6436. da = a;
  6437. }
  6438. function Ld(a, b, c) {
  6439. if (c) {
  6440. if (!a) {
  6441. ja.tails[b] = 1;
  6442. } else {
  6443. ja.latestTail = b;
  6444. }
  6445. } else if (!a) {
  6446. ja.skins[b] = 1;
  6447. if (b == 7) {
  6448. pa.reSync = true;
  6449. }
  6450. } else {
  6451. ja.latestSkin = b;
  6452. }
  6453. }
  6454. function Md(a, b) {
  6455. let c = false;
  6456. let d = ta(a);
  6457. B(d.name + "[" + d.sid + "]", b, "white");
  6458. d.chatMessage = b;
  6459. d.chatCountdown = f.chatCountdown;
  6460. }
  6461. function Nd(a) {
  6462. rc = a;
  6463. }
  6464. function Od(a, b, c, d) {
  6465. lc.stack.push({
  6466. x: a,
  6467. y: b,
  6468. value: c
  6469. });
  6470. }
  6471. let Pd = [];
  6472. let Qd = {
  6473. x: dc.randInt(35, 14365),
  6474. y: dc.randInt(35, 14365)
  6475. };
  6476. setInterval(() => {
  6477. Qd = {
  6478. x: dc.randInt(35, 14365),
  6479. y: dc.randInt(35, 14365)
  6480. };
  6481. }, 60000);
  6482. class Rd {
  6483. constructor(a, b, c, d) {
  6484. this.millPlace = true;
  6485. this.id = a;
  6486. this.sid = b;
  6487. this.team = null;
  6488. this.skinIndex = 0;
  6489. this.tailIndex = 0;
  6490. this.hitTime = 0;
  6491. this.iconIndex = 0;
  6492. this.enemy = [];
  6493. this.near = [];
  6494. this.dist2 = 0;
  6495. this.aim2 = 0;
  6496. this.tick = 0;
  6497. this.itemCounts = {};
  6498. this.latestSkin = 0;
  6499. this.latestTail = 0;
  6500. this.points = 0;
  6501. this.tails = {};
  6502. for (let e = 0; e < d.length; ++e) {
  6503. if (d[e].price <= 0) {
  6504. this.tails[d[e].id] = 1;
  6505. }
  6506. }
  6507. this.skins = {};
  6508. for (let e = 0; e < c.length; ++e) {
  6509. if (c[e].price <= 0) {
  6510. this.skins[c[e].id] = 1;
  6511. }
  6512. }
  6513. this.spawn = function (a) {
  6514. this.upgraded = 0;
  6515. this.enemy = [];
  6516. this.near = [];
  6517. this.active = true;
  6518. this.alive = true;
  6519. this.lockMove = false;
  6520. this.lockDir = false;
  6521. this.minimapCounter = 0;
  6522. this.chatCountdown = 0;
  6523. this.shameCount = 0;
  6524. this.shameTimer = 0;
  6525. this.sentTo = {};
  6526. this.gathering = 0;
  6527. this.autoGather = 0;
  6528. this.animTime = 0;
  6529. this.animSpeed = 0;
  6530. this.mouseState = 0;
  6531. this.buildIndex = -1;
  6532. this.weaponIndex = 0;
  6533. this.dmgOverTime = {};
  6534. this.noMovTimer = 0;
  6535. this.maxXP = 300;
  6536. this.XP = 0;
  6537. this.age = 1;
  6538. this.kills = 0;
  6539. this.upgrAge = 2;
  6540. this.upgradePoints = 0;
  6541. this.x = 0;
  6542. this.y = 0;
  6543. this.zIndex = 0;
  6544. this.xVel = 0;
  6545. this.yVel = 0;
  6546. this.slowMult = 1;
  6547. this.dir = 0;
  6548. this.nDir = 0;
  6549. this.dirPlus = 0;
  6550. this.targetDir = 0;
  6551. this.targetAngle = 0;
  6552. this.maxHealth = 100;
  6553. this.health = this.maxHealth;
  6554. this.oldHealth = this.maxHealth;
  6555. this.scale = f.playerScale;
  6556. this.speed = f.playerSpeed;
  6557. this.resetMoveDir();
  6558. this.resetResources(a);
  6559. this.items = [0, 3, 6, 10];
  6560. this.weapons = [0];
  6561. this.shootCount = 0;
  6562. this.weaponXP = [];
  6563. this.isBot = false;
  6564. this.reloads = {
  6565. 0: 0,
  6566. 1: 0,
  6567. 2: 0,
  6568. 3: 0,
  6569. 4: 0,
  6570. 5: 0,
  6571. 6: 0,
  6572. 7: 0,
  6573. 8: 0,
  6574. 9: 0,
  6575. 10: 0,
  6576. 11: 0,
  6577. 12: 0,
  6578. 13: 0,
  6579. 14: 0,
  6580. 15: 0,
  6581. 53: 0
  6582. };
  6583. this.timeZinceZpawn = 0;
  6584. this.whyDie = "";
  6585. this.clearRadius = false;
  6586. this.circlee = 0;
  6587. };
  6588. this.resetMoveDir = function () {
  6589. this.moveDir = undefined;
  6590. };
  6591. this.resetResources = function (a) {
  6592. for (let b = 0; b < f.resourceTypes.length; ++b) {
  6593. this[f.resourceTypes[b]] = a ? 100 : 0;
  6594. }
  6595. };
  6596. this.setData = function (a) {
  6597. this.id = a[0];
  6598. this.sid = a[1];
  6599. this.name = a[2];
  6600. this.x = a[3];
  6601. this.y = a[4];
  6602. this.dir = a[5];
  6603. this.health = a[6];
  6604. this.maxHealth = a[7];
  6605. this.scale = a[8];
  6606. this.skinColor = a[9];
  6607. };
  6608. this.judgeShame = function () {
  6609. if (this.oldHealth < this.health) {
  6610. if (this.hitTime) {
  6611. let a = this.tick - this.hitTime;
  6612. this.hitTime = 0;
  6613. if (a < 2) {
  6614. this.lastshamecount = this.shameCount;
  6615. this.shameCount++;
  6616. } else {
  6617. this.lastshamecount = this.shameCount;
  6618. this.shameCount = Math.max(0, this.shameCount - 2);
  6619. }
  6620. }
  6621. } else if (this.oldHealth > this.health) {
  6622. this.hitTime = this.tick;
  6623. }
  6624. };
  6625. this.manageReloadaa = function () {
  6626. if (this.shooting[53]) {
  6627. this.shooting[53] = 0;
  6628. this.reloads[53] = 2388.8888888888887;
  6629. } else if (this.reloads[53] > 0) {
  6630. this.reloads[53] = Math.max(0, this.reloads[53] - 1000 / 9);
  6631. }
  6632. if (this.gathering || this.shooting[1]) {
  6633. if (this.gathering) {
  6634. this.gathering = 0;
  6635. this.reloads[this.gatherIndex] = ec.weapons[this.gatherIndex].speed * (this.skinIndex == 20 ? 0.78 : 1);
  6636. this.attacked = true;
  6637. }
  6638. if (this.shooting[1]) {
  6639. this.shooting[1] = 0;
  6640. this.reloads[this.shootIndex] = ec.weapons[this.shootIndex].speed * (this.skinIndex == 20 ? 0.78 : 1);
  6641. this.attacked = true;
  6642. }
  6643. } else {
  6644. this.attacked = false;
  6645. if (this.buildIndex < 0) {
  6646. if (this.reloads[this.weaponIndex] > 0) {
  6647. this.reloads[this.weaponIndex] = Math.max(0, this.reloads[this.weaponIndex] - P.tickRate);
  6648. }
  6649. }
  6650. }
  6651. };
  6652. this.closeSockets = function (a) {
  6653. a.close();
  6654. };
  6655. this.whyDieChat = function (a, b) {
  6656. a.sendWS("6", "why die XDDD " + b);
  6657. };
  6658. }
  6659. }
  6660. ;
  6661. class Sd {
  6662. constructor(a) {
  6663. this.sid = a;
  6664. this.init = function (a, b, c, d, e, f, g) {
  6665. f = f || {};
  6666. this.active = true;
  6667. this.x = a;
  6668. this.y = b;
  6669. this.scale = d;
  6670. this.owner = g;
  6671. this.id = f.id;
  6672. this.dmg = f.dmg;
  6673. this.trap = f.trap;
  6674. this.teleport = f.teleport;
  6675. this.isItem = this.id != undefined;
  6676. };
  6677. }
  6678. }
  6679. ;
  6680. class Td {
  6681. constructor(a, b) {
  6682. this.disableObj = function (a) {
  6683. a.active = false;
  6684. if (f.anotherVisual) {} else {
  6685. a.alive = false;
  6686. }
  6687. };
  6688. let c;
  6689. this.add = function (d, e, f, g, h, i, j, k, l) {
  6690. c = b(d);
  6691. if (!c) {
  6692. c = a.find(a => !a.active);
  6693. if (!c) {
  6694. c = new Sd(d);
  6695. a.push(c);
  6696. }
  6697. }
  6698. if (k) {
  6699. c.sid = d;
  6700. }
  6701. c.init(e, f, g, h, i, j, l);
  6702. };
  6703. this.disableBySid = function (a) {
  6704. let c = b(a);
  6705. if (c) {
  6706. this.disableObj(c);
  6707. }
  6708. };
  6709. this.removeAllItems = function (b, c) {
  6710. a.filter(a => a.active && a.owner && a.owner.sid == b).forEach(a => this.disableObj(a));
  6711. };
  6712. }
  6713. }
  6714. ;
  6715. let Ud = [];
  6716. function Vd(a) {
  6717. let b;
  6718. console.log(I);
  6719. let d = I.url.split("wss://")[1].split("?")[0];
  6720. b = a && new WebSocket("wss://" + d + "?token=re:" + encodeURIComponent(a));
  6721. let e = new Map();
  6722. h.push([e]);
  6723. Ud.push([b]);
  6724. let g;
  6725. let i = [];
  6726. let j = [];
  6727. let k = {
  6728. x: 0,
  6729. y: 0,
  6730. inGame: false,
  6731. closeSocket: false,
  6732. whyDie: ""
  6733. };
  6734. let l = {
  6735. x: 0,
  6736. y: 0
  6737. };
  6738. let m = 0;
  6739. let n = new Td(i, function (a) {
  6740. return ra(i, a);
  6741. });
  6742. b.binaryType = "arraybuffer";
  6743. b.first = true;
  6744. b.sendWS = function (a) {
  6745. let c = Array.prototype.slice.call(arguments, 1);
  6746. let d = window.msgpack.encode([a, c]);
  6747. b.send(d);
  6748. };
  6749. b.spawn = function () {
  6750. b.sendWS("M", {
  6751. name: "Yurio Slaves",
  6752. moofoll: 1,
  6753. skin: "__proto__"
  6754. });
  6755. };
  6756. b.sendUpgrade = function (a) {
  6757. b.sendWS("H", a);
  6758. };
  6759. b.place = function (a, c) {
  6760. try {
  6761. let d = ec.list[e.items[a]];
  6762. if (e.itemCounts[d.group.id] == undefined ? true : e.itemCounts[d.group.id] < (f.isSandbox ? 296 : d.group.limit ? d.group.limit : 296)) {
  6763. b.sendWS("G", e.items[a]);
  6764. b.sendWS("d", 1, c);
  6765. b.sendWS("G", e.weaponIndex, true);
  6766. }
  6767. } catch (a) {}
  6768. };
  6769. b.buye = function (a, c) {
  6770. let d = 0;
  6771. if (e.alive && e.inGame) {
  6772. if (c == 0) {
  6773. if (e.skins[a]) {
  6774. if (e.latestSkin != a) {
  6775. b.sendWS("c", 0, a, 0);
  6776. }
  6777. } else {
  6778. let c = qa(hc, a);
  6779. if (c) {
  6780. if (e.points >= c.price) {
  6781. b.sendWS("c", 1, a, 0);
  6782. b.sendWS("c", 0, a, 0);
  6783. } else if (e.latestSkin != d) {
  6784. b.sendWS("c", 0, d, 0);
  6785. }
  6786. } else if (e.latestSkin != d) {
  6787. b.sendWS("c", 0, d, 0);
  6788. }
  6789. }
  6790. } else if (c == 1) {
  6791. if (e.tails[a]) {
  6792. if (e.latestTail != a) {
  6793. b.sendWS("c", 0, a, 1);
  6794. }
  6795. } else {
  6796. let c = qa(ic, a);
  6797. if (c) {
  6798. if (e.points >= c.price) {
  6799. b.sendWS("c", 1, a, 1);
  6800. b.sendWS("c", 0, a, 1);
  6801. } else if (e.latestTail != 0) {
  6802. b.sendWS("c", 0, 0, 1);
  6803. }
  6804. } else if (e.latestTail != 0) {
  6805. b.sendWS("c", 0, 0, 1);
  6806. }
  6807. }
  6808. }
  6809. }
  6810. };
  6811. b.fastGear = function () {
  6812. if (e.y2 >= f.mapScale / 2 - f.riverWidth / 2 && e.y2 <= f.mapScale / 2 + f.riverWidth / 2) {
  6813. b.buye(31, 0);
  6814. } else if (e.y2 <= f.snowBiomeTop) {
  6815. b.buye(15, 0);
  6816. } else {
  6817. b.buye(12, 0);
  6818. }
  6819. };
  6820. b.selectWeapon = function (a) {
  6821. U("G", a, 1);
  6822. };
  6823. function o(a, b) {
  6824. try {
  6825. return Math.atan2((b.y2 || b.y) - (a.y2 || a.y), (b.x2 || b.x) - (a.x2 || a.x));
  6826. } catch (a) {
  6827. return 0;
  6828. }
  6829. }
  6830. b.heal = function () {
  6831. if (e.health < 100) {
  6832. b.place(0, 0);
  6833. }
  6834. };
  6835. function p(a, b) {
  6836. try {
  6837. return Math.hypot((b.y2 || b.y) - (a.y2 || a.y), (b.x2 || b.x) - (a.x2 || a.x));
  6838. } catch (a) {
  6839. return Infinity;
  6840. }
  6841. }
  6842. let q = "no";
  6843. b.zync = function (a) {
  6844. if (!e.millPlace) {
  6845. q = "yeah";
  6846. b.place(5, o(e, a));
  6847. let c = {
  6848. x: e.x + Math.cos(o(a, e) - Math.PI) * 80,
  6849. y: e.y + Math.sin(o(a, e) - Math.PI) * 80,
  6850. x2: e.x + Math.cos(o(a, e) - Math.PI) * 80,
  6851. y2: e.y + Math.sin(o(a, e) - Math.PI) * 80
  6852. };
  6853. function d(a, b, c, d) {
  6854. let e = Math.sqrt(Math.pow(c - a, 2) + Math.pow(d - b, 2));
  6855. return e;
  6856. }
  6857. function f() {
  6858. b.sendWS("6", d(c.x, c.y, e.x, e.y) + "");
  6859. b.sendWS("D", o(a, e) - Math.PI);
  6860. }
  6861. let g = setInterval(() => {
  6862. b.sendWS("G", e.weapons[1], true);
  6863. if (m == 0) {
  6864. b.sendWS("K", 1);
  6865. m = 1;
  6866. }
  6867. setTimeout(() => {
  6868. b.sendWS("G", e.weapons[0], true);
  6869. }, 2000);
  6870. b.buye(53, 0);
  6871. if (d(c.x, c.y, e.x, e.y) > 5) {
  6872. b.sendWS("a", o(e, c));
  6873. } else {
  6874. b.sendWS("6", d(c.x, c.y, e.x, e.y) + "");
  6875. q = "no";
  6876. b.sendWS("a", undefined);
  6877. f();
  6878. clearInterval(g);
  6879. }
  6880. }, 150);
  6881. setTimeout(() => {
  6882. q = "no";
  6883. clearInterval(g);
  6884. }, 500);
  6885. }
  6886. };
  6887. b.onmessage = function (a) {
  6888. let d = new Uint8Array(a.data);
  6889. let f = window.msgpack.decode(d);
  6890. let h = f[0];
  6891. d = f[1];
  6892. if (h == "io-init") {
  6893. b.spawn();
  6894. }
  6895. if (h == "1") {
  6896. g = d[0];
  6897. console.log(g);
  6898. }
  6899. if (h == "D") {
  6900. if (d[1]) {
  6901. e = new Rd(d[0][0], d[0][1], hc, ic);
  6902. e.setData(d[0]);
  6903. e.inGame = true;
  6904. e.alive = true;
  6905. e.x2 = undefined;
  6906. e.y2 = undefined;
  6907. e.spawn(1);
  6908. e.oldHealth = 100;
  6909. e.health = 100;
  6910. e.showName = "YEAHHH";
  6911. l = {
  6912. x: d[0][3],
  6913. y: d[0][4]
  6914. };
  6915. k.inGame = true;
  6916. if (b.first) {
  6917. b.first = false;
  6918. Pd.push(k);
  6919. }
  6920. }
  6921. }
  6922. if (h == "P") {
  6923. b.spawn();
  6924. e.inGame = false;
  6925. k.inGame = false;
  6926. }
  6927. if (h == "a") {
  6928. let a = d[0];
  6929. e.tick++;
  6930. e.enemy = [];
  6931. e.near = [];
  6932. b.showName = "YEAHHH";
  6933. j = [];
  6934. for (let b = 0; b < a.length;) {
  6935. if (a[b] == e.sid) {
  6936. e.x2 = a[b + 1];
  6937. e.y2 = a[b + 2];
  6938. e.d2 = a[b + 3];
  6939. e.buildIndex = a[b + 4];
  6940. e.weaponIndex = a[b + 5];
  6941. e.weaponVariant = a[b + 6];
  6942. e.team = a[b + 7];
  6943. e.isLeader = a[b + 8];
  6944. e.skinIndex = a[b + 9];
  6945. e.tailIndex = a[b + 10];
  6946. e.iconIndex = a[b + 11];
  6947. e.zIndex = a[b + 12];
  6948. e.visible = true;
  6949. k.x2 = e.x2;
  6950. k.y2 = e.y2;
  6951. }
  6952. b += 13;
  6953. }
  6954. for (let b = 0; b < a.length;) {
  6955. la = ta(a[b]);
  6956. if (la) {
  6957. if (!la.isTeam(e)) {
  6958. ma.push(la);
  6959. if (la.dist2 <= ec.weapons[la.primaryIndex == undefined ? 5 : la.primaryIndex].range + e.scale * 2) {
  6960. na.push(la);
  6961. }
  6962. }
  6963. }
  6964. b += 13;
  6965. }
  6966. if (ma.length) {
  6967. e.near = ma.sort(function (a, b) {
  6968. return a.dist2 - b.dist2;
  6969. })[0];
  6970. }
  6971. if (m == 1) {
  6972. b.sendWS("K", 1);
  6973. m = 0;
  6974. }
  6975. if (k.closeSocket) {
  6976. e.closeSockets(b);
  6977. }
  6978. if (k.whyDie != "") {
  6979. e.whyDieChat(b, k.whyDie);
  6980. k.whyDie = "";
  6981. }
  6982. if (e.alive) {
  6983. if (ja.team) {
  6984. if (e.team != ja.team && e.tick % 9 === 0) {
  6985. if (e.team) {
  6986. b.sendWS("N");
  6987. }
  6988. b.sendWS("b", ja.team);
  6989. }
  6990. }
  6991. let a = ec.list[e.items[3]];
  6992. let d = e.itemCounts[a.group.id];
  6993. if ((d != undefined ? d : 0) < 201 && e.millPlace) {
  6994. if (e.inGame) {
  6995. b.sendWS("D", e.moveDir);
  6996. if (m == 0) {
  6997. b.sendWS("K", 1);
  6998. m = 1;
  6999. }
  7000. if (dc.getDist(l, e, 0, 2) > 90) {
  7001. let a = dc.getDirect(l, e, 0, 2);
  7002. b.place(3, a + 7.7);
  7003. b.place(3, a - 7.7);
  7004. b.place(3, a);
  7005. l = {
  7006. x: e.x2,
  7007. y: e.y2
  7008. };
  7009. }
  7010. if (e.tick % 90 === 0) {
  7011. let a = Math.random() * Math.PI * 2;
  7012. e.moveDir = a;
  7013. b.sendWS("a", e.moveDir);
  7014. }
  7015. }
  7016. b.fastGear();
  7017. } else if ((d != undefined ? d : 0) > 296 && e.millPlace) {
  7018. e.millPlace = false;
  7019. b.fastGear();
  7020. } else if (e.inGame) {
  7021. if (i.length > 0) {
  7022. let a = i.filter(a => a.active && a.isItem && dc.getDist(a, ja, 0, 2) <= 600);
  7023. if (c("mode").value == "fuckemup") {
  7024. b.selectWeapon(e.weapons[1]);
  7025. let c = dc.getDist(a[0], e, 0, 2);
  7026. let d = dc.getDirect(a[0], e, 0, 2);
  7027. j = i.filter(b => b.active && (ra(a, b.sid) ? true : !b.trap || ja.sid != b.owner.sid && !ja.findAllianceBySid(b.owner.sid)) && b.isItem && dc.getDist(b, e, 0, 2) <= ec.weapons[e.weaponIndex].range + b.scale + 10).sort(function (a, b) {
  7028. return dc.getDist(a, e, 0, 2) - dc.getDist(b, e, 0, 2);
  7029. })[0];
  7030. if (j) {
  7031. let f = dc.getDist(a[0], j, 0, 0);
  7032. if (c - f > 0) {
  7033. if (ra(a, j.sid) ? true : j.dmg || j.trap) {
  7034. if (e.moveDir != undefined) {
  7035. e.moveDir = undefined;
  7036. b.sendWS("a", e.moveDir);
  7037. b.sendWS("D", e.nDir);
  7038. }
  7039. } else {
  7040. e.moveDir = d;
  7041. b.sendWS("a", e.moveDir);
  7042. b.sendWS("D", e.nDir);
  7043. }
  7044. if (e.nDir != dc.getDirect(j, e, 0, 2)) {
  7045. e.nDir = dc.getDirect(j, e, 0, 2);
  7046. b.sendWS("D", e.nDir);
  7047. }
  7048. if (m == 0) {
  7049. b.sendWS("K", 1);
  7050. m = 1;
  7051. }
  7052. b.buye(40, 0);
  7053. } else {
  7054. e.moveDir = d;
  7055. b.sendWS("a", e.moveDir);
  7056. b.sendWS("D", e.nDir);
  7057. b.fastGear();
  7058. }
  7059. } else {
  7060. e.moveDir = d;
  7061. b.sendWS("a", e.moveDir);
  7062. b.sendWS("D", e.nDir);
  7063. b.fastGear();
  7064. }
  7065. }
  7066. }
  7067. if (i.length > 0) {
  7068. if (c("mode").value == "flex") {
  7069. const a = e.sid * (Math.PI * 2 / e.sid);
  7070. const c = Math.cos(Date.now() * 0.01) * 300 + ja.x;
  7071. const d = Math.sin(Date.now() * 0.01) * 300 + ja.x;
  7072. b.sendWS("a", Math.atan2(d - e.y, c - e.x));
  7073. const f = Math.hypot(c - e.x, d - e.y);
  7074. if (f > 22) {
  7075. return;
  7076. }
  7077. }
  7078. }
  7079. if (i.length > 0) {
  7080. j = i.filter(a => a.active && a.isItem && dc.getDist(a, e, 0, 2) <= ec.weapons[e.weaponIndex].range).sort(function (a, b) {
  7081. return dc.getDist(a, e, 0, 2) - dc.getDist(b, e, 0, 2);
  7082. })[0];
  7083. if (j) {
  7084. if (m == 0) {
  7085. b.sendWS("K", 1);
  7086. m = 1;
  7087. }
  7088. if (e.nDir != dc.getDirect(j, e, 0, 2)) {
  7089. e.nDir = dc.getDirect(j, e, 0, 2);
  7090. b.sendWS("D", e.nDir);
  7091. }
  7092. b.buye(40, 0);
  7093. b.buye(11, 1);
  7094. } else {
  7095. b.fastGear();
  7096. b.buye(11, 1);
  7097. }
  7098. b.buye(11, 1);
  7099. if (ia.length > 0 && c("mode").value == "clear") {
  7100. b.selectWeapon(e.weapons[1]);
  7101. let a = dc.getDist(ia[0], e, 0, 2);
  7102. let c = dc.getDirect(ia[0], e, 0, 2);
  7103. j = i.filter(a => a.active && (ra(ia, a.sid) ? true : !a.trap || ja.sid != a.owner.sid && !ja.findAllianceBySid(a.owner.sid)) && a.isItem && dc.getDist(a, e, 0, 2) <= ec.weapons[e.weaponIndex].range + a.scale).sort(function (a, b) {
  7104. return dc.getDist(a, e, 0, 2) - dc.getDist(b, e, 0, 2);
  7105. })[0];
  7106. if (j) {
  7107. let d = dc.getDist(ia[0], j, 0, 0);
  7108. if (a - d > 0) {
  7109. if (ra(ia, j.sid) ? true : j.dmg || j.trap) {
  7110. if (e.moveDir != undefined) {
  7111. e.moveDir = undefined;
  7112. b.sendWS("a", e.moveDir);
  7113. b.sendWS("D", e.nDir);
  7114. }
  7115. } else {
  7116. e.moveDir = c;
  7117. b.sendWS("a", e.moveDir);
  7118. b.sendWS("D", e.nDir);
  7119. }
  7120. if (e.nDir != dc.getDirect(j, e, 0, 2)) {
  7121. e.nDir = dc.getDirect(j, e, 0, 2);
  7122. b.sendWS("D", e.nDir);
  7123. }
  7124. if (m == 0) {
  7125. b.sendWS("K", 1);
  7126. m = 1;
  7127. }
  7128. b.buye(40, 0);
  7129. b.fastGear();
  7130. } else {
  7131. e.moveDir = c;
  7132. b.sendWS("a", e.moveDir);
  7133. b.sendWS("D", e.nDir);
  7134. b.fastGear();
  7135. }
  7136. } else {
  7137. e.moveDir = c;
  7138. b.sendWS("a", e.moveDir);
  7139. b.sendWS("D", e.nDir);
  7140. b.fastGear();
  7141. }
  7142. if (a > 300) {
  7143. if (dc.getDist(l, e, 0, 2) > 90) {
  7144. let a = dc.getDirect(l, e, 0, 2);
  7145. b.place(3, a + 7.7);
  7146. b.place(3, a - 7.7);
  7147. b.place(3, a);
  7148. l = {
  7149. x: e.x2,
  7150. y: e.y2
  7151. };
  7152. }
  7153. }
  7154. }
  7155. }
  7156. if (i.length > 0 && c("mode").value == "zync") {
  7157. let a = i.filter(a => a.active && a.isItem && dc.getDist(a, ja, 0, 2) <= ec.weapons[e.weaponIndex].range + a.scale);
  7158. if (!a.length) {
  7159. if (q == "no") {
  7160. b.sendWS("D", dc.getDirect(ja, e, 0, 2));
  7161. }
  7162. b.sendWS("a", o(ja, e) + Math.PI);
  7163. }
  7164. if (a.length) {
  7165. let c = dc.getDist(a[0], e, 0, 2);
  7166. let d = dc.getDirect(a[0], e, 0, 2);
  7167. j = i.filter(b => b.active && (ra(a, b.sid) ? true : !b.trap || ja.sid != b.owner.sid && !ja.findAllianceBySid(b.owner.sid)) && b.isItem && dc.getDist(b, e, 0, 2) <= ec.weapons[e.weaponIndex].range + b.scale).sort(function (a, b) {
  7168. return dc.getDist(a, e, 0, 2) - dc.getDist(b, e, 0, 2);
  7169. })[0];
  7170. if (j) {
  7171. let d = dc.getDist(a[0], j, 0, 0);
  7172. if (c - d > 0) {
  7173. if (ra(a, j.sid) ? true : j.dmg || j.trap) {
  7174. if (e.moveDir != undefined) {
  7175. e.moveDir = undefined;
  7176. b.sendWS("a", e.moveDir);
  7177. b.sendWS("D", e.nDir);
  7178. }
  7179. } else {
  7180. b.sendWS("D", e.nDir);
  7181. }
  7182. if (e.nDir != dc.getDirect(j, e, 0, 2)) {
  7183. e.nDir = dc.getDirect(j, e, 0, 2);
  7184. b.sendWS("D", e.nDir);
  7185. }
  7186. if (m == 0) {
  7187. b.sendWS("K", 1);
  7188. m = 1;
  7189. }
  7190. b.buye(40, 0);
  7191. b.fastGear();
  7192. } else {
  7193. if (q == "no") {
  7194. b.sendWS("D", dc.getDirect(j, e, 0, 2));
  7195. }
  7196. if (p(ja, e) <= 110) {
  7197. b.sendWS("a", undefined);
  7198. } else {
  7199. b.sendWS("a", o(ja, e) + Math.PI);
  7200. }
  7201. }
  7202. } else if (a.length) {
  7203. if (q == "no") {
  7204. b.sendWS("D", dc.getDirect(a[0], e, 0, 2));
  7205. }
  7206. if (p(ja, e) <= 110) {
  7207. b.sendWS("a", undefined);
  7208. } else {
  7209. b.sendWS("a", o(ja, e) + Math.PI);
  7210. }
  7211. } else {
  7212. if (q == "no") {
  7213. b.sendWS("D", dc.getDirect(ja, e, 0, 2));
  7214. }
  7215. if (p(ja, e) <= 110) {
  7216. b.sendWS("a", undefined);
  7217. } else {
  7218. b.sendWS("a", o(ja, e) + Math.PI);
  7219. }
  7220. }
  7221. }
  7222. }
  7223. }
  7224. }
  7225. }
  7226. if (h == "H") {
  7227. let a = d[0];
  7228. for (let b = 0; b < a.length;) {
  7229. n.add(a[b], a[b + 1], a[b + 2], a[b + 3], a[b + 4], a[b + 5], ec.list[a[b + 6]], true, a[b + 7] >= 0 ? {
  7230. sid: a[b + 7]
  7231. } : null);
  7232. b += 8;
  7233. }
  7234. }
  7235. if (h == "N") {
  7236. let a = d[0];
  7237. let b = d[1];
  7238. if (e) {
  7239. e[a] = b;
  7240. }
  7241. }
  7242. if (h == "O") {
  7243. if (d[0] == e.sid) {
  7244. e.oldHealth = e.health;
  7245. e.health = d[1];
  7246. e.judgeShame();
  7247. if (e.oldHealth > e.health) {
  7248. if (e.shameCount < 5) {
  7249. for (let a = 0; a < 2; a++) {
  7250. b.place(0, e.nDir);
  7251. }
  7252. } else {
  7253. setTimeout(() => {
  7254. for (let a = 0; a < 2; a++) {
  7255. b.place(0, e.nDir);
  7256. }
  7257. }, 95);
  7258. }
  7259. }
  7260. }
  7261. }
  7262. if (h == "Q") {
  7263. let a = d[0];
  7264. n.disableBySid(a);
  7265. }
  7266. if (h == "R") {
  7267. let a = d[0];
  7268. if (e.alive) {
  7269. n.removeAllItems(a);
  7270. }
  7271. }
  7272. if (h == "S") {
  7273. let a = d[0];
  7274. let b = d[1];
  7275. if (e) {
  7276. e.itemCounts[a] = b;
  7277. }
  7278. }
  7279. if (h == "U") {
  7280. if (d[0] > 0) {
  7281. if (c("setup").value == "dm") {
  7282. if (e.upgraded == 0) {
  7283. b.sendUpgrade(7);
  7284. } else if (e.upgraded == 1) {
  7285. b.sendUpgrade(17);
  7286. } else if (e.upgraded == 2) {
  7287. b.sendUpgrade(31);
  7288. } else if (e.upgraded == 3) {
  7289. b.sendUpgrade(23);
  7290. } else if (e.upgraded == 4) {
  7291. b.sendUpgrade(9);
  7292. } else if (e.upgraded == 5) {
  7293. b.sendUpgrade(34);
  7294. } else if (e.upgraded == 6) {
  7295. b.sendUpgrade(12);
  7296. } else if (e.upgraded == 7) {
  7297. b.sendUpgrade(15);
  7298. }
  7299. } else if (c("setup").value == "dr") {
  7300. if (e.upgraded == 0) {
  7301. b.sendUpgrade(7);
  7302. } else if (e.upgraded == 1) {
  7303. b.sendUpgrade(17);
  7304. } else if (e.upgraded == 2) {
  7305. b.sendUpgrade(31);
  7306. } else if (e.upgraded == 3) {
  7307. b.sendUpgrade(23);
  7308. } else if (e.upgraded == 4) {
  7309. b.sendUpgrade(9);
  7310. } else if (e.upgraded == 5) {
  7311. b.sendUpgrade(34);
  7312. } else if (e.upgraded == 6) {
  7313. b.sendUpgrade(12);
  7314. } else if (e.upgraded == 7) {
  7315. b.sendUpgrade(13);
  7316. }
  7317. } else if (c("setup").value == "kh") {
  7318. if (e.upgraded == 0) {
  7319. b.sendUpgrade(3);
  7320. } else if (e.upgraded == 1) {
  7321. b.sendUpgrade(17);
  7322. } else if (e.upgraded == 2) {
  7323. b.sendUpgrade(31);
  7324. } else if (e.upgraded == 3) {
  7325. b.sendUpgrade(27);
  7326. } else if (e.upgraded == 4) {
  7327. b.sendUpgrade(10);
  7328. } else if (e.upgraded == 5) {
  7329. b.sendUpgrade(34);
  7330. } else if (e.upgraded == 6) {
  7331. b.sendUpgrade(4);
  7332. } else if (e.upgraded == 7) {
  7333. b.sendUpgrade(25);
  7334. }
  7335. } else if (c("setup").value == "zd") {
  7336. if (e.upgraded == 0) {
  7337. b.sendUpgrade(3);
  7338. } else if (e.upgraded == 1) {
  7339. b.sendUpgrade(17);
  7340. } else if (e.upgraded == 2) {
  7341. b.sendUpgrade(31);
  7342. } else if (e.upgraded == 3) {
  7343. b.sendUpgrade(27);
  7344. } else if (e.upgraded == 4) {
  7345. b.sendUpgrade(9);
  7346. } else if (e.upgraded == 5) {
  7347. b.sendUpgrade(34);
  7348. } else if (e.upgraded == 6) {
  7349. b.sendUpgrade(12);
  7350. } else if (e.upgraded == 7) {
  7351. b.sendUpgrade(15);
  7352. }
  7353. }
  7354. e.upgraded++;
  7355. }
  7356. }
  7357. if (h == "V") {
  7358. let a = d[0];
  7359. let b = d[1];
  7360. if (a) {
  7361. if (b) {
  7362. e.weapons = a;
  7363. } else {
  7364. e.items = a;
  7365. }
  7366. }
  7367. }
  7368. if (h == "5") {
  7369. let a = d[0];
  7370. let b = d[1];
  7371. let c = d[2];
  7372. if (c) {
  7373. if (!a) {
  7374. e.tails[b] = 1;
  7375. } else {
  7376. e.latestTail = b;
  7377. }
  7378. } else if (!a) {
  7379. e.skins[b] = 1;
  7380. } else {
  7381. e.latestSkin = b;
  7382. }
  7383. }
  7384. if (h == "6") {
  7385. let a = d[0];
  7386. let c = d[1] + "";
  7387. if (a == ja.sid && c.includes("syncon")) {
  7388. b.zync(e.near);
  7389. }
  7390. }
  7391. };
  7392. b.onclose = function () {
  7393. e.inGame = false;
  7394. k.inGame = false;
  7395. };
  7396. }
  7397. function Wd(a, b, c, d, e) {
  7398. let f = a + c * Math.cos(d);
  7399. let g = b + c * Math.sin(d);
  7400. let h = c * 0.4;
  7401. e.moveTo(a, b);
  7402. e.beginPath();
  7403. e.quadraticCurveTo((a + f) / 2 + h * Math.cos(d + Math.PI / 2), (b + g) / 2 + h * Math.sin(d + Math.PI / 2), f, g);
  7404. e.quadraticCurveTo((a + f) / 2 - h * Math.cos(d + Math.PI / 2), (b + g) / 2 - h * Math.sin(d + Math.PI / 2), a, b);
  7405. e.closePath();
  7406. e.fill();
  7407. e.stroke();
  7408. }
  7409. function Xd(a, b, c, d, e, f) {
  7410. d = d || Ba;
  7411. d.beginPath();
  7412. d.arc(a, b, c, 0, Math.PI * 2);
  7413. if (!f) {
  7414. d.fill();
  7415. }
  7416. if (!e) {
  7417. d.stroke();
  7418. }
  7419. }
  7420. function Yd(a, b, c, d, e, f) {
  7421. d = d || Ba;
  7422. d.beginPath();
  7423. d.arc(a, b, c, 0, Math.PI * 2);
  7424. if (!f) {
  7425. d.fill();
  7426. }
  7427. if (!e) {
  7428. d.stroke();
  7429. }
  7430. }
  7431. function Zd(a, b, c, d) {
  7432. let e = Math.PI / 2 * 3;
  7433. let f;
  7434. let g;
  7435. let h = Math.PI / b;
  7436. a.beginPath();
  7437. a.moveTo(0, -c);
  7438. for (let i = 0; i < b; i++) {
  7439. f = Math.cos(e) * c;
  7440. g = Math.sin(e) * c;
  7441. a.lineTo(f, g);
  7442. e += h;
  7443. f = Math.cos(e) * d;
  7444. g = Math.sin(e) * d;
  7445. a.lineTo(f, g);
  7446. e += h;
  7447. }
  7448. a.lineTo(0, -c);
  7449. a.closePath();
  7450. }
  7451. function $d(a, b, c, d) {
  7452. let e = Math.PI / 2 * 3;
  7453. let f;
  7454. let g;
  7455. let h = Math.PI / b;
  7456. a.beginPath();
  7457. a.moveTo(0, -c);
  7458. for (let i = 0; i < b; i++) {
  7459. f = Math.cos(e) * c;
  7460. g = Math.sin(e) * c;
  7461. a.lineTo(f, g);
  7462. e += h;
  7463. f = Math.cos(e) * d;
  7464. g = Math.sin(e) * d;
  7465. a.lineTo(f, g);
  7466. e += h;
  7467. }
  7468. a.lineTo(0, -c);
  7469. a.closePath();
  7470. }
  7471. function _d(a, b, c, d, e, f, g) {
  7472. if (!g) {
  7473. e.fillRect(a - c / 2, b - d / 2, c, d);
  7474. }
  7475. if (!f) {
  7476. e.strokeRect(a - c / 2, b - d / 2, c, d);
  7477. }
  7478. }
  7479. function ae(a, b, c, d, e, f, g) {
  7480. if (!g) {
  7481. e.fillRect(a - c / 2, b - d / 2, c, d);
  7482. }
  7483. if (!f) {
  7484. e.strokeRect(a - c / 2, b - d / 2, c, d);
  7485. }
  7486. }
  7487. function be(a, b, c, d, e, f, g, h) {
  7488. f.save();
  7489. f.translate(a, b);
  7490. e = Math.ceil(e / 2);
  7491. for (let i = 0; i < e; i++) {
  7492. _d(0, 0, c * 2, d, f, g, h);
  7493. f.rotate(Math.PI / e);
  7494. }
  7495. f.restore();
  7496. }
  7497. function ce(a, b, c, d) {
  7498. let e = Math.PI / 2 * 3;
  7499. let f;
  7500. let g;
  7501. let h = Math.PI / b;
  7502. let i;
  7503. a.beginPath();
  7504. a.moveTo(0, -d);
  7505. for (let f = 0; f < b; f++) {
  7506. i = dc.randInt(c + 0.9, c * 1.2);
  7507. a.quadraticCurveTo(Math.cos(e + h) * i, Math.sin(e + h) * i, Math.cos(e + h * 2) * d, Math.sin(e + h * 2) * d);
  7508. e += h * 2;
  7509. }
  7510. a.lineTo(0, -d);
  7511. a.closePath();
  7512. }
  7513. function de(a, b) {
  7514. b = b || Ba;
  7515. let c = a * (Math.sqrt(3) / 2);
  7516. b.beginPath();
  7517. b.moveTo(0, -c / 2);
  7518. b.lineTo(-a / 2, c / 2);
  7519. b.lineTo(a / 2, c / 2);
  7520. b.lineTo(0, -c / 2);
  7521. b.fill();
  7522. b.closePath();
  7523. }
  7524. function ee() {}
  7525. const fe = 1;
  7526. function ge(a, b) {
  7527. Ba.fillStyle = "#91b2db";
  7528. const c = Date.now();
  7529. ha.filter(a => a.active).forEach(d => {
  7530. if (!d.startTime) {
  7531. d.startTime = c;
  7532. d.angle = 0;
  7533. d.radius = 0.1;
  7534. }
  7535. const e = c - d.startTime;
  7536. const f = 1;
  7537. d.alpha = Math.max(0, f - e / 3000);
  7538. d.animate(Va);
  7539. Ba.globalAlpha = d.alpha;
  7540. Ba.strokeStyle = eb;
  7541. Ba.save();
  7542. Ba.translate(d.x - a, d.y - b);
  7543. d.radius -= 0.001;
  7544. d.angle += 0.0174533;
  7545. const g = 1;
  7546. const h = d.radius * Math.cos(d.angle);
  7547. const i = d.radius * Math.sin(d.angle);
  7548. d.x += h * g;
  7549. d.y += i * g;
  7550. Ba.rotate(d.angle);
  7551. ie(d, Ba);
  7552. Ba.restore();
  7553. Ba.fillStyle = "#91b2db";
  7554. if (e >= 3000) {
  7555. d.active = false;
  7556. d.startTime = null;
  7557. }
  7558. });
  7559. }
  7560. function he(a, b, c) {
  7561. Ba.globalAlpha = 1;
  7562. Ba.fillStyle = "#91b2db";
  7563. for (var d = 0; d < ba.length; ++d) {
  7564. la = ba[d];
  7565. if (la.zIndex == c) {
  7566. la.animate(Va);
  7567. if (la.visible) {
  7568. la.skinRot += Va * 0.002;
  7569. $a = la == ja ? Pc() : la.dir || 0;
  7570. Ba.save();
  7571. Ba.translate(la.x - a, la.y - b);
  7572. Ba.rotate($a + la.dirPlus);
  7573. je(la, Ba);
  7574. Ba.restore();
  7575. }
  7576. }
  7577. }
  7578. }
  7579. function ie(a, b) {
  7580. b = b || Ba;
  7581. b.lineWidth = gb;
  7582. b.lineJoin = "miter";
  7583. let c = Math.PI / 4 * (ec.weapons[a.weaponIndex].armS || 1);
  7584. let d = a.buildIndex < 0 ? ec.weapons[a.weaponIndex].hndS || 1 : 1;
  7585. let e = a.buildIndex < 0 ? ec.weapons[a.weaponIndex].hndD || 1 : 1;
  7586. De(13, b, a);
  7587. if (a.buildIndex < 0 && !ec.weapons[a.weaponIndex].aboveHand) {
  7588. Fe(ec.weapons[a.weaponIndex], f.weaponVariants[a.weaponVariant || 0].src || "", a.scale, 0, b);
  7589. if (ec.weapons[a.weaponIndex].projectile != undefined && !ec.weapons[a.weaponIndex].hideProjectile) {
  7590. Ie(a.scale, 0, ec.projectiles[ec.weapons[a.weaponIndex].projectile], Ba);
  7591. }
  7592. }
  7593. b.fillStyle = "#ececec";
  7594. Xd(a.scale * Math.cos(c), a.scale * Math.sin(c), 14);
  7595. Xd(a.scale * e * Math.cos(-c * d), a.scale * e * Math.sin(-c * d), 14);
  7596. if (a.buildIndex < 0 && ec.weapons[a.weaponIndex].aboveHand) {
  7597. Fe(ec.weapons[a.weaponIndex], f.weaponVariants[a.weaponVariant || 0].src || "", a.scale, 0, b);
  7598. if (ec.weapons[a.weaponIndex].projectile != undefined && !ec.weapons[a.weaponIndex].hideProjectile) {
  7599. Ie(a.scale, 0, ec.projectiles[ec.weapons[a.weaponIndex].projectile], Ba);
  7600. }
  7601. }
  7602. if (a.buildIndex >= 0) {
  7603. var g = Pe(ec.list[a.buildIndex]);
  7604. b.drawImage(g, a.scale - ec.list[a.buildIndex].holdOffset, -g.width / 2);
  7605. }
  7606. Xd(0, 0, a.scale, b);
  7607. me(48, b, null, a);
  7608. }
  7609. function je(a, b) {
  7610. b = b || Ba;
  7611. b.lineWidth = gb;
  7612. b.lineJoin = "miter";
  7613. let c = Math.PI / 4 * (ec.weapons[a.weaponIndex].armS || 1);
  7614. let d = a.buildIndex < 0 ? ec.weapons[a.weaponIndex].hndS || 1 : 1;
  7615. let e = a.buildIndex < 0 ? ec.weapons[a.weaponIndex].hndD || 1 : 1;
  7616. let g = a == ja && a.weapons[0] == 3 && a.weapons[1] == 15;
  7617. if (a.tailIndex > 0) {
  7618. we(a.tailIndex, b, a);
  7619. }
  7620. if (a.buildIndex < 0 && !ec.weapons[a.weaponIndex].aboveHand) {
  7621. Fe(ec.weapons[g ? 4 : a.weaponIndex], f.weaponVariants[a.weaponVariant].src, a.scale, 0, b);
  7622. if (ec.weapons[a.weaponIndex].projectile != undefined && !ec.weapons[a.weaponIndex].hideProjectile) {
  7623. Ie(a.scale, 0, ec.projectiles[ec.weapons[a.weaponIndex].projectile], Ba);
  7624. }
  7625. }
  7626. b.fillStyle = f.skinColors[a.skinColor];
  7627. Xd(a.scale * Math.cos(c), a.scale * Math.sin(c), 14);
  7628. Xd(a.scale * e * Math.cos(-c * d), a.scale * e * Math.sin(-c * d), 14);
  7629. if (a.buildIndex < 0 && ec.weapons[a.weaponIndex].aboveHand) {
  7630. Fe(ec.weapons[a.weaponIndex], f.weaponVariants[a.weaponVariant].src, a.scale, 0, b);
  7631. if (ec.weapons[a.weaponIndex].projectile != undefined && !ec.weapons[a.weaponIndex].hideProjectile) {
  7632. Ie(a.scale, 0, ec.projectiles[ec.weapons[a.weaponIndex].projectile], Ba);
  7633. }
  7634. }
  7635. if (a.buildIndex >= 0) {
  7636. var h = Pe(ec.list[a.buildIndex]);
  7637. b.drawImage(h, a.scale - ec.list[a.buildIndex].holdOffset, -h.width / 2);
  7638. }
  7639. Xd(0, 0, a.scale, b);
  7640. if (a.skinIndex > 0) {
  7641. b.rotate(Math.PI / 2);
  7642. ne(a.skinIndex, b, null, a);
  7643. }
  7644. }
  7645. var ke = {};
  7646. var le = {};
  7647. function me(a, b, c, d) {
  7648. se = ke[a];
  7649. if (!se) {
  7650. var e = new Image();
  7651. e.onload = function () {
  7652. this.isLoaded = true;
  7653. this.onload = null;
  7654. };
  7655. e.src = "https://moomoo.io/img/hats/hat_" + a + ".png";
  7656. ke[a] = e;
  7657. se = e;
  7658. }
  7659. var f = c || le[a];
  7660. if (!f) {
  7661. for (var g = 0; g < hc.length; ++g) {
  7662. if (hc[g].id == a) {
  7663. f = hc[g];
  7664. break;
  7665. }
  7666. }
  7667. le[a] = f;
  7668. }
  7669. if (se.isLoaded) {
  7670. b.drawImage(se, -f.scale / 2, -f.scale / 2, f.scale, f.scale);
  7671. }
  7672. if (!c && f.topSprite) {
  7673. b.save();
  7674. b.rotate(d.skinRot);
  7675. me(a + "_top", b, f, d);
  7676. b.restore();
  7677. }
  7678. }
  7679. function ne(a, b, c, d) {
  7680. if (!(se = qe[a + (ze ? "lol" : 0)])) {
  7681. var e = new Image();
  7682. e.onload = function () {
  7683. this.isLoaded = true;
  7684. this.onload = null;
  7685. };
  7686. e.src = pe(a, "hat", a);
  7687. qe[a + (ze ? "lol" : 0)] = e;
  7688. se = e;
  7689. }
  7690. var f = c || re[a];
  7691. if (!f) {
  7692. for (var g = 0; g < hc.length; ++g) {
  7693. if (hc[g].id == a) {
  7694. f = hc[g];
  7695. break;
  7696. }
  7697. }
  7698. re[a] = f;
  7699. }
  7700. if (se.isLoaded) {
  7701. b.drawImage(se, -f.scale / 2, -f.scale / 2, f.scale, f.scale);
  7702. }
  7703. if (!c && f.topSprite) {
  7704. b.save();
  7705. b.rotate(d.skinRot);
  7706. te(a + "_top", b, f, d);
  7707. b.restore();
  7708. }
  7709. }
  7710. var oe = {
  7711. 7: "https://i.imgur.com/vAOzlyY.png",
  7712. 15: "https://i.imgur.com/YRQ8Ybq.png",
  7713. 40: "https://i.imgur.com/Xzmg27N.png",
  7714. 26: "https://i.imgur.com/I0xGtyZ.png",
  7715. 55: "https://i.imgur.com/uYgDtcZ.png",
  7716. 20: "https://i.imgur.com/f5uhWCk.png"
  7717. };
  7718. function pe(a, b, c) {
  7719. if (true) {
  7720. if (oe[a] && b == "hat") {
  7721. return oe[a];
  7722. } else if (b == "acc") {
  7723. return ".././img/accessories/access_" + a + ".png";
  7724. } else if (b == "hat") {
  7725. return ".././img/hats/hat_" + a + ".png";
  7726. } else {
  7727. return ".././img/weapons/" + a + ".png";
  7728. }
  7729. } else if (b == "acc") {
  7730. return ".././img/accessories/access_" + a + ".png";
  7731. } else if (b == "hat") {
  7732. return ".././img/hats/hat_" + a + ".png";
  7733. } else {
  7734. return ".././img/weapons/" + a + ".png";
  7735. }
  7736. }
  7737. let qe = {};
  7738. let re = {};
  7739. let se;
  7740. function te(a, b, c, d) {
  7741. se = qe[a];
  7742. if (!se) {
  7743. let b = new Image();
  7744. b.onload = function () {
  7745. this.isLoaded = true;
  7746. this.onload = null;
  7747. };
  7748. b.src = "https://moomoo.io/img/hats/hat_" + a + ".png";
  7749. qe[a] = b;
  7750. se = b;
  7751. }
  7752. let e = c || re[a];
  7753. if (!e) {
  7754. for (let b = 0; b < hc.length; ++b) {
  7755. if (hc[b].id == a) {
  7756. e = hc[b];
  7757. break;
  7758. }
  7759. }
  7760. re[a] = e;
  7761. }
  7762. if (se.isLoaded) {
  7763. b.drawImage(se, -e.scale / 2, -e.scale / 2, e.scale, e.scale);
  7764. }
  7765. if (!c && e.topSprite) {
  7766. b.save();
  7767. b.rotate(d.skinRot);
  7768. te(a + "_top", b, e, d);
  7769. b.restore();
  7770. }
  7771. }
  7772. var ue = {
  7773. 21: "https://i.imgur.com/4ddZert.png",
  7774. 19: "https://i.imgur.com/sULkUZT.png"
  7775. };
  7776. function ve(a, b, c) {
  7777. if (true) {
  7778. if (ue[a] && b == "acc") {
  7779. return ue[a];
  7780. } else if (b == "acc") {
  7781. return ".././img/accessories/access_" + a + ".png";
  7782. } else if (b == "hat") {
  7783. return ".././img/hats/hat_" + a + ".png";
  7784. } else {
  7785. return ".././img/weapons/" + a + ".png";
  7786. }
  7787. } else if (b == "acc") {
  7788. return ".././img/accessories/access_" + a + ".png";
  7789. } else if (b == "hat") {
  7790. return ".././img/hats/hat_" + a + ".png";
  7791. } else {
  7792. return ".././img/weapons/" + a + ".png";
  7793. }
  7794. }
  7795. function we(a, b, c) {
  7796. if (!(se = xe[a + (ze ? "lol" : 0)])) {
  7797. var d = new Image();
  7798. d.onload = function () {
  7799. this.isLoaded = true;
  7800. this.onload = null;
  7801. };
  7802. d.src = ve(a, "acc");
  7803. xe[a + (ze ? "lol" : 0)] = d;
  7804. se = d;
  7805. }
  7806. var e = ye[a];
  7807. if (!e) {
  7808. for (var f = 0; f < ic.length; ++f) {
  7809. if (ic[f].id == a) {
  7810. e = ic[f];
  7811. break;
  7812. }
  7813. }
  7814. ye[a] = e;
  7815. }
  7816. if (se.isLoaded) {
  7817. b.save();
  7818. b.translate(-20 - (e.xOff || 0), 0);
  7819. if (e.spin) {
  7820. b.rotate(c.skinRot);
  7821. }
  7822. b.drawImage(se, -(e.scale / 2), -(e.scale / 2), e.scale, e.scale);
  7823. b.restore();
  7824. }
  7825. }
  7826. let xe = {};
  7827. let ye = {};
  7828. var ze = true;
  7829. function Ae(a, b, c) {
  7830. se = xe[a];
  7831. if (!se) {
  7832. let b = new Image();
  7833. b.onload = function () {
  7834. this.isLoaded = true;
  7835. this.onload = null;
  7836. };
  7837. b.src = "https://moomoo.io/img/accessories/access_" + a + ".png";
  7838. xe[a] = b;
  7839. se = b;
  7840. }
  7841. let d = ye[a];
  7842. if (!d) {
  7843. for (let b = 0; b < ic.length; ++b) {
  7844. if (ic[b].id == a) {
  7845. d = ic[b];
  7846. break;
  7847. }
  7848. }
  7849. ye[a] = d;
  7850. }
  7851. if (se.isLoaded) {
  7852. b.save();
  7853. b.translate(-20 - (d.xOff || 0), 0);
  7854. if (d.spin) {
  7855. b.rotate(c.skinRot);
  7856. }
  7857. b.drawImage(se, -(d.scale / 2), -(d.scale / 2), d.scale, d.scale);
  7858. b.restore();
  7859. }
  7860. }
  7861. var Be = {};
  7862. var Ce = {};
  7863. function De(a, b, c) {
  7864. se = Be[a];
  7865. if (!se) {
  7866. var d = new Image();
  7867. d.onload = function () {
  7868. this.isLoaded = true;
  7869. this.onload = null;
  7870. };
  7871. d.src = "https://moomoo.io/img/accessories/access_" + a + ".png";
  7872. Be[a] = d;
  7873. se = d;
  7874. }
  7875. var e = Ce[a];
  7876. if (!e) {
  7877. for (var f = 0; f < ic.length; ++f) {
  7878. if (ic[f].id == a) {
  7879. e = ic[f];
  7880. break;
  7881. }
  7882. }
  7883. Ce[a] = e;
  7884. }
  7885. if (se.isLoaded) {
  7886. b.save();
  7887. b.translate(-20 - (e.xOff || 0), 0);
  7888. if (e.spin) {
  7889. b.rotate(c.skinRot);
  7890. }
  7891. b.drawImage(se, -(e.scale / 2), -(e.scale / 2), e.scale, e.scale);
  7892. b.restore();
  7893. }
  7894. }
  7895. let Ee = {};
  7896. function Fe(a, b, c, d, e) {
  7897. let f = a.src + (b || "");
  7898. let g = Ee[f];
  7899. if (!g) {
  7900. g = new Image();
  7901. g.onload = function () {
  7902. this.isLoaded = true;
  7903. };
  7904. g.src = "https://moomoo.io/img/weapons/" + f + ".png";
  7905. Ee[f] = g;
  7906. }
  7907. if (g.isLoaded) {
  7908. e.drawImage(g, c + a.xOff - a.length / 2, d + a.yOff - a.width / 2, a.length, a.width);
  7909. }
  7910. }
  7911. function Ge(a, b, c) {
  7912. for (let d = 0; d < ga.length; d++) {
  7913. la = ga[d];
  7914. if (la.active && la.layer == a && la.inWindow) {
  7915. la.update(Va);
  7916. if (la.active && Ue(la.x - b, la.y - c, la.scale)) {
  7917. Ba.save();
  7918. Ba.translate(la.x - b, la.y - c);
  7919. Ba.rotate(la.dir);
  7920. Ie(0, 0, la, Ba, 1);
  7921. Ba.restore();
  7922. }
  7923. }
  7924. }
  7925. ;
  7926. }
  7927. let He = {};
  7928. function Ie(a, b, c, d, e) {
  7929. if (c.src) {
  7930. let e = ec.projectiles[c.indx].src;
  7931. let f = He[e];
  7932. if (!f) {
  7933. f = new Image();
  7934. f.onload = function () {
  7935. this.isLoaded = true;
  7936. };
  7937. f.src = "https://moomoo.io/img/weapons/" + e + ".png";
  7938. He[e] = f;
  7939. }
  7940. if (f.isLoaded) {
  7941. d.drawImage(f, a - c.scale / 2, b - c.scale / 2, c.scale, c.scale);
  7942. }
  7943. } else if (c.indx == 1) {
  7944. d.fillStyle = "#939393";
  7945. Xd(a, b, c.scale, d);
  7946. }
  7947. }
  7948. let Je = {};
  7949. function Ke(a, b) {
  7950. let c = a.index;
  7951. let d = Je[c];
  7952. if (!d) {
  7953. let b = new Image();
  7954. b.onload = function () {
  7955. this.isLoaded = true;
  7956. this.onload = null;
  7957. };
  7958. b.src = "https://moomoo.io/img/animals/" + a.src + ".png";
  7959. d = b;
  7960. Je[c] = d;
  7961. }
  7962. if (d.isLoaded) {
  7963. let c = a.scale * 1.2 * (a.spriteMlt || 1);
  7964. b.drawImage(d, -c, -c, c * 2, c * 2);
  7965. }
  7966. }
  7967. function Le(a, b, c, d) {
  7968. let e = f.riverWidth + d;
  7969. let g = f.mapScale / 2 - b - e / 2;
  7970. if (g < Ta && g + e > 0) {
  7971. c.fillRect(0, g, Sa, e);
  7972. }
  7973. }
  7974. let Me = {};
  7975. function Ne(a) {
  7976. let b = a.y >= f.mapScale - f.snowBiomeTop ? 2 : a.y <= f.snowBiomeTop ? 1 : 0;
  7977. let c = a.type + "_" + a.scale + "_" + b;
  7978. let d = Me[c];
  7979. if (!d) {
  7980. let e = 6;
  7981. let f = document.createElement("canvas");
  7982. f.width = f.height = a.scale * 2.1 + gb;
  7983. let g = f.getContext("2d");
  7984. g.translate(f.width / 2, f.height / 2);
  7985. g.rotate(dc.randFloat(0, Math.PI));
  7986. g.strokeStyle = eb;
  7987. g.lineWidth = gb;
  7988. if (a.type == 0) {
  7989. let c;
  7990. let d = 8;
  7991. g.globalAlpha = ef(a, ja) <= 250 ? 0.6 : 1;
  7992. for (let a = 0; a < 2; ++a) {
  7993. c = la.scale * (!a ? 1 : 0.5);
  7994. Zd(g, d, c, c * 0.7);
  7995. g.fillStyle = !b ? !a ? "#9ebf57" : "#b4db62" : !a ? "#e3f1f4" : "#fff";
  7996. g.fill();
  7997. if (!a) {
  7998. g.stroke();
  7999. g.shadowBlur = null;
  8000. g.shadowColor = null;
  8001. g.globalAlpha = 1;
  8002. }
  8003. }
  8004. } else if (a.type == 1) {
  8005. if (b == 2) {
  8006. g.fillStyle = "#606060";
  8007. Zd(g, 6, a.scale * 0.3, a.scale * 0.71);
  8008. g.fill();
  8009. g.stroke();
  8010. g.fillStyle = "#89a54c";
  8011. Xd(0, 0, a.scale * 0.55, g);
  8012. g.fillStyle = "#a5c65b";
  8013. Xd(0, 0, a.scale * 0.3, g, true);
  8014. } else {
  8015. ce(g, 6, la.scale, la.scale * 0.7);
  8016. g.fillStyle = b ? "#e3f1f4" : "#89a54c";
  8017. g.fill();
  8018. g.stroke();
  8019. g.fillStyle = b ? "#6a64af" : "#c15555";
  8020. let a;
  8021. let c = 4;
  8022. let d = Math.PI * 2 / c;
  8023. for (let b = 0; b < c; ++b) {
  8024. a = dc.randInt(la.scale / 3.5, la.scale / 2.3);
  8025. Xd(a * Math.cos(d * b), a * Math.sin(d * b), dc.randInt(10, 12), g);
  8026. }
  8027. }
  8028. } else if (a.type == 2 || a.type == 3) {
  8029. g.fillStyle = a.type == 2 ? b == 2 ? "#938d77" : "#939393" : "#e0c655";
  8030. Zd(g, 3, a.scale, a.scale);
  8031. g.fill();
  8032. g.stroke();
  8033. g.shadowBlur = null;
  8034. g.shadowColor = null;
  8035. g.fillStyle = a.type == 2 ? b == 2 ? "#b2ab90" : "#bcbcbc" : "#ebdca3";
  8036. Zd(g, 3, a.scale * 0.55, a.scale * 0.65);
  8037. g.fill();
  8038. }
  8039. d = f;
  8040. Me[c] = d;
  8041. }
  8042. return d;
  8043. }
  8044. let Oe = [];
  8045. function Pe(a, b) {
  8046. let c = Oe[a.id];
  8047. if (!c || b) {
  8048. let d = !b ? 20 : 5;
  8049. let e = document.createElement("canvas");
  8050. let f = !b && a.name == "windmill" ? ec.list[4].scale : a.scale;
  8051. e.width = e.height = f * 2.5 + gb + (ec.list[a.id].spritePadding || 0) + d;
  8052. let g = e.getContext("2d");
  8053. g.translate(e.width / 2, e.height / 2);
  8054. g.rotate(b ? 0 : Math.PI / 2);
  8055. g.strokeStyle = eb;
  8056. g.lineWidth = gb * (b ? e.width / 81 : 1);
  8057. if (!b) {
  8058. g.shadowBlur = 8;
  8059. g.shadowColor = "rgba(0, 0, 0, 0.2)";
  8060. }
  8061. if (a.name == "apple") {
  8062. g.fillStyle = "#c15555";
  8063. Xd(0, 0, a.scale, g);
  8064. g.fillStyle = "#89a54c";
  8065. let b = -(Math.PI / 2);
  8066. Wd(a.scale * Math.cos(b), a.scale * Math.sin(b), 25, b + Math.PI / 2, g);
  8067. } else if (a.name == "cookie") {
  8068. g.fillStyle = "#cca861";
  8069. Xd(0, 0, a.scale, g);
  8070. g.fillStyle = "#937c4b";
  8071. let b = 4;
  8072. let c = Math.PI * 2 / b;
  8073. let d;
  8074. for (let e = 0; e < b; ++e) {
  8075. d = dc.randInt(a.scale / 2.5, a.scale / 1.7);
  8076. Xd(d * Math.cos(c * e), d * Math.sin(c * e), dc.randInt(4, 5), g, true);
  8077. }
  8078. } else if (a.name == "cheese") {
  8079. g.fillStyle = "#f4f3ac";
  8080. Xd(0, 0, a.scale, g);
  8081. g.fillStyle = "#c3c28b";
  8082. let b = 4;
  8083. let c = Math.PI * 2 / b;
  8084. let d;
  8085. for (let e = 0; e < b; ++e) {
  8086. d = dc.randInt(a.scale / 2.5, a.scale / 1.7);
  8087. Xd(d * Math.cos(c * e), d * Math.sin(c * e), dc.randInt(4, 5), g, true);
  8088. }
  8089. } else if (a.name == "wood wall" || a.name == "stone wall" || a.name == "castle wall") {
  8090. g.fillStyle = a.name == "castle wall" ? "#83898e" : a.name == "wood wall" ? "#a5974c" : "#939393";
  8091. let b = a.name == "castle wall" ? 4 : 3;
  8092. Zd(g, b, a.scale * 1.1, a.scale * 1.1);
  8093. g.fill();
  8094. g.stroke();
  8095. g.fillStyle = a.name == "castle wall" ? "#9da4aa" : a.name == "wood wall" ? "#c9b758" : "#bcbcbc";
  8096. Zd(g, b, a.scale * 0.65, a.scale * 0.65);
  8097. g.fill();
  8098. } else if (a.name == "spikes" || a.name == "greater spikes" || a.name == "poison spikes" || a.name == "spinning spikes") {
  8099. g.fillStyle = a.name == "poison spikes" ? "#7b935d" : "#939393";
  8100. let b = a.scale * 0.6;
  8101. Zd(g, a.name == "spikes" ? 5 : 6, a.scale, b);
  8102. g.fill();
  8103. g.stroke();
  8104. g.fillStyle = "#a5974c";
  8105. Xd(0, 0, b, g);
  8106. g.fillStyle = "#c9b758";
  8107. Xd(0, 0, b / 2, g, true);
  8108. } else if (a.name == "windmill" || a.name == "faster windmill" || a.name == "power mill") {
  8109. g.fillStyle = "#a5974c";
  8110. Xd(0, 0, f, g);
  8111. g.fillStyle = "#c9b758";
  8112. be(0, 0, f * 1.5, 29, 4, g);
  8113. g.fillStyle = "#a5974c";
  8114. Xd(0, 0, f * 0.5, g);
  8115. } else if (a.name == "mine") {
  8116. g.fillStyle = "#939393";
  8117. Zd(g, 3, a.scale, a.scale);
  8118. g.fill();
  8119. g.stroke();
  8120. g.fillStyle = "#bcbcbc";
  8121. Zd(g, 3, a.scale * 0.55, a.scale * 0.65);
  8122. g.fill();
  8123. } else if (a.name == "sapling") {
  8124. for (let b = 0; b < 2; ++b) {
  8125. let c = a.scale * (!b ? 1 : 0.5);
  8126. Zd(g, 7, c, c * 0.7);
  8127. g.fillStyle = !b ? "#9ebf57" : "#b4db62";
  8128. g.fill();
  8129. if (!b) {
  8130. g.stroke();
  8131. }
  8132. }
  8133. } else if (a.name == "pit trap") {
  8134. g.fillStyle = "#a5974c";
  8135. Zd(g, 3, a.scale * 1.1, a.scale * 1.1);
  8136. g.fill();
  8137. g.stroke();
  8138. g.fillStyle = eb;
  8139. Zd(g, 3, a.scale * 0.65, a.scale * 0.65);
  8140. g.fill();
  8141. } else if (a.name == "boost pad") {
  8142. g.fillStyle = "#7e7f82";
  8143. _d(0, 0, a.scale * 2, a.scale * 2, g);
  8144. g.fill();
  8145. g.stroke();
  8146. g.fillStyle = "#dbd97d";
  8147. de(a.scale * 1, g);
  8148. } else if (a.name == "turret") {
  8149. g.fillStyle = "#a5974c";
  8150. Xd(0, 0, a.scale, g);
  8151. g.fill();
  8152. g.stroke();
  8153. g.fillStyle = "#939393";
  8154. let b = 50;
  8155. _d(0, -b / 2, a.scale * 0.9, b, g);
  8156. Xd(0, 0, a.scale * 0.6, g);
  8157. g.fill();
  8158. g.stroke();
  8159. } else if (a.name == "platform") {
  8160. g.fillStyle = "#cebd5f";
  8161. let b = 4;
  8162. let c = a.scale * 2;
  8163. let d = c / b;
  8164. let e = -(a.scale / 2);
  8165. for (let f = 0; f < b; ++f) {
  8166. _d(e - d / 2, 0, d, a.scale * 2, g);
  8167. g.fill();
  8168. g.stroke();
  8169. e += c / b;
  8170. }
  8171. } else if (a.name == "healing pad") {
  8172. g.fillStyle = "#7e7f82";
  8173. _d(0, 0, a.scale * 2, a.scale * 2, g);
  8174. g.fill();
  8175. g.stroke();
  8176. g.fillStyle = "#db6e6e";
  8177. be(0, 0, a.scale * 0.65, 20, 4, g, true);
  8178. } else if (a.name == "spawn pad") {
  8179. g.fillStyle = "#7e7f82";
  8180. _d(0, 0, a.scale * 2, a.scale * 2, g);
  8181. g.fill();
  8182. g.stroke();
  8183. g.fillStyle = "#71aad6";
  8184. Xd(0, 0, a.scale * 0.6, g);
  8185. } else if (a.name == "blocker") {
  8186. g.fillStyle = "#7e7f82";
  8187. Xd(0, 0, a.scale, g);
  8188. g.fill();
  8189. g.stroke();
  8190. g.rotate(Math.PI / 4);
  8191. g.fillStyle = "#db6e6e";
  8192. be(0, 0, a.scale * 0.65, 20, 4, g, true);
  8193. } else if (a.name == "teleporter") {
  8194. g.fillStyle = "#7e7f82";
  8195. Xd(0, 0, a.scale, g);
  8196. g.fill();
  8197. g.stroke();
  8198. g.rotate(Math.PI / 4);
  8199. g.fillStyle = "#d76edb";
  8200. Xd(0, 0, a.scale * 0.5, g, true);
  8201. }
  8202. c = e;
  8203. if (!b) {
  8204. Oe[a.id] = c;
  8205. }
  8206. }
  8207. return c;
  8208. }
  8209. function Qe(a, b, c) {
  8210. let d = Ba;
  8211. let e = a.name == "windmill" ? ec.list[4].scale : a.scale;
  8212. d.save();
  8213. d.translate(b, c);
  8214. d.rotate(a.dir);
  8215. d.strokeStyle = eb;
  8216. d.lineWidth = gb;
  8217. if (a.name == "apple") {
  8218. d.fillStyle = "#c15555";
  8219. Xd(0, 0, a.scale, d);
  8220. d.fillStyle = "#89a54c";
  8221. let b = -(Math.PI / 2);
  8222. Wd(a.scale * Math.cos(b), a.scale * Math.sin(b), 25, b + Math.PI / 2, d);
  8223. } else if (a.name == "cookie") {
  8224. d.fillStyle = "#cca861";
  8225. Xd(0, 0, a.scale, d);
  8226. d.fillStyle = "#937c4b";
  8227. let b = 4;
  8228. let c = Math.PI * 2 / b;
  8229. let e;
  8230. for (let f = 0; f < b; ++f) {
  8231. e = dc.randInt(a.scale / 2.5, a.scale / 1.7);
  8232. Xd(e * Math.cos(c * f), e * Math.sin(c * f), dc.randInt(4, 5), d, true);
  8233. }
  8234. } else if (a.name == "cheese") {
  8235. d.fillStyle = "#f4f3ac";
  8236. Xd(0, 0, a.scale, d);
  8237. d.fillStyle = "#c3c28b";
  8238. let b = 4;
  8239. let c = Math.PI * 2 / b;
  8240. let e;
  8241. for (let f = 0; f < b; ++f) {
  8242. e = dc.randInt(a.scale / 2.5, a.scale / 1.7);
  8243. Xd(e * Math.cos(c * f), e * Math.sin(c * f), dc.randInt(4, 5), d, true);
  8244. }
  8245. } else if (a.name == "wood wall" || a.name == "stone wall" || a.name == "castle wall") {
  8246. d.fillStyle = a.name == "castle wall" ? "#83898e" : a.name == "wood wall" ? "#a5974c" : "#939393";
  8247. let b = a.name == "castle wall" ? 4 : 3;
  8248. Zd(d, b, a.scale * 1.1, a.scale * 1.1);
  8249. d.fill();
  8250. d.stroke();
  8251. d.fillStyle = a.name == "castle wall" ? "#9da4aa" : a.name == "wood wall" ? "#c9b758" : "#bcbcbc";
  8252. Zd(d, b, a.scale * 0.65, a.scale * 0.65);
  8253. d.fill();
  8254. } else if (a.name == "spikes" || a.name == "greater spikes" || a.name == "poison spikes" || a.name == "spinning spikes") {
  8255. d.fillStyle = a.name == "poison spikes" ? "#7b935d" : "#939393";
  8256. let b = a.scale * 0.6;
  8257. Zd(d, a.name == "spikes" ? 5 : 6, a.scale, b);
  8258. d.fill();
  8259. d.stroke();
  8260. d.fillStyle = "#a5974c";
  8261. Xd(0, 0, b, d);
  8262. d.fillStyle = "#c9b758";
  8263. Xd(0, 0, b / 2, d, true);
  8264. } else if (a.name == "windmill" || a.name == "faster windmill" || a.name == "power mill") {
  8265. d.fillStyle = "#a5974c";
  8266. Xd(0, 0, e, d);
  8267. d.fillStyle = "#c9b758";
  8268. be(0, 0, e * 1.5, 29, 4, d);
  8269. d.fillStyle = "#a5974c";
  8270. Xd(0, 0, e * 0.5, d);
  8271. } else if (a.name == "mine") {
  8272. d.fillStyle = "#939393";
  8273. Zd(d, 3, a.scale, a.scale);
  8274. d.fill();
  8275. d.stroke();
  8276. d.fillStyle = "#bcbcbc";
  8277. Zd(d, 3, a.scale * 0.55, a.scale * 0.65);
  8278. d.fill();
  8279. } else if (a.name == "sapling") {
  8280. for (let b = 0; b < 2; ++b) {
  8281. let c = a.scale * (!b ? 1 : 0.5);
  8282. Zd(d, 7, c, c * 0.7);
  8283. d.fillStyle = !b ? "#9ebf57" : "#b4db62";
  8284. d.fill();
  8285. if (!b) {
  8286. d.stroke();
  8287. }
  8288. }
  8289. } else if (a.name == "pit trap") {
  8290. d.fillStyle = "#a5974c";
  8291. Zd(d, 3, a.scale * 1.1, a.scale * 1.1);
  8292. d.fill();
  8293. d.stroke();
  8294. d.fillStyle = eb;
  8295. Zd(d, 3, a.scale * 0.65, a.scale * 0.65);
  8296. d.fill();
  8297. } else if (a.name == "boost pad") {
  8298. d.fillStyle = "#7e7f82";
  8299. _d(0, 0, a.scale * 2, a.scale * 2, d);
  8300. d.fill();
  8301. d.stroke();
  8302. d.fillStyle = "#dbd97d";
  8303. de(a.scale * 1, d);
  8304. } else if (a.name == "turret") {
  8305. d.fillStyle = "#a5974c";
  8306. Xd(0, 0, a.scale, d);
  8307. d.fill();
  8308. d.stroke();
  8309. d.fillStyle = "#939393";
  8310. let b = 50;
  8311. _d(0, -b / 2, a.scale * 0.9, b, d);
  8312. Xd(0, 0, a.scale * 0.6, d);
  8313. d.fill();
  8314. d.stroke();
  8315. } else if (a.name == "platform") {
  8316. d.fillStyle = "#cebd5f";
  8317. let b = 4;
  8318. let c = a.scale * 2;
  8319. let e = c / b;
  8320. let f = -(a.scale / 2);
  8321. for (let g = 0; g < b; ++g) {
  8322. _d(f - e / 2, 0, e, a.scale * 2, d);
  8323. d.fill();
  8324. d.stroke();
  8325. f += c / b;
  8326. }
  8327. } else if (a.name == "healing pad") {
  8328. d.fillStyle = "#7e7f82";
  8329. _d(0, 0, a.scale * 2, a.scale * 2, d);
  8330. d.fill();
  8331. d.stroke();
  8332. d.fillStyle = "#db6e6e";
  8333. be(0, 0, a.scale * 0.65, 20, 4, d, true);
  8334. } else if (a.name == "spawn pad") {
  8335. d.fillStyle = "#7e7f82";
  8336. _d(0, 0, a.scale * 2, a.scale * 2, d);
  8337. d.fill();
  8338. d.stroke();
  8339. d.fillStyle = "#71aad6";
  8340. Xd(0, 0, a.scale * 0.6, d);
  8341. } else if (a.name == "blocker") {
  8342. d.fillStyle = "#7e7f82";
  8343. Xd(0, 0, a.scale, d);
  8344. d.fill();
  8345. d.stroke();
  8346. d.rotate(Math.PI / 4);
  8347. d.fillStyle = "#db6e6e";
  8348. be(0, 0, a.scale * 0.65, 20, 4, d, true);
  8349. } else if (a.name == "teleporter") {
  8350. d.fillStyle = "#7e7f82";
  8351. Xd(0, 0, a.scale, d);
  8352. d.fill();
  8353. d.stroke();
  8354. d.rotate(Math.PI / 4);
  8355. d.fillStyle = "#d76edb";
  8356. Xd(0, 0, a.scale * 0.5, d, true);
  8357. }
  8358. d.restore();
  8359. }
  8360. let Re = [];
  8361. function Se(a) {
  8362. let b = Re[a.id];
  8363. if (!b) {
  8364. let c = document.createElement("canvas");
  8365. c.width = c.height = a.scale * 2.5 + gb + (ec.list[a.id].spritePadding || 0) + 0;
  8366. let d = c.getContext("2d");
  8367. d.translate(c.width / 2, c.height / 2);
  8368. d.rotate(Math.PI / 2);
  8369. d.strokeStyle = eb;
  8370. d.lineWidth = gb;
  8371. if (a.name == "spikes" || a.name == "greater spikes" || a.name == "poison spikes" || a.name == "spinning spikes") {
  8372. d.fillStyle = a.name == "poison spikes" ? "#7b935d" : "#939393";
  8373. let b = a.scale * 0.6;
  8374. Zd(d, a.name == "spikes" ? 5 : 6, a.scale, b);
  8375. d.fill();
  8376. d.stroke();
  8377. d.fillStyle = "#a5974c";
  8378. Xd(0, 0, b, d);
  8379. d.fillStyle = "#cc5151";
  8380. Xd(0, 0, b / 2, d, true);
  8381. } else if (a.name == "pit trap") {
  8382. d.fillStyle = "#a5974c";
  8383. Zd(d, 3, a.scale * 1.1, a.scale * 1.1);
  8384. d.fill();
  8385. d.stroke();
  8386. d.fillStyle = "#cc5151";
  8387. Zd(d, 3, a.scale * 0.65, a.scale * 0.65);
  8388. d.fill();
  8389. }
  8390. b = c;
  8391. Re[a.id] = b;
  8392. }
  8393. return b;
  8394. }
  8395. function Te(a, b, c, d) {
  8396. let e = {
  8397. x: Qa / 2,
  8398. y: Ra / 2
  8399. };
  8400. b.lineWidth = gb;
  8401. Ba.globalAlpha = 0.2;
  8402. b.strokeStyle = eb;
  8403. b.save();
  8404. b.translate(c, d);
  8405. b.rotate(90 ** 10);
  8406. if (a.name == "spikes" || a.name == "greater spikes" || a.name == "poison spikes" || a.name == "spinning spikes") {
  8407. b.fillStyle = a.name == "poison spikes" ? "#7b935d" : "#939393";
  8408. var f = a.scale;
  8409. Zd(b, a.name == "spikes" ? 5 : 6, a.scale, f);
  8410. b.fill();
  8411. b.stroke();
  8412. b.fillStyle = "#a5974c";
  8413. Xd(0, 0, f, b);
  8414. if (ja && a.owner && ja.sid != a.owner.sid && !la.findAllianceBySid(a.owner.sid)) {
  8415. b.fillStyle = "#a34040";
  8416. } else {
  8417. b.fillStyle = "#c9b758";
  8418. }
  8419. Xd(0, 0, f / 2, b, true);
  8420. } else if (a.name == "turret") {
  8421. Xd(0, 0, a.scale, b);
  8422. b.fill();
  8423. b.stroke();
  8424. b.fillStyle = "#939393";
  8425. let c = 50;
  8426. _d(0, -c / 2, a.scale * 0.9, c, b);
  8427. Xd(0, 0, a.scale * 0.6, b);
  8428. b.fill();
  8429. b.stroke();
  8430. } else if (a.name == "teleporter") {
  8431. b.fillStyle = "#7e7f82";
  8432. Xd(0, 0, a.scale, b);
  8433. b.fill();
  8434. b.stroke();
  8435. b.rotate(Math.PI / 4);
  8436. b.fillStyle = "#d76edb";
  8437. Xd(0, 0, a.scale * 0.5, b, true);
  8438. } else if (a.name == "platform") {
  8439. b.fillStyle = "#cebd5f";
  8440. let c = 4;
  8441. let d = a.scale * 2;
  8442. let e = d / c;
  8443. let f = -(a.scale / 2);
  8444. for (let g = 0; g < c; ++g) {
  8445. _d(f - e / 2, 0, e, a.scale * 2, b);
  8446. b.fill();
  8447. b.stroke();
  8448. f += d / c;
  8449. }
  8450. } else if (a.name == "healing pad") {
  8451. b.fillStyle = "#7e7f82";
  8452. _d(0, 0, a.scale * 2, a.scale * 2, b);
  8453. b.fill();
  8454. b.stroke();
  8455. b.fillStyle = "#db6e6e";
  8456. be(0, 0, a.scale * 0.65, 20, 4, b, true);
  8457. } else if (a.name == "spawn pad") {
  8458. b.fillStyle = "#7e7f82";
  8459. _d(0, 0, a.scale * 2, a.scale * 2, b);
  8460. b.fill();
  8461. b.stroke();
  8462. b.fillStyle = "#71aad6";
  8463. Xd(0, 0, a.scale * 0.6, b);
  8464. } else if (a.name == "blocker") {
  8465. b.fillStyle = "#7e7f82";
  8466. Xd(0, 0, a.scale, b);
  8467. b.fill();
  8468. b.stroke();
  8469. b.rotate(Math.PI / 4);
  8470. b.fillStyle = "#db6e6e";
  8471. be(0, 0, a.scale * 0.65, 20, 4, b, true);
  8472. } else if (a.name == "windmill" || a.name == "faster windmill" || a.name == "power mill") {
  8473. b.fillStyle = "#a5974c";
  8474. Xd(0, 0, a.scale, b);
  8475. b.fillStyle = "#c9b758";
  8476. be(0, 0, a.scale * 1.5, 29, 4, b);
  8477. b.fillStyle = "#a5974c";
  8478. Xd(0, 0, a.scale * 0.5, b);
  8479. } else if (a.name == "pit trap") {
  8480. b.fillStyle = "#a5974c";
  8481. Zd(b, 3, a.scale * 1.1, a.scale * 1.1);
  8482. b.fill();
  8483. b.stroke();
  8484. if (ja && a.owner && ja.sid != a.owner.sid && !la.findAllianceBySid(a.owner.sid)) {
  8485. b.fillStyle = "#a34040";
  8486. } else {
  8487. b.fillStyle = eb;
  8488. }
  8489. Zd(b, 3, a.scale * 0.65, a.scale * 0.65);
  8490. b.fill();
  8491. }
  8492. b.restore();
  8493. }
  8494. function Ue(a, b, c) {
  8495. return a + c >= 0 && a - c <= Sa && b + c >= 0 && (b, c, Ta);
  8496. }
  8497. function Ve(a, b, c) {
  8498. let d;
  8499. let e;
  8500. let g;
  8501. fa.forEach(h => {
  8502. la = h;
  8503. if (la.active && fa.includes(h) && la.render) {
  8504. e = la.x + la.xWiggle - b;
  8505. g = la.y + la.yWiggle - c;
  8506. if (a == 0) {
  8507. la.update(Va);
  8508. }
  8509. Ba.globalAlpha = la.alpha;
  8510. if (la.layer == a && Ue(e, g, la.scale + (la.blocker || 0))) {
  8511. if (la.isItem) {
  8512. if ((la.dmg || la.trap) && !la.isTeamObject(ja)) {
  8513. d = Se(la);
  8514. } else {
  8515. d = Pe(la);
  8516. }
  8517. Ba.save();
  8518. Ba.translate(e, g);
  8519. Ba.rotate(la.dir);
  8520. if (!la.active) {
  8521. Ba.scale(la.visScale / la.scale, la.visScale / la.scale);
  8522. }
  8523. Ba.drawImage(d, -(d.width / 2), -(d.height / 2));
  8524. if (la.blocker) {
  8525. Ba.strokeStyle = "#db6e6e";
  8526. Ba.globalAlpha = 0.3;
  8527. Ba.lineWidth = 6;
  8528. Xd(0, 0, la.blocker, Ba, false, true);
  8529. }
  8530. Ba.restore();
  8531. } else {
  8532. d = Ne(la);
  8533. Ba.drawImage(d, e - d.width / 2, g - d.height / 2);
  8534. }
  8535. }
  8536. if (a == 3 && !K) {
  8537. if (la.health < la.maxHealth) {
  8538. Ba.fillStyle = fb;
  8539. Ba.roundRect(e - f.healthBarWidth / 2 - f.healthBarPad, g - f.healthBarPad, f.healthBarWidth + f.healthBarPad * 2, 17, 8);
  8540. Ba.fill();
  8541. Ba.fillStyle = la.isTeamObject(ja) ? "#8ecc51" : "#cc5151";
  8542. Ba.roundRect(e - f.healthBarWidth / 2, g, f.healthBarWidth * (la.health / la.maxHealth), 17 - f.healthBarPad * 2, 7);
  8543. Ba.fill();
  8544. }
  8545. }
  8546. }
  8547. });
  8548. if (a == 0) {
  8549. if (tb.length) {
  8550. tb.forEach(a => {
  8551. e = a.x - b;
  8552. g = a.y - c;
  8553. We(a, e, g);
  8554. });
  8555. }
  8556. }
  8557. }
  8558. function We(a, b, c) {
  8559. Te(a, Ba, b, c);
  8560. }
  8561. class Xe {
  8562. constructor(a, b) {
  8563. this.init = function (a, b) {
  8564. this.scale = 0;
  8565. this.x = a;
  8566. this.y = b;
  8567. this.active = true;
  8568. };
  8569. this.update = function (a, c) {
  8570. if (this.active) {
  8571. this.scale += c * 0.05;
  8572. if (this.scale >= b) {
  8573. this.active = false;
  8574. } else {
  8575. a.globalAlpha = 1 - Math.max(0, this.scale / b);
  8576. a.beginPath();
  8577. a.arc(this.x / f.mapScale * Ca.width, this.y / f.mapScale * Ca.width, this.scale, 0, Math.PI * 2);
  8578. a.stroke();
  8579. }
  8580. }
  8581. };
  8582. this.color = a;
  8583. }
  8584. }
  8585. function Ye(a, b) {
  8586. uc = tc.find(a => !a.active);
  8587. if (!uc) {
  8588. uc = new Xe("#fff", f.mapPingScale);
  8589. tc.push(uc);
  8590. }
  8591. uc.init(a, b);
  8592. }
  8593. function Ze() {
  8594. sc.x = ja.x;
  8595. sc.y = ja.y;
  8596. }
  8597. function $e(a) {
  8598. if (ja && ja.alive) {
  8599. Da.clearRect(0, 0, Ca.width, Ca.height);
  8600. Da.lineWidth = 4;
  8601. for (let b = 0; b < tc.length; ++b) {
  8602. uc = tc[b];
  8603. Da.strokeStyle = uc.color;
  8604. uc.update(Da, a);
  8605. }
  8606. Da.globalAlpha = 1;
  8607. Da.fillStyle = "#ff0000";
  8608. if (vc.length) {
  8609. Da.fillStyle = "#abcdef";
  8610. Da.font = "34px Hammersmith One";
  8611. Da.textBaseline = "middle";
  8612. Da.textAlign = "center";
  8613. for (let a = 0; a < vc.length;) {
  8614. Da.fillText("!", vc[a].x / f.mapScale * Ca.width, vc[a].y / f.mapScale * Ca.height);
  8615. a += 2;
  8616. }
  8617. }
  8618. Da.globalAlpha = 1;
  8619. Da.fillStyle = "#fff";
  8620. Xd(ja.x / f.mapScale * Ca.width, ja.y / f.mapScale * Ca.height, 7, Da, true);
  8621. Da.fillStyle = "rgba(255,255,255,0.35)";
  8622. if (ja.team && rc) {
  8623. for (let a = 0; a < rc.length;) {
  8624. Xd(rc[a] / f.mapScale * Ca.width, rc[a + 1] / f.mapScale * Ca.height, 7, Da, true);
  8625. a += 2;
  8626. }
  8627. }
  8628. if (Pd.length) {
  8629. Pd.forEach(a => {
  8630. if (a.inGame) {
  8631. Da.globalAlpha = 1;
  8632. Da.strokeStyle = "#cc5151";
  8633. Xd(a.x2 / f.mapScale * Ca.width, a.y2 / f.mapScale * Ca.height, 7, Da, false, true);
  8634. }
  8635. });
  8636. }
  8637. if (qc) {
  8638. Da.fillStyle = "#fc5553";
  8639. Da.font = "34px Hammersmith One";
  8640. Da.textBaseline = "middle";
  8641. Da.textAlign = "center";
  8642. Da.fillText("x", qc.x / f.mapScale * Ca.width, qc.y / f.mapScale * Ca.height);
  8643. }
  8644. if (sc) {
  8645. Da.fillStyle = "#fff";
  8646. Da.font = "34px Hammersmith One";
  8647. Da.textBaseline = "middle";
  8648. Da.textAlign = "center";
  8649. Da.fillText("x", sc.x / f.mapScale * Ca.width, sc.y / f.mapScale * Ca.height);
  8650. }
  8651. }
  8652. }
  8653. let _e = ["https://cdn.discordapp.com/attachments/1001384433078779927/1149285738412769300/newawwddd.png", "https://cdn.discordapp.com/attachments/1001384433078779927/1149285168780165170/100px-Crosshairs_Red.png"];
  8654. let af = {};
  8655. let bf = {};
  8656. let cf = ["crown", "skull"];
  8657. function df() {
  8658. for (let a = 0; a < cf.length; ++a) {
  8659. let b = new Image();
  8660. b.onload = function () {
  8661. this.isLoaded = true;
  8662. };
  8663. b.src = "./../img/icons/" + cf[a] + ".png";
  8664. bf[cf[a]] = b;
  8665. }
  8666. for (let a = 0; a < _e.length; ++a) {
  8667. let b = new Image();
  8668. b.onload = function () {
  8669. this.isLoaded = true;
  8670. };
  8671. b.src = _e[a];
  8672. af[a] = b;
  8673. }
  8674. }
  8675. df();
  8676. function ef(a, b) {
  8677. try {
  8678. return Math.hypot((b.y2 || b.y) - (a.y2 || a.y), (b.x2 || b.x) - (a.x2 || a.x));
  8679. } catch (a) {
  8680. return Infinity;
  8681. }
  8682. }
  8683. function ff() {
  8684. if (ea.length && lb) {
  8685. ea.forEach(a => {
  8686. if (dc.getDistance(a.x, a.y, ja.x, ja.y) <= 1200) {
  8687. if (!fa.includes(a)) {
  8688. fa.push(a);
  8689. a.render = true;
  8690. }
  8691. } else if (fa.includes(a)) {
  8692. if (dc.getDistance(a.x, a.y, ja.x, ja.y) >= 1200) {
  8693. a.render = false;
  8694. const b = fa.indexOf(a);
  8695. if (b > -1) {
  8696. fa.splice(b, 1);
  8697. }
  8698. }
  8699. } else if (dc.getDistance(a.x, a.y, ja.x, ja.y) >= 1200) {
  8700. a.render = false;
  8701. const b = fa.indexOf(a);
  8702. if (b > -1) {
  8703. fa.splice(b, 1);
  8704. }
  8705. } else {
  8706. a.render = false;
  8707. const b = fa.indexOf(a);
  8708. if (b > -1) {
  8709. fa.splice(b, 1);
  8710. }
  8711. }
  8712. });
  8713. }
  8714. Ba.beginPath();
  8715. Ba.clearRect(0, 0, Aa.width, Aa.height);
  8716. Ba.globalAlpha = 1;
  8717. if (ja) {
  8718. if (false) {
  8719. Ya = ja.x;
  8720. Za = ja.y;
  8721. } else {
  8722. let a = dc.getDistance(Ya, Za, ja.x, ja.y);
  8723. let b = dc.getDirection(ja.x, ja.y, Ya, Za);
  8724. let c = Math.min(a * 0.0045 * Va, a);
  8725. if (a > 0.05) {
  8726. Ya += c * Math.cos(b);
  8727. Za += c * Math.sin(b);
  8728. } else {
  8729. Ya = ja.x;
  8730. Za = ja.y;
  8731. }
  8732. }
  8733. } else {
  8734. Ya = f.mapScale / 2 + f.riverWidth;
  8735. Za = f.mapScale / 2;
  8736. }
  8737. let a = Wa - 1000 / f.serverUpdateRate;
  8738. let b;
  8739. for (let c = 0; c < ba.length + aa.length; ++c) {
  8740. la = ba[c] || aa[c - ba.length];
  8741. if (la && la.visible) {
  8742. if (la.forcePos) {
  8743. la.x = la.x2;
  8744. la.y = la.y2;
  8745. la.dir = la.d2;
  8746. } else {
  8747. let c = la.t2 - la.t1;
  8748. let d = a - la.t1;
  8749. let e = d / c;
  8750. let g = 170;
  8751. la.dt += Va;
  8752. let h = Math.min(1.7, la.dt / g);
  8753. b = la.x2 - la.x1;
  8754. la.x = la.x1 + b * h;
  8755. b = la.y2 - la.y1;
  8756. la.y = la.y1 + b * h;
  8757. if (f.anotherVisual) {
  8758. la.dir = Math.lerpAngle(la.d2, la.d1, Math.min(1.2, e));
  8759. } else {
  8760. la.dir = Math.lerpAngle(la.d2, la.d1, Math.min(1.2, e));
  8761. }
  8762. }
  8763. }
  8764. }
  8765. let d = Ya - Sa / 2;
  8766. let e = Za - Ta / 2;
  8767. if (f.snowBiomeTop - e <= 0 && f.mapScale - f.snowBiomeTop - e >= Ta) {
  8768. Ba.fillStyle = "#b6db66";
  8769. Ba.fillRect(0, 0, Sa, Ta);
  8770. } else if (f.mapScale - f.snowBiomeTop - e <= 0) {
  8771. Ba.fillStyle = "#dbc666";
  8772. Ba.fillRect(0, 0, Sa, Ta);
  8773. } else if (f.snowBiomeTop - e >= Ta) {
  8774. Ba.fillStyle = "#fff";
  8775. Ba.fillRect(0, 0, Sa, Ta);
  8776. } else if (f.snowBiomeTop - e >= 0) {
  8777. Ba.fillStyle = "#fff";
  8778. Ba.fillRect(0, 0, Sa, f.snowBiomeTop - e);
  8779. Ba.fillStyle = "#b6db66";
  8780. Ba.fillRect(0, f.snowBiomeTop - e, Sa, Ta - (f.snowBiomeTop - e));
  8781. } else {
  8782. Ba.fillStyle = "#b6db66";
  8783. Ba.fillRect(0, 0, Sa, f.mapScale - f.snowBiomeTop - e);
  8784. Ba.fillStyle = "#dbc666";
  8785. Ba.fillRect(0, f.mapScale - f.snowBiomeTop - e, Sa, Ta - (f.mapScale - f.snowBiomeTop - e));
  8786. }
  8787. if (!hb) {
  8788. cb += db * f.waveSpeed * Va;
  8789. if (cb >= f.waveMax) {
  8790. cb = f.waveMax;
  8791. db = -1;
  8792. } else if (cb <= 1) {
  8793. cb = db = 1;
  8794. }
  8795. Ba.globalAlpha = 1;
  8796. Ba.fillStyle = "#dbc666";
  8797. Le(d, e, Ba, f.riverPadding);
  8798. Ba.fillStyle = "#91b2db";
  8799. Le(d, e, Ba, (cb - 1) * 250);
  8800. }
  8801. Ba.globalAlpha = 1;
  8802. Ba.strokeStyle = eb;
  8803. ge(d, e);
  8804. Ba.globalAlpha = 1;
  8805. Ba.strokeStyle = eb;
  8806. Ve(-1, d, e);
  8807. Ba.globalAlpha = 1;
  8808. Ba.lineWidth = gb;
  8809. Ge(0, d, e);
  8810. he(d, e, 0);
  8811. Ba.globalAlpha = 1;
  8812. for (let a = 0; a < aa.length; ++a) {
  8813. la = aa[a];
  8814. if (la.active && la.visible) {
  8815. la.animate(Va);
  8816. Ba.save();
  8817. Ba.translate(la.x - d, la.y - e);
  8818. Ba.rotate(la.dir + la.dirPlus - Math.PI / 2);
  8819. Ke(la, Ba);
  8820. Ba.restore();
  8821. }
  8822. }
  8823. Ve(0, d, e);
  8824. Ge(1, d, e);
  8825. Ve(1, d, e);
  8826. he(d, e, 1);
  8827. Ve(2, d, e);
  8828. Ve(3, d, e);
  8829. Ba.fillStyle = "#000";
  8830. Ba.globalAlpha = 0.09;
  8831. if (d <= 0) {
  8832. Ba.fillRect(0, 0, -d, Ta);
  8833. }
  8834. if (f.mapScale - d <= Sa) {
  8835. let a = Math.max(0, -e);
  8836. Ba.fillRect(f.mapScale - d, a, Sa - (f.mapScale - d), Ta - a);
  8837. }
  8838. if (e <= 0) {
  8839. Ba.fillRect(-d, 0, Sa + d, -e);
  8840. }
  8841. if (f.mapScale - e <= Ta) {
  8842. let a = Math.max(0, -d);
  8843. let b = 0;
  8844. if (f.mapScale - d <= Sa) {
  8845. b = Sa - (f.mapScale - d);
  8846. }
  8847. Ba.fillRect(a, f.mapScale - e, Sa - a - b, Ta - (f.mapScale - e));
  8848. }
  8849. Ba.globalAlpha = 1;
  8850. Ba.fillStyle = "rgba(0, 5, 80, 0.55)";
  8851. Ba.fillRect(0, 0, Sa, Ta);
  8852. Ba.strokeStyle = fb;
  8853. Ba.globalAlpha = 1;
  8854. for (let a = 0; a < ba.length + aa.length; ++a) {
  8855. la = ba[a] || aa[a - ba.length];
  8856. if (la.visible && la.showName === "NOOO") {
  8857. Ba.strokeStyle = fb;
  8858. let a = (la.team ? "[" + la.team + "] " : "") + (la.name || "");
  8859. if (a != "" && la.name != "Yurio Slaves") {
  8860. Ba.font = (la.nameScale || 30) + "px Hammersmith One";
  8861. Ba.fillStyle = "#fff";
  8862. Ba.textBaseline = "middle";
  8863. Ba.textAlign = "center";
  8864. Ba.lineWidth = la.nameScale ? 11 : 8;
  8865. Ba.lineJoin = "round";
  8866. Ba.strokeText(a, la.x - d, la.y - e - la.scale - f.nameY);
  8867. Ba.fillText(a, la.x - d, la.y - e - la.scale - f.nameY);
  8868. if (la.isLeader && bf.crown.isLoaded) {
  8869. let b = f.crownIconScale;
  8870. let c = la.x - d - b / 2 - Ba.measureText(a).width / 2 - f.crownPad;
  8871. Ba.drawImage(bf.crown, c, la.y - e - la.scale - f.nameY - b / 2 - 5, b, b);
  8872. }
  8873. if (la.iconIndex == 1 && bf.skull.isLoaded) {
  8874. let b = f.crownIconScale;
  8875. let c = la.x - d - b / 2 + Ba.measureText(a).width / 2 + f.crownPad;
  8876. Ba.drawImage(bf.skull, c, la.y - e - la.scale - f.nameY - b / 2 - 5, b, b);
  8877. }
  8878. if (la.isPlayer && nc.wait && oa == la && (la.backupNobull ? af[1].isLoaded : af[0].isLoaded) && ma.length && !K) {
  8879. let a = la.scale * 2.2;
  8880. Ba.drawImage(la.backupNobull ? af[1] : af[0], la.x - d - a / 2, la.y - e - a / 2, a, a);
  8881. }
  8882. }
  8883. if (la.health > 0) {
  8884. if (la.name != "Yurio Slaves") {
  8885. Ba.fillStyle = fb;
  8886. Ba.roundRect(la.x - d - f.healthBarWidth - f.healthBarPad, la.y - e + la.scale + f.nameY, f.healthBarWidth * 2 + f.healthBarPad * 2, 17, 8);
  8887. Ba.fill();
  8888. Ba.fillStyle = la == ja || la.team && la.team == ja.team ? "#8ecc51" : "#cc5151";
  8889. Ba.roundRect(la.x - d - f.healthBarWidth, la.y - e + la.scale + f.nameY + f.healthBarPad, f.healthBarWidth * 2 * (la.health / la.maxHealth), 17 - f.healthBarPad * 2, 7);
  8890. Ba.fill();
  8891. }
  8892. if (la.isPlayer) {
  8893. Ba.globalAlpha = 1;
  8894. let a = {
  8895. primary: la.primaryIndex == undefined ? 1 : (ec.weapons[la.primaryIndex].speed - la.reloads[la.primaryIndex]) / ec.weapons[la.primaryIndex].speed,
  8896. secondary: la.secondaryIndex == undefined ? 1 : (ec.weapons[la.secondaryIndex].speed - la.reloads[la.secondaryIndex]) / ec.weapons[la.secondaryIndex].speed,
  8897. turret: (2500 - la.reloads[53]) / 2500
  8898. };
  8899. if (!la.currentReloads) {
  8900. la.currentReloads = {
  8901. primary: a.primary,
  8902. secondary: a.secondary,
  8903. turret: a.turret
  8904. };
  8905. }
  8906. const b = 0.3;
  8907. la.currentReloads.primary = (1 - b) * la.currentReloads.primary + b * a.primary;
  8908. la.currentReloads.secondary = (1 - b) * la.currentReloads.secondary + b * a.secondary;
  8909. la.currentReloads.turret = (1 - b) * la.currentReloads.turret + b * a.turret;
  8910. let g = la.primaryIndex !== undefined ? (ec.weapons[la.primaryIndex].speed - la.reloads[la.primaryIndex]) / ec.weapons[la.primaryIndex].speed : 1;
  8911. let h = la.secondaryIndex !== undefined ? (ec.weapons[la.secondaryIndex].speed - la.reloads[la.secondaryIndex]) / ec.weapons[la.secondaryIndex].speed : 1;
  8912. const i = la.x - d;
  8913. const j = la.y - e;
  8914. const k = 35;
  8915. const l = 15;
  8916. const m = Math.PI * 2 / 3;
  8917. const n = -Math.PI / 2 + Math.PI / 3 + la.dir - Math.PI / 2;
  8918. const o = n + m * la.currentReloads.secondary;
  8919. const p = Math.PI / 2 + la.dir - Math.PI / 2;
  8920. const q = p + m * la.currentReloads.primary;
  8921. const r = Math.PI + Math.PI / 4.5 + la.dir - Math.PI / 2;
  8922. const s = r + m / 1.25 * la.currentReloads.turret;
  8923. function t(a) {
  8924. const b = Math.floor((1 - a) * 255);
  8925. return "rgb(" + b + ", " + b + ", " + b + ")";
  8926. }
  8927. Ba.save();
  8928. if (la.currentReloads.primary < 0.999) {
  8929. Ba.beginPath();
  8930. Ba.lineCap = "round";
  8931. Ba.arc(i, j, k, p, q);
  8932. Ba.lineWidth = 4;
  8933. Ba.strokeStyle = t(la.currentReloads.primary * 240);
  8934. Ba.stroke();
  8935. }
  8936. if (la.currentReloads.secondary < 0.999) {
  8937. Ba.beginPath();
  8938. Ba.lineCap = "round";
  8939. Ba.arc(i, j, k, n, o);
  8940. Ba.lineWidth = 4;
  8941. Ba.strokeStyle = t(la.currentReloads.secondary * 240);
  8942. Ba.stroke();
  8943. }
  8944. if (la.currentReloads.turret < 0.999) {
  8945. Ba.beginPath();
  8946. Ba.lineCap = "round";
  8947. Ba.arc(i, j, k, r, s);
  8948. Ba.lineWidth = 4;
  8949. Ba.strokeStyle = t(la.currentReloads.turret * 240);
  8950. Ba.stroke();
  8951. }
  8952. Ba.restore();
  8953. if (la.name != "Yurio Slaves") {
  8954. Ba.globalAlpha = 1;
  8955. Ba.font = "27px Hammersmith One";
  8956. Ba.strokeStyle = fb;
  8957. Ba.textBaseline = "middle";
  8958. Ba.textAlign = "center";
  8959. Ba.lineWidth = 11;
  8960. Ba.lineJoin = "round";
  8961. let a = f.crownIconScale;
  8962. let b = la.x - d - a / 2 + f.crownPad - 2;
  8963. let c = (la.skinIndex == 45 && la.shameTimer > 0 ? la.shameTimer : la.shameCount).toString();
  8964. let g = b - 60;
  8965. let h = la.y - e - la.scale - f.nameY + 0;
  8966. if (la.skinIndex == 45) {
  8967. Ba.fillStyle = "red";
  8968. } else {
  8969. Ba.fillStyle = "#fff";
  8970. }
  8971. Ba.strokeText(c, g, h);
  8972. Ba.fillText(c, g, h);
  8973. }
  8974. if (!la.isTeam(ja)) {
  8975. let a = {
  8976. x: Qa / 2,
  8977. y: Ra / 2
  8978. };
  8979. let b = Math.min(1, dc.getDistance(0, 0, ja.x - la.x, (ja.y - la.y) * (16 / 9)) * 100 / (f.maxScreenHeight / 2) / a.y);
  8980. let c = a.y * b / 2;
  8981. let g = c * Math.cos(dc.getDirect(la, ja, 0, 0));
  8982. let h = c * Math.sin(dc.getDirect(la, ja, 0, 0));
  8983. Ba.save();
  8984. Ba.translate(ja.x - d + g, ja.y - e + h);
  8985. Ba.rotate(la.aim2 + Math.PI / 2);
  8986. let i = 255 - la.sid * 2;
  8987. Ba.fillStyle = "rgb(" + i + ", " + i + ", " + i + ")";
  8988. Ba.globalAlpha = b;
  8989. let j = function (a, b) {
  8990. b = b || Ba;
  8991. let c = a * (Math.sqrt(3) / 2);
  8992. b.beginPath();
  8993. b.moveTo(0, -c / 1.5);
  8994. b.lineTo(-a / 2, c / 2);
  8995. b.lineTo(a / 2, c / 2);
  8996. b.lineTo(0, -c / 1.5);
  8997. b.fill();
  8998. b.closePath();
  8999. };
  9000. j(25, Ba);
  9001. Ba.restore();
  9002. }
  9003. if (c("predictType").value == "pre2") {
  9004. Ba.lineWidth = 3;
  9005. Ba.strokeStyle = "#fff";
  9006. Ba.globalAlpha = 1;
  9007. Ba.beginPath();
  9008. let a = {
  9009. x: la.x2 - d,
  9010. y: la.y2 - e
  9011. };
  9012. Ba.moveTo(la.x - d, la.y - e);
  9013. Ba.lineTo(a.x, a.y);
  9014. Ba.stroke();
  9015. } else if (c("predictType").value == "pre3") {
  9016. Ba.lineWidth = 3;
  9017. Ba.strokeStyle = "#cc5151";
  9018. Ba.globalAlpha = 1;
  9019. Ba.beginPath();
  9020. let a = {
  9021. x: la.x3 - d,
  9022. y: la.y3 - e
  9023. };
  9024. Ba.moveTo(la.x - d, la.y - e);
  9025. Ba.lineTo(a.x, a.y);
  9026. Ba.stroke();
  9027. }
  9028. }
  9029. }
  9030. }
  9031. }
  9032. if (ja) {
  9033. if (pa.autoPush && pa.pushData) {
  9034. Ba.lineWidth = 5;
  9035. Ba.globalAlpha = 1;
  9036. Ba.beginPath();
  9037. Ba.strokeStyle = "white";
  9038. var g = ja.x - d;
  9039. var h = ja.y - e;
  9040. var i = pa.pushData.x2 - d;
  9041. var j = pa.pushData.y2 - e;
  9042. var k = pa.pushData.x - d;
  9043. var l = pa.pushData.y - e;
  9044. Ba.moveTo(g, h);
  9045. Ba.lineTo(i, j);
  9046. Ba.lineTo(k, l);
  9047. Ba.stroke();
  9048. var m = k - g;
  9049. var n = l - h;
  9050. var o = Math.sqrt(m * m + n * n);
  9051. var p = 100;
  9052. var q = o / p * 100;
  9053. q = Math.min(100, Math.max(0, q));
  9054. let a;
  9055. Ba.fillStyle = "white";
  9056. Ba.strokeStyle = "black";
  9057. Ba.lineWidth = 5;
  9058. Ba.font = "30px Hammersmith One";
  9059. let b = fa.filter(a => a.trap && a.active && a.isTeamObject(ja) && dc.getDist(a, oa, 0, 2) <= oa.scale + a.getScale() + 5).sort(function (a, b) {
  9060. return dc.getDist(a, oa, 0, 2) - dc.getDist(b, oa, 0, 2);
  9061. })[0];
  9062. if (b) {
  9063. a = fa.filter(a => a.dmg && a.active && a.isTeamObject(ja) && dc.getDist(a, b, 0, 0) <= oa.scale + b.scale + a.scale).sort(function (a, b) {
  9064. return dc.getDist(a, oa, 0, 2) - dc.getDist(b, oa, 0, 2);
  9065. })[0];
  9066. }
  9067. let c = (ja.x - d + oa.x - d) / 2;
  9068. let f = (ja.y - e + oa.y - e) / 2;
  9069. Ba.moveTo(ja.x - d, ja.y - e);
  9070. Ba.strokeText(oa.aim2, c, f);
  9071. Ba.fillText(oa.aim2, c, f);
  9072. }
  9073. }
  9074. Ba.globalAlpha = 1;
  9075. lc.update(Va, Ba, d, e);
  9076. for (let a = 0; a < ba.length; ++a) {
  9077. la = ba[a];
  9078. if (la.visible) {
  9079. if (la.chatCountdown > 0) {
  9080. la.chatCountdown -= Va;
  9081. if (la.chatCountdown <= 0) {
  9082. la.chatCountdown = 0;
  9083. }
  9084. Ba.font = "32px Hammersmith One";
  9085. let a = Ba.measureText(la.chatMessage);
  9086. Ba.textBaseline = "middle";
  9087. Ba.textAlign = "center";
  9088. let b = la.x - d;
  9089. let c = la.y - la.scale - e - 90;
  9090. let f = 47;
  9091. let g = a.width + 17;
  9092. Ba.fillStyle = "rgba(0,0,0,0.2)";
  9093. Ba.roundRect(b - g / 2, c - f / 2, g, f, 6);
  9094. Ba.fill();
  9095. Ba.fillStyle = "#fff";
  9096. Ba.fillText(la.chatMessage, b, c);
  9097. }
  9098. if (la.chat.count > 0) {
  9099. if (!K) {
  9100. la.chat.count -= Va;
  9101. if (la.chat.count <= 0) {
  9102. la.chat.count = 0;
  9103. }
  9104. Ba.font = "32px Hammersmith One";
  9105. let a = Ba.measureText(la.chat.message);
  9106. Ba.textBaseline = "middle";
  9107. Ba.textAlign = "center";
  9108. let b = la.x - d;
  9109. let c = la.y - la.scale - e + 180;
  9110. let f = 47;
  9111. let g = a.width + 17;
  9112. Ba.fillStyle = "rgba(0,0,0,0.2)";
  9113. Ba.roundRect(b - g / 2, c - f / 2, g, f, 6);
  9114. Ba.fill();
  9115. Ba.fillStyle = "#ffffff99";
  9116. Ba.fillText(la.chat.message, b, c);
  9117. } else {
  9118. la.chat.count = 0;
  9119. }
  9120. }
  9121. }
  9122. }
  9123. if (Z.length) {
  9124. Z.filter(a => a.active).forEach(a => {
  9125. if (!a.alive) {
  9126. if (a.alpha <= 1) {
  9127. a.alpha += Va / 250;
  9128. if (a.alpha >= 1) {
  9129. a.alpha = 1;
  9130. a.alive = true;
  9131. }
  9132. }
  9133. } else {
  9134. a.alpha -= Va / 5000;
  9135. if (a.alpha <= 0) {
  9136. a.alpha = 0;
  9137. a.active = false;
  9138. }
  9139. }
  9140. if (a.active) {
  9141. Ba.font = "20px Ubuntu";
  9142. let b = Ba.measureText(a.chat);
  9143. Ba.textBaseline = "middle";
  9144. Ba.textAlign = "center";
  9145. let c = a.x - d;
  9146. let f = a.y - e - 90;
  9147. let g = 40;
  9148. let h = b.width + 15;
  9149. Ba.globalAlpha = a.alpha;
  9150. Ba.fillStyle = a.owner.isTeam(ja) ? "#8ecc51" : "#cc5151";
  9151. Ba.strokeStyle = "rgb(25, 25, 25)";
  9152. Ba.strokeText(a.owner.name, c, f - 45);
  9153. Ba.fillText(a.owner.name, c, f - 45);
  9154. Ba.lineWidth = 5;
  9155. Ba.fillStyle = "#ccc";
  9156. Ba.strokeStyle = "rgb(25, 25, 25)";
  9157. Ba.roundRect(c - h / 2, f - g / 2, h, g, 6);
  9158. Ba.stroke();
  9159. Ba.fill();
  9160. Ba.fillStyle = "#fff";
  9161. Ba.strokeStyle = "#000";
  9162. Ba.strokeText(a.chat, c, f);
  9163. Ba.fillText(a.chat, c, f);
  9164. a.y -= Va / 100;
  9165. }
  9166. });
  9167. }
  9168. Ba.globalAlpha = 1;
  9169. $e(Va);
  9170. }
  9171. window.requestAnimFrame = function () {
  9172. return null;
  9173. };
  9174. window.rAF = function () {
  9175. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (a) {
  9176. window.setTimeout(a, 1000 / 9);
  9177. };
  9178. }();
  9179. function gf() {
  9180. Wa = performance.now();
  9181. Va = Wa - Xa;
  9182. Xa = Wa;
  9183. let a = performance.now();
  9184. let b = a - R.last;
  9185. if (b >= 1000) {
  9186. R.ltime = R.time * (1000 / b);
  9187. R.last = a;
  9188. R.time = 0;
  9189. }
  9190. R.time++;
  9191. c("pingFps").innerHTML = window.pingTime + "ms | Fps: " + Math.round(R.ltime);
  9192. c("packetStatus").innerHTML = L;
  9193. ff();
  9194. rAF(gf);
  9195. rb.avg = Math.round((rb.min + rb.max) / 2);
  9196. }
  9197. ee();
  9198. gf();
  9199. function hf(a) {
  9200. c("instaType").disabled = a;
  9201. c("antiBullType").disabled = a;
  9202. c("predictType").disabled = a;
  9203. }
  9204. hf(K);
  9205. let jf = {};
  9206. window.debug = function () {
  9207. pa.waitHit = 0;
  9208. pa.autoAim = false;
  9209. nc.isTrue = false;
  9210. mc.inTrap = false;
  9211. Oe = [];
  9212. Re = [];
  9213. Me = [];
  9214. };
  9215. window.wasdMode = function () {
  9216. K = !K;
  9217. hf(K);
  9218. };
  9219. window.startGrind = function () {
  9220. if (c("weaponGrind").checked) {
  9221. for (let a = 0; a < Math.PI * 2; a += Math.PI / 2) {
  9222. Rb(ja.getItemType(22), a);
  9223. }
  9224. }
  9225. };
  9226. let kf = ["adorable-eight-guppy", "galvanized-bittersweet-windshield"];
  9227. let lf = 0;
  9228. window.connectFillBots = function () {
  9229. h = [];
  9230. lf = 0;
  9231. for (let a = 0; a < kf.length; a++) {
  9232. let b = new WebSocket("wss://" + kf[a] + ".glitch.me");
  9233. b.binaryType = "arraybuffer";
  9234. b.onopen = function () {
  9235. b.ssend = function (a) {
  9236. let c = Array.prototype.slice.call(arguments, 1);
  9237. let d = window.msgpack.encode([a, c]);
  9238. b.send(d);
  9239. };
  9240. for (let a = 0; a < 4; a++) {
  9241. window.grecaptcha.execute("6LfahtgjAAAAAF8SkpjyeYMcxMdxIaQeh-VoPATP", {
  9242. action: "homepage"
  9243. }).then(function (a) {
  9244. let c = I.url.split("wss://")[1].split("?")[0];
  9245. b.ssend("bots", "wss://" + c + "?token=re:" + encodeURIComponent(a), lf);
  9246. h.push([b]);
  9247. lf++;
  9248. });
  9249. }
  9250. };
  9251. b.onmessage = function (a) {
  9252. let b = new Uint8Array(a.data);
  9253. let c = window.msgpack.decode(b);
  9254. let d = c[0];
  9255. b = c[1];
  9256. };
  9257. }
  9258. };
  9259. window.destroyFillBots = function () {
  9260. h.forEach(a => {
  9261. a[0].close();
  9262. });
  9263. h = [];
  9264. };
  9265. window.tryConnectBots = function () {
  9266. for (let a = 0; a < (Pd.length < 3 ? 3 : 4); a++) {
  9267. window.grecaptcha.execute("6LfahtgjAAAAAF8SkpjyeYMcxMdxIaQeh-VoPATP", {
  9268. action: "homepage"
  9269. }).then(function (a) {
  9270. Vd(a);
  9271. });
  9272. }
  9273. };
  9274. window.destroyBots = function () {
  9275. Pd.forEach(a => {
  9276. a.closeSocket = true;
  9277. });
  9278. Pd = [];
  9279. };
  9280. window.resBuild = function () {
  9281. if (ea.length) {
  9282. ea.forEach(a => {
  9283. a.breakObj = false;
  9284. });
  9285. ia = [];
  9286. }
  9287. };
  9288. window.toggleBotsCircle = function () {
  9289. ja.circle = !ja.circle;
  9290. };
  9291. window.toggleVisual = function () {
  9292. f.anotherVisual = !f.anotherVisual;
  9293. ea.forEach(a => {
  9294. if (a.active) {
  9295. a.dir = a.lastDir;
  9296. }
  9297. });
  9298. };
  9299. window.prepareUI = function (a) {
  9300. Cc();
  9301. var b = document.getElementById("chatBox");
  9302. var d = document.getElementById("chatHolder");
  9303. var e = document.createElement("div");
  9304. e.id = "suggestBox";
  9305. var g = 0;
  9306. function h() {
  9307. if (!Dc) {
  9308. if (d.style.display == "block") {
  9309. if (b.value) {
  9310. wc(b.value);
  9311. }
  9312. i();
  9313. } else {
  9314. Ea.style.display = "none";
  9315. bb.style.display = "none";
  9316. d.style.display = "block";
  9317. b.focus();
  9318. Y();
  9319. }
  9320. } else {
  9321. setTimeout(function () {
  9322. var a = prompt("chat message");
  9323. if (a) {
  9324. wc(a);
  9325. }
  9326. }, 1);
  9327. }
  9328. b.value = "";
  9329. (() => {
  9330. g = 0;
  9331. })();
  9332. }
  9333. function i() {
  9334. b.value = "";
  9335. d.style.display = "none";
  9336. }
  9337. dc.removeAllChildren(Ka);
  9338. for (let b = 0; b < ec.weapons.length + ec.list.length; ++b) {
  9339. (function (a) {
  9340. dc.generateElement({
  9341. id: "actionBarItem" + a,
  9342. class: "actionBarItem",
  9343. style: "display:none; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5)",
  9344. onmouseout: function () {
  9345. Bc();
  9346. },
  9347. parent: Ka
  9348. });
  9349. })(b);
  9350. }
  9351. for (let b = 0; b < ec.list.length + ec.weapons.length; ++b) {
  9352. (function (b) {
  9353. let d = document.createElement("canvas");
  9354. d.width = d.height = 66;
  9355. let e = d.getContext("2d");
  9356. e.translate(d.width / 2, d.height / 2);
  9357. e.imageSmoothingEnabled = false;
  9358. e.webkitImageSmoothingEnabled = false;
  9359. e.mozImageSmoothingEnabled = false;
  9360. if (ec.weapons[b]) {
  9361. e.rotate(Math.PI);
  9362. let g = new Image();
  9363. Ee[ec.weapons[b].src] = g;
  9364. g.onload = function () {
  9365. this.isLoaded = true;
  9366. let a = 1 / (this.height / this.width);
  9367. let g = ec.weapons[b].iPad || 1;
  9368. e.drawImage(this, -(d.width * g * f.iconPad * a) / 2, -(d.height * g * f.iconPad) / 2, d.width * g * a * f.iconPad, d.height * g * f.iconPad);
  9369. e.fillStyle = "rgba(0, 0, 70, 0.2)";
  9370. e.globalCompositeOperation = "source-atop";
  9371. e.fillRect(-d.width / 2, -d.height / 2, d.width, d.height);
  9372. c("actionBarItem" + b).style.backgroundImage = "url(" + d.toDataURL() + ")";
  9373. };
  9374. g.src = "./../img/weapons/" + ec.weapons[b].src + ".png";
  9375. let h = c("actionBarItem" + b);
  9376. h.onclick = dc.checkTrusted(function () {
  9377. Nb(a.weapons[ec.weapons[b].type]);
  9378. });
  9379. dc.hookTouchEvents(h);
  9380. } else {
  9381. let g = Pe(ec.list[b - ec.weapons.length], true);
  9382. let h = Math.min(d.width - f.iconPadding, g.width);
  9383. e.globalAlpha = 1;
  9384. e.drawImage(g, -h / 2, -h / 2, h, h);
  9385. e.fillStyle = "rgba(0, 0, 70, 0.1)";
  9386. e.globalCompositeOperation = "source-atop";
  9387. e.fillRect(-h / 2, -h / 2, h, h);
  9388. c("actionBarItem" + b).style.backgroundImage = "url(" + d.toDataURL() + ")";
  9389. let i = c("actionBarItem" + b);
  9390. i.onclick = dc.checkTrusted(function () {
  9391. Mb(a.items[a.getItemType(b - ec.weapons.length)]);
  9392. });
  9393. dc.hookTouchEvents(i);
  9394. }
  9395. })(b);
  9396. }
  9397. };
  9398. window.profineTest = function (a) {
  9399. if (a) {
  9400. let b = a + "";
  9401. b = b.slice(0, f.maxNameLength);
  9402. return b;
  9403. }
  9404. };