Complete the DamageEvent migration: one deal() entry point for every attacker

The bull's Hitbox already routed through DamageEvent, but the spear, the bear's
maul, and the matador's reach-gore still did raw Object.call(&"take_sword_hit", ...)
— the exact scattered string paths DamageEvent was meant to retire. Add a single
static DamageEvent.deal(target, cause, at, source, knock_up) that builds the typed
event and hands it to receive_damage(), falling back to the legacy string call for
any not-yet-migrated victim, and route all four attackers (Hitbox included) through
it. The damage_pipeline characterization test proves the bull's outcomes are
unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq1VX2o1ZfiNRdCjD294wf
This commit is contained in:
2026-09-05 10:52:10 +03:00
parent ffe3052468
commit 9c4563a973
5 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -630,7 +630,7 @@ func _try_hit(reach: float) -> bool:
return false
if _facing().dot(to_bull / dist) < cos(deg_to_rad(DP.f("bear_hit_arc"))):
return false
_bull.call(&"take_sword_hit", "mauled")
DamageEvent.deal(_bull, DamageEvent.Cause.MAULED, _bull.global_position, self)
_shake(0.55)
return true