**Testing triggering the emergency:**
Let the AI build a lot of buildings and units.
1. Then destroy more than 30% of it in less than 3 minutes. =>Emergency
2. Or destroy all civic centres =>Emergency
3. Or destroy at least two civic centres =>Emergency
4. Test with the phasesForSteadyDecline: E.g. start a game with population limit 300, wait until there are around 190 and then kill around 150 units. =>Emergency.
**Testing the reaction of the AI**
1. All troops should retreat to one point:
Either CC, Temple or Dock ORterritory root or just in the average position of all movable units. If the units can't reach the point, e.g. because ships can't move at the land and units can't cross the ocean, let them stay there after a certain time period
2. Then actions depending on the personality are done.
2.1 Defensive>Aggressive and collaborative > 0.5: Divides all its resources except some specified amount of every sort among every enemy and send tributes.
2.1.1 Neutrality requests are sent to every enemy.
2.1.2 Wait for a configurable duration. If the request was accepted, get neutral else let it expire.
2.1.2.1 If all neutrality requests are accepted and at least one territory root is available, then return to normal: The units will gather resources again, build structures, ...
2.1.2.2 Otherwise see 2.2
2.2 Defensive>Aggressive: Wait at the collect point, if any of the own people goes further than some configurable distance, pull it back.
2.3 For both defensive AIs: If they wait long enough and have only minor losses, they will return to normal otherwise, if the losses are too heavy, resign, destroy all own entities and make
one big tribute to the next ally
2.4 Aggressive:
2.4.1 Destroy all own buildings
2.4.2 Always go to the next building/unit of the enemy, until all own units are dead.
2.4 Aggressive: Always go to the next building/unit of the enemy4.3 If no enemy is left, until all own units are deaddestroyed.
For Aggressive mode:
If the target is not reachable after a certain amount of time, a new one is selected.