diff --git a/Mage.Sets/src/mage/sets/conspiracytakethecrown/KayaGhostAssassin.java b/Mage.Sets/src/mage/sets/conspiracytakethecrown/KayaGhostAssassin.java new file mode 100644 index 00000000000..f8993d9c67c --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracytakethecrown/KayaGhostAssassin.java @@ -0,0 +1,150 @@ +/* + * 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.conspiracytakethecrown; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class KayaGhostAssassin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature to exile. Choose no targets to exile Kaya."); + + public KayaGhostAssassin(UUID ownerId) { + super(ownerId, 75, "Kaya, Ghost Assassin", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{B}"); + this.expansionSetCode = "CN2"; + this.subtype.add("Kaya"); + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + + // 0: Exile Kaya, Ghost Assassin or up to one target creature. Return that card to the battlefield under its owner's control at the beginning of your next upkeep. + // You lose 2 life. + Ability ability = new LoyaltyAbility(new KayaGhostAssassinEffect(), 0); + ability.addTarget(new TargetCreaturePermanent(0, 1, filter, false)); + this.addAbility(ability); + + // -1: Each opponent loses 2 life and you gain 2 life. + ability = new LoyaltyAbility(new LoseLifeOpponentsEffect(2), -1); + Effect effect = new GainLifeEffect(2); + effect.setText("and you gain 2 life"); + ability.addEffect(effect); + this.addAbility(ability); + + // -2: Each opponent discards a card and you draw a card. + ability = new LoyaltyAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), -2); + effect = new DrawCardSourceControllerEffect(1); + effect.setText("and you draw a card"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public KayaGhostAssassin(final KayaGhostAssassin card) { + super(card); + } + + @Override + public KayaGhostAssassin copy() { + return new KayaGhostAssassin(this); + } +} + +class KayaGhostAssassinEffect extends OneShotEffect { + + public KayaGhostAssassinEffect() { + super(Outcome.Benefit); + this.staticText = "Exile {this} or up to one target creature. Return that card to the battlefield under its owner's control at the beginning of your next upkeep. " + + "You lose 2 life"; + } + + public KayaGhostAssassinEffect(final KayaGhostAssassinEffect effect) { + super(effect); + } + + @Override + public KayaGhostAssassinEffect copy() { + return new KayaGhostAssassinEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (controller != null && sourcePermanent != null) { + if (getTargetPointer().getFirst(game, source) != null) { + Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (targetCreature != null) { + int zcc = targetCreature.getZoneChangeCounter(game); + if (controller.moveCards(targetCreature, Zone.EXILED, source, game)) { + Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(); + effect.setTargetPointer(new FixedTarget(targetCreature.getId(), zcc + 1)); + AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility delayedAbility + = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); + game.addDelayedTriggeredAbility(delayedAbility, source); + } + } + } else { + int zcc = sourcePermanent.getZoneChangeCounter(game); + if (controller.moveCards(sourcePermanent, Zone.EXILED, source, game)) { + Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(); + effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), zcc + 1)); + AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility delayedAbility + = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); + game.addDelayedTriggeredAbility(delayedAbility, source); + } + } + controller.loseLife(2, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/visions/VisionCharm.java b/Mage.Sets/src/mage/sets/visions/VisionCharm.java index ff528620736..9a218243d33 100644 --- a/Mage.Sets/src/mage/sets/visions/VisionCharm.java +++ b/Mage.Sets/src/mage/sets/visions/VisionCharm.java @@ -40,22 +40,22 @@ import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.choices.Choice; -import mage.choices.ChoiceLandType; import mage.choices.ChoiceBasicLandType; +import mage.choices.ChoiceLandType; 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.filter.FilterPermanent; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetArtifactPermanent; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -68,18 +68,20 @@ public class VisionCharm extends CardImpl { this.expansionSetCode = "VIS"; - // Choose one - Phase target artifact - this.getSpellAbility().addEffect(new PhaseOutTargetEffect()); - this.getSpellAbility().addTarget(new TargetArtifactPermanent()); - // or Target player puts the top four cards of his or her library into his or her graveyard. + // Choose one - Target player puts the top four cards of his or her library into his or her graveyard; + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4)); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // or choose a land type and a basic land type. Each land of the first chosen type becomes the second chosen type until end of turn; Mode mode = new Mode(); - mode.getEffects().add(new PutLibraryIntoGraveTargetEffect(4)); - mode.getTargets().add(new TargetPlayer()); - this.getSpellAbility().addMode(mode); - // or choose a land type and a basic land type. Each land of the first chosen type becomes the second chosen type until end of turn. - mode = new Mode(); mode.getEffects().add(new VisionCharmEffect()); this.getSpellAbility().addMode(mode); + + // or target artifact phases out. + mode = new Mode(); + mode.getEffects().add(new PhaseOutTargetEffect()); + mode.getTargets().add(new TargetArtifactPermanent()); + this.getSpellAbility().addMode(mode); } public VisionCharm(final VisionCharm card) { @@ -95,7 +97,7 @@ public class VisionCharm extends CardImpl { class VisionCharmEffect extends ContinuousEffectImpl { private String targetLandType; private String targetBasicLandType; - + public VisionCharmEffect() { super(Duration.EndOfTurn, Outcome.Neutral); staticText = "Choose a land type and a basic land type. Each land of the first chosen type becomes the second chosen type until end of turn."; @@ -109,7 +111,7 @@ class VisionCharmEffect extends ContinuousEffectImpl { public VisionCharmEffect copy() { return new VisionCharmEffect(this); } - + @Override public void init(Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); @@ -117,7 +119,7 @@ class VisionCharmEffect extends ContinuousEffectImpl { Choice choice = new ChoiceLandType(); controller.choose(outcome, choice, game); targetLandType = choice.getChoice(); - + choice = new ChoiceBasicLandType(); controller.choose(outcome, choice, game); targetBasicLandType = choice.getChoice(); @@ -135,7 +137,7 @@ class VisionCharmEffect extends ContinuousEffectImpl { //Remove all existing subtypes and replace them with the selected Basic Land Type land.getSubtype().removeAll(land.getSubtype()); land.getSubtype().add(targetBasicLandType); - + /* Remove the existing abilities and replace them with the ability of the chosen basic land */ land.removeAllAbilities(source.getId(), game); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index c1d6cfa664f..a8f3e788273 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -3458,6 +3458,7 @@ Tukatongue Thallid|Conflux|96|C|{G}|Creature - Fungus|1|1|When Tukatongue Thalli Wild Leotau|Conflux|97|C|{2}{G}{G}|Creature - Cat|5|4|At the beginning of your upkeep, sacrifice Wild Leotau unless you pay {G}.| Apocalypse Hydra|Conflux|98|M|{X}{R}{G}|Creature - Hydra|0|0|Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.${1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player.| Blood Tyrant|Conflux|99|R|{4}{U}{B}{R}|Creature - Vampire|5|5|Flying, trample$At the beginning of your upkeep, each player loses 1 life. Put a +1/+1 counter on Blood Tyrant for each 1 life lost this way.$Whenever a player loses the game, put five +1/+1 counters on Blood Tyrant.| +Kaya, Ghost Assassin|Conspiracy: Take the Crown|75|M|{2}{W}{B}|Planeswalker - Kaya|||0: Exile Kaya, Ghost Assassin or up to one target creature. Return that card to the battlefield under its owner's control at the beginning of your next upkeep. You lose 2 life.$-1: Each opponent loses 2 life and you gain 2 life.$-2: Each opponent discards a card and you draw a card.| Archangel's Light|Dark Ascension|1|M|{7}{W}|Sorcery|||You gain 2 life for each card in your graveyard, then shuffle your graveyard into your library.| Hollowhenge Spirit|Dark Ascension|10|U|{3}{W}|Creature - Spirit|2|2|Flash (You may cast this spell any time you could cast an instant.)$Flying$When Hollowhenge Spirit enters the battlefield, remove target attacking or blocking creature from combat.| Nearheath Stalker|Dark Ascension|100|C|{4}{R}|Creature - Vampire Rogue|4|1|Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)|