diff --git a/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java index d6f59f35b1c..09e91dd67e5 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java @@ -1,7 +1,6 @@ package forge.game.ability.effects; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import org.apache.commons.lang3.StringUtils; @@ -149,14 +148,13 @@ public class PlayEffect extends SpellAbilityEffect { if (sa.hasParam("ValidSA")) { final String valid[] = {sa.getParam("ValidSA")}; - final Iterator itr = tgtCards.iterator(); - while (itr.hasNext()) { - final Card c = itr.next(); - final List validSA = Lists.newArrayList(Iterables.filter(AbilityUtils.getBasicSpellsFromPlayEffect(c, controller), SpellAbilityPredicates.isValid(valid, controller , c, sa))); - if (validSA.size() == 0) { - itr.remove(); + List toRemove = Lists.newArrayList(); + for (Card c : tgtCards) { + if (!Iterables.any(AbilityUtils.getBasicSpellsFromPlayEffect(c, controller), SpellAbilityPredicates.isValid(valid, controller , c, sa))) { + toRemove.add(c); } } + tgtCards.removeAll(toRemove); if (tgtCards.isEmpty()) { return; } diff --git a/forge-gui/res/cardsfolder/b/brain_in_a_jar.txt b/forge-gui/res/cardsfolder/b/brain_in_a_jar.txt index 36194f48586..a0b66afb8bd 100644 --- a/forge-gui/res/cardsfolder/b/brain_in_a_jar.txt +++ b/forge-gui/res/cardsfolder/b/brain_in_a_jar.txt @@ -2,7 +2,7 @@ Name:Brain in a Jar ManaCost:2 Types:Artifact A:AB$ PutCounter | Cost$ 1 T | CounterType$ CHARGE | CounterNum$ 1 | SubAbility$ DBCast | SpellDescription$ Put a charge counter on Brain in a Jar, then you may cast an instant or sorcery card with converted mana cost equal to the number of charge counters on Brain in a Jar from your hand without paying its mana cost. -SVar:DBCast:DB$ Play | ValidZone$ Hand | Valid$ Instant.YouOwn+cmcEQY,Sorcery.YouOwn+cmcEQY | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ 1 | References$ Y +SVar:DBCast:DB$ Play | ValidZone$ Hand | Valid$ Instant.YouOwn,Sorcery.YouOwn| ValidSA$ Spell.cmcEQY | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ 1 | References$ Y A:AB$ Scry | Cost$ 3 T SubCounter | ScryNum$ X | References$ X | AILogic$ BrainJar | SpellDescription$ Scry X. SVar:X:Count$xPaid SVar:Y:Count$CardCounters.CHARGE diff --git a/forge-gui/res/cardsfolder/k/kaho_minamo_historian.txt b/forge-gui/res/cardsfolder/k/kaho_minamo_historian.txt index f266e634d2f..6eefb21c9ee 100644 --- a/forge-gui/res/cardsfolder/k/kaho_minamo_historian.txt +++ b/forge-gui/res/cardsfolder/k/kaho_minamo_historian.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Human Wizard PT:2/2 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ Catalogue | TriggerDescription$ When CARDNAME enters the battlefield, search your library for up to three instant cards and exile them. Then shuffle your library. SVar:Catalogue:DB$ ChangeZone | Origin$ Library | Destination$ Exile | ChangeType$ Instant | ChangeNum$ 3 | RememberChanged$ True | ForgetOtherRemembered$ True -A:AB$ Play | Cost$ X T | Valid$ Card.IsRemembered+ExiledWithSource+cmcEQX | ValidZone$ Exile | WithoutManaCost$ True | Amount$ 1 | Controller$ You | Optional$ True | References$ X | ForgetTargetRemembered$ True | SpellDescription$ You may cast a card with converted mana cost X exiled with Kaho without paying its mana cost. +A:AB$ Play | Cost$ X T | Valid$ Card.IsRemembered+ExiledWithSource | ValidSA$ Spell.cmcEQX | ValidZone$ Exile | WithoutManaCost$ True | Amount$ 1 | Controller$ You | Optional$ True | References$ X | ForgetTargetRemembered$ True | SpellDescription$ You may cast a spell with converted mana cost X exiled with Kaho without paying its mana cost. T:Mode$ ChangesZone | ValidCard$ Card.IsRemembered+ExiledWithSource | Origin$ Exile | Destination$ Any | Execute$ ForgetCard | Static$ True T:Mode$ SpellCast | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ ForgetCard | Static$ True SVar:ForgetCard:DB$ Cleanup | ForgetDefined$ TriggeredCard @@ -13,4 +13,4 @@ SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:Count$xPaid AI:RemoveDeck:All SVar:Picture:http://www.wizards.com/global/images/magic/general/kaho_minamo_historian.jpg -Oracle:When Kaho, Minamo Historian enters the battlefield, search your library for up to three instant cards and exile them. Then shuffle your library.\n{X}, {T}: You may cast a card with converted mana cost X exiled with Kaho without paying its mana cost. +Oracle:When Kaho, Minamo Historian enters the battlefield, search your library for up to three instant cards and exile them. Then shuffle your library.\n{X}, {T}: You may cast a spell with converted mana cost X exiled with Kaho without paying its mana cost. diff --git a/forge-gui/res/cardsfolder/s/sunbirds_invocation.txt b/forge-gui/res/cardsfolder/s/sunbirds_invocation.txt index 654fcea8d13..cb6432794af 100644 --- a/forge-gui/res/cardsfolder/s/sunbirds_invocation.txt +++ b/forge-gui/res/cardsfolder/s/sunbirds_invocation.txt @@ -1,11 +1,11 @@ Name:Sunbird's Invocation ManaCost:5 R Types:Enchantment -T:Mode$ SpellCast | ValidCard$ Card.wasCastFromHand | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDig | TriggerDescription$ Whenever you cast a spell from your hand, reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a card revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order. +T:Mode$ SpellCast | ValidCard$ Card.wasCastFromHand | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDig | TriggerDescription$ Whenever you cast a spell from your hand, reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a spell revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order. SVar:TrigDig:DB$ PeekAndReveal | Defined$ You | PeekAmount$ X | RememberRevealed$ True | References$ X | SubAbility$ DBPlay -SVar:DBPlay:DB$ Play | ValidZone$ Library | Valid$ Card.nonLand+IsRemembered+cmcLEX | WithoutManaCost$ True | Optional$ True | Amount$ 1 | ShowCards$ Card.IsRemembered | ForgetTargetRemembered$ True | References$ X | SubAbility$ DBRestRandomOrder +SVar:DBPlay:DB$ Play | ValidZone$ Library | Valid$ Card.nonLand+IsRemembered | ValidSA$ Spell.cmcLEX | WithoutManaCost$ True | Optional$ True | Amount$ 1 | ShowCards$ Card.IsRemembered | ForgetTargetRemembered$ True | References$ X | SubAbility$ DBRestRandomOrder SVar:DBRestRandomOrder:DB$ ChangeZone | Defined$ Remembered | AtRandom$ True | Origin$ Library | Destination$ Library | LibraryPosition$ -1 | Shuffle$ False | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:TriggerCount$CastSACMC SVar:Picture:http://media.wizards.com/2017/xln/en_wZkZ5jvNGp.png -Oracle:Whenever you cast a spell from your hand, reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a card revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order. +Oracle:Whenever you cast a spell from your hand, reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a spell revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order.