real combat system: simulation. swarmling-queens spawn swarmlings, destroy enemy lair
after #100 (closed), flesh out the dummy async simulation into a real async combat system, including UI.
Minimum functionality:
- No player interaction yet. No randomness yet. Only swarmlings, swarmling-queens, and the lair - no towers or other unittypes yet.
- Each team starts combat with a
lair
, with a fixed amount of hit points. - The lair spawns swarmlings over time, based on how many swarmling-queens the player owns.
- No other units yet.
- Swarmling growth works similar to other units' growth, but it only lasts as long as this combat instance.
- Periodically (ever 2-5 seconds?):
- Swarmlings from both sides inflict damage on the enemy.
- Some swarmlings on both sides die, based on damage taken. Lair takes damage too.
- If the lair dies, that side loses.
- If lairs die simultaneously, it's a draw.
- If the battle lasts longer than (3 minutes?), it's a draw.
- Beyond minimum functionality: as time passes, reduce hp/increase damage/speed up spawns, to speed up combat.
- UI can just be a pair of lists showing who's alive on each side.
this ended up being a pretty big task. Rewriting the comment that github so thoughtfully deleted:
-
combatevent.root -
combat ui uses real unit data
-
-
implement lairs -
swarmlings attack lairs (not just each other) -
combat ends when either lair dies
-
-
extend time limit, so there's real combat -
reaching the time limit results in a draw, not a s-queen compare
-
-
more unit tests - I'm not yet confident that it works well -
verify that you can't (re)start combat if combat's already running
optional:
-
increase damage, spawn rate as time passes -
soldier-types dir (probably in #102 (closed) though) -
show the time limit (we currently show time elapsed) -
don't store combatresult - it should be 100% derived from combat. snapshot everything needed for that.
Edited by Evan