From 58bd340017f16b70fedbafc41d5732a1d6fed4f5 Mon Sep 17 00:00:00 2001 From: MichaelCourtney Date: Mon, 26 Jun 2023 17:33:40 +1000 Subject: [PATCH] Tweak movement AI for krakens and Juggernauts --- .../monster/SH_JUGGERNAUT_1_BODY.focs.txt | 1 + .../monster/SH_JUGGERNAUT_2_BODY.focs.txt | 1 + .../monster/SH_KRAKEN_1_BODY.focs.txt | 1 + .../monster/SH_KRAKEN_2_BODY.focs.txt | 1 + .../ship_hulls/monster/monster.macros | 34 +++++++++++++++++++ 5 files changed, 38 insertions(+) diff --git a/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_1_BODY.focs.txt b/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_1_BODY.focs.txt index fb9969266fd..39a5e0b21b9 100644 --- a/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_1_BODY.focs.txt +++ b/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_1_BODY.focs.txt @@ -43,6 +43,7 @@ Hull stackinggroup = "GAME_START_MOD_STACK" effects = AddSpecial name = "JUGGERNAUT_NEST_SPECIAL" + [[HUNT_PLANET_TYPE(Asteroids,0.5)]] [[MONSTER_MOVE_ALWAYS]] [[INFINITE_FUEL]] [[ADD_HULL_FUEL_TO_MAX_FUEL_METER]] diff --git a/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_2_BODY.focs.txt b/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_2_BODY.focs.txt index 0565790118d..a0b8854e8ac 100644 --- a/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_2_BODY.focs.txt +++ b/default/scripting/ship_hulls/monster/SH_JUGGERNAUT_2_BODY.focs.txt @@ -19,6 +19,7 @@ Hull tags = [ "PEDIA_HULL_MONSTER_JUGGERNAUT" ] location = All effectsgroups = [ + [[HUNT_PLANET_TYPE(Asteroids,0.3)]] [[MONSTER_MOVE_ALWAYS]] [[INFINITE_FUEL]] [[ADD_HULL_FUEL_TO_MAX_FUEL_METER]] diff --git a/default/scripting/ship_hulls/monster/SH_KRAKEN_1_BODY.focs.txt b/default/scripting/ship_hulls/monster/SH_KRAKEN_1_BODY.focs.txt index abfee61d60f..db589c9e05a 100644 --- a/default/scripting/ship_hulls/monster/SH_KRAKEN_1_BODY.focs.txt +++ b/default/scripting/ship_hulls/monster/SH_KRAKEN_1_BODY.focs.txt @@ -41,6 +41,7 @@ Hull effects = AddSpecial name = "KRAKEN_NEST_SPECIAL" [[GAS_GIANT_STEALTH_BONUS]] + [[HUNT_PLANET_TYPE(GasGiant,0.5)]] [[MONSTER_MOVE_ALWAYS]] [[INFINITE_FUEL]] [[ADD_HULL_FUEL_TO_MAX_FUEL_METER]] diff --git a/default/scripting/ship_hulls/monster/SH_KRAKEN_2_BODY.focs.txt b/default/scripting/ship_hulls/monster/SH_KRAKEN_2_BODY.focs.txt index 95500e92299..2b658f1ea40 100644 --- a/default/scripting/ship_hulls/monster/SH_KRAKEN_2_BODY.focs.txt +++ b/default/scripting/ship_hulls/monster/SH_KRAKEN_2_BODY.focs.txt @@ -19,6 +19,7 @@ Hull location = All effectsgroups = [ [[GAS_GIANT_STEALTH_BONUS]] + [[HUNT_PLANET_TYPE(GasGiant,0.3)]] [[MONSTER_MOVE_ALWAYS]] [[INFINITE_FUEL]] [[ADD_HULL_FUEL_TO_MAX_FUEL_METER]] diff --git a/default/scripting/ship_hulls/monster/monster.macros b/default/scripting/ship_hulls/monster/monster.macros index 22a4b0fcd09..4bbfbc10f28 100644 --- a/default/scripting/ship_hulls/monster/monster.macros +++ b/default/scripting/ship_hulls/monster/monster.macros @@ -152,6 +152,40 @@ HUNT_PLANETS ] ''' +// Wild monsters tend to grow slower as players will park the growth environment. +// Encourages wild monsters to return to growth environment. +// @1@ Planet Type +// @2@ Maximum Probability of Movement +HUNT_PLANET_TYPE +'''EffectsGroup + scope = And [ + Object id = Source.FleetID + Fleet + Number low = 1 condition = And [ + Planet + Planet type = @1@ + Stealth high = Source.Detection + WithinStarlaneJumps jumps = 1 condition = Source + ] + ] + activation = And [ + Turn low = 10 + Stationary + Unowned + Random Probability = min(@2@, ((abs(Source.Age - 20)/3)^2)) + ] + stackinggroup = "MONSTER_FLEET_MOVE_STACK" + effects = SetDestination destination = And [ + System + Contains And [ + Planet + Planet type = @1@ + Stealth high = Source.Detection + WithinStarlaneJumps jumps = 1 condition = Source + ] + ] +''' + GAS_GIANT_STEALTH_BONUS '''EffectsGroup scope = Source