From 055e441e1b650cdeb40957f2615adc5230c4a669 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 5 Feb 2026 21:15:53 -0500 Subject: [PATCH] Lowered break chance for items. --- src/constants.nvgt | 6 +++--- src/save_system.nvgt | 2 +- src/time_system.nvgt | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/constants.nvgt b/src/constants.nvgt index b762017..c4de350 100644 --- a/src/constants.nvgt +++ b/src/constants.nvgt @@ -204,9 +204,9 @@ const int RESIDENT_SNARE_CHECK_CHANCE = 15; // 15% chance per hour to check sna const int RESIDENT_FISHING_CHANCE = 6; // 6% chance per resident per hour to catch a fish const int RESIDENT_SMOKE_FISH_CHANCE = 10; // 10% chance per hour to smoke a stored fish const int RESIDENT_TOOL_BREAK_CHANCE = 2; // 2% chance tools break during resident use (fishing poles, knives, baskets) -const int PLAYER_ITEM_BREAK_CHANCE_MIN = 1; -const int PLAYER_ITEM_BREAK_CHANCE_MAX = 100; -const int PLAYER_ITEM_BREAK_CHANCE_INCREMENT = 1; +const float PLAYER_ITEM_BREAK_CHANCE_MIN = 1.0; +const float PLAYER_ITEM_BREAK_CHANCE_MAX = 100.0; +const float PLAYER_ITEM_BREAK_CHANCE_INCREMENT = 0.1; const int PLAYER_ITEM_BREAKS_PER_DAY = 2; // Goose settings diff --git a/src/save_system.nvgt b/src/save_system.nvgt index 402172e..3b50ab5 100644 --- a/src/save_system.nvgt +++ b/src/save_system.nvgt @@ -1300,7 +1300,7 @@ 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)); + playerItemBreakChance = float(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)); diff --git a/src/time_system.nvgt b/src/time_system.nvgt index 5e6e78e..32045f4 100644 --- a/src/time_system.nvgt +++ b/src/time_system.nvgt @@ -12,7 +12,7 @@ bool is_daytime = true; bool sun_setting_warned = false; bool sunrise_warned = false; -int playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN; +float playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN; int playerItemBreaksToday = 0; bool playerItemBreakPending = false; int playerItemBreakPendingType = -1; @@ -124,7 +124,8 @@ void attempt_player_item_break_check() { if (breakableItems.length() == 0) return; int roll = random(1, 100); - if (roll <= playerItemBreakChance) { + int checkChance = int(playerItemBreakChance); // Floor for comparison + if (roll <= checkChance) { int pickIndex = random(0, int(breakableItems.length()) - 1); int itemType = breakableItems[pickIndex]; playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;