#97a: buildings have health, and can be destroyed #99
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Subticket of #97 - "Waves tries to attack built buildings, so building needs health now."
Foundation for the rest of the wave work: nothing can attack a structure that
cannot be hurt.
max_hponBuildingDefinition, so a mothership is not as fragile as anextractor.
GameState, not on the node:Main.tscnis torn down and rebuilt on every trip to a planet surface, so damage kept
only on a node would heal itself the moment the player landed.
GameState.damage_building(id, amount), returning whether it died, anddestruction that removes the record, its stored inventory and its queued
orders.
happens.
Done in
c221584.max_hpis per definition - an extractor bolted to a rock is not themothership - and the current value lives on the RECORD in GameState, not on the
Building node, because Main.tscn is rebuilt on every landing and damage kept on
a node would heal itself the moment you touched down.
A record written before this carries no
hpfield at all. That reads asundamaged rather than as zero, or an existing save would open on a field of
wrecks.
The mothership cannot be destroyed - it floors at 1hp. The bank, the hangar
and research all live there and a wiped fleet rebuilds there, so losing it would
be a soft-lock with no route back. Keyed on the "bank" capability rather than on
the type, so whatever building holds the bank is the one that cannot be lost.
Covered by
tests/test_building_health.gd.