From 78ede43eb108868c986aadbb373b9bdd1caa370c Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Sun, 2 Apr 2023 19:19:26 +0100 Subject: [PATCH] less wave rng for small crews --- maps/pirates/ai.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index 3af104a3..a41301c5 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -133,6 +133,8 @@ function Public.wave_size_rng() -- random variance in attack sizes local memory = Memory.get_crew_memory() local destination = Common.current_destination() + local rng_scale = Common.crew_scale()^(1/4) -- slightly dampen wave variance for small crews as they can't handle it + -- prevent situation where when player reveals spawner, he immediately gets surrounded by massive amount of biters (especially late game) if destination and destination.type == SurfacesCommon.enum.ISLAND then if destination.dynamic_data and destination.dynamic_data.disabled_wave_timer and destination.dynamic_data.disabled_wave_timer > 0 then @@ -144,17 +146,18 @@ function Public.wave_size_rng() -- random variance in attack sizes local wave_size_multiplier = 1 local rng1 = Math.random(100) + if rng1 > wave_percentage_chance then wave_size_multiplier = 0 elseif memory.overworldx > 0 then local rng2 = Math.random(1000) - if rng2 <= 890 then + if rng2 >= 110 * rng_scale then wave_size_multiplier = 1 - elseif rng2 <= 970 then + elseif rng2 >= 30 * rng_scale then wave_size_multiplier = 1.5 - elseif rng2 <= 985 then + elseif rng2 >= 15 * rng_scale then wave_size_multiplier = 2 - elseif rng2 <= 995 then + elseif rng2 >= 5 * rng_scale then wave_size_multiplier = 3 else wave_size_multiplier = 4