From 064559130c92f89061f70ec2703ecea92bbce153 Mon Sep 17 00:00:00 2001 From: istamarahsan Date: Sun, 26 Jan 2025 05:05:45 +0700 Subject: [PATCH] fix: add support card only if not instant --- tcg/match/match_manager.gd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tcg/match/match_manager.gd b/tcg/match/match_manager.gd index 1a12147..4eb4128 100644 --- a/tcg/match/match_manager.gd +++ b/tcg/match/match_manager.gd @@ -101,8 +101,9 @@ func resolve(action_by_player_id: Dictionary) -> PhaseTransition: for played_card in support_cards: var player: MatchPlayer = played_card.player var card: SupportCard = played_card.card - var executed_instant_effects_events = _execute_support_card_immediate_effects(player, card) - player.active_support_cards.append(card) + if played_card is ImplementedSupportCard and played_card.scope != 'instant' + player.active_support_cards.append(played_card) + var executed_instant_effects_events = _execute_support_card_instant_effects(player, card) events.append_array(executed_instant_effects_events) phase = Match.Phase.RPS Match.Phase.RPS: @@ -145,8 +146,9 @@ func resolve(action_by_player_id: Dictionary) -> PhaseTransition: for played_card in support_cards: var player: MatchPlayer = played_card.player var card: SupportCard = played_card.card - player.active_support_cards.append(played_card) - events.append_array(_execute_support_card_immediate_effects(player, card)) + if played_card is ImplementedSupportCard and played_card.scope != 'instant' + player.active_support_cards.append(played_card) + events.append_array(_execute_support_card_instant_effects(player, card)) for player: MatchPlayer in players.values(): if _player_has_active_support_card(player, "absorb") and player.monster.health_delta < 0: @@ -190,7 +192,7 @@ func resolve(action_by_player_id: Dictionary) -> PhaseTransition: func _monster_from_card(card: MonsterCard) -> MatchMonster: return MatchMonster.new(card, card.base_health, 0) -func _execute_support_card_immediate_effects(player: MatchPlayer, card: SupportCard) -> Array[Event]: +func _execute_support_card_instant_effects(player: MatchPlayer, card: SupportCard) -> Array[Event]: var events: Array[Event] if card is ImplementedSupportCard: match card.id: