Fixed cards submitted by cbt33 - see list of changes:

* Scrivener - Changed filter message, change EntersBattlefieldEffect to EntersBattlefieldTriggeredEffect
* Earnest Fellowship - Moved comment line, Changed layer of EarnestFellowshipEffect to AbilityAddingRemovingEffects_6, changed outcome. Removed unneccassary init method. Simplyfied apply effect, adding maximal one ProtectionAbility to a permanent, before Filter and abilities were all redundant for multicolor permanents. Fixed wrong sourceId for addAbility.
* Hallowed Healer - Made targets mandatory (default number of targets 1 has not to be set), Fixed tooltip text (Threshold, tap symbol, dot at the end).
* Treetop Sentinel - filname missed the "java" extension. Changed filter message.
* Bloodcurdler - removed unneccessary comment, replaced card name by {this} for rule text, corrected the descond effect of the threshold ability (this is no cost it's an effect).
* Buried Alive - Moved comment line, fixed sourceId for moveToZone.
* Think Tank - removed unneccessary comment, LookLibraryAndPickControllerEffect could not handle the effect.
* Words of Wisdom - added missing tooltip text, removed unneccessary comments, fixed indentation     
* Unifying Theory - removed unneccessary comment, simplified UnifyingTheoryEffect, removed dot from effect static text.
* Ancestral Tribute - fixed indentation.
This commit is contained in:
LevelX2 2013-09-27 12:57:08 +02:00
parent b1108332bd
commit 14d4f0dccf
15 changed files with 220 additions and 128 deletions

View file

@ -112,8 +112,7 @@ class EtherwroughtPageEffect extends OneShotEffect<EtherwroughtPageEffect> {
cards.add(card);
you.lookAtCards("Etherwrought Page", cards, game);
if (you.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", game)) {
card = you.getLibrary().removeFromTop(game);
return card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
return card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
}
return true;
}

View file

@ -102,7 +102,7 @@ class InameDeathAspectEffect extends SearchEffect<InameDeathAspectEffect> {
for (UUID cardId: target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null){
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
}
}
}

View file

@ -33,8 +33,6 @@ import mage.abilities.Ability;
import mage.abilities.effects.SearchEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
@ -56,8 +54,9 @@ public class BuriedAlive extends CardImpl<BuriedAlive> {
this.expansionSetCode = "CMD";
this.color.setBlack(true);
this.getSpellAbility().addEffect(new BuriedAliveEffect());
// Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library.
this.getSpellAbility().addEffect(new BuriedAliveEffect());
}
@ -74,7 +73,7 @@ public class BuriedAlive extends CardImpl<BuriedAlive> {
class BuriedAliveEffect extends SearchEffect<BuriedAliveEffect> {
public BuriedAliveEffect() {
super(new TargetCardInLibrary(1, 3, new FilterCreatureCard()), Outcome.Neutral);
super(new TargetCardInLibrary(0, 3, new FilterCreatureCard()), Outcome.Detriment);
staticText = "Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library";
}
@ -90,25 +89,21 @@ class BuriedAliveEffect extends SearchEffect<BuriedAliveEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
Cards cards = new CardsImpl();
for (UUID cardId: (List<UUID>)target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null){
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
if (player != null) {
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
for (UUID cardId: (List<UUID>)target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null){
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
}
}
}
}
player.shuffleLibrary(game);
return true;
}
player.shuffleLibrary(game);
return false;
}
}

View file

@ -30,7 +30,7 @@ package mage.sets.exodus;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -46,7 +46,7 @@ import mage.target.common.TargetCardInGraveyard;
public class Scrivener extends CardImpl<Scrivener> {
private static final FilterCard filter = new FilterCard("Instant");
private static final FilterCard filter = new FilterCard("instant card from your graveyard");
static{
filter.add(new CardTypePredicate(CardType.INSTANT));
@ -63,7 +63,7 @@ public class Scrivener extends CardImpl<Scrivener> {
this.toughness = new MageInt(2);
// When Scrivener enters the battlefield, you may return target instant card from your graveyard to your hand.
Ability ability = new EntersBattlefieldAbility(new ReturnFromGraveyardToHandTargetEffect(), true);
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), true);
ability.addTarget(new TargetCardInGraveyard(filter));
this.addAbility(ability);

View file

@ -28,14 +28,14 @@
package mage.sets.odyssey;
import java.util.UUID;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.FlashbackAbility;
import mage.filter.FilterCard;
/**
@ -50,13 +50,12 @@ public class AncestralTribute extends CardImpl<AncestralTribute> {
this.expansionSetCode = "ODY";
this.color.setWhite(true);
// You gain 2 life for each card in your graveyard.
this.getSpellAbility().addEffect(new GainLifeEffect((new CardsInControllerGraveyardCount(new FilterCard(), 2))));
// Flashback {9}{W}{W}{W}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{9}{W}{W}{W}"), TimingRule.SORCERY));
this.getSpellAbility().addEffect(new GainLifeEffect((new CardsInControllerGraveyardCount(new FilterCard(), 2))));
// Flashback {9}{W}{W}{W}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{9}{W}{W}{W}"), TimingRule.SORCERY));
}

View file

@ -30,13 +30,18 @@ package mage.sets.odyssey;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.common.ExileCardFromOwnGraveyardControllerEffect;
import mage.abilities.effects.common.PutTopCardOfYourLibraryIntoGraveEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -66,23 +71,16 @@ public class Bloodcurdler extends CardImpl<Bloodcurdler> {
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, put the top card of your library into your graveyard.
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new PutTopCardOfYourLibraryIntoGraveEffect(1), TargetController.YOU, false);
this.addAbility(ability);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new PutTopCardOfYourLibraryIntoGraveEffect(1), TargetController.YOU, false));
Condition thresholdCondition = new CardsInControllerGraveCondition(7);
// Threshold - As long as seven or more cards are in your graveyard, Bloodcurdler gets +1/+1 and has "At the beginning of your end step, exile two cards from your graveyard."
//this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new Zone zone, UUID exileId, String exileName, FilterCard filter, 1), TargetController.YOU, false));
Ability thresholdAbility = new SimpleStaticAbility(
Zone.BATTLEFIELD,
new ConditionalContinousEffect(
new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield),
new CardsInControllerGraveCondition(7),
"<br/><br/><i>Threshold</i> - If seven or more cards are in your graveyard, Bloodcurdler gets +1/+1."
));
//"At the beginning of your end step, exile two cards from your graveyard."
thresholdAbility.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2, new FilterCard("cards from your graveyard"))));
Ability thresholdAbility = new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), thresholdCondition,
"<i>Threshold</i> - If seven or more cards are in your graveyard, {this} gets +1/+1"));
ContinuousEffect effect = new GainAbilitySourceEffect(new BeginningOfEndStepTriggeredAbility(new ExileCardFromOwnGraveyardControllerEffect(2), TargetController.YOU, false));
thresholdAbility.addEffect(new ConditionalContinousEffect(effect, thresholdCondition,
"and has \"At the beginning of your end step, exile two cards from your graveyard.\""));
this.addAbility(thresholdAbility);
}

View file

@ -59,9 +59,11 @@ public class EarnestFellowship extends CardImpl<EarnestFellowship> {
this.expansionSetCode = "ODY";
this.color.setWhite(true);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EarnestFellowshipEffect()));
// Each creature has protection from its colors.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EarnestFellowshipEffect()));
}
@ -81,7 +83,7 @@ class EarnestFellowshipEffect extends ContinuousEffectImpl<EarnestFellowshipEffe
public EarnestFellowshipEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
this.staticText = "Each creature has protection from its colors";
}
@ -94,59 +96,32 @@ class EarnestFellowshipEffect extends ContinuousEffectImpl<EarnestFellowshipEffe
return new EarnestFellowshipEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
if (this.affectedObjectsSet) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
for (Permanent permanent : permanents) {
objects.add(permanent.getId());
}
}
}
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
for (Permanent permanent : permanents) {
if (!this.affectedObjectsSet || objects.contains(permanent.getId())) {
ObjectColor color = permanent.getColor();
FilterCard filterColor = new FilterCard("its own Colors");
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (permanent.getColor().hasColor()) {
ObjectColor color = permanent.getColor();
FilterCard filterColor = new FilterCard("its own Colors");
if (color.contains(ObjectColor.BLACK)){
filterColor.add(new ColorPredicate(ObjectColor.BLACK));
Ability ability = new ProtectionAbility(filterColor);
permanent.addAbility(ability, id, game);
}
filterColor.add(new ColorPredicate(ObjectColor.BLACK));
}
if (color.contains(ObjectColor.BLUE)){
filterColor.add(new ColorPredicate(ObjectColor.BLUE));
Ability ability = new ProtectionAbility(filterColor);
permanent.addAbility(ability, id, game);
}
filterColor.add(new ColorPredicate(ObjectColor.BLUE));
}
if (color.contains(ObjectColor.WHITE)){
filterColor.add(new ColorPredicate(ObjectColor.WHITE));
Ability ability = new ProtectionAbility(filterColor);
permanent.addAbility(ability, id, game);
}
filterColor.add(new ColorPredicate(ObjectColor.WHITE));
}
if (color.contains(ObjectColor.RED)){
filterColor.add(new ColorPredicate(ObjectColor.RED));
Ability ability = new ProtectionAbility(filterColor);
permanent.addAbility(ability, id, game);
}
filterColor.add(new ColorPredicate(ObjectColor.RED));
}
if (color.contains(ObjectColor.GREEN)){
filterColor.add(new ColorPredicate(ObjectColor.GREEN));
Ability ability = new ProtectionAbility(filterColor);
permanent.addAbility(ability, id, game);
filterColor.add(new ColorPredicate(ObjectColor.GREEN));
}
Ability ability = new ProtectionAbility(filterColor);
permanent.addAbility(ability, source.getSourceId(), game);
}
}
return true;
}
}

View file

@ -61,15 +61,15 @@ public class HallowedHealer extends CardImpl<HallowedHealer> {
// {tap}: Prevent the next 2 damage that would be dealt to target creature or player this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn,2), new TapSourceCost());
ability.addTarget(new TargetCreatureOrPlayer(1));
ability.addTarget(new TargetCreatureOrPlayer(true));
this.addAbility(ability);
// Threshold - {tap}: Prevent the next 4 damage that would be dealt to target creature or player this turn. Activate this ability only if seven or more cards are in your graveyard.
Ability thresholdAbility = new ConditionalGainActivatedAbility(Zone.BATTLEFIELD,
new PreventDamageTargetEffect(Duration.EndOfTurn,4),
new TapSourceCost(),
new CardsInControllerGraveCondition(7),
"Prevent the next 4 damage that would be dealt to target creature or player this turn. Activate this ability only if seven or more cards are in your graveyard");
thresholdAbility.addTarget(new TargetCreatureOrPlayer(1));
"<i>Threshold</i> - {T}: Prevent the next 4 damage that would be dealt to target creature or player this turn. Activate this ability only if seven or more cards are in your graveyard.");
thresholdAbility.addTarget(new TargetCreatureOrPlayer(true));
this.addAbility(thresholdAbility);
}

View file

@ -31,13 +31,19 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
/**
*
@ -52,12 +58,8 @@ public class ThinkTank extends CardImpl<ThinkTank> {
this.color.setBlue(true);
// At the beginning of your upkeep, look at the top card of your library. You may put that card into your graveyard.
//Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(1), TargetController.YOU, false);
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new LookLibraryAndPickControllerEffect(new StaticValue(1), false, new StaticValue(1), new FilterCard(), Zone.GRAVEYARD, false, false), TargetController.YOU, false);
this.addAbility(ability);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ThinkTankLookLibraryEffect(), TargetController.YOU, false));
// Ability ability2 = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new PutTopCardOfYourLibraryIntoGraveEffect(1), TargetController.YOU, true);
//this.addAbility(ability2);
}
public ThinkTank(final ThinkTank card) {
@ -69,3 +71,41 @@ public class ThinkTank extends CardImpl<ThinkTank> {
return new ThinkTank(this);
}
}
class ThinkTankLookLibraryEffect extends OneShotEffect<ThinkTankLookLibraryEffect> {
public ThinkTankLookLibraryEffect() {
super(Outcome.DrawCard);
this.staticText = "look at the top card of your library. You may put that card into your graveyard";
}
public ThinkTankLookLibraryEffect(final ThinkTankLookLibraryEffect effect) {
super(effect);
}
@Override
public ThinkTankLookLibraryEffect copy() {
return new ThinkTankLookLibraryEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
if (you != null) {
if (you.getLibrary().size() > 0) {
Card card = you.getLibrary().getFromTop(game);
if (card != null) {
CardsImpl cards = new CardsImpl();
cards.add(card);
you.lookAtCards("Think Tank", cards, game);
if (you.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", game)) {
return card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
}
}
}
return true;
}
return false;
}
}

View file

@ -45,8 +45,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
public class TreetopSentinel extends CardImpl<TreetopSentinel> {
public static final FilterCard filter = new FilterCard("Green");
public static final FilterCard filter = new FilterCard("green");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}

View file

@ -30,12 +30,14 @@ package mage.sets.odyssey;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastAllTriggeredAbility;
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -60,7 +62,7 @@ public class UnifyingTheory extends CardImpl<UnifyingTheory> {
this.color.setBlue(true);
// Whenever a player casts a spell, that player may pay {2}. If the player does, he or she draws a card.
this.addAbility(new SpellCastAllTriggeredAbility(new UnifyingTheoryEffect(), new FilterSpell("a spell"), false, true));
this.addAbility(new SpellCastAllTriggeredAbility(new UnifyingTheoryEffect() , new FilterSpell("a spell"), false, true));
}
public UnifyingTheory(final UnifyingTheory card) {
@ -77,7 +79,7 @@ class UnifyingTheoryEffect extends OneShotEffect<UnifyingTheoryEffect> {
public UnifyingTheoryEffect() {
super(Outcome.Detriment);
this.staticText = "that player may pay {2}. If the player does, he or she draws a card.";
this.staticText = "that player may pay {2}. If the player does, he or she draws a card";
}
public UnifyingTheoryEffect(final UnifyingTheoryEffect effect) {
@ -100,13 +102,7 @@ class UnifyingTheoryEffect extends OneShotEffect<UnifyingTheoryEffect> {
if (caster.chooseUse(Outcome.DrawCard, "Pay {2} to draw a card?", game)) {
Cost cost = new ManaCostsImpl("{2}");
if (cost.pay(source, game, source.getSourceId(), caster.getId(), false)) {
Effect effect = new DrawCardTargetEffect(1);
effect.setTargetPointer(new FixedTarget(caster.getId()));
//Ability ability = new AtEndOfTurnDelayedTriggeredAbility(effect);
//return ability.activate(game, true);
return effect.apply(game, source);
//return new SimpleTriggeredAbility(Zone.BATTLEFIELD, effect, "").apply(game,source);
//return new CreateDelayedTriggeredAbilityEffect(new AtEndOfTurnDelayedTriggeredAbility(effect, TargetController.ANY)).apply(game, source);
caster.drawCards(1, game);
}
}
return true;

View file

@ -30,6 +30,7 @@ package mage.sets.odyssey;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -51,6 +52,7 @@ public class WordsOfWisdom extends CardImpl<WordsOfWisdom> {
this.color.setBlue(true);
// You draw two cards, then each other player draws a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(2));
this.getSpellAbility().addEffect(new WordsOfWisdomEffect());
}
@ -68,7 +70,7 @@ class WordsOfWisdomEffect extends OneShotEffect<WordsOfWisdomEffect> {
public WordsOfWisdomEffect() {
super(Outcome.Detriment);
this.staticText = "each other player draws a card";
this.staticText = "then each other player draws a card";
}
public WordsOfWisdomEffect(final WordsOfWisdomEffect effect) {
@ -84,28 +86,16 @@ class WordsOfWisdomEffect extends OneShotEffect<WordsOfWisdomEffect> {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.drawCards(2, game);
for(UUID playerId: controller.getInRange()) {
if (!playerId.equals(controller.getId())) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.drawCards(1, game);
//TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard());
// if (target.canChoose(source.getSourceId(), playerId, game)
// && player.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", game)
// && player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
// Card card = game.getCard(target.getFirstTarget());
// if (card != null) {
// card.putOntoBattlefield(game, Zone.HAND, source.getId(), player.getId());
}
//}
}
}
}
return false;
}
return false;
}
}

View file

@ -170,7 +170,7 @@ class PreventAllDamageToControllerEffect extends PreventionEffectImpl<PreventAll
if(player != null){
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(damage, player.getGraveyard().size()), new FilterCard());
target.setRequired(true);
if (target.choose(Outcome.Exile, source.getControllerId(), source.getId(), game)) {
if (target.choose(Outcome.Exile, source.getControllerId(), source.getSourceId(), game)) {
for (UUID targetId: target.getTargets()) {
Card card = player.getGraveyard().get(targetId, game);
if (card != null) {

View file

@ -0,0 +1,95 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect<ExileCardFromOwnGraveyardControllerEffect> {
private int amount;
public ExileCardFromOwnGraveyardControllerEffect(int amount) {
super(Outcome.Exile);
this.amount = amount;
this.staticText = setText();
}
public ExileCardFromOwnGraveyardControllerEffect(final ExileCardFromOwnGraveyardControllerEffect effect) {
super(effect);
this.amount = effect.amount;
}
@Override
public ExileCardFromOwnGraveyardControllerEffect copy() {
return new ExileCardFromOwnGraveyardControllerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if(player != null){
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(amount, player.getGraveyard().size()), new FilterCard());
target.setRequired(true);
if (player.chooseTarget(outcome, target, source, game)) {
for (UUID targetId: target.getTargets()) {
Card card = player.getGraveyard().get(targetId, game);
if (card != null) {
card.moveToZone(Zone.EXILED, source.getSourceId(), game, false);
}
}
}
return true;
}
return false;
}
private String setText() {
StringBuilder sb = new StringBuilder("Exile ");
if (amount == 1) {
sb.append(" a card ");
} else {
sb.append(CardUtil.numberToText(amount)). append(" cards ");
}
sb.append("from your graveyard");
return sb.toString();
}
}

View file

@ -164,6 +164,9 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
case BATTLEFIELD:
sb.append("put ").append(filter.getMessage()).append(" onto the battlefield");
break;
case GRAVEYARD:
sb.append("put ").append(filter.getMessage()).append(" into your graveyard");
break;
}
return sb.append("?").toString();
}
@ -181,6 +184,9 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
case BATTLEFIELD:
sb.append("put onto the battlefield");
break;
case GRAVEYARD:
sb.append("put into the graveyard");
break;
}
return sb.toString();
}