Merge pull request #4 from magefree/master

Fork sync
This commit is contained in:
ilcartographer 2015-06-17 17:13:09 -04:00
commit f7666d998f
60 changed files with 2350 additions and 241 deletions

View file

@ -2422,7 +2422,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"),
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"),
getUserSkipPrioritySteps(), getUserSkipPrioritySteps(),
MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png"), MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"),
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true") PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true")
); );
} }

View file

@ -1146,6 +1146,7 @@ public class TablesPanel extends javax.swing.JPanel {
options.setMatchTimeLimit(MatchTimeLimit.NONE); options.setMatchTimeLimit(MatchTimeLimit.NONE);
options.setFreeMulligans(2); options.setFreeMulligans(2);
options.setSkillLevel(SkillLevel.CASUAL); options.setSkillLevel(SkillLevel.CASUAL);
options.setRollbackTurnsAllowed(true);
table = session.createTable(roomId, options); table = session.createTable(roomId, options);
session.joinTable(roomId, table.getTableId(), "Human", "Human", 1, DeckImporterUtil.importDeck("test.dck"),""); session.joinTable(roomId, table.getTableId(), "Human", "Human", 1, DeckImporterUtil.importDeck("test.dck"),"");

View file

@ -68,7 +68,7 @@ public class CountryCellRenderer extends DefaultTableCellRenderer {
private ImageIcon getCountryFlagIcon(String countryCode) { private ImageIcon getCountryFlagIcon(String countryCode) {
ImageIcon flagIcon = flagIconCache.get(countryCode); ImageIcon flagIcon = flagIconCache.get(countryCode);
if (flagIcon == null) { if (flagIcon == null) {
flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode +".png")); flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode + (countryCode.endsWith(".png") ? "" :".png")));
if (flagIcon.getImage() == null) { if (flagIcon.getImage() == null) {
logger.warn("Country flag resource not found: " + countryCode); logger.warn("Country flag resource not found: " + countryCode);
} else { } else {

View file

@ -42,7 +42,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 1; public final static int MAGE_VERSION_PATCH = 1;
public final static String MAGE_VERSION_MINOR_PATCH = "v0"; public final static String MAGE_VERSION_MINOR_PATCH = "v2";
public final static String MAGE_VERSION_INFO = ""; public final static String MAGE_VERSION_INFO = "";
private final int major; private final int major;

View file

@ -208,7 +208,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString()); log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString());
} }
// sometimes a target aelection can be made from a player that does not control the ability // sometimes a target selection can be made from a player that does not control the ability
UUID abilityControllerId = playerId; UUID abilityControllerId = playerId;
if (target.getTargetController() != null && target.getAbilityController() != null) { if (target.getTargetController() != null && target.getAbilityController() != null) {
abilityControllerId = target.getAbilityController(); abilityControllerId = target.getAbilityController();
@ -507,7 +507,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (target instanceof TargetDiscard || target instanceof TargetCardInHand) { if (target instanceof TargetDiscard || target instanceof TargetCardInHand) {
if (outcome.isGood()) { if (outcome.isGood()) {
ArrayList<Card> cardsInHand = new ArrayList<>(hand.getCards(game)); ArrayList<Card> cardsInHand = new ArrayList<>(hand.getCards(game));
while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() < target.getTargets().size()) { while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() > target.getTargets().size()) {
Card card = pickBestCard(cardsInHand, null, target, source, game); Card card = pickBestCard(cardsInHand, null, target, source, game);
if (card != null) { if (card != null) {
if (target.canTarget(card.getId(), source, game)) { if (target.canTarget(card.getId(), source, game)) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.sets.avacynrestored; package mage.sets.avacynrestored;
import java.util.ArrayList;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType; import mage.constants.CardType;
@ -42,11 +41,10 @@ import mage.cards.CardsImpl;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.util.CardUtil;
/** /**
* *
@ -59,7 +57,6 @@ public class DescendantsPath extends CardImpl {
super(ownerId, 173, "Descendants' Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); super(ownerId, 173, "Descendants' Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.expansionSetCode = "AVR"; this.expansionSetCode = "AVR";
// At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library. // At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DescendantsPathEffect(), TargetController.YOU, false); Ability ability = new BeginningOfUpkeepTriggeredAbility(new DescendantsPathEffect(), TargetController.YOU, false);
this.addAbility(ability); this.addAbility(ability);
@ -93,36 +90,39 @@ class DescendantsPathEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (player != null) { MageObject sourceObject = source.getSourceObject(game);
if (player.getLibrary().size() > 0) { if (controller != null && sourceObject != null) {
Card card = player.getLibrary().getFromTop(game); if (controller.getLibrary().size() > 0) {
player.revealCards("DescendantsPath", new CardsImpl(card), game); Card card = controller.getLibrary().getFromTop(game);
if (card.getCardType().contains(CardType.CREATURE)) { if (card == null) {
return false;
}
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
if (card.getCardType().contains(CardType.CREATURE)) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
boolean found = false;
ArrayList<Predicate<MageObject>> subtypes = new ArrayList<>(); for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
for (String subtype: card.getSubtype()) { if (CardUtil.shareSubtypes(card, permanent)) {
subtypes.add(new SubtypePredicate(subtype)); found = true;
break;
}
} }
filter.add(Predicates.or(subtypes)); if (found) {
game.informPlayers(sourceObject.getLogName() + ": Found a creature that shares a creature type with the revealed card.");
int count = game.getBattlefield().getAllActivePermanents(filter, player.getId(), game).size(); if (controller.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
if (count > 0) { controller.cast(card.getSpellAbility(), game, true);
game.informPlayers("DescendantsPath: Found a creature that shares a creature type with the revealed card.");
if (player.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
player.cast(card.getSpellAbility(), game, true);
} else { } else {
game.informPlayers("DescendantsPath: " + player.getLogName() + " canceled casting the card."); game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " canceled casting the card.");
player.getLibrary().putOnBottom(card, game); controller.getLibrary().putOnBottom(card, game);
} }
} else { } else {
game.informPlayers("DescendantsPath: No creature that shares a creature type with the revealed card."); game.informPlayers(sourceObject.getLogName() + ": No creature that shares a creature type with the revealed card.");
player.getLibrary().putOnBottom(card, game); controller.getLibrary().putOnBottom(card, game);
} }
} else { } else {
game.informPlayers("DescendantsPath: put " + card.getName() + " on the bottom."); game.informPlayers(sourceObject.getLogName() + ": Put " + card.getLogName() + " on the bottom.");
player.getLibrary().putOnBottom(card, game); controller.getLibrary().putOnBottom(card, game);
} }
return true; return true;

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 anonymous
*/
public class DreambornMuse extends mage.sets.legions.DreambornMuse {
public DreambornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 44;
this.expansionSetCode = "CMD";
}
public DreambornMuse(final DreambornMuse card) {
super(card);
}
@Override
public DreambornMuse copy() {
return new DreambornMuse(this);
}
}

View file

@ -35,16 +35,13 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterBasicLandCard; import mage.filter.common.FilterBasicLandCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
@ -63,8 +60,10 @@ public class Fertilid extends CardImpl {
// Fertilid enters the battlefield with two +1/+1 counters on it. // Fertilid enters the battlefield with two +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it"));
// {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library. // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new FertilidEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}"));
ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)));
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
@ -79,47 +78,3 @@ public class Fertilid extends CardImpl {
return new Fertilid(this); return new Fertilid(this);
} }
} }
class FertilidEffect extends SearchLibraryPutInPlayEffect {
public FertilidEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) {
super(target, tapped, forceShuffle);
this.staticText = "Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library.";
}
public FertilidEffect(final FertilidEffect effect) {
super(effect);
}
@Override
public FertilidEffect copy() {
return new FertilidEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null) {
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
for (UUID cardId: target.getTargets()) {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped);
}
}
}
player.shuffleLibrary(game);
return true;
}
if (forceShuffle) {
player.shuffleLibrary(game);
}
}
return false;
}
}

View file

@ -0,0 +1,106 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.sets.darksteel;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author wanderer120
*/
public class GreaterHarvester extends CardImpl {
public static final FilterPermanent filter = new FilterPermanent("a permanent");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.PLANESWALKER),
new CardTypePredicate(CardType.LAND)));
}
public GreaterHarvester(UUID ownerId) {
super(ownerId, 44, "Greater Harvester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{B}");
this.expansionSetCode = "DST";
this.subtype.add("Horror");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// At the beginning of your upkeep, sacrifice a permanent.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, ""), TargetController.YOU, false));
//Whenever Greater Harvester deals combat damage to a player, that player sacrifices two permanents.
this.addAbility(new GreaterHarvesterAbility());
}
public GreaterHarvester(final GreaterHarvester card) {
super(card);
}
@Override
public GreaterHarvester copy() {
return new GreaterHarvester(this);
}
}
class GreaterHarvesterAbility extends TriggeredAbilityImpl {
public GreaterHarvesterAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterPermanent(), 2, ""));
}
public GreaterHarvesterAbility(final GreaterHarvesterAbility ability) {
super(ability);
}
@Override
public GreaterHarvesterAbility copy() {
return new GreaterHarvesterAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return EventType.DAMAGED_PLAYER.equals(event.getType());
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} deals combat damage to a player, that player sacrifices two permanent.";
}
}

View file

@ -77,21 +77,23 @@ class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl {
public PainMagnificationTriggeredAbility copy() { public PainMagnificationTriggeredAbility copy() {
return new PainMagnificationTriggeredAbility(this); return new PainMagnificationTriggeredAbility(this);
} }
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { // If the damaged player is an opponent
// If the damaged player is an opponent if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { if(event.getAmount() >= 3) {
int amount = event.getAmount(); // If at least 3 damage is dealt, set the opponent as the Discard target
if(amount >= 3) { for (Effect effect : this.getEffects()) {
// If at least 3 damage is dealt, set the opponent as the Discard target effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
for (Effect effect : this.getEffects()) { }
effect.setTargetPointer(new FixedTarget(event.getPlayerId())); return true;
} }
return true;
}
}
} }
return false; return false;
} }

View file

@ -100,16 +100,19 @@ class TeysaEnvoyOfGhostsTriggeredAbility extends TriggeredAbilityImpl {
return new TeysaEnvoyOfGhostsTriggeredAbility(this); return new TeysaEnvoyOfGhostsTriggeredAbility(this);
} }
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event instanceof DamagedPlayerEvent) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; Permanent sourcePermanent = game.getPermanent(event.getSourceId());
Permanent p = game.getPermanent(event.getSourceId()); if (damageEvent.getPlayerId().equals(getControllerId()) && damageEvent.isCombatDamage() && sourcePermanent != null && sourcePermanent.getCardType().contains(CardType.CREATURE)) {
if (damageEvent.getPlayerId().equals(controllerId) && damageEvent.isCombatDamage() && p != null && p.getCardType().contains(CardType.CREATURE)) { game.getState().setValue(sourceId.toString(), sourcePermanent.getControllerId());
game.getState().setValue(sourceId.toString(), p.getControllerId()); getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); return true;
return true;
}
} }
return false; return false;
} }

View file

@ -52,7 +52,6 @@ public class Bioshift extends CardImpl {
super(ownerId, 214, "Bioshift", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G/U}"); super(ownerId, 214, "Bioshift", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G/U}");
this.expansionSetCode = "GTC"; this.expansionSetCode = "GTC";
// Move any number of +1/+1 counters from target creature onto another target creature with the same controller. // Move any number of +1/+1 counters from target creature onto another target creature with the same controller.
getSpellAbility().addEffect(new MoveCounterFromTargetToTargetEffect()); getSpellAbility().addEffect(new MoveCounterFromTargetToTargetEffect());
getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false)); getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false));

View file

@ -0,0 +1,68 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.legions;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.dynamicvalue.common.CardsInTargetPlayerHandCount;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author cbrianhill
*/
public class DreambornMuse extends CardImpl {
public DreambornMuse(UUID ownerId) {
super(ownerId, 36, "Dreamborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.expansionSetCode = "LGN";
this.subtype.add("Spirit");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand.
PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount());
effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand.");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false));
}
public DreambornMuse(final DreambornMuse card) {
super(card);
}
@Override
public DreambornMuse copy() {
return new DreambornMuse(this);
}
}

View file

@ -37,7 +37,9 @@ import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game; import mage.game.Game;
@ -49,22 +51,20 @@ import mage.target.common.TargetLandPermanent;
* @author ilcartographer * @author ilcartographer
*/ */
public class AquitectsWill extends CardImpl { public class AquitectsWill extends CardImpl {
private static final String rule = "land is an Island in addition to its other types for as long as it has a flood counter on it.";
public AquitectsWill(UUID ownerId) { public AquitectsWill(UUID ownerId) {
super(ownerId, 52, "Aquitect's Will", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{U}"); super(ownerId, 52, "Aquitect's Will", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{U}");
this.expansionSetCode = "LRW"; this.expansionSetCode = "LRW";
this.subtype.add("Merfolk"); this.subtype.add("Merfolk");
// Put a flood counter on target land. That land is an Island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. // Put a flood counter on target land.
// Add the flood counter to target land
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance())); this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance()));
this.getSpellAbility().addTarget(new TargetLandPermanent()); this.getSpellAbility().addTarget(new TargetLandPermanent());
// Add the Flood counter effect // That land is an Island in addition to its other types for as long as it has a flood counter on it.
this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island")); this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island"));
// Draw if you control a Merfolk // If you control a Merfolk, draw a card.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect( this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(1), new DrawCardSourceControllerEffect(1),
new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")), new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")),
@ -85,6 +85,7 @@ class AquitectsWillEffect extends BecomesBasicLandTargetEffect {
public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) { public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) {
super(duration, chooseLandType, loseType, landNames); super(duration, chooseLandType, loseType, landNames);
staticText = "That land is an Island in addition to its other types for as long as it has a flood counter on it";
} }
public AquitectsWillEffect(final AquitectsWillEffect effect) { public AquitectsWillEffect(final AquitectsWillEffect effect) {
@ -92,18 +93,20 @@ class AquitectsWillEffect extends BecomesBasicLandTargetEffect {
} }
@Override @Override
public boolean isInactive(Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source));
if (land != null && land.getCounters().getCount(CounterType.FLOOD) < 1) { if (land == null) {
// if permanent left battlefield the effect can be removed because it was only valid for that object
this.discard(); this.discard();
return true; } else if (land.getCounters().getCount(CounterType.FLOOD) > 0) {
} // only if Flood counter is on the object it becomes an Island.(it would be possible to remove and return the counters with e.g. Fate Transfer if the land becomes a creature too)
super.apply(layer, sublayer, source, game);
return false; }
return true;
} }
@Override @Override
public AquitectsWillEffect copy() { public AquitectsWillEffect copy() {
return new AquitectsWillEffect(this); return new AquitectsWillEffect(this);
} }
} }

View file

@ -0,0 +1,68 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.target.TargetPermanent;
/**
*
* @author emerald000
*/
public class ConclaveNaturalists extends CardImpl {
public ConclaveNaturalists(UUID ownerId) {
super(ownerId, 171, "Conclave Naturalists", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}");
this.expansionSetCode = "ORI";
this.subtype.add("Dryad");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true);
ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()));
this.addAbility(ability);
}
public ConclaveNaturalists(final ConclaveNaturalists card) {
super(card);
}
@Override
public ConclaveNaturalists copy() {
return new ConclaveNaturalists(this);
}
}

View file

@ -0,0 +1,138 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
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.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GraspOfTheHieromancer extends CardImpl {
public GraspOfTheHieromancer(UUID ownerId) {
super(ownerId, 15, "Grasp of the Hieromancer", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.expansionSetCode = "ORI";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
Ability gainedAbility = new GraspOfTheHieromancerTriggeredAbility(new TapTargetEffect(), false);
gainedAbility.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
effect.setText("and has \"Whenever this creature attacks, tap target creature defending player controls.\"");
ability.addEffect(effect);
this.addAbility(ability);
}
public GraspOfTheHieromancer(final GraspOfTheHieromancer card) {
super(card);
}
@Override
public GraspOfTheHieromancer copy() {
return new GraspOfTheHieromancer(this);
}
}
class GraspOfTheHieromancerTriggeredAbility extends TriggeredAbilityImpl {
public GraspOfTheHieromancerTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
public GraspOfTheHieromancerTriggeredAbility(final GraspOfTheHieromancerTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getCombat().getAttackers().contains(getSourceId()) ) {
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
if (defendingPlayerId != null) {
this.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
this.addTarget(target);
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} attacks, tap target creature defending player controls.";
}
@Override
public GraspOfTheHieromancerTriggeredAbility copy() {
return new GraspOfTheHieromancerTriggeredAbility(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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class HeavyInfantry extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public HeavyInfantry(UUID ownerId) {
super(ownerId, 18, "Heavy Infantry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}");
this.expansionSetCode = "ORI";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// When Heavy Infantry enters the battlefield, tap target creature an opponent controls.
Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
public HeavyInfantry(final HeavyInfantry card) {
super(card);
}
@Override
public HeavyInfantry copy() {
return new HeavyInfantry(this);
}
}

View file

@ -0,0 +1,159 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class HixusPrisonWarden extends CardImpl {
public HixusPrisonWarden(UUID ownerId) {
super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{3}{W}{W}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Soldier");
this.power = new MageInt(4);
this.toughness = new MageInt(44);
// Flash
this.addAbility(FlashAbility.getInstance());
// Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.
this.addAbility(new HixusPrisonWardenTriggeredAbility(new HixusPrisonWardenExileEffect()));
}
public HixusPrisonWarden(final HixusPrisonWarden card) {
super(card);
}
@Override
public HixusPrisonWarden copy() {
return new HixusPrisonWarden(this);
}
}
class HixusPrisonWardenTriggeredAbility extends TriggeredAbilityImpl {
public HixusPrisonWardenTriggeredAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect);
this.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
}
public HixusPrisonWardenTriggeredAbility(final HixusPrisonWardenTriggeredAbility ability) {
super(ability);
}
@Override
public HixusPrisonWardenTriggeredAbility copy() {
return new HixusPrisonWardenTriggeredAbility(this);
}
@Override
public boolean checkInterveningIfClause(Game game) {
MageObject mageObject = getSourceObject(game);
return (mageObject instanceof Permanent) && ((Permanent)mageObject).getTurnsOnBattlefield() ==1;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
Permanent sourcePermanent = game.getPermanent(event.getSourceId());
if (damageEvent.getPlayerId().equals(getControllerId()) &&
damageEvent.isCombatDamage() &&
sourcePermanent != null &&
sourcePermanent.getCardType().contains(CardType.CREATURE)) {
getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever a creature deals combat damage to you, if {this} entered the battlefield this turn, exile that creature until {this} leaves the battlefield.";
}
}
class HixusPrisonWardenExileEffect extends OneShotEffect {
public HixusPrisonWardenExileEffect() {
super(Outcome.Benefit);
this.staticText = "exile that creature until {this} leaves the battlefield";
}
public HixusPrisonWardenExileEffect(final HixusPrisonWardenExileEffect effect) {
super(effect);
}
@Override
public HixusPrisonWardenExileEffect copy() {
return new HixusPrisonWardenExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
// If Prison Warden leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source);
}
return false;
}
}

View file

@ -0,0 +1,82 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author emerald000
*/
public class MantleOfWebs extends CardImpl {
public MantleOfWebs(UUID ownerId) {
super(ownerId, 187, "Mantle of Webs", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
this.expansionSetCode = "ORI";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +1/+3 and has reach.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 3, Duration.WhileOnBattlefield)));
Effect effect = new GainAbilityAttachedEffect(ReachAbility.getInstance(), AttachmentType.AURA);
effect.setText("and has reach");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
public MantleOfWebs(final MantleOfWebs card) {
super(card);
}
@Override
public MantleOfWebs copy() {
return new MantleOfWebs(this);
}
}

View file

@ -0,0 +1,198 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.players.Player;
import mage.target.common.TargetLandPermanent;
/**
*
* @author emerald000
*/
public class NissaSageAnimist extends CardImpl {
public NissaSageAnimist(UUID ownerId) {
super(ownerId, 189, "Nissa, Sage Animist", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
this.expansionSetCode = "ORI";
this.subtype.add("Nissa");
this.color.setGreen(true);
this.nightCard = true;
this.canTransform = true;
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
// +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.
this.addAbility(new LoyaltyAbility(new NissaSageAnimistPlusOneEffect(), 1));
// -2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new NissaSageAnimistToken()), -2));
// -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.
Ability ability = new LoyaltyAbility(new UntapTargetEffect(), -7);
ability.addTarget(new TargetLandPermanent(0, 6, new FilterLandPermanent("lands"), false));
ability.addEffect(new NissaSageAnimistMinusSevenEffect());
this.addAbility(ability);
}
public NissaSageAnimist(final NissaSageAnimist card) {
super(card);
}
@Override
public NissaSageAnimist copy() {
return new NissaSageAnimist(this);
}
}
class NissaSageAnimistPlusOneEffect extends OneShotEffect {
NissaSageAnimistPlusOneEffect() {
super(Outcome.Benefit);
this.staticText = "Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.";
}
NissaSageAnimistPlusOneEffect(final NissaSageAnimistPlusOneEffect effect) {
super(effect);
}
@Override
public NissaSageAnimistPlusOneEffect copy() {
return new NissaSageAnimistPlusOneEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
if (card == null) {
return false;
}
CardsImpl cards = new CardsImpl();
cards.add(card);
controller.revealCards("Nissa, Sage Animist", cards, game);
if (card.getCardType().contains(CardType.LAND)) {
return controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
} else {
return controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game);
}
}
return true;
}
}
class NissaSageAnimistToken extends Token {
NissaSageAnimistToken() {
super("Ashaya, the Awoken World", "legendary 4/4 green Elemental creature token named Ashaya, the Awoken World");
this.setOriginalExpansionSetCode("ORI");
this.getSupertype().add("Legendary");
this.getPower().initValue(4);
this.getToughness().initValue(4);
this.color.setGreen(true);
this.getSubtype().add("Elemental");
this.getCardType().add(CardType.CREATURE);
}
}
class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl {
NissaSageAnimistMinusSevenEffect() {
super(Duration.EndOfGame, Outcome.BecomeCreature);
this.staticText = "They become 6/6 Elemental creatures. They're still lands";
}
NissaSageAnimistMinusSevenEffect(final NissaSageAnimistMinusSevenEffect effect) {
super(effect);
}
@Override
public NissaSageAnimistMinusSevenEffect copy() {
return new NissaSageAnimistMinusSevenEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
for (UUID permanentId : this.getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
switch (layer) {
case TypeChangingEffects_4:
if (!permanent.getCardType().contains(CardType.CREATURE)) {
permanent.getCardType().add(CardType.CREATURE);
}
if (!permanent.getSubtype().contains("Elemental")) {
permanent.getSubtype().add("Elemental");
}
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getToughness().setValue(6);
permanent.getPower().setValue(6);
}
}
}
}
return true;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7;
}
}

View file

@ -0,0 +1,130 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.abilities.keyword.TransformAbility;
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.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author emerald000
*/
public class NissaVastwoodSeer extends CardImpl {
private static final FilterCard filter = new FilterCard("basic Forest card");
static {
filter.add(new SupertypePredicate("Basic"));
filter.add(new SubtypePredicate("Forest"));
}
public NissaVastwoodSeer(UUID ownerId) {
super(ownerId, 189, "Nissa, Vastwood Seer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Elf");
this.subtype.add("Scout");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.canTransform = true;
this.secondSideCard = new NissaSageAnimist(ownerId);
// When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true, true), true));
// Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
this.addAbility(new TransformAbility());
this.addAbility(new ConditionalTriggeredAbility(
new EntersBattlefieldControlledTriggeredAbility(new NissaVastwoodSeerTransformEffect(), new FilterLandPermanent()),
new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true),
"Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control."));
}
public NissaVastwoodSeer(final NissaVastwoodSeer card) {
super(card);
}
@Override
public NissaVastwoodSeer copy() {
return new NissaVastwoodSeer(this);
}
}
class NissaVastwoodSeerTransformEffect extends OneShotEffect {
NissaVastwoodSeerTransformEffect() {
super(Outcome.Benefit);
this.staticText = "exile {this}, then return her to the battlefield transformed under her owner's control";
}
NissaVastwoodSeerTransformEffect(final NissaVastwoodSeerTransformEffect effect) {
super(effect);
}
@Override
public NissaVastwoodSeerTransformEffect copy() {
return new NissaVastwoodSeerTransformEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
Player controller = game.getPlayer(source.getControllerId());
if (sourceObject != null && controller != null) {
Card card = (Card) sourceObject;
if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
}
}
return true;
}
}

View file

@ -0,0 +1,98 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FirstTargetPointer;
/**
*
* @author LevelX2
*/
public class SentinelOfTheEternalWatch extends CardImpl {
public SentinelOfTheEternalWatch(UUID ownerId) {
super(ownerId, 30, "Sentinel of the Eternal Watch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}");
this.expansionSetCode = "ORI";
this.subtype.add("Giant");
this.subtype.add("Soldier");
this.power = new MageInt(4);
this.toughness = new MageInt(6);
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// At the beginning of combat on each opponent's turn, tap target creature that player controls.
this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect("target creature that player controls"), TargetController.OPPONENT, false, true));
}
public SentinelOfTheEternalWatch(final SentinelOfTheEternalWatch card) {
super(card);
}
@Override
public SentinelOfTheEternalWatch copy() {
return new SentinelOfTheEternalWatch(this);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof BeginningOfCombatTriggeredAbility) {
for (Effect effect: ability.getEffects()) {
UUID opponentId = effect.getTargetPointer().getFirst(game, ability);
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
effect.setTargetPointer(new FirstTargetPointer());
FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature from the active opponent");
filter.add(new ControllerIdPredicate(opponentId));
Target target = new TargetCreaturePermanent(filter);
ability.addTarget(target);
}
}
}
}
}

View file

@ -0,0 +1,67 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author emerald000
*/
public class VeteransSidearm extends CardImpl {
public VeteransSidearm(UUID ownerId) {
super(ownerId, 242, "Veteran's Sidearm", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "ORI";
this.subtype.add("Equipment");
// Equipped creature gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
}
public VeteransSidearm(final VeteransSidearm card) {
super(card);
}
@Override
public VeteransSidearm copy() {
return new VeteransSidearm(this);
}
}

View file

@ -28,7 +28,6 @@
package mage.sets.mirrodinbesieged; package mage.sets.mirrodinbesieged;
import java.util.UUID; import java.util.UUID;
import mage.Mana;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
@ -46,7 +45,6 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.mana.ColorlessManaAbility; import mage.abilities.mana.ColorlessManaAbility;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.game.Game; import mage.game.Game;

View file

@ -87,7 +87,7 @@ class ApostlesBlessingEffect extends OneShotEffect {
public ApostlesBlessingEffect() { public ApostlesBlessingEffect() {
super(Outcome.AddAbility); super(Outcome.AddAbility);
this.staticText = "Target artifact or creature gains protection from artifacts or from the color of your choice until end of turn"; this.staticText = "Target artifact or creature you control gains protection from artifacts or from the color of your choice until end of turn";
} }
public ApostlesBlessingEffect(final ApostlesBlessingEffect effect) { public ApostlesBlessingEffect(final ApostlesBlessingEffect effect) {

View file

@ -32,6 +32,7 @@ import java.util.UUID;
import mage.constants.*; import mage.constants.*;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility; import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@ -54,7 +55,6 @@ public class SnakeUmbra extends CardImpl {
this.expansionSetCode = "ROE"; this.expansionSetCode = "ROE";
this.subtype.add("Aura"); this.subtype.add("Aura");
// Enchant creature // Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
@ -63,11 +63,14 @@ public class SnakeUmbra extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// Enchanted creature gets +1/+1 // Enchanted creature gets +1/+1
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
// and has "Whenever this creature deals damage to an opponent, you may draw a card." // and has "Whenever this creature deals damage to an opponent, you may draw a card."
Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true); Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA))); Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
effect.setText("and has \"Whenever this creature deals damage to an opponent, you may draw a card.\"");
ability.addEffect(effect);
this.addAbility(ability);
// Totem armor // Totem armor
this.addAbility(new TotemArmorAbility()); this.addAbility(new TotemArmorAbility());

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.tenthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class DreambornMuse extends mage.sets.legions.DreambornMuse {
public DreambornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 82;
this.expansionSetCode = "10E";
}
public DreambornMuse(final DreambornMuse card) {
super(card);
}
@Override
public DreambornMuse copy() {
return new DreambornMuse(this);
}
}

View file

@ -131,7 +131,14 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl {
if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) { if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) {
game.getState().addOtherAbility(card, FlashAbility.getInstance()); game.getState().addOtherAbility(card, FlashAbility.getInstance());
} }
} }
// commander in command zone
if (controller.getCommanderId() != null && game.getState().getZone(controller.getCommanderId()).equals(Zone.COMMAND)) {
Card card = game.getCard(controller.getCommanderId());
if (card.getCardType().contains(CardType.CREATURE)) {
game.getState().addOtherAbility(card, FlashAbility.getInstance());
}
}
return true; return true;
} }
return false; return false;

View file

@ -96,24 +96,18 @@ class SearingBlazeEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId()); LandfallWatcher watcher = (LandfallWatcher) game.getState().getWatchers().get("LandPlayed");
Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget()); Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (watcher != null && watcher.conditionMet()) { int damage = 1;
if (player != null) { if (watcher != null && watcher.landPlayed(source.getControllerId())) {
player.damage(3, source.getSourceId(), game, false, true); damage = 3;
}
if (creature != null) {
creature.damage(3, source.getSourceId(), game, false, true);
}
} }
else { if (player != null) {
if (player != null) { player.damage(damage, source.getSourceId(), game, false, true);
player.damage(1, source.getSourceId(), game, false, true); }
} if (creature != null) {
if (creature != null) { creature.damage(damage, source.getSourceId(), game, false, true);
creature.damage(1, source.getSourceId(), game, false, true);
}
} }
return true; return true;
} }
@ -143,7 +137,7 @@ class SearingBlazeTarget extends TargetPermanent {
@Override @Override
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
Set<UUID> availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); Set<UUID> availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
Set<UUID> possibleTargets = new HashSet<UUID>(); Set<UUID> possibleTargets = new HashSet<>();
MageObject object = game.getObject(sourceId); MageObject object = game.getObject(sourceId);
if (object instanceof StackObject) { if (object instanceof StackObject) {
UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget(); UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget();

View file

@ -38,14 +38,10 @@ import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.target.TargetSpell;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
/** /**
@ -91,9 +87,14 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl {
return new PyromancerAscensionQuestTriggeredAbility(this); return new PyromancerAscensionQuestTriggeredAbility(this);
} }
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId()); Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) { if (isControlledInstantOrSorcery(spell)) {
Card sourceCard = game.getCard(spell.getSourceId()); Card sourceCard = game.getCard(spell.getSourceId());
@ -138,10 +139,15 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl {
public PyromancerAscensionCopyTriggeredAbility copy() { public PyromancerAscensionCopyTriggeredAbility copy() {
return new PyromancerAscensionCopyTriggeredAbility(this); return new PyromancerAscensionCopyTriggeredAbility(this);
} }
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId()); Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) { if (isControlledInstantOrSorcery(spell)) {
Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId()); Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId());

View file

@ -0,0 +1,70 @@
NAME:Geoff's Daxos of Meletis
1 [THS:58] Ordeal of Thassa
1 [5ED:388] Mana Vault
1 [THS:14] Gift of Immortality
1 [PC2:12] Spirit Mantle
1 [M13:36] Sublime Archangel
1 [M13:206] Gilded Lotus
1 [M11:5] Armored Ascension
1 [ALA:27] Sigiled Paladin
1 [ALA:26] Sighted-Caste Sorcerer
1 [CON:2] Asha's Favor
1 [M14:210] Fireshrieker
1 [GTC:17] Holy Mantle
1 [CHK:65] Hinder
1 [DGM:96] Render Silent
1 [M13:74] Tricks of the Trade
1 [ISD:229] Mask of Avacyn
1 [GPT:28] Infiltrator's Magemark
14 [THS:234] Island
1 [CMD:261] Sol Ring
1 [THS:25] Ordeal of Heliod
1 [5DN:131] Helm of Kaldra
1 [M12:24] Lifelink
1 [AVR:50] Elgaud Shieldmate
19 [THS:230] Plains
1 [M14:23] Indestructibility
1 [M14:5] Archangel of Thune
1 [CMD:265] Azorius Chancery
1 [ARB:3] Ethercaste Knight
1 [ARB:1] Ardent Plea
1 [M13:18] Guardians of Akrasa
1 [CMD:40] Brainstorm
1 [UDS:139] Thran Dynamo
1 [M12:219] Swiftfoot Boots
1 [THS:39] Aqueous Form
1 [M13:6] Aven Squire
1 [MMA:25] Path to Exile
1 [M13:4] Angelic Benediction
1 [CMD:253] Lightning Greaves
1 [SHM:150] Steel of the Godhead
1 [M13:225] Glacial Fortress
1 [10E:40] Serra's Embrace
1 [JUD:31] Unquestioned Authority
1 [M13:221] Cathedral of War
1 [RTR:9] Ethereal Armor
1 [DDL:27] Battle Mastery
1 [DDL:24] Bonds of Faith
1 [ISD:53] Dissipate
1 [DKA:148] Executioner's Hood
1 [DIS:159] Azorius Signet
1 [GTC:37] Hands of Binding
1 [PC2:112] Quietus Spike
1 [MRD:144] Banshee's Blade
1 [AVR:36] Silverblade Paladin
1 [PC2:115] Whispersilk Cloak
1 [M12:73] Ponder
1 [M13:29] Rhox Faithmender
1 [ALA:1] Akrasan Squire
1 [M13:213] Ring of Thune
1 [UDS:46] Sigil of Sleep
1 [M13:211] Ring of Evos Isle
1 [RTR:241] Hallowed Fountain
1 [7ED:67] Counterspell
1 [ISD:49] Curiosity
1 [SOM:229] Seachrome Coast
1 [PC2:10] Mammoth Umbra
1 [MBS:104] Darksteel Plate
1 [M13:21] Knight of Glory
1 [M13:22] Oblivion Ring
SB: 1 [THS:191] Daxos of Meletis

View file

@ -27,7 +27,6 @@
*/ */
package org.mage.test.cards.abilities.activated; package org.mage.test.cards.abilities.activated;
import mage.abilities.keyword.BloodthirstAbility;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
import org.junit.Test; import org.junit.Test;
@ -74,5 +73,46 @@ public class ReturnToHandTest extends CardTestPlayerBase {
} }
/**
* Return from graveyard to hand if you play a swamp
*/
@Test
public void VeilbornGhoulTest1() {
// Veilborn Ghoul can't block.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
addCard(Zone.HAND, playerA, "Swamp");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Swamp", 1);
assertHandCount(playerA, "Veilborn Ghoul", 1);
}
/**
* Return from graveyard to hand if you play a non swamp land but Urborg, Tomb of Yawgmoth is in play
*/
@Test
public void VeilbornGhoulTest2() {
// Veilborn Ghoul can't block.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
addCard(Zone.HAND, playerA, "Flood Plain");
// Each land is a Swamp in addition to its other land types.
addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Flood Plain", 1);
assertHandCount(playerA, "Veilborn Ghoul", 1);
}
} }

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package org.mage.test.cards.abilities.keywords; package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
@ -37,16 +36,14 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
* *
* @author LevelX2 * @author LevelX2
*/ */
public class DiscardTest extends CardTestPlayerBase { public class DiscardTest extends CardTestPlayerBase {
/* /*
* If Rest in Peace is in play, every card going to the graveyard goes to exile instead. * If Rest in Peace is in play, every card going to the graveyard goes to exile instead.
* If a card is discarded while Rest in Peace is on the battlefield, abilities that function * If a card is discarded while Rest in Peace is on the battlefield, abilities that function
* when a card is discarded (such as madness) still work, even though that card never reaches * when a card is discarded (such as madness) still work, even though that card never reaches
* a graveyard. * a graveyard.
*/ */
@Test @Test
public void testRestInPeaceAndCycle() { public void testRestInPeaceAndCycle() {
@ -67,4 +64,26 @@ public class DiscardTest extends CardTestPlayerBase {
assertHandCount(playerA, 1); // the card drawn by Cycling assertHandCount(playerA, 1); // the card drawn by Cycling
} }
} /**
* With Bazaar of Baghdad, if you use it when you have no cards in hand, you
* draw 2, it asks for you to discard 3, but you can't. So the game can't
* progress and you lose on time.
*/
@Test
public void testBazaarOfBaghdad() {
// {T}: Draw two cards, then discard three cards.
addCard(Zone.BATTLEFIELD, playerA, "Bazaar of Baghdad", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw two cards, then discard three cards");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertHandCount(playerA, 0);
assertGraveyardCount(playerA, 2);
}
}

View file

@ -111,5 +111,93 @@ public class LandfallTest extends CardTestPlayerBase {
assertLife(playerB, 20); assertLife(playerB, 20);
} }
/**
* Searing Blaze's landfall doesn't appear to be working. My opponent played
* a mountain, then played searing blaze targeting my Tasigur, the Golden
* Fang. It only dealt 1 damage to me, where it should've dealt 3, because
* my opponent had played a land.
*/
@Test
public void testSearingBlaze() {
// Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.
// Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.
addCard(Zone.HAND, playerA, "Searing Blaze",1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain",1);
addCard(Zone.HAND, playerA, "Mountain");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Searing Blaze");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Mountain", 2);
assertGraveyardCount(playerA, "Searing Blaze" , 1);
assertLife(playerA, 20);
assertLife(playerB, 17);
assertGraveyardCount(playerB, "Silvercoat Lion" , 1);
}
@Test
public void testGroundswellWithoutLandfall() {
// Target creature gets +2/+2 until end of turn.
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
addCard(Zone.HAND, playerB, "Groundswell",1);
addCard(Zone.BATTLEFIELD, playerB, "Forest",1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
attack(2, playerB, "Silvercoat Lion");
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerB, "Forest", 1);
assertGraveyardCount(playerB, "Groundswell" , 1);
assertPermanentCount(playerB, "Silvercoat Lion" , 1);
assertPowerToughness(playerB, "Silvercoat Lion", 4, 4);
assertLife(playerA, 16); // 2 + 4
assertLife(playerB, 20);
}
@Test
public void testGroundswellWithLandfall() {
// Target creature gets +2/+2 until end of turn.
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
addCard(Zone.HAND, playerB, "Groundswell",1);
addCard(Zone.HAND, playerB, "Forest");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest");
attack(2, playerB, "Silvercoat Lion");
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerB, "Forest", 1);
assertGraveyardCount(playerB, "Groundswell" , 1);
assertPermanentCount(playerB, "Silvercoat Lion" , 1);
assertPowerToughness(playerB, "Silvercoat Lion", 6, 6);
assertLife(playerA, 14); // 2 + 4
assertLife(playerB, 20);
}
} }

View file

@ -0,0 +1,144 @@
/*
* 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 org.mage.test.cards.abilities.keywords;
import mage.abilities.keyword.HasteAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class SpliceOnArcaneTest extends CardTestPlayerBase {
/**
* Test that it works to cast Through the Breach
* by slicing it on an arcane spell
*
*/
@Test
public void testSpliceThroughTheBreach() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
// Sorcery - Arcane {R}
// Lava Spike deals 3 damage to target player.
addCard(Zone.HAND, playerA, "Lava Spike",1);
// You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step.
// Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.)
addCard(Zone.HAND, playerA, "Through the Breach",1);
addCard(Zone.HAND, playerA, "Silvercoat Lion",1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB);
setChoice(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 17);
assertGraveyardCount(playerA, "Lava Spike", 1);
assertHandCount(playerA, "Through the Breach", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
Assert.assertEquals("All available mana has to be used", 0, playerA.getManaAvailable(currentGame).size());
}
@Test
public void testSpliceTorrentOfStone() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
// Sorcery - Arcane {R}
// Lava Spike deals 3 damage to target player.
addCard(Zone.HAND, playerA, "Lava Spike",1);
// Torrent of Stone deals 4 damage to target creature.
// Splice onto Arcane-Sacrifice two Mountains. (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.)
addCard(Zone.HAND, playerA, "Torrent of Stone",1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB);
addTarget(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 17);
assertGraveyardCount(playerA, "Lava Spike", 1);
assertHandCount(playerA, "Torrent of Stone", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Mountain", 0);
Assert.assertEquals("No more mana available", "[]", playerA.getManaAvailable(currentGame).toString());
}
/**
* Nourishing Shoal's interaction with Splicing Through the Breach is
* bugged. You should still need to pay 2RR as an additional cost, which is
* not affected by the alternate casting method of Shoal, but you are able
* to Splice it for free. This is a very relevant bug right now due to the
* appearance of the deck over the weekend, and it makes the deck absurdly
* powerful.
*/
@Test
public void testSpliceThroughTheBreach2() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost.
// You gain X life.
addCard(Zone.HAND, playerA, "Nourishing Shoal",1);
addCard(Zone.HAND, playerA, "Giant Growth",1);
// You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step.
// Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.)
addCard(Zone.HAND, playerA, "Through the Breach",1);
addCard(Zone.HAND, playerA, "Silvercoat Lion",1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nourishing Shoal");
setChoice(playerA, "Yes");
setChoice(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 21);
assertLife(playerB, 20);
assertGraveyardCount(playerA, "Nourishing Shoal", 1);
assertHandCount(playerA, "Through the Breach", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
Assert.assertEquals("All available mana has to be used","[]", playerA.getManaAvailable(currentGame).toString());
}
}

View file

@ -30,6 +30,7 @@ package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test; import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
@ -163,5 +164,39 @@ public class StormTest extends CardTestPlayerBase {
assertLife(playerB, 16); // 3 (Lightning Bolt) + 1 from Storm copied Grapeshot assertLife(playerB, 16); // 3 (Lightning Bolt) + 1 from Storm copied Grapeshot
} }
/**
* I provide a game log fo the issue with storm mentioned earlier. I guess Pyromancer Ascension is a culprit.
*
*
*/
@Test
public void testStormAndPyromancerAscension() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
// Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on Pyromancer Ascension.
// Whenever you cast an instant or sorcery spell while Pyromancer Ascension has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy.
addCard(Zone.BATTLEFIELD, playerA, "Pyromancer Ascension", 1);
// Grapeshot deals 1 damage to target creature or player. - Sorcery {1}{R}
// Storm (When you cast this spell, copy it for each spell cast before it this turn. You may choose new targets for the copies.)
addCard(Zone.LIBRARY, playerA, "Grapeshot", 2);
skipInitShuffling();
// Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
addCard(Zone.HAND, playerA, "Sleight of Hand");
addCard(Zone.HAND, playerA, "Shock", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sleight of Hand");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", playerB);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", "targetPlayer=PlayerB", "Shock", StackClause.WHILE_NOT_ON_STACK);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", "targetPlayer=PlayerB", "Shock", StackClause.WHILE_NOT_ON_STACK);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grapeshot", playerB);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Shock", 3);
assertGraveyardCount(playerA, "Grapeshot", 1);
assertCounterCount("Pyromancer Ascension", CounterType.QUEST, 2);
assertLife(playerB, 8); // 6 from the Shocks + 5 from Grapeshot + 1 from Pyromancer Ascencsion copy
}
} }

View file

@ -0,0 +1,68 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class TransformTest extends CardTestPlayerBase{
@Test
public void NissaVastwoodSeerTest() {
addCard(Zone.LIBRARY, playerA, "Forest");
addCard(Zone.BATTLEFIELD, playerA, "Forest", 6);
// When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.
// Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
addCard(Zone.HAND, playerA, "Nissa, Vastwood Seer");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Forest", 7);
assertPermanentCount(playerA, "Nissa, Vastwood Seer", 0);
assertPermanentCount(playerA, "Nissa, Sage Animist", 1);
assertCounterCount("Nissa, Sage Animist", CounterType.LOYALTY, 3);
}
}

View file

@ -18,6 +18,12 @@ public class TwoFacedCardEffectsTest extends CardTestPlayerBase {
*/ */
@Test @Test
public void testEffectTurnedOffOnTransform() { public void testEffectTurnedOffOnTransform() {
// Other Human creatures you control get +1/+1.
// At the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck.
// Howlpack Alpha (transformed side) ----------------
// Each other creature you control that's a Werewolf or a Wolf gets +1/+1.
// At the beginning of your end step, put a 2/2 green Wolf creature token onto the battlefield.
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack Alpha.
addCard(Zone.BATTLEFIELD, playerA, "Mayor of Avabruck"); addCard(Zone.BATTLEFIELD, playerA, "Mayor of Avabruck");
addCard(Zone.BATTLEFIELD, playerA, "Wolfir Avenger"); addCard(Zone.BATTLEFIELD, playerA, "Wolfir Avenger");
addCard(Zone.BATTLEFIELD, playerA, "Elite Inquisitor"); addCard(Zone.BATTLEFIELD, playerA, "Elite Inquisitor");

View file

@ -7,6 +7,7 @@ package org.mage.test.cards.triggers;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
@ -116,4 +117,73 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase {
} }
/**
* v9: Worldgorger Dragon + Animate Dead is still acting up (yey complex rules interactions!).
* The first time you return Animate Dead from Worldgorger's exile, it works like it's supposed
* to. You have to pick a creature, and it brings it back. But if you pick Worldgorger Dragon
* again, it allows you to not pick a creature, and regardless of whether you choose to skip or pick
* a different creature, it always returns the first creature you picked. Kind of hard to explain,
* but here's how to reproduce:
*
* 1) Cast Animate Dead, targeting Worldgorger Dragon
* 2) Worldgorger Dragon will exile Animate Dead, killing the dragon and returning the permanents
* 3) Select Worldgorger again
* 4) Step 2 repeats
* 5) Attempt to select a different creature. Worldgorger Dragon is returned instead.
*
*/
@Test
@Ignore
public void testWithAnimateDeadDifferentTargets() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
// When Worldgorger Dragon enters the battlefield, exile all other permanents you control.
// When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control.
addCard(Zone.GRAVEYARD, playerA, "Worldgorger Dragon", 1);
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1);
// When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard"
// and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield
// under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.
addCard(Zone.HAND, playerA, "Animate Dead");
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
// Instant {X}{R}{R}
// Volcanic Geyser deals X damage to target creature or player.
addCard(Zone.HAND, playerA, "Volcanic Geyser", 1);
// When Staunch Defenders enters the battlefield, you gain 4 life.
addCard(Zone.BATTLEFIELD, playerA, "Staunch Defenders", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Worldgorger Dragon");
addTarget(playerA, "Worldgorger Dragon");
addTarget(playerA, "Worldgorger Dragon");
addTarget(playerA, "Silvercoat Lion");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB, 9);
setChoice(playerA, "X=7");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Worldgorger Dragon", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertLife(playerA, 24);
assertLife(playerB, 11);
assertGraveyardCount(playerA, "Volcanic Geyser", 1);
}
} }

View file

@ -38,7 +38,7 @@ import org.mage.test.serverside.base.CardTestCommanderDuelBase;
*/ */
public class CastCommanderTest extends CardTestCommanderDuelBase { public class CastCommanderTest extends CardTestCommanderDuelBase {
@Test @Test
public void testFirstAbility() { public void testCastCommander() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath");
@ -50,5 +50,5 @@ public class CastCommanderTest extends CardTestCommanderDuelBase {
assertLife(playerB, 40); assertLife(playerB, 40);
assertPermanentCount(playerA, "Ob Nixilis of the Black Oath", 1); assertPermanentCount(playerA, "Ob Nixilis of the Black Oath", 1);
} }
} }

View file

@ -0,0 +1,98 @@
/*
* 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 org.mage.test.commander.duel;
import java.io.FileNotFoundException;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.GameException;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestCommanderDuelBase;
/**
*
* @author LevelX2
*/
public class TeferiMageOfZhalfirTest extends CardTestCommanderDuelBase {
@Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
setDecknamePlayerA("CommanderDuel_UW.dck"); // Commander = Daxos of Meletis
return super.createNewGameAndPlayers();
}
@Test
public void castCommanderWithFlash() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
addCard(Zone.BATTLEFIELD, playerA, "Teferi, Mage of Zhalfir");
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Daxos of Meletis");
setStopAt(1, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerA, "Daxos of Meletis", 1);
}
@Test
public void testCommanderDamage() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
// Enchant creature
// Enchanted creature gets +4/+4, has flying and first strike, and is an Angel in addition to its other types.
// When enchanted creature dies, return Angelic Destiny to its owner's hand.
addCard(Zone.HAND, playerA, "Angelic Destiny");
addCard(Zone.BATTLEFIELD, playerA, "Teferi, Mage of Zhalfir");
// Daxos of Meletis can't be blocked by creatures with power 3 or greater.
// Whenever Daxos of Meletis deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angelic Destiny","Daxos of Meletis");
attack(3, playerA, "Daxos of Meletis");
attack(5, playerA, "Daxos of Meletis");
attack(7, playerA, "Daxos of Meletis");
attack(9, playerA, "Daxos of Meletis");
setStopAt(9, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Daxos of Meletis", 1);
assertPowerToughness(playerA, "Daxos of Meletis", 6, 6);
Assert.assertEquals("Player A has won because of commander damage", true, playerA.hasWon());
Assert.assertEquals("Player A has lost because of commander damage", true, playerB.hasLost());
}
}

View file

@ -42,12 +42,18 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl;
public abstract class CardTestCommanderDuelBase extends CardTestPlayerAPIImpl { public abstract class CardTestCommanderDuelBase extends CardTestPlayerAPIImpl {
public CardTestCommanderDuelBase() {
super();
this.deckNameA = "CommanderDuel.dck";
this.deckNameB = "CommanderDuel.dck";
}
@Override @Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
Game game = new CommanderDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 40); Game game = new CommanderDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 40);
playerA = createPlayer(game, playerA, "PlayerA","CommanderDuel.dck"); playerA = createPlayer(game, playerA, "PlayerA",deckNameA);
playerB = createPlayer(game, playerB, "PlayerB","CommanderDuel.dck"); playerB = createPlayer(game, playerB, "PlayerB",deckNameB);
return game; return game;
} }

View file

@ -15,12 +15,17 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl;
*/ */
public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl {
public CardTestPlayerBase() {
deckNameA = "RB Aggro.dck";
deckNameB = "RB Aggro.dck";
}
@Override @Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
Game game = new TwoPlayerDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 20); Game game = new TwoPlayerDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 20);
playerA = createPlayer(game, playerA, "PlayerA"); playerA = createPlayer(game, playerA, "PlayerA", deckNameA);
playerB = createPlayer(game, playerB, "PlayerB"); playerB = createPlayer(game, playerB, "PlayerB", deckNameB);
return game; return game;
} }

View file

@ -44,6 +44,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
protected GameOptions gameOptions; protected GameOptions gameOptions;
protected String deckNameA;
protected String deckNameB;
protected enum ExpectedType { protected enum ExpectedType {
TURN_NUMBER, TURN_NUMBER,
RESULT, RESULT,
@ -1009,6 +1012,14 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
player.addTarget("targetPlayer="+targetPlayer.getName()); player.addTarget("targetPlayer="+targetPlayer.getName());
} }
public void setDecknamePlayerA(String deckname) {
deckNameA = deckname;
}
public void setDecknamePlayerB(String deckname) {
deckNameB = deckname;
}
protected void skipInitShuffling() { protected void skipInitShuffling() {
gameOptions.skipInitShuffling = true; gameOptions.skipInitShuffling = true;
} }

View file

@ -329,7 +329,7 @@ public abstract class AbilityImpl implements Ability {
// and/or zones become the target of a spell trigger at this point; they'll wait to be put on // and/or zones become the target of a spell trigger at this point; they'll wait to be put on
// the stack until the spell has finished being cast.) // the stack until the spell has finished being cast.)
if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already TriggeredAbilities.checkTriggers() if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already in playerImpl.triggerAbility
sourceObject.adjustTargets(this, game); sourceObject.adjustTargets(this, game);
} }
if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) { if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) {

View file

@ -28,31 +28,29 @@
package mage.abilities.condition.common; package mage.abilities.condition.common;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.constants.TargetController;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
/** /**
* * Checks if one opponent (each opponent is checked on its own) fulfills
* the defined condition of controlling the defined number of permanents.
*
* @author LevelX2 * @author LevelX2
*/ */
public class OpponentControlsPermanentCondition implements Condition { public class OpponentControlsPermanentCondition implements Condition {
public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO }; public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO };
private FilterPermanent filter; private FilterPermanent filter;
private Condition condition;
private CountType type; private CountType type;
private int count; private int count;
/** /**
* Applies a filter and delegates creation to
* {@link #ControlsPermanent(mage.filter.FilterPermanent, mage.abilities.condition.common.ControlsPermanent.CountType, int)}
* with {@link CountType#MORE_THAN}, and 0.
*
* @param filter * @param filter
*/ */
public OpponentControlsPermanentCondition(FilterPermanent filter) { public OpponentControlsPermanentCondition(FilterPermanent filter) {
@ -74,46 +72,33 @@ public class OpponentControlsPermanentCondition implements Condition {
this.count = count; this.count = count;
} }
/**
* Applies a filter, a {@link CountType}, and count to permanents on the
* battlefield and calls the decorated condition to see if it
* {@link #apply(mage.game.Game, mage.abilities.Ability) applies}
* as well. This will force both conditions to apply for this to be true.
*
* @param filter
* @param type
* @param count
* @param conditionToDecorate
*/
public OpponentControlsPermanentCondition ( FilterPermanent filter, CountType type, int count, Condition conditionToDecorate ) {
this(filter, type, count);
this.condition = conditionToDecorate;
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
boolean conditionApplies = false; boolean conditionApplies = false;
for(UUID opponentId :game.getOpponents(source.getControllerId())) {
FilterPermanent localFilter = filter.copy(); FilterPermanent localFilter = filter.copy();
localFilter.add(new ControllerPredicate(TargetController.OPPONENT)); localFilter.add(new ControllerIdPredicate(opponentId));
switch ( this.type ) {
switch ( this.type ) { case FEWER_THAN:
case FEWER_THAN: if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count) {
conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count; conditionApplies = true;
break; break;
case MORE_THAN: }
conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) > this.count; case MORE_THAN:
break; if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) > this.count) {
case EQUAL_TO: conditionApplies = true;
conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) == this.count; break;
break; }
break;
case EQUAL_TO:
if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) == this.count) {
conditionApplies = true;
break;
}
break;
}
} }
//If a decorated condition exists, check it as well and apply them together.
if ( this.condition != null ) {
conditionApplies = conditionApplies && this.condition.apply(game, source);
}
return conditionApplies; return conditionApplies;
} }

View file

@ -0,0 +1,34 @@
package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author cbrianhill
*/
public class CardsInTargetPlayerHandCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility));
if (player != null) {
return player.getHand().size();
}
return 0;
}
@Override
public DynamicValue copy() {
return new CardsInTargetPlayerHandCount();
}
@Override
public String getMessage() {
return "cards in target player's hand";
}
}

View file

@ -135,16 +135,22 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
case AbilityAddingRemovingEffects_6: case AbilityAddingRemovingEffects_6:
land.removeAllAbilities(source.getSourceId(), game); land.removeAllAbilities(source.getSourceId(), game);
for (String landType : landTypes) { for (String landType : landTypes) {
if (landType.equals("Swamp")) { switch (landType) {
land.addAbility(new BlackManaAbility(), source.getSourceId(), game); case "Swamp":
} else if (landType.equals("Mountain")) { land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
land.addAbility(new RedManaAbility(), source.getSourceId(), game); break;
} else if (landType.equals("Forest")) { case "Mountain":
land.addAbility(new GreenManaAbility(), source.getSourceId(), game); land.addAbility(new RedManaAbility(), source.getSourceId(), game);
} else if (landType.equals("Island")) { break;
land.addAbility(new BlueManaAbility(), source.getSourceId(), game); case "Forest":
} else if (landType.equals("Plains")) { land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); break;
case "Island":
land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
break;
case "Plains":
land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
break;
} }
} }
break; break;

View file

@ -87,7 +87,7 @@ public class ProliferateEffect extends OneShotEffect {
choices.add(counter.getName()); choices.add(counter.getName());
} }
choice.setChoices(choices); choice.setChoices(choices);
choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")"); choice.setMessage("Choose a counter to proliferate (" + permanent.getIdName() + ")");
controller.choose(Outcome.Benefit, choice, game); controller.choose(Outcome.Benefit, choice, game);
for (Counter counter : permanent.getCounters().values()) { for (Counter counter : permanent.getCounters().values()) {
if (counter.getName().equals(choice.getChoice())) { if (counter.getName().equals(choice.getChoice())) {

View file

@ -0,0 +1,119 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common.search;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.SearchEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author LevelX2
*/
public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect {
protected boolean tapped;
protected boolean forceShuffle;
public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target) {
this(target, false, true, Outcome.PutCardInPlay);
}
public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped) {
this(target, tapped, true, Outcome.PutCardInPlay);
}
public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) {
this(target, tapped, forceShuffle, Outcome.PutCardInPlay);
}
public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, Outcome outcome) {
this(target, tapped, true, outcome);
}
public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) {
super(target, outcome);
this.tapped = tapped;
this.forceShuffle = forceShuffle;
setText();
}
public SearchLibraryPutInPlayTargetPlayerEffect(final SearchLibraryPutInPlayTargetPlayerEffect effect) {
super(effect);
this.tapped = effect.tapped;
this.forceShuffle = effect.forceShuffle;
}
@Override
public SearchLibraryPutInPlayTargetPlayerEffect copy() {
return new SearchLibraryPutInPlayTargetPlayerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
for (UUID cardId: target.getTargets()) {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped);
}
}
}
player.shuffleLibrary(game);
return true;
}
if (forceShuffle) {
player.shuffleLibrary(game);
}
}
return false;
}
private void setText() {
StringBuilder sb = new StringBuilder();
sb.append("target player searches his or her library for ");
if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) {
if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) {
sb.append("any number of ").append(" ");
}
else {
sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" ");
}
sb.append(target.getTargetName()).append(" and put them onto the battlefield");
}
else {
sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield");
}
if (tapped) {
sb.append(" tapped");
}
if (forceShuffle) {
sb.append(". Then that player shuffles his or her library");
}
else {
sb.append(". If that player does, he or she shuffles his or her library");
}
staticText = sb.toString();
}
public List<UUID> getTargets() {
return target.getTargets();
}
}

View file

@ -38,7 +38,6 @@ import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.SpliceCardEffectImpl; import mage.abilities.effects.SpliceCardEffectImpl;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardsImpl;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SpellAbilityType; import mage.constants.SpellAbilityType;
@ -105,12 +104,12 @@ import mage.players.Player;
public class SpliceOntoArcaneAbility extends SimpleStaticAbility { public class SpliceOntoArcaneAbility extends SimpleStaticAbility {
private static final String KEYWORD_TEXT = "Splice onto Arcane"; private static final String KEYWORD_TEXT = "Splice onto Arcane";
private Costs spliceCosts = new CostsImpl(); private Costs<Cost> spliceCosts = new CostsImpl<>();
private boolean nonManaCosts = false; private boolean nonManaCosts = false;
public SpliceOntoArcaneAbility(String manaString) { public SpliceOntoArcaneAbility(String manaString) {
super(Zone.HAND, new SpliceOntoArcaneEffect()); super(Zone.HAND, new SpliceOntoArcaneEffect());
spliceCosts.add(new ManaCostsImpl(manaString)); spliceCosts.add(new ManaCostsImpl<>(manaString));
} }
public SpliceOntoArcaneAbility(Cost cost) { public SpliceOntoArcaneAbility(Cost cost) {
@ -144,7 +143,6 @@ public class SpliceOntoArcaneAbility extends SimpleStaticAbility {
} }
} }
class SpliceOntoArcaneEffect extends SpliceCardEffectImpl { class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
public SpliceOntoArcaneEffect() { public SpliceOntoArcaneEffect() {
@ -156,8 +154,6 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
super(effect); super(effect);
} }
@Override @Override
public SpliceOntoArcaneEffect copy() { public SpliceOntoArcaneEffect copy() {
return new SpliceOntoArcaneEffect(this); return new SpliceOntoArcaneEffect(this);
@ -175,12 +171,7 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
splicedAbility.setSourceId(abilityToModify.getSourceId()); splicedAbility.setSourceId(abilityToModify.getSourceId());
spell.addSpellAbility(splicedAbility); spell.addSpellAbility(splicedAbility);
for (Iterator it = ((SpliceOntoArcaneAbility) source).getSpliceCosts().iterator(); it.hasNext();) { for (Iterator it = ((SpliceOntoArcaneAbility) source).getSpliceCosts().iterator(); it.hasNext();) {
Cost cost = (Cost) it.next(); spell.getSpellAbility().getCosts().add(((Cost) it.next()).copy());
if (cost instanceof ManaCostsImpl) {
spell.getSpellAbility().getManaCostsToPay().add((ManaCostsImpl) cost.copy());
} else {
spell.getSpellAbility().getCosts().add(cost.copy());
}
} }
} }
return true; return true;

View file

@ -44,6 +44,9 @@ public class TransformAbility extends SimpleStaticAbility {
public static final String NO_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if no spells were cast last turn, transform {this}."; public static final String NO_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if no spells were cast last turn, transform {this}.";
public static final String TWO_OR_MORE_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if a player cast two or more spells last turn, transform {this}."; public static final String TWO_OR_MORE_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if a player cast two or more spells last turn, transform {this}.";
// this state value controlls if a permanent enters the battlefield already transformed
public static final String VALUE_KEY_ENTER_TRANSFORMED = "EnterTransformed";
public TransformAbility() { public TransformAbility() {
super(Zone.BATTLEFIELD, new TransformEffect()); super(Zone.BATTLEFIELD, new TransformEffect());
} }

View file

@ -60,7 +60,7 @@ public enum CardRepository {
// raise this if db structure was changed // raise this if db structure was changed
private static final long CARD_DB_VERSION = 39; private static final long CARD_DB_VERSION = 39;
// raise this if new cards were added to the server // raise this if new cards were added to the server
private static final long CARD_CONTENT_VERSION = 18; private static final long CARD_CONTENT_VERSION = 19;
private final Random random = new Random(); private final Random random = new Random();
private Dao<CardInfo, Object> cardDao; private Dao<CardInfo, Object> cardDao;

View file

@ -29,10 +29,7 @@
package mage.filter.common; package mage.filter.common;
import mage.constants.AsThoughEffectType; import mage.constants.AsThoughEffectType;
import mage.filter.predicate.ObjectPlayer;
import mage.filter.predicate.ObjectPlayerPredicate;
import mage.filter.predicate.Predicate; import mage.filter.predicate.Predicate;
import mage.game.Controllable;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;

View file

@ -21,6 +21,14 @@ public class CardAttribute implements Serializable {
public CardAttribute(Card card) { public CardAttribute(Card card) {
color = card.getColor(null).copy(); color = card.getColor(null).copy();
} }
public CardAttribute(CardAttribute cardAttribute) {
this.color = cardAttribute.color;
}
public CardAttribute copy() {
return new CardAttribute(this);
}
public ObjectColor getColor() { public ObjectColor getColor() {
return color; return color;

View file

@ -171,6 +171,9 @@ public class GameState implements Serializable, Copyable<GameState> {
for (Map.Entry<UUID, CardState> entry: state.cardState.entrySet()) { for (Map.Entry<UUID, CardState> entry: state.cardState.entrySet()) {
cardState.put(entry.getKey(), entry.getValue().copy()); cardState.put(entry.getKey(), entry.getValue().copy());
} }
for (Map.Entry<UUID, CardAttribute> entry: state.cardAttribute.entrySet()) {
cardAttribute.put(entry.getKey(), entry.getValue().copy());
}
this.zoneChangeCounter.putAll(state.zoneChangeCounter); this.zoneChangeCounter.putAll(state.zoneChangeCounter);
this.copiedCards.putAll(state.copiedCards); this.copiedCards.putAll(state.copiedCards);
this.permanentOrderNumber = state.permanentOrderNumber; this.permanentOrderNumber = state.permanentOrderNumber;
@ -208,6 +211,7 @@ public class GameState implements Serializable, Copyable<GameState> {
this.zones = state.zones; this.zones = state.zones;
this.simultaneousEvents = state.simultaneousEvents; this.simultaneousEvents = state.simultaneousEvents;
this.cardState = state.cardState; this.cardState = state.cardState;
this.cardAttribute = state.cardAttribute;
this.zoneChangeCounter = state.zoneChangeCounter; this.zoneChangeCounter = state.zoneChangeCounter;
this.copiedCards = state.copiedCards; this.copiedCards = state.copiedCards;
this.permanentOrderNumber = state.permanentOrderNumber; this.permanentOrderNumber = state.permanentOrderNumber;

View file

@ -33,6 +33,7 @@ import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.keyword.TransformAbility;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.LevelerCard; import mage.cards.LevelerCard;
import mage.constants.Zone; import mage.constants.Zone;
@ -65,6 +66,13 @@ public class PermanentCard extends PermanentImpl {
if (card instanceof LevelerCard) { if (card instanceof LevelerCard) {
maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters(); maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters();
} }
if (canTransform()) {
if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId()) != null) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId(), null);
setTransformed(true);
TransformAbility.transform(this, getSecondCardFace(), game);
}
}
} }
public PermanentCard(final PermanentCard permanent) { public PermanentCard(final PermanentCard permanent) {

View file

@ -709,7 +709,8 @@ public abstract class PlayerImpl implements Player, Serializable {
} }
} }
} else { } else {
TargetDiscard target = new TargetDiscard(amount, amount, new FilterCard(CardUtil.numberToText(amount, "a") + " card" + (amount > 1 ? "s" : "")), playerId); int possibleAmount = Math.min(getHand().size(), amount);
TargetDiscard target = new TargetDiscard(possibleAmount, possibleAmount, new FilterCard(CardUtil.numberToText(possibleAmount, "a") + " card" + (possibleAmount > 1 ? "s" : "")), playerId);
choose(Outcome.Discard, target, source == null ? null : source.getSourceId(), game); choose(Outcome.Discard, target, source == null ? null : source.getSourceId(), game);
for (UUID cardId : target.getTargets()) { for (UUID cardId : target.getTargets()) {
Card card = this.getHand().get(cardId, game); Card card = this.getHand().get(cardId, game);
@ -2839,7 +2840,19 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override @Override
public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) { public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) {
ArrayList<Card> cardList = new ArrayList<>(); ArrayList<Card> cardList = new ArrayList<>();
cardList.addAll(cards.getCards(game)); for (UUID cardId: cards) {
if (fromZone.equals(Zone.BATTLEFIELD)) {
Permanent permanent = game.getPermanent(cardId);
if (permanent != null) {
cardList.add(permanent);
}
} else {
Card card = game.getCard(cardId);
if (card != null) {
cardList.add(card);
}
}
}
return moveCards(cardList, fromZone, toZone, source, game); return moveCards(cardList, fromZone, toZone, source, game);
} }

View file

@ -26196,6 +26196,8 @@ Akroan Jailer|Magic Origins|1|C|{W}|Creature - Human Soldier|1|1|{2}{W}, {T}: Ta
Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."| Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."|
Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.| Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.|
Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.| Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.|
Gideon, Battle-Forged|Magic Origins|023|M||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.|
Kytheon, Hero of Akros|Magic Origins|23|M|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.|
Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance <i>(Attacking doesn't cause this creature to tap.)</i>$At the beginning of combat on each opponent's turn, tap target creature that player controls.| Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance <i>(Attacking doesn't cause this creature to tap.)</i>$At the beginning of combat on each opponent's turn, tap target creature that player controls.|
Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.| Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.|
Aegis Angel|Magic Origins|273|R|{4}{W}{W}{4}{W}{W}|Creature - Angel|5|55|5|Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.$Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.| Aegis Angel|Magic Origins|273|R|{4}{W}{W}{4}{W}{W}|Creature - Angel|5|55|5|Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.$Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.|
@ -26204,10 +26206,14 @@ Eagle of the Watch|Magic Origins|275|C|{2}{W}|Creature - Bird|2|1|Flying, vigila
Serra Angel|Magic Origins|276|U|{3}{W}{W}{3}{W}{W}|Creature - Angel|4|44|4|Flying$Vigilance$Flying$Vigilance| Serra Angel|Magic Origins|276|U|{3}{W}{W}{3}{W}{W}|Creature - Angel|4|44|4|Flying$Vigilance$Flying$Vigilance|
Claustrophobia|Magic Origins|?|C|{1}{U}{U}{1}{U}{U}|Enchantment - Aura|||$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.| Claustrophobia|Magic Origins|?|C|{1}{U}{U}{1}{U}{U}|Enchantment - Aura|||$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.|
Disperse|Magic Origins|?|C|{1}{U}{1}{U}|Instant|||Return target nonland permanent to its owner's hand.$Return target nonland permanent to its owner's hand.| Disperse|Magic Origins|?|C|{1}{U}{1}{U}|Instant|||Return target nonland permanent to its owner's hand.$Return target nonland permanent to its owner's hand.|
Displacement Wave|Magic Origins|?|?mtg-set-icon mtg-set-magic-origins-unknown|{X}{U}{U}{X}{U}{U}|Sorcery|||Return all nonland permanents with converted mana cost X or less to their owners' hands.$Return all nonland permanents with converted mana cost X or less to their owners' hands.|
Maritime Guard|Magic Origins|?|C|{1}{U}{1}{U}|Creature - Merfolk Soldier|1|31|3|| Maritime Guard|Magic Origins|?|C|{1}{U}{1}{U}|Creature - Merfolk Soldier|1|31|3||
Mizzium Meddler|Magic Origins|?|R|{2}{U}{2}{U}|Creature - Vedalken Wizard|1|41|4|Flash$When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.$Flash$When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.|
Scrapskin Drake|Magic Origins|?|C|{2}{U}{2}{U}|Creature - Zombie Drake|2|32|3|Flying$Scrapskin Drake can block only creatures with flying.$Flying$Scrapskin Drake can block only creatures with flying.| Scrapskin Drake|Magic Origins|?|C|{2}{U}{2}{U}|Creature - Zombie Drake|2|32|3|Flying$Scrapskin Drake can block only creatures with flying.$Flying$Scrapskin Drake can block only creatures with flying.|
Tower Geist|Magic Origins|?|U|{3}{U}{3}{U}|Creature - Spirit|2|22|2|Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.$Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.| Tower Geist|Magic Origins|?|U|{3}{U}{3}{U}|Creature - Spirit|2|22|2|Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.$Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.|
Hydrolash|Magic Origins|59|U|{2}{U}|Instant|||Attacking creatures get -2/-0 until end of turn.$Draw a card.| Hydrolash|Magic Origins|59|U|{2}{U}|Instant|||Attacking creatures get -2/-0 until end of turn.$Draw a card.|
Jace, Telepath Unbound|Magic Origins|60|M||Planeswalker - Jace|55|+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". $+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". |
Jace, Vryn's Prodigy|Magic Origins|60|M|{1}{U}{1}{U}|Legendary Creature - Human Wizard|0|20|2|{T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. ${T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. |
Jhessian Thief|Magic Origins|62|U|{2}{U}|Creature - Human Rogue|1|3|Prowess <i>(Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)</i>$Whenever Jhessian Thief deals combat damage to a player, draw a card.| Jhessian Thief|Magic Origins|62|U|{2}{U}|Creature - Human Rogue|1|3|Prowess <i>(Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)</i>$Whenever Jhessian Thief deals combat damage to a player, draw a card.|
Ringwarden Owl|Magic Origins|068|C|{3}{U}{U}|Creature - Bird|3|3|Flying <i>(This creature can't be blocked except by creatures with flying or reach.)</i>$Prowess <i>(Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)</i>| Ringwarden Owl|Magic Origins|068|C|{3}{U}{U}|Creature - Bird|3|3|Flying <i>(This creature can't be blocked except by creatures with flying or reach.)</i>$Prowess <i>(Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)</i>|
Separatist Voidmage|Magic Origins|72|C|{3}{U}|Creature - Human Wizard|2|2|When Separatist Voidmage enters the battlefield, you may return target creature to its owner's hand.| Separatist Voidmage|Magic Origins|72|C|{3}{U}|Creature - Human Wizard|2|2|When Separatist Voidmage enters the battlefield, you may return target creature to its owner's hand.|
@ -26231,12 +26237,16 @@ Nightmare|Magic Origins|282|R|{5}{B}{5}{B}|Creature - Nightmare Horse|0|00|0|Fly
Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.| Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.|
Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.| Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.|
Chandra's Fury|Magic Origins|?|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.| Chandra's Fury|Magic Origins|?|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.|
Chandra's Ignition|Magic Origins|?|R|{3}{R}{R}{3}{R}{R}|Sorcery|||Target creature you control deals damage equal to its power to each other creature and each opponent.$Target creature you control deals damage equal to its power to each other creature and each opponent.|
Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2|| Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2||
Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.| Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.|
Ravaging Blaze|Magic Origins|?|U|{X}{R}{R}{X}{R}{R}|Instant|||Ravaging Blaze deals X damage to target creature. $<i>Spell mastery</i> — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.$Ravaging Blaze deals X damage to target creature. $<i>Spell mastery</i> — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.|
Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.| Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.|
Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.| Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.|
Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.| Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.|
Boggart Brute|Magic Origins|133|C|{2}{R}|Creature - Goblin Warrior|3|2|Menace <i>(This creature can't be blocked except by two or more creatures.)</i>| Boggart Brute|Magic Origins|133|C|{2}{R}|Creature - Goblin Warrior|3|2|Menace <i>(This creature can't be blocked except by two or more creatures.)</i>|
Chandra, Fire of Kaladesh|Magic Origins|135|M|{1}{R}{R}{1}{R}{R}|Legendary Creature - Human Shaman|2|22|2|Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.$Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.|
Chandra, Roaring Flame|Magic Origins|135|M||Planeswalker - Chandra|44|+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."$+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."|
Enthralling Victor|Magic Origins|142|U|{3}{R}|Creature - Human Warrior|3|2|When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.| Enthralling Victor|Magic Origins|142|U|{3}{R}|Creature - Human Warrior|3|2|When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.|
Lightning Javelin|Magic Origins|153|C|{3}{R}|Sorcery|||Lightning Javelin deals 3 damage to target creature or player. Scry 1.| Lightning Javelin|Magic Origins|153|C|{3}{R}|Sorcery|||Lightning Javelin deals 3 damage to target creature or player. Scry 1.|
Seismic Elemental|Magic Origins|161|U|{3}{R}{R}|Creature - Elemental|4|4|When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.| Seismic Elemental|Magic Origins|161|U|{3}{R}{R}|Creature - Elemental|4|4|When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.|
@ -26253,6 +26263,8 @@ Conclave Naturalists|Magic Origins|171|U|{4}{G}|Creature - Dryad|4|4|When Concla
Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach| Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach|
Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.| Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.|
Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.| Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.|
Nissa, Sage Animist|Magic Origins|189|M||Planeswalker - Nissa|33|+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.$+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.|
Nissa, Vastwood Seer|Magic Origins|189|M|{2}{G}{2}{G}|Legendary Creature - Elf Scout|2|22|2|When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.$When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.|
Plummet|Magic Origins|286|C|{1}{G}{1}{G}|Instant|||Destroy target creature with flying.$Destroy target creature with flying.| Plummet|Magic Origins|286|C|{1}{G}{1}{G}|Instant|||Destroy target creature with flying.$Destroy target creature with flying.|
Prized Unicorn|Magic Origins|287|U|{3}{G}{3}{G}|Creature - Unicorn|2|22|2|All creatures able to block Prized Unicorn do so.$All creatures able to block Prized Unicorn do so.| Prized Unicorn|Magic Origins|287|U|{3}{G}{3}{G}|Creature - Unicorn|2|22|2|All creatures able to block Prized Unicorn do so.$All creatures able to block Prized Unicorn do so.|
Terra Stomper|Magic Origins|288|R|{3}{G}{G}{G}{3}{G}{G}{G}|Creature - Beast|8|88|8|Terra Stomper can't be countered.$Trample$Terra Stomper can't be countered.$Trample| Terra Stomper|Magic Origins|288|R|{3}{G}{G}{G}{3}{G}{G}{G}|Creature - Beast|8|88|8|Terra Stomper can't be countered.$Trample$Terra Stomper can't be countered.$Trample|
@ -26260,7 +26272,7 @@ Meteorite|Magic Origins|?|U|{5}{5}|Artifact|||When Meteorite enters the battlefi
Gold-Forged Sentinel|Magic Origins|?|U|{6}{6}|Artifact Creature - Chimera|4|44|4|Flying$Flying| Gold-Forged Sentinel|Magic Origins|?|U|{6}{6}|Artifact Creature - Chimera|4|44|4|Flying$Flying|
Runed Servitor|Magic Origins|?|U|{2}{2}|Artifact Creature - Construct|2|22|2|When Runed Servitor dies, each player draws a card.$When Runed Servitor dies, each player draws a card.| Runed Servitor|Magic Origins|?|U|{2}{2}|Artifact Creature - Construct|2|22|2|When Runed Servitor dies, each player draws a card.$When Runed Servitor dies, each player draws a card.|
Jayemdae Tome|Magic Origins|?|U|{4}{4}|Artifact|||{4}, {T}: Draw a card.${4}, {T}: Draw a card.| Jayemdae Tome|Magic Origins|?|U|{4}{4}|Artifact|||{4}, {T}: Draw a card.${4}, {T}: Draw a card.|
Veteran's Sidearm|Magic Origins|242|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Equip {1}| Veteran's Sidearm|Magic Origins|242|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Equip {1}|
Ambush Commander|Duel Decks: Anthology, Elves vs. Goblins|1|R|{3}{G}{G}|Creature - Elf|2|2|Forests you control are 1/1 green Elf creatures that are still lands.${1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.| Ambush Commander|Duel Decks: Anthology, Elves vs. Goblins|1|R|{3}{G}{G}|Creature - Elf|2|2|Forests you control are 1/1 green Elf creatures that are still lands.${1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.|
Lys Alana Huntmaster|Duel Decks: Anthology, Elves vs. Goblins|10|C|{2}{G}{G}|Creature - Elf Warrior|3|3|Whenever you cast an Elf spell, you may put a 1/1 green Elf Warrior creature token onto the battlefield.| Lys Alana Huntmaster|Duel Decks: Anthology, Elves vs. Goblins|10|C|{2}{G}{G}|Creature - Elf Warrior|3|3|Whenever you cast an Elf spell, you may put a 1/1 green Elf Warrior creature token onto the battlefield.|
Stonewood Invoker|Duel Decks: Anthology, Elves vs. Goblins|11|C|{1}{G}|Creature - Elf Mutant|2|2|{7}{G}: Stonewood Invoker gets +5/+5 until end of turn.| Stonewood Invoker|Duel Decks: Anthology, Elves vs. Goblins|11|C|{1}{G}|Creature - Elf Mutant|2|2|{7}{G}: Stonewood Invoker gets +5/+5 until end of turn.|

View file

@ -134,6 +134,9 @@ git log eb96b08dfac3de4f78403d6f23e41ce8d41ece6f..HEAD --diff-filter=A --name-st
since 1.4.1.v0 since 1.4.1.v0
git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.4.1.v1
git log 3e9b4cfb7c22d363755d28f5ff1de351f6b7123c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
3. Copy added_cards.txt to trunk\Utils folder 3. Copy added_cards.txt to trunk\Utils folder
4. Run script: 4. Run script:
> perl extract_in_wiki_format.perl > perl extract_in_wiki_format.perl