From 23643d0934aaeb326ebf5490f4b2d00ec9d647e8 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 22 Mar 2026 10:42:56 -0400 Subject: [PATCH] Fix ArchSpirit ability activation + Ownership:Target auto-resolution - AbilitySystem.cs: ActivateAbility was only searching player.Field for the source unit, but player.ArchSpirit is stored in a separate field and was never checked. Active abilities on an ArchSpirit now work correctly. - game_screen.gd: Add "Target" to auto_ownerships so the client skips the player-picker UI for Ownership:Target actions. The server auto-resolves them from ctx.ResolvedTargets (the owner of the previously targeted card), which is exactly what Bounce needs: refund SP to the owner of the returned spirit without asking the user to choose a player. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/scenes/game/game_screen.gd | 3 ++- Server/src/SOR.Game/Abilities/AbilitySystem.cs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index 3dfa498..93e59f0 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -2491,7 +2491,8 @@ func _start_ability_targeting() -> void: var count_all : bool = count_dict.get("all", false) # Actions auto-resolved by the server need no player input. - var auto_ownerships := ["Self", "ExactSelf", "Random"] + # "Target" means "owner of the last targeted card" — resolved server-side from ctx.ResolvedTargets. + var auto_ownerships := ["Self", "ExactSelf", "Random", "Target"] if count_all or ownership in auto_ownerships: _ability_cur_action_idx += 1 _start_ability_targeting() diff --git a/Server/src/SOR.Game/Abilities/AbilitySystem.cs b/Server/src/SOR.Game/Abilities/AbilitySystem.cs index 8d32288..7bbeff5 100644 --- a/Server/src/SOR.Game/Abilities/AbilitySystem.cs +++ b/Server/src/SOR.Game/Abilities/AbilitySystem.cs @@ -61,9 +61,11 @@ public static class AbilitySystem IReadOnlyList? clientTargets) { var player = state.Players[actorId]; + // ArchSpirit is stored in player.ArchSpirit, not player.Field — check both. var source = player.Field.OfType() - .FirstOrDefault(f => f.InstanceId == sourceInstanceId) - ?? throw new GameException("UNIT_NOT_FOUND"); + .FirstOrDefault(f => f.InstanceId == sourceInstanceId) + ?? (player.ArchSpirit?.InstanceId == sourceInstanceId ? player.ArchSpirit : null) + ?? throw new GameException("UNIT_NOT_FOUND"); if (source.IsExhausted) throw new GameException("UNIT_EXHAUSTED");