Fixed healing and started working on item collection tracking

This commit is contained in:
2026-10-10 00:17:53 -06:00
parent 3e0ad62cf2
commit 774f596c09
8 changed files with 163 additions and 7 deletions
+37
View File
@@ -0,0 +1,37 @@
from src.stats.combat_stats import CombatStats
class VisibleAll:
def test(self, _name):
return True
def test_self_healing_counts_while_in_combat():
stats = CombatStats(VisibleAll())
stats.on_player_appeared(0, 'Healer')
stats.on_enter_combat(0)
stats.on_health_received(0, 0, 100.0)
combat_healing = stats.players_healing()
total_healing = stats.players_total_healing()
assert combat_healing[0].name == 'Healer'
assert combat_healing[0].value == 100.0
assert total_healing[0].value == 100.0
def test_total_healing_includes_post_combat_healing():
stats = CombatStats(VisibleAll())
stats.on_player_appeared(0, 'Healer')
stats.on_enter_combat(0)
stats.on_health_received(0, 0, 100.0)
stats.on_leave_combat(0)
stats.on_health_received(0, 0, 50.0)
combat_healing = stats.players_healing()
total_healing = stats.players_total_healing()
assert combat_healing[0].value == 100.0
assert total_healing[0].value == 150.0