This commit is contained in:
LevelX2 2013-11-15 08:04:30 +01:00
commit c4bb1fb0c9
14 changed files with 357 additions and 234 deletions

View file

@ -0,0 +1,72 @@
/*
* 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.sets.commander2013;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.TargetPlayer;
/**
*
* @author LevelX2
*/
public class AngelOfFinality extends CardImpl<AngelOfFinality> {
public AngelOfFinality(UUID ownerId) {
super(ownerId, 4, "Angel of Finality", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "C13";
this.subtype.add("Angel");
this.color.setWhite(true);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Angel of Finality enters the battlefield, exile all cards from target player's graveyard.
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileGraveyardAllTargetPlayerEffect());
ability.addTarget(new TargetPlayer(true));
this.addAbility(ability);
}
public AngelOfFinality(final AngelOfFinality card) {
super(card);
}
@Override
public AngelOfFinality copy() {
return new AngelOfFinality(this);
}
}

View file

@ -0,0 +1,102 @@
/*
* 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.sets.commander2013;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.decorator.ConditionalManaEffect;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.token.SpiritWhiteToken;
/**
*
* @author LevelX2
*/
public class KirtarsWrath extends CardImpl<KirtarsWrath> {
public KirtarsWrath(UUID ownerId) {
super(ownerId, 15, "Kirtar's Wrath", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}");
this.expansionSetCode = "C13";
this.color.setWhite(true);
// Destroy all creatures. They can't be regenerated.
// Threshold - If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new KirtarsWrathEffect(),
new DestroyAllEffect(new FilterCreaturePermanent("all creatures"), true),
new CardsInControllerGraveCondition(7),
"Destroy all creatures. They can't be regenerated.<br/><br/><i>Threshold<i/> - If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated"));
}
public KirtarsWrath(final KirtarsWrath card) {
super(card);
}
@Override
public KirtarsWrath copy() {
return new KirtarsWrath(this);
}
}
class KirtarsWrathEffect extends OneShotEffect<KirtarsWrathEffect> {
public KirtarsWrathEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated";
}
public KirtarsWrathEffect(final KirtarsWrathEffect effect) {
super(effect);
}
@Override
public KirtarsWrathEffect copy() {
return new KirtarsWrathEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
new DestroyAllEffect(new FilterCreaturePermanent("all creatures"), true).apply(game, source);
return new CreateTokenEffect(new SpiritWhiteToken(), 2).apply(game, source);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.sets.odyssey;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class KirtarsWrath extends mage.sets.commander2013.KirtarsWrath {
public KirtarsWrath(UUID ownerId) {
super(ownerId);
this.cardNumber = 28;
this.expansionSetCode = "ODY";
}
public KirtarsWrath(final KirtarsWrath card) {
super(card);
}
@Override
public KirtarsWrath copy() {
return new KirtarsWrath(this);
}
}

View file

@ -27,18 +27,16 @@
*/
package mage.sets.returntoravnica;
import java.util.ArrayList;
import java.util.UUID;
import mage.constants.CardType;
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.DestroyTargetEffect;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
@ -61,7 +59,7 @@ public class RakdosCharm extends CardImpl<RakdosCharm> {
this.color.setRed(true);
// 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());
// 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;
}
}
}

View file

@ -27,24 +27,19 @@
*/
package mage.sets.scarsofmirrodin;
import java.util.ArrayList;
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.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.players.Player;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
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}");
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.addTarget(new TargetPlayer());
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));
}
@ -73,30 +70,3 @@ public class NihilSpellbomb extends CardImpl<NihilSpellbomb> {
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;
}
}

View file

@ -27,23 +27,17 @@
*/
package mage.sets.shardsofalara;
import java.util.ArrayList;
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.Outcome;
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.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
@ -62,7 +56,7 @@ public class JundCharm extends CardImpl<JundCharm> {
this.color.setBlack(true);
// 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());
// or Jund Charm deals 2 damage to each creature;
Mode mode = new Mode();
@ -84,29 +78,3 @@ public class JundCharm extends CardImpl<JundCharm> {
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;
}
}

View file

@ -82,7 +82,7 @@ class MightyEmergenceTriggeredAbility extends TriggeredAbilityImpl<MightyEmergen
}
public MightyEmergenceTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersTargetEffect(), true);
super(Zone.BATTLEFIELD, new MightyEmergenceAddCountersTargetEffect(), true);
}
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);
}
public AddCountersTargetEffect(final AddCountersTargetEffect effect) {
public MightyEmergenceAddCountersTargetEffect(final MightyEmergenceAddCountersTargetEffect effect) {
super(effect);
}
@ -145,8 +145,8 @@ class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffect> {
}
@Override
public AddCountersTargetEffect copy() {
return new AddCountersTargetEffect(this);
public MightyEmergenceAddCountersTargetEffect copy() {
return new MightyEmergenceAddCountersTargetEffect(this);
}

View file

@ -27,20 +27,15 @@
*/
package mage.sets.timeshifted;
import java.util.ArrayList;
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.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.players.Player;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPlayer;
/**
@ -54,7 +49,7 @@ public class TormodsCrypt extends CardImpl<TormodsCrypt> {
this.expansionSetCode = "TSB";
// {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.addTarget(new TargetPlayer());
this.addAbility(ability);
@ -69,29 +64,3 @@ public class TormodsCrypt extends CardImpl<TormodsCrypt> {
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;
}
}

View file

@ -28,13 +28,13 @@
package mage.sets.torment;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.Mana;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.decorator.ConditionalManaEffect;
import mage.abilities.effects.common.BasicManaEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
@ -49,13 +49,12 @@ public class CabalRitual extends CardImpl<CabalRitual> {
this.color.setBlack(true);
// Add {B}{B}{B} to your mana pool.
this.getSpellAbility().addEffect(new BasicManaEffect(new Mana(0, 0, 0, 0, 3, 0, 0)));
// Threshold - Add {B}{B}{B}{B}{B} to your mana pool instead if seven or more cards are in your graveyard.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new BasicManaEffect(new Mana(0, 0, 0, 0, 2, 0, 0)),
// Threshold Add {B}{B}{B}{B}{B} to your mana pool instead if seven or more cards are in your graveyard.
this.getSpellAbility().addEffect(new ConditionalManaEffect(
new BasicManaEffect(new Mana(0, 0, 0, 0, 5, 0, 0)),
new BasicManaEffect(new Mana(0, 0, 0, 0, 3, 0, 0)),
new CardsInControllerGraveCondition(7),
"Threshold - Add {B}{B}{B}{B}{B} to your mana pool instead if seven or more cards are in your graveyard"
));
"Add {B}{B}{B} to your mana pool.<br/><br/><i>Threshold<i/> - Add {B}{B}{B}{B}{B} to your mana pool instead if seven or more cards are in your graveyard"));
}
public CabalRitual(final CabalRitual card) {

View file

@ -29,16 +29,17 @@ package mage.sets.worldwake;
import java.util.ArrayList;
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.EntersBattlefieldTappedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.abilities.mana.BlackManaAbility;
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.players.Player;
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}, "");
this.expansionSetCode = "WWK";
// Bojuka Bog enters the battlefield tapped.
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());
this.addAbility(ability);
// {T}: Add {B} to your mana pool.
this.addAbility(new BlackManaAbility());
}
@ -69,30 +73,3 @@ public class BojukaBog extends CardImpl<BojukaBog> {
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;
}
}

View file

@ -36,6 +36,7 @@ import mage.abilities.Ability;
import mage.abilities.costs.AlternativeCostImpl;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
@ -63,7 +64,7 @@ public class RavenousTrap extends CardImpl<RavenousTrap> {
this.addWatcher(new CardsPutIntoGraveyardWatcher());
// Exile all cards from target player's graveyard.
this.getSpellAbility().addEffect(new RavenousTrapEffect());
this.getSpellAbility().addEffect(new ExileGraveyardAllTargetPlayerEffect());
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";
}
}
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;
}
}

View file

@ -5,14 +5,14 @@ import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.players.Player;
/**
* Condition for -
* Controller has X or more cards in his or her graveyard
* Condition for - Controller has X or more cards in his or her graveyard
*
* @author LevelX2
*/
public class CardsInControllerGraveCondition implements Condition {
private int value;
private final int value;
public CardsInControllerGraveCondition(int value) {
this.value = value;
@ -20,11 +20,7 @@ public class CardsInControllerGraveCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Player p = game.getPlayer(source.getControllerId());
if (p != null && p.getGraveyard().size() >= value)
{
return true;
}
return false;
Player player = game.getPlayer(source.getControllerId());
return player != null && player.getGraveyard().size() >= value;
}
}

View file

@ -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;
}
}

View file

@ -920,9 +920,11 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
}
if (zone != Zone.HAND) {
if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.CAST, game)) {
for (ActivatedAbility ability: object.getAbilities().getActivatedAbilities(Zone.HAND)) {
for (Ability ability: object.getAbilities()) {
ability.setControllerId(this.getId());
useable.put(ability.getId(), ability);
if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND)) {
useable.put(ability.getId(), (ActivatedAbility) ability);
}
}
}
}
@ -1755,8 +1757,9 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
for (ExileZone exile: game.getExile().getExileZones()) {
for (Card card: exile.getCards(game)) {
if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.CAST, game)) {
for (ActivatedAbility ability: card.getAbilities().getActivatedAbilities(Zone.HAND)) {
if (ability instanceof SpellAbility || ability instanceof PlayLandAbility) {
for (Ability ability: card.getAbilities()) {
ability.setControllerId(this.getId()); // controller must be set for case owner != caster
if (ability.getZone().match(Zone.HAND) && (ability instanceof SpellAbility || ability instanceof PlayLandAbility)) {
playable.add(ability);
}
}