diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java index b6a0b8aaf1e..146539d9507 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseCardAi.java @@ -162,9 +162,17 @@ public class ChooseCardAi extends SpellAbilityAi { public Card chooseSingleCard(final Player ai, final SpellAbility sa, Iterable options, boolean isOptional, Player targetedPlayer, Map params) { final Card host = sa.getHostCard(); final Player ctrl = host.getController(); - final String logic = sa.getParam("AILogic"); + String logic = sa.getParamOrDefault("AILogic", ""); + if (logic.contains("NotSelf")) { + CardCollection opt = (CardCollection) options; + if (opt.contains(host)) { + opt.remove(host); + } + options = opt; + logic = logic.replace("NotSelf", ""); + } Card choice = null; - if (logic == null) { + if (logic.equals("")) { // Base Logic is choose "best" choice = ComputerUtilCard.getBestAI(options); } else if ("WorstCard".equals(logic)) { diff --git a/forge-gui/res/cardsfolder/upcoming/disciple_of_caelus_nin.txt b/forge-gui/res/cardsfolder/upcoming/disciple_of_caelus_nin.txt index eeda0329f50..2251add2fc4 100644 --- a/forge-gui/res/cardsfolder/upcoming/disciple_of_caelus_nin.txt +++ b/forge-gui/res/cardsfolder/upcoming/disciple_of_caelus_nin.txt @@ -4,7 +4,7 @@ Types:Creature Human Wizard PT:3/4 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRepeatEach | TriggerDescription$ When CARDNAME enters the battlefield, starting with you, each player chooses up to five permanents they control. All permanents other than CARDNAME that weren't chosen this way phase out. SVar:TrigRepeatEach:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBChoosePermanent | SubAbility$ DBPhaseOut -SVar:DBChoosePermanent:DB$ ChooseCard | ChoiceTitle$ Choose up to five permanents you control | MinAmount$ 0 | Amount$ 5 | Defined$ Remembered | Choices$ Permanent.RememberedPlayerCtrl | RememberChosen$ True | AILogic$ BestCard +SVar:DBChoosePermanent:DB$ ChooseCard | ChoiceTitle$ Choose up to five permanents you control | MinAmount$ 0 | Amount$ 5 | Defined$ Remembered | Choices$ Permanent.RememberedPlayerCtrl | RememberChosen$ True | AILogic$ NotSelf SVar:DBPhaseOut:DB$ Phases | AllValid$ Permanent.Other+IsNotRemembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True | ClearRemembered$ True S:Mode$ CantPhaseIn | ValidCard$ Permanent | Description$ Permanents can't phase in.