Skip to content

Commit

Permalink
Tweak movement AI for krakens and Juggernauts
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCourtney committed Jul 3, 2023
1 parent 276f8d4 commit 58bd340
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
Expand Up @@ -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]]
Expand Down
Expand Up @@ -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]]
Expand Down
Expand Up @@ -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]]
Expand Down
Expand Up @@ -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]]
Expand Down
34 changes: 34 additions & 0 deletions default/scripting/ship_hulls/monster/monster.macros
Expand Up @@ -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
Expand Down

0 comments on commit 58bd340

Please sign in to comment.