- Added cards from Alara Reborn that I could not test due to a deckvalidation issue with latest build.

This commit is contained in:
Jeff 2013-07-07 14:26:21 -05:00
parent 5a8a7b19de
commit a44d6aacd0
16 changed files with 1674 additions and 0 deletions

View file

@ -0,0 +1,81 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.MayTapOrUntapTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.SoldierToken;
import mage.target.TargetPermanent;
/**
*
* @author jeffwadsworth
*/
public class BantSojourners extends CardImpl<BantSojourners> {
public BantSojourners(UUID ownerId) {
super(ownerId, 125, "Bant Sojourners", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}");
this.expansionSetCode = "ARB";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.color.setBlue(true);
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// When you cycle Bant Sojourners or it dies, you may put a 1/1 white Soldier creature token onto the battlefield.
Ability ability1 = new CycleTriggeredAbility(new CreateTokenEffect(new SoldierToken()), true);
Ability ability2 = new DiesTriggeredAbility(new CreateTokenEffect(new SoldierToken()), true);
this.addAbility(ability1);
this.addAbility(ability2);
// Cycling {2}{W}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{W}")));
}
public BantSojourners(final BantSojourners card) {
super(card);
}
@Override
public BantSojourners copy() {
return new BantSojourners(this);
}
}

View file

@ -0,0 +1,100 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class DrasticRevelation extends CardImpl<DrasticRevelation> {
public DrasticRevelation(UUID ownerId) {
super(ownerId, 111, "Drastic Revelation", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}{B}{R}");
this.expansionSetCode = "ARB";
this.color.setRed(true);
this.color.setBlue(true);
this.color.setBlack(true);
// Discard your hand. Draw seven cards, then discard three cards at random.
this.getSpellAbility().addEffect(new DrasticRevelationEffect());
}
public DrasticRevelation(final DrasticRevelation card) {
super(card);
}
@Override
public DrasticRevelation copy() {
return new DrasticRevelation(this);
}
}
class DrasticRevelationEffect extends OneShotEffect<DrasticRevelationEffect> {
DrasticRevelationEffect() {
super(Outcome.DrawCard);
staticText = "Discard your hand. Draw seven cards, then discard three cards at random";
}
DrasticRevelationEffect(final DrasticRevelationEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
you.discardToMax(game);
you.drawCards(7, game);
Cards hand = you.getHand();
for (int i = 0; i < 3; i++) {
Card card = hand.getRandom(game);
if (card != null) {
you.discard(card, source, game);
}
}
return false;
}
@Override
public DrasticRevelationEffect copy() {
return new DrasticRevelationEffect(this);
}
}

View file

@ -0,0 +1,81 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.MayTapOrUntapTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.TargetPermanent;
/**
*
* @author jeffwadsworth
*/
public class EsperSojourners extends CardImpl<EsperSojourners> {
public EsperSojourners(UUID ownerId) {
super(ownerId, 107, "Esper Sojourners", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{W}{U}{B}");
this.expansionSetCode = "ARB";
this.subtype.add("Vedalken");
this.subtype.add("Wizard");
this.color.setBlue(true);
this.color.setBlack(true);
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// When you cycle Esper Sojourners or it dies, you may tap or untap target permanent.
Ability ability1 = new CycleTriggeredAbility(new MayTapOrUntapTargetEffect());
Ability ability2 = new DiesTriggeredAbility(new MayTapOrUntapTargetEffect());
ability1.addTarget(new TargetPermanent());
ability2.addTarget(new TargetPermanent());
this.addAbility(ability1);
this.addAbility(ability2);
// Cycling {2}{U}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{U}")));
}
public EsperSojourners(final EsperSojourners card) {
super(card);
}
@Override
public EsperSojourners copy() {
return new EsperSojourners(this);
}
}

View file

@ -0,0 +1,123 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class EtherwroughtPage extends CardImpl<EtherwroughtPage> {
public EtherwroughtPage(UUID ownerId) {
super(ownerId, 108, "Etherwrought Page", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}{W}{U}{B}");
this.expansionSetCode = "ARB";
this.color.setBlue(true);
this.color.setBlack(true);
this.color.setWhite(true);
// At the beginning of your upkeep, choose one - You gain 2 life; or look at the top card of your library, then you may put that card into your graveyard; or each opponent loses 1 life.
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), TargetController.YOU, false);
// or look at the top card of your library, then you may put that card into your graveyard;
Mode mode = new Mode();
mode.getEffects().add(new EtherwroughtPageEffect());
ability.addMode(mode);
// or each opponent loses 1 life
Mode mode1 = new Mode();
mode1.getEffects().add(new LoseLifeOpponentsEffect(1));
ability.addMode(mode1);
this.addAbility(ability);
}
public EtherwroughtPage(final EtherwroughtPage card) {
super(card);
}
@Override
public EtherwroughtPage copy() {
return new EtherwroughtPage(this);
}
}
class EtherwroughtPageEffect extends OneShotEffect<EtherwroughtPageEffect> {
public EtherwroughtPageEffect() {
super(Outcome.DrawCard);
this.staticText = "or look at the top card of your library, then you may put that card into your graveyard";
}
public EtherwroughtPageEffect(final EtherwroughtPageEffect effect) {
super(effect);
}
@Override
public EtherwroughtPageEffect copy() {
return new EtherwroughtPageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
if (you != null && you.getLibrary().size() > 0) {
Card card = you.getLibrary().getFromTop(game);
if (card != null) {
CardsImpl cards = new CardsImpl();
cards.add(card);
you.lookAtCards("Etherwrought Page", cards, game);
if (you.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", game)) {
card = you.getLibrary().removeFromTop(game);
return card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
}
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,82 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.target.common.TargetCardInASingleGraveyard;
/**
*
* @author jeffwadsworth
*/
public class GrixisSojourners extends CardImpl<GrixisSojourners> {
public GrixisSojourners(UUID ownerId) {
super(ownerId, 112, "Grixis Sojourners", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{B}{R}");
this.expansionSetCode = "ARB";
this.subtype.add("Zombie");
this.subtype.add("Ogre");
this.color.setRed(true);
this.color.setBlue(true);
this.color.setBlack(true);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// When you cycle Grixis Sojourners or it dies, you may exile target card from a graveyard.
Ability ability1 = new CycleTriggeredAbility(new ExileTargetEffect(), true);
Ability ability2 = new DiesTriggeredAbility(new ExileTargetEffect(), true);
ability1.addTarget(new TargetCardInASingleGraveyard(1, 1, new FilterCard()));
ability2.addTarget(new TargetCardInASingleGraveyard(1, 1, new FilterCard()));
this.addAbility(ability1);
this.addAbility(ability2);
// Cycling {2}{B}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{B}")));
}
public GrixisSojourners(final GrixisSojourners card) {
super(card);
}
@Override
public GrixisSojourners copy() {
return new GrixisSojourners(this);
}
}

View file

@ -0,0 +1,114 @@
/*
* 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.alarareborn;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect;
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.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
*
* @author jeffwadsworth
*/
public class Lavalanche extends CardImpl<Lavalanche> {
public Lavalanche(UUID ownerId) {
super(ownerId, 118, "Lavalanche", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{R}{G}");
this.expansionSetCode = "ARB";
this.color.setRed(true);
this.color.setGreen(true);
this.color.setBlack(true);
// Lavalanche deals X damage to target player and each creature he or she controls.
this.getSpellAbility().addEffect(new LavalancheEffect(new ManacostVariableValue()));
this.getSpellAbility().addTarget(new TargetPlayer());
}
public Lavalanche(final Lavalanche card) {
super(card);
}
@Override
public Lavalanche copy() {
return new Lavalanche(this);
}
}
class LavalancheEffect extends OneShotEffect<LavalancheEffect> {
private DynamicValue amount;
public LavalancheEffect(DynamicValue amount) {
super(Outcome.Damage);
this.amount = amount;
staticText = "Lavalanche deals X damage to target player and each creature he or she controls";
}
public LavalancheEffect(final LavalancheEffect effect) {
super(effect);
this.amount = effect.amount;
}
@Override
public LavalancheEffect copy() {
return new LavalancheEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (targetPlayer == null) {
return false;
}
targetPlayer.damage(amount.calculate(game, source), source.getId(), game, false, true);
FilterPermanent filter = new FilterPermanent("and each creature he or she controls");
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game);
for (Permanent permanent: permanents) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, true, false);
}
return true;
}
}

View file

@ -0,0 +1,178 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.keyword.CascadeAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.game.stack.StackObject;
import mage.watchers.WatcherImpl;
/**
*
* @author jeffwadsworth
*/
public class MaelstromNexus extends CardImpl<MaelstromNexus> {
public MaelstromNexus(UUID ownerId) {
super(ownerId, 130, "Maelstrom Nexus", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT}, "{W}{U}{B}{R}{G}");
this.expansionSetCode = "ARB";
this.color.setRed(true);
this.color.setBlue(true);
this.color.setGreen(true);
this.color.setBlack(true);
this.color.setWhite(true);
// The first spell you cast each turn has cascade.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MaelstromNexusEffect(new CascadeAbility(), Duration.WhileOnStack, "The first spell you cast each turn has cascade", true)));
this.addWatcher(new CastSpellThisTurnWatcher());
}
public MaelstromNexus(final MaelstromNexus card) {
super(card);
}
@Override
public MaelstromNexus copy() {
return new MaelstromNexus(this);
}
}
class CastSpellThisTurnWatcher extends WatcherImpl<CastSpellThisTurnWatcher> {
int spellCount = 0;
public CastSpellThisTurnWatcher() {
super("CastSpellThisTurn", WatcherScope.CARD);
}
public CastSpellThisTurnWatcher(final CastSpellThisTurnWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId() == controllerId) {
Spell spell = (Spell) game.getObject(event.getTargetId());
if (this.getSourceId().equals(spell.getSourceId())) {
spellCount++;
if (spellCount == 1) {
condition = true;
}
}
}
}
@Override
public CastSpellThisTurnWatcher copy() {
return new CastSpellThisTurnWatcher(this);
}
@Override
public void reset() {
super.reset();
spellCount = 0;
}
}
class MaelstromNexusEffect extends ContinuousEffectImpl<MaelstromNexusEffect> {
protected Ability ability;
// shall a card gain the ability (otherwise permanent)
private boolean onCard;
public MaelstromNexusEffect(Ability ability, Duration duration) {
this(ability, duration, null);
}
public MaelstromNexusEffect(Ability ability, Duration duration, String rule) {
this(ability, duration, rule, false);
}
public MaelstromNexusEffect(Ability ability, Duration duration, String rule, boolean onCard) {
super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA,
ability.getEffects().size() > 0 ? ability.getEffects().get(0).getOutcome() : Outcome.AddAbility);
this.ability = ability;
staticText = rule;
this.onCard = onCard;
}
public MaelstromNexusEffect(final MaelstromNexusEffect effect) {
super(effect);
this.ability = effect.ability.copy();
this.onCard = effect.onCard;
}
@Override
public MaelstromNexusEffect copy() {
return new MaelstromNexusEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
targetPointer.init(game, source);
}
@Override
public boolean apply(Game game, Ability source) {
CastSpellThisTurnWatcher watcher = (CastSpellThisTurnWatcher) game.getState().getWatchers().get("CastSpellThisTurn", source.getSourceId());
StackObject spellObject = game.getStack().getFirst();
Spell spell = game.getStack().getSpell(spellObject.getSourceId());
if (spell == null) {
return false;
}
if (watcher.conditionMet()
&& spell.getControllerId() == source.getControllerId()) {
if (onCard) {
Card card = game.getCard(spell.getSourceId());
if (card != null) {
card.addAbility(ability);
}
}
}
return false;
}
}

View file

@ -0,0 +1,121 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class MayaelsAria extends CardImpl<MayaelsAria> {
public MayaelsAria(UUID ownerId) {
super(ownerId, 121, "Mayael's Aria", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}{G}{W}");
this.expansionSetCode = "ARB";
this.color.setRed(true);
this.color.setGreen(true);
this.color.setWhite(true);
// At the beginning of your upkeep, put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. Then you gain 10 life if you control a creature with power 10 or greater. Then you win the game if you control a creature with power 20 or greater.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MayaelsAriaEffect(), TargetController.YOU, false));
}
public MayaelsAria(final MayaelsAria card) {
super(card);
}
@Override
public MayaelsAria copy() {
return new MayaelsAria(this);
}
}
class MayaelsAriaEffect extends OneShotEffect<MayaelsAriaEffect> {
public MayaelsAriaEffect() {
super(Outcome.Benefit);
this.staticText = "put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. Then you gain 10 life if you control a creature with power 10 or greater. Then you win the game if you control a creature with power 20 or greater";
}
public MayaelsAriaEffect(final MayaelsAriaEffect effect) {
super(effect);
}
@Override
public MayaelsAriaEffect copy() {
return new MayaelsAriaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
boolean condition1 = false;
boolean condition2 = false;
Player you = game.getPlayer(source.getControllerId());
if (you == null) {
return false;
}
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, game)) {
if (creature.getPower().getValue() > 4) {
condition1 = true;
}
if (creature.getPower().getValue() > 9) {
condition2 = true;
}
if (creature.getPower().getValue() > 19) {
you.won(game);
}
}
if (condition1) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, game)) {
creature.addCounters(CounterType.P1P1.createInstance(), game);
}
}
if (condition2) {
you.gainLife(10, game);
}
return true;
}
}

View file

@ -0,0 +1,82 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author jeffwadsworth
*/
public class NayaSojourners extends CardImpl<NayaSojourners> {
public NayaSojourners(UUID ownerId) {
super(ownerId, 122, "Naya Sojourners", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}{W}");
this.expansionSetCode = "ARB";
this.subtype.add("Elf");
this.subtype.add("Shaman");
this.color.setRed(true);
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(5);
this.toughness = new MageInt(3);
// When you cycle Naya Sojourners or it dies, you may put a +1/+1 counter on target creature.
Ability ability1 = new CycleTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
Ability ability2 = new DiesTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
ability1.addTarget(new TargetCreaturePermanent());
ability2.addTarget(new TargetCreaturePermanent());
this.addAbility(ability1);
this.addAbility(ability2);
// Cycling {2}{G}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{G}")));
}
public NayaSojourners(final NayaSojourners card) {
super(card);
}
@Override
public NayaSojourners copy() {
return new NayaSojourners(this);
}
}

View file

@ -0,0 +1,79 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author jeffwadsworth
*/
public class SangriteBacklash extends CardImpl<SangriteBacklash> {
public SangriteBacklash(UUID ownerId) {
super(ownerId, 139, "Sangrite Backlash", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B/G}{R}");
this.expansionSetCode = "ARB";
this.subtype.add("Aura");
this.color.setRed(true);
this.color.setGreen(true);
this.color.setBlack(true);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +3/-3.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, -3)));
}
public SangriteBacklash(final SangriteBacklash card) {
super(card);
}
@Override
public SangriteBacklash copy() {
return new SangriteBacklash(this);
}
}

View file

@ -0,0 +1,64 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author jeffwadsworth
*/
public class SkyclawThrash extends CardImpl<SkyclawThrash> {
public SkyclawThrash(UUID ownerId) {
super(ownerId, 89, "Skyclaw Thrash", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{U}{R}");
this.expansionSetCode = "ARB";
this.subtype.add("Viashino");
this.subtype.add("Warrior");
this.color.setRed(true);
this.color.setBlue(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Skyclaw Thrash attacks, flip a coin. If you win the flip, Skyclaw Thrash gets +1/+1 and gains flying until end of turn.
}
public SkyclawThrash(final SkyclawThrash card) {
super(card);
}
@Override
public SkyclawThrash copy() {
return new SkyclawThrash(this);
}
}

View file

@ -0,0 +1,87 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterSpell;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author jeffwadsworth
*/
public class SoulManipulation extends CardImpl<SoulManipulation> {
private static final FilterSpell filter = new FilterSpell("creature spell");
private static final FilterCreatureCard filter2 = new FilterCreatureCard("creature card from your graveyard");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public SoulManipulation(UUID ownerId) {
super(ownerId, 29, "Soul Manipulation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{B}");
this.expansionSetCode = "ARB";
this.color.setBlue(true);
this.color.setBlack(true);
// Choose one or both -
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(2);
// Counter target creature spell;
this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addTarget(new TargetSpell(filter));
// and/or return target creature card from your graveyard to your hand.
Mode mode = new Mode();
mode.getEffects().add(new ReturnFromGraveyardToHandTargetEffect());
mode.getTargets().add(new TargetCardInYourGraveyard(filter2));
this.getSpellAbility().addMode(mode);
}
public SoulManipulation(final SoulManipulation card) {
super(card);
}
@Override
public SoulManipulation copy() {
return new SoulManipulation(this);
}
}

View file

@ -0,0 +1,159 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author jeffwadsworth
*/
public class Thraximundar extends CardImpl<Thraximundar> {
public Thraximundar(UUID ownerId) {
super(ownerId, 113, "Thraximundar", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{B}{R}");
this.expansionSetCode = "ARB";
this.supertype.add("Legendary");
this.subtype.add("Zombie");
this.subtype.add("Assassin");
this.color.setRed(true);
this.color.setBlue(true);
this.color.setBlack(true);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Haste
this.addAbility(HasteAbility.getInstance());
// Whenever Thraximundar attacks, defending player sacrifices a creature.
this.addAbility(new ThraximundarTriggeredAbility());
// Whenever a player sacrifices a creature, you may put a +1/+1 counter on Thraximundar.
this.addAbility(new PlayerSacrificesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true));
}
public Thraximundar(final Thraximundar card) {
super(card);
}
@Override
public Thraximundar copy() {
return new Thraximundar(this);
}
}
class ThraximundarTriggeredAbility extends TriggeredAbilityImpl<ThraximundarTriggeredAbility> {
private static final FilterControlledPermanent filter;
static {
filter = new FilterControlledPermanent(" a creature");
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public ThraximundarTriggeredAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, "defending player"));
}
public ThraximundarTriggeredAbility(final ThraximundarTriggeredAbility ability) {
super(ability);
}
@Override
public ThraximundarTriggeredAbility copy() {
return new ThraximundarTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS
&& game.getActivePlayerId().equals(this.controllerId)
&& event.getSourceId() == this.getSourceId()) {
UUID defender = game.getCombat().getDefendingPlayer(this.getSourceId());
this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} attacks, defending player sacrifices a creature.";
}
}
class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl<PlayerSacrificesCreatureTriggeredAbility> {
public PlayerSacrificesCreatureTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
public PlayerSacrificesCreatureTriggeredAbility(final PlayerSacrificesCreatureTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT) {
MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (mageObject != null && mageObject.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a player sacrifices a creature, " + super.getRule();
}
@Override
public PlayerSacrificesCreatureTriggeredAbility copy() {
return new PlayerSacrificesCreatureTriggeredAbility(this);
}
}

View file

@ -0,0 +1,178 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ShroudAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
/**
*
* @author jeffwadsworth
*/
public class TraceOfAbundance extends CardImpl<TraceOfAbundance> {
private String rule = "Enchanted land has shroud";
public TraceOfAbundance(UUID ownerId) {
super(ownerId, 142, "Trace of Abundance", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R/W}{G}");
this.expansionSetCode = "ARB";
this.subtype.add("Aura");
this.color.setRed(true);
this.color.setGreen(true);
this.color.setWhite(true);
// Enchant land
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted land has shroud.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield, rule)));
// Whenever enchanted land is tapped for mana, its controller adds one mana of any color to his or her mana pool.
this.addAbility(new TraceOfAbundanceTriggeredAbility());
}
public TraceOfAbundance(final TraceOfAbundance card) {
super(card);
}
@Override
public TraceOfAbundance copy() {
return new TraceOfAbundance(this);
}
}
class TraceOfAbundanceTriggeredAbility extends TriggeredManaAbility<TraceOfAbundanceTriggeredAbility> {
public TraceOfAbundanceTriggeredAbility() {
super(Zone.BATTLEFIELD, new TraceOfAbundanceEffect());
}
public TraceOfAbundanceTriggeredAbility(final TraceOfAbundanceTriggeredAbility ability) {
super(ability);
}
@Override
public TraceOfAbundanceTriggeredAbility copy() {
return new TraceOfAbundanceTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.getSourceId());
if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever enchanted land is tapped for mana, its controller adds one mana of any color to his or her mana pool.";
}
}
class TraceOfAbundanceEffect extends ManaEffect<TraceOfAbundanceEffect> {
public TraceOfAbundanceEffect() {
super();
staticText = "its controller adds one mana of any color to his or her mana pool";
}
public TraceOfAbundanceEffect(final TraceOfAbundanceEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null) {
Permanent land = game.getPermanent(enchantment.getAttachedTo());
if (land != null) {
Player player = game.getPlayer(land.getControllerId());
if (player != null) {
ChoiceColor choice = new ChoiceColor();
while (!player.choose(outcome, choice, game)) {
game.debugMessage("player canceled choosing color. retrying.");
}
int amount = 1;
Mana mana = null;
if (choice.getColor().isBlack()) {
mana = Mana.BlackMana(amount);
} else if (choice.getColor().isBlue()) {
mana = Mana.BlueMana(amount);
} else if (choice.getColor().isRed()) {
mana = Mana.RedMana(amount);
} else if (choice.getColor().isGreen()) {
mana = Mana.GreenMana(amount);
} else if (choice.getColor().isWhite()) {
mana = Mana.WhiteMana(amount);
}
if (player != null && mana != null) {
player.getManaPool().addMana(mana, game, source);
return true;
}
}
}
}
return false;
}
@Override
public TraceOfAbundanceEffect copy() {
return new TraceOfAbundanceEffect(this);
}
}

View file

@ -0,0 +1,77 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.AuraAttachedCount;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author jeffwadsworth
*/
public class UrilTheMiststalker extends CardImpl<UrilTheMiststalker> {
public UrilTheMiststalker(UUID ownerId) {
super(ownerId, 124, "Uril, the Miststalker", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{G}{W}");
this.expansionSetCode = "ARB";
this.supertype.add("Legendary");
this.subtype.add("Beast");
this.color.setRed(true);
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Hexproof
this.addAbility(HexproofAbility.getInstance());
// Uril, the Miststalker gets +2/+2 for each Aura attached to it.
AuraAttachedCount count = new AuraAttachedCount(2);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(count, count, Duration.WhileOnBattlefield)));
}
public UrilTheMiststalker(final UrilTheMiststalker card) {
super(card);
}
@Override
public UrilTheMiststalker copy() {
return new UrilTheMiststalker(this);
}
}

View file

@ -0,0 +1,68 @@
/*
* 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.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author jeffwadsworth
*/
public class VedalkenHeretic extends CardImpl<VedalkenHeretic> {
public VedalkenHeretic(UUID ownerId) {
super(ownerId, 104, "Vedalken Heretic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}{U}");
this.expansionSetCode = "ARB";
this.subtype.add("Vedalken");
this.subtype.add("Rogue");
this.color.setBlue(true);
this.color.setGreen(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever Vedalken Heretic deals damage to an opponent, you may draw a card.
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DrawCardControllerEffect(1), true));
}
public VedalkenHeretic(final VedalkenHeretic card) {
super(card);
}
@Override
public VedalkenHeretic copy() {
return new VedalkenHeretic(this);
}
}