From 41326affb56e64385c07d20aa7a744da06d4d562 Mon Sep 17 00:00:00 2001 From: drmDev Date: Sun, 3 Jul 2016 04:09:46 -0400 Subject: [PATCH] Emrakuls Evangel (EMN) --- .../sets/eldritchmoon/EmrakulsEvangel.java | 129 ++++++++++++++++++ .../src/mage/sets/tempest/Dracoplasm.java | 4 +- .../permanent/token/EldraziHorrorToken.java | 57 ++++++++ .../permanent/token/EldraziSpawnToken.java | 3 +- 4 files changed, 188 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/eldritchmoon/EmrakulsEvangel.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/EldraziHorrorToken.java diff --git a/Mage.Sets/src/mage/sets/eldritchmoon/EmrakulsEvangel.java b/Mage.Sets/src/mage/sets/eldritchmoon/EmrakulsEvangel.java new file mode 100644 index 0000000000..17f9c37e72 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eldritchmoon/EmrakulsEvangel.java @@ -0,0 +1,129 @@ +/* + * 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.eldritchmoon; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) + */ +public class EmrakulsEvangel extends CardImpl { + + public EmrakulsEvangel(UUID ownerId) { + super(ownerId, 156, "Emrakul's Evangel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "EMN"; + this.subtype.add("Human"); + this.subtype.add("Horror"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // {T}, Sacrifice Emrakul's Evangel and any number of other non-Eldrazi creatures: + // Put a 3/2 colorless Eldrazi Horror creature token onto the battlefield for each creature sacrificed this way. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EmrakulsEvangelEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public EmrakulsEvangel(final EmrakulsEvangel card) { + super(card); + } + + @Override + public EmrakulsEvangel copy() { + return new EmrakulsEvangel(this); + } +} + +class EmrakulsEvangelEffect extends OneShotEffect { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Eldrazi creatures you control"); + + static { + filter.add(new AnotherPredicate()); + filter.add(Predicates.not(new SubtypePredicate("Eldrazi"))); + } + + EmrakulsEvangelEffect() { + super(Outcome.Sacrifice); + this.staticText = "Sacrifice Emrakul's Evangel and any number of other non-Eldrazi creatures: Put a 3/2 colorless Eldrazi Horror creature token onto the battlefield for each creature sacrificed this way."; + } + + EmrakulsEvangelEffect(final EmrakulsEvangelEffect effect) { + super(effect); + } + + @Override + public EmrakulsEvangelEffect copy() { + return new EmrakulsEvangelEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Target target = new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, filter, true); + player.chooseTarget(Outcome.Sacrifice, target, source, game); + int numSacrificed = 0; + for (UUID permanentId : target.getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + if (permanent.sacrifice(source.getSourceId(), game)) { + numSacrificed++; + } + } + } + if (numSacrificed > 0) { + EldraziHorrorToken token = new EldraziHorrorToken(); + token.putOntoBattlefield(numSacrificed, game, source.getSourceId(), source.getControllerId()); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java b/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java index ffd34d3bbf..6ae7b388ad 100644 --- a/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java +++ b/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java @@ -119,7 +119,6 @@ class DracoplasmEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { return event.getTargetId().equals(source.getSourceId()); - } @Override @@ -148,5 +147,4 @@ class DracoplasmEffect extends ReplacementEffectImpl { } return false; } - -} +} \ No newline at end of file diff --git a/Mage/src/main/java/mage/game/permanent/token/EldraziHorrorToken.java b/Mage/src/main/java/mage/game/permanent/token/EldraziHorrorToken.java new file mode 100644 index 0000000000..4ee787aac2 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/EldraziHorrorToken.java @@ -0,0 +1,57 @@ +/* + * 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.game.permanent.token; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import mage.MageInt; +import mage.constants.CardType; + +/** + * + * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) + */ +public class EldraziHorrorToken extends Token { + + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("EMN")); + } + + public EldraziHorrorToken() { + super("Eldrazi Horror", "3/2 colorless Eldrazi Horror creature"); + cardType.add(CardType.CREATURE); + subtype.add("Eldrazi"); + subtype.add("Horror"); + power = new MageInt(3); + toughness = new MageInt(2); + availableImageSetCodes = tokenImageSets; + } +} \ No newline at end of file diff --git a/Mage/src/main/java/mage/game/permanent/token/EldraziSpawnToken.java b/Mage/src/main/java/mage/game/permanent/token/EldraziSpawnToken.java index c063ed0ac1..2ec29418c6 100644 --- a/Mage/src/main/java/mage/game/permanent/token/EldraziSpawnToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/EldraziSpawnToken.java @@ -63,5 +63,4 @@ public class EldraziSpawnToken extends Token { // Get one of the three possible token images this.setTokenType(new Random().nextInt(3) + 1); } - -} +} \ No newline at end of file