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 <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -61,9 +61,11 @@ public static class AbilitySystem
|
||||
IReadOnlyList<AbilityTarget>? clientTargets)
|
||||
{
|
||||
var player = state.Players[actorId];
|
||||
// ArchSpirit is stored in player.ArchSpirit, not player.Field — check both.
|
||||
var source = player.Field.OfType<FieldCard>()
|
||||
.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");
|
||||
|
||||
Reference in New Issue
Block a user