mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Added ExileGraveyardAllTargetPlayerEffect, changed cards using it.
This commit is contained in:
parent
e8ee9b70f0
commit
28daa2cd29
8 changed files with 108 additions and 209 deletions
|
|
@ -27,18 +27,16 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.returntoravnica;
|
package mage.sets.returntoravnica;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
|
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -61,7 +59,7 @@ public class RakdosCharm extends CardImpl<RakdosCharm> {
|
||||||
this.color.setRed(true);
|
this.color.setRed(true);
|
||||||
|
|
||||||
// Choose one — Exile all cards from target player's graveyard;
|
// Choose one — Exile all cards from target player's graveyard;
|
||||||
this.getSpellAbility().addEffect(new RakdosCharmExileEffect());
|
this.getSpellAbility().addEffect(new ExileGraveyardAllTargetPlayerEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
|
|
||||||
// or destroy target artifact;
|
// or destroy target artifact;
|
||||||
|
|
@ -119,30 +117,4 @@ public class RakdosCharm extends CardImpl<RakdosCharm> {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class RakdosCharmExileEffect extends OneShotEffect<RakdosCharmExileEffect> {
|
|
||||||
|
|
||||||
public RakdosCharmExileEffect() {
|
|
||||||
super(Outcome.Exile);
|
|
||||||
staticText = "Exile all cards from target player's graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RakdosCharmExileEffect copy() {
|
|
||||||
return new RakdosCharmExileEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
|
||||||
if (targetPlayer != null) {
|
|
||||||
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
|
||||||
for (UUID cardId : graveyard) {
|
|
||||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -27,24 +27,19 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.scarsofmirrodin;
|
package mage.sets.scarsofmirrodin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.DiesTriggeredAbility;
|
import mage.abilities.common.DiesTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||||
|
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.game.Game;
|
import mage.constants.CardType;
|
||||||
import mage.players.Player;
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,10 +52,12 @@ public class NihilSpellbomb extends CardImpl<NihilSpellbomb> {
|
||||||
super(ownerId, 187, "Nihil Spellbomb", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
|
super(ownerId, 187, "Nihil Spellbomb", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
|
||||||
this.expansionSetCode = "SOM";
|
this.expansionSetCode = "SOM";
|
||||||
|
|
||||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NihilSpellbombEffect(), new TapSourceCost());
|
// {T}, Sacrifice Nihil Spellbomb: Exile all cards from target player's graveyard.
|
||||||
|
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileGraveyardAllTargetPlayerEffect(), new TapSourceCost());
|
||||||
ability.addCost(new SacrificeSourceCost());
|
ability.addCost(new SacrificeSourceCost());
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
// When Nihil Spellbomb is put into a graveyard from the battlefield, you may pay {B}. If you do, draw a card.
|
||||||
this.addAbility(new DiesTriggeredAbility(new DoIfCostPaid(new DrawCardControllerEffect(1), new ManaCostsImpl("{B}")), false));
|
this.addAbility(new DiesTriggeredAbility(new DoIfCostPaid(new DrawCardControllerEffect(1), new ManaCostsImpl("{B}")), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,30 +70,3 @@ public class NihilSpellbomb extends CardImpl<NihilSpellbomb> {
|
||||||
return new NihilSpellbomb(this);
|
return new NihilSpellbomb(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class NihilSpellbombEffect extends OneShotEffect<NihilSpellbombEffect> {
|
|
||||||
|
|
||||||
public NihilSpellbombEffect() {
|
|
||||||
super(Outcome.Exile);
|
|
||||||
staticText = "Exile all cards from target player's graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NihilSpellbombEffect copy() {
|
|
||||||
return new NihilSpellbombEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
|
||||||
if (targetPlayer != null) {
|
|
||||||
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
|
||||||
for (UUID cardId : graveyard) {
|
|
||||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -27,23 +27,17 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.shardsofalara;
|
package mage.sets.shardsofalara;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.abilities.Mode;
|
||||||
|
import mage.abilities.effects.common.DamageAllEffect;
|
||||||
|
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
|
||||||
|
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.Mode;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.effects.common.DamageAllEffect;
|
|
||||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
|
@ -62,7 +56,7 @@ public class JundCharm extends CardImpl<JundCharm> {
|
||||||
this.color.setBlack(true);
|
this.color.setBlack(true);
|
||||||
|
|
||||||
// Choose one - Exile all cards from target player's graveyard;
|
// Choose one - Exile all cards from target player's graveyard;
|
||||||
this.getSpellAbility().addEffect(new JundCharmEffect());
|
this.getSpellAbility().addEffect(new ExileGraveyardAllTargetPlayerEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
// or Jund Charm deals 2 damage to each creature;
|
// or Jund Charm deals 2 damage to each creature;
|
||||||
Mode mode = new Mode();
|
Mode mode = new Mode();
|
||||||
|
|
@ -84,29 +78,3 @@ public class JundCharm extends CardImpl<JundCharm> {
|
||||||
return new JundCharm(this);
|
return new JundCharm(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class JundCharmEffect extends OneShotEffect<JundCharmEffect> {
|
|
||||||
|
|
||||||
public JundCharmEffect() {
|
|
||||||
super(Outcome.Exile);
|
|
||||||
staticText = "Exile all cards from target player's graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JundCharmEffect copy() {
|
|
||||||
return new JundCharmEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
|
||||||
if (targetPlayer != null) {
|
|
||||||
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
|
||||||
for (UUID cardId : graveyard) {
|
|
||||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class MightyEmergenceTriggeredAbility extends TriggeredAbilityImpl<MightyEmergen
|
||||||
}
|
}
|
||||||
|
|
||||||
public MightyEmergenceTriggeredAbility() {
|
public MightyEmergenceTriggeredAbility() {
|
||||||
super(Zone.BATTLEFIELD, new AddCountersTargetEffect(), true);
|
super(Zone.BATTLEFIELD, new MightyEmergenceAddCountersTargetEffect(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MightyEmergenceTriggeredAbility(MightyEmergenceTriggeredAbility ability) {
|
public MightyEmergenceTriggeredAbility(MightyEmergenceTriggeredAbility ability) {
|
||||||
|
|
@ -117,15 +117,15 @@ class MightyEmergenceTriggeredAbility extends TriggeredAbilityImpl<MightyEmergen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffect> {
|
class MightyEmergenceAddCountersTargetEffect extends OneShotEffect<MightyEmergenceAddCountersTargetEffect> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public AddCountersTargetEffect() {
|
public MightyEmergenceAddCountersTargetEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddCountersTargetEffect(final AddCountersTargetEffect effect) {
|
public MightyEmergenceAddCountersTargetEffect(final MightyEmergenceAddCountersTargetEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,8 +145,8 @@ class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffect> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AddCountersTargetEffect copy() {
|
public MightyEmergenceAddCountersTargetEffect copy() {
|
||||||
return new AddCountersTargetEffect(this);
|
return new MightyEmergenceAddCountersTargetEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,15 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.timeshifted;
|
package mage.sets.timeshifted;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.game.Game;
|
import mage.constants.CardType;
|
||||||
import mage.players.Player;
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +49,7 @@ public class TormodsCrypt extends CardImpl<TormodsCrypt> {
|
||||||
this.expansionSetCode = "TSB";
|
this.expansionSetCode = "TSB";
|
||||||
|
|
||||||
// {tap}, Sacrifice Tormod's Crypt: Exile all cards from target player's graveyard.
|
// {tap}, Sacrifice Tormod's Crypt: Exile all cards from target player's graveyard.
|
||||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TormodsCryptEffect(), new TapSourceCost());
|
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileGraveyardAllTargetPlayerEffect(), new TapSourceCost());
|
||||||
ability.addCost(new SacrificeSourceCost());
|
ability.addCost(new SacrificeSourceCost());
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
@ -69,29 +64,3 @@ public class TormodsCrypt extends CardImpl<TormodsCrypt> {
|
||||||
return new TormodsCrypt(this);
|
return new TormodsCrypt(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TormodsCryptEffect extends OneShotEffect<TormodsCryptEffect> {
|
|
||||||
|
|
||||||
public TormodsCryptEffect() {
|
|
||||||
super(Outcome.Exile);
|
|
||||||
staticText = "Exile all cards from target player's graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TormodsCryptEffect copy() {
|
|
||||||
return new TormodsCryptEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
|
||||||
if (targetPlayer != null) {
|
|
||||||
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
|
||||||
for (UUID cardId : graveyard) {
|
|
||||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -29,16 +29,17 @@ package mage.sets.worldwake;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
|
||||||
import mage.abilities.mana.BlackManaAbility;
|
import mage.abilities.mana.BlackManaAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
@ -53,10 +54,13 @@ public class BojukaBog extends CardImpl<BojukaBog> {
|
||||||
super(ownerId, 132, "Bojuka Bog", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
|
super(ownerId, 132, "Bojuka Bog", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
|
||||||
this.expansionSetCode = "WWK";
|
this.expansionSetCode = "WWK";
|
||||||
|
|
||||||
|
// Bojuka Bog enters the battlefield tapped.
|
||||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BojukaBogEffect());
|
// When Bojuka Bog enters the battlefield, exile all cards from target player's graveyard.
|
||||||
|
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ExileGraveyardAllTargetPlayerEffect());
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
// {T}: Add {B} to your mana pool.
|
||||||
this.addAbility(new BlackManaAbility());
|
this.addAbility(new BlackManaAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,30 +73,3 @@ public class BojukaBog extends CardImpl<BojukaBog> {
|
||||||
return new BojukaBog(this);
|
return new BojukaBog(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BojukaBogEffect extends OneShotEffect<BojukaBogEffect> {
|
|
||||||
|
|
||||||
public BojukaBogEffect() {
|
|
||||||
super(Outcome.Exile);
|
|
||||||
staticText = "exile all cards from target player's graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BojukaBogEffect copy() {
|
|
||||||
return new BojukaBogEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
|
||||||
if (targetPlayer != null) {
|
|
||||||
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
|
||||||
for (UUID cardId : graveyard) {
|
|
||||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.AlternativeCostImpl;
|
import mage.abilities.costs.AlternativeCostImpl;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
|
@ -63,7 +64,7 @@ public class RavenousTrap extends CardImpl<RavenousTrap> {
|
||||||
this.addWatcher(new CardsPutIntoGraveyardWatcher());
|
this.addWatcher(new CardsPutIntoGraveyardWatcher());
|
||||||
|
|
||||||
// Exile all cards from target player's graveyard.
|
// Exile all cards from target player's graveyard.
|
||||||
this.getSpellAbility().addEffect(new RavenousTrapEffect());
|
this.getSpellAbility().addEffect(new ExileGraveyardAllTargetPlayerEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,30 +112,3 @@ class RavenousTrapAlternativeCost extends AlternativeCostImpl<RavenousTrapAltern
|
||||||
return "If an opponent had three or more cards put into his or her graveyard from anywhere this turn, you may pay {0} rather than pay Ravenous Trap's mana cost";
|
return "If an opponent had three or more cards put into his or her graveyard from anywhere this turn, you may pay {0} rather than pay Ravenous Trap's mana cost";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RavenousTrapEffect extends OneShotEffect<RavenousTrapEffect> {
|
|
||||||
|
|
||||||
public RavenousTrapEffect() {
|
|
||||||
super(Outcome.Exile);
|
|
||||||
staticText = "Exile all cards from target player's graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RavenousTrapEffect copy() {
|
|
||||||
return new RavenousTrapEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
|
||||||
if (targetPlayer != null) {
|
|
||||||
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
|
||||||
for (UUID cardId : graveyard) {
|
|
||||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
|
* permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package mage.abilities.effects.common;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LevelX2
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ExileGraveyardAllTargetPlayerEffect extends OneShotEffect<ExileGraveyardAllTargetPlayerEffect> {
|
||||||
|
|
||||||
|
public ExileGraveyardAllTargetPlayerEffect() {
|
||||||
|
super(Outcome.Exile);
|
||||||
|
staticText = "exile all cards from target player's graveyard";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExileGraveyardAllTargetPlayerEffect copy() {
|
||||||
|
return new ExileGraveyardAllTargetPlayerEffect();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||||
|
if (targetPlayer != null) {
|
||||||
|
ArrayList<UUID> graveyard = new ArrayList<UUID>(targetPlayer.getGraveyard());
|
||||||
|
for (UUID cardId : graveyard) {
|
||||||
|
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue