Item breaking now happens for players too. Bandit adventured tweaked a bit. Rune of destruction added. Can be put anywhere only affective on weapons.
This commit is contained in:
@@ -625,6 +625,13 @@ void reset_game_state() {
|
||||
invasion_scheduled_hour = -1;
|
||||
quest_roll_done_today = false;
|
||||
quest_queue.resize(0);
|
||||
playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
playerItemBreaksToday = 0;
|
||||
playerItemBreakPending = false;
|
||||
playerItemBreakPendingType = -1;
|
||||
playerItemBreakMessage = "";
|
||||
playerItemBreakSoundHandle = -1;
|
||||
playerItemBreakSoundPending = false;
|
||||
|
||||
walktimer.restart();
|
||||
jumptimer.restart();
|
||||
@@ -823,6 +830,7 @@ bool save_game_state() {
|
||||
|
||||
// Rune system data
|
||||
saveData.set("rune_swiftness_unlocked", rune_swiftness_unlocked);
|
||||
saveData.set("rune_destruction_unlocked", rune_destruction_unlocked);
|
||||
saveData.set("unicorn_boss_defeated", unicorn_boss_defeated);
|
||||
saveData.set("equipped_head_rune", equipped_head_rune);
|
||||
saveData.set("equipped_torso_rune", equipped_torso_rune);
|
||||
@@ -869,6 +877,10 @@ bool save_game_state() {
|
||||
saveData.set("time_invasion_roll_done_today", invasion_roll_done_today);
|
||||
saveData.set("time_invasion_scheduled_hour", invasion_scheduled_hour);
|
||||
saveData.set("time_invasion_enemy_type", invasion_enemy_type);
|
||||
saveData.set("player_item_break_chance", playerItemBreakChance);
|
||||
saveData.set("player_item_breaks_today", playerItemBreaksToday);
|
||||
saveData.set("player_item_break_pending", playerItemBreakPending);
|
||||
saveData.set("player_item_break_pending_type", playerItemBreakPendingType);
|
||||
saveData.set("quest_roll_done_today", quest_roll_done_today);
|
||||
saveData.set("wight_spawn_chance", wight_spawn_chance);
|
||||
saveData.set("wight_spawned_this_night", wight_spawned_this_night);
|
||||
@@ -1186,6 +1198,7 @@ bool load_game_state_from_file(const string&in filename) {
|
||||
|
||||
// Load rune system data
|
||||
rune_swiftness_unlocked = get_bool(saveData, "rune_swiftness_unlocked", false);
|
||||
rune_destruction_unlocked = get_bool(saveData, "rune_destruction_unlocked", false);
|
||||
unicorn_boss_defeated = get_bool(saveData, "unicorn_boss_defeated", false);
|
||||
equipped_head_rune = int(get_number(saveData, "equipped_head_rune", RUNE_NONE));
|
||||
equipped_torso_rune = int(get_number(saveData, "equipped_torso_rune", RUNE_NONE));
|
||||
@@ -1287,6 +1300,31 @@ bool load_game_state_from_file(const string&in filename) {
|
||||
if (invasion_chance > 100) invasion_chance = 100;
|
||||
if (invasion_scheduled_hour < -1) invasion_scheduled_hour = -1;
|
||||
if (invasion_scheduled_hour > 23) invasion_scheduled_hour = -1;
|
||||
playerItemBreakChance = int(get_number(saveData, "player_item_break_chance", PLAYER_ITEM_BREAK_CHANCE_MIN));
|
||||
playerItemBreaksToday = int(get_number(saveData, "player_item_breaks_today", 0));
|
||||
playerItemBreakPending = get_bool(saveData, "player_item_break_pending", false);
|
||||
playerItemBreakPendingType = int(get_number(saveData, "player_item_break_pending_type", -1));
|
||||
if (playerItemBreakChance < PLAYER_ITEM_BREAK_CHANCE_MIN) {
|
||||
playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
}
|
||||
if (playerItemBreakChance > PLAYER_ITEM_BREAK_CHANCE_MAX) {
|
||||
playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MAX;
|
||||
}
|
||||
if (playerItemBreaksToday < 0) playerItemBreaksToday = 0;
|
||||
if (playerItemBreaksToday > PLAYER_ITEM_BREAKS_PER_DAY) {
|
||||
playerItemBreaksToday = PLAYER_ITEM_BREAKS_PER_DAY;
|
||||
}
|
||||
if (playerItemBreakPending) {
|
||||
bool validPending = (playerItemBreakPendingType >= 0 && playerItemBreakPendingType < ITEM_COUNT)
|
||||
|| is_runed_item_type(playerItemBreakPendingType);
|
||||
if (!validPending) {
|
||||
playerItemBreakPending = false;
|
||||
playerItemBreakPendingType = -1;
|
||||
}
|
||||
} else {
|
||||
playerItemBreakPendingType = -1;
|
||||
}
|
||||
reset_player_item_break_audio_state();
|
||||
quest_roll_done_today = get_bool(saveData, "quest_roll_done_today", false);
|
||||
wight_spawn_chance = int(get_number(saveData, "wight_spawn_chance", WIGHT_SPAWN_CHANCE_START));
|
||||
wight_spawned_this_night = get_bool(saveData, "wight_spawned_this_night", false);
|
||||
|
||||
Reference in New Issue
Block a user