Merge branch 'fixCards' into 'master'

Update more cards with ValidSA

See merge request core-developers/forge!3804
This commit is contained in:
Hans Mackowiak
2021-02-12 13:22:41 +00:00
4 changed files with 11 additions and 13 deletions

View File

@@ -1,7 +1,6 @@
package forge.game.ability.effects; package forge.game.ability.effects;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -149,14 +148,13 @@ public class PlayEffect extends SpellAbilityEffect {
if (sa.hasParam("ValidSA")) { if (sa.hasParam("ValidSA")) {
final String valid[] = {sa.getParam("ValidSA")}; final String valid[] = {sa.getParam("ValidSA")};
final Iterator<Card> itr = tgtCards.iterator(); List<Card> toRemove = Lists.newArrayList();
while (itr.hasNext()) { for (Card c : tgtCards) {
final Card c = itr.next(); if (!Iterables.any(AbilityUtils.getBasicSpellsFromPlayEffect(c, controller), SpellAbilityPredicates.isValid(valid, controller , c, sa))) {
final List<SpellAbility> validSA = Lists.newArrayList(Iterables.filter(AbilityUtils.getBasicSpellsFromPlayEffect(c, controller), SpellAbilityPredicates.isValid(valid, controller , c, sa))); toRemove.add(c);
if (validSA.size() == 0) {
itr.remove();
} }
} }
tgtCards.removeAll(toRemove);
if (tgtCards.isEmpty()) { if (tgtCards.isEmpty()) {
return; return;
} }

View File

@@ -2,7 +2,7 @@ Name:Brain in a Jar
ManaCost:2 ManaCost:2
Types:Artifact 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. 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<X/CHARGE> | ScryNum$ X | References$ X | AILogic$ BrainJar | SpellDescription$ Scry X. A:AB$ Scry | Cost$ 3 T SubCounter<X/CHARGE> | ScryNum$ X | References$ X | AILogic$ BrainJar | SpellDescription$ Scry X.
SVar:X:Count$xPaid SVar:X:Count$xPaid
SVar:Y:Count$CardCounters.CHARGE SVar:Y:Count$CardCounters.CHARGE

View File

@@ -4,7 +4,7 @@ Types:Legendary Creature Human Wizard
PT:2/2 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. 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 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$ ChangesZone | ValidCard$ Card.IsRemembered+ExiledWithSource | Origin$ Exile | Destination$ Any | Execute$ ForgetCard | Static$ True
T:Mode$ SpellCast | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ ForgetCard | Static$ True T:Mode$ SpellCast | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ ForgetCard | Static$ True
SVar:ForgetCard:DB$ Cleanup | ForgetDefined$ TriggeredCard SVar:ForgetCard:DB$ Cleanup | ForgetDefined$ TriggeredCard
@@ -13,4 +13,4 @@ SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$xPaid SVar:X:Count$xPaid
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/kaho_minamo_historian.jpg 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.

View File

@@ -1,11 +1,11 @@
Name:Sunbird's Invocation Name:Sunbird's Invocation
ManaCost:5 R ManaCost:5 R
Types:Enchantment 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: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:DBRestRandomOrder:DB$ ChangeZone | Defined$ Remembered | AtRandom$ True | Origin$ Library | Destination$ Library | LibraryPosition$ -1 | Shuffle$ False | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:TriggerCount$CastSACMC SVar:X:TriggerCount$CastSACMC
SVar:Picture:http://media.wizards.com/2017/xln/en_wZkZ5jvNGp.png 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.