The-International-Open-Source
The-International-Open-Source copied to clipboard
Improve safemode activation requirements
Things to consider when improving code:
- Should probably only safemode when a spawn is at risk.
- Spawns are probably not at risk if there is a sufficiently HP rampart on top of them
- Spawns can be killed in one hit by sufficiently fitted dismantle creeps, so checking if spawn hits are low isn't a good idea
- Perhaps check enemy range to spawn and spawn rampart existence for each spawn each tick
There is existing safemode code in defenceManager.ts. I suggest replacing that with this improved version :D
Partially implemented in ac67c3616b1b4ab8963833d5ed9b4c53ec13363d
Current implementation doesn't take ramparts into account, and only react to attack from previous tick (EventLog).
A spawn can be destroyed in a single tick. In this case, safeMode will trigger after spawn is gone.