From 636db342f29d0ea128d6a0fbf57c44d637881fff Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 17 Aug 2017 08:12:47 -0400 Subject: [PATCH 1/2] Implemented Galecaster Colossus --- .../src/mage/cards/g/GalecasterColossus.java | 88 +++++++++++++++++++ .../cards/m/MirriWeatherlightDuelist.java | 34 +------ Mage.Sets/src/mage/sets/Commander2017.java | 1 + 3 files changed, 90 insertions(+), 33 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/g/GalecasterColossus.java diff --git a/Mage.Sets/src/mage/cards/g/GalecasterColossus.java b/Mage.Sets/src/mage/cards/g/GalecasterColossus.java new file mode 100644 index 0000000000..5bf40b9c85 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GalecasterColossus.java @@ -0,0 +1,88 @@ +/* + * 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.cards.g; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetNonlandPermanent; + +/** + * + * @author TheElk801 + */ +public class GalecasterColossus extends CardImpl { + + private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanent you don't control"); + private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("untapped Wizard you control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + filter2.add(new SubtypePredicate(SubType.WIZARD)); + filter2.add(Predicates.not(new TappedPredicate())); + } + + public GalecasterColossus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); + + this.subtype.add("Giant"); + this.subtype.add("Wizard"); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // Tap an untapped Wizard you control: Return target nonland permanent you don't control to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new TapTargetCost(new TargetControlledPermanent(1, 1, filter2, true))); + ability.addTarget(new TargetNonlandPermanent(filter)); + this.addAbility(ability); + } + + public GalecasterColossus(final GalecasterColossus card) { + super(card); + } + + @Override + public GalecasterColossus copy() { + return new GalecasterColossus(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MirriWeatherlightDuelist.java b/Mage.Sets/src/mage/cards/m/MirriWeatherlightDuelist.java index 90d94d622d..c9b9bf8bb8 100644 --- a/Mage.Sets/src/mage/cards/m/MirriWeatherlightDuelist.java +++ b/Mage.Sets/src/mage/cards/m/MirriWeatherlightDuelist.java @@ -71,7 +71,7 @@ public class MirriWeatherlightDuelist extends CardImpl { // Whenever Mirri, Weatherlight Duelist attacks, each opponent can't block with more than one creature this combat. this.addAbility(new AttacksTriggeredAbility(new AddContinuousEffectToGame(new MirriWeatherlightDuelistBlockRestrictionEffect()), false)); - + // As long as Mirri, Weatherlight Duelist is tapped, no more than one creature can attack you each combat. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new MirriWeatherlightDuelistAttackRestrictionEffect(1), SourceTappedCondition.instance, @@ -121,38 +121,6 @@ class MirriWeatherlightDuelistBlockRestrictionEffect extends RestrictionEffect { } } -/*class MirriWeatherlightDuelistAttackRestrictionEffect extends RestrictionEffect { - - MirriWeatherlightDuelistAttackRestrictionEffect() { - super(Duration.WhileOnBattlefield); - staticText = "no more than one creature can attack you each combat"; - } - - MirriWeatherlightDuelistAttackRestrictionEffect(final MirriWeatherlightDuelistAttackRestrictionEffect effect) { - super(effect); - } - - @Override - public MirriWeatherlightDuelistAttackRestrictionEffect copy() { - return new MirriWeatherlightDuelistAttackRestrictionEffect(this); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return true; - } - - @Override - public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { - for (UUID creature : game.getCombat().getAttackers()) { - if (game.getPermanent(creature).getControllerId().equals(attacker.getControllerId()) - && game.getCombat().getDefendingPlayerId(creature, game).equals(source.getControllerId())) { - return false; - } - } - return true; - } -}*/ class MirriWeatherlightDuelistAttackRestrictionEffect extends ContinuousEffectImpl { private final int maxAttackedBy; diff --git a/Mage.Sets/src/mage/sets/Commander2017.java b/Mage.Sets/src/mage/sets/Commander2017.java index 47663bbc7a..b2e4e92a2b 100644 --- a/Mage.Sets/src/mage/sets/Commander2017.java +++ b/Mage.Sets/src/mage/sets/Commander2017.java @@ -61,6 +61,7 @@ public class Commander2017 extends ExpansionSet { cards.add(new SetCardInfo("Edgar Markov", 36, Rarity.MYTHIC, mage.cards.e.EdgarMarkov.class)); cards.add(new SetCardInfo("Fortunate Few", 4, Rarity.RARE, mage.cards.f.FortunateFew.class)); cards.add(new SetCardInfo("Fractured Identity", 37, Rarity.RARE, mage.cards.f.FracturedIdentity.class)); + cards.add(new SetCardInfo("Galecaster Colossus", 10, Rarity.RARE, mage.cards.g.GalecasterColossus.class)); cards.add(new SetCardInfo("Herald's Horn", 53, Rarity.UNCOMMON, mage.cards.h.HeraldsHorn.class)); cards.add(new SetCardInfo("Hungry Lynx", 31, Rarity.RARE, mage.cards.h.HungryLynx.class)); cards.add(new SetCardInfo("Inalla, Archmage Ritualist", 38, Rarity.MYTHIC, mage.cards.i.InallaArchmageRitualist.class)); From d2d6c635ac835471b1acb0a2a1da8bbaeb502414 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 17 Aug 2017 09:44:30 -0400 Subject: [PATCH 2/2] Implemented Kheru Mind-Eater --- .../src/mage/cards/k/KheruMindEater.java | 194 ++++++++++++++++++ Mage.Sets/src/mage/sets/Commander2017.java | 1 + 2 files changed, 195 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KheruMindEater.java diff --git a/Mage.Sets/src/mage/cards/k/KheruMindEater.java b/Mage.Sets/src/mage/cards/k/KheruMindEater.java new file mode 100644 index 0000000000..3717cc6216 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KheruMindEater.java @@ -0,0 +1,194 @@ +/* + * 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.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.ExileZone; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInHand; +import mage.util.CardUtil; + +/** + * + * @author TheElk801 + */ +public class KheruMindEater extends CardImpl { + + public KheruMindEater(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add("Vampire"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Menace + this.addAbility(new MenaceAbility()); + + // Whenever Kheru Mind-Eater deals combat damage to a player, that player exiles a card from his or her hand face down. + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new KheruMindEaterExileEffect(), false, true)); + + // You may look at and play cards exiled with Kheru Mind-Eater. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KheruMindEaterEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new KheruMindEaterLookAtCardEffect())); + } + + public KheruMindEater(final KheruMindEater card) { + super(card); + } + + @Override + public KheruMindEater copy() { + return new KheruMindEater(this); + } +} + +class KheruMindEaterExileEffect extends OneShotEffect { + + public KheruMindEaterExileEffect() { + super(Outcome.Discard); + staticText = "that player exiles a card of his or her hand face down"; + } + + public KheruMindEaterExileEffect(final KheruMindEaterExileEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null && player.getHand().size() > 0) { + Target target = new TargetCardInHand(1, new FilterCard()); + target.chooseTarget(Outcome.Exile, player.getId(), source, game); + Card card = game.getCard(target.getFirstTarget()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (card != null && sourceObject != null) { + if (player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getIdName(), source.getSourceId(), game, Zone.HAND, true)) { + card.setFaceDown(true, game); + } + return true; + } + } + return false; + } + + @Override + public KheruMindEaterExileEffect copy() { + return new KheruMindEaterExileEffect(this); + } +} + +class KheruMindEaterEffect extends AsThoughEffectImpl { + + public KheruMindEaterEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may play cards exiled with {this}"; + } + + public KheruMindEaterEffect(final KheruMindEaterEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public KheruMindEaterEffect copy() { + return new KheruMindEaterEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Card card = game.getCard(objectId); + if (affectedControllerId.equals(source.getControllerId()) && card != null && game.getState().getZone(card.getId()) == Zone.EXILED) { + ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); + return zone != null && zone.contains(card.getId()); + } + return false; + } +} + +class KheruMindEaterLookAtCardEffect extends AsThoughEffectImpl { + + public KheruMindEaterLookAtCardEffect() { + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may look at cards exiled with {this}"; + } + + public KheruMindEaterLookAtCardEffect(final KheruMindEaterLookAtCardEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public KheruMindEaterLookAtCardEffect copy() { + return new KheruMindEaterLookAtCardEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (affectedControllerId.equals(source.getControllerId())) { + Card card = game.getCard(objectId); + if (card != null) { + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject == null) { + return false; + } + UUID exileId = CardUtil.getCardExileZoneId(game, source); + ExileZone exile = game.getExile().getExileZone(exileId); + return exile != null && exile.contains(objectId); + } + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/Commander2017.java b/Mage.Sets/src/mage/sets/Commander2017.java index b2e4e92a2b..f0954f7726 100644 --- a/Mage.Sets/src/mage/sets/Commander2017.java +++ b/Mage.Sets/src/mage/sets/Commander2017.java @@ -65,6 +65,7 @@ public class Commander2017 extends ExpansionSet { cards.add(new SetCardInfo("Herald's Horn", 53, Rarity.UNCOMMON, mage.cards.h.HeraldsHorn.class)); cards.add(new SetCardInfo("Hungry Lynx", 31, Rarity.RARE, mage.cards.h.HungryLynx.class)); cards.add(new SetCardInfo("Inalla, Archmage Ritualist", 38, Rarity.MYTHIC, mage.cards.i.InallaArchmageRitualist.class)); + cards.add(new SetCardInfo("Kheru Mind-Eater", 17, Rarity.RARE, mage.cards.k.KheruMindEater.class)); cards.add(new SetCardInfo("Kindred Dominance", 18, Rarity.RARE, mage.cards.k.KindredDominance.class)); cards.add(new SetCardInfo("Mirri, Weatherlight Duelist", 43, Rarity.MYTHIC, mage.cards.m.MirriWeatherlightDuelist.class)); cards.add(new SetCardInfo("Mirror of the Forebears", 54, Rarity.UNCOMMON, mage.cards.m.MirrorOfTheForebears.class));