Missing EffectJson for Repentance and Instinct cards

This commit is contained in:
dingo
2026-03-19 14:04:20 -04:00
parent 6fd1b07ab2
commit d5c6ca2559
2 changed files with 12 additions and 1 deletions
@@ -2173,6 +2173,7 @@ func _hide_ability_panel() -> void:
## Determine what input is needed for the current action and either enter
## ABILITY_TARGET mode (board highlights) or show the player panel.
func _start_ability_targeting() -> void:
print("Game_Screen:: _Start targeting")
if _ability_cur_action_idx >= _ability_def.size():
_send_ability()
return
@@ -2494,6 +2495,7 @@ func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
# Repentance / Instinct — may have an active ability requiring unit target selection.
if card.get("cardType", "") in ["Repentance", "Instinct"]:
print("GAMESCREEN: I AM A REPENT OR INSTINCT")
# Deselect: same card clicked again.
if (_mode == Mode.ABILITY_TARGET and _ability_card_id == iid) or \
(_mode == Mode.CARD_FROM_HAND and _sel_card_id == iid):
@@ -2504,21 +2506,27 @@ func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
_set_mode(Mode.NONE)
# Parse effectsJson for the first Active ability.
var abs_raw : String = card.get("effectsJson", "")
print("GAMESCREEN: card", card)
if not abs_raw.is_empty():
print("GAMESCREEN: Not Empty")
var parsed_variant : Array = JSON.parse_string(abs_raw)
if parsed_variant is Array:
print("GAMESCREEN: Is Array")
var parsed : Array = _normalize_keys(parsed_variant)
for ab_var: Variant in parsed:
print("GAMESCREEN: ab_var parsed")
if not (ab_var is Dictionary): continue
var ab : Dictionary = ab_var
if ab.get("type", "") != "active": continue
# Extract target-side activation conditions.
var tgt_conds : Array = []
for cv: Variant in ab.get("activationconditions", []):
print("GAMESCREEN: cv block")
if not (cv is Dictionary): continue
var cd : Dictionary = cv
if cd.get("subject", "") == "target":
tgt_conds.append(cd)
print("GAMESCREEN: Supposed to enter Target here")
# Enter unit-target selection mode.
_ability_card_id = iid
_ability_unit_id = ""
@@ -2529,8 +2537,10 @@ func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
_ability_targets = []
_ability_cur_action_idx = 0
_sel_card_id = iid
print("GAMESCREEN: Setting Mode: ", Mode.ABILITY_TARGET)
_set_mode(Mode.ABILITY_TARGET)
_clear_highlights()
print("GAMESCREEN: Calling Start bility targeting")
_start_ability_targeting()
return
# No active ability — channel immediately.