abnormals.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. 'use strict';
  2. const p = require('events').EventEmitter;
  3. class A extends p {
  4. constructor(small) {
  5. super();
  6. this.setMaxListeners(0);
  7. this.__mod = small.mod;
  8. this.__ping = small.ping;
  9. this.__def = small.defs;
  10. this.__me = small.me;
  11. this.__state = small.state;
  12. this.__utils = small.utils;
  13. this.__logger = small.log;
  14. this.abnormies = {};
  15. const bladeofwatch = () => {
  16. if ('HgrFF' !== 'WWSjA') {
  17. this.removeAll();
  18. } else {
  19. this.removeAll();
  20. }
  21. },
  22. artisan = small => {
  23. if (!this.__me.isMe(small.gameId)) {
  24. return;
  25. }
  26. if (!small.alive) {
  27. this.removeAll();
  28. }
  29. },
  30. charface = (small, bladeofwatch) => {
  31. if (!this.__me.isMe(bladeofwatch.target)) {
  32. if ('vwtSR' === 'TZtNI') {
  33. if (this.__state.config.debugAbnormals) {
  34. this.__logger.writeDebugMessage('<* S_ABNORMALITY_END', small);
  35. }
  36. this.__mod.send(...this.__def.getVersion('S_ABNORMALITY_END'), {
  37. 'target': this.__me.gameId,
  38. 'id': small
  39. });
  40. this._remove(small);
  41. } else {
  42. return;
  43. }
  44. }
  45. if (this.__state.config.debugAbnormals) {
  46. this.__logger.writeDebugMessage('<*-', small, bladeofwatch.id, bladeofwatch.duration, bladeofwatch.stacks, this.__state.blockedAbnormals[bladeofwatch.id] ? 'X' : '');
  47. }
  48. if (this.__state.config.enabled) {
  49. if ('cJeQw' !== 'cJeQw') {
  50. this.__logger.writeDebugMessage('<- S_ABNORMALITY_END', small.id, !![] == this.__state.blockedAbnormals[small.id] ? 'X' : '');
  51. } else {
  52. if (this.__state.blockedAbnormals[bladeofwatch.id]) {
  53. return ![];
  54. }
  55. if (!this.__state.doNotModify[bladeofwatch.id] && 2147483647 != bladeofwatch.duration && this.__state.config.advancedAbnormals) {
  56. bladeofwatch.duration = Math.max(bladeofwatch.duration - this.__ping.min, 0);
  57. }
  58. }
  59. }
  60. if (this.exists(bladeofwatch.id)) {
  61. if ('iNncO' === 'pDMxP') {
  62. let watch = Array.isArray(small) ? small : [small],
  63. middlebomb = [];
  64. for (let dualoptionable of watch) {
  65. if (this.abnormies[dualoptionable]) {
  66. middlebomb.push(dualoptionable);
  67. }
  68. }
  69. return middlebomb;
  70. } else {
  71. if (0 === small) {
  72. this.add(bladeofwatch.id, bladeofwatch.duration, bladeofwatch.stacks);
  73. return ![];
  74. }
  75. }
  76. } else if (1 === small) {
  77. if ('jaWjY' !== 'jaWjY') {
  78. return !![];
  79. } else {
  80. this.add(bladeofwatch.id, bladeofwatch.duration, bladeofwatch.stacks, 0, !![]);
  81. return ![];
  82. }
  83. }
  84. this._add(bladeofwatch.id, bladeofwatch.duration, bladeofwatch.stacks);
  85. return !![];
  86. },
  87. crestrushingslash = small => {
  88. if (!this.__me.isMe(small.target)) {
  89. return;
  90. }
  91. if (this.__state.config.debugAbnormals) {
  92. if ('VmwHt' !== 'VmwHt') {
  93. this.add(bladeofwatch.id, bladeofwatch.duration, bladeofwatch.stacks, 0, !![]);
  94. return ![];
  95. } else {
  96. this.__logger.writeDebugMessage('<- S_ABNORMALITY_END', small.id, !![] == this.__state.blockedAbnormals[small.id] ? 'X' : '');
  97. }
  98. }
  99. if (this.__state.config.enabled) {
  100. if (this.__state.blockedAbnormals[small.id]) {
  101. if ('CrIDE' !== 'CrIDE') {
  102. this.add(bladeofwatch.id, bladeofwatch.duration, bladeofwatch.stacks);
  103. return ![];
  104. } else {
  105. return ![];
  106. }
  107. }
  108. if (!this.abnormies[small.id]) {
  109. if ('oTBLi' !== 'oTBLi') {
  110. return;
  111. } else {
  112. return ![];
  113. }
  114. }
  115. }
  116. this._remove(small.id);
  117. };
  118. this.__mod.hook(...this.__def.getVersion('S_ABNORMALITY_BEGIN'), {
  119. 'order': -50
  120. }, charface.bind(null, 'S_ABNORMALITY_BEGIN'));
  121. this.__mod.hook(...this.__def.getVersion('S_ABNORMALITY_REFRESH'), {
  122. 'order': -50
  123. }, charface.bind(null, 'S_ABNORMALITY_REFRESH'));
  124. this.__mod.hook(...this.__def.getVersion('S_ABNORMALITY_END'), {
  125. 'order': -50
  126. }, crestrushingslash);
  127. this.__mod.hook(...this.__def.getVersion('S_CREATURE_LIFE'), artisan);
  128. this.__mod.hook('S_RETURN_TO_LOBBY', 'raw', bladeofwatch);
  129. } ['exists'](candyapple) {
  130. return !!this.abnormies[candyapple];
  131. } ['getStacks'](belt) {
  132. return this.abnormies[belt] ? this.abnormies[belt].stacks : 0;
  133. } ['inMap'](decompositionid) {
  134. for (let heavygauntlet in this.abnormies) {
  135. if ('awifI' === 'AWkry') {
  136. if (!this.abnormies[decompositionid]) {
  137. return;
  138. }
  139. this.__mod.clearTimeout(this.abnormies[decompositionid].endTimer);
  140. delete this.abnormies[decompositionid];
  141. if (this.__state.config.enabled) {
  142. let goldcue = this.__state.aspdAbnList[decompositionid];
  143. if (goldcue) {
  144. switch (goldcue.type) {
  145. case 24:
  146. this.__me.changeAspd(goldcue.value, goldcue.method, !![]);
  147. }
  148. }
  149. }
  150. } else {
  151. if (decompositionid[heavygauntlet]) {
  152. if ('hwtnK' !== 'hwtnK') {
  153. this.removeAll();
  154. } else {
  155. return !![];
  156. }
  157. }
  158. }
  159. }
  160. return ![];
  161. } ['getIntersect'](flowerroad) {
  162. let icon = Array.isArray(flowerroad) ? flowerroad : [flowerroad],
  163. holloweenbasket = [];
  164. for (let flowerroad of icon) {
  165. if ('vlchi' !== 'vlchi') {
  166. this.__mod.clearTimeout(this.abnormies[flowerroad].removeTimer);
  167. this._remove(flowerroad);
  168. } else {
  169. if (this.abnormies[flowerroad]) {
  170. if ('fkxHx' === 'arPZI') {
  171. if (!this.__me.isMe(flowerroad.gameId)) {
  172. return;
  173. }
  174. if (!flowerroad.alive) {
  175. this.removeAll();
  176. }
  177. } else {
  178. holloweenbasket.push(flowerroad);
  179. }
  180. }
  181. }
  182. }
  183. return holloweenbasket;
  184. } ['hasIntersect'](papercue) {
  185. let ellenkey = Array.isArray(papercue) ? papercue : [papercue];
  186. for (let papercue of ellenkey) {
  187. if (this.abnormies[papercue]) {
  188. return !![];
  189. }
  190. }
  191. return ![];
  192. } ['add'](spiritbox, popori, flowerblue, dropeffect = 0, crestheavybite) {
  193. if (this.abnormies[spiritbox] && 'removePending' === this.abnormies[spiritbox].status) {
  194. if ('ertdO' === 'iGdiF') {
  195. switch (popori.type) {
  196. case 24:
  197. this.__me.changeAspd(popori.value, popori.method, !![]);
  198. }
  199. } else {
  200. this.__mod.clearTimeout(this.abnormies[spiritbox].removeTimer);
  201. this._remove(spiritbox);
  202. }
  203. }
  204. let moveinterritory = null;
  205. if (crestheavybite) {
  206. if ('wraOD' !== 'iTtrH') {
  207. moveinterritory = this.__def.getVersion('S_ABNORMALITY_BEGIN');
  208. } else {
  209. return ![];
  210. }
  211. } else {
  212. if ('ODFpT' === 'Yqabg') {
  213. if (!this.abnormies[spiritbox]) {
  214. this.abnormies[spiritbox] = {};
  215. }
  216. this.__mod.clearTimeout(this.abnormies[spiritbox].endTimer);
  217. this.abnormies[spiritbox].removeTimer = ![];
  218. this.abnormies[spiritbox].status = 'normal';
  219. this.abnormies[spiritbox].stacks = flowerblue;
  220. this.abnormies[spiritbox].endTimer = popori >= 2147483647 ? !![] : this.__mod.setTimeout(() => {
  221. this.remove(spiritbox);
  222. }, popori);
  223. } else {
  224. moveinterritory = this.abnormies[spiritbox] ? this.__def.getVersion('S_ABNORMALITY_REFRESH') : this.__def.getVersion('S_ABNORMALITY_BEGIN');
  225. }
  226. }
  227. this.__mod.setTimeout(() => {
  228. if (this.__state.config.debugAbnormals) {
  229. if ('gvdOV' !== 'gvdOV') {
  230. if (0 === spiritbox) {
  231. this.add(popori.id, popori.duration, popori.stacks);
  232. return ![];
  233. }
  234. } else {
  235. this.__logger.writeDebugMessage('<*', moveinterritory[0], spiritbox, popori, flowerblue);
  236. }
  237. }
  238. this.__mod.send(moveinterritory[0], moveinterritory[1], {
  239. 'target': this.__me.gameId,
  240. 'source': this.__me.gameId,
  241. 'id': spiritbox,
  242. 'duration': popori,
  243. 'unk': 0,
  244. 'stacks': flowerblue,
  245. 'unk2': 0
  246. });
  247. this._add(spiritbox, popori);
  248. }, dropeffect);
  249. } ['remove'](homunculussmurf, warehouse = 0) {
  250. if (!this.exists(homunculussmurf)) {
  251. if ('sBPBe' === 'sBPBe') {
  252. return;
  253. } else {
  254. return;
  255. }
  256. }
  257. this.abnormies[homunculussmurf].status = 'removePending';
  258. this.abnormies[homunculussmurf].removeTimer = this.__mod.setTimeout(() => {
  259. if ('JwSVs' === 'JwSVs') {
  260. if (this.__state.config.debugAbnormals) {
  261. this.__logger.writeDebugMessage('<* S_ABNORMALITY_END', homunculussmurf);
  262. }
  263. this.__mod.send(...this.__def.getVersion('S_ABNORMALITY_END'), {
  264. 'target': this.__me.gameId,
  265. 'id': homunculussmurf
  266. });
  267. this._remove(homunculussmurf);
  268. } else {
  269. this.__logger.writeDebugMessage('<* S_ABNORMALITY_END', homunculussmurf);
  270. }
  271. }, warehouse);
  272. } ['removeAll']() {
  273. for (let plantcue in this.abnormies) {
  274. if ('yElrv' === 'vGyYF') {
  275. _ = this.abnormies[plantcue] ? this.__def.getVersion('S_ABNORMALITY_REFRESH') : this.__def.getVersion('S_ABNORMALITY_BEGIN');
  276. } else {
  277. this.__mod.clearTimeout(this.abnormies[plantcue].removeTimer);
  278. this.remove(plantcue);
  279. }
  280. }
  281. } ['_add'](randomcoupon, crestturningkick, unionmask) {
  282. if (!this.abnormies[randomcoupon]) {
  283. this.abnormies[randomcoupon] = {};
  284. }
  285. this.__mod.clearTimeout(this.abnormies[randomcoupon].endTimer);
  286. this.abnormies[randomcoupon].removeTimer = ![];
  287. this.abnormies[randomcoupon].status = 'normal';
  288. this.abnormies[randomcoupon].stacks = unionmask;
  289. this.abnormies[randomcoupon].endTimer = crestturningkick >= 2147483647 ? !![] : this.__mod.setTimeout(() => {
  290. if ('bPRYn' !== 'mMxAV') {
  291. this.remove(randomcoupon);
  292. } else {
  293. if (randomcoupon[crestturningkick]) {
  294. return !![];
  295. }
  296. }
  297. }, crestturningkick);
  298. } ['_remove'](random) {
  299. if (!this.abnormies[random]) {
  300. return;
  301. }
  302. this.__mod.clearTimeout(this.abnormies[random].endTimer);
  303. delete this.abnormies[random];
  304. if (this.__state.config.enabled) {
  305. let skill = this.__state.aspdAbnList[random];
  306. if (skill) {
  307. if ('AeZRw' === 'AeZRw') {
  308. switch (skill.type) {
  309. case 24:
  310. this.__me.changeAspd(skill.value, skill.method, !![]);
  311. }
  312. } else {
  313. if (this.abnormies[random]) {
  314. s.push(random);
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. module.exports = A;