CardFactoryUtil: fix Squad Trigger for Copy

This commit is contained in:
Hans Mackowiak
2024-04-21 15:09:46 +02:00
parent 5408dd7844
commit 5a4a4bafc6
2 changed files with 8 additions and 1 deletions

View File

@@ -1806,7 +1806,7 @@ public class CardFactoryUtil {
inst.addTrigger(parsedTrigger); inst.addTrigger(parsedTrigger);
} else if (keyword.startsWith("Squad")) { } else if (keyword.startsWith("Squad")) {
final String trigScript = "Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | " + final String trigScript = "Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | " +
"ValidCard$ Card.Self+wasCast | CheckSVar$ SquadAmount | Secondary$ True | " + "ValidCard$ Card.Self+linkedCastSA | CheckSVar$ SquadAmount | Secondary$ True | " +
"TriggerDescription$ When this creature enters the battlefield, create that many tokens that " + "TriggerDescription$ When this creature enters the battlefield, create that many tokens that " +
"are copies of it."; "are copies of it.";
final String abString = "DB$ CopyPermanent | Defined$ TriggeredCard | NumCopies$ SquadAmount"; final String abString = "DB$ CopyPermanent | Defined$ TriggeredCard | NumCopies$ SquadAmount";

View File

@@ -1810,6 +1810,13 @@ public class CardProperty {
} else if (property.equals("couldAttackButNotAttacking")) { } else if (property.equals("couldAttackButNotAttacking")) {
if (!game.getPhaseHandler().isPlayerTurn(controller)) return false; if (!game.getPhaseHandler().isPlayerTurn(controller)) return false;
return CombatUtil.couldAttackButNotAttacking(combat, card); return CombatUtil.couldAttackButNotAttacking(combat, card);
} else if (property.equals("linkedCastSA")) {
if (card.getCastSA() == null) {
return false;
}
if (AbilityUtils.isUnlinkedFromCastSA(spellAbility, card)) {
return false;
}
} else if (property.startsWith("kicked")) { } else if (property.startsWith("kicked")) {
// CR 607.2i check cost is linked // CR 607.2i check cost is linked
if (AbilityUtils.isUnlinkedFromCastSA(spellAbility, card)) { if (AbilityUtils.isUnlinkedFromCastSA(spellAbility, card)) {