feat(stats): heals, repairs and restores count what they applied

Live sent TotalArmorRepaired / TotalImaginationRestored with what a repair
or restore applied, 0 included (1,050 and 2,148 zeros in the captures: a
power-up picked up at full), and never a TotalDamageHealed or
TotalDamageTaken of 0. DLU counted every change of the value instead, so
setting stats up (loading, respawning, level changes) counted as healing
and a heal at full health counted as 0 damage taken.

Now Heal, Repair and Imagine count what they applied; health lost and
imagination spent still count wherever they change.

Check in game: pick up an armor or imagination power-up when full; the
passport's Armor Repaired / Imagination Restored stay the same. Take damage
and heal; Damage Taken and Damage Healed go up by what the bar shows.
Respawn: Damage Healed doesn't jump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 02:19:43 -05:00
parent 1f29e9604a
commit fd10e19a06
4 changed files with 56 additions and 13 deletions

View File

@@ -201,19 +201,20 @@ public:
static std::optional<StatisticID> GetPowerUpStatistic(LOT lot);
/**
* Handles a change in health and updates the statistics
* Handles a change in health and updates the statistics: healing applied (DestroyableComponent::Heal) or health lost
* @param health the health delta
*/
void TrackHealthDelta(int32_t health);
/**
* Handles a change in imagination and updates the statistics
* Handles a change in imagination and updates the statistics: restored (DestroyableComponent::Imagine, 0 included)
* or spent
* @param imagination the imagination delta
*/
void TrackImaginationDelta(int32_t imagination);
/**
* Handles a change in armor and updates the statistics
* Handles armor repaired (DestroyableComponent::Repair, 0 included) and updates the statistics
* @param armor the armor delta
*/
void TrackArmorDelta(int32_t armor);