Fix: Repentance/Instinct card target selection + server active ability execution

Client: Repentance/Instinct cards with Active abilities in abilitiesJson now
enter ABILITY_TARGET mode instead of sending play_card immediately. Units on
matching tile affinities (IsOnTileWithAffinity) are highlighted in blue; the
player clicks a target unit and the card is sent with the selected unit target.

Server: FireCardEffects now also processes Active abilities from AbilitiesJson
(after the existing EffectsJson path). Source-side ActivationConditions are
checked; target-side conditions (Subject=Target) are trusted from the client.

New Game.gd helper: send_play_card_with_targets sends play_card with a targets
array so the server can route unit selections to the active ability handler.

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-03-18 14:05:49 -04:00
co-authored by Claude Happy
parent 66452313d5
commit 5d3ee92553
3 changed files with 95 additions and 6 deletions
+7
View File
@@ -176,6 +176,13 @@ func send_play_card_multi(card_instance_id: String, targets: Array) -> void:
})
func send_play_card_with_targets(card_instance_id: String, targets: Array) -> void:
var payload := { "cardInstanceId": card_instance_id }
if not targets.is_empty():
payload["targets"] = targets
_game_request("game.play_card", payload)
func send_move_unit(unit_instance_id: String, target_x: int, target_y: int) -> void:
_game_request("game.move_unit", {
"unitInstanceId": unit_instance_id,