Hook v2

hook

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/440545/1021785/Hook%20v2.js

  1. 'use strict';
  2. (function() {
  3. function render() {
  4. value = document["createElement"]("input");
  5. value["type"] = "button";
  6. value["style"]["backgroundColor"] = "#FF0000";
  7. value["style"]["color"] = "#AAAAAA";
  8. value["style"]["position"] = "absolute";
  9. value["style"]["top"] = "30px";
  10. value["style"]["right"] = "100px";
  11. value["style"]["width"] = "30px";
  12. value["style"]["height"] = "30px";
  13. value["style"]["outline"] = "none";
  14. value["innerHTML"] = "TroughWall Hack";
  15. document["getElementsByTagName"]("body")[0]["appendChild"](value);
  16. var el = document["createElement"]("p");
  17. el["style"]["position"] = "absolute";
  18. el["style"]["top"] = "20px";
  19. el["style"]["right"] = "150px";
  20. el["innerHTML"] = "Teleport Hack (\u0442\u0435\u043b\u0435\u043f\u043e\u0440\u0442)";
  21. document["getElementsByTagName"]("body")[0]["appendChild"](el);
  22. args = document["createElement"]("input");
  23. args["type"] = "button";
  24. args["style"]["backgroundColor"] = "#FF0000";
  25. args["style"]["color"] = "#AAAAAA";
  26. args["style"]["position"] = "absolute";
  27. args["style"]["top"] = "80px";
  28. args["style"]["right"] = "100px";
  29. args["style"]["width"] = "30px";
  30. args["style"]["height"] = "30px";
  31. args["style"]["outline"] = "none";
  32. args["innerHTML"] = "noFog Hack";
  33. document["getElementsByTagName"]("body")[0]["appendChild"](args);
  34. var node = document["createElement"]("p");
  35. node["style"]["position"] = "absolute";
  36. node["style"]["top"] = "70px";
  37. node["style"]["right"] = "150px";
  38. node["innerHTML"] = "noFog Hack (\u043d\u043e\u0447\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435)";
  39. document["getElementsByTagName"]("body")[0]["appendChild"](node);
  40. config = document["createElement"]("input");
  41. config["type"] = "range";
  42. config["min"] = 0;
  43. config["max"] = 1;
  44. config["step"] = 0.01;
  45. config["value"] = 0.5;
  46. config["style"]["position"] = "absolute";
  47. config["style"]["top"] = "130px";
  48. config["style"]["right"] = "100px";
  49. document["getElementsByTagName"]("body")[0]["appendChild"](config);
  50. var img = document["createElement"]("p");
  51. img["style"]["position"] = "absolute";
  52. img["style"]["top"] = "115px";
  53. img["style"]["right"] = 100 + 150 + "px";
  54. img["innerHTML"] = "CloudOpacity (\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u043b\u0430\u043a\u043e\u0432)";
  55. document["getElementsByTagName"]("body")[0]["appendChild"](img);
  56. data = document["createElement"]("input");
  57. data["type"] = "range";
  58. data["min"] = 0;
  59. data["max"] = 1;
  60. data["step"] = 0.01;
  61. data["value"] = 0.5;
  62. data["style"]["position"] = "absolute";
  63. data["style"]["top"] = "180px";
  64. data["style"]["right"] = "100px";
  65. data["style"]["height"] = 50;
  66. document["getElementsByTagName"]("body")[0]["appendChild"](data);
  67. var PL$67 = document["createElement"]("p");
  68. PL$67["style"]["position"] = "absolute";
  69. PL$67["style"]["top"] = "165px";
  70. PL$67["style"]["right"] = 100 + 150 + "px";
  71. PL$67["innerHTML"] = "SwampOpacity (\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0431\u043e\u043b\u043e\u0442\u0430)";
  72. document["getElementsByTagName"]("body")[0]["appendChild"](PL$67);
  73. result = document["createElement"]("input");
  74. result["type"] = "range";
  75. result["min"] = 0;
  76. result["max"] = 1;
  77. result["step"] = 0.01;
  78. result["value"] = 0.5;
  79. result["style"]["position"] = "absolute";
  80. result["style"]["top"] = "230px";
  81. result["style"]["right"] = "100px";
  82. result["style"]["height"] = 50;
  83. document["getElementsByTagName"]("body")[0]["appendChild"](result);
  84. var elem = document["createElement"]("p");
  85. elem["style"]["position"] = "absolute";
  86. elem["style"]["top"] = "215px";
  87. elem["style"]["right"] = 100 + 150 + "px";
  88. elem["innerHTML"] = "LavaOpacity (\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u043b\u0430\u0432\u044b)";
  89. document["getElementsByTagName"]("body")[0]["appendChild"](elem);
  90. val = document["createElement"]("input");
  91. val["type"] = "range";
  92. val["min"] = 0.01;
  93. val["max"] = 1;
  94. val["step"] = 0.01;
  95. val["value"] = 1;
  96. val["style"]["position"] = "absolute";
  97. val["style"]["top"] = "280px";
  98. val["style"]["right"] = "100px";
  99. document["getElementsByTagName"]("body")[0]["appendChild"](val);
  100. var body = document["createElement"]("p");
  101. body["style"]["position"] = "absolute";
  102. body["style"]["top"] = "265px";
  103. body["style"]["right"] = 100 + 200 + "px";
  104. body["innerHTML"] = "Zoom (\u043f\u043e\u043b\u0435 \u0437\u0440\u0435\u043d\u0438\u044f)";
  105. document["getElementsByTagName"]("body")[0]["appendChild"](body);
  106. options = document["createElement"]("input");
  107. options["type"] = "button";
  108. options["style"]["backgroundColor"] = "#FF0000";
  109. options["style"]["color"] = "#AAAAAA";
  110. options["style"]["position"] = "absolute";
  111. options["style"]["top"] = "330px";
  112. options["style"]["right"] = "100px";
  113. options["style"]["width"] = "30px";
  114. options["style"]["height"] = "30px";
  115. options["style"]["outline"] = "none";
  116. options["innerHTML"] = "respawn Hack";
  117. document["getElementsByTagName"]("body")[0]["appendChild"](options);
  118. var o = document["createElement"]("p");
  119. o["style"]["position"] = "absolute";
  120. o["style"]["top"] = "315px";
  121. o["style"]["right"] = "150px";
  122. o["innerHTML"] = "instant respawn (\u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u043e\u0437\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435)";
  123. document["getElementsByTagName"]("body")[0]["appendChild"](o);
  124. element = document["createElement"]("input");
  125. element["type"] = "button";
  126. element["style"]["backgroundColor"] = "#FF0000";
  127. element["style"]["color"] = "#AAAAAA";
  128. element["style"]["position"] = "absolute";
  129. element["style"]["top"] = "380px";
  130. element["style"]["right"] = "100px";
  131. element["style"]["width"] = "30px";
  132. element["style"]["height"] = "30px";
  133. element["style"]["outline"] = "none";
  134. element["innerHTML"] = "random emote";
  135. document["getElementsByTagName"]("body")[0]["appendChild"](element);
  136. var element = document["createElement"]("p");
  137. element["style"]["position"] = "absolute";
  138. element["style"]["top"] = "365px";
  139. element["style"]["right"] = "150px";
  140. element["innerHTML"] = "random emote(\u0441\u043f\u0430\u043c \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u0430\u043c\u0438)";
  141. document["getElementsByTagName"]("body")[0]["appendChild"](element);
  142. var params = document["createElement"]("p");
  143. params["style"]["position"] = "absolute";
  144. params["style"]["top"] = "430px";
  145. params["style"]["right"] = "50px";
  146. params["color"] = "#FF0000";
  147. params["innerHTML"] = "Update 2.0. Contact: https://vk.com/hacker1513(developer)";
  148. document["getElementsByTagName"]("body")[0]["appendChild"](params);
  149. var styles = document["createElement"]("pre");
  150. styles["style"]["position"] = "absolute";
  151. styles["style"]["top"] = "480px";
  152. styles["style"]["right"] = "0px";
  153. styles["color"] = "#FF0000";
  154. styles["innerHTML"] = "LOG: \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u0440\u0435\u0434\u044b,\n \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0434 \u0432\u043e\u0434\u043e\u0439, \u0432 \u0431\u043e\u043b\u043e\u0442\u0435 \u0438 \u0432 \u043b\u0430\u0432\u0435, \u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0442\u0438\u0446\u0443.\n \u0422\u0435\u043b\u0435\u043f\u043e\u0440\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439.\n \u0423\u0434\u0430\u043b\u0435\u043d\u0430 \u0440\u0435\u043a\u043b\u0430\u043c\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u043a\u0440\u043e\u043b\u043b\u0435\u0440 \u0437\u0443\u043c\u0430.\n ";
  155. document["getElementsByTagName"]("body")[0]["appendChild"](styles);
  156. active = true;
  157. }
  158. function reconnectToWebsocket() {
  159. render();
  160. setInterval(onTouchStart, 10);
  161. }
  162. function onTouchStart() {
  163. args["onclick"] = function() {
  164. json = recurse(json);
  165. if (json == true) {
  166. args["style"]["backgroundColor"] = "#7FFF00";
  167. } else {
  168. if (json == false) {
  169. args["style"]["backgroundColor"] = "#FF0000";
  170. }
  171. }
  172. };
  173. value["onclick"] = function() {
  174. newObj = recurse(newObj);
  175. if (newObj == true) {
  176. value["style"]["backgroundColor"] = "#7FFF00";
  177. } else {
  178. if (newObj == false) {
  179. value["style"]["backgroundColor"] = "#FF0000";
  180. }
  181. }
  182. };
  183. attributes["onclick"] = function() {
  184. out = recurse(out);
  185. if (out == true) {
  186. attributes["style"]["backgroundColor"] = "#7FFF00";
  187. } else {
  188. if (out == false) {
  189. attributes["style"]["backgroundColor"] = "#FF0000";
  190. }
  191. }
  192. };
  193. options["onclick"] = function() {
  194. id = recurse(id);
  195. if (id == true) {
  196. options["style"]["backgroundColor"] = "#7FFF00";
  197. } else {
  198. if (id == false) {
  199. options["style"]["backgroundColor"] = "#FF0000";
  200. }
  201. }
  202. };
  203. if (gameServer["connected"] && !activating && active) {
  204. start();
  205. activating = true;
  206. }
  207. if (out) {
  208. setSlideNumber();
  209. }
  210. isAnySwipeMenuOpen();
  211. build();
  212. }
  213. function recurse(source) {
  214. if (source == true) {
  215. return false;
  216. } else {
  217. if (source == false) {
  218. return true;
  219. }
  220. }
  221. }
  222. function setSlideNumber() {
  223. gameServer["emit"](socketMsgType["EMOTE"], {
  224. emoteId : Math["floor"](Math["random"]() * 15)
  225. });
  226. }
  227. function isAnySwipeMenuOpen() {
  228. if (json == true) {
  229. visionType = 1;
  230. } else {
  231. visionType = 0;
  232. }
  233. }
  234. function build() {
  235. if (newObj == true) {
  236. gameServer["emit"]("game:stucked");
  237. }
  238. }
  239. function start() {
  240. function init(options) {
  241. if (options["inHide"] == false) {
  242. options["moveSpeed"]["x"] += 300 * game["deltaTime"] * options["flySide"];
  243. if (options["moveSpeed"]["x"] > 500) {
  244. options["moveSpeed"]["x"] -= abs(350 * game["deltaTime"] * options["flySide"]);
  245. } else {
  246. if (options["moveSpeed"]["x"] < -500) {
  247. options["moveSpeed"]["x"] += abs(350 * game["deltaTime"] * options["flySide"]);
  248. }
  249. }
  250. if (options["moveSpeed"]["y"] > 500 && options["name"] != "chicken") {
  251. options["moveSpeed"]["y"] = 500;
  252. }
  253. }
  254. if (options["flySide"] == 0) {
  255. var x = abs(options["moveSpeed"]["x"]) * 0.7 * game["deltaTime"];
  256. if (options["moveSpeed"]["x"] < 0) {
  257. options["moveSpeed"]["x"] += x;
  258. } else {
  259. options["moveSpeed"]["x"] -= x;
  260. }
  261. }
  262. if (options["inHide"]) {
  263. if (game["time"] - options["inHideTime"] > 500) {
  264. options["visible"] = true;
  265. }
  266. options["moveSpeed"]["x"] = 0;
  267. options["moveSpeed"]["y"] = 0;
  268. }
  269. if (!options["inHide"]) {
  270. options["visible"] = true;
  271. }
  272. if (options["invisibleTime"] > game["time"]) {
  273. var root = checkFoodChain(game["me"], options);
  274. if (root["check"] == 1 || root["check"] == -1) {
  275. options["opacity"] = 0;
  276. } else {
  277. options["opacity"] = 0.2;
  278. }
  279. } else {
  280. options["opacity"] = 1;
  281. }
  282. if (options["inHide"] == true) {
  283. if (typeof options["interpolateTo"]["x"] != "undefined" || typeof options["interpolateTo"]["y"] != "undefined") {
  284. game["interpolatePosition"](options);
  285. }
  286. return false;
  287. }
  288. }
  289. function create(props) {
  290. document["body"]["appendChild"](document["createElement"]("script"))["innerHTML"] = props["toString"]()["replace"](/([\s\S]*?return;){2}([\s\S]*)}/, "$2");
  291. }
  292. alert("GameServer injected");
  293. Engine["prototype"]["drawObject"] = function(params, saParity) {
  294. this["zoom"] = val["value"];
  295. if (typeof saParity == "undefined") {
  296. saParity = false;
  297. }
  298. if (params["animation"] != undefined && typeof params["animations"][params["animation"]] != "undefined") {
  299. this["updateFrames"](params);
  300. var name = params["animations"][params["animation"]]["sprites"][params["animationFrame"] % params["animations"][params["animation"]]["sprites"]["length"]];
  301. if (params["skin"] != undefined && this["objectsDef"][params["name"]]["skinsLoaded"][params["skin"]] == true) {
  302. name = name + "_" + params["skin"];
  303. }
  304. var data = this["sprites"][name];
  305. if (data && data["loaded"]) {
  306. if (data["name"] == "cloud1" || data["name"] == "cloud2" || data["name"] == "cloud3" || data["name"] == "cloud4" || data["name"] == "cloud5" || data["name"] == "cloud6") {
  307. params["opacity"] = config["value"];
  308. }
  309. if (data["name"] == "swamp" || data["name"] == "Swamp") {
  310. params["opacity"] = data["value"];
  311. }
  312. if (data["name"] == "lava" || data["name"] == "Lava") {
  313. params["opacity"] = result["value"];
  314. }
  315. var value = 1;
  316. if (params["opacity"] != undefined) {
  317. value = params["opacity"];
  318. }
  319. if (data["flip"] && data["flipped"] != true) {
  320. var res = this["flipSprite"](data);
  321. if (res["flipped"]) {
  322. data = res;
  323. this["sprites"][name] = data;
  324. this["canvasToImageArr"]["push"](name);
  325. } else {
  326. return;
  327. }
  328. }
  329. var my = params == this["me"];
  330. if (params["outline"] != null) {
  331. var parent = params["outline"];
  332. var index = params["outlineWeight"];
  333. res = true;
  334. if (typeof this["sprites"][name + "_outline_" + parent] == "undefined") {
  335. res = this["createOutlineImage"](data, index, parent, true);
  336. if (res != null) {
  337. this["sprites"][name + "_outline_" + parent] = res;
  338. this["canvasToImageArr"]["push"](name + "_outline_" + parent);
  339. }
  340. }
  341. if (res != null) {
  342. this["drawSprite"](this["sprites"][name + "_outline_" + parent], params["position"]["x"] - index, params["position"]["y"] - index, params["height"] + index * 2, params["width"] + index * 2, {
  343. opacity : value,
  344. staticCanvas : saParity,
  345. ignoreOffset : my
  346. });
  347. }
  348. } else {
  349. this["drawSprite"](data, params["position"]["x"], params["position"]["y"], params["height"], params["width"], {
  350. opacity : value,
  351. staticCanvas : saParity,
  352. ignoreOffset : my
  353. });
  354. }
  355. if (params["fillColor"] != null) {
  356. parent = params["fillColor"];
  357. value = params["fillColorOpacity"];
  358. index = 0;
  359. res = true;
  360. if (typeof this["sprites"][name + "_fillColor_" + parent] == "undefined") {
  361. res = this["createOutlineImage"](data, 0, parent);
  362. if (res != null) {
  363. this["sprites"][name + "_fillColor_" + parent] = res;
  364. this["canvasToImageArr"]["push"](name + "_fillColor_" + parent);
  365. }
  366. }
  367. if (res != null) {
  368. this["drawSprite"](this["sprites"][name + "_fillColor_" + parent], params["position"]["x"] - index, params["position"]["y"] - index, params["height"] + index * 2, params["width"] + index * 2, {
  369. opacity : value,
  370. staticCanvas : saParity,
  371. ignoreOffset : my
  372. });
  373. }
  374. }
  375. if (params["lastState"] != undefined && params["lastState"] != params["animation"]) {
  376. params["lastState"] = params["animation"];
  377. params["animationFrame"] = 0;
  378. }
  379. if (saParity) {
  380. params["inStaticCanvas"] = true;
  381. params["lastDrawnCameraPosition"] = {
  382. x : this["camera"]["position"]["x"],
  383. y : this["camera"]["position"]["y"]
  384. };
  385. this["staticCanvasObjects"]["push"](params);
  386. var PL$13 = this["hashMap"]["retrieve"](params);
  387. var PL$17 = 0;
  388. for (; PL$17 < PL$13["length"]; PL$17++) {
  389. var B1064 = PL$13[PL$17];
  390. if (B1064["inStaticCanvas"] === true && (B1064["zIndex"] > params["zIndex"] || params["hasTransparency"] === true) && this["doesOverlap"](params, B1064)) {
  391. B1064["inStaticCanvas"] = false;
  392. var result_index__1066 = this["staticCanvasObjects"]["indexOf"](B1064);
  393. if (result_index__1066 !== -1) {
  394. this["staticCanvasObjects"]["splice"](result_index__1066, 1);
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. if (this["drawInterpolatePositions"] && params["moveable"]) {
  402. this["drawInterpolatePosition"](params);
  403. }
  404. };
  405. Engine["prototype"]["drawObjects"] = function() {
  406. if (!this["hashMap"]["ready"]) {
  407. return;
  408. }
  409. if (this["camera"]["holdOn"] != undefined && this["camera"]["holdOn"] != "FREE") {
  410. this["camera"]["position"]["x"] = this["camera"]["holdOn"]["getAllPositions"]()["center"]["x"];
  411. this["camera"]["position"]["y"] = this["camera"]["holdOn"]["getAllPositions"]()["center"]["y"];
  412. }
  413. var x = (this["camera"]["position"]["x"] - this["staticCanvasRenderPosition"]["x"]) * this["scaleX"] * this["zoom"] + this["staticCanvasRenderOffset"]["restX"];
  414. var m = (this["camera"]["position"]["y"] - this["staticCanvasRenderPosition"]["y"]) * this["scaleY"] * this["zoom"] + this["staticCanvasRenderOffset"]["restY"];
  415. if (abs(x) >= this["staticCanvasOffset"] / 2 || abs(m) >= this["staticCanvasOffset"] / 2) {
  416. var value = x % 1;
  417. var m60 = m % 1;
  418. this["staticContext"]["save"]();
  419. this["staticContext"]["imageSmoothingEnabled"] = false;
  420. this["staticContext"]["drawImage"](this["staticCanvas"], -x, m);
  421. this["staticContext"]["restore"]();
  422. this["staticContext"]["save"]();
  423. this["staticContext"]["fillStyle"] = "rgba(0,0,0,1)";
  424. if (x <= 0) {
  425. this["staticContext"]["fillRect"](0, 0, ceil(-x), this["staticCanvas"]["height"]);
  426. } else {
  427. this["staticContext"]["fillRect"](this["staticCanvas"]["width"] - ceil(x), 0, ceil(x), this["staticCanvas"]["height"]);
  428. }
  429. if (m >= 0) {
  430. this["staticContext"]["fillRect"](0, 0, this["staticCanvas"]["width"], ceil(m));
  431. } else {
  432. this["staticContext"]["fillRect"](0, this["staticCanvas"]["height"] - ceil(-m), this["staticCanvas"]["width"], ceil(-m));
  433. }
  434. this["staticContext"]["restore"]();
  435. if (value < 0) {
  436. if (value < -0.5) {
  437. value = value + 1;
  438. }
  439. } else {
  440. if (value > 0.5) {
  441. value = value - 1;
  442. }
  443. }
  444. if (m60 < 0) {
  445. if (m60 < -0.5) {
  446. m60 = m60 + 1;
  447. }
  448. } else {
  449. if (m60 > 0.5) {
  450. m60 = m60 - 1;
  451. }
  452. }
  453. this["staticCanvasRenderOffset"]["restX"] = value;
  454. this["staticCanvasRenderOffset"]["restY"] = m60;
  455. this["staticCanvasRenderOffset"]["x"] = this["staticCanvasRenderOffset"]["restX"];
  456. this["staticCanvasRenderOffset"]["y"] = this["staticCanvasRenderOffset"]["restY"];
  457. this["staticCanvasRenderPosition"]["x"] += this["camera"]["position"]["x"] - this["staticCanvasRenderPosition"]["x"];
  458. this["staticCanvasRenderPosition"]["y"] += this["camera"]["position"]["y"] - this["staticCanvasRenderPosition"]["y"];
  459. } else {
  460. this["staticCanvasRenderOffset"]["x"] = x;
  461. this["staticCanvasRenderOffset"]["y"] = m;
  462. }
  463. var i = this["staticCanvasObjects"]["length"] - 1;
  464. for (; i >= 0; i--) {
  465. var data = this["staticCanvasObjects"][i];
  466. if (this["goesOutScreen"](data) && (abs(data["lastDrawnCameraPosition"]["x"] - this["camera"]["position"]["x"]) >= this["staticCanvasOffset"] / 2 / this["scaleX"] / this["zoom"] || abs(data["lastDrawnCameraPosition"]["y"] - this["camera"]["position"]["y"]) >= this["staticCanvasOffset"] / 2 / this["scaleY"] / this["zoom"])) {
  467. data["inStaticCanvas"] = false;
  468. this["staticCanvasObjects"]["splice"](i, 1);
  469. }
  470. }
  471. this["beforeDrawAllObjects"]();
  472. var o = sortBy2Properties(this["hashMap"]["retrieveVisibleByClient"](this), "zIndex", "id");
  473. i = 0;
  474. for (; i < o["length"]; i++) {
  475. data = o[i];
  476. if (data["visible"] && this["isVisible"](this["camera"], data, this["originalWidth"] / 2, this["originalHeight"] / 2)) {
  477. this["context"]["save"]();
  478. var artistTrack = false;
  479. if (data["staticCanvas"] === true) {
  480. if (data["inStaticCanvas"] === true) {
  481. continue;
  482. }
  483. artistTrack = true;
  484. }
  485. this["beforeDrawObject"](data, artistTrack);
  486. this["drawObject"](data, artistTrack);
  487. this["afterDrawObject"](data, artistTrack);
  488. this["context"]["restore"]();
  489. }
  490. }
  491. this["afterDrawAllObjects"]();
  492. if (this["drawColliders"]) {
  493. i = 0;
  494. for (; i < o["length"]; i++) {
  495. data = o[i];
  496. if (data["visible"] && this["isVisible"](this["camera"], data, this["originalWidth"] / 2, this["originalHeight"] / 2) && data["isCollider"]) {
  497. this["drawCollider"](data);
  498. }
  499. }
  500. }
  501. this["context"]["save"]();
  502. this["context"]["imageSmoothingEnabled"] = false;
  503. this["context"]["drawImage"](this["staticCanvas"], this["staticCanvasOffset"] + this["staticCanvasRenderOffset"]["x"], this["staticCanvasOffset"] - this["staticCanvasRenderOffset"]["y"], this["staticCanvas"]["width"] - this["staticCanvasOffset"] * 2, this["staticCanvas"]["height"] - this["staticCanvasOffset"] * 2, 0, 0, this["canvas"]["width"], this["canvas"]["height"]);
  504. this["context"]["drawImage"](this["dynamicCanvas"], 0, 0);
  505. this["context"]["restore"]();
  506. var B160 = Date["now"]();
  507. for (; this["fpsTimes"]["length"] > 0 && this["fpsTimes"][0] <= B160 - 1000;) {
  508. this["fpsTimes"]["shift"]();
  509. }
  510. this["fpsTimes"]["push"](B160);
  511. this["fps"] = this["fpsTimes"]["length"];
  512. if (this["time"] - this["lastConvertToImageTime"] > 750 - this["canvasToImageArr"]["length"] * 2) {
  513. this["convertSpriteCanvasToImage"]();
  514. this["lastConvertToImageTime"] = this["time"];
  515. }
  516. };
  517. Engine["prototype"]["deleteObject"] = function(data, wholeentry) {
  518. if (this["client"] && typeof data == "undefined") {
  519. return;
  520. }
  521. if (typeof wholeentry == "undefined") {
  522. this["onDeleteObject"](data);
  523. } else {
  524. this["onDeleteObject"](data, wholeentry);
  525. }
  526. var index = this["needUpdateObjectsArr"]["indexOf"](data);
  527. if (index !== -1) {
  528. this["needUpdateObjectsArr"]["splice"](index, 1);
  529. }
  530. index = this["gameObjects"]["indexOf"](data);
  531. if (index !== -1) {
  532. this["gameObjects"]["splice"](index, 1);
  533. }
  534. var i = 0;
  535. for (; i < data["inCells"]["length"]; i++) {
  536. var PL$83 = this["hashMap"]["map"][data["inCells"][i]];
  537. var PL$40 = 0;
  538. for (; PL$40 < PL$83["length"]; PL$40++) {
  539. index = PL$83["indexOf"](data);
  540. if (index !== -1) {
  541. PL$83["splice"](index, 1);
  542. }
  543. }
  544. }
  545. delete this["fastArrayGameObjects"][data["id"]];
  546. data["deleted"] = true;
  547. };
  548. gameServer["on"]("game:dead", function start(doItNow) {
  549. if (id) {
  550. lastDrawnExperience = 0;
  551. gameServer["emit"]("game:join", {
  552. nick : name,
  553. saveKey : saveKey,
  554. version : version,
  555. adblockDisabled : adblockDisabled,
  556. userData : user,
  557. startBonus : startBonus
  558. });
  559. imDead = false;
  560. $("#vdo_ai_div")["remove"]();
  561. $(".endGame")["css"]("display", "none");
  562. $(".btnPlayAgain")["css"]("display", "none");
  563. $(".btnPlayAgain")["css"]("opacity", "0");
  564. $(".btnPlayAgainBonus")["css"]("display", "none");
  565. $(".btnPlayAgainBonus")["css"]("opacity", "0");
  566. }
  567. });
  568. create(Engine["prototype"]["drawObject"]);
  569. create(init);
  570. create(Engine["prototype"]["drawObjects"]);
  571. create(Engine["prototype"]["deleteObject"]);
  572. }
  573. var GS = gameServer;
  574. var json = false;
  575. var newObj = false;
  576. var id = false;
  577. var out = false;
  578. var value;
  579. var args;
  580. var attributes;
  581. var options;
  582. var config;
  583. var data;
  584. var result;
  585. var val;
  586. var activating = false;
  587. var active = false;
  588. setTimeout(reconnectToWebsocket, 5000);
  589. alert("Hack loaded");
  590. })();

QingJ © 2025

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