From e1928a10399612463bf4e71d55c2e55bec294c77 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 1 Feb 2026 12:35:02 -0500 Subject: [PATCH] Breaking items for residents and basket collection improved. Time for catching fish adjusted. --- src/constants.nvgt | 2 +- src/enemies/undead.nvgt | 4 ++++ src/fishing.nvgt | 9 +++++---- src/fylgja_system.nvgt | 4 +++- src/player.nvgt | 2 +- src/time_system.nvgt | 15 +++++++++++++++ 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/constants.nvgt b/src/constants.nvgt index f3a99b0..7e2482d 100644 --- a/src/constants.nvgt +++ b/src/constants.nvgt @@ -184,7 +184,7 @@ const int RESIDENT_SNARE_ESCAPE_CHANCE = 5; // 5% chance game escapes when resi const int RESIDENT_SNARE_CHECK_CHANCE = 15; // 15% chance per hour to check snares 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 = 5; // 5% chance tools break during resident use (fishing poles, knives, baskets) +const int RESIDENT_TOOL_BREAK_CHANCE = 2; // 2% chance tools break during resident use (fishing poles, knives, baskets) // Goose settings const int GOOSE_HEALTH = 1; diff --git a/src/enemies/undead.nvgt b/src/enemies/undead.nvgt index b5e67f2..141130c 100644 --- a/src/enemies/undead.nvgt +++ b/src/enemies/undead.nvgt @@ -122,6 +122,10 @@ bool can_undead_attack_player(Undead@ undead) { return false; } + if (fylgjaCharging) { + return false; + } + if (abs(undead.position - x) > 1) { return false; } diff --git a/src/fishing.nvgt b/src/fishing.nvgt index f7480fd..dc29803 100644 --- a/src/fishing.nvgt +++ b/src/fishing.nvgt @@ -1,8 +1,9 @@ // Fishing system const int FISHING_NEAR_STREAM_RANGE = 2; const int FISHING_CAST_MOVE_MS = 300; -const int FISHING_CATCH_CHANCE_STEP = 15; -const int FISHING_CATCH_CHANCE_MAX = 85; +const int FISHING_CATCH_CHANCE_START = 5; +const int FISHING_CATCH_CHANCE_STEP = 1; +const int FISHING_CATCH_CHANCE_MAX = 95; const int FISHING_BAD_CAST_BREAK_CHANCE = 40; const int FISHING_EARLY_ESCAPE_CHANCE = 50; const int FISHING_LATE_ESCAPE_CHANCE = 50; @@ -226,12 +227,12 @@ void release_cast() { void update_waiting_for_fish() { if (!line_in_water) return; - const int check_interval = 30000; + const int check_interval = 1000; int checks_ready = fishing_timer.elapsed / check_interval; while (fishing_checks_done < checks_ready) { fishing_checks_done++; - catch_chance += FISHING_CATCH_CHANCE_STEP; + catch_chance = FISHING_CATCH_CHANCE_START + (fishing_checks_done - 1) * FISHING_CATCH_CHANCE_STEP; if (catch_chance > FISHING_CATCH_CHANCE_MAX) catch_chance = FISHING_CATCH_CHANCE_MAX; if (catch_chance > 0 && random(1, 100) <= catch_chance) { diff --git a/src/fylgja_system.nvgt b/src/fylgja_system.nvgt index bcdf095..46ef9ab 100644 --- a/src/fylgja_system.nvgt +++ b/src/fylgja_system.nvgt @@ -288,7 +288,9 @@ void update_fylgja_charge() { y = targetElevation; if (targetElevation < previousY) { int fallHeight = previousY - targetElevation; - apply_falling_damage(fallHeight); + if (fallHeight > SAFE_FALL_HEIGHT) { + apply_falling_damage(fallHeight); + } } } diff --git a/src/player.nvgt b/src/player.nvgt index 7e7ff85..39cb93c 100644 --- a/src/player.nvgt +++ b/src/player.nvgt @@ -67,7 +67,7 @@ int target_stream_start = -1; // Start of target stream for casting int target_stream_end = -1; // End of target stream for casting timer fishing_timer; // Tracks time line has been in water timer cast_move_timer; // Controls discrete position movement (150ms per tile) -int catch_chance = 0; // Current catch percentage (starts 0, +15% per minute, max 85%) +int catch_chance = 0; // Current catch percentage (starts 5% after 1s, +1% per second, max 95%) int cast_sound_handle = -1; // Handle for cast_strength.ogg string hooked_fish_type = ""; // Type of fish on the line int fishing_checks_done = 0; // Number of catch checks performed while waiting diff --git a/src/time_system.nvgt b/src/time_system.nvgt index 6998d4e..7dd17da 100644 --- a/src/time_system.nvgt +++ b/src/time_system.nvgt @@ -438,6 +438,19 @@ void attempt_blessing() { } } +bool should_attempt_resident_foraging(int hour) { + int residentCount = residents_count; + if (residentCount <= 0) return false; + + if (hour == 6) return true; + if (residentCount == 1) return false; + if (residentCount == 2) return hour == 12; + if (residentCount == 3) return hour == 12 || hour == 18; + + // 4+ residents: spread across daytime hours + return hour == 10 || hour == 14 || hour == 18; +} + void update_time() { if (hour_timer.elapsed >= MS_PER_HOUR) { hour_timer.restart(); @@ -507,6 +520,8 @@ void update_time() { process_daily_weapon_breakage(); attempt_daily_quest(); attempt_resident_butchering(); + } + if (should_attempt_resident_foraging(current_hour)) { attempt_resident_foraging(); } attempt_daily_invasion();