Support for Zygon Infiltrator (#3937)

* Support for Zygon Infiltrator

* 614.13a

* Fix filename

* Clean up

* Account for Chains of Mephistopheles

---------

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
This commit is contained in:
tool4ever
2023-10-21 20:55:39 +02:00
committed by GitHub
parent 49b1a66ad7
commit 437d64dc08
15 changed files with 30 additions and 28 deletions

View File

@@ -198,13 +198,13 @@ public abstract class SpellAbilityEffect {
protected final static CardCollection getDefinedCardsOrTargeted(final SpellAbility sa, final String definedParam) { return getCards(true, definedParam, sa); }
private static CardCollection getCards(final boolean definedFirst, final String definedParam, final SpellAbility sa) {
final boolean useTargets = sa.usesTargeting() && (!definedFirst || !sa.hasParam(definedParam));
if (sa.hasParam("ThisDefinedAndTgts")) {
CardCollection cards =
AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("ThisDefinedAndTgts"), sa);
cards.addAll(sa.getTargets().getTargetCards());
return cards;
}
final boolean useTargets = sa.usesTargeting() && (!definedFirst || !sa.hasParam(definedParam));
return useTargets ? new CardCollection(sa.getTargets().getTargetCards())
: AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam(definedParam), sa);
}
@@ -855,6 +855,10 @@ public abstract class SpellAbilityEffect {
} else if ("UntilUntaps".equals(duration)) {
host.addLeavesPlayCommand(until);
host.addUntapCommand(until);
} else if ("UntilTargetedUntaps".equals(duration)) {
Card tgt = sa.getSATargetingCard().getTargetCard();
tgt.addLeavesPlayCommand(until);
tgt.addUntapCommand(until);
} else if ("UntilUnattached".equals(duration)) {
host.addLeavesPlayCommand(until); //if it leaves play, it's unattached
host.addUnattachCommand(until);

View File

@@ -136,6 +136,10 @@ public class CloneEffect extends SpellAbilityEffect {
return;
}
if ("UntilTargetedUntaps".equals(sa.getParam("Duration")) && !cardToCopy.isTapped()) {
return;
}
final Long ts = game.getNextTimestamp();
tgtCard.addCloneState(CardFactory.getCloneStates(cardToCopy, tgtCard, sa), ts);

View File

@@ -1652,11 +1652,16 @@ public class Player extends GameEntity implements Comparable<Player> {
}
}
CardCollection milled = getTopXCardsFromLibrary(n);
CardCollectionView milledView = milled;
CardCollectionView milledView = getCardsIn(ZoneType.Library);
// 614.13c
if (sa.getRootAbility().getReplacingObject(AbilityKey.SimultaneousETB) != null) {
Iterables.removeAll(milledView, (CardCollection) sa.getRootAbility().getReplacingObject(AbilityKey.SimultaneousETB));
}
CardCollection milled = new CardCollection(Iterables.limit(milledView, n));
milledView = milled;
if (destination == ZoneType.Graveyard) {
milledView = GameActionUtil.orderCardsByTheirOwners(game, milled, ZoneType.Graveyard, sa);
milledView = GameActionUtil.orderCardsByTheirOwners(game, milledView, ZoneType.Graveyard, sa);
}
for (Card m : milledView) {

View File

@@ -3,7 +3,7 @@ ManaCost:2
Types:Artifact Vehicle
PT:0/0
K:ETBReplacement:Other:Imprint
SVar:Imprint:DB$ ChangeZone | Imprint$ True | ChangeType$ Creature | ChangeNum$ 1 | Origin$ Graveyard | Destination$ Exile | Mandatory$ True | Hidden$ True | Chooser$ You | SpellDescription$ Imprint - As CARDNAME enters the battlefield, exile a creature card from a graveyard.
SVar:Imprint:DB$ ChangeZone | Imprint$ True | ChangeType$ Creature.NotDefinedReplacedSimultaneousETB | ChangeNum$ 1 | Origin$ Graveyard | Destination$ Exile | Mandatory$ True | Hidden$ True | Chooser$ You | SpellDescription$ Imprint - As CARDNAME enters the battlefield, exile a creature card from a graveyard.
A:AB$ Clone | Cost$ tapXType<2/Creature> | Defined$ Imprinted | Duration$ UntilEndOfTurn | ImprintRememberedNoCleanup$ True | AddTypes$ Vehicle & Artifact | StackDescription$ Until end of turn, CARDNAME becomes a copy of {c:Imprinted}, except it's a Vehicle artifact in addition to its other types. | SpellDescription$ Until end of turn, CARDNAME becomes a copy of the exiled card, except it's a Vehicle artifact in addition to its other types.
SVar:NeedsToPlayVar:Check GE1
SVar:Check:Count$ValidGraveyard Creature

View File

@@ -3,7 +3,7 @@ ManaCost:X B B
Types:Creature Zombie
PT:0/1
R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ ExileCreature | Description$ As CARDNAME enters the battlefield, exile X creature cards from your graveyard. If you can't, put CARDNAME into its owner's graveyard instead of onto the battlefield. For each creature card exiled this way, CARDNAME enters the battlefield with a +2/+0, +1/+1, or +0/+2 counter on it.
SVar:ExileCreature:DB$ ChooseCard | ETB$ True | Choices$ Creature.YouOwn | ChoiceZone$ Graveyard | Amount$ X | Mandatory$ True | ConditionCheckSVar$ CheckYard | ConditionSVarCompare$ GEX | SubAbility$ DBExile
SVar:ExileCreature:DB$ ChooseCard | ETB$ True | Choices$ Creature.YouOwn+NotDefinedReplacedSimultaneousETB | ChoiceZone$ Graveyard | Amount$ X | Mandatory$ True | ConditionCheckSVar$ CheckYard | ConditionSVarCompare$ GEX | SubAbility$ DBExile
SVar:DBExile:DB$ ChangeZone | Defined$ ChosenCard | Origin$ Graveyard | Destination$ Exile | RememberChanged$ True | SubAbility$ Movetoyard
SVar:Movetoyard:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Graveyard | Defined$ Self | ConditionCheckSVar$ CheckExiled | ConditionSVarCompare$ LTX | Imprint$ True | ETB$ True | SubAbility$ ChooseCounters
SVar:ChooseCounters:DB$ Repeat | MaxRepeat$ X | ETB$ True | RepeatSubAbility$ DBChooseCounter | ConditionCheckSVar$ CheckExiled | ConditionSVarCompare$ EQX | SubAbility$ MovetoPlay
@@ -15,7 +15,7 @@ SVar:MovetoPlay:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Battl
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True
SVar:X:Count$xPaid
SVar:CheckExiled:Count$ValidExile Card.IsRemembered
SVar:CheckYard:Count$ValidGraveyard Creature.YouOwn
SVar:CheckYard:Count$ValidGraveyard Creature.YouOwn+NotDefinedReplacedSimultaneousETB
SVar:NeedsToPlayVar:CheckYard GE1
DeckHints:Ability$Mill|Graveyard
DeckHas:Ability$Gravyard|Counters

View File

@@ -2,7 +2,6 @@ Name:Giant Trap Door Spider
ManaCost:1 R G
Types:Creature Spider
PT:2/3
A:AB$ ChangeZone | Cost$ 1 R G T | ValidTgts$ Creature.attackingYou+withoutFlying | TgtPrompt$ Select target creature without flying that's attacking you | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile CARDNAME and target creature without flying that's attacking you. | SubAbility$ ExileME
SVar:ExileME:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ Self
A:AB$ ChangeZone | Cost$ 1 R G T | ValidTgts$ Creature.attackingYou+withoutFlying | ThisDefinedAndTgts$ Self | TgtPrompt$ Select target creature without flying that's attacking you | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile CARDNAME and target creature without flying that's attacking you.
AI:RemoveDeck:All
Oracle:{1}{R}{G}, {T}: Exile Giant Trap Door Spider and target creature without flying that's attacking you.

View File

@@ -7,7 +7,6 @@ SVar:TrigCounter:DB$ PutCounterAll | ValidCards$ Creature.nonGideon+YouCtrl+atta
A:AB$ Animate | Cost$ AddCounter<2/LOYALTY> | Defined$ Self | Power$ 5 | Toughness$ 5 | Types$ Creature,Soldier | SubAbility$ GideonPrevent | Planeswalker$ True | SpellDescription$ Until end of turn, CARDNAME becomes a 5/5 white Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
SVar:GideonPrevent:DB$ Effect | ReplacementEffects$ RPrevent | Duration$ UntilHostLeavesPlayOrEOT
SVar:RPrevent:Event$ DamageDone | Prevent$ True | ActiveZones$ Command | ValidTarget$ Card.EffectSource | Description$ Prevent all damage that would be dealt to EFFECTSOURCE.
A:AB$ ChangeZone | Cost$ SubCounter<9/LOYALTY> | Planeswalker$ True | Ultimate$ True | Defined$ Self | Origin$ Battlefield | Destination$ Exile | SubAbility$ ExileOppCreatures | SpellDescription$ Exile CARDNAME and each creature your opponents control.
SVar:ExileOppCreatures:DB$ ChangeZoneAll | Origin$ Battlefield | Destination$ Exile | ChangeType$ Creature.OppCtrl
A:AB$ ChangeZoneAll | Cost$ SubCounter<9/LOYALTY> | Planeswalker$ True | Ultimate$ True | ChangeType$ Card.Self,Creature.OppCtrl | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile CARDNAME and each creature your opponents control.
DeckHas:Ability$Counters
Oracle:Whenever you attack with two or more non-Gideon creatures, put a +1/+1 counter on each of those creatures.\n[+2]: Until end of turn, Gideon, the Oathsworn becomes a 5/5 white Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn. (He can't attack if he was cast this turn.)\n[-9]: Exile Gideon, the Oathsworn and each creature your opponents control.

View File

@@ -4,10 +4,5 @@ Types:Creature Jellyfish
PT:0/3
K:Defender
K:Flying
A:AB$ ChangeZoneAll | Cost$ T | ChangeType$ Creature.blockedBySource | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | RememberChanged$ True | ForgetOtherRemembered$ True | SubAbility$ JellyBounceSelf | SpellDescription$ Put CARDNAME and each creature it's blocking on top of their owners' libraries, then those players shuffle.
SVar:JellyBounceSelf:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | SubAbility$ WobbleOppJelly
SVar:WobbleOppJelly:DB$ Shuffle | Defined$ RememberedOwner | SubAbility$ WobbleYourJelly | ConditionCheckSVar$ X
SVar:WobbleYourJelly:DB$ Shuffle | Defined$ You | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount
A:AB$ ChangeZoneAll | Cost$ T | ChangeType$ Card.Self,Creature.blockedBySource | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | Shuffle$ True | SpellDescription$ Put CARDNAME and each creature it's blocking on top of their owners' libraries, then those players shuffle.
Oracle:Defender, flying\n{T}: Put Gomazoa and each creature it's blocking on top of their owners' libraries, then those players shuffle.

View File

@@ -2,6 +2,5 @@ Name:Hunting Kavu
ManaCost:1 R G
Types:Creature Kavu
PT:2/3
A:AB$ ChangeZone | Cost$ 1 R G T | ValidTgts$ Creature.withoutFlying+attackingYou | TgtPrompt$ Select target creature without flying that's attacking you | Origin$ Battlefield | Destination$ Exile | SubAbility$ ExileSelf | SpellDescription$ Exile CARDNAME and target creature without flying that's attacking you.
SVar:ExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile
A:AB$ ChangeZone | Cost$ 1 R G T | ValidTgts$ Creature.withoutFlying+attackingYou | ThisDefinedAndTgts$ Self | TgtPrompt$ Select target creature without flying that's attacking you | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile CARDNAME and target creature without flying that's attacking you.
Oracle:{1}{R}{G}, {T}: Exile Hunting Kavu and target creature without flying that's attacking you.

View File

@@ -2,6 +2,5 @@ Name:Mangara of Corondor
ManaCost:1 W W
Types:Legendary Creature Human Wizard
PT:1/1
A:AB$ ChangeZone | Cost$ T | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Permanent | SubAbility$ DBChange | SpellDescription$ Exile CARDNAME and target permanent.
SVar:DBChange:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile
A:AB$ ChangeZone | Cost$ T | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Permanent | ThisDefinedAndTgts$ Self | SpellDescription$ Exile CARDNAME and target permanent.
Oracle:{T}: Exile Mangara of Corondor and target permanent.

View File

@@ -2,7 +2,7 @@ Name:Quickening Licid
ManaCost:1 W
Types:Creature Licid
PT:1/1
A:AB$ Animate | Cost$ W T | Defined$ Self | RemoveThisAbility$ True | Duration$ Permanent | RevertCost$ W | Keywords$ Enchant creature | Abilities$ SPAttach | Types$ Enchantment,Aura | RemoveCardTypes$ True | RemoveEnchantmentTypes$ True | SubAbility$ DBAttach | SpellDescription$ CARDNAME loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.
A:AB$ Animate | Cost$ 1 W T | Defined$ Self | RemoveThisAbility$ True | Duration$ Permanent | RevertCost$ W | Keywords$ Enchant creature | Abilities$ SPAttach | Types$ Enchantment,Aura | RemoveCardTypes$ True | RemoveEnchantmentTypes$ True | SubAbility$ DBAttach | SpellDescription$ CARDNAME loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.
SVar:DBAttach:DB$ Attach | ValidTgts$ Creature | AILogic$ Pump
SVar:SPAttach:SP$ Attach | Cost$ 0 | ValidTgts$ Creature
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ First Strike | Description$ Enchanted creature has first strike.

View File

@@ -5,7 +5,7 @@ PT:*/*
K:Trample
K:ETBReplacement:Other:ETBPrep
SVar:ETBPrep:DB$ Cleanup | ClearRemembered$ True | SubAbility$ DBChoose
SVar:DBChoose:DB$ ChooseCard | Defined$ You | MinAmount$ 0 | Amount$ X | Choices$ Creature.YouOwn+Other | ChoiceTitle$ Exile any number of creature cards from your graveyard | ChoiceZone$ Graveyard | RememberChosen$ True | SubAbility$ ExileCreatures | SpellDescription$ As CARDNAME enters the battlefield, exile any number of creature cards from your graveyard. CARDNAME's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.
SVar:DBChoose:DB$ ChooseCard | Defined$ You | MinAmount$ 0 | Amount$ X | Choices$ Creature.YouOwn+Other+NotDefinedReplacedSimultaneousETB | ChoiceTitle$ Exile any number of creature cards from your graveyard | ChoiceZone$ Graveyard | RememberChosen$ True | SubAbility$ ExileCreatures | SpellDescription$ As CARDNAME enters the battlefield, exile any number of creature cards from your graveyard. CARDNAME's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.
SVar:ExileCreatures:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered | Origin$ Graveyard | Destination$ Exile | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True
S:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self | SetPower$ TotalPower | SetToughness$ TotalToughness | Description$ CARDNAME's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.

View File

@@ -3,9 +3,8 @@ ManaCost:3 U U
Types:Creature Shapeshifter
PT:0/0
# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone
K:ETBReplacement:Copy:ChooseCreature:Optional
SVar:ChooseCreature:DB$ ChooseCard | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | 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 has "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 and it has this ability."
SVar:DBCopy:DB$ Clone | Defined$ ChosenCard | SetColor$ Blue | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig
K:ETBReplacement:Copy:DBCopy:Optional
SVar:DBCopy:DB$ Clone | Choices$ Creature.Other | SetColor$ Blue | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig | 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 has "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 and it has this ability."
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 and it has this ability.
SVar:VesDopCopy:DB$ Clone | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | SetColor$ Blue | GainThisAbility$ True | AddSVars$ VesDopCopy | AILogic$ CloneBestCreature
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 has "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 and it has this ability."

View File

@@ -2,6 +2,5 @@ Name:Void Stalker
ManaCost:1 U
Types:Creature Elemental
PT:2/1
A:AB$ ChangeZone | Cost$ 2 U T | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | Shuffle$ True | SubAbility$ SelfBounce | SpellDescription$ Put CARDNAME and target creature on top of their owner's libraries, then those players shuffle their libraries.
SVar:SelfBounce:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | Shuffle$ True
A:AB$ ChangeZone | Cost$ 2 U T | ValidTgts$ Creature | ThisDefinedAndTgts$ Self | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | Shuffle$ True | SpellDescription$ Put CARDNAME and target creature on top of their owner's libraries, then those players shuffle their libraries.
Oracle:{2}{U}, {T}: Put Void Stalker and target creature on top of their owners' libraries, then those players shuffle their libraries.