Route the bull's hits through the typed DamageEvent pipeline

Hitbox now builds a DamageEvent (cause + hit position + shaped knock-up) and
calls the bull's new receive_damage(), instead of two stringly Object.call()s.
receive_damage adapts over the existing pip/knock-up logic so behaviour is
identical -- the characterization test drives both the string and typed paths
and asserts the same outcomes. Wire fx/damage/harness tests into run_tests.sh
+ CLAUDE.md. All hitbox guard tests green (stab, bear hitbox, ram, charge).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CmG3mQGVXZUPDVapmdbWZ1
This commit is contained in:
2026-09-05 00:17:04 +03:00
parent 973db7d8b8
commit 70274f1773
6 changed files with 68 additions and 5 deletions
+19
View File
@@ -41,3 +41,22 @@ static func make(kind: Cause, at: Vector3, src: Node = null) -> DamageEvent:
## ("gored" / "mauled" / "thrown") during the migration off string causes.
func cause_name() -> String:
return String(Cause.keys()[cause]).to_lower()
## Maps a legacy cause string onto the enum, so a Hitbox's exported damage_cause round-trips
## exactly (gored/mauled/thrown are the only ones in use). Unknown strings fall back to GENERIC.
static func cause_from(text: String) -> Cause:
match text.to_lower():
"gored":
return Cause.GORED
"mauled":
return Cause.MAULED
"thrown":
return Cause.THROWN
"slammed":
return Cause.SLAMMED
"kicked":
return Cause.KICKED
"dashed":
return Cause.DASHED
return Cause.GENERIC