Advertisement
Guest User

Untitled

a guest
May 11th, 2023
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.36 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. /////////////////////////////////////////////////
  6.  
  7. // Cheat Menu Plugin Class
  8.  
  9. /////////////////////////////////////////////////
  10.  
  11. var Cheat_Menu = {};
  12.  
  13.  
  14.  
  15. Cheat_Menu.initialized = false;
  16.  
  17. Cheat_Menu.cheat_menu_open = false;
  18.  
  19. Cheat_Menu.overlay_openable = false;
  20.  
  21. Cheat_Menu.position = 1;
  22.  
  23. Cheat_Menu.menu_update_timer = null;
  24.  
  25.  
  26.  
  27. Cheat_Menu.cheat_selected = 0;
  28.  
  29. Cheat_Menu.cheat_selected_actor = 1;
  30.  
  31. Cheat_Menu.amounts = [-100000, -10000, -1000, -100, -10, -1, 1, 10, 100, 1000, 10000, 100000];
  32.  
  33. Cheat_Menu.amount_index = 6;
  34.  
  35. Cheat_Menu.current_classes = [];
  36.  
  37. Cheat_Menu.class_selection = 0;
  38.  
  39. Cheat_Menu.stat_selection = 0;
  40.  
  41. Cheat_Menu.item_selection = 1;
  42.  
  43. Cheat_Menu.weapon_selection = 1;
  44.  
  45. Cheat_Menu.armor_selection = 1;
  46.  
  47. Cheat_Menu.move_amounts = [-1, 1];
  48.  
  49. Cheat_Menu.move_amount_index = 1;
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. /////////////////////////////////////////////////
  58.  
  59. // Cheat Functions
  60.  
  61. /////////////////////////////////////////////////
  62.  
  63.  
  64.  
  65. // enable god mode for an actor
  66.  
  67. Cheat_Menu.god_mode = function(actor) {
  68.  
  69. if (actor instanceof Game_Actor && !(actor.god_mode)) {
  70.  
  71. actor.god_mode = true;
  72.  
  73.  
  74.  
  75. actor.gainHP_bkup = actor.gainHp;
  76.  
  77. actor.gainHp = function(value) {
  78.  
  79. if (value < 0) {
  80.  
  81. value = 0;
  82.  
  83. }
  84.  
  85. this.gainHP_bkup(value);
  86.  
  87. };
  88.  
  89.  
  90.  
  91. actor.setHp_bkup = actor.setHp;
  92.  
  93. actor.setHp = function(hp) {
  94.  
  95. hp = Math.max(1, hp);
  96.  
  97. this.setHp_bkup(hp);
  98.  
  99. }
  100.  
  101.  
  102.  
  103. actor.gainMp_bkup = actor.gainMp;
  104.  
  105. actor.gainMp = function (value) {
  106.  
  107. if (value < 0) {
  108.  
  109. value = 0;
  110.  
  111. }
  112.  
  113. this.gainMp_bkup(value);
  114.  
  115. };
  116.  
  117.  
  118.  
  119. actor.gainTp_bkup = actor.gainTp;
  120.  
  121. actor.gainTp = function (value) {
  122.  
  123. if (value < 0) {
  124.  
  125. value = 0;
  126.  
  127. }
  128.  
  129. this.gainTp_bkup(value);
  130.  
  131. };
  132.  
  133.  
  134.  
  135. actor.paySkillCost_bkup = actor.paySkillCost;
  136.  
  137. actor.paySkillCost = function (skill) {
  138.  
  139. // do nothing
  140.  
  141. };
  142.  
  143.  
  144.  
  145. actor.god_mode_interval = setInterval(function() {
  146.  
  147. actor._hp = actor.mhp;
  148.  
  149. actor._mp = actor.mmp;
  150.  
  151. }, 100);
  152.  
  153. }
  154.  
  155. };
  156.  
  157.  
  158.  
  159.  
  160.  
  161. // disable god mode for an actor
  162.  
  163. Cheat_Menu.god_mode_off = function(actor) {
  164.  
  165. if (actor instanceof Game_Actor && actor.god_mode) {
  166.  
  167. actor.god_mode = false;
  168.  
  169.  
  170.  
  171. actor.gainHp = actor.gainHP_bkup;
  172.  
  173. actor.setHp = actor.setHp_bkup;
  174.  
  175. actor.gainMp = actor.gainMp_bkup;
  176.  
  177. actor.gainTp = actor.gainTp_bkup;
  178.  
  179. actor.paySkillCost = actor.paySkillCost_bkup;
  180.  
  181.  
  182.  
  183. clearInterval(actor.god_mode_interval);
  184.  
  185. }
  186.  
  187. };
  188.  
  189.  
  190.  
  191. // set all enemies hp
  192.  
  193. Cheat_Menu.set_enemy_hp = function(hp) {
  194.  
  195. for (var i = 0; i < $gameTroop._enemies.length; i++) {
  196.  
  197. if ($gameTroop._enemies[i]) {
  198.  
  199. $gameTroop._enemies[i]._hp = hp;
  200.  
  201. }
  202.  
  203. }
  204.  
  205. };
  206.  
  207.  
  208.  
  209. // increase class exp
  210.  
  211. Cheat_Menu.give_exp = function(actor, class_index, amount) {
  212.  
  213. if (actor instanceof Game_Actor) {
  214.  
  215. if (actor._exp[class_index] != undefined) {
  216.  
  217. actor._exp[class_index] += amount;
  218.  
  219. }
  220.  
  221. }
  222.  
  223. };
  224.  
  225.  
  226.  
  227. // increase stat bonus
  228.  
  229. Cheat_Menu.give_stat = function(actor, stat_index, amount) {
  230.  
  231. if (actor instanceof Game_Actor) {
  232.  
  233. if (actor._paramPlus[stat_index] != undefined) {
  234.  
  235. actor._paramPlus[stat_index] += amount;
  236.  
  237. }
  238.  
  239. }
  240.  
  241. };
  242.  
  243.  
  244.  
  245. // increase gold
  246.  
  247. Cheat_Menu.give_gold = function(amount) {
  248.  
  249. $gameParty._gold += amount;
  250.  
  251. };
  252.  
  253.  
  254.  
  255. // increase item count for party of item, by id
  256.  
  257. Cheat_Menu.give_item = function(item_id, amount) {
  258.  
  259. if ($dataItems[item_id] != undefined) {
  260.  
  261. if ($gameParty._items[item_id] == undefined) {
  262.  
  263. $gameParty._items[item_id] = amount;
  264.  
  265. }
  266.  
  267. else {
  268.  
  269. $gameParty._items[item_id] += amount;
  270.  
  271. }
  272.  
  273. }
  274.  
  275. }
  276.  
  277.  
  278.  
  279. // increase weapon count for party of item, by id
  280.  
  281. Cheat_Menu.give_weapon = function(weapon_id, amount) {
  282.  
  283. if ($dataWeapons[weapon_id] != undefined) {
  284.  
  285. if ($gameParty._weapons[weapon_id] == undefined) {
  286.  
  287. $gameParty._weapons[weapon_id] = amount;
  288.  
  289. }
  290.  
  291. else {
  292.  
  293. $gameParty._weapons[weapon_id] += amount;
  294.  
  295. }
  296.  
  297. }
  298.  
  299. }
  300.  
  301.  
  302.  
  303. // increase armor count for party of item, by id
  304.  
  305. Cheat_Menu.give_armor = function(armor_id, amount) {
  306.  
  307. if ($dataArmors[armor_id] != undefined) {
  308.  
  309. if ($gameParty._armors[armor_id] == undefined) {
  310.  
  311. $gameParty._armors[armor_id] = amount;
  312.  
  313. }
  314.  
  315. else {
  316.  
  317. $gameParty._armors[armor_id] += amount;
  318.  
  319. }
  320.  
  321. }
  322.  
  323. }
  324.  
  325.  
  326.  
  327. // change player movement speed
  328.  
  329. Cheat_Menu.change_player_speed = function(amount) {
  330.  
  331. $gamePlayer._moveSpeed += amount;
  332.  
  333. }
  334.  
  335.  
  336.  
  337. // clear active states on an actor
  338.  
  339. Cheat_Menu.clear_actor_states = function(actor) {
  340.  
  341. if (actor instanceof Game_Actor) {
  342.  
  343. if (actor._states != undefined && actor._states.length > 0) {
  344.  
  345. actor._states = [];
  346.  
  347. }
  348.  
  349. }
  350.  
  351. }
  352.  
  353.  
  354.  
  355. /////////////////////////////////////////////////
  356.  
  357. // Cheat Menu overlay
  358.  
  359. /////////////////////////////////////////////////
  360.  
  361.  
  362.  
  363. Cheat_Menu.overlay_box = document.createElement('div');
  364.  
  365. Cheat_Menu.overlay_box.id = "cheat_menu";
  366.  
  367. Cheat_Menu.overlay_box.style.left = "5px";
  368.  
  369. Cheat_Menu.overlay_box.style.top = "5px";
  370.  
  371. Cheat_Menu.overlay_box.style.right = "";
  372.  
  373. Cheat_Menu.overlay_box.style.bottom = "";
  374.  
  375.  
  376.  
  377. Cheat_Menu.overlay = document.createElement('table');
  378.  
  379. Cheat_Menu.overlay.id = "cheat_menu_text";
  380.  
  381. Cheat_Menu.overlay.style.left = "5px";
  382.  
  383. Cheat_Menu.overlay.style.top = "5px";
  384.  
  385. Cheat_Menu.overlay.style.right = "";
  386.  
  387. Cheat_Menu.overlay.style.bottom = "";
  388.  
  389.  
  390.  
  391.  
  392.  
  393. Cheat_Menu.style_css = document.createElement("link");
  394.  
  395. Cheat_Menu.style_css.type = "text/css";
  396.  
  397. Cheat_Menu.style_css.rel = "stylesheet";
  398.  
  399. Cheat_Menu.style_css.href = "js/plugins/Cheat_Menu.css";
  400.  
  401. document.head.appendChild(Cheat_Menu.style_css);
  402.  
  403.  
  404.  
  405.  
  406.  
  407. // keep menu in correct location
  408.  
  409. Cheat_Menu.position_menu = function(event) {
  410.  
  411. //middle of screen
  412.  
  413. if (Cheat_Menu.position == 0) {
  414.  
  415. Cheat_Menu.overlay_box.style.left = "" + (window.innerWidth / 2) + "px";
  416.  
  417. Cheat_Menu.overlay_box.style.top = "" + (window.innerHeight / 2) + "px";
  418.  
  419. Cheat_Menu.overlay_box.style.right = "";
  420.  
  421. Cheat_Menu.overlay_box.style.bottom = "";
  422.  
  423.  
  424.  
  425. Cheat_Menu.overlay_box.style.marginLeft = "-110px";
  426.  
  427. Cheat_Menu.overlay_box.style.marginTop = "-50px";
  428.  
  429.  
  430.  
  431. Cheat_Menu.overlay.style.left = "" + (window.innerWidth / 2) + "px";
  432.  
  433. Cheat_Menu.overlay.style.top = "" + (window.innerHeight / 2) + "px";
  434.  
  435. Cheat_Menu.overlay.style.right = "";
  436.  
  437. Cheat_Menu.overlay.style.bottom = "";
  438.  
  439.  
  440.  
  441. Cheat_Menu.overlay.style.marginLeft = "-110px";
  442.  
  443. Cheat_Menu.overlay.style.marginTop = "-50px";
  444.  
  445. }
  446.  
  447. // top left corner
  448.  
  449. else if (Cheat_Menu.position == 1) {
  450.  
  451. Cheat_Menu.overlay_box.style.left = "5px";
  452.  
  453. Cheat_Menu.overlay_box.style.top = "5px";
  454.  
  455. Cheat_Menu.overlay_box.style.right = "";
  456.  
  457. Cheat_Menu.overlay_box.style.bottom = "";
  458.  
  459.  
  460.  
  461. Cheat_Menu.overlay_box.style.marginLeft = "";
  462.  
  463. Cheat_Menu.overlay_box.style.marginTop = "";
  464.  
  465.  
  466.  
  467. Cheat_Menu.overlay.style.left = "5px";
  468.  
  469. Cheat_Menu.overlay.style.top = "5px";
  470.  
  471. Cheat_Menu.overlay.style.right = "";
  472.  
  473. Cheat_Menu.overlay.style.bottom = "";
  474.  
  475.  
  476.  
  477. Cheat_Menu.overlay.style.marginLeft = "";
  478.  
  479. Cheat_Menu.overlay.style.marginTop = "";
  480.  
  481. }
  482.  
  483. // top right corner
  484.  
  485. else if (Cheat_Menu.position == 2) {
  486.  
  487. Cheat_Menu.overlay_box.style.left = "";
  488.  
  489. Cheat_Menu.overlay_box.style.top = "5px";
  490.  
  491. Cheat_Menu.overlay_box.style.right = "5px";
  492.  
  493. Cheat_Menu.overlay_box.style.bottom = "";
  494.  
  495.  
  496.  
  497. Cheat_Menu.overlay_box.style.marginLeft = "";
  498.  
  499. Cheat_Menu.overlay_box.style.marginTop = "";
  500.  
  501.  
  502.  
  503. Cheat_Menu.overlay.style.left = "";
  504.  
  505. Cheat_Menu.overlay.style.top = "5px";
  506.  
  507. Cheat_Menu.overlay.style.right = "-15px";
  508.  
  509. Cheat_Menu.overlay.style.bottom = "";
  510.  
  511.  
  512.  
  513. Cheat_Menu.overlay.style.marginLeft = "";
  514.  
  515. Cheat_Menu.overlay.style.marginTop = "";
  516.  
  517. }
  518.  
  519. // bottom right corner
  520.  
  521. else if (Cheat_Menu.position == 3) {
  522.  
  523. Cheat_Menu.overlay_box.style.left = "";
  524.  
  525. Cheat_Menu.overlay_box.style.top = "";
  526.  
  527. Cheat_Menu.overlay_box.style.right = "5px";
  528.  
  529. Cheat_Menu.overlay_box.style.bottom = "5px";
  530.  
  531.  
  532.  
  533. Cheat_Menu.overlay_box.style.marginLeft = "";
  534.  
  535. Cheat_Menu.overlay_box.style.marginTop = "";
  536.  
  537.  
  538.  
  539. Cheat_Menu.overlay.style.left = "";
  540.  
  541. Cheat_Menu.overlay.style.top = "";
  542.  
  543. Cheat_Menu.overlay.style.right = "-15px";
  544.  
  545. Cheat_Menu.overlay.style.bottom = "5px";
  546.  
  547.  
  548.  
  549. Cheat_Menu.overlay.style.marginLeft = "";
  550.  
  551. Cheat_Menu.overlay.style.marginTop = "";
  552.  
  553. }
  554.  
  555. // bottom left corner
  556.  
  557. else if (Cheat_Menu.position == 4) {
  558.  
  559. Cheat_Menu.overlay_box.style.left = "5px";
  560.  
  561. Cheat_Menu.overlay_box.style.top = "";
  562.  
  563. Cheat_Menu.overlay_box.style.right = "";
  564.  
  565. Cheat_Menu.overlay_box.style.bottom = "5px";
  566.  
  567.  
  568.  
  569. Cheat_Menu.overlay_box.style.marginLeft = "";
  570.  
  571. Cheat_Menu.overlay_box.style.marginTop = "";
  572.  
  573.  
  574.  
  575. Cheat_Menu.overlay.style.left = "5px";
  576.  
  577. Cheat_Menu.overlay.style.top = "";
  578.  
  579. Cheat_Menu.overlay.style.right = "";
  580.  
  581. Cheat_Menu.overlay.style.bottom = "5px";
  582.  
  583.  
  584.  
  585. Cheat_Menu.overlay.style.marginLeft = "";
  586.  
  587. Cheat_Menu.overlay.style.marginTop = "";
  588.  
  589. }
  590.  
  591.  
  592.  
  593. // adjust background box size to match contents
  594.  
  595. var height = 20;
  596.  
  597. for (var i = 0; i < Cheat_Menu.overlay.children.length; i++) {
  598.  
  599. height += Cheat_Menu.overlay.children[i].scrollHeight;
  600.  
  601. }
  602.  
  603. Cheat_Menu.overlay_box.style.height = "" + height + "px";
  604.  
  605. };
  606.  
  607.  
  608.  
  609. // insert row with buttons to scroll left and right for some context
  610.  
  611. Cheat_Menu.append_scroll_selector = function(text, key1, key2, scroll_left_handler, scroll_right_handler) {
  612.  
  613. var scroll_selector = Cheat_Menu.overlay.insertRow();
  614.  
  615. scroll_selector.className = "scroll_selector_row";
  616.  
  617.  
  618.  
  619. var scroll_left_button = scroll_selector.insertCell();
  620.  
  621. scroll_left_button.className = "scroll_selector_buttons cheat_menu_cell";
  622.  
  623.  
  624.  
  625.  
  626.  
  627. var scroll_text = scroll_selector.insertCell();
  628.  
  629. scroll_text.className = "cheat_menu_cell";
  630.  
  631.  
  632.  
  633. var scroll_right_button = scroll_selector.insertCell();
  634.  
  635. scroll_right_button.className = "scroll_selector_buttons cheat_menu_cell";
  636.  
  637.  
  638.  
  639. scroll_left_button.innerHTML = "←[" + key1 + "]";
  640.  
  641. scroll_text.innerHTML = text;
  642.  
  643. scroll_right_button.innerHTML = "[" + key2 + "]→";
  644.  
  645.  
  646.  
  647. scroll_left_button.addEventListener('mousedown', scroll_left_handler);
  648.  
  649. scroll_right_button.addEventListener('mousedown', scroll_right_handler);
  650.  
  651. }
  652.  
  653.  
  654.  
  655. // insert a title row
  656.  
  657. Cheat_Menu.append_title = function(title) {
  658.  
  659. var title_row = Cheat_Menu.overlay.insertRow();
  660.  
  661. var temp = title_row.insertCell()
  662.  
  663. temp.className = "cheat_menu_cell_title";
  664.  
  665. var title_text = title_row.insertCell();
  666.  
  667. title_text.className = "cheat_menu_cell_title";
  668.  
  669. temp = title_row.insertCell()
  670.  
  671. temp.className = "cheat_menu_cell_title";
  672.  
  673. title_text.innerHTML = title;
  674.  
  675. }
  676.  
  677.  
  678.  
  679. // append a cheat with some handler to activate
  680.  
  681. Cheat_Menu.append_cheat = function(cheat_text, status_text, key, click_handler) {
  682.  
  683. var cheat_row = Cheat_Menu.overlay.insertRow();
  684.  
  685.  
  686.  
  687. var cheat_title = cheat_row.insertCell();
  688.  
  689. cheat_title.className = "cheat_menu_cell"
  690.  
  691. var temp = cheat_row.insertCell()
  692.  
  693. temp.className = "cheat_menu_cell";
  694.  
  695. var cheat = cheat_row.insertCell();
  696.  
  697. cheat.className = "cheat_menu_buttons cheat_menu_cell";
  698.  
  699.  
  700.  
  701. cheat_title.innerHTML = cheat_text;
  702.  
  703. cheat.innerHTML = status_text + "[" + key + "]";
  704.  
  705.  
  706.  
  707. cheat.addEventListener('mousedown', click_handler);
  708.  
  709. }
  710.  
  711.  
  712.  
  713. //
  714.  
  715. // various functions to settup each page of the cheat menu
  716.  
  717. //
  718.  
  719.  
  720.  
  721. Cheat_Menu.scroll_left_cheat = function() {
  722.  
  723. Cheat_Menu.cheat_selected--;
  724.  
  725. if (Cheat_Menu.cheat_selected < 0) {
  726.  
  727. Cheat_Menu.cheat_selected = 10;
  728.  
  729. }
  730.  
  731. SoundManager.playSystemSound(0);
  732.  
  733. Cheat_Menu.update_menu();
  734.  
  735. }
  736.  
  737.  
  738.  
  739. Cheat_Menu.scroll_right_cheat = function() {
  740.  
  741. Cheat_Menu.cheat_selected++;
  742.  
  743. if (Cheat_Menu.cheat_selected > 10) {
  744.  
  745. Cheat_Menu.cheat_selected = 0;
  746.  
  747. }
  748.  
  749. SoundManager.playSystemSound(0);
  750.  
  751. Cheat_Menu.update_menu();
  752.  
  753. }
  754.  
  755.  
  756.  
  757. Cheat_Menu.append_cheat_title = function(cheat_name) {
  758.  
  759. Cheat_Menu.append_title("Cheat");
  760.  
  761. Cheat_Menu.append_scroll_selector(cheat_name, 2, 3, Cheat_Menu.scroll_left_cheat, Cheat_Menu.scroll_right_cheat);
  762.  
  763. }
  764.  
  765.  
  766.  
  767. Cheat_Menu.scroll_left_actor = function() {
  768.  
  769. Cheat_Menu.cheat_selected_actor--;
  770.  
  771. if (Cheat_Menu.cheat_selected_actor < 0) {
  772.  
  773. Cheat_Menu.cheat_selected_actor = $gameActors._data.length - 1;
  774.  
  775. }
  776.  
  777. SoundManager.playSystemSound(0);
  778.  
  779. Cheat_Menu.update_menu();
  780.  
  781. }
  782.  
  783.  
  784.  
  785. Cheat_Menu.scroll_right_actor = function() {
  786.  
  787. Cheat_Menu.cheat_selected_actor++;
  788.  
  789. if (Cheat_Menu.cheat_selected_actor >= $gameActors._data.length) {
  790.  
  791. Cheat_Menu.cheat_selected_actor = 0;
  792.  
  793. }
  794.  
  795. SoundManager.playSystemSound(0);
  796.  
  797. Cheat_Menu.update_menu();
  798.  
  799. }
  800.  
  801.  
  802.  
  803. Cheat_Menu.append_actor_selection = function(key1, key2) {
  804.  
  805. Cheat_Menu.append_title("Actor");
  806.  
  807.  
  808.  
  809. var actor_name;
  810.  
  811.  
  812.  
  813. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._name) {
  814.  
  815. actor_name = "<font color='#0088ff'>" + $gameActors._data[Cheat_Menu.cheat_selected_actor]._name + "</font>";
  816.  
  817. }
  818.  
  819. else {
  820.  
  821. actor_name = "<font color='#ff0000'>NULL</font>";
  822.  
  823. }
  824.  
  825.  
  826.  
  827. Cheat_Menu.append_scroll_selector(actor_name, key1, key2, Cheat_Menu.scroll_left_actor, Cheat_Menu.scroll_right_actor);
  828.  
  829. }
  830.  
  831.  
  832.  
  833. Cheat_Menu.god_mode_toggle = function(event) {
  834.  
  835. if ($gameActors._data[Cheat_Menu.cheat_selected_actor]) {
  836.  
  837. if (!($gameActors._data[Cheat_Menu.cheat_selected_actor].god_mode)) {
  838.  
  839. Cheat_Menu.god_mode($gameActors._data[Cheat_Menu.cheat_selected_actor]);
  840.  
  841. SoundManager.playSystemSound(1);
  842.  
  843. }
  844.  
  845. else {
  846.  
  847. Cheat_Menu.god_mode_off($gameActors._data[Cheat_Menu.cheat_selected_actor]);
  848.  
  849. SoundManager.playSystemSound(2);
  850.  
  851. }
  852.  
  853. Cheat_Menu.update_menu();
  854.  
  855. }
  856.  
  857. }
  858.  
  859.  
  860.  
  861. Cheat_Menu.append_godmode_status = function() {
  862.  
  863. var status_text;
  864.  
  865. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor].god_mode) {
  866.  
  867. status_text = "<font color='#00ff00'>on</font>";
  868.  
  869. }
  870.  
  871. else {
  872.  
  873. status_text = "<font color='#ff0000'>off</font>";
  874.  
  875. }
  876.  
  877.  
  878.  
  879. Cheat_Menu.append_cheat("Status:", status_text, 6, Cheat_Menu.god_mode_toggle);
  880.  
  881. }
  882.  
  883.  
  884.  
  885. Cheat_Menu.enemy_hp_cheat_1 = function() {
  886.  
  887. Cheat_Menu.set_enemy_hp(0);
  888.  
  889. SoundManager.playSystemSound(1);
  890.  
  891. }
  892.  
  893.  
  894.  
  895. Cheat_Menu.enemy_hp_cheat_2 = function() {
  896.  
  897. Cheat_Menu.set_enemy_hp(1);
  898.  
  899. SoundManager.playSystemSound(1);
  900.  
  901. }
  902.  
  903.  
  904.  
  905. Cheat_Menu.append_enemy_cheats = function(key1, key2) {
  906.  
  907. Cheat_Menu.append_cheat("Enemy HP to 0", "Activate", key1, Cheat_Menu.enemy_hp_cheat_1);
  908.  
  909. Cheat_Menu.append_cheat("Enemy HP to 1", "Activate", key2, Cheat_Menu.enemy_hp_cheat_2);
  910.  
  911. }
  912.  
  913.  
  914.  
  915. Cheat_Menu.toggle_no_clip_status = function(event) {
  916.  
  917. $gamePlayer._through = !($gamePlayer._through);
  918.  
  919. Cheat_Menu.update_menu();
  920.  
  921. if ($gamePlayer._through) {
  922.  
  923. SoundManager.playSystemSound(1);
  924.  
  925. }
  926.  
  927. else {
  928.  
  929. SoundManager.playSystemSound(2);
  930.  
  931. }
  932.  
  933. }
  934.  
  935.  
  936.  
  937. Cheat_Menu.append_no_clip_status = function(key1) {
  938.  
  939. var status_text;
  940.  
  941. if ($gamePlayer._through) {
  942.  
  943. status_text = "<font color='#00ff00'>on</font>";
  944.  
  945. }
  946.  
  947. else {
  948.  
  949. status_text = "<font color='#ff0000'>off</font>";
  950.  
  951. }
  952.  
  953.  
  954.  
  955. Cheat_Menu.append_cheat("Status:", status_text, key1, Cheat_Menu.toggle_no_clip_status);
  956.  
  957. }
  958.  
  959.  
  960.  
  961. Cheat_Menu.move_left_amount = function() {
  962.  
  963. Cheat_Menu.amount_index--;
  964.  
  965. if (Cheat_Menu.amount_index < 0) {
  966.  
  967. Cheat_Menu.amount_index = 0;
  968.  
  969. SoundManager.playSystemSound(2);
  970.  
  971. }
  972.  
  973. else {
  974.  
  975. SoundManager.playSystemSound(1);
  976.  
  977. }
  978.  
  979. Cheat_Menu.update_menu();
  980.  
  981. }
  982.  
  983.  
  984.  
  985. Cheat_Menu.move_right_amount = function() {
  986.  
  987. Cheat_Menu.amount_index++;
  988.  
  989. if (Cheat_Menu.amount_index >= Cheat_Menu.amounts.length) {
  990.  
  991. Cheat_Menu.amount_index = Cheat_Menu.amounts.length - 1;
  992.  
  993. SoundManager.playSystemSound(2);
  994.  
  995. }
  996.  
  997. else {
  998.  
  999. SoundManager.playSystemSound(1);
  1000.  
  1001. }
  1002.  
  1003. Cheat_Menu.update_menu();
  1004.  
  1005. }
  1006.  
  1007.  
  1008.  
  1009. Cheat_Menu.append_amount_selection = function(key1, key2) {
  1010.  
  1011. Cheat_Menu.append_title("Amount");
  1012.  
  1013.  
  1014.  
  1015. var current_amount = "<font color='#0088ff'>" + Cheat_Menu.amounts[Cheat_Menu.amount_index] + "</font>";
  1016.  
  1017. Cheat_Menu.append_scroll_selector(current_amount, key1, key2, Cheat_Menu.move_left_amount, Cheat_Menu.move_right_amount);
  1018.  
  1019. }
  1020.  
  1021.  
  1022.  
  1023. Cheat_Menu.move_left_move_amount = function() {
  1024.  
  1025. Cheat_Menu.move_amount_index--;
  1026.  
  1027. if (Cheat_Menu.move_amount_index < 0) {
  1028.  
  1029. Cheat_Menu.move_amount_index = 0;
  1030.  
  1031. SoundManager.playSystemSound(2);
  1032.  
  1033. }
  1034.  
  1035. else {
  1036.  
  1037. SoundManager.playSystemSound(1);
  1038.  
  1039. }
  1040.  
  1041. Cheat_Menu.update_menu();
  1042.  
  1043. }
  1044.  
  1045.  
  1046.  
  1047. Cheat_Menu.move_right_move_amount = function() {
  1048.  
  1049. Cheat_Menu.move_amount_index++;
  1050.  
  1051. if (Cheat_Menu.move_amount_index >= Cheat_Menu.move_amounts.length) {
  1052.  
  1053. Cheat_Menu.move_amount_index = Cheat_Menu.move_amounts.length - 1;
  1054.  
  1055. SoundManager.playSystemSound(2);
  1056.  
  1057. }
  1058.  
  1059. else {
  1060.  
  1061. SoundManager.playSystemSound(1);
  1062.  
  1063. }
  1064.  
  1065. Cheat_Menu.update_menu();
  1066.  
  1067. }
  1068.  
  1069.  
  1070.  
  1071. Cheat_Menu.append_move_amount_selection = function(key1, key2) {
  1072.  
  1073. Cheat_Menu.append_title("Amount");
  1074.  
  1075.  
  1076.  
  1077. var current_amount = "<font color='#0088ff'>" + Cheat_Menu.move_amounts[Cheat_Menu.move_amount_index] + "</font>";
  1078.  
  1079. Cheat_Menu.append_scroll_selector(current_amount, key1, key2, Cheat_Menu.move_left_move_amount, Cheat_Menu.move_right_move_amount);
  1080.  
  1081. }
  1082.  
  1083.  
  1084.  
  1085. Cheat_Menu.scroll_left_class = function(event) {
  1086.  
  1087. Cheat_Menu.class_selection--;
  1088.  
  1089. if (Cheat_Menu.class_selection < 0) {
  1090.  
  1091. if (Cheat_Menu.current_classes.length > 0) {
  1092.  
  1093. Cheat_Menu.class_selection = Cheat_Menu.current_classes.length - 1;
  1094.  
  1095. }
  1096.  
  1097. else {
  1098.  
  1099. Cheat_Menu.class_selection = 0;
  1100.  
  1101. }
  1102.  
  1103. }
  1104.  
  1105. Cheat_Menu.update_menu();
  1106.  
  1107. }
  1108.  
  1109.  
  1110.  
  1111. Cheat_Menu.scroll_right_class = function(event) {
  1112.  
  1113. Cheat_Menu.class_selection++;
  1114.  
  1115. if (Cheat_Menu.class_selection >= Cheat_Menu.current_classes.length) {
  1116.  
  1117. Cheat_Menu.class_selection = 0;
  1118.  
  1119. }
  1120.  
  1121. Cheat_Menu.update_menu();
  1122.  
  1123. }
  1124.  
  1125.  
  1126.  
  1127. Cheat_Menu.give_current_exp = function(event) {
  1128.  
  1129. Cheat_Menu.give_exp($gameActors._data[Cheat_Menu.cheat_selected_actor], Cheat_Menu.current_classes[Cheat_Menu.class_selection] , Cheat_Menu.amounts[Cheat_Menu.amount_index]);
  1130.  
  1131. Cheat_Menu.update_menu();
  1132.  
  1133.  
  1134.  
  1135. if (Cheat_Menu.amounts[Cheat_Menu.amount_index] > 0) {
  1136.  
  1137. SoundManager.playSystemSound(1);
  1138.  
  1139. }
  1140.  
  1141. else {
  1142.  
  1143. SoundManager.playSystemSound(2);
  1144.  
  1145. }
  1146.  
  1147. }
  1148.  
  1149.  
  1150.  
  1151. Cheat_Menu.append_class_selection = function(key1, key2, key3) {
  1152.  
  1153. Cheat_Menu.append_title("Class");
  1154.  
  1155.  
  1156.  
  1157. var class_string = "";
  1158.  
  1159.  
  1160.  
  1161. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._exp) {
  1162.  
  1163. Cheat_Menu.current_classes = Object.keys($gameActors._data[Cheat_Menu.cheat_selected_actor]._exp);
  1164.  
  1165. if (Cheat_Menu.current_classes.length > 0) {
  1166.  
  1167. if (Cheat_Menu.class_selection >= Cheat_Menu.current_classes.length) {
  1168.  
  1169. Cheat_Menu.class_selection = 0;
  1170.  
  1171. }
  1172.  
  1173. class_string = $dataClasses[Cheat_Menu.current_classes[Cheat_Menu.class_selection]].name;
  1174.  
  1175. }
  1176.  
  1177. }
  1178.  
  1179. else {
  1180.  
  1181. Cheat_Menu.current_classes = [];
  1182.  
  1183. }
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189. Cheat_Menu.append_scroll_selector(class_string, key1, key2, Cheat_Menu.scroll_left_class, Cheat_Menu.scroll_right_class);
  1190.  
  1191. var current_exp = "NULL";
  1192.  
  1193. if (Cheat_Menu.current_classes.length > 0) {
  1194.  
  1195. current_exp = $gameActors._data[Cheat_Menu.cheat_selected_actor]._exp[Cheat_Menu.current_classes[Cheat_Menu.class_selection]];
  1196.  
  1197. }
  1198.  
  1199. Cheat_Menu.append_cheat("EXP:", current_exp, key3, Cheat_Menu.give_current_exp);
  1200.  
  1201. }
  1202.  
  1203.  
  1204.  
  1205. Cheat_Menu.scroll_left_stat = function(event) {
  1206.  
  1207. Cheat_Menu.stat_selection--;
  1208.  
  1209. if (Cheat_Menu.stat_selection < 0) {
  1210.  
  1211. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus) {
  1212.  
  1213. Cheat_Menu.stat_selection = $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus.length - 1;
  1214.  
  1215. }
  1216.  
  1217. else {
  1218.  
  1219. Cheat_Menu.stat_selection = 0;
  1220.  
  1221. }
  1222.  
  1223. }
  1224.  
  1225. Cheat_Menu.update_menu();
  1226.  
  1227. }
  1228.  
  1229.  
  1230.  
  1231. Cheat_Menu.scroll_right_stat = function(event) {
  1232.  
  1233. Cheat_Menu.stat_selection++;
  1234.  
  1235. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus) {
  1236.  
  1237. if (Cheat_Menu.stat_selection >= $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus.length) {
  1238.  
  1239. Cheat_Menu.stat_selection = 0;
  1240.  
  1241. }
  1242.  
  1243. }
  1244.  
  1245. else {
  1246.  
  1247. Cheat_Menu.stat_selection = 0;
  1248.  
  1249. }
  1250.  
  1251. Cheat_Menu.update_menu();
  1252.  
  1253. }
  1254.  
  1255.  
  1256.  
  1257. Cheat_Menu.give_current_stat = function(event) {
  1258.  
  1259. Cheat_Menu.give_stat($gameActors._data[Cheat_Menu.cheat_selected_actor], Cheat_Menu.stat_selection , Cheat_Menu.amounts[Cheat_Menu.amount_index]);
  1260.  
  1261. Cheat_Menu.update_menu();
  1262.  
  1263.  
  1264.  
  1265. if (Cheat_Menu.amounts[Cheat_Menu.amount_index] > 0) {
  1266.  
  1267. SoundManager.playSystemSound(1);
  1268.  
  1269. }
  1270.  
  1271. else {
  1272.  
  1273. SoundManager.playSystemSound(2);
  1274.  
  1275. }
  1276.  
  1277. }
  1278.  
  1279.  
  1280.  
  1281. Cheat_Menu.append_stat_selection = function(key1, key2, key3) {
  1282.  
  1283. Cheat_Menu.append_title("Stat");
  1284.  
  1285.  
  1286.  
  1287. var stat_string = "";
  1288.  
  1289.  
  1290.  
  1291. var stat_string = "";
  1292.  
  1293. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus) {
  1294.  
  1295. if (Cheat_Menu.stat_selection >= $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus.length) {
  1296.  
  1297. Cheat_Menu.stat_selection = 0;
  1298.  
  1299. }
  1300.  
  1301. stat_string += $dataSystem.terms.params[Cheat_Menu.stat_selection];
  1302.  
  1303. }
  1304.  
  1305.  
  1306.  
  1307. Cheat_Menu.append_scroll_selector(stat_string, key1, key2, Cheat_Menu.scroll_left_stat, Cheat_Menu.scroll_right_stat);
  1308.  
  1309. var current_value = "NULL";
  1310.  
  1311. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus) {
  1312.  
  1313. current_value = $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus[Cheat_Menu.stat_selection];
  1314.  
  1315. }
  1316.  
  1317. Cheat_Menu.append_cheat("Value:", current_value, key3, Cheat_Menu.give_current_stat);
  1318.  
  1319. }
  1320.  
  1321.  
  1322.  
  1323. Cheat_Menu.give_current_gold = function(event) {
  1324.  
  1325. Cheat_Menu.give_gold(Cheat_Menu.amounts[Cheat_Menu.amount_index]);
  1326.  
  1327. SoundManager.playSystemSound(1);
  1328.  
  1329. Cheat_Menu.update_menu();
  1330.  
  1331. }
  1332.  
  1333.  
  1334.  
  1335. Cheat_Menu.append_gold_status = function(key1) {
  1336.  
  1337. Cheat_Menu.append_cheat("Gold:", $gameParty._gold, key1, Cheat_Menu.give_current_gold);
  1338.  
  1339. }
  1340.  
  1341.  
  1342.  
  1343. Cheat_Menu.update_speed = function(event) {
  1344.  
  1345. Cheat_Menu.change_player_speed(Cheat_Menu.move_amounts[Cheat_Menu.move_amount_index]);
  1346.  
  1347. SoundManager.playSystemSound(1);
  1348.  
  1349. Cheat_Menu.update_menu();
  1350.  
  1351. }
  1352.  
  1353.  
  1354.  
  1355. Cheat_Menu.append_speed_status = function(key1) {
  1356.  
  1357. Cheat_Menu.append_cheat("Current<br>Speed:", $gamePlayer._moveSpeed, key1, Cheat_Menu.update_speed);
  1358.  
  1359. }
  1360.  
  1361.  
  1362.  
  1363. Cheat_Menu.scroll_left_item = function(event) {
  1364.  
  1365. Cheat_Menu.item_selection--;
  1366.  
  1367. if (Cheat_Menu.item_selection < 0) {
  1368.  
  1369. Cheat_Menu.item_selection = $dataItems.length - 1;
  1370.  
  1371. }
  1372.  
  1373. Cheat_Menu.update_menu();
  1374.  
  1375. }
  1376.  
  1377.  
  1378.  
  1379. Cheat_Menu.scroll_right_item = function(event) {
  1380.  
  1381. Cheat_Menu.item_selection++;
  1382.  
  1383. if (Cheat_Menu.item_selection >= $dataItems.length) {
  1384.  
  1385. Cheat_Menu.item_selection = 0;
  1386.  
  1387. }
  1388.  
  1389. Cheat_Menu.update_menu();
  1390.  
  1391. }
  1392.  
  1393.  
  1394.  
  1395. Cheat_Menu.give_current_item = function(event) {
  1396.  
  1397. Cheat_Menu.give_item(Cheat_Menu.item_selection, Cheat_Menu.amounts[Cheat_Menu.amount_index]);
  1398.  
  1399. SoundManager.playSystemSound(1);
  1400.  
  1401. Cheat_Menu.update_menu();
  1402.  
  1403. }
  1404.  
  1405.  
  1406.  
  1407. Cheat_Menu.append_item_selection = function(key1, key2, key3) {
  1408.  
  1409. Cheat_Menu.append_title("Item");
  1410.  
  1411. var current_item = "";
  1412.  
  1413. if ($dataItems[Cheat_Menu.item_selection] && $dataItems[Cheat_Menu.item_selection].name && $dataItems[Cheat_Menu.item_selection].name.length > 0) {
  1414.  
  1415. current_item = $dataItems[Cheat_Menu.item_selection].name;
  1416.  
  1417. }
  1418.  
  1419. else {
  1420.  
  1421. current_item = "NULL";
  1422.  
  1423. }
  1424.  
  1425.  
  1426.  
  1427. Cheat_Menu.append_scroll_selector(current_item, key1, key2, Cheat_Menu.scroll_left_item, Cheat_Menu.scroll_right_item);
  1428.  
  1429. var current_item_amount = 0;
  1430.  
  1431. if ($gameParty._items[Cheat_Menu.item_selection] != undefined) {
  1432.  
  1433. current_item_amount = $gameParty._items[Cheat_Menu.item_selection];
  1434.  
  1435. }
  1436.  
  1437. Cheat_Menu.append_cheat("Amount:", current_item_amount, key3, Cheat_Menu.give_current_item);
  1438.  
  1439. }
  1440.  
  1441.  
  1442.  
  1443. Cheat_Menu.scroll_left_weapon = function(event) {
  1444.  
  1445. Cheat_Menu.weapon_selection--;
  1446.  
  1447. if (Cheat_Menu.weapon_selection < 0) {
  1448.  
  1449. Cheat_Menu.weapon_selection = $dataWeapons.length - 1;
  1450.  
  1451. }
  1452.  
  1453. Cheat_Menu.update_menu();
  1454.  
  1455. }
  1456.  
  1457.  
  1458.  
  1459. Cheat_Menu.scroll_right_weapon = function(event) {
  1460.  
  1461. Cheat_Menu.weapon_selection++;
  1462.  
  1463. if (Cheat_Menu.weapon_selection >= $dataWeapons.length) {
  1464.  
  1465. Cheat_Menu.weapon_selection = 0;
  1466.  
  1467. }
  1468.  
  1469. Cheat_Menu.update_menu();
  1470.  
  1471. }
  1472.  
  1473.  
  1474.  
  1475. Cheat_Menu.give_current_weapon = function(event) {
  1476.  
  1477. Cheat_Menu.give_weapon(Cheat_Menu.weapon_selection, Cheat_Menu.amounts[Cheat_Menu.amount_index]);
  1478.  
  1479. SoundManager.playSystemSound(1);
  1480.  
  1481. Cheat_Menu.update_menu();
  1482.  
  1483. }
  1484.  
  1485.  
  1486.  
  1487. Cheat_Menu.append_weapon_selection = function(key1, key2, key3) {
  1488.  
  1489. Cheat_Menu.append_title("Weapon");
  1490.  
  1491. var current_weapon = "";
  1492.  
  1493. if ($dataWeapons[Cheat_Menu.weapon_selection] && $dataWeapons[Cheat_Menu.weapon_selection].name && $dataWeapons[Cheat_Menu.weapon_selection].name.length > 0) {
  1494.  
  1495. current_weapon = $dataWeapons[Cheat_Menu.weapon_selection].name;
  1496.  
  1497. }
  1498.  
  1499. else {
  1500.  
  1501. current_weapon = "NULL";
  1502.  
  1503. }
  1504.  
  1505.  
  1506.  
  1507. Cheat_Menu.append_scroll_selector(current_weapon, key1, key2, Cheat_Menu.scroll_left_weapon, Cheat_Menu.scroll_right_weapon);
  1508.  
  1509. var current_weapon_amount = 0;
  1510.  
  1511. if ($gameParty._weapons[Cheat_Menu.weapon_selection] != undefined) {
  1512.  
  1513. current_weapon_amount = $gameParty._weapons[Cheat_Menu.weapon_selection];
  1514.  
  1515. }
  1516.  
  1517. Cheat_Menu.append_cheat("Amount:", current_weapon_amount, key3, Cheat_Menu.give_current_weapon);
  1518.  
  1519. }
  1520.  
  1521.  
  1522.  
  1523. Cheat_Menu.scroll_left_armor = function(event) {
  1524.  
  1525. Cheat_Menu.armor_selection--;
  1526.  
  1527. if (Cheat_Menu.armor_selection < 0) {
  1528.  
  1529. Cheat_Menu.armor_selection = $dataArmors.length - 1;
  1530.  
  1531. }
  1532.  
  1533. Cheat_Menu.update_menu();
  1534.  
  1535. }
  1536.  
  1537.  
  1538.  
  1539. Cheat_Menu.scroll_right_armor = function(event) {
  1540.  
  1541. Cheat_Menu.armor_selection++;
  1542.  
  1543. if (Cheat_Menu.armor_selection >= $dataArmors.length) {
  1544.  
  1545. Cheat_Menu.armor_selection = 0;
  1546.  
  1547. }
  1548.  
  1549. Cheat_Menu.update_menu();
  1550.  
  1551. }
  1552.  
  1553.  
  1554.  
  1555. Cheat_Menu.give_current_armor = function(event) {
  1556.  
  1557. Cheat_Menu.give_armor(Cheat_Menu.armor_selection, Cheat_Menu.amounts[Cheat_Menu.amount_index]);
  1558.  
  1559. SoundManager.playSystemSound(1);
  1560.  
  1561. Cheat_Menu.update_menu();
  1562.  
  1563. }
  1564.  
  1565.  
  1566.  
  1567. Cheat_Menu.append_armor_selection = function(key1, key2, key3) {
  1568.  
  1569. Cheat_Menu.append_title("Armor");
  1570.  
  1571. var current_armor = "";
  1572.  
  1573. if ($dataArmors[Cheat_Menu.armor_selection] && $dataArmors[Cheat_Menu.armor_selection].name && $dataArmors[Cheat_Menu.armor_selection].name.length > 0) {
  1574.  
  1575. current_armor = $dataArmors[Cheat_Menu.armor_selection].name;
  1576.  
  1577. }
  1578.  
  1579. else {
  1580.  
  1581. current_armor = "NULL";
  1582.  
  1583. }
  1584.  
  1585.  
  1586.  
  1587. Cheat_Menu.append_scroll_selector(current_armor, key1, key2, Cheat_Menu.scroll_left_armor, Cheat_Menu.scroll_right_armor);
  1588.  
  1589. var current_armor_amount = 0;
  1590.  
  1591. if ($gameParty._armors[Cheat_Menu.armor_selection] != undefined) {
  1592.  
  1593. current_armor_amount = $gameParty._armors[Cheat_Menu.armor_selection];
  1594.  
  1595. }
  1596.  
  1597. Cheat_Menu.append_cheat("Amount:", current_armor_amount, key3, Cheat_Menu.give_current_armor);
  1598.  
  1599. }
  1600.  
  1601.  
  1602.  
  1603. Cheat_Menu.clear_current_actor_states = function() {
  1604.  
  1605. Cheat_Menu.clear_actor_states($gameActors._data[Cheat_Menu.cheat_selected_actor]);
  1606.  
  1607. SoundManager.playSystemSound(1);
  1608.  
  1609. Cheat_Menu.update_menu();
  1610.  
  1611. }
  1612.  
  1613.  
  1614.  
  1615. Cheat_Menu.append_current_state = function(key1) {
  1616.  
  1617. Cheat_Menu.append_title("Current State");
  1618.  
  1619. var number_states = 0;
  1620.  
  1621.  
  1622.  
  1623. if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._states && $gameActors._data[Cheat_Menu.cheat_selected_actor]._states.length >= 0) {
  1624.  
  1625. number_states = $gameActors._data[Cheat_Menu.cheat_selected_actor]._states.length;
  1626.  
  1627. }
  1628.  
  1629. else {
  1630.  
  1631. number_states = null;
  1632.  
  1633. }
  1634.  
  1635.  
  1636.  
  1637. Cheat_Menu.append_cheat("Number Effects:", number_states, key1, Cheat_Menu.clear_current_actor_states);
  1638.  
  1639. }
  1640.  
  1641.  
  1642.  
  1643. // update whats being displayed in menu
  1644.  
  1645. Cheat_Menu.update_menu = function() {
  1646.  
  1647. // clear menu
  1648.  
  1649. Cheat_Menu.overlay.innerHTML = "";
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655. // god mode
  1656.  
  1657. if (Cheat_Menu.cheat_selected == 0) {
  1658.  
  1659. Cheat_Menu.append_cheat_title("God Mode");
  1660.  
  1661. Cheat_Menu.append_actor_selection(4, 5);
  1662.  
  1663.  
  1664.  
  1665. Cheat_Menu.append_godmode_status();
  1666.  
  1667. }
  1668.  
  1669. else if (Cheat_Menu.cheat_selected == 1) {
  1670.  
  1671. Cheat_Menu.append_cheat_title("Enemy Health");
  1672.  
  1673.  
  1674.  
  1675. Cheat_Menu.append_enemy_cheats(4, 5);
  1676.  
  1677. }
  1678.  
  1679. else if (Cheat_Menu.cheat_selected == 2) {
  1680.  
  1681. Cheat_Menu.append_cheat_title("No Clip");
  1682.  
  1683.  
  1684.  
  1685. Cheat_Menu.append_no_clip_status(4);
  1686.  
  1687. }
  1688.  
  1689. else if (Cheat_Menu.cheat_selected == 3) {
  1690.  
  1691. Cheat_Menu.append_cheat_title("Give Exp");
  1692.  
  1693. Cheat_Menu.append_actor_selection(4, 5);
  1694.  
  1695. Cheat_Menu.append_amount_selection(6, 7);
  1696.  
  1697. Cheat_Menu.append_class_selection(8, 9, 0);
  1698.  
  1699. }
  1700.  
  1701. else if (Cheat_Menu.cheat_selected == 4) {
  1702.  
  1703. Cheat_Menu.append_cheat_title("Stats");
  1704.  
  1705. Cheat_Menu.append_actor_selection(4, 5);
  1706.  
  1707. Cheat_Menu.append_amount_selection(6, 7);
  1708.  
  1709. Cheat_Menu.append_stat_selection(8, 9, 0);
  1710.  
  1711. }
  1712.  
  1713. else if (Cheat_Menu.cheat_selected == 5) {
  1714.  
  1715. Cheat_Menu.append_cheat_title("Gold");
  1716.  
  1717. Cheat_Menu.append_amount_selection(4, 5);
  1718.  
  1719. Cheat_Menu.append_gold_status(6);
  1720.  
  1721. }
  1722.  
  1723. else if (Cheat_Menu.cheat_selected == 6) {
  1724.  
  1725. Cheat_Menu.append_cheat_title("Items");
  1726.  
  1727. Cheat_Menu.append_amount_selection(4, 5);
  1728.  
  1729. Cheat_Menu.append_item_selection(6, 7, 8);
  1730.  
  1731. }
  1732.  
  1733. else if (Cheat_Menu.cheat_selected == 7) {
  1734.  
  1735. Cheat_Menu.append_cheat_title("Weapons");
  1736.  
  1737. Cheat_Menu.append_amount_selection(4, 5);
  1738.  
  1739. Cheat_Menu.append_weapon_selection(6, 7, 8);
  1740.  
  1741. }
  1742.  
  1743. else if (Cheat_Menu.cheat_selected == 8) {
  1744.  
  1745. Cheat_Menu.append_cheat_title("Armors");
  1746.  
  1747. Cheat_Menu.append_amount_selection(4, 5);
  1748.  
  1749. Cheat_Menu.append_armor_selection(6, 7, 8);
  1750.  
  1751. }
  1752.  
  1753. else if (Cheat_Menu.cheat_selected == 9) {
  1754.  
  1755. Cheat_Menu.append_cheat_title("Speed");
  1756.  
  1757. Cheat_Menu.append_move_amount_selection(4, 5);
  1758.  
  1759. Cheat_Menu.append_speed_status(6);
  1760.  
  1761. }
  1762.  
  1763. else if (Cheat_Menu.cheat_selected == 10) {
  1764.  
  1765. Cheat_Menu.append_cheat_title("Clear States");
  1766.  
  1767. Cheat_Menu.append_actor_selection(4, 5);
  1768.  
  1769. Cheat_Menu.append_current_state(6);
  1770.  
  1771. }
  1772.  
  1773.  
  1774.  
  1775. Cheat_Menu.position_menu();
  1776.  
  1777. };
  1778.  
  1779.  
  1780.  
  1781. // listener to reposition menu
  1782.  
  1783. window.addEventListener("resize", Cheat_Menu.position_menu);
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789. // prevent clicking from passing through
  1790.  
  1791. Cheat_Menu.overlay.addEventListener("mousedown", function(event) {
  1792.  
  1793. event.stopPropagation();
  1794.  
  1795. });
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803. /////////////////////////////////////////////////
  1804.  
  1805. // Cheat Menu Key Listener
  1806.  
  1807. /////////////////////////////////////////////////
  1808.  
  1809.  
  1810.  
  1811. // Key codes
  1812.  
  1813. var KEYCODE_1 = 89; //49; Y
  1814.  
  1815. var KEYCODE_2 = 85; //50; U
  1816.  
  1817. var KEYCODE_3 = 73; //51; I
  1818.  
  1819. var KEYCODE_4 = 75; //52; O
  1820.  
  1821. var KEYCODE_5 = 80; //53; P
  1822.  
  1823. var KEYCODE_6 = 74; //54; J
  1824.  
  1825. var KEYCODE_7 = 75; //55; K
  1826.  
  1827. var KEYCODE_8 = 76; //56; L
  1828.  
  1829. var KEYCODE_9 = 78; //57; N
  1830.  
  1831. var KEYCODE_0 = 77; //48; M
  1832.  
  1833. var KEYCODE_TILDE = 192;
  1834.  
  1835.  
  1836.  
  1837. window.addEventListener("keydown", function(event) {
  1838.  
  1839. if (!event.ctrlKey && !event.altKey && (event.keyCode === 119) && $gameTemp && !$gameTemp.isPlaytest()) {
  1840.  
  1841. // open debug menu
  1842.  
  1843. event.stopPropagation();
  1844.  
  1845. event.preventDefault();
  1846.  
  1847. require('nw.gui').Window.get().showDevTools();
  1848.  
  1849. }
  1850.  
  1851. else if (!event.altKey && !event.ctrlKey && !event.shiftKey && (event.keyCode === 120) && $gameTemp && !$gameTemp.isPlaytest()) {
  1852.  
  1853. // trick the game into thinking its a playtest so it will open the switch/variable debug menu
  1854.  
  1855. $gameTemp._isPlaytest = true;
  1856.  
  1857. setTimeout(function() {
  1858.  
  1859. // back to not being playtest
  1860.  
  1861. $gameTemp._isPlaytest = false;
  1862.  
  1863. }, 100);
  1864.  
  1865. }
  1866.  
  1867. else if (Cheat_Menu.overlay_openable && !event.altKey && !event.ctrlKey && !event.shiftKey) {
  1868.  
  1869. // open and close menu
  1870.  
  1871. if (event.keyCode == KEYCODE_1) {
  1872.  
  1873. if (!Cheat_Menu.initialized) {
  1874.  
  1875. for (var i = 0; i < $gameActors._data.length; i++) {
  1876.  
  1877. if($gameActors._data[i]) {
  1878.  
  1879. $gameActors._data[i].god_mode = false;
  1880.  
  1881. }
  1882.  
  1883. }
  1884.  
  1885.  
  1886.  
  1887. // reset to inital values
  1888.  
  1889. Cheat_Menu.cheat_selected = 0;
  1890.  
  1891. Cheat_Menu.cheat_selected_actor = 1;
  1892.  
  1893. Cheat_Menu.amount_index = 6;
  1894.  
  1895. Cheat_Menu.current_classes = [];
  1896.  
  1897. Cheat_Menu.class_selection = 0;
  1898.  
  1899. Cheat_Menu.stat_selection = 0;
  1900.  
  1901. Cheat_Menu.item_selection = 1;
  1902.  
  1903. Cheat_Menu.weapon_selection = 1;
  1904.  
  1905. Cheat_Menu.armor_selection = 1;
  1906.  
  1907. Cheat_Menu.move_amount_index = 1;
  1908.  
  1909.  
  1910.  
  1911. // only do this once per load or new game
  1912.  
  1913. Cheat_Menu.initialized = true;
  1914.  
  1915. }
  1916.  
  1917.  
  1918.  
  1919. // open menu
  1920.  
  1921. if (!Cheat_Menu.cheat_menu_open) {
  1922.  
  1923. Cheat_Menu.cheat_menu_open = true;
  1924.  
  1925. document.body.appendChild(Cheat_Menu.overlay_box);
  1926.  
  1927. document.body.appendChild(Cheat_Menu.overlay);
  1928.  
  1929. Cheat_Menu.update_menu();
  1930.  
  1931. SoundManager.playSystemSound(1);
  1932.  
  1933. }
  1934.  
  1935. // close menu
  1936.  
  1937. else {
  1938.  
  1939. Cheat_Menu.cheat_menu_open = false;
  1940.  
  1941. Cheat_Menu.overlay_box.remove();
  1942.  
  1943. Cheat_Menu.overlay.remove();
  1944.  
  1945. SoundManager.playSystemSound(2);
  1946.  
  1947. }
  1948.  
  1949. }
  1950.  
  1951.  
  1952.  
  1953. // navigate and activate cheats
  1954.  
  1955. else if (Cheat_Menu.cheat_menu_open) {
  1956.  
  1957. // cycle left cheat
  1958.  
  1959. if (event.keyCode == KEYCODE_2) {
  1960.  
  1961. Cheat_Menu.scroll_left_cheat();
  1962.  
  1963. }
  1964.  
  1965. // cycle right cheat
  1966.  
  1967. else if (event.keyCode == KEYCODE_3 ) {
  1968.  
  1969. Cheat_Menu.scroll_right_cheat();
  1970.  
  1971. }
  1972.  
  1973.  
  1974.  
  1975. // move menu position
  1976.  
  1977. else if (event.keyCode == KEYCODE_TILDE) {
  1978.  
  1979. Cheat_Menu.position++;
  1980.  
  1981. if (Cheat_Menu.position > 4) {
  1982.  
  1983. Cheat_Menu.position = 0;
  1984.  
  1985. }
  1986.  
  1987. Cheat_Menu.update_menu();
  1988.  
  1989. }
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995. // god mode controls
  1996.  
  1997. if (Cheat_Menu.cheat_selected == 0) {
  1998.  
  1999. // cycle left actor selection
  2000.  
  2001. if (event.keyCode == KEYCODE_4) {
  2002.  
  2003. Cheat_Menu.scroll_left_actor();
  2004.  
  2005. }
  2006.  
  2007. // cycle right actor selection
  2008.  
  2009. else if (event.keyCode == KEYCODE_5 ) {
  2010.  
  2011. Cheat_Menu.scroll_right_actor();
  2012.  
  2013. }
  2014.  
  2015. // toggle god mode
  2016.  
  2017. else if (event.keyCode == KEYCODE_6 && $gameActors._data[Cheat_Menu.cheat_selected_actor]) {
  2018.  
  2019. Cheat_Menu.god_mode_toggle();
  2020.  
  2021. }
  2022.  
  2023. }
  2024.  
  2025.  
  2026.  
  2027. // enemy health
  2028.  
  2029. else if (Cheat_Menu.cheat_selected == 1) {
  2030.  
  2031. if (event.keyCode == KEYCODE_4) {
  2032.  
  2033. Cheat_Menu.enemy_hp_cheat_1();
  2034.  
  2035. }
  2036.  
  2037. else if (event.keyCode == KEYCODE_5) {
  2038.  
  2039. Cheat_Menu.enemy_hp_cheat_2();
  2040.  
  2041. }
  2042.  
  2043. }
  2044.  
  2045.  
  2046.  
  2047. // no clip
  2048.  
  2049. else if (Cheat_Menu.cheat_selected == 2) {
  2050.  
  2051. if (event.keyCode == KEYCODE_4) {
  2052.  
  2053. Cheat_Menu.toggle_no_clip_status();
  2054.  
  2055. }
  2056.  
  2057. }
  2058.  
  2059.  
  2060.  
  2061. // give exp
  2062.  
  2063. else if (Cheat_Menu.cheat_selected == 3) {
  2064.  
  2065. // cycle left actor selection
  2066.  
  2067. if (event.keyCode == KEYCODE_4) {
  2068.  
  2069. Cheat_Menu.scroll_left_actor();
  2070.  
  2071. }
  2072.  
  2073. // cycle right actor selection
  2074.  
  2075. else if (event.keyCode == KEYCODE_5 ) {
  2076.  
  2077. Cheat_Menu.scroll_right_actor();
  2078.  
  2079. }
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085. // cycle left amount
  2086.  
  2087. else if (event.keyCode == KEYCODE_6) {
  2088.  
  2089. Cheat_Menu.move_left_amount();
  2090.  
  2091. }
  2092.  
  2093. // cycle right amount
  2094.  
  2095. else if (event.keyCode == KEYCODE_7) {
  2096.  
  2097. Cheat_Menu.move_right_amount();
  2098.  
  2099. }
  2100.  
  2101.  
  2102.  
  2103. else if (Cheat_Menu.current_classes.length > 0) {
  2104.  
  2105. // cycle left class
  2106.  
  2107. if (event.keyCode == KEYCODE_8) {
  2108.  
  2109. Cheat_Menu.scroll_left_class();
  2110.  
  2111. }
  2112.  
  2113. // cycle right class
  2114.  
  2115. else if (event.keyCode == KEYCODE_9) {
  2116.  
  2117. Cheat_Menu.scroll_right_class();
  2118.  
  2119. }
  2120.  
  2121.  
  2122.  
  2123. // edit exp
  2124.  
  2125. else if (event.keyCode == KEYCODE_0) {
  2126.  
  2127. Cheat_Menu.give_current_exp();
  2128.  
  2129. }
  2130.  
  2131. }
  2132.  
  2133.  
  2134.  
  2135. }
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141. // edit stats
  2142.  
  2143. else if (Cheat_Menu.cheat_selected == 4) {
  2144.  
  2145. // cycle left actor selection
  2146.  
  2147. if (event.keyCode == KEYCODE_4) {
  2148.  
  2149. Cheat_Menu.scroll_left_actor();
  2150.  
  2151. }
  2152.  
  2153. // cycle right actor selection
  2154.  
  2155. else if (event.keyCode == KEYCODE_5 ) {
  2156.  
  2157. Cheat_Menu.scroll_right_actor();
  2158.  
  2159. }
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165. // cycle left amount
  2166.  
  2167. else if (event.keyCode == KEYCODE_6) {
  2168.  
  2169. Cheat_Menu.move_left_amount();
  2170.  
  2171. }
  2172.  
  2173. // cycle right amount
  2174.  
  2175. else if (event.keyCode == KEYCODE_7) {
  2176.  
  2177. Cheat_Menu.move_right_amount();
  2178.  
  2179. }
  2180.  
  2181.  
  2182.  
  2183. else if ($gameActors._data[Cheat_Menu.cheat_selected_actor] && $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus && $gameActors._data[Cheat_Menu.cheat_selected_actor]._paramPlus.length > 0) {
  2184.  
  2185. // cycle left stat
  2186.  
  2187. if (event.keyCode == KEYCODE_8) {
  2188.  
  2189. Cheat_Menu.scroll_left_stat();
  2190.  
  2191. }
  2192.  
  2193. // cycle right stat
  2194.  
  2195. else if (event.keyCode == KEYCODE_9) {
  2196.  
  2197. Cheat_Menu.scroll_right_stat();
  2198.  
  2199. }
  2200.  
  2201.  
  2202.  
  2203. // edit stat
  2204.  
  2205. else if (event.keyCode == KEYCODE_0) {
  2206.  
  2207. Cheat_Menu.give_current_stat();
  2208.  
  2209. }
  2210.  
  2211. }
  2212.  
  2213.  
  2214.  
  2215. }
  2216.  
  2217.  
  2218.  
  2219. // edit gold
  2220.  
  2221. else if (Cheat_Menu.cheat_selected == 5) {
  2222.  
  2223. if (event.keyCode == KEYCODE_4) {
  2224.  
  2225. Cheat_Menu.move_left_amount();
  2226.  
  2227. }
  2228.  
  2229. // cycle right amount
  2230.  
  2231. else if (event.keyCode == KEYCODE_5) {
  2232.  
  2233. Cheat_Menu.move_right_amount();
  2234.  
  2235. }
  2236.  
  2237.  
  2238.  
  2239. // edit gold
  2240.  
  2241. else if (event.keyCode == KEYCODE_6) {
  2242.  
  2243. Cheat_Menu.give_current_gold();
  2244.  
  2245. }
  2246.  
  2247. }
  2248.  
  2249.  
  2250.  
  2251. // edit items
  2252.  
  2253. else if (Cheat_Menu.cheat_selected == 6) {
  2254.  
  2255. if (event.keyCode == KEYCODE_4) {
  2256.  
  2257. Cheat_Menu.move_left_amount();
  2258.  
  2259. }
  2260.  
  2261. // cycle right amount
  2262.  
  2263. else if (event.keyCode == KEYCODE_5) {
  2264.  
  2265. Cheat_Menu.move_right_amount();
  2266.  
  2267. }
  2268.  
  2269.  
  2270.  
  2271. // select items
  2272.  
  2273. else if (event.keyCode == KEYCODE_6) {
  2274.  
  2275. Cheat_Menu.scroll_left_item();
  2276.  
  2277. }
  2278.  
  2279. else if (event.keyCode == KEYCODE_7) {
  2280.  
  2281. Cheat_Menu.scroll_right_item();
  2282.  
  2283. }
  2284.  
  2285.  
  2286.  
  2287. // edit items
  2288.  
  2289. else if (event.keyCode == KEYCODE_8) {
  2290.  
  2291. Cheat_Menu.give_current_item();
  2292.  
  2293. }
  2294.  
  2295.  
  2296.  
  2297. }
  2298.  
  2299.  
  2300.  
  2301. // edit weapons
  2302.  
  2303. else if (Cheat_Menu.cheat_selected == 7) {
  2304.  
  2305. if (event.keyCode == KEYCODE_4) {
  2306.  
  2307. Cheat_Menu.move_left_amount();
  2308.  
  2309. }
  2310.  
  2311. // cycle right amount
  2312.  
  2313. else if (event.keyCode == KEYCODE_5) {
  2314.  
  2315. Cheat_Menu.move_right_amount();
  2316.  
  2317. }
  2318.  
  2319.  
  2320.  
  2321. // select weapons
  2322.  
  2323. else if (event.keyCode == KEYCODE_6) {
  2324.  
  2325. Cheat_Menu.scroll_left_weapon();
  2326.  
  2327. }
  2328.  
  2329. else if (event.keyCode == KEYCODE_7) {
  2330.  
  2331. Cheat_Menu.scroll_right_weapon();
  2332.  
  2333. }
  2334.  
  2335.  
  2336.  
  2337. // edit items
  2338.  
  2339. else if (event.keyCode == KEYCODE_8) {
  2340.  
  2341. Cheat_Menu.give_current_weapon();
  2342.  
  2343. }
  2344.  
  2345.  
  2346.  
  2347. }
  2348.  
  2349.  
  2350.  
  2351. // edit armors
  2352.  
  2353. else if (Cheat_Menu.cheat_selected == 8) {
  2354.  
  2355. if (event.keyCode == KEYCODE_4) {
  2356.  
  2357. Cheat_Menu.move_left_amount();
  2358.  
  2359. }
  2360.  
  2361. // cycle right amount
  2362.  
  2363. else if (event.keyCode == KEYCODE_5) {
  2364.  
  2365. Cheat_Menu.move_right_amount();
  2366.  
  2367. }
  2368.  
  2369.  
  2370.  
  2371. // select armor
  2372.  
  2373. else if (event.keyCode == KEYCODE_6) {
  2374.  
  2375. Cheat_Menu.scroll_left_armor();
  2376.  
  2377. }
  2378.  
  2379. else if (event.keyCode == KEYCODE_7) {
  2380.  
  2381. Cheat_Menu.scroll_right_armor();
  2382.  
  2383. }
  2384.  
  2385.  
  2386.  
  2387. // edit items
  2388.  
  2389. else if (event.keyCode == KEYCODE_8) {
  2390.  
  2391. Cheat_Menu.give_current_armor();
  2392.  
  2393. }
  2394.  
  2395.  
  2396.  
  2397. }
  2398.  
  2399.  
  2400.  
  2401. // change movement speed
  2402.  
  2403. else if (Cheat_Menu.cheat_selected == 9) {
  2404.  
  2405. if (event.keyCode == KEYCODE_4) {
  2406.  
  2407. Cheat_Menu.move_left_move_amount();
  2408.  
  2409. }
  2410.  
  2411. // cycle right amount
  2412.  
  2413. else if (event.keyCode == KEYCODE_5) {
  2414.  
  2415. Cheat_Menu.move_right_move_amount();
  2416.  
  2417. }
  2418.  
  2419.  
  2420.  
  2421. // change speed
  2422.  
  2423. else if (event.keyCode == KEYCODE_6) {
  2424.  
  2425. Cheat_Menu.update_speed();
  2426.  
  2427. }
  2428.  
  2429.  
  2430.  
  2431. }
  2432.  
  2433.  
  2434.  
  2435. // clear status effects
  2436.  
  2437. else if (Cheat_Menu.cheat_selected == 10) {
  2438.  
  2439. if (event.keyCode == KEYCODE_4) {
  2440.  
  2441. Cheat_Menu.scroll_left_actor();
  2442.  
  2443. }
  2444.  
  2445. // cycle right amount
  2446.  
  2447. else if (event.keyCode == KEYCODE_5) {
  2448.  
  2449. Cheat_Menu.scroll_right_actor();
  2450.  
  2451. }
  2452.  
  2453.  
  2454.  
  2455. // change speed
  2456.  
  2457. else if (event.keyCode == KEYCODE_6) {
  2458.  
  2459. Cheat_Menu.clear_current_actor_states();
  2460.  
  2461. }
  2462.  
  2463.  
  2464.  
  2465. }
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471. }
  2472.  
  2473. }
  2474.  
  2475. });
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483. /////////////////////////////////////////////////
  2484.  
  2485. // Load Hook
  2486.  
  2487. /////////////////////////////////////////////////
  2488.  
  2489.  
  2490.  
  2491. Cheat_Menu.initialize = function() {
  2492.  
  2493. Cheat_Menu.overlay_openable = true;
  2494.  
  2495. Cheat_Menu.initialized = false;
  2496.  
  2497. Cheat_Menu.cheat_menu_open = false;
  2498.  
  2499. Cheat_Menu.overlay_box.remove();
  2500.  
  2501. Cheat_Menu.overlay.remove();
  2502.  
  2503.  
  2504.  
  2505. // periodic update
  2506.  
  2507. clearInterval(Cheat_Menu.menu_update_timer);
  2508.  
  2509. Cheat_Menu.menu_update_timer = setInterval(function() {
  2510.  
  2511. if (Cheat_Menu.cheat_menu_open) {
  2512.  
  2513. Cheat_Menu.update_menu();
  2514.  
  2515. }
  2516.  
  2517. }, 1000);
  2518.  
  2519. }
  2520.  
  2521.  
  2522.  
  2523. DataManager.default_loadGame = DataManager.loadGame;
  2524.  
  2525. DataManager.loadGame = function(savefileId) {
  2526.  
  2527. Cheat_Menu.initialize();
  2528.  
  2529.  
  2530.  
  2531. return DataManager.default_loadGame(savefileId);
  2532.  
  2533. };
  2534.  
  2535.  
  2536.  
  2537. DataManager.default_setupNewGame = DataManager.setupNewGame;
  2538.  
  2539. DataManager.setupNewGame = function() {
  2540.  
  2541. Cheat_Menu.initialize();
  2542.  
  2543.  
  2544.  
  2545. DataManager.default_setupNewGame();
  2546.  
  2547. }
  2548.  
  2549.  
  2550.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement