diff --git a/forge-game/src/main/java/forge/game/card/CardFactory.java b/forge-game/src/main/java/forge/game/card/CardFactory.java index 331ffb1fd86..e3c7b524fb8 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactory.java +++ b/forge-game/src/main/java/forge/game/card/CardFactory.java @@ -307,10 +307,13 @@ public class CardFactory { CardFactoryUtil.setupSiegeAbilities(card); } else if (card.getType().getBattleTypes().isEmpty()) { + //Probably a custom card? Check if it already has an RE for designating a protector. + if(card.getReplacementEffects().stream().anyMatch((re) -> re.hasParam("BattleProtector"))) + return; //Battles with no battle type enter protected by their controller. String abProtector = "DB$ ChoosePlayer | Choices$ You | Protect$ True | DontNotify$ True"; String reText = "Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplacementResult$ Updated" - + " | Description$ (As this Battle enters, its controller becomes its protector.)"; + + " | BattleProtector$ True | Description$ (As this Battle enters, its controller becomes its protector.)"; ReplacementEffect re = ReplacementHandler.parseReplacement(reText, card, true); re.setOverridingAbility(AbilityFactory.getAbility(abProtector, card)); card.addReplacementEffect(re); diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index 8baaaa922bb..f34313ce5e8 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -4124,7 +4124,7 @@ public class CardFactoryUtil { public static void setupSiegeAbilities(Card card) { StringBuilder chooseSB = new StringBuilder(); - chooseSB.append("Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplacementResult$ Updated"); + chooseSB.append("Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplacementResult$ Updated | BattleProtector$ True"); chooseSB.append(" | Description$ (As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.)"); String chooseProtector = "DB$ ChoosePlayer | Defined$ You | Choices$ Opponent | Protect$ True | ChoiceTitle$ Choose an opponent to protect this battle";