From dd4f5491a18b3a1aec0387e4be405481adb5bce8 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Thu, 2 Jun 2022 13:34:22 +0100 Subject: [PATCH] wave _frequency_ now depends on pollution --- maps/pirates/ai.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maps/pirates/ai.lua b/maps/pirates/ai.lua index a376f650..865c9603 100644 --- a/maps/pirates/ai.lua +++ b/maps/pirates/ai.lua @@ -127,10 +127,14 @@ function Public.eat_up_fraction_of_all_pollution(surface, fraction_of_global_pol end function Public.wave_size_rng() -- random variance in attack sizes + local memory = Memory.get_crew_memory() + + local wave_percentage_chance = Math.clamp(0, 70, 20 + 10 * memory.floating_pollution/1400) --trying this out + local wave_size_multiplier = 1 local memory = Memory.get_crew_memory() local rng1 = Math.random(100) - if rng1 <= 68 then + if rng1 > wave_percentage_chance then wave_size_multiplier = 0 elseif memory.overworldx > 0 then local rng2 = Math.random(1000)