diff --git a/res/cardsfolder/d/dodecapod.txt b/res/cardsfolder/d/dodecapod.txt index db52c7f2ab4..84601b379d4 100644 --- a/res/cardsfolder/d/dodecapod.txt +++ b/res/cardsfolder/d/dodecapod.txt @@ -3,7 +3,10 @@ ManaCost:4 Types:Artifact Creature Golem Text:no text PT:3/3 -K:If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield with two +1/+1 counters on it instead of putting it into your graveyard. +R:Event$ Discard | ActiveZones$ Hand | ValidCard$ Card.Self | ValidSource$ Card.OppCtrl | ReplaceWith$ SurpriseETB | DiscardFromEffect$ True | Description$ If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield with two +1/+1 counters on it instead of putting it into your graveyard. +SVar:SurpriseETB:DB$ ChangeZone | DefinedPlayer$ ReplacedPlayer | Defined$ ReplacedCard | Origin$ Hand | Destination$ Battlefield | SubAbility$ TwiceTheSurprise +SVar:TwiceTheSurprise:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ P1P1 | CounterNum$ 2 +SVar:DiscardMeByOpp:3 SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/dodecapod.jpg SetInfo:APC|Uncommon|http://magiccards.info/scans/en/ap/134.jpg diff --git a/res/cardsfolder/g/guerrilla_tactics.txt b/res/cardsfolder/g/guerrilla_tactics.txt index 4021ac2e5e2..25bc37fb844 100644 --- a/res/cardsfolder/g/guerrilla_tactics.txt +++ b/res/cardsfolder/g/guerrilla_tactics.txt @@ -5,6 +5,7 @@ Text:no text A:SP$ DealDamage | Cost$ 1 R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to target creature or player. T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ TrigDoubleDmg | TriggerDescription$ When a spell or ability an opponent controls causes you to discard CARDNAME, CARDNAME deals 4 damage to target creature or player. SVar:TrigDoubleDmg:AB$ DealDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 4 +SVar:DiscardMeByOpp:3 SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/guerrilla_tactics.jpg SetInfo:8ED|Uncommon|http://magiccards.info/scans/en/8e/192.jpg diff --git a/res/cardsfolder/l/loxodon_smiter.txt b/res/cardsfolder/l/loxodon_smiter.txt index d0b604f5efa..a0eae292a4a 100644 --- a/res/cardsfolder/l/loxodon_smiter.txt +++ b/res/cardsfolder/l/loxodon_smiter.txt @@ -4,7 +4,9 @@ Types:Creature Elephant Soldier Text:no text PT:4/4 K:CARDNAME can't be countered. -K:If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard. +R:Event$ Discard | ActiveZones$ Hand | ValidCard$ Card.Self | ValidSource$ Card.OppCtrl | ReplaceWith$ SurpriseETB | DiscardFromEffect$ True | Description$ If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard. +SVar:SurpriseETB:DB$ ChangeZone | DefinedPlayer$ ReplacedPlayer | Defined$ ReplacedCard | Origin$ Hand | Destination$ Battlefield +SVar:DiscardMeByOpp:2 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/loxodon_smiter.jpg SetInfo:RTR|Rare|http://magiccards.info/scans/en/rtr/178.jpg diff --git a/res/cardsfolder/m/mangaras_blessing.txt b/res/cardsfolder/m/mangaras_blessing.txt index 12a0643e0d0..be62e1cbaa6 100644 --- a/res/cardsfolder/m/mangaras_blessing.txt +++ b/res/cardsfolder/m/mangaras_blessing.txt @@ -7,6 +7,7 @@ T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ T SVar:TrigGainLife:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 2 | SubAbility$ DelayReturn SVar:DelayReturn:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Return CARDNAME from your graveyard to your hand. SVar:TrigReturn:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | Defined$ Self +SVar:DiscardMeByOpp:3 SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/mangaras_blessing.jpg SetInfo:MIR|Uncommon|http://magiccards.info/scans/en/mr/229.jpg diff --git a/res/cardsfolder/m/metrognome.txt b/res/cardsfolder/m/metrognome.txt index 31d14c4d405..c12250f8236 100644 --- a/res/cardsfolder/m/metrognome.txt +++ b/res/cardsfolder/m/metrognome.txt @@ -4,8 +4,9 @@ Types:Artifact Text:no text A:AB$ Token | Cost$ 4 T | TokenAmount$ 1 | TokenName$ Gnome | TokenTypes$ Artifact,Creature,Gnome | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless Gnome artifact creature token onto the battlefield. T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ TrigToken | TriggerDescription$ When a spell or ability an opponent controls causes you to discard CARDNAME, put four 1/1 colorless Gnome artifact creature tokens onto the battlefield. -SVar:TrigToken:DB$Token | TokenAmount$ 4 | TokenName$ Gnome | TokenTypes$ Artifact,Creature,Gnome | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 +SVar:TrigToken:DB$ Token | TokenAmount$ 4 | TokenName$ Gnome | TokenTypes$ Artifact,Creature,Gnome | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 SVar:Rarity:Rare +SVar:DiscardMeByOpp:2 SVar:Picture:http://www.wizards.com/global/images/magic/general/metrognome.jpg SetInfo:USG|Rare|http://magiccards.info/scans/en/us/301.jpg Oracle:When a spell or ability an opponent controls causes you to discard Metrognome, put four 1/1 colorless Gnome artifact creature tokens onto the battlefield.\n{4}, {T}: Put a 1/1 colorless Gnome artifact creature token onto the battlefield. diff --git a/res/cardsfolder/o/obstinate_baloth.txt b/res/cardsfolder/o/obstinate_baloth.txt index 777de0f7a9a..0fe8abad773 100644 --- a/res/cardsfolder/o/obstinate_baloth.txt +++ b/res/cardsfolder/o/obstinate_baloth.txt @@ -3,9 +3,11 @@ ManaCost:2 G G Types:Creature Beast Text:no text PT:4/4 -K:If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigGainLife | TriggerDescription$ When CARDNAME enters the battlefield, you gain 4 life. SVar:TrigGainLife:AB$GainLife | Cost$ 0 | LifeAmount$ 4 +R:Event$ Discard | ActiveZones$ Hand | ValidCard$ Card.Self | ValidSource$ Card.OppCtrl | ReplaceWith$ SurpriseETB | DiscardFromEffect$ True | Description$ If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard. +SVar:SurpriseETB:DB$ ChangeZone | DefinedPlayer$ ReplacedPlayer | Defined$ ReplacedCard | Origin$ Hand | Destination$ Battlefield +SVar:DiscardMeByOpp:2 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/obstinate_baloth.jpg SetInfo:M11|Rare|http://magiccards.info/scans/en/m11/188.jpg diff --git a/res/cardsfolder/p/psychic_purge.txt b/res/cardsfolder/p/psychic_purge.txt index 09b7e79429d..52e0bad1f21 100644 --- a/res/cardsfolder/p/psychic_purge.txt +++ b/res/cardsfolder/p/psychic_purge.txt @@ -5,6 +5,7 @@ Text:no text A:SP$ DealDamage | Cost$ U | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ TrigLoseLife | TriggerDescription$ When a spell or ability an opponent controls causes you to discard CARDNAME, that player loses 5 life. SVar:TrigLoseLife:AB$ LoseLife | Cost$ 0 | Defined$ TriggeredCauseController | LifeAmount$ 5 +SVar:DiscardMeByOpp:3 SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/psychic_purge.jpg SetInfo:LEG|Common|http://magiccards.info/scans/en/lg/68.jpg diff --git a/res/cardsfolder/p/pure_intentions.txt b/res/cardsfolder/p/pure_intentions.txt index 55b26dcf9c1..595d512e48b 100644 --- a/res/cardsfolder/p/pure_intentions.txt +++ b/res/cardsfolder/p/pure_intentions.txt @@ -7,6 +7,7 @@ SVar:PureDiscarded:Mode$ Discarded | ValidCard$ Card.YouCtrl | ValidCause$ Card. SVar:TrigPureChange:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Hand T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ TrigPureReturn | TriggerDescription$ When a spell or ability an opponent controls causes you to discard CARDNAME, return it to your hand. SVar:TrigPureReturn:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand +SVar:DiscardMeByOpp:1 SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/q/quagnoth.txt b/res/cardsfolder/q/quagnoth.txt index 16ee18cef81..614a98a6804 100644 --- a/res/cardsfolder/q/quagnoth.txt +++ b/res/cardsfolder/q/quagnoth.txt @@ -6,7 +6,8 @@ PT:4/5 K:Split second K:Shroud T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ TrigReturn | TriggerDescription$ When a spell or ability an opponent controls causes you to discard CARDNAME, return it to your hand. -SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand +SVar:TrigReturn:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand +SVar:DiscardMeByOpp:1 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quagnoth.jpg SetInfo:FUT|Rare|http://magiccards.info/scans/en/fut/150.jpg diff --git a/res/cardsfolder/w/wilt_leaf_liege.txt b/res/cardsfolder/w/wilt_leaf_liege.txt index 0194854b420..c07bea800d4 100644 --- a/res/cardsfolder/w/wilt_leaf_liege.txt +++ b/res/cardsfolder/w/wilt_leaf_liege.txt @@ -3,9 +3,11 @@ ManaCost:1 GW GW GW Types:Creature Elf Knight Text:no text PT:4/4 -K:If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard. S:Mode$ Continuous | Affected$ Creature.Green+Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other green creatures you control get +1/+1. S:Mode$ Continuous | Affected$ Creature.White+Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other white creatures you control get +1/+1. +R:Event$ Discard | ActiveZones$ Hand | ValidCard$ Card.Self | ValidSource$ Card.OppCtrl | ReplaceWith$ SurpriseETB | DiscardFromEffect$ True | Description$ If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard. +SVar:SurpriseETB:DB$ ChangeZone | DefinedPlayer$ ReplacedPlayer | Defined$ ReplacedCard | Origin$ Hand | Destination$ Battlefield +SVar:DiscardMeByOpp:2 SVar:PlayMain1:TRUE SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/wilt_leaf_liege.jpg diff --git a/src/main/java/forge/card/ability/effects/DiscardEffect.java b/src/main/java/forge/card/ability/effects/DiscardEffect.java index 976f6701d18..5d55ca4d850 100644 --- a/src/main/java/forge/card/ability/effects/DiscardEffect.java +++ b/src/main/java/forge/card/ability/effects/DiscardEffect.java @@ -114,9 +114,7 @@ public class DiscardEffect extends RevealEffectBase { List goodChoices = CardLists.filter(dPChHand, new Predicate() { @Override public boolean apply(final Card c) { - if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME," - + " put it onto the battlefield instead of putting it into your graveyard.") - || !c.getSVar("DiscardMe").equals("")) { + if (!c.getSVar("DiscardMeByOpp").equals("") || !c.getSVar("DiscardMe").equals("")) { return false; } return true; diff --git a/src/main/java/forge/card/replacement/ReplaceDiscard.java b/src/main/java/forge/card/replacement/ReplaceDiscard.java index d995b2b2498..3b9fe37a0b3 100644 --- a/src/main/java/forge/card/replacement/ReplaceDiscard.java +++ b/src/main/java/forge/card/replacement/ReplaceDiscard.java @@ -56,6 +56,11 @@ public class ReplaceDiscard extends ReplacementEffect { return false; } } + if (this.getMapParams().containsKey("ValidSource")) { + if (!matchesValid(runParams.get("Source"), this.getMapParams().get("ValidSource").split(","), this.getHostCard())) { + return false; + } + } if (this.getMapParams().containsKey("DiscardFromEffect")) { if (null == runParams.get("Source")) { return false; diff --git a/src/main/java/forge/game/player/Player.java b/src/main/java/forge/game/player/Player.java index 46206b68687..c19720f651c 100644 --- a/src/main/java/forge/game/player/Player.java +++ b/src/main/java/forge/game/player/Player.java @@ -150,7 +150,7 @@ public abstract class Player extends GameEntity implements Comparable { private List planarDeck = new ArrayList(); private Card currentPlane = null; - + private PlayerStatistics stats = new PlayerStatistics(); private final List schemeDeck = new ArrayList(); @@ -737,7 +737,7 @@ public abstract class Player extends GameEntity implements Comparable { public final int staticReplaceDamage(final int damage, final Card source, final boolean isCombat) { int restDamage = damage; - + if (this.hasKeyword("Damage that would reduce your life total to less than 1 reduces it to 1 instead.")) { restDamage = Math.min(restDamage, this.life - 1); } @@ -1633,21 +1633,12 @@ public abstract class Player extends GameEntity implements Comparable { game.getAction().discardMadness(c, this); - boolean hasPutIntoPlayInsteadOfDiscard = c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard."); - boolean hasPutIntoPlayWith2xP1P1InsteadOfDiscard = c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME, put it onto the battlefield with two +1/+1 counters on it instead of putting it into your graveyard."); boolean discardToTopOfLibrary = null != sa && sa.hasParam("DiscardToTopOfLibrary"); - if ((hasPutIntoPlayInsteadOfDiscard || hasPutIntoPlayWith2xP1P1InsteadOfDiscard) - && null != sa && sa.getSourceCard().getController().isOpponentOf(c.getController())) { - game.getAction().moveToPlay(c); - - if (hasPutIntoPlayWith2xP1P1InsteadOfDiscard) { - c.addCounter(CounterType.P1P1, 2, false); - } - // Play the corresponding Put into Play sound - game.getEvents().post(new SpellResolvedEvent(c, sa)); - } else if (discardToTopOfLibrary) { + if (discardToTopOfLibrary) { game.getAction().moveToLibrary(c, 0); + // Play the Discard sound + game.getEvents().post(new CardDiscardedEvent()); } else { game.getAction().moveToGraveyard(c);