From 6da3fd898fe308c903054b5cbc8af8af0d331f73 Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 30 Nov 2018 09:10:55 +0300 Subject: [PATCH] - Attempting to implement a more concise and correct code for Sisters of Stone Death which would also work for the AI. --- forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java | 6 +++++- .../p/profane_procession_tomb_of_the_dusk_rose.txt | 4 ++-- forge-gui/res/cardsfolder/s/sisters_of_stone_death.txt | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java b/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java index e5c52128bef..ee8c766f31b 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChangeZoneAi.java @@ -314,7 +314,11 @@ public class ChangeZoneAi extends SpellAbilityAi { } for (final Player p : pDefined) { - CardCollectionView list = p.getCardsIn(origin); + // TODO: figure out how to make the AI properly establish which zones to look in for cards like Sisters of Stone Death + // without needing a separate AI logic for it (the issue is that there's no Defined/DefinedPlayer in cards like that, and + // the AI normally defaults to its own zone in these cases) + CardCollectionView list = "CheckAllPlayerZones".equals(sa.getParam("AILogic")) ? p.getGame().getCardsIn(origin) + : p.getCardsIn(origin); if (type != null && p == ai) { // AI only "knows" about his information diff --git a/forge-gui/res/cardsfolder/p/profane_procession_tomb_of_the_dusk_rose.txt b/forge-gui/res/cardsfolder/p/profane_procession_tomb_of_the_dusk_rose.txt index 25f4f6061a6..89b778373c4 100644 --- a/forge-gui/res/cardsfolder/p/profane_procession_tomb_of_the_dusk_rose.txt +++ b/forge-gui/res/cardsfolder/p/profane_procession_tomb_of_the_dusk_rose.txt @@ -13,7 +13,7 @@ Name:Tomb of the Dusk Rose ManaCost:no cost Types:Legendary Land A:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color. -A:AB$ ChooseCard | Cost$ 2 W B T | Choices$ Creature.IsRemembered+ExiledWithSource | ChoiceZone$ Exile | SubAbility$ DBChangeZone | AILogic$ AtLeast1 | Mandatory$ True | SpellDescription$ Put a creature card exiled with this permanent onto the battlefield under your control. -SVar:DBChangeZone:DB$ ChangeZone | Defined$ ChosenCard | Origin$ Exile | Destination$ Battlefield | ChangeType$ Creature.IsRemembered+ExiledWithSource | ChangeNum$ 1 | GainControl$ True +A:AB$ ChangeZone | Cost$ 2 W B T | Origin$ Exile | Destination$ Battlefield | ChangeType$ Creature.IsRemembered+ExiledWithSource | Hidden$ True | Mandatory$ True | GainControl$ True | AILogic$ CheckAllPlayerZones | SpellDescription$ Put a creature card exiled with this permanent onto the battlefield under your control. | StackDescription$ SpellDescription SVar:Picture:http://www.wizards.com/global/images/magic/general/tomb_of_the_dusk_rose.jpg Oracle:(Transforms from Profane Procession.)\n{T}: Add one mana of any color.\n{2}{W}{B},{T}: Put a creature card exiled with this permanent onto the battlefield under your control. + diff --git a/forge-gui/res/cardsfolder/s/sisters_of_stone_death.txt b/forge-gui/res/cardsfolder/s/sisters_of_stone_death.txt index cf74812459a..c6243e10d9f 100644 --- a/forge-gui/res/cardsfolder/s/sisters_of_stone_death.txt +++ b/forge-gui/res/cardsfolder/s/sisters_of_stone_death.txt @@ -4,8 +4,7 @@ Types:Legendary Creature Gorgon PT:7/5 A:AB$ MustBlock | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Target creature blocks CARDNAME this turn if able. A:AB$ ChangeZone | Cost$ B G | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Creature.blockingSource,Creature.blockedBySource | TgtPrompt$ Select target creature blocking Sisters of Stone Death | RememberTargets$ True | SpellDescription$ Exile target creature blocking or blocked by CARDNAME. -A:AB$ ChooseCard | Cost$ 2 B | Choices$ Creature.IsRemembered+ExiledWithSource | ChoiceZone$ Exile | AILogic$ AtLeast1 | Mandatory$ True | SubAbility$ DBChangeZone | SpellDescription$ Put a creature card exiled with CARDNAME onto the battlefield under your control. -SVar:DBChangeZone:DB$ ChangeZone | Defined$ ChosenCard | Origin$ Exile | Destination$ Battlefield | ChangeType$ Creature.IsRemembered+ExiledWithSource | ChangeNum$ 1 | GainControl$ True +A:AB$ ChangeZone | Cost$ 2 B | Origin$ Exile | Destination$ Battlefield | ChangeType$ Creature.IsRemembered+ExiledWithSource | Hidden$ True | Mandatory$ True | GainControl$ True | AILogic$ CheckAllPlayerZones | SpellDescription$ Put a creature card exiled with CARDNAME onto the battlefield under your control. | StackDescription$ SpellDescription T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget SVar:DBForget:DB$ Pump | ForgetImprinted$ TriggeredCard T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ DBCleanup | Static$ True | Secondary$ True | TriggerDescription$ Forget all remembered cards.