From 3d59f1832ceb876891adb716ef29b5ccdca75cdf Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 5 Jan 2020 14:09:33 +0800 Subject: [PATCH] Allure of the Unknown should reveal first --- .../src/main/java/forge/ai/ability/DigAi.java | 11 +++++++++++ .../forge/game/ability/effects/DigEffect.java | 18 ++++++++++-------- .../res/cardsfolder/a/animal_magnetism.txt | 2 +- .../res/cardsfolder/k/karn_scion_of_urza.txt | 2 +- .../res/cardsfolder/m/murmurs_from_beyond.txt | 2 +- .../res/cardsfolder/p/phyrexian_portal.txt | 2 +- .../upcoming/allure_of_the_unknown.txt | 5 ++--- 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/DigAi.java b/forge-ai/src/main/java/forge/ai/ability/DigAi.java index e3435869c4d..b8b13d18fd3 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DigAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DigAi.java @@ -1,6 +1,8 @@ package forge.ai.ability; import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; + import forge.ai.*; import forge.game.Game; import forge.game.ability.AbilityUtils; @@ -157,6 +159,15 @@ public class DigAi extends SpellAbilityAi { } } + /* (non-Javadoc) + * @see forge.card.ability.SpellAbilityAi#chooseSinglePlayer(forge.game.player.Player, forge.card.spellability.SpellAbility, java.util.List) + */ + @Override + public Player chooseSinglePlayer(Player ai, SpellAbility sa, Iterable options) { + // an opponent choose a card from + return Iterables.getFirst(options, null); + } + /* (non-Javadoc) * @see forge.card.ability.SpellAbilityAi#confirmAction(forge.card.spellability.SpellAbility, forge.game.player.PlayerActionConfirmMode, java.lang.String) */ diff --git a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java index 8063eb5f06d..e4317c6a486 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java @@ -22,6 +22,7 @@ import forge.game.zone.PlayerZone; import forge.game.zone.ZoneType; import forge.util.Lang; import forge.util.TextUtil; +import forge.util.collect.FCollectionView; import forge.util.Localizer; import java.util.*; @@ -100,13 +101,6 @@ public class DigEffect extends SpellAbilityEffect { final TargetRestrictions tgt = sa.getTargetRestrictions(); final List tgtPlayers = getTargetPlayers(sa); - if (sa.hasParam("Choser")) { - final List choosers = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Choser"), sa); - if (!choosers.isEmpty()) { - chooser = choosers.get(0); - } - } - CardZoneTable table = new CardZoneTable(); GameEntityCounterTable counterTable = new GameEntityCounterTable(); for (final Player p : tgtPlayers) { @@ -165,7 +159,15 @@ public class DigEffect extends SpellAbilityEffect { host.addRemembered(one); } } - + if (sa.hasParam("Choser")) { + final FCollectionView choosers = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Choser"), sa); + if (!choosers.isEmpty()) { + chooser = player.getController().chooseSingleEntityForEffect(choosers, sa, "Choser:"); + } + if (sa.hasParam("SetChosenPlayer")) { + host.setChosenPlayer(chooser); + } + } if (!noMove) { CardCollection movedCards; rest.addAll(top); diff --git a/forge-gui/res/cardsfolder/a/animal_magnetism.txt b/forge-gui/res/cardsfolder/a/animal_magnetism.txt index 3d61b1006c0..b490bdcbf70 100644 --- a/forge-gui/res/cardsfolder/a/animal_magnetism.txt +++ b/forge-gui/res/cardsfolder/a/animal_magnetism.txt @@ -1,6 +1,6 @@ Name:Animal Magnetism ManaCost:4 G Types:Sorcery -A:SP$ Dig | Cost$ 4 G | DigNum$ 5 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Creature | DestinationZone$ Battlefield | DestinationZone2$ Graveyard | Choser$ Opponent | SpellDescription$ Reveal the top five cards of your library. An opponent chooses a creature card from among them. Put that card onto the battlefield and the rest into your graveyard. +A:SP$ Dig | Cost$ 4 G | DigNum$ 5 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Creature | DestinationZone$ Battlefield | DestinationZone2$ Graveyard | Choser$ Player.Opponent | SpellDescription$ Reveal the top five cards of your library. An opponent chooses a creature card from among them. Put that card onto the battlefield and the rest into your graveyard. SVar:Picture:http://www.wizards.com/global/images/magic/general/animal_magnetism.jpg Oracle:Reveal the top five cards of your library. An opponent chooses a creature card from among them. Put that card onto the battlefield and the rest into your graveyard. diff --git a/forge-gui/res/cardsfolder/k/karn_scion_of_urza.txt b/forge-gui/res/cardsfolder/k/karn_scion_of_urza.txt index d659fcec475..2052a5c5ad4 100644 --- a/forge-gui/res/cardsfolder/k/karn_scion_of_urza.txt +++ b/forge-gui/res/cardsfolder/k/karn_scion_of_urza.txt @@ -2,7 +2,7 @@ Name:Karn, Scion of Urza ManaCost:4 Types:Legendary Planeswalker Karn Loyalty:5 -A:AB$ Dig | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | DigNum$ 2 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Card | DestinationZone$ Hand | DestinationZone2$ Exile | ExileWithCounter$ SILVER | Choser$ Opponent | SpellDescription$ Reveal the top two cards of your library. An opponent chooses one of them. Put that card into your hand and exile the other with a silver counter on it. +A:AB$ Dig | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | DigNum$ 2 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Card | DestinationZone$ Hand | DestinationZone2$ Exile | ExileWithCounter$ SILVER | Choser$ Player.Opponent | SpellDescription$ Reveal the top two cards of your library. An opponent chooses one of them. Put that card into your hand and exile the other with a silver counter on it. A:AB$ ChangeZone | Cost$ SubCounter<1/LOYALTY> | Planeswalker$ True | Hidden$ True | Origin$ Exile | Destination$ Hand | ChangeType$ Card.YouOwn+counters_GE1_SILVER | StackDescription$ SpellDescription | SpellDescription$ Put a card you own with a silver counter on it from exile into your hand. A:AB$ Token | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Ultimate$ True | TokenScript$ c_0_0_a_construct_total_artifacts | TokenOwner$ You | LegacyImage$ c 0 0 a construct total artifacts dom | SpellDescription$ Create a 0/0 colorless Construct artifact creature token with "This creature gets +1/+1 for each artifact you control." SVar:BuffedBy:Artifact diff --git a/forge-gui/res/cardsfolder/m/murmurs_from_beyond.txt b/forge-gui/res/cardsfolder/m/murmurs_from_beyond.txt index f8dbb9daa4c..41c6256d5c9 100644 --- a/forge-gui/res/cardsfolder/m/murmurs_from_beyond.txt +++ b/forge-gui/res/cardsfolder/m/murmurs_from_beyond.txt @@ -1,6 +1,6 @@ Name:Murmurs from Beyond ManaCost:2 U Types:Instant Arcane -A:SP$ Dig | Cost$ 2 U | DigNum$ 3 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Card | DestinationZone$ Graveyard | DestinationZone2$ Hand | Choser$ Opponent | SpellDescription$ Reveal the top three cards of your library. An opponent chooses one of them. Put that card into your graveyard and the rest into your hand. +A:SP$ Dig | Cost$ 2 U | DigNum$ 3 | Reveal$ True | ChangeNum$ 1 | ChangeValid$ Card | DestinationZone$ Graveyard | DestinationZone2$ Hand | Choser$ Player.Opponent | SpellDescription$ Reveal the top three cards of your library. An opponent chooses one of them. Put that card into your graveyard and the rest into your hand. SVar:Picture:http://www.wizards.com/global/images/magic/general/murmurs_from_beyond.jpg Oracle:Reveal the top three cards of your library. An opponent chooses one of them. Put that card into your graveyard and the rest into your hand. diff --git a/forge-gui/res/cardsfolder/p/phyrexian_portal.txt b/forge-gui/res/cardsfolder/p/phyrexian_portal.txt index bc4a872d23c..14307d89eb3 100644 --- a/forge-gui/res/cardsfolder/p/phyrexian_portal.txt +++ b/forge-gui/res/cardsfolder/p/phyrexian_portal.txt @@ -1,7 +1,7 @@ Name:Phyrexian Portal ManaCost:3 Types:Artifact -A:AB$ Dig | Cost$ 3 | DigNum$ 10 | RememberRevealed$ True | NoMove$ True | Choser$ Opponent | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | SubAbility$ DBTwoPiles | SpellDescription$ If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library. | StackDescription$ If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library. +A:AB$ Dig | Cost$ 3 | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | DigNum$ 10 | RememberRevealed$ True | NoMove$ True | Choser$ Targeted | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | SubAbility$ DBTwoPiles | SpellDescription$ If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library. | StackDescription$ If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library. SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | FaceDown$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ChosenPile$ DBHand | UnchosenPile$ DBExile | SubAbility$ DBCleanup SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand | ChangeType$ Card | ChangeNum$ 1 | ChooseFromDefined$ True | Mandatory$ True | Shuffle$ True SVar:DBExile:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Exile diff --git a/forge-gui/res/cardsfolder/upcoming/allure_of_the_unknown.txt b/forge-gui/res/cardsfolder/upcoming/allure_of_the_unknown.txt index 60aa94cafbc..cb3a37a14e7 100644 --- a/forge-gui/res/cardsfolder/upcoming/allure_of_the_unknown.txt +++ b/forge-gui/res/cardsfolder/upcoming/allure_of_the_unknown.txt @@ -1,8 +1,7 @@ Name:Allure of the Unknown ManaCost:3 B R Types:Sorcery -A:SP$ ChoosePlayer | Cost$ 3 B R | Defined$ You | Choices$ Player.Opponent | SubAbility$ DBDig | ChoiceTitle$ Choose an opponent | SpellDescription$ Reveal the top six cards of your library. An opponent exiles a nonland card from among them, then you put the rest into your hand. That opponent may cast the exiled card without paying its mana cost. | StackDescription$ SpellDescription -SVar:DBDig:DB$ Dig | DigNum$ 6 | Reveal$ True | Choser$ Player.Chosen | ChangeNum$ 1 | ChangeValid$ Card.nonLand | AILogic$ BestCard | DestinationZone$ Exile | DestinationZone2$ Hand | RememberChanged$ True | SubAbility$ DBPlay +A:SP$ Dig | Cost$ 3 B R | DigNum$ 6 | Reveal$ True | Choser$ Player.Opponent | SetChosenPlayer$ True | ChangeNum$ 1 | ChangeValid$ Card.nonLand | AILogic$ BestCard | DestinationZone$ Exile | DestinationZone2$ Hand | RememberChanged$ True | SpellDescription$ Reveal the top six cards of your library. An opponent exiles a nonland card from among them, then you put the rest into your hand. That opponent may cast the exiled card without paying its mana cost. | StackDescription$ SpellDescription | SubAbility$ DBPlay SVar:DBPlay:DB$ Play | WithoutManaCost$ True | Controller$ Player.Chosen | Optional$ True | OptionalDecider$ Player.Chosen | ValidZone$ Exile | Valid$ Card.IsRemembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearChosenPlayer$ True -Oracle:Reveal the top six cards of your library. An opponent exiles a nonland card from among them, then you put the rest into your hand. That opponent may cast the exiled card without paying its mana cost. \ No newline at end of file +Oracle:Reveal the top six cards of your library. An opponent exiles a nonland card from among them, then you put the rest into your hand. That opponent may cast the exiled card without paying its mana cost.