Advertisement
Guest User

Untitled

a guest
May 20th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 239.99 KB | None | 0 0
  1. var r = {
  2. scope: {}
  3. };
  4. r.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function(e, a, t) {
  5. if (t.get || t.set) throw new TypeError("ES3 does not support getters and setters.");
  6. e != Array.prototype && e != Object.prototype && (e[a] = t.value)
  7. };
  8. r.getGlobal = function(e) {
  9. return "undefined" != typeof window && window === e ? e : "undefined" != typeof global ? global : e
  10. };
  11. r.global = r.getGlobal(this);
  12. r.polyfill = function(e, a, t, i) {
  13. if (a) {
  14. t = r.global;
  15. e = e.split(".");
  16. for (i = 0; i < e.length - 1; i++) {
  17. var s = e[i];
  18. s in t || (t[s] = {});
  19. t = t[s]
  20. }
  21. e = e[e.length - 1];
  22. i = t[e];
  23. a = a(i);
  24. a != i && null != a && r.defineProperty(t, e, {
  25. configurable: !0,
  26. writable: !0,
  27. value: a
  28. })
  29. }
  30. };
  31. r.polyfill("Math.trunc", function(e) {
  32. return e ? e : function(e) {
  33. e = Number(e);
  34. if (isNaN(e) || Infinity === e || -Infinity === e || 0 === e) return e;
  35. var a = Math.floor(Math.abs(e));
  36. return 0 > e ? -a : a
  37. }
  38. }, "es6-impl", "es3");
  39. r.polyfill("Array.prototype.fill", function(e) {
  40. return e ? e : function(e, a, t) {
  41. var i = this.length || 0;
  42. 0 > a && (a = Math.max(0, i + a));
  43. if (null == t || t > i) t = i;
  44. t = Number(t);
  45. 0 > t && (t = Math.max(0, i + t));
  46. for (a = Number(a || 0); a < t; a++) this[a] = e;
  47. return this
  48. }
  49. }, "es6-impl", "es3");
  50. var l = 211,
  51. t = !1;
  52. console.log("\n\n\n");
  53. console.log("--------------------------------------------");
  54. console.log("");
  55. console.log("# # #### ##### ###### # ####");
  56. console.log("## ## # # # # # # # #");
  57. console.log("# ## # # # # # ##### # # #");
  58. console.log("# # # # ##### # ### # # #");
  59. console.log("# # # # # # ### # # #");
  60. console.log("# # #### # ###### ### # ####");
  61. console.log("____ Mope.ioΓ’Β„Λ˜ Copyright 2017- Mopeio Ltd.___");
  62. console.log("--------------------------------------------");
  63. console.log("-----------Game Version " + l + " ----------------");
  64. console.log("\n\n\n");
  65. var m = 1,
  66. f = 2,
  67. u = 3,
  68. b = 4,
  69. y = 5,
  70. w = 6,
  71. k = 7,
  72. P = 8,
  73. A = 9,
  74. T = 10,
  75. I = 11,
  76. v = 12,
  77. D = 13,
  78. M = 14,
  79. x = 15,
  80. C = 16,
  81. N = 17,
  82. _ = 18,
  83. S = 19,
  84. E = 20,
  85. U = 21,
  86. B = 22,
  87. O = 23,
  88. R = 24,
  89. F = 25,
  90. W = 26,
  91. G = 27,
  92. H = 28,
  93. z = 29,
  94. j = 30,
  95. L = 31,
  96. X = 32,
  97. Y = 33,
  98. V = 34,
  99. K = 35,
  100. J = 36,
  101. q = 37,
  102. Z = 38,
  103. Q = 39,
  104. $ = 40,
  105. ee = 42,
  106. a = 43,
  107. ae = 44,
  108. te = 46,
  109. ie = 47,
  110. se = 48,
  111. re = 49,
  112. ne = 50,
  113. oe = 51,
  114. le = 52,
  115. he = 53,
  116. ce = 54,
  117. de = 55,
  118. pe = 56,
  119. ge = 57,
  120. me = 58,
  121. fe = 59,
  122. ue = 60,
  123. be = 61,
  124. ye = 62,
  125. we = 63,
  126. ke = 64,
  127. Pe = 65,
  128. Ae = 66,
  129. Te = 67,
  130. i = 68,
  131. s = 69,
  132. n = 70,
  133. o = 71,
  134. h = {
  135. customClassesForOType: {},
  136. setClassForAnimalType: function(e, a) {
  137. this.setCustomClassForGameObjType(e, f, a)
  138. },
  139. setCustomClassForGameObjType: function(e, a, t) {
  140. a in this.customClassesForOType || (this.customClassesForOType[a] = {
  141. oTypeMainClass: null,
  142. secondaryTypeClasses: {}
  143. });
  144. var i = this.customClassesForOType[a];
  145. null == t ? (null != i.oTypeMainClass && console.log("ERROR 'GameObjType.setCustomClassForGameObjType': a class (" + this.customClassesForOType[a] + ") is already set for oType " + a + "! Check for duplicate calls!"), i.oTypeMainClass = e) : (t in i.secondaryTypeClasses && console.log("ERROR 'GameObjType.setCustomClassForGameObjType': a class is already set for oType " + a + " AND secondaryType (eg. animalType) " + t + "! Check for duplicate calls!"), i.secondaryTypeClasses[t] = e)
  146. },
  147. getClassForGameObjType: function(e, a) {
  148. if (e in this.customClassesForOType) {
  149. var t = this.customClassesForOType[e];
  150. return null == a || 0 == a ? t.oTypeMainClass : a in t.secondaryTypeClasses ? t.secondaryTypeClasses[a] : t.oTypeMainClass
  151. }
  152. return In
  153. },
  154. newlyVis_createGameObjFromMsg: function(e) {
  155. var a = e.readUInt8(),
  156. t = null;
  157. a == f && (t = e.readUInt8());
  158. var i = h.createGameObjOfOType(a, t);
  159. i.worldUpd_readMsgNewlyVisible(e, a, t);
  160. return i
  161. },
  162. createGameObjOfOType: function(e, a) {
  163. return new(this.getClassForGameObjType(e, a))(e)
  164. }
  165. },
  166. c = 1,
  167. p = 2,
  168. g = 3,
  169. Ie = 4,
  170. ve = 5,
  171. De = 6,
  172. Me = 7,
  173. xe = 8,
  174. Ce = 9,
  175. Ne = 10,
  176. _e = 11,
  177. Se = 12,
  178. Ee = 13,
  179. Ue = 14,
  180. Be = 15,
  181. Oe = 16,
  182. Re = 17,
  183. Fe = 18,
  184. We = 19,
  185. Ge = 20,
  186. He = 21,
  187. ze = 22,
  188. je = 23,
  189. Le = 24,
  190. Xe = 25,
  191. Ye = 26,
  192. Ve = 27,
  193. Ke = 28,
  194. Je = 29,
  195. qe = 30,
  196. Ze = 31,
  197. Qe = 32,
  198. $e = 33,
  199. ea = 34,
  200. aa = 35,
  201. ta = 36,
  202. ia = 37,
  203. sa = 38,
  204. ra = 39,
  205. na = 40,
  206. oa = 41,
  207. la = 42,
  208. ha = 43,
  209. ca = 44,
  210. da = 45,
  211. pa = 46,
  212. ma = 47,
  213. fa = 48,
  214. ua = 49,
  215. ba = 50,
  216. ya = 51,
  217. wa = 52,
  218. ka = 53,
  219. Pa = 54,
  220. Aa = 55,
  221. Ta = 56,
  222. Ia = 57,
  223. va = 58,
  224. Da = 59,
  225. Ma = 60,
  226. xa = 61,
  227. Ca = 62,
  228. Na = 63,
  229. _a = 64,
  230. Sa = 65,
  231. Ea = 66,
  232. Ua = 67,
  233. Ba = 68,
  234. Oa = 69,
  235. Ra = function(e) {
  236. var a = {};
  237. switch (e) {
  238. case da:
  239. a.aniName = "Snail";
  240. a.aniDesc = "";
  241. a.upgradeText = "You're a super slow snail!";
  242. a.aniCol = "#fcc02b";
  243. a.skinName = "snail";
  244. break;
  245. case c:
  246. a.aniName = "Mouse";
  247. a.aniDesc = "";
  248. a.upgradeText = "";
  249. a.aniCol = "#9BA9B9";
  250. a.skinName = "mouse";
  251. break;
  252. case p:
  253. a.aniName = "Rabbit";
  254. a.aniDesc = "";
  255. a.upgradeText = "UPGRADED to RABBIT! \nPress W to burrow a hole to hide in!";
  256. a.aniCol = "#AA937E";
  257. a.skinName = "rabbit";
  258. break;
  259. case g:
  260. a.aniName = "Pig";
  261. a.aniDesc = "";
  262. a.upgradeText = "UPGRADED to PIG!\n Pigs move FAST through MUD! (Can use 'stink' on mud/ hiding holes!)";
  263. a.aniCol = "#DD6BD4";
  264. a.skinName = "pig";
  265. break;
  266. case Ie:
  267. a.aniName = "Fox";
  268. a.aniDesc = "";
  269. a.upgradeText = "UPGRADED to FOX! ,\n You can kick players out of hiding holes! (Press W when in one!)\n+ Hide in red berry bushes!";
  270. a.aniCol = "#FF9D43";
  271. a.skinName = "fox";
  272. break;
  273. case ve:
  274. a.aniName = "Deer";
  275. a.aniDesc = "";
  276. a.upgradeText = "UPGRADED to DEER! \nPress W to dig up food! \nDig in mud for better food!\n Hint:Check water areas for new food sources!";
  277. a.aniCol = "#C4773E";
  278. a.skinName = "deer";
  279. break;
  280. case De:
  281. a.aniName = "Mole";
  282. a.aniDesc = "";
  283. a.upgradeText = "UPGRADED to MOLE!\n Hold W to dig underground!\nGo under anything, do surprise attacks!";
  284. a.aniCol = "#4C4A45";
  285. a.skinName = "mole";
  286. break;
  287. case Me:
  288. a.aniName = "Zebra";
  289. a.aniDesc = "";
  290. a.upgradeText = "UPGRADED to ZEBRA! \nPress W to kick side ways!";
  291. a.aniCol = "#FFFFFF";
  292. a.skinName = "zebra";
  293. break;
  294. case xe:
  295. a.aniName = "Lion";
  296. a.aniDesc = "";
  297. a.upgradeText = "UPGRADED to LION!\n Press W to release a mighty ROAR (Rawr!)!";
  298. a.aniCol = "#f8c923";
  299. a.skinName = "lion";
  300. break;
  301. case Ce:
  302. a.aniName = "Cheetah";
  303. a.aniDesc = "";
  304. a.upgradeText = "UPGRADED to CHEETAH!\n Press W to get a speed boost! (Every 8 seconds)!";
  305. a.aniCol = "#CAC05B";
  306. a.skinName = "cheetah";
  307. break;
  308. case Ne:
  309. a.aniName = "Bear";
  310. a.aniDesc = "";
  311. a.upgradeText = "UPGRADED to BEAR!\n Bears climb through green hills! (Press W to use your claw!)";
  312. a.aniCol = "#99591C";
  313. a.skinName = "bear";
  314. break;
  315. case _e:
  316. a.aniName = "Croc";
  317. a.aniDesc = "";
  318. a.upgradeText = "UPGRADED to CROCODILE!\n Press W to bite and drag around animals! \n+ (Now hide in water spots)+ Swim well in Mud, Lakes & Oceans!";
  319. a.aniCol = "#30F51C";
  320. a.skinName = "croc";
  321. break;
  322. case Ee:
  323. a.aniName = "Hippo";
  324. a.aniDesc = "";
  325. a.upgradeText = "UPGRADED to HIPPO!\nHippos are great swimmers, dominate the Lakes/Oceans/Mud!";
  326. a.aniCol = "#945A99";
  327. a.skinName = "hippo";
  328. break;
  329. case Se:
  330. a.aniName = "Rhino";
  331. a.aniDesc = "";
  332. a.upgradeText = "UPGRADED to RHINO!\n Press W to CHARGE with your mighty horn!";
  333. a.aniCol = "#94a3a9";
  334. a.skinName = "rhino";
  335. break;
  336. case Be:
  337. a.aniName = "Shrimp";
  338. a.aniDesc = "";
  339. a.upgradeText = "";
  340. a.aniCol = "#f88e37";
  341. a.skinName = "shrimp";
  342. break;
  343. case Oe:
  344. a.aniName = "Trout";
  345. a.aniDesc = "";
  346. a.upgradeText = "UPGRADED to TROUT!\nHint: Hold Left-click to RUN! (Uses extra water)";
  347. a.aniCol = "#ac8686";
  348. a.skinName = "trout";
  349. break;
  350. case Re:
  351. a.aniName = "Crab";
  352. a.aniDesc = "";
  353. a.upgradeText = "UPGRADED to CRAB!\n Crabs can survive on dry land!\n (On land, Press W to go into your shell!)";
  354. a.aniCol = "#bf2408";
  355. a.skinName = "crab";
  356. break;
  357. case Fe:
  358. a.aniName = "Squid";
  359. a.aniDesc = "";
  360. a.upgradeText = "UPGRADED to SQUID!\n Squids can use INK when injured (press W!) \n+ you can hide in plankton bushes!";
  361. a.aniCol = "#40dda4";
  362. a.skinName = "squid";
  363. break;
  364. case We:
  365. a.aniName = "Shark";
  366. a.aniDesc = "";
  367. a.upgradeText = "UPGRADED to SHARK!\n A vicious predator of the oceans!";
  368. a.aniCol = "#999fc6";
  369. a.skinName = "shark";
  370. break;
  371. case ze:
  372. a.aniName = "Sea-horse";
  373. a.aniDesc = "";
  374. a.upgradeText = "UPGRADED to SEA HORSE!\n An agile hunter!";
  375. a.aniCol = "#73BE2F";
  376. a.skinName = "seahorse";
  377. break;
  378. case je:
  379. a.aniName = "Jellyfish";
  380. a.aniDesc = "";
  381. a.upgradeText = "UPGRADED to JELLYFISH!\n A slowly-turning animal that can grow quite large!";
  382. a.aniCol = "#FDB9BA";
  383. a.skinName = "jellyfish";
  384. break;
  385. case He:
  386. a.aniName = "Turtle";
  387. a.aniDesc = "";
  388. a.upgradeText = "UPGRADED to TURTLE!\n Lives well on land & water! (On land, Press W to go into your shell!)";
  389. a.aniCol = "#502E1A";
  390. a.skinName = "turtle";
  391. break;
  392. case Ge:
  393. a.aniName = "Stringray";
  394. a.aniDesc = "";
  395. a.upgradeText = "UPGRADED to STINGRAY!\n Use electic shock (Release W key!) to shock animals! \n(Takes time to recharge)";
  396. a.aniCol = "#164336";
  397. a.skinName = "stingray";
  398. break;
  399. case Le:
  400. a.aniName = "The Kraken";
  401. a.aniDesc = "";
  402. a.upgradeText = "UPGRADED to THE KRAKEN!\n Terrorize the oceans, and be feared by all!\n (Release W to use whirlpool ability!)";
  403. a.aniCol = "#64a034";
  404. a.skinName = "kraken";
  405. break;
  406. case Xe:
  407. a.aniName = "Pufferfish";
  408. a.aniDesc = "";
  409. a.upgradeText = "UPGRADED to PUFFERFISH!\n (Hold W to inflate- become spiky, and dangerous to touch!)";
  410. a.aniCol = "#6C5C2C";
  411. a.skinName = "pufferfish";
  412. break;
  413. case Ye:
  414. a.aniName = "Killer Whale";
  415. a.aniDesc = "";
  416. a.upgradeText = "UPGRADED to Killer Whale! \nWhales blow out water when diving! (And sometimes other loot!)";
  417. a.aniCol = "#141414";
  418. a.skinName = "killerwhale";
  419. break;
  420. case Ve:
  421. a.aniName = "Swordfish";
  422. a.aniDesc = "";
  423. a.upgradeText = "UPGRADED to " + a.aniName + "!\n (Press W to rush with your sharp nose!)";
  424. a.aniCol = "#689CD7";
  425. a.skinName = "swordfish";
  426. break;
  427. case Ke:
  428. a.aniName = "Gorilla";
  429. a.aniDesc = "";
  430. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Gorillas are very fast on hills/trees!\n Press W to throw bananas! (from trees)";
  431. a.aniCol = "#323232";
  432. a.skinName = "gorilla";
  433. break;
  434. case Je:
  435. a.aniName = "Octopus";
  436. a.aniDesc = "";
  437. a.upgradeText = "UPGRADED to Octopus!\nHold W to use your 'Disguise' ability!\n(Hint: wait for prey to bite you- they get stunned!)";
  438. a.aniCol = "#ff8340";
  439. a.skinName = "octopus";
  440. break;
  441. case Ue:
  442. a.aniName = "Dragon";
  443. a.aniDesc = "";
  444. a.upgradeText = "UPGRADED to " + a.aniName + "!\n (You're amazing!) \nFly over everything, Hold W to shoot fire!";
  445. a.aniCol = "#22FF8A";
  446. a.skinName = "dragon";
  447. break;
  448. case pa:
  449. a.aniName = "Black Dragon";
  450. a.aniDesc = "";
  451. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Black dragons drink lava instead of water! Black dragons only heal on healing stones/lava!";
  452. a.aniCol = "black";
  453. a.skinName = "blackdragon";
  454. break;
  455. case wa:
  456. a.aniName = "Giant Spider";
  457. a.aniDesc = "";
  458. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Place web around the game to catch prey!";
  459. a.aniCol = "black";
  460. a.skinName = "giantSpider";
  461. break;
  462. case ba:
  463. a.aniName = "Cobra";
  464. a.aniDesc = "";
  465. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Hold W to Spit venom, and poison animals with your bite!";
  466. a.aniCol = "black";
  467. a.skinName = "cobra";
  468. break;
  469. case ya:
  470. a.aniName = "Boa Constrictor";
  471. a.aniDesc = "";
  472. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Coil and suffocate other animals!";
  473. a.aniCol = "black";
  474. a.skinName = "boaConstrictor";
  475. break;
  476. case ka:
  477. a.aniName = "T-REX";
  478. a.aniDesc = "";
  479. a.upgradeText = "UPGRADED to " + a.aniName + " The Dinosaur!\n This ancient dinosaur has powerful jaws that can drag prey around!!";
  480. a.aniCol = "#862A2A";
  481. a.skinName = "trex";
  482. break;
  483. case Pa:
  484. a.aniName = "Tiger";
  485. a.aniDesc = "";
  486. a.upgradeText = "UPGRADED to Tiger!\n Tigers can launch an ambush attack (HOLD W to grow a bush)!";
  487. a.aniCol = "#FF9000";
  488. a.skinName = "tiger";
  489. break;
  490. case Aa:
  491. a.aniName = "Giraffe";
  492. a.aniDesc = "";
  493. a.upgradeText = "UPGRADED to Giraffe!\nGiraffe have huge legs and stomp anyone in their way!";
  494. a.aniCol = "#E9BD23";
  495. a.skinName = "giraffe";
  496. break;
  497. case Ta:
  498. a.aniName = "Eagle";
  499. a.aniDesc = "";
  500. a.upgradeText = "UPGRADED to Eagle!\nEagles can fly up other animals in the air! !\nThey can also fly high (double click)";
  501. a.aniCol = "#5b400d";
  502. a.skinName = "eagle";
  503. break;
  504. case oa:
  505. a.aniName = "Arctic Fox";
  506. a.aniDesc = "";
  507. a.upgradeText = "UPGRADED to " + a.aniName + "!\n You can kick players out of hiding holes! (Press W when in one!)\n+ Hide in red berry bushes!";
  508. a.aniCol = "#CFCFCF";
  509. a.skinName = "arctic/arcticfox";
  510. break;
  511. case Ze:
  512. a.aniName = "Arctic Hare";
  513. a.aniDesc = "";
  514. a.upgradeText = "UPGRADED to " + a.aniName + "!\n \nPress W to burrow a hole to hide in!";
  515. a.aniCol = "#D5D5D5";
  516. a.skinName = "arctic/arctichare";
  517. break;
  518. case Qe:
  519. a.aniName = "The Yeti!";
  520. a.aniDesc = "";
  521. a.upgradeText = "UPGRADED to " + a.aniName + "!\n So it really exists... \n Hold W to turn into snow, release W to freeeeeze!";
  522. a.aniCol = "#839eb5";
  523. a.skinName = "arctic/yeti";
  524. break;
  525. case $e:
  526. a.aniName = "Chipmunk";
  527. a.aniDesc = "";
  528. a.upgradeText = "";
  529. a.aniCol = "#A77C30";
  530. a.skinName = "arctic/chipmunk";
  531. break;
  532. case ea:
  533. a.aniName = "Muskox";
  534. a.aniDesc = "";
  535. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to charge with your horns! \nPlus move decently on ice!";
  536. a.aniCol = "#231f18";
  537. a.skinName = "arctic/muskox";
  538. break;
  539. case aa:
  540. a.aniName = "Penguin";
  541. a.aniDesc = "";
  542. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Left-click to run!\n (HOLD W to slide FAST on ice)!";
  543. a.aniCol = "#FFFFFF";
  544. a.skinName = "arctic/penguin";
  545. break;
  546. case ta:
  547. a.aniName = "Polar Bear";
  548. a.aniDesc = "";
  549. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Polar bears can climb hills! \n+ They're amazing swimmers!";
  550. a.aniCol = "#e4e4e4";
  551. a.skinName = "arctic/polarbear";
  552. break;
  553. case ia:
  554. a.aniName = "Seal";
  555. a.aniDesc = "";
  556. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Seals can slide on ice (Hold W) + can climb hills (rocks too!)";
  557. a.aniCol = "#cfcfcf";
  558. a.skinName = "arctic/seal";
  559. break;
  560. case sa:
  561. a.aniName = "Snow leopard";
  562. a.aniDesc = "";
  563. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to get a speed boost! (Every 8 seconds)!";
  564. a.aniCol = "#cfcfcf";
  565. a.skinName = "arctic/snowleopard";
  566. break;
  567. case ra:
  568. a.aniName = "Walrus";
  569. a.aniDesc = "";
  570. a.upgradeText = "UPGRADED to " + a.aniName + "!\n You can slide on ice (Hold W) + can climb hills (rocks too!)";
  571. a.aniCol = "#633838";
  572. a.skinName = "arctic/walrus";
  573. break;
  574. case na:
  575. a.aniName = "Reindeer";
  576. a.aniDesc = "";
  577. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to dig up food! \n Your sharp hooves let you turn very well on ice!";
  578. a.aniCol = "#a68976";
  579. a.skinName = "arctic/reindeer";
  580. break;
  581. case qe:
  582. a.aniName = "Wolf";
  583. a.aniDesc = "";
  584. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Wolf paws turn very well on ice!\n Press W to howl!";
  585. a.aniCol = "#6B6B6B";
  586. a.skinName = "arctic/wolf";
  587. break;
  588. case la:
  589. a.aniName = "Wolverine";
  590. a.aniDesc = "";
  591. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to Let out a Powerful GROWL! (Knocks back prey!)";
  592. a.aniCol = "#843A0F";
  593. a.skinName = "arctic/wolverine";
  594. break;
  595. case ha:
  596. a.aniName = "Mammoth";
  597. a.aniDesc = "";
  598. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to roll snowballs with your trunk!\n The bigger the snowball gets, the longer the freeze!";
  599. a.aniCol = "#9d4717";
  600. a.skinName = "arctic/mammoth";
  601. break;
  602. case ca:
  603. a.aniName = "Donkey";
  604. a.aniDesc = "";
  605. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to Kick any animal behind you";
  606. a.aniCol = "#8c7c64";
  607. a.skinName = "donkey";
  608. break;
  609. case ma:
  610. a.aniName = "Sabertooth Tiger";
  611. a.aniDesc = "";
  612. a.upgradeText = "UPGRADED to Sabertooth Tiger!\nSabertooth Tigers are great swimmers, dominate the Lakes/Oceans/Mud!";
  613. a.aniCol = "#945A99";
  614. a.skinName = "sabertoothtiger";
  615. break;
  616. case fa:
  617. a.aniName = "Elephant";
  618. a.aniDesc = "";
  619. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Use your long trunk to attack and eat food!";
  620. a.aniCol = "#945A99";
  621. a.skinName = "elephant";
  622. break;
  623. case ua:
  624. a.aniName = "Blue Whale";
  625. a.aniDesc = "";
  626. a.upgradeText = "UPGRADED to Blue Whale!\n Smash with your powerful tail!";
  627. a.aniCol = "#945A99";
  628. a.skinName = "bluewhale";
  629. break;
  630. case va:
  631. a.aniName = "Duck";
  632. a.aniDesc = "";
  633. a.upgradeText = "UPGRADED to a DUCK!";
  634. a.aniCol = "#FF9000";
  635. a.skinName = "duck";
  636. break;
  637. case Da:
  638. a.aniName = "Duckling";
  639. a.aniDesc = "";
  640. a.upgradeText = "UPGRADED to a DUCK!";
  641. a.aniCol = "#FF9000";
  642. a.skinName = "duckling";
  643. break;
  644. case Ia:
  645. a.aniName = "Hedgehog";
  646. a.aniDesc = "";
  647. a.upgradeText = "UPGRADED to Hedgehog!\n (Hold W to become spiky, and dangerous to touch!)";
  648. a.aniCol = "#5b400d";
  649. a.skinName = "hedgehog";
  650. break;
  651. case xa:
  652. a.aniName = "King Crab";
  653. a.aniDesc = "";
  654. a.upgradeText = "UPGRADED to a KING CRAB!";
  655. a.aniCol = "#971f0e";
  656. a.skinName = "kingcrab";
  657. break;
  658. case Ma:
  659. a.aniName = "Lemming";
  660. a.aniDesc = "";
  661. a.upgradeText = "";
  662. a.aniCol = "#A77C30";
  663. a.skinName = "arctic/lemming";
  664. break;
  665. case Ca:
  666. a.aniName = "Frog";
  667. a.aniDesc = "";
  668. a.upgradeText = "UPGRADED to Frog!!";
  669. a.aniCol = "#FF9000";
  670. a.skinName = "frog/frog";
  671. break;
  672. case Na:
  673. a.aniName = "Ostrich";
  674. a.aniDesc = "";
  675. a.upgradeText = "UPGRADED to Ostrich! Lay eggs to hatch babies! \nCommand babies by placing your crosshair (right-click/W)-\n They can attack prey!";
  676. a.aniCol = "#FF9000";
  677. a.skinName = "ostrich/ostrich";
  678. break;
  679. case _a:
  680. a.aniName = "Pelican";
  681. a.aniDesc = "";
  682. a.upgradeText = "UPGRADED to Pelican! \nPick up water (and prey!) in your mouth,\nfly, and drop water on prey! (press W again)";
  683. a.aniCol = "#FF9000";
  684. a.skinName = "pelican/pelican";
  685. break;
  686. case Sa:
  687. a.aniName = "Falcon";
  688. a.aniDesc = "";
  689. a.upgradeText = "UPGRADED to Falcon! \nFly, and do a powerful dive attack! Aim it well.";
  690. a.aniCol = "#FF9000";
  691. a.skinName = "falcon/falcon";
  692. break;
  693. case Ea:
  694. a.aniName = "Snowy Owl";
  695. a.aniDesc = "";
  696. a.upgradeText = "UPGRADED to Snowy Owl!\n Aim the crosshair, \n right click/W when it's on top of prey, to attack!";
  697. a.aniCol = "#FF9000";
  698. a.skinName = "snowyowl/snowyowl";
  699. break;
  700. case Oa:
  701. a.aniName = "Baby Ostrich";
  702. a.aniDesc = "";
  703. a.upgradeText = "UPGRADED to Baby Ostrich!!";
  704. a.aniCol = "#FF9000";
  705. a.skinName = "ostrich/baby-ostrich";
  706. break;
  707. default:
  708. a.aniName = "(Animal)", a.aniDesc = "", a.upgradeText = "UPGRADED!"
  709. }
  710. return a
  711. },
  712. Fa = 100,
  713. Wa = 101,
  714. Ga = 0,
  715. Ha = 1,
  716. za = 2,
  717. ja = 3,
  718. La = 4,
  719. Xa = 5,
  720. Ya = 6,
  721. Va = 7,
  722. Ka = 8,
  723. Ja = 9,
  724. qa = 10,
  725. Za = 11,
  726. Qa = 12,
  727. $a = 13,
  728. et = 14,
  729. at = 15,
  730. tt = 16,
  731. it = 17,
  732. st = 18,
  733. rt = 19,
  734. nt = 20,
  735. ot = 21,
  736. lt = 22,
  737. ht = 23,
  738. ct = 24,
  739. dt = 25,
  740. pt = 26,
  741. gt = 27,
  742. mt = 28,
  743. ft = 30,
  744. ut = 31,
  745. bt = 32,
  746. yt = 33,
  747. wt = 34,
  748. kt = 35,
  749. Pt = 36,
  750. At = 37,
  751. Tt = 38,
  752. It = 39,
  753. vt = 40,
  754. Dt = 41,
  755. Mt = 42,
  756. xt = 43,
  757. Ct = 46,
  758. Nt = 47,
  759. _t = 48,
  760. St = 49,
  761. Et = 51,
  762. Ut = 54,
  763. Bt = 55,
  764. Ot = 56,
  765. Rt = 57,
  766. Ft = 58,
  767. Wt = 59,
  768. Gt = 60,
  769. Ht = 61,
  770. zt = 62,
  771. jt = function(e) {
  772. var a = {};
  773. switch (e) {
  774. case bt:
  775. a.abilName = "Tail Slap";
  776. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  777. break;
  778. case ut:
  779. a.abilName = "Trunk Hit";
  780. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  781. break;
  782. case Fa:
  783. a.abilName = "Dive";
  784. a.abilImg = "img/ability_dive.png";
  785. break;
  786. case dt:
  787. a.abilName = "Dig For Food";
  788. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  789. break;
  790. case za:
  791. a.abilName = "Shell";
  792. a.abilImg = "skins/" + Ra(pr).skinName + "2.png";
  793. break;
  794. case ot:
  795. a.abilName = "Bite Drag";
  796. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  797. break;
  798. case Pt:
  799. a.abilName = "Suffocate prey";
  800. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  801. break;
  802. case Bt:
  803. a.abilName = "Fly with water";
  804. a.abilImg = "skins/pelican/ability_pelican.png";
  805. break;
  806. case Va:
  807. a.abilName = "Disguise";
  808. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  809. break;
  810. case lt:
  811. a.abilName = "Burrow Hole";
  812. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  813. break;
  814. case ht:
  815. a.abilName = "Pull from Hole";
  816. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  817. break;
  818. case Ja:
  819. a.abilName = "Charge";
  820. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  821. break;
  822. case it:
  823. a.abilName = "Roll snow";
  824. a.abilImg = "img/snowball.png";
  825. break;
  826. case wt:
  827. a.abilName = "Venom Spit";
  828. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  829. break;
  830. case kt:
  831. a.abilName = "Spin Web";
  832. a.abilImg = "img/spiderWeb.png";
  833. break;
  834. case $a:
  835. a.abilName = "Throw Snow";
  836. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  837. break;
  838. case tt:
  839. a.abilName = "Drop Snow";
  840. a.abilImg = "img/snowball.png";
  841. break;
  842. case st:
  843. a.abilName = "Loud Noise";
  844. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  845. break;
  846. case et:
  847. a.abilName = "Claw Slash";
  848. a.abilImg = "img/ability_claw.png";
  849. break;
  850. case La:
  851. a.abilName = "Ink";
  852. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  853. break;
  854. case ja:
  855. a.abilName = "Shock";
  856. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  857. break;
  858. case Ha:
  859. a.abilName = "Hold to Dig";
  860. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  861. break;
  862. case Qa:
  863. a.abilName = "Howl";
  864. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  865. break;
  866. case ct:
  867. a.abilName = "Throw Banana";
  868. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  869. break;
  870. case mt:
  871. a.abilName = "Cause Wave";
  872. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  873. break;
  874. case at:
  875. a.abilName = "Extra Boost";
  876. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  877. break;
  878. case Ka:
  879. a.abilName = "Slide on ice";
  880. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  881. break;
  882. case qa:
  883. a.abilName = "Inflate";
  884. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  885. break;
  886. case St:
  887. a.abilName = "Spikes";
  888. a.abilImg = "skins/" + Ra(pr).skinName + "2.png";
  889. break;
  890. case rt:
  891. a.abilName = "Fire";
  892. a.abilImg = "img/fire.png";
  893. break;
  894. case ft:
  895. a.abilName = "Fire";
  896. a.abilImg = "img/fire.png";
  897. break;
  898. case Et:
  899. a.abilName = "Arm Smash";
  900. a.abilImg = "img/ability_crabSmashSkin.png";
  901. break;
  902. case At:
  903. a.abilName = "Jaws Bite";
  904. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  905. break;
  906. case Ct:
  907. a.abilName = "Jaws Bite";
  908. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  909. break;
  910. case Ut:
  911. a.abilName = "Command Babies";
  912. a.abilImg = "skins/ostrich/ostrich-baby.png";
  913. break;
  914. case Ft:
  915. a.abilName = "Target prey";
  916. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  917. break;
  918. case Rt:
  919. a.abilName = "Sky dive";
  920. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  921. break;
  922. case Tt:
  923. a.abilName = "Ambush Attack";
  924. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  925. break;
  926. case Mt:
  927. a.abilName = "Stomp";
  928. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  929. break;
  930. case Nt:
  931. a.abilName = "Fly with prey";
  932. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  933. break;
  934. case _t:
  935. a.abilName = "Stink";
  936. a.abilImg = "skins/" + Ra(pr).skinName + ".png";
  937. break;
  938. default:
  939. a.abilName = "Ability", a.abilImg = "skins/" + Ra(pr).skinName + ".png"
  940. }
  941. return a
  942. },
  943. Lt = function(e, a) {
  944. return Math.random() * (a - e) + e
  945. },
  946. Xt = function(e, a) {
  947. return Math.floor(Math.random() * (a - e + 1)) + e
  948. },
  949. Yt = function(e) {
  950. e = Math.trunc(e) % 360 + (e - Math.trunc(e));
  951. return 0 < e ? e : e + 360
  952. },
  953. Vt = function(e) {
  954. e = e.split(".");
  955. return 256 * (256 * (256 * +e[0] + +e[1]) + +e[2]) + +e[3]
  956. },
  957. Kt = function(e) {
  958. for (var a = e % 256, t = 3; 0 < t; t--) e = Math.floor(e / 256), a = e % 256 + "." + a;
  959. return a
  960. },
  961. Jt = function(e, a) {
  962. var t = a.split("?")[0],
  963. i, s;
  964. i = -1 !== a.indexOf("?") ? a.split("?")[1] : "";
  965. if ("" !== i) {
  966. s = i.split("&");
  967. for (var r = s.length - 1; 0 <= r; --r) i = s[r].split("=")[0], i === e && s.splice(r, 1);
  968. t = t + "?" + s.join("&")
  969. }
  970. return t
  971. },
  972. qt = function(e) {
  973. return 180 / Math.PI * e
  974. },
  975. Zt = function(e) {
  976. return Math.PI / 180 * e
  977. },
  978. Qt = function(e, a, t, i) {
  979. return Math.atan2(i - a, t - e)
  980. },
  981. $t = function(e, a) {
  982. return 0 != (e >> a) % 2
  983. },
  984. ei = function(e, a, t) {
  985. return t ? e | 1 << a : e & ~(1 << a)
  986. },
  987. ai = function(e, a) {
  988. var t = Yt(qt(a - e));
  989. 180 < t && (t -= 360);
  990. return Zt(t)
  991. },
  992. ti = function(e, a, t) {
  993. return Math.min(t, Math.max(a, e))
  994. },
  995. ii = function(e) {
  996. return unescape(encodeURIComponent(e))
  997. },
  998. si = function(e) {
  999. return decodeURIComponent(escape(e))
  1000. },
  1001. ri = function(e, a, t) {
  1002. var i = 1.2 * Zi.measureText("M").width;
  1003. e = e.split("\n");
  1004. for (var s = 0; s < e.length; ++s) Zi.fillText(e[s], a, t), t += i
  1005. },
  1006. ni = function(e) {
  1007. var a = parseInt(e, 10),
  1008. t = Math.floor(a / 3600);
  1009. e = Math.floor((a - 3600 * t) / 60);
  1010. a = a - 3600 * t - 60 * e;
  1011. 10 > a && (a = "0" + a);
  1012. return e + ":" + a
  1013. },
  1014. oi = function(e) {
  1015. return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
  1016. },
  1017. li = function(e) {
  1018. return hi(e)
  1019. },
  1020. hi = function(e, a) {
  1021. if (null === e) return null;
  1022. if (0 === e) return "0";
  1023. a = !a || 0 > a ? 0 : a;
  1024. var t = e.toPrecision(2).split("e"),
  1025. t = 1 === t.length ? 0 : Math.floor(Math.min(t[1].slice(1), 14) / 3),
  1026. i = 1 > t ? e.toFixed(0 + a) : (e / Math.pow(10, 3 * t)).toFixed(2);
  1027. return (0 > i ? i : Math.abs(i)) + ["", "K", "M", "B", "T"][t]
  1028. },
  1029. ci = function(e, a, t, i) {
  1030. Zi.fillStyle = i;
  1031. Zi.beginPath();
  1032. Zi.arc(e, a, Math.max(0, t), 0, 2 * Math.PI);
  1033. Zi.fill()
  1034. },
  1035. di = function(e, a, t, i) {
  1036. return t * Math.sin(i * Math.PI / a * e)
  1037. };
  1038. pi.prototype = {
  1039. strokeW: 1,
  1040. strokeColor: "#000000",
  1041. multiLine: !1,
  1042. _text: "",
  1043. _color: "#000000",
  1044. x: 0,
  1045. y: 0,
  1046. _fntSize: 16,
  1047. _canvas: null,
  1048. _ctx: null,
  1049. _dirty: !1,
  1050. renderScale: 1.5,
  1051. _scale: 1,
  1052. width: 0,
  1053. height: 0,
  1054. setColor: function(e) {
  1055. this._color != e && (this._color = e, this._dirty = !0)
  1056. },
  1057. setFontSize: function(e) {
  1058. this._fntSize != e && (this._fntSize = e, this._dirty = !0)
  1059. },
  1060. setText: function(e) {
  1061. e != this._text && (this._text = e, this._dirty = !0)
  1062. },
  1063. getRenderedCanvas: function() {
  1064. null == this._canvas && (this._canvas = document.createElement("canvas"), this._ctx = this._canvas.getContext("2d"));
  1065. if (this._dirty) {
  1066. this._dirty = !1;
  1067. var e = this._canvas,
  1068. a = this._ctx,
  1069. t = this._text,
  1070. i = this._scale,
  1071. s = this._fntSize * this.renderScale,
  1072. r = s + "px Arial";
  1073. a.font = r;
  1074. var n = ~~(.2 * s);
  1075. a.font = r;
  1076. if (this.multiLine) {
  1077. for (var o = 1.2 * a.measureText("M").width, t = t.split("\n"), l = 0, h = 0; h < t.length; ++h) l = Math.max(l, a.measureText(t[h]).width);
  1078. this.width = (l + 6) * i;
  1079. this.height = (o * t.length + n) * i;
  1080. e.width = this.width;
  1081. e.height = this.height;
  1082. this.width /= this.renderScale;
  1083. this.height /= this.renderScale;
  1084. a.globalAlpha = 1;
  1085. a.font = r;
  1086. 0 < this.strokeW && (a.shadowOffsetX = this.strokeW, a.shadowOffsetY = this.strokeW, a.shadowColor = this.strokeColor);
  1087. a.fillStyle = this._color;
  1088. a.textAlign = "center";
  1089. e = 3 + e.width / 2;
  1090. s -= n / 2;
  1091. for (h = 0; h < t.length; ++h) a.fillText(t[h], e, s), s += o
  1092. } else this.width = (a.measureText(t).width + 6) * i, this.height = (s + n) * i, e.width = this.width, e.height = this.height, this.width /= this.renderScale, this.height /= this.renderScale, a.globalAlpha = 1, a.font = r, 0 < this.strokeW && (a.shadowOffsetX = this.strokeW, a.shadowOffsetY = this.strokeW, a.shadowColor = this.strokeColor), a.fillStyle = this._color, a.fillText(t, 3, s - n / 2)
  1093. }
  1094. return this._canvas
  1095. },
  1096. draw: function() {
  1097. if (this._text) {
  1098. var e = this.renderScale,
  1099. a = this.getRenderedCanvas(),
  1100. t = a.width / e,
  1101. e = a.height / e;
  1102. Zi.drawImage(a, this.x - t / 2, this.y - e / 2, t, e)
  1103. }
  1104. }
  1105. };
  1106.  
  1107. function pi(e, a) {
  1108. e && (this._fntSize = e);
  1109. a && (this._color = a)
  1110. }
  1111. window.CachedText = pi;
  1112.  
  1113. function gi(e, a, t, i, s, r) {
  1114. this.x = e;
  1115. this.y = a;
  1116. this.w = t;
  1117. this.h = i;
  1118. this.aniT = s;
  1119. this.buttonTXT = new pi(12, "white");
  1120. this.buttonTXT.renderScale = 1.5;
  1121. this.buttonTXT.setText(Ra(s).aniName);
  1122. this.isHighLighted = !1;
  1123. this.biomeNum = r;
  1124. e = new Cn(0, f, 0, 0, 30);
  1125. e.animalType = s;
  1126. e.x = e.ox = e.nx = 0;
  1127. e.y = e.oy = e.ny = 0;
  1128. e.rad = e.oRad = e.nRad = 30;
  1129. e.alwaysPlainOutline = !0;
  1130. this.drawnAniObj = e;
  1131. this.buttonScaleF = 1;
  1132. this.testPosHitsButton = function(e, a) {
  1133. return e < this.x - this.w / 2 || e > this.x + this.w / 2 ? !1 : a < this.y - this.w / 2 || a > this.y + this.w / 2 ? !1 : !0
  1134. };
  1135. this.setPosAndSize = function(e, a, t, i, s, r) {
  1136. this.w = t;
  1137. this.h = i;
  1138. this.x = e + t * (.5 - s);
  1139. this.y = a + i * (.5 - r)
  1140. };
  1141. this.draw = function() {
  1142. Zi.save();
  1143. Zi.translate(this.x, this.y);
  1144. Zi.scale(this.buttonScaleF, this.buttonScaleF);
  1145. var e = Zi.globalAlpha;
  1146. Zi.globalAlpha = .75 * e;
  1147. switch (this.biomeNum) {
  1148. case 1:
  1149. Zi.fillStyle = "#1C91B8";
  1150. break;
  1151. case 0:
  1152. Zi.fillStyle = "#26A73A";
  1153. break;
  1154. case 2:
  1155. Zi.fillStyle = "#B2B2B2"
  1156. }
  1157. Zi.fillRect(0 - this.w / 2, 0 - this.h / 2, this.w, this.h);
  1158. this.isHighLighted && (Zi.fillStyle = "white", Zi.globalAlpha = .2 * e, Zi.fillRect(0 - this.w / 2, 0 - this.h / 2, this.w, this.h));
  1159. Zi.globalAlpha = e;
  1160. this.drawnAniObj.nRad = this.drawnAniObj.rad = .6 * t / 2 * fs;
  1161. Zi.save();
  1162. Zi.scale(2, 2);
  1163. this.drawnAniObj.draw();
  1164. Zi.restore();
  1165. this.buttonTXT.setFontSize(23 * fs);
  1166. this.buttonTXT.x = 0;
  1167. this.buttonTXT.y = .375 * -this.h;
  1168. this.buttonTXT.draw();
  1169. Zi.restore()
  1170. }
  1171. }
  1172. window.AniChoiceButton = gi;
  1173. mi.prototype = {
  1174. x: 0,
  1175. y: 0,
  1176. w: 0,
  1177. h: 0,
  1178. visible: !0,
  1179. buttonTXT: null,
  1180. pressed: !1,
  1181. pressedTouchID: -1,
  1182. touchEnabled: !0,
  1183. testPosHitsButton: function(e, a) {
  1184. return e < this.x - this.w / 2 || e > this.x + this.w / 2 ? !1 : a < this.y - this.w / 2 || a > this.y + this.w / 2 ? !1 : !0
  1185. },
  1186. setPosAndSize: function(e, a, t, i, s, r) {
  1187. this.w = t;
  1188. this.h = i;
  1189. this.x = e + t * (.5 - s);
  1190. this.y = a + i * (.5 - r)
  1191. },
  1192. onButtonTouchStart: function() {},
  1193. onButtonTouchEnd: function() {}
  1194. };
  1195.  
  1196. function mi(e) {
  1197. this.buttonTXT = new pi(10, "white");
  1198. this.buttonTXT.renderScale = 1.5;
  1199. this.buttonTXT.setText(e);
  1200. this.draw = function() {
  1201. this.visible && (Zi.save(), Zi.globalAlpha = .2, Zi.fillStyle = this.pressed ? "white" : "#000000", Zi.fillRect(this.x - this.w / 2, this.y - this.h / 2, this.w, this.h), Zi.globalAlpha = .2, this.buttonTXT.setFontSize(15 * $i), this.buttonTXT.x = this.x, this.buttonTXT.y = this.y, this.buttonTXT.draw(), Zi.restore())
  1202. }
  1203. }
  1204. window.TouchButton = mi;
  1205. var fi = function() {
  1206. this.buttonTXT = new pi(10, "white");
  1207. this.buttonTXT.renderScale = 1.5;
  1208. this.isMiniRechargeBut = !1;
  1209. this.abil_Type = 0;
  1210. this.abil_possible = this.abil_usable = this.abil_recharging = this.abil_active = !1;
  1211. this.abil_avilableA = this.abil_rechargeBarA = this.abil_rechargeTotalT = this.abil_rechargeEndT = 0;
  1212. this.draw = function() {
  1213. if (this.visible && (this.abil_rechargeBarA += .1 * ((this.abil_recharging ? 1 : 0) - this.abil_rechargeBarA), this.abil_avilableA += .1 * ((this.abil_usable || this.abil_active ? 1 : .2) - this.abil_avilableA), this.isMiniRechargeBut && (this.h = .6 * this.w), this.abil_possible)) {
  1214. Zi.save();
  1215. this.isMiniRechargeBut ? (this.h = .8 * this.w, Zi.translate(this.x, this.y + .36 * this.h), Zi.scale(.65, .65)) : Zi.translate(this.x, this.y);
  1216. var e = .2 * this.abil_avilableA,
  1217. a = this.pressed || Ts ? "#CECECE" : "#000000";
  1218. this.abil_active && (a = Gi, e = .7);
  1219. Zi.fillStyle = a;
  1220. Zi.globalAlpha = 1 * e;
  1221. Zi.fillRect(0 - this.w / 2, 0 - this.h / 2, this.w, this.h);
  1222. e = jt(this.abil_Type);
  1223. if (this.abil_Type == rt || this.abil_Type == ft) {
  1224. if (a = Ns("img/fireball/" + Math.trunc(Yi / 120) % 5 + ".png")) {
  1225. var t = .4 * this.w,
  1226. i = 0;
  1227. Fs[dr] && (i = di((Yi - Fs[dr].spawnTime) / 1e3, 1, 10, 2));
  1228. Zi.globalAlpha = 1 * this.abil_avilableA;
  1229. Zi.drawImage(a, -t, .85 * -t - i, 2 * t, 2 * t + i)
  1230. }
  1231. } else if (a = Ns(e.abilImg)) t = .4 * this.w, Zi.globalAlpha = 1 * this.abil_avilableA, Zi.drawImage(a, -t, .85 * -t, 2 * t, 2 * t);
  1232. this.buttonTXT.setText(e.abilName);
  1233. this.buttonTXT.setFontSize(15 * $i);
  1234. this.buttonTXT.x = 0;
  1235. this.buttonTXT.y = .35 * -this.w;
  1236. this.buttonTXT.draw();
  1237. e = Math.max(0, this.abil_rechargeEndT - Yi);
  1238. this.abil_rechargeBarA += .1 * ((this.abil_recharging ? 1 : 0) - this.abil_rechargeBarA);
  1239. .01 < this.abil_rechargeBarA && (Zi.globalAlpha = .35 * this.abil_rechargeBarA, Zi.fillStyle = "#000000", a = .8 * this.w, t = .5 * this.h, Zi.fillRect(0 - a / 2, 0 - t / 2, a, t), Zi.globalAlpha = 1 * this.abil_rechargeBarA, Zi.fillStyle = "#F3C553", Zi.fillRect(0 - a / 2, 0 - t / 2, e / this.abil_rechargeTotalT * a, t));
  1240. Zi.restore()
  1241. }
  1242. }
  1243. };
  1244. fi.prototype = Object.create(mi.prototype);
  1245. window.AbilityButton = fi;
  1246.  
  1247. function ui(e) {
  1248. e = e.split("+").join(" ");
  1249. for (var a = {}, t, i = /[?&]?([^=]+)=([^&]*)/g; t = i.exec(e);) a[decodeURIComponent(t[1])] = decodeURIComponent(t[2]);
  1250. return a
  1251. }
  1252. var bi = ui(document.location.search),
  1253. yi = 0 < bi.mobileios,
  1254. wi = 0 < bi.mobileAndroid,
  1255. ki = yi || wi,
  1256. Pi = 0 < bi.videoson,
  1257. Ai = bi.server,
  1258. Ti = .175,
  1259. Ii = "#3FBA54",
  1260. vi = "#f7f7f7",
  1261. Di = "#09992F",
  1262. Mi = "#007ec0",
  1263. xi = "grey",
  1264. Ci = "#09992F",
  1265. Ni = "#4E66E4",
  1266. _i = "#ff6000",
  1267. Si = "#5e69a0",
  1268. Ei = Si,
  1269. Ui = "#c8b745",
  1270. Bi = "#F35F53",
  1271. Oi = "#CF6259",
  1272. Ri = "#FF911E",
  1273. Fi = "#C67019",
  1274. Wi = "#EF3C31",
  1275. Gi = "#4AE05E",
  1276. Hi = "#8C9688",
  1277. zi = function(e) {
  1278. switch (e) {
  1279. case Li:
  1280. return Mi;
  1281. case Xi:
  1282. return xi;
  1283. default:
  1284. case ji:
  1285. return Di
  1286. }
  1287. },
  1288. ji = 0,
  1289. Li = 1,
  1290. Xi = 2,
  1291. Yi = +new Date,
  1292. Vi = +new Date,
  1293. Ki = document.getElementById("gCanvas"),
  1294. Ji = null,
  1295. qi = null,
  1296. Zi = Ki.getContext("2d");
  1297. Zi.shadowColor = "black";
  1298. var Qi = !1,
  1299. $i = Math.min(window.devicePixelRatio, 2),
  1300. es = 1 == ("ontouchstart" in window || navigator.maxTouchPoints);
  1301. es && console.log("mobile touch device detected!");
  1302. var as = {},
  1303. ts = function(e) {
  1304. if (!as.hasOwnProperty(e) && !$s) {
  1305. var a = new Audio(e);
  1306. console.log("loading audio: " + e);
  1307. as[e] = a;
  1308. a.volume = .7;
  1309. a.muted = $s
  1310. }
  1311. return as[e]
  1312. },
  1313. is = null,
  1314. ss = "",
  1315. rs = "audio/music_game.mp3",
  1316. ns = function(e) {
  1317. is && (is.pause(), is.currentTime = 0);
  1318. ss = e;
  1319. if (!$s) {
  1320. console.log("changed music to " + e);
  1321. is = ts(e, !0);
  1322. try {
  1323. is.play()
  1324. } catch (e) {}
  1325. }
  1326. },
  1327. os = function() {
  1328. var e = document.getElementById("button_mute_img");
  1329. if (e) {
  1330. e.src = $s ? "img/sound_off.png" : "img/sound_on.png";
  1331. for (var a in as) as.hasOwnProperty(a) && (as[a].muted = $s);
  1332. !$s && ss && null == is && ns(ss)
  1333. }
  1334. },
  1335. ls = camzoom_n = 2.7,
  1336. ls = 1,
  1337. hs = 0,
  1338. cs = 0,
  1339. ds = 0,
  1340. ps = 0,
  1341. gs = 0,
  1342. ms = 0,
  1343. fs = 1,
  1344. us = 0,
  1345. bs = 0,
  1346. ys = 0,
  1347. ws = 0,
  1348. ks = 0,
  1349. Ps = 0,
  1350. As = !1,
  1351. Ts = !1,
  1352. Is = 0,
  1353. vs = 0,
  1354. Ds = 0,
  1355. Ms = 0,
  1356. xs = 1,
  1357. Cs = {},
  1358. Ns = function(e) {
  1359. Cs.hasOwnProperty(e) || (Cs[e] = new Image, Cs[e].src = e);
  1360. return 0 != Cs[e].width && Cs[e].complete ? Cs[e] : null
  1361. },
  1362. _s = 100,
  1363. Ss = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0),
  1364. Es = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0),
  1365. Us = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0),
  1366. Bs = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0),
  1367. Os = !1,
  1368. Rs = [],
  1369. Fs = {},
  1370. Ws = [],
  1371. Gs = !1,
  1372. Hs = 0,
  1373. zs = 1,
  1374. js = !1,
  1375. Ls = 0,
  1376. Xs = 1,
  1377. Ys = !1,
  1378. Vs = +new Date,
  1379. Ks = !1,
  1380. Js = !1,
  1381. qs = !1,
  1382. Zs = !1,
  1383. Qs = !1,
  1384. $s = !1,
  1385. er = !1;
  1386. if (window.localStorage) {
  1387. Ks = 0 < window.localStorage.getItem("options_noImages") + 0;
  1388. document.getElementById("options_noImages").checked = Ks;
  1389. Js = 0 < window.localStorage.getItem("options_noNames") + 0;
  1390. document.getElementById("options_noNames").checked = Js;
  1391. qs = 0 < window.localStorage.getItem("options_lowGraphics") + 0;
  1392. document.getElementById("options_lowGraphics").checked = qs;
  1393. Zs = 0 < window.localStorage.getItem("options_noJoystick") + 0;
  1394. document.getElementById("options_noJoystick").checked = Zs;
  1395. Zs = 0 < window.localStorage.getItem("options_noJoystick") + 0;
  1396. document.getElementById("options_noJoystick").checked = Zs;
  1397. var Qs = 0 < window.localStorage.getItem("options_leftHanded") + 0,
  1398. ar = document.getElementById("options_leftHanded");
  1399. ar && (ar.checked = Qs);
  1400. $s = 0 < window.localStorage.getItem("options_muted") + 0;
  1401. os()
  1402. }
  1403. var tr = 0,
  1404. ir = 0,
  1405. sr = +new Date,
  1406. rr = "... fps",
  1407. nr = +new Date,
  1408. or = 0,
  1409. lr = 0,
  1410. hr = "...",
  1411. cr = 0,
  1412. dr = 0,
  1413. pr = c,
  1414. gr = !1,
  1415. mr = !1,
  1416. fr = !1,
  1417. ur = !1,
  1418. br = +new Date,
  1419. yr = !1,
  1420. wr = !1,
  1421. kr = waterBarPerc_n = 100,
  1422. Pr = xp = xpPer = 0,
  1423. Ar = new pi(16, "white"),
  1424. Tr = new pi(16, "white"),
  1425. Ir = new pi(16, "white"),
  1426. vr = new pi(10, "white");
  1427. Ir.multiLine = !0;
  1428. Ir.renderScale = 1;
  1429. vr.renderScale = 1;
  1430. var Dr = 0,
  1431. Mr = 0,
  1432. xr = "",
  1433. Cr = [],
  1434. Nr = new fi;
  1435. Nr.onButtonTouchStart = function() {
  1436. vl(Pl, !0)
  1437. };
  1438. Nr.onButtonTouchEnd = function() {
  1439. vl(Pl, !1);
  1440. Sr.pressed && -1 == Sr.pressedTouchID && (Sr.pressed = !1, vl(kl, !1))
  1441. };
  1442. Cr.push(Nr);
  1443. var _r = new fi;
  1444. _r.isMiniRechargeBut = !0;
  1445. _r.touchEnabled = !1;
  1446. Cr.push(_r);
  1447. var Sr = new mi("RUN");
  1448. Sr.onButtonTouchStart = function() {
  1449. vl(kl, !0)
  1450. };
  1451. Sr.onButtonTouchEnd = function() {
  1452. vl(kl, !1)
  1453. };
  1454. Cr.push(Sr);
  1455. var Er = new mi("CHAT");
  1456. Er.onButtonTouchStart = function() {
  1457. ul()
  1458. };
  1459. Cr.push(Er);
  1460. var Ur = new mi("S");
  1461. Ur.onButtonTouchStart = function() {
  1462. vl(Il, !0)
  1463. };
  1464. Cr.push(Ur);
  1465. var Br = new mi("DOWN҆“");
  1466. Br.onButtonTouchStart = function() {
  1467. vl(Tl, !0)
  1468. };
  1469. Cr.push(Br);
  1470. var Or = !1,
  1471. Rr = -1,
  1472. Fr = 0,
  1473. Wr = 0,
  1474. Gr = 0,
  1475. Hr = 0,
  1476. zr = 50,
  1477. jr = 0,
  1478. Lr = 0,
  1479. Xr = 0,
  1480. Yr = 0,
  1481. Vr = 0,
  1482. Vi = +Date.now(),
  1483. Kr = null,
  1484. Jr = !1;
  1485. if (!ki) {
  1486. var qr = document.createElement("div");
  1487. qr.innerHTML = "&nbsp;";
  1488. qr.className = "adsbox";
  1489. document.body.appendChild(qr);
  1490. window.setTimeout(function() {
  1491. 0 === qr.offsetHeight && (Jr = !0, document.getElementById("blockedImg").style.display = "block");
  1492. qr.remove();
  1493. console.log("AdBlock Enabled? ", Jr)
  1494. }, 1e3)
  1495. }
  1496. ki || (function(e, a, t, i, s, r, n) {
  1497. e.GoogleAnalyticsObject = s;
  1498. e[s] = e[s] || function() {
  1499. (e[s].q = e[s].q || []).push(arguments)
  1500. };
  1501. e[s].l = 1 * new Date;
  1502. r = a.createElement(t);
  1503. n = a.getElementsByTagName(t)[0];
  1504. r.async = 1;
  1505. r.src = i;
  1506. n.parentNode.insertBefore(r, n)
  1507. }(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga"), ga("create", "UA-36494583-11", "auto"), ga("send", "pageview"));
  1508. var Zr = 0,
  1509. Qr = 0;
  1510. if (window.localStorage) var $r = 1 * window.localStorage.getItem("lastAdShowT") || 0,
  1511. en = +new Date - $r,
  1512. Qr = 0 < en ? $r : 0,
  1513. Zr = 1 * window.localStorage.getItem("gamesSinceAd");
  1514. var an = 0,
  1515. tn = +new Date,
  1516. sn = !1,
  1517. rn = function() {
  1518. return on() ? Pi ? (console.log("videoAd: test mode, always show video ad!"), !0) : Jr ? (console.log("videoAd: no show: ad blocker on!"), !1) : 120 < (+new Date - Qr) / 1e3 && 0 < Zr ? (console.log("videoAd: show: time limit passed!"), !0) : 2 <= Zr ? (console.log("videoAd: show: 3+ games passed!"), !0) : !1 : (console.log("videoAd: no show: ads disabled"), !1)
  1519. },
  1520. nn = !1,
  1521. on = function() {
  1522. var e = !ki && !t;
  1523. return nn ? e && "undefined" != typeof adplayer : e
  1524. },
  1525. ln = function() {
  1526. nn && mn("//api.adinplay.com/player/v2/MOP/mope.io/player.min.js", function() {
  1527. "undefined" != typeof aipPlayer ? (console.log("Loading video preroll..."), adplayer = new aipPlayer({
  1528. AD_WIDTH: 960,
  1529. AD_HEIGHT: 540,
  1530. AD_FULLSCREEN: !1,
  1531. PREROLL_ELEM: document.getElementById("preroll"),
  1532. AIP_COMPLETE: function() {
  1533. console.log("Video ad finished.");
  1534. gn(!0)
  1535. }
  1536. })) : (console.log("Video ad (blocked) -finished."), gn(!1))
  1537. })
  1538. },
  1539. hn = !1,
  1540. cn = !1,
  1541. dn = new pi(10, "white");
  1542. dn.setText("Connecting...");
  1543. dn.renderScale = 1;
  1544. var pn = function() {
  1545. is && (is.volume = .2);
  1546. sn = !0;
  1547. document.getElementById("startMenuWrapper").style.display = "none";
  1548. hn = !0;
  1549. cn = !1;
  1550. nn ? adplayer.startPreRoll() : (document.getElementById("pvVidContainer").style.display = "block", wn())
  1551. },
  1552. gn = function(e) {
  1553. sn || console.log("ad isn't playing!");
  1554. hn = cn = sn = !1;
  1555. nn || (document.getElementById("pvVidContainer").style.display = "none", document.getElementById("my-content-2").style.display = "none");
  1556. if (e && (Zr = 0, Qr = +new Date, window.localStorage)) try {
  1557. window.localStorage.setItem("lastAdShowT", Qr), window.localStorage.setItem("gamesSinceAd", Zr)
  1558. } catch (e) {}
  1559. is && (is.volume = .7);
  1560. var a = ts("audio/click.mp3");
  1561. if (a) try {
  1562. a.play()
  1563. } catch (e) {}
  1564. console.log("Video done (success: " + e + "), joining game!");
  1565. dl(!1)
  1566. },
  1567. mn = function(e, a) {
  1568. var t = document.head || document.getElementsByTagName("head")[0],
  1569. i = document.createElement("script"),
  1570. s = !0;
  1571. i.async = "async";
  1572. i.type = "text/javascript";
  1573. i.charset = "UTF-8";
  1574. i.src = e;
  1575. i.onload = i.onreadystatechange = function() {
  1576. !s || i.readyState && !/loaded|complete/.test(i.readyState) || (s = !1, a(), i.onload = i.onreadystatechange = null)
  1577. };
  1578. t.appendChild(i)
  1579. };
  1580. ki || ln();
  1581. var fn = !1,
  1582. un = null,
  1583. bn = "player-2",
  1584. yn = !0,
  1585. wn = function(e) {
  1586. fn = !1;
  1587. e = document.getElementById("pvVidContainer");
  1588. un = setTimeout(function() {
  1589. console.log("Error: ad failed to start playing in time!");
  1590. gn(!0)
  1591. }, 1e4);
  1592. try {
  1593. script = document.createElement("script"), script.src = "http://cdn.playwire.com/bolt/js/zeus/embed.js", script.type = "text/javascript", script.id = "script", script.setAttribute("charset", "utf-8"), script.setAttribute("data-config", "http://config.playwire.com/1018393/v2/pre_content.json"), script.setAttribute("data-width", "100%"), script.setAttribute("data-height", "100%"), script.setAttribute("data-id", bn), script.setAttribute("data-onready", "onBoltLoaded"), script.setAttribute("data-post-ad-container", "my-content-2"), script.setAttribute("data-theme", "http://cdn.playwire.com/bolt/js/zeus/themes/orion/main.js"), e.appendChild(script), console.log("loading player...")
  1594. } catch (e) {
  1595. console.log("Error: " + e)
  1596. }
  1597. };
  1598. window.onBoltLoaded = function(e) {
  1599. console.log("onBoltLoaded: playerName '" + e + "'");
  1600. clearTimeout(un);
  1601. Bolt.on(e, "showHiddenContainer", function() {
  1602. console.log("BOLT showHiddenContainer fired");
  1603. gn(fn)
  1604. });
  1605. Bolt.on(e, Bolt.BOLT_AD_STARTED, function() {
  1606. console.log("AD STARTED: SUCCESS");
  1607. fn = cn = !0
  1608. });
  1609. Bolt.on(e, Bolt.BOLT_AD_ERROR, function() {
  1610. console.log("AD ERROR EVENT FIRED");
  1611. gn(fn)
  1612. })
  1613. };
  1614. var kn;
  1615.  
  1616. function Pn(e) {
  1617. if (window.WebViewJavascriptBridge) return e(WebViewJavascriptBridge);
  1618. if (window.WVJBCallbacks) return window.WVJBCallbacks.push(e);
  1619. window.WVJBCallbacks = [e];
  1620. var a = document.createElement("iframe");
  1621. a.style.display = "none";
  1622. a.src = "wvjbscheme://__BRIDGE_LOADED__";
  1623. document.documentElement.appendChild(a);
  1624. setTimeout(function() {
  1625. document.documentElement.removeChild(a)
  1626. }, 0)
  1627. }
  1628. yi && Pn(function(e) {
  1629. kn = e
  1630. });
  1631. var An = function() {
  1632. kn && yi && kn.callHandler("adShowCallBack", {
  1633. foo: "bar"
  1634. }, function(e) {
  1635. console.log("JS got response " + e)
  1636. })
  1637. },
  1638. Tn = function() {
  1639. console.log("Showing ad android...");
  1640. window.location = "myscheme://showAdmob"
  1641. };
  1642. In.prototype = {
  1643. id: 0,
  1644. oType: E,
  1645. spawnTime: 0,
  1646. rPer: 0,
  1647. updateTime: 0,
  1648. x: 0,
  1649. y: 0,
  1650. ox: 0,
  1651. oy: 0,
  1652. nx: 0,
  1653. ny: 0,
  1654. rad: 0,
  1655. oRad: 0,
  1656. nRad: 0,
  1657. angle: 0,
  1658. oAngle: 0,
  1659. angleDelta: 0,
  1660. moveUpdF: 0,
  1661. z: 0,
  1662. name: "",
  1663. dead: !1,
  1664. type: 0,
  1665. curBiome: 0,
  1666. isRectangle: !1,
  1667. rectW: 0,
  1668. rectH: 0,
  1669. specType: 0,
  1670. toString: function() {
  1671. return "[GObj t=" + this.oType + " id=" + this.id + "]"
  1672. }
  1673. };
  1674. In.prototype.flag_hurt = !1;
  1675. In.prototype.hpPer = In.prototype.hpPer_n = In.prototype.hpBarA = 0;
  1676. In.prototype.hpBarTimeoutT = 0;
  1677. In.prototype.alwaysPlainOutline = !1;
  1678. In.prototype.doesDrawEffectScale = !1;
  1679. In.prototype.drawEffectScale_Slow = !1;
  1680. In.prototype.customDraw = function(e) {
  1681. switch (this.oType) {
  1682. case u:
  1683. switch (this.curBiome) {
  1684. case Li:
  1685. e ? ci(0, 0, this.rad, this.getOutlineColor()) : ci(0, 0, this.rad - 1.5, Ui);
  1686. break;
  1687. case Xi:
  1688. e ? ci(0, 0, this.rad, "white") : ci(0, 0, this.rad - 1.5, vi);
  1689. break;
  1690. default:
  1691. e ? ci(0, 0, this.rad, this.getOutlineColor()) : ci("", Di)
  1692. }
  1693. break;
  1694. case G:
  1695. Zi.save();
  1696. var a;
  1697. a = (Yi - this.spawnTime) / 1e3;
  1698. var t;
  1699. a = 1.5 * Math.sin(2 * Math.PI / 2 * a);
  1700. t = this.curBiome == Li ? Fi : Oi;
  1701. Zi.fillStyle = t;
  1702. var i = .8 * this.rad;
  1703. this.drawOutlinedCircle("", t);
  1704. Zi.globalAlpha *= .98;
  1705. var s = .5 * -i + 10 * this.rPer;
  1706. e = Math.max(0, .65 * i + a) + 2;
  1707. ci(.5 * -i, s, e, t);
  1708. s = .5 * -i - 10 * this.rPer;
  1709. e = Math.max(0, .73 * i - a);
  1710. ci(.5 * i, s, e, t);
  1711. e = Math.max(0, .78 * i + a);
  1712. ci(.6 * i, .4 * i, e, t);
  1713. s = .5 * i + 10 * this.rPer;
  1714. e = Math.max(0, .6 * i + this.rPer - a);
  1715. ci(.5 * -i, s, e, t);
  1716. Zi.restore();
  1717. break;
  1718. case x:
  1719. this.drawOutlinedCircle("", "#1AAE31");
  1720. Zi.save();
  1721. a = (Yi - this.spawnTime) / 1e3;
  1722. a = 1.5 * Math.sin(2 * Math.PI / 2 * a);
  1723. Zi.fillStyle = Ii;
  1724. s = .75 * this.rad;
  1725. Zi.globalAlpha *= .8;
  1726. Zi.beginPath();
  1727. Zi.arc(.5 * -s, .5 * -s + 10 * this.rPer, Math.max(0, .65 * s + a), 0, 2 * Math.PI);
  1728. Zi.fill();
  1729. Zi.beginPath();
  1730. Zi.arc(.5 * s, .5 * -s - 10 * this.rPer, Math.max(0, .73 * s - a), 0, 2 * Math.PI);
  1731. Zi.fill();
  1732. Zi.beginPath();
  1733. Zi.arc(.6 * s, .4 * s, Math.max(0, .78 * s + a), 0, 2 * Math.PI);
  1734. Zi.fill();
  1735. Zi.beginPath();
  1736. Zi.arc(.5 * -s, .5 * s, Math.max(0, .6 * s + this.rPer - a), 0, 2 * Math.PI);
  1737. Zi.fill();
  1738. Zi.restore();
  1739. break;
  1740. case H:
  1741. Zi.save();
  1742. a = (Yi - this.spawnTime) / 1e3;
  1743. a = 1.5 * Math.sin(2 * Math.PI / 2 * a);
  1744. i = .8 * this.rad;
  1745. t = Fi;
  1746. this.drawOutlinedCircle("", t);
  1747. Zi.globalAlpha *= .98;
  1748. s = .5 * -i + 10 * this.rPer;
  1749. e = Math.max(0, .65 * i + a) + 2;
  1750. ci(.5 * -i, s, e, t);
  1751. s = .5 * -i - 10 * this.rPer;
  1752. e = Math.max(0, .73 * i - a);
  1753. ci(.5 * i, s, e, t);
  1754. e = Math.max(0, .78 * i + a);
  1755. ci(.6 * i, .4 * i, e, t);
  1756. s = .5 * i + 10 * this.rPer;
  1757. e = Math.max(0, .6 * i + this.rPer - a);
  1758. ci(.5 * -i, s, e, t);
  1759. Zi.restore();
  1760. break;
  1761. case b:
  1762. Zi.save();
  1763. a = this.curBiome == Xi ? "#7790d8" : Si;
  1764. this.drawOutlinedCircle("", a);
  1765. qs || Zi.rotate(2 * this.rPer * Math.PI);
  1766. a = (Yi - this.spawnTime) / 1e3;
  1767. a = 4 * Math.sin(2 * Math.PI / 7 * a);
  1768. Zi.fillStyle = this.curBiome == Xi ? "#7790d8" : Si;
  1769. Zi.beginPath();
  1770. Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI);
  1771. Zi.fill();
  1772. qs || (Zi.beginPath(), Zi.arc(.3 * this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .35 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill());
  1773. Zi.restore();
  1774. break;
  1775. case E:
  1776. s = Bi;
  1777. this.curBiome == Xi && (s = "#ac443c");
  1778. this.drawOutlinedCircle("", s);
  1779. break;
  1780. case z:
  1781. if (a = Ns("img/banana" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1782. break;
  1783. case L:
  1784. if (a = Ns("img/rasp" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1785. break;
  1786. case X:
  1787. if (a = Ns("img/pear" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1788. break;
  1789. case K:
  1790. if (a = Ns("img/seaweed" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1791. break;
  1792. case J:
  1793. if (a = Ns("img/starfish" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1794. break;
  1795. case q:
  1796. if (a = Ns("img/kelp" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1797. break;
  1798. case Z:
  1799. if (a = Ns("img/clam" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1800. break;
  1801. case Q:
  1802. if (a = Ns("img/conch" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = 1 * this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1803. break;
  1804. case j:
  1805. if (a = Ns("img/coconut" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1806. break;
  1807. case ye:
  1808. case be:
  1809. break;
  1810. case ke:
  1811. if (a = Ns("img/santa/sleig.png")) s = this.rad, Zi.save(), Zi.rotate(this.angle), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1812. break;
  1813. case Ae:
  1814. if (a = Ns("img/ostrichEgg" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1815. break;
  1816. case we:
  1817. s = "";
  1818. 1 == this.specType && (s = "golden");
  1819. if (a = Ns("img/" + s + "egg" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1820. break;
  1821. case Pe:
  1822. if (a = Ns("img/quill.png")) s = this.rad, Zi.rotate(this.angle), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1823. break;
  1824. case W:
  1825. this.drawOutlinedCircle("", Ri);
  1826. Zi.rotate(this.rPer * Math.PI * 2);
  1827. ci(.25 * this.rad, .4 * this.rad, (.3 + .15 * this.rPer) * this.rad, "#905113");
  1828. break;
  1829. case te:
  1830. switch (this.curBiome) {
  1831. case Li:
  1832. s = "_ocean";
  1833. break;
  1834. case Xi:
  1835. s = "_arctic";
  1836. break;
  1837. default:
  1838. s = ""
  1839. }
  1840. if (a = Ns("img/healingStone" + s + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1841. break;
  1842. case ee:
  1843. ci(0, 0, Math.max(0, 1 * this.rad), "#815427");
  1844. ci(0, 0, Math.max(0, .6 * this.rad), "#6e4b29");
  1845. ci(0, 0, Math.max(0, .5 * this.rad), "#543d28");
  1846. ci(0, 0, Math.max(0, .45 * this.rad), "#3f3124");
  1847. ci(0, 0, Math.max(0, .33 * this.rad), "#241e19");
  1848. ci(0, 0, Math.max(0, .25 * this.rad), "#120f0d");
  1849. ci(0, 0, Math.max(0, .2 * this.rad), _i);
  1850. break;
  1851. case ae:
  1852. Zi.save();
  1853. a = (Yi - this.spawnTime) / 1e3;
  1854. a = 2.5 * Math.sin(2 * Math.PI / 4 * a);
  1855. if (e) Zi.fillStyle = _i, Zi.beginPath(), Zi.arc(0, 0, this.rad, 0, 2 * Math.PI), Zi.fill();
  1856. else {
  1857. Zi.fillStyle = _i;
  1858. Zi.beginPath();
  1859. Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI);
  1860. Zi.fill();
  1861. qs || (Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill());
  1862. Zi.save();
  1863. Zi.globalAlpha = 1 - this.underwaterA;
  1864. a = (Yi - this.spawnTime) / 1e3;
  1865. s = 8 * Math.sin(2 * Math.PI / 1.5 * a);
  1866. this.flag_underWater && (Zi.globalAlpha *= .5, this.animalType == _e && (Zi.globalAlpha = .3));
  1867. Zi.fillStyle = "yellow";
  1868. a = .15 * this.rad;
  1869. Zi.beginPath();
  1870. for (Vn = e = 1; Vn <= e; Vn++) Zi.save(), Zi.globalAlpha = .2, Zi.rotate(this.rPer * Math.PI * 2 * Vn), Zi.beginPath(), Zi.arc(-.35 * this.rad, -.33 * this.rad, Math.max(0, a + s), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.35 * this.rad, -.32 * this.rad, Math.max(0, a - s), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.35 * this.rad, .36 * this.rad, Math.max(0, a + s), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(-.35 * this.rad, .35 * this.rad, Math.max(0, a - s), 0, 2 * Math.PI), Zi.fill(), Zi.restore();
  1871. Zi.restore()
  1872. }
  1873. Zi.restore();
  1874. break;
  1875. case me:
  1876. Zi.save();
  1877. a = (Yi - this.spawnTime) / 1e3;
  1878. a = 2.5 * Math.sin(2 * Math.PI / 4 * a);
  1879. if (e) Zi.fillStyle = "#5e5348", Zi.beginPath(), Zi.arc(0, 0, this.rad, 0, 2 * Math.PI), Zi.fill();
  1880. else {
  1881. Zi.fillStyle = "#706962";
  1882. Zi.beginPath();
  1883. Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI);
  1884. Zi.fill();
  1885. qs || (Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill());
  1886. Zi.save();
  1887. Zi.globalAlpha = 1 - this.underwaterA;
  1888. a = (Yi - this.spawnTime) / 1e3;
  1889. s = 8 * Math.sin(2 * Math.PI / 1.5 * a);
  1890. this.flag_underWater && (Zi.globalAlpha *= .5, this.animalType == _e && (Zi.globalAlpha = .3));
  1891. Zi.fillStyle = "yellow";
  1892. a = .15 * this.rad;
  1893. Zi.beginPath();
  1894. for (Vn = e = 1; Vn <= e; Vn++) Zi.save(), Zi.globalAlpha = .2, Zi.rotate(this.rPer * Math.PI * 2 * Vn), Zi.beginPath(), Zi.arc(-.35 * this.rad, -.33 * this.rad, Math.max(0, a + s), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.35 * this.rad, -.32 * this.rad, Math.max(0, a - s), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.35 * this.rad, .36 * this.rad, Math.max(0, a + s), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(-.35 * this.rad, .35 * this.rad, Math.max(0, a - s), 0, 2 * Math.PI), Zi.fill(), Zi.restore();
  1895. Zi.restore()
  1896. }
  1897. Zi.restore();
  1898. break;
  1899. case ue:
  1900. if (a = Ns("img/cloudberry" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) Zi.save(), s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1901. break;
  1902. case se:
  1903. if (a = Ns("img/arcticNut" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) Zi.save(), s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1904. break;
  1905. case re:
  1906. if (a = Ns("img/carrot" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1907. break;
  1908. case ne:
  1909. if (a = Ns("img/watermelon" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1910. break;
  1911. case pe:
  1912. Zi.save();
  1913. ci(0, 0, this.rad, this.isEdibleOutlined() ? Gi : zi(this.curBiome));
  1914. ci(0, 0, Math.max(0, this.rad - 2), "#74e61e");
  1915. Zi.restore();
  1916. break;
  1917. case oe:
  1918. if (a = Ns("img/watermelonSlice" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1919. break;
  1920. case le:
  1921. case he:
  1922. case ce:
  1923. if (a = Ns("img/meat" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  1924. break;
  1925. case B:
  1926. case R:
  1927. s = 2;
  1928. a = this.oType == R ? 15 : 9;
  1929. Zi.fillStyle = this.getOutlineColor();
  1930. Zi.beginPath();
  1931. Zi.rect(-a / 2 - s, -s, a + 2 * s, .8 * this.rad + 2 * s);
  1932. Zi.fill();
  1933. Zi.fillStyle = "#FFCA49";
  1934. Zi.beginPath();
  1935. Zi.rect(-a / 2, 0 + s / 2, a, .8 * this.rad - s / 2);
  1936. Zi.fill();
  1937. qs || (Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad), Math.PI, 2 * Math.PI), Zi.fillStyle = this.getOutlineColor(), Zi.fill());
  1938. Zi.beginPath();
  1939. Zi.arc(0, 0, Math.max(0, this.rad - s), Math.PI, 2 * Math.PI);
  1940. Zi.fillStyle = this.oType == R ? "#B8413B" : "#CFAD59";
  1941. Zi.fill();
  1942. break;
  1943. case F:
  1944. s = 2;
  1945. Zi.save();
  1946. a = (Yi - this.spawnTime) / 1e3;
  1947. a = 1.5 * Math.sin(2 * Math.PI / 2 * a);
  1948. Zi.fillStyle = "#45D157";
  1949. Zi.globalAlpha *= .93;
  1950. Zi.beginPath();
  1951. Zi.arc(.5 * -this.rad, .5 * -this.rad + 10 * this.rPer, Math.max(0, .55 * this.rad + a), 0, 2 * Math.PI);
  1952. Zi.fill();
  1953. Zi.beginPath();
  1954. Zi.arc(.5 * this.rad, .5 * -this.rad - 10 * this.rPer, Math.max(0, .43 * this.rad - a), 0, 2 * Math.PI);
  1955. Zi.fill();
  1956. Zi.beginPath();
  1957. Zi.arc(.6 * this.rad, .4 * this.rad, Math.max(0, .48 * this.rad + a), 0, 2 * Math.PI);
  1958. Zi.fill();
  1959. Zi.beginPath();
  1960. Zi.arc(.5 * -this.rad, .5 * this.rad, Math.max(0, .4 * this.rad + this.rPer - a), 0, 2 * Math.PI);
  1961. Zi.fill();
  1962. Zi.restore();
  1963. a = 20;
  1964. Zi.fillStyle = this.getOutlineColor();
  1965. Zi.beginPath();
  1966. Zi.rect(-a / 2 - s, -s, a + 2 * s, .8 * this.rad + 2 * s);
  1967. Zi.fill();
  1968. Zi.fillStyle = "#FFCA49";
  1969. Zi.beginPath();
  1970. Zi.rect(-a / 2, 0 + s / 2, a, .8 * this.rad - s / 2);
  1971. Zi.fill();
  1972. Zi.beginPath();
  1973. Zi.arc(0, 0, Math.max(0, .8 * this.rad), Math.PI, 2 * Math.PI);
  1974. Zi.fillStyle = this.getOutlineColor();
  1975. Zi.fill();
  1976. Zi.beginPath();
  1977. Zi.arc(0, 0, Math.max(0, .8 * this.rad - s), Math.PI, 2 * Math.PI);
  1978. Zi.fillStyle = "#B8413B";
  1979. Zi.fill();
  1980. break;
  1981. case O:
  1982. if (a = Ns("img/lillypad" + (this.isEdibleOutlined() ? "_e" : "") + ".png")) s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  1983. break;
  1984. case y:
  1985. this.drawOutlinedCircle("", "#9F8641");
  1986. ci(0 - this.rPer, 0 - this.rPer, Math.max(0, this.rad - 7), "#7E6A35");
  1987. ci(0 + this.rPer, 1, Math.max(0, this.rad - 12), "#5C4E28");
  1988. break;
  1989. case M:
  1990. switch (this.type) {
  1991. case Ut:
  1992. case St:
  1993. break;
  1994. case Za:
  1995. Zi.save();
  1996. e = Zi.globalAlpha;
  1997. Zi.globalAlpha = .4 * e;
  1998. ci(0, 0, this.rad, "#7EBCC0");
  1999. Zi.globalAlpha = 1 * e;
  2000. Zi.strokeStyle = "white";
  2001. Zi.beginPath();
  2002. a = 10;
  2003. Zi.translate(-5, -.7 * this.rad);
  2004. Zi.moveTo(0, -a);
  2005. Zi.lineTo(0, a);
  2006. Zi.moveTo(-a, -a);
  2007. Zi.lineTo(a, a);
  2008. Zi.moveTo(a, -a);
  2009. Zi.lineTo(-a, a);
  2010. Zi.moveTo(-a, 0);
  2011. Zi.lineTo(a, 0);
  2012. Zi.lineWidth = 3;
  2013. Zi.stroke();
  2014. Zi.restore();
  2015. break;
  2016. case at:
  2017. Zi.save();
  2018. e = Zi.globalAlpha;
  2019. Zi.globalAlpha = .15 * e;
  2020. ci(0, 0, this.rad, "#755A2A");
  2021. Zi.restore();
  2022. break;
  2023. case yt:
  2024. Zi.save();
  2025. e = Zi.globalAlpha;
  2026. Zi.globalAlpha = 1 * e;
  2027. if (a = Ns("img/ability_sabertoothJawAttack.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = this.rad - 2.5, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, 0, 0, a.width * e, a.height, -s, -s, 2 * s * e, 2 * s);
  2028. Zi.restore();
  2029. break;
  2030. case et:
  2031. Zi.save();
  2032. e = Zi.globalAlpha;
  2033. Zi.globalAlpha = 1 * e;
  2034. if (a = Ns("img/ability_claw.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = this.rad - 2.5, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, 0, 0, a.width * e, a.height, -s, -s, 2 * s * e, 2 * s);
  2035. Zi.restore();
  2036. break;
  2037. case bt:
  2038. Zi.save();
  2039. e = Zi.globalAlpha;
  2040. Zi.globalAlpha = .1 * e;
  2041. ci(0, 0, this.rad, "#5B7EC7");
  2042. Zi.globalAlpha = 1 * e;
  2043. if (a = Ns("img/ability_whaleTailHit.png")) {
  2044. e = Math.min(1, (Yi - this.spawnTime) / 200);
  2045. s = .85 * this.rad;
  2046. Zi.rotate(this.angle);
  2047. i = this.rad;
  2048. t = 2 * s;
  2049. var r = 2 * s * e,
  2050. n;
  2051. Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r)
  2052. }
  2053. Zi.restore();
  2054. break;
  2055. case zt:
  2056. e = Zi.globalAlpha;
  2057. Zi.save();
  2058. a = (Yi - this.spawnTime) / 1e3;
  2059. s = 1 * Math.sin(2 * Math.PI / 1.5 * a);
  2060. Zi.globalAlpha = .6 * Zi.globalAlpha * s;
  2061. Zi.rotate(this.angle);
  2062. Zi.globalAlpha = .15 * e;
  2063. 0 == this.specType2 ? ci(0, 0, this.rad, "#96661C") : ci(0, 0, this.rad, "#e0dfde");
  2064. Zi.restore();
  2065. Zi.save();
  2066. if (a = Ns("img/ability_bearSlash" + this.specType2 + ".png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = ti((Yi - this.spawnTime) / 300, 0, 1), i = -(-.5 + s) * Zt(90), Zi.rotate(this.angle + i * (0 == this.specType ? 1 : -1)), s = 1 * -this.rad, i = this.rad, t = 2 * s, r = 2 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.8 * r + s, t, r);
  2067. Zi.restore();
  2068. break;
  2069. case _t:
  2070. a = (Yi - this.spawnTime) / 1e3;
  2071. e = di(a, 1, .1, 1);
  2072. Zi.save();
  2073. Zi.globalAlpha = .1 - e;
  2074. Zi.restore();
  2075. Zi.save();
  2076. a = (Yi - this.spawnTime) / 1e3;
  2077. a = 1.5 * Math.sin(2 * Math.PI / 2 * a);
  2078. Zi.fillStyle = "white";
  2079. i = .7 * this.rad;
  2080. Zi.globalAlpha = .3 - e;
  2081. s = .5 * -i + 10 * this.rPer;
  2082. e = Math.max(0, .65 * i + a) + 2;
  2083. ci(.6 * -i, s, e, "#654321");
  2084. s = .5 * -i - 10 * this.rPer;
  2085. e = Math.max(0, .73 * i - a);
  2086. ci(.5 * i, s, e, "#654321");
  2087. e = Math.max(0, .78 * i + a);
  2088. ci(.6 * i, .5 * i, e, "#654321");
  2089. s = .5 * i + 10 * this.rPer;
  2090. e = Math.max(0, .6 * i + this.rPer - a);
  2091. ci(.5 * -i, s, e, "#654321");
  2092. Zi.restore();
  2093. break;
  2094. case Nt:
  2095. break;
  2096. case Rt:
  2097. Zi.globalAlpha = .2;
  2098. ci(0, 0, this.rad, "limegreen");
  2099. break;
  2100. case Gt:
  2101. Zi.globalAlpha = .2;
  2102. break;
  2103. case Ht:
  2104. Zi.globalAlpha = .5;
  2105. ci(0, 0, this.rad, "#ef6e24");
  2106. break;
  2107. case Wt:
  2108. this.doesDrawEffectScale = this.drawEffectScale_Slow = !0;
  2109. Zi.globalAlpha = .2;
  2110. ci(0, 0, .85 * this.rad, "white");
  2111. if (a = Ns("img/target" + (3 == this.specType ? "_e" : "") + ".png")) s = this.rad, Zi.save(), Zi.globalAlpha = .5, Zi.drawImage(a, -s, -s, 2 * s, 2 * s), Zi.restore();
  2112. break;
  2113. case Ft:
  2114. Zi.globalAlpha = .5;
  2115. break;
  2116. case Et:
  2117. Zi.save();
  2118. e = Zi.globalAlpha;
  2119. Zi.globalAlpha = .05 * e;
  2120. ci(0, 0, this.rad, "#B32E10");
  2121. Zi.globalAlpha = 1 * e;
  2122. if (a = Ns("img/ability_crabSmash" + this.specType + ".png")) s = ti((Yi - this.spawnTime) / 200, 0, 1), e = 1 == this.specType ? -1 : 1, Zt(-90 * e), i = e * (.3 + s) + Zt(-30 * e), s = .6 * this.rad, Zi.rotate(this.angle + i), i = this.rad, t = 1.4 * s, r = 2 * s, e = .75, n = .95, 1 == this.specType && (e = .25, n = .95), Zi.drawImage(a, 0 + t * -e, i + r * -n, t, r);
  2123. Zi.restore();
  2124. break;
  2125. case ut:
  2126. Zi.save();
  2127. e = Zi.globalAlpha;
  2128. Zi.globalAlpha = .05 * e;
  2129. ci(0, 0, this.rad, "#E4E7C8");
  2130. Zi.globalAlpha = 1 * e;
  2131. if (a = Ns("img/ability_elephantTrunkSmack.png")) s = ti((Yi - this.spawnTime) / 300, 0, 1), i = -(-.5 + s) * Zt(90), s = .6 * this.rad, Zi.rotate(this.angle + i), i = this.rad, t = 1.4 * s, r = 2 * s, Zi.drawImage(a, 0 + -.75 * t, i + -.95 * r, t, r);
  2132. Zi.restore();
  2133. break;
  2134. case nt:
  2135. Zi.save();
  2136. e = Zi.globalAlpha;
  2137. Zi.globalAlpha = .1 * e;
  2138. ci(0, 0, this.rad, "#755A2A");
  2139. Zi.globalAlpha = 1 * e;
  2140. if (a = Ns("img/ability_backkick.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = .6 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2 * s, r = 2 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r);
  2141. Zi.restore();
  2142. break;
  2143. case ot:
  2144. Zi.save();
  2145. e = Zi.globalAlpha;
  2146. Zi.globalAlpha = .25 * e;
  2147. ci(0, 0, this.rad, "#44d31f");
  2148. Zi.globalAlpha = 1 * e;
  2149. if (a = Ns("img/ability_crocBite.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = .6 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r), Zi.rotate(Math.PI), i = .5 * this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r);
  2150. Zi.restore();
  2151. break;
  2152. case Pt:
  2153. Zi.save();
  2154. e = Zi.globalAlpha;
  2155. Zi.globalAlpha = .25 * e;
  2156. ci(0, 0, this.rad, "#44d31f");
  2157. Zi.globalAlpha = 1 * e;
  2158. if (a = Ns("img/ability_boaBite.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = .6 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r), Zi.rotate(Math.PI), i = .5 * this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r);
  2159. Zi.restore();
  2160. break;
  2161. case vt:
  2162. Zi.save();
  2163. e = Zi.globalAlpha;
  2164. Zi.globalAlpha = .1 * e;
  2165. ci(0, 0, this.rad, "#755A2A");
  2166. Zi.globalAlpha = 1 * e;
  2167. if (a = Ns("img/ability_tigerJump.png")) e = Math.min(1, (Yi - this.spawnTime) / 100), s = 1.1 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2 * s, r = 2 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -1 * r, t, r);
  2168. Zi.restore();
  2169. break;
  2170. case Dt:
  2171. Zi.save();
  2172. e = Zi.globalAlpha;
  2173. Zi.globalAlpha = .05 * e;
  2174. ci(0, 0, this.rad, "#44d31f");
  2175. Zi.globalAlpha = 1 * e;
  2176. a = Ns("img/ability_pounce2.png");
  2177. n = Ns("img/ability_pounce1.png");
  2178. a && n && (e = Math.min(1, (Yi - this.spawnTime) / 200), s = .4 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r), s = .6 * this.rad, i = .5 * this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(n, 0 + -.5 * t, i + -.95 * r, t, r));
  2179. Zi.restore();
  2180. break;
  2181. case It:
  2182. Zi.save();
  2183. e = Zi.globalAlpha;
  2184. Zi.globalAlpha = .05 * e;
  2185. ci(0, 0, this.rad, "#E4E7C8");
  2186. Zi.globalAlpha = 1 * e;
  2187. if (a = Ns("img/ability_tigerSlash" + this.specType + ".png")) s = ti((Yi - this.spawnTime) / 300, 0, 1), i = (1 == this.specType ? 1 : -1) * (-.6 + s) * Zt(90), s = 1.2 * this.rad, Zi.rotate(this.angle + i), i = this.rad, t = 1.4 * s, r = 2 * s, Zi.drawImage(a, 0 + -.2 * t, i + -.5 * r, t, r);
  2188. Zi.restore();
  2189. break;
  2190. case xt:
  2191. Zi.save();
  2192. e = Zi.globalAlpha;
  2193. Zi.globalAlpha = .1 * e;
  2194. ci(0, 0, this.rad, "#755A2A");
  2195. Zi.globalAlpha = 1 * e;
  2196. if (a = Ns("img/ability_zebraKick.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = .6 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2 * s, r = 3 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -1 * r, t, r);
  2197. Zi.restore();
  2198. break;
  2199. case Mt:
  2200. e = Zi.globalAlpha;
  2201. Zi.save();
  2202. a = (Yi - this.spawnTime) / 1e3;
  2203. s = 1 * Math.sin(2 * Math.PI / 1.5 * a);
  2204. a = Zi.globalAlpha;
  2205. Zi.globalAlpha = .6 * Zi.globalAlpha * s;
  2206. Zi.rotate(this.angle);
  2207. Zi.globalAlpha = .15 * e;
  2208. ci(.3 * this.rad, 0, this.rad * (.9 + .12 * s), "#E4E7C8");
  2209. ci(.3 * -this.rad, 0, this.rad * (1.05 + .09 * s), "#E4E7C8");
  2210. Zi.globalAlpha = a;
  2211. Zi.restore();
  2212. Zi.save();
  2213. if (a = Ns("img/ability_giraffeStompLeg.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = this.angle, Zi.rotate(s), s = 1 * -this.rad, i = this.rad, t = 2 * s, r = 2 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.8 * r + s, t, r);
  2214. Zi.restore();
  2215. break;
  2216. case Ct:
  2217. Zi.save();
  2218. e = Zi.globalAlpha;
  2219. Zi.globalAlpha = .15 * e;
  2220. Zi.globalAlpha = 1 * e;
  2221. if (a = Ns("img/ability_sharkBite.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = .6 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r), Zi.rotate(Math.PI), i = .5 * this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -1.35 * r, t, r);
  2222. if (a = Ns("img/shark-head.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), Zi.globalAlpha = .9, s = 1.75 * -this.rad, Zi.rotate(Zt(180)), i = this.rad, t = 2 * s, r = 2 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.5 * r + s, t, r);
  2223. Zi.restore();
  2224. break;
  2225. case Ot:
  2226. Zi.save();
  2227. e = Zi.globalAlpha;
  2228. Zi.globalAlpha = .5 * e;
  2229. s = this.rad;
  2230. a = (Yi - this.spawnTime) / 1e3;
  2231. t = 2.2;
  2232. i = 6.5 * Math.cos(2 * Math.PI / t * a);
  2233. a = 6.5 * Math.sin(2 * Math.PI / t * a);
  2234. Zi.globalAlpha = .3 * e;
  2235. ci(0, 0, s, "#2CAAC4");
  2236. Zi.globalAlpha = .5 * e;
  2237. ci(0 + i / 4.5 + this.rPer, 1 + a / 1.5, Math.max(0, s - 14), "#29A0BA");
  2238. ci(0 + i / 1.5 - 2 * this.rPer, a, Math.max(0, s - 38.5 + a / 5), "#2B8CAA");
  2239. ci(0 + i / 1.5 - 2 * this.rPer, a, Math.max(0, s - 54.5 + a / 11), "#28829E");
  2240. Zi.restore();
  2241. break;
  2242. case Bt:
  2243. if (0 == this.specType || 2 == this.specType) {
  2244. Zi.save();
  2245. if (a = Ns("skins/pelican/ability_pelican.png")) s = 1.5 * -this.rad, Zi.rotate(this.angle), i = this.rad, r = t = s, Zi.drawImage(a, 0 + -.5 * t, i + -.5 * r + s, t, r);
  2246. Zi.restore()
  2247. }
  2248. break;
  2249. case At:
  2250. Zi.save();
  2251. e = Zi.globalAlpha;
  2252. Zi.globalAlpha = .15 * e;
  2253. Zi.globalAlpha = 1 * e;
  2254. if (a = Ns("img/ability_trexBite.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = .6 * this.rad, Zi.rotate(this.angle), i = this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r), Zi.rotate(Math.PI), i = .5 * this.rad, t = 2.5 * s, r = 2.5 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.95 * r, t, r);
  2255. if (a = Ns("img/trex-head.png")) e = Math.min(1, (Yi - this.spawnTime) / 200), s = 1.5 * -this.rad, Zi.rotate(Zt(180)), i = this.rad, t = 2 * s, r = 2 * s * e, Zi.drawImage(a, 0 + -.5 * t, i + -.5 * r + s, t, r);
  2256. Zi.restore();
  2257. break;
  2258. case Qa:
  2259. Zi.save();
  2260. e = Zi.globalAlpha;
  2261. Zi.globalAlpha = .15 * e;
  2262. ci(0, 0, this.rad, "#6D7471");
  2263. Zi.restore();
  2264. break;
  2265. case wt:
  2266. Zi.save();
  2267. e = Zi.globalAlpha;
  2268. Zi.globalAlpha = .15 * e;
  2269. ci(0, 0, this.rad, "#6D7471");
  2270. Zi.restore();
  2271. break;
  2272. case kt:
  2273. Zi.save();
  2274. e = Zi.globalAlpha;
  2275. Zi.globalAlpha = .15 * e;
  2276. ci(0, 0, this.rad, "#f2f2f2");
  2277. Zi.restore();
  2278. break;
  2279. case mt:
  2280. Zi.save();
  2281. Zi.rotate(this.angle + Zt(180));
  2282. e = Zi.globalAlpha;
  2283. Zi.globalAlpha = .8 * e;
  2284. if (a = Ns("img/wave.png")) s = this.rad, Zi.drawImage(a, -s, -s, 2 * s, 2 * s);
  2285. Zi.restore();
  2286. break;
  2287. case st:
  2288. Zi.save();
  2289. e = Zi.globalAlpha;
  2290. Zi.globalAlpha = .2 * e;
  2291. ci(0, 0, this.rad, "#746B3E");
  2292. Zi.restore();
  2293. break;
  2294. case ja:
  2295. Zi.save();
  2296. e = Zi.globalAlpha;
  2297. Zi.globalAlpha = .5 * e;
  2298. ci(0, 0, this.rad, "#62C5FF");
  2299. Zi.globalAlpha = 1 * e;
  2300. Zi.strokeStyle = "#62C5FF";
  2301. Zi.beginPath();
  2302. s = -.7 * this.rad;
  2303. Zi.moveTo(s, -5);
  2304. Zi.lineTo(s - 4, 5);
  2305. Zi.lineTo(s + 4, 2);
  2306. Zi.lineTo(s + 2, 15);
  2307. Zi.lineWidth = 3;
  2308. Zi.stroke();
  2309. Zi.restore();
  2310. break;
  2311. case Xa:
  2312. Zi.save();
  2313. e = Zi.globalAlpha;
  2314. Zi.globalAlpha = .5 * e;
  2315. s = Math.max(0, this.rad - 30);
  2316. a = (Yi - this.spawnTime) / 1e3;
  2317. t = 2.2;
  2318. i = 6.5 * Math.cos(2 * Math.PI / t * a);
  2319. a = 6.5 * Math.sin(2 * Math.PI / t * a);
  2320. Zi.globalAlpha = .4 * e;
  2321. ci(0, 0, s, "#2CAAC4");
  2322. Zi.globalAlpha = .7 * e;
  2323. qs || ci(0 + i / 2 - this.rPer, 0 + a / 2 - this.rPer, Math.max(0, s - 6), "#2D93B0");
  2324. ci(0 + i / 4.5 + this.rPer, 1 + a / 1.5, Math.max(0, s - 14), "#29A0BA");
  2325. ci(0 + i / 1.5 - 2 * this.rPer, a, Math.max(0, s - 38.5 + a / 5), "#2B8CAA");
  2326. ci(0 + i / 1.5 - 2 * this.rPer, a, Math.max(0, s - 54.5 + a / 11), "#28829E");
  2327. Zi.restore();
  2328. break;
  2329. case La:
  2330. Zi.save();
  2331. e = Zi.globalAlpha;
  2332. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2333. a = (Yi - this.spawnTime) / 1e3;
  2334. a = 1.5 * Math.sin(2 * Math.PI / 6 * a);
  2335. Zi.globalAlpha = .7 * e;
  2336. s = 4;
  2337. Zi.fillStyle = "black";
  2338. Zi.beginPath();
  2339. Zi.arc(0, 0, this.rad, 0, 2 * Math.PI);
  2340. Zi.fill();
  2341. qs || (Zi.fillStyle = "black", Zi.globalAlpha = .5 * e, Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath());
  2342. Zi.restore();
  2343. break;
  2344. case lt:
  2345. Zi.save();
  2346. e = Zi.globalAlpha;
  2347. Zi.globalAlpha = .25 * e;
  2348. ci(0, 0, this.rad, "#9F8641");
  2349. Zi.restore();
  2350. break;
  2351. case ht:
  2352. Zi.save();
  2353. e = Zi.globalAlpha;
  2354. Zi.globalAlpha = .25 * e;
  2355. ci(0, 0, this.rad, "#785228");
  2356. Zi.restore();
  2357. break;
  2358. default:
  2359. Zi.save(), e = Zi.globalAlpha, Zi.globalAlpha = .15 * e, ci(0, 0, this.rad, "black"), Zi.restore()
  2360. }
  2361. break;
  2362. case D:
  2363. a = (Yi - this.spawnTime) / 1e3;
  2364. t = 1.2;
  2365. i = 2.5 * Math.cos(2 * Math.PI / t * a);
  2366. a = 2.5 * Math.sin(2 * Math.PI / t * a);
  2367. this.drawOutlinedCircle("", "#2CAAC4");
  2368. qs || ci(0 + i / 2 - this.rPer, 0 + a / 2 - this.rPer, Math.max(0, this.rad - 6), "#2D93B0");
  2369. ci(0 + i / 4.5 + this.rPer, 1 + a / 1.5, Math.max(0, this.rad - 14), "#29A0BA");
  2370. ci(0 + i / 1.5 - 2 * this.rPer, a, Math.max(0, this.rad - 18.5 + a / 5), "#2B8CAA");
  2371. ci(0 + i / 1.5 - 2 * this.rPer, a, Math.max(0, this.rad - 24.5 + a / 11), "#28829E");
  2372. break;
  2373. case A:
  2374. this.drawOutlinedCircle("", "#9F8641");
  2375. qs || ci(0 - this.rPer, 0 - this.rPer, Math.max(0, this.rad - 7), "#7E6A35");
  2376. ci(0 + this.rPer, 1, Math.max(0, this.rad - 14), "#5C4E28");
  2377. ci(0 - 2 * this.rPer - 3, 1, Math.max(0, this.rad - 18.5), "#40371D");
  2378. break;
  2379. case w:
  2380. Zi.save();
  2381. a = (Yi - this.spawnTime) / 1e3;
  2382. a = 1.5 * Math.sin(2 * Math.PI / 2 * a);
  2383. switch (this.curBiome) {
  2384. case Li:
  2385. s = "#786810";
  2386. break;
  2387. case Xi:
  2388. s = "#CED0D0";
  2389. break;
  2390. default:
  2391. case ji:
  2392. s = "#45D157"
  2393. }
  2394. Zi.fillStyle = s;
  2395. Zi.globalAlpha *= .93;
  2396. Zi.beginPath();
  2397. Zi.arc(.5 * -this.rad, .5 * -this.rad + 10 * this.rPer, Math.max(0, .65 * this.rad + a), 0, 2 * Math.PI);
  2398. Zi.fill();
  2399. Zi.beginPath();
  2400. Zi.arc(.5 * this.rad, .5 * -this.rad - 10 * this.rPer, Math.max(0, .73 * this.rad - a), 0, 2 * Math.PI);
  2401. Zi.fill();
  2402. Zi.beginPath();
  2403. Zi.arc(.6 * this.rad, .4 * this.rad, Math.max(0, .78 * this.rad + a), 0, 2 * Math.PI);
  2404. Zi.fill();
  2405. Zi.beginPath();
  2406. Zi.arc(.5 * -this.rad, .5 * this.rad, Math.max(0, .6 * this.rad + this.rPer - a), 0, 2 * Math.PI);
  2407. Zi.fill();
  2408. Zi.restore();
  2409. break;
  2410. case ie:
  2411. Zi.save();
  2412. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2413. a = (Yi - this.spawnTime) / 1e3;
  2414. a = 1.5 * Math.sin(2 * Math.PI / 6 * a);
  2415. s = 4;
  2416. Zi.fillStyle = "#604729";
  2417. Zi.beginPath();
  2418. Zi.arc(0, 0, this.rad, 0, 2 * Math.PI);
  2419. Zi.fill();
  2420. qs || (Zi.fillStyle = "#8A681B", Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath());
  2421. Zi.restore();
  2422. break;
  2423. case de:
  2424. Zi.save();
  2425. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2426. a = (Yi - this.spawnTime) / 1e3;
  2427. a = 1.5 * Math.sin(2 * Math.PI / 6 * a);
  2428. s = 4;
  2429. Zi.fillStyle = "#605649";
  2430. Zi.beginPath();
  2431. Zi.arc(0, 0, this.rad, 0, 2 * Math.PI);
  2432. Zi.fill();
  2433. qs || (Zi.fillStyle = "#5e4f36", Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath());
  2434. Zi.restore();
  2435. break;
  2436. case k:
  2437. Zi.save();
  2438. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2439. a = (Yi - this.spawnTime) / 1e3;
  2440. a = 1.5 * Math.sin(2 * Math.PI / 6 * a);
  2441. s = 4;
  2442. Zi.fillStyle = "#8B7833";
  2443. Zi.beginPath();
  2444. Zi.arc(0, 0, this.rad, 0, 2 * Math.PI);
  2445. Zi.fill();
  2446. qs || (Zi.fillStyle = "#98803A", Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath());
  2447. Zi.restore();
  2448. break;
  2449. case N:
  2450. Zi.save();
  2451. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2452. a = (Yi - this.spawnTime) / 1e3;
  2453. a = 1.5 * Math.sin(2 * Math.PI / 6 * a);
  2454. s = 4;
  2455. Zi.fillStyle = "#8CC3C7";
  2456. Zi.beginPath();
  2457. Zi.arc(0, 0, this.rad, 0, 2 * Math.PI);
  2458. Zi.fill();
  2459. qs || (Zi.fillStyle = "#9DDADE", Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath());
  2460. Zi.restore();
  2461. break;
  2462. case T:
  2463. Zi.save();
  2464. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2465. a = (Yi - this.spawnTime) / 1e3;
  2466. a = 5.5 * Math.sin(2 * Math.PI / 4 * a);
  2467. s = 4;
  2468. Zi.fillStyle = Ui;
  2469. Zi.beginPath();
  2470. Zi.arc(0, 0, this.rad, 0, 2 * Math.PI);
  2471. Zi.fill();
  2472. Zi.fillStyle = this.curBiome == Xi ? "#8da0d6" : Si;
  2473. Zi.beginPath();
  2474. Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI);
  2475. Zi.fill();
  2476. qs || (Zi.beginPath(), Zi.arc(.45 * this.rad, .45 * -this.rad + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.5 * this.rad, .5 * this.rad + 15 * this.rPer, Math.max(0, .4 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.55 * -this.rad * .707, .55 * +this.rad * .707 + 15 * this.rPer, Math.max(0, .5 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(.75 * -this.rad, .35 * -this.rad + 15 * this.rPer, Math.max(0, .3 * this.rad + a), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill());
  2477. Zi.restore();
  2478. break;
  2479. case V:
  2480. Zi.save();
  2481. qs || Zi.rotate(2 * this.rPer * Math.PI);
  2482. a = (Yi - Vs) / 1e3;
  2483. a = 5.5 * Math.sin(2 * Math.PI / 5 * a);
  2484. s = 4;
  2485. e || (Zi.fillStyle = Ei, Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - s + a), 0, 2 * Math.PI), Zi.fill(), qs || (Zi.beginPath(), Zi.arc(this.rad + 10 * this.rPer, 50 * this.rPer, 8, 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(this.rad - 20 * this.rPer, 50 * this.rPer, 10, 0, 2 * Math.PI), Zi.fill()));
  2486. Zi.restore();
  2487. break;
  2488. case v:
  2489. a = (Yi - Vs) / 1e3;
  2490. s = -8.5 * Math.sin(2 * Math.PI / 5 * a);
  2491. 1 == (this.x > Ds / 2 ? 1 : 0) ? (Zi.fillStyle = Ei, Zi.fillRect(-this.rectW / 2 + s, -this.rectH / 2 + s + 10, this.rectW - s, this.rectH - s - 10), Zi.beginPath(), Zi.arc(-this.rectW / 2 + 50, -this.rectH / 2 + 50, 70 - s, 0, 2 * Math.PI), Zi.fill(), s = 35) : (Zi.fillStyle = Ei, s *= -1, Zi.fillRect(-this.rectW / 2, -this.rectH / 2 - s + 10, this.rectW + s, this.rectH + s - 10), s = 25);
  2492. fillGrid(-this.rectW / 2 + s, -this.rectH / 2 + s, this.rectW / 2 - s, this.rectH / 2 - s, this.x, this.y);
  2493. break;
  2494. case Y:
  2495. Zi.fillStyle = Ui;
  2496. e = -this.rectW / 2;
  2497. i = this.rectW / 2;
  2498. t = -this.rectH / 2;
  2499. r = this.rectH / 2;
  2500. Zi.beginPath();
  2501. Zi.moveTo(e, t);
  2502. n = 20;
  2503. var o = [-15, 10, -10, 12, 0, 5, -10, 5, -12, 5, 10, 0, -6],
  2504. l = 45,
  2505. h = 0,
  2506. c = Ds - this.x,
  2507. d = 0 - this.x,
  2508. p = Ms - this.y,
  2509. g = 0 - this.y;
  2510. a = e - n;
  2511. for (s = t; s < r; s += l) Zi.lineTo(Math.min(c, Math.max(d, a + o[h])), s), h = (h + 1) % o.length;
  2512. Zi.lineTo(e, r);
  2513. s = r + n;
  2514. for (a = e; a < i; a += l) Zi.lineTo(a, Math.min(p, Math.max(g, s + o[h]))), h = (h + 1) % o.length;
  2515. Zi.lineTo(i, r);
  2516. a = i + n;
  2517. for (s = r; s > t; s -= l) Zi.lineTo(Math.min(c, Math.max(d, a + o[h])), s), h = (h + 1) % o.length;
  2518. Zi.lineTo(i, t);
  2519. s = t - n;
  2520. for (a = i; a > e; a -= l) Zi.lineTo(a, Math.min(p, Math.max(g, s + o[h]))), h = (h + 1) % o.length;
  2521. Zi.closePath();
  2522. Zi.fill();
  2523. break;
  2524. case C:
  2525. Zi.fillStyle = "#ececec";
  2526. Zi.fillRect(-this.rectW / 2, -this.rectH / 2, this.rectW, this.rectH);
  2527. e = -this.rectW / 2;
  2528. i = this.rectW / 2;
  2529. t = this.rectH / 2 - 20;
  2530. r = this.rectH / 2;
  2531. snowLandWidth = this.rectW;
  2532. snowLandHeight = this.rectH;
  2533. Zi.beginPath();
  2534. Zi.moveTo(e, t);
  2535. n = 20;
  2536. o = [-15, 5, 10, 0, -10, 3, 12, 4, 0, 3, 5, -10, 5, -12, 5, 10, 0, -6];
  2537. l = 60;
  2538. h = 0;
  2539. p = Ms - this.y;
  2540. g = 0 - this.y;
  2541. Zi.lineTo(e, r);
  2542. s = r + n;
  2543. for (a = e; a < i; a += l) Zi.lineTo(a, Math.min(p, Math.max(g, s + o[h]))), h = (h + 1) % o.length;
  2544. Zi.lineTo(i, r);
  2545. Zi.lineTo(i, t);
  2546. Zi.closePath();
  2547. Zi.fill();
  2548. s = 20;
  2549. fillGrid(-this.rectW / 2 + s, -this.rectH / 2 + s, this.rectW / 2 - s, this.rectH / 2 - s, this.x, this.y);
  2550. break;
  2551. case $:
  2552. Zi.fillStyle = Si;
  2553. Zi.fillRect(-this.rectW / 2, -this.rectH / 2, this.rectW, this.rectH);
  2554. Zi.fillStyle = Si;
  2555. e = -this.rectW / 2;
  2556. i = this.rectW / 2;
  2557. t = -this.rectH / 2 + 3;
  2558. r = -this.rectH / 2 - 15;
  2559. Zi.beginPath();
  2560. Zi.moveTo(e, t);
  2561. n = 0;
  2562. o = [-15, 5, 10, 0, -10, 3, 12, 4, 0, 3, 5, -10, 5, -12, 5, 10, 0, -6];
  2563. l = 60;
  2564. h = 0;
  2565. p = Ms - this.y;
  2566. g = 0 - this.y;
  2567. Zi.lineTo(e, r);
  2568. s = r + n;
  2569. for (a = e; a < i; a += l) Zi.lineTo(a, Math.min(p, Math.max(g, s + o[h]))), h = (h + 1) % o.length;
  2570. Zi.lineTo(i, r);
  2571. Zi.lineTo(i, t);
  2572. Zi.closePath();
  2573. Zi.fill();
  2574. Zi.fillStyle = Si;
  2575. e = -this.rectW / 2;
  2576. i = this.rectW / 2;
  2577. t = this.rectH / 2 - 3;
  2578. r = this.rectH / 2 + 15;
  2579. Zi.beginPath();
  2580. Zi.moveTo(e, t);
  2581. n = 0;
  2582. o = [-15, 5, 10, 0, -10, 3, 12, 4, 0, 3, 5, -10, 5, -12, 5, 10, 0, -6];
  2583. l = 60;
  2584. h = 0;
  2585. p = Ms - this.y;
  2586. g = 0 - this.y;
  2587. Zi.lineTo(e, r);
  2588. s = r + n;
  2589. for (a = e; a < i; a += l) Zi.lineTo(a, Math.min(p, Math.max(g, s + o[h]))), h = (h + 1) % o.length;
  2590. Zi.lineTo(i, r);
  2591. Zi.lineTo(i, t);
  2592. Zi.closePath();
  2593. Zi.fill();
  2594. if (a = Ns("img/riverCurrent" + this.riverSpecT + ".png"))
  2595. for (s = -this.rectW / 2, Vn = 0; 40 > Vn; Vn++) e = 100 / 120 * this.riverFlowSpeedX * 1e3, e = (Yi - this.spawnTime) % e / e, Zi.drawImage(a, s + 100 * e, -this.rectH / 2, 100, this.rectH), s += 100;
  2596. break;
  2597. case m:
  2598. Zi.fillStyle = Ii;
  2599. Zi.fillRect(-this.rectW / 2, -this.rectH / 2, this.rectW, this.rectH);
  2600. s = 20;
  2601. fillGrid(-this.rectW / 2 + s, -this.rectH / 2 + s, this.rectW / 2 - s, this.rectH / 2 - s, this.x, this.y);
  2602. break;
  2603. case P:
  2604. e ? ci(0, 0, this.rad, this.getOutlineColor()) : ci(0, 0, this.rad - 1.5, Hi);
  2605. break;
  2606. case I:
  2607. Zi.fillStyle = Ui;
  2608. Zi.beginPath();
  2609. Zi.arc(0, 0, Math.max(0, this.rad), 0, 2 * Math.PI);
  2610. Zi.fill();
  2611. Zi.fillStyle = "#E4D04C";
  2612. Zi.beginPath();
  2613. Zi.arc(-5 + 10 * this.rPer, -5 + 10 * this.rPer, .8 * this.rad, 0, 2 * Math.PI);
  2614. Zi.fill();
  2615. break;
  2616. case Te:
  2617. a = (Yi - this.spawnTime) / 1e3;
  2618. e = di(a, 1, 5, 2);
  2619. s = di(a, 1, .2, 2);
  2620. Zi.globalAlpha = .5;
  2621. ci(0, 0, this.rad, Ni);
  2622. i = -(-.2 + e) * Zt(90);
  2623. Zi.save();
  2624. Zi.scale(1, 1 + s);
  2625. Zi.globalAlpha = .3;
  2626. Zi.rotate(i);
  2627. ci(0, 0, this.rad - e, "#2CAAC4");
  2628. Zi.restore();
  2629. Zi.save();
  2630. Zi.scale(1 + s, 1);
  2631. Zi.globalAlpha = .1;
  2632. Zi.rotate(i);
  2633. ci(0, 0, .9 * this.rad - e, "white");
  2634. Zi.restore();
  2635. break;
  2636. case U:
  2637. a = this.curBiome == Xi ? "#8fa4e0" : Ni;
  2638. this.drawOutlinedCircle("", a);
  2639. break;
  2640. case S:
  2641. (a = Ns("img/snowball.png")) ? (s = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -s, -s, 2 * s, 2 * s)) : this.drawOutlinedCircle("", "white");
  2642. break;
  2643. case ge:
  2644. break;
  2645. case fe:
  2646. Zi.save();
  2647. ci(0, 0, this.rad, this.isEdibleOutlined() ? Gi : zi(this.curBiome));
  2648. ci(0, 0, Math.max(0, this.rad - 2), Ni);
  2649. Zi.restore();
  2650. Zi.save();
  2651. s = .3;
  2652. a = .5 * (.7 - s);
  2653. Zi.globalAlpha *= s + a + a * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3));
  2654. Zi.globalAlpha *= this.effA_poison;
  2655. ci(0, 0, this.rad + 2.6, "#7FF600");
  2656. Zi.restore();
  2657. break;
  2658. case _:
  2659. s = .15;
  2660. a = .5 * (.8 - s);
  2661. s = s + a + a * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  2662. Zi.save();
  2663. Zi.globalAlpha *= s;
  2664. ci(0, 0, Math.max(0, this.rad), "#F6EA65");
  2665. Zi.restore();
  2666. s = .85;
  2667. a = .5 * (1 - s);
  2668. s = s + a + a * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  2669. if (a = Ns(1 == Math.trunc(Yi / 300) % 2 ? "img/fire.png" : "img/fire2.png")) i = .3 * this.rad, t = 2 * this.rad * (2 + 2 * s) / 3, r = 2 * this.rad * s, e = .5, n = .95, Zi.save(), a && (Zi.globalAlpha = Zi.globalAlpha * this.onFireEffA * s, Zi.drawImage(a, 0 + t * -e, i + r * -n, t, r)), Zi.restore();
  2670. break;
  2671. case f:
  2672. break;
  2673. default:
  2674. this.isRectangle ? (Zi.fillStyle = "black", Zi.fillRect(-this.rectW / 2, -this.rectH / 2, this.rectW, this.rectH)) : this.drawOutlinedCircle("????", "black")
  2675. }
  2676. };
  2677. In.prototype.draw = function(e) {
  2678. this.moveUpdF = this.moveUpdate();
  2679. Zi.save();
  2680. Zi.translate(this.x, this.y);
  2681. if (this.doesDrawEffectScale && !qs) {
  2682. var a;
  2683. a = (Yi - this.spawnTime) / 1e3;
  2684. var t = 1.5,
  2685. i = .1;
  2686. this.drawEffectScale_Slow && (t = 2.5, i = .04);
  2687. a = i * Math.sin(2 * Math.PI / t * a);
  2688. Zi.scale(1 + a, 1 + a / 2)
  2689. }
  2690. this.getOutlineColor();
  2691. Zi.globalAlpha = this.dead ? Zi.globalAlpha * (1 - this.moveUpdF) : Zi.globalAlpha * Math.min(1, (Yi - this.spawnTime) / (1e3 * Ti));
  2692. this.customDraw(e);
  2693. this.flag_hurt && (Zi.fillStyle = "rgba(255,0,0,0.3)", Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - 2), 0, 2 * Math.PI), Zi.fill());
  2694. this.drawHealthBar();
  2695. Zi.restore()
  2696. };
  2697. In.prototype.drawHealthBar = function() {
  2698. Zi.save();
  2699. this.hpBarA += .04 * ((Yi < this.hpBarTimeoutT ? 1 : 0) - this.hpBarA);
  2700. if (.001 < this.hpBarA) {
  2701. this.hpPer += .1 * (this.hpPer_n - this.hpPer);
  2702. var e = Math.max(1, this.rad / 25),
  2703. a = 20 * e,
  2704. t = 5 * e,
  2705. e = -this.rad - 10 * e;
  2706. Zi.globalAlpha *= this.hpBarA;
  2707. Zi.fillStyle = "rgba(0,0,0,0.35)";
  2708. Zi.fillRect(0 - a / 2, e - t / 2, a, t);
  2709. Zi.fillStyle = "#16D729";
  2710. Zi.fillRect(0 - a / 2, e - t / 2, this.hpPer / 100 * a, t)
  2711. }
  2712. Zi.restore()
  2713. };
  2714. In.prototype.drawChat = function() {
  2715. if (!(1 > this.chatLines.length)) {
  2716. Zi.save();
  2717. Zi.font = "10px Arial";
  2718. Zi.lineWidth = 1;
  2719. Zi.textAlign = "center";
  2720. Zi.textBaseline = "middle";
  2721. for (var e = .01 < this.hpBarA ? -10 : 0, a = [], t = this.chatLines.length - 1; 0 <= t; t--) {
  2722. var i = this.chatLines[t],
  2723. s = -13 * (this.chatLines.length - 1 - t) + e,
  2724. r = Yi > i.chatFadeT ? 0 : 1;
  2725. i.chatA += .1 * (r - i.chatA);
  2726. Zi.shadowOffsetX = 0;
  2727. Zi.shadowOffsetY = 0;
  2728. .02 > i.chatA ? (.02 > r && (i.chatTxt = ""), a.push(t)) : (r = Zi.measureText(i.chatTxt).width, Zi.globalAlpha = .8 * i.chatA, Zi.fillStyle = zi(this.curBiome), Zi.fillRect(this.x - 1 - r / 2, s + this.y - this.rad - 10 - 5 - 1, r + 2, 12), Zi.fillStyle = "#F1C34C", qs || (Zi.shadowOffsetX = 1, Zi.shadowOffsetY = 1, Zi.shadowColor = "black"), Zi.globalAlpha = i.chatA, Zi.fillText(i.chatTxt, this.x, s + this.y - this.rad - 10))
  2729. }
  2730. for (t = 0; t < a.length; t++) this.chatLines.splice(a[t], 1);
  2731. Zi.restore()
  2732. }
  2733. };
  2734. In.prototype.getOutlineColor = function() {
  2735. if (this.alwaysPlainOutline) return Di;
  2736. if (this.isEdibleOutlined()) return Gi;
  2737. if (this.oType == f && 0 < Ss[this.animalType - 1] && this.id != dr) return Wi;
  2738. var e = this.curBiome;
  2739. if (this.flag_inWater) e = Li;
  2740. else if (this.flag_inLava) return _i;
  2741. return zi(e)
  2742. };
  2743. In.prototype.isEdibleOutlined = function() {
  2744. return this.oType == f ? 0 < Es[this.animalType - 1] && this.id != dr : 0 < Bs[this.oType - 1]
  2745. };
  2746. In.prototype.gotChat = function(e) {
  2747. this.chatLines.push({
  2748. chatTxt: e,
  2749. chatFadeT: Yi + 4e3,
  2750. chatA: 0
  2751. });
  2752. 5 < this.chatLines.length && this.chatLines.splice(this.chatLines.length - 1, 1)
  2753. };
  2754. In.prototype.drawOutlinedCircle = function(e, a) {
  2755. var t = this.getOutlineColor();
  2756. qs && t == Di || ci(0, 0, this.rad, t);
  2757. ci(0, 0, Math.max(0, this.rad - 1.5), a)
  2758. };
  2759. In.prototype.moveUpdate = function() {
  2760. var e = (Yi - this.updateTime) / 1e3 / Ti,
  2761. e = 0 > e ? 0 : 1 < e ? 1 : e;
  2762. this.dead && 1 <= e && Ws.push(this);
  2763. this.x = e * (this.nx - this.ox) + this.ox;
  2764. this.y = e * (this.ny - this.oy) + this.oy;
  2765. this.rad += .1 * (this.nRad - this.rad);
  2766. if (void 0 != this.angle) {
  2767. var a = .1 * this.angleDelta;
  2768. this.angleDelta -= a;
  2769. this.angle += a
  2770. }
  2771. return Math.min(1, e)
  2772. };
  2773. In.prototype.readCustomData_onUpdate = function(e) {
  2774. this.oType == M && (this.specType = e.readUInt8(), this.specType2 = e.readUInt8(), this.hasAngleUpdate && (e = 3 * e.readUInt8(), this.angle = Zt(e)))
  2775. };
  2776. In.prototype.readCustomData_onNewlyVisible = function(e) {
  2777. if (this.oType == M) {
  2778. this.type = e.readUInt8();
  2779. this.hasAngleUpdate = 1 == e.readUInt8();
  2780. this.specType = e.readUInt8();
  2781. this.specType2 = e.readUInt8();
  2782. if (this.hasAngleUpdate || this.type == yt || this.type == ut || this.type == bt || this.type == nt || this.type == ot || this.type == Pt || this.type == mt || this.type == At || this.type == Dt || this.type == Mt || this.type == It || this.type == vt || this.type == xt) {
  2783. var a = 3 * e.readUInt8() + 180;
  2784. this.angle = Zt(a)
  2785. }
  2786. if (this.type == Za || this.type == Qa || this.type == mt || this.type == st || this.type == ht) this.rad = this.oRad = 0
  2787. }
  2788. this.oType == $ && (this.riverSpecT = a = e.readUInt8(), this.riverFlowSpeedX = 0 == a ? 1 : -1);
  2789. this.oType == pe && (this.specType = e.readUInt8())
  2790. };
  2791. In.prototype.setObjTypes = function(e, a) {
  2792. this.oType = e
  2793. };
  2794. In.prototype.worldUpd_readMsgNewlyVisible = function(e, a, t) {
  2795. this.setObjTypes(a, t);
  2796. t = e.readUInt32();
  2797. var i = e.readUInt16() / 4,
  2798. s = e.readUInt16() / 4,
  2799. r = e.readUInt16() / 4;
  2800. this.id = t;
  2801. this.ox = this.x = this.nx = s;
  2802. this.oy = this.y = this.ny = r;
  2803. this.nRad = i;
  2804. this.oRad = this.rad = 0;
  2805. if (a == de || a == ie || a == k || a == N || a == T || a == M || a == u || a == P || a == x || a == I) this.oRad = this.rad = i;
  2806. i = e.readBitGroup();
  2807. a = i.getBool();
  2808. t = i.getBool();
  2809. this.curBiome = i.getInt0to3();
  2810. i = null;
  2811. a && (i = Fs[e.readUInt32()]);
  2812. i && (this.updateTime = Yi, this.nx = this.x, this.ny = this.y, this.ox = i.x, this.oy = i.y, this.x = i.x, this.y = i.y);
  2813. t && (this.isRectangle = !0, this.rectW = e.readUInt16(), this.rectH = e.readUInt16());
  2814. if (this.objGetsAngleUpdate = 1 == e.readUInt8()) a = 3 * e.readUInt8(), this.angle = Zt(a + 90), this.specType = e.readUInt8();
  2815. this.readCustomData_onNewlyVisible(e)
  2816. };
  2817. In.prototype.worldUpd_readMsgUpdate = function(e) {
  2818. var a = e.readUInt16() / 4,
  2819. t = e.readUInt16() / 4,
  2820. i = e.readUInt16() / 10;
  2821. this.specType = e.readUInt8();
  2822. var s = e.readBitGroup(),
  2823. r = s.getBool(),
  2824. s = s.getBool();
  2825. this.updateTime = Yi;
  2826. this.ox = this.x;
  2827. this.oy = this.y;
  2828. this.nx = a;
  2829. this.ny = t;
  2830. this.oRad = this.rad;
  2831. this.nRad = i;
  2832. this.flag_hurt = s;
  2833. r ? (a = e.readUInt8(), .001 > this.hpBarA && (this.hpPer = a), this.hpPer_n = a, this.hpBarTimeoutT = +new Date + 3e3) : this.hpBarTimeoutT = +new Date;
  2834. this.objGetsAngleUpdate && (a = 3 * e.readUInt8(), this.angle = Zt(a + 90), this.specType = e.readUInt8());
  2835. this.readCustomData_onUpdate(e);
  2836. this.firstPosUpd = !1
  2837. };
  2838. In.prototype.worldUpd_readMsgRemovedObj = function(e) {
  2839. e = 0 < e.readUInt8() ? e.readUInt32() : 0;
  2840. e = 0 < e ? Fs[e] : void 0;
  2841. this.dead = !0;
  2842. this.updateTime = Yi;
  2843. this.oType == M ? (this.ox = this.x, this.oy = this.y, this.nx = this.x, this.ny = this.y) : e ? (this.ox = this.x, this.oy = this.y, this.oRad = this.rad, this.nx = e.nx, this.ny = e.ny, this.nRad = Math.min(this.rad, e.rad), this.hp_n = 0) : (this.ox = this.x, this.oy = this.y, this.oRad = this.rad, this.nx = this.x, this.ny = this.y, this.nRad = 0)
  2844. };
  2845. In.prototype.updateZ = function() {
  2846. switch (this.oType) {
  2847. case m:
  2848. this.z = -220;
  2849. break;
  2850. case C:
  2851. this.z = -210;
  2852. break;
  2853. case ie:
  2854. case de:
  2855. this.z = -209;
  2856. break;
  2857. case Y:
  2858. this.z = -202;
  2859. break;
  2860. case V:
  2861. this.z = -201;
  2862. break;
  2863. case $:
  2864. case T:
  2865. case ae:
  2866. case me:
  2867. this.z = -159;
  2868. break;
  2869. case v:
  2870. case k:
  2871. this.z = -158;
  2872. break;
  2873. case ee:
  2874. this.z = -158;
  2875. break;
  2876. case N:
  2877. this.z = -156;
  2878. break;
  2879. case b:
  2880. this.z = -155;
  2881. break;
  2882. case I:
  2883. this.z = -154;
  2884. break;
  2885. case M:
  2886. if (this.type == Nt || this.type == Rt || this.type == Ft || this.type == Wt || this.type == zt) {
  2887. this.z = 100002;
  2888. break
  2889. }
  2890. this.type == Ka || this.type == et || this.type == nt || this.type == bt || this.type == ut || this.type == Et || this.type == ot || this.type == Pt || this.type == yt || this.type == At || this.type == It || this.type == Dt || this.type == Mt || this.type == xt || this.type == Ct || this.type == _t ? this.z = 10001 : this.type == mt ? this.z = 1002 : this.type == Ot ? this.z = 10001 : this.type == Bt ? 1 == this.specType ? this.z = 10001 : 2 == this.specType && (this.z = 1013) : this.z = -152;
  2891. break;
  2892. case D:
  2893. this.z = -150;
  2894. break;
  2895. case A:
  2896. this.z = -101;
  2897. break;
  2898. case y:
  2899. this.z = -100;
  2900. break;
  2901. case te:
  2902. this.z = -99;
  2903. break;
  2904. case u:
  2905. this.z = 999;
  2906. break;
  2907. case Pe:
  2908. case x:
  2909. this.z = 1e3;
  2910. break;
  2911. case P:
  2912. this.z = 1001;
  2913. break;
  2914. case ge:
  2915. this.z = 1002;
  2916. break;
  2917. case G:
  2918. case H:
  2919. this.z = 1004;
  2920. break;
  2921. case Te:
  2922. this.z = 1015;
  2923. break;
  2924. case j:
  2925. case z:
  2926. this.z = 1006;
  2927. break;
  2928. case _:
  2929. case fe:
  2930. this.z = 1006;
  2931. break;
  2932. case w:
  2933. this.z = 1e4;
  2934. break;
  2935. case ke:
  2936. this.z = 1002;
  2937. 0 != this.specType && (this.z = 10001);
  2938. break;
  2939. case f:
  2940. this.flag_flying ? (this.z = 10001 + this.rad - (this.flag_usingAbility ? 0 : this.rad / 2), 100 == this.specType2 && (this.z = 1014)) : this.z = !this.flag_usingAbility || this.animalType != Ta && this.animalType != _a ? this.flag_underWater || this.flag_usingAbility && this.animalType == De ? -100 : this.animalType == Ta ? 1010 : this.animalType == pa ? 1009 : this.animalType == ka ? 1008 + (this.flag_usingAbility ? 1 : 0) : this.animalType == Ue ? 1007 : this.flag_canClimbHill || this.animalType == Ne || this.animalType == Se || this.animalType == Ke || this.animalType == ta || this.animalType == Re || this.animalType == He || this.animalType == ia || this.animalType == ra || this.animalType == Qe || this.animalType == ma || this.animalType == Je || this.animalType == ba || this.animalType == ya || this.animalType == wa ? 1003 : this.animalType == Pa ? 1e3 : this.rad : 10001;
  2941. break;
  2942. default:
  2943. this.z = this.rad
  2944. }
  2945. };
  2946.  
  2947. function In(e) {
  2948. this.oType = e;
  2949. this.rPer = Lt(0, 1);
  2950. this.updateTime = this.spawnTime = Yi;
  2951. this.firstPosUpd = !0;
  2952. this.chatLines = [];
  2953. switch (this.oType) {
  2954. case E:
  2955. case z:
  2956. case L:
  2957. case X:
  2958. case j:
  2959. case U:
  2960. case _:
  2961. case fe:
  2962. case ge:
  2963. case B:
  2964. case R:
  2965. case O:
  2966. case y:
  2967. case D:
  2968. case A:
  2969. case W:
  2970. case K:
  2971. case J:
  2972. case q:
  2973. case Z:
  2974. case Q:
  2975. case ue:
  2976. case se:
  2977. case re:
  2978. case pe:
  2979. case ne:
  2980. case oe:
  2981. case le:
  2982. case he:
  2983. case ce:
  2984. case we:
  2985. case Ae:
  2986. case Pe:
  2987. this.doesDrawEffectScale = !0
  2988. }
  2989. if (this.oType == y || this.oType == A || this.oType == D || this.oType == ge) this.drawEffectScale_Slow = !0
  2990. }
  2991. window.GameObj = In;
  2992. var vn = Mn,
  2993. Dn = In;
  2994. vn.prototype = Object.create(Dn.prototype);
  2995. vn.prototype.constructor = vn;
  2996.  
  2997. function Mn() {
  2998. this.objs = [];
  2999. this.updateZ = function() {
  3000. 0 < this.objs.length && (this.objs[0].updateZ(), this.z = this.objs[0].z)
  3001. };
  3002. this.draw = function() {
  3003. for (var e = 0; e < this.objs.length; e++) {
  3004. var a = this.objs[e];
  3005. a.draw(!0)
  3006. }
  3007. for (e = 0; e < this.objs.length; e++) a = this.objs[e], a.draw(!1)
  3008. };
  3009. this.addBatchedObj = function(e) {
  3010. 0 == this.objs.length && (this.oType = e.oType, this.objs = []);
  3011. this.objs.push(e)
  3012. }
  3013. }
  3014. window.GameObjBatchDraw = Mn;
  3015. var c = 1,
  3016. p = 2,
  3017. g = 3,
  3018. Ie = 4,
  3019. ve = 5,
  3020. De = 6,
  3021. Me = 7,
  3022. xe = 8,
  3023. Ce = 9,
  3024. Ne = 10,
  3025. _e = 11,
  3026. Se = 12,
  3027. Ee = 13,
  3028. Ue = 14,
  3029. Be = 15,
  3030. Oe = 16,
  3031. Re = 17,
  3032. Fe = 18,
  3033. We = 19,
  3034. Ge = 20,
  3035. He = 21,
  3036. ze = 22,
  3037. je = 23,
  3038. Le = 24,
  3039. Xe = 25,
  3040. Ye = 26,
  3041. Ve = 27,
  3042. Ke = 28,
  3043. Je = 29,
  3044. qe = 30,
  3045. Ze = 31,
  3046. Qe = 32,
  3047. $e = 33,
  3048. ea = 34,
  3049. aa = 35,
  3050. ta = 36,
  3051. ia = 37,
  3052. sa = 38,
  3053. ra = 39,
  3054. na = 40,
  3055. oa = 41,
  3056. la = 42,
  3057. ha = 43,
  3058. ca = 44,
  3059. da = 45,
  3060. pa = 46,
  3061. ma = 47,
  3062. fa = 48,
  3063. ua = 49,
  3064. ba = 50,
  3065. ya = 51,
  3066. wa = 52,
  3067. ka = 53,
  3068. Pa = 54,
  3069. Aa = 55,
  3070. Ta = 56,
  3071. Ia = 57,
  3072. va = 58,
  3073. Da = 59,
  3074. Ma = 60,
  3075. xa = 61,
  3076. Ca = 62,
  3077. Na = 63,
  3078. _a = 64,
  3079. Sa = 65,
  3080. Ea = 66,
  3081. Ua = 67,
  3082. Ba = 68,
  3083. Oa = 69,
  3084. Ra = function(e) {
  3085. var a = {};
  3086. switch (e) {
  3087. case da:
  3088. a.aniName = "Snail";
  3089. a.aniDesc = "";
  3090. a.upgradeText = "You're a super slow snail!";
  3091. a.aniCol = "#fcc02b";
  3092. a.skinName = "snail";
  3093. break;
  3094. case c:
  3095. a.aniName = "Mouse";
  3096. a.aniDesc = "";
  3097. a.upgradeText = "";
  3098. a.aniCol = "#9BA9B9";
  3099. a.skinName = "mouse";
  3100. break;
  3101. case p:
  3102. a.aniName = "Rabbit";
  3103. a.aniDesc = "";
  3104. a.upgradeText = "UPGRADED to RABBIT! \nPress W to burrow a hole to hide in!";
  3105. a.aniCol = "#AA937E";
  3106. a.skinName = "rabbit";
  3107. break;
  3108. case g:
  3109. a.aniName = "Pig";
  3110. a.aniDesc = "";
  3111. a.upgradeText = "UPGRADED to PIG!\n Pigs move FAST through MUD! (Can use 'stink' on mud/ hiding holes!)";
  3112. a.aniCol = "#DD6BD4";
  3113. a.skinName = "pig";
  3114. break;
  3115. case Ie:
  3116. a.aniName = "Fox";
  3117. a.aniDesc = "";
  3118. a.upgradeText = "UPGRADED to FOX! ,\n You can kick players out of hiding holes! (Press W when in one!)\n+ Hide in red berry bushes!";
  3119. a.aniCol = "#FF9D43";
  3120. a.skinName = "fox";
  3121. break;
  3122. case ve:
  3123. a.aniName = "Deer";
  3124. a.aniDesc = "";
  3125. a.upgradeText = "UPGRADED to DEER! \nPress W to dig up food! \nDig in mud for better food!\n Hint:Check water areas for new food sources!";
  3126. a.aniCol = "#C4773E";
  3127. a.skinName = "deer";
  3128. break;
  3129. case De:
  3130. a.aniName = "Mole";
  3131. a.aniDesc = "";
  3132. a.upgradeText = "UPGRADED to MOLE!\n Hold W to dig underground!\nGo under anything, do surprise attacks!";
  3133. a.aniCol = "#4C4A45";
  3134. a.skinName = "mole";
  3135. break;
  3136. case Me:
  3137. a.aniName = "Zebra";
  3138. a.aniDesc = "";
  3139. a.upgradeText = "UPGRADED to ZEBRA! \nPress W to kick side ways!";
  3140. a.aniCol = "#FFFFFF";
  3141. a.skinName = "zebra";
  3142. break;
  3143. case xe:
  3144. a.aniName = "Lion";
  3145. a.aniDesc = "";
  3146. a.upgradeText = "UPGRADED to LION!\n Press W to release a mighty ROAR (Rawr!)!";
  3147. a.aniCol = "#f8c923";
  3148. a.skinName = "lion";
  3149. break;
  3150. case Ce:
  3151. a.aniName = "Cheetah";
  3152. a.aniDesc = "";
  3153. a.upgradeText = "UPGRADED to CHEETAH!\n Press W to get a speed boost! (Every 8 seconds)!";
  3154. a.aniCol = "#CAC05B";
  3155. a.skinName = "cheetah";
  3156. break;
  3157. case Ne:
  3158. a.aniName = "Bear";
  3159. a.aniDesc = "";
  3160. a.upgradeText = "UPGRADED to BEAR!\n Bears climb through green hills! (Press W to use your claw!)";
  3161. a.aniCol = "#99591C";
  3162. a.skinName = "bear";
  3163. break;
  3164. case _e:
  3165. a.aniName = "Croc";
  3166. a.aniDesc = "";
  3167. a.upgradeText = "UPGRADED to CROCODILE!\n Press W to bite and drag around animals! \n+ (Now hide in water spots)+ Swim well in Mud, Lakes & Oceans!";
  3168. a.aniCol = "#30F51C";
  3169. a.skinName = "croc";
  3170. break;
  3171. case Ee:
  3172. a.aniName = "Hippo";
  3173. a.aniDesc = "";
  3174. a.upgradeText = "UPGRADED to HIPPO!\nHippos are great swimmers, dominate the Lakes/Oceans/Mud!";
  3175. a.aniCol = "#945A99";
  3176. a.skinName = "hippo";
  3177. break;
  3178. case Se:
  3179. a.aniName = "Rhino";
  3180. a.aniDesc = "";
  3181. a.upgradeText = "UPGRADED to RHINO!\n Press W to CHARGE with your mighty horn!";
  3182. a.aniCol = "#94a3a9";
  3183. a.skinName = "rhino";
  3184. break;
  3185. case Be:
  3186. a.aniName = "Shrimp";
  3187. a.aniDesc = "";
  3188. a.upgradeText = "";
  3189. a.aniCol = "#f88e37";
  3190. a.skinName = "shrimp";
  3191. break;
  3192. case Oe:
  3193. a.aniName = "Trout";
  3194. a.aniDesc = "";
  3195. a.upgradeText = "UPGRADED to TROUT!\nHint: Hold Left-click to RUN! (Uses extra water)";
  3196. a.aniCol = "#ac8686";
  3197. a.skinName = "trout";
  3198. break;
  3199. case Re:
  3200. a.aniName = "Crab";
  3201. a.aniDesc = "";
  3202. a.upgradeText = "UPGRADED to CRAB!\n Crabs can survive on dry land!\n (On land, Press W to go into your shell!)";
  3203. a.aniCol = "#bf2408";
  3204. a.skinName = "crab";
  3205. break;
  3206. case Fe:
  3207. a.aniName = "Squid";
  3208. a.aniDesc = "";
  3209. a.upgradeText = "UPGRADED to SQUID!\n Squids can use INK when injured (press W!) \n+ you can hide in plankton bushes!";
  3210. a.aniCol = "#40dda4";
  3211. a.skinName = "squid";
  3212. break;
  3213. case We:
  3214. a.aniName = "Shark";
  3215. a.aniDesc = "";
  3216. a.upgradeText = "UPGRADED to SHARK!\n A vicious predator of the oceans!";
  3217. a.aniCol = "#999fc6";
  3218. a.skinName = "shark";
  3219. break;
  3220. case ze:
  3221. a.aniName = "Sea-horse";
  3222. a.aniDesc = "";
  3223. a.upgradeText = "UPGRADED to SEA HORSE!\n An agile hunter!";
  3224. a.aniCol = "#73BE2F";
  3225. a.skinName = "seahorse";
  3226. break;
  3227. case je:
  3228. a.aniName = "Jellyfish";
  3229. a.aniDesc = "";
  3230. a.upgradeText = "UPGRADED to JELLYFISH!\n A slowly-turning animal that can grow quite large!";
  3231. a.aniCol = "#FDB9BA";
  3232. a.skinName = "jellyfish";
  3233. break;
  3234. case He:
  3235. a.aniName = "Turtle";
  3236. a.aniDesc = "";
  3237. a.upgradeText = "UPGRADED to TURTLE!\n Lives well on land & water! (On land, Press W to go into your shell!)";
  3238. a.aniCol = "#502E1A";
  3239. a.skinName = "turtle";
  3240. break;
  3241. case Ge:
  3242. a.aniName = "Stringray";
  3243. a.aniDesc = "";
  3244. a.upgradeText = "UPGRADED to STINGRAY!\n Use electic shock (Release W key!) to shock animals! \n(Takes time to recharge)";
  3245. a.aniCol = "#164336";
  3246. a.skinName = "stingray";
  3247. break;
  3248. case Le:
  3249. a.aniName = "The Kraken";
  3250. a.aniDesc = "";
  3251. a.upgradeText = "UPGRADED to THE KRAKEN!\n Terrorize the oceans, and be feared by all!\n (Release W to use whirlpool ability!)";
  3252. a.aniCol = "#64a034";
  3253. a.skinName = "kraken";
  3254. break;
  3255. case Xe:
  3256. a.aniName = "Pufferfish";
  3257. a.aniDesc = "";
  3258. a.upgradeText = "UPGRADED to PUFFERFISH!\n (Hold W to inflate- become spiky, and dangerous to touch!)";
  3259. a.aniCol = "#6C5C2C";
  3260. a.skinName = "pufferfish";
  3261. break;
  3262. case Ye:
  3263. a.aniName = "Killer Whale";
  3264. a.aniDesc = "";
  3265. a.upgradeText = "UPGRADED to Killer Whale! \nWhales blow out water when diving! (And sometimes other loot!)";
  3266. a.aniCol = "#141414";
  3267. a.skinName = "killerwhale";
  3268. break;
  3269. case Ve:
  3270. a.aniName = "Swordfish";
  3271. a.aniDesc = "";
  3272. a.upgradeText = "UPGRADED to " + a.aniName + "!\n (Press W to rush with your sharp nose!)";
  3273. a.aniCol = "#689CD7";
  3274. a.skinName = "swordfish";
  3275. break;
  3276. case Ke:
  3277. a.aniName = "Gorilla";
  3278. a.aniDesc = "";
  3279. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Gorillas are very fast on hills/trees!\n Press W to throw bananas! (from trees)";
  3280. a.aniCol = "#323232";
  3281. a.skinName = "gorilla";
  3282. break;
  3283. case Je:
  3284. a.aniName = "Octopus";
  3285. a.aniDesc = "";
  3286. a.upgradeText = "UPGRADED to Octopus!\nHold W to use your 'Disguise' ability!\n(Hint: wait for prey to bite you- they get stunned!)";
  3287. a.aniCol = "#ff8340";
  3288. a.skinName = "octopus";
  3289. break;
  3290. case Ue:
  3291. a.aniName = "Dragon";
  3292. a.aniDesc = "";
  3293. a.upgradeText = "UPGRADED to " + a.aniName + "!\n (You're amazing!) \nFly over everything, Hold W to shoot fire!";
  3294. a.aniCol = "#22FF8A";
  3295. a.skinName = "dragon";
  3296. break;
  3297. case pa:
  3298. a.aniName = "Black Dragon";
  3299. a.aniDesc = "";
  3300. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Black dragons drink lava instead of water! Black dragons only heal on healing stones/lava!";
  3301. a.aniCol = "black";
  3302. a.skinName = "blackdragon";
  3303. break;
  3304. case wa:
  3305. a.aniName = "Giant Spider";
  3306. a.aniDesc = "";
  3307. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Place web around the game to catch prey!";
  3308. a.aniCol = "black";
  3309. a.skinName = "giantSpider";
  3310. break;
  3311. case ba:
  3312. a.aniName = "Cobra";
  3313. a.aniDesc = "";
  3314. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Hold W to Spit venom, and poison animals with your bite!";
  3315. a.aniCol = "black";
  3316. a.skinName = "cobra";
  3317. break;
  3318. case ya:
  3319. a.aniName = "Boa Constrictor";
  3320. a.aniDesc = "";
  3321. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Coil and suffocate other animals!";
  3322. a.aniCol = "black";
  3323. a.skinName = "boaConstrictor";
  3324. break;
  3325. case ka:
  3326. a.aniName = "T-REX";
  3327. a.aniDesc = "";
  3328. a.upgradeText = "UPGRADED to " + a.aniName + " The Dinosaur!\n This ancient dinosaur has powerful jaws that can drag prey around!!";
  3329. a.aniCol = "#862A2A";
  3330. a.skinName = "trex";
  3331. break;
  3332. case Pa:
  3333. a.aniName = "Tiger";
  3334. a.aniDesc = "";
  3335. a.upgradeText = "UPGRADED to Tiger!\n Tigers can launch an ambush attack (HOLD W to grow a bush)!";
  3336. a.aniCol = "#FF9000";
  3337. a.skinName = "tiger";
  3338. break;
  3339. case Aa:
  3340. a.aniName = "Giraffe";
  3341. a.aniDesc = "";
  3342. a.upgradeText = "UPGRADED to Giraffe!\nGiraffe have huge legs and stomp anyone in their way!";
  3343. a.aniCol = "#E9BD23";
  3344. a.skinName = "giraffe";
  3345. break;
  3346. case Ta:
  3347. a.aniName = "Eagle";
  3348. a.aniDesc = "";
  3349. a.upgradeText = "UPGRADED to Eagle!\nEagles can fly up other animals in the air! !\nThey can also fly high (double click)";
  3350. a.aniCol = "#5b400d";
  3351. a.skinName = "eagle";
  3352. break;
  3353. case oa:
  3354. a.aniName = "Arctic Fox";
  3355. a.aniDesc = "";
  3356. a.upgradeText = "UPGRADED to " + a.aniName + "!\n You can kick players out of hiding holes! (Press W when in one!)\n+ Hide in red berry bushes!";
  3357. a.aniCol = "#CFCFCF";
  3358. a.skinName = "arctic/arcticfox";
  3359. break;
  3360. case Ze:
  3361. a.aniName = "Arctic Hare";
  3362. a.aniDesc = "";
  3363. a.upgradeText = "UPGRADED to " + a.aniName + "!\n \nPress W to burrow a hole to hide in!";
  3364. a.aniCol = "#D5D5D5";
  3365. a.skinName = "arctic/arctichare";
  3366. break;
  3367. case Qe:
  3368. a.aniName = "The Yeti!";
  3369. a.aniDesc = "";
  3370. a.upgradeText = "UPGRADED to " + a.aniName + "!\n So it really exists... \n Hold W to turn into snow, release W to freeeeeze!";
  3371. a.aniCol = "#839eb5";
  3372. a.skinName = "arctic/yeti";
  3373. break;
  3374. case $e:
  3375. a.aniName = "Chipmunk";
  3376. a.aniDesc = "";
  3377. a.upgradeText = "";
  3378. a.aniCol = "#A77C30";
  3379. a.skinName = "arctic/chipmunk";
  3380. break;
  3381. case ea:
  3382. a.aniName = "Muskox";
  3383. a.aniDesc = "";
  3384. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to charge with your horns! \nPlus move decently on ice!";
  3385. a.aniCol = "#231f18";
  3386. a.skinName = "arctic/muskox";
  3387. break;
  3388. case aa:
  3389. a.aniName = "Penguin";
  3390. a.aniDesc = "";
  3391. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Left-click to run!\n (HOLD W to slide FAST on ice)!";
  3392. a.aniCol = "#FFFFFF";
  3393. a.skinName = "arctic/penguin";
  3394. break;
  3395. case ta:
  3396. a.aniName = "Polar Bear";
  3397. a.aniDesc = "";
  3398. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Polar bears can climb hills! \n+ They're amazing swimmers!";
  3399. a.aniCol = "#e4e4e4";
  3400. a.skinName = "arctic/polarbear";
  3401. break;
  3402. case ia:
  3403. a.aniName = "Seal";
  3404. a.aniDesc = "";
  3405. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Seals can slide on ice (Hold W) + can climb hills (rocks too!)";
  3406. a.aniCol = "#cfcfcf";
  3407. a.skinName = "arctic/seal";
  3408. break;
  3409. case sa:
  3410. a.aniName = "Snow leopard";
  3411. a.aniDesc = "";
  3412. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to get a speed boost! (Every 8 seconds)!";
  3413. a.aniCol = "#cfcfcf";
  3414. a.skinName = "arctic/snowleopard";
  3415. break;
  3416. case ra:
  3417. a.aniName = "Walrus";
  3418. a.aniDesc = "";
  3419. a.upgradeText = "UPGRADED to " + a.aniName + "!\n You can slide on ice (Hold W) + can climb hills (rocks too!)";
  3420. a.aniCol = "#633838";
  3421. a.skinName = "arctic/walrus";
  3422. break;
  3423. case na:
  3424. a.aniName = "Reindeer";
  3425. a.aniDesc = "";
  3426. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to dig up food! \n Your sharp hooves let you turn very well on ice!";
  3427. a.aniCol = "#a68976";
  3428. a.skinName = "arctic/reindeer";
  3429. break;
  3430. case qe:
  3431. a.aniName = "Wolf";
  3432. a.aniDesc = "";
  3433. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Wolf paws turn very well on ice!\n Press W to howl!";
  3434. a.aniCol = "#6B6B6B";
  3435. a.skinName = "arctic/wolf";
  3436. break;
  3437. case la:
  3438. a.aniName = "Wolverine";
  3439. a.aniDesc = "";
  3440. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to Let out a Powerful GROWL! (Knocks back prey!)";
  3441. a.aniCol = "#843A0F";
  3442. a.skinName = "arctic/wolverine";
  3443. break;
  3444. case ha:
  3445. a.aniName = "Mammoth";
  3446. a.aniDesc = "";
  3447. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to roll snowballs with your trunk!\n The bigger the snowball gets, the longer the freeze!";
  3448. a.aniCol = "#9d4717";
  3449. a.skinName = "arctic/mammoth";
  3450. break;
  3451. case ca:
  3452. a.aniName = "Donkey";
  3453. a.aniDesc = "";
  3454. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Press W to Kick any animal behind you";
  3455. a.aniCol = "#8c7c64";
  3456. a.skinName = "donkey";
  3457. break;
  3458. case ma:
  3459. a.aniName = "Sabertooth Tiger";
  3460. a.aniDesc = "";
  3461. a.upgradeText = "UPGRADED to Sabertooth Tiger!\nSabertooth Tigers are great swimmers, dominate the Lakes/Oceans/Mud!";
  3462. a.aniCol = "#945A99";
  3463. a.skinName = "sabertoothtiger";
  3464. break;
  3465. case fa:
  3466. a.aniName = "Elephant";
  3467. a.aniDesc = "";
  3468. a.upgradeText = "UPGRADED to " + a.aniName + "!\n Use your long trunk to attack and eat food!";
  3469. a.aniCol = "#945A99";
  3470. a.skinName = "elephant";
  3471. break;
  3472. case ua:
  3473. a.aniName = "Blue Whale";
  3474. a.aniDesc = "";
  3475. a.upgradeText = "UPGRADED to Blue Whale!\n Smash with your powerful tail!";
  3476. a.aniCol = "#945A99";
  3477. a.skinName = "bluewhale";
  3478. break;
  3479. case va:
  3480. a.aniName = "Duck";
  3481. a.aniDesc = "";
  3482. a.upgradeText = "UPGRADED to a DUCK!";
  3483. a.aniCol = "#FF9000";
  3484. a.skinName = "duck";
  3485. break;
  3486. case Da:
  3487. a.aniName = "Duckling";
  3488. a.aniDesc = "";
  3489. a.upgradeText = "UPGRADED to a DUCK!";
  3490. a.aniCol = "#FF9000";
  3491. a.skinName = "duckling";
  3492. break;
  3493. case Ia:
  3494. a.aniName = "Hedgehog";
  3495. a.aniDesc = "";
  3496. a.upgradeText = "UPGRADED to Hedgehog!\n (Hold W to become spiky, and dangerous to touch!)";
  3497. a.aniCol = "#5b400d";
  3498. a.skinName = "hedgehog";
  3499. break;
  3500. case xa:
  3501. a.aniName = "King Crab";
  3502. a.aniDesc = "";
  3503. a.upgradeText = "UPGRADED to a KING CRAB!";
  3504. a.aniCol = "#971f0e";
  3505. a.skinName = "kingcrab";
  3506. break;
  3507. case Ma:
  3508. a.aniName = "Lemming";
  3509. a.aniDesc = "";
  3510. a.upgradeText = "";
  3511. a.aniCol = "#A77C30";
  3512. a.skinName = "arctic/lemming";
  3513. break;
  3514. case Ca:
  3515. a.aniName = "Frog";
  3516. a.aniDesc = "";
  3517. a.upgradeText = "UPGRADED to Frog!!";
  3518. a.aniCol = "#FF9000";
  3519. a.skinName = "frog/frog";
  3520. break;
  3521. case Na:
  3522. a.aniName = "Ostrich";
  3523. a.aniDesc = "";
  3524. a.upgradeText = "UPGRADED to Ostrich! Lay eggs to hatch babies! \nCommand babies by placing your crosshair (right-click/W)-\n They can attack prey!";
  3525. a.aniCol = "#FF9000";
  3526. a.skinName = "ostrich/ostrich";
  3527. break;
  3528. case _a:
  3529. a.aniName = "Pelican";
  3530. a.aniDesc = "";
  3531. a.upgradeText = "UPGRADED to Pelican! \nPick up water (and prey!) in your mouth,\nfly, and drop water on prey! (press W again)";
  3532. a.aniCol = "#FF9000";
  3533. a.skinName = "pelican/pelican";
  3534. break;
  3535. case Sa:
  3536. a.aniName = "Falcon";
  3537. a.aniDesc = "";
  3538. a.upgradeText = "UPGRADED to Falcon! \nFly, and do a powerful dive attack! Aim it well.";
  3539. a.aniCol = "#FF9000";
  3540. a.skinName = "falcon/falcon";
  3541. break;
  3542. case Ea:
  3543. a.aniName = "Snowy Owl";
  3544. a.aniDesc = "";
  3545. a.upgradeText = "UPGRADED to Snowy Owl!\n Aim the crosshair, \n right click/W when it's on top of prey, to attack!";
  3546. a.aniCol = "#FF9000";
  3547. a.skinName = "snowyowl/snowyowl";
  3548. break;
  3549. case Oa:
  3550. a.aniName = "Baby Ostrich";
  3551. a.aniDesc = "";
  3552. a.upgradeText = "UPGRADED to Baby Ostrich!!";
  3553. a.aniCol = "#FF9000";
  3554. a.skinName = "ostrich/baby-ostrich";
  3555. break;
  3556. default:
  3557. a.aniName = "(Animal)", a.aniDesc = "", a.upgradeText = "UPGRADED!"
  3558. }
  3559. return a
  3560. },
  3561. xn = Cn,
  3562. Dn = In;
  3563. xn.prototype = Object.create(Dn.prototype);
  3564. xn.prototype.constructor = xn;
  3565. xn.superClass = Dn;
  3566. Cn.prototype.animalType = c;
  3567. Cn.prototype.nickName = "";
  3568. Cn.prototype.skinImgName = null;
  3569. Cn.prototype.skinNotLoadedColor = "#75ce67";
  3570. Cn.prototype.flag_lowWat = !1;
  3571. Cn.prototype.flag_tailBitten = !1;
  3572. Cn.prototype.flag_underWater = !1;
  3573. Cn.prototype.flag_eff_stunned = !1;
  3574. Cn.prototype.flag_eff_frozen = !1;
  3575. Cn.prototype.flag_usingAbility = !1;
  3576. Cn.prototype.flag_eff_invincible = !1;
  3577. Cn.prototype.flag_eff_healing = Cn.prototype.flag_eff_poison = Cn.prototype.flag_eff_bleeding = !1;
  3578. Cn.prototype.flag_iceSliding = !1;
  3579. Cn.prototype.underwaterA = 0;
  3580. Cn.prototype.nickNameA = 0;
  3581. Cn.prototype.bleedingA = 0;
  3582. Cn.prototype.stunA = 0;
  3583. Cn.prototype.frozenEffA = Cn.prototype.onFireEffA = Cn.prototype.effA_healing = 0;
  3584. Cn.prototype.effA_poison = Cn.prototype.effA_bleeding = Cn.prototype.effA_stunk = 0;
  3585. Cn.prototype.effA_constricted = Cn.prototype.effA_slimed = Cn.prototype.effA_webStuck = 0;
  3586. Cn.prototype.nameA = 0;
  3587. Cn.prototype.loadedSkinImg = null;
  3588. Cn.prototype.outlineW = null;
  3589. Cn.prototype.getNameSize = function() {
  3590. return 10
  3591. };
  3592. Cn.prototype.setNick = function(e) {
  3593. this.nickName = e;
  3594. null == this.nickTXT ? (this.nickTXT = new pi(this.getNameSize(), "#FFFFFF"), this.nickTXT.strokeW = 1.5, this.nickTXT.renderScale = 5) : this.nickTXT.setFontSize(this.getNameSize());
  3595. this.nickTXT.setText(this.nickName)
  3596. };
  3597. Cn.prototype.drawEyeAtPos = function(e, a) {
  3598. Zi.beginPath();
  3599. Zi.arc(e, a, 4.5, 0, 2 * Math.PI);
  3600. Zi.fillStyle = "black";
  3601. Zi.fill();
  3602. Zi.beginPath();
  3603. Zi.fillStyle = "white";
  3604. Zi.arc(e - 2, a - 1, .99, 0, 2 * Math.PI);
  3605. Zi.fill()
  3606. };
  3607. Cn.prototype.customDraw = function(e) {
  3608. var a = Ra(this.animalType);
  3609. e = a.aniCol;
  3610. this.skinImgName = a.skinName;
  3611. a = .1 * this.rad;
  3612. this.skinNotLoadedColor = e;
  3613. switch (this.animalType) {
  3614. case Xe:
  3615. case ea:
  3616. case Ve:
  3617. case He:
  3618. case _e:
  3619. a = .16 * this.rad
  3620. }
  3621. var t = this.getSkinName();
  3622. this.loadedSkinImg = null;
  3623. t && !Ks && (this.loadedSkinImg = Ns("./skins/" + t + ".png"));
  3624. Zi.save();
  3625. Zi.rotate(this.angle);
  3626. var i, s = (Yi - this.spawnTime) / 1e3;
  3627. i = .7 * Math.sin(2 * Math.PI / 2.5 * s);
  3628. t = this.flag_underWater || this.flag_usingAbility && (this.animalType == De || this.animalType == Je || this.animalType == Qe) ? 0 : 1;
  3629. this.flag_stealth && (t = this.animalType == ze ? 0 : .2);
  3630. this.flag_flying && this.id != dr && !this.flag_isGrabbed && (t = .6);
  3631. this.underwaterA += .1 * (t - this.underwaterA);
  3632. Zi.globalAlpha *= this.underwaterA;
  3633. if (this.flag_eff_invincible) {
  3634. var s = .3,
  3635. r = .5 * (1 - s);
  3636. Zi.globalAlpha *= s + r + r * Math.sin(2 * Math.PI / 1 * ((Yi - this.spawnTime) / 1e3))
  3637. }
  3638. this.outlineW = 2 + i;
  3639. i = this.getOutlineColor();
  3640. this.flag_flying || qs && i != Gi && i != Wi ? this.outlineW = 0 : ci(0, 0, this.rad, i);
  3641. if (this.animalType != p && this.animalType != c && this.animalType != Re) {
  3642. var s = (Yi - this.spawnTime) / 1e3,
  3643. s = 4 * Math.sin(2 * Math.PI / 5 * s),
  3644. r = 2.5 * this.outlineW,
  3645. n = Math.PI / 180;
  3646. Zi.fillStyle = this.flag_tailBitten ? Wi : 0 < Us[this.animalType - 1] && this.id != dr ? Gi : i;
  3647. qs && Zi.fillStyle != Di || this.flag_flying || (Zi.beginPath(), Zi.moveTo((this.rad - this.outlineW + 1) * Math.cos((282.5 + r) * n), (this.rad - this.outlineW + 1) * Math.sin(282.5 * n)), Zi.lineTo((this.rad - this.outlineW + 1) * Math.cos((257.5 - r) * n), (this.rad - this.outlineW + 1) * Math.sin(257.5 * n)), Zi.lineTo((this.rad + a + this.outlineW) * Math.cos((270 + s) * n), (this.rad + a + this.outlineW) * Math.sin((270 + s) * n)), Zi.lineTo((this.rad - this.outlineW + 1) * Math.cos((282.5 + r) * n), (this.rad - this.outlineW + 1) * Math.sin(282.5 * n)), Zi.fill());
  3648. qs || this.loadedSkinImg && !this.flag_tailBitten || (Zi.fillStyle = this.flag_tailBitten ? Wi : e, Zi.beginPath(), Zi.moveTo((this.rad - this.outlineW) * Math.cos(282.5 * n), (this.rad - this.outlineW) * Math.sin(282.5 * n)), Zi.lineTo((this.rad - this.outlineW) * Math.cos(257.5 * n), (this.rad - this.outlineW) * Math.sin(257.5 * n)), Zi.lineTo((this.rad + a) * Math.cos((270 + s) * n), (this.rad + a) * Math.sin((270 + s) * n)), Zi.lineTo((this.rad - this.outlineW) * Math.cos(282.5 * n), (this.rad - this.outlineW) * Math.sin(282.5 * n)), Zi.fill())
  3649. }
  3650. this.drawUnderSkinImgOutline();
  3651. this.drawUnderSkinImg();
  3652. this.drawSkinImg();
  3653. this.drawOnTopOfSkinImg();
  3654. Zi.restore();
  3655. this.drawTopEffects();
  3656. this.flag_lowWat && (s = .2, r = .5 * (.8 - s), e = s + r + r * Math.sin(2 * Math.PI / 1.2 * (Yi / 1e3)), Zi.save(), Zi.globalAlpha = e, Zi.fillStyle = this.animalType == pa ? _i : Ni, Zi.beginPath(), Zi.arc(0, this.rad + 5, 5, 0, 2 * Math.PI), Zi.fill(), Zi.restore());
  3657. this.drawNickName(t)
  3658. };
  3659. Cn.prototype.drawNickName = function(e) {
  3660. this.nickNameA += .1 * (e - this.nickNameA);
  3661. this.nickName && this.nickTXT && !Js && (Zi.save(), Zi.globalAlpha = this.dead ? Zi.globalAlpha * (1 - this.moveUpdF) : 1, Zi.globalAlpha *= this.nickNameA, this.nickTXT.x = 0, this.nickTXT.y = this.rad + 9, this.nickTXT.draw(), Zi.restore())
  3662. };
  3663. Cn.prototype.drawUnderSkinImgOutline = function() {
  3664. if (this.flag_underWater || this.flag_usingAbility && this.animalType == De) Zi.save(), Zi.globalAlpha = 1 - this.underwaterA, this.drawWhenUnderwater(), Zi.restore();
  3665. if (this.flag_eff_stunk) {
  3666. Zi.save();
  3667. var e = .3,
  3668. a = .5 * (1 - e),
  3669. e = e + a + a * Math.sin(2 * Math.PI / 1 * ((Yi - this.spawnTime) / 1e3));
  3670. Zi.globalAlpha *= e;
  3671. ci(0, 0, this.rad + 2.6 * e, "brown");
  3672. Zi.restore()
  3673. }
  3674. this.flag_iceSliding && (e = (Yi - this.spawnTime) / 1e3, e = 1 * Math.sin(2 * Math.PI / .75 * e), a = Zi.globalAlpha, Zi.globalAlpha *= .8 - .2 * e, ci(0, .3 * this.rad, this.rad * (.9 + .15 * e), "#7BB7BB"), ci(0, .3 * -this.rad, this.rad * (1.05 + .1 * e), "#7BB7BB"), console.log("drawing ice slide"), Zi.globalAlpha = a);
  3675. !this.flag_usingAbility || this.animalType != ve && this.animalType != na || (e = (Yi - this.spawnTime) / 1e3, e = 1 * Math.sin(2 * Math.PI / 1.5 * e), a = Zi.globalAlpha, Zi.globalAlpha *= .8, ci(0, .3 * this.rad, this.rad * (.9 + .12 * e), "#7F582B"), ci(0, .3 * -this.rad, this.rad * (1.05 + .09 * e), "#7F582B"), Zi.globalAlpha = a);
  3676. e = this.flag_eff_frozen || this.flag_cold ? 1 : 0;
  3677. this.frozenEffA += .1 * (e - this.frozenEffA);
  3678. .01 < this.frozenEffA && (a = Zi.globalAlpha, Zi.globalAlpha *= this.frozenEffA, ci(0, 0, this.rad + 1.6 * this.frozenEffA, "white"), Zi.globalAlpha = a);
  3679. e = this.flag_eff_healing ? 1 : 0;
  3680. this.effA_healing += .1 * (e - this.effA_healing);
  3681. .01 < this.effA_healing && (Zi.save(), Zi.globalAlpha *= this.effA_healing, ci(0, 0, this.rad + 2.6 * this.effA_healing, "purple"), Zi.restore());
  3682. e = this.flag_eff_poison ? 1 : 0;
  3683. this.effA_poison += .1 * (e - this.effA_poison);
  3684. .01 < this.effA_poison && (Zi.save(), e = .3, a = .5 * (1 - e), Zi.globalAlpha *= e + a + a * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), Zi.globalAlpha *= this.effA_poison, ci(0, 0, this.rad + 2.6 * this.effA_poison, "#7FF600"), Zi.restore());
  3685. e = this.flag_eff_bleeding ? 1 : 0;
  3686. this.effA_bleeding += .1 * (e - this.effA_bleeding);
  3687. .01 < this.effA_bleeding && (Zi.save(), e = .3, a = .5 * (1 - e), Zi.globalAlpha *= e + a + a * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), Zi.globalAlpha *= this.effA_bleeding, ci(0, 0, this.rad + 2.6 * this.effA_bleeding, "red"), Zi.restore());
  3688. e = this.flag_eff_slimed ? 1 : 0;
  3689. this.effA_slimed += .1 * (e - this.effA_slimed);
  3690. .01 < this.effA_slimed && (Zi.save(), e = .3, a = .5 * (1 - e), Zi.globalAlpha *= e + a + a * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), Zi.globalAlpha *= this.effA_slimed, ci(0, 0, this.rad + 2.6 * this.effA_slimed, "grey"), Zi.restore())
  3691. };
  3692. Cn.prototype.drawUnderSkinImg = function() {};
  3693. Cn.prototype.drawWhenUnderwater = function() {
  3694. var e = (Yi - this.spawnTime) / 1e3,
  3695. a = 1 * Math.sin(2 * Math.PI / 1.5 * e);
  3696. this.animalType == _e && (Zi.globalAlpha *= .3);
  3697. Zi.fillStyle = this.flag_underWater ? "#4E71C3" : "#7E6A35";
  3698. var t = this.flag_underWater ? .15 * this.rad : .1 * this.rad;
  3699. Zi.beginPath();
  3700. Zi.arc(-.35 * this.rad, -.33 * this.rad, Math.max(0, t + a), 0, 2 * Math.PI);
  3701. Zi.fill();
  3702. Zi.beginPath();
  3703. Zi.arc(.35 * this.rad, -.32 * this.rad, Math.max(0, t - a), 0, 2 * Math.PI);
  3704. Zi.fill();
  3705. Zi.beginPath();
  3706. Zi.arc(.35 * this.rad, .36 * this.rad, Math.max(0, t + a), 0, 2 * Math.PI);
  3707. Zi.fill();
  3708. Zi.beginPath();
  3709. Zi.arc(-.35 * this.rad, .35 * this.rad, Math.max(0, t - a), 0, 2 * Math.PI);
  3710. Zi.fill();
  3711. this.animalType == We ? (Zi.globalAlpha = 1 - this.underwaterA, Zi.fillStyle = "#73799b", Zi.beginPath(), e = this.rad, a = .25 * e, Zi.moveTo(-.07 * e, a), Zi.lineTo(0, a - .5 * e), Zi.lineTo(.35 * e, a), Zi.closePath(), Zi.fill()) : this.animalType == Ye ? ci(0, .2 * this.rad, .12 * this.rad, "#4D4D4D") : this.animalType == ua ? ci(0, .45 * this.rad, .08 * this.rad, "#202A65") : this.animalType == xa ? (e = di(e, 1, 1, 1), Zi.save(), Zi.rotate(Zt(40)), Zi.scale(1, 2), Zi.globalAlpha = .08, ci(1 * this.rad, .2 * this.rad, .1 * this.rad + .1 * this.rad * e, "#B32E10"), Zi.globalAlpha = .2, ci(1 * this.rad, .2 * this.rad, .15 * this.rad, "#B32E10"), Zi.restore(), Zi.save(), Zi.globalAlpha = 1, Zi.rotate(Zt(-40)), Zi.scale(1, 2), Zi.globalAlpha = .08, ci(-1 * this.rad, .2 * this.rad, .1 * this.rad + .1 * this.rad * -e, "#B32E10"), Zi.globalAlpha = .2, ci(-1 * this.rad, .2 * this.rad, .15 * this.rad, "#B32E10"), Zi.restore()) : this.animalType == Le ? (Zi.globalAlpha = 1 - this.underwaterA, ci(.4 * this.rad, .75 * this.rad, .12 * this.rad, "#598b30"), ci(.65 * this.rad, .55 * this.rad, .1 * this.rad, "#64a034"), ci(-.4 * this.rad, .75 * this.rad, .12 * this.rad, "#64a034"), ci(-.65 * this.rad, .55 * this.rad, .1 * this.rad, "#598b30")) : this.animalType == ka && (Zi.save(), Zi.globalAlpha = .2, Zi.scale(1, 2), ci(0, .24 * this.rad, .08 * this.rad, "#202A65"), ci(0, -.02 * this.rad, .06 * this.rad, "#202A65"), ci(0, -.28 * this.rad, .05 * this.rad, "#202A65"), ci(0, -.54 * this.rad, .04 * this.rad, "#202A65"), Zi.restore())
  3712. };
  3713. Cn.prototype.basicDrawSkinImg = function() {
  3714. var e = 500 / 340,
  3715. a = this.rad - this.outlineW;
  3716. this.loadedSkinImg ? this.animalType == ka ? (overSizeOffset = a / 2, Zi.drawImage(this.loadedSkinImg, -a - overSizeOffset, -a - overSizeOffset, 2 * a * e, 2.4 * a * e)) : Zi.drawImage(this.loadedSkinImg, -a * e, -a * e, 2 * a * e, 2 * a * e) : this.loadedSkinImg && (Zi.fillStyle = this.skinNotLoadedColor, Zi.beginPath(), Zi.arc(0, 0, Math.max(0, this.rad - this.outlineW), 0, 2 * Math.PI), Zi.fill())
  3717. };
  3718. Cn.prototype.drawSkinImg = function() {
  3719. this.basicDrawSkinImg();
  3720. this.drawSkinCustomization()
  3721. };
  3722. Cn.prototype.drawSkinCustomization = function() {};
  3723. Cn.prototype.drawOnTopOfSkinImg = function() {
  3724. if (!this.loadedSkinImg) {
  3725. Zi.save();
  3726. var e = Math.max(1, this.rad / 25);
  3727. Zi.scale(e, e);
  3728. this.drawEyeAtPos(6, .32 * this.rad);
  3729. this.drawEyeAtPos(-6, .32 * this.rad);
  3730. Zi.restore()
  3731. }
  3732. if (this.animalType == Se) {
  3733. Zi.fillStyle = "#E5CF79";
  3734. Zi.beginPath();
  3735. var e = this.rad - this.outlineW,
  3736. a = 1 * e;
  3737. Zi.moveTo(-.16 * e, a);
  3738. Zi.lineTo(0, e * (this.flag_usingAbility ? 1.41 : .7));
  3739. Zi.lineTo(.153 * e, a);
  3740. Zi.closePath();
  3741. Zi.fill()
  3742. }
  3743. this.flag_usingAbility && this.animalType == Qe && (Zi.save(), Zi.globalAlpha = 1 - this.underwaterA, (a = Ns("img/snowball.png")) ? (e = this.rad, Zi.rotate(this.rPer * Math.PI * 2), Zi.drawImage(a, -e, -e, 2 * e, 2 * e)) : this.drawOutlinedCircle("", "white"), Zi.restore())
  3744. };
  3745. Cn.prototype.drawTopEffects = function() {
  3746. var e = this.flag_eff_stunned ? 1 : 0;
  3747. this.stunA += .1 * (e - this.stunA);
  3748. if (.01 < this.stunA) {
  3749. Zi.save();
  3750. var a = 2.5,
  3751. a = Yi % (1e3 * a) / (1e3 * a);
  3752. Zi.rotate(2 * a * Math.PI);
  3753. Zi.globalAlpha *= this.stunA;
  3754. var t = .2 * this.rad,
  3755. a = (Yi - this.spawnTime) / 1e3,
  3756. e = (.5 + .07 * t) * Math.sin(2 * Math.PI / 1 * a);
  3757. Zi.fillStyle = "#F3D444";
  3758. Zi.beginPath();
  3759. Zi.arc(-.22 * this.rad, -.22 * this.rad, Math.max(0, t + e), 0, 2 * Math.PI);
  3760. Zi.fill();
  3761. Zi.beginPath();
  3762. Zi.arc(.22 * this.rad, -.22 * this.rad, Math.max(0, t - e), 0, 2 * Math.PI);
  3763. Zi.fill();
  3764. Zi.beginPath();
  3765. Zi.arc(.22 * this.rad, .22 * this.rad, Math.max(0, t + e), 0, 2 * Math.PI);
  3766. Zi.fill();
  3767. Zi.beginPath();
  3768. Zi.arc(-.22 * this.rad, .22 * this.rad, Math.max(0, t - e), 0, 2 * Math.PI);
  3769. Zi.fill();
  3770. Zi.restore()
  3771. }
  3772. e = this.flag_eff_onFire ? 1 : 0;
  3773. this.onFireEffA += .1 * (e - this.onFireEffA);
  3774. if (.01 < this.onFireEffA) {
  3775. e = .15;
  3776. t = .5 * (.4 - e);
  3777. e = e + t + t * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  3778. Zi.save();
  3779. Zi.globalAlpha = Zi.globalAlpha * e * this.onFireEffA;
  3780. ci(0, 0, Math.max(0, this.rad), "orange");
  3781. Zi.restore();
  3782. var e = .5,
  3783. t = .5 * (1 - e),
  3784. e = e + t + t * Math.sin(2 * Math.PI / 1 * (Yi / 1e3)),
  3785. i = Math.trunc(Yi / 150) % 5,
  3786. t = Ns("img/fire/" + Math.trunc(Yi / 100) % 5 + ".png"),
  3787. i = Ns("img/fire/" + i + ".png");
  3788. if (t || i) {
  3789. var s = 0 - .3 * this.rad,
  3790. r = .2 * this.rad - .3 * this.rad,
  3791. n = 1 * this.rad * (2 + 2 * e) / 3,
  3792. o = 1 * this.rad * e;
  3793. Zi.save();
  3794. t && (Zi.globalAlpha = Zi.globalAlpha * this.onFireEffA * e, Zi.drawImage(t, s + -.5 * n, r + -.95 * o, n, o));
  3795. i && (Zi.globalAlpha = Zi.globalAlpha * this.onFireEffA * e, Zi.drawImage(i, s + .5 * this.rad + -.5 * n, r + .5 * this.rad + -.95 * o, n, o));
  3796. Zi.restore()
  3797. }
  3798. }
  3799. .01 < this.frozenEffA && this.flag_eff_frozen && (Zi.save(), a = 7, a = Yi % (1e3 * a) / (1e3 * a), Zi.rotate(2 * a * Math.PI), Zi.globalAlpha *= this.frozenEffA, t = .2 * this.rad, a = (Yi - this.spawnTime) / 1e3, e = (.5 + .07 * t) * Math.sin(2 * Math.PI / 1 * a), Zi.fillStyle = "white", i = .27 * this.rad, Zi.beginPath(), Zi.arc(-i, -i, Math.max(0, t + e), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(i, -i, Math.max(0, t - e), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(i, i, Math.max(0, t + e), 0, 2 * Math.PI), Zi.fill(), Zi.beginPath(), Zi.arc(-i, i, Math.max(0, t - e), 0, 2 * Math.PI), Zi.fill(), Zi.restore());
  3800. .01 < this.frozenEffA && (Zi.save(), Zi.globalAlpha = .3 * Zi.globalAlpha * this.frozenEffA, ci(0, 0, Math.max(0, this.rad - this.outlineW), "white"), Zi.restore());
  3801. .01 < this.effA_healing && (Zi.save(), Zi.globalAlpha = .3 * Zi.globalAlpha * this.effA_healing, ci(0, 0, Math.max(0, this.rad - this.outlineW), "#ef24ed"), Zi.restore());
  3802. .01 < this.effA_poison && (Zi.save(), Zi.globalAlpha = .3 * Zi.globalAlpha * this.effA_poison, e = .3, t = .5 * (1 - e), Zi.globalAlpha *= e + t + t * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), ci(0, 0, Math.max(0, this.rad - this.outlineW), "#9FDA00"), Zi.restore());
  3803. e = this.flag_eff_bleeding ? .8 : 0;
  3804. this.effA_bleeding += .1 * (e - this.effA_bleeding);
  3805. .01 < this.effA_bleeding && (Zi.save(), e = .3, t = .3 * (1 - e), Zi.globalAlpha *= e + t + t * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), Zi.globalAlpha *= this.effA_bleeding, ci(0, 0, this.rad + -2.6 * this.effA_bleeding, "red"), Zi.restore());
  3806. e = this.flag_eff_slimed ? .8 : 0;
  3807. this.effA_slimed += .1 * (e - this.effA_slimed);
  3808. .01 < this.effA_slimed && (Zi.save(), e = .3, t = .3 * (1 - e), Zi.globalAlpha *= e + t + t * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), Zi.globalAlpha *= this.effA_slimed, ci(0, 0, this.rad + -2.6 * this.effA_slimed, "grey"), Zi.restore());
  3809. e = this.flag_eff_stunk ? .8 : 0;
  3810. this.effA_stunk += .1 * (e - this.effA_stunk);
  3811. .01 < this.effA_stunk && (Zi.save(), e = .3, t = .3 * (1 - e), Zi.globalAlpha *= e + t + t * Math.sin(2 * Math.PI / 1.2 * ((Yi - this.spawnTime) / 1e3)), Zi.globalAlpha *= this.effA_stunk, ci(0, 0, this.rad + -2.6 * this.effA_stunk, "brown"), Zi.restore());
  3812. this.animalType == wa && this.flag_usingAbility && (e = 1 * Math.sin(2 * Math.PI / .75 * a), a = Zi.globalAlpha, Zi.globalAlpha *= .8 - .2 * e, ci(.15 * this.rad, 1.27 * -this.rad, this.rad * (.1 + .05 * e), "#efefef"), ci(.15 * -this.rad, 1.27 * -this.rad, this.rad * (.1 - .05 * e), "#efefef"), Zi.globalAlpha = a);
  3813. e = this.flag_webStuck ? 1 : 0;
  3814. this.effA_webStuck += .02 * (e - this.effA_webStuck);
  3815. if (.01 < this.effA_webStuck) {
  3816. Zi.save();
  3817. Zi.globalAlpha = .9 * Zi.globalAlpha * this.effA_webStuck;
  3818. if (t = Ns("img/spiderWeb_stuck.png")) a = 1.3 * this.rad, Zi.drawImage(t, -a, -a, 2 * a, 2 * a);
  3819. Zi.restore()
  3820. }
  3821. e = this.flag_constricted ? 1 : 0;
  3822. this.effA_constricted += .04 * (e - this.effA_constricted);
  3823. if (.01 < this.effA_constricted) {
  3824. Zi.save();
  3825. Zi.globalAlpha = .9 * Zi.globalAlpha * this.effA_constricted;
  3826. if (t = Ns("img/constrict.png")) a = 1.3 * this.rad, Zi.rotate(-this.angle), Zi.drawImage(t, -a, -a, 2 * a, 2 * a);
  3827. Zi.restore()
  3828. }
  3829. };
  3830. Cn.prototype.getSkinName = function() {
  3831. var e = this.skinImgName;
  3832. switch (this.animalType) {
  3833. case Xe:
  3834. case ea:
  3835. case Ve:
  3836. case He:
  3837. case Re:
  3838. case da:
  3839. case ba:
  3840. case ya:
  3841. case Ia:
  3842. this.flag_usingAbility && (e += "2");
  3843. break;
  3844. case Pa:
  3845. this.z *= 2, this.flag_usingAbility && 4 == this.specType && (e += "2")
  3846. }!this.flag_flying || this.flag_isGrabbed || this.animalType != va && this.animalType != pa || (e = "flying_" + e);
  3847. return e
  3848. };
  3849. Cn.prototype.setObjTypes = function(e, a) {
  3850. this.oType = e;
  3851. this.animalType = a
  3852. };
  3853. Cn.prototype.readCustomData_onNewlyVisible = function(e) {
  3854. Cn.superClass.prototype.readCustomData_onNewlyVisible.call(this, e);
  3855. e = e.readString();
  3856. this.setNick(e ? e : "mope.io")
  3857. };
  3858. Cn.prototype.readCustomData_onUpdate = function(e) {
  3859. Cn.superClass.prototype.readCustomData_onUpdate.call(this, e);
  3860. if (this.oType == f) {
  3861. this.specType = e.readUInt8();
  3862. this.specType2 = e.readUInt8();
  3863. var a = 2 * e.readUInt8(),
  3864. a = Zt(a - 90);
  3865. this.angleDelta = ai(this.angle, a);
  3866. this.oAngle = this.angle;
  3867. this.firstPosUpd && (this.oAngle = this.angle = a, this.angleDelta = 0);
  3868. e = e.readBitGroup();
  3869. this.curBiome = e.getIntWithXBits(3);
  3870. this.flag_lowWat = e.getBool();
  3871. this.flag_underWater = e.getBool();
  3872. this.flag_eff_invincible = e.getBool();
  3873. this.flag_usingAbility = e.getBool();
  3874. this.flag_tailBitten = e.getBool();
  3875. this.flag_eff_stunned = e.getBool();
  3876. this.flag_iceSliding = e.getBool();
  3877. this.flag_eff_frozen = e.getBool();
  3878. this.flag_eff_onFire = e.getBool();
  3879. this.flag_eff_healing = e.getBool();
  3880. this.flag_eff_poison = e.getBool();
  3881. this.flag_constricted = e.getBool();
  3882. this.flag_webStuck = e.getBool();
  3883. this.flag_stealth = e.getBool();
  3884. this.flag_eff_bleeding = e.getBool();
  3885. this.flag_flying = e.getBool();
  3886. this.flag_isGrabbed = e.getBool();
  3887. this.flag_eff_aniInClaws = e.getBool();
  3888. this.flag_eff_stunk = e.getBool();
  3889. this.flag_cold = e.getBool();
  3890. this.flag_inWater = e.getBool();
  3891. this.flag_inLava = e.getBool();
  3892. this.flag_canClimbHill = e.getBool();
  3893. this.flag_isDevMode = e.getBool();
  3894. this.flag_eff_slimed = e.getBool()
  3895. }
  3896. };
  3897.  
  3898. function Cn() {
  3899. Dn.call(this, f)
  3900. }
  3901. window.Animal = Cn;
  3902. h.setCustomClassForGameObjType(Cn, f);
  3903. Dn = In;
  3904. Nn.prototype = Object.create(Dn.prototype);
  3905. Nn.prototype.constructor = Nn;
  3906. Nn.superClass = Dn;
  3907. Nn.prototype.updateZ = function() {
  3908. this.z = 1002
  3909. };
  3910. Nn.prototype.readCustomData_onUpdate = function(e) {
  3911. this.webTransparency = this.specType = e.readUInt8()
  3912. };
  3913. Nn.prototype.customDraw = function(e) {
  3914. Zi.save();
  3915. Zi.globalAlpha = this.specType / 100 * Zi.globalAlpha * .9;
  3916. if (e = Ns("img/spiderWeb.png")) {
  3917. var a = this.rad;
  3918. Zi.rotate(this.rPer * Math.PI * 2);
  3919. Zi.drawImage(e, -a, -a, 2 * a, 2 * a)
  3920. }
  3921. Zi.restore()
  3922. };
  3923. Nn.prototype.readCustomData_onNewlyVisible = function(e) {
  3924. this.webTransparency = this.specType = e.readUInt8()
  3925. };
  3926.  
  3927. function Nn() {
  3928. Nn.superClass.call(this, ge);
  3929. this.webTransparency = 0;
  3930. this.drawEffectScale_Slow = this.doesDrawEffectScale = !0
  3931. }
  3932. window.SpiderWeb = Nn;
  3933. h.setCustomClassForGameObjType(Nn, ge);
  3934. Dn = Cn;
  3935. _n.prototype = Object.create(Dn.prototype);
  3936. _n.prototype.constructor = _n;
  3937. _n.superClass = Dn;
  3938. _n.prototype.readCustomData_onNewlyVisible = function(e) {
  3939. _n.superClass.prototype.readCustomData_onNewlyVisible.call(this, e)
  3940. };
  3941. _n.prototype.readCustomData_onUpdate = function(e) {
  3942. _n.superClass.prototype.readCustomData_onUpdate.call(this, e);
  3943. if (this.flag_usingAbility) {
  3944. var a = 0 < e.readUInt8();
  3945. e = e.readUInt16();
  3946. if (this.octoIsAnimal != a || this.octoDisguiseObjT != e || null == this.octoDrawObj) {
  3947. var t = a ? e : null,
  3948. i = h.createGameObjOfOType(a ? f : e, t);
  3949. a && (i.animalType = t);
  3950. i.oRad = this.oRad;
  3951. i.nRad = this.nRad;
  3952. i.curBiome = this.curBiome;
  3953. this.octoDrawObj = i
  3954. }
  3955. this.octoIsAnimal = a;
  3956. this.octoDisguiseObjT = e
  3957. }
  3958. };
  3959. _n.prototype.drawUnderSkinImgOutline = function() {
  3960. _n.superClass.prototype.drawUnderSkinImgOutline.call(this)
  3961. };
  3962. _n.prototype.drawUnderSkinImg = function() {
  3963. _n.superClass.prototype.drawUnderSkinImg.call(this)
  3964. };
  3965. _n.prototype.drawOnTopOfSkinImg = function() {
  3966. _n.superClass.prototype.drawOnTopOfSkinImg.call(this);
  3967. this.flag_usingAbility && (Zi.save(), Zi.globalAlpha = 1 - this.underwaterA, this.octoDisguiseObjT == R ? this.octoDrawObj.nRad = 25 : this.octoDisguiseObjT == W ? this.octoDrawObj.nRad = 17 : this.octoDisguiseObjT == te && (this.octoDrawObj.nRad = 15), this.octoDrawObj.nRad = this.rad, this.octoDrawObj.draw(), Zi.restore())
  3968. };
  3969. _n.prototype.drawWhenUnderwater = function() {
  3970. _n.superClass.prototype.drawWhenUnderwater.call(this)
  3971. };
  3972. _n.prototype.octoDisguiseObjT = 0;
  3973. _n.prototype.octoIsAnimal = !1;
  3974. _n.prototype.drawHealthBar = function() {
  3975. if (this.flag_usingAbility)
  3976. if (this.octoIsAnimal) _n.superClass.prototype.drawNickName.call(this, 1), this.octoDrawObj.curBiome = this.curBiome, this.hpPer_n = 2, this.hpPer = 25, this.hpBarA = 1;
  3977. else return;
  3978. Zi.save();
  3979. this.hpBarA += .04 * ((Yi < this.hpBarTimeoutT ? 1 : 0) - this.hpBarA);
  3980. if (.001 < this.hpBarA) {
  3981. this.hpPer += .1 * (this.hpPer_n - this.hpPer);
  3982. var e = Math.max(1, this.rad / 25),
  3983. a = 20 * e,
  3984. t = 5 * e,
  3985. e = -this.rad - 10 * e;
  3986. Zi.globalAlpha *= this.hpBarA;
  3987. Zi.fillStyle = "rgba(0,0,0,0.35)";
  3988. Zi.fillRect(0 - a / 2, e - t / 2, a, t);
  3989. Zi.fillStyle = "#16D729";
  3990. var i = this.hpPer / 100 * a;
  3991. this.flag_usingAbility && this.octoIsAnimal && (i = .25 * a);
  3992. Zi.fillRect(0 - a / 2, e - t / 2, i, t)
  3993. }
  3994. Zi.restore()
  3995. };
  3996. _n.prototype.getSkinName = function() {
  3997. return "octopus"
  3998. };
  3999.  
  4000. function _n() {
  4001. _n.superClass.call(this, f)
  4002. }
  4003. window.Octopus = _n;
  4004. h.setCustomClassForGameObjType(_n, f, Je);
  4005. Dn = Cn;
  4006. Sn.prototype = Object.create(Dn.prototype);
  4007. Sn.prototype.constructor = Sn;
  4008. Sn.superClass = Dn;
  4009. Sn.prototype.getSkinName = function() {
  4010. return "eagle/eagle" + (0 == this.specType ? "" : this.specType)
  4011. };
  4012. Sn.prototype.drawSkinCustomization = function() {
  4013. if (this.flag_usingAbility) {
  4014. var e = 500 / 340;
  4015. if (this.flag_flying && !this.flag_isGrabbed) {
  4016. Zi.save();
  4017. var a = (Yi - this.spawnTime) / 1e3,
  4018. a = di(a, .9, .3, 2),
  4019. t = Ns("skins/eagle/eagle_wing1.png");
  4020. if (t) {
  4021. Zi.save();
  4022. var i = -(-.2 + a) * Zt(90),
  4023. s = .8 * this.rad;
  4024. Zi.rotate(Zt(45) + i);
  4025. var i = this.rad,
  4026. r = 1.24 * s,
  4027. s = 2.5 * s;
  4028. Zi.drawImage(t, 0 + -.2 * r, i + -1.7 * s, r, s);
  4029. Zi.restore()
  4030. }
  4031. if (t = Ns("skins/eagle/eagle_wing2.png")) Zi.save(), i = -(-.2 + a) * Zt(-90), s = .8 * this.rad, Zi.rotate(Zt(-45) + i), i = this.rad, r = 1.24 * s, s *= 2.5, Zi.drawImage(t, 0 + -.8 * r, i + -1.7 * s, r, s), Zi.restore();
  4032. Zi.restore()
  4033. } else if (1 == this.specType) {
  4034. Zi.save();
  4035. a = (Yi - this.spawnTime) / 1e3;
  4036. a = di(a, .7, .3, 2);
  4037. if (t = Ns("skins/eagle/eagle_wing1.png")) Zi.save(), i = -(-.2 + a) * Zt(45), s = .8 * this.rad, Zi.rotate(Zt(15) + i), i = this.rad, r = 1.6 * s, s *= 2.2, Zi.drawImage(t, 0 + -0 * r, i + -1.5 * s, r, s), Zi.restore();
  4038. if (t = Ns("skins/eagle/eagle_wing2.png")) Zi.save(), i = -(-.2 + a) * Zt(-45), s = .8 * this.rad, Zi.rotate(Zt(-15) + i), i = this.rad, r = 1.6 * s, s *= 2.2, Zi.drawImage(t, 0 + -1 * r, i + -1.5 * s, r, s), Zi.restore();
  4039. Zi.restore()
  4040. }
  4041. 0 != this.specType && void 0 != this.specType && (a = Ns("skins/eagle/eagle_head.png")) && (Zi.save(), s = this.rad, Zi.drawImage(a, -s * e, (-s + .1 * s) * e, 2 * s * e, 2 * s * e), Zi.restore())
  4042. }
  4043. };
  4044.  
  4045. function Sn() {
  4046. Sn.superClass.call(this, f)
  4047. }
  4048. window.Eagle = Sn;
  4049. h.setCustomClassForGameObjType(Sn, f, Ta);
  4050. Dn = Cn;
  4051. En.prototype = Object.create(Dn.prototype);
  4052. En.prototype.constructor = En;
  4053. En.superClass = Dn;
  4054. En.prototype.getSkinName = function() {
  4055. return "ostrich/ostrich"
  4056. };
  4057.  
  4058. function En() {
  4059. En.superClass.call(this, f)
  4060. }
  4061. window.Ostrich = En;
  4062. h.setCustomClassForGameObjType(En, f, Na);
  4063. Dn = Cn;
  4064. Un.prototype = Object.create(Dn.prototype);
  4065. Un.prototype.constructor = Un;
  4066. Un.superClass = Dn;
  4067. Un.prototype.getSkinName = function() {
  4068. return "ostrich/ostrich-baby"
  4069. };
  4070. Un.prototype.isEdibleOutlined = function() {
  4071. if (this.mommyID == dr) return !1;
  4072. var e = Fs[dr];
  4073. return e && (e = e.animalType, e == Ee || e == ya || e == Ye) ? !1 : Un.superClass.prototype.isEdibleOutlined.call(this)
  4074. };
  4075. Un.prototype.readCustomData_onNewlyVisible = function(e) {
  4076. Un.superClass.prototype.readCustomData_onNewlyVisible.call(this, e);
  4077. this.mommyID = e.readUInt32()
  4078. };
  4079.  
  4080. function Un() {
  4081. Un.superClass.call(this, f)
  4082. }
  4083. window.OstrichBaby = Un;
  4084. h.setCustomClassForGameObjType(Un, f, Oa);
  4085. Dn = Cn;
  4086. Bn.prototype = Object.create(Dn.prototype);
  4087. Bn.prototype.constructor = Bn;
  4088. Bn.superClass = Dn;
  4089. Bn.prototype.getSkinName = function() {
  4090. return "falcon/falcon" + (0 == this.specType || void 0 == this.specType ? "" : this.specType)
  4091. };
  4092. Bn.prototype.drawSkinCustomization = function() {
  4093. if (this.flag_usingAbility) {
  4094. var e = 500 / 340;
  4095. if (this.flag_flying && !this.flag_isGrabbed && 1 == this.specType) {
  4096. Zi.save();
  4097. var a = (Yi - this.spawnTime) / 1e3,
  4098. t = di(a, .7, .4, 2),
  4099. i = Ns("skins/falcon/falcon_wing1.png");
  4100. if (i) {
  4101. Zi.save();
  4102. var s = -(-.2 + t) * Zt(80),
  4103. a = .8 * this.rad;
  4104. Zi.rotate(Zt(25) + s);
  4105. var s = this.rad,
  4106. r = 1.3 * a,
  4107. a = 2.5 * a;
  4108. Zi.drawImage(i, 0 + -0 * r, s + -1.5 * a, r, a);
  4109. Zi.restore()
  4110. }
  4111. if (i = Ns("skins/falcon/falcon_wing2.png")) Zi.save(), s = -(-.2 + t) * Zt(-80), a = .8 * this.rad, Zi.rotate(Zt(-25) + s), s = this.rad, r = 1.3 * a, a *= 2.5, Zi.drawImage(i, 0 + -1 * r, s + -1.5 * a, r, a), Zi.restore();
  4112. Zi.restore()
  4113. } else if (this.flag_flying && 2 == this.specType) {
  4114. Zi.save();
  4115. a = (Yi - this.spawnTime) / 1e3;
  4116. di(a, .7, .3, 2);
  4117. if (i = Ns("skins/falcon/falcon_wing1.png")) Zi.save(), s = .2 * Zt(25), a = .8 * this.rad, Zi.rotate(s), s = this.rad, r = 1.4 * a, a *= 2.2, Zi.drawImage(i, 0 + -0 * r, s + -1.5 * a, r, a), Zi.restore();
  4118. if (i = Ns("skins/falcon/falcon_wing2.png")) Zi.save(), s = .2 * Zt(-25), a = .8 * this.rad, Zi.rotate(s), s = this.rad, r = 1.4 * a, a *= 2.2, Zi.drawImage(i, 0 + -1 * r, s + -1.5 * a, r, a), Zi.restore();
  4119. Zi.restore()
  4120. } else if (this.flag_flying && 3 == this.specType) {
  4121. Zi.save();
  4122. a = (Yi - this.spawnTime) / 1e3;
  4123. t = di(a, .5, .4, 2);
  4124. if (i = Ns("skins/falcon/falcon_wing1.png")) Zi.save(), s = -(-.2 + t) * Zt(45), a = .8 * this.rad, Zi.rotate(Zt(15) + s), s = this.rad, r = 2 * a, a *= 2.2, Zi.drawImage(i, 0 + -0 * r, s + -1.5 * a, r, a), Zi.restore();
  4125. if (i = Ns("skins/falcon/falcon_wing2.png")) Zi.save(), s = -(-.2 + t) * Zt(-45), a = .8 * this.rad, Zi.rotate(Zt(-15) + s), s = this.rad, r = 2 * a, a *= 2.2, Zi.drawImage(i, 0 + -1 * r, s + -1.5 * a, r, a), Zi.restore();
  4126. Zi.restore()
  4127. }
  4128. 0 != this.specType && void 0 != this.specType && (t = Ns("skins/falcon/falcon_head.png")) && (Zi.save(), a = this.rad * (3 == this.specType ? 1.2 : 1), i = .2 * a, 3 == this.specType && (i = -.15 * a), Zi.drawImage(t, -a * e, (-a + i) * e, 2 * a * e, 2 * a * e), Zi.restore())
  4129. }
  4130. };
  4131.  
  4132. function Bn() {
  4133. Bn.superClass.call(this, f)
  4134. }
  4135. window.Falcon = Bn;
  4136. h.setCustomClassForGameObjType(Bn, f, Sa);
  4137. Dn = Cn;
  4138. On.prototype = Object.create(Dn.prototype);
  4139. On.prototype.constructor = On;
  4140. On.superClass = Dn;
  4141. On.prototype.getSkinName = function() {
  4142. return "snowyowl/snowyowl" + (0 == this.specType ? "" : this.specType)
  4143. };
  4144. On.prototype.drawSkinCustomization = function() {
  4145. if (this.flag_usingAbility) {
  4146. var e = 500 / 340;
  4147. if (this.flag_flying && !this.flag_isGrabbed && 1 == this.specType) {
  4148. Zi.save();
  4149. var a = (Yi - this.spawnTime) / 1e3,
  4150. a = di(a, .7, .4, 2),
  4151. t = Ns("skins/snowyowl/snowyowl_wing1.png");
  4152. if (t) {
  4153. Zi.save();
  4154. var i = -(-.2 + a) * Zt(80),
  4155. s = .8 * this.rad;
  4156. Zi.rotate(Zt(25) + i);
  4157. var i = this.rad,
  4158. r = 1.3 * s,
  4159. s = 2.5 * s;
  4160. Zi.drawImage(t, 0 + -0 * r, i + -1.5 * s, r, s);
  4161. Zi.restore()
  4162. }
  4163. if (t = Ns("skins/snowyowl/snowyowl_wing2.png")) Zi.save(), i = -(-.2 + a) * Zt(-80), s = .8 * this.rad, Zi.rotate(Zt(-25) + i), i = this.rad, r = 1.3 * s, s *= 2.5, Zi.drawImage(t, 0 + -1 * r, i + -1.5 * s, r, s), Zi.restore();
  4164. Zi.restore()
  4165. } else if (this.flag_flying && 2 == this.specType) {
  4166. Zi.save();
  4167. a = (Yi - this.spawnTime) / 1e3;
  4168. a = di(a, .7, .3, 2);
  4169. if (t = Ns("skins/snowyowl/snowyowl_wing1.png")) Zi.save(), i = -(-.2 + a) * Zt(45), s = .8 * this.rad, Zi.rotate(Zt(15) + i), i = this.rad, r = 1.4 * s, s *= 2.2, Zi.drawImage(t, 0 + -0 * r, i + -1.5 * s, r, s), Zi.restore();
  4170. if (t = Ns("skins/snowyowl/snowyowl_wing2.png")) Zi.save(), i = -(-.2 + a) * Zt(-45), s = .8 * this.rad, Zi.rotate(Zt(-15) + i), i = this.rad, r = 1.4 * s, s *= 2.2, Zi.drawImage(t, 0 + -1 * r, i + -1.5 * s, r, s), Zi.restore();
  4171. Zi.restore()
  4172. } else if (this.flag_flying && 3 == this.specType) {
  4173. Zi.save();
  4174. a = (Yi - this.spawnTime) / 1e3;
  4175. a = di(a, .5, .5, 2);
  4176. if (t = Ns("skins/snowyowl/snowyowl_wing1.png")) Zi.save(), i = -(-.2 + a) * Zt(45), s = .8 * this.rad, Zi.rotate(Zt(25) + i), i = this.rad, r = 1.4 * s, s *= 2.2, Zi.drawImage(t, 0 + -0 * r, i + -1.5 * s, r, s), Zi.restore();
  4177. if (t = Ns("skins/snowyowl/snowyowl_wing2.png")) Zi.save(), i = -(-.2 + a) * Zt(-45), s = .8 * this.rad, Zi.rotate(Zt(-25) + i), i = this.rad, r = 1.4 * s, s *= 2.2, Zi.drawImage(t, 0 + -1 * r, i + -1.5 * s, r, s), Zi.restore();
  4178. Zi.restore()
  4179. }
  4180. 0 != this.specType && void 0 != this.specType && (a = Ns("skins/snowyowl/snowyowl_head.png")) && (Zi.save(), s = .8 * this.rad, Zi.drawImage(a, -s * e, (-s + .1 * s) * e, 2 * s * e, 2 * s * e), Zi.restore())
  4181. }
  4182. };
  4183.  
  4184. function On() {
  4185. On.superClass.call(this, f)
  4186. }
  4187. window.SnowyOwl = On;
  4188. h.setCustomClassForGameObjType(On, f, Ea);
  4189. Dn = Cn;
  4190. Rn.prototype = Object.create(Dn.prototype);
  4191. Rn.prototype.constructor = Rn;
  4192. Rn.superClass = Dn;
  4193. Rn.prototype.getSkinName = function() {
  4194. return "pelican/pelican" + (0 == this.specType ? "" : this.specType)
  4195. };
  4196. Rn.prototype.drawSkinCustomization = function() {
  4197. if (this.flag_usingAbility) {
  4198. var e = 500 / 340,
  4199. a;
  4200. if (this.flag_flying) {
  4201. Zi.save();
  4202. a = (Yi - this.spawnTime) / 1e3;
  4203. var t = di(a, .9, .3, 2),
  4204. i = Ns("skins/pelican/pelican_wing1.png");
  4205. if (i) {
  4206. Zi.save();
  4207. var s = -(-.2 + t) * Zt(90);
  4208. a = .8 * this.rad;
  4209. Zi.rotate(Zt(45) + s);
  4210. var s = this.rad,
  4211. r = 1.2 * a;
  4212. a *= 2.3;
  4213. Zi.drawImage(i, 0 + -0 * r, s + -1.7 * a, r, a);
  4214. Zi.restore()
  4215. }
  4216. if (i = Ns("skins/pelican/pelican_wing2.png")) Zi.save(), s = -(-.2 + t) * Zt(-90), a = .8 * this.rad, Zi.rotate(Zt(-45) + s), s = this.rad, r = 1.2 * a, a *= 2.3, Zi.drawImage(i, 0 + -1 * r, s + -1.7 * a, r, a), Zi.restore();
  4217. Zi.restore()
  4218. } else if (1 == this.specType) {
  4219. Zi.save();
  4220. a = (Yi - this.spawnTime) / 1e3;
  4221. t = di(a, .9, .3, 2);
  4222. if (i = Ns("skins/pelican/pelican_wing11.png")) Zi.save(), s = -(-.2 + t) * Zt(45), a = .8 * this.rad, Zi.rotate(Zt(45) + s), s = this.rad, r = 1.4 * a, a *= 2.2, Zi.drawImage(i, 0 + -0 * r, s + -1.7 * a, r, a), Zi.restore();
  4223. if (i = Ns("skins/pelican/pelican_wing21.png")) Zi.save(), s = -(-.2 + t) * Zt(-45), a = .8 * this.rad, Zi.rotate(Zt(-45) + s), s = this.rad, r = 1.4 * a, a *= 2.2, Zi.drawImage(i, 0 + -1 * r, s + -1.7 * a, r, a), Zi.restore();
  4224. Zi.restore()
  4225. }
  4226. 0 != this.specType && !this.flag_isGrabbed && (2 == this.specType && (i = Ns("skins/pelican/ability_pelican.png")) && (Zi.save(), Zi.rotate(Zt(180)), a = .3 * this.rad, t = 1 * this.rad, Zi.drawImage(i, -a * e, -a - t * e, 2 * a * e, 2 * a * e), Zi.restore()), i = Ns("skins/pelican/pelican_head" + (3 == this.specType ? "2" : "") + ".png")) && (Zi.save(), a = 1 * this.rad, t = .3 * -this.rad, Zi.drawImage(i, -a * e, -a + t * e, 2 * a * e, 2 * a * e), Zi.restore())
  4227. }
  4228. };
  4229.  
  4230. function Rn() {
  4231. Rn.superClass.call(this, f)
  4232. }
  4233. window.Pelican = Rn;
  4234. h.setCustomClassForGameObjType(Rn, f, _a);
  4235. Dn = Cn;
  4236. Fn.prototype = Object.create(Dn.prototype);
  4237. Fn.prototype.constructor = Fn;
  4238. Fn.superClass = Dn;
  4239. Fn.prototype.updateZ = function() {
  4240. this.z = 1003 + this.rad
  4241. };
  4242. Fn.prototype.getSkinName = function() {
  4243. var e = "";
  4244. this.flag_usingAbility && !this.flag_underWater && 1 == specType && (e = "2");
  4245. return "frog/frog" + e
  4246. };
  4247. Fn.prototype.drawUnderSkinImg = function() {
  4248. if (this.flag_usingAbility && !this.flag_underWater && 1 == this.specType) {
  4249. var e = this.rad - this.outlineW,
  4250. a = 500 / 340,
  4251. t = Ns("./skins/frog/frogLegs.png");
  4252. t && Zi.drawImage(t, -e * a, (-e - e) * a, 2 * e * a, 2 * e * a)
  4253. }
  4254. };
  4255. Fn.prototype.drawWhenUnderwater = function() {
  4256. Zi.save();
  4257. Zi.globalAlpha = .2;
  4258. Zi.scale(1, 1.5);
  4259. ci(0, 0, .5 * this.rad, "#598b30");
  4260. ci(0, -.6 * this.rad, .3 * this.rad, "#64a034");
  4261. Zi.restore()
  4262. };
  4263.  
  4264. function Fn() {
  4265. Fn.superClass.call(this, f)
  4266. }
  4267. window.Frog = Fn;
  4268. h.setCustomClassForGameObjType(Fn, f, Ca);
  4269. xn = Wn;
  4270. Dn = Cn;
  4271. xn.prototype = Object.create(Dn.prototype);
  4272. xn.prototype.constructor = xn;
  4273. xn.superClass = Dn;
  4274. xn.prototype.getSkinName = function() {
  4275. return "duck/duck_" + this.specType
  4276. };
  4277. xn.prototype.drawSkinCustomization = function() {
  4278. var e = 500 / 340;
  4279. if (this.flag_flying && !this.flag_isGrabbed) {
  4280. Zi.save();
  4281. var a = di((Yi - this.spawnTime) / 1e3, .9, .3, 2),
  4282. t = Ns("skins/duck/duck_wing1.png");
  4283. if (t) {
  4284. Zi.save();
  4285. var i = -(-.2 + a) * Zt(90),
  4286. s = .8 * this.rad;
  4287. Zi.rotate(Zt(45) + i);
  4288. var i = this.rad,
  4289. r = 1 * s,
  4290. s = 2.2 * s;
  4291. Zi.drawImage(t, 0 + -0 * r, i + -1.7 * s, r, s);
  4292. Zi.restore()
  4293. }
  4294. if (t = Ns("skins/duck/duck_wing2.png")) Zi.save(), i = -(-.2 + a) * Zt(-90), s = .8 * this.rad, Zi.rotate(Zt(-45) + i), i = this.rad, r = 1 * s, s *= 2.2, Zi.drawImage(t, 0 + -1 * r, i + -1.7 * s, r, s), Zi.restore();
  4295. if (a = Ns("skins/duck/head_duck.png")) s = this.rad - this.outlineW, Zi.drawImage(a, -s * e, -s * e, 2 * s * e, 2 * s * e);
  4296. Zi.restore()
  4297. }
  4298. };
  4299.  
  4300. function Wn() {
  4301. Dn.call(this, f)
  4302. }
  4303. window.Duck = Wn;
  4304. h.setCustomClassForGameObjType(Wn, f, va);
  4305. Dn = Cn;
  4306. Gn.prototype = Object.create(Dn.prototype);
  4307. Gn.prototype.constructor = Gn;
  4308. Gn.superClass = Dn;
  4309. Gn.prototype.getSkinName = function() {
  4310. return "duck/duckling"
  4311. };
  4312.  
  4313. function Gn() {
  4314. Gn.superClass.call(this, f)
  4315. }
  4316. window.Duckling = Gn;
  4317. h.setCustomClassForGameObjType(Gn, f, Da);
  4318. Dn = Cn;
  4319. Hn.prototype = Object.create(Dn.prototype);
  4320. Hn.prototype.constructor = Hn;
  4321. Hn.superClass = Dn;
  4322. Hn.prototype.updateZ = function() {
  4323. this.z = 1003 + this.rad
  4324. };
  4325. Hn.prototype.getSkinName = function() {
  4326. return "blackdragon"
  4327. };
  4328. Hn.prototype.readCustomData_onNewlyVisible = function(e) {
  4329. Hn.superClass.prototype.readCustomData_onNewlyVisible.call(this, e);
  4330. this.lava = e.readUInt8()
  4331. };
  4332. Hn.prototype.readCustomData_onUpdate = function(e) {
  4333. Hn.superClass.prototype.readCustomData_onUpdate.call(this, e);
  4334. this.lava = e.readUInt8()
  4335. };
  4336. Hn.prototype.drawSkinCustomization = function() {
  4337. var e = 500 / 340,
  4338. a = Ns("skins/bd-nostrils.png");
  4339. if (a) {
  4340. var t = (Yi - this.spawnTime) / 1e3,
  4341. i = di(t, 5, 1, 1);
  4342. Zi.save();
  4343. Zi.globalAlpha = Math.max(0, i);
  4344. t = this.rad - this.outlineW;
  4345. Zi.drawImage(a, -t * e, -t * e, 2 * t * e, 2 * t * e);
  4346. Zi.restore()
  4347. }
  4348. a = this.lava;
  4349. 50 > a && (i = a / 50, a = Ns("skins/bd-lowlava-wings.png")) && (Zi.save(), Zi.globalAlpha = 1 - i, t = this.rad - this.outlineW, Zi.drawImage(a, -t * e, -t * e, 2 * t * e, 2 * t * e), Zi.restore());
  4350. if (this.flag_flying && !this.flag_isGrabbed) {
  4351. Zi.save();
  4352. var t = (Yi - this.spawnTime) / 1e3,
  4353. i = di(t, 2.1, .4, 1.5),
  4354. e = di(t, 2.1, -8, 1.5),
  4355. s = di(t, 2.1, .4, 1.5),
  4356. r = di(t, 2.1, .3, 1.5),
  4357. a = Ns("img/blackdragon_wing1.png"),
  4358. t = .6 * this.rad;
  4359. if (a) {
  4360. Zi.save();
  4361. var n = -(-.3 + i) * Zt(90);
  4362. Zi.rotate(n);
  4363. var n = this.rad,
  4364. o = 1.6 * t,
  4365. l = 2 * t + 5 * e;
  4366. imAnchorY = 1.75 - (s + s / 4 - r);
  4367. Zi.drawImage(a, 0 + .65 * o, n + l * -imAnchorY, o, l);
  4368. Zi.restore()
  4369. }
  4370. if (a = Ns("img/blackdragon_wing2.png")) Zi.save(), n = -(-.3 + i) * Zt(-90), Zi.rotate(n), n = this.rad, o = 1.6 * t, l = 2 * t + 5 * e, imAnchorY = 1.75 - (s + s / 4) + r, Zi.drawImage(a, 0 + -1.65 * o, n + l * -imAnchorY, o, l), Zi.restore();
  4371. Zi.restore()
  4372. }
  4373. };
  4374.  
  4375. function Hn() {
  4376. this.lava = 0;
  4377. Hn.superClass.call(this, f)
  4378. }
  4379. window.BlackDragon = Hn;
  4380. h.setCustomClassForGameObjType(Hn, f, pa);
  4381. Dn = In;
  4382. zn.prototype = Object.create(Dn.prototype);
  4383. zn.prototype.constructor = zn;
  4384. zn.superClass = Dn;
  4385. zn.prototype.updateZ = function() {
  4386. this.z = 1005
  4387. };
  4388. zn.prototype.customDraw = function(e) {
  4389. e = .15;
  4390. var a = .5 * (.8 - e);
  4391. e = e + a + a * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  4392. Zi.save();
  4393. Zi.globalAlpha *= e;
  4394. Zi.restore();
  4395. e = .85;
  4396. a = .5 * (1 - e);
  4397. e = e + a + a * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  4398. if (a = Ns("img/fire/" + Math.trunc(Yi / 120) % 5 + ".png")) {
  4399. var t = .4 * this.rad,
  4400. i = 2 * this.rad * (2 + 2 * e) / 3,
  4401. s = 2 * this.rad * e;
  4402. Zi.save();
  4403. a && (Zi.globalAlpha = Zi.globalAlpha * this.onFireEffA * e, Zi.rotate(this.angle), Zi.drawImage(a, 0 + -.5 * i, t + -.95 * s, i, s));
  4404. Zi.restore()
  4405. }
  4406. };
  4407.  
  4408. function zn() {
  4409. zn.superClass.call(this, n);
  4410. this.webTransparency = 0;
  4411. this.drawEffectScale_Slow = this.doesDrawEffectScale = !0
  4412. }
  4413. window.Fire = zn;
  4414. h.setCustomClassForGameObjType(zn, n);
  4415. Dn = In;
  4416. jn.prototype = Object.create(Dn.prototype);
  4417. jn.prototype.constructor = jn;
  4418. jn.superClass = Dn;
  4419. jn.prototype.updateZ = function() {
  4420. this.z = 1005
  4421. };
  4422. jn.prototype.customDraw = function(e) {
  4423. e = .15;
  4424. var a = .5 * (.8 - e);
  4425. e = e + a + a * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  4426. Zi.save();
  4427. Zi.globalAlpha *= e;
  4428. Zi.restore();
  4429. e = .85;
  4430. a = .5 * (1 - e);
  4431. e = e + a + a * Math.sin(2 * Math.PI / 1 * (Yi / 1e3));
  4432. if (a = Ns("img/fireball/" + Math.trunc(Yi / 120) % 5 + ".png")) {
  4433. var t = .4 * this.rad,
  4434. i = 2 * this.rad * (2 + 2 * e) / 3,
  4435. s = 3.5 * this.rad * e;
  4436. Zi.save();
  4437. a && (Zi.globalAlpha = Zi.globalAlpha * this.onFireEffA * e, Zi.rotate(this.angle), Zi.drawImage(a, 0 + -.5 * i, t + -.95 * s, i, s));
  4438. Zi.restore()
  4439. }
  4440. };
  4441.  
  4442. function jn() {
  4443. jn.superClass.call(this, _)
  4444. }
  4445. window.FireBall = jn;
  4446. h.setCustomClassForGameObjType(jn, _);
  4447. for (var Ln = [], Xn = ["USA-East", "USA-West", "Brazil/ USA-South", "Europe", "Asia/Australia"], Yn = {}, Vn = 0; Vn < Xn.length; Vn++) Yn[Xn[Vn]] = [];
  4448.  
  4449. function Kn(e, a, t) {
  4450. e = {
  4451. name: e,
  4452. ip: a,
  4453. serverConnURL: a,
  4454. region: t,
  4455. playersCount: -1,
  4456. ping: 1e4,
  4457. domOptionIndex: 0
  4458. };
  4459. Ln.push(e);
  4460. Yn[t].push(e);
  4461. return e
  4462. }
  4463. if (t) {
  4464. var Jn = "USA-East";
  4465. Kn("LOCAL TEST", "127.0.0.1", Jn)
  4466. } else Jn = "USA-East", Kn("USA 1", "104.207.132.63", Jn), Kn("USA 2", "107.191.40.35", Jn), Kn("USA 3", "107.191.43.180", Jn), Kn("USA 4", "45.63.17.44", Jn), Kn("USA 5", "107.191.40.38", Jn), Kn("USA 6", "104.238.138.249", Jn), Kn("USA 7", "45.76.20.213", Jn), Kn("USA 8", "45.76.28.156", Jn), Kn("USA 9", "104.238.135.150", Jn), Kn("USA 10", "207.246.83.246", Jn), Kn("USA 11", "104.238.131.13", Jn), Kn("USA 12", "108.61.87.46", Jn), Jn = "USA-West", Kn("USA W 1", "45.63.87.103", Jn), Kn("USA W 2", "45.32.137.149", Jn), Kn("USA W 3", "45.76.67.64", Jn), Kn("USA W 4", "45.63.51.60", Jn), Kn("USA W 5", "45.32.228.141", Jn), Kn("USA W 6", "104.207.158.226", Jn), Jn = "Brazil/ USA-South", Kn("USA S 1", "108.61.224.165", Jn), Kn("USA S 2", "107.191.55.233", Jn), Kn("USA S 3", "45.32.198.173", Jn), Kn("USA S 4", "104.238.147.152", Jn), Kn("USA S 5", "108.61.205.88", Jn), Jn = "Europe", Kn("Europe 1", "45.77.88.81", Jn), Kn("Europe 2", "104.238.170.8", Jn), Kn("Europe 3", "45.76.129.33", Jn), Kn("Europe 4", "45.76.134.74", Jn), Kn("Europe 5", "45.76.135.33", Jn), Kn("Europe 6", "45.76.129.125", Jn), Kn("Europe 7", "45.32.144.28", Jn), Kn("Europe 8", "185.92.221.137", Jn), Kn("Europe 9", "45.32.152.68", Jn), Kn("Europe 10", "45.32.156.214", Jn), Kn("Europe 11", "45.32.154.83", Jn), Kn("Europe 12", "45.63.117.122", Jn), Kn("Europe 13", "104.238.159.143", Jn), Kn("Europe 14", "45.32.157.75", Jn), Kn("Europe 15", "45.77.67.70", Jn), Kn("Europe 16", "45.76.81.117", Jn), Kn("Europe 17", "45.63.117.130", Jn), Kn("Europe 18", "45.63.116.195", Jn), Kn("Europe 19", "45.77.52.178", Jn), Kn("Europe 20", "45.76.91.16", Jn), Kn("Europe 21", "108.61.211.119", Jn), Kn("Europe 22", "45.76.89.189", Jn), Kn("Europe 23", "45.76.87.177", Jn), Jn = "Asia/Australia", Kn("Asia 1", "45.63.28.66", Jn), Kn("Asia 2", "45.76.112.176", Jn), Kn("Asia 3", "45.32.101.8", Jn);
  4467. var qn = 2,
  4468. Zn = function(e) {
  4469. this.serverObj = e;
  4470. e = "https:" === window.location.protocol ? "wss://" : "ws://";
  4471. this.testWs = new WebSocket(e + this.serverObj.serverConnURL + ":" + ("wss://" == e ? 7021 : 7020));
  4472. this.startT = +new Date;
  4473. this.testWs.binaryType = "arraybuffer";
  4474. var a = this;
  4475. this.pingsDelayMsTot = this.pingsRec = 0;
  4476. this.testWs.onopen = function() {
  4477. a.sendPing()
  4478. };
  4479. this.sendPing = function() {
  4480. var e = new fo(1);
  4481. e.writeUInt8(255);
  4482. a.testWs.send(e.dataView.buffer);
  4483. this.startT = +new Date
  4484. };
  4485. this.testWs.onmessage = function(e) {
  4486. e = new mo(new DataView(e.data));
  4487. 255 == e.readUInt8() && (e = +new Date - a.startT, a.pingsRec += 1, a.pingsDelayMsTot += e, 3 <= a.pingsRec ? (a.serverObj.ping = a.pingsDelayMsTot / a.pingsRec, a.testWs.close(), oo(a)) : a.sendPing())
  4488. }
  4489. },
  4490. Qn = t ? Xn[0] : Xn[Xt(0, Math.max(0, Xn.length - 1 - 1))],
  4491. $n = 0,
  4492. eo = Yn[Qn][$n],
  4493. Qn = eo.region,
  4494. ao = eo,
  4495. to = [],
  4496. io = !1,
  4497. so = !1,
  4498. ro;
  4499.  
  4500. function no() {
  4501. if (so) lo();
  4502. else if (!io) {
  4503. io = !0;
  4504. for (var e in Yn) Yn.hasOwnProperty(e) && 0 < Yn[e].length && "SANDBOX" != e && to.push(new Zn(Yn[e][0]));
  4505. ro = setTimeout(function() {
  4506. for (var e = 0; e < to.length; e++) to[e].testWs.close();
  4507. lo()
  4508. }, 3e3)
  4509. }
  4510. }
  4511.  
  4512. function oo(e) {
  4513. e.serverObj.ping < ao.ping && (ao = e.serverObj);
  4514. e = to.indexOf(e); - 1 != e && to.splice(e, 1);
  4515. 0 == to.length && (ro && clearTimeout(ro), lo())
  4516. }
  4517.  
  4518. function lo() {
  4519. io && (so = !0);
  4520. io = !1;
  4521. console.log("@@@@ Fastest region is " + ao.region + " with ping " + ao.ping + "ms ");
  4522. Qn = ao.region;
  4523. po()
  4524. }
  4525. var ho = 400,
  4526. co = 500;
  4527.  
  4528. function po() {
  4529. var e = Yn[Qn].slice();
  4530. e.sort(function(e, a) {
  4531. return e.playersCount < a.playersCount ? 1 : e.playersCount > a.playersCount ? -1 : 0
  4532. });
  4533. for (var a = !1, t = !0, i = 0; i < e.length; i++)
  4534. if (e[i].playersCount < co && 0 <= e[i].playersCount && (t = !1), e[i].playersCount < ho && 0 <= e[i].playersCount) {
  4535. eo = e[i];
  4536. $n = Yn[Qn].indexOf(eo);
  4537. a = !0;
  4538. break
  4539. }
  4540. if (!a)
  4541. if (t && Io)
  4542. for (console.log("All servers in region " + Qn + " are full/offline! Picking random server..."), t = !0, i = 0; i < Ln.length; i++) {
  4543. if (Ln[i].playersCount < co) {
  4544. eo = Ln[i];
  4545. $n = Yn[eo.region].indexOf(eo);
  4546. Qn = eo.region;
  4547. break
  4548. }
  4549. } else eo = e[Xt(0, e.length - 1)], $n = e.indexOf(eo);
  4550. console.log("Connecting to best server...");
  4551. wo(eo)
  4552. }
  4553.  
  4554. function go(e) {
  4555. var a = ts("audio/click.mp3");
  4556. if (a) try {
  4557. a.play()
  4558. } catch (e) {}
  4559. newMsg = new fo(2);
  4560. newMsg.writeUInt8(24);
  4561. newMsg.writeUInt8(tl.indexOf(e));
  4562. Oo(newMsg);
  4563. il && (Os = !1, dl(!1));
  4564. il = el = !1
  4565. }
  4566.  
  4567. function mo(e) {
  4568. this.data = e;
  4569. this.offset = 0;
  4570. this.readUInt8 = function() {
  4571. var e = this.data.getUint8(this.offset);
  4572. this.offset += 1;
  4573. return e
  4574. };
  4575. this.readUInt16 = function() {
  4576. try {
  4577. var e = this.data.getUint16(this.offset, !1);
  4578. this.offset += 2;
  4579. return e
  4580. } catch (e) {
  4581. return 0
  4582. }
  4583. };
  4584. this.readUInt32 = function() {
  4585. var e = this.data.getUint32(this.offset, !1);
  4586. this.offset += 4;
  4587. return e
  4588. };
  4589. this.readString = function() {
  4590. for (var e = this.readUInt16(), a = "", t, i = 0; i < e; i++) t = this.readUInt8(), i != e - 1 && (a += String.fromCharCode(t));
  4591. return si(a)
  4592. };
  4593. this.readMsgReaderBitsGroup = function() {};
  4594. this.readBitGroup = function() {
  4595. return new uo(this)
  4596. }
  4597. }
  4598.  
  4599. function fo(e) {
  4600. this.len = 0;
  4601. this.dataView = new DataView(new ArrayBuffer(e));
  4602. this.writeUInt8 = function(e) {
  4603. this.dataView.setUint8(this.len, e);
  4604. this.len += 1
  4605. };
  4606. this.writeUInt16 = function(e) {
  4607. this.dataView.setUint16(this.len, e, !1);
  4608. this.len += 2
  4609. };
  4610. this.writeInt16 = function(e) {
  4611. this.dataView.setInt16(this.len, e, !1);
  4612. this.len += 2
  4613. };
  4614. this.writeUInt32 = function(e) {
  4615. this.dataView.setUint32(this.len, e, !1);
  4616. this.len += 4
  4617. };
  4618. this.writeString = function(e) {
  4619. e = ii(e);
  4620. len = e.length;
  4621. this.writeUInt16(e.length);
  4622. for (var a = 0; a < len; a++) this.writeUInt8(e.charCodeAt(a))
  4623. }
  4624. }
  4625.  
  4626. function uo(e) {
  4627. this.bytesArray = new Uint8Array(20);
  4628. this.bytesLen = 0;
  4629. this.rBitIndex = 1;
  4630. this.rByteIndex = 0;
  4631. this.getBool = function() {
  4632. var e = 0 < $t(this.bytesArray[this.rByteIndex], this.rBitIndex);
  4633. this.rBitIndex += 1;
  4634. 7 < this.rBitIndex && (this.rBitIndex = 1, this.rByteIndex += 1);
  4635. return e
  4636. };
  4637. this.getInt0to3 = function() {
  4638. return this.getIntWithXBits(2)
  4639. };
  4640. this.getIntWithXBits = function(e) {
  4641. for (var a = 0, t = 0; t < e; t++) var i = this.getBool(),
  4642. a = ei(a, t, i);
  4643. return a
  4644. };
  4645. this.byteToStr = function(e) {
  4646. for (var a = "", t = 0; 8 > t; t++) a += 0 < $t(e, t) ? "1" : "0";
  4647. return a
  4648. };
  4649. var a = !0;
  4650. do {
  4651. a = e.readUInt8(), this.bytesArray[this.bytesLen++] = a, a = 0 < $t(a, 0)
  4652. } while (a)
  4653. }
  4654. var bo, yo = 0;
  4655.  
  4656. function wo(a) {
  4657. Eo();
  4658. So();
  4659. _o();
  4660. eo = a;
  4661. Qn = a.region;
  4662. $n = Yn[a.region].indexOf(a);
  4663. Ro() && (theWs = Kr, Kr = null, theWs.close());
  4664. 1 < yo && ($n += 1, $n > Yn[Qn].length - 1 && ($n = 0), eo = Ln[$n], Qn = eo.region, _o());
  4665. yr = !1;
  4666. document.getElementById("connecting").style.visibility = "visible";
  4667. var e = "https:" === window.location.protocol ? "wss://" : "ws://",
  4668. e = e + eo.serverConnURL + ":" + ("wss://" == e ? 7021 : 7020);
  4669. console.log("Connecting to " + eo.name + " (" + e + ")...");
  4670. Kr = new WebSocket(e);
  4671. Kr.binaryType = "arraybuffer";
  4672. Kr.onopen = function() {
  4673. yo = 0;
  4674. document.getElementById("startMenu").style.visibility = "visible";
  4675. document.getElementById("connecting").style.visibility = "hidden"
  4676. };
  4677. Kr.onmessage = function(e) {
  4678. Bo(new DataView(e.data))
  4679. };
  4680. Kr.onclose = function(e) {
  4681. this == Kr && (yo += 1, mr = gr = fr = !1, yr || (bo = setTimeout(function() {
  4682. wo(a)
  4683. }, 2e3), document.getElementById("connecting").style.visibility = "visible"))
  4684. };
  4685. Kr.onerror = function() {
  4686. console.log("socket error!")
  4687. }
  4688. }
  4689. ts("audio/click.mp3");
  4690. wl();
  4691. El();
  4692. var ko = null;
  4693. if (Ai)
  4694. for (var Ai = Ai.replace(/\W/g, "").toUpperCase(), Po = !1, Vn = 0; Vn < Ln.length; Vn++) {
  4695. var Ao = Ln[Vn],
  4696. To = Ao.name.toUpperCase(),
  4697. To = To.replace(/\W/g, "");
  4698. if (To == Ai) {
  4699. ko = Ao;
  4700. break
  4701. }
  4702. }
  4703. ko ? (console.log("Connecting to URL server..."), wo(ko)) : no();
  4704. var Io = !1;
  4705.  
  4706. function vo() {
  4707. var e = "https:" === window.location.protocol ? "wss://" : "ws://",
  4708. a = new WebSocket(e + "master1.mope.io:" + ("wss://" == e ? 7501 : 7500));
  4709. a.binaryType = "arraybuffer";
  4710. a.onopen = function() {
  4711. var e = new fo(1);
  4712. e.writeUInt8(200);
  4713. a.send(e.dataView.buffer)
  4714. };
  4715. a.onmessage = function(e) {
  4716. e = new mo(new DataView(e.data));
  4717. if (100 == e.readUInt8()) {
  4718. Io = !0;
  4719. var a = e.readUInt32();
  4720. vr.setText(oi(a) + " players");
  4721. for (var a = e.readUInt16(), t = 0; t < a; t++)
  4722. for (var i = Kt(e.readUInt32()), s = e.readUInt16(), r = 0; r < Ln.length; r++)
  4723. if (Ln[r].ip == i) {
  4724. Ln[r].playersCount = 6e4 == s ? -1 : s;
  4725. break
  4726. }
  4727. }
  4728. Eo();
  4729. So()
  4730. };
  4731. a.onerror = function(e) {};
  4732. a.onclose = function(e) {}
  4733. }
  4734. vo();
  4735. var Do = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform),
  4736. Mo = -1 < navigator.userAgent.toLowerCase().indexOf("android");
  4737. if ((Do || Mo) && !ki) {
  4738. var xo = !1;
  4739. if (window.localStorage) {
  4740. xo = 0 < window.localStorage.getItem("oldVisitor");
  4741. try {
  4742. window.localStorage.setItem("oldVisitor", 1)
  4743. } catch (e) {
  4744. xo = !0
  4745. }
  4746. }
  4747. xo || (Do ? window.location.href = "https://itunes.apple.com/us/app/mope.io/id1086471119?ls=1&mt=8" : Mo && (window.location.href = "https://play.google.com/store/apps/details?id=tatarnykov.stan.mopeioandroid"))
  4748. }
  4749. document.getElementById("serverSelect").onchange = Co;
  4750.  
  4751. function Co() {
  4752. $n = document.getElementById("serverSelect").selectedIndex - 1;
  4753. eo = Yn[Qn][$n];
  4754. _o();
  4755. console.log("Server changed...");
  4756. Ro() && Kr.close();
  4757. document.getElementById("spawnXpLabel").style.opacity = 0;
  4758. partyLinkKey = partyLinkIP = null;
  4759. wo(eo)
  4760. }
  4761. document.getElementById("regionSelect").onchange = No;
  4762.  
  4763. function No() {
  4764. console.log("Region changed...");
  4765. var e = document.getElementById("regionSelect").selectedIndex - 1;
  4766. Qn = Xn[e];
  4767. Ro() && Kr.close();
  4768. document.getElementById("spawnXpLabel").style.opacity = 0;
  4769. po()
  4770. }
  4771.  
  4772. function _o() {
  4773. document.getElementById("serverSelect").selectedIndex = $n + 1
  4774. }
  4775.  
  4776. function So() {
  4777. for (var e = document.getElementById("serverSelect"); e.lastChild;) e.removeChild(e.lastChild);
  4778. var a = document.createElement("option");
  4779. a.text = "Choose a server:";
  4780. a.disabled = !0;
  4781. e.add(a);
  4782. for (var t = -1, i = Yn[Qn], s = 0; s < i.length; s++) a = document.createElement("option"), a.text = i[s].name + " [" + (0 > i[s].playersCount ? "..." : i[s].playersCount) + " players " + (i[s].playersCount >= co ? "-FULL!" : "") + "]", i[s].ip == eo.ip && (t = s), e.add(a); - 1 == t && (t = 0);
  4783. e.selectedIndex = t + 1
  4784. }
  4785.  
  4786. function Eo() {
  4787. for (var e = document.getElementById("regionSelect"); e.lastChild;) e.removeChild(e.lastChild);
  4788. var a = document.createElement("option");
  4789. a.text = "Choose a region:";
  4790. a.disabled = !0;
  4791. e.add(a);
  4792. for (var t = -1, i = 0; i < Xn.length; i++) {
  4793. for (var s = Xn[i], a = Yn[s], r = 0; r < a.length; r++);
  4794. a = document.createElement("option");
  4795. a.text = s;
  4796. s == Qn && (t = i);
  4797. e.add(a)
  4798. } - 1 == t && (t = 0);
  4799. e.selectedIndex = t + 1
  4800. }
  4801.  
  4802. function Uo() {
  4803. if (!ki) {
  4804. var e = eo.name.replace(/\W/g, "").toUpperCase(),
  4805. a = window.location.href.split("?")[0];
  4806. window.history.replaceState({
  4807. foo: "foo"
  4808. }, "mope.io (" + e + ")", a + "?server=" + e)
  4809. }
  4810. document.getElementById("startMenuWrapper").style.display = "block";
  4811. dl(!0)
  4812. }
  4813.  
  4814. function Bo(e) {
  4815. e = new mo(e);
  4816. switch (e.readUInt8()) {
  4817. case 1:
  4818. nPlayers = e.readUInt16();
  4819. vr.setText(oi(nPlayers) + " players");
  4820. serverVer = e.readUInt16();
  4821. serverVer > l ? setTimeout(function() {
  4822. ki || (window.onbeforeunload = null);
  4823. console.log("Old client (ver " + l + "/" + serverVer + ")");
  4824. alert("mope.io has been updated! You need to refresh to get the latest version of the game! (If this keeps appearing, hold SHIFT when pressing refresh!)");
  4825. window.location.reload(!0)
  4826. }, 1500) : (serverVer < l && console.log("Old server version detected!"), Uo());
  4827. break;
  4828. case 2:
  4829. var a = e.readUInt8();
  4830. if (1 == a) {
  4831. spectating = 2 == e.readUInt8();
  4832. gr = !spectating;
  4833. mr = spectating;
  4834. fr = !0;
  4835. ur || (document.getElementById("onconnectDiv").style.visibility = "visible");
  4836. ur = !0;
  4837. Ds = e.readUInt16();
  4838. Ms = e.readUInt16();
  4839. xs = e.readUInt8();
  4840. hs = gs = ds = e.readUInt16() / 4;
  4841. cs = ms = ps = e.readUInt16() / 4;
  4842. camzoom_n = e.readUInt16() / 1e3;
  4843. ls = 1.2 * camzoom_n;
  4844. spectating || zo(e);
  4845. spectating || (document.getElementById("startMenuWrapper").style.display = "none", ns(rs), ki || (window.onbeforeunload = function(e) {
  4846. return "You're alive in a game, close mope.io?"
  4847. }));
  4848. if (!spectating && (an += 1, Zr += 1, window.localStorage)) try {
  4849. window.localStorage.setItem("gamesSinceAd", Zr)
  4850. } catch (e) {}
  4851. El()
  4852. } else if (0 == a) {
  4853. e = document.getElementById("spawnXpLabel");
  4854. e.style.display = "block";
  4855. e.style.opacity = 1;
  4856. e.textContent = "Error: this server is full!";
  4857. var t = eo;
  4858. setTimeout(function() {
  4859. gr || eo != t || (yo = 100, wo(eo))
  4860. }, 1e3)
  4861. }
  4862. break;
  4863. case 24:
  4864. var i = e.readUInt8();
  4865. 5 == i && (el = !1);
  4866. if (0 == i || 1 == i) {
  4867. var a = 1 == i,
  4868. i = e.readUInt8(),
  4869. s = e.readUInt8();
  4870. el = !0;
  4871. al = 0;
  4872. tl = [];
  4873. il = a;
  4874. sl = +new Date;
  4875. rl = sl + 1e3 * i;
  4876. for (i = 0; i < s; i++) {
  4877. var r = e.readUInt8(),
  4878. n = e.readUInt8(),
  4879. r = new gi(0, 0, 100, 100, r, n);
  4880. tl.push(r)
  4881. }
  4882. }
  4883. Vo = +new Date;
  4884. a && (document.getElementById("startMenuWrapper").style.display = "none");
  4885. break;
  4886. case 8:
  4887. a = e.readUInt16();
  4888. s = e.readUInt8();
  4889. lbData = [];
  4890. for (i = 0; i < s; ++i) lbData.push({
  4891. rank: e.readUInt16(),
  4892. name: e.readString(),
  4893. score: e.readUInt32()
  4894. });
  4895. jo(lbData, 0, a);
  4896. break;
  4897. case 10:
  4898. nPlayers = e.readUInt16();
  4899. vr.setText(oi(nPlayers) + " players");
  4900. break;
  4901. case 18:
  4902. a = e.readUInt8();
  4903. i = 0 < e.readUInt8();
  4904. dr = e.readUInt32();
  4905. _s = e.readUInt32();
  4906. s = Ra(a);
  4907. Xo = i ? "You downgraded to " + s.aniName + "! \nDont lose too much xp!" : s.upgradeText;
  4908. Yo = "white";
  4909. Vo = +new Date + 9e3;
  4910. Os || (Os = !0, Ss = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0), Es = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0), Us = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0), Bs = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0));
  4911. Ss = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0);
  4912. i = e.readUInt8();
  4913. for (s = 0; s < i; s++) Ss[e.readUInt8() - 1] = 1;
  4914. Es = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0);
  4915. i = e.readUInt8();
  4916. for (s = 0; s < i; s++) r = e.readUInt8(), Es[r - 1] = 1;
  4917. Us = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0);
  4918. i = e.readUInt8();
  4919. for (s = 0; s < i; s++) Us[e.readUInt8() - 1] = 1;
  4920. Bs = Array.apply(null, Array(50)).map(Number.prototype.valueOf, 0);
  4921. i = e.readUInt8();
  4922. for (s = 0; s < i; s++) Bs[e.readUInt8() - 1] = 1;
  4923. $o = a == c || a == Be;
  4924. Jo = +new Date + 9e3;
  4925. qo = 0;
  4926. break;
  4927. case 14:
  4928. var a = e.readUInt8(),
  4929. o = e.readUInt32();
  4930. Xo = 1 == a ? "Oh no, You were eaten! \n Watch out for red-circled players!" : 2 == a ? "Oh no, You died from a tail-bite!\n Watch your tail!" : 4 == a ? "You died of thirst :( Don't let your water run out!" : 13 == a ? "You died from burning! (Get to water when on fire!)" : "You died! Watch your health!";
  4931. Yo = "#F1C34C";
  4932. Vo = +new Date + 3500;
  4933. gr = !1;
  4934. mr = !0;
  4935. el = !1;
  4936. resetAfk();
  4937. try {
  4938. ki || setTimeout(factorem.refreshAds.bind(factorem, null, !0), 800)
  4939. } catch (e) {}
  4940. window.setTimeout(function() {
  4941. if (!gr) {
  4942. yi && An();
  4943. wi && Tn();
  4944. document.getElementById("startMenuWrapper").style.display = "block";
  4945. xr = 0 < o ? "You'll spawn with +" + li(o) + " XP!" : "";
  4946. Mr = 0;
  4947. var e = document.getElementById("spawnXpLabel");
  4948. e.style.opacity = 0;
  4949. xr && setTimeout(function() {
  4950. gr || (e.style.display = "block", e.style.opacity = 1)
  4951. }, 1e3);
  4952. document.getElementById("spawnXpLabel").textContent = xr;
  4953. ki || (window.onbeforeunload = null)
  4954. }
  4955. }, 2e3);
  4956. break;
  4957. case 4:
  4958. Fo(e);
  4959. break;
  4960. case 19:
  4961. a = e.readUInt32();
  4962. if (a = Fs[a]) e = e.readString(), a.gotChat(e);
  4963. break;
  4964. case 23:
  4965. a = e.readUInt8();
  4966. if (gr) switch (Vo = Yi + 3500, Yo = "white", a) {
  4967. case 255:
  4968. Xo = e.readString();
  4969. break;
  4970. case 2:
  4971. Xo = "Ouch! Your tail got bitten!";
  4972. break;
  4973. case 12:
  4974. Xo = "You've been stung by a jellyfish!";
  4975. break;
  4976. case 3:
  4977. Xo = "ZAP! You've been shocked by a STINGRAY!";
  4978. break;
  4979. case 8:
  4980. Xo = "You've been inked!";
  4981. break;
  4982. case 5:
  4983. Xo = "Oh no! Escape the kraken's pull!";
  4984. break;
  4985. case 6:
  4986. Xo = "Ouch! Pufferfish are pointy!";
  4987. break;
  4988. case 7:
  4989. Xo = "That's an octopus in disguise!";
  4990. break;
  4991. case 9:
  4992. Xo = "Brrr! You've been frozen!";
  4993. break;
  4994. case 10:
  4995. Xo = "Ahh! The wolf's howl scared you!";
  4996. break;
  4997. case 11:
  4998. Xo = "Ouch! A VERY LOUD sound hit you!";
  4999. break;
  5000. case 13:
  5001. Xo = "Ah! You're on fire!";
  5002. break;
  5003. case 14:
  5004. Xo = "BAM! You got kicked by a donkey!";
  5005. break;
  5006. case 16:
  5007. Xo = "Ouch! You're getting dragged by a croc!";
  5008. break;
  5009. case 17:
  5010. Xo = "A fox DUG you out of the hole!";
  5011. break;
  5012. case 18:
  5013. Xo = "A wave has swept you away!"
  5014. }
  5015. break;
  5016. case 25:
  5017. a = 0 < e.readUInt8(), e = e.readUInt8() / 10, a ? (Ls = 1e3 * e, Xs = +new Date + 1e3 * e, js = !0) : (Hs = 1e3 * e, zs = +new Date + 1e3 * e, Gs = !0)
  5018. }
  5019. }
  5020.  
  5021. function Oo(e) {
  5022. Kr.send(e.dataView.buffer)
  5023. }
  5024.  
  5025. function Ro() {
  5026. return null != Kr && Kr.readyState == Kr.OPEN
  5027. }
  5028.  
  5029. function Fo(e) {
  5030. Vi = Yi = +new Date;
  5031. Wo(e);
  5032. for (var a = e.readUInt16(), t = 0; t < a; t++) {
  5033. var i = h.newlyVis_createGameObjFromMsg(e),
  5034. s = i.id,
  5035. r = Fs[s];
  5036. delete Fs[s];
  5037. r = Rs.indexOf(r); - 1 != r && Rs.splice(r, 1);
  5038. Fs[s] = i;
  5039. Rs.push(i)
  5040. }
  5041. a = e.readUInt16();
  5042. for (t = 0; t < a; t++) s = e.readUInt32(), (i = Fs[s]) ? i.worldUpd_readMsgUpdate(e) : console.log("Error: Updated GameObj id " + s + " doesn't exist!");
  5043. a = e.readUInt16();
  5044. for (t = 0; t < a; t++) i = e.readUInt32(), (i = Fs[i]) ? i.worldUpd_readMsgRemovedObj(e) : console.log("Error: Removed GameObj id " + s + " doesn't exist!")
  5045. }
  5046.  
  5047. function Wo(e) {
  5048. gs = hs;
  5049. ms = cs;
  5050. ds = e.readUInt16() / 4;
  5051. ps = e.readUInt16() / 4;
  5052. camzoom_n = e.readUInt16() / 1e3;
  5053. var a = e.readUInt8(),
  5054. t = $t(a, 0),
  5055. i = $t(a, 1),
  5056. s = $t(a, 2);
  5057. Ys = $t(a, 3);
  5058. wr = $t(a, 7);
  5059. if (!t) {
  5060. var t = Gs = abil_active = !1,
  5061. r = Ga;
  5062. i && (t = $t(a, 4), Gs = $t(a, 5), abil_active = $t(a, 6), r = e.readUInt8());
  5063. a = js = abil_dive_active = !1;
  5064. if (s) {
  5065. var n = e.readUInt8(),
  5066. a = $t(n, 0);
  5067. js = $t(n, 1);
  5068. abil_dive_active = $t(n, 2)
  5069. }
  5070. Ys ? (_r.abil_usable = t, _r.abil_recharging = Gs, _r.abil_possible = i, _r.abil_active = abil_active, _r.abil_Type = r, Nr.abil_usable = a, Nr.abil_recharging = js, Nr.abil_possible = s, Nr.abil_active = abil_dive_active, Nr.abil_Type = Fa, js && (Nr.abil_rechargeTotalT = Ls, Nr.abil_rechargeEndT = Xs), Gs && (_r.abil_rechargeTotalT = Hs, _r.abil_rechargeEndT = zs)) : (Nr.abil_usable = t, Nr.abil_recharging = Gs, Nr.abil_possible = i, Nr.abil_active = abil_active, Nr.abil_Type = r, _r.abil_usable = a, _r.abil_recharging = js, _r.abil_possible = s, _r.abil_active = abil_dive_active, _r.abil_Type = Fa, Gs && (Nr.abil_rechargeTotalT = Hs, Nr.abil_rechargeEndT = zs), js && (_r.abil_rechargeTotalT = Ls, _r.abil_rechargeEndT = Xs));
  5071. waterBarPerc_n = e.readUInt8();
  5072. xp = e.readUInt32();
  5073. Pr = e.readUInt8()
  5074. }
  5075. }
  5076. drawCrossAt = function(e, a) {
  5077. crossHx = e;
  5078. crossHy = a;
  5079. crossL = 30;
  5080. Zi.beginPath();
  5081. Zi.moveTo(crossHx, crossHy - crossL / 2);
  5082. Zi.lineTo(crossHx, crossHy + crossL / 2);
  5083. Zi.stroke();
  5084. Zi.moveTo(crossHx - crossL / 2, crossHy);
  5085. Zi.lineTo(crossHx + crossL / 2, crossHy);
  5086. Zi.stroke()
  5087. };
  5088. fillGrid = function(e, a, t, i, s, r) {
  5089. if (!qs) {
  5090. Zi.save();
  5091. var n = t - e,
  5092. o = i - a,
  5093. l = Is / 2 / ls,
  5094. h = vs / 2 / ls;
  5095. e = Math.max(e, hs - l - s + 0);
  5096. a = Math.max(a, cs - h - r + 0);
  5097. t = Math.min(t, hs + l - s - 0);
  5098. i = Math.min(i, cs + h - r - 0);
  5099. Zi.strokeStyle = "black";
  5100. Zi.globalAlpha = .055;
  5101. t -= e;
  5102. fillH = i - a;
  5103. for (i = -.5 + e + (n - e) % 30; i < e + t; i += 30) Zi.beginPath(), Zi.moveTo(i, a), Zi.lineTo(i, a + fillH), Zi.stroke();
  5104. for (dy = -.5 + a + (o - a) % 30; dy < a + fillH; dy += 30) Zi.beginPath(), Zi.moveTo(e, dy), Zi.lineTo(e + t, dy), Zi.stroke();
  5105. Zi.restore()
  5106. }
  5107. };
  5108. var Go = 250,
  5109. Ho = 250;
  5110.  
  5111. function zo(e) {
  5112. Go = Ds / Ms * Ho;
  5113. qi = document.createElement("canvas");
  5114. qi.width = Go;
  5115. qi.height = Ho;
  5116. var a = qi.getContext("2d");
  5117. a.globalAlpha = .35;
  5118. a.fillStyle = "#000000";
  5119. a.fillRect(0, 0, qi.width, qi.height);
  5120. for (var t = Go / 200, i = Ho / 200, s = e.readUInt16(), r = e.readUInt16(), n = e.readUInt16(), o = 0; 2 > o; o++) {
  5121. a.fillStyle = Ei;
  5122. a.globalAlpha = .5;
  5123. var l = Go / Ds;
  5124. 0 == o ? a.fillRect(0 * l, n * l, s * l, Ms * l) : a.fillRect((Ds - s) * l, n * l, s * l, Ms * l)
  5125. }
  5126. a.fillStyle = "white";
  5127. a.globalAlpha = .5;
  5128. l = Go / Ds;
  5129. a.fillRect((Ds / 2 - r / 2) * l, 0 * l, r * l, n * l);
  5130. s = e.readUInt16();
  5131. a.fillStyle = Ei;
  5132. a.globalAlpha = .5;
  5133. for (o = 0; o < s; o++) {
  5134. var r = e.readUInt16() * (Go / Ds),
  5135. n = e.readUInt16() * (Ho / Ms),
  5136. l = e.readUInt16() * (Go / Ds),
  5137. h = e.readUInt16() * (Ho / Ms);
  5138. a.globalAlpha = .5;
  5139. a.fillRect(l - r / 2, h - n / 2, r, n)
  5140. }
  5141. s = e.readUInt16();
  5142. a.fillStyle = _i;
  5143. for (o = 0; o < s; o++) r = 5 * e.readUInt8(), n = e.readUInt16() * (Go / Ds), l = e.readUInt16() * (Ho / Ms), a.beginPath(), a.arc(n, l, Math.max(1, Go / Ds * r), 0, 2 * Math.PI), a.fill();
  5144. s = e.readUInt16();
  5145. a.fillStyle = Ni;
  5146. a.globalAlpha = .5;
  5147. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, l = 5 * e.readUInt8(), a.beginPath(), a.arc(r, n, Math.max(1, Go / Ds * l), 0, 2 * Math.PI), a.fill();
  5148. s = e.readUInt16();
  5149. a.fillStyle = "#907A33";
  5150. a.globalAlpha = .7;
  5151. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, l = 5 * e.readUInt8(), a.beginPath(), a.arc(r, n, Math.max(1, Go / Ds * l), 0, 2 * Math.PI), a.fill();
  5152. s = e.readUInt16();
  5153. a.fillStyle = "#7BB7BB";
  5154. a.globalAlpha = .85;
  5155. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, l = 5 * e.readUInt8(), a.beginPath(), a.arc(r, n, Math.max(1, Go / Ds * l), 0, 2 * Math.PI), a.fill();
  5156. s = e.readUInt16();
  5157. a.fillStyle = Di;
  5158. a.globalAlpha = 1;
  5159. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, l = 5 * e.readUInt8(), a.beginPath(), a.arc(r, n, Math.max(1, Go / Ds * l), 0, 2 * Math.PI), a.fill();
  5160. s = e.readUInt16();
  5161. a.fillStyle = "#A89937";
  5162. a.globalAlpha = .6;
  5163. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, l = 5 * e.readUInt8(), a.beginPath(), a.arc(r, n, Math.max(1, Go / Ds * l), 0, 2 * Math.PI), a.fill();
  5164. s = e.readUInt16();
  5165. a.fillStyle = Bi;
  5166. a.globalAlpha = 1;
  5167. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, a.beginPath(), a.arc(r, n, Math.max(2.5, Go / Ds * 40), 0, 2 * Math.PI), a.fill();
  5168. s = e.readUInt16();
  5169. a.fillStyle = Ni;
  5170. a.globalAlpha = 1;
  5171. for (o = 0; o < s; o++) r = e.readUInt8() * t, n = e.readUInt8() * i, a.beginPath(), a.arc(r, n, Math.max(2.5, Go / Ds * 50), 0, 2 * Math.PI), a.fill()
  5172. }
  5173.  
  5174. function jo(e, a, t) {
  5175. Ji = null;
  5176. if (0 != e.length) {
  5177. Ji = document.createElement("canvas");
  5178. a = Ji.getContext("2d");
  5179. var i;
  5180. i = 55 + 22 * e.length;
  5181. Ji.width = 220;
  5182. Ji.height = i;
  5183. a.globalAlpha = .35;
  5184. a.fillStyle = "#000000";
  5185. a.fillRect(0, 0, 200, i);
  5186. a.globalAlpha = 1;
  5187. a.fillStyle = "#FFFFFF";
  5188. i = eo.name;
  5189. a.font = "27px Arial";
  5190. qs || (a.shadowOffsetX = 1, a.shadowOffsetY = 1);
  5191. a.shadowColor = "black";
  5192. a.fillText(i, 95 - a.measureText(i).width / 2, 40);
  5193. var s;
  5194. a.textAlign = "left";
  5195. a.font = "17px Arial";
  5196. for (s = 0; s < e.length; ++s) i = Js ? "" : e[s].name || "mope.io", t == e[s].rank ? (a.fillStyle = "#FEED92", Js && (i = "you")) : a.fillStyle = "#FFFFFF", i = e[s].rank + ". " + i + " (" + li(e[s].score) + ")", a.fillText(i, 15, 65 + 22 * s)
  5197. }
  5198. }
  5199.  
  5200. function Lo() {
  5201. Zi.save();
  5202. if (gr) {
  5203. kr += .1 * (waterBarPerc_n - kr);
  5204. xpPer += .03 * (Pr - xpPer);
  5205. var e = Fs[dr];
  5206. e && (pr = e.animalType);
  5207. var a = 1,
  5208. t = 25 >= kr;
  5209. t && (a = .7 + .3 * Math.sin(2 * Math.PI / 1.2 * (Yi / 1e3)));
  5210. var i = Math.min(450, .9 * Is) * fs,
  5211. s = 30 * fs,
  5212. r = Is / 2,
  5213. n = vs - 60 * fs;
  5214. Zi.globalAlpha = .35 * a;
  5215. Zi.fillStyle = "#000000";
  5216. Zi.fillRect(r - i / 2, n - s / 2, i, s);
  5217. Zi.globalAlpha = a;
  5218. Zi.fillStyle = pr == pa ? _i : wr ? "#8CCEF4" : Ni;
  5219. Zi.fillRect(r - i / 2, n - s / 2, kr / 100 * i, s);
  5220. Zi.fillStyle = As ? t ? Bi : "orange" : t ? Bi : "white";
  5221. Zi.globalAlpha = 1 * a;
  5222. Ar.setText(wr ? t ? "LOW Air" : "Air" : e && e.animalType == pa ? t ? "LOW Lava" : "Lava" : t ? "LOW Water" : "Water");
  5223. Ar.setFontSize(22 * fs);
  5224. Ar.setColor(t ? Bi : "white");
  5225. Ar.x = r;
  5226. Ar.y = n;
  5227. Zi.globalAlpha *= t ? 1 : .5;
  5228. Ar.draw();
  5229. Zi.globalAlpha = .35;
  5230. Zi.fillStyle = "#000000";
  5231. n = vs - s / 2 - 5;
  5232. i = .9 * Is;
  5233. Zi.fillRect(r - i / 2, n - s / 2, i, s);
  5234. Zi.globalAlpha = 1;
  5235. Zi.fillStyle = "#F3C553";
  5236. Zi.fillRect(r - i / 2, n - s / 2, xpPer / 100 * i, s);
  5237. Zi.globalAlpha = 1;
  5238. Tr.setText("" + li(xp) + " xp (" + li(_s) + " xp Next Animal)");
  5239. Tr.setFontSize(22 * fs);
  5240. Tr.x = r;
  5241. Tr.y = n;
  5242. Tr.draw();
  5243. for (e = 0; e < Cr.length; e++) Cr[e].draw();
  5244. es && (jr += .1 * ((Or ? 1 : 0) - jr), .005 < jr && gr && (Zi.globalAlpha = .3 * jr, Zi.beginPath(), Zi.arc(Fr, Wr, zr * $i, 0, 2 * Math.PI), Zi.fillStyle = "#000000", Zi.fill(), Zi.globalAlpha = .5 * jr, Zi.beginPath(), Zi.arc(Gr, Hr, zr * $i * .57, 0, 2 * Math.PI), Zi.fillStyle = "#000000", Zi.fill(), e = .3 * Xr, Xr -= e, Lr += e, Yr += .1 * (Vr - Yr), Zi.save(), Zi.translate(Is / 2, vs / 2), Zi.rotate(Lr), Zi.globalAlpha = .5 * jr, Zi.beginPath(), Zi.fillStyle = "#000000", e = 40 * $i, Fs[dr] && (e = (9 + Fs[dr].rad) * ls), e *= .1 + .9 * Yr, a = 15 * $i, Zi.moveTo(e + 30 * $i * (.2 + .8 * Yr), 0), Zi.lineTo(e, a / 2), Zi.lineTo(e, -a / 2), Zi.closePath(), Zi.fill(), Zi.restore()))
  5245. }
  5246. Zi.restore()
  5247. }
  5248. var Xo = "Ready to survive!",
  5249. Yo = "white",
  5250. Vo = +new Date + 0,
  5251. Ko = [],
  5252. Jo = +new Date + 0,
  5253. qo = 0,
  5254. Zo = 100,
  5255. Qo = 2,
  5256. $o = !1,
  5257. el = !1,
  5258. al = 0,
  5259. tl = [],
  5260. il = !1,
  5261. sl = 0,
  5262. rl = 0;
  5263.  
  5264. function nl(e, a) {
  5265. Xo = e;
  5266. Vo = +new Date + a
  5267. }
  5268.  
  5269. function ol() {
  5270. var e = (Vo - Yi) / 1e3 / 1,
  5271. e = 0 > e ? 0 : 1 < e ? 1 : e;
  5272. 0 < e && (Zi.save(), Zi.globalAlpha = e, Ir.setText(Xo), Ir.setColor(Yo), Ir.setFontSize(25 * fs), Ir.x = Is / 2, Ir.y = .3 * vs, Ir.draw(), Zi.restore());
  5273. e = 0 < Jo - Yi ? 1 : 0;
  5274. qo += .05 * (e - qo);
  5275. if (.01 < qo && !qs && $o) {
  5276. Zi.save();
  5277. Zi.translate(Is / 2, vs * (.9 + .3 * (1 - qo)));
  5278. if (e = Ns("./img/howToPlay1.png")) {
  5279. var a = .2 * vs / e.height * qo;
  5280. Zi.drawImage(e, -.5 * e.width * a, -1 * e.height * a, e.width * a, e.height * a)
  5281. }
  5282. Zi.restore()
  5283. }
  5284. e = el ? 1 : 0;
  5285. al += .1 * (e - al);
  5286. if (.01 < al) {
  5287. if (0 < tl.length) {
  5288. Zi.save();
  5289. Zi.translate(0, -.5 * vs * (1 - al));
  5290. for (var e = 170 * fs, a = e + 20, t = Is / 2 - (Math.max(0, tl.length - 1) * (10 + e) + (a - e)) / 2, i = 0; i < tl.length; i++) {
  5291. var s = tl[i];
  5292. s.buttonScaleF = 0 == i ? a / e : 1;
  5293. s.w = e;
  5294. s.h = e;
  5295. s.x = t;
  5296. s.y = .25 * vs;
  5297. t += s.w / 2 * s.buttonScaleF + e / 2 + 10
  5298. }
  5299. Zi.globalAlpha = al;
  5300. for (i = 0; i < tl.length; i++) s = tl[i], s.draw()
  5301. }
  5302. e = Math.max(0, rl - Yi) / 1e3;
  5303. a = 1;
  5304. 0 != e && 8 > e && (a = .7 + .3 * Math.sin(2 * Math.PI / 1.2 * (Yi / 1e3)));
  5305. Zi.save();
  5306. Zi.globalAlpha = al * a;
  5307. Zi.fillStyle = 0 != e && 8 > e ? "red" : "white";
  5308. Zi.font = 25 * fs + "px Arial";
  5309. Zi.lineWidth = 1;
  5310. Zi.textAlign = "center";
  5311. Zi.textBaseline = "middle";
  5312. qs || (Zi.shadowOffsetX = 1, Zi.shadowOffsetY = 1, Zi.shadowColor = "black");
  5313. e = 0 < e ? " (auto in " + Math.trunc(e) + "s)" : "";
  5314. Zi.fillText(il ? "Choose which animal to spawn as:" : "Choose an upgrade:" + e, Is / 2, tl[0].y - tl[0].w / 2 - 25);
  5315. Zi.restore();
  5316. Zi.restore()
  5317. }
  5318. }
  5319. var ll = +new Date;
  5320.  
  5321. function hl(a) {
  5322. Yi = +new Date;
  5323. window.requestAnimationFrame(hl);
  5324. 1 != Zi.globalAlpha && (Zi.setTransform(1, 0, 0, 1, 0, 0), Zi.globalAlpha = 1);
  5325. Zi.clearRect(0, 0, Is, vs);
  5326. a = (Yi - Vi) / 1e3 / .2;
  5327. a = 0 > a ? 0 : 1 < a ? 1 : a;
  5328. hs = a * (ds - gs) + gs;
  5329. cs = a * (ps - ms) + ms;
  5330. ls = (25 * ls + camzoom_n) / 26;
  5331. Ml();
  5332. Zi.save();
  5333. a = Is / 2;
  5334. var t = vs / 2;
  5335. Zi.translate(a * (1 - ls) + (a - hs) * ls, t * (1 - ls) + (t - cs) * ls);
  5336. Zi.scale(ls, ls);
  5337. Zi.save();
  5338. ur ? (a = 10, a = 600, Zi.globalAlpha = 1, Zi.fillStyle = Di, Zi.fillRect(0, 0 - a, Ds, a), Zi.fillRect(0, Ms, Ds, a), Zi.fillRect(-a, -a, a, Ms + 2 * a), Zi.fillRect(Ds, -a, a, Ms + 2 * a)) : fillGrid(Nl(0), _l(0), Nl(Is), _l(vs), 0, 0);
  5339. Zi.restore();
  5340. a = Rs.slice();
  5341. for (var t = [u, P, ae, me], i = {}, s = 0; s < t.length; s++) {
  5342. var r = new Mn;
  5343. i[t[s]] = r;
  5344. a.push(r)
  5345. }
  5346. for (d = a.length - 1; 0 <= d; d--)
  5347. for (s = a[d], e = 0; e < t.length; e++)
  5348. if (r = t[e], r == s.oType && !(s instanceof Mn)) {
  5349. i[r].addBatchedObj(s);
  5350. a.splice(d, 1);
  5351. break
  5352. }
  5353. Ws = [];
  5354. for (d = 0; d < a.length; d++) a[d].updateZ();
  5355. a.sort(function(e, a) {
  5356. return e.z == a.z ? e.id - a.id : e.z - a.z
  5357. });
  5358. for (d = 0; d < a.length; d++) s = a[d], s.draw();
  5359. if (!Js)
  5360. for (d = 0; d < a.length; d++) "undefined" != typeof a[d].chatLines && a[d].drawChat();
  5361. for (d = 0; d < Ws.length; d++) a = Ws[d], Fs.hasOwnProperty(a.id) && delete Fs[a.id], a = Rs.indexOf(a), -1 != a && Rs.splice(a, 1);
  5362. Zi.restore();
  5363. gr && (Ji && Ji.width && Zi.drawImage(Ji, 10 * $i, 10 * $i, Ji.width * fs, Ji.height * fs), qi && qi.width && Zi.drawImage(qi, Is - (10 * $i + qi.width * fs), 10 * $i, Go * fs, Ho * fs), a = Fs[dr]) && (Zi.fillStyle = "white", Zi.beginPath(), Zi.arc(Is - (10 * $i + qi.width * fs) + a.x * qi.width * fs / Ds, 10 * $i + a.y * qi.height * fs / Ms, 3, 0, 2 * Math.PI), Zi.fill());
  5364. Lo();
  5365. ol();
  5366. hn && (dn.setFontSize(40 * fs), dn.x = Is / 2, dn.y = .2 * vs, cn ? dn.setText("") : dn.setText("Connecting to game..."), dn.draw(), !cn && (a = Is / 2, t = .25 * vs + 120 * fs, i = Ns("skins/mouse.png"))) && (Zi.save(), Zi.translate(a, t), Zi.rotate(Yi % 800 / 800 * Math.PI * 2), Zi.drawImage(i, -75, -75, 150, 150), Zi.restore());
  5367. 370 < bl && !gr && (qs && (tr += 1, 1e3 < Yi - sr && (sr = +new Date, vr.setText(tr + " fps"), tr = 0), or += 1), vr.setFontSize(15 * fs), vr.x = Is - 5 - vr.width / 2, vr.y = vs - 2 - vr.height / 2, vr.draw())
  5368. }
  5369. window.requestAnimationFrame ? window.requestAnimationFrame(hl) : setInterval(draw, 1e3 / 60);
  5370. var cl = 0;
  5371.  
  5372. function dl(e) {
  5373. if (Ro() && !gr) {
  5374. playerName = nickInput.value.replace(/(<([^>]+)>)/gi, "").substring(0, 20);
  5375. var a = 9 + ii(playerName).length + 1;
  5376. mes = new fo(a);
  5377. mes.writeUInt8(2);
  5378. mes.writeString(playerName);
  5379. mes.writeUInt16(Is);
  5380. mes.writeUInt16(vs);
  5381. mes.writeUInt8(e ? 1 : 0);
  5382. Oo(mes);
  5383. if (!e && window.localStorage) try {
  5384. window.localStorage.setItem("nick", playerName + "")
  5385. } catch (e) {}
  5386. }
  5387. }
  5388. document.getElementById("startButton").onclick = function() {
  5389. resetAfk();
  5390. var e = ts("audio/click.mp3");
  5391. if (e) try {
  5392. e.play()
  5393. } catch (e) {}!sn && fr && (rn() ? pn() : dl(!1))
  5394. };
  5395. var pl = document.getElementById("button_mute");
  5396. pl && (pl.onclick = function() {
  5397. $s = !$s;
  5398. os();
  5399. try {
  5400. window.localStorage.setItem("options_muted", $s ? 1 : 0)
  5401. } catch (e) {}
  5402. });
  5403. document.getElementById("settingsButton").onclick = function() {
  5404. var e = document.getElementById("optionsDiv");
  5405. e.style.display = "block" == e.style.display ? "none" : "block";
  5406. if (e = ts("audio/click.mp3")) try {
  5407. e.play()
  5408. } catch (e) {}
  5409. };
  5410. document.getElementById("closeBut").onclick = function() {
  5411. var e = document.getElementById("optionsDiv");
  5412. e.style.display = "block" == e.style.display ? "none" : "block";
  5413. if (e = ts("audio/click.mp3")) try {
  5414. e.play()
  5415. } catch (e) {}
  5416. };
  5417. document.getElementById("options_noImages").onchange = function() {
  5418. if (window.localStorage) {
  5419. Ks = document.getElementById("options_noImages").checked;
  5420. try {
  5421. window.localStorage.setItem("options_noImages", Ks ? 1 : 0)
  5422. } catch (e) {}
  5423. console.log("options_noimages: saved as " + window.localStorage.getItem("options_noImages"))
  5424. }
  5425. };
  5426. document.getElementById("options_noNames").onchange = function() {
  5427. if (window.localStorage) {
  5428. Js = document.getElementById("options_noNames").checked;
  5429. try {
  5430. window.localStorage.setItem("options_noNames", Js ? 1 : 0)
  5431. } catch (e) {}
  5432. console.log("options_noNames: saved as " + window.localStorage.getItem("options_noNames"))
  5433. }
  5434. };
  5435. document.getElementById("options_lowGraphics").onchange = function() {
  5436. if (window.localStorage) {
  5437. qs = document.getElementById("options_lowGraphics").checked;
  5438. try {
  5439. window.localStorage.setItem("options_lowGraphics", qs ? 1 : 0)
  5440. } catch (e) {}
  5441. wl();
  5442. console.log("options_lowGraphics: saved as " + window.localStorage.getItem("options_lowGraphics"))
  5443. }
  5444. };
  5445. document.getElementById("options_noJoystick").onchange = function() {
  5446. if (window.localStorage) {
  5447. Zs = document.getElementById("options_noJoystick").checked;
  5448. try {
  5449. window.localStorage.setItem("options_noJoystick", Zs ? 1 : 0)
  5450. } catch (e) {}
  5451. wl();
  5452. console.log("options_noJoystick: saved as " + window.localStorage.getItem("options_noJoystick"))
  5453. }
  5454. };
  5455. var gl = document.getElementById("options_leftHanded");
  5456. gl && (gl.onchange = function() {
  5457. if (window.localStorage) {
  5458. Qs = gl.checked;
  5459. try {
  5460. window.localStorage.setItem("options_leftHanded", Qs ? 1 : 0)
  5461. } catch (e) {}
  5462. wl();
  5463. console.log("options_leftHanded: saved as " + window.localStorage.getItem("options_leftHanded"))
  5464. }
  5465. });
  5466. var ml = !1,
  5467. fl = !1;
  5468. document.onkeydown = function(e) {
  5469. resetAfk();
  5470. var a = e.keyCode || e.which;
  5471. if (!ml && gr) switch (a) {
  5472. case 32:
  5473. e.preventDefault();
  5474. vl(kl, !0);
  5475. break;
  5476. case 87:
  5477. e.preventDefault();
  5478. vl(Pl, !0);
  5479. break;
  5480. case 83:
  5481. e.preventDefault();
  5482. vl(Il, !0);
  5483. break;
  5484. case 27:
  5485. t && (e.preventDefault(), fl = !fl, nl("Movement Lock (ESC KEY): " + (fl ? "ON" : "OFF"), 2500))
  5486. }
  5487. };
  5488. document.onkeyup = function(e) {
  5489. var a = e.keyCode || e.which;
  5490. if (13 == a) {
  5491. if (!gr && !el) {
  5492. document.getElementById("startButton").click();
  5493. return
  5494. }
  5495. if (el) {
  5496. go(tl[0]);
  5497. return
  5498. }
  5499. }
  5500. if (gr)
  5501. if (a = e.keyCode || e.which, 13 == a) ul();
  5502. else if (!ml && gr) switch (a) {
  5503. case 32:
  5504. e.preventDefault();
  5505. vl(kl, !1);
  5506. break;
  5507. case 87:
  5508. e.preventDefault();
  5509. vl(Pl, !1);
  5510. break;
  5511. case 38:
  5512. e.preventDefault();
  5513. vl(Al, !1);
  5514. break;
  5515. case 40:
  5516. e.preventDefault(), vl(Tl, !1)
  5517. }
  5518. };
  5519.  
  5520. function ul() {
  5521. var e = document.getElementById("chatinput");
  5522. if (!ml && gr) e.style.visibility = "visible", e.focus(), ml = !0, e.onblur = function() {
  5523. ml && ul()
  5524. };
  5525. else if (ml) {
  5526. var a = e.value + "";
  5527. ml = !1;
  5528. e.style.visibility = "hidden";
  5529. e.blur();
  5530. 0 < a.length && gr && (newMsg = new fo(3 + ii(a).length), newMsg.writeUInt8(19), newMsg.writeString(a), Oo(newMsg));
  5531. e.value = ""
  5532. }
  5533. }
  5534. window.onresize = wl;
  5535. var bl = 100,
  5536. yl = 100;
  5537.  
  5538. function wl() {
  5539. bl = window.innerWidth;
  5540. yl = window.innerHeight;
  5541. yi && (bl = document.body.clientWidth, yl = document.body.clientHeight);
  5542. $i = window.devicePixelRatio;
  5543. Is = bl * $i;
  5544. vs = yl * $i;
  5545. Ki.width = Is;
  5546. Ki.height = vs;
  5547. Ki.style.width = bl + "px";
  5548. Ki.style.height = yl + "px";
  5549. document.getElementById("chatinput").style.marginTop = yl / 2 - 50 + "px";
  5550. Sr.w = Sr.h = 95 * $i;
  5551. Nr.w = Nr.h = 95 * $i;
  5552. _r.w = _r.h = 95 * $i;
  5553. Er.w = 60 * $i;
  5554. Er.h = 30 * $i;
  5555. Sr.x = 25 * $i + Sr.w / 2;
  5556. Sr.y = vs - (40 * $i + Sr.w / 2);
  5557. Qs && (Sr.x = Is - Sr.x);
  5558. Nr.x = Sr.x;
  5559. Nr.y = es ? Sr.y - (10 * $i + Nr.w / 2 + Sr.w / 2) : Sr.y;
  5560. _r.x = Sr.x;
  5561. _r.y = Nr.y - (10 * $i + _r.w / 2 + Nr.w / 2);
  5562. Er.x = 72.5 * $i + 125 * $i;
  5563. Er.y = 15 * $i + Er.h / 2;
  5564. Ur.setPosAndSize(Er.x - (Er.w / 2 + 10 * $i), Er.y, 60 * $i, 30 * $i, 1, .5);
  5565. Br.setPosAndSize(Ur.x, Ur.y + Ur.h / 2 + 10 * $i, 60 * $i, 30 * $i, .5, 0);
  5566. for (var e = 0; e < Cr.length; e++) Cr[e].visible = es;
  5567. Nr.visible = !0;
  5568. _r.visible = !0;
  5569. Ur.visible = Ur.touchEnabled = es;
  5570. Br.visible = Br.touchEnabled = es && t;
  5571. fs = Math.max(Is / 1344, vs / 756);
  5572. fs = Math.min(1, Math.max(.4, fs * $i));
  5573. 500 > Math.min(bl, yl) && (fs = $i / 2 * .9);
  5574. Ro() && (mes = new fo(5), mes.writeUInt8(17), mes.writeUInt16(Is), mes.writeUInt16(vs), Oo(mes))
  5575. }
  5576. var kl = 1,
  5577. Pl = 2,
  5578. Al = 3,
  5579. Tl = 4,
  5580. Il = 5;
  5581.  
  5582. function vl(e, a) {
  5583. switch (e) {
  5584. case kl:
  5585. As != a && Ro() && gr && (a && Sl(), mes = new fo(2), mes.writeUInt8(21), mes.writeUInt8(a ? 1 : 0), Oo(mes));
  5586. As = a;
  5587. break;
  5588. case Pl:
  5589. Ts != a && Ro() && gr && (a && Sl(), mes = new fo(2), mes.writeUInt8(20), mes.writeUInt8(a ? 1 : 0), Oo(mes));
  5590. Ts = a;
  5591. break;
  5592. case Al:
  5593. t && gr && (mes = new fo(1), mes.writeUInt8(26), Oo(mes));
  5594. break;
  5595. case Tl:
  5596. t && gr && (mes = new fo(1), mes.writeUInt8(27), Oo(mes));
  5597. break;
  5598. case Il:
  5599. gr && (mes = new fo(1), mes.writeUInt8(28), Oo(mes))
  5600. }
  5601. }
  5602. Ki.addEventListener("gesturestart", function(e) {
  5603. e.preventDefault()
  5604. });
  5605.  
  5606. function Dl() {
  5607. for (var e = 0; e < Cr.length; e++) {
  5608. var a = Cr[e];
  5609. a.pressed = !1;
  5610. a.pressedTouchID = -1
  5611. }
  5612. Or = !1
  5613. }
  5614. Ki.ontouchstart = function(e) {
  5615. resetAfk();
  5616. 1 == e.touches.length && (console.log("Resetting all buttons (joytick bug fix)"), Dl());
  5617. if (gr) {
  5618. for (var a = 0; a < e.changedTouches.length; a++)
  5619. for (var t = e.changedTouches[a], i = 0; i < Cr.length; i++) {
  5620. var s = Cr[i];
  5621. if (s.testPosHitsButton(t.clientX * $i, t.clientY * $i) && !s.pressed && s.touchEnabled) {
  5622. e.preventDefault();
  5623. s.pressed = !0;
  5624. s.pressedTouchID = t.identifier;
  5625. s.onButtonTouchStart();
  5626. return
  5627. }
  5628. }
  5629. Zs || Or ? (us = e.touches[0].clientX * $i, bs = e.touches[0].clientY * $i, Ml()) : (t = e.changedTouches[0], Or = !0, Fr = t.clientX * $i, Wr = t.clientY * $i, Gr = Fr, Hr = Wr, Rr = t.identifier)
  5630. }
  5631. };
  5632. Ki.ontouchmove = function(e) {
  5633. resetAfk();
  5634. e.preventDefault();
  5635. for (var a = 0; a < e.changedTouches.length; a++) {
  5636. var t = e.changedTouches[a];
  5637. if (t.identifier == Nr.pressedTouchID) {
  5638. if (-1 == Sr.pressedTouchID) {
  5639. var i = Sr.testPosHitsButton(t.clientX * $i, t.clientY * $i),
  5640. t = Sr.pressed;
  5641. (Sr.pressed = i) && !t ? vl(kl, !0) : !i && t && vl(kl, !1)
  5642. }
  5643. } else if (Zs) us = t.clientX * $i, bs = t.clientY * $i, Ml();
  5644. else if (Or && t.identifier == Rr) {
  5645. var i = t.clientX * $i - Fr,
  5646. t = t.clientY * $i - Wr,
  5647. s = Math.sqrt(i * i + t * t);
  5648. if (0 < s) {
  5649. var i = i / s,
  5650. t = t / s,
  5651. s = Math.min(1, s / (zr * $i)),
  5652. r = Math.pow(s, 3);
  5653. .1 > r && (r = 0);
  5654. r *= 300 * $i;
  5655. Xr = ai(Lr, Math.atan2(t, i));
  5656. Vr = s;
  5657. Gr = Fr + zr * $i * i * s;
  5658. Hr = Wr + zr * $i * t * s;
  5659. us = Is / 2 + i * r;
  5660. bs = vs / 2 + t * r;
  5661. Ml()
  5662. }
  5663. }
  5664. }
  5665. };
  5666. Ki.ontouchend = function(e) {
  5667. for (var a = 0; a < e.changedTouches.length; a++) {
  5668. var t = e.changedTouches[a];
  5669. if (Or && t.identifier == Rr) Or = !1, Rr = -1;
  5670. else
  5671. for (var i = 0; i < Cr.length; i++) {
  5672. var s = Cr[i];
  5673. if (s.pressed && s.pressedTouchID == t.identifier && s.touchEnabled) {
  5674. s.pressed = !1;
  5675. s.pressedTouchID = -1;
  5676. if (gr) s.onButtonTouchEnd();
  5677. return
  5678. }
  5679. }
  5680. }
  5681. };
  5682. Ki.ontouchcancel = function(e) {
  5683. console.log("touch cancel");
  5684. Ki.ontouchend(e)
  5685. };
  5686. Ki.ontouchleave = function(e) {
  5687. console.log("touch leave")
  5688. };
  5689. Ki.onmousemove = function(e) {
  5690. us = e.clientX * $i;
  5691. bs = e.clientY * $i;
  5692. Ml();
  5693. yr || resetAfk();
  5694. if (el && 650 < Yi - sl)
  5695. for (var a = 0; a < tl.length; a++) {
  5696. var t = tl[a];
  5697. t.isHighLighted = t.testPosHitsButton(us, bs)
  5698. }
  5699. e.preventDefault()
  5700. };
  5701. Ki.onmousedown = function(e) {
  5702. resetAfk();
  5703. 1 == e.which && vl(kl, !0);
  5704. 3 == e.which && vl(Pl, !0);
  5705. e.preventDefault()
  5706. };
  5707. Ki.onmouseup = function(e) {
  5708. if (1 == e.which && (vl(kl, !1), el && 650 < Yi - sl)) {
  5709. us = e.clientX * $i;
  5710. bs = e.clientY * $i;
  5711. for (var a = 0; a < tl.length; a++) {
  5712. var t = tl[a];
  5713. if (t.testPosHitsButton(us, bs)) {
  5714. go(t);
  5715. break
  5716. }
  5717. }
  5718. }
  5719. 3 == e.which && vl(Pl, !1);
  5720. e.preventDefault()
  5721. };
  5722. Ki.onblur = function(e) {
  5723. vl(kl, !1);
  5724. vl(Pl, !1)
  5725. };
  5726. window.onfocus = function(e) {
  5727. resetAfk()
  5728. };
  5729. window.onmouseout = function(e) {
  5730. null == e.toElement && null == e.relatedTarget && (vl(kl, !1), vl(Pl, !1))
  5731. };
  5732. document.oncontextmenu = document.body.oncontextmenu = function() {
  5733. return !gr
  5734. };
  5735.  
  5736. function Ml() {
  5737. var e = vs / 2;
  5738. ys = (us - (Is / 2 - hs * ls)) / ls;
  5739. ws = (bs - (e - cs * ls)) / ls
  5740. }
  5741.  
  5742. function xl(e) {
  5743. return e * ls + (Is / 2 - hs * ls)
  5744. }
  5745.  
  5746. function Cl(e) {
  5747. return e * ls + (vs / 2 - cs * ls)
  5748. }
  5749.  
  5750. function Nl(e) {
  5751. return (e - (Is / 2 - hs * ls)) / ls
  5752. }
  5753.  
  5754. function _l(e) {
  5755. return (e - (vs / 2 - cs * ls)) / ls
  5756. }
  5757.  
  5758. function Sl() { //mouse
  5759. if (fl) {
  5760. var e = Fs[dr];
  5761. if (e) ys = e.x, ws = e.y + 2;
  5762. else return
  5763. }
  5764. Ro() && gr && (.1 < Math.abs(ks - ys) || .1 < Math.abs(Ps - ws)) && (ks = ys, Ps = ws, mes = new fo(7), mes.writeUInt8(5), mes.writeInt16(ys), mes.writeInt16(ws), mes.writeInt16(Ul), window.fo = mes, Oo(mes))
  5765. }
  5766. setInterval(Sl, 20);
  5767. resetAfk = function() {
  5768. br = +new Date;
  5769. yr && (yr = !1, ki || (window.onbeforeunload = null), document.getElementById("connecting").style.visibility = "visible", window.location.reload())
  5770. };
  5771. setInterval(function() {
  5772. +new Date - br > 6e4 * (gr ? 2400 : 10) && !yr && fr && (console.log("Disconnected for afk..."), yr = !0, Ro() && Kr.close())
  5773. }, 5e3);
  5774.  
  5775. function El() {
  5776. wl();
  5777. Fs = {};
  5778. Rs = [];
  5779. Ws = [];
  5780. Pr = xpPer = xp = waterBarPerc_n = kr = 0;
  5781. Ji = null;
  5782. xr = "";
  5783. var e = document.getElementById("spawnXpLabel");
  5784. e.style.display = xr ? "block" : "none";
  5785. e.textContent = xr;
  5786. for (e = 0; e < Cr.length; e++) Cr[e].pressed = !1;
  5787. el = Or = !1;
  5788. al = 0;
  5789. tl = [];
  5790. il = !1
  5791. }
  5792. window.onload = function() {
  5793. wl();
  5794. if (window.localStorage) {
  5795. var e = document.getElementById("nickInput");
  5796. e.value = window.localStorage.getItem("nick");
  5797. e.setSelectionRange(0, e.value.length);
  5798. es || e.focus()
  5799. }
  5800. };
  5801. Ki.addEventListener ? (Ki.addEventListener("mousewheel", Ol, !1), Ki.addEventListener("DOMMouseScroll", Ol, !1)) : Ki.attachEvent("onmousewheel", Ol);
  5802. var Ul = 0,
  5803. Bl = 1;
  5804.  
  5805. function Ol(e) {
  5806. e = window.event || e;
  5807. Bl = e = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail));
  5808. Ul = 1 == e ? Ul + 1 : Ul - 1;
  5809. 400 < Ul ? Ul = 400 : -100 > Ul && (Ul = -100)
  5810. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement