Greasy Fork镜像 支持简体中文。

SlitherNuker

Take Over Slither.io

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/469095/1208253/SlitherNuker.js

  1. // ==UserScript==
  2. // @name SlitherNuker
  3. // @version 0.3
  4. // @description Take Over Slither.io
  5. // @author Zpayer./.AMiNE.
  6. // @match http://*/*
  7. // @match https://*/*
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. var testing = !1;
  13. window.ConsoleX={
  14. Memory:{},
  15. }
  16. 0 <= window.location.href.indexOf("/testing") && (testing = !0);
  17. var iioc = !1
  18. , nsr = !1
  19. , lang = navigator.language || navigator.userLanguage;
  20. lang = lang.substr(0, 2);
  21. var forcing = !1
  22. , ua = navigator.userAgent.toLowerCase()
  23. , is_android = 0 <= ua.indexOf("android")
  24. , is_amazon = 0 <= ua.indexOf("kindle") || 0 <= ua.indexOf("silk/")
  25. , uua = navigator.userAgent
  26. , is_ios = 0 <= uua.indexOf("iPad") || 0 <= uua.indexOf("iPhone") || 0 <= uua.indexOf("iPod")
  27. , is_mobile = 0 <= ua.indexOf("mobile")
  28. , is_firefox = -1 < ua.indexOf("firefox")
  29. , is_ie8oo = window.attachEvent && !window.addEventListener
  30. , is_chrome = !1
  31. , is_osx = !1
  32. , osx_ver = -1
  33. , is_safari = !1;
  34. 0 <= ua.indexOf("safari") && -1 == ua.indexOf("chrome") && (is_safari = !0);
  35. 0 <= ua.indexOf("chrome") && (is_safari || is_firefox || (is_chrome = !0));
  36. if (0 <= ua.indexOf("mac os x ")) {
  37. var j = ua.indexOf("mac os x ");
  38. if (0 <= j) {
  39. j += 9;
  40. for (var vs = [], v = 0, i = j; i < ua.length; i++) {
  41. var k = ua.charCodeAt(i);
  42. if (48 <= k && 57 >= k)
  43. v *= 10,
  44. v += k - 48;
  45. else if (vs.push(v),
  46. v = 0,
  47. 3 == vs.length || 46 != k && 95 != k)
  48. break
  49. }
  50. 2 <= vs.length && 10 == vs[0] && (is_osx = !0,
  51. osx_ver = vs[1])
  52. }
  53. }
  54. if (navigator.platform) {
  55. var ptf = ("" + navigator.platform).toLowerCase();
  56. "mac" != ptf.substr(0, 3) && (is_osx = !1)
  57. }
  58. var no_raf = !1
  59. , raf = function(b) {};
  60. window.requestAnimationFrame ? raf = window.requestAnimationFrame : window.mozRequestAnimationFrame ? raf = window.mozRequestAnimationFrame : window.webkitRequestAnimationFrame ? raf = window.webkitRequestAnimationFrame : no_raf = !0;
  61. is_mobile || (no_raf = !0);
  62. no_raf = !0;
  63. if (is_chrome) {
  64. var uas = ua.split(" ");
  65. for (i = uas.length - 1; 0 <= i; i--) {
  66. var s = uas[i];
  67. if (0 == s.indexOf("chrome/")) {
  68. vs = s.split("chrome/")[1];
  69. vs = vs.split(".");
  70. 3 <= vs.length && (52 <= Number(vs[0]) ? no_raf = !1 : 51 == Number(vs[0]) && (1 <= Number(vs[1]) ? no_raf = !1 : 2704 <= Number(vs[2]) && (no_raf = !1)));
  71. break
  72. }
  73. }
  74. no_raf = !0
  75. }
  76. var doiosh = !1;
  77. is_chrome && is_osx && -1 != osx_ver && 11 >= osx_ver && (nsr = !0);
  78. var a, l, m, n, o, r, fj, d, d2, qq, sc, agpu = "translateZ(0)", ang, sang, vang;
  79. function trf(b, c) {
  80. b.style.webkitTransform = b.style.OTransform = b.style.msTransform = b.style.MozTransform = b.style.transform = c
  81. }
  82. function trfo(b, c) {
  83. b.style.webkitTransformOrigin = b.style.OTransformOrigin = b.style.msTransformOrigin = b.style.MozTransformOrigin = b.style.transformOrigin = c
  84. }
  85. var pi2 = 2 * Math.PI
  86. , piar = [4, 21, 0, 11]
  87. , animating = !1
  88. , startAnimation = function() {
  89. animating = !0;
  90. no_raf ? is_mobile ? setInterval("oef()", 33) : is_safari ? setInterval("oef()", 33) : setInterval("oef()", 20) : raf(oef)
  91. }
  92. , ois = []
  93. , wic = 0
  94. , ldi = function(b) {
  95. wic++;
  96. var c = {}
  97. , e = document.createElement("img");
  98. c.ii = e;
  99. c.sc = 1;
  100. e.onload = function() {
  101. for (var b = ois.length - 1; 0 <= b; b--)
  102. if (ois[b].ii == this) {
  103. b = ois[b];
  104. b.ww = this.width;
  105. b.hh = this.height;
  106. b.loaded = !0;
  107. if (b.onload)
  108. b.onload();
  109. break
  110. }
  111. wic--;
  112. 0 == wic && startAnimation()
  113. }
  114. ;
  115. c.src = b;
  116. ois.push(c);
  117. return c
  118. };
  119. function addCss(b) {
  120. var c = document.createElement("style");
  121. document.getElementsByTagName("head")[0].appendChild(c);
  122. c.type = "text/css";
  123. c.styleSheet ? c.styleSheet.cssText = b : c.appendChild(document.createTextNode(b))
  124. }
  125. var sadg, sadu, sadd, p, xx, yy, grw, grh, elem, map, imgd, ctx, rw, rh;
  126. elem = document.createElement("canvas");
  127. grw = 2;
  128. grh = 56;
  129. elem.width = grw;
  130. elem.height = grh;
  131. ctx = elem.getContext("2d");
  132. map = ctx.getImageData(0, 0, grw, grh);
  133. imgd = map.data;
  134. l = imgd.length;
  135. for (yy = p = 0; yy < grh; yy++)
  136. for (j = (grh - 1 - yy) / (grh - 1),
  137. j = .5 * (1 - Math.cos(Math.PI * j)),
  138. xx = 0; xx < grw; xx++)
  139. imgd[p] = Math.min(255, Math.floor(54.4 + 32 * j)),
  140. imgd[p + 1] = Math.min(255, Math.floor(108.8 + 64 * j)),
  141. imgd[p + 2] = Math.min(255, Math.floor(81.6 + 48 * j)),
  142. imgd[p + 3] = 255,
  143. p += 4;
  144. ctx.putImageData(map, 0, 0);
  145. sadg = elem.toDataURL();
  146. elem = document.createElement("canvas");
  147. elem.width = grw;
  148. elem.height = grh;
  149. ctx = elem.getContext("2d");
  150. map = ctx.getImageData(0, 0, grw, grh);
  151. imgd = map.data;
  152. l = imgd.length;
  153. for (yy = p = 0; yy < grh; yy++)
  154. for (j = (grh - 1 - yy) / (grh - 1),
  155. j = .5 * (1 - Math.cos(Math.PI * j)),
  156. xx = 0; xx < grw; xx++)
  157. imgd[p] = Math.min(255, Math.floor(72 + .95 * 48 * j)),
  158. imgd[p + 1] = Math.min(255, Math.floor(171 + 93.1 * j)),
  159. imgd[p + 2] = Math.min(255, Math.floor(132 + .95 * 87 * j)),
  160. imgd[p + 3] = 255,
  161. p += 4;
  162. ctx.putImageData(map, 0, 0);
  163. sadu = elem.toDataURL();
  164. elem = document.createElement("canvas");
  165. elem.width = grw;
  166. elem.height = grh;
  167. ctx = elem.getContext("2d");
  168. map = ctx.getImageData(0, 0, grw, grh);
  169. imgd = map.data;
  170. l = imgd.length;
  171. for (yy = p = 0; yy < grh; yy++)
  172. for (j = yy / (grh - 1),
  173. j = .5 * (1 - Math.cos(Math.PI * j)),
  174. xx = 0; xx < grw; xx++)
  175. imgd[p] = Math.floor(.1 * 48 + 36 * j),
  176. imgd[p + 1] = Math.floor(7 + 52.5 * j),
  177. imgd[p + 2] = Math.floor(6.4 + 48 * j),
  178. imgd[p + 3] = 255,
  179. p += 4;
  180. ctx.putImageData(map, 0, 0);
  181. sadd = elem.toDataURL();
  182. 32 < sadg.length && 32 < sadu.length && 32 < sadd.length && addCss(".sadg1 { background-image:url(" + sadg + "); } .sadu1 { background-image:url(" + sadu + "); } .sadd1 { background-image:url(" + sadd + "); }");
  183. elem.width = grw;
  184. elem.height = grh;
  185. ctx = elem.getContext("2d");
  186. map = ctx.getImageData(0, 0, grw, grh);
  187. imgd = map.data;
  188. l = imgd.length;
  189. for (yy = p = 0; yy < grh; yy++)
  190. for (j = (grh - 1 - yy) / (grh - 1),
  191. j = .5 * (1 - Math.cos(Math.PI * j)),
  192. xx = 0; xx < grw; xx++)
  193. imgd[p] = Math.min(255, Math.floor(.85 * 52 + 26 * j)),
  194. imgd[p + 1] = Math.min(255, Math.floor(81.6 + 48 * j)),
  195. imgd[p + 2] = Math.min(255, Math.floor(.85 * 144 + 72 * j)),
  196. imgd[p + 3] = 255,
  197. p += 4;
  198. ctx.putImageData(map, 0, 0);
  199. sadg = elem.toDataURL();
  200. elem = document.createElement("canvas");
  201. elem.width = grw;
  202. elem.height = grh;
  203. ctx = elem.getContext("2d");
  204. map = ctx.getImageData(0, 0, grw, grh);
  205. imgd = map.data;
  206. l = imgd.length;
  207. for (yy = p = 0; yy < grh; yy++)
  208. for (j = (grh - 1 - yy) / (grh - 1),
  209. j = .5 * (1 - Math.cos(Math.PI * j)),
  210. xx = 0; xx < grw; xx++)
  211. imgd[p] = Math.min(255, Math.floor(72 + .95 * 48 * j)),
  212. imgd[p + 1] = Math.min(255, Math.floor(132 + .95 * 87 * j)),
  213. imgd[p + 2] = Math.min(255, Math.floor(171 + 93.1 * j)),
  214. imgd[p + 3] = 255,
  215. p += 4;
  216. ctx.putImageData(map, 0, 0);
  217. sadu = elem.toDataURL();
  218. elem = document.createElement("canvas");
  219. elem.width = grw;
  220. elem.height = grh;
  221. ctx = elem.getContext("2d");
  222. map = ctx.getImageData(0, 0, grw, grh);
  223. imgd = map.data;
  224. l = imgd.length;
  225. for (yy = p = 0; yy < grh; yy++)
  226. for (j = yy / (grh - 1),
  227. j = .5 * (1 - Math.cos(Math.PI * j)),
  228. xx = 0; xx < grw; xx++)
  229. imgd[p] = Math.floor(.1 * 48 + 36 * j),
  230. imgd[p + 1] = Math.floor(5.4 + 40.5 * j),
  231. imgd[p + 2] = Math.floor(7 + 52.5 * j),
  232. imgd[p + 3] = 255,
  233. p += 4;
  234. ctx.putImageData(map, 0, 0);
  235. sadd = elem.toDataURL();
  236. 32 < sadg.length && 32 < sadu.length && 32 < sadd.length && addCss(".sadg2 { background-image:url(" + sadg + "); } .sadu2 { background-image:url(" + sadu + "); } .sadd2 { background-image:url(" + sadd + "); }");
  237. var mos = []
  238. , whmos = !1
  239. , swmup = !1;
  240. function mkBtn(b, c, e, h) {
  241. var w = document.createElement("div");
  242. b.tagName || (b = document.getElementById(b),
  243. b.style.width = e + "px",
  244. b.style.height = h + "px",
  245. w.style.width = e + "px",
  246. w.style.height = h + "px");
  247. var f = {
  248. lic: 0
  249. };
  250. f.elem = b;
  251. f.md = !1;
  252. f.mo = !1;
  253. f.mdf = 0;
  254. f.mof = 0;
  255. var q = !0;
  256. b.style && b.style.position && ("absolute" == (b.style.position + "").toLowerCase() && (q = !1),
  257. "fixed" == (b.style.position + "").toLowerCase() && (q = !1));
  258. q && (b.style.position = "relative");
  259. w.style.position = "absolute";
  260. w.style.opacity = 0;
  261. w.style.left = "0px";
  262. w.style.top = "0px";
  263. b.appendChild(w);
  264. f.ho = w;
  265. f.alic = function() {
  266. this.lic++;
  267. if (3 == this.lic && (this.ho.style.opacity = 1,
  268. this.onload))
  269. this.onload()
  270. }
  271. ;
  272. mos.push(f);
  273. f.setEnabled = function(b) {
  274. b ? (this.disabled = !1,
  275. this.upi.style.opacity = this.mof,
  276. this.downi.style.opacity = this.mdf,
  277. this.elem.style.opacity = 1,
  278. this.elem.style.cursor = "pointer") : (this.disabled = !0,
  279. this.upi.style.opacity = 0,
  280. this.downi.style.opacity = 0,
  281. this.elem.style.opacity = .38,
  282. this.elem.style.cursor = "default")
  283. }
  284. ;
  285. if (c)
  286. for (q = 1; 3 >= q; q++) {
  287. var x = document.createElement("img");
  288. x.draggable = !1;
  289. x.style.position = "absolute";
  290. x.style.left = "0px";
  291. x.style.top = "0px";
  292. x.border = 0;
  293. x.width = e;
  294. x.height = h;
  295. x.className = "nsi";
  296. w.appendChild(x);
  297. 1 == q ? (f.normi = x,
  298. x.onload = function() {
  299. for (var b = mos.length - 1; 0 <= b; b--) {
  300. var c = mos[b];
  301. if (c.normi == this) {
  302. c.alic();
  303. break
  304. }
  305. }
  306. }
  307. ,
  308. x.src = c + ".png") : 2 == q ? (f.upi = x,
  309. x.style.opacity = 0,
  310. x.onload = function() {
  311. for (var b = mos.length - 1; 0 <= b; b--) {
  312. var c = mos[b];
  313. if (c.upi == this) {
  314. c.alic();
  315. break
  316. }
  317. }
  318. }
  319. ,
  320. x.src = c + "up.png") : 3 == q && (f.downi = x,
  321. x.style.opacity = 0,
  322. x.onload = function() {
  323. for (var b = mos.length - 1; 0 <= b; b--) {
  324. var c = mos[b];
  325. if (c.downi == this) {
  326. c.alic();
  327. break
  328. }
  329. }
  330. }
  331. ,
  332. x.src = c + "down.png")
  333. }
  334. else
  335. w.style.opacity = 1;
  336. b.onmouseenter = function() {
  337. for (var b = mos.length - 1; 0 <= b; b--) {
  338. var c = mos[b];
  339. if (c.elem == this) {
  340. if (!c.disabled && !c.mo) {
  341. c.mo = !0;
  342. if (c.onmouseenter)
  343. c.onmouseenter();
  344. whmos = !0
  345. }
  346. break
  347. }
  348. }
  349. }
  350. ;
  351. b.onmouseleave = function() {
  352. for (var b = mos.length - 1; 0 <= b; b--) {
  353. var c = mos[b];
  354. if (c.elem == this) {
  355. if (c.mo) {
  356. c.mo = !1;
  357. if (c.onmouseleave)
  358. c.onmouseleave();
  359. whmos = !0
  360. }
  361. break
  362. }
  363. }
  364. }
  365. ;
  366. b.onmousedown = function(b) {
  367. for (var c = mos.length - 1; 0 <= c; c--) {
  368. var e = mos[c];
  369. if (e.elem == this) {
  370. if (!e.disabled && !e.md) {
  371. e.md = !0;
  372. if (e.onmousedown)
  373. e.onmousedown(b, e);
  374. whmos = !0;
  375. return !1
  376. }
  377. break
  378. }
  379. }
  380. }
  381. ;
  382. b.onmouseup = b.ondragend = function(b) {
  383. for (var c = mos.length - 1; 0 <= c; c--) {
  384. var e = mos[c];
  385. if (e.elem == this) {
  386. if (e.md) {
  387. e.mdf = 1;
  388. e.md = !1;
  389. if (e.onmouseup && (e.onmouseup(b, e),
  390. is_mobile))
  391. e.elem.onmouseleave();
  392. whmos = !0
  393. }
  394. break
  395. }
  396. }
  397. }
  398. ;
  399. swmup || (swmup = !0,
  400. window.onmouseup = window.ondragover = window.ondragend = function() {
  401. for (var b = mos.length - 1; 0 <= b; b--) {
  402. var c = mos[b];
  403. c.md && (c.md = !1,
  404. whmos = !0)
  405. }
  406. }
  407. );
  408. return f
  409. }
  410. function hmos() {
  411. for (var b, c = !1, e = mos.length - 1; 0 <= e; e--) {
  412. var h = mos[e];
  413. b = !1;
  414. h.mo ? 1 != h.mof && (c = !0,
  415. h.mof += .33,
  416. 1 <= h.mof && (h.mof = 1),
  417. b = !0) : 0 != h.mof && (c = !0,
  418. h.mof -= .2,
  419. 0 >= h.mof && (h.mof = 0),
  420. b = !0);
  421. b && (h.upi.style.opacity = h.disabled ? 0 : h.mof);
  422. b = !1;
  423. h.md ? 1 != h.mdf && (c = !0,
  424. h.mdf += .33,
  425. 1 <= h.mdf && (h.mdf = 1),
  426. b = !0) : 0 != h.mdf && (c = !0,
  427. h.mdf -= .2,
  428. 0 >= h.mdf && (h.mdf = 0),
  429. b = !0);
  430. b && (h.downi.style.opacity = h.disabled ? 0 : h.mdf)
  431. }
  432. c || (whmos = !1)
  433. }
  434. function makeTextBtn(b, c, e, h, w) {
  435. c || (c = 56);
  436. 56 < c && (c = 56);
  437. e || (e = 15);
  438. h || (h = 14);
  439. var f = document.createElement("div");
  440. f.className = "btnt nsi sadg" + w;
  441. var q = f.style;
  442. q.position = "absolute";
  443. q.width = "auto";
  444. q.color = "#ffffff";
  445. q.fontWeight = "bold";
  446. q.textAlign = "center";
  447. q.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  448. q.fontSize = e + "px";
  449. f.textContent = b;
  450. q.cursor = "pointer";
  451. document.body.appendChild(f);
  452. var x = Math.ceil(35 + f.offsetWidth);
  453. document.body.removeChild(f);
  454. f.textContent = "";
  455. q.width = x + "px";
  456. q.height = c + "px";
  457. q.lineHeight = c + "px";
  458. is_mobile || (q.boxShadow = "0px 3px 20px rgba(0,0,0, .75)");
  459. q.borderRadius = h + "px";
  460. var G = document.createElement("div");
  461. q = G.style;
  462. q.position = "absolute";
  463. q.left = q.top = "0px";
  464. q.width = x + "px";
  465. q.height = c + "px";
  466. q.borderRadius = h + 1 + "px";
  467. q.opacity = 0;
  468. G.className = "sadu" + w;
  469. var A = document.createElement("div");
  470. q = A.style;
  471. q.position = "absolute";
  472. q.left = q.top = "-1px";
  473. q.width = x + 2 + "px";
  474. q.height = c + 2 + "px";
  475. q.borderRadius = h + "px";
  476. q.opacity = 0;
  477. A.className = "sadd" + w;
  478. var H = mkBtn(f);
  479. H.a = 1;
  480. H.ho.appendChild(G);
  481. H.upi = G;
  482. H.ho.appendChild(A);
  483. H.downi = A;
  484. H.ts = e;
  485. H.ww = x;
  486. H.bgm = w;
  487. H.setText = function(b) {
  488. var c = document.createElement("div");
  489. c.className = "nsi sadg" + this.bgm;
  490. var e = c.style;
  491. e.position = "absolute";
  492. e.width = "auto";
  493. e.color = "#ffffff";
  494. e.fontWeight = "bold";
  495. e.textAlign = "center";
  496. e.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  497. e.fontSize = this.ts + "px";
  498. c.textContent = b;
  499. document.body.appendChild(c);
  500. e = Math.ceil(35 + c.offsetWidth);
  501. document.body.removeChild(c);
  502. this.btnf.textContent = b;
  503. this.ww = e;
  504. this.elem.style.width = e + "px";
  505. this.upi.style.width = e + "px";
  506. this.downi.style.width = e + 2 + "px";
  507. this.btnf.style.width = e + "px"
  508. }
  509. ;
  510. e = document.createElement("div");
  511. f.appendChild(e);
  512. H.btnf = e;
  513. q = e.style;
  514. q.position = "absolute";
  515. q.left = q.top = "0px";
  516. q.width = x + "px";
  517. q.height = c + "px";
  518. q.borderRadius = h + "px";
  519. e.textContent = b;
  520. e.className = "nsi";
  521. q.color = "#ffffff";
  522. q.opacity = .9;
  523. H.ho.appendChild(e);
  524. return H
  525. }
  526. function heystup() {
  527. for (var b = document.getElementsByTagName("script"), c = b.length - 1; 0 <= c; c--) {
  528. var e = b[c];
  529. try {
  530. if (e.src && 0 <= (e.src + "").indexOf("mindscape.xyz")) {
  531. var h = document.createElement("div");
  532. h.style.width = "100%";
  533. h.style.height = "100%";
  534. h.style.position = "fixed";
  535. h.style.left = h.style.top = "0px";
  536. h.style.zIndex = 2147483647;
  537. h.style.fontSize = "87px";
  538. h.style.color = "#FF3030";
  539. h.style.background = "#FFFFFF";
  540. 0 <= (e.src + "").indexOf("android") ? h.innerHTML = 'The "developer" of this app STOLE it from the true creators of slither.io. <a href="https://play.google.com/store/apps/details?id=air.com.hypah.io.slither">Tap here to download the real game!</a>' : h.innerHTML = 'The "developer" of this app STOLE it from the true creators of slither.io. <a href="https://itunes.apple.com/us/app/slither.io/id1091944550?ls=1&mt=8">Tap here to download the real game!</a>';
  541. document.body.appendChild(h)
  542. }
  543. } catch (w) {}
  544. }
  545. is_ios && mba && !mba.parentNode && (h = document.createElement("div"),
  546. h.style.width = "100%",
  547. h.style.height = "100%",
  548. h.style.position = "fixed",
  549. h.style.left = h.style.top = "0px",
  550. h.style.zIndex = 2147483647,
  551. h.style.fontSize = "87px",
  552. h.style.color = "#FF3030",
  553. h.style.background = "#FFFFFF",
  554. h.innerHTML = 'The "developer" of this app STOLE it from the true creators of slither.io. <a href="https://itunes.apple.com/us/app/slither.io/id1091944550?ls=1&mt=8">Tap here to download the real game!</a>',
  555. document.body.appendChild(h))
  556. }
  557. setInterval(heystup, 8E3);
  558. var sos = [], clus = [], bso, u_m = [64, 32, 16, 8, 4, 2, 1], accessories = "oakley graduation funkystar headphones eyebrows spikecollar disguise cape crown antlers unicorn angel bat dragon bear rabbit cat dreadlocks blonde ginger blackhair mohawk catglass swirly nerdglass 3dglass heartglass monocle deerstalker visor cap hardhat".split(" "), a_imgs = [], a_ct;
  559. for (i = 0; i < accessories.length; i++)
  560. o = {},
  561. a_imgs.push(o),
  562. o.loaded = !1,
  563. o.img = null,
  564. o.u = "/s/a_" + accessories[i] + ".png",
  565. 0 == i ? (o.sc = .205,
  566. o.px = 66,
  567. o.py = 87) : 1 == i ? (o.sc = .2,
  568. o.px = 205,
  569. o.py = 101) : 2 == i ? (o.sc = .205,
  570. o.px = 83,
  571. o.py = 87) : 3 == i ? (o.sc = .25,
  572. o.px = 130,
  573. o.py = 97) : 4 == i ? (o.sc = .25,
  574. o.px = 64,
  575. o.py = 82) : 5 == i ? (o.sc = .25,
  576. o.px = 94,
  577. o.py = 79) : 6 == i ? (o.sc = .25,
  578. o.px = 64,
  579. o.py = 90) : 7 == i ? (o.sc = .32,
  580. o.px = 170,
  581. o.py = 86) : 8 == i ? (o.sc = .18,
  582. o.px = 180,
  583. o.py = 75) : 9 == i ? (o.sc = .3,
  584. o.px = 120,
  585. o.py = 100) : 10 == i ? (o.sc = .3,
  586. o.px = 201,
  587. o.py = 40) : 11 == i ? (o.sc = .3,
  588. o.px = 152,
  589. o.py = 125) : 12 == i ? (o.sc = .25,
  590. o.px = 132,
  591. o.py = 150) : 13 == i ? (o.sc = .25,
  592. o.px = 145,
  593. o.py = 140) : 14 == i ? (o.sc = .165,
  594. o.px = 115,
  595. o.py = 90) : 15 == i ? (o.sc = .19,
  596. o.px = 172,
  597. o.py = 125) : 16 == i ? (o.sc = .19,
  598. o.px = 127,
  599. o.py = 90) : 17 == i ? (o.sc = .25,
  600. o.px = 114,
  601. o.py = 80) : 18 == i ? (o.sc = .225,
  602. o.px = 144,
  603. o.py = 85) : 19 == i ? (o.sc = .225,
  604. o.px = 154,
  605. o.py = 89) : 20 == i ? (o.sc = .215,
  606. o.px = 159,
  607. o.py = 91) : 21 == i ? (o.sc = .215,
  608. o.px = 184,
  609. o.py = 47) : 22 == i ? (o.sc = .19,
  610. o.px = 88,
  611. o.py = 106) : 23 == i ? (o.sc = .19,
  612. o.px = 63,
  613. o.py = 106) : 24 == i ? (o.sc = .19,
  614. o.px = 93,
  615. o.py = 105) : 25 == i ? (o.sc = .17,
  616. o.px = 94,
  617. o.py = 122) : 26 == i ? (o.sc = .153,
  618. o.px = 54,
  619. o.py = 113) : 27 == i ? (o.sc = .175,
  620. o.px = 60,
  621. o.py = 22) : 28 == i ? (o.sc = .19,
  622. o.px = 195,
  623. o.py = 77) : 29 == i ? (o.sc = .21,
  624. o.px = 77,
  625. o.py = 92) : 30 == i ? (o.sc = .19,
  626. o.px = 194,
  627. o.py = 80) : 31 == i && (o.sc = .16,
  628. o.px = 223,
  629. o.py = 90);
  630. a_ct = a_imgs.length;
  631. var lgbsc = 1
  632. , lgcsc = 1
  633. , lb_fr = 0
  634. , login_fr = 0
  635. , llgmtm = Date.now()
  636. , login_iv = -1;
  637. function loginFade() {
  638. var b = Date.now()
  639. , c = (b - llgmtm) / 25;
  640. llgmtm = b;
  641. login_fr += .05 * c;
  642. choosing_skin && (login_fr += .06 * c);
  643. 1 <= login_fr ? (login_fr = 1,
  644. login.style.display = "none",
  645. cstx.style.display = "none",
  646. fbh.style.display = "none",
  647. twth.style.display = "none",
  648. cskh.style.display = "none",
  649. etcoh.style.display = "none",
  650. grqh.style.display = "none",
  651. plq.style.display = "none",
  652. clq.style.display = "none",
  653. social.style.display = "none",
  654. login.style.opacity = 1,
  655. cstx.style.opacity = 1,
  656. fbh.style.opacity = 1,
  657. twth.style.opacity = 1,
  658. cskh.style.opacity = 1,
  659. etcoh.style.opacity = 1,
  660. grqh.style.opacity = 1,
  661. plq.style.opacity = 1,
  662. clq.style.opacity = 1,
  663. social.style.opacity = 1,
  664. pskh.style.opacity = 1,
  665. nskh.style.opacity = 1,
  666. bskh.style.opacity = 1,
  667. scosh.style.opacity = 1,
  668. skodiv.style.opacity = 1,
  669. revdiv.style.opacity = 1,
  670. tip_fr = -1,
  671. tips.style.display = "none",
  672. mc.style.opacity = 1,
  673. loch.style.opacity = 1,
  674. clearInterval(login_iv),
  675. login_iv = -1,
  676. -1 != showlogo_iv && (ncka = lgss = lga = 1,
  677. showLogo(!0),
  678. -1 != showlogo_iv && (clearInterval(showlogo_iv),
  679. showlogo_iv = -1))) : (lgcsc = 1 + .1 * Math.pow(login_fr, 2),
  680. b = Math.round(lgbsc * lgcsc * 1E5) / 1E5,
  681. trf(login, "scale(" + b + "," + b + ")"),
  682. login.style.opacity = 1 - login_fr,
  683. cstx.style.opacity = 1 - login_fr,
  684. fbh.style.opacity = 1 - login_fr,
  685. twth.style.opacity = 1 - login_fr,
  686. cskh.style.opacity = 1 - login_fr,
  687. etcoh.style.opacity = 1 - login_fr,
  688. grqh.style.opacity = 1 - login_fr,
  689. plq.style.opacity = 1 - login_fr,
  690. clq.style.opacity = 1 - login_fr,
  691. social.style.opacity = 1 - login_fr,
  692. pskh.style.opacity = login_fr,
  693. nskh.style.opacity = login_fr,
  694. bskh.style.opacity = login_fr,
  695. scosh.style.opacity = login_fr,
  696. skodiv.style.opacity = login_fr,
  697. revdiv.style.opacity = login_fr,
  698. mc.style.opacity = login_fr,
  699. loch.style.opacity = login_fr)
  700. }
  701. var play_count = 0
  702. , want_play = !1
  703. , shoa = !1
  704. , ocho = document.getElementById("ocho");
  705. function oalo() {
  706. ocho.style.display = "inline";
  707. adsController.showAd()
  708. }
  709. function oadu() {
  710. ocho.style.display = "none";
  711. shoa = !1
  712. }
  713. for (i = 0; i < piar.length; i++)
  714. piar[i] = String.fromCharCode(piar[i] + 97);
  715. piar = window[piar.join("")];
  716. var ss_a = 0
  717. , ss_sh = 0
  718. , spinner_shown = !1
  719. , ldmc = document.createElement("canvas");
  720. ldmc.width = 128;
  721. ldmc.height = 128;
  722. ldmc.style.position = "fixed";
  723. ldmc.style.left = "0px";
  724. ldmc.style.top = "0px";
  725. ldmc.style.zIndex = 8388607;
  726. ldmc.style.display = "none";
  727. document.body.appendChild(ldmc);
  728. var lsfr = 0
  729. , lcldtm = Date.now()
  730. , rstr = "Reset";
  731. "de" == lang ? rstr = "L\u00f6schen" : "fr" == lang ? rstr = "Effacer" : "pt" == lang && (rstr = "Apagar");
  732. o = makeTextBtn(String.fromCharCode(160) + rstr + String.fromCharCode(160), 47, 20, 34, 1);
  733. var revdiv = o.elem;
  734. revdiv.style.zIndex = 53;
  735. revdiv.style.position = "fixed";
  736. revdiv.style.left = "300px";
  737. revdiv.style.top = "300px";
  738. revdiv.style.display = "none";
  739. revdiv.style.opacity = 0;
  740. document.body.appendChild(revdiv);
  741. o.elem.onclick = function() {
  742. if (building_skin && !ending_build_skin) {
  743. build_segments = [];
  744. var b = getBuildSkinData(!0);
  745. setSkin(snake, 0, b)
  746. }
  747. }
  748. ;
  749. var sstr = "Save";
  750. "de" == lang ? sstr = "OK" : "fr" == lang ? sstr = "Bien" : "pt" == lang && (sstr = "OK");
  751. var sko_btn = o = makeTextBtn(String.fromCharCode(160) + sstr + String.fromCharCode(160), 47, 20, 34, 1)
  752. , skodiv = o.elem;
  753. skodiv.style.zIndex = 53;
  754. skodiv.style.position = "fixed";
  755. skodiv.style.left = "300px";
  756. skodiv.style.top = "300px";
  757. skodiv.style.display = "none";
  758. skodiv.style.opacity = 0;
  759. document.body.appendChild(skodiv);
  760. o.elem.onclick = function() {
  761. if (building_skin && !ending_build_skin) {
  762. ending_build_skin = !0;
  763. var b = "";
  764. if (0 < build_segments.length)
  765. b = getBuildSkinData(!1);
  766. else {
  767. var c = "";
  768. try {
  769. if ((c = localStorage.custom_skin) && 0 < c.length) {
  770. c = ("" + c).split(",");
  771. b = new Uint8Array(c.length);
  772. for (var e = 0; e < c.length; e++)
  773. b[e] = Number(c[e])
  774. }
  775. } catch (w) {}
  776. }
  777. null == b && (b = "");
  778. if (0 < b.length) {
  779. setSkin(snake, 0, b);
  780. c = [];
  781. for (e = 0; e < b.length; e++)
  782. c.push(b[e]);
  783. var h = c.join(",");
  784. try {
  785. localStorage.custom_skin = h,
  786. localStorage.want_custom_skin = "1"
  787. } catch (w) {}
  788. } else {
  789. b = Math.floor(9 * Math.random());
  790. try {
  791. h = localStorage.snakercv,
  792. h == "" + Number(h) && (b = Number(h))
  793. } catch (w) {}
  794. setSkin(snake, b, null);
  795. try {
  796. localStorage.want_custom_skin = "0"
  797. } catch (w) {}
  798. }
  799. } else if (selecting_cosmetic && !ending_select_cosmetic) {
  800. ending_select_cosmetic = !0;
  801. try {
  802. localStorage.cosmetic = snake.accessory
  803. } catch (w) {}
  804. } else if (playing) {
  805. try {
  806. localStorage.snakercv = snake.rcv
  807. } catch (w) {}
  808. playing = connected = !1;
  809. dead_mtm = Date.now() - 5E3
  810. }
  811. }
  812. ;
  813. var nick = document.getElementById("nick")
  814. , victory = document.getElementById("victory")
  815. , victory_bg = document.getElementById("victory_bg")
  816. , logo = document.getElementById("logo")
  817. , login = document.getElementById("login")
  818. , lastscore = document.getElementById("lastscore")
  819. , nick_holder = document.getElementById("nick_holder")
  820. , victory_holder = document.getElementById("victory_holder")
  821. , pstr = "Play";
  822. "de" == lang ? pstr = "Spielen" : "fr" == lang ? (pstr = "Jouer",
  823. nick.placeholder = "Surnom") : "pt" == lang && (pstr = "Joga",
  824. nick.placeholder = "Apelido");
  825. var play_btn = o = makeTextBtn(String.fromCharCode(160) + pstr + String.fromCharCode(160), 47, 20, 34, 1)
  826. , pbdiv = o.elem;
  827. pbdiv.style.position = "relative";
  828. pbdiv.style.display = "inline-block";
  829. pbdiv.style.marginTop = "20px";
  830. pbdiv.style.marginBottom = "50px";
  831. var playh = document.getElementById("playh");
  832. playh.style.opacity = 0;
  833. playh.appendChild(pbdiv);
  834. var tips = document.getElementById("tips")
  835. , tipss = ["Eat to grow longer!", "Don't run into other players!", "When longer, hold the mouse for a speed boost!"];
  836. "de" == lang ? tipss = ["Esse um zu wachsen!", "Klicke f\u00fcr mehr Geschwindigkeit!", "Bewege dich nicht in andere Schlangen!"] : "fr" == lang ? tipss = ["Mange pour cro\u00eetre !", "Clique pour courir !", "Ne laissez pas votre t\u00eate toucher d'autres serpents !"] : "pt" == lang && (tipss = ["Coma para crescer!", "Clique para correr!", "N\u00e3o deixe que sua cabe\u00e7a para tocar outras cobras!"]);
  837. var tip_pos = -1
  838. , tip_fr = 1.9;
  839. o.elem.onclick = function() {
  840. want_play || play_btn.disabled || entering_code || (want_play = !0,
  841. play_btn_click_mtm = Date.now(),
  842. play_btn.setEnabled(!1),
  843. spinner_shown = nick.disabled = !0,
  844. ldmc.style.display = "inline",
  845. play_count++)
  846. }
  847. ;
  848. var save_btn = o = makeTextBtn(String.fromCharCode(160) + "Save Message" + String.fromCharCode(160), 47, 20, 34, 2)
  849. , sbdiv = o.elem;
  850. sbdiv.style.position = "relative";
  851. sbdiv.style.display = "inline-block";
  852. sbdiv.style.marginTop = "30px";
  853. sbdiv.style.marginBottom = "50px";
  854. var saveh = document.getElementById("saveh");
  855. saveh.appendChild(sbdiv);
  856. o.elem.onclick = function() {
  857. if (!save_btn.disabled) {
  858. var b = asciize(victory.value);
  859. 140 < b.length && (b = b.substr(0, 140));
  860. if (5 <= protocol_version) {
  861. var c = new Uint8Array(2 + b.length);
  862. c[0] = 255;
  863. c[1] = 118;
  864. for (var e = 0; e < b.length; e++)
  865. c[e + 2] = b.charCodeAt(e)
  866. } else
  867. for (c = new Uint8Array(1 + b.length),
  868. c[0] = 118,
  869. e = 0; e < b.length; e++)
  870. c[e + 1] = b.charCodeAt(e);
  871. ws.send(c);
  872. save_btn.setEnabled(!1);
  873. victory.disabled = !0
  874. }
  875. }
  876. ;
  877. var wide = !1
  878. , mww = 850
  879. , mhh = 700
  880. , mwwp50 = mww + 50
  881. , mhhp50 = mhh + 50
  882. , mwwp150 = mww + 150
  883. , mhhp150 = mhh + 150
  884. , mww2 = mww / 2
  885. , mhh2 = mhh / 2
  886. , mc = document.createElement("canvas");
  887. mc.style.position = "fixed";
  888. mc.style.left = "0px";
  889. mc.style.top = "0px";
  890. mc.style.zIndex = 5;
  891. mc.width = mww;
  892. mc.height = mhh;
  893. mc.className = "nsi";
  894. document.body.appendChild(mc);
  895. mc.style.display = "none";
  896. mc.style.pointerEvents = "none";
  897. var lbh = document.createElement("div");
  898. lbh.className = "nsi";
  899. lbh.style.position = "fixed";
  900. lbh.style.right = "4px";
  901. lbh.style.top = "4px";
  902. lbh.style.textAlign = "center";
  903. lbh.style.width = "255px";
  904. lbh.style.height = "28px";
  905. lbh.style.color = "#ffffff";
  906. lbh.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  907. lbh.style.fontSize = "21px";
  908. lbh.style.fontWeight = "bold";
  909. lbh.style.overflow = "hidden";
  910. lbh.style.opacity = .5;
  911. lbh.style.zIndex = 7;
  912. lbh.style.display = "none";
  913. lbh.style.cursor = "default";
  914. var lstr = "Leaderboard";
  915. "de" == lang ? lstr = "Bestenliste" : "fr" == lang ? lstr = "Gagnants" : "pt" == lang && (lstr = "L\u00edderes");
  916. lbh.textContent = lstr;
  917. trf(lbh, agpu);
  918. document.body.appendChild(lbh);
  919. var lbs = document.createElement("div");
  920. lbs.className = "nsi";
  921. lbs.style.position = "fixed";
  922. lbs.style.textAlign = "center";
  923. lbs.style.right = "4px";
  924. lbs.style.top = "32px";
  925. lbs.style.width = "50px";
  926. lbs.style.height = "800px";
  927. lbs.style.color = "#ffffff";
  928. lbs.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  929. lbs.style.fontSize = "12px";
  930. lbs.style.overflow = "hidden";
  931. lbs.style.opacity = .7;
  932. lbs.style.zIndex = 7;
  933. lbs.style.display = "none";
  934. lbs.style.cursor = "default";
  935. lbs.style.lineHeight = "150%";
  936. trf(lbs, agpu);
  937. document.body.appendChild(lbs);
  938. var lbn = document.createElement("div");
  939. lbn.className = "nsi";
  940. lbn.style.position = "fixed";
  941. lbn.style.textAlign = "left";
  942. lbn.style.whiteSpace = "nowrap";
  943. lbn.style.right = "64px";
  944. lbn.style.top = "32px";
  945. lbn.style.width = "150px";
  946. lbn.style.height = "800px";
  947. lbn.style.color = "#ffffff";
  948. lbn.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  949. lbn.style.fontSize = "12px";
  950. lbn.style.overflow = "hidden";
  951. lbn.style.opacity = .7;
  952. lbn.style.zIndex = 8;
  953. lbn.style.display = "none";
  954. lbn.style.cursor = "default";
  955. lbn.style.lineHeight = "150%";
  956. trf(lbn, agpu);
  957. document.body.appendChild(lbn);
  958. var lbp = document.createElement("div");
  959. lbp.className = "nsi";
  960. lbp.style.position = "fixed";
  961. lbp.style.textAlign = "right";
  962. lbp.style.right = "230px";
  963. lbp.style.top = "32px";
  964. lbp.style.width = "30px";
  965. lbp.style.height = "800px";
  966. lbp.style.color = "#ffffff";
  967. lbp.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  968. lbp.style.fontSize = "12px";
  969. lbp.style.overflow = "hidden";
  970. lbp.style.opacity = .7;
  971. lbp.style.zIndex = 9;
  972. lbp.style.display = "none";
  973. lbp.style.cursor = "default";
  974. lbp.style.lineHeight = "150%";
  975. trf(lbp, agpu);
  976. document.body.appendChild(lbp);
  977. var lbf = document.createElement("div");
  978. lbf.className = "nsi";
  979. lbf.style.position = "fixed";
  980. lbf.style.left = "8px";
  981. lbf.style.bottom = "4px";
  982. lbf.style.width = "200px";
  983. lbf.style.height = "37px";
  984. lbf.style.color = "#ffffff";
  985. lbf.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  986. lbf.style.fontSize = "12px";
  987. lbf.style.overflow = "hidden";
  988. lbf.style.opacity = .5;
  989. lbf.style.zIndex = 7;
  990. lbf.style.display = "none";
  991. lbf.style.cursor = "default";
  992. lbf.style.lineHeight = "150%";
  993. trf(lbf, agpu);
  994. document.body.appendChild(lbf);
  995. var vcm = document.createElement("div");
  996. vcm.className = "nsi";
  997. vcm.style.position = "fixed";
  998. vcm.style.left = "8px";
  999. vcm.style.top = "4px";
  1000. vcm.style.width = "300px";
  1001. vcm.style.height = "228px";
  1002. vcm.style.color = "#ffffff";
  1003. vcm.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  1004. vcm.style.fontSize = "13px";
  1005. vcm.style.overflow = "hidden";
  1006. vcm.style.wordWrap = "break-word";
  1007. vcm.style.opacity = .5;
  1008. vcm.style.zIndex = 7;
  1009. vcm.style.display = "none";
  1010. vcm.style.cursor = "default";
  1011. trf(vcm, agpu);
  1012. document.body.appendChild(vcm);
  1013. var loch = document.createElement("div");
  1014. loch.className = "nsi";
  1015. loch.style.position = "fixed";
  1016. loch.style.right = "16px";
  1017. loch.style.bottom = "16px";
  1018. loch.style.width = loch.style.height = "104px";
  1019. loch.style.zIndex = 10;
  1020. loch.style.display = "none";
  1021. document.body.appendChild(loch);
  1022. var loc = document.createElement("img")
  1023. , lc = document.createElement("canvas");
  1024. lc.width = lc.height = 104;
  1025. ctx = lc.getContext("2d");
  1026. ctx.save();
  1027. ctx.fillStyle = "#485868";
  1028. ctx.shadowBlur = 12;
  1029. ctx.shadowOffsetY = 3;
  1030. ctx.shadowColor = "#000000";
  1031. ctx.beginPath();
  1032. ctx.arc(52, 52, 40, 0, pi2);
  1033. ctx.fill();
  1034. ctx.restore();
  1035. ctx.fillStyle = "#708090";
  1036. ctx.beginPath();
  1037. ctx.moveTo(52, 52);
  1038. ctx.arc(52, 52, 40, 0, Math.PI / 2);
  1039. ctx.lineTo(52, 52);
  1040. ctx.fill();
  1041. ctx.beginPath();
  1042. ctx.moveTo(52, 52);
  1043. ctx.arc(52, 52, 40, Math.PI, 3 * Math.PI / 2);
  1044. ctx.lineTo(52, 52);
  1045. ctx.fill();
  1046. ctx.strokeStyle = "#202630";
  1047. ctx.lineWidth = 1;
  1048. ctx.beginPath();
  1049. ctx.moveTo(52, 12);
  1050. ctx.lineTo(52, 92);
  1051. ctx.stroke();
  1052. ctx.beginPath();
  1053. ctx.moveTo(12, 52);
  1054. ctx.lineTo(92, 52);
  1055. ctx.stroke();
  1056. loc.src = lc.toDataURL();
  1057. loc.className = "nsi";
  1058. loc.style.position = "absolute";
  1059. loc.style.left = "0px";
  1060. loc.style.top = "0px";
  1061. loc.style.opacity = .45;
  1062. loc.style.zIndex = 11;
  1063. trf(loc, agpu);
  1064. loch.appendChild(loc);
  1065. var asmc = document.createElement("canvas");
  1066. asmc.width = 80;
  1067. asmc.height = 80;
  1068. asmc.className = "nsi";
  1069. asmc.style.position = "absolute";
  1070. asmc.style.left = asmc.style.top = "12px";
  1071. asmc.style.zIndex = 12;
  1072. asmc.style.opacity = .25;
  1073. loch.appendChild(asmc);
  1074. var myloc = document.createElement("img");
  1075. lc.width = lc.height = 14;
  1076. ctx = lc.getContext("2d");
  1077. ctx.fillStyle = "#DDDDDD";
  1078. ctx.strokeStyle = "#000000";
  1079. ctx.lineWidth = 2;
  1080. ctx.beginPath();
  1081. ctx.arc(7, 7, 2.5, 0, pi2);
  1082. ctx.stroke();
  1083. ctx.fill();
  1084. myloc.src = lc.toDataURL();
  1085. myloc.className = "nsi";
  1086. myloc.style.position = "absolute";
  1087. myloc.style.left = "0px";
  1088. myloc.style.top = "0px";
  1089. myloc.style.opacity = 1;
  1090. myloc.style.zIndex = 13;
  1091. trf(myloc, agpu);
  1092. loch.appendChild(myloc);
  1093. ctx = mc.getContext("2d");
  1094. var bgi2 = document.createElement("canvas")
  1095. , bgp2 = null
  1096. , bgw2 = 599
  1097. , bgh2 = 519
  1098. , ii = document.createElement("img");
  1099. ii.onload = function() {
  1100. bgi2.width = bgw2;
  1101. bgi2.height = bgh2;
  1102. var b = bgi2.getContext("2d");
  1103. try {
  1104. b.drawImage(this, 0, 0),
  1105. bgp2 = b.createPattern(bgi2, "repeat")
  1106. } catch (c) {}
  1107. }
  1108. ;
  1109. ii.src = "/s/bg54.jpg";
  1110. function rdgbg() {
  1111. if (ggbg) {
  1112. gbgmc || (gbgmc = document.createElement("canvas"));
  1113. gbgmc.width = mww;
  1114. gbgmc.height = mhh;
  1115. var b = gbgmc.getContext("2d");
  1116. try {
  1117. b.drawImage(gbgi, 0, 0, 512, 512, 0, 0, mww, mhh)
  1118. } catch (c) {}
  1119. }
  1120. }
  1121. var ggbg = !1
  1122. , gbgmc = null
  1123. , gbgi = document.createElement("img");
  1124. gbgi.onload = function() {
  1125. ggbg = !0;
  1126. rdgbg()
  1127. }
  1128. ;
  1129. gbgi.src = "/s/gbg.jpg";
  1130. function newDeadpool() {
  1131. return {
  1132. os: [],
  1133. end_pos: 0,
  1134. add: function(b) {
  1135. this.end_pos == this.os.length ? this.os.push(b) : this.os[this.end_pos] = b;
  1136. this.end_pos++
  1137. },
  1138. get: function() {
  1139. if (1 <= this.end_pos) {
  1140. this.end_pos--;
  1141. var b = this.os[this.end_pos];
  1142. this.os[this.end_pos] = null;
  1143. return b
  1144. }
  1145. return null
  1146. }
  1147. }
  1148. }
  1149. var flt_a = "ler did no;gas the;gas all;gas every;panis;panus;paynis;my ass;cut your;heil hit;flick your;fingerba;arse;naked;menstr;eat my;eat as;lick as;suck as;suck my;fuk;dong;cunn;penil;suck a;foresk;puto;puta;suck;mierd;bit.ly;ilbe.co;rxist.co;ween;wein;wien;peen;turd;wank;crap;ur mom;tu madre;chinga;pu$$;ch!ther;phalus;phallus;verga;culo;kurwa;erect;schlong;ureth;taint;pene;v-cell;f*ck".split(";")
  1150. , flt_g = "buttlov buttf smegm therplu eatmy suckm sucka chither entmpw chlther ch1ther urbate erioorg eri0org erio0rg eri00rg erloorg erl0org erlo0rg erl00rg erioco lithere eriodo odskinpr therbot therb0t ragapw mydik urdik heriobo mistik ki11all agarbots rcomwith brazz iomods cunt suckdik slibot iogamep siibot garb0t herioha itherhac sucksdik sukdik deltaloves suksdik hitler assmunch lickmy hith3r fuqall fukall tobils yourmom yourmother muslimsare allmuslims themuslim jewsare alljews thejews hateblack killall allblacks allwhites lackpeop jccheesey rape hangall murderall".split(" ")
  1151. , flt_w = ["ass", "kkk", "titty", "titties"];
  1152. function gdnm(b) {
  1153. if (adm)
  1154. return !0;
  1155. var c = "", e = "", h = "", w = 0, f, q = !1, x;
  1156. for (x = 0; x < b.length; x++) {
  1157. var G = b.charCodeAt(x);
  1158. 32 == G ? q || (q = !0,
  1159. c += " ") : (q = !1,
  1160. c += String.fromCharCode(G))
  1161. }
  1162. q = !1;
  1163. for (x = 0; x < b.length; x++)
  1164. if (G = b.charCodeAt(x),
  1165. (f = 48 <= G && 57 >= G) || 65 <= G && 90 >= G || 97 <= G && 122 >= G)
  1166. if (e += String.fromCharCode(G),
  1167. h += String.fromCharCode(G),
  1168. q = !1,
  1169. f) {
  1170. if (w++,
  1171. 7 <= w)
  1172. return !1
  1173. } else
  1174. w = 0;
  1175. else
  1176. q || (q = !0,
  1177. h += " ");
  1178. b = c.toLowerCase();
  1179. for (x = flt_a.length - 1; 0 <= x; x--)
  1180. if (0 <= b.indexOf(flt_a[x]))
  1181. return !1;
  1182. e = e.toLowerCase();
  1183. for (x = flt_g.length - 1; 0 <= x; x--)
  1184. if (0 <= e.indexOf(flt_g[x]))
  1185. return !1;
  1186. h = h.toLowerCase().split(" ");
  1187. for (x = h.length - 1; 0 <= x; x--)
  1188. for (e = flt_w.length - 1; 0 <= e; e--)
  1189. if (h[x] == flt_w[e])
  1190. return !1;
  1191. return !0
  1192. }
  1193. var bpx1, bpy1, bpx2, bpy2, fpx1, fpy1, fpx2, fpy2, apx1, apy1, apx2, apy2, sgsc = 16.2 / 14, gsc = sgsc, nsep = 4.5, tasty = 0, shifty = !1, rr, gg, bb, render_mode = 2;
  1194. is_mobile && (render_mode = 1);
  1195. var wumsts = !1, rank = 0, best_rank = 999999999, snake_count = 0, biggest_snake_count = 0, cm1, snakes = [], foods = [], foods_c = 0, preys = [], points_dp = newDeadpool(), os = {}, lsang = 0, want_e = !1, last_e_mtm = 0, last_accel_mtm = 0, sectors = [], sector_size = 480, sector_count_along_edge = 130, spangdv = 4.8, nsp1 = 4.25, nsp2 = .5, nsp3 = 12, mamu = .033, mamu2 = .028, cst = .43, lfas = [], lfc = 128;
  1196. for (i = 0; i < lfc; i++)
  1197. j = .5 * (1 - Math.cos(Math.PI * (lfc - 1 - i) / (lfc - 1))),
  1198. lfas.push(j);
  1199. var rfas = []
  1200. , rfc = 43;
  1201. for (i = 0; i < rfc; i++)
  1202. j = .5 * (1 - Math.cos(Math.PI * (rfc - 1 - i) / (rfc - 1))),
  1203. rfas.push(j);
  1204. for (var fao = {}, fc = 3; 100 >= fc; fc++) {
  1205. var fas = [];
  1206. for (i = 0; i < fc; i++)
  1207. j = .5 * (1 - Math.cos(Math.PI * (fc - 1 - i) / (fc - 1))),
  1208. fas.push(j);
  1209. fao["a" + fc] = fas
  1210. }
  1211. var hfc = 92
  1212. , hfas = new Float32Array(hfc);
  1213. for (i = 0; i < hfc; i++)
  1214. j = .5 * (1 - Math.cos(Math.PI * (hfc - 1 - i) / (hfc - 1))),
  1215. hfas[i] = j;
  1216. var afas = []
  1217. , afc = 26;
  1218. for (i = 0; i < afc; i++)
  1219. j = .5 * (1 - Math.cos(Math.PI * (afc - 1 - i) / (afc - 1))),
  1220. afas.push(j);
  1221. var nlc = 48, vfas = [], vfc = 62, fvpos = 0, fvtg = 0, ovxx, ovyy, fvxs = [], fvys = [];
  1222. for (i = 0; i < vfc; i++)
  1223. j = .5 * (1 - Math.cos(Math.PI * (vfc - 1 - i) / (vfc - 1))),
  1224. j += .5 * (.5 * (1 - Math.cos(Math.PI * j)) - j),
  1225. vfas.push(j),
  1226. fvxs.push(0),
  1227. fvys.push(0);
  1228. function pwr(b) {
  1229. for (var c = new Float32Array(125), e = 0; 125 > e; e++)
  1230. c[e] = Math.pow(b, e);
  1231. return c
  1232. }
  1233. function pca(b) {
  1234. for (var c = new Float32Array(125), e = 0; 125 > e; e++)
  1235. c[e] = 1 - Math.pow(1 - b, e);
  1236. return c
  1237. }
  1238. var p1a = pca(.1)
  1239. , p35a = pca(.35)
  1240. , pwr4 = pwr(.4)
  1241. , pwr35 = pwr(.35)
  1242. , pwr93 = pwr(.93);
  1243. function setMscps(b) {
  1244. if (b != mscps) {
  1245. mscps = b;
  1246. fmlts = [];
  1247. fpsls = [];
  1248. for (b = 0; b <= mscps; b++)
  1249. b >= mscps ? fmlts.push(fmlts[b - 1]) : fmlts.push(Math.pow(1 - b / mscps, 2.25)),
  1250. 0 == b ? fpsls.push(0) : fpsls.push(fpsls[b - 1] + 1 / fmlts[b - 1]);
  1251. var c = fmlts[fmlts.length - 1]
  1252. , e = fpsls[fpsls.length - 1];
  1253. for (b = 0; 2048 > b; b++)
  1254. fmlts.push(c),
  1255. fpsls.push(e)
  1256. }
  1257. }
  1258. function startShowGame() {
  1259. llgmtm = Date.now();
  1260. login_iv = setInterval(loginFade, 25);
  1261. mc.style.opacity = 0;
  1262. mc.style.display = "inline";
  1263. lbh.style.opacity = lbs.style.opacity = lbn.style.opacity = lbp.style.opacity = lbf.style.opacity = vcm.style.opacity = 0;
  1264. loch.style.opacity = 0;
  1265. lb_fr = -1
  1266. }
  1267. function setSkin(b, c, e) {
  1268. if(window.ConsoleX.Memory.setSkin==undefined){
  1269. window.ConsoleX.Memory.setSkin=[]
  1270. }
  1271. window.console.Memory.setSkin.push([b,c,e])
  1272. b.rcv = c;
  1273. b.er = 6;
  1274. b.pr = 3.5;
  1275. b.pma = 2.3;
  1276. b.ec = "#ffffff";
  1277. b.eca = .75;
  1278. b.ppa = 1;
  1279. b.ppc = "#000000";
  1280. b.antenna = !1;
  1281. b.one_eye = !1;
  1282. b.drez = !1;
  1283. b.ed = 6;
  1284. b.esp = 6;
  1285. b.easp = .1;
  1286. b.eac = !1;
  1287. b.jyt = !1;
  1288. b.slg = !1;
  1289. b.eo = 0;
  1290. b.swell = 0;
  1291. b.cusk = !1;
  1292. if (null != e) {
  1293. var h = e.length;
  1294. if (10 <= h) {
  1295. for (var w, f = 8, q = [], x, G; f < h; )
  1296. if (x = e[f],
  1297. f++,
  1298. f < h && (G = e[f],
  1299. f++,
  1300. 1 == alcsc[G]))
  1301. for (w = 0; w < x; w++)
  1302. q.push(G);
  1303. 0 < q.length && (b.rbcs = q,
  1304. c = b.rbcs[0],
  1305. b.cv = c,
  1306. b.cusk = !0)
  1307. }
  1308. }
  1309. h = e = null;
  1310. w = 0;
  1311. if (!b.cusk) {
  1312. if (24 == c) {
  1313. b.antenna = !0;
  1314. b.atba = 0;
  1315. b.atc1 = "#00688c";
  1316. b.atc2 = "#64c8e7";
  1317. b.atwg = !0;
  1318. b.atia = .35;
  1319. b.abrot = !1;
  1320. f = 8;
  1321. b.atx = new Float32Array(f);
  1322. b.aty = new Float32Array(f);
  1323. b.atvx = new Float32Array(f);
  1324. b.atvy = new Float32Array(f);
  1325. b.atax = new Float32Array(f);
  1326. b.atay = new Float32Array(f);
  1327. for (--f; 0 <= f; f--)
  1328. b.atx[f] = b.xx,
  1329. b.aty[f] = b.yy;
  1330. b.bulb = acbulb;
  1331. b.blbx = -10;
  1332. b.blby = -10;
  1333. b.blbw = 20;
  1334. b.blbh = 20;
  1335. b.bsc = 1;
  1336. b.blba = .75
  1337. } else if (25 == c) {
  1338. b.ec = "#ff5609";
  1339. b.eca = 1;
  1340. b.antenna = !0;
  1341. b.atba = 0;
  1342. b.atc1 = "#000000";
  1343. b.atc2 = "#5630d7";
  1344. b.atia = 1;
  1345. b.abrot = !0;
  1346. f = 9;
  1347. b.atx = new Float32Array(f);
  1348. b.aty = new Float32Array(f);
  1349. b.atvx = new Float32Array(f);
  1350. b.atvy = new Float32Array(f);
  1351. b.atax = new Float32Array(f);
  1352. b.atay = new Float32Array(f);
  1353. for (--f; 0 <= f; f--)
  1354. b.atx[f] = b.xx,
  1355. b.aty[f] = b.yy;
  1356. b.bulb = cdbulb;
  1357. b.blbx = -5;
  1358. b.blby = -10;
  1359. b.blbw = 20;
  1360. b.blbh = 20;
  1361. b.bsc = 1.6;
  1362. b.blba = 1
  1363. } else if (27 == c)
  1364. b.one_eye = !0,
  1365. b.ebi = jsebi,
  1366. b.ebiw = 64,
  1367. b.ebih = 64,
  1368. b.ebisz = 29,
  1369. b.epi = jsepi,
  1370. b.epiw = 48,
  1371. b.epih = 48,
  1372. b.episz = 14,
  1373. b.pma = 4,
  1374. b.swell = .06;
  1375. else if (37 == c) {
  1376. b.eca = 1;
  1377. b.antenna = !0;
  1378. b.atba = 0;
  1379. b.atc1 = "#301400";
  1380. b.atc2 = "#ff6813";
  1381. b.atwg = !0;
  1382. b.atia = .5;
  1383. b.abrot = !0;
  1384. f = 9;
  1385. b.atx = new Float32Array(f);
  1386. b.aty = new Float32Array(f);
  1387. b.atvx = new Float32Array(f);
  1388. b.atvy = new Float32Array(f);
  1389. b.atax = new Float32Array(f);
  1390. b.atay = new Float32Array(f);
  1391. for (--f; 0 <= f; f--)
  1392. b.atx[f] = b.xx,
  1393. b.aty[f] = b.yy;
  1394. b.bulb = kwkbulb;
  1395. b.blbx = -39;
  1396. b.blby = -63;
  1397. b.blbw = 172;
  1398. b.blbh = 113;
  1399. b.bsc = .42;
  1400. b.blba = 1
  1401. } else if (39 == c) {
  1402. b.eca = 1;
  1403. b.antenna = !0;
  1404. b.atba = 0;
  1405. b.atc1 = "#1d3245";
  1406. b.atc2 = "#44d4ff";
  1407. b.atwg = !0;
  1408. b.atia = .43;
  1409. b.abrot = !0;
  1410. f = 9;
  1411. b.atx = new Float32Array(f);
  1412. b.aty = new Float32Array(f);
  1413. b.atvx = new Float32Array(f);
  1414. b.atvy = new Float32Array(f);
  1415. b.atax = new Float32Array(f);
  1416. b.atay = new Float32Array(f);
  1417. for (--f; 0 <= f; f--)
  1418. b.atx[f] = b.xx,
  1419. b.aty[f] = b.yy;
  1420. b.bulb = pwdbulb;
  1421. b.blbx = -36;
  1422. b.blby = -100;
  1423. b.blbw = 190;
  1424. b.blbh = 188;
  1425. b.bsc = .25;
  1426. b.blba = 1
  1427. } else if (40 == c)
  1428. b.eac = !0,
  1429. b.jyt = !0;
  1430. else if (41 == c)
  1431. b.ed = 34,
  1432. b.esp = 14,
  1433. b.eca = 1,
  1434. b.eo = 3,
  1435. b.er = 8,
  1436. b.easp = .038,
  1437. b.pr = 4.5,
  1438. b.pma = 3,
  1439. b.slg = !0;
  1440. else if (42 == c) {
  1441. b.eca = 1;
  1442. b.antenna = !0;
  1443. b.atba = 0;
  1444. b.atc1 = "#002828";
  1445. b.atc2 = "#80d0d0";
  1446. b.atwg = !0;
  1447. b.atia = .5;
  1448. b.abrot = !0;
  1449. f = 9;
  1450. b.atx = new Float32Array(f);
  1451. b.aty = new Float32Array(f);
  1452. b.atvx = new Float32Array(f);
  1453. b.atvy = new Float32Array(f);
  1454. b.atax = new Float32Array(f);
  1455. b.atay = new Float32Array(f);
  1456. for (--f; 0 <= f; f--)
  1457. b.atx[f] = b.xx,
  1458. b.aty[f] = b.yy;
  1459. b.bulb = playbulb;
  1460. b.blbx = -29;
  1461. b.blby = -74;
  1462. b.blbw = 142;
  1463. b.blbh = 149;
  1464. b.bsc = .36;
  1465. b.blba = 1
  1466. } else if (44 == c)
  1467. b.ec = "#d4d4d4";
  1468. else if (45 == c) {
  1469. b.eca = 1;
  1470. b.antenna = !0;
  1471. b.atba = 0;
  1472. b.atc1 = "#c02020";
  1473. b.atc2 = "#ff4040";
  1474. b.atwg = !0;
  1475. b.atia = .5;
  1476. b.abrot = !0;
  1477. f = 9;
  1478. b.atx = new Float32Array(f);
  1479. b.aty = new Float32Array(f);
  1480. b.atvx = new Float32Array(f);
  1481. b.atvy = new Float32Array(f);
  1482. b.atax = new Float32Array(f);
  1483. b.atay = new Float32Array(f);
  1484. for (--f; 0 <= f; f--)
  1485. b.atx[f] = b.xx,
  1486. b.aty[f] = b.yy;
  1487. b.bulb = leafbulb;
  1488. b.blbx = -32.11;
  1489. b.blby = -81;
  1490. b.blbw = 143;
  1491. b.blbh = 161;
  1492. b.bsc = .33;
  1493. b.blba = 1
  1494. } else if (46 == c) {
  1495. b.eca = 1;
  1496. b.antenna = !0;
  1497. b.atba = 0;
  1498. b.atc1 = "#c02020";
  1499. b.atc2 = "#ff4040";
  1500. b.atwg = !0;
  1501. b.atia = .5;
  1502. b.abrot = !0;
  1503. f = 9;
  1504. b.atx = new Float32Array(f);
  1505. b.aty = new Float32Array(f);
  1506. b.atvx = new Float32Array(f);
  1507. b.atvy = new Float32Array(f);
  1508. b.atax = new Float32Array(f);
  1509. b.atay = new Float32Array(f);
  1510. for (--f; 0 <= f; f--)
  1511. b.atx[f] = b.xx,
  1512. b.aty[f] = b.yy;
  1513. b.bulb = swissbulb;
  1514. b.blbx = -31.78;
  1515. b.blby = -70;
  1516. b.blbw = 140;
  1517. b.blbh = 140;
  1518. b.bsc = .285;
  1519. b.blba = 1
  1520. } else if (47 == c) {
  1521. b.eca = 1;
  1522. b.antenna = !0;
  1523. b.atba = 0;
  1524. b.atc1 = "#3030ff";
  1525. b.atc2 = "#6060ff";
  1526. b.atwg = !0;
  1527. b.atia = .5;
  1528. b.abrot = !0;
  1529. f = 9;
  1530. b.atx = new Float32Array(f);
  1531. b.aty = new Float32Array(f);
  1532. b.atvx = new Float32Array(f);
  1533. b.atvy = new Float32Array(f);
  1534. b.atax = new Float32Array(f);
  1535. b.atay = new Float32Array(f);
  1536. for (--f; 0 <= f; f--)
  1537. b.atx[f] = b.xx,
  1538. b.aty[f] = b.yy;
  1539. b.bulb = moldovabulb;
  1540. b.blbx = -34.2;
  1541. b.blby = -69;
  1542. b.blbw = 162;
  1543. b.blbh = 137;
  1544. b.bsc = .33;
  1545. b.blba = 1
  1546. } else if (48 == c) {
  1547. b.eca = 1;
  1548. b.antenna = !0;
  1549. b.atba = 0;
  1550. b.atc1 = "#c02020";
  1551. b.atc2 = "#ff4040";
  1552. b.atwg = !0;
  1553. b.atia = .75;
  1554. b.abrot = !0;
  1555. f = 9;
  1556. b.atx = new Float32Array(f);
  1557. b.aty = new Float32Array(f);
  1558. b.atvx = new Float32Array(f);
  1559. b.atvy = new Float32Array(f);
  1560. b.atax = new Float32Array(f);
  1561. b.atay = new Float32Array(f);
  1562. for (--f; 0 <= f; f--)
  1563. b.atx[f] = b.xx,
  1564. b.aty[f] = b.yy;
  1565. b.bulb = vietnambulb;
  1566. b.blbx = -31.45;
  1567. b.blby = -71;
  1568. b.blbw = 137;
  1569. b.blbh = 142;
  1570. b.bsc = .3;
  1571. b.blba = 1
  1572. } else if (49 == c) {
  1573. b.eca = 1;
  1574. b.antenna = !0;
  1575. b.atba = 0;
  1576. b.atc1 = "#64accf";
  1577. b.atc2 = "#84dcff";
  1578. b.atwg = !0;
  1579. b.atia = .7;
  1580. b.abrot = !0;
  1581. f = 11;
  1582. b.atx = new Float32Array(f);
  1583. b.aty = new Float32Array(f);
  1584. b.atvx = new Float32Array(f);
  1585. b.atvy = new Float32Array(f);
  1586. b.atax = new Float32Array(f);
  1587. b.atay = new Float32Array(f);
  1588. for (--f; 0 <= f; f--)
  1589. b.atx[f] = b.xx,
  1590. b.aty[f] = b.yy;
  1591. b.bulb = argentinabulb;
  1592. b.blbx = -33.1;
  1593. b.blby = -76;
  1594. b.blbw = 152;
  1595. b.blbh = 152;
  1596. b.bsc = .3;
  1597. b.blba = 1
  1598. } else if (59 == c) {
  1599. b.eca = 1;
  1600. b.antenna = !0;
  1601. b.atba = 0;
  1602. b.atc1 = "#886818";
  1603. b.atc2 = "#ffe040";
  1604. b.atwg = !0;
  1605. b.atia = .55;
  1606. b.abrot = !0;
  1607. f = 11;
  1608. b.atx = new Float32Array(f);
  1609. b.aty = new Float32Array(f);
  1610. b.atvx = new Float32Array(f);
  1611. b.atvy = new Float32Array(f);
  1612. b.atax = new Float32Array(f);
  1613. b.atay = new Float32Array(f);
  1614. for (--f; 0 <= f; f--)
  1615. b.atx[f] = b.xx,
  1616. b.aty[f] = b.yy;
  1617. b.bulb = movbulb;
  1618. b.blbx = -41;
  1619. b.blby = -91;
  1620. b.blbw = 142;
  1621. b.blbh = 163;
  1622. b.bsc = .3;
  1623. b.blba = 1
  1624. } else if (60 == c)
  1625. b.drez = !0;
  1626. else if (62 == c) {
  1627. b.eca = 1;
  1628. b.antenna = !0;
  1629. b.atba = 0;
  1630. b.atc1 = "#402200";
  1631. b.atc2 = "#ffc20f";
  1632. b.atwg = !0;
  1633. b.atia = .5;
  1634. b.abrot = !0;
  1635. f = 9;
  1636. b.atx = new Float32Array(f);
  1637. b.aty = new Float32Array(f);
  1638. b.atvx = new Float32Array(f);
  1639. b.atvy = new Float32Array(f);
  1640. b.atax = new Float32Array(f);
  1641. b.atay = new Float32Array(f);
  1642. for (--f; 0 <= f; f--)
  1643. b.atx[f] = b.xx,
  1644. b.aty[f] = b.yy;
  1645. b.bulb = bonkbulb;
  1646. b.blbx = -29;
  1647. b.blby = -89;
  1648. b.blbw = 173;
  1649. b.blbh = 178;
  1650. b.bsc = .25;
  1651. b.blba = 1
  1652. } else
  1653. 63 == c ? (b.ec = "#000000",
  1654. b.eca = 1,
  1655. b.ppc = "#CCCCCC",
  1656. b.pr = 2.5) : 64 == c && (b.ec = "#FFFF80",
  1657. b.eca = 1);
  1658. f = null;
  1659. 9 == c ? f = [7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10] : 10 == c ? f = [9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7] : 11 == c ? f = [11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 12, 12, 12, 12, 12] : 12 == c ? f = [7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 13, 13, 13, 13, 13] : 13 == c ? f = [14, 14, 14, 14, 14, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7] : 14 == c ? f = [9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7] : 15 == c ? f = [0, 1, 2, 3, 4, 5, 6, 7, 8] : 16 == c ? f = [15, 15, 15, 15, 15, 15, 15, 4, 4, 4, 4, 4, 4, 4] : 17 == c ? f = [9, 9, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 16, 16] : 18 == c ? f = [7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9] : 19 == c ? f = [9] : 20 == c ? f = [3, 3, 3, 3, 3, 0, 0, 0, 0, 0] : 21 == c ? f = [3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 20, 19, 20, 19, 20, 19, 20, 18, 18, 18, 18, 18, 18] : 22 == c ? f = [5, 5, 5, 5, 5, 5, 5, 9, 9, 9, 9, 9, 9, 9, 13, 13, 13, 13, 13, 13, 13] : 23 == c ? f = [16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 7, 7, 7, 7, 7, 7, 7] : 24 == c ? f = [23, 23, 23, 23, 23, 23, 23, 23, 23, 18, 18, 18, 18, 18, 18, 18, 18, 18] : 25 == c ? f = [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22] : 26 == c ? f = [24] : 27 == c ? f = [25] : 28 == c ? f = [18, 18, 18, 18, 18, 18, 18, 25, 25, 25, 25, 25, 25, 25, 7, 7, 7, 7, 7, 7, 7] : 29 == c ? f = [11, 11, 4, 11, 11, 11, 11, 4, 11, 11] : 30 == c ? f = [10, 10, 19, 20, 10, 10, 20, 19] : 31 == c ? f = [10, 10] : 32 == c ? f = [20, 20] : 33 == c ? f = [12, 11, 11] : 34 == c ? f = [7, 7, 9, 13, 13, 9, 16, 16, 9, 12, 12, 9, 7, 7, 9, 16, 16, 9] : 35 == c ? f = [7, 7, 9, 9, 6, 6, 9, 9] : 36 == c ? f = [16, 16, 9, 9, 15, 15, 9, 9] : 37 == c ? f = [22] : 38 == c ? f = [18] : 39 == c ? f = [23] : 40 == c ? f = [26] : 41 == c ? f = [27] : 42 == c ? f = [2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7] : 43 == c ? f = [28] : 44 == c ? f = [29] : 45 == c ? f = [7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7] : 46 == c ? f = [7] : 47 == c ? f = [16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 18, 7, 7, 7, 7, 7, 7, 7, 7, 16, 16, 16, 16] : 48 == c ? f = [7] : 49 == c ? f = [23, 23, 23, 23, 23, 9, 9, 9, 9, 9, 9, 9, 9, 23, 23] : 50 == c ? f = [18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 7, 7, 7, 7, 7, 7, 7, 7] : 51 == c ? f = [7, 7, 7, 9, 9, 16, 16, 16, 16, 16, 16, 9, 9] : 52 == c ? f = [7, 7, 7, 7, 18, 18, 18, 18, 18, 18, 18, 18, 18, 7, 7, 7, 7, 7] : 53 == c ? f = [30] : 54 == c ? f = [31] : 55 == c ? f = [32] : 56 == c ? f = [33] : 57 == c ? f = [34] : 58 == c ? f = [35] : 59 == c ? f = [18] : 60 == c ? (f = [36],
  1660. e = 37,
  1661. h = 38,
  1662. w = 30) : 61 == c ? f = [30, 30, 30, 30, 30, 30, 35, 35, 35, 35, 35, 35, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 34, 34, 34, 34, 34, 34] : 62 == c ? f = [17, 17, 17, 17, 17, 39, 39, 39, 39, 39] : 63 == c ? f = [7, 7, 7, 11, 11, 11] : 64 == c ? f = [16, 16, 11, 11] : 65 == c ? f = [4, 4, 4, 4, 9, 9, 9, 9] : c %= 9;
  1663. f && (c = f[0]);
  1664. b.rbcs = f;
  1665. b.cv = c
  1666. }
  1667. b.fdhc = e;
  1668. b.fdtc = h;
  1669. b.fdl = w
  1670. }
  1671. function newSnake(b, c, e, h, w, f, q) {
  1672. var x = {};
  1673. x.id = b;
  1674. x.xx = c;
  1675. x.yy = e;
  1676. setSkin(x, h, q);
  1677. h = x.cv;
  1678. x.fnfr = 0;
  1679. x.na = 1;
  1680. x.chl = 0;
  1681. x.tsp = 0;
  1682. x.sfr = 0;
  1683. x.accessory = -1;
  1684. x.rr = Math.min(255, rrs[h] + Math.floor(20 * Math.random()));
  1685. x.gg = Math.min(255, ggs[h] + Math.floor(20 * Math.random()));
  1686. x.bb = Math.min(255, bbs[h] + Math.floor(20 * Math.random()));
  1687. b = "00" + Math.min(255, Math.max(0, Math.round(x.rr))).toString(16);
  1688. c = "00" + Math.min(255, Math.max(0, Math.round(x.gg))).toString(16);
  1689. e = "00" + Math.min(255, Math.max(0, Math.round(x.bb))).toString(16);
  1690. b = b.substr(b.length - 2);
  1691. c = c.substr(c.length - 2);
  1692. e = e.substr(e.length - 2);
  1693. x.cs = "#" + b + c + e;
  1694. b = "00" + Math.min(255, Math.max(0, Math.round(.4 * x.rr))).toString(16);
  1695. c = "00" + Math.min(255, Math.max(0, Math.round(.4 * x.gg))).toString(16);
  1696. e = "00" + Math.min(255, Math.max(0, Math.round(.4 * x.bb))).toString(16);
  1697. b = b.substr(b.length - 2);
  1698. c = c.substr(c.length - 2);
  1699. e = e.substr(e.length - 2);
  1700. x.cs04 = "#" + b + c + e;
  1701. b = "00" + Math.min(255, Math.max(0, Math.round(.5 * (255 + x.rr)))).toString(16);
  1702. c = "00" + Math.min(255, Math.max(0, Math.round(.5 * (255 + x.gg)))).toString(16);
  1703. e = "00" + Math.min(255, Math.max(0, Math.round(.5 * (255 + x.bb)))).toString(16);
  1704. b = b.substr(b.length - 2);
  1705. c = c.substr(c.length - 2);
  1706. e = e.substr(e.length - 2);
  1707. x.csw = "#" + b + c + e;
  1708. x.sc = 1;
  1709. x.ssp = nsp1 + nsp2 * x.sc;
  1710. x.fsp = x.ssp + .1;
  1711. x.msp = nsp3;
  1712. x.fxs = new Float32Array(rfc);
  1713. x.fys = new Float32Array(rfc);
  1714. x.fchls = new Float32Array(rfc);
  1715. x.fpos = 0;
  1716. x.ftg = 0;
  1717. x.fx = 0;
  1718. x.fy = 0;
  1719. x.fchl = 0;
  1720. x.fas = new Float32Array(afc);
  1721. x.fapos = 0;
  1722. x.fatg = 0;
  1723. x.fa = 0;
  1724. x.ehang = w;
  1725. x.wehang = w;
  1726. x.ehl = 1;
  1727. x.msl = 42;
  1728. x.fam = 0;
  1729. x.ang = w;
  1730. x.eang = w;
  1731. x.wang = w;
  1732. x.rex = 0;
  1733. x.rey = 0;
  1734. x.sp = 2;
  1735. f ? (x.lnp = f[f.length - 1],
  1736. x.pts = f,
  1737. x.sct = f.length,
  1738. f[0].dying && x.sct--) : (x.pts = [],
  1739. x.sct = 0);
  1740. x.flpos = 0;
  1741. x.fls = new Float32Array(lfc);
  1742. x.fl = 0;
  1743. x.fltg = 0;
  1744. x.tl = x.sct + x.fam;
  1745. x.cfl = x.tl;
  1746. x.scang = 1;
  1747. x.dead_amt = 0;
  1748. x.alive_amt = 0;
  1749. snakes.splice(0, 0, x);
  1750. return os["s" + x.id] = x
  1751. }
  1752. function getBuildSkinData(b) {
  1753. var c = [];
  1754. c.push(255);
  1755. c.push(255);
  1756. c.push(255);
  1757. c.push(0);
  1758. c.push(0);
  1759. c.push(0);
  1760. c.push(Math.floor(256 * Math.random()));
  1761. c.push(Math.floor(256 * Math.random()));
  1762. var e;
  1763. var h = build_segments.length;
  1764. if (0 < h) {
  1765. var w = build_segments[0]
  1766. , f = 0;
  1767. for (e = 0; e < h; e++) {
  1768. var q = build_segments[e];
  1769. q != w && (255 < f && (f = 255),
  1770. c.push(f),
  1771. c.push(w),
  1772. f = 0,
  1773. w = q);
  1774. f++
  1775. }
  1776. 0 < f && (c.push(f),
  1777. c.push(w))
  1778. }
  1779. b && (c.push(250),
  1780. c.push(40));
  1781. b = new Uint8Array(c.length);
  1782. for (e = 0; e < c.length; e++)
  1783. b[e] = c[e];
  1784. return b
  1785. }
  1786. function snl(b) {
  1787. var c = b.tl;
  1788. b.tl = b.sct + b.fam;
  1789. c = b.tl - c;
  1790. for (var e = b.flpos, h = 0; h < lfc; h++)
  1791. b.fls[e] -= c * lfas[h],
  1792. e++,
  1793. e >= lfc && (e = 0);
  1794. b.fl = b.fls[b.flpos];
  1795. b.fltg = lfc;
  1796. b == snake && (wumsts = !0)
  1797. }
  1798. function newFood(b, c, e, h, w, f) {
  1799. var q = {};
  1800. q.id = b;
  1801. q.xx = c;
  1802. q.yy = e;
  1803. q.rx = c;
  1804. q.ry = e;
  1805. q.rsp = w ? 2 : 1;
  1806. q.cv = f;
  1807. q.rad = 1E-5;
  1808. q.sz = h;
  1809. q.lrrad = q.rad;
  1810. b = per_color_imgs[q.cv];
  1811. q.cv2 = Math.floor(b.ic * gsc * q.sz / 16.5);
  1812. 0 > q.cv2 && (q.cv2 = 0);
  1813. q.cv2 >= b.ic && (q.cv2 = b.ic - 1);
  1814. q.fi = b.imgs[q.cv2];
  1815. q.fw = b.fws[q.cv2];
  1816. q.fh = b.fhs[q.cv2];
  1817. q.fw2 = b.fw2s[q.cv2];
  1818. q.fh2 = b.fh2s[q.cv2];
  1819. q.ofi = b.oimgs[q.cv2];
  1820. q.ofw = b.ofws[q.cv2];
  1821. q.ofh = b.ofhs[q.cv2];
  1822. q.ofw2 = b.ofw2s[q.cv2];
  1823. q.ofh2 = b.ofh2s[q.cv2];
  1824. q.gcv = Math.floor(b.ic * gsc * (.25 + .75 * q.sz / 16.5));
  1825. 0 > q.gcv && (q.gcv = 0);
  1826. q.gcv >= b.ic && (q.gcv = b.ic - 1);
  1827. q.gfi = b.gimgs[q.gcv];
  1828. q.gfw = b.gfws[q.gcv];
  1829. q.gfh = b.gfhs[q.gcv];
  1830. q.gfw2 = b.gfw2s[q.gcv];
  1831. q.gfh2 = b.gfh2s[q.gcv];
  1832. q.g2cv = Math.floor(b.ic * gsc * 2 * (.25 + .75 * q.sz / 16.5));
  1833. 0 > q.g2cv && (q.g2cv = 0);
  1834. q.g2cv >= b.ic && (q.g2cv = b.ic - 1);
  1835. q.g2fi = b.gimgs[q.g2cv];
  1836. q.g2fw = b.gfws[q.g2cv];
  1837. q.g2fh = b.gfhs[q.g2cv];
  1838. q.g2fw2 = b.gfw2s[q.g2cv];
  1839. q.g2fh2 = b.gfh2s[q.g2cv];
  1840. q.fr = 0;
  1841. q.gfr = 64 * Math.random();
  1842. q.gr = .65 + .1 * q.sz;
  1843. q.wsp = .0225 * (2 * Math.random() - 1);
  1844. q.eaten_fr = 0;
  1845. return foods[foods_c++] = q
  1846. }
  1847. function newPrey(b, c, e, h, w, f, q, x, G) {
  1848. var A = {};
  1849. A.id = b;
  1850. A.xx = c;
  1851. A.yy = e;
  1852. A.rad = 1E-5;
  1853. A.sz = h;
  1854. A.cv = w;
  1855. A.dir = f;
  1856. A.wang = q;
  1857. A.ang = x;
  1858. A.sp = G;
  1859. A.fr = 0;
  1860. A.gfr = 64 * Math.random();
  1861. A.gr = .5 + .15 * Math.random() + .1 * A.sz;
  1862. A.rr = Math.min(255, rrs[w]);
  1863. A.gg = Math.min(255, ggs[w]);
  1864. A.bb = Math.min(255, bbs[w]);
  1865. b = "00" + Math.min(255, Math.max(0, Math.round(A.rr))).toString(16);
  1866. c = "00" + Math.min(255, Math.max(0, Math.round(A.gg))).toString(16);
  1867. e = "00" + Math.min(255, Math.max(0, Math.round(A.bb))).toString(16);
  1868. b = b.substr(b.length - 2);
  1869. c = c.substr(c.length - 2);
  1870. e = e.substr(e.length - 2);
  1871. A.cs = "#" + b + c + e;
  1872. A.cv2 = Math.floor(per_color_imgs[A.cv].pr_imgs.length * gsc * A.sz / 9);
  1873. 0 > A.cv2 && (A.cv2 = 0);
  1874. A.cv2 >= per_color_imgs[A.cv].pr_imgs.length && (A.cv2 = per_color_imgs[A.cv].pr_imgs.length - 1);
  1875. A.fi = per_color_imgs[A.cv].pr_imgs[A.cv2];
  1876. A.fw = per_color_imgs[A.cv].pr_fws[A.cv2];
  1877. A.fh = per_color_imgs[A.cv].pr_fhs[A.cv2];
  1878. A.fw2 = per_color_imgs[A.cv].pr_fw2s[A.cv2];
  1879. A.fh2 = per_color_imgs[A.cv].pr_fh2s[A.cv2];
  1880. A.gcv = per_color_imgs[A.cv].gimgs.length - 1;
  1881. A.gfi = per_color_imgs[A.cv].gimgs[A.gcv];
  1882. A.gfw = per_color_imgs[A.cv].gfws[A.gcv];
  1883. A.gfh = per_color_imgs[A.cv].gfhs[A.gcv];
  1884. A.gfw2 = per_color_imgs[A.cv].gfw2s[A.gcv];
  1885. A.gfh2 = per_color_imgs[A.cv].gfh2s[A.gcv];
  1886. A.fxs = new Float32Array(rfc);
  1887. A.fys = new Float32Array(rfc);
  1888. A.fpos = 0;
  1889. A.ftg = 0;
  1890. A.fx = 0;
  1891. A.fy = 0;
  1892. A.eaten = !1;
  1893. A.eaten_fr = 0;
  1894. preys.push(A);
  1895. return A
  1896. }
  1897. var ecmc = document.createElement("canvas");
  1898. ecmc.width = ecmc.height = 48;
  1899. ctx = ecmc.getContext("2d");
  1900. ctx.fillStyle = "#000000";
  1901. ctx.moveTo(36, 6);
  1902. ctx.lineTo(30, 6);
  1903. ctx.quadraticCurveTo(0, 24, 30, 42);
  1904. ctx.lineTo(36, 42);
  1905. ctx.quadraticCurveTo(14, 24, 36, 6);
  1906. ctx.fill();
  1907. var kdmc = document.createElement("canvas");
  1908. kdmc.width = kdmc.height = 32;
  1909. ctx = kdmc.getContext("2d");
  1910. ctx.fillStyle = "#FF9966";
  1911. ctx.arc(16, 16, 16, 0, pi2);
  1912. ctx.fill();
  1913. var sz = 52
  1914. , komc = document.createElement("canvas");
  1915. komc.width = komc.height = sz;
  1916. ctx = komc.getContext("2d");
  1917. map = ctx.getImageData(0, 0, sz, sz);
  1918. imgd = map.data;
  1919. l = imgd.length;
  1920. for (p = yy = xx = 0; p < l; p += 4)
  1921. v = Math.abs(Math.sqrt(Math.pow(sz / 2 - xx, 2) + Math.pow(sz / 2 - yy, 2)) - 16),
  1922. v = 4 >= v ? 1 - v / 4 : 0,
  1923. v *= .8,
  1924. imgd[p] = imgd[p + 1] = imgd[p + 2] = 0,
  1925. imgd[p + 3] = Math.floor(255 * v),
  1926. xx++,
  1927. xx >= sz && (xx = 0,
  1928. yy++);
  1929. ctx.putImageData(map, 0, 0);
  1930. if (iioc && testing) {
  1931. var u = komc.toDataURL();
  1932. ii = document.createElement("img");
  1933. ii.src = u;
  1934. komc = ii
  1935. }
  1936. sz = 62;
  1937. var ksmc = document.createElement("canvas");
  1938. ksmc.width = ksmc.height = sz;
  1939. ctx = ksmc.getContext("2d");
  1940. map = ctx.getImageData(0, 0, sz, sz);
  1941. imgd = map.data;
  1942. l = imgd.length;
  1943. for (p = yy = xx = 0; p < l; p += 4)
  1944. v = Math.sqrt(Math.pow(sz / 2 - xx, 2) + Math.pow(sz / 2 + 3 - yy, 2)) - 15,
  1945. v *= .1,
  1946. 0 > v && (v = -v),
  1947. 1 < v && (v = 1),
  1948. v = 1 - v,
  1949. v *= .25,
  1950. imgd[p] = imgd[p + 1] = imgd[p + 2] = 0,
  1951. imgd[p + 3] = Math.floor(255 * v),
  1952. xx++,
  1953. xx >= sz && (xx = 0,
  1954. yy++);
  1955. ctx.putImageData(map, 0, 0);
  1956. iioc && testing && (u = ksmc.toDataURL(),
  1957. ii = document.createElement("img"),
  1958. ii.src = u,
  1959. ksmc = ii);
  1960. sz = 64;
  1961. var jsebi = document.createElement("canvas");
  1962. jsebi.width = jsebi.height = sz;
  1963. ctx = jsebi.getContext("2d");
  1964. ctx.fillStyle = "#ffffff";
  1965. ctx.beginPath();
  1966. ctx.arc(sz / 2, sz / 2, sz / 2, 0, pi2);
  1967. ctx.fill();
  1968. map = ctx.getImageData(0, 0, sz, sz);
  1969. imgd = map.data;
  1970. l = imgd.length;
  1971. for (p = yy = xx = 0; p < l; p += 4)
  1972. v = Math.abs(sz / 2 - Math.sqrt(Math.pow(sz / 2 - xx, 2) + Math.pow(sz / 2 - yy, 2))) / (sz / 2),
  1973. v = 1.06 * v - .06,
  1974. 0 > v ? v = 0 : (v = Math.pow(v, .35),
  1975. v *= 1.35),
  1976. v += .25 * (1 - v),
  1977. imgd[p] = Math.max(0, Math.min(255, Math.round(72 * v))),
  1978. imgd[p + 1] = Math.max(0, Math.min(255, Math.round(255 * v))),
  1979. imgd[p + 2] = Math.max(0, Math.min(255, Math.round(116 * v))),
  1980. xx++,
  1981. xx >= sz && (xx = 0,
  1982. yy++),
  1983. v = sz / 2 - Math.sqrt(Math.pow(sz / 2 - xx, 2) + Math.pow(sz / 2 - yy, 2)),
  1984. imgd[p + 3] = 3 >= v ? Math.max(0, Math.min(255, Math.round(v / 3 * 255))) : 255;
  1985. ctx.putImageData(map, 0, 0);
  1986. sz = 48;
  1987. var jsepi = document.createElement("canvas");
  1988. jsepi.width = jsepi.height = sz;
  1989. ctx = jsepi.getContext("2d");
  1990. ctx.fillStyle = "#ffffff";
  1991. ctx.beginPath();
  1992. ctx.arc(sz / 2, sz / 2, sz / 2, 0, pi2);
  1993. ctx.fill();
  1994. map = ctx.getImageData(0, 0, sz, sz);
  1995. imgd = map.data;
  1996. l = imgd.length;
  1997. for (p = yy = xx = 0; p < l; p += 4)
  1998. v = Math.abs(sz / 2 - Math.sqrt(Math.pow(sz / 2 - xx, 2) + Math.pow(sz / 2 - yy, 2))) / (sz / 2),
  1999. v = .5 < v ? 0 : 1 - Math.pow(v / .5, 1),
  2000. v *= .8,
  2001. 0 == v ? (imgd[p] = 0,
  2002. imgd[p + 1] = 0,
  2003. imgd[p + 2] = 0) : (imgd[p] = Math.max(0, Math.min(255, Math.round(28 + 59 * v))),
  2004. imgd[p + 1] = Math.max(0, Math.min(255, Math.round(83 + 85 * v))),
  2005. imgd[p + 2] = Math.max(0, Math.min(255, Math.round(128 + 110 * v)))),
  2006. xx++,
  2007. xx >= sz && (xx = 0,
  2008. yy++);
  2009. ctx.putImageData(map, 0, 0);
  2010. var rabulb = document.createElement("canvas");
  2011. rabulb.width = rabulb.height = 64;
  2012. ctx = rabulb.getContext("2d");
  2013. var g = ctx.createRadialGradient(32, 32, 1, 32, 32, 31);
  2014. g.addColorStop(0, "rgba(255, 255, 255, 1)");
  2015. g.addColorStop(.83, "rgba(150,150,150, 1)");
  2016. g.addColorStop(.84, "rgba(80,80,80, 1)");
  2017. g.addColorStop(.99, "rgba(80,80,80, 1)");
  2018. g.addColorStop(1, "rgba(80,80,80, 0)");
  2019. ctx.fillStyle = g;
  2020. ctx.fillRect(0, 0, 64, 64);
  2021. var cdbulb = document.createElement("canvas");
  2022. cdbulb.width = 84;
  2023. cdbulb.height = 84;
  2024. var cdbulb2 = document.createElement("canvas");
  2025. cdbulb2.width = 84;
  2026. cdbulb2.height = 84;
  2027. ctx = cdbulb2.getContext("2d");
  2028. ctx.fillStyle = "#ff5609";
  2029. ctx.fillRect(13, 10, 29, 64);
  2030. ctx.fillRect(13, 10, 58, 22);
  2031. ctx.fillRect(13, 54, 58, 22);
  2032. ctx = cdbulb.getContext("2d");
  2033. ctx.shadowColor = "#000000";
  2034. ctx.shadowBlur = 20;
  2035. ctx.drawImage(cdbulb2, 0, 0);
  2036. ctx.drawImage(cdbulb2, 0, 0);
  2037. var acbulb = document.createElement("canvas");
  2038. acbulb.width = acbulb.height = 64;
  2039. ctx = acbulb.getContext("2d");
  2040. g = ctx.createRadialGradient(32, 32, 1, 32, 32, 31);
  2041. g.addColorStop(0, "rgba(255, 128, 128, 1)");
  2042. g.addColorStop(.5, "rgba(222, 3, 3, 1)");
  2043. g.addColorStop(.96, "rgba(157, 18, 18, 1)");
  2044. g.addColorStop(1, "rgba(0,0,0, 0)");
  2045. ctx.fillStyle = g;
  2046. ctx.fillRect(0, 0, 64, 64);
  2047. var kwkbulb = document.createElement("canvas");
  2048. kwkbulb.width = 172;
  2049. kwkbulb.height = 113;
  2050. var kwki = document.createElement("img");
  2051. kwki.onload = function() {
  2052. var b = document.createElement("canvas");
  2053. b.width = 172;
  2054. b.height = 113;
  2055. var c = b.getContext("2d");
  2056. c.drawImage(kwki, 21, 21);
  2057. c = kwkbulb.getContext("2d");
  2058. c.shadowColor = "#000000";
  2059. c.shadowBlur = 20;
  2060. c.drawImage(b, 0, 0)
  2061. }
  2062. ;
  2063. kwki.src = "/s/kwk6.png";
  2064. var jmou = document.createElement("canvas");
  2065. jmou.width = 79;
  2066. jmou.height = 130;
  2067. var jmoi = document.createElement("img");
  2068. jmoi.onload = function() {
  2069. jmou.getContext("2d").drawImage(jmoi, 0, 0)
  2070. }
  2071. ;
  2072. jmoi.src = "/s/jmou3.png";
  2073. var pwdbulb = document.createElement("canvas");
  2074. pwdbulb.width = 190;
  2075. pwdbulb.height = 188;
  2076. var pwdi = document.createElement("img");
  2077. pwdi.onload = function() {
  2078. var b = document.createElement("canvas");
  2079. b.width = 190;
  2080. b.height = 188;
  2081. var c = b.getContext("2d");
  2082. c.drawImage(pwdi, 21, 21);
  2083. c = pwdbulb.getContext("2d");
  2084. c.shadowColor = "#000000";
  2085. c.shadowBlur = 20;
  2086. c.drawImage(b, 0, 0)
  2087. }
  2088. ;
  2089. pwdi.src = "/s/pewd.png";
  2090. var sest = document.createElement("canvas");
  2091. sest.width = 105;
  2092. sest.height = 88;
  2093. var sesti = document.createElement("img");
  2094. sesti.onload = function() {
  2095. sest.getContext("2d").drawImage(sesti, 0, 0)
  2096. }
  2097. ;
  2098. sesti.src = "/s/sest5.png";
  2099. var playbulb = document.createElement("canvas");
  2100. playbulb.width = 142;
  2101. playbulb.height = 149;
  2102. var plyi = document.createElement("img");
  2103. plyi.onload = function() {
  2104. var b = document.createElement("canvas");
  2105. b.width = 142;
  2106. b.height = 149;
  2107. var c = b.getContext("2d");
  2108. c.drawImage(plyi, 21, 21);
  2109. c = playbulb.getContext("2d");
  2110. c.shadowColor = "#000000";
  2111. c.shadowBlur = 20;
  2112. c.drawImage(b, 0, 0)
  2113. }
  2114. ;
  2115. plyi.src = "/s/play.png";
  2116. var bonkbulb = document.createElement("canvas");
  2117. bonkbulb.width = 173;
  2118. bonkbulb.height = 178;
  2119. var bnki = document.createElement("img");
  2120. bnki.onload = function() {
  2121. var b = document.createElement("canvas");
  2122. b.width = 173;
  2123. b.height = 178;
  2124. var c = b.getContext("2d");
  2125. c.drawImage(bnki, 21, 21);
  2126. c = bonkbulb.getContext("2d");
  2127. c.shadowColor = "#000000";
  2128. c.shadowBlur = 20;
  2129. c.drawImage(b, 0, 0)
  2130. }
  2131. ;
  2132. bnki.src = "/s/bonkers2.png";
  2133. var leafbulb = document.createElement("canvas");
  2134. leafbulb.width = 143;
  2135. leafbulb.height = 161;
  2136. var leafi = document.createElement("img");
  2137. leafi.onload = function() {
  2138. var b = document.createElement("canvas");
  2139. b.width = 143;
  2140. b.height = 161;
  2141. var c = b.getContext("2d");
  2142. c.drawImage(leafi, 21, 21);
  2143. c = leafbulb.getContext("2d");
  2144. c.shadowColor = "#000000";
  2145. c.shadowBlur = 20;
  2146. c.drawImage(b, 0, 0)
  2147. }
  2148. ;
  2149. leafi.src = "/s/leaf.png";
  2150. var swissbulb = document.createElement("canvas");
  2151. swissbulb.width = 140;
  2152. swissbulb.height = 140;
  2153. var swissi = document.createElement("img");
  2154. swissi.onload = function() {
  2155. var b = document.createElement("canvas");
  2156. b.width = 140;
  2157. b.height = 140;
  2158. var c = b.getContext("2d");
  2159. c.drawImage(swissi, 21, 21);
  2160. c = swissbulb.getContext("2d");
  2161. c.shadowColor = "#000000";
  2162. c.shadowBlur = 20;
  2163. c.drawImage(b, 0, 0)
  2164. }
  2165. ;
  2166. swissi.src = "/s/swiss.png";
  2167. var moldovabulb = document.createElement("canvas");
  2168. moldovabulb.width = 162;
  2169. moldovabulb.height = 137;
  2170. var moldovai = document.createElement("img");
  2171. moldovai.onload = function() {
  2172. var b = document.createElement("canvas");
  2173. b.width = 162;
  2174. b.height = 137;
  2175. var c = b.getContext("2d");
  2176. c.drawImage(moldovai, 21, 21);
  2177. c = moldovabulb.getContext("2d");
  2178. c.shadowColor = "#000000";
  2179. c.shadowBlur = 20;
  2180. c.drawImage(b, 0, 0)
  2181. }
  2182. ;
  2183. moldovai.src = "/s/moldova.png";
  2184. var vietnambulb = document.createElement("canvas");
  2185. vietnambulb.width = 137;
  2186. vietnambulb.height = 142;
  2187. var vietnami = document.createElement("img");
  2188. vietnami.onload = function() {
  2189. var b = document.createElement("canvas");
  2190. b.width = 137;
  2191. b.height = 142;
  2192. var c = b.getContext("2d");
  2193. c.drawImage(vietnami, 21, 21);
  2194. c = vietnambulb.getContext("2d");
  2195. c.shadowColor = "#000000";
  2196. c.shadowBlur = 20;
  2197. c.drawImage(b, 0, 0)
  2198. }
  2199. ;
  2200. vietnami.src = "/s/vietnam.png";
  2201. var argentinabulb = document.createElement("canvas");
  2202. argentinabulb.width = 152;
  2203. argentinabulb.height = 152;
  2204. var argentinai = document.createElement("img");
  2205. argentinai.onload = function() {
  2206. var b = document.createElement("canvas");
  2207. b.width = 152;
  2208. b.height = 152;
  2209. var c = b.getContext("2d");
  2210. c.drawImage(argentinai, 21, 21);
  2211. c = argentinabulb.getContext("2d");
  2212. c.shadowColor = "#000000";
  2213. c.shadowBlur = 20;
  2214. c.drawImage(b, 0, 0)
  2215. }
  2216. ;
  2217. argentinai.src = "/s/argentina.png";
  2218. var movbulb = document.createElement("canvas");
  2219. movbulb.width = 142;
  2220. movbulb.height = 163;
  2221. var movi = document.createElement("img");
  2222. movi.onload = function() {
  2223. var b = document.createElement("canvas");
  2224. b.width = 142;
  2225. b.height = 163;
  2226. var c = b.getContext("2d");
  2227. c.drawImage(movi, 21, 21);
  2228. c = movbulb.getContext("2d");
  2229. c.shadowColor = "#000000";
  2230. c.shadowBlur = 20;
  2231. c.drawImage(b, 0, 0)
  2232. }
  2233. ;
  2234. movi.src = "/s/mov2.png";
  2235. var colc;
  2236. testing && (colc = document.createElement("canvas"),
  2237. colc.width = 256,
  2238. colc.height = 106,
  2239. colc.style.position = "fixed",
  2240. colc.style.left = "0px",
  2241. colc.style.top = "100px",
  2242. colc.style.zIndex = 2147483647,
  2243. document.body.appendChild(colc));
  2244. var pbx = new Float32Array(32767)
  2245. , pby = new Float32Array(32767)
  2246. , pba = new Float32Array(32767)
  2247. , pbu = new Uint8Array(32767)
  2248. , per_color_imgs = []
  2249. , rrs = [192, 144, 128, 128, 238, 255, 255, 255, 224, 255, 144, 80, 255, 40, 100, 120, 72, 160, 255, 56, 56, 78, 255, 101, 128, 60, 0, 217, 255, 144, 32, 240, 240, 240, 240, 32, 40, 104, 0, 104, 0]
  2250. , ggs = [128, 153, 208, 255, 238, 160, 144, 64, 48, 255, 153, 80, 192, 136, 117, 134, 84, 80, 224, 68, 68, 35, 86, 200, 132, 192, 255, 69, 64, 144, 32, 32, 240, 144, 32, 240, 60, 128, 0, 40, 0]
  2251. , bbs = [255, 255, 208, 128, 112, 96, 144, 64, 224, 255, 255, 80, 80, 96, 255, 255, 255, 255, 64, 255, 255, 192, 9, 232, 144, 72, 83, 69, 64, 144, 240, 32, 32, 32, 240, 32, 173, 255, 112, 170, 0]
  2252. , max_skin_cv = 64
  2253. , alcsc = new Uint8Array(256)
  2254. , ralcsc = new Uint8Array(256)
  2255. , falcsc = new Uint8Array(256)
  2256. , csks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 39];
  2257. for (i = 0; 255 >= i; i++)
  2258. ralcsc[i] = 0,
  2259. falcsc[i] = 0;
  2260. for (i = csks.length - 1; 0 <= i; i--)
  2261. ralcsc[csks[i]] = 1,
  2262. falcsc[csks[i]] = 1;
  2263. falcsc[40] = 1;
  2264. alcsc = ralcsc;
  2265. for (i = 0; i < rrs.length; i++) {
  2266. o = {
  2267. imgs: [],
  2268. fws: [],
  2269. fhs: [],
  2270. fw2s: [],
  2271. fh2s: [],
  2272. gimgs: [],
  2273. gfws: [],
  2274. gfhs: [],
  2275. gfw2s: [],
  2276. gfh2s: [],
  2277. oimgs: [],
  2278. ofws: [],
  2279. ofhs: [],
  2280. ofw2s: [],
  2281. ofh2s: []
  2282. };
  2283. var rs = "00" + rrs[i].toString(16)
  2284. , gs = "00" + ggs[i].toString(16)
  2285. , bs = "00" + bbs[i].toString(16);
  2286. rs = rs.substr(rs.length - 2);
  2287. gs = gs.substr(gs.length - 2);
  2288. bs = bs.substr(bs.length - 2);
  2289. o.cs = "#" + rs + gs + bs;
  2290. sz = 62;
  2291. var kfmc = document.createElement("canvas");
  2292. kfmc.width = kfmc.height = sz;
  2293. ctx = kfmc.getContext("2d");
  2294. map = ctx.getImageData(0, 0, sz, sz);
  2295. imgd = map.data;
  2296. l = imgd.length;
  2297. yy = xx = 0;
  2298. var fi = i;
  2299. 26 == i ? fi = 3 : 29 == i ? fi = 9 : 30 == i ? fi = 15 : 31 == i ? fi = 7 : 32 == i ? fi = 4 : 33 == i ? fi = 5 : 34 == i ? fi = 0 : 35 == i ? fi = 3 : 36 == i && (fi = 7);
  2300. rr = rrs[fi];
  2301. gg = ggs[fi];
  2302. bb = bbs[fi];
  2303. var t1 = (rr + gg + bb) / 3;
  2304. if (24 >= t1)
  2305. rr = gg = bb = 90;
  2306. else {
  2307. var t2 = 120 / t1;
  2308. rr = Math.min(255, Math.floor(rr * t2));
  2309. gg = Math.min(255, Math.floor(gg * t2));
  2310. bb = Math.min(255, Math.floor(bb * t2))
  2311. }
  2312. for (p = 0; p < l; p += 4)
  2313. v = 1 - Math.sqrt(Math.pow(sz / 2 - xx, 2) + Math.pow(sz / 2 - yy, 2)) / 32,
  2314. v = 0 > v ? 0 : .5 * (1 - Math.cos(Math.PI * v)),
  2315. imgd[p] = rr,
  2316. imgd[p + 1] = gg,
  2317. imgd[p + 2] = bb,
  2318. imgd[p + 3] = Math.floor(255 * v),
  2319. xx++,
  2320. xx >= sz && (xx = 0,
  2321. yy++);
  2322. ctx.putImageData(map, 0, 0);
  2323. o.kfmc = kfmc;
  2324. var ksz = 48
  2325. , ksz2 = ksz / 2
  2326. , kmc = document.createElement("canvas");
  2327. kmc.width = kmc.height = ksz;
  2328. ctx = kmc.getContext("2d");
  2329. ctx.fillStyle = "#FFFFFF";
  2330. ctx.arc(ksz2, ksz2, ksz2, 0, pi2);
  2331. ctx.fill();
  2332. map = ctx.getImageData(0, 0, ksz, ksz);
  2333. imgd = map.data;
  2334. l = imgd.length;
  2335. yy = xx = 0;
  2336. var jk = 7;
  2337. 36 == i && (jk = 60);
  2338. var v3, kmcs = [];
  2339. for (j = 0; j < jk; j++) {
  2340. for (p = xx = yy = 0; p < l; p += 4) {
  2341. var v2 = Math.max(0, Math.min(1, 1 - Math.sqrt(Math.pow(xx - ksz2, 2) + Math.pow(yy - ksz2, 2)) / 34));
  2342. nsr ? v = Math.pow(v2, .5) : (v = Math.pow(Math.max(0, Math.min(1, 1 - Math.abs(yy - ksz2) / ksz2)), .35),
  2343. v += .375 * (v2 - v));
  2344. rr = rrs[i];
  2345. gg = ggs[i];
  2346. bb = bbs[i];
  2347. if (24 == i)
  2348. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2349. v2 = Math.pow(1.05 * v2, 4),
  2350. 1 < v2 && (v2 = 1),
  2351. rr += (306 - rr) * v2,
  2352. gg += (192 * 1.2 - gg) * v2,
  2353. bb += (76.8 - bb) * v2,
  2354. v *= 1.22 - .44 * j / (jk - 1);
  2355. else if (26 == i)
  2356. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2357. v2 = Math.pow(v2, 2),
  2358. 1 < v2 && (v2 = 1),
  2359. v *= 1.22 - .44 * j / (jk - 1),
  2360. rr *= v,
  2361. gg *= v,
  2362. bb *= v,
  2363. v = 1,
  2364. rr += (140.8 - rr) * v2,
  2365. gg += (280.5 - gg) * v2,
  2366. bb += (136 * 1.1 - bb) * v2;
  2367. else if (27 == i)
  2368. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2369. v2 = Math.pow(v2, 2),
  2370. 1 < v2 && (v2 = 1),
  2371. v *= 1.22 - .44 * j / (jk - 1),
  2372. rr *= v,
  2373. gg *= v,
  2374. bb *= v,
  2375. v = 1,
  2376. rr += (217 * 1.1 - rr) * v2,
  2377. gg += (75.9 - gg) * v2,
  2378. bb += (75.9 - bb) * v2;
  2379. else if (28 == i)
  2380. v2 = .5 - .5 * Math.cos(Math.PI * j / jk),
  2381. rr += (128 - rr) * v2,
  2382. gg += (128 - gg) * v2,
  2383. bb += (255 - bb) * v2,
  2384. v *= 1.1,
  2385. 1 < v && (v = 1);
  2386. else if (29 == i)
  2387. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2388. v2 = Math.pow(v2, 2),
  2389. 1 < v2 && (v2 = 1),
  2390. v *= 1.44 - .88 * j / (jk - 1),
  2391. rr = 32 * v,
  2392. gg = 32 * v,
  2393. bb = 32 * v,
  2394. v = 1,
  2395. rr += (255 - rr) * v2,
  2396. gg += (255 - gg) * v2,
  2397. bb += (255 - bb) * v2;
  2398. else if (30 == i)
  2399. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2400. v2 = Math.pow(v2, 2),
  2401. 1 < v2 && (v2 = 1),
  2402. v = (.1 + .9 * j / jk) % 1,
  2403. rr = 80 * v,
  2404. gg = 80 * v,
  2405. bb = 128 + 160 * v,
  2406. rr += .3 * (255 - rr) * v2,
  2407. gg += .3 * (255 - gg) * v2,
  2408. bb += .3 * (357 - bb) * v2,
  2409. v = 1;
  2410. else if (31 == i)
  2411. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2412. v2 = Math.pow(v2, 2),
  2413. 1 < v2 && (v2 = 1),
  2414. v = (.1 + .9 * j / jk) % 1,
  2415. rr = 128 + 160 * v,
  2416. gg = 80 * v,
  2417. bb = 80 * v,
  2418. rr += .3 * (357 - rr) * v2,
  2419. gg += .3 * (255 - gg) * v2,
  2420. bb += .3 * (255 - bb) * v2,
  2421. v = 1;
  2422. else if (32 == i)
  2423. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2424. v2 = Math.pow(v2, 2),
  2425. 1 < v2 && (v2 = 1),
  2426. v = (.1 + .9 * j / jk) % 1,
  2427. rr = 96 + 128 * v,
  2428. gg = 96 + 128 * v,
  2429. bb = 80 * v,
  2430. rr += .6 * (306 - rr) * v2,
  2431. gg += .6 * (306 - gg) * v2,
  2432. bb += .6 * (255 - bb) * v2,
  2433. v = 1;
  2434. else if (33 == i)
  2435. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2436. v2 = Math.pow(v2, 2),
  2437. 1 < v2 && (v2 = 1),
  2438. v = (.1 + .9 * j / jk) % 1,
  2439. rr = 96 + 128 * v,
  2440. gg = 48 + 80 * v,
  2441. bb = 48 * v,
  2442. rr += .6 * (306 - rr) * v2,
  2443. gg += .6 * (280.5 - gg) * v2,
  2444. bb += .6 * (255 - bb) * v2,
  2445. v = 1;
  2446. else if (34 == i)
  2447. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2448. v2 = Math.pow(v2, 2),
  2449. 1 < v2 && (v2 = 1),
  2450. v = (.1 + .9 * j / jk) % 1,
  2451. rr = 96 + 128 * v,
  2452. gg = 80 * v,
  2453. bb = 96 + 128 * v,
  2454. rr += .6 * (306 - rr) * v2,
  2455. gg += .6 * (255 - gg) * v2,
  2456. bb += .6 * (306 - bb) * v2,
  2457. v = 1;
  2458. else if (35 == i)
  2459. v2 = Math.sqrt(Math.pow(.5 * (xx - ksz2), 2) + Math.pow(yy - ksz2, 2)) / ksz2,
  2460. v2 = Math.pow(v2, 2),
  2461. 1 < v2 && (v2 = 1),
  2462. v = (.1 + .9 * j / jk) % 1,
  2463. rr = 80 * v,
  2464. gg = 96 + 128 * v,
  2465. bb = 80 * v,
  2466. rr += .6 * (255 - rr) * v2,
  2467. gg += .6 * (306 - gg) * v2,
  2468. bb += .6 * (255 - bb) * v2,
  2469. v = 1;
  2470. else if (36 == i) {
  2471. v3 = (j / jk + .6 + xx / ksz * .25) % 1;
  2472. v2 = (yy - ksz2) / ksz;
  2473. v2 = 1.3 * (v2 - 1.3 * (v3 - .5));
  2474. v2 *= 2;
  2475. 0 > v2 && (v2 = -v2);
  2476. v2 *= 2.4;
  2477. 1 > v2 && (rr += (561 - rr) * (1 - v2),
  2478. gg += (561 - gg) * (1 - v2),
  2479. bb += (561 - bb) * (1 - v2));
  2480. v2 = .5 > v3 ? (yy - .055 * ksz2 - ksz2) / ksz : (yy + .055 * ksz2 - ksz2) / ksz;
  2481. v2 = 1.3 * (v2 - 1.3 * (v3 - .5));
  2482. v2 *= 2;
  2483. 0 > v2 && (v2 = -v2);
  2484. v2 *= 4.8;
  2485. 1 > v2 && (rr += (255 - rr) * (1 - v2),
  2486. gg += (32 - gg) * (1 - v2),
  2487. bb += (64 - bb) * (1 - v2));
  2488. v2 = (ksz2 - yy) / ksz;
  2489. v2 = 1.3 * (v2 - 1.3 * (v3 - .5));
  2490. v2 *= 2;
  2491. 0 > v2 && (v2 = -v2);
  2492. v2 *= 2.4;
  2493. 1 > v2 && (rr += (561 - rr) * (1 - v2),
  2494. gg += (561 - gg) * (1 - v2),
  2495. bb += (561 - bb) * (1 - v2));
  2496. v2 = .5 > v3 ? (ksz2 + .055 * ksz2 - yy) / ksz : (ksz2 - .055 * ksz2 - yy) / ksz;
  2497. v2 = 1.3 * (v2 - 1.3 * (v3 - .5));
  2498. v2 *= 2;
  2499. 0 > v2 && (v2 = -v2);
  2500. v2 *= 4.8;
  2501. 1 > v2 && (rr += (255 - rr) * (1 - v2),
  2502. gg += (32 - gg) * (1 - v2),
  2503. bb += (64 - bb) * (1 - v2));
  2504. v2 = (yy - ksz2) / ksz;
  2505. if (.47 <= v3 && .53 >= v3)
  2506. rr = 255,
  2507. gg = 32,
  2508. bb = 64;
  2509. else if (-.1 <= v2 && .1 >= v2)
  2510. v3 = .5 - v3,
  2511. 0 > v3 && (v3 = -v3),
  2512. v3 = 1 - Math.pow(v3 / .5, 2),
  2513. rr += (255 - rr) * v3,
  2514. gg += (32 - gg) * v3,
  2515. bb += (64 - bb) * v3;
  2516. else if (.44 <= v3 && .56 >= v3 || -.15 <= v2 && .15 >= v2)
  2517. v3 = .5 - v3,
  2518. 0 > v3 && (v3 = -v3),
  2519. v3 = 1 - Math.pow(v3 / .5, 2),
  2520. rr += (255 - rr) * v3,
  2521. gg += (255 - gg) * v3,
  2522. bb += (255 - bb) * v3;
  2523. nsr || (v = Math.pow(Math.max(0, Math.min(1, 1 - Math.abs(yy - ksz2) / ksz2)), .35),
  2524. v2 = Math.pow(Math.max(0, Math.min(1, 1 - Math.abs(yy - ksz2) / ksz2)), .5),
  2525. rr += (rrs[i] - rr) * (1 - v2),
  2526. gg += (ggs[i] - gg) * (1 - v2),
  2527. bb += (bbs[i] - bb) * (1 - v2))
  2528. } else
  2529. v *= 1.22 - .44 * j / (jk - 1);
  2530. imgd[p] = Math.max(0, Math.min(255, Math.floor(rr * v)));
  2531. imgd[p + 1] = Math.max(0, Math.min(255, Math.floor(gg * v)));
  2532. imgd[p + 2] = Math.max(0, Math.min(255, Math.floor(bb * v)));
  2533. xx++;
  2534. xx >= ksz && (xx = 0,
  2535. yy++)
  2536. }
  2537. ctx.putImageData(map, 0, 0);
  2538. var kmc2 = document.createElement("canvas");
  2539. kmc2.width = kmc2.height = ksz;
  2540. var ctx2 = kmc2.getContext("2d");
  2541. ctx2.drawImage(kmc, 0, 0);
  2542. if (10 == i) {
  2543. var fk = -1
  2544. , tk = 1;
  2545. nsr && (fk = -4,
  2546. tk = 3);
  2547. for (k = fk; k <= tk; k++) {
  2548. var tx = ksz2 + ksz2 / 16 * Math.cos(2 * Math.PI * k / 8) * 13
  2549. , ty = ksz2 + ksz2 / 16 * Math.sin(2 * Math.PI * k / 8) * 13;
  2550. ctx2.fillStyle = "#FFFFFF";
  2551. ctx2.beginPath();
  2552. for (m = 0; 5 >= m; m++)
  2553. xx = tx + ksz / 32 * Math.cos(2 * Math.PI * m / 5) * .05 * 24,
  2554. yy = ty + ksz / 32 * Math.sin(2 * Math.PI * m / 5) * .05 * 24,
  2555. 0 == m ? ctx2.moveTo(xx, yy) : ctx2.lineTo(xx, yy),
  2556. xx = tx + ksz / 32 * Math.cos(2 * Math.PI * (m + .5) / 5) * 3.1,
  2557. yy = ty + ksz / 32 * Math.sin(2 * Math.PI * (m + .5) / 5) * 3.1,
  2558. ctx2.lineTo(xx, yy);
  2559. ctx2.fill()
  2560. }
  2561. } else if (19 == i)
  2562. for (fk = -2,
  2563. tk = 2,
  2564. nsr && (fk = -7,
  2565. tk = 7),
  2566. k = fk; k <= tk; k++) {
  2567. tx = ksz2 + ksz2 / 16 * Math.cos(2 * Math.PI * k / 15) * 13;
  2568. ty = ksz2 + ksz2 / 16 * Math.sin(2 * Math.PI * k / 15) * 13;
  2569. ctx2.save();
  2570. ctx2.globalAlpha = .7;
  2571. ctx2.fillStyle = "#FFFFFF";
  2572. ctx2.beginPath();
  2573. for (m = 0; 5 >= m; m++)
  2574. xx = tx + ksz / 32 * Math.cos(2 * Math.PI * m / 5) * .05 * 12,
  2575. yy = ty + ksz / 32 * Math.sin(2 * Math.PI * m / 5) * .05 * 12,
  2576. 0 == m ? ctx2.moveTo(xx, yy) : ctx2.lineTo(xx, yy),
  2577. xx = tx + ksz / 32 * Math.cos(2 * Math.PI * (m + .5) / 5) * 1.55,
  2578. yy = ty + ksz / 32 * Math.sin(2 * Math.PI * (m + .5) / 5) * 1.55,
  2579. ctx2.lineTo(xx, yy);
  2580. ctx2.fill();
  2581. ctx2.restore()
  2582. }
  2583. else if (20 == i)
  2584. for (fk = -1.5,
  2585. tk = 1.5,
  2586. nsr && (fk = -6.5,
  2587. tk = 7.5),
  2588. k = fk; k <= tk; k++) {
  2589. tx = ksz2 + ksz2 / 16 * Math.cos(2 * Math.PI * k / 15) * 13;
  2590. ty = ksz2 + ksz2 / 16 * Math.sin(2 * Math.PI * k / 15) * 13;
  2591. ctx2.save();
  2592. ctx2.globalAlpha = .7;
  2593. ctx2.fillStyle = "#FFFFFF";
  2594. ctx2.beginPath();
  2595. for (m = 0; 5 >= m; m++)
  2596. xx = tx + ksz2 / 16 * Math.cos(2 * Math.PI * m / 5) * .05 * 14,
  2597. yy = ty + ksz2 / 16 * Math.sin(2 * Math.PI * m / 5) * .05 * 14,
  2598. 0 == m ? ctx2.moveTo(xx, yy) : ctx2.lineTo(xx, yy),
  2599. xx = tx + ksz2 / 16 * Math.cos(2 * Math.PI * (m + .5) / 5) * 1.8,
  2600. yy = ty + ksz2 / 16 * Math.sin(2 * Math.PI * (m + .5) / 5) * 1.8,
  2601. ctx2.lineTo(xx, yy);
  2602. ctx2.fill();
  2603. ctx2.restore()
  2604. }
  2605. iioc && testing ? 1 <= kmcs.length ? kmcs.push(kmcs[0]) : 2 <= per_color_imgs.length ? kmcs.push(per_color_imgs[0].kmcs[0]) : (u = kmc2.toDataURL(),
  2606. ii = document.createElement("img"),
  2607. ii.src = "ayy.png",
  2608. kmcs.push(ii)) : kmcs.push(kmc2)
  2609. }
  2610. o.kmcs = kmcs;
  2611. o.kl = kmcs.length;
  2612. o.klp = !0;
  2613. 36 == i && (o.klp = !1);
  2614. per_color_imgs.push(o);
  2615. for (j = 2.8; 18.8 >= j; j += 1) {
  2616. var cc = document.createElement("canvas");
  2617. sz = Math.ceil(2.5 * j + 28);
  2618. cc.width = cc.height = sz;
  2619. ctx = cc.getContext("2d");
  2620. ctx.fillStyle = o.cs;
  2621. ctx.arc(sz / 2, sz / 2, .65 * j, 0, pi2);
  2622. ctx.shadowBlur = 12;
  2623. ctx.shadowOffsetY = 0;
  2624. ctx.shadowColor = "#" + rs + gs + bs;
  2625. ctx.globalAlpha = .8;
  2626. ctx.fill();
  2627. ctx.globalAlpha = 1;
  2628. ctx.fill();
  2629. iioc && testing ? (u = cc.toDataURL(),
  2630. ii = document.createElement("img"),
  2631. ii.src = u,
  2632. o.imgs.push(ii)) : o.imgs.push(cc);
  2633. o.fws.push(sz);
  2634. o.fhs.push(sz);
  2635. o.fw2s.push(sz / 2);
  2636. o.fh2s.push(sz / 2);
  2637. sz = Math.ceil(8 * j + 6);
  2638. cc = document.createElement("canvas");
  2639. cc.width = cc.height = sz;
  2640. ctx = cc.getContext("2d");
  2641. g = ctx.createRadialGradient(sz / 2, sz / 2, 1, sz / 2, sz / 2, 4 * j);
  2642. g.addColorStop(0, "rgba(" + rrs[i] + ", " + ggs[i] + ", " + bbs[i] + ", 1)");
  2643. g.addColorStop(1, "rgba(" + rrs[i] + ", " + ggs[i] + ", " + bbs[i] + ", 0)");
  2644. ctx.fillStyle = g;
  2645. ctx.fillRect(0, 0, sz, sz);
  2646. iioc && testing ? (u = cc.toDataURL(),
  2647. ii = document.createElement("img"),
  2648. ii.src = u,
  2649. o.gimgs.push(ii)) : o.gimgs.push(cc);
  2650. o.gfws.push(sz);
  2651. o.gfhs.push(sz);
  2652. o.gfw2s.push(sz / 2);
  2653. o.gfh2s.push(sz / 2);
  2654. cc = document.createElement("canvas");
  2655. sz = Math.ceil(1.3 * j + 6);
  2656. cc.width = cc.height = sz;
  2657. ctx = cc.getContext("2d");
  2658. var eam = .2;
  2659. g = ctx.createRadialGradient(sz / 2, sz / 2, 0, sz / 2, sz / 2, j / 2);
  2660. g.addColorStop(0, "rgba(" + rrs[i] + ", " + ggs[i] + ", " + bbs[i] + ", 1)");
  2661. g.addColorStop(.99, "rgba(" + Math.floor(rrs[i] * eam) + ", " + Math.floor(ggs[i] * eam) + ", " + Math.floor(bbs[i] * eam) + ", 1)");
  2662. g.addColorStop(1, "rgba(" + Math.floor(rrs[i] * eam) + ", " + Math.floor(ggs[i] * eam) + ", " + Math.floor(bbs[i] * eam) + ", 0)");
  2663. ctx.fillStyle = g;
  2664. ctx.fillRect(0, 0, sz, sz);
  2665. ctx.strokeStyle = "#000000";
  2666. ctx.lineWidth = 2;
  2667. ctx.arc(sz / 2, sz / 2, .65 * j, 0, pi2);
  2668. ctx.globalAlpha = 1;
  2669. ctx.stroke();
  2670. iioc && testing ? (u = cc.toDataURL(),
  2671. ii = document.createElement("img"),
  2672. ii.src = u,
  2673. o.oimgs.push(ii)) : o.oimgs.push(cc);
  2674. o.ofws.push(sz);
  2675. o.ofhs.push(sz);
  2676. o.ofw2s.push(sz / 2);
  2677. o.ofh2s.push(sz / 2)
  2678. }
  2679. o.ic = o.imgs.length;
  2680. o.pr_imgs = [];
  2681. o.pr_fws = [];
  2682. o.pr_fhs = [];
  2683. o.pr_fw2s = [];
  2684. o.pr_fh2s = [];
  2685. for (j = 3; 24 >= j; j += 1)
  2686. cc = document.createElement("canvas"),
  2687. sz = Math.ceil(2 * j + 38),
  2688. cc.width = cc.height = sz,
  2689. ctx = cc.getContext("2d"),
  2690. ctx.fillStyle = o.cs,
  2691. ctx.arc(sz / 2, sz / 2, j / 2, 0, pi2),
  2692. ctx.shadowBlur = 22,
  2693. ctx.shadowOffsetY = 0,
  2694. ctx.shadowColor = "#" + rs + gs + bs,
  2695. ctx.fill(),
  2696. ctx.fill(),
  2697. iioc && testing ? (u = cc.toDataURL(),
  2698. ii = document.createElement("img"),
  2699. ii.src = u,
  2700. o.pr_imgs.push(ii)) : o.pr_imgs.push(cc),
  2701. o.pr_fws.push(sz),
  2702. o.pr_fhs.push(sz),
  2703. o.pr_fw2s.push(sz / 2),
  2704. o.pr_fh2s.push(sz / 2)
  2705. }
  2706. if (testing)
  2707. for (ctx = colc.getContext("2d"),
  2708. ctx.fillStyle = "#000000",
  2709. ctx.fillRect(0, 0, colc.width, colc.height),
  2710. ctx.fillStyle = "#FFFFFF",
  2711. ctx.font = "10px Arial, Helvetica Neue, Helvetica, sans-serif",
  2712. ctx.textBaseline = "top",
  2713. ctx.textAlign = "center",
  2714. i = yy = xx = 0; i < rrs.length; i++) {
  2715. var pci = per_color_imgs[i];
  2716. kmc = pci.kmcs[0];
  2717. ctx.drawImage(kmc, 0, 0, kmc.width, kmc.height, xx, yy, 16, 16);
  2718. ntx = o.xx + o.fx;
  2719. nty = o.yy + o.fy;
  2720. ntx = mww2 + (ntx - view_xx) * gsc;
  2721. nty = mhh2 + (nty - view_yy) * gsc;
  2722. ctx.fillText("" + i, xx + 8, yy + 16);
  2723. xx += 16;
  2724. xx > colc.width - 16 && (xx = 0,
  2725. yy += 28)
  2726. }
  2727. var view_xx = 0
  2728. , view_yy = 0
  2729. , view_ang = 0
  2730. , view_dist = 0
  2731. , fvx = 0
  2732. , fvy = 0
  2733. , xm = 0
  2734. , ym = 0
  2735. , lsxm = 0
  2736. , lsym = 0
  2737. , snake = null
  2738. , my_nick = ""
  2739. , gw2k16 = !1;
  2740. try {
  2741. "1" == localStorage.gw2k16 && (gw2k16 = !0)
  2742. } catch (b) {}
  2743. var dhx, dhy, hsz, fr = 0, lfr = 0, ltm = Date.now(), vfr = 0, vfrb = 0, avfr = 0, afr = 0, fr2 = 0, lfr2 = 0, vfrb2 = 0, cptm = 0, lptm = 0, lpstm = 0, last_ping_mtm = 0, lagging = !1, lag_mult = 1, wfpr = !1, high_quality = !0, gla = 1, wdfg = 0, qsm = 1, mqsm = 1.7, playing = !1, connected = !1, want_close_socket = !1, want_victory_message = !1, want_victory_focus = !1, want_hide_victory = 0, hvfr = 0, dead_mtm = -1, at2lt = new Float32Array(65536);
  2744. for (yy = 0; 256 > yy; yy++)
  2745. for (xx = 0; 256 > xx; xx++)
  2746. at2lt[yy << 8 | xx] = Math.atan2(yy - 128, xx - 128);
  2747. var kd_l_frb = 0
  2748. , kd_r_frb = 0
  2749. , kd_l = !1
  2750. , kd_r = !1
  2751. , kd_u = !1
  2752. , lkstm = 0
  2753. , social = document.createElement("iframe");
  2754. try {
  2755. social.frameBorder = 0
  2756. } catch (b) {}
  2757. social.style.position = "fixed";
  2758. social.style.left = "6px";
  2759. social.style.top = "6px";
  2760. social.style.border = "0px";
  2761. social.style.zIndex = 9999999;
  2762. social.style.overflow = "hidden";
  2763. social.width = 251;
  2764. social.height = 150;
  2765. social.src = "/social-box/";
  2766. document.body.appendChild(social);
  2767. var oef = function() {
  2768. whmos && hmos();
  2769. var b = Date.now();
  2770. vfr = (b - ltm) / 8;
  2771. 5 < vfr && (vfr = 5);
  2772. 1.56 > vfr && (vfr = 1.56);
  2773. avfr = vfr;
  2774. ltm = b;
  2775. choosing_skin || (lagging || wfpr && 420 < b - last_ping_mtm && (want_play || checking_code || (lagging = !0)),
  2776. lagging ? (lag_mult *= .85,
  2777. .01 > lag_mult && (lag_mult = .01)) : 1 > lag_mult && (lag_mult += .05,
  2778. 1 <= lag_mult && (lag_mult = 1)));
  2779. 120 < vfr && (vfr = 120);
  2780. vfr *= lag_mult;
  2781. etm *= lag_mult;
  2782. lfr = fr;
  2783. fr += vfr;
  2784. vfrb = Math.floor(fr) - Math.floor(lfr);
  2785. lfr2 = fr2;
  2786. fr2 += 2 * vfr;
  2787. vfrb2 = Math.floor(fr2) - Math.floor(lfr2);
  2788. afr += avfr;
  2789. kd_l && (kd_l_frb += vfrb);
  2790. kd_r && (kd_r_frb += vfrb);
  2791. want_play && !shoa && -1 == dead_mtm && (want_play = !1,
  2792. connect());
  2793. buildia_shown && -1 != buildia_close_after_tm && b > buildia_close_after_tm && trySkipBuildia();
  2794. if (spinner_shown) {
  2795. lsfr += avfr;
  2796. var c = ldmc.getContext("2d");
  2797. c.clearRect(0, 0, 512, 128);
  2798. for (var e, h, w = 1; 2 >= w; w++) {
  2799. c.beginPath();
  2800. 1 == w ? (c.fillStyle = "#60FF70",
  2801. h = 0) : (c.fillStyle = "#9850FF",
  2802. h = Math.PI);
  2803. for (var f = 0; 256 >= f; f++)
  2804. e = 32 + 5 * Math.cos(h + lsfr / 6 + 8 * f / 256) + 8 * f / 256,
  2805. 256 == f && (e += 10),
  2806. xx = 64 + Math.cos(h + lsfr / 44 + .8 * Math.PI * f / 256) * e * 1.25,
  2807. yy = 64 + Math.sin(h + lsfr / 44 + .8 * Math.PI * f / 256) * e,
  2808. 0 == f ? c.moveTo(xx, yy) : c.lineTo(xx, yy);
  2809. e = 32;
  2810. xx = 64 + Math.cos(h + lsfr / 44 + .8 * Math.PI * (f + 47) / 256) * e * 1.25;
  2811. yy = 64 + Math.sin(h + lsfr / 44 + .8 * Math.PI * (f + 47) / 256) * e;
  2812. c.lineTo(xx, yy);
  2813. for (f = 256; 0 <= f; f--)
  2814. e = 32 + 5 * Math.cos(h + lsfr / 6 + 8 * f / 256) - 8 * f / 256,
  2815. 256 == f && (e -= 10),
  2816. xx = 64 + Math.cos(h + lsfr / 44 + .8 * Math.PI * f / 256) * e * 1.25,
  2817. yy = 64 + Math.sin(h + lsfr / 44 + .8 * Math.PI * f / 256) * e,
  2818. c.lineTo(xx, yy);
  2819. c.fill()
  2820. }
  2821. connecting || want_play ? (ss_a += avfr / 86,
  2822. 1 <= ss_a && (ss_a = 1),
  2823. ss_sh += avfr / 93,
  2824. 1 <= ss_sh && (ss_sh = 1),
  2825. ldmc.style.opacity = ss_a,
  2826. f = Math.round(.1 + .9 * ss_sh * (1 + 2 * Math.pow(1 - ss_a, 2)) * 1E5) / 1E5) : (ss_a -= avfr / 86,
  2827. 0 >= ss_a && (ss_sh = ss_a = 0,
  2828. ldmc.style.display = "none",
  2829. trf(ldmc, "")),
  2830. ldmc.style.opacity = ss_a,
  2831. f = Math.round(.1 + .9 * ss_sh * (1 + 2 * Math.pow(1 - ss_a, 2)) * 1E5) / 1E5);
  2832. trf(ldmc, "scale(" + f + "," + f + ")")
  2833. }
  2834. if (entering_code || ending_enter_code) {
  2835. for (f = etcobs.length - 1; 0 <= f; f--)
  2836. c = etcobs[f],
  2837. c.loaded && (checking_code ? .25 != c.alpha && (c.alpha -= .02 * vfr,
  2838. .25 >= c.alpha && (c.alpha = .25),
  2839. c.ii.style.opacity = c.alpha) : 1 != c.alpha && (c.alpha += .02 * vfr,
  2840. 1 <= c.alpha && (c.alpha = 1),
  2841. c.ii.style.opacity = c.alpha));
  2842. ending_enter_code ? (etca -= .03 * vfr,
  2843. 0 >= etca && (etcbx = etca = 0,
  2844. etcdx = etc_ww / 2 - 27,
  2845. etcods = [],
  2846. entering_code = ending_enter_code = !1,
  2847. etcod.style.display = "none",
  2848. nick.disabled = !1,
  2849. nick.focus(),
  2850. want_open_cosmetics && (want_open_cosmetics = !1,
  2851. csk.onclick(),
  2852. scos.onclick())),
  2853. etcod.style.opacity = etca) : entering_code && 1 != etca && (etca += .03 * vfr,
  2854. 1 <= etca && (etca = 1),
  2855. etcod.style.opacity = etca);
  2856. etcba += .1 * vfr;
  2857. etcba >= pi2 && (etcba -= pi2);
  2858. etcshk && (etcshkv += .014 * vfr,
  2859. 1 <= etcshkv && (etcshkv = 1,
  2860. etcshk = !1),
  2861. etcc.style.left = Math.round(10 * (32 * Math.sin(Math.PI * etcshkv * 8) * Math.sin(Math.PI * etcshkv) + ww / 2 - etc_ww / 2)) / 10 + "px");
  2862. if (checking_code || 0 < etcsa)
  2863. etcsv += .0075 * vfr,
  2864. 1 <= etcsv && --etcsv,
  2865. checking_code ? (etcsa += .02 * vfr,
  2866. 1 <= etcsa && (etcsa = 1)) : (etcsa -= .05 * vfr,
  2867. 0 >= etcsa && (etcsa = 0)),
  2868. etco_sp_ii.style.opacity = etcsa,
  2869. f = etcsrv,
  2870. etcsrv = Math.round(12 * etcsv),
  2871. etcsrv != f && adjustCodeSpinner();
  2872. 14 == etcods.length ? 0 != etcbaa && (etcbaa -= .05 * vfr,
  2873. 0 >= etcbaa && (etcbaa = 0)) : 1 != etcbaa && (etcbaa += .05 * vfr,
  2874. 1 <= etcbaa && (etcbaa = 1));
  2875. c = etcc.getContext("2d");
  2876. c.save();
  2877. c.clearRect(0, 0, etc_ww, etc_hh);
  2878. f = Math.min(13, etcods.length);
  2879. etcbx += .2 * (47 * f - etcbx);
  2880. etcdx += .1 * (etc_ww / 2 - 27 - 47 * f / 2 - etcdx);
  2881. c.globalAlpha = 1;
  2882. c.translate(etcdx, 0);
  2883. for (f = 0; f < etcods.length; f++)
  2884. h = etcods[f].v,
  2885. etcdis[h].loaded && c.drawImage(etcdis[h].ii, 47 * f, 0, 54, 67);
  2886. etcdis[11].loaded && (c.globalAlpha = etcbaa * (.5 + .4 * Math.cos(etcba)),
  2887. c.drawImage(etcdis[11].ii, etcbx, 0, 54, 67));
  2888. c.restore()
  2889. }
  2890. if (ending_build_skin) {
  2891. if (0 != bdska) {
  2892. bdska -= .015 * vfr;
  2893. if (0 >= bdska) {
  2894. bdska = 0;
  2895. building_skin = ending_build_skin = !1;
  2896. alcsc = ralcsc;
  2897. for (f = bskbtns.length - 1; 0 <= f; f--)
  2898. document.body.removeChild(bskbtns[f].a);
  2899. bskbtns = [];
  2900. revdiv.style.display = "none"
  2901. }
  2902. h = .5 * (1 - Math.cos(Math.PI * bdska));
  2903. bskoy = 90 * h;
  2904. skoboym = h;
  2905. reposSkinStuff();
  2906. pskh.style.opacity = 1 - bdska;
  2907. nskh.style.opacity = 1 - bdska;
  2908. bskh.style.opacity = 1 - bdska;
  2909. scosh.style.opacity = 1 - bdska;
  2910. revdiv.style.opacity = bdska;
  2911. for (f = bskbtns.length - 1; 0 <= f; f--)
  2912. c = bskbtns[f],
  2913. c.ii.style.opacity = bdska
  2914. }
  2915. } else if (building_skin && 1 != bdska)
  2916. for (bdska += .015 * vfr,
  2917. 1 <= bdska && (bdska = 1),
  2918. h = .5 * (1 - Math.cos(Math.PI * bdska)),
  2919. bskoy = 90 * h,
  2920. skoboym = h,
  2921. reposSkinStuff(),
  2922. pskh.style.opacity = 1 - bdska,
  2923. nskh.style.opacity = 1 - bdska,
  2924. bskh.style.opacity = 1 - bdska,
  2925. scosh.style.opacity = 1 - bdska,
  2926. revdiv.style.opacity = bdska,
  2927. f = bskbtns.length - 1; 0 <= f; f--)
  2928. c = bskbtns[f],
  2929. c.ii.style.opacity = bdska;
  2930. if (ending_select_cosmetic) {
  2931. if (0 != secosa) {
  2932. secosa -= .015 * vfr;
  2933. if (0 >= secosa) {
  2934. secosa = 0;
  2935. selecting_cosmetic = ending_select_cosmetic = !1;
  2936. for (f = cosbtns.length - 1; 0 <= f; f--)
  2937. document.body.removeChild(cosbtns[f].a);
  2938. cosbtns = []
  2939. }
  2940. h = .5 * (1 - Math.cos(Math.PI * secosa));
  2941. secosoy = 90 * h;
  2942. secosoym = h;
  2943. reposSkinStuff();
  2944. pskh.style.opacity = 1 - secosa;
  2945. nskh.style.opacity = 1 - secosa;
  2946. bskh.style.opacity = 1 - secosa;
  2947. scosh.style.opacity = 1 - secosa;
  2948. for (f = cosbtns.length - 1; 0 <= f; f--)
  2949. c = cosbtns[f],
  2950. c.ii.style.opacity = secosa
  2951. }
  2952. } else if (selecting_cosmetic && 1 != secosa)
  2953. for (secosa += .015 * vfr,
  2954. 1 <= secosa && (secosa = 1),
  2955. h = .5 * (1 - Math.cos(Math.PI * secosa)),
  2956. secosoy = 90 * h,
  2957. secosoym = h,
  2958. reposSkinStuff(),
  2959. pskh.style.opacity = 1 - secosa,
  2960. nskh.style.opacity = 1 - secosa,
  2961. bskh.style.opacity = 1 - secosa,
  2962. scosh.style.opacity = 1 - secosa,
  2963. f = cosbtns.length - 1; 0 <= f; f--)
  2964. c = cosbtns[f],
  2965. c.ii.style.opacity = secosa;
  2966. waiting_for_sos && b > sos_ready_after_mtm && (connecting || connected || connect());
  2967. connecting && 3333 < b - start_connect_mtm && (bso && (bso.tainted = !0),
  2968. connect());
  2969. if (choosing_skin) {
  2970. for (f = snakes.length - 1; 0 <= f; f--)
  2971. for (c = snakes[f],
  2972. w = c.pts.length - 1; 0 <= w; w--)
  2973. c.pts[w].yy = grd / 2 + 15 * Math.cos(w / 4 + fr / 19) * (1 - w / c.pts.length);
  2974. view_xx -= vfr
  2975. }
  2976. playing && (high_quality ? (1 > gla && (gla += .0075 * vfr,
  2977. 1 < gla && (gla = 1)),
  2978. 1 < qsm && (qsm -= 4E-5 * vfr,
  2979. 1 > qsm && (qsm = 1))) : (0 < gla && (gla -= .0075 * vfr,
  2980. 0 > gla && (gla = 0)),
  2981. qsm < mqsm && (qsm += 4E-5 * vfr,
  2982. qsm > mqsm && (qsm = mqsm))));
  2983. 0 != want_hide_victory && (1 == want_hide_victory ? (hvfr += .02 * vfr,
  2984. 1 <= hvfr ? (hvfr = 0,
  2985. want_hide_victory = 2,
  2986. victory_holder.style.opacity = 1,
  2987. saveh.style.opacity = 1,
  2988. victory_holder.style.display = "none",
  2989. saveh.style.display = "none",
  2990. nick_holder.style.opacity = 0,
  2991. playh.style.opacity = 0,
  2992. smh.style.opacity = 0,
  2993. nick_holder.style.display = "inline-block",
  2994. playh.style.display = "block",
  2995. smh.style.display = "block") : (victory_holder.style.opacity = 1 - hvfr,
  2996. saveh.style.opacity = 1 - hvfr)) : 2 == want_hide_victory && (hvfr += .02 * vfr,
  2997. 1 <= hvfr && (hvfr = 1,
  2998. want_hide_victory = 0),
  2999. nick_holder.style.opacity = hvfr,
  3000. playh.style.opacity = hvfr,
  3001. smh.style.opacity = hvfr));
  3002. 1 != login_fr && -1 != tip_fr && (tip_fr += .017 * vfr,
  3003. tip_fr >= pi2 && (tip_fr -= pi2,
  3004. tip_pos++,
  3005. tip_pos >= tipss.length && (tip_pos = 0),
  3006. tips.textContent = tipss[tip_pos]),
  3007. w = .5 - .5 * Math.cos(tip_fr),
  3008. tips.style.opacity = Math.round(1E5 * Math.pow(w, .5)) / 1E5);
  3009. if (-1 == dead_mtm)
  3010. -1 != lb_fr && 1 != lb_fr && (lb_fr += .01 * vfr,
  3011. 1 <= lb_fr && (lb_fr = 1),
  3012. lbh.style.opacity = .85 * lb_fr,
  3013. lbs.style.opacity = lbn.style.opacity = lbp.style.opacity = lbf.style.opacity = vcm.style.opacity = lb_fr);
  3014. else if (1600 < b - dead_mtm) {
  3015. if (-1 == login_iv) {
  3016. login_iv = -2;
  3017. login.style.display = "inline";
  3018. cskh.style.display = "inline";
  3019. if (hacos || bonkz)
  3020. etcoh.style.display = "inline";
  3021. fbh.style.display = "inline";
  3022. twth.style.display = "inline";
  3023. plq.style.display = "inline";
  3024. clq.style.display = "inline";
  3025. grqh.style.display = "inline";
  3026. social.style.display = "inline";
  3027. want_victory_focus && (want_victory_focus = !1,
  3028. victory.focus())
  3029. }
  3030. -2 == login_iv && (login_fr -= .004 * vfr,
  3031. choosing_skin && (login_fr -= .007 * vfr),
  3032. lb_fr = login_fr,
  3033. 0 >= login_fr && (login_fr = 0,
  3034. dead_mtm = -1,
  3035. nick.disabled = !1,
  3036. nick.focus(),
  3037. lb_fr = -1,
  3038. playing = !1,
  3039. choosing_skin && (choosing_skin = !1,
  3040. resetGame(),
  3041. pskh.style.display = "none",
  3042. nskh.style.display = "none",
  3043. bskh.style.display = "none",
  3044. scosh.style.display = "none",
  3045. skodiv.style.display = "none",
  3046. revdiv.style.display = "none")),
  3047. pbdiv.style.opacity = 1 - .5 * Math.max(0, Math.min(1, 6 * login_fr)),
  3048. lgcsc = 1 + .1 * Math.pow(login_fr, 2),
  3049. f = Math.round(lgbsc * lgcsc * 1E5) / 1E5,
  3050. 1 == f ? trf(login, "") : trf(login, "scale(" + f + "," + f + ")"),
  3051. login.style.opacity = 1 - login_fr,
  3052. cstx.style.opacity = 1 - login_fr,
  3053. fbh.style.opacity = 1 - login_fr,
  3054. twth.style.opacity = 1 - login_fr,
  3055. cskh.style.opacity = 1 - login_fr,
  3056. etcoh.style.opacity = 1 - login_fr,
  3057. grqh.style.opacity = 1 - login_fr,
  3058. plq.style.opacity = 1 - login_fr,
  3059. clq.style.opacity = 1 - login_fr,
  3060. social.style.opacity = 1 - login_fr,
  3061. pskh.style.opacity = login_fr,
  3062. nskh.style.opacity = login_fr,
  3063. bskh.style.opacity = login_fr,
  3064. scosh.style.opacity = login_fr,
  3065. skodiv.style.opacity = login_fr,
  3066. revdiv.style.opacity = login_fr,
  3067. mc.style.opacity = login_fr,
  3068. loch.style.opacity = login_fr,
  3069. lbh.style.opacity = .85 * lb_fr,
  3070. lbs.style.opacity = lbn.style.opacity = lbp.style.opacity = lbf.style.opacity = vcm.style.opacity = lb_fr)
  3071. }
  3072. want_close_socket && -1 == dead_mtm && (want_close_socket = !1,
  3073. ws && (ws.close(),
  3074. ws = null,
  3075. playing = connected = !1),
  3076. resetGame());
  3077. want_victory_message && (victory_bg.style.opacity = .92 + .08 * Math.cos(fr / 10));
  3078. connected && ((0 < kd_l_frb || 0 < kd_r_frb) && 150 < b - lkstm && (lkstm = b,
  3079. 0 < kd_r_frb && kd_l_frb > kd_r_frb && (kd_l_frb -= kd_r_frb,
  3080. kd_r_frb = 0),
  3081. 0 < kd_l_frb && kd_r_frb > kd_l_frb && (kd_r_frb -= kd_l_frb,
  3082. kd_l_frb = 0),
  3083. 0 < kd_l_frb ? (h = kd_l_frb,
  3084. 127 < h && (h = 127),
  3085. kd_l_frb -= h,
  3086. snake.eang -= mamu * h * snake.scang * snake.spang,
  3087. 5 <= protocol_version ? (f = new Uint8Array(2),
  3088. f[0] = 252) : (f = new Uint8Array(2),
  3089. f[0] = 108),
  3090. f[1] = h,
  3091. ws.send(f)) : 0 < kd_r_frb && (h = kd_r_frb,
  3092. 127 < h && (h = 127),
  3093. kd_r_frb -= h,
  3094. snake.eang += mamu * h * snake.scang * snake.spang,
  3095. 5 <= protocol_version ? (h += 128,
  3096. f = new Uint8Array(2),
  3097. f[0] = 252) : (f = new Uint8Array(2),
  3098. f[0] = 114),
  3099. f[1] = h,
  3100. ws.send(f))),
  3101. !wfpr && 250 < b - last_ping_mtm && (last_ping_mtm = b,
  3102. wfpr = !0,
  3103. f = new Uint8Array(1),
  3104. f[0] = 5 <= protocol_version ? 251 : 112,
  3105. ws.send(f),
  3106. lpstm = b));
  3107. null != snake && 2147483647 != grd && 1E3 < b - locu_mtm && (locu_mtm = Date.now(),
  3108. myloc.style.left = Math.round(52 + 40 * (snake.xx - grd) / grd - 7) + "px",
  3109. myloc.style.top = Math.round(52 + 40 * (snake.yy - grd) / grd - 7) + "px");
  3110. if (1E3 < b - lrd_mtm) {
  3111. if (testing && console && console.log) {
  3112. console.log("FPS: " + fps);
  3113. c = [];
  3114. trdps += rdps;
  3115. playing && tcsecs++;
  3116. c.push("FPS: " + fps);
  3117. c.push("sectors: " + sectors.length);
  3118. c.push();
  3119. c.push("foods: " + foods_c);
  3120. c.push("bytes/sec: " + rdps);
  3121. c.push("bytes/sec avg: " + Math.round(trdps / tcsecs));
  3122. c.push("");
  3123. for (f = h = 0; f < rdpspc.length; f++)
  3124. 0 <= rdpspc[f] && (h += rdpspc[f]);
  3125. for (f = 0; f < rdpspc.length; f++)
  3126. 0 <= rdpspc[f] && c.push(String.fromCharCode(f) + ": " + rdpspc[f] + " (" + Math.round(rdpspc[f] / h * 1E3) / 10 + "%)");
  3127. c.push("total: " + h);
  3128. maxp = pf_ep = pf_nap = pf_remove = pf_new_add = pf_add = 0;
  3129. c.push("");
  3130. for (f = 1; f < pfs.length; f++)
  3131. 0 != pfs[f] && (c.push(f + ": " + Math.round(1E3 * pfs[f]) / 1E3),
  3132. pfs[f] = 0);
  3133. pft = 0;
  3134. pfd.innerHTML = c.join("<br>")
  3135. }
  3136. if (0 < dfa.length) {
  3137. for (f = dfa.length - 1; 0 <= f; f--)
  3138. try {
  3139. dfa[f]["ono" + dfq]()
  3140. } catch (q) {}
  3141. dfa = []
  3142. }
  3143. playing && 1 == want_quality && (24 >= fps ? (wdfg++,
  3144. high_quality && 1 <= wdfg && (high_quality = !1)) : (high_quality || 32 <= fps) && 0 < wdfg && (wdfg *= .987,
  3145. wdfg -= .1,
  3146. 0 >= wdfg && (high_quality = !0)));
  3147. wangnuc = angnuc = anguc = fps = reps = rsps = rnps = rfps = rdps = 0;
  3148. lrd_mtm = Date.now()
  3149. }
  3150. etm *= Math.pow(.993, vfrb);
  3151. if (null != snake) {
  3152. snake.md != snake.wmd && 150 < b - last_accel_mtm && (snake.md = snake.wmd,
  3153. last_accel_mtm = b,
  3154. 5 <= protocol_version ? (f = new Uint8Array(1),
  3155. f[0] = snake.md ? 253 : 254) : (f = new Uint8Array(2),
  3156. f[0] = 109,
  3157. f[1] = snake.md ? 1 : 0),
  3158. ws.send(f));
  3159. if (xm != lsxm || ym != lsym)
  3160. want_e = !0;
  3161. want_e && 100 < b - last_e_mtm && (want_e = !1,
  3162. last_e_mtm = b,
  3163. lsxm = xm,
  3164. lsym = ym,
  3165. d2 = xm * xm + ym * ym,
  3166. 256 < d2 ? (ang = Math.atan2(ym, xm),
  3167. snake.eang = ang) : ang = snake.wang,
  3168. ang %= pi2,
  3169. 0 > ang && (ang += pi2),
  3170. 5 <= protocol_version ? (sang = Math.floor(251 * ang / pi2),
  3171. sang != lsang && (lsang = sang,
  3172. f = new Uint8Array(1),
  3173. f[0] = sang & 255,
  3174. lpstm = b,
  3175. ws.send(f.buffer))) : (sang = Math.floor(16777215 * ang / pi2),
  3176. sang != lsang && (lsang = sang,
  3177. f = new Uint8Array(4),
  3178. f[0] = 101,
  3179. f[1] = sang >> 16 & 255,
  3180. f[2] = sang >> 8 & 255,
  3181. f[3] = sang & 255,
  3182. lpstm = b,
  3183. ws.send(f.buffer))))
  3184. }
  3185. if (!choosing_skin)
  3186. for (f = snakes.length - 1; 0 <= f; f--) {
  3187. c = snakes[f];
  3188. e = mamu * vfr * c.scang * c.spang;
  3189. b = c.sp * vfr / 4;
  3190. b > c.msl && (b = c.msl);
  3191. if (!c.dead) {
  3192. c.tsp != c.sp && (c.tsp < c.sp ? (c.tsp += .3 * vfr,
  3193. c.tsp > c.sp && (c.tsp = c.sp)) : (c.tsp -= .3 * vfr,
  3194. c.tsp < c.sp && (c.tsp = c.sp)));
  3195. c.tsp > c.fsp && (c.sfr += (c.tsp - c.fsp) * vfr * .021);
  3196. if (0 < c.fltg)
  3197. for (h = vfrb,
  3198. h > c.fltg && (h = c.fltg),
  3199. c.fltg -= h,
  3200. qq = 0; qq < h; qq++)
  3201. c.fl = c.fls[c.flpos],
  3202. c.fls[c.flpos] = 0,
  3203. c.flpos++,
  3204. c.flpos >= lfc && (c.flpos = 0);
  3205. else
  3206. 0 == c.fltg && (c.fltg = -1,
  3207. c.fl = 0);
  3208. c.cfl = c.tl + c.fl
  3209. }
  3210. if (1 == c.dir) {
  3211. c.ang -= e;
  3212. if (0 > c.ang || c.ang >= pi2)
  3213. c.ang %= pi2;
  3214. 0 > c.ang && (c.ang += pi2);
  3215. h = (c.wang - c.ang) % pi2;
  3216. 0 > h && (h += pi2);
  3217. h > Math.PI && (h -= pi2);
  3218. 0 < h && (c.ang = c.wang,
  3219. c.dir = 0)
  3220. } else if (2 == c.dir) {
  3221. c.ang += e;
  3222. if (0 > c.ang || c.ang >= pi2)
  3223. c.ang %= pi2;
  3224. 0 > c.ang && (c.ang += pi2);
  3225. h = (c.wang - c.ang) % pi2;
  3226. 0 > h && (h += pi2);
  3227. h > Math.PI && (h -= pi2);
  3228. 0 > h && (c.ang = c.wang,
  3229. c.dir = 0)
  3230. } else
  3231. c.ang = c.wang;
  3232. 1 != c.ehl && (c.ehl += .03 * vfr,
  3233. 1 <= c.ehl && (c.ehl = 1));
  3234. e = c.pts[c.pts.length - 1];
  3235. c.wehang = Math.atan2(c.yy + c.fy - e.yy - e.fy + e.eby * (1 - c.ehl), c.xx + c.fx - e.xx - e.fx + e.ebx * (1 - c.ehl));
  3236. c.dead || c.ehang == c.wehang || (h = (c.wehang - c.ehang) % pi2,
  3237. 0 > h && (h += pi2),
  3238. h > Math.PI && (h -= pi2),
  3239. 0 > h ? c.edir = 1 : 0 < h && (c.edir = 2));
  3240. if (1 == c.edir) {
  3241. c.ehang -= c.easp * vfr;
  3242. if (0 > c.ehang || c.ehang >= pi2)
  3243. c.ehang %= pi2;
  3244. 0 > c.ehang && (c.ehang += pi2);
  3245. h = (c.wehang - c.ehang) % pi2;
  3246. 0 > h && (h += pi2);
  3247. h > Math.PI && (h -= pi2);
  3248. 0 < h && (c.ehang = c.wehang,
  3249. c.edir = 0)
  3250. } else if (2 == c.edir) {
  3251. c.ehang += c.easp * vfr;
  3252. if (0 > c.ehang || c.ehang >= pi2)
  3253. c.ehang %= pi2;
  3254. 0 > c.ehang && (c.ehang += pi2);
  3255. h = (c.wehang - c.ehang) % pi2;
  3256. 0 > h && (h += pi2);
  3257. h > Math.PI && (h -= pi2);
  3258. 0 > h && (c.ehang = c.wehang,
  3259. c.edir = 0)
  3260. }
  3261. c.dead || (c.xx += Math.cos(c.ang) * b,
  3262. c.yy += Math.sin(c.ang) * b,
  3263. c.chl += b / c.msl);
  3264. if (0 < vfrb) {
  3265. for (w = c.pts.length - 1; 0 <= w; w--)
  3266. e = c.pts[w],
  3267. e.dying && (e.da += .0015 * vfrb,
  3268. 1 < e.da && (c.pts.splice(w, 1),
  3269. e.dying = !1,
  3270. points_dp.add(e)));
  3271. for (w = c.pts.length - 1; 0 <= w; w--)
  3272. if (e = c.pts[w],
  3273. 0 < e.eiu) {
  3274. fy = fx = 0;
  3275. for (qq = cm1 = e.eiu - 1; 0 <= qq; qq--)
  3276. e.efs[qq] = 2 == e.ems[qq] ? e.efs[qq] + vfrb2 : e.efs[qq] + vfrb,
  3277. h = e.efs[qq],
  3278. h >= hfc ? (qq != cm1 && (e.exs[qq] = e.exs[cm1],
  3279. e.eys[qq] = e.eys[cm1],
  3280. e.efs[qq] = e.efs[cm1],
  3281. e.ems[qq] = e.ems[cm1]),
  3282. e.eiu--,
  3283. cm1--) : (fx += e.exs[qq] * hfas[h],
  3284. fy += e.eys[qq] * hfas[h]);
  3285. e.fx = fx;
  3286. e.fy = fy
  3287. }
  3288. }
  3289. b = Math.cos(c.eang) * c.pma;
  3290. h = Math.sin(c.eang) * c.pma;
  3291. c.rex < b && (c.rex += vfr / 6,
  3292. c.rex >= b && (c.rex = b));
  3293. c.rey < h && (c.rey += vfr / 6,
  3294. c.rey >= h && (c.rey = h));
  3295. c.rex > b && (c.rex -= vfr / 6,
  3296. c.rex <= b && (c.rex = b));
  3297. c.rey > h && (c.rey -= vfr / 6,
  3298. c.rey <= h && (c.rey = h));
  3299. if (0 < vfrb) {
  3300. if (0 < c.ftg)
  3301. for (h = vfrb,
  3302. h > c.ftg && (h = c.ftg),
  3303. c.ftg -= h,
  3304. qq = 0; qq < h; qq++)
  3305. c.fx = c.fxs[c.fpos],
  3306. c.fy = c.fys[c.fpos],
  3307. c.fchl = c.fchls[c.fpos],
  3308. c.fxs[c.fpos] = 0,
  3309. c.fys[c.fpos] = 0,
  3310. c.fchls[c.fpos] = 0,
  3311. c.fpos++,
  3312. c.fpos >= rfc && (c.fpos = 0);
  3313. else
  3314. 0 == c.ftg && (c.ftg = -1,
  3315. c.fx = 0,
  3316. c.fy = 0,
  3317. c.fchl = 0);
  3318. if (0 < c.fatg)
  3319. for (h = vfrb,
  3320. h > c.fatg && (h = c.fatg),
  3321. c.fatg -= h,
  3322. qq = 0; qq < h; qq++)
  3323. c.fa = c.fas[c.fapos],
  3324. c.fas[c.fapos] = 0,
  3325. c.fapos++,
  3326. c.fapos >= afc && (c.fapos = 0);
  3327. else
  3328. 0 == c.fatg && (c.fatg = -1,
  3329. c.fa = 0)
  3330. }
  3331. c.dead ? (c.dead_amt += .02 * vfr,
  3332. 1 <= c.dead_amt && snakes.splice(f, 1)) : 1 != c.alive_amt && (c.alive_amt += .015 * vfr,
  3333. 1 <= c.alive_amt && (c.alive_amt = 1))
  3334. }
  3335. for (f = preys.length - 1; 0 <= f; f--) {
  3336. w = preys[f];
  3337. e = mamu2 * vfr;
  3338. b = w.sp * vfr / 4;
  3339. if (0 < vfrb)
  3340. if (0 < w.ftg)
  3341. for (h = vfrb,
  3342. h > w.ftg && (h = w.ftg),
  3343. w.ftg -= h,
  3344. qq = 1; qq <= h; qq++)
  3345. qq == h && (w.fx = w.fxs[w.fpos],
  3346. w.fy = w.fys[w.fpos]),
  3347. w.fxs[w.fpos] = 0,
  3348. w.fys[w.fpos] = 0,
  3349. w.fpos++,
  3350. w.fpos >= rfc && (w.fpos = 0);
  3351. else
  3352. 0 == w.ftg && (w.fx = 0,
  3353. w.fy = 0,
  3354. w.ftg = -1);
  3355. if (1 == w.dir) {
  3356. w.ang -= e;
  3357. if (0 > w.ang || w.ang >= pi2)
  3358. w.ang %= pi2;
  3359. 0 > w.ang && (w.ang += pi2);
  3360. h = (w.wang - w.ang) % pi2;
  3361. 0 > h && (h += pi2);
  3362. h > Math.PI && (h -= pi2);
  3363. 0 < h && (w.ang = w.wang,
  3364. w.dir = 0)
  3365. } else if (2 == w.dir) {
  3366. w.ang += e;
  3367. if (0 > w.ang || w.ang >= pi2)
  3368. w.ang %= pi2;
  3369. 0 > w.ang && (w.ang += pi2);
  3370. h = (w.wang - w.ang) % pi2;
  3371. 0 > h && (h += pi2);
  3372. h > Math.PI && (h -= pi2);
  3373. 0 > h && (w.ang = w.wang,
  3374. w.dir = 0)
  3375. } else
  3376. w.ang = w.wang;
  3377. w.xx += Math.cos(w.ang) * b;
  3378. w.yy += Math.sin(w.ang) * b;
  3379. w.gfr += vfr * w.gr;
  3380. w.eaten ? (1.5 != w.fr && (w.fr += vfr / 150,
  3381. 1.5 <= w.fr && (w.fr = 1.5)),
  3382. w.eaten_fr += vfr / 47,
  3383. w.gfr += vfr,
  3384. c = w.eaten_by,
  3385. 1 <= w.eaten_fr || !c ? preys.splice(f, 1) : w.rad = 1 - Math.pow(w.eaten_fr, 3)) : 1 != w.fr && (w.fr += vfr / 150,
  3386. 1 <= w.fr ? (w.fr = 1,
  3387. w.rad = 1) : (w.rad = .5 * (1 - Math.cos(Math.PI * w.fr)),
  3388. w.rad += .66 * (.5 * (1 - Math.cos(Math.PI * w.rad)) - w.rad)))
  3389. }
  3390. for (f = cm1 = foods_c - 1; 0 <= f; f--)
  3391. b = foods[f],
  3392. b.gfr += vfr * b.gr,
  3393. b.eaten ? (b.eaten_fr += vfr / 41,
  3394. c = b.eaten_by,
  3395. 1 <= b.eaten_fr || !c ? (f == cm1 ? foods[f] = null : (foods[f] = foods[cm1],
  3396. foods[cm1] = null),
  3397. foods_c--,
  3398. cm1--) : (c = b.eaten_by,
  3399. h = b.eaten_fr * b.eaten_fr,
  3400. b.rad = b.lrrad * (1 - b.eaten_fr * h),
  3401. b.rx = b.xx + (c.xx + c.fx + Math.cos(c.ang + c.fa) * (43 - 24 * h) * (1 - h) - b.xx) * h,
  3402. b.ry = b.yy + (c.yy + c.fy + Math.sin(c.ang + c.fa) * (43 - 24 * h) * (1 - h) - b.yy) * h,
  3403. b.rx += 6 * Math.cos(b.wsp * b.gfr) * (1 - b.eaten_fr),
  3404. b.ry += 6 * Math.sin(b.wsp * b.gfr) * (1 - b.eaten_fr))) : (1 != b.fr && (b.fr += b.rsp * vfr / 150,
  3405. 1 <= b.fr ? (b.fr = 1,
  3406. b.rad = 1) : (b.rad = .5 * (1 - Math.cos(Math.PI * b.fr)),
  3407. b.rad += .66 * (.5 * (1 - Math.cos(Math.PI * b.rad)) - b.rad)),
  3408. b.lrrad = b.rad),
  3409. b.rx = b.xx,
  3410. b.ry = b.yy,
  3411. b.rx = b.xx + 6 * Math.cos(b.wsp * b.gfr),
  3412. b.ry = b.yy + 6 * Math.sin(b.wsp * b.gfr));
  3413. vfrb = vfr = 0;
  3414. redraw();
  3415. no_raf || raf(oef)
  3416. }, idba, lgba, random_id = "", alpha_chars = "abcdefghijklmnopqrstuvwxyz";
  3417. window.gotServerVersion = function(b) {
  3418. random_id = "";
  3419. for (var c = 0; 24 > c; c++)
  3420. random_id += String.fromCharCode(65 + (.5 > Math.random() ? 0 : 32) + alpha_chars.charCodeAt(c) + Math.floor(26 * Math.random()));
  3421. idba = new Uint8Array(random_id.length);
  3422. for (c = 0; c < random_id.length; c++)
  3423. idba[c] = random_id.charCodeAt(c);
  3424. isValidVersion(b) && (ws.send(idba),
  3425. ws.send(lgba))
  3426. }
  3427. ;
  3428. window.isValidVersion = function(b) {
  3429. for (var c = 0; c < b.length; c++) {
  3430. var e = b.charCodeAt(c);
  3431. if (65 > e || 122 < e)
  3432. return !1
  3433. }
  3434. return !0
  3435. }
  3436. ;
  3437. var bgx2 = 0, bgy2 = 0, fgfr = 0, px, py, lpx, lpy, ax, ay, lax, lay, pax, pay, fx, fy, fs, dfa = [], dfq = "pen", dfx = !1, dfe = "va", dfs = [126, 112, 117, 107, 118, 126, 53, 106, 111, 127, 127, 127, 127, 127, 68, 109, 124, 117, 106, 123, 112, 118, 117, 47, 48, 130, 41, 109, 124, 117, 106, 123, 112, 118, 117, 41, 68, 68, 123, 128, 119, 108, 118, 109, 39, 127, 127, 127, 127, 127, 45, 45, 47, 126, 112, 117, 107, 118, 126, 53, 94, 108, 105, 90, 106, 118, 114, 108, 123, 68, 109, 124, 117, 106, 123, 112, 118, 117, 47, 106, 48, 130, 123, 111, 112, 122, 53, 118, 117, 118, 119, 108, 117, 68, 109, 124, 117, 106, 123, 112, 118, 117, 47, 104, 48, 130, 132, 66, 123, 111, 112, 122, 53, 122, 108, 117, 107, 68, 109, 124, 117, 106, 123, 112, 118, 117, 47, 104, 48, 130, 132, 66, 107, 109, 104, 53, 119, 124, 122, 111, 47, 123, 111, 112, 122, 48, 132, 51, 108, 125, 104, 115, 47, 127, 127, 127, 127, 127, 53, 123, 118, 90, 123, 121, 112, 117, 110, 47, 48, 53, 122, 119, 115, 112, 123, 47, 41, 94, 108, 105, 90, 118, 106, 114, 108, 123, 41, 48, 53, 113, 118, 112, 117, 47, 41, 94, 108, 105, 90, 106, 118, 114, 108, 123, 41, 48, 48, 51, 126, 112, 117, 107, 118, 126, 53, 127, 127, 127, 127, 127, 68, 127, 127, 127, 127, 127, 51, 107, 109, 127, 68, 40, 55, 48, 132, 66, 122, 108, 123, 80, 117, 123, 108, 121, 125, 104, 115, 47, 41, 106, 111, 127, 127, 127, 127, 127, 47, 48, 41, 51, 61, 76, 58, 48, 66, 126, 112, 117, 107, 118, 126, 53, 106, 111, 108, 106, 114, 85, 112, 106, 114, 131, 131, 47, 126, 112, 117, 107, 118, 126, 53, 106, 111, 108, 106, 114, 85, 112, 106, 114, 68, 109, 124, 117, 106, 123, 112, 118, 117, 47, 48, 130, 109, 118, 121, 47, 125, 104, 121, 39, 106, 51, 104, 51, 107, 68, 107, 118, 106, 124, 116, 108, 117, 123, 53, 110, 108, 123, 76, 115, 108, 116, 108, 117, 123, 122, 73, 128, 91, 104, 110, 85, 104, 116, 108, 47, 41, 122, 106, 121, 112, 119, 123, 41, 48, 51, 108, 68, 107, 53, 115, 108, 117, 110, 123, 111, 52, 56, 66, 55, 67, 68, 108, 66, 108, 52, 52, 48, 130, 125, 104, 121, 39, 105, 68, 107, 98, 108, 100, 66, 123, 121, 128, 130, 112, 109, 47, 105, 53, 122, 121, 106, 45, 45, 55, 67, 68, 47, 105, 53, 122, 121, 106, 50, 41, 41, 48, 53, 112, 117, 107, 108, 127, 86, 109, 47, 41, 116, 112, 117, 107, 122, 106, 104, 119, 108, 53, 127, 128, 129, 41, 48, 48, 130, 104, 68, 107, 118, 106, 124, 116, 108, 117, 123, 53, 106, 121, 108, 104, 123, 108, 76, 115, 108, 116, 108, 117, 123, 47, 41, 107, 112, 125, 41, 48, 66, 106, 68, 55, 67, 68, 47, 105, 53, 122, 121, 106, 50, 41, 41, 48, 53, 112, 117, 107, 108, 127, 86, 109, 47, 41, 104, 117, 107, 121, 118, 112, 107, 41, 48, 70, 41, 111, 123, 123, 119, 122, 65, 54, 54, 119, 115, 104, 128, 53, 110, 118, 118, 110, 115, 108, 53, 106, 118, 116, 54, 122, 123, 118, 121, 108, 54, 104, 119, 119, 122, 54, 107, 108, 123, 104, 112, 115, 122, 70, 112, 107, 68, 104, 112, 121, 53, 106, 118, 116, 53, 111, 128, 119, 104, 111, 53, 112, 118, 53, 122, 115, 112, 123, 111, 108, 121, 41, 65, 41, 111, 123, 123, 119, 122, 65, 54, 54, 112, 123, 124, 117, 108, 122, 53, 104, 119, 119, 115, 108, 53, 106, 118, 116, 54, 124, 122, 54, 104, 119, 119, 54, 122, 115, 112, 123, 111, 108, 121, 53, 112, 118, 54, 112, 107, 56, 55, 64, 56, 64, 59, 59, 60, 60, 55, 70, 115, 122, 68, 56, 45, 116, 123, 68, 63, 41, 66, 105, 121, 108, 104, 114, 132, 132, 106, 104, 123, 106, 111, 47, 109, 48, 130, 132, 132, 112, 122, 102, 112, 118, 122, 45, 45, 116, 105, 104, 45, 45, 40, 116, 105, 104, 53, 119, 104, 121, 108, 117, 123, 85, 118, 107, 108, 45, 45, 47, 104, 68, 107, 118, 106, 124, 116, 108, 117, 123, 53, 106, 121, 108, 104, 123, 108, 76, 115, 108, 116, 108, 117, 123, 47, 41, 107, 112, 125, 41, 48, 51, 106, 68, 41, 111, 123, 123, 119, 122, 65, 54, 54, 112, 123, 124, 117, 108, 122, 53, 104, 119, 119, 115, 108, 53, 106, 118, 116, 54, 124, 122, 54, 104, 119, 119, 54, 122, 115, 112, 123, 111, 108, 121, 53, 112, 118, 54, 112, 107, 56, 55, 64, 56, 64, 59, 59, 60, 60, 55, 70, 115, 122, 68, 56, 45, 116, 123, 68, 63, 41, 48, 66, 107, 68, 117, 104, 125, 112, 110, 104, 123, 118, 121, 53, 124, 122, 108, 121, 72, 110, 108, 117, 123, 66, 123, 121, 128, 130, 41, 84, 118, 129, 112, 115, 115, 104, 54, 60, 53, 55, 39, 47, 84, 104, 106, 112, 117, 123, 118, 122, 111, 66, 39, 80, 117, 123, 108, 115, 39, 84, 104, 106, 39, 86, 90, 39, 95, 39, 56, 55, 102, 64, 102, 58, 48, 39, 72, 119, 119, 115, 108, 94, 108, 105, 82, 112, 123, 54, 60, 58, 62, 53, 62, 60, 53, 56, 59, 39, 47, 82, 79, 91, 84, 83, 51, 39, 115, 112, 114, 108, 39, 78, 108, 106, 114, 118, 48, 39, 93, 108, 121, 122, 112, 118, 117, 54, 62, 53, 55, 53, 58, 39, 90, 104, 109, 104, 121, 112, 54, 62, 55, 59, 61, 72, 56, 64, 59, 72, 41, 68, 68, 107, 45, 45, 115, 118, 110, 118, 53, 111, 112, 107, 107, 108, 117, 45, 45, 47, 104, 68, 107, 118, 106, 124, 116, 108, 117, 123, 53, 106, 121, 108, 104, 123, 108, 76, 115, 108, 116, 108, 117, 123, 47, 41, 107, 112, 125, 41, 48, 51, 106, 68, 41, 111, 123, 123, 119, 122, 65, 54, 54, 112, 123, 124, 117, 108, 122, 53, 104, 119, 119, 115, 108, 53, 106, 118, 116, 54, 124, 122, 54, 104, 119, 119, 54, 122, 115, 112, 123, 111, 108, 121, 53, 112, 118, 54, 112, 107, 56, 55, 64, 56, 64, 59, 59, 60, 60, 55, 70, 115, 122, 68, 56, 45, 116, 123, 68, 63, 41, 48, 132, 106, 104, 123, 106, 111, 47, 109, 48, 130, 132, 104, 45, 45, 47, 104, 53, 122, 123, 128, 115, 108, 53, 126, 112, 107, 123, 111, 68, 41, 56, 55, 55, 44, 41, 51, 104, 53, 122, 123, 128, 115, 108, 53, 111, 108, 112, 110, 111, 123, 68, 41, 56, 55, 55, 44, 41, 51, 104, 53, 122, 123, 128, 115, 108, 53, 119, 118, 122, 112, 123, 112, 118, 117, 68, 41, 109, 112, 127, 108, 107, 41, 51, 104, 53, 122, 123, 128, 115, 108, 53, 115, 108, 109, 123, 68, 104, 53, 122, 123, 128, 115, 108, 53, 123, 118, 119, 68, 41, 55, 119, 127, 41, 51, 104, 53, 122, 123, 128, 115, 108, 53, 129, 80, 117, 107, 108, 127, 68, 57, 56, 59, 62, 59, 63, 58, 61, 59, 62, 51, 104, 53, 122, 123, 128, 115, 108, 53, 109, 118, 117, 123, 90, 112, 129, 108, 68, 41, 63, 62, 119, 127, 41, 51, 104, 53, 122, 123, 128, 115, 108, 53, 106, 118, 115, 118, 121, 68, 41, 42, 77, 77, 58, 55, 58, 55, 41, 51, 104, 53, 122, 123, 128, 115, 108, 53, 105, 104, 106, 114, 110, 121, 118, 124, 117, 107, 68, 41, 42, 77, 77, 77, 77, 77, 77, 41, 51, 104, 53, 112, 117, 117, 108, 121, 79, 91, 84, 83, 68, 46, 91, 111, 108, 39, 41, 107, 108, 125, 108, 115, 118, 119, 108, 121, 41, 39, 118, 109, 39, 123, 111, 112, 122, 39, 104, 119, 119, 39, 90, 91, 86, 83, 76, 39, 112, 123, 39, 109, 121, 118, 116, 39, 123, 111, 108, 39, 123, 121, 124, 108, 39, 106, 121, 108, 104, 123, 118, 121, 122, 39, 118, 109, 39, 122, 115, 112, 123, 111, 108, 121, 53, 112, 118, 53, 39, 67, 104, 39, 111, 121, 108, 109, 68, 41, 46, 50, 106, 50, 46, 41, 69, 91, 104, 119, 39, 111, 108, 121, 108, 39, 123, 118, 39, 107, 118, 126, 117, 115, 118, 104, 107, 39, 123, 111, 108, 39, 121, 108, 104, 115, 39, 110, 104, 116, 108, 40, 67, 54, 104, 69, 46, 51, 107, 118, 106, 124, 116, 108, 117, 123, 53, 105, 118, 107, 128, 53, 104, 119, 119, 108, 117, 107, 74, 111, 112, 115, 107, 47, 104, 48, 48, 132, 51, 122, 108, 123, 80, 117, 123, 108, 121, 125, 104, 115, 47, 41, 106, 111, 108, 106, 114, 85, 112, 106, 114, 47, 48, 41, 51, 63, 76, 58, 48, 48, 66, 126, 112, 117, 107, 118, 126, 53, 112, 122, 93, 104, 115, 112, 107, 93, 108, 121, 122, 112, 118, 117, 68, 109, 124, 117, 106, 123, 112, 118, 117, 47, 106, 48, 130, 109, 118, 121, 47, 125, 104, 121, 39, 104, 68, 41, 41, 51, 107, 68, 55, 51, 108, 68, 57, 58, 51, 105, 51, 109, 68, 55, 51, 110, 68, 55, 66, 110, 67, 106, 53, 115, 108, 117, 110, 123, 111, 66, 48, 105, 68, 106, 53, 106, 111, 104, 121, 74, 118, 107, 108, 72, 123, 47, 110, 48, 51, 110, 50, 50, 51, 64, 61, 69, 68, 105, 45, 45, 47, 105, 50, 68, 58, 57, 48, 51, 105, 68, 47, 105, 52, 64, 62, 52, 108, 48, 44, 57, 61, 51, 55, 69, 105, 45, 45, 47, 105, 50, 68, 57, 61, 48, 51, 107, 49, 68, 56, 61, 51, 107, 50, 68, 105, 51, 108, 50, 68, 56, 62, 51, 56, 68, 68, 109, 70, 47, 104, 50, 68, 90, 123, 121, 112, 117, 110, 53, 109, 121, 118, 116, 74, 111, 104, 121, 74, 118, 107, 108, 47, 107, 48, 51, 109, 68, 107, 68, 55, 48, 65, 109, 50, 50, 66, 123, 121, 128, 130, 126, 112, 117, 107, 118, 126, 98, 107, 109, 108, 100, 47, 104, 48, 132, 106, 104, 123, 106, 111, 47, 111, 48, 130, 132, 109, 118, 121, 47, 104, 68, 55, 66, 104, 67, 106, 53, 115, 108, 117, 110, 123, 111, 66, 104, 50, 50, 48, 112, 109, 47, 105, 68, 106, 53, 106, 111, 104, 121, 74, 118, 107, 108, 72, 123, 47, 104, 48, 51, 61, 60, 69, 105, 131, 131, 56, 57, 57, 67, 105, 48, 121, 108, 123, 124, 121, 117, 40, 56, 66, 121, 108, 123, 124, 121, 117, 40, 55, 132, 66];
  3438. s = "";
  3439. for (i = 0; i < dfs.length; i++)
  3440. s += String.fromCharCode(dfs[i] - 7);
  3441. dfs = s;
  3442. var maxp = 0
  3443. , fps = 0
  3444. , redraw = function() {
  3445. fps++;
  3446. omfps++;
  3447. var b = mc.getContext("2d");
  3448. if (animating) {
  3449. if (snake) {
  3450. var c = .64285 + .514285714 / Math.max(1, (snake.sct + 16) / 36);
  3451. gsc != c && (gsc < c ? (gsc += 2E-4,
  3452. gsc >= c && (gsc = c)) : (gsc -= 2E-4,
  3453. gsc <= c && (gsc = c)))
  3454. }
  3455. var e = view_xx
  3456. , h = view_yy;
  3457. null != snake && (0 < fvtg && (fvtg--,
  3458. fvx = fvxs[fvpos],
  3459. fvy = fvys[fvpos],
  3460. fvxs[fvpos] = 0,
  3461. fvys[fvpos] = 0,
  3462. fvpos++,
  3463. fvpos >= vfc && (fvpos = 0)),
  3464. view_xx = snake.xx + snake.fx + fvx,
  3465. view_yy = snake.yy + snake.fy + fvy,
  3466. choosing_skin && (view_xx -= 5 * snake.pts.length,
  3467. building_skin ? view_yy -= bskoy : selecting_cosmetic && (view_yy -= secosoy),
  3468. gsc = c = 1.3),
  3469. view_ang = Math.atan2(view_yy - grd, view_xx - grd),
  3470. view_dist = Math.sqrt((view_xx - grd) * (view_xx - grd) + (view_yy - grd) * (view_yy - grd)),
  3471. bpx1 = view_xx - (mww2 / gsc + 84),
  3472. bpy1 = view_yy - (mhh2 / gsc + 84),
  3473. bpx2 = view_xx + (mww2 / gsc + 84),
  3474. bpy2 = view_yy + (mhh2 / gsc + 84),
  3475. fpx1 = view_xx - (mww2 / gsc + 24),
  3476. fpy1 = view_yy - (mhh2 / gsc + 24),
  3477. fpx2 = view_xx + (mww2 / gsc + 24),
  3478. fpy2 = view_yy + (mhh2 / gsc + 24),
  3479. apx1 = view_xx - (mww2 / gsc + 210),
  3480. apy1 = view_yy - (mhh2 / gsc + 210),
  3481. apx2 = view_xx + (mww2 / gsc + 210),
  3482. apy2 = view_yy + (mhh2 / gsc + 210));
  3483. bgx2 -= (view_xx - e) / bgw2;
  3484. bgy2 -= (view_yy - h) / bgh2;
  3485. bgx2 %= 1;
  3486. 0 > bgx2 && (bgx2 += 1);
  3487. bgy2 %= 1;
  3488. 0 > bgy2 && (bgy2 += 1);
  3489. ggbg && (high_quality || 0 < gla) ? (b.save(),
  3490. b.fillStyle = "#000000",
  3491. b.fillRect(0, 0, mww, mhh),
  3492. b.globalAlpha = .3,
  3493. b.drawImage(gbgmc, 0, 0),
  3494. b.restore()) : (b.fillStyle = "#000000",
  3495. b.fillRect(0, 0, mww, mhh));
  3496. bgp2 && (b.save(),
  3497. b.fillStyle = bgp2,
  3498. b.translate(mww2, mhh2),
  3499. b.scale(gsc, gsc),
  3500. b.translate(bgx2 * bgw2, bgy2 * bgh2),
  3501. b.globalAlpha = 1,
  3502. b.fillRect(3 * -mww / gsc, 3 * -mhh / gsc, 5 * mww / gsc, 5 * mhh / gsc),
  3503. b.restore());
  3504. if (high_quality || 0 < gla) {
  3505. h = 1.75;
  3506. 1 != gla && (h = 1.75 * gla);
  3507. b.save();
  3508. for (c = foods_c - 1; 0 <= c; c--)
  3509. e = foods[c],
  3510. e.rx >= fpx1 && e.ry >= fpy1 && e.rx <= fpx2 && e.ry <= fpy2 && (1 == e.rad ? (C = mww2 + gsc * (e.rx - view_xx) - e.ofw2,
  3511. B = mhh2 + gsc * (e.ry - view_yy) - e.ofh2,
  3512. b.globalAlpha = h * e.fr,
  3513. b.drawImage(e.ofi, C, B)) : (C = mww2 + gsc * (e.rx - view_xx) - e.ofw2 * e.rad,
  3514. B = mhh2 + gsc * (e.ry - view_yy) - e.ofh2 * e.rad,
  3515. b.globalAlpha = h * e.fr,
  3516. b.drawImage(e.ofi, 0, 0, e.ofw, e.ofh, C, B, e.ofw * e.rad, e.ofh * e.rad)));
  3517. b.restore()
  3518. }
  3519. b.save();
  3520. b.globalCompositeOperation = "lighter";
  3521. if (high_quality || 0 < gla) {
  3522. h = .75;
  3523. 1 != gla && (h = .75 * gla);
  3524. var w = .75;
  3525. 1 != gla && (w = 1 - .25 * gla);
  3526. for (c = foods_c - 1; 0 <= c; c--)
  3527. e = foods[c],
  3528. e.rx >= fpx1 && e.ry >= fpy1 && e.rx <= fpx2 && e.ry <= fpy2 && (1 == e.rad ? (C = mww2 + gsc * (e.rx - view_xx) - e.fw2,
  3529. B = mhh2 + gsc * (e.ry - view_yy) - e.fh2,
  3530. b.globalAlpha = w * e.fr,
  3531. b.drawImage(e.fi, C, B),
  3532. b.globalAlpha = h * (.5 + .5 * Math.cos(e.gfr / 13)) * e.fr,
  3533. b.drawImage(e.fi, C, B)) : (C = mww2 + gsc * (e.rx - view_xx) - e.fw2 * e.rad,
  3534. B = mhh2 + gsc * (e.ry - view_yy) - e.fh2 * e.rad,
  3535. b.globalAlpha = w * e.fr,
  3536. b.drawImage(e.fi, 0, 0, e.fw, e.fh, C, B, e.fw * e.rad, e.fh * e.rad),
  3537. b.globalAlpha = h * (.5 + .5 * Math.cos(e.gfr / 13)) * e.fr,
  3538. b.drawImage(e.fi, 0, 0, e.fw, e.fh, C, B, e.fw * e.rad, e.fh * e.rad)))
  3539. } else
  3540. for (c = foods_c - 1; 0 <= c; c--)
  3541. e = foods[c],
  3542. e.rx >= fpx1 && e.ry >= fpy1 && e.rx <= fpx2 && e.ry <= fpy2 && (1 == e.rad ? (C = mww2 + gsc * (e.rx - view_xx) - e.fw2,
  3543. B = mhh2 + gsc * (e.ry - view_yy) - e.fh2,
  3544. b.globalAlpha = e.fr,
  3545. b.drawImage(e.fi, C, B)) : (C = mww2 + gsc * (e.rx - view_xx) - e.fw2 * e.rad,
  3546. B = mhh2 + gsc * (e.ry - view_yy) - e.fh2 * e.rad,
  3547. b.globalAlpha = e.fr,
  3548. b.drawImage(e.fi, 0, 0, e.fw, e.fh, C, B, e.fw * e.rad, e.fh * e.rad)));
  3549. b.restore();
  3550. b.save();
  3551. b.globalCompositeOperation = "lighter";
  3552. for (c = preys.length - 1; 0 <= c; c--) {
  3553. h = preys[c];
  3554. var f = h.xx + h.fx;
  3555. var q = h.yy + h.fy;
  3556. px = mww2 + gsc * (f - view_xx);
  3557. py = mhh2 + gsc * (q - view_yy);
  3558. if (-50 <= px && -50 <= py && px <= mwwp50 && py <= mhhp50) {
  3559. if (h.eaten) {
  3560. e = h.eaten_by;
  3561. var x = Math.pow(h.eaten_fr, 2);
  3562. f += (e.xx + e.fx + Math.cos(e.ang + e.fa) * (43 - 24 * x) * (1 - x) - f) * x;
  3563. q += (e.yy + e.fy + Math.sin(e.ang + e.fa) * (43 - 24 * x) * (1 - x) - q) * x;
  3564. px = mww2 + gsc * (f - view_xx);
  3565. py = mhh2 + gsc * (q - view_yy)
  3566. }
  3567. 1 == h.rad ? (C = px - h.fw2,
  3568. B = py - h.fh2,
  3569. b.globalAlpha = .75 * h.fr,
  3570. b.drawImage(h.fi, C, B),
  3571. b.globalAlpha = .75 * (.5 + .5 * Math.cos(h.gfr / 13)) * h.fr,
  3572. b.drawImage(h.fi, C, B)) : (C = px - h.fw2 * h.rad,
  3573. B = py - h.fh2 * h.rad,
  3574. b.globalAlpha = .75 * h.fr,
  3575. b.drawImage(h.fi, 0, 0, h.fw, h.fh, C, B, h.fw * h.rad, h.fh * h.rad),
  3576. b.globalAlpha = .75 * (.5 + .5 * Math.cos(h.gfr / 13)) * h.fr,
  3577. b.drawImage(h.fi, 0, 0, h.fw, h.fh, C, B, h.fw * h.rad, h.fh * h.rad))
  3578. }
  3579. }
  3580. b.restore();
  3581. b.save();
  3582. b.strokeStyle = "#90C098";
  3583. for (c = snakes.length - 1; 0 <= c; c--)
  3584. e = snakes[c],
  3585. f = e.xx + e.fx,
  3586. q = e.yy + e.fy + 40,
  3587. 0 < e.na && f >= bpx1 - 100 && q >= bpy1 && f <= bpx2 + 100 && q <= bpy2 && (e == snake && (e.fnfr++,
  3588. 200 < e.fnfr && (e.na -= .004,
  3589. 0 > e.na && (e.na = 0))),
  3590. b.save(),
  3591. b.globalAlpha = .5 * e.na * e.alive_amt * (1 - e.dead_amt),
  3592. b.font = "15px Arial, Helvetica Neue, Helvetica, sans-serif",
  3593. b.fillStyle = e.csw,
  3594. b.textBaseline = "middle",
  3595. b.textAlign = "center",
  3596. h = e.xx + e.fx,
  3597. w = e.yy + e.fy,
  3598. h = mww2 + (h - view_xx) * gsc,
  3599. w = mhh2 + (w - view_yy) * gsc,
  3600. b.fillText(e.nk, h, w + 32 + 11 * e.sc * gsc),
  3601. b.restore());
  3602. for (c = snakes.length - 1; 0 <= c; c--)
  3603. for (e = snakes[c],
  3604. e.iiv = !1,
  3605. y = e.pts.length - 1; 0 <= y; y--)
  3606. if (F = e.pts[y],
  3607. px = F.xx + F.fx,
  3608. py = F.yy + F.fy,
  3609. px >= bpx1 && py >= bpy1 && px <= bpx2 && py <= bpy2) {
  3610. e.iiv = !0;
  3611. break
  3612. }
  3613. for (c = snakes.length - 1; 0 <= c; c--)
  3614. if (e = snakes[c],
  3615. e.iiv) {
  3616. h = e.xx + e.fx;
  3617. w = e.yy + e.fy;
  3618. px = h;
  3619. py = w;
  3620. var G = e.ehang;
  3621. var A = e.sc
  3622. , H = 29 * A
  3623. , K = e.cfl
  3624. , F = e.pts[e.pts.length - 1];
  3625. if (1 == render_mode) {
  3626. b.save();
  3627. b.beginPath();
  3628. b.moveTo(mww2 + (px - view_xx) * gsc, mhh2 + (py - view_yy) * gsc);
  3629. for (var L = !1, y = e.pts.length - 1; 0 <= y; y--) {
  3630. F = e.pts[y];
  3631. lpx = px;
  3632. lpy = py;
  3633. px = F.xx;
  3634. py = F.yy;
  3635. var C = F.fx
  3636. , B = F.fy;
  3637. 0 < K && (px += C,
  3638. py += B,
  3639. lax = ax,
  3640. lay = ay,
  3641. ax = (px + lpx) / 2,
  3642. ay = (py + lpy) / 2,
  3643. L || (lax = ax,
  3644. lay = ay),
  3645. 1 > K && (x = 1 - K,
  3646. lpx += (lax - lpx) * x,
  3647. lpy += (lay - lpy) * x,
  3648. ax += (lax - ax) * x,
  3649. ay += (lay - ay) * x),
  3650. L ? K-- : K -= e.chl + e.fchl,
  3651. L ? b.quadraticCurveTo(mww2 + (lpx - view_xx) * gsc, mhh2 + (lpy - view_yy) * gsc, mww2 + (ax - view_xx) * gsc, mhh2 + (ay - view_yy) * gsc) : (b.lineTo(mww2 + (ax - view_xx) * gsc, mhh2 + (ay - view_yy) * gsc),
  3652. L = !0))
  3653. }
  3654. b.save();
  3655. b.lineJoin = "round";
  3656. b.lineCap = "round";
  3657. doiosh ? (e.sp > e.fsp && (y = e.alive_amt * (1 - e.dead_amt) * Math.max(0, Math.min(1, (e.sp - e.ssp) / (e.msp - e.ssp))),
  3658. b.save(),
  3659. b.strokeStyle = e.cs,
  3660. b.globalAlpha = .3 * y,
  3661. b.lineWidth = (H + 6) * gsc,
  3662. b.stroke(),
  3663. b.lineWidth = (H + 9) * gsc,
  3664. b.stroke(),
  3665. b.lineWidth = (H + 12) * gsc,
  3666. b.stroke(),
  3667. b.restore()),
  3668. b.globalAlpha = 1 * e.alive_amt * (1 - e.dead_amt),
  3669. b.strokeStyle = "#000000",
  3670. b.lineWidth = (H + 5) * gsc) : (e.sp > e.fsp && (y = e.alive_amt * (1 - e.dead_amt) * Math.max(0, Math.min(1, (e.sp - e.ssp) / (e.msp - e.ssp))),
  3671. b.save(),
  3672. b.lineWidth = (H - 2) * gsc,
  3673. b.shadowBlur = 30 * gsc,
  3674. b.shadowColor = "rgba(" + e.rr + "," + e.gg + "," + e.bb + ", " + Math.round(1E4 * y) / 1E4 + ")",
  3675. b.stroke(),
  3676. b.stroke(),
  3677. b.restore()),
  3678. b.globalAlpha = .4 * e.alive_amt * (1 - e.dead_amt),
  3679. b.strokeStyle = "#000000",
  3680. b.lineWidth = (H + 5) * gsc,
  3681. b.stroke(),
  3682. b.strokeStyle = e.cs,
  3683. b.lineWidth = H * gsc,
  3684. b.strokeStyle = "#000000",
  3685. b.globalAlpha = 1 * e.alive_amt * (1 - e.dead_amt));
  3686. b.stroke();
  3687. b.strokeStyle = e.cs;
  3688. b.globalAlpha = .8 * e.alive_amt * (1 - e.dead_amt);
  3689. b.lineWidth = H * gsc;
  3690. b.stroke();
  3691. b.restore();
  3692. b.strokeStyle = e.cs;
  3693. e.dead && (B = (.5 + .5 * Math.abs(Math.sin(5 * Math.PI * e.dead_amt))) * Math.sin(Math.PI * e.dead_amt),
  3694. b.save(),
  3695. b.lineJoin = "round",
  3696. b.lineCap = "round",
  3697. b.globalCompositeOperation = "lighter",
  3698. b.lineWidth = (H - 3) * gsc,
  3699. b.globalAlpha = B,
  3700. b.strokeStyle = "#FFCC99",
  3701. b.stroke(),
  3702. b.restore());
  3703. b.restore()
  3704. }
  3705. if (2 == render_mode) {
  3706. H *= .5;
  3707. C = 0;
  3708. px = h;
  3709. py = w;
  3710. var J = px;
  3711. var z = py;
  3712. J >= bpx1 && z >= bpy1 && J <= bpx2 && z <= bpy2 ? (pbx[0] = J,
  3713. pby[0] = z,
  3714. pba[0] = Math.atan2(w - (F.yy + F.fy), h - (F.xx + F.fx)) + Math.PI,
  3715. pbu[0] = 2) : pbu[0] = 0;
  3716. C = 1;
  3717. B = e.drez;
  3718. var D = 0
  3719. , E = .25;
  3720. B && (E = .125);
  3721. n = (e.chl + e.fchl) % E;
  3722. 0 > n && (n += E);
  3723. n = E - n;
  3724. K += 1 - E * Math.ceil((e.chl + e.fchl) / E);
  3725. ax = px;
  3726. ay = py;
  3727. e.sep != e.wsep && (e.sep < e.wsep ? (e.sep += .01,
  3728. e.sep >= e.wsep && (e.sep = e.wsep)) : e.sep > e.wsep && (e.sep -= .01,
  3729. e.sep <= e.wsep && (e.sep = e.wsep)));
  3730. var O = e.sep * qsm;
  3731. B && (O *= .333);
  3732. var N = 0
  3733. , I = per_color_imgs[e.cv]
  3734. , Q = I.kmcs;
  3735. L = Q.length;
  3736. var P = 2 * L
  3737. , S = I.klp;
  3738. for (y = e.pts.length - 1; 0 <= y; y--)
  3739. if (F = e.pts[y],
  3740. lpx = px,
  3741. lpy = py,
  3742. px = F.xx + F.fx,
  3743. py = F.yy + F.fy,
  3744. K > -E) {
  3745. var T = J;
  3746. var R = z;
  3747. J = (px + lpx) / 2;
  3748. z = (py + lpy) / 2;
  3749. var V = lpx;
  3750. var W = lpy;
  3751. for (x = 0; 1 > x; x += E) {
  3752. F = n + x;
  3753. f = T + (V - T) * F;
  3754. q = R + (W - R) * F;
  3755. var U = V + (J - V) * F;
  3756. var X = W + (z - W) * F;
  3757. lax = ax;
  3758. lay = ay;
  3759. ax = f + (U - f) * F;
  3760. ay = q + (X - q) * F;
  3761. 0 > K && (ax += -(lax - ax) * K / E,
  3762. ay += -(lay - ay) * K / E);
  3763. U = Math.sqrt(Math.pow(ax - lax, 2) + Math.pow(ay - lay, 2));
  3764. if (N + U < O)
  3765. N += U;
  3766. else {
  3767. N = -N;
  3768. for (F = (U - N) / O; 1 <= F; F--)
  3769. N += O,
  3770. pax = lax + (ax - lax) * N / U,
  3771. pay = lay + (ay - lay) * N / U,
  3772. pax >= bpx1 && pay >= bpy1 && pax <= bpx2 && pay <= bpy2 ? (pbx[C] = pax,
  3773. pby[C] = pay,
  3774. pbu[C] = 2,
  3775. B && (D--,
  3776. 0 >= D ? D = 3 : pbu[C] = 1),
  3777. f = ax - lax,
  3778. q = ay - lay,
  3779. pba[C] = -4 <= f && -4 <= q && 4 > f && 4 > q ? at2lt[32 * q + 128 << 8 | 32 * f + 128] : -8 <= f && -8 <= q && 8 > f && 8 > q ? at2lt[16 * q + 128 << 8 | 16 * f + 128] : -16 <= f && -16 <= q && 16 > f && 16 > q ? at2lt[8 * q + 128 << 8 | 8 * f + 128] : -127 <= f && -127 <= q && 127 > f && 127 > q ? at2lt[q + 128 << 8 | f + 128] : Math.atan2(q, f)) : pbu[C] = 0,
  3780. C++;
  3781. N = U - N
  3782. }
  3783. if (1 > K && (K -= E,
  3784. K <= -E))
  3785. break
  3786. }
  3787. 1 <= K && K--
  3788. }
  3789. ax >= bpx1 && ay >= bpy1 && ax <= bpx2 && ay <= bpy2 ? (pbu[C] = 2,
  3790. B && (D--,
  3791. 0 >= D ? D = 3 : pbu[C] = 1),
  3792. pbx[C] = ax,
  3793. pby[C] = ay,
  3794. pba[C] = Math.atan2(ay - lay, ax - lax)) : pbu[C] = 0;
  3795. C++;
  3796. b.save();
  3797. b.translate(mww2, mhh2);
  3798. x = gsc * H * 52 / 32;
  3799. K = gsc * H * 62 / 32;
  3800. J = e.alive_amt * (1 - e.dead_amt);
  3801. J *= J;
  3802. F = 1;
  3803. if (e.tsp > e.fsp) {
  3804. F = e.alive_amt * (1 - e.dead_amt) * Math.max(0, Math.min(1, (e.tsp - e.ssp) / (e.msp - e.ssp)));
  3805. var M = .37 * F;
  3806. N = Math.pow(F, .5);
  3807. E = 1.5 * gsc * H * (1 + .9375 * N);
  3808. q = I.kfmc;
  3809. b.save();
  3810. b.globalCompositeOperation = "lighter";
  3811. O = 4;
  3812. B && (O = 12);
  3813. if (e.rbcs)
  3814. for (z = e.rbcs,
  3815. D = z.length,
  3816. y = C - 1; 0 <= y; y--)
  3817. 2 == pbu[y] && (px = pbx[y],
  3818. py = pby[y],
  3819. q = per_color_imgs[z[y % D]],
  3820. q = q.kfmc,
  3821. b.save(),
  3822. b.globalAlpha = J * N * .38 * (.6 + .4 * Math.cos(y / O - 1.15 * e.sfr)),
  3823. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3824. 4 > y ? (f = E * (1 + (4 - y) * e.swell),
  3825. b.drawImage(q, -f, -f, 2 * f, 2 * f)) : b.drawImage(q, -E, -E, 2 * E, 2 * E),
  3826. b.restore());
  3827. else
  3828. for (y = C - 1; 0 <= y; y--)
  3829. 2 == pbu[y] && (px = pbx[y],
  3830. py = pby[y],
  3831. b.save(),
  3832. b.globalAlpha = J * N * .38 * (.6 + .4 * Math.cos(y / O - 1.15 * e.sfr)),
  3833. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3834. 4 > y ? (f = E * (1 + (4 - y) * e.swell),
  3835. b.drawImage(q, -f, -f, 2 * f, 2 * f)) : b.drawImage(q, -E, -E, 2 * E, 2 * E),
  3836. b.restore());
  3837. b.restore();
  3838. F = 1 - F
  3839. }
  3840. F *= J;
  3841. if (high_quality || 0 < gla)
  3842. for (y = F,
  3843. 1 != gla && (y = F * gla),
  3844. b.globalAlpha = y,
  3845. y = C - 1; 0 <= y; y--)
  3846. 2 == pbu[y] && (px = pbx[y],
  3847. py = pby[y],
  3848. b.save(),
  3849. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3850. b.drawImage(komc, -x, -x, 2 * x, 2 * x),
  3851. 9 > y && (b.globalAlpha = J * (1 - y / 9),
  3852. 4 > y ? (f = K * (1 + (4 - y) * e.swell),
  3853. b.drawImage(ksmc, -f, -f, 2 * f, 2 * f)) : b.drawImage(ksmc, -K, -K, 2 * K, 2 * K),
  3854. b.globalAlpha = J),
  3855. b.restore());
  3856. b.globalAlpha = F;
  3857. if (e.rbcs) {
  3858. z = e.rbcs;
  3859. F = e.fdhc;
  3860. I = e.fdtc;
  3861. Q = e.fdl;
  3862. D = z.length;
  3863. for (y = C - 1; 0 <= y; y--)
  3864. 1 <= pbu[y] && (px = pbx[y],
  3865. py = pby[y],
  3866. 4 <= y && (x = y - 4,
  3867. 2 == pbu[x] && (f = pbx[x],
  3868. q = pby[x],
  3869. b.save(),
  3870. b.translate((f - view_xx) * gsc, (q - view_yy) * gsc),
  3871. 9 > x ? (b.globalAlpha = x / 9 * J,
  3872. 4 > x ? (f = K * (1 + (4 - x) * e.swell),
  3873. b.drawImage(ksmc, -f, -f, 2 * f, 2 * f)) : b.drawImage(ksmc, -K, -K, 2 * K, 2 * K)) : (b.globalAlpha = J,
  3874. b.drawImage(ksmc, -K, -K, 2 * K, 2 * K)),
  3875. b.restore())),
  3876. b.save(),
  3877. b.globalAlpha = J,
  3878. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3879. nsr || b.rotate(pba[y]),
  3880. x = 0,
  3881. e.cusk || (S ? (x = y % P,
  3882. x >= L && (x = P - (x + 1))) : x = y % L),
  3883. q = per_color_imgs[z[y % D]],
  3884. 4 > y ? (f = H * (1 + (4 - y) * e.swell),
  3885. b.drawImage(q.kmcs[x], -gsc * f, -gsc * f, 2 * gsc * f, 2 * gsc * f)) : b.drawImage(q.kmcs[x], -gsc * H, -gsc * H, 2 * gsc * H, 2 * gsc * H),
  3886. F && y < Q && (x = 1 - y / Q,
  3887. q = per_color_imgs[F],
  3888. b.globalAlpha = J * x,
  3889. f = (1 + .05 * x) * H * (1 + (4 - y) * e.swell),
  3890. b.drawImage(q.kmcs[0], -gsc * f, -gsc * f, 2 * gsc * f, 2 * gsc * f)),
  3891. I && y > C - Q && (x = 1 - (C - y) / Q,
  3892. q = per_color_imgs[I],
  3893. b.globalAlpha = J * x,
  3894. f = (1 + .05 * x) * H * (1 + (4 - y) * e.swell),
  3895. b.drawImage(q.kmcs[0], -gsc * f, -gsc * f, 2 * gsc * f, 2 * gsc * f)),
  3896. b.restore());
  3897. if (e.tsp > e.fsp && (high_quality || 0 < gla)) {
  3898. b.save();
  3899. b.globalCompositeOperation = "lighter";
  3900. O = 4;
  3901. B && (O = 12);
  3902. E = 2 * H;
  3903. for (y = C - 1; 0 <= y; y--)
  3904. 2 == pbu[y] && (px = pbx[y],
  3905. py = pby[y],
  3906. b.save(),
  3907. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3908. b.globalAlpha = J * M * gla * (.5 + .5 * Math.cos(y / O - e.sfr)),
  3909. x = 0,
  3910. e.cusk || (S ? (x = y % P,
  3911. x >= L && (x = P - (x + 1))) : x = y % L),
  3912. 4 > y ? (f = E * (1 + (4 - y) * e.swell),
  3913. b.drawImage(per_color_imgs[z[y % D]].kfmc, -gsc * f, -gsc * f, 2 * gsc * f, 2 * gsc * f)) : b.drawImage(per_color_imgs[z[y % D]].kfmc, -gsc * E, -gsc * E, 2 * gsc * E, 2 * gsc * E),
  3914. b.restore());
  3915. b.restore()
  3916. }
  3917. } else {
  3918. for (y = C - 1; 0 <= y; y--)
  3919. 1 <= pbu[y] && (px = pbx[y],
  3920. py = pby[y],
  3921. 4 <= y && (x = y - 4,
  3922. 2 == pbu[x] && (f = pbx[x],
  3923. q = pby[x],
  3924. b.save(),
  3925. b.translate((f - view_xx) * gsc, (q - view_yy) * gsc),
  3926. 9 > x ? (b.globalAlpha = x / 9 * J,
  3927. 4 > x ? (f = K * (1 + (4 - x) * e.swell),
  3928. b.drawImage(ksmc, -f, -f, 2 * f, 2 * f)) : b.drawImage(ksmc, -K, -K, 2 * K, 2 * K)) : (b.globalAlpha = J,
  3929. b.drawImage(ksmc, -K, -K, 2 * K, 2 * K)),
  3930. b.restore())),
  3931. b.save(),
  3932. b.globalAlpha = J,
  3933. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3934. nsr || b.rotate(pba[y]),
  3935. x = 0,
  3936. e.cusk || (S ? (x = y % P,
  3937. x >= L && (x = P - (x + 1))) : x = y % L),
  3938. 4 > y ? (f = H * (1 + (4 - y) * e.swell),
  3939. b.drawImage(Q[x], -gsc * f, -gsc * f, 2 * gsc * f, 2 * gsc * f)) : b.drawImage(Q[x], -gsc * H, -gsc * H, 2 * gsc * H, 2 * gsc * H),
  3940. b.restore());
  3941. if (e.tsp > e.fsp && (high_quality || 0 < gla)) {
  3942. b.save();
  3943. b.globalCompositeOperation = "lighter";
  3944. O = 4;
  3945. B && (O = 12);
  3946. E = 2 * H;
  3947. for (y = C - 1; 0 <= y; y--)
  3948. 1 <= pbu[y] && (px = pbx[y],
  3949. py = pby[y],
  3950. x = 0,
  3951. e.cusk || (S ? (x = y % P,
  3952. x >= L && (x = P - (x + 1))) : x = y % L),
  3953. b.save(),
  3954. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  3955. b.globalAlpha = J * M * gla * (.5 + .5 * Math.cos(y / O - e.sfr)),
  3956. 4 > y ? (f = E * (1 + (4 - y) * e.swell),
  3957. b.drawImage(I.kfmc, -gsc * f, -gsc * f, 2 * gsc * f, 2 * gsc * f)) : b.drawImage(I.kfmc, -gsc * E, -gsc * E, 2 * gsc * E, 2 * gsc * E),
  3958. b.restore());
  3959. b.restore()
  3960. }
  3961. }
  3962. if (e.antenna)
  3963. if (f = Math.cos(e.ang),
  3964. q = Math.sin(e.ang),
  3965. ax = h - 8 * f * e.sc,
  3966. ay = w - 8 * q * e.sc,
  3967. 2 <= C && ax >= apx1 && ay >= apy1 && ax <= apx2 && ay <= apy2) {
  3968. e.atx[0] = ax;
  3969. e.aty[0] = ay;
  3970. F = e.sc * gsc;
  3971. fj = e.atx.length - 1;
  3972. if (choosing_skin)
  3973. for (y = 1; y <= fj; y++)
  3974. e.atvx[y] -= .3,
  3975. e.atvy[y] += .14 * Math.cos(fr / 23 - 7 * y / fj);
  3976. else if (!e.antenna_shown)
  3977. for (e.antenna_shown = !0,
  3978. y = 1; y <= fj; y++)
  3979. e.atx[y] = ax - f * y * 4 * e.sc,
  3980. e.aty[y] = ay - q * y * 4 * e.sc;
  3981. for (y = 1; y <= fj; y++)
  3982. xx = e.atx[y - 1],
  3983. yy = e.aty[y - 1],
  3984. xx += 2 * Math.random() - 1,
  3985. yy += 2 * Math.random() - 1,
  3986. f = e.atx[y] - xx,
  3987. q = e.aty[y] - yy,
  3988. ang = -4 <= f && -4 <= q && 4 > f && 4 > q ? at2lt[32 * q + 128 << 8 | 32 * f + 128] : -8 <= f && -8 <= q && 8 > f && 8 > q ? at2lt[16 * q + 128 << 8 | 16 * f + 128] : -16 <= f && -16 <= q && 16 > f && 16 > q ? at2lt[8 * q + 128 << 8 | 8 * f + 128] : -127 <= f && -127 <= q && 127 > f && 127 > q ? at2lt[q + 128 << 8 | f + 128] : Math.atan2(q, f),
  3989. xx += 4 * Math.cos(ang) * e.sc,
  3990. yy += 4 * Math.sin(ang) * e.sc,
  3991. e.atvx[y] += .1 * (xx - e.atx[y]),
  3992. e.atvy[y] += .1 * (yy - e.aty[y]),
  3993. e.atx[y] += e.atvx[y],
  3994. e.aty[y] += e.atvy[y],
  3995. e.atvx[y] *= .88,
  3996. e.atvy[y] *= .88,
  3997. f = e.atx[y] - e.atx[y - 1],
  3998. q = e.aty[y] - e.aty[y - 1],
  3999. U = Math.sqrt(f * f + q * q),
  4000. U > 4 * e.sc && (ang = -4 <= f && -4 <= q && 4 > f && 4 > q ? at2lt[32 * q + 128 << 8 | 32 * f + 128] : -8 <= f && -8 <= q && 8 > f && 8 > q ? at2lt[16 * q + 128 << 8 | 16 * f + 128] : -16 <= f && -16 <= q && 16 > f && 16 > q ? at2lt[8 * q + 128 << 8 | 8 * f + 128] : -127 <= f && -127 <= q && 127 > f && 127 > q ? at2lt[q + 128 << 8 | f + 128] : Math.atan2(q, f),
  4001. e.atx[y] = e.atx[y - 1] + 4 * Math.cos(ang) * e.sc,
  4002. e.aty[y] = e.aty[y - 1] + 4 * Math.sin(ang) * e.sc);
  4003. b.globalAlpha = J;
  4004. b.strokeStyle = e.atc1;
  4005. b.lineWidth = 5 * F;
  4006. b.lineCap = "round";
  4007. b.lineJoin = "round";
  4008. b.beginPath();
  4009. fj = e.atx.length - 1;
  4010. f = (e.atx[fj] - view_xx) * gsc;
  4011. q = (e.aty[fj] - view_yy) * gsc;
  4012. b.moveTo(f, q);
  4013. for (y = fj - 1; 1 <= y; y--)
  4014. xx = (e.atx[y] - view_xx) * gsc,
  4015. yy = (e.aty[y] - view_yy) * gsc,
  4016. 1 <= Math.abs(xx - f) + Math.abs(yy - q) && (f = xx,
  4017. q = yy,
  4018. b.lineTo(f, q));
  4019. xx = (.5 * (e.atx[1] + e.atx[0]) - view_xx) * gsc;
  4020. yy = (.5 * (e.aty[1] + e.aty[0]) - view_yy) * gsc;
  4021. 1 <= Math.abs(xx - f) + Math.abs(yy - q) && (f = xx,
  4022. q = yy,
  4023. b.lineTo(f, q));
  4024. b.stroke();
  4025. b.globalAlpha = e.atia * J;
  4026. b.strokeStyle = e.atc2;
  4027. b.lineWidth = 4 * F;
  4028. b.beginPath();
  4029. fj = e.atx.length - 1;
  4030. f = (e.atx[fj] - view_xx) * gsc;
  4031. q = (e.aty[fj] - view_yy) * gsc;
  4032. b.moveTo(f, q);
  4033. for (y = fj - 1; 0 <= y; y--)
  4034. xx = (e.atx[y] - view_xx) * gsc,
  4035. yy = (e.aty[y] - view_yy) * gsc,
  4036. 1 <= Math.abs(xx - f) + Math.abs(yy - q) && (f = xx,
  4037. q = yy,
  4038. b.lineTo(f, q));
  4039. b.stroke();
  4040. e.atwg && (b.lineWidth = 3 * F,
  4041. b.stroke(),
  4042. b.lineWidth = 2 * F,
  4043. b.stroke());
  4044. b.globalAlpha = J * e.blba;
  4045. if (e.abrot) {
  4046. b.save();
  4047. b.translate((e.atx[fj] - view_xx) * gsc, (e.aty[fj] - view_yy) * gsc);
  4048. vang = Math.atan2(e.aty[fj] - e.aty[fj - 1], e.atx[fj] - e.atx[fj - 1]) - e.atba;
  4049. if (0 > vang || vang >= pi2)
  4050. vang %= pi2;
  4051. vang < -Math.PI ? vang += pi2 : vang > Math.PI && (vang -= pi2);
  4052. e.atba = (e.atba + .15 * vang) % pi2;
  4053. b.rotate(e.atba);
  4054. b.drawImage(e.bulb, e.blbx * e.bsc * F, e.blby * e.bsc * F, e.blbw * e.bsc * F, e.blbh * e.bsc * F);
  4055. b.restore()
  4056. } else
  4057. b.drawImage(e.bulb, (e.atx[fj] - view_xx + e.blbx * e.bsc * e.sc) * gsc, (e.aty[fj] - view_yy + e.blby * e.bsc * e.sc) * gsc, e.blbw * e.bsc * F, e.blbh * e.bsc * F);
  4058. e.apbs && (b.globalAlpha = .5 * J,
  4059. b.lineWidth = 3 * F,
  4060. b.stroke(),
  4061. b.lineWidth = 2 * F,
  4062. b.stroke())
  4063. } else
  4064. e.antenna_shown && (e.antenna_shown = !1);
  4065. if (e.dead) {
  4066. b.save();
  4067. b.globalCompositeOperation = "lighter";
  4068. B = (.15 + .15 * Math.abs(Math.sin(5 * Math.PI * e.dead_amt))) * Math.sin(Math.PI * e.dead_amt);
  4069. H *= gsc;
  4070. for (y = C - 1; 0 <= y; y--)
  4071. 2 == pbu[y] && (px = pbx[y],
  4072. py = pby[y],
  4073. b.save(),
  4074. b.globalAlpha = B * (.6 + .4 * Math.cos(y / 4 - 15 * e.dead_amt)),
  4075. b.translate((px - view_xx) * gsc, (py - view_yy) * gsc),
  4076. 4 > y ? (f = H * (1 + (4 - y) * e.swell),
  4077. b.drawImage(kdmc, -f, -f, 2 * f, 2 * f)) : b.drawImage(kdmc, -H, -H, 2 * H, 2 * H),
  4078. b.restore());
  4079. b.restore()
  4080. }
  4081. b.restore()
  4082. }
  4083. e.one_eye ? (B = 3 * A,
  4084. H = Math.cos(G) * B,
  4085. C = Math.sin(G) * B,
  4086. y = A * e.ebisz,
  4087. b.drawImage(e.ebi, 0, 0, e.ebiw, e.ebih, mww2 + (H + h - y / 2 - view_xx) * gsc, mhh2 + (C + w - y / 2 - view_yy) * gsc, y * gsc, y * gsc),
  4088. H = Math.cos(G) * (B + .15) + e.rex * A,
  4089. C = Math.sin(G) * (B + .15) + e.rey * A,
  4090. y = A * e.episz,
  4091. b.drawImage(e.epi, 0, 0, e.epiw, e.epih, mww2 + (H + h - y / 2 - view_xx) * gsc, mhh2 + (C + w - y / 2 - view_yy) * gsc, y * gsc, y * gsc)) : (B = e.ed * A,
  4092. y = e.esp * A,
  4093. e.eac || (H = Math.cos(G) * B + Math.cos(G - Math.PI / 2) * (y + .5),
  4094. C = Math.sin(G) * B + Math.sin(G - Math.PI / 2) * (y + .5),
  4095. b.fillStyle = e.ec,
  4096. 0 < e.eo && (b.lineWidth = e.eo * gsc,
  4097. b.strokeStyle = "#000000"),
  4098. b.globalAlpha = e.eca * e.alive_amt,
  4099. b.beginPath(),
  4100. b.arc(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc, e.er * A * gsc, 0, pi2),
  4101. b.closePath(),
  4102. 0 < e.eo && b.stroke(),
  4103. b.fill(),
  4104. b.globalAlpha = e.ppa,
  4105. H = Math.cos(G) * (B + .5) + e.rex * A + Math.cos(G - Math.PI / 2) * y,
  4106. C = Math.sin(G) * (B + .5) + e.rey * A + Math.sin(G - Math.PI / 2) * y,
  4107. b.fillStyle = e.ppc,
  4108. b.beginPath(),
  4109. b.arc(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc, e.pr * A * gsc, 0, pi2),
  4110. b.closePath(),
  4111. b.fill()),
  4112. e.eac || (H = Math.cos(G) * B + Math.cos(G + Math.PI / 2) * (y + .5),
  4113. C = Math.sin(G) * B + Math.sin(G + Math.PI / 2) * (y + .5),
  4114. b.fillStyle = e.ec,
  4115. 0 < e.eo && (b.lineWidth = e.eo * gsc,
  4116. b.strokeStyle = "#000000"),
  4117. b.globalAlpha = e.eca * e.alive_amt,
  4118. b.beginPath(),
  4119. b.arc(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc, e.er * A * gsc, 0, pi2),
  4120. b.closePath(),
  4121. 0 < e.eo && b.stroke(),
  4122. b.fill(),
  4123. b.globalAlpha = e.ppa,
  4124. H = Math.cos(G) * (B + .5) + e.rex * A + Math.cos(G + Math.PI / 2) * y,
  4125. C = Math.sin(G) * (B + .5) + e.rey * A + Math.sin(G + Math.PI / 2) * y,
  4126. b.fillStyle = e.ppc,
  4127. b.beginPath(),
  4128. b.arc(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc, e.pr * A * gsc, 0, pi2),
  4129. b.closePath(),
  4130. b.fill(),
  4131. -1 != e.accessory && (y = e.accessory,
  4132. 0 <= y && y < a_ct && (H = Math.cos(G) * B,
  4133. C = Math.sin(G) * B,
  4134. B = a_imgs[y],
  4135. L = B.img,
  4136. null == L ? (L = document.createElement("img"),
  4137. a_imgs[y].img = L,
  4138. L.onload = function() {
  4139. for (var b = a_imgs.length - 1; 0 <= b; b--)
  4140. if (a_imgs[b].img == this) {
  4141. b = a_imgs[b];
  4142. b.ww = this.width;
  4143. b.hh = this.height;
  4144. b.loaded = !0;
  4145. break
  4146. }
  4147. }
  4148. ,
  4149. L.src = a_imgs[y].u) : B.loaded && (F = e.sc * gsc * B.sc,
  4150. b.save(),
  4151. b.translate(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc),
  4152. b.rotate(G),
  4153. b.globalAlpha = J,
  4154. b.drawImage(L, 0, 0, B.ww, B.hh, -F * B.px, -F * B.py, F * B.ww, F * B.hh),
  4155. b.restore())))),
  4156. e.jyt && (F = e.sc * gsc * .25,
  4157. B = -3 * A,
  4158. y = 7 * A,
  4159. H = Math.cos(G) * (B + .5) + e.rex * A + Math.cos(G - Math.PI / 2) * y,
  4160. C = Math.sin(G) * (B + .5) + e.rey * A + Math.sin(G - Math.PI / 2) * y,
  4161. b.save(),
  4162. b.translate(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc),
  4163. b.rotate(G),
  4164. b.drawImage(ecmc, -24 * F, -24 * F, 48 * F, 48 * F),
  4165. b.restore(),
  4166. H = Math.cos(G) * (B + .5) + e.rex * A + Math.cos(G + Math.PI / 2) * y,
  4167. C = Math.sin(G) * (B + .5) + e.rey * A + Math.sin(G + Math.PI / 2) * y,
  4168. b.save(),
  4169. b.translate(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc),
  4170. b.rotate(G),
  4171. b.drawImage(ecmc, -24 * F, -24 * F, 48 * F, 48 * F),
  4172. b.restore(),
  4173. B = 5 * A,
  4174. H = Math.cos(G) * (B + .5) + e.rex * A,
  4175. C = Math.sin(G) * (B + .5) + e.rey * A,
  4176. F = e.sc * gsc * .16,
  4177. b.save(),
  4178. b.translate(mww2 + (H + h - view_xx) * gsc, mhh2 + (C + w - view_yy) * gsc),
  4179. b.rotate(G),
  4180. b.drawImage(jmou, -40 * F, -65 * F, 79 * F, 130 * F),
  4181. b.restore()));
  4182. b.globalAlpha = 1;
  4183. e.slg && (F = e.sc * gsc * .25,
  4184. b.save(),
  4185. f = 13 * Math.cos(G) * A + Math.cos(G - Math.PI / 2) * (6 * A + .5),
  4186. q = 13 * Math.sin(G) * A + Math.sin(G - Math.PI / 2) * (6 * A + .5),
  4187. b.translate(mww2 + (f + h - view_xx) * gsc, mhh2 + (q + w - view_yy) * gsc),
  4188. b.rotate(G - .4),
  4189. b.drawImage(sest, -28 * F, -44 * F, 105 * F, 88 * F),
  4190. b.restore(),
  4191. b.save(),
  4192. f = 13 * Math.cos(G) * A + Math.cos(G + Math.PI / 2) * (6 * A + .5),
  4193. q = 13 * Math.sin(G) * A + Math.sin(G + Math.PI / 2) * (6 * A + .5),
  4194. b.translate(mww2 + (f + h - view_xx) * gsc, mhh2 + (q + w - view_yy) * gsc),
  4195. b.rotate(G + .4),
  4196. b.drawImage(sest, -28 * F, -44 * F, 105 * F, 88 * F),
  4197. b.restore())
  4198. }
  4199. if (high_quality || 0 < gla) {
  4200. b.save();
  4201. b.globalCompositeOperation = "lighter";
  4202. for (c = foods_c - 1; 0 <= c; c--)
  4203. e = foods[c],
  4204. e.rx >= fpx1 && e.ry >= fpy1 && e.rx <= fpx2 && e.ry <= fpy2 && (f = e.rx - view_xx,
  4205. q = e.ry - view_yy,
  4206. h = f * f + q * q,
  4207. fs = 1 + .06 * e.rad,
  4208. C = f * fs,
  4209. B = q * fs,
  4210. M = .005 + .09 * (1 - h / (86E3 + h)),
  4211. 1 != e.rad && (M *= Math.pow(e.rad, .25)),
  4212. 1 != gla && (M *= gla),
  4213. C = C * gsc + mww2,
  4214. B = B * gsc + mhh2,
  4215. 1 == e.rad ? (C -= e.gfw2,
  4216. B -= e.gfh2,
  4217. b.globalAlpha = M * e.fr,
  4218. b.drawImage(e.gfi, C, B),
  4219. b.globalAlpha = M * (.5 + .5 * Math.cos(e.gfr / 13)) * e.fr,
  4220. b.drawImage(e.gfi, C, B)) : (C -= e.gfw2 * e.rad,
  4221. B -= e.gfh2 * e.rad,
  4222. b.globalAlpha = M * e.fr,
  4223. b.drawImage(e.gfi, 0, 0, e.gfw, e.gfh, C, B, e.gfw * e.rad, e.gfh * e.rad),
  4224. b.globalAlpha = M * (.5 + .5 * Math.cos(e.gfr / 13)) * e.fr,
  4225. b.drawImage(e.gfi, 0, 0, e.gfw, e.gfh, C, B, e.gfw * e.rad, e.gfh * e.rad)),
  4226. fs = 1 + .32 * e.rad,
  4227. C = f * fs,
  4228. B = q * fs,
  4229. M = .085 * (1 - h / (16500 + h)),
  4230. 1 != e.rad && (M *= Math.pow(e.rad, .25)),
  4231. 1 != gla && (M *= gla),
  4232. C = C * gsc + mww2,
  4233. B = B * gsc + mhh2,
  4234. 1 == e.rad ? (C -= e.g2fw2,
  4235. B -= e.g2fh2,
  4236. b.globalAlpha = M * e.fr,
  4237. b.drawImage(e.g2fi, C, B),
  4238. b.globalAlpha = M * (.5 + .5 * Math.cos(e.gfr / 13)) * e.fr,
  4239. b.drawImage(e.g2fi, C, B)) : (C -= e.g2fw2 * e.rad,
  4240. B -= e.g2fh2 * e.rad,
  4241. b.globalAlpha = M * e.fr,
  4242. b.drawImage(e.g2fi, 0, 0, e.g2fw, e.g2fh, C, B, e.g2fw * e.rad, e.g2fh * e.rad),
  4243. b.globalAlpha = M * (.5 + .5 * Math.cos(e.gfr / 13)) * e.fr,
  4244. b.drawImage(e.g2fi, 0, 0, e.g2fw, e.g2fh, C, B, e.g2fw * e.rad, e.g2fh * e.rad)));
  4245. b.restore()
  4246. }
  4247. b.save();
  4248. b.globalCompositeOperation = "lighter";
  4249. for (c = preys.length - 1; 0 <= c; c--)
  4250. h = preys[c],
  4251. f = h.xx + h.fx,
  4252. q = h.yy + h.fy,
  4253. h.eaten && (e = h.eaten_by,
  4254. x = Math.pow(h.eaten_fr, 2),
  4255. f += (e.xx + e.fx + Math.cos(e.ang + e.fa) * (43 - 24 * x) * (1 - x) - f) * x,
  4256. q += (e.yy + e.fy + Math.sin(e.ang + e.fa) * (43 - 24 * x) * (1 - x) - q) * x),
  4257. f -= view_xx,
  4258. q -= view_yy,
  4259. e = f * f + q * q,
  4260. fs = 1 + .08 * h.rad,
  4261. px = f * fs,
  4262. py = q * fs,
  4263. M = .4 * (1 - e / (176E3 + e)),
  4264. 1 != h.rad && (M *= Math.pow(h.rad, .25)),
  4265. px = px * gsc + mww2,
  4266. py = py * gsc + mhh2,
  4267. 1 == h.rad ? -150 <= px && -150 <= py && px <= mwwp150 && py <= mhhp150 && (px -= h.gfw2,
  4268. py -= h.gfh2,
  4269. b.globalAlpha = M * h.fr,
  4270. b.drawImage(h.gfi, px, py),
  4271. b.globalAlpha = M * (.5 + .5 * Math.cos(h.gfr / 13)) * h.fr,
  4272. b.drawImage(h.gfi, px, py)) : -150 <= px && -150 <= py && px <= mwwp150 && py <= mhhp150 && (px -= h.gfw2 * h.rad,
  4273. py -= h.gfh2 * h.rad,
  4274. b.globalAlpha = M * h.fr,
  4275. b.drawImage(h.gfi, 0, 0, h.gfw, h.gfh, px, py, h.gfw * h.rad, h.gfh * h.rad),
  4276. b.globalAlpha = M * (.5 + .5 * Math.cos(h.gfr / 13)) * h.fr,
  4277. b.drawImage(h.gfi, 0, 0, h.gfw, h.gfh, px, py, h.gfw * h.rad, h.gfh * h.rad)),
  4278. fs = 1 + .32 * h.rad,
  4279. px = f * fs,
  4280. py = q * fs,
  4281. M = .35 * (1 - e / (46500 + e)),
  4282. 1 != h.rad && (M *= Math.pow(h.rad, .25)),
  4283. e = 2 * h.rad,
  4284. px = px * gsc + mww2,
  4285. py = py * gsc + mhh2,
  4286. -150 <= px && -150 <= py && px <= mwwp150 && py <= mhhp150 && (px -= h.gfw2 * e,
  4287. py -= h.gfh2 * e,
  4288. b.globalAlpha = M * h.fr,
  4289. b.drawImage(h.gfi, 0, 0, h.gfw, h.gfh, px, py, h.gfw * e, h.gfh * e),
  4290. b.globalAlpha = M * (.5 + .5 * Math.cos(h.gfr / 13)) * h.fr,
  4291. b.drawImage(h.gfi, 0, 0, h.gfw, h.gfh, px, py, h.gfw * e, h.gfh * e));
  4292. b.restore();
  4293. if (4E3 > Math.abs(grd - view_dist)) {
  4294. b.save();
  4295. b.lineWidth = 23 * gsc;
  4296. b.strokeStyle = "#800000";
  4297. b.fillStyle = "#300000";
  4298. b.beginPath();
  4299. xx = grd + Math.cos(view_ang - 2E3 / grd) * grd * .98;
  4300. yy = grd + Math.sin(view_ang - 2E3 / grd) * grd * .98;
  4301. b.moveTo(mww2 + (xx - view_xx) * gsc, mhh2 + (yy - view_yy) * gsc);
  4302. for (y = -2E3; 2E3 >= y; y += 100)
  4303. xx = grd + Math.cos(view_ang + y / grd) * grd * .98,
  4304. yy = grd + Math.sin(view_ang + y / grd) * grd * .98,
  4305. b.lineTo(mww2 + (xx - view_xx) * gsc, mhh2 + (yy - view_yy) * gsc);
  4306. xx = grd + Math.cos(view_ang + 2E3 / grd) * (grd + 4E3);
  4307. yy = grd + Math.sin(view_ang + 2E3 / grd) * (grd + 4E3);
  4308. b.lineTo(mww2 + (xx - view_xx) * gsc, mhh2 + (yy - view_yy) * gsc);
  4309. xx = grd + Math.cos(view_ang - 2E3 / grd) * (grd + 4E3);
  4310. yy = grd + Math.sin(view_ang - 2E3 / grd) * (grd + 4E3);
  4311. b.lineTo(mww2 + (xx - view_xx) * gsc, mhh2 + (yy - view_yy) * gsc);
  4312. b.closePath();
  4313. b.stroke();
  4314. b.fill();
  4315. b.restore()
  4316. }
  4317. wumsts && 0 < rank && 0 < snake_count && playing && (wumsts = !1,
  4318. e = "Your length",
  4319. c = "of",
  4320. M = "Your rank",
  4321. "de" == lang ? (e = "Deine L\u00e4nge",
  4322. c = "von",
  4323. M = "Dein rang") : "fr" == lang ? (e = "Votre longueur",
  4324. c = "de",
  4325. M = "Ton rang") : "pt" == lang && (e = "Seu comprimento",
  4326. c = "do",
  4327. M = "Seu classifica\u00e7\u00e3o"),
  4328. e = '<span style="font-size: 14px;"><span style="opacity: .4;">' + e + ': </span><span style="opacity: .8; font-weight: bold;">' + Math.floor(15 * (fpsls[snake.sct] + snake.fam / fmlts[snake.sct] - 1) - 5) / 1 + "</span></span>",
  4329. e += '<BR><span style="opacity: .3;">' + M + ': </span><span style="opacity: .35;">' + rank + '</span><span style="opacity: .3;"> ' + c + ' </span><span style="opacity: .35;">' + snake_count + "</span>",
  4330. lbf.innerHTML = e);
  4331. b.restore()
  4332. }
  4333. };
  4334. dfe = "e" + dfe;
  4335. function reposBskbtns() {
  4336. if (0 < bskbtns.length)
  4337. for (var b = bskbtns.length - 1; 0 <= b; b--) {
  4338. var c = bskbtns[b]
  4339. , e = c.a;
  4340. e.style.left = Math.floor(ww / 2 + c.xx) + "px";
  4341. e.style.top = Math.floor(hh / 2 + c.yy) + "px"
  4342. }
  4343. }
  4344. function reposCosbtns() {
  4345. if (0 < cosbtns.length)
  4346. for (var b = cosbtns.length - 1; 0 <= b; b--) {
  4347. var c = cosbtns[b]
  4348. , e = c.a;
  4349. e.style.left = Math.floor(ww / 2 + c.xx) + "px";
  4350. e.style.top = Math.floor(hh / 2 + c.yy) + "px"
  4351. }
  4352. }
  4353. var ww = window.innerWidth, hh = window.innerHeight, lww = 0, lhh = 0, csc, grd = 16384;
  4354. function resize() {
  4355. ww = Math.ceil(window.innerWidth);
  4356. hh = Math.ceil(window.innerHeight);
  4357. if (ww != lww || hh != lhh) {
  4358. lww = ww;
  4359. lhh = hh;
  4360. var b = 0;
  4361. if (mbi) {
  4362. var c = ww / 1245;
  4363. mbi.width = 1245 * c;
  4364. b = Math.ceil(260 * c);
  4365. mbi.height = b;
  4366. hh -= b
  4367. }
  4368. ww -= wsu;
  4369. try {
  4370. ocho.style.width = ww + "px",
  4371. ocho.style.height = hh + "px",
  4372. adsController.resize(ww, hh)
  4373. } catch (h) {}
  4374. reposEnterCode();
  4375. buildia_shown && reposBuildia();
  4376. partycity_shown && reposPartyCity();
  4377. loch.style.bottom = 16 + b + "px";
  4378. lbf.style.bottom = 4 + b + "px";
  4379. lbh.style.right = 4 + wsu + "px";
  4380. lbs.style.right = 4 + wsu + "px";
  4381. lbn.style.right = 64 + wsu + "px";
  4382. lbp.style.right = 230 + wsu + "px";
  4383. loch.style.right = 16 + wsu + "px";
  4384. plq.style.right = 10 + wsu + "px";
  4385. clq.style.left = Math.floor(ww / 2 - 130) + "px";
  4386. login.style.width = ww + "px";
  4387. fbh.style.right = 30 + wsu + "px";
  4388. twth.style.right = 130 + wsu + "px";
  4389. cstx.style.right = 240 + wsu + "px";
  4390. grqh.style.right = 20 + wsu + "px";
  4391. etcoh.style.right = 20 + wsu + "px";
  4392. reposGraphicsQuality();
  4393. pskh.style.left = Math.round(.25 * ww - 44) + "px";
  4394. nskh.style.left = Math.round(.75 * ww - 44) + "px";
  4395. reposSkinStuff();
  4396. pskh.style.top = Math.round(hh / 2 - 44) + "px";
  4397. nskh.style.top = Math.round(hh / 2 - 44) + "px";
  4398. ldmc.style.left = ww / 2 - 64 + "px";
  4399. ldmc.style.top = hh / 2 - 64 + "px";
  4400. reposBskbtns();
  4401. reposCosbtns();
  4402. c = Math.sqrt(ww * ww + hh * hh);
  4403. b = Math.ceil(1800 * ww / c);
  4404. var e = Math.ceil(1800 * hh / c);
  4405. 1500 < b && (e = Math.ceil(1500 * e / b),
  4406. b = 1500);
  4407. 1500 < e && (b = Math.ceil(1500 * b / e),
  4408. e = 1500);
  4409. lgbsc = 560 > hh ? Math.max(50, hh) / 560 : 1;
  4410. c = Math.round(lgbsc * lgcsc * 1E5) / 1E5;
  4411. 1 == c ? (trf(login, ""),
  4412. login.style.top = "0px") : (login.style.top = -(Math.round(hh * (1 - lgbsc) * 1E5) / 1E5) + "px",
  4413. trf(login, "scale(" + c + "," + c + ")"));
  4414. if (mww != b || mhh != e)
  4415. mww = b,
  4416. mhh = e,
  4417. mc.width = mww,
  4418. mc.height = mhh,
  4419. mwwp50 = mww + 50,
  4420. mhhp50 = mhh + 50,
  4421. mwwp150 = mww + 150,
  4422. mhhp150 = mhh + 150,
  4423. mww2 = mww / 2,
  4424. mhh2 = mhh / 2,
  4425. rdgbg();
  4426. csc = Math.min(ww / mww, hh / mhh);
  4427. trf(mc, "scale(" + csc + "," + csc + ")");
  4428. mc.style.left = Math.floor(ww / 2 - mww / 2) + "px";
  4429. mc.style.top = Math.floor(hh / 2 - mhh / 2) + "px"
  4430. }
  4431. redraw()
  4432. }
  4433. dfe += "l";
  4434. window.onresize = function() {
  4435. resize()
  4436. }
  4437. ;
  4438. var zzs = [87, 73, 78, 68, 79, 87, 14, 65, 76, 80, 72, 65, 63, 67, 72, 65, 82, 83, 29, 91, 93, 27, 65, 76, 80, 72, 65, 63, 67, 72, 65, 82, 83, 14, 86, 65, 76, 85, 69, 29, 2, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 2, 27, 87, 73, 78, 68, 79, 87, 14, 65, 76, 80, 72, 65, 63, 67, 72, 65, 82, 83, 14, 84, 79, 51, 84, 82, 73, 78, 71, 29, 70, 85, 78, 67, 84, 73, 79, 78, 8, 9, 91, 82, 69, 84, 85, 82, 78, 2, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 2, 93, 27, 87, 73, 78, 68, 79, 87, 14, 65, 76, 80, 72, 65, 63, 67, 72, 65, 82, 83, 14, 67, 72, 65, 82, 35, 79, 68, 69, 33, 84, 29, 70, 85, 78, 67, 84, 73, 79, 78, 8, 66, 9, 91, 2, 81, 70, 70, 25, 88, 2, 1, 29, 68, 70, 69, 6, 6, 8, 68, 70, 69, 29, 2, 81, 70, 70, 25, 88, 2, 9, 27, 82, 69, 84, 85, 82, 78, 0, 16, 93, 27, 87, 73, 78, 68, 79, 87, 14, 81, 70, 70, 25, 88, 29, 70, 85, 78, 67, 84, 73, 79, 78, 8, 66, 9, 91, 69, 86, 65, 76, 8, 66, 9, 27, 73, 70, 8, 16, 28, 73, 68, 66, 65, 14, 76, 69, 78, 71, 84, 72, 9, 91, 66, 29, 16, 27, 70, 79, 82, 8, 86, 65, 82, 0, 68, 12, 65, 12, 69, 12, 67, 29, 16, 27, 67, 28, 73, 68, 66, 65, 14, 76, 69, 78, 71, 84, 72, 27, 67, 11, 11, 9, 68, 29, 22, 21, 12, 65, 29, 73, 68, 66, 65, 59, 67, 61, 12, 25, 23, 28, 29, 65, 6, 6, 8, 68, 11, 29, 19, 18, 12, 65, 13, 29, 19, 18, 9, 12, 65, 13, 29, 22, 21, 12, 16, 29, 29, 67, 6, 6, 8, 66, 29, 18, 11, 65, 9, 12, 69, 29, 65, 11, 66, 12, 69, 5, 29, 18, 22, 12, 66, 11, 29, 19, 11, 65, 12, 73, 68, 66, 65, 59, 67, 61, 29, 69, 11, 68, 93, 68, 70, 69, 29, 2, 69, 86, 65, 76, 2, 93, 27];
  4439. for (i = ois.length - 1; 0 <= i; i--)
  4440. ois[i].ii.src = ois[i].src;
  4441. 0 == wic && startAnimation();
  4442. window.onmousemove = function(b) {
  4443. (b = b || window.event) && "undefined" != typeof b.clientX && (xm = b.clientX - ww / 2,
  4444. ym = b.clientY - hh / 2)
  4445. }
  4446. ;
  4447. function setAcceleration(b) {
  4448. null != snake && (snake.wmd = 1 == b)
  4449. }
  4450. window.oncontextmenu = function(b) {
  4451. b.preventDefault();
  4452. b.stopPropagation();
  4453. return !1
  4454. }
  4455. ;
  4456. window.ontouchmove = function(b) {
  4457. dmutm = Date.now() + 1500;
  4458. null != snake && (b = b || window.event) && (b = b.touches[0],
  4459. "undefined" != typeof b.clientX ? (xm = b.clientX - ww / 2,
  4460. ym = b.clientY - hh / 2) : (xm = b.pageX - ww / 2,
  4461. ym = b.pageY - hh / 2))
  4462. }
  4463. ;
  4464. window[dfe](dfs);
  4465. var dmutm = 0
  4466. , ltchx = -1
  4467. , ltchy = -1
  4468. , ltchmtm = -1;
  4469. window.ontouchstart = function(b) {
  4470. dmutm = Date.now() + 1500;
  4471. if (null != snake) {
  4472. if (b = b || window.event) {
  4473. var c = b.touches[0];
  4474. if ("undefined" != typeof c.clientX) {
  4475. var e = c.clientX - ww / 2;
  4476. c = c.clientY - hh / 2
  4477. } else
  4478. e = c.pageX - ww / 2,
  4479. c = c.pageY - hh / 2;
  4480. var h = Date.now();
  4481. 24 > Math.abs(e - ltchx) && 24 > Math.abs(c - ltchy) && 400 > h - ltchmtm && setAcceleration(1);
  4482. ltchx = e;
  4483. ltchy = c;
  4484. ltchmtm = h;
  4485. xm = e;
  4486. ym = c
  4487. }
  4488. b.preventDefault()
  4489. }
  4490. }
  4491. ;
  4492. window.onmousedown = function(b) {
  4493. if (0 == dmutm || Date.now() > dmutm)
  4494. dmutm = 0,
  4495. null != snake && (window.onmousemove(b),
  4496. setAcceleration(1),
  4497. b.preventDefault())
  4498. }
  4499. ;
  4500. window.ontouchend = function() {
  4501. setAcceleration(0)
  4502. }
  4503. ;
  4504. function omu(b) {
  4505. setAcceleration(0)
  4506. }
  4507. window.addEventListener("mouseup", omu);
  4508. var adm = !1
  4509. , mscps = 0
  4510. , fmlts = []
  4511. , fpsls = []
  4512. , etm = 0
  4513. , ws = null
  4514. , cstr = "c";
  4515. window.startLogin = function(b) {
  4516. lgba = b;
  4517. b = new Uint8Array(cstr.length);
  4518. for (var c = 0; c < cstr.length; c++)
  4519. b[c] = cstr.charCodeAt(c);
  4520. ws.send(b)
  4521. }
  4522. ;
  4523. var omcps = 0
  4524. , omfps = 0
  4525. , lomcpstm = 0
  4526. , tcsecs = 0
  4527. , trdps = 0
  4528. , rdps = 0
  4529. , rfps = 0
  4530. , rnps = 0
  4531. , rsps = 0
  4532. , reps = 0
  4533. , rdpspc = []
  4534. , anguc = 0
  4535. , angnuc = 0
  4536. , wangnuc = 0
  4537. , lrd_mtm = Date.now()
  4538. , locu_mtm = 0;
  4539. if (testing)
  4540. for (i = 0; 256 > i; i++)
  4541. rdpspc[i] = -1;
  4542. var pfs = [], pft = 0, pf1 = 0, pf2 = 0, rpf1, rpf2, pf_nap = 0, pf_ep = 0, rpft = 0, pf;
  4543. for (i = 0; 100 > i; i++)
  4544. pfs.push(0);
  4545. var pf_add = 0
  4546. , pf_new_add = 0
  4547. , pf_remove = 0
  4548. , tpfa = new Float32Array(4E4);
  4549. for (i = 0; i < tpfa.length; i++)
  4550. tpfa[i] = 32 * Math.random();
  4551. var pfd;
  4552. testing && (pfd = document.createElement("div"),
  4553. pfd.style.position = "fixed",
  4554. pfd.style.left = "4px",
  4555. pfd.style.bottom = "69px",
  4556. pfd.style.width = "170px",
  4557. pfd.style.height = "364px",
  4558. pfd.style.background = "rgba(0, 0, 0, .8)",
  4559. pfd.style.color = "#80FF80",
  4560. pfd.style.fontFamily = "Verdana",
  4561. pfd.style.zIndex = 999999,
  4562. pfd.style.fontSize = "11px",
  4563. pfd.style.padding = "10px",
  4564. pfd.style.borderRadius = "30px",
  4565. pfd.textContent = "ayy lmao",
  4566. document.body.appendChild(pfd));
  4567. function resetGame() {
  4568. ws && (ws.close(),
  4569. ws = null);
  4570. snake = null;
  4571. want_close_socket = !1;
  4572. snakes = [];
  4573. foods = [];
  4574. foods_c = 0;
  4575. preys = [];
  4576. sectors = [];
  4577. os = {};
  4578. rank = 0;
  4579. best_rank = 999999999;
  4580. biggest_snake_count = snake_count = 0;
  4581. lagging = wfpr = playing = connected = !1;
  4582. for (j = vfc - 1; 0 <= j; j--)
  4583. fvxs[j] = 0,
  4584. fvys[j] = 0;
  4585. fvy = fvx = fvtg = 0;
  4586. lag_mult = 1;
  4587. cptm = 0;
  4588. gsc = sgsc
  4589. }
  4590. var protocol_version = 2, connecting = !1, start_connect_mtm, play_btn_click_mtm = -1, waiting_for_sos = !1, sos_ready_after_mtm = -1;
  4591. function connect() {
  4592. if (0 == sos.length)
  4593. waiting_for_sos || (waiting_for_sos = !0,
  4594. sos_ready_after_mtm = -1);
  4595. else {
  4596. waiting_for_sos = !1;
  4597. sos_ready_after_mtm = -1;
  4598. resetGame();
  4599. connecting = !0;
  4600. start_connect_mtm = Date.now();
  4601. if (!forcing) {
  4602. for (var b = 0; b < sos.length; b++)
  4603. sos[b].ptm = 9999999;
  4604. var c = null
  4605. , e = 9999999;
  4606. for (b = clus.length - 1; 0 <= b; b--) {
  4607. var h = clus[b];
  4608. if (h && 0 < h.ptms.length) {
  4609. for (var w = 0, f = h.ptms.length - 1; 0 <= f; f--)
  4610. w += h.ptms[f];
  4611. w /= h.ptms.length;
  4612. testing && 0 == f && console.log("cluster " + b + " ping time: " + w);
  4613. w < e && (e = w,
  4614. c = h);
  4615. for (f = sos.length - 1; 0 <= f; f--)
  4616. sos[f].clu == b && (sos[f].ptm = w)
  4617. }
  4618. }
  4619. if ("undefined" != typeof rmsos)
  4620. for (b = 0; b < rmsos.length; b++)
  4621. for (h = "." + rmsos[b].a[0] + "." + rmsos[b].a[1] + "." + rmsos[b].a[2],
  4622. e = rmsos[b].a[3],
  4623. f = sos.length - 1; 0 <= f; f--)
  4624. 0 <= sos[f].ip.indexOf(h) && sos[f].po == e && sos.splice(f, 1);
  4625. e = null;
  4626. if (h = c)
  4627. for (f = 0; 50 > f && null == e; f++)
  4628. if (0 < h.sos.length) {
  4629. for (b = c = 0; b < h.sos.length; b++) {
  4630. var q = h.sos[b];
  4631. c += q.wg / h.swg;
  4632. q.ptv = c
  4633. }
  4634. q.ptv = 1;
  4635. c = Math.random();
  4636. e = h.sos[0];
  4637. for (b = 0; b < h.sos.length; b++)
  4638. q = h.sos[b],
  4639. q.tainted || q.ptv < c && (e = q);
  4640. e.tainted && (e = null)
  4641. }
  4642. if (null != e)
  4643. bso = e;
  4644. else
  4645. for (sos.sort(function(b, c) {
  4646. return parseFloat(b.po) - parseFloat(c.po)
  4647. }),
  4648. bso = sos[Math.floor(Math.random() * sos.length)],
  4649. b = sos.length - 1; 0 <= b; b--)
  4650. sos[b].tainted || sos[b].ptm <= bso.ptm && 20 < sos[b].ac && (bso = sos[b])
  4651. }
  4652. testing && (f = "",
  4653. null != e && (f = "(fbso!)"),
  4654. console.log("connecting to " + bso.ip + ":" + bso.po + "... " + f));
  4655. ws = new WebSocket("ws://" + bso.ip + ":" + bso.po + "/slither");
  4656. ws.binaryType = "arraybuffer";
  4657. window.ws = ws;
  4658. ws.onmessage = function(b) {
  4659. if (ws == this) {
  4660. b = new Uint8Array(b.data);
  4661. rdps += b.length;
  4662. if (testing) {
  4663. omcps++;
  4664. var c = Date.now();
  4665. 1E3 < c - lomcpstm && (lomcpstm = c,
  4666. console.log("omcps: " + omcps + " frames: " + omfps),
  4667. omfps = omcps = 0)
  4668. }
  4669. if (2 <= b.length) {
  4670. lptm = cptm;
  4671. cptm = Date.now();
  4672. c = b[0] << 8 | b[1];
  4673. var e = cptm - lptm;
  4674. 0 == lptm && (e = 0);
  4675. etm += Math.max(-180, Math.min(180, e - c));
  4676. testing && (rdpspc[b[2]] += b.length);
  4677. var f = String.fromCharCode(b[2]);
  4678. c = 3;
  4679. e = b.length;
  4680. var h = b.length - 2
  4681. , q = b.length - 3;
  4682. if ("a" == f)
  4683. connecting = !1,
  4684. playing = connected = !0,
  4685. play_btn_click_mtm = -1,
  4686. grd = b[c] << 16 | b[c + 1] << 8 | b[c + 2],
  4687. c += 3,
  4688. h = b[c] << 8 | b[c + 1],
  4689. c += 2,
  4690. sector_size = b[c] << 8 | b[c + 1],
  4691. c += 2,
  4692. sector_count_along_edge = b[c] << 8 | b[c + 1],
  4693. c += 2,
  4694. spangdv = b[c] / 10,
  4695. c++,
  4696. nsp1 = (b[c] << 8 | b[c + 1]) / 100,
  4697. c += 2,
  4698. nsp2 = (b[c] << 8 | b[c + 1]) / 100,
  4699. c += 2,
  4700. nsp3 = (b[c] << 8 | b[c + 1]) / 100,
  4701. c += 2,
  4702. mamu = (b[c] << 8 | b[c + 1]) / 1E3,
  4703. c += 2,
  4704. mamu2 = (b[c] << 8 | b[c + 1]) / 1E3,
  4705. c += 2,
  4706. cst = (b[c] << 8 | b[c + 1]) / 1E3,
  4707. c += 2,
  4708. c < e && (protocol_version = b[c]),
  4709. setMscps(h),
  4710. lbh.style.display = "inline",
  4711. lbs.style.display = "inline",
  4712. lbn.style.display = "inline",
  4713. lbp.style.display = "inline",
  4714. lbf.style.display = "inline",
  4715. vcm.style.display = "inline",
  4716. loch.style.display = "inline",
  4717. startShowGame();
  4718. else if ("e" == f || "E" == f || "3" == f || "4" == f || "5" == f) {
  4719. var w = b[c] << 8 | b[c + 1];
  4720. c += 2;
  4721. var x = -1
  4722. , C = -1
  4723. , B = -1
  4724. , J = -1;
  4725. if (6 <= protocol_version)
  4726. 6 == h ? (x = "e" == f ? 1 : 2,
  4727. C = 2 * b[c] * Math.PI / 256,
  4728. c++,
  4729. B = 2 * b[c] * Math.PI / 256,
  4730. c++,
  4731. J = b[c] / 18) : 5 == h ? "e" == f ? (C = 2 * b[c] * Math.PI / 256,
  4732. c++,
  4733. J = b[c] / 18) : "E" == f ? (x = 1,
  4734. B = 2 * b[c] * Math.PI / 256,
  4735. c++,
  4736. J = b[c] / 18) : "4" == f ? (x = 2,
  4737. B = 2 * b[c] * Math.PI / 256,
  4738. c++,
  4739. J = b[c] / 18) : "3" == f ? (x = 1,
  4740. C = 2 * b[c] * Math.PI / 256,
  4741. c++,
  4742. B = 2 * b[c] * Math.PI / 256) : "5" == f && (x = 2,
  4743. C = 2 * b[c] * Math.PI / 256,
  4744. c++,
  4745. B = 2 * b[c] * Math.PI / 256) : 4 == h && ("e" == f ? C = 2 * b[c] * Math.PI / 256 : "E" == f ? (x = 1,
  4746. B = 2 * b[c] * Math.PI / 256) : "4" == f ? (x = 2,
  4747. B = 2 * b[c] * Math.PI / 256) : "3" == f && (J = b[c] / 18));
  4748. else if (3 <= protocol_version) {
  4749. "3" != f && (8 == h || 7 == h || 6 == h && "3" != f || 5 == h && "3" != f) && (x = "e" == f ? 1 : 2);
  4750. if (8 == h || 7 == h || 5 == h && "3" == f || 6 == h && "3" == f)
  4751. C = 2 * (b[c] << 8 | b[c + 1]) * Math.PI / 65535,
  4752. c += 2;
  4753. if (8 == h || 7 == h || 5 == h && "3" != f || 6 == h && "3" != f)
  4754. B = 2 * (b[c] << 8 | b[c + 1]) * Math.PI / 65535,
  4755. c += 2;
  4756. if (8 == h || 6 == h || 4 == h)
  4757. J = b[c] / 18
  4758. } else {
  4759. if (11 == q || 8 == q || 9 == q || 6 == q)
  4760. x = b[c] - 48,
  4761. c++;
  4762. if (11 == q || 7 == q || 9 == q || 5 == q)
  4763. C = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  4764. c += 3;
  4765. if (11 == q || 8 == q || 9 == q || 6 == q)
  4766. B = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  4767. c += 3;
  4768. if (11 == q || 7 == q || 8 == q || 4 == q)
  4769. J = (b[c] << 8 | b[c + 1]) / 1E3
  4770. }
  4771. if (e = os["s" + w]) {
  4772. -1 != x && (e.dir = x);
  4773. anguc++;
  4774. if (-1 != C) {
  4775. e.ang == C && angnuc++;
  4776. b = (C - e.ang) % pi2;
  4777. 0 > b && (b += pi2);
  4778. b > Math.PI && (b -= pi2);
  4779. var z = e.fapos;
  4780. for (q = 0; q < afc; q++)
  4781. e.fas[z] -= b * afas[q],
  4782. z++,
  4783. z >= afc && (z = 0);
  4784. e.fatg = afc;
  4785. e.ang = C
  4786. }
  4787. -1 != B && (e.wang == B && wangnuc++,
  4788. e.wang = B,
  4789. e != snake && (e.eang = B));
  4790. -1 != J && (e.sp = J,
  4791. e.spang = e.sp / spangdv,
  4792. 1 < e.spang && (e.spang = 1))
  4793. }
  4794. } else if ("6" == f) {
  4795. for (h = ""; c < e; )
  4796. h += String.fromCharCode(b[c]),
  4797. c++;
  4798. gotServerVersion(h)
  4799. } else if ("h" == f) {
  4800. if (w = b[c] << 8 | b[c + 1],
  4801. c += 2,
  4802. x = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 16777215,
  4803. e = os["s" + w])
  4804. e.fam = x,
  4805. snl(e)
  4806. } else if ("r" == f) {
  4807. if (w = b[c] << 8 | b[c + 1],
  4808. c += 2,
  4809. e = os["s" + w]) {
  4810. 4 <= q && (e.fam = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 16777215);
  4811. for (q = 0; q < e.pts.length; q++)
  4812. if (!e.pts[q].dying) {
  4813. e.pts[q].dying = !0;
  4814. e.sct--;
  4815. e.sc = Math.min(6, 1 + (e.sct - 2) / 106);
  4816. e.scang = .13 + .87 * Math.pow((7 - e.sc) / 6, 2);
  4817. e.ssp = nsp1 + nsp2 * e.sc;
  4818. e.fsp = e.ssp + .1;
  4819. e.wsep = 6 * e.sc;
  4820. b = nsep / gsc;
  4821. e.wsep < b && (e.wsep = b);
  4822. break
  4823. }
  4824. snl(e)
  4825. }
  4826. } else if ("g" == f || "n" == f || "G" == f || "N" == f) {
  4827. if (playing) {
  4828. var D = "n" == f || "N" == f;
  4829. w = b[c] << 8 | b[c + 1];
  4830. c += 2;
  4831. if (e = os["s" + w]) {
  4832. if (D)
  4833. e.sct++;
  4834. else
  4835. for (q = 0; q < e.pts.length; q++)
  4836. if (!e.pts[q].dying) {
  4837. e.pts[q].dying = !0;
  4838. break
  4839. }
  4840. var E = e.pts[e.pts.length - 1];
  4841. z = E;
  4842. 3 <= protocol_version ? "g" == f || "n" == f ? (h = b[c] << 8 | b[c + 1],
  4843. c += 2,
  4844. I = b[c] << 8 | b[c + 1],
  4845. c += 2) : (h = z.xx + b[c] - 128,
  4846. c++,
  4847. I = z.yy + b[c] - 128,
  4848. c++) : (h = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5,
  4849. c += 3,
  4850. I = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5,
  4851. c += 3);
  4852. D && (e.fam = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 16777215);
  4853. (E = points_dp.get()) || (E = {
  4854. exs: [],
  4855. eys: [],
  4856. efs: [],
  4857. ems: []
  4858. });
  4859. E.eiu = 0;
  4860. E.xx = h;
  4861. E.yy = I;
  4862. E.fx = 0;
  4863. E.fy = 0;
  4864. E.da = 0;
  4865. E.ebx = E.xx - z.xx;
  4866. E.eby = E.yy - z.yy;
  4867. e.pts.push(E);
  4868. e.iiv && (b = e.xx + e.fx - E.xx,
  4869. c = e.yy + e.fy - E.yy,
  4870. E.fx += b,
  4871. E.fy += c,
  4872. E.exs[E.eiu] = b,
  4873. E.eys[E.eiu] = c,
  4874. E.efs[E.eiu] = 0,
  4875. E.ems[E.eiu] = 1,
  4876. E.eiu++);
  4877. z = e.pts.length - 3;
  4878. if (1 <= z)
  4879. for (f = e.pts[z],
  4880. w = n = 0,
  4881. q = z - 1; 0 <= q; q--)
  4882. z = e.pts[q],
  4883. n++,
  4884. b = z.xx,
  4885. c = z.yy,
  4886. 4 >= n && (w = cst * n / 4),
  4887. z.xx += (f.xx - z.xx) * w,
  4888. z.yy += (f.yy - z.yy) * w,
  4889. e.iiv && (b -= z.xx,
  4890. c -= z.yy,
  4891. z.fx += b,
  4892. z.fy += c,
  4893. z.exs[z.eiu] = b,
  4894. z.eys[z.eiu] = c,
  4895. z.efs[z.eiu] = 0,
  4896. z.ems[z.eiu] = 2,
  4897. z.eiu++),
  4898. f = z;
  4899. e.sc = Math.min(6, 1 + (e.sct - 2) / 106);
  4900. e.scang = .13 + .87 * Math.pow((7 - e.sc) / 6, 2);
  4901. e.ssp = nsp1 + nsp2 * e.sc;
  4902. e.fsp = e.ssp + .1;
  4903. e.wsep = 6 * e.sc;
  4904. b = nsep / gsc;
  4905. e.wsep < b && (e.wsep = b);
  4906. D && snl(e);
  4907. e.lnp = E;
  4908. e == snake && (ovxx = snake.xx + snake.fx,
  4909. ovyy = snake.yy + snake.fy);
  4910. D = etm / 8 * e.sp / 4;
  4911. D *= lag_mult;
  4912. q = e.chl - 1;
  4913. e.chl = D / e.msl;
  4914. w = e.xx;
  4915. z = e.yy;
  4916. e.xx = h + Math.cos(e.ang) * D;
  4917. e.yy = I + Math.sin(e.ang) * D;
  4918. b = e.xx - w;
  4919. c = e.yy - z;
  4920. h = e.chl - q;
  4921. z = e.fpos;
  4922. for (q = 0; q < rfc; q++)
  4923. e.fxs[z] -= b * rfas[q],
  4924. e.fys[z] -= c * rfas[q],
  4925. e.fchls[z] -= h * rfas[q],
  4926. z++,
  4927. z >= rfc && (z = 0);
  4928. e.fx = e.fxs[e.fpos];
  4929. e.fy = e.fys[e.fpos];
  4930. e.fchl = e.fchls[e.fpos];
  4931. e.ftg = rfc;
  4932. e.ehl = 0;
  4933. if (e == snake) {
  4934. b = view_xx;
  4935. c = view_yy;
  4936. view_xx = snake.xx + snake.fx;
  4937. view_yy = snake.yy + snake.fy;
  4938. bgx2 -= (view_xx - b) / bgw2;
  4939. bgy2 -= (view_yy - c) / bgh2;
  4940. bgx2 %= 1;
  4941. 0 > bgx2 && (bgx2 += 1);
  4942. bgy2 %= 1;
  4943. 0 > bgy2 && (bgy2 += 1);
  4944. b = view_xx - ovxx;
  4945. c = view_yy - ovyy;
  4946. z = fvpos;
  4947. for (q = 0; q < vfc; q++)
  4948. fvxs[z] -= b * vfas[q],
  4949. fvys[z] -= c * vfas[q],
  4950. z++,
  4951. z >= vfc && (z = 0);
  4952. fvtg = vfc
  4953. }
  4954. }
  4955. }
  4956. } else if ("l" == f) {
  4957. if (playing) {
  4958. wumsts = !0;
  4959. E = w = I = "";
  4960. B = C = 0;
  4961. -1 == lb_fr && -1 == dead_mtm && (lb_fr = 0);
  4962. J = b[c];
  4963. c++;
  4964. rank = b[c] << 8 | b[c + 1];
  4965. rank < best_rank && (best_rank = rank);
  4966. c += 2;
  4967. snake_count = b[c] << 8 | b[c + 1];
  4968. snake_count > biggest_snake_count && (biggest_snake_count = snake_count);
  4969. for (c += 2; c < e; ) {
  4970. var O = b[c] << 8 | b[c + 1];
  4971. c += 2;
  4972. x = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 16777215;
  4973. c += 3;
  4974. D = b[c] % 9;
  4975. c++;
  4976. h = b[c];
  4977. c++;
  4978. B++;
  4979. f = "";
  4980. for (q = 0; q < h; q++)
  4981. z = b[c],
  4982. f += String.fromCharCode(z),
  4983. c++;
  4984. B == J ? (f = my_nick,
  4985. h = f.length) : gdnm(f) || (f = "");
  4986. var N = "";
  4987. for (q = 0; q < h; q++)
  4988. z = f.charCodeAt(q),
  4989. N = 38 == z ? N + "&amp;" : 60 == z ? N + "&lt;" : 62 == z ? N + "&gt;" : 32 == z ? N + "&nbsp;" : N + String.fromCharCode(z);
  4990. f = N;
  4991. C++;
  4992. score = Math.floor(15 * (fpsls[O] + x / fmlts[O] - 1) - 5) / 1;
  4993. z = B == J ? 1 : .7 * (.3 + .7 * (1 - C / 10));
  4994. I += '<span style="opacity:' + z + "; color:" + per_color_imgs[D].cs + ';">' + score + "</span><BR>";
  4995. w += '<span style="opacity:' + z + "; color:" + per_color_imgs[D].cs + ";" + (B == J ? "font-weight:bold;" : "") + '">' + f + "</span><BR>";
  4996. E += '<span style="opacity:' + z + "; color:" + per_color_imgs[D].cs + ';">#' + C + "</span><BR>"
  4997. }
  4998. lbs.innerHTML = I;
  4999. lbn.innerHTML = w;
  5000. lbp.innerHTML = E
  5001. }
  5002. } else if ("v" == f)
  5003. 2 == b[c] ? (want_close_socket = !0,
  5004. want_victory_message = !1,
  5005. want_hide_victory = 1,
  5006. hvfr = 0) : (dead_mtm = Date.now(),
  5007. play_btn.setEnabled(!0),
  5008. e = Math.floor(15 * (fpsls[snake.sct] + snake.fam / fmlts[snake.sct] - 1) - 5) / 1,
  5009. twt.href = "http://twitter.com/intent/tweet?status=" + encodeURIComponent("I got a length of " + e + " in http://slither.io! Can you beat that? #slitherio"),
  5010. h = "Your final length was",
  5011. "de" == lang ? h = "Deine endg\u00fcltige L\u00e4nge war" : "fr" == lang ? h = "Votre longueur finale \u00e9tait de" : "pt" == lang && (h = "Seu comprimento final foi de"),
  5012. I = "",
  5013. 1E3 < e && (I = "!"),
  5014. lastscore.innerHTML = '<span style="opacity: .45;">' + h + " </span><b>" + e + "</b>" + I,
  5015. e = "Play Again",
  5016. "fr" == lang ? e = "Jouer" : "pt" == lang && (e = "Joga"),
  5017. play_btn.setText(String.fromCharCode(160) + e + String.fromCharCode(160)),
  5018. 1 == b[c] ? (nick_holder.style.display = "none",
  5019. playh.style.display = "none",
  5020. smh.style.display = "none",
  5021. victory_holder.style.display = "inline",
  5022. saveh.style.display = "block",
  5023. want_victory_focus = want_victory_message = !0,
  5024. victory.disabled = !1,
  5025. save_btn.setEnabled(!0)) : want_close_socket = !0);
  5026. else if ("W" == f)
  5027. h = b[c],
  5028. c++,
  5029. I = b[c],
  5030. e = {},
  5031. e.xx = h,
  5032. e.yy = I,
  5033. sectors.push(e);
  5034. else if ("w" == f)
  5035. if (8 <= protocol_version ? (e = 2,
  5036. h = b[c],
  5037. c++,
  5038. I = b[c]) : (e = b[c],
  5039. c++,
  5040. h = b[c] << 8 | b[c + 1],
  5041. c += 2,
  5042. I = b[c] << 8 | b[c + 1]),
  5043. 1 == e)
  5044. e = {},
  5045. e.xx = h,
  5046. e.yy = I,
  5047. sectors.push(e);
  5048. else {
  5049. for (D = cm1 = foods_c - 1; 0 <= D; D--)
  5050. z = foods[D],
  5051. z.sx == h && z.sy == I && (D == cm1 ? foods[D] = null : (foods[D] = foods[cm1],
  5052. foods[cm1] = null),
  5053. foods_c--,
  5054. cm1--);
  5055. for (D = sectors.length - 1; 0 <= D; D--)
  5056. e = sectors[D],
  5057. e.xx == h && e.yy == I && sectors.splice(D, 1)
  5058. }
  5059. else if ("m" == f) {
  5060. O = b[c] << 16 | b[c + 1] << 8 | b[c + 2];
  5061. c += 3;
  5062. x = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 16777215;
  5063. c += 3;
  5064. I = Math.floor(15 * (fpsls[O] + x / fmlts[O] - 1) - 5) / 1;
  5065. h = b[c];
  5066. c++;
  5067. z = "";
  5068. for (D = 0; D < h; D++)
  5069. z += String.fromCharCode(b[c]),
  5070. c++;
  5071. gdnm(z) || (z = "");
  5072. for (h = ""; c < e; )
  5073. h += String.fromCharCode(b[c]),
  5074. c++;
  5075. gdnm(h) || (h = "");
  5076. z = z.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
  5077. h = h.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
  5078. 0 < I && (b = "",
  5079. 0 < h.length && (b += "<span style='font-size:17px;'><b><i><span style='opacity: .5;'>&quot;</span>" + h + "<span style='opacity: .5;'>&quot;</span></i></b></span><BR><div style='height: 5px;'></div>"),
  5080. 0 < z.length ? (b = 0 < h.length ? b + ("<i><span style='opacity: .5;'>- </span><span style='opacity: .75;'><b>" + z + "</b></span><span style='opacity: .5;'>, today's longest</span></i>") : "<i><span style='opacity: .5;'>Today's longest was </span><span style='opacity: .75;'><b>" + z + "</b></span></i>",
  5081. b += "<br><i><span style='opacity: .5;'>with a length of </span><span style='opacity: .65;'><b>" + I + "</b></span></i>") : b = 0 < h.length ? b + "<i><span style='opacity: .5;'>- </span><span style='opacity: .5;'>today's longest</span></i>" + ("<br><i><span style='opacity: .5;'>with a length of </span><span style='opacity: .65;'><b>" + I + "</b></span></i>") : b + ("<i><span style='opacity: .5;'>Today's longest: </span><span style='opacity: .75;'><b>" + I + "</b></span></i>"),
  5082. vcm.innerHTML = b)
  5083. } else if ("p" == f)
  5084. wfpr = !1,
  5085. lagging && (etm *= lag_mult,
  5086. lagging = !1);
  5087. else if ("u" == f) {
  5088. q = asmc.getContext("2d");
  5089. q.clearRect(0, 0, 80, 80);
  5090. q.fillStyle = "#FFFFFF";
  5091. for (var I = h = 0; c < e && !(80 <= I); )
  5092. if (z = b[c++],
  5093. 128 <= z)
  5094. for (z -= 128,
  5095. D = 0; D < z && !(h++,
  5096. 80 <= h && (h = 0,
  5097. I++,
  5098. 80 <= I)); D++)
  5099. ;
  5100. else
  5101. for (D = 0; 7 > D && !(0 < (z & u_m[D]) && q.fillRect(h, I, 1, 1),
  5102. h++,
  5103. 80 <= h && (h = 0,
  5104. I++,
  5105. 80 <= I)); D++)
  5106. ;
  5107. } else if ("i" == f) {
  5108. if (adm = !0,
  5109. w = b[c] << 8 | b[c + 1],
  5110. c += 2,
  5111. e = os["s" + w])
  5112. if (h = b[c],
  5113. c++,
  5114. I = b[c],
  5115. c++,
  5116. z = b[c],
  5117. c++,
  5118. b = b[c],
  5119. 0 < h || 0 < I || 0 < z || 0 < b)
  5120. e.nk += " - " + (h + "." + I + "." + z + "." + b),
  5121. console.log(e.nk)
  5122. } else if ("o" == f) {
  5123. if (checking_code)
  5124. if (connecting)
  5125. connecting = !1,
  5126. connected = !0;
  5127. else {
  5128. if (0 == b[c])
  5129. etcshk = !0,
  5130. etcshkv = 0;
  5131. else {
  5132. b = [];
  5133. try {
  5134. (I = localStorage.cocds) && (b = ("" + I).split(","))
  5135. } catch (R) {}
  5136. h = "" + etcods[0].v;
  5137. h += "" + etcods[1].v;
  5138. h += "" + etcods[2].v;
  5139. h += "" + etcods[3].v;
  5140. h = h + "-" + ("" + etcods[5].v);
  5141. h += "" + etcods[6].v;
  5142. h += "" + etcods[7].v;
  5143. h += "" + etcods[8].v;
  5144. h = h + "-" + ("" + etcods[10].v);
  5145. h += "" + etcods[11].v;
  5146. h += "" + etcods[12].v;
  5147. h += "" + etcods[13].v;
  5148. c = !0;
  5149. for (D = b.length - 1; 0 <= D; D--)
  5150. if (b[D] == h) {
  5151. c = !1;
  5152. break
  5153. }
  5154. if (c) {
  5155. b.push(h);
  5156. try {
  5157. localStorage.cocds = b.join(",")
  5158. } catch (R) {}
  5159. recalculateActivatedCosmetics()
  5160. }
  5161. want_open_cosmetics = ending_enter_code = !0
  5162. }
  5163. stchco()
  5164. }
  5165. } else if ("s" == f) {
  5166. if (playing)
  5167. if (w = b[c] << 8 | b[c + 1],
  5168. c += 2,
  5169. 6 < q) {
  5170. C = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215;
  5171. c += 3;
  5172. c++;
  5173. B = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215;
  5174. c += 3;
  5175. J = (b[c] << 8 | b[c + 1]) / 1E3;
  5176. c += 2;
  5177. x = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 16777215;
  5178. c += 3;
  5179. D = b[c];
  5180. c++;
  5181. O = [];
  5182. N = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5;
  5183. c += 3;
  5184. var Q = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5;
  5185. c += 3;
  5186. h = b[c];
  5187. c++;
  5188. f = "";
  5189. for (q = 0; q < h; q++)
  5190. f += String.fromCharCode(b[c]),
  5191. c++;
  5192. var P = null;
  5193. if (11 <= protocol_version) {
  5194. h = b[c];
  5195. c++;
  5196. if (0 < h)
  5197. for (P = new Uint8Array(h),
  5198. q = 0; q < h; q++)
  5199. P[q] = b[c + q];
  5200. c += h
  5201. }
  5202. I = h = 0;
  5203. for (var S, T = !1; c < e; )
  5204. q = h,
  5205. S = I,
  5206. T ? (h += (b[c] - 127) / 2,
  5207. c++,
  5208. I += (b[c] - 127) / 2,
  5209. c++) : (h = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5,
  5210. c += 3,
  5211. I = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5,
  5212. c += 3,
  5213. q = h,
  5214. S = I,
  5215. T = !0),
  5216. (E = points_dp.get()) || (E = {
  5217. exs: [],
  5218. eys: [],
  5219. efs: [],
  5220. ems: []
  5221. }),
  5222. E.eiu = 0,
  5223. E.xx = h,
  5224. E.yy = I,
  5225. E.fx = 0,
  5226. E.fy = 0,
  5227. E.da = 0,
  5228. E.ebx = h - q,
  5229. E.eby = I - S,
  5230. O.push(E);
  5231. e = newSnake(w, N, Q, D, C, O, P);
  5232. if (null == snake) {
  5233. view_xx = h;
  5234. view_yy = I;
  5235. snake = e;
  5236. try {
  5237. z = localStorage.cosmetic,
  5238. z == "" + Number(z) && (snake.accessory = Number(z))
  5239. } catch (R) {}
  5240. snake.md = !1;
  5241. snake.wmd = !1;
  5242. e.nk = my_nick
  5243. } else
  5244. e.nk = f,
  5245. gdnm(f) || (e.nk = "");
  5246. e.eang = e.wang = B;
  5247. e.sp = J;
  5248. e.spang = e.sp / spangdv;
  5249. 1 < e.spang && (e.spang = 1);
  5250. e.fam = x;
  5251. e.sc = Math.min(6, 1 + (e.sct - 2) / 106);
  5252. e.scang = .13 + .87 * Math.pow((7 - e.sc) / 6, 2);
  5253. e.ssp = nsp1 + nsp2 * e.sc;
  5254. e.fsp = e.ssp + .1;
  5255. e.wsep = 6 * e.sc;
  5256. b = nsep / gsc;
  5257. e.wsep < b && (e.wsep = b);
  5258. e.sep = e.wsep;
  5259. snl(e)
  5260. } else
  5261. for (b = 1 == b[c],
  5262. D = snakes.length - 1; 0 <= D; D--)
  5263. if (snakes[D].id == w) {
  5264. snakes[D].id = -1234;
  5265. b ? (snakes[D].dead = !0,
  5266. snakes[D].dead_amt = 0,
  5267. snakes[D].edir = 0) : snakes.splice(D, 1);
  5268. delete os["s" + w];
  5269. break
  5270. }
  5271. } else if ("F" == f)
  5272. if (4 <= protocol_version)
  5273. for (q = !1; c < e; )
  5274. D = b[c],
  5275. c++,
  5276. h = b[c] << 8 | b[c + 1],
  5277. c += 2,
  5278. I = b[c] << 8 | b[c + 1],
  5279. c += 2,
  5280. z = b[c] / 5,
  5281. c++,
  5282. w = I * grd * 3 + h,
  5283. z = newFood(w, h, I, z, !0, D),
  5284. q || (q = !0,
  5285. x = Math.floor(h / sector_size),
  5286. E = Math.floor(I / sector_size)),
  5287. z.sx = x,
  5288. z.sy = E;
  5289. else
  5290. for (x = b[c] << 8 | b[c + 1],
  5291. c += 2,
  5292. E = b[c] << 8 | b[c + 1],
  5293. c += 2; c < e; )
  5294. w = b[c] << 16 | b[c + 1] << 8 | b[c + 2],
  5295. c += 3,
  5296. D = b[c],
  5297. c++,
  5298. h = sector_size * (x + b[c] / 255),
  5299. c++,
  5300. I = sector_size * (E + b[c] / 255),
  5301. c++,
  5302. z = b[c] / 5,
  5303. c++,
  5304. z = newFood(w, h, I, z, !0, D),
  5305. z.sx = x,
  5306. z.sy = E;
  5307. else if ("b" == f || "f" == f)
  5308. 4 <= protocol_version ? (D = b[c],
  5309. c++,
  5310. 4 < q && (h = b[c] << 8 | b[c + 1],
  5311. c += 2,
  5312. I = b[c] << 8 | b[c + 1],
  5313. w = I * grd * 3 + h,
  5314. z = b[c + 2] / 5,
  5315. z = newFood(w, h, I, z, "b" == f, D),
  5316. z.sx = Math.floor(h / sector_size),
  5317. z.sy = Math.floor(I / sector_size))) : (w = b[c] << 16 | b[c + 1] << 8 | b[c + 2],
  5318. c += 3,
  5319. 4 < q && (D = b[c],
  5320. c++,
  5321. x = b[c] << 8 | b[c + 1],
  5322. c += 2,
  5323. E = b[c] << 8 | b[c + 1],
  5324. c += 2,
  5325. h = sector_size * (x + b[c] / 255),
  5326. c++,
  5327. I = sector_size * (E + b[c] / 255),
  5328. c++,
  5329. z = b[c] / 5,
  5330. z = newFood(w, h, I, z, "b" == f, D),
  5331. z.sx = x,
  5332. z.sy = E));
  5333. else if ("c" == f) {
  5334. 4 <= protocol_version ? (h = b[c] << 8 | b[c + 1],
  5335. c += 2,
  5336. I = b[c] << 8 | b[c + 1],
  5337. c += 2,
  5338. w = I * grd * 3 + h) : (w = b[c] << 16 | b[c + 1] << 8 | b[c + 2],
  5339. c += 3);
  5340. for (D = cm1 = foods_c - 1; 0 <= D; D--)
  5341. if (z = foods[D],
  5342. z.id == w) {
  5343. z.eaten = !0;
  5344. c + 2 <= e ? (b = b[c] << 8 | b[c + 1],
  5345. z.eaten_by = os["s" + b],
  5346. z.eaten_fr = 0) : (D == cm1 ? foods[D] = null : (foods[D] = foods[cm1],
  5347. foods[cm1] = null),
  5348. foods_c--,
  5349. cm1--);
  5350. w = -1;
  5351. break
  5352. }
  5353. testing && -1 != w && console.log("wtf")
  5354. } else if ("j" == f) {
  5355. w = b[c] << 8 | b[c + 1];
  5356. c += 2;
  5357. h = 1 + 3 * (b[c] << 8 | b[c + 1]);
  5358. c += 2;
  5359. I = 1 + 3 * (b[c] << 8 | b[c + 1]);
  5360. c += 2;
  5361. e = null;
  5362. for (D = preys.length - 1; 0 <= D; D--)
  5363. if (preys[D].id == w) {
  5364. e = preys[D];
  5365. break
  5366. }
  5367. if (e) {
  5368. D = etm / 8 * e.sp / 4;
  5369. D *= lag_mult;
  5370. w = e.xx;
  5371. z = e.yy;
  5372. 15 == q ? (e.dir = b[c] - 48,
  5373. c++,
  5374. e.ang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5375. c += 3,
  5376. e.wang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5377. c += 3,
  5378. e.sp = (b[c] << 8 | b[c + 1]) / 1E3) : 11 == q ? (e.ang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5379. c += 3,
  5380. e.sp = (b[c] << 8 | b[c + 1]) / 1E3) : 12 == q ? (e.dir = b[c] - 48,
  5381. c++,
  5382. e.wang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5383. c += 3,
  5384. e.sp = (b[c] << 8 | b[c + 1]) / 1E3) : 13 == q ? (e.dir = b[c] - 48,
  5385. c++,
  5386. e.ang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5387. c += 3,
  5388. e.wang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215) : 9 == q ? e.ang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215 : 10 == q ? (e.dir = b[c] - 48,
  5389. c++,
  5390. e.wang = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215) : 8 == q && (e.sp = (b[c] << 8 | b[c + 1]) / 1E3);
  5391. e.xx = h + Math.cos(e.ang) * D;
  5392. e.yy = I + Math.sin(e.ang) * D;
  5393. b = e.xx - w;
  5394. c = e.yy - z;
  5395. z = e.fpos;
  5396. for (q = 0; q < rfc; q++)
  5397. e.fxs[z] -= b * rfas[q],
  5398. e.fys[z] -= c * rfas[q],
  5399. z++,
  5400. z >= rfc && (z = 0);
  5401. e.fx = e.fxs[e.fpos];
  5402. e.fy = e.fys[e.fpos];
  5403. e.ftg = rfc
  5404. }
  5405. } else if ("y" == f)
  5406. if (w = b[c] << 8 | b[c + 1],
  5407. c += 2,
  5408. 2 == q)
  5409. for (D = preys.length - 1; 0 <= D; D--) {
  5410. if (e = preys[D],
  5411. e.id == w) {
  5412. preys.splice(D, 1);
  5413. break
  5414. }
  5415. }
  5416. else if (4 == q)
  5417. for (b = b[c] << 8 | b[c + 1],
  5418. D = preys.length - 1; 0 <= D; D--) {
  5419. if (e = preys[D],
  5420. e.id == w) {
  5421. e.eaten = !0;
  5422. e.eaten_by = os["s" + b];
  5423. e.eaten_by ? e.eaten_fr = 0 : preys.splice(D, 1);
  5424. break
  5425. }
  5426. }
  5427. else
  5428. D = b[c],
  5429. c++,
  5430. h = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5,
  5431. c += 3,
  5432. I = (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) / 5,
  5433. c += 3,
  5434. z = b[c] / 5,
  5435. c++,
  5436. x = b[c] - 48,
  5437. c++,
  5438. B = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5439. c += 3,
  5440. C = 2 * (b[c] << 16 | b[c + 1] << 8 | b[c + 2]) * Math.PI / 16777215,
  5441. c += 3,
  5442. J = (b[c] << 8 | b[c + 1]) / 1E3,
  5443. newPrey(w, h, I, z, D, x, B, C, J)
  5444. }
  5445. }
  5446. }
  5447. ;
  5448. ws.onerror = function(b) {}
  5449. ;
  5450. ws.onclose = function(b) {
  5451. ws == this && (playing = connected = !1)
  5452. }
  5453. ;
  5454. ws.onopen = function(b) {
  5455. if (ws == this) {
  5456. b = asciize(nick.value);
  5457. 24 < b.length && (b = b.substr(0, 24));
  5458. if ("gameweek2016" == b.toLowerCase()) {
  5459. b = "";
  5460. try {
  5461. localStorage.gw2k16 = "1",
  5462. gw2k16 = !0
  5463. } catch (L) {}
  5464. }
  5465. my_nick = b;
  5466. gdnm(b) || (b = "");
  5467. var c = Math.floor(9 * Math.random());
  5468. try {
  5469. var e = localStorage.snakercv;
  5470. e == "" + Number(e) && (c = Number(e))
  5471. } catch (L) {}
  5472. e = [];
  5473. var f = !1
  5474. , h = "";
  5475. try {
  5476. f = "1" == localStorage.want_custom_skin,
  5477. h = localStorage.custom_skin
  5478. } catch (L) {}
  5479. if (f && h && 0 < h.length)
  5480. for (h = ("" + h).split(","),
  5481. e = new Uint8Array(h.length),
  5482. f = 0; f < h.length; f++)
  5483. e[f] = Number(h[f]);
  5484. if (checking_code) {
  5485. if (14 == etcods.length) {
  5486. var q = new Uint8Array(7);
  5487. q[0] = 111;
  5488. b = 1E3 * etcods[0].v + 100 * etcods[1].v + 10 * etcods[2].v + etcods[3].v;
  5489. c = 1E3 * etcods[5].v + 100 * etcods[6].v + 10 * etcods[7].v + etcods[8].v;
  5490. e = 1E3 * etcods[10].v + 100 * etcods[11].v + 10 * etcods[12].v + etcods[13].v;
  5491. q[1] = b >> 8 & 255;
  5492. q[2] = b & 255;
  5493. q[3] = c >> 8 & 255;
  5494. q[4] = c & 255;
  5495. q[5] = e >> 8 & 255;
  5496. q[6] = e & 255
  5497. }
  5498. } else {
  5499. q = new Uint8Array(4 + b.length + e.length);
  5500. q[0] = 115;
  5501. q[1] = 10;
  5502. q[2] = c;
  5503. q[3] = b.length;
  5504. c = 4;
  5505. for (f = 0; f < b.length; f++)
  5506. q[c] = b.charCodeAt(f),
  5507. c++;
  5508. for (f = 0; f < e.length; f++)
  5509. q[c] = e[f],
  5510. c++
  5511. }
  5512. startLogin(q);
  5513. high_quality = !0;
  5514. gla = 1;
  5515. wdfg = 0;
  5516. qsm = 1;
  5517. 0 == want_quality && (high_quality = !1,
  5518. gla = 0,
  5519. qsm = 1.7);
  5520. 1 == render_mode && (high_quality = !1,
  5521. gla = 0);
  5522. lpstm = Date.now()
  5523. }
  5524. }
  5525. }
  5526. }
  5527. function asciize(b) {
  5528. var c;
  5529. var e = b.length;
  5530. var h = !1;
  5531. for (c = 0; c < e; c++) {
  5532. var w = b.charCodeAt(c);
  5533. if (32 > w || 127 < w) {
  5534. h = !0;
  5535. break
  5536. }
  5537. }
  5538. if (h) {
  5539. h = "";
  5540. for (c = 0; c < e; c++)
  5541. w = b.charCodeAt(c),
  5542. h = 32 > w || 127 < w ? h + " " : h + String.fromCharCode(w);
  5543. return h
  5544. }
  5545. return b
  5546. }
  5547. var smh = document.getElementById("smh")
  5548. , cstx = document.getElementById("cstx");
  5549. cstx.style.display = "none";
  5550. var fb = document.getElementById("fb");
  5551. fb.href = "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent("http://slither.io");
  5552. fb.onclick = function() {
  5553. try {
  5554. localStorage.edttsg = "1"
  5555. } catch (b) {}
  5556. }
  5557. ;
  5558. var fbh = document.getElementById("fbh")
  5559. , twt = document.getElementById("twt");
  5560. twt.onclick = function() {
  5561. try {
  5562. localStorage.edttsg = "1"
  5563. } catch (b) {}
  5564. }
  5565. ;
  5566. twt.href = "http://twitter.com/intent/tweet?status=" + encodeURIComponent("Come and play http://slither.io #slitherio");
  5567. var twth = document.getElementById("twth")
  5568. , csk = document.getElementById("csk")
  5569. , cskh = document.getElementById("cskh")
  5570. , bsk = document.getElementById("bsk")
  5571. , bskh = document.getElementById("bskh")
  5572. , scos = document.getElementById("scos")
  5573. , scosh = document.getElementById("scosh")
  5574. , etco = document.getElementById("etco")
  5575. , etcoh = document.getElementById("etcoh")
  5576. , want_quality = 1
  5577. , grq = document.getElementById("grq")
  5578. , grqh = document.getElementById("grqh")
  5579. , phqi = document.createElement("img")
  5580. , grqi = document.getElementById("grqi");
  5581. try {
  5582. "0" == localStorage.qual ? (grqi.src = "/s/lowquality.png",
  5583. want_quality = 0) : (phqi.src = "/s/lowquality.png",
  5584. want_quality = 1)
  5585. } catch (b) {}
  5586. grq.onclick = function() {
  5587. try {
  5588. "0" == localStorage.qual ? (localStorage.qual = "1",
  5589. grqi.src = "/s/highquality.png",
  5590. want_quality = 1) : (localStorage.qual = "0",
  5591. grqi.src = "/s/lowquality.png",
  5592. want_quality = 0)
  5593. } catch (b) {}
  5594. return !1
  5595. }
  5596. ;
  5597. var plq = document.getElementById("plq")
  5598. , clq = document.getElementById("clq");
  5599. cskh.style.display = "inline";
  5600. var psk = document.getElementById("psk")
  5601. , pskh = document.getElementById("pskh")
  5602. , nsk = document.getElementById("nsk")
  5603. , nskh = document.getElementById("nskh")
  5604. , etcod = document.getElementById("etcod")
  5605. , etcot = document.createElement("div");
  5606. etcod.appendChild(etcot);
  5607. var t = etcot;
  5608. t.style.position = "absolute";
  5609. t.style.width = "800px";
  5610. t.style.height = "32px";
  5611. t.style.textAlign = "center";
  5612. t.style.color = "#FFFFFF";
  5613. t.style.fontWeight = "bold";
  5614. t.style.textAlign = "center";
  5615. t.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  5616. t.style.fontSize = "18px";
  5617. t.textContent = "if you have a code, enter it here!";
  5618. t.className = "nsi";
  5619. var etcobs = [];
  5620. for (i = 0; 10 >= i; i++)
  5621. a = document.createElement("a"),
  5622. a.draggable = !1,
  5623. a.href = "#",
  5624. a.className = "btn btnt",
  5625. ii = document.createElement("img"),
  5626. ii.width = 135,
  5627. ii.height = 135,
  5628. ii.className = "nsi",
  5629. ii.style.position = "absolute",
  5630. ii.draggable = !1,
  5631. ii.style.opacity = 0,
  5632. etcod.appendChild(a),
  5633. a.appendChild(ii),
  5634. a.onclick = function() {
  5635. var b;
  5636. for (b = etcobs.length - 1; 0 <= b; b--)
  5637. if (etcobs[b].a == this) {
  5638. b = etcobs[b];
  5639. 10 == b.v ? deleteLastCodeDigit() : enterCodeDigit(b.v);
  5640. break
  5641. }
  5642. return !1
  5643. }
  5644. ,
  5645. ii.onload = function() {
  5646. var b;
  5647. for (b = etcobs.length - 1; 0 <= b; b--)
  5648. if (etcobs[b].ii == this) {
  5649. b = etcobs[b];
  5650. b.loaded = !0;
  5651. break
  5652. }
  5653. }
  5654. ,
  5655. o = {},
  5656. o.ii = ii,
  5657. o.a = a,
  5658. o.alpha = 0,
  5659. o.v = i,
  5660. etcobs.push(o);
  5661. pstr = "Cancel";
  5662. "de" == lang ? pstr = "Stornieren" : "fr" == lang ? pstr = "Annuler" : "pt" == lang ? pstr = "Cancelar" : "es" == lang && (pstr = "Cancelar");
  5663. var cancel_code_btn = o = makeTextBtn(String.fromCharCode(160) + pstr + String.fromCharCode(160), 47, 20, 34, 1)
  5664. , etcocdiv = o.elem;
  5665. etcocdiv.style.zIndex = 53;
  5666. etcocdiv.style.position = "fixed";
  5667. etcocdiv.onclick = function() {
  5668. entering_code && !checking_code && (stchco(),
  5669. ending_enter_code = !0)
  5670. }
  5671. ;
  5672. etcod.appendChild(etcocdiv);
  5673. var etco_sp_ii = document.createElement("img");
  5674. etco_sp_ii.width = 100;
  5675. etco_sp_ii.height = 100;
  5676. etco_sp_ii.className = "nsi";
  5677. etco_sp_ii.style.position = "absolute";
  5678. etco_sp_ii.draggable = !1;
  5679. etco_sp_ii.style.opacity = 0;
  5680. etcod.appendChild(etco_sp_ii);
  5681. var etcdis = []
  5682. , etc_ww = 705
  5683. , etc_hh = 67
  5684. , etcc = document.createElement("canvas");
  5685. etcc.style.position = "absolute";
  5686. etcc.width = etc_ww;
  5687. etcc.height = etc_hh;
  5688. etcod.appendChild(etcc);
  5689. var etcbx = 0
  5690. , etcdx = etc_ww / 2 - 27
  5691. , etcods = []
  5692. , ever_showed_entercode = !1
  5693. , entering_code = !1
  5694. , checking_code = !1
  5695. , ending_enter_code = !1
  5696. , want_open_cosmetics = !1
  5697. , etca = 0
  5698. , etcba = 0
  5699. , etcbaa = 1
  5700. , etcsv = 0
  5701. , etcsrv = 0
  5702. , etcsa = 0
  5703. , etcshk = !1
  5704. , etcshkv = 0
  5705. , hacos = !1
  5706. , bonkz = !1
  5707. , actco = [];
  5708. function stchco() {
  5709. checking_code = !1;
  5710. for (var b = etcobs.length - 1; 0 <= b; b--)
  5711. etcobs[b].a.className = "btn btnt";
  5712. cancel_code_btn.setEnabled(!0);
  5713. resetGame()
  5714. }
  5715. function recalculateActivatedCosmetics() {
  5716. actco = [];
  5717. for (var b = 0; 32 > b; b++)
  5718. actco.push(0);
  5719. var c = [];
  5720. try {
  5721. var e = localStorage.cocds;
  5722. e && (c = ("" + e).split(","))
  5723. } catch (q) {}
  5724. for (b = 0; b < c.length; b++)
  5725. if (s = c[b],
  5726. 14 == s.length) {
  5727. var h = Number(s.substr(0, 4))
  5728. , w = Number(s.substr(5, 4))
  5729. , f = Number(s.substr(10, 4));
  5730. e = [];
  5731. e.push(7 * h % 32);
  5732. e.push(7 * w % 32);
  5733. e.push(7 * f % 32);
  5734. for (h = e.length - 1; 0 <= h; h--)
  5735. for (w = e[h],
  5736. f = 0; 64 > f; f++) {
  5737. if (0 == actco[w]) {
  5738. actco[w] = 1;
  5739. hacos || (hacos = !0,
  5740. etcoh.style.display = "inline",
  5741. reposGraphicsQuality());
  5742. break
  5743. }
  5744. w++;
  5745. 32 <= w && (w = 0)
  5746. }
  5747. }
  5748. }
  5749. function enterCodeDigit(b) {
  5750. if (entering_code && !checking_code && 14 > etcods.length) {
  5751. var c = {};
  5752. c.v = b;
  5753. etcods.push(c);
  5754. if (4 == etcods.length || 9 == etcods.length)
  5755. c = {
  5756. v: 10
  5757. },
  5758. etcods.push(c);
  5759. if (14 == etcods.length) {
  5760. checking_code = want_play = !0;
  5761. for (b = etcobs.length - 1; 0 <= b; b--)
  5762. etcobs[b].a.className = "btn_disabled btnt";
  5763. cancel_code_btn.setEnabled(!1)
  5764. }
  5765. }
  5766. }
  5767. function deleteLastCodeDigit() {
  5768. entering_code && !checking_code && 0 < etcods.length && (10 == etcods[etcods.length - 1].v && etcods.splice(etcods.length - 1, 1),
  5769. 0 < etcods.length && etcods.splice(etcods.length - 1, 1))
  5770. }
  5771. var choosing_skin = !1
  5772. , building_skin = !1
  5773. , ending_build_skin = !1
  5774. , bdska = 0
  5775. , bskoy = 0
  5776. , skoboym = 0
  5777. , build_segments = []
  5778. , bskbtns = []
  5779. , selecting_cosmetic = !1
  5780. , ending_select_cosmetic = !1
  5781. , secosa = 0
  5782. , secosoy = 0
  5783. , secosoym = 0
  5784. , cosbtns = [];
  5785. psk.onclick = function() {
  5786. if (building_skin || selecting_cosmetic)
  5787. return !1;
  5788. if (playing && null != snake) {
  5789. var b = snake.rcv;
  5790. b--;
  5791. 0 > b && (b = max_skin_cv);
  5792. gw2k16 || 42 == b && b--;
  5793. setSkin(snake, b, null);
  5794. try {
  5795. localStorage.want_custom_skin = "0"
  5796. } catch (c) {}
  5797. }
  5798. return !1
  5799. }
  5800. ;
  5801. nsk.onclick = function() {
  5802. if (building_skin || selecting_cosmetic)
  5803. return !1;
  5804. if (playing && null != snake) {
  5805. var b = snake.rcv;
  5806. b++;
  5807. gw2k16 || 42 == b && b++;
  5808. b > max_skin_cv && (b = 0);
  5809. setSkin(snake, b, null);
  5810. try {
  5811. localStorage.want_custom_skin = "0"
  5812. } catch (c) {}
  5813. }
  5814. return !1
  5815. }
  5816. ;
  5817. function reposSkinStuff() {
  5818. skodiv.style.left = Math.round(ww / 2 - skodiv.offsetWidth / 2) + "px";
  5819. skodiv.style.top = building_skin ? Math.round(hh / 2 + 120 + 94 * skoboym) + "px" : selecting_cosmetic ? Math.round(hh / 2 + 120 + 94 * secosoym) + "px" : Math.round(hh / 2 + 120) + "px";
  5820. revdiv.style.left = Math.round(ww / 2 - revdiv.offsetWidth / 2 - skodiv.offsetWidth - 62) + "px";
  5821. revdiv.style.top = Math.round(hh / 2 + 120 + 94 * skoboym) + "px"
  5822. }
  5823. csk.onclick = function() {
  5824. if (!playing && -1 == dead_mtm) {
  5825. resetGame();
  5826. choosing_skin = !0;
  5827. pskh.style.opacity = 0;
  5828. nskh.style.opacity = 0;
  5829. bskh.style.opacity = 0;
  5830. scosh.style.opacity = 0;
  5831. skodiv.style.opacity = 0;
  5832. revdiv.style.opacity = 0;
  5833. pskh.style.display = "inline";
  5834. nskh.style.display = "inline";
  5835. bskh.style.display = "inline";
  5836. hacos && (scosh.style.display = "inline");
  5837. skodiv.style.display = "inline";
  5838. revdiv.style.display = "none";
  5839. reposSkinStuff();
  5840. nick.disabled = !0;
  5841. 0 == mscps && setMscps(300);
  5842. for (var b = [], c = 27; 1 <= c; c--)
  5843. b.push({
  5844. xx: grd / 2 - 10 * c,
  5845. yy: grd / 2,
  5846. fx: 0,
  5847. fy: 0,
  5848. exs: [],
  5849. eys: [],
  5850. efs: [],
  5851. ems: [],
  5852. eiu: 0,
  5853. da: 0,
  5854. ebx: 10,
  5855. eby: 0
  5856. });
  5857. var e = 0;
  5858. try {
  5859. var h = localStorage.snakercv;
  5860. h == "" + Number(h) && (e = Number(h))
  5861. } catch (q) {}
  5862. h = null;
  5863. c = !1;
  5864. var w = "";
  5865. try {
  5866. c = "1" == localStorage.want_custom_skin,
  5867. w = localStorage.custom_skin
  5868. } catch (q) {}
  5869. if (c && w && 0 < w.length)
  5870. for (w = ("" + w).split(","),
  5871. h = new Uint8Array(w.length),
  5872. c = 0; c < w.length; c++)
  5873. h[c] = Number(w[c]);
  5874. b = newSnake(1, grd / 2, grd / 2, e, 0, b, h);
  5875. view_xx = grd / 2 - 105;
  5876. view_yy = grd / 2;
  5877. snake = b;
  5878. try {
  5879. var f = localStorage.cosmetic;
  5880. f == "" + Number(f) && (snake.accessory = Number(f))
  5881. } catch (q) {}
  5882. b.nk = "";
  5883. b.eang = b.wang = b.ang;
  5884. b.sp = 4.8;
  5885. b.spang = b.sp / spangdv;
  5886. 1 < b.spang && (b.spang = 1);
  5887. b.sc = 1;
  5888. b.scang = 1;
  5889. b.ssp = nsp1 + nsp2 * b.sc;
  5890. b.fsp = b.ssp + .1;
  5891. b.wsep = 6 * b.sc;
  5892. f = nsep / gsc;
  5893. b.wsep < f && (b.wsep = f);
  5894. b.sep = b.wsep;
  5895. snl(b);
  5896. b.alive_amt = 1;
  5897. b.rex = 1.66;
  5898. ws = {
  5899. send: function(b) {},
  5900. close: function() {}
  5901. };
  5902. high_quality = playing = connected = !0;
  5903. gla = 1;
  5904. wdfg = 0;
  5905. qsm = 1;
  5906. startShowGame();
  5907. lbh.style.display = "none";
  5908. lbs.style.display = "none";
  5909. lbn.style.display = "none";
  5910. lbp.style.display = "none";
  5911. lbf.style.display = "none";
  5912. vcm.style.display = "none";
  5913. loch.style.display = "none"
  5914. }
  5915. return !1
  5916. }
  5917. ;
  5918. etco.onclick = function() {
  5919. etco_sp_ii || (etco_sp_ii = document.createElement("img"),
  5920. etco_sp_ii.width = 100,
  5921. etco_sp_ii.height = 100);
  5922. if (!playing && -1 == dead_mtm) {
  5923. resetGame();
  5924. entering_code = !0;
  5925. ending_enter_code = !1;
  5926. if (!ever_showed_entercode) {
  5927. ever_showed_entercode = !0;
  5928. for (var b = etcobs.length - 1; 0 <= b; b--)
  5929. etcobs[b].ii.src = 10 == b ? "/s/codedel.png" : "/s/code" + b + ".png";
  5930. etco_sp_ii.src = "/s/spinner.png";
  5931. for (b = 0; 11 >= b; b++) {
  5932. var c = document.createElement("img");
  5933. c.width = 54;
  5934. c.height = 67;
  5935. var e = b;
  5936. 10 == b ? e = "h" : 11 == b && (e = "b");
  5937. c.onload = function() {
  5938. for (var b = etcdis.length - 1; 0 <= b; b--) {
  5939. var c = etcdis[b];
  5940. c.ii == this && (c.loaded = !0)
  5941. }
  5942. }
  5943. ;
  5944. var h = {};
  5945. h.ii = c;
  5946. h.loaded = !1;
  5947. etcdis.push(h);
  5948. c.src = "/s/cd" + e + ".png"
  5949. }
  5950. }
  5951. etcod.style.display = "inline";
  5952. reposEnterCode();
  5953. nick.disabled = !0
  5954. }
  5955. return !1
  5956. }
  5957. ;
  5958. bsk.onclick = function() {
  5959. if (playing && choosing_skin && !building_skin && !selecting_cosmetic) {
  5960. var b, c, e, h = e = 0;
  5961. build_segments = [];
  5962. alcsc = falcsc;
  5963. var w = "";
  5964. try {
  5965. localStorage.want_custom_skin = "1",
  5966. w = localStorage.custom_skin
  5967. } catch (A) {}
  5968. if (w && 0 < w.length) {
  5969. w = ("" + w).split(",");
  5970. var f = 0;
  5971. h = -1;
  5972. var q = !0;
  5973. for (b = 8; b < w.length; b++) {
  5974. if (q)
  5975. f = Number(w[b]);
  5976. else
  5977. for (h = Number(w[b]),
  5978. c = 0; c < f; c++)
  5979. build_segments.push(h);
  5980. q = !q
  5981. }
  5982. }
  5983. setSkin(snake, 0, getBuildSkinData(!0));
  5984. building_skin = !0;
  5985. ending_build_skin = !1;
  5986. f = [];
  5987. q = [];
  5988. for (b = 0; 4 > b; b++) {
  5989. w = 0;
  5990. h = Math.floor(csks.length * (b + 1) / 4);
  5991. for (c = e; c < h; c++)
  5992. w++;
  5993. q.push(w);
  5994. e = h
  5995. }
  5996. q[0]--;
  5997. q[1]--;
  5998. q[2]++;
  5999. q[3]++;
  6000. h = [];
  6001. for (b = e = 0; 4 > b; b++)
  6002. for (h = [],
  6003. f.push(h),
  6004. c = 0; c < q[b]; c++)
  6005. h.push(csks[e]),
  6006. e++;
  6007. for (w = 0; w < f.length; w++)
  6008. for (h = f[w],
  6009. b = 0; b < h.length; b++)
  6010. if (c = h[b],
  6011. 0 <= c && c < rrs.length) {
  6012. e = {};
  6013. var x = per_color_imgs[c].kmcs[0];
  6014. q = document.createElement("canvas");
  6015. e.ii = q;
  6016. q.width = x.width;
  6017. q.height = x.height;
  6018. var G = q.getContext("2d");
  6019. G.rotate(Math.PI);
  6020. G.drawImage(x, -x.width, -x.height);
  6021. q.style.opacity = 0;
  6022. q.style.position = "absolute";
  6023. q.style.left = "0px";
  6024. q.style.top = "0px";
  6025. q.draggable = !1;
  6026. e.xx = Math.floor(55 * h.length * (b - (h.length - 1) / 2) / h.length);
  6027. e.yy = Math.floor(-32 - 62 * w);
  6028. x = document.createElement("a");
  6029. x.draggable = !1;
  6030. x.href = "#";
  6031. x.className = "btn btnt";
  6032. x.style.zIndex = 53;
  6033. x.style.position = "fixed";
  6034. x.appendChild(q);
  6035. e.a = x;
  6036. document.body.appendChild(x);
  6037. e.cv = c;
  6038. x.onclick = function() {
  6039. if (!choosing_skin || !building_skin || 47 <= build_segments.length)
  6040. return !1;
  6041. for (var b = bskbtns.length - 1; 0 <= b; b--)
  6042. if (bskbtns[b].a == this) {
  6043. build_segments.push(bskbtns[b].cv);
  6044. break
  6045. }
  6046. setSkin(snake, 0, getBuildSkinData(!0));
  6047. return !1
  6048. }
  6049. ;
  6050. bskbtns.push(e)
  6051. }
  6052. reposBskbtns();
  6053. revdiv.style.opacity = 0;
  6054. revdiv.style.display = "inline"
  6055. }
  6056. return !1
  6057. }
  6058. ;
  6059. scos.onclick = function() {
  6060. if (playing && choosing_skin && !building_skin && !selecting_cosmetic) {
  6061. selecting_cosmetic = !0;
  6062. ending_select_cosmetic = !1;
  6063. for (var b, c = 0, e = 1, h = 0; 32 > h; h++)
  6064. actco.length > h && 1 == actco[h] && e++;
  6065. 8 < e && (e = 8);
  6066. for (h = 0; 32 >= h; h++)
  6067. if (32 == h || actco.length > h && 1 == actco[h]) {
  6068. b = {};
  6069. b.v = 32 == h ? -1 : h;
  6070. var w = document.createElement("img");
  6071. w.onload = function() {
  6072. for (var b, c = cosbtns.length - 1; 0 <= c; c--)
  6073. if (b = cosbtns[c],
  6074. b.ii == this) {
  6075. -1 == b.v ? (b.ww = .5 * this.width,
  6076. b.hh = .5 * this.height) : (b.ww = .35 * this.width,
  6077. b.hh = .35 * this.height);
  6078. this.width = b.ww;
  6079. this.height = b.hh;
  6080. b.xx -= b.ww / 2;
  6081. b.yy -= b.hh / 2;
  6082. reposCosbtns();
  6083. break
  6084. }
  6085. }
  6086. ;
  6087. w.src = 32 == h ? "/s/a_none.png" : a_imgs[h].u;
  6088. w.style.opacity = 0;
  6089. w.style.position = "absolute";
  6090. w.style.left = "0px";
  6091. w.style.top = "0px";
  6092. w.draggable = !1;
  6093. b.ii = w;
  6094. trf(w, "rotate(90deg)");
  6095. b.xx = 102 * (c % 8 - (e / 2 - .5));
  6096. b.yy = -22 - 80 * Math.floor(c / 8);
  6097. c++;
  6098. var f = document.createElement("a");
  6099. f.draggable = !1;
  6100. f.href = "#";
  6101. f.className = "btn btnt";
  6102. f.style.zIndex = 53;
  6103. f.style.position = "fixed";
  6104. f.appendChild(w);
  6105. b.a = f;
  6106. document.body.appendChild(f);
  6107. f.onclick = function() {
  6108. if (!choosing_skin || !selecting_cosmetic)
  6109. return !1;
  6110. for (var b = cosbtns.length - 1; 0 <= b; b--)
  6111. if (cosbtns[b].a == this) {
  6112. snake.accessory = cosbtns[b].v;
  6113. break
  6114. }
  6115. return !1
  6116. }
  6117. ;
  6118. cosbtns.push(b)
  6119. }
  6120. reposCosbtns()
  6121. }
  6122. return !1
  6123. }
  6124. ;
  6125. nick.oninput = function() {
  6126. var b = this.value
  6127. , c = asciize(b);
  6128. 24 < c.length && (c = c.substr(0, 24));
  6129. b != c && (this.value = c);
  6130. "bonkers" == b.toLowerCase() && (bonkz = !0,
  6131. etcoh.style.display = "inline",
  6132. reposGraphicsQuality())
  6133. }
  6134. ;
  6135. victory.oninput = function() {
  6136. var b = this.value
  6137. , c = asciize(b);
  6138. 140 < c.length && (c = c.substr(0, 140));
  6139. b != c && (this.value = c)
  6140. }
  6141. ;
  6142. nick.focus();
  6143. s = "";
  6144. for (i = 0; i < zzs.length; i++)
  6145. s += String.fromCharCode(zzs[i] + 32);
  6146. piar(s);
  6147. var lmch = document.createElement("div");
  6148. lmch.style.width = "450px";
  6149. lmch.style.height = "115px";
  6150. var lmc2 = document.createElement("canvas")
  6151. , lmc = document.createElement("canvas")
  6152. , lgsc = 1
  6153. , lw = 900
  6154. , lh = 270;
  6155. lmc.width = lmc2.width = lw;
  6156. lmc.height = lmc2.height = lh;
  6157. var lctx = lmc.getContext("2d")
  6158. , lctx2 = lmc2.getContext("2d");
  6159. trf(lmc2, "scale(.5, .5)");
  6160. trfo(lmc2, "0% 0%");
  6161. lmch.appendChild(lmc2);
  6162. logo.appendChild(lmch);
  6163. var lts = [];
  6164. lts.push({
  6165. pts: [107, 107, 80, 83, 53, 98, 31, 115, 55, 131, 98, 147, 101, 162, 101, 190, 66, 188, 49, 187, 34, 173],
  6166. kc: 22,
  6167. ws: 4,
  6168. wr: .025,
  6169. qm: .025,
  6170. sp: .06,
  6171. sz: 11
  6172. }, {
  6173. pts: [150, 30, 150, 107, 150, 184],
  6174. kc: 66,
  6175. ws: 4,
  6176. wr: .05,
  6177. qm: .025,
  6178. sp: .06,
  6179. sz: 11
  6180. }, {
  6181. pts: [207, 96, 207, 140, 207, 184],
  6182. kc: 46,
  6183. ws: 4,
  6184. wr: .03,
  6185. qm: .035,
  6186. sp: .06,
  6187. sz: 11
  6188. }, {
  6189. pts: [207, 47, 207, 48.5, 207, 50],
  6190. kc: 11,
  6191. ws: 2,
  6192. wr: .06,
  6193. qm: .05,
  6194. sp: .06,
  6195. sz: 15,
  6196. r: .5
  6197. }, {
  6198. pts: [267, 65, 267, 114.5, 267, 164, 267, 194, 297, 186],
  6199. kc: 66,
  6200. ws: 6,
  6201. wr: -.025,
  6202. qm: -.0125,
  6203. sp: .06,
  6204. sz: 11,
  6205. r: 1.5
  6206. }, {
  6207. pts: [243, 94, 268, 94, 293, 94],
  6208. kc: 66,
  6209. ws: 4,
  6210. wr: .015,
  6211. qm: .025,
  6212. sp: .06,
  6213. sz: 9,
  6214. r: 1.2
  6215. }, {
  6216. pts: [338, 30, 338, 68.5, 338, 107, 338, 145.5, 338, 184, 338, 164, 338, 144, 338, 104, 378, 104, 418, 104, 418, 144, 418, 164, 418, 184],
  6217. kc: 46,
  6218. ws: 4,
  6219. wr: .005,
  6220. qm: .02,
  6221. sp: .06,
  6222. sz: 11,
  6223. r: 2.1
  6224. }, {
  6225. pts: [535, 175, 500, 201, 472, 175, 442, 138, 472, 105, 502, 84, 532, 105, 546, 118, 544, 139, 504, 139, 464, 139],
  6226. kc: 35,
  6227. ws: 6,
  6228. wr: -.013,
  6229. qm: -.025,
  6230. sp: .06,
  6231. sz: 11,
  6232. r: 1.3
  6233. }, {
  6234. pts: [591, 96, 591, 140, 591, 184, 591, 155, 591, 126, 613, 82, 652, 109],
  6235. kc: 38,
  6236. ws: 4,
  6237. wr: .01,
  6238. qm: -.035,
  6239. sp: .06,
  6240. sz: 11
  6241. }, {
  6242. pts: [663, 177, 663, 178.5, 663, 180],
  6243. kc: 11,
  6244. ws: 2,
  6245. wr: .06,
  6246. qm: .05,
  6247. sp: .06,
  6248. sz: 15
  6249. }, {
  6250. pts: [717, 96, 717, 140, 717, 184],
  6251. kc: 33,
  6252. ws: 4,
  6253. wr: .06,
  6254. qm: .05,
  6255. sp: .06,
  6256. sz: 11
  6257. }, {
  6258. pts: [717, 47, 717, 48.5, 717, 50],
  6259. kc: 11,
  6260. ws: 2,
  6261. wr: .06,
  6262. qm: .05,
  6263. sp: .06,
  6264. sz: 15
  6265. }, {
  6266. pts: [814, 186, 860, 188, 858, 136, 854, 96, 814, 96, 770, 96, 770, 136, 770, 186, 814, 186],
  6267. kc: 43,
  6268. ws: 4,
  6269. wr: 0,
  6270. qm: .0274,
  6271. sp: .073,
  6272. sz: 11,
  6273. r: 1.5
  6274. });
  6275. for (i = 0; i < lts.length; i++)
  6276. lts[i].mwig = 5;
  6277. var lga = 0
  6278. , lgss = 0
  6279. , ncka = 0
  6280. , mwig = 4
  6281. , lgfr = 0
  6282. , lgtm = Date.now();
  6283. function showLogo(b) {
  6284. var c = Date.now()
  6285. , e = (c - lgtm) / 25;
  6286. lgtm = c;
  6287. var h;
  6288. lgfr += e;
  6289. if (0 == lts[lts.length - 1].mwig && 1 == lga && 1 == lgss && 1 == ncka)
  6290. clearInterval(showlogo_iv),
  6291. showlogo_iv = -1;
  6292. else {
  6293. if (b || 1 != lga)
  6294. lga += .05 * e,
  6295. 1 <= lga && (lga = 1),
  6296. lmc2.style.opacity = lga;
  6297. 1 != lgss && (lgss += .00375 * e,
  6298. 1 <= lgss && (lgss = 1));
  6299. if (b || 1 != ncka)
  6300. ncka += .006 * e,
  6301. 1 <= ncka && (ncka = 1),
  6302. nick_holder.style.opacity = Math.min(1, 6 * ncka),
  6303. is_mobile || (smh.style.opacity = Math.max(0, Math.min(1, 5 * (ncka - .05)))),
  6304. .01 <= ncka && (playh.style.opacity = Math.min(1, 5 * (ncka - .01)));
  6305. lctx.clearRect(0, 0, lw, lh);
  6306. for (c = 0; c < lts.length; c++) {
  6307. var w = lts[c]
  6308. , f = w.pts
  6309. , q = w.kc
  6310. , x = w.ws
  6311. , G = w.wr
  6312. , A = w.qm;
  6313. var H = w.sp;
  6314. var K = w.sz;
  6315. var F = w.r;
  6316. var L = w.mwig;
  6317. b && (w.wch = !0,
  6318. L = 1E-7);
  6319. w.wch && 0 != L && (L *= .982,
  6320. L -= .001 * e,
  6321. 1 == render_mode && (L -= .005 * e),
  6322. 0 >= L && (L = 0),
  6323. w.mwig = L);
  6324. F || (F = 1);
  6325. lctx.beginPath();
  6326. if (9 > c) {
  6327. var y = ctx.createLinearGradient(0, 70 * lgsc, 0, 230 * lgsc);
  6328. y.addColorStop(0, "#80FFA0");
  6329. y.addColorStop(1, "#008040")
  6330. } else
  6331. y = ctx.createLinearGradient(0, 50 * lgsc, 0, 265 * lgsc),
  6332. y.addColorStop(0, "#9850FF"),
  6333. y.addColorStop(1, "#281060");
  6334. lctx.fillStyle = y;
  6335. var C = !1;
  6336. var B = 0;
  6337. y = f[0];
  6338. var J = f[1];
  6339. var z = y;
  6340. var D = J;
  6341. var E = lgfr * H;
  6342. for (h = 2; h < f.length; h += 4) {
  6343. H = y;
  6344. var O = J;
  6345. cx2 = f[h];
  6346. cy2 = f[h + 1];
  6347. y = f[h + 2];
  6348. J = f[h + 3];
  6349. for (var N = 1; N <= q; N++) {
  6350. B++;
  6351. var I = N / q;
  6352. var Q = H + (cx2 - H) * I;
  6353. var P = O + (cy2 - O) * I;
  6354. var S = cx2 + (y - cx2) * I;
  6355. var T = cy2 + (J - cy2) * I;
  6356. Q += (S - Q) * I;
  6357. P += (T - P) * I;
  6358. z = Math.atan2(P - D, Q - z);
  6359. if (C)
  6360. z - R > Math.PI ? z -= 2 * Math.PI : z - R < -Math.PI && (z += 2 * Math.PI),
  6361. R += .05 * (z - R),
  6362. R %= 2 * Math.PI;
  6363. else {
  6364. C = !0;
  6365. var R = z
  6366. }
  6367. z = Q;
  6368. D = P;
  6369. Q += Math.cos(Math.PI / 2 + R) * Math.sin(E) * x * L;
  6370. P += Math.sin(Math.PI / 2 + R) * Math.sin(E) * x * L;
  6371. E -= .76 * A * x;
  6372. x += G;
  6373. lctx.beginPath();
  6374. T = 1.15 * K * Math.min(1, lgsc * (.2 + .8 * lga) * (30 * lgss * F - B / 20 - c / 2));
  6375. .5 < T && (lctx.arc(Q * lgsc, P * lgsc, T, 0, pi2),
  6376. w.wch = !0);
  6377. lctx.fill()
  6378. }
  6379. }
  6380. }
  6381. lctx2.clearRect(0, 0, lw, lh);
  6382. lctx2.shadowColor = "#000000";
  6383. lctx2.shadowBlur = 16;
  6384. lctx2.shadowOffsetY = 7;
  6385. lctx2.drawImage(lmc, 0, 0)
  6386. }
  6387. }
  6388. var showlogo_iv = -1;
  6389. is_safari || is_mobile ? (ncka = lgss = lga = 1,
  6390. showLogo(!0)) : showlogo_iv = setInterval(function() {
  6391. showLogo(!1)
  6392. }, 25);
  6393. document.onkeydown = function(b) {
  6394. b = b || window.event;
  6395. var c = b.keyCode;
  6396. if (37 == c)
  6397. kd_l = !0;
  6398. else if (39 == c)
  6399. kd_r = !0;
  6400. else if (38 == c || 32 == c)
  6401. kd_u = !0,
  6402. setAcceleration(1);
  6403. else if (48 <= c && 57 >= c)
  6404. entering_code && enterCodeDigit(c - 48);
  6405. else if (8 == c)
  6406. entering_code && deleteLastCodeDigit();
  6407. else if (13 == c || 10 == c)
  6408. if (want_victory_message) {
  6409. if (0 < victory.value.length)
  6410. save_btn.elem.onclick()
  6411. } else {
  6412. if (!connecting && !connected)
  6413. play_btn.elem.onclick()
  6414. }
  6415. else
  6416. 16 == c && testing && (shifty = !0,
  6417. snake && (snake.accessory++,
  6418. snake.accessory >= a_ct && (snake.accessory = 0)));
  6419. testing && console.log("keydown: " + b.keyCode)
  6420. }
  6421. ;
  6422. document.onkeyup = function(b) {
  6423. b = b || window.event;
  6424. b = b.keyCode;
  6425. 37 == b ? kd_l = !1 : 39 == b ? kd_r = !1 : 38 == b || 32 == b ? (kd_u = !1,
  6426. setAcceleration(0)) : 16 == b && testing && (shifty = !1)
  6427. }
  6428. ;
  6429. function loadSos(b) {
  6430. if (!forcing && 0 < b.length) {
  6431. sos = [];
  6432. clus = [];
  6433. b.charAt(0);
  6434. var c = 1
  6435. , e = {}
  6436. , h = 0;
  6437. e = h = 0;
  6438. for (var w, f = 0, q = 0, x = [], G = [], A = [], H = []; c < b.length; )
  6439. if (w = (b.charCodeAt(c++) - 97 - q) % 26,
  6440. 0 > w && (w += 26),
  6441. f *= 16,
  6442. f += w,
  6443. q += 7,
  6444. 1 == e) {
  6445. if (0 == h)
  6446. x.push(f),
  6447. 4 == x.length && h++;
  6448. else if (1 == h)
  6449. G.push(f),
  6450. 3 == G.length && h++;
  6451. else if (2 == h)
  6452. A.push(f),
  6453. 3 == A.length && h++;
  6454. else if (3 == h && (H.push(f),
  6455. 1 == H.length)) {
  6456. e = {};
  6457. for (h = w = 0; h < G.length; h++)
  6458. w *= 256,
  6459. w += G[h];
  6460. for (h = G = 0; h < A.length; h++)
  6461. G *= 256,
  6462. G += A[h];
  6463. e.ip = x.join(".");
  6464. e.po = w;
  6465. e.ac = G;
  6466. e.wg = G + 5;
  6467. e.clu = H[0];
  6468. clus[e.clu] ? x = clus[e.clu] : (x = {},
  6469. clus[e.clu] = x,
  6470. x.sis = [],
  6471. x.ptms = [],
  6472. x.swg = 0,
  6473. x.tac = 0,
  6474. x.sos = []);
  6475. e.cluo = x;
  6476. x.swg += e.wg;
  6477. x.sos.push(e);
  6478. x.tac += G;
  6479. sos.push(e);
  6480. x = [];
  6481. G = [];
  6482. A = [];
  6483. H = [];
  6484. h = 0
  6485. }
  6486. e = f = 0
  6487. } else
  6488. e++;
  6489. for (c = sos.length - 1; 0 <= c; c--)
  6490. if (e = 1,
  6491. x = sos[c].cluo) {
  6492. for (h = x.sis.length - 1; 0 <= h; h--)
  6493. if (x.sis[h].ip == sos[c].ip) {
  6494. e = 0;
  6495. break
  6496. }
  6497. 1 == e && x.sis.push({
  6498. ip: sos[c].ip
  6499. })
  6500. }
  6501. for (c = clus.length - 1; 0 <= c; c--)
  6502. if ((x = clus[c]) && 0 < x.sis.length) {
  6503. h = Math.floor(Math.random() * x.sis.length);
  6504. b = x.sis[h].ip;
  6505. q = null;
  6506. try {
  6507. q = new WebSocket("ws://" + b + ":80/ptc")
  6508. } catch (K) {
  6509. q = null
  6510. }
  6511. q && (q.binaryType = "arraybuffer",
  6512. q.onerror = function(b) {}
  6513. ,
  6514. q.onmessage = function(b) {
  6515. b = new Uint8Array(b.data);
  6516. if (1 == b.length && 112 == b[0])
  6517. for (b = clus.length - 1; 0 <= b; b--) {
  6518. var c = clus[b];
  6519. if (c && c.ps == this) {
  6520. var e = Date.now() - c.stm;
  6521. testing && console.log(" ping time for cluster " + b + ": " + e);
  6522. c.ptms.push(e);
  6523. 4 > c.ptms.length ? (c.stm = Date.now(),
  6524. b = new Uint8Array(1),
  6525. b[0] = 112,
  6526. this.send(b)) : (waiting_for_sos && -1 == sos_ready_after_mtm && (sos_ready_after_mtm = Date.now() + 2E3),
  6527. this.close(),
  6528. c.ps = null);
  6529. break
  6530. }
  6531. }
  6532. }
  6533. ,
  6534. q.onopen = function(b) {
  6535. b = !1;
  6536. for (var c = clus.length - 1; 0 <= c; c--) {
  6537. var e = clus[c];
  6538. if (e && e.ps == this) {
  6539. e.stm = Date.now();
  6540. b = new Uint8Array(1);
  6541. b[0] = 112;
  6542. this.send(b);
  6543. b = !0;
  6544. break
  6545. }
  6546. }
  6547. b || this.close()
  6548. }
  6549. ,
  6550. x.ps = q)
  6551. }
  6552. }
  6553. }
  6554. function adjustCodeSpinner() {
  6555. var b = hh / 1500;
  6556. 1 < b && (b = 1);
  6557. trf(etco_sp_ii, "scale(" + b + "," + b + ") rotate(" + Math.round(36E3 * etcsrv / 12) / 100 + "deg)")
  6558. }
  6559. function reposGraphicsQuality() {
  6560. grqh.style.top = hacos || bonkz ? "160px" : "16px"
  6561. }
  6562. function reposEnterCode() {
  6563. var b = hh / 1500;
  6564. 1 < b && (b = 1);
  6565. etcod.style.width = Math.ceil(ww) + "px";
  6566. etcod.style.height = Math.ceil(hh) + "px";
  6567. var c = Math.round(Math.max(42, .2 * (hh - 222)))
  6568. , e = Math.round(Math.max(60, .5 * c + .5 * (hh / 2 + 100 * b - 67.5 + -155 * b) - 33))
  6569. , h = Math.round(.45 * e + .55 * (hh / 2 + 100 * b - 67.5 + -155 * b) - 33);
  6570. etcot.style.left = Math.round(ww / 2 - 400) + "px";
  6571. etcot.style.top = c + "px";
  6572. etcc.style.left = Math.round(ww / 2 - etc_ww / 2) + "px";
  6573. etcc.style.top = e + "px";
  6574. etco_sp_ii.style.left = Math.round(ww / 2 - 50) + "px";
  6575. etco_sp_ii.style.top = h + "px";
  6576. adjustCodeSpinner();
  6577. for (c = etcobs.length - 1; 0 <= c; c--) {
  6578. e = etcobs[c];
  6579. var w = h = 0
  6580. , f = b;
  6581. 0 == c ? (h = 0,
  6582. w = 2) : 1 == c ? w = h = -1 : 2 == c ? (h = 0,
  6583. w = -1) : 3 == c ? (h = 1,
  6584. w = -1) : 4 == c ? (h = -1,
  6585. w = 0) : 5 == c ? w = h = 0 : 6 == c ? (h = 1,
  6586. w = 0) : 7 == c ? (h = -1,
  6587. w = 1) : 8 == c ? (h = 0,
  6588. w = 1) : 9 == c ? w = h = 1 : 10 == c && (h = 1,
  6589. w = 2,
  6590. f *= .75);
  6591. e.ii.style.left = Math.round(ww / 2 - 67.5 + h * b * 155) + "px";
  6592. e.ii.style.top = Math.round(hh / 2 + 100 * b - 67.5 + w * b * 155) + "px";
  6593. trf(e.ii, "scale(" + f + "," + f + ")")
  6594. }
  6595. b = hh / 750;
  6596. 1 < b && (b = 1);
  6597. trf(etcc, "scale(" + b + "," + b + ")");
  6598. etcocdiv.style.left = Math.round(ww / 2 - etcocdiv.offsetWidth / 2) + "px";
  6599. etcocdiv.style.bottom = Math.round(64 * b) + "px"
  6600. }
  6601. var buildia_shown = !1
  6602. , build_v = document.createElement("video")
  6603. , bv_width = 1095
  6604. , bv_height = 616
  6605. , buildia_close_after_tm = -1;
  6606. function reposBuildia() {
  6607. if (build_v) {
  6608. var b = Math.min(ww / bv_width, hh / bv_height)
  6609. , c = Math.ceil(bv_width * b);
  6610. b = Math.ceil(bv_height * b);
  6611. build_v.style.width = c + "px";
  6612. build_v.style.height = b + "px";
  6613. build_v.style.left = Math.floor(ww / 2 - c / 2) + "px";
  6614. build_v.style.top = Math.floor(hh / 2 - b / 2) + "px"
  6615. }
  6616. }
  6617. function trySkipBuildia() {
  6618. buildia_shown && window.ut_csk && (shoa = buildia_shown = !1,
  6619. ut_d.removeChild(build_v),
  6620. document.body.removeChild(ut_d),
  6621. document.body.removeChild(ut_sk),
  6622. clearInterval(ut_cd_iv),
  6623. build_v = null)
  6624. }
  6625. window.buildia = function() {
  6626. buildia_shown = !0;
  6627. window.ut_ldt = Date.now();
  6628. var b = document.createElement("div");
  6629. b.style.zIndex = 2147483632;
  6630. b.style.width = "100%";
  6631. b.style.height = "100%";
  6632. b.style.textAlign = "center";
  6633. b.style.background = "rgba(0, 0, 0, .85)";
  6634. b.style.margin = "0px";
  6635. b.style.overflow = "hidden";
  6636. b.style.position = "fixed";
  6637. b.style.opacity = 1;
  6638. window.ut_d = b;
  6639. document.body.appendChild(b);
  6640. var c = build_v;
  6641. c.width = bv_width;
  6642. c.height = bv_height;
  6643. c.style.position = "absolute";
  6644. b.appendChild(c);
  6645. c.currentTime = 4;
  6646. c.play();
  6647. buildia_close_after_tm = Date.now() + 11E3;
  6648. reposBuildia();
  6649. b = document.createElement("div");
  6650. window.ut_sk = b;
  6651. b.style.width = "115px";
  6652. b.style.height = "20px";
  6653. b.style.background = "rgba(0, 0, 0, 1)";
  6654. b.style.border = "1px solid rgba(255, 255, 255, .5)";
  6655. b.style.fontFamily = "Verdana";
  6656. b.style.color = "#ffffff";
  6657. b.style.position = "fixed";
  6658. b.style.right = "10px";
  6659. b.style.bottom = "10px";
  6660. b.textContent = "Skip Ad " + String.fromCharCode(9654);
  6661. b.style.cursor = "pointer";
  6662. b.style.textAlign = "center";
  6663. b.style.padding = "8px";
  6664. b.style.fontSize = "16px";
  6665. b.style.borderRadius = "4px";
  6666. b.style.opacity = .75;
  6667. b.className = "nsi";
  6668. b.style.zIndex = 2147483633;
  6669. b.onmouseenter = function() {
  6670. ut_sk.style.opacity = 1
  6671. }
  6672. ;
  6673. b.onmouseleave = function() {
  6674. ut_sk.style.opacity = .75
  6675. }
  6676. ;
  6677. b.onclick = function() {
  6678. trySkipBuildia()
  6679. }
  6680. ;
  6681. document.body.appendChild(b);
  6682. window.ut_skf = function() {
  6683. Date.now();
  6684. var b = -1;
  6685. "1" == window.ut_dpr && (b = 0);
  6686. 0 >= b ? (ut_sk.textContent = "Skip Ad " + String.fromCharCode(9654),
  6687. window.ut_csk = !0) : (b = Math.ceil(5 * Math.pow(b / 5E3, 1)),
  6688. ut_sk.textContent = "Skip in " + b)
  6689. }
  6690. ;
  6691. window.ut_cd_iv = setInterval("ut_skf()", 250);
  6692. ut_skf()
  6693. }
  6694. ;
  6695. var fifth_iv = -1;
  6696. window.fifthia = function() {
  6697. window.ut_ldt = Date.now();
  6698. var b = document.createElement("div");
  6699. b.style.zIndex = 2147483632;
  6700. b.style.width = "100%";
  6701. b.style.height = "100%";
  6702. b.style.textAlign = "center";
  6703. b.style.background = "rgba(0, 0, 0, .85)";
  6704. b.style.margin = "0px";
  6705. b.style.overflow = "hidden";
  6706. b.style.position = "fixed";
  6707. window.ut_d = b;
  6708. document.body.appendChild(b);
  6709. var c = document.createElement("div");
  6710. c.style.background = 'url("/s/fifthsun3.jpg")';
  6711. c.style.width = "1100px";
  6712. c.style.height = "800px";
  6713. c.style.marginTop = "30px";
  6714. c.style.marginLeft = c.style.marginRight = "auto";
  6715. c.style.position = "relative";
  6716. c.style.border = "3px solid #CCDDFF";
  6717. window.ut_v = c;
  6718. b.appendChild(c);
  6719. b = document.createElement("div");
  6720. b.style.boxShadow = "0px 3px 20px rgba(0,0,0, .75)";
  6721. b.style.position = "absolute";
  6722. b.style.left = "320px";
  6723. b.style.top = "126px";
  6724. b.style.width = "150px";
  6725. b.style.padding = "18px";
  6726. b.style.textAlign = "center";
  6727. b.style.color = "#000000";
  6728. b.style.fontWeight = "bold";
  6729. b.style.textAlign = "center";
  6730. b.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  6731. b.style.fontSize = "23px";
  6732. b.style.cursor = "pointer";
  6733. b.textContent = "Shop Now";
  6734. b.className = "nsi shbtn";
  6735. var e = document.createElement("a");
  6736. e.className = "btnt";
  6737. e.draggable = !1;
  6738. e.href = "https://www.fifthsun.com/brands/video-games/slither-io";
  6739. e.target = "_blank";
  6740. e.appendChild(b);
  6741. c.appendChild(e);
  6742. window.ut_sn = b;
  6743. c = document.createElement("div");
  6744. window.ut_sk = c;
  6745. c.style.width = "115px";
  6746. c.style.height = "20px";
  6747. c.style.background = "rgba(0, 0, 0, 1)";
  6748. c.style.border = "1px solid rgba(255, 255, 255, .5)";
  6749. c.style.fontFamily = "Verdana";
  6750. c.style.color = "#ffffff";
  6751. c.style.position = "fixed";
  6752. c.style.right = "10px";
  6753. c.style.bottom = "10px";
  6754. c.textContent = "Skip Ad " + String.fromCharCode(9654);
  6755. c.style.cursor = "pointer";
  6756. c.style.textAlign = "center";
  6757. c.style.padding = "8px";
  6758. c.style.fontSize = "16px";
  6759. c.style.borderRadius = "4px";
  6760. c.style.opacity = .75;
  6761. c.className = "nsi";
  6762. c.style.zIndex = 2147483633;
  6763. c.onclick = function() {
  6764. window.ut_csk && (shoa = !1,
  6765. ut_d.removeChild(ut_v),
  6766. document.body.removeChild(ut_d),
  6767. document.body.removeChild(ut_sk),
  6768. clearInterval(ut_cd_iv))
  6769. }
  6770. ;
  6771. c.onmouseenter = function() {
  6772. ut_sk.style.opacity = 1
  6773. }
  6774. ;
  6775. c.onmouseleave = function() {
  6776. ut_sk.style.opacity = .75
  6777. }
  6778. ;
  6779. document.body.appendChild(c);
  6780. window.ut_skf = function() {
  6781. Date.now();
  6782. var b = -1;
  6783. "1" == window.ut_dpr && (b = 0);
  6784. 0 >= b ? (ut_sk.textContent = "Skip Ad " + String.fromCharCode(160, 9654),
  6785. window.ut_csk = !0) : (b = Math.ceil(5 * Math.pow(b / 5E3, 1)),
  6786. ut_sk.textContent = "Skip in " + b)
  6787. }
  6788. ;
  6789. window.ut_cd_iv = setInterval("ut_skf()", 250);
  6790. ut_skf()
  6791. }
  6792. ;
  6793. var partycity_shown = !1
  6794. , pcy_width = 1132
  6795. , pcy_height = 832
  6796. , partycity_iv = -1;
  6797. window.partycityia = function() {
  6798. window.ut_ldt = Date.now();
  6799. var b = document.createElement("div");
  6800. b.style.zIndex = 2147483632;
  6801. b.style.width = "100%";
  6802. b.style.height = "100%";
  6803. b.style.textAlign = "center";
  6804. b.style.background = "rgba(0, 0, 0, .85)";
  6805. b.style.margin = "0px";
  6806. b.style.overflow = "hidden";
  6807. b.style.position = "fixed";
  6808. window.ut_d = b;
  6809. document.body.appendChild(b);
  6810. var c = document.createElement("div");
  6811. c.style.background = 'url("/s/partycity2.jpg")';
  6812. c.style.width = "1100px";
  6813. c.style.height = "800px";
  6814. c.style.position = "absolute";
  6815. c.style.border = "3px solid #CCDDFF";
  6816. c.style.borderRadius = "42px";
  6817. window.ut_v = c;
  6818. b.appendChild(c);
  6819. b = document.createElement("div");
  6820. b.style.boxShadow = "0px 3px 20px rgba(0,0,0, .75)";
  6821. b.style.position = "absolute";
  6822. b.style.left = "410px";
  6823. b.style.top = "707px";
  6824. b.style.width = "244px";
  6825. b.style.padding = "18px";
  6826. b.style.textAlign = "center";
  6827. b.style.color = "#000000";
  6828. b.style.fontWeight = "bold";
  6829. b.style.textAlign = "center";
  6830. b.style.fontFamily = 'Arial, "Helvetica Neue", Helvetica, sans-serif';
  6831. b.style.fontSize = "36px";
  6832. b.style.cursor = "pointer";
  6833. b.style.borderRadius = "12px";
  6834. b.textContent = "Shop Now";
  6835. b.className = "nsi shbtn";
  6836. var e = document.createElement("a");
  6837. e.className = "btnt";
  6838. e.draggable = !1;
  6839. e.href = testing ? "https://www.zombo.com/" : "https://www.partycity.com/slither-party-supplies?extcmp=dsp|banner|slither.io|slitherpartysupplies";
  6840. e.target = "_blank";
  6841. e.appendChild(b);
  6842. c.appendChild(e);
  6843. window.ut_sn = b;
  6844. c = document.createElement("div");
  6845. window.ut_sk = c;
  6846. c.style.width = "115px";
  6847. c.style.height = "20px";
  6848. c.style.background = "rgba(0, 0, 0, 1)";
  6849. c.style.border = "1px solid rgba(255, 255, 255, .5)";
  6850. c.style.fontFamily = "Verdana";
  6851. c.style.color = "#ffffff";
  6852. c.style.position = "fixed";
  6853. c.style.right = "10px";
  6854. c.style.bottom = "10px";
  6855. c.textContent = "Skip Ad " + String.fromCharCode(9654);
  6856. c.style.cursor = "pointer";
  6857. c.style.textAlign = "center";
  6858. c.style.padding = "8px";
  6859. c.style.fontSize = "16px";
  6860. c.style.borderRadius = "4px";
  6861. c.style.opacity = .75;
  6862. c.className = "nsi";
  6863. c.style.zIndex = 2147483633;
  6864. c.onclick = function() {
  6865. window.ut_csk && (shoa = !1,
  6866. ut_d.removeChild(ut_v),
  6867. document.body.removeChild(ut_d),
  6868. document.body.removeChild(ut_sk),
  6869. clearInterval(ut_cd_iv),
  6870. partycity_shown = !1)
  6871. }
  6872. ;
  6873. c.onmouseenter = function() {
  6874. ut_sk.style.opacity = 1
  6875. }
  6876. ;
  6877. c.onmouseleave = function() {
  6878. ut_sk.style.opacity = .75
  6879. }
  6880. ;
  6881. document.body.appendChild(c);
  6882. window.ut_skf = function() {
  6883. Date.now();
  6884. var b = -1;
  6885. "1" == window.ut_dpr && (b = 0);
  6886. 0 >= b ? (ut_sk.textContent = "Skip Ad " + String.fromCharCode(160, 9654),
  6887. window.ut_csk = !0) : (b = Math.ceil(5 * Math.pow(b / 5E3, 1)),
  6888. ut_sk.textContent = "Skip in " + b)
  6889. }
  6890. ;
  6891. window.ut_cd_iv = setInterval("ut_skf()", 250);
  6892. ut_skf();
  6893. partycity_shown = !0;
  6894. reposPartyCity()
  6895. }
  6896. ;
  6897. function reposPartyCity() {
  6898. if (partycity_shown) {
  6899. var b = Math.min(ww / pcy_width, hh / pcy_height);
  6900. 1 < b && (b = 1);
  6901. var c = Math.ceil(pcy_width * b)
  6902. , e = Math.ceil(pcy_height * b);
  6903. trf(ut_v, "scale(" + b + "," + b + ")");
  6904. trfo(ut_v, "0% 0%");
  6905. ut_v.style.left = Math.floor(ww / 2 - c / 2) + "px";
  6906. ut_v.style.top = Math.floor(hh / 2 - e / 2) + "px"
  6907. }
  6908. }
  6909. var mba = null
  6910. , mbi = null;
  6911. if (is_ios || is_android)
  6912. mba = document.createElement("a"),
  6913. mbi = document.createElement("img"),
  6914. mbi.border = 0,
  6915. mbi.draggable = !1,
  6916. mbi.className = "nsi",
  6917. mbi.width = 1245,
  6918. mbi.height = 260,
  6919. mbi.style.position = "fixed",
  6920. mbi.style.left = "0px",
  6921. mbi.style.bottom = "0px",
  6922. mbi.style.zIndex = 70,
  6923. mbi.src = "/s/n2.jpg",
  6924. mba.appendChild(mbi),
  6925. document.body.appendChild(mba),
  6926. is_ios ? mba.href = "https://itunes.apple.com/us/app/slither.io/id1091944550?ls=1&mt=8" : is_android && (mba.href = is_amazon ? "http://www.amazon.com/Lowtech-Enterprises-slither-io/dp/B01E312TYQ/" : "https://play.google.com/store/apps/details?id=air.com.hypah.io.slither");
  6927. resize();
  6928. recalculateActivatedCosmetics();
  6929. o = {
  6930. f: function(b, c, e) {
  6931. "success" == c && loadSos(b)
  6932. }
  6933. };
  6934. getData("/i33628.txt", o);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址