If our defense structures are attacked, garrison soldiers inside when possible and if a support unit is attacked and has less than 55% health, garrison it inside the nearest healing structure and if a ranged siege unit (not used for defense) is attacked, garrison it in the nearest fortress. If our hero is attacked with regicide victory condition, the victoryManager will handle it.
Garrison a hurt unit inside a player-owned or allied structure. If emergency is true, the unit will be garrisoned in the closest possible structure. Otherwise, it will garrison in the closest healing structure.
Garrison a attacked siege ranged unit inside the nearest fortress.
Be more inclined to help an ally attacked by several enemies.
Switch a defense army into an attack if needed.