Skip to content
Permalink
Browse files

Can lock speed to cheat menu value

Also added sleep event toggle for Cursed Armor plugin
  • Loading branch information...
emerladCoder committed Nov 18, 2017
1 parent ac03988 commit 7c30fc779e8cbde6692c64216a3943d1d20dcc59
@@ -30,6 +30,10 @@ Cheat_Menu.saved_positions = [{m: -1, x: -1, y: -1}, {m: -1, x: -1, y: -1}, {m:

Cheat_Menu.teleport_location = {m: 1, x: 0, y: 0};

Cheat_Menu.speed = null;
Cheat_Menu.speed_unlocked = true;
Cheat_Menu.speed_initialized = false;


/////////////////////////////////////////////////
// Initial values for reseting on new game/load
@@ -56,6 +60,9 @@ Cheat_Menu.initial_values.variable_selection = 1;
Cheat_Menu.initial_values.switch_selection = 1;
Cheat_Menu.initial_values.saved_positions = [{m: -1, x: -1, y: -1}, {m: -1, x: -1, y: -1}, {m: -1, x: -1, y: -1}];
Cheat_Menu.initial_values.teleport_location = {m: 1, x: 0, y: 0};
Cheat_Menu.initial_values.speed = null;
Cheat_Menu.initial_values.speed_unlocked = true;
Cheat_Menu.initial_values.speed_initialized = false;

/////////////////////////////////////////////////
// Cheat Functions
@@ -217,11 +224,31 @@ Cheat_Menu.give_armor = function(armor_id, amount) {
}
};

// initialize speed hook for locking
Cheat_Menu.initialize_speed_lock = function() {
if (!Cheat_Menu.speed_initialized) {
Cheat_Menu.speed = $gamePlayer._moveSpeed;
Object.defineProperty($gamePlayer, "_moveSpeed", {
get: function() {return Cheat_Menu.speed;},
set: function(newVal) {if(Cheat_Menu.speed_unlocked) {Cheat_Menu.speed = newVal;}}
});
Cheat_Menu.speed_initialized = true;
}
};

// change player movement speed
Cheat_Menu.change_player_speed = function(amount) {
$gamePlayer._moveSpeed += amount;
Cheat_Menu.initialize_speed_lock();
Cheat_Menu.speed += amount;
};

// toggle locking of player speed
Cheat_Menu.toggle_lock_player_speed = function(amount) {
Cheat_Menu.initialize_speed_lock();
Cheat_Menu.speed_unlocked = !Cheat_Menu.speed_unlocked;
};


// clear active states on an actor
Cheat_Menu.clear_actor_states = function(actor) {
if (actor instanceof Game_Actor) {
@@ -816,10 +843,29 @@ Cheat_Menu.apply_speed_change = function(direction, event) {
Cheat_Menu.update_menu();
};

Cheat_Menu.apply_speed_lock_toggle = function() {
Cheat_Menu.toggle_lock_player_speed();
if (Cheat_Menu.speed_unlocked) {
SoundManager.playSystemSound(2);
}
else {
SoundManager.playSystemSound(1);
}
Cheat_Menu.update_menu();
};

// append the movement speed to the menu
Cheat_Menu.append_speed_status = function(key1, key2) {
Cheat_Menu.append_speed_status = function(key1, key2, key3) {
Cheat_Menu.append_title("Current Speed");
Cheat_Menu.append_scroll_selector($gamePlayer._moveSpeed, key1, key2, Cheat_Menu.apply_speed_change);
var status_text;
if (!Cheat_Menu.speed_unlocked) {
status_text = "<font color='#00ff00'>false</font>";
}
else {
status_text = "<font color='#ff0000'>true</font>";
}
Cheat_Menu.append_cheat("Speed Unlocked", status_text, key3, Cheat_Menu.apply_speed_lock_toggle);
};

// Left and right scrollers for handling switching between items selected
@@ -1292,7 +1338,7 @@ Cheat_Menu.menus.splice(0, 0, function() {
Cheat_Menu.menus.splice(0, 0, function() {
Cheat_Menu.append_cheat_title("Speed");
Cheat_Menu.append_move_amount_selection(4, 5);
Cheat_Menu.append_speed_status(6, 7);
Cheat_Menu.append_speed_status(6, 7, 8);
});

Cheat_Menu.menus.splice(0, 0, function() {
@@ -84,6 +84,11 @@ Cheat_Menu.client_stamina_down = function() {
$we._enemyHP -= Math.floor($we._enemyMaxHP / 10);
}

// Activate Sleep Event
Cheat_Menu.wolf_sleep_event = function() {
$gameTemp.reserveCommonEvent(12);
}


/////////////////////////////////////////////////////////////
// Various functions to settup each page of the cheat menu
@@ -243,11 +248,13 @@ Cheat_Menu.append_wolf_stat_2_selection = function(key1, key2, key3, key4) {

// Here I create function to append each cheat for the 3rd menu
// these are for an ingame minigame
Cheat_Menu.append_minigame_cheats = function(key1, key2, key3, key4) {
Cheat_Menu.append_minigame_cheats = function(key1, key2, key3, key4, key5) {
Cheat_Menu.append_cheat("Player Feel Down", "Activate", key1, Cheat_Menu.player_feel_down);
Cheat_Menu.append_cheat("Player Stamina Full", "Activate", key2, Cheat_Menu.player_stamina_full);
Cheat_Menu.append_cheat("Client Feel Up", "Activate", key3, Cheat_Menu.client_feel_up);
Cheat_Menu.append_cheat("Client Stamina Down", "Activate", key4, Cheat_Menu.client_stamina_down);
Cheat_Menu.append_title("Misc Cheats");
Cheat_Menu.append_cheat("Sleep Event", "Activate", key5, Cheat_Menu.wolf_sleep_event);
}

//////////////////////////////////////////////////////////////////////////////////
@@ -290,7 +297,7 @@ Cheat_Menu.menus[Cheat_Menu.menus.length] = function() {

Cheat_Menu.menus[Cheat_Menu.menus.length] = function() {
Cheat_Menu.append_cheat_title("Cursed Minigame Cheats");
Cheat_Menu.append_minigame_cheats(4, 5, 6, 7);
Cheat_Menu.append_minigame_cheats(4, 5, 6, 7, 8);
};

// Misc

0 comments on commit 7c30fc7

Please sign in to comment.
You can’t perform that action at this time.