fix(game): centralize death resolution, reorder UnitAttack trigger, clear Position on zone transitions

- FireTrigger(UnitAttack) now fires BEFORE ApplyDamage so triggered abilities
  can modify attacker/target stats before damage lands
- AbilitySystem.KillUnit is now leader-aware: killing an ArchSpirit (in field
  or ArchSpirit slot) calls GameEngine.EliminatePlayer instead of silently failing
- MoveToDiscard and RemoveFromAllZones both clear Position = null on zone transitions
- RemoveFromAllZones guards against direct ArchSpirit removal (throws InvalidOperationException)
- EliminatePlayer made internal for cross-class access from AbilitySystem
- Client: improved JSON parsing error handling in Network.gd; debug_output enabled in Game.gd

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-05-05 15:58:45 -04:00
co-authored by Claude Happy
parent 7211a1038b
commit 5482dedcbe
4 changed files with 54 additions and 16 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ var session_id : String = ""
var state : Dictionary = {}
var opponent_name : String = ""
var is_spectating : bool = false
var debug_output : bool = false
var debug_output : bool = true
var _state_version : int = -1
# ── Lifecycle ─────────────────────────────────────────────────────────────────