Merge origin/master

This commit is contained in:
fireshoes 2014-12-20 04:47:33 -06:00
commit 9ea54b38c2
125 changed files with 6528 additions and 1403 deletions

View file

@ -12,7 +12,9 @@ import org.mage.card.arcane.UI;
import javax.swing.*;
import java.awt.*;
import java.net.URL;
import java.util.ArrayList;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
public class GuiDisplayUtil {
private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15);
@ -200,19 +202,19 @@ public class GuiDisplayUtil {
buffer.append("</td></tr></table>");
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td style='margin-left: 1px'>");
if(card.getColor().isWhite()) {
buffer.append("<img src='file:src/main/resources/card/color_ind_white.png' alt='W'>");
buffer.append("<img src='").append(getResourcePath("card/color_ind_white.png")).append("' alt='W'>");
}
if(card.getColor().isBlue()) {
buffer.append("<img src='file:src/main/resources/card/color_ind_blue.png' alt='U'>");
buffer.append("<img src='").append(getResourcePath("card/color_ind_blue.png")).append("' alt='U'>");
}
if(card.getColor().isBlack()) {
buffer.append("<img src='file:src/main/resources/card/color_ind_black.png' alt='B'>");
buffer.append("<img src='").append(getResourcePath("card/color_ind_black.png")).append("' alt='B'>");
}
if(card.getColor().isRed()) {
buffer.append("<img src='file:src/main/resources/card/color_ind_red.png' alt='R'>");
buffer.append("<img src='").append(getResourcePath("card/color_ind_red.png")).append("' alt='R'>");
}
if(card.getColor().isGreen()) {
buffer.append("<img src='file:src/main/resources/card/color_ind_green.png' alt='G'>");
buffer.append("<img src='").append(getResourcePath("card/color_ind_green.png")).append("' alt='G'>");
}
if(!card.getColor().isColorless()) {
buffer.append("&nbsp;&nbsp;");
@ -312,7 +314,11 @@ public class GuiDisplayUtil {
buffer.append("<br></body></html>");
return buffer;
}
private static String getResourcePath(String image) {
return GuiDisplayUtil.class.getClassLoader().getResource(image).toString();
}
private static String getTypes(CardView card) {
String types = "";
for (String superType : card.getSuperTypes()) {

View file

@ -28,6 +28,7 @@
package mage.game;
import java.util.UUID;
import mage.constants.MultiplayerAttackOption;
import mage.constants.RangeOfInfluence;
import mage.game.match.MatchType;
@ -49,6 +50,12 @@ public class CommanderFreeForAll extends GameCommanderImpl {
this.numPlayers = game.numPlayers;
}
@Override
protected void init(UUID choosingPlayerId, GameOptions gameOptions) {
startingPlayerSkipsDraw = false;
super.init(choosingPlayerId, gameOptions);
}
@Override
public MatchType getGameType() {
return new CommanderFreeForAllType();

View file

@ -119,6 +119,7 @@ public class SessionManager {
// session was removed meanwhile by another thread so we can return
return;
}
logger.debug("DISCONNECT " + reason.toString() + " - sessionId: "+ sessionId);
sessions.remove(sessionId);
switch (reason) {
case Disconnected:

View file

@ -0,0 +1,197 @@
/*
* 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.alliances;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class PhyrexianDevourer extends CardImpl {
public PhyrexianDevourer(UUID ownerId) {
super(ownerId, 167, "Phyrexian Devourer", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}");
this.expansionSetCode = "ALL";
this.subtype.add("Construct");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// When Phyrexian Devourer's power is 7 or greater, sacrifice it.
this.addAbility(new PhyrexianDevourerStateTriggeredAbility());
// Exile the top card of your library: Put X +1/+1 counters on Phyrexian Devourer, where X is the exiled card's converted mana cost.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PhyrexianDevourerEffect(), new ExileTopCardLibraryCost()));
}
public PhyrexianDevourer(final PhyrexianDevourer card) {
super(card);
}
@Override
public PhyrexianDevourer copy() {
return new PhyrexianDevourer(this);
}
}
class PhyrexianDevourerStateTriggeredAbility extends StateTriggeredAbility {
public PhyrexianDevourerStateTriggeredAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
}
public PhyrexianDevourerStateTriggeredAbility(final PhyrexianDevourerStateTriggeredAbility ability) {
super(ability);
}
@Override
public PhyrexianDevourerStateTriggeredAbility copy() {
return new PhyrexianDevourerStateTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(getSourceId());
if(permanent != null && permanent.getPower().getValue() >= 7){
return true;
}
return false;
}
@Override
public String getRule() {
return "When {this}'s power is 7 or greater, sacrifice it.";
}
}
class PhyrexianDevourerEffect extends OneShotEffect {
public PhyrexianDevourerEffect() {
super(Outcome.BoostCreature);
this.staticText = "Put X +1/+1 counters on {this}, where X is the exiled card's converted mana cost";
}
public PhyrexianDevourerEffect(final PhyrexianDevourerEffect effect) {
super(effect);
}
@Override
public PhyrexianDevourerEffect copy() {
return new PhyrexianDevourerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = null;
for (Cost cost: source.getCosts()) {
if (cost instanceof ExileTopCardLibraryCost) {
card = ((ExileTopCardLibraryCost)cost).getCard();
}
}
if (card != null) {
int amount = card.getManaCost().convertedManaCost();
if (amount > 0) {
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)).apply(game, source);
}
}
return true;
}
return false;
}
}
class ExileTopCardLibraryCost extends CostImpl {
Card card;
public ExileTopCardLibraryCost() {
this.text = "Exile the top card of your library";
}
public ExileTopCardLibraryCost(final ExileTopCardLibraryCost cost) {
super(cost);
this.card = cost.getCard();
}
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Player controller = game.getPlayer(controllerId);
if (controller != null) {
card = controller.getLibrary().getFromTop(game);
if (card != null) {
paid = controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.LIBRARY);
}
}
return paid;
}
@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
Player controller = game.getPlayer(controllerId);
if (controller != null) {
return controller.getLibrary().size() > 0;
}
return false;
}
@Override
public ExileTopCardLibraryCost copy() {
return new ExileTopCardLibraryCost(this);
}
public Card getCard() {
return card;
}
}

View file

@ -70,7 +70,7 @@ public class Cromat extends CardImpl {
this.toughness = new MageInt(5);
// {W}{B}: Destroy target creature blocking or blocked by Cromat.
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by {this}");
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by Cromat");
filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
new BlockingAttackerIdPredicate(this.getId())));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{W}{B}"));

View file

@ -0,0 +1,126 @@
/*
* 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.apocalypse;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author emerald000
*/
public class WildResearch extends CardImpl {
private static final FilterCard filterEnchantment = new FilterCard("enchantment card");
private static final FilterCard filterInstant = new FilterCard("instant card");
static {
filterEnchantment.add(new CardTypePredicate(CardType.ENCHANTMENT));
filterInstant.add(new CardTypePredicate(CardType.INSTANT));
}
public WildResearch(UUID ownerId) {
super(ownerId, 72, "Wild Research", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
this.expansionSetCode = "APC";
// {1}{W}: Search your library for an enchantment card and reveal that card. Put it into your hand, then discard a card at random. Then shuffle your library.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WildResearchEffect(filterEnchantment), new ManaCostsImpl<>("{1}{W}")));
// {1}{U}: Search your library for an instant card and reveal that card. Put it into your hand, then discard a card at random. Then shuffle your library.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WildResearchEffect(filterInstant), new ManaCostsImpl<>("{1}{U}")));
}
public WildResearch(final WildResearch card) {
super(card);
}
@Override
public WildResearch copy() {
return new WildResearch(this);
}
}
class WildResearchEffect extends OneShotEffect {
protected final FilterCard filter;
WildResearchEffect(FilterCard filter) {
super(Outcome.DrawCard);
this.staticText = "Search your library for an " + filter.getMessage() + " and reveal that card. Put it into your hand, then discard a card at random. Then shuffle your library.";
this.filter = filter;
}
WildResearchEffect(final WildResearchEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public WildResearchEffect copy() {
return new WildResearchEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
TargetCardInLibrary target = new TargetCardInLibrary(filter);
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
Card card = player.getLibrary().remove(target.getFirstTarget(), game);
if (card != null) {
player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
Cards cards = new CardsImpl();
cards.add(card);
player.revealCards("Wild Research", cards, game, true);
}
}
}
player.discardOne(true, source, game);
player.shuffleLibrary(game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,126 @@
/*
* 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.archenemy;
import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.keyword.FearAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.CostModificationType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author emerald000
*/
public class AvatarOfWoe extends CardImpl {
public AvatarOfWoe(UUID ownerId) {
super(ownerId, 9, "Avatar of Woe", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{B}{B}");
this.expansionSetCode = "ARC";
this.subtype.add("Avatar");
this.power = new MageInt(6);
this.toughness = new MageInt(5);
// If there are ten or more creature cards total in all graveyards, Avatar of Woe costs {6} less to cast.
this.addAbility(new SimpleStaticAbility(Zone.STACK, new AvatarOfWoeCostReductionEffect()));
// Fear
this.addAbility(FearAbility.getInstance());
// {tap}: Destroy target creature. It can't be regenerated.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public AvatarOfWoe(final AvatarOfWoe card) {
super(card);
}
@Override
public AvatarOfWoe copy() {
return new AvatarOfWoe(this);
}
}
class AvatarOfWoeCostReductionEffect extends CostModificationEffectImpl {
AvatarOfWoeCostReductionEffect() {
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
staticText = "If there are ten or more creature cards total in all graveyards, {this} costs {6} less to cast";
}
AvatarOfWoeCostReductionEffect(final AvatarOfWoeCostReductionEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
SpellAbility spellAbility = (SpellAbility) abilityToModify;
Mana mana = spellAbility.getManaCostsToPay().getMana();
if (mana.getColorless() > 0) {
int newCount = mana.getColorless() - 6;
if (newCount < 0) {
newCount = 0;
}
mana.setColorless(newCount);
spellAbility.getManaCostsToPay().load(mana.toString());
return true;
}
return false;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
return abilityToModify.getSourceId().equals(source.getSourceId())
&& (abilityToModify instanceof SpellAbility)
&& new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 10;
}
@Override
public AvatarOfWoeCostReductionEffect copy() {
return new AvatarOfWoeCostReductionEffect(this);
}
}

View file

@ -50,7 +50,7 @@ public class HeedTheMists extends CardImpl {
super(ownerId, 36, "Heed the Mists", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U}{U}");
this.expansionSetCode = "BOK";
this.subtype.add("Arcane");
this.color.setBlue(true);
// Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost.
@ -65,36 +65,36 @@ public class HeedTheMists extends CardImpl {
public HeedTheMists copy() {
return new HeedTheMists(this);
}
private class HeedTheMistsEffect extends OneShotEffect {
public HeedTheMistsEffect() {
super(Outcome.DrawCard);
staticText = "Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost";
}
public HeedTheMistsEffect() {
super(Outcome.DrawCard);
staticText = "Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost";
}
public HeedTheMistsEffect(HeedTheMistsEffect effect) {
super(effect);
}
public HeedTheMistsEffect(HeedTheMistsEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
int cmc = card.getManaCost().convertedManaCost();
result = card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
player.drawCards(cmc, game);
}
}
return result;
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = controller.getLibrary().removeFromTop(game);
if (card != null) {
int cmc = card.getManaCost().convertedManaCost();
controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
controller.drawCards(cmc, game);
}
}
return result;
}
@Override
public HeedTheMistsEffect copy() {
return new HeedTheMistsEffect(this);
}
@Override
public HeedTheMistsEffect copy() {
return new HeedTheMistsEffect(this);
}
}
}

View file

@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
@ -60,10 +61,9 @@ public class VeilOfSecrecy extends CardImpl {
this.expansionSetCode = "BOK";
this.subtype.add("Arcane");
this.color.setBlue(true);
// Target creature gains shroud until end of turn and is unblockable this turn.
Effect effect = new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
effect.setText("Target creature gains shroud until end of turn");
this.getSpellAbility().addEffect(effect);
effect = new UnblockableTargetEffect();

View file

@ -65,7 +65,7 @@ public class NezumiGraverobber extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
this.flipCard = true;
this.flipCardName = "Nighteyes The Desecrator";
this.flipCardName = "Nighteyes the Desecrator";
// {1}{B}: Exile target card from an opponent's graveyard. If no cards are in that graveyard, flip Nezumi Graverobber.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{1}{B}"));
@ -118,8 +118,9 @@ class NezumiGraverobberFlipEffect extends OneShotEffect {
}
class NighteyesTheDesecratorToken extends Token {
NighteyesTheDesecratorToken() {
super("Nighteyes The Desecrator", "");
NighteyesTheDesecratorToken() {
super("Nighteyes the Desecrator", "");
supertype.add("Legendary");
cardType.add(CardType.CREATURE);
color.setBlack(true);

View file

@ -0,0 +1,133 @@
/*
* 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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactCard;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author emerald000
*/
public class ArcumDagsson extends CardImpl {
private static final FilterPermanent filter = new FilterArtifactPermanent("artifact creature");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public ArcumDagsson(UUID ownerId) {
super(ownerId, 27, "Arcum Dagsson", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "CSP";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Artificer");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {tap}: Target artifact creature's controller sacrifices it. That player may search his or her library for a noncreature artifact card, put it onto the battlefield, then shuffle his or her library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ArcumDagssonEffect(), new TapSourceCost());
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
public ArcumDagsson(final ArcumDagsson card) {
super(card);
}
@Override
public ArcumDagsson copy() {
return new ArcumDagsson(this);
}
}
class ArcumDagssonEffect extends OneShotEffect {
private static final FilterCard filter = new FilterArtifactCard("noncreature artifact card");
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
ArcumDagssonEffect() {
super(Outcome.Removal);
this.staticText = "Target artifact creature's controller sacrifices it. That player may search his or her library for a noncreature artifact card, put it onto the battlefield, then shuffle his or her library";
}
ArcumDagssonEffect(final ArcumDagssonEffect effect) {
super(effect);
}
@Override
public ArcumDagssonEffect copy() {
return new ArcumDagssonEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent artifactCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (artifactCreature != null) {
Player player = game.getPlayer(artifactCreature.getControllerId());
if (player != null) {
artifactCreature.sacrifice(source.getSourceId(), game);
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a noncreature artifact card?", game)) {
TargetCardInLibrary target = new TargetCardInLibrary(filter);
if (player.searchLibrary(target, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
}
}
player.shuffleLibrary(game);
}
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,73 @@
/*
* 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.coldsnap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPlayer;
/**
*
* @author LevelX2
*/
public class MishrasBauble extends CardImpl {
public MishrasBauble(UUID ownerId) {
super(ownerId, 138, "Mishra's Bauble", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{0}");
this.expansionSetCode = "CSP";
// {T}, Sacrifice Mishra's Bauble: Look at the top card of target player's library. Draw a card at the beginning of the next turn's upkeep.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryTopCardTargetPlayerEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(
new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public MishrasBauble(final MishrasBauble card) {
super(card);
}
@Override
public MishrasBauble copy() {
return new MishrasBauble(this);
}
}

View file

@ -56,7 +56,7 @@ public class AkromaAngelOfFury extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("white and from blue");
static {
protectionFilter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK),new ColorPredicate(ObjectColor.RED)));
protectionFilter.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE),new ColorPredicate(ObjectColor.BLUE)));
}
public AkromaAngelOfFury(UUID ownerId) {

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.commander;
import java.util.UUID;
/**
*
* @author emerald000
*/
public class AvatarOfWoe extends mage.sets.archenemy.AvatarOfWoe {
public AvatarOfWoe(UUID ownerId) {
super(ownerId);
this.cardNumber = 73;
this.expansionSetCode = "CMD";
}
public AvatarOfWoe(final AvatarOfWoe card) {
super(card);
}
@Override
public AvatarOfWoe copy() {
return new AvatarOfWoe(this);
}
}

View file

@ -32,13 +32,15 @@ import java.util.List;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.EmptyEffect;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.abilities.mana.SimpleManaAbility;
import mage.abilities.mana.CommanderColorIdentityManaAbility;
import mage.abilities.mana.ManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.choices.Choice;
@ -71,7 +73,7 @@ public class OpalPalace extends CardImpl {
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {1}, {tap}: Add to your mana pool one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it equal to the number of times it's been cast from the command zone this game.
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new OpalPalaceManaEffect(), new GenericManaCost(1));
Ability ability = new CommanderColorIdentityManaAbility(new GenericManaCost(1));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
@ -92,87 +94,9 @@ public class OpalPalace extends CardImpl {
}
}
class OpalPalaceManaEffect extends ManaEffect {
public OpalPalaceManaEffect() {
super();
this.staticText = "Add to your mana pool one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it equal to the number of times it's been cast from the command zone this game";
}
public OpalPalaceManaEffect(final OpalPalaceManaEffect effect) {
super(effect);
}
@Override
public OpalPalaceManaEffect copy() {
return new OpalPalaceManaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card commander = game.getCard(controller.getCommanderId());
if (commander != null) {
Mana commanderMana = commander.getManaCost().getMana();
Choice choice = new ChoiceImpl(true);
choice.setMessage("Pick a mana color");
if (commanderMana.getBlack() > 0) {
choice.getChoices().add("Black");
}
if (commanderMana.getRed() > 0) {
choice.getChoices().add("Red");
}
if (commanderMana.getBlue() > 0) {
choice.getChoices().add("Blue");
}
if (commanderMana.getGreen() > 0) {
choice.getChoices().add("Green");
}
if (commanderMana.getWhite() > 0) {
choice.getChoices().add("White");
}
if (choice.getChoices().size() > 0) {
Mana mana = new Mana();
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
controller.choose(outcome, choice, game);
}
if (choice.getChoice().equals("Black")) {
mana.addBlack();
} else if (choice.getChoice().equals("Blue")) {
mana.addBlue();
} else if (choice.getChoice().equals("Red")) {
mana.addRed();
} else if (choice.getChoice().equals("Green")) {
mana.addGreen();
} else if (choice.getChoice().equals("White")) {
mana.addWhite();
}
// set to indicate, that the mana can boost the commander
mana.setFlag(true);
checkToFirePossibleEvents(mana, game, source);
controller.getManaPool().addMana(mana, game, source);
}
return true;
}
}
return false;
}
@Override
public Mana getMana(Game game, Ability source) {
return null;
}
}
class OpalPalaceWatcher extends Watcher {
public List<UUID> commanderId = new ArrayList<UUID>();
public List<UUID> commanderId = new ArrayList<>();
public OpalPalaceWatcher() {
super("ManaPaidFromOpalPalaceWatcher", WatcherScope.CARD);
@ -249,7 +173,7 @@ class OpalPalaceEntersBattlefieldEffect extends ReplacementEffectImpl {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null) {
Integer castCount = (Integer)game.getState().getValue(permanent.getId() + "_castCount");
if (castCount != null && castCount.intValue() > 0) {
if (castCount != null && castCount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(castCount), game);
}
}

View file

@ -125,17 +125,13 @@ class PrimalVigorCounterEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent p = game.getPermanent(event.getTargetId());
if (p != null) {
p.addCounters(CounterType.P1P1.createInstance(event.getAmount() * 2), game, event.getAppliedEffects());
return true;
}
event.setAmount(event.getAmount() *2);
return false;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.ADD_COUNTER) {
if (event.getType() == GameEvent.EventType.ADD_COUNTERS) {
Permanent target = game.getPermanent(event.getTargetId());
if (target != null && filter.match(target, game)
&& event.getData() != null && event.getData().equals("+1/+1")) {

View file

@ -34,8 +34,9 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterBasicLandCard;
import mage.filter.FilterCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
/**
@ -43,6 +44,13 @@ import mage.target.common.TargetCardInLibrary;
* @author LevelX2
*/
public class GiftOfEstates extends CardImpl {
private static final FilterCard filter = new FilterCard("Plains cards");
static {
filter.add(new SubtypePredicate("Plains"));
}
public GiftOfEstates(UUID ownerId) {
super(ownerId, 73, "Gift of Estates", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}");
@ -52,7 +60,7 @@ public class GiftOfEstates extends CardImpl {
// If an opponent controls more lands than you, search your library for up to three Plains cards, reveal them, and put them into your hand. Then shuffle your library.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true),
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, filter), true),
new OpponentControllsMoreCondition(new FilterLandPermanent("lands"))));
}

View file

@ -38,6 +38,7 @@ import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterCreatureCard;
import mage.game.permanent.token.Token;
/**
@ -59,7 +60,7 @@ public class HallowedSpiritkeeper extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// When Hallowed Spiritkeeper dies, put X 1/1 white Spirit creature tokens with flying onto the battlefield, where X is the number of creature cards in your graveyard.
Effect effect = new CreateTokenEffect(new HallowedSpiritkeeperSpiritToken(), new CardsInControllerGraveyardCount());
Effect effect = new CreateTokenEffect(new HallowedSpiritkeeperSpiritToken(), new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards")));
effect.setText("put X 1/1 white Spirit creature tokens with flying onto the battlefield, where X is the number of creature cards in your graveyard");
this.addAbility(new DiesTriggeredAbility(effect, false));

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.conspiracy;
import java.util.UUID;
/**
*
* @author emerald000
*/
public class PleaForPower extends mage.sets.vintagemasters.PleaForPower {
public PleaForPower(UUID ownerId) {
super(ownerId);
this.cardNumber = 24;
this.expansionSetCode = "CNS";
}
public PleaForPower(final PleaForPower card) {
super(card);
}
@Override
public PleaForPower copy() {
return new PleaForPower(this);
}
}

View file

@ -0,0 +1,80 @@
/*
* 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.conspiracy;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderAllEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
/**
*
* @author LevelX2
*/
public class WakestoneGargoyle extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control with defender");
static {
filter.add(new AbilityPredicate(DefenderAbility.class));
}
public WakestoneGargoyle(UUID ownerId) {
super(ownerId, 88, "Wakestone Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "CNS";
this.subtype.add("Gargoyle");
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// Defender
this.addAbility(DefenderAbility.getInstance());
// Flying
this.addAbility(FlyingAbility.getInstance());
// {1}{W}: Creatures you control with defender can attack this turn as though they didn't have defender.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{W}") ));
}
public WakestoneGargoyle(final WakestoneGargoyle card) {
super(card);
}
@Override
public WakestoneGargoyle copy() {
return new WakestoneGargoyle(this);
}
}

View file

@ -0,0 +1,66 @@
/*
* 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.darksteel;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.AffinityForLandTypeAbility;
import mage.abilities.keyword.FearAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class DrossGolem extends CardImpl {
public DrossGolem(UUID ownerId) {
super(ownerId, 119, "Dross Golem", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
this.expansionSetCode = "DST";
this.subtype.add("Golem");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Affinity for Swamps
this.addAbility(new AffinityForLandTypeAbility("Swamp", "Swamps"));
// Fear
this.addAbility(FearAbility.getInstance());
}
public DrossGolem(final DrossGolem card) {
super(card);
}
@Override
public DrossGolem copy() {
return new DrossGolem(this);
}
}

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.darksteel;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class OxiddaGolem extends mage.sets.jacevschandra.OxiddaGolem {
public OxiddaGolem(UUID ownerId) {
super(ownerId);
this.cardNumber = 135;
this.expansionSetCode = "DST";
}
public OxiddaGolem(final OxiddaGolem card) {
super(card);
}
@Override
public OxiddaGolem copy() {
return new OxiddaGolem(this);
}
}

View file

@ -0,0 +1,62 @@
/*
* 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.darksteel;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.AffinityForLandTypeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class TangleGolem extends CardImpl {
public TangleGolem(UUID ownerId) {
super(ownerId, 151, "Tangle Golem", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}");
this.expansionSetCode = "DST";
this.subtype.add("Golem");
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Affinity for Forests
this.addAbility(new AffinityForLandTypeAbility("Forest", "Forests"));
}
public TangleGolem(final TangleGolem card) {
super(card);
}
@Override
public TangleGolem copy() {
return new TangleGolem(this);
}
}

View file

@ -0,0 +1,110 @@
/*
* 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.dissension;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInOpponentsGraveyard;
public class CrimePunishment extends SplitCard {
private static final FilterCard filter = new FilterCard("creature or enchantment card from an opponent's graveyard");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public CrimePunishment(UUID ownerId) {
super(ownerId, 150, "Crime", "Punishment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{B}", "{X}{B}{G}", false);
this.expansionSetCode = "DIS";
// Crime
// Put target creature or enchantment card from an opponent's graveyard onto the battlefield under your control.
this.getLeftHalfCard().getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
this.getLeftHalfCard().getSpellAbility().addTarget(new TargetCardInOpponentsGraveyard(filter));
// Punishment
// Destroy each artifact, creature, and enchantment with converted mana cost X.
this.getRightHalfCard().getSpellAbility().addEffect(new PunishmentEffect());
}
public CrimePunishment(final CrimePunishment card) {
super(card);
}
@Override
public CrimePunishment copy() {
return new CrimePunishment(this);
}
}
class PunishmentEffect extends OneShotEffect {
PunishmentEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy each artifact, creature, and enchantment with converted mana cost X";
}
PunishmentEffect(final PunishmentEffect effect) {
super(effect);
}
@Override
public PunishmentEffect copy() {
return new PunishmentEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
if (permanent != null
&& permanent.getManaCost().convertedManaCost() == source.getManaCostsToPay().getX()
&& (permanent.getCardType().contains(CardType.ARTIFACT)
|| permanent.getCardType().contains(CardType.CREATURE)
|| permanent.getCardType().contains(CardType.ENCHANTMENT))) {
permanent.destroy(source.getSourceId(), game, false);
}
}
return true;
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.dissension;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class WakestoneGargoyle extends mage.sets.conspiracy.WakestoneGargoyle {
public WakestoneGargoyle(UUID ownerId) {
super(ownerId);
this.cardNumber = 21;
this.expansionSetCode = "DIS";
this.rarity = Rarity.RARE;
}
public WakestoneGargoyle(final WakestoneGargoyle card) {
super(card);
}
@Override
public WakestoneGargoyle copy() {
return new WakestoneGargoyle(this);
}
}

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.eighthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class Twiddle extends mage.sets.unlimitededition.Twiddle {
public Twiddle(UUID ownerId) {
super(ownerId);
this.cardNumber = 111;
this.expansionSetCode = "8ED";
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(this);
}
}

View file

@ -55,7 +55,7 @@ import mage.players.Player;
public class WardOfBones extends CardImpl {
public WardOfBones(UUID ownerId) {
super(ownerId, 174, "Ward of Bones", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}");
super(ownerId, 174, "Ward of Bones", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}");
this.expansionSetCode = "EVE";
// Each opponent who controls more creatures than you can't play creature cards. The same is true for artifacts, enchantments, and lands.

View file

@ -0,0 +1,191 @@
/*
* 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.eventide;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.RetraceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.watchers.Watcher;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
* @author anonymous
*/
public class WavesOfAggression extends CardImpl {
public WavesOfAggression(UUID ownerId) {
super(ownerId, 148, "Waves of Aggression", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R/W}{R/W}");
this.expansionSetCode = "EVE";
this.color.setRed(true);
this.color.setWhite(true);
// Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase.
this.addWatcher(new AttackedThisTurnWatcher());
this.getSpellAbility().addEffect(new WavesOfAggressionUntapEffect());
this.getSpellAbility().addEffect(new WavesOfAggressionAddPhasesEffect());
// Retrace
this.addAbility(new RetraceAbility(new ManaCostsImpl("{3}{R/W}{R/W}"), TimingRule.SORCERY));
}
public WavesOfAggression(final WavesOfAggression card) {
super(card);
}
@Override
public WavesOfAggression copy() {
return new WavesOfAggression(this);
}
}
class WavesOfAggressionUntapEffect extends OneShotEffect {
public WavesOfAggressionUntapEffect() {
super(Outcome.Benefit);
staticText = "Untap all creatures that attacked this turn";
}
public WavesOfAggressionUntapEffect(final WavesOfAggressionUntapEffect effect) {
super(effect);
}
@Override
public WavesOfAggressionUntapEffect copy() {
return new WavesOfAggressionUntapEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Watcher watcher = game.getState().getWatchers().get("AttackedThisTurn");
if (watcher != null && watcher instanceof AttackedThisTurnWatcher) {
Set<UUID> attackedThisTurn = ((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures();
for (UUID uuid : attackedThisTurn) {
Permanent permanent = game.getPermanent(uuid);
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
permanent.untap(game);
}
}
return true;
}
return false;
}
}
class WavesOfAggressionAddPhasesEffect extends OneShotEffect {
public WavesOfAggressionAddPhasesEffect() {
super(Outcome.Benefit);
staticText = "After this main phase, there is an additional combat phase followed by an additional main phase";
}
public WavesOfAggressionAddPhasesEffect(final WavesOfAggressionAddPhasesEffect effect) {
super(effect);
}
@Override
public WavesOfAggressionAddPhasesEffect copy() {
return new WavesOfAggressionAddPhasesEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
// 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created.
if (TurnPhase.PRECOMBAT_MAIN.equals(game.getTurn().getPhaseType()) || TurnPhase.POSTCOMBAT_MAIN.equals(game.getTurn().getPhaseType())) {
// we can't add two turn modes at once, will add additional post combat on delayed trigger resolution
TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false);
game.getState().getTurnMods().add(combat);
WavesOfAggressionDelayedAddMainPhaseAbility delayedTriggeredAbility = new WavesOfAggressionDelayedAddMainPhaseAbility();
delayedTriggeredAbility.setSourceId(source.getSourceId());
delayedTriggeredAbility.setControllerId(source.getControllerId());
delayedTriggeredAbility.setConnectedTurnMod(combat.getId());
game.addDelayedTriggeredAbility(delayedTriggeredAbility);
return true;
}
return false;
}
}
class WavesOfAggressionDelayedAddMainPhaseAbility extends DelayedTriggeredAbility {
private UUID connectedTurnMod;
private boolean enabled;
public WavesOfAggressionDelayedAddMainPhaseAbility() {
super(null, Duration.EndOfTurn);
this.usesStack = false; // don't show this to the user
}
public WavesOfAggressionDelayedAddMainPhaseAbility(WavesOfAggressionDelayedAddMainPhaseAbility ability) {
super(ability);
this.connectedTurnMod = ability.connectedTurnMod;
this.enabled = ability.enabled;
}
@Override
public WavesOfAggressionDelayedAddMainPhaseAbility copy() {
return new WavesOfAggressionDelayedAddMainPhaseAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) {
enabled = true;
}
if (event.getType() == GameEvent.EventType.COMBAT_PHASE_PRE && enabled) {
// add additional post combat main phase after that - after phase == null because add it after this combat
game.getState().getTurnMods().add(new TurnMod(getControllerId(), TurnPhase.POSTCOMBAT_MAIN, null, false));
enabled = false;
}
return false;
}
public void setConnectedTurnMod(UUID connectedTurnMod) {
this.connectedTurnMod = connectedTurnMod;
}
@Override
public String getRule() {
return "add additional post combat main phase";
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.fallenempires;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GoblinChirurgeon extends CardImpl {
public GoblinChirurgeon(UUID ownerId) {
super(ownerId, 110, "Goblin Chirurgeon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "FEM";
this.subtype.add("Goblin");
this.subtype.add("Shaman");
this.power = new MageInt(0);
this.toughness = new MageInt(2);
// Sacrifice a Goblin: Regenerate target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new RegenerateTargetEffect(),
new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("Goblin","a Goblin"))));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public GoblinChirurgeon(final GoblinChirurgeon card) {
super(card);
}
@Override
public GoblinChirurgeon copy() {
return new GoblinChirurgeon(this);
}
}

View file

@ -27,6 +27,7 @@
*/
package mage.sets.fifthedition;
import java.util.Set;
import java.util.UUID;
import mage.constants.*;
@ -41,6 +42,7 @@ import mage.cards.CardImpl;
import mage.choices.ChoiceImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
@ -57,9 +59,7 @@ public class PrimalClay extends CardImpl {
this.toughness = new MageInt(0);
// As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new PrimalClayEffect(), "As {this} enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types"));
ability.addChoice(new PrimalClayChoice());
this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new PrimalClayEffect(), "As {this} enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types")));
}
public PrimalClay(final PrimalClay card) {
@ -73,35 +73,68 @@ public class PrimalClay extends CardImpl {
}
class PrimalClayEffect extends ContinuousEffectImpl {
private final static String choice1 = "a 3/3 artifact creature";
private final static String choice2 = "a 2/2 artifact creature with flying";
private final static String choice3 = "a 1/6 Wall artifact creature with defender";
String choice;
PrimalClayEffect() {
super(Duration.WhileOnBattlefield, Outcome.BecomeCreature);
}
PrimalClayEffect(final PrimalClayEffect effect) {
super(effect);
this.choice = effect.choice;
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
ChoiceImpl primalClayChoice = new ChoiceImpl();
Set<String> choices = primalClayChoice.getChoices();
choices.add(choice1);
choices.add(choice2);
choices.add(choice3);
primalClayChoice.setMessage("Choose for " + permanent.getLogName() + " to be");
while (!primalClayChoice.isChosen()) {
if (!controller.isInGame()) {
discard();
return;
}
controller.choose(outcome, primalClayChoice, game);
}
this.choice = primalClayChoice.getChoice();
return;
}
discard();
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId());
PrimalClayChoice choice = (PrimalClayChoice) source.getChoices().get(0);
if (permanent == null) {
discard();
return false;
}
switch (layer) {
case PTChangingEffects_7:
if (sublayer.equals(SubLayer.SetPT_7b)) {
switch (choice.getChoice()) {
case "a 3/3 artifact creature":
switch (choice) {
case choice1:
permanent.getPower().setValue(3);
permanent.getToughness().setValue(3);
break;
case "a 2/2 artifact creature with flying":
case choice2:
permanent.getPower().setValue(2);
permanent.getToughness().setValue(2);
break;
case "a 1/6 Wall artifact creature with defender":
case choice3:
permanent.getPower().setValue(1);
permanent.getToughness().setValue(6);
break;
@ -109,11 +142,11 @@ class PrimalClayEffect extends ContinuousEffectImpl {
}
break;
case AbilityAddingRemovingEffects_6:
switch (choice.getChoice()) {
case "a 2/2 artifact creature with flying":
switch (choice) {
case choice2:
permanent.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game);
break;
case "a 1/6 Wall artifact creature with defender":
case choice3:
permanent.addAbility(DefenderAbility.getInstance(), source.getSourceId(), game);
break;
}
@ -137,22 +170,3 @@ class PrimalClayEffect extends ContinuousEffectImpl {
return new PrimalClayEffect(this);
}
}
class PrimalClayChoice extends ChoiceImpl {
PrimalClayChoice() {
super(true);
this.setMessage("Choose for Primal Clay to be");
this.choices.add("a 3/3 artifact creature");
this.choices.add("a 2/2 artifact creature with flying");
this.choices.add("a 1/6 Wall artifact creature with defender");
}
PrimalClayChoice(final PrimalClayChoice choice) {
super(choice);
}
@Override
public PrimalClayChoice copy() {
return new PrimalClayChoice(this);
}
}

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.fifthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class Twiddle extends mage.sets.unlimitededition.Twiddle {
public Twiddle(UUID ownerId) {
super(ownerId);
this.cardNumber = 130;
this.expansionSetCode = "5ED";
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(this);
}
}

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.fourthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class Twiddle extends mage.sets.unlimitededition.Twiddle {
public Twiddle(UUID ownerId) {
super(ownerId);
this.cardNumber = 109;
this.expansionSetCode = "4ED";
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(this);
}
}

View file

@ -0,0 +1,120 @@
/*
* 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.guildpact;
import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ChooseColorEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.keyword.ReachAbility;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class SilhanaStarfletcher extends CardImpl {
public SilhanaStarfletcher(UUID ownerId) {
super(ownerId, 95, "Silhana Starfletcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "GPT";
this.subtype.add("Elf");
this.subtype.add("Druid");
this.subtype.add("Archer");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Reach
this.addAbility(ReachAbility.getInstance());
// As Silhana Starfletcher enters the battlefield, choose a color.
this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral)));
// {tap}: Add one mana of the chosen color to your mana pool.
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new SilhanaStarfletcherManaEffect(), new TapSourceCost()));
}
public SilhanaStarfletcher(final SilhanaStarfletcher card) {
super(card);
}
@Override
public SilhanaStarfletcher copy() {
return new SilhanaStarfletcher(this);
}
}
class SilhanaStarfletcherManaEffect extends ManaEffect {
public SilhanaStarfletcherManaEffect() {
super();
staticText = "Add one mana of the chosen color to your mana pool";
}
public SilhanaStarfletcherManaEffect(final SilhanaStarfletcherManaEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.getManaPool().addMana(getMana(game, source), game, source);
}
return true;
}
@Override
public Mana getMana(Game game, Ability source) {
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
if (color != null) {
return new Mana(ColoredManaSymbol.lookup(color.toString().charAt(0)));
} else {
return null;
}
}
@Override
public SilhanaStarfletcherManaEffect copy() {
return new SilhanaStarfletcherManaEffect(this);
}
}

View file

@ -33,9 +33,9 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
@ -45,9 +45,9 @@ 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;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -99,11 +99,17 @@ class WildGrowthTriggeredAbility extends TriggeredManaAbility {
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.getSourceId());
public boolean checkTrigger(GameEvent event, Game game) {
if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
Permanent enchantment = game.getPermanent(this.getSourceId());
if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
return true;
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null) {
for(Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
}
return true;
}
}
}
return false;

View file

@ -0,0 +1,73 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
*
* @author LevelX2
*/
public class Dredge extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("a creature or land");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
}
public Dredge(UUID ownerId) {
super(ownerId, 103, "Dredge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}");
this.expansionSetCode = "INV";
// Sacrifice a creature or land.
this.getSpellAbility().addEffect(new SacrificeControllerEffect(filter, 1, ""));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public Dredge(final Dredge card) {
super(card);
}
@Override
public Dredge copy() {
return new Dredge(this);
}
}

View file

@ -0,0 +1,66 @@
/*
* 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.jacevschandra;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.AffinityForLandTypeAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class OxiddaGolem extends CardImpl {
public OxiddaGolem(UUID ownerId) {
super(ownerId, 46, "Oxidda Golem", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}");
this.expansionSetCode = "DD2";
this.subtype.add("Golem");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Affinity for Mountains
this.addAbility(new AffinityForLandTypeAbility("Mountain", "Mountains"));
// Haste
this.addAbility(HasteAbility.getInstance());
}
public OxiddaGolem(final OxiddaGolem card) {
super(card);
}
@Override
public OxiddaGolem copy() {
return new OxiddaGolem(this);
}
}

View file

@ -27,29 +27,24 @@
*/
package mage.sets.journeyintonyx;
import java.util.LinkedList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.Card;
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.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.util.CardUtil;
/**
*
@ -72,10 +67,8 @@ public class BanishingLight extends CardImpl {
// When Banishing Light enters the battlefield, exile target nonland permanent an opponent controls until Banishing Light leaves the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new BanishingLightExileEffect());
ability.addTarget(new TargetPermanent(filter));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(ability);
// Implemented as triggered effect that doesn't uses the stack (implementation with watcher does not work correctly because if the returned creature
// has a DiesTriggeredAll ability it triggers for the dying / battlefield leaving source object, what shouldn't happen)
this.addAbility(new BanishingLightReturnExiledAbility());
}
public BanishingLight(final BanishingLight card) {
@ -110,79 +103,7 @@ class BanishingLightExileEffect extends OneShotEffect {
// If Banishing Light leaves the battlefield before its triggered ability resolves,
// the target won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(source.getSourceId(), permanent.getName()).apply(game, source);
}
return false;
}
}
/**
* Returns the exiled card as source permanent leaves battlefield
* Uses no stack
* @author LevelX2
*/
class BanishingLightReturnExiledAbility extends TriggeredAbilityImpl {
public BanishingLightReturnExiledAbility() {
super(Zone.BATTLEFIELD, new ReturnExiledCreatureEffect());
this.usesStack = false;
this.setRuleVisible(false);
}
public BanishingLightReturnExiledAbility(final BanishingLightReturnExiledAbility ability) {
super(ability);
}
@Override
public BanishingLightReturnExiledAbility copy() {
return new BanishingLightReturnExiledAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
}
}
return false;
}
}
class ReturnExiledCreatureEffect extends OneShotEffect {
public ReturnExiledCreatureEffect() {
super(Outcome.Benefit);
this.staticText = "Return exiled permanent";
}
public ReturnExiledCreatureEffect(final ReturnExiledCreatureEffect effect) {
super(effect);
}
@Override
public ReturnExiledCreatureEffect copy() {
return new ReturnExiledCreatureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
Card sourceCard = game.getCard(source.getSourceId());
if (exile != null && sourceCard != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
}
exile.clear();
return true;
}
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source);
}
return false;
}

View file

@ -31,12 +31,14 @@ import java.util.LinkedList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
@ -70,10 +72,8 @@ public class BrainMaggot extends CardImpl {
// When Brain Maggot enters the battlefield, target opponent reveals his or her hand and you choose a nonland card from it. Exile that card until Brain Maggot leaves the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new BrainMaggotExileEffect());
ability.addTarget(new TargetOpponent());
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new BrainMaggotReturnExiledCreatureAbility()));
this.addAbility(ability);
// Implemented as triggered effect that doesn't uses the stack (implementation with watcher does not work correctly because if the returned creature
// has a DiesTriggeredAll ability it triggers for the dying / battlefield leaving source object, what shouldn't happen)
this.addAbility(new BrainMaggotReturnExiledAbility());
}
public BrainMaggot(final BrainMaggot card) {
@ -108,15 +108,17 @@ class BrainMaggotExileEffect extends OneShotEffect {
Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && opponent != null && sourcePermanent != null) {
opponent.revealCards(sourcePermanent.getLogName(), opponent.getHand(), game);
if (!opponent.getHand().isEmpty()) {
opponent.revealCards(sourcePermanent.getLogName(), opponent.getHand(), game);
FilterCard filter = new FilterNonlandCard("nonland card to exile");
TargetCard target = new TargetCard(Zone.HAND, filter);
if (opponent.getHand().count(filter, game) > 0 && controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
// If source permanent leaves the battlefield before its triggered ability resolves, the target card won't be exiled.
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) {
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND);
FilterCard filter = new FilterNonlandCard("nonland card to exile");
TargetCard target = new TargetCard(Zone.HAND, filter);
if (opponent.getHand().count(filter, game) > 0 && controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
// If source permanent leaves the battlefield before its triggered ability resolves, the target card won't be exiled.
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) {
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND);
}
}
}
return true;
@ -132,21 +134,21 @@ class BrainMaggotExileEffect extends OneShotEffect {
* @author LevelX2
*/
class BrainMaggotReturnExiledAbility extends TriggeredAbilityImpl {
class BrainMaggotReturnExiledCreatureAbility extends DelayedTriggeredAbility {
public BrainMaggotReturnExiledAbility() {
super(Zone.BATTLEFIELD, new BrainMaggotReturnExiledCreatureEffect());
public BrainMaggotReturnExiledCreatureAbility() {
super(new BrainMaggotReturnExiledCreatureEffect(), Duration.OneUse);
this.usesStack = false;
this.setRuleVisible(false);
}
public BrainMaggotReturnExiledAbility(final BrainMaggotReturnExiledAbility ability) {
public BrainMaggotReturnExiledCreatureAbility(final BrainMaggotReturnExiledCreatureAbility ability) {
super(ability);
}
@Override
public BrainMaggotReturnExiledAbility copy() {
return new BrainMaggotReturnExiledAbility(this);
public BrainMaggotReturnExiledCreatureAbility copy() {
return new BrainMaggotReturnExiledCreatureAbility(this);
}
@Override

View file

@ -0,0 +1,162 @@
/*
* 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.judgment;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.AsThoughEffectType;
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.stack.Spell;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.TargetSpell;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author emerald000
*/
public class Spelljack extends CardImpl {
public Spelljack(UUID ownerId) {
super(ownerId, 51, "Spelljack", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}{U}{U}");
this.expansionSetCode = "JUD";
// Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. You may play it without paying its mana cost for as long as it remains exiled.
this.getSpellAbility().addEffect(new SpelljackEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
public Spelljack(final Spelljack card) {
super(card);
}
@Override
public Spelljack copy() {
return new Spelljack(this);
}
}
class SpelljackEffect extends OneShotEffect {
SpelljackEffect() {
super(Outcome.PlayForFree);
this.staticText = "Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. You may play it without paying its mana cost for as long as it remains exiled";
}
SpelljackEffect(final SpelljackEffect effect) {
super(effect);
}
@Override
public SpelljackEffect copy() {
return new SpelljackEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
UUID objectId = targetPointer.getFirst(game, source);
UUID sourceId = source.getSourceId();
StackObject stackObject = game.getStack().getStackObject(objectId);
if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) {
game.rememberLKI(objectId, Zone.STACK, stackObject);
game.getStack().remove(stackObject);
if (!((Spell) stackObject).isCopiedSpell()) {
MageObject card = game.getObject(stackObject.getSourceId());
if (card instanceof Card) {
((Card) card).moveToZone(Zone.EXILED, sourceId, game, true);
ContinuousEffect effect = new SpelljackCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
}
}
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId()));
return true;
}
return false;
}
}
class SpelljackCastFromExileEffect extends AsThoughEffectImpl {
SpelljackCastFromExileEffect() {
super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit);
staticText = "You may cast that card without paying its mana cost as long as it remains exiled";
}
SpelljackCastFromExileEffect(final SpelljackCastFromExileEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public SpelljackCastFromExileEffect copy() {
return new SpelljackCastFromExileEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (affectedControllerId.equals(source.getControllerId())) {
if (getTargetPointer().getFirst(game, source) == null) {
this.discard();
return false;
}
if (sourceId.equals(getTargetPointer().getFirst(game, source))) {
Card card = game.getCard(sourceId);
if (card != null) {
if (game.getState().getZone(sourceId) == Zone.EXILED) {
Player player = game.getPlayer(affectedControllerId);
player.setCastSourceIdWithoutMana(sourceId);
return true;
}
else {
this.discard();
}
}
}
}
return false;
}
}

View file

@ -76,7 +76,8 @@ public class JeeringInstigator extends CardImpl {
Ability ability = new ConditionalTriggeredAbility(
new TurnedFaceUpSourceTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn),false, false),
MyTurnCondition.getInstance(),
"When {this} is turned face up, if it's your turn, gain control of another target creature until end of turn.");
"When {this} is turned face up, if it's your turn, gain control of another target creature until end of turn. Untap that creature. It gains haste until end of turn.");
ability.setWorksFaceDown(true);
Effect effect = new UntapTargetEffect();
effect.setText("Untap that creature");
ability.addEffect(effect);

View file

@ -179,7 +179,7 @@ class KheruLichLordReplacementEffect extends ReplacementEffectImpl {
if (controller != null) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, null);
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, game.getState().getZone(card.getId()));
}
}
return true;

View file

@ -27,29 +27,24 @@
*/
package mage.sets.khansoftarkir;
import java.util.LinkedList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.Filter.ComparisonType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ToughnessPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
@ -71,10 +66,9 @@ public class SuspensionField extends CardImpl {
// When Suspension Field enters the battlefield, you may exile target creature with toughness 3 or greater until Suspension Field leaves the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new SuspensionFieldExileEffect(), true);
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(ability);
// Implemented as triggered effect that doesn't uses the stack (implementation with watcher does not work correctly because if the returned creature
// has a DiesTriggeredAll ability it triggers for the dying / battlefield leaving source object, what shouldn't happen)
this.addAbility(new SuspensionFieldReturnExiledAbility());
}
public SuspensionField(final SuspensionField card) {
@ -108,73 +102,7 @@ class SuspensionFieldExileEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
// If Suspension Field leaves the battlefield before its triggered ability resolves, the target won't be exiled.
if (sourcePermanent != null) {
return new ExileTargetEffect(source.getSourceId(), sourcePermanent.getName()).apply(game, source);
}
return false;
}
}
class SuspensionFieldReturnExiledAbility extends TriggeredAbilityImpl {
SuspensionFieldReturnExiledAbility() {
super(Zone.BATTLEFIELD, new SuspensionFieldReturnExiledCreatureEffect());
this.usesStack = false;
this.setRuleVisible(false);
}
SuspensionFieldReturnExiledAbility(final SuspensionFieldReturnExiledAbility ability) {
super(ability);
}
@Override
public SuspensionFieldReturnExiledAbility copy() {
return new SuspensionFieldReturnExiledAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
}
}
return false;
}
}
class SuspensionFieldReturnExiledCreatureEffect extends OneShotEffect {
SuspensionFieldReturnExiledCreatureEffect() {
super(Outcome.Benefit);
this.staticText = "Return exiled permanent";
}
SuspensionFieldReturnExiledCreatureEffect(final SuspensionFieldReturnExiledCreatureEffect effect) {
super(effect);
}
@Override
public SuspensionFieldReturnExiledCreatureEffect copy() {
return new SuspensionFieldReturnExiledCreatureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
Card sourceCard = game.getCard(source.getSourceId());
if (exile != null && sourceCard != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
}
exile.clear();
return true;
}
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName()).apply(game, source);
}
return false;
}

View file

@ -0,0 +1,115 @@
/*
* 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.legends;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.SetToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.BlockedByIdPredicate;
import mage.filter.predicate.permanent.BlockingAttackerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class Sentinel extends CardImpl {
public Sentinel(UUID ownerId) {
super(ownerId, 239, "Sentinel", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.expansionSetCode = "LEG";
this.subtype.add("Shapeshifter");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by Sentinel");
filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
new BlockingAttackerIdPredicate(this.getId())));
// 0: Change Sentinel's base toughness to 1 plus the power of target creature blocking or blocked by Sentinel. (This effect lasts indefinitely.)
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SentinelEffect(), new GenericManaCost(0));
ability.addTarget(null);
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
public Sentinel(final Sentinel card) {
super(card);
}
@Override
public Sentinel copy() {
return new Sentinel(this);
}
}
class SentinelEffect extends OneShotEffect {
public SentinelEffect() {
super(Outcome.Detriment);
this.staticText = "Change {this}'s base toughness to 1 plus the power of target creature blocking or blocked by {this}. <i>(This effect lasts indefinitely.)</i>";
}
public SentinelEffect(final SentinelEffect effect) {
super(effect);
}
@Override
public SentinelEffect copy() {
return new SentinelEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source));
if (controller != null && targetPermanent != null) {
int newToughness = targetPermanent.getPower().getValue() + 1;
game.addEffect(new SetToughnessSourceEffect(new StaticValue(newToughness), Duration.Custom), source);
return true;
}
return false;
}
}

View file

@ -33,7 +33,9 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.AddCardSubTypeTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityAllEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
@ -48,6 +50,8 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -105,9 +109,9 @@ public class MistformSliver extends CardImpl {
}
}
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice().toString());
permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice() + "</i>");
permanent.getSubtype().add(typeChoice.getChoice());
ContinuousEffect effect = new AddCardSubTypeTargetEffect(typeChoice.getChoice(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
}
return false;
}

View file

@ -37,7 +37,6 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Duration;

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.limitedalpha;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class Twiddle extends mage.sets.unlimitededition.Twiddle {
public Twiddle(UUID ownerId) {
super(ownerId);
this.cardNumber = 86;
this.expansionSetCode = "LEA";
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(this);
}
}

View file

@ -109,7 +109,7 @@ class BalanceEffect extends OneShotEffect {
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
TargetControlledPermanent target = new TargetControlledPermanent(minLand, minLand, new FilterControlledLandPermanent(), true);
TargetControlledPermanent target = new TargetControlledPermanent(minLand, minLand, new FilterControlledLandPermanent("lands to keep"), true);
if (target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledLandPermanent(), player.getId(), source.getSourceId(), game)) {
if (permanent != null && !target.getTargets().contains(permanent.getId())) {
@ -143,7 +143,7 @@ class BalanceEffect extends OneShotEffect {
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
TargetControlledPermanent target = new TargetControlledPermanent(minCreature, minCreature, new FilterControlledCreaturePermanent(), true);
TargetControlledPermanent target = new TargetControlledPermanent(minCreature, minCreature, new FilterControlledCreaturePermanent("creatures to keep"), true);
if (target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), player.getId(), source.getSourceId(), game)) {
if (permanent != null && !target.getTargets().contains(permanent.getId())) {
@ -178,7 +178,7 @@ class BalanceEffect extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
Cards cards = new CardsImpl();
TargetCardInHand target = new TargetCardInHand(minCard, new FilterCard());
TargetCardInHand target = new TargetCardInHand(minCard, new FilterCard("cards to keep"));
if (target.choose(Outcome.Discard, player.getId(), source.getSourceId(), game)) {
for (Card card : player.getHand().getCards(game)) {
if (card != null && !target.getTargets().contains(card.getId())) {

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.limitedbeta;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class Twiddle extends mage.sets.unlimitededition.Twiddle {
public Twiddle(UUID ownerId) {
super(ownerId);
this.cardNumber = 86;
this.expansionSetCode = "LEB";
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(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.lorwyn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author emerald000
*/
public class BattlewandOak extends CardImpl {
private static final FilterPermanent filterForest = new FilterPermanent("a Forest");
private static final FilterSpell filterTreefolk = new FilterSpell("a Treefolk spell");
static {
filterForest.add(new SubtypePredicate("Forest"));
filterTreefolk.add(new SubtypePredicate("Treefolk"));
}
public BattlewandOak(UUID ownerId) {
super(ownerId, 197, "Battlewand Oak", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "LRW";
this.subtype.add("Treefolk");
this.subtype.add("Warrior");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Whenever a Forest enters the battlefield under your control, Battlewand Oak gets +2/+2 until end of turn.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filterForest));
// Whenever you cast a Treefolk spell, Battlewand Oak gets +2/+2 until end of turn.
this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filterTreefolk, false));
}
public BattlewandOak(final BattlewandOak card) {
super(card);
}
@Override
public BattlewandOak copy() {
return new BattlewandOak(this);
}
}

View file

@ -27,30 +27,25 @@
*/
package mage.sets.magic2014;
import java.util.LinkedList;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.Card;
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.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
@ -76,13 +71,8 @@ public class BanisherPriest extends CardImpl {
// When Banisher Priest enters the battlefield, exile target creature an opponent controls until Banisher Priest leaves the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new BanisherPriestExileEffect());
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(ability);
// Implemented as triggered effect that doesn't uses the stack (implementation with watcher does not work correctly because if the returned creature
// has a DiesTriggeredAll ability it triggers for the dying Banish Priest, what shouldn't happen)
this.addAbility(new BanisherPriestReturnExiledAbility());
}
public BanisherPriest(final BanisherPriest card) {
@ -117,76 +107,7 @@ class BanisherPriestExileEffect extends OneShotEffect {
// If Banisher Priest leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(source.getSourceId(), permanent.getName()).apply(game, source);
}
return false;
}
}
/**
* Returns the exiled card as Banisher Priest leaves battlefield
* Uses no stack
* @author LevelX2
*/
class BanisherPriestReturnExiledAbility extends TriggeredAbilityImpl {
public BanisherPriestReturnExiledAbility() {
super(Zone.BATTLEFIELD, new ReturnExiledCreatureEffect());
this.usesStack = false;
this.setRuleVisible(false);
}
public BanisherPriestReturnExiledAbility(final BanisherPriestReturnExiledAbility ability) {
super(ability);
}
@Override
public BanisherPriestReturnExiledAbility copy() {
return new BanisherPriestReturnExiledAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
}
}
return false;
}
}
class ReturnExiledCreatureEffect extends OneShotEffect {
public ReturnExiledCreatureEffect() {
super(Outcome.Benefit);
this.staticText = "Return exiled creature";
}
public ReturnExiledCreatureEffect(final ReturnExiledCreatureEffect effect) {
super(effect);
}
@Override
public ReturnExiledCreatureEffect copy() {
return new ReturnExiledCreatureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (exile != null && sourceObject != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
game.informPlayers(new StringBuilder(sourceObject.getLogName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
}
exile.clear();
return true;
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source);
}
return false;
}

View file

@ -27,15 +27,15 @@
*/
package mage.sets.magic2014;
import java.util.LinkedList;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.IslandwalkAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -43,12 +43,11 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
@ -69,9 +68,6 @@ public class ColossalWhale extends CardImpl {
this.addAbility(new IslandwalkAbility());
// Whenever Colossal Whale attacks, you may exile target creature defending player controls until Colossal Whale leaves the battlefield.
this.addAbility(new ColossalWhaleAbility());
// Implemented as triggered effect that doesn't uses the stack (implementation with watcher does not work correctly because if the returned creature
// has a DiesTriggeredAll ability it triggers for the dying Banish Priest, what shouldn't happen)
this.addAbility(new ColossalWhaleReturnExiledAbility());
}
@ -90,6 +86,7 @@ class ColossalWhaleAbility extends TriggeredAbilityImpl {
public ColossalWhaleAbility() {
super(Zone.BATTLEFIELD, null);
this.addEffect(new ColossalWhaleExileEffect());
this.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
}
public ColossalWhaleAbility(final ColossalWhaleAbility ability) {
@ -144,76 +141,7 @@ class ColossalWhaleExileEffect extends OneShotEffect {
// If Whale leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(source.getSourceId(), permanent.getName()).apply(game, source);
}
return false;
}
}
/**
* Returns the exiled card as Banisher Priest leaves battlefield
* Uses no stack
* @author LevelX2
*/
class ColossalWhaleReturnExiledAbility extends TriggeredAbilityImpl {
public ColossalWhaleReturnExiledAbility() {
super(Zone.BATTLEFIELD, new ReturnExiledCreatureColossalWhaleEffect());
this.usesStack = false;
this.setRuleVisible(false);
}
public ColossalWhaleReturnExiledAbility(final ColossalWhaleReturnExiledAbility ability) {
super(ability);
}
@Override
public ColossalWhaleReturnExiledAbility copy() {
return new ColossalWhaleReturnExiledAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
}
}
return false;
}
}
class ReturnExiledCreatureColossalWhaleEffect extends OneShotEffect {
public ReturnExiledCreatureColossalWhaleEffect() {
super(Outcome.Benefit);
this.staticText = "Return exiled creatures";
}
public ReturnExiledCreatureColossalWhaleEffect(final ReturnExiledCreatureColossalWhaleEffect effect) {
super(effect);
}
@Override
public ReturnExiledCreatureColossalWhaleEffect copy() {
return new ReturnExiledCreatureColossalWhaleEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
Card sourceCard = game.getCard(source.getSourceId());
if (exile != null && sourceCard != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
}
exile.clear();
return true;
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source);
}
return false;
}

View file

@ -27,18 +27,16 @@
*/
package mage.sets.magic2015;
import java.util.LinkedList;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityAllEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
@ -49,13 +47,10 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
@ -83,7 +78,7 @@ public class ConstrictingSliver extends CardImpl {
// until this creature leaves the battlefield."
Ability ability = new EntersBattlefieldTriggeredAbility(new ConstrictingSliverExileEffect(), true);
ability.addTarget(new TargetCreaturePermanent(filterTarget));
ability.addEffect(new ConstrictingSliverAddDelayedReturnEffect());
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Sliver","Sliver creatures"),
@ -123,107 +118,7 @@ class ConstrictingSliverExileEffect extends OneShotEffect {
// If the creature leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(source.getSourceId(), permanent.getLogName()).apply(game, source);
}
return false;
}
}
class ConstrictingSliverAddDelayedReturnEffect extends OneShotEffect {
public ConstrictingSliverAddDelayedReturnEffect() {
super(Outcome.Benefit);
this.staticText = "";
}
public ConstrictingSliverAddDelayedReturnEffect(final ConstrictingSliverAddDelayedReturnEffect effect) {
super(effect);
}
@Override
public ConstrictingSliverAddDelayedReturnEffect copy() {
return new ConstrictingSliverAddDelayedReturnEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
DelayedTriggeredAbility delayedAbility = new ConstrictingSliverReturnExiledCreatureAbility();
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
}
/**
* Returns the exiled card as creature leaves battlefield
* Uses no stack
* @author LevelX2
*/
class ConstrictingSliverReturnExiledCreatureAbility extends DelayedTriggeredAbility {
public ConstrictingSliverReturnExiledCreatureAbility() {
super(new ConstrictingSliverReturnExiledCreatureEffect(), Duration.OneUse);
this.usesStack = false;
this.setRuleVisible(false);
}
public ConstrictingSliverReturnExiledCreatureAbility(final ConstrictingSliverReturnExiledCreatureAbility ability) {
super(ability);
}
@Override
public ConstrictingSliverReturnExiledCreatureAbility copy() {
return new ConstrictingSliverReturnExiledCreatureAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
}
}
return false;
}
}
class ConstrictingSliverReturnExiledCreatureEffect extends OneShotEffect {
public ConstrictingSliverReturnExiledCreatureEffect() {
super(Outcome.Benefit);
this.staticText = "Return exiled creatures";
}
public ConstrictingSliverReturnExiledCreatureEffect(final ConstrictingSliverReturnExiledCreatureEffect effect) {
super(effect);
}
@Override
public ConstrictingSliverReturnExiledCreatureEffect copy() {
return new ConstrictingSliverReturnExiledCreatureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (exile != null && sourceObject != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
}
exile.clear();
return true;
}
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getLogName()).apply(game, source);
}
return false;
}

View file

@ -27,7 +27,6 @@
*/
package mage.sets.modernmasters;
import java.util.Locale;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
@ -38,8 +37,6 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -96,7 +93,7 @@ class DoublingSeasonTokenEffect extends ReplacementEffectImpl {
case CREATE_TOKEN:
StackObject spell = game.getStack().getStackObject(event.getSourceId());
if (spell != null && spell.getControllerId().equals(source.getControllerId())) {
event.setAmount(event.getAmount() * 2);
return true;
}
}
return false;
@ -109,7 +106,8 @@ class DoublingSeasonTokenEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
return apply(game, source);
event.setAmount(event.getAmount() * 2);
return false;
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.morningtide;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.ChampionAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author LevelX2
*/
public class LightningCrafter extends CardImpl {
public LightningCrafter(UUID ownerId) {
super(ownerId, 93, "Lightning Crafter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "MOR";
this.subtype.add("Goblin");
this.subtype.add("Shaman");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Champion a Goblin or Shaman
this.addAbility(new ChampionAbility(this, new String[]{"Goblin", "Shaman"}));
// {T}: Lightning Crafter deals 3 damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new TapSourceCost());
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public LightningCrafter(final LightningCrafter card) {
super(card);
}
@Override
public LightningCrafter copy() {
return new LightningCrafter(this);
}
}

View file

@ -0,0 +1,109 @@
/*
* 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.morningtide;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class OrchardWarden extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another Treefolk creature");
static {
filter.add(new SubtypePredicate("Treefolk"));
filter.add(new AnotherPredicate());
}
public OrchardWarden(UUID ownerId) {
super(ownerId, 131, "Orchard Warden", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.expansionSetCode = "MOR";
this.subtype.add("Treefolk");
this.subtype.add("Shaman");
this.power = new MageInt(4);
this.toughness = new MageInt(6);
// Whenever another Treefolk creature enters the battlefield under your control, you may gain life equal to that creature's toughness.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new OrchardWardenffect(), filter, true, SetTargetPointer.PERMANENT, ""));
}
public OrchardWarden(final OrchardWarden card) {
super(card);
}
@Override
public OrchardWarden copy() {
return new OrchardWarden(this);
}
}
class OrchardWardenffect extends OneShotEffect {
public OrchardWardenffect() {
super(Outcome.GainLife);
this.staticText = "you may gain life equal to that creature's toughness";
}
public OrchardWardenffect(final OrchardWardenffect effect) {
super(effect);
}
@Override
public OrchardWardenffect copy() {
return new OrchardWardenffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
controller.gainLife(permanent.getToughness().getValue(), game);
return true;
}
return false;
}
}

View file

@ -29,23 +29,18 @@ package mage.sets.morningtide;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BecomesBlockedAllTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.abilities.keyword.ChampionAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*

View file

@ -41,6 +41,7 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continious.BoostEquippedEffect;
@ -75,10 +76,19 @@ public class SwordOfWarAndPeace extends CardImpl {
super(ownerId, 161, "Sword of War and Peace", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "NPH";
this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.EQUIPMENT)));
// Equipped creature gets +2/+2 and has protection from red and from white.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2));
Effect effect = new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.EQUIPMENT);
effect.setText("and has protection from red and from white");
ability.addEffect(effect);
this.addAbility(ability);
// Whenever equipped creature deals combat damage to a player, Sword of War and Peace deals damage to that player equal to the number of cards in his or her hand and you gain 1 life for each card in your hand.
this.addAbility(new SwordOfWarAndPeaceAbility());
// Equip {2}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
public SwordOfWarAndPeace (final SwordOfWarAndPeace card) {

View file

@ -0,0 +1,61 @@
/*
* 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.onslaught;
import java.util.UUID;
import mage.Mana;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DynamicManaEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
/**
*
* @author LevelX2
*/
public class BrightstoneRitual extends CardImpl {
public BrightstoneRitual(UUID ownerId) {
super(ownerId, 191, "Brightstone Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "ONS";
// Add {R} to your mana pool for each Goblin on the battlefield.
this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Goblin","Goblin on the battlefield"))));
}
public BrightstoneRitual(final BrightstoneRitual card) {
super(card);
}
@Override
public BrightstoneRitual copy() {
return new BrightstoneRitual(this);
}
}

View file

@ -0,0 +1,106 @@
/*
* 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.onslaught;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class ManaEchoes extends CardImpl {
public ManaEchoes(UUID ownerId) {
super(ownerId, 218, "Mana Echoes", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}");
this.expansionSetCode = "ONS";
// Whenever a creature enters the battlefield, you may add {X} to your mana pool, where X is the number of creatures you control that share a creature type with it.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD,
new ManaEchoesEffect(), new FilterCreaturePermanent("a creature"), true, SetTargetPointer.PERMANENT, ""));
}
public ManaEchoes(final ManaEchoes card) {
super(card);
}
@Override
public ManaEchoes copy() {
return new ManaEchoes(this);
}
}
class ManaEchoesEffect extends OneShotEffect {
public ManaEchoesEffect() {
super(Outcome.Benefit);
this.staticText = "you may add {X} to your mana pool, where X is the number of creatures you control that share a creature type with it";
}
public ManaEchoesEffect(final ManaEchoesEffect effect) {
super(effect);
}
@Override
public ManaEchoesEffect copy() {
return new ManaEchoesEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
int foundCreatures = 0;
for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
if (CardUtil.shareSubtypes(permanent, perm)) {
foundCreatures ++;
}
}
if (foundCreatures > 0) {
controller.getManaPool().addMana(new Mana(0,0,0,0,0,foundCreatures,0), game, source);
}
return true;
}
return false;
}
}

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.portal;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class HandOfDeath extends mage.sets.starter2000.HandOfDeath {
public HandOfDeath(UUID ownerId) {
super(ownerId);
this.cardNumber = 14;
this.expansionSetCode = "POR";
}
public HandOfDeath(final HandOfDeath card) {
super(card);
}
@Override
public HandOfDeath copy() {
return new HandOfDeath(this);
}
}

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.portalsecondage;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class HandOfDeath extends mage.sets.starter2000.HandOfDeath {
public HandOfDeath(UUID ownerId) {
super(ownerId);
this.cardNumber = 14;
this.expansionSetCode = "PO2";
}
public HandOfDeath(final HandOfDeath card) {
super(card);
}
@Override
public HandOfDeath copy() {
return new HandOfDeath(this);
}
}

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.prophecy;
import java.util.UUID;
/**
*
* @author emerald000
*/
public class AvatarOfWoe extends mage.sets.archenemy.AvatarOfWoe {
public AvatarOfWoe(UUID ownerId) {
super(ownerId);
this.cardNumber = 56;
this.expansionSetCode = "PCY";
}
public AvatarOfWoe(final AvatarOfWoe card) {
super(card);
}
@Override
public AvatarOfWoe copy() {
return new AvatarOfWoe(this);
}
}

View file

@ -102,7 +102,7 @@ class DryadMilitantReplacementEffect extends ReplacementEffectImpl {
if (controller != null) {
Card card = game.getCard(event.getTargetId());
if (card != null) {
return controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, null);
return controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, game.getState().getZone(card.getId()));
}
}
return false;

View file

@ -29,17 +29,11 @@ package mage.sets.riseoftheeldrazi;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
@ -59,7 +53,7 @@ public class MerfolkObserver extends CardImpl {
this.toughness = new MageInt(1);
// When Merfolk Observer enters the battlefield, look at the top card of target player's library.
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new MerfolkObserverEffect());
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new LookLibraryTopCardTargetPlayerEffect());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
@ -73,36 +67,3 @@ public class MerfolkObserver extends CardImpl {
return new MerfolkObserver(this);
}
}
class MerfolkObserverEffect extends OneShotEffect {
public MerfolkObserverEffect() {
super(Outcome.Benefit);
this.staticText = "look at the top card of target player's library";
}
public MerfolkObserverEffect(final MerfolkObserverEffect effect) {
super(effect);
}
@Override
public MerfolkObserverEffect copy() {
return new MerfolkObserverEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (player != null && targetPlayer != null) {
Card card = targetPlayer.getLibrary().getFromTop(game);
if (card != null) {
CardsImpl cards = new CardsImpl();
cards.add(card);
player.lookAtCards("Merfolk Observer", cards, game);
}
return true;
}
return false;
}
}

View file

@ -107,4 +107,10 @@ class MoreCardsInHandThanOpponentsCondition implements Condition {
}
return true;
}
@Override
public String toString() {
return "you have more cards in hand than each opponent";
}
}

View file

@ -1,4 +1,4 @@
/*
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
@ -30,8 +30,8 @@ package mage.sets.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SweepNumber;
import mage.abilities.effects.keyword.SweepEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.abilities.effects.keyword.SweepEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;

View file

@ -0,0 +1,145 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
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.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class CowedByWisdom extends CardImpl {
public CowedByWisdom(UUID ownerId) {
super(ownerId, 5, "Cowed by Wisdom", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}");
this.expansionSetCode = "SOK";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature can't attack or block unless its controller pays {1} for each card in your hand.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CowedByWisdomEffect()));
}
public CowedByWisdom(final CowedByWisdom card) {
super(card);
}
@Override
public CowedByWisdom copy() {
return new CowedByWisdom(this);
}
}
class CowedByWisdomEffect extends ReplacementEffectImpl {
private static final String effectText = "Enchanted creature can't attack or block unless its controller pays {1} for each card in your hand";
CowedByWisdomEffect ( ) {
super(Duration.WhileOnBattlefield, Outcome.Neutral);
staticText = effectText;
}
CowedByWisdomEffect ( CowedByWisdomEffect effect ) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player player = game.getPlayer(event.getPlayerId());
Player controller = game.getPlayer(source.getControllerId());
if (player != null && controller != null) {
if (controller.getHand().isEmpty()) {
return false;
}
String chooseText;
int cardsInHand = controller.getHand().size();
if (event.getType().equals(GameEvent.EventType.DECLARE_ATTACKER)) {
chooseText = "Pay {" + cardsInHand + "} to attack?";
} else {
chooseText = "Pay {" + cardsInHand + "} to block?";
}
ManaCostsImpl attackBlockTax = new ManaCostsImpl("{" + cardsInHand + "}");
if (attackBlockTax.canPay(source, source.getSourceId(), event.getPlayerId(), game)
&& player.chooseUse(Outcome.Neutral, chooseText, game)) {
if (attackBlockTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
return false;
}
}
return true;
}
return false;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType().equals(GameEvent.EventType.DECLARE_ATTACKER)) {
Permanent attacker = game.getPermanent(event.getSourceId());
return attacker != null && attacker.getAttachments().contains(source.getSourceId());
}
if (event.getType().equals(GameEvent.EventType.DECLARE_BLOCKER)) {
Permanent blocker = game.getPermanent(event.getSourceId());
return blocker != null && blocker.getAttachments().contains(source.getSourceId());
}
return false;
}
@Override
public CowedByWisdomEffect copy() {
return new CowedByWisdomEffect(this);
}
}

View file

@ -0,0 +1,156 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.Rarity;
import mage.constants.TurnPhase;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.filter.predicate.permanent.BlockingPredicate;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class CurtainOfLight extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("unblocked attacking creature");
static {
filter.add(new AttackingPredicate());
filter.add(Predicates.not(new BlockingPredicate()));
}
public CurtainOfLight(UUID ownerId) {
super(ownerId, 6, "Curtain of Light", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "SOK";
// Cast Curtain of Light only during combat after blockers are declared.
Ability ability = new SimpleStaticAbility(Zone.ALL, new CurtainOfLightRuleModifyingEffect());
ability.setRuleAtTheTop(true);
this.addAbility(ability);
// Target unblocked attacking creature becomes blocked.
this.getSpellAbility().addEffect(new CurtainOfLightEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public CurtainOfLight(final CurtainOfLight card) {
super(card);
}
@Override
public CurtainOfLight copy() {
return new CurtainOfLight(this);
}
}
class CurtainOfLightRuleModifyingEffect extends ContinuousRuleModifiyingEffectImpl {
CurtainOfLightRuleModifyingEffect() {
super(Duration.EndOfGame, Outcome.Detriment);
staticText = "Cast {this} only during combat after blockers are declared";
}
CurtainOfLightRuleModifyingEffect(final CurtainOfLightRuleModifyingEffect effect) {
super(effect);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
return !game.getPhase().getType().equals(TurnPhase.COMBAT) ||
game.getStep().getType().equals(PhaseStep.BEGIN_COMBAT) ||
game.getStep().getType().equals(PhaseStep.DECLARE_ATTACKERS);
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public CurtainOfLightRuleModifyingEffect copy() {
return new CurtainOfLightRuleModifyingEffect(this);
}
}
class CurtainOfLightEffect extends OneShotEffect {
public CurtainOfLightEffect() {
super(Outcome.Benefit);
this.staticText = "Target unblocked attacking creature becomes blocked";
}
public CurtainOfLightEffect(final CurtainOfLightEffect effect) {
super(effect);
}
@Override
public CurtainOfLightEffect copy() {
return new CurtainOfLightEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
CombatGroup combatGroup = game.getCombat().findGroup(permanent.getId());
if (combatGroup != null) {
combatGroup.setBlocked(true);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,169 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.FlipSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget;
import mage.watchers.common.CastSpellLastTurnWatcher;
/**
*
* @author LevelX2
*/
public class ErayoSoratamiAscendant extends CardImpl {
public ErayoSoratamiAscendant(UUID ownerId) {
super(ownerId, 35, "Erayo, Soratami Ascendant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetCode = "SOK";
this.supertype.add("Legendary");
this.subtype.add("Moonfolk");
this.subtype.add("Monk");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.flipCard = true;
this.flipCardName = "Erayo's Essence";
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever the fourth spell of a turn is cast, flip Erayo, Soratami Ascendant.
this.addAbility(new ErayoSoratamiAscendantTriggeredAbility());
}
public ErayoSoratamiAscendant(final ErayoSoratamiAscendant card) {
super(card);
}
@Override
public ErayoSoratamiAscendant copy() {
return new ErayoSoratamiAscendant(this);
}
}
class ErayoSoratamiAscendantTriggeredAbility extends TriggeredAbilityImpl {
public ErayoSoratamiAscendantTriggeredAbility() {
super(Zone.BATTLEFIELD, getFlipEffect(), false);
}
private static Effect getFlipEffect() {
Effect effect = new FlipSourceEffect(new ErayosEssence());
effect.setText("flip {this}");
return effect;
}
public ErayoSoratamiAscendantTriggeredAbility(final ErayoSoratamiAscendantTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
if (watcher != null && watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn() == 4) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever the fourth spell of a turn is cast, " + super.getRule();
}
@Override
public ErayoSoratamiAscendantTriggeredAbility copy() {
return new ErayoSoratamiAscendantTriggeredAbility(this);
}
}
class ErayosEssence extends Token {
ErayosEssence () {
super("Erayo's Essence", "");
supertype.add("Legendary");
cardType.add(CardType.ENCHANTMENT);
color.setBlue(true);
// Whenever an opponent casts a spell for the first time in a turn, counter that spell.
this.addAbility(new ErayosEssenceTriggeredAbility());
}
}
class ErayosEssenceTriggeredAbility extends TriggeredAbilityImpl {
public ErayosEssenceTriggeredAbility() {
super(Zone.BATTLEFIELD, new CounterTargetEffect(), false);
}
public ErayosEssenceTriggeredAbility(final ErayosEssenceTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 1) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
return true;
}
}
}
return false;
}
@Override
public String getRule() {
return "Whenever an opponent casts a spell for the first time in a turn, counter that spell.";
}
@Override
public ErayosEssenceTriggeredAbility copy() {
return new ErayosEssenceTriggeredAbility(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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class KitsuneBonesetter extends CardImpl {
public KitsuneBonesetter(UUID ownerId) {
super(ownerId, 15, "Kitsune Bonesetter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.expansionSetCode = "SOK";
this.subtype.add("Fox");
this.subtype.add("Cleric");
this.power = new MageInt(0);
this.toughness = new MageInt(1);
// {tap}: Prevent the next 3 damage that would be dealt to target creature this turn. Activate this ability only if you have more cards in hand than each opponent.
Ability ability = new ConditionalActivatedAbility(
Zone.BATTLEFIELD,
new PreventDamageToTargetEffect(Duration.EndOfTurn, 3),
new TapSourceCost(),
new MoreCardsInHandThanOpponentsCondition()
);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public KitsuneBonesetter(final KitsuneBonesetter card) {
super(card);
}
@Override
public KitsuneBonesetter copy() {
return new KitsuneBonesetter(this);
}
}

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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class KitsuneLoreweaver extends CardImpl {
public KitsuneLoreweaver(UUID ownerId) {
super(ownerId, 17, "Kitsune Loreweaver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.expansionSetCode = "SOK";
this.subtype.add("Fox");
this.subtype.add("Cleric");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// {1}{W}: Kitsune Loreweaver gets +0/+X until end of turn, where X is the number of cards in your hand.
Effect effect = new BoostSourceEffect(new StaticValue(0), new CardsInControllerHandCount(), Duration.EndOfTurn, true);
effect.setText("{this} gets +0/+X until end of turn, where X is the number of cards in your hand");
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{W}")));
}
public KitsuneLoreweaver(final KitsuneLoreweaver card) {
super(card);
}
@Override
public KitsuneLoreweaver copy() {
return new KitsuneLoreweaver(this);
}
}

View file

@ -0,0 +1,128 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class KiyomaroFirstToStand extends CardImpl {
public KiyomaroFirstToStand(UUID ownerId) {
super(ownerId, 18, "Kiyomaro, First to Stand", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.expansionSetCode = "SOK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Kiyomaro, First to Stand's power and toughness are each equal to the number of cards in your hand.
DynamicValue xValue= new CardsInControllerHandCount();
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
// As long as you have four or more cards in hand, Kiyomaro has vigilance.
Condition condition = new CardsInHandCondition(CardsInHandCondition.CountType.MORE_THAN,3);
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield), condition,
"As long as you have four or more cards in hand, {this} has vigilance"));
this.addAbility(ability);
// Whenever Kiyomaro deals damage, if you have seven or more cards in hand, you gain 7 life.
this.addAbility(new ConditionalTriggeredAbility(
new KiyomaroFirstToStandDealsDamageTriggeredAbility(),
new CardsInHandCondition(CardsInHandCondition.CountType.MORE_THAN, 6),
"Whenever {this} deals damage, if you have seven or more cards in hand, you gain 7 life"
));
}
public KiyomaroFirstToStand(final KiyomaroFirstToStand card) {
super(card);
}
@Override
public KiyomaroFirstToStand copy() {
return new KiyomaroFirstToStand(this);
}
}
class KiyomaroFirstToStandDealsDamageTriggeredAbility extends TriggeredAbilityImpl {
public KiyomaroFirstToStandDealsDamageTriggeredAbility() {
super(Zone.BATTLEFIELD, new GainLifeEffect(7), false);
}
public KiyomaroFirstToStandDealsDamageTriggeredAbility(final KiyomaroFirstToStandDealsDamageTriggeredAbility ability) {
super(ability);
}
@Override
public KiyomaroFirstToStandDealsDamageTriggeredAbility copy() {
return new KiyomaroFirstToStandDealsDamageTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE)
|| event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER)
|| event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) {
if (event.getSourceId().equals(this.getSourceId())) {
for (Effect effect : this.getEffects()) {
effect.setValue("damage", event.getAmount());
}
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,112 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class MirenTheMoaningWell extends CardImpl {
public MirenTheMoaningWell(UUID ownerId) {
super(ownerId, 163, "Miren, the Moaning Well", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "SOK";
this.supertype.add("Legendary");
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {3}, {tap}, Sacrifice a creature: You gain life equal to the sacrificed creature's toughness.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MirenTheMoaningWellEffect(), new GenericManaCost(3));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), true)));
this.addAbility(ability);
}
public MirenTheMoaningWell(final MirenTheMoaningWell card) {
super(card);
}
@Override
public MirenTheMoaningWell copy() {
return new MirenTheMoaningWell(this);
}
}
class MirenTheMoaningWellEffect extends OneShotEffect {
public MirenTheMoaningWellEffect() {
super(Outcome.GainLife);
this.staticText = "You gain life equal to the sacrificed creature's toughness";
}
public MirenTheMoaningWellEffect(final MirenTheMoaningWellEffect effect) {
super(effect);
}
@Override
public MirenTheMoaningWellEffect copy() {
return new MirenTheMoaningWellEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
int amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue();
if (amount > 0) {
controller.gainLife(amount, game);
}
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,84 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class OboroEnvoy extends CardImpl {
public OboroEnvoy(UUID ownerId) {
super(ownerId, 49, "Oboro Envoy", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "SOK";
this.subtype.add("Moonfolk");
this.subtype.add("Wizard");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {2}, Return a land you control to its owner's hand: Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand.
Effect effect = new BoostTargetEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(-0), Duration.EndOfTurn);
effect.setText("Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public OboroEnvoy(final OboroEnvoy card) {
super(card);
}
@Override
public OboroEnvoy copy() {
return new OboroEnvoy(this);
}
}

View file

@ -0,0 +1,112 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.TargetSpell;
/**
*
* @author LevelX2
*/
public class OppressiveWill extends CardImpl {
public OppressiveWill(UUID ownerId) {
super(ownerId, 50, "Oppressive Will", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}");
this.expansionSetCode = "SOK";
// Counter target spell unless its controller pays {1} for each card in your hand.
this.getSpellAbility().addEffect(new SpellSyphonEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
public OppressiveWill(final OppressiveWill card) {
super(card);
}
@Override
public OppressiveWill copy() {
return new OppressiveWill(this);
}
}
class SpellSyphonEffect extends OneShotEffect {
public SpellSyphonEffect() {
super(Outcome.Benefit);
}
public SpellSyphonEffect(final SpellSyphonEffect effect) {
super(effect);
}
@Override
public SpellSyphonEffect copy() {
return new SpellSyphonEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source));
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null && spell != null) {
Player player = game.getPlayer(spell.getControllerId());
Player controller = game.getPlayer(source.getControllerId());
if (player != null && controller != null) {
int amount = controller.getHand().size();
if (amount > 0) {
GenericManaCost cost = new GenericManaCost(amount);
if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) {
game.informPlayers(sourceObject.getLogName() + ": cost wasn't payed - countering target spell.");
return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
}
}
return true;
}
}
return false;
}
@Override
public String getText(Mode mode) {
return "Counter target spell unless its controller pays {1} for each card in your hand";
}
}

View file

@ -0,0 +1,61 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class PresenceOfTheWise extends CardImpl {
public PresenceOfTheWise(UUID ownerId) {
super(ownerId, 23, "Presence of the Wise", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{W}{W}");
this.expansionSetCode = "SOK";
// You gain 2 life for each card in your hand.
this.getSpellAbility().addEffect(new GainLifeEffect(
new MultipliedValue(new CardsInControllerHandCount(), 2),"You gain 2 life for each card in your hand"));
}
public PresenceOfTheWise(final PresenceOfTheWise card) {
super(card);
}
@Override
public PresenceOfTheWise copy() {
return new PresenceOfTheWise(this);
}
}

View file

@ -0,0 +1,105 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SpiritToken;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class PromiseOfBunrei extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature you control");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
public PromiseOfBunrei(UUID ownerId) {
super(ownerId, 24, "Promise of Bunrei", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.expansionSetCode = "SOK";
// When a creature you control dies, sacrifice Promise of Bunrei. If you do, put four 1/1 colorless Spirit creature tokens onto the battlefield.
this.addAbility(new DiesCreatureTriggeredAbility(new PromiseOfBunreiEffect(), false, filter));
}
public PromiseOfBunrei(final PromiseOfBunrei card) {
super(card);
}
@Override
public PromiseOfBunrei copy() {
return new PromiseOfBunrei(this);
}
}
class PromiseOfBunreiEffect extends OneShotEffect {
public PromiseOfBunreiEffect() {
super(Outcome.Benefit);
this.staticText = "sacrifice {this}. If you do, put four 1/1 colorless Spirit creature tokens onto the battlefield";
}
public PromiseOfBunreiEffect(final PromiseOfBunreiEffect effect) {
super(effect);
}
@Override
public PromiseOfBunreiEffect copy() {
return new PromiseOfBunreiEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
if (permanent.sacrifice(source.getSourceId(), game)) {
return new CreateTokenEffect(new SpiritToken(), 4).apply(game, source);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,103 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class Reverence extends CardImpl {
public Reverence(UUID ownerId) {
super(ownerId, 26, "Reverence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
this.expansionSetCode = "SOK";
// Creatures with power 2 or less can't attack you.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ReverenceRestrictionEffect()));
}
public Reverence(final Reverence card) {
super(card);
}
@Override
public Reverence copy() {
return new Reverence(this);
}
}
class ReverenceRestrictionEffect extends RestrictionEffect {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures with power 2 or less");
static {
filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3));
}
ReverenceRestrictionEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "Creatures with power 2 or less can't attack you";
}
ReverenceRestrictionEffect(final ReverenceRestrictionEffect effect) {
super(effect);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
}
@Override
public boolean canAttack(UUID defenderId, Ability source, Game game) {
return !defenderId.equals(source.getControllerId());
}
@Override
public ReverenceRestrictionEffect copy() {
return new ReverenceRestrictionEffect(this);
}
}

View file

@ -0,0 +1,135 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.util.functions.ApplyToPermanent;
/**
*
* @author LevelX2
*/
public class SakashimaTheImpostor extends CardImpl {
private static final String abilityText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains \"{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step.\"";
public SakashimaTheImpostor(UUID ownerId) {
super(ownerId, 53, "Sakashima the Impostor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.expansionSetCode = "SOK";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Rogue");
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step."
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(
new SakashimaTheImpostorCopyEffect(), abilityText, true));
this.addAbility(ability);
}
public SakashimaTheImpostor(final SakashimaTheImpostor card) {
super(card);
}
@Override
public SakashimaTheImpostor copy() {
return new SakashimaTheImpostor(this);
}
}
class SakashimaTheImpostorCopyEffect extends OneShotEffect {
public SakashimaTheImpostorCopyEffect() {
super(Outcome.Copy);
}
public SakashimaTheImpostorCopyEffect(final SakashimaTheImpostorCopyEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null) {
Target target = new TargetPermanent(new FilterCreaturePermanent());
target.setNotTarget(true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
player.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() {
@Override
public Boolean apply(Game game, Permanent permanent) {
if (!permanent.getSupertype().contains("Legendary")) {
permanent.getSubtype().add("Legendary");
}
permanent.setName("Sakashima the Impostor");
// {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step
permanent.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false),
new ManaCostsImpl("{2}{U}{U}")
), game);
return true;
}
});
return true;
}
}
}
return false;
}
@Override
public SakashimaTheImpostorCopyEffect copy() {
return new SakashimaTheImpostorCopyEffect(this);
}
}

View file

@ -0,0 +1,108 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class ShapeStealer extends CardImpl {
public ShapeStealer(UUID ownerId) {
super(ownerId, 55, "Shape Stealer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{U}{U}");
this.expansionSetCode = "SOK";
this.subtype.add("Shapeshifter");
this.subtype.add("Spirit");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// This ability triggers once for each creature blocked by or blocking Shape Stealer.
// If multiple creatures block it, Shape Stealer's power and toughness will change for
// each one in succession. The first trigger put on the stack will be the last to resolve,
// so that will set Shape Stealer's final power and toughness.
// Whenever Shape Stealer blocks or becomes blocked by a creature, change Shape Stealer's power and toughness to that creature's power and toughness until end of turn.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new ShapeStealerEffect(), false));
}
public ShapeStealer(final ShapeStealer card) {
super(card);
}
@Override
public ShapeStealer copy() {
return new ShapeStealer(this);
}
}
class ShapeStealerEffect extends OneShotEffect {
public ShapeStealerEffect() {
super(Outcome.Detriment);
this.staticText = "change {this}'s power and toughness to that creature's power and toughness until end of turn";
}
public ShapeStealerEffect(final ShapeStealerEffect effect) {
super(effect);
}
@Override
public ShapeStealerEffect copy() {
return new ShapeStealerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (permanent != null) {
ContinuousEffect effect = new SetPowerToughnessSourceEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn);
game.addEffect(effect, source);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,66 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.effects.common.continious.ExchangeControlTargetEffect;
import mage.abilities.keyword.SpliceOntoArcaneAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetLandPermanent;
/**
*
* @author LevelX2
*/
public class ShiftingBorders extends CardImpl {
public ShiftingBorders(UUID ownerId) {
super(ownerId, 56, "Shifting Borders", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}");
this.expansionSetCode = "SOK";
this.subtype.add("Arcane");
// Exchange control of two target lands.
this.getSpellAbility().addEffect(new ExchangeControlTargetEffect(Duration.EndOfGame, "Exchange control of two target lands"));
this.getSpellAbility().addTarget(new TargetLandPermanent(2));
// Splice onto Arcane {3}{U}
this.addAbility(new SpliceOntoArcaneAbility("{3}{U}"));
}
public ShiftingBorders(final ShiftingBorders card) {
super(card);
}
@Override
public ShiftingBorders copy() {
return new ShiftingBorders(this);
}
}

View file

@ -0,0 +1,86 @@
/*
* 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.saviorsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.ReturnToHandTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author LevelX2
*/
public class SoramaroFirstToDream extends CardImpl {
public SoramaroFirstToDream(UUID ownerId) {
super(ownerId, 58, "Soramaro, First to Dream", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}");
this.expansionSetCode = "SOK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Soramaro, First to Dream's power and toughness are each equal to the number of cards in your hand.
DynamicValue xValue= new CardsInControllerHandCount();
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
// {4}, Return a land you control to its owner's hand: Draw a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new DrawCardSourceControllerEffect(1), new GenericManaCost(4));
ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
this.addAbility(ability);
}
public SoramaroFirstToDream(final SoramaroFirstToDream card) {
super(card);
}
@Override
public SoramaroFirstToDream copy() {
return new SoramaroFirstToDream(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.saviorsofkamigawa;
import java.util.UUID;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.SpliceOntoArcaneAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.SpiritToken;
/**
*
* @author LevelX2
*/
public class SpiritualVisit extends CardImpl {
public SpiritualVisit(UUID ownerId) {
super(ownerId, 29, "Spiritual Visit", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "SOK";
this.subtype.add("Arcane");
// Put a 1/1 colorless Spirit creature token onto the battlefield.
this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritToken()));
// Splice onto Arcane {W}
this.addAbility(new SpliceOntoArcaneAbility("{W}"));
}
public SpiritualVisit(final SpiritualVisit card) {
super(card);
}
@Override
public SpiritualVisit copy() {
return new SpiritualVisit(this);
}
}

View file

@ -56,6 +56,7 @@ import mage.game.permanent.token.WolfToken;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
import mage.abilities.Ability;
/**
*
@ -71,15 +72,23 @@ public class SwordOfBodyAndMind extends CardImpl {
new ColorPredicate(ObjectColor.BLUE)));
}
public SwordOfBodyAndMind (UUID ownerId) {
super(ownerId, 208, "Sword of Body and Mind", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "SOM";
this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.EQUIPMENT)));
// Equipped creature gets +2/+2 and has protection from green and from blue.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2));
Effect effect = new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.EQUIPMENT);
effect.setText("and has protection from green and from blue");
ability.addEffect(effect);
this.addAbility(ability);
// Whenever equipped creature deals combat damage to a player, you put a 2/2 green Wolf creature token onto the battlefield and that player puts the top ten cards of his or her library into his or her graveyard.
this.addAbility(new SwordOfBodyAndMindAbility());
// Equip {2}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
}
public SwordOfBodyAndMind (final SwordOfBodyAndMind card) {
@ -115,7 +124,7 @@ class SwordOfBodyAndMindAbility extends TriggeredAbilityImpl {
Permanent p = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}

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.scourge;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAttachedTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterBasicLandCard;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class OneWithNature extends CardImpl {
public OneWithNature(UUID ownerId) {
super(ownerId, 125, "One with Nature", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "SCG";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutLandInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted creature deals combat damage to a player, you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.
ability = new DealsDamageToAPlayerAttachedTriggeredAbility(
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, Outcome.PutLandInPlay),
"enchanted creature", true, false, true, TargetController.ANY);
this.addAbility(ability);
}
public OneWithNature(final OneWithNature card) {
super(card);
}
@Override
public OneWithNature copy() {
return new OneWithNature(this);
}
}

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.seventhedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class Twiddle extends mage.sets.unlimitededition.Twiddle {
public Twiddle(UUID ownerId) {
super(ownerId);
this.cardNumber = 107;
this.expansionSetCode = "7ED";
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(this);
}
}

View file

@ -36,6 +36,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.OpponentControllsMoreCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterBySubtypeCard;
@ -62,7 +63,7 @@ public class KnightOfTheWhiteOrchid extends CardImpl {
// When Knight of the White Orchid enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library.
this.addAbility(new ConditionalTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterBySubtypeCard("Plains")), true), true),
new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, new FilterBySubtypeCard("Plains")), false), true),
new OpponentControllsMoreCondition(new FilterLandPermanent("lands")),
"When {this} enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library"));

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.starter1999;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class HandOfDeath extends mage.sets.starter2000.HandOfDeath {
public HandOfDeath(UUID ownerId) {
super(ownerId);
this.cardNumber = 80;
this.expansionSetCode = "S99";
}
public HandOfDeath(final HandOfDeath card) {
super(card);
}
@Override
public HandOfDeath copy() {
return new HandOfDeath(this);
}
}

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.starter2000;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author anonymous
*/
public class HandOfDeath extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
static {
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
}
public HandOfDeath(UUID ownerId) {
super(ownerId, 6, "Hand of Death", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}");
this.expansionSetCode = "S00";
this.color.setBlack(true);
// Destroy target nonblack creature.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new DestroyTargetEffect());
}
public HandOfDeath(final HandOfDeath card) {
super(card);
}
@Override
public HandOfDeath copy() {
return new HandOfDeath(this);
}
}

View file

@ -35,7 +35,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/
public class RollingStones extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Wall creatures");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wall creatures");
static {
filter.add(new SubtypePredicate("Wall"));

View file

@ -0,0 +1,74 @@
/*
* 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.tempest;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author KholdFuzion
*/
public class StormFront extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying");
static {
filter.add(new AbilityPredicate(FlyingAbility.class));
}
public StormFront(UUID ownerId) {
super(ownerId, 153, "Storm Front", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "TMP";
// {G}{G}: Tap target creature with flying.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{G}{G}"));
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
public StormFront(final StormFront card) {
super(card);
}
@Override
public StormFront copy() {
return new StormFront(this);
}
}

View file

@ -27,33 +27,29 @@
*/
package mage.sets.theros;
import java.util.LinkedList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.Card;
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.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
* If the land Chained to the Rocks is enchanting stops being a Mountain or another player
@ -112,10 +108,8 @@ public class ChainedToTheRocks extends CardImpl {
// When Chained to the Rocks enters the battlefield, exile target creature an opponent controls until Chained to the Rocks leaves the battlefield. (That creature returns under its owner's control.)
ability = new EntersBattlefieldTriggeredAbility(new ChainedToTheRocksEffect());
ability.addTarget(new TargetCreaturePermanent(filterTarget));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(ability);
// Implemented as triggered effect that doesn't uses the stack (implementation with watcher does not work correctly because if the returned creature
// has a DiesTriggeredAll ability it triggers for the battlefield leaving Chained to the Rocks, what shouldn't happen)
this.addAbility(new ChainedToTheRocksReturnExiledAbility());
}
@ -151,77 +145,7 @@ class ChainedToTheRocksEffect extends OneShotEffect {
// If Chained to the Rocks leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(source.getSourceId(), permanent.getLogName()).apply(game, source);
}
return false;
}
}
/**
* Returns the exiled card as Chained to the Rocks leaves battlefield
* Uses no stack
* @author LevelX2
*/
class ChainedToTheRocksReturnExiledAbility extends TriggeredAbilityImpl {
public ChainedToTheRocksReturnExiledAbility() {
super(Zone.BATTLEFIELD, new ReturnExiledCreatureChainedToTheRocksEffect());
this.usesStack = false;
this.setRuleVisible(false);
}
public ChainedToTheRocksReturnExiledAbility(final ChainedToTheRocksReturnExiledAbility ability) {
super(ability);
}
@Override
public ChainedToTheRocksReturnExiledAbility copy() {
return new ChainedToTheRocksReturnExiledAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
}
}
return false;
}
}
class ReturnExiledCreatureChainedToTheRocksEffect extends OneShotEffect {
public ReturnExiledCreatureChainedToTheRocksEffect() {
super(Outcome.Benefit);
this.staticText = "Return exiled creatures";
}
public ReturnExiledCreatureChainedToTheRocksEffect(final ReturnExiledCreatureChainedToTheRocksEffect effect) {
super(effect);
}
@Override
public ReturnExiledCreatureChainedToTheRocksEffect copy() {
return new ReturnExiledCreatureChainedToTheRocksEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
Card sourceCard = game.getCard(source.getSourceId());
if (exile != null && sourceCard != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
}
exile.clear();
return true;
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getLogName()).apply(game, source);
}
return false;
}

View file

@ -156,8 +156,8 @@ class WhipOfErebosReplacementEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Card card = game.getCard(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
if (card != null && controller != null) {
controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, null);
if (card != null && controller != null) {
controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.BATTLEFIELD);
}
return true;
}

View file

@ -0,0 +1,54 @@
/*
* 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.timeshifted;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author emerald000
*/
public class AvatarOfWoe extends mage.sets.archenemy.AvatarOfWoe {
public AvatarOfWoe(UUID ownerId) {
super(ownerId);
this.cardNumber = 37;
this.expansionSetCode = "TSB";
this.rarity = Rarity.SPECIAL;
}
public AvatarOfWoe(final AvatarOfWoe card) {
super(card);
}
@Override
public AvatarOfWoe copy() {
return new AvatarOfWoe(this);
}
}

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.unlimitededition;
import java.util.UUID;
import mage.abilities.effects.common.MayTapOrUntapTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
*
* @author anonymous
*/
public class Twiddle extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.LAND)));
}
public Twiddle(UUID ownerId) {
super(ownerId, 86, "Twiddle", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "2ED";
// You may tap or untap target artifact, creature, or land.
this.getSpellAbility().addEffect(new MayTapOrUntapTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
}
public Twiddle(final Twiddle card) {
super(card);
}
@Override
public Twiddle copy() {
return new Twiddle(this);
}
}

View file

@ -0,0 +1,145 @@
/*
* 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.urzassaga;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import static mage.constants.Layer.PTChangingEffects_7;
import static mage.constants.Layer.TypeChangingEffects_4;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
/**
*
* @author LevelX2
*/
public class KarnSilverGolem extends CardImpl {
private static final FilterArtifactPermanent filterNonCreature = new FilterArtifactPermanent("noncreature artifact");
static {
filterNonCreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public KarnSilverGolem(UUID ownerId) {
super(ownerId, 298, "Karn, Silver Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
this.expansionSetCode = "USG";
this.supertype.add("Legendary");
this.subtype.add("Golem");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Karn, Silver Golem blocks or becomes blocked, it gets -4/+4 until end of turn.
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-4, +4, Duration.EndOfTurn), false));
// {1}: Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KarnSilverGolemEffect(), new ManaCostsImpl("{1"));
ability.addTarget(new TargetPermanent(filterNonCreature));
this.addAbility(ability);
}
public KarnSilverGolem(final KarnSilverGolem card) {
super(card);
}
@Override
public KarnSilverGolem copy() {
return new KarnSilverGolem(this);
}
}
class KarnSilverGolemEffect extends ContinuousEffectImpl {
public KarnSilverGolemEffect() {
super(Duration.EndOfTurn, Outcome.BecomeCreature);
staticText = "Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn";
}
public KarnSilverGolemEffect(final KarnSilverGolemEffect effect) {
super(effect);
}
@Override
public KarnSilverGolemEffect copy() {
return new KarnSilverGolemEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent artifact = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (artifact == null) {
return false;
}
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (!artifact.getCardType().contains(CardType.CREATURE)) {
artifact.getCardType().add(CardType.CREATURE);
}
}
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
int cmc = artifact.getManaCost().convertedManaCost();
artifact.getPower().setValue(cmc);
artifact.getToughness().setValue(cmc);
}
}
return true;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4;
}
}

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.vintagemasters;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class KarnSilverGolem extends mage.sets.urzassaga.KarnSilverGolem {
public KarnSilverGolem(UUID ownerId) {
super(ownerId);
this.cardNumber = 270;
this.expansionSetCode = "VMA";
}
public KarnSilverGolem(final KarnSilverGolem card) {
super(card);
}
@Override
public KarnSilverGolem copy() {
return new KarnSilverGolem(this);
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.sets.vintagemasters;
import java.util.List;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
@ -41,9 +40,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
@ -76,7 +73,7 @@ public class ManaCrypt extends CardImpl {
class ManaCryptEffect extends OneShotEffect {
ManaCryptEffect() {
super(Outcome.Sacrifice);
super(Outcome.Damage);
staticText = "flip a coin. If you lose the flip, {this} Crypt deals 3 damage to you";
}

View file

@ -0,0 +1,108 @@
/*
* 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.vintagemasters;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author emerald000
*/
public class PleaForPower extends CardImpl {
public PleaForPower(UUID ownerId) {
super(ownerId, 87, "Plea for Power", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
this.expansionSetCode = "VMA";
// Will of the council - Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.
this.getSpellAbility().addEffect(new PleaForPowerEffect());
}
public PleaForPower(final PleaForPower card) {
super(card);
}
@Override
public PleaForPower copy() {
return new PleaForPower(this);
}
}
class PleaForPowerEffect extends OneShotEffect {
PleaForPowerEffect() {
super(Outcome.Benefit);
this.staticText = "<i>Will of the council</i> — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards";
}
PleaForPowerEffect(final PleaForPowerEffect effect) {
super(effect);
}
@Override
public PleaForPowerEffect copy() {
return new PleaForPowerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int timeCount = 0;
int knowledgeCount = 0;
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player.chooseUse(Outcome.ExtraTurn, "Choose time?", game)) {
timeCount++;
game.informPlayers(player.getName() + " has chosen: time");
}
else {
knowledgeCount++;
game.informPlayers(player.getName() + " has chosen: knowledge");
}
}
if (timeCount > knowledgeCount) {
new AddExtraTurnControllerEffect().apply(game, source);
}
else {
controller.drawCards(3, game);
}
return true;
}
return false;
}
}

Some files were not shown because too many files have changed in this diff Show more