diff --git a/Mage.Sets/src/mage/sets/alarareborn/EtherwroughtPage.java b/Mage.Sets/src/mage/sets/alarareborn/EtherwroughtPage.java index b1431e72ee..eac6537aa4 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/EtherwroughtPage.java +++ b/Mage.Sets/src/mage/sets/alarareborn/EtherwroughtPage.java @@ -112,8 +112,7 @@ class EtherwroughtPageEffect extends OneShotEffect { 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; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java index 77235e8174..95b5d25579 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java @@ -102,7 +102,7 @@ class InameDeathAspectEffect extends SearchEffect { 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); } } } diff --git a/Mage.Sets/src/mage/sets/commander/BuriedAlive.java b/Mage.Sets/src/mage/sets/commander/BuriedAlive.java index aea4ed2174..b4cba10549 100644 --- a/Mage.Sets/src/mage/sets/commander/BuriedAlive.java +++ b/Mage.Sets/src/mage/sets/commander/BuriedAlive.java @@ -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 { 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 { class BuriedAliveEffect extends SearchEffect { 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 { @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)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)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; } - } diff --git a/Mage.Sets/src/mage/sets/exodus/Scrivener.java b/Mage.Sets/src/mage/sets/exodus/Scrivener.java index eed96220bb..ba39b13de5 100644 --- a/Mage.Sets/src/mage/sets/exodus/Scrivener.java +++ b/Mage.Sets/src/mage/sets/exodus/Scrivener.java @@ -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 { - 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 { 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); diff --git a/Mage.Sets/src/mage/sets/odyssey/AncestralTribute.java b/Mage.Sets/src/mage/sets/odyssey/AncestralTribute.java index 1b02657280..2b1b0475fd 100644 --- a/Mage.Sets/src/mage/sets/odyssey/AncestralTribute.java +++ b/Mage.Sets/src/mage/sets/odyssey/AncestralTribute.java @@ -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 { 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)); } diff --git a/Mage.Sets/src/mage/sets/odyssey/Bloodcurdler.java b/Mage.Sets/src/mage/sets/odyssey/Bloodcurdler.java index 6185b86706..10e9cd0fe0 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Bloodcurdler.java +++ b/Mage.Sets/src/mage/sets/odyssey/Bloodcurdler.java @@ -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 { 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), - "

Threshold - 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, + "Threshold - 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); } diff --git a/Mage.Sets/src/mage/sets/odyssey/EarnestFellowship.java b/Mage.Sets/src/mage/sets/odyssey/EarnestFellowship.java index d52413660d..026529be2a 100644 --- a/Mage.Sets/src/mage/sets/odyssey/EarnestFellowship.java +++ b/Mage.Sets/src/mage/sets/odyssey/EarnestFellowship.java @@ -59,9 +59,11 @@ public class EarnestFellowship extends CardImpl { 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 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 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; } } - - diff --git a/Mage.Sets/src/mage/sets/odyssey/HallowedHealer.java b/Mage.Sets/src/mage/sets/odyssey/HallowedHealer.java index fe953013fd..1288f319a8 100644 --- a/Mage.Sets/src/mage/sets/odyssey/HallowedHealer.java +++ b/Mage.Sets/src/mage/sets/odyssey/HallowedHealer.java @@ -61,15 +61,15 @@ public class HallowedHealer extends CardImpl { // {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)); + "Threshold - {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); } diff --git a/Mage.Sets/src/mage/sets/odyssey/ThinkTank.java b/Mage.Sets/src/mage/sets/odyssey/ThinkTank.java index ef5f9b93dd..e974743379 100644 --- a/Mage.Sets/src/mage/sets/odyssey/ThinkTank.java +++ b/Mage.Sets/src/mage/sets/odyssey/ThinkTank.java @@ -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 { 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 { return new ThinkTank(this); } } + +class ThinkTankLookLibraryEffect extends OneShotEffect { + + 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; + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/TreetopSentinel b/Mage.Sets/src/mage/sets/odyssey/TreetopSentinel.java similarity index 97% rename from Mage.Sets/src/mage/sets/odyssey/TreetopSentinel rename to Mage.Sets/src/mage/sets/odyssey/TreetopSentinel.java index 3da5f1ec0f..f8e2f759f4 100644 --- a/Mage.Sets/src/mage/sets/odyssey/TreetopSentinel +++ b/Mage.Sets/src/mage/sets/odyssey/TreetopSentinel.java @@ -45,8 +45,7 @@ import mage.filter.predicate.mageobject.ColorPredicate; public class TreetopSentinel extends CardImpl { - public static final FilterCard filter = new FilterCard("Green"); - + public static final FilterCard filter = new FilterCard("green"); static { filter.add(new ColorPredicate(ObjectColor.GREEN)); } diff --git a/Mage.Sets/src/mage/sets/odyssey/UnifyingTheory.java b/Mage.Sets/src/mage/sets/odyssey/UnifyingTheory.java index 62de4ce74e..76e1ca2cb2 100644 --- a/Mage.Sets/src/mage/sets/odyssey/UnifyingTheory.java +++ b/Mage.Sets/src/mage/sets/odyssey/UnifyingTheory.java @@ -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 { 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 { 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 { 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; diff --git a/Mage.Sets/src/mage/sets/odyssey/WordsOfWisdom.java b/Mage.Sets/src/mage/sets/odyssey/WordsOfWisdom.java index dd7550f100..14f6ace7dd 100644 --- a/Mage.Sets/src/mage/sets/odyssey/WordsOfWisdom.java +++ b/Mage.Sets/src/mage/sets/odyssey/WordsOfWisdom.java @@ -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 { 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 { 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 { 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; + } } - - - diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java b/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java index 61853b4d4d..b30495b42f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java @@ -170,7 +170,7 @@ class PreventAllDamageToControllerEffect extends PreventionEffectImpl { + 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(); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index 44672010e5..f5d4c93923 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -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(); }