diff --git a/forge-ai/src/main/java/forge/ai/ability/CloneAi.java b/forge-ai/src/main/java/forge/ai/ability/CloneAi.java index 494632f1f50..c9ab77868ab 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CloneAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CloneAi.java @@ -161,10 +161,14 @@ public class CloneAi extends SpellAbilityAi { */ @Override public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) { - if (sa.hasParam("AILogic") && sa.usesTargeting() && sa.isTargetNumberValid()) { + if (sa.hasParam("AILogic") && (!sa.usesTargeting() || sa.isTargetNumberValid())) { // Had a special logic for it and managed to target, so confirm if viable if ("CloneBestCreature".equals(sa.getParam("AILogic"))) { return ComputerUtilCard.evaluateCreature(sa.getTargets().getFirstTargetedCard()) > ComputerUtilCard.evaluateCreature(sa.getHostCard()); + } else if ("BetterThanTriggered".equals(sa.getParam("AILogic"))) { + List defined = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("Defined"), sa); + Card bestDefined = ComputerUtilCard.getBestCreatureAI(defined); + return ComputerUtilCard.evaluateCreature(bestDefined) > ComputerUtilCard.evaluateCreature(sa.getHostCard()); } } diff --git a/forge-gui/res/cardsfolder/a/artisan_of_forms.txt b/forge-gui/res/cardsfolder/a/artisan_of_forms.txt index 1263e6df041..5168bc73c30 100644 --- a/forge-gui/res/cardsfolder/a/artisan_of_forms.txt +++ b/forge-gui/res/cardsfolder/a/artisan_of_forms.txt @@ -3,7 +3,6 @@ ManaCost:1 U Types:Creature Human Wizard PT:1/1 T:Mode$ SpellCast | ValidActivatingPlayer$ You | TargetsValid$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigArtisanCopy | TriggerDescription$ Heroic — Whenever you cast a spell that targets CARDNAME, you may have CARDNAME become a copy of target creature and gain this ability. -SVar:TrigArtisanCopy:DB$ Clone | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy | Optional$ True | GainThisAbility$ True -AI:RemoveDeck:All +SVar:TrigArtisanCopy:DB$ Clone | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy | Optional$ True | GainThisAbility$ True | AddSVars$ TrigArtisanCopy | AILogic$ CloneBestCreature SVar:Picture:http://www.wizards.com/global/images/magic/general/artisan_of_forms.jpg Oracle:Heroic — Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability. diff --git a/forge-gui/res/cardsfolder/l/lazav_dimir_mastermind.txt b/forge-gui/res/cardsfolder/l/lazav_dimir_mastermind.txt index da736302f56..d198dfc52e2 100644 --- a/forge-gui/res/cardsfolder/l/lazav_dimir_mastermind.txt +++ b/forge-gui/res/cardsfolder/l/lazav_dimir_mastermind.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Shapeshifter PT:3/3 K:Hexproof T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.nonToken+OppOwn | TriggerZones$ Battlefield | Execute$ LazavCopy | OptionalDecider$ You | TriggerDescription$ Whenever a creature card is put into an opponent's graveyard from anywhere, you may have Lazav, Dimir Mastermind become a copy of that card, except its name is Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it has hexproof and this ability. -SVar:LazavCopy:DB$ Clone | Defined$ TriggeredCard | NewName$ Lazav, Dimir Mastermind | AddTypes$ Legendary | AddKeywords$ Hexproof | GainThisAbility$ True +SVar:LazavCopy:DB$ Clone | Defined$ TriggeredCard | NewName$ Lazav, Dimir Mastermind | AddTypes$ Legendary | AddKeywords$ Hexproof | GainThisAbility$ True | Optional$ True | AddSVars$ LazavCopy | AILogic$ BetterThanTriggered AI:RemoveDeck:All SVar:Picture:http://www.wizards.com/global/images/magic/general/lazav_dimir_mastermind.jpg Oracle:Hexproof\nWhenever a creature card is put into an opponent's graveyard from anywhere, you may have Lazav, Dimir Mastermind become a copy of that card, except its name is Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it has hexproof and this ability. diff --git a/forge-gui/res/cardsfolder/r/renegade_doppelganger.txt b/forge-gui/res/cardsfolder/r/renegade_doppelganger.txt index 98b32fecbf8..0881f7c4f77 100644 --- a/forge-gui/res/cardsfolder/r/renegade_doppelganger.txt +++ b/forge-gui/res/cardsfolder/r/renegade_doppelganger.txt @@ -4,6 +4,6 @@ Types:Creature Shapeshifter PT:0/1 # Make SVars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Other+YouCtrl | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ RDCopy | TriggerDescription$ Whenever another creature enters the battlefield under your control, you may have CARDNAME become a copy of that creature until end of turn. (If it does, it loses this ability for the rest of the turn.) -SVar:RDCopy:DB$ Clone | Defined$ TriggeredCard | Duration$ UntilEndOfTurn +SVar:RDCopy:DB$ Clone | Defined$ TriggeredCard | Duration$ UntilEndOfTurn | AILogic$ BetterThanTriggered SVar:Picture:http://www.wizards.com/global/images/magic/general/renegade_doppelganger.jpg Oracle:Whenever another creature enters the battlefield under your control, you may have Renegade Doppelganger become a copy of that creature until end of turn. (If it does, it loses this ability for the rest of the turn.) diff --git a/forge-gui/res/cardsfolder/v/vesuvan_doppelganger.txt b/forge-gui/res/cardsfolder/v/vesuvan_doppelganger.txt index 56ff80e3418..2e0eac3b014 100644 --- a/forge-gui/res/cardsfolder/v/vesuvan_doppelganger.txt +++ b/forge-gui/res/cardsfolder/v/vesuvan_doppelganger.txt @@ -7,7 +7,6 @@ K:ETBReplacement:Copy:ChooseCreature:Optional SVar:ChooseCreature:DB$ ChooseCard | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | AILogic$ Clone | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." SVar:DBCopy:DB$ Clone | Defined$ Remembered | Colors$ Blue | OverwriteColors$ True | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig SVar:VesDopUpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ VesDopCopy | TriggerDescription$ At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability. -SVar:VesDopCopy:DB$ Clone | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | Colors$ Blue | OverwriteColors$ True | GainThisAbility$ True | SubAbility$ DBCleanup -AI:RemoveDeck:All +SVar:VesDopCopy:DB$ Clone | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | Colors$ Blue | OverwriteColors$ True | GainThisAbility$ True | AddSVars$ VesDopCopy | AILogic$ CloneBestCreature | SubAbility$ DBCleanup SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuvan_doppelganger.jpg Oracle:You may have Vesuvan Doppelganger enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability."