From 0d5f71635d24cbffb00f405d3807a6453376d7a9 Mon Sep 17 00:00:00 2001 From: North Date: Wed, 31 Aug 2011 17:00:58 +0300 Subject: [PATCH] [NPH] Blind Zealot; Fresh Meat; Phyrexian Ingester; Postmortem Lunge [ROE] Brood Birthing [LRW] Gilt-Leaf Seer; Immaculate Magistrate; Scarred Vinebreeder; Warren-Scourge Elf --- .../src/mage/sets/lorwyn/GiltLeafSeer.java | 134 +++++++++++++++ .../sets/lorwyn/ImmaculateMagistrate.java | 111 ++++++++++++ .../mage/sets/lorwyn/ScarredVinebreeder.java | 82 +++++++++ .../mage/sets/lorwyn/WarrenScourgeElf.java | 72 ++++++++ .../mage/sets/newphyrexia/BlindZealot.java | 155 +++++++++++++++++ .../src/mage/sets/newphyrexia/FreshMeat.java | 140 +++++++++++++++ .../sets/newphyrexia/PhyrexianIngester.java | 159 ++++++++++++++++++ .../sets/newphyrexia/PostmortemLunge.java | 129 ++++++++++++++ .../sets/riseoftheeldrazi/BroodBirthing.java | 97 +++++++++++ 9 files changed, 1079 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/GiltLeafSeer.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/FreshMeat.java create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/GiltLeafSeer.java b/Mage.Sets/src/mage/sets/lorwyn/GiltLeafSeer.java new file mode 100644 index 00000000000..ab24a9b9c6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/GiltLeafSeer.java @@ -0,0 +1,134 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author North + */ +public class GiltLeafSeer extends CardImpl { + + public GiltLeafSeer(UUID ownerId) { + super(ownerId, 215, "Gilt-Leaf Seer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}, {tap}: Look at the top two cards of your library, then put them back in any order. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GiltLeafSeerEffect(), new ManaCostsImpl("{G}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public GiltLeafSeer(final GiltLeafSeer card) { + super(card); + } + + @Override + public GiltLeafSeer copy() { + return new GiltLeafSeer(this); + } +} + +class GiltLeafSeerEffect extends OneShotEffect { + + public GiltLeafSeerEffect() { + super(Outcome.Neutral); + this.staticText = "look at the top two cards of your library, then put them back in any order"; + } + + public GiltLeafSeerEffect(final GiltLeafSeerEffect effect) { + super(effect); + } + + @Override + public GiltLeafSeerEffect copy() { + return new GiltLeafSeerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + Cards cards = new CardsImpl(Zone.PICK); + int count = Math.min(player.getLibrary().size(), 2); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + } + } + player.lookAtCards("Sage Owl", cards, game); + + TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library")); + target.setRequired(true); + while (cards.size() > 1) { + player.choose(Outcome.Neutral, cards, target, game); + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + target.clearChosen(); + } + if (cards.size() == 1) { + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java b/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java new file mode 100644 index 00000000000..dbbe7f044a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java @@ -0,0 +1,111 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class ImmaculateMagistrate extends CardImpl { + + public ImmaculateMagistrate(UUID ownerId) { + super(ownerId, 219, "Immaculate Magistrate", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: Put a +1/+1 counter on target creature for each Elf you control. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new ImmaculateMagistrateEffect(), + new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ImmaculateMagistrate(final ImmaculateMagistrate card) { + super(card); + } + + @Override + public ImmaculateMagistrate copy() { + return new ImmaculateMagistrate(this); + } +} + +class ImmaculateMagistrateEffect extends OneShotEffect { + + public ImmaculateMagistrateEffect() { + super(Outcome.BoostCreature); + this.staticText = "Put a +1/+1 counter on target creature for each Elf you control"; + } + + public ImmaculateMagistrateEffect(final ImmaculateMagistrateEffect effect) { + super(effect); + } + + @Override + public ImmaculateMagistrateEffect copy() { + return new ImmaculateMagistrateEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + FilterPermanent filter = new FilterPermanent("Elf card"); + filter.getSubtype().add("Elf"); + int count = game.getBattlefield().count(filter, source.getControllerId(), game); + if (count > 0) { + permanent.addCounters(CounterType.P1P1.createInstance(count), game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java b/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java new file mode 100644 index 00000000000..dcd6461d383 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java @@ -0,0 +1,82 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author North + */ +public class ScarredVinebreeder extends CardImpl { + + private static final FilterCard filter = new FilterCard("Elf card"); + + static { + filter.getSubtype().add("Elf"); + } + + public ScarredVinebreeder(UUID ownerId) { + super(ownerId, 138, "Scarred Vinebreeder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{B}, Exile an Elf card from your graveyard: Scarred Vinebreeder gets +3/+3 until end of turn. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(3, 3, Duration.EndOfTurn), + new ManaCostsImpl("{2}{B}")); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(filter))); + this.addAbility(ability); + } + + public ScarredVinebreeder(final ScarredVinebreeder card) { + super(card); + } + + @Override + public ScarredVinebreeder copy() { + return new ScarredVinebreeder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java b/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java new file mode 100644 index 00000000000..5d836e9e709 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java @@ -0,0 +1,72 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.filter.FilterCard; + +/** + * + * @author North + */ +public class WarrenScourgeElf extends CardImpl { + + private static final FilterCard filter = new FilterCard("Goblin"); + + static { + filter.getSubtype().add("Goblin"); + } + + public WarrenScourgeElf(UUID ownerId) { + super(ownerId, 241, "Warren-Scourge Elf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Protection from Goblins + this.addAbility(new ProtectionAbility(filter)); + } + + public WarrenScourgeElf(final WarrenScourgeElf card) { + super(card); + } + + @Override + public WarrenScourgeElf copy() { + return new WarrenScourgeElf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java b/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java new file mode 100644 index 00000000000..932033cbe6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java @@ -0,0 +1,155 @@ +/* + * 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.newphyrexia; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.IntimidateAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class BlindZealot extends CardImpl { + + public BlindZealot(UUID ownerId) { + super(ownerId, 52, "Blind Zealot", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "NPH"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + this.addAbility(IntimidateAbility.getInstance()); + this.addAbility(new BlindZealotTriggeredAbility()); + } + + public BlindZealot(final BlindZealot card) { + super(card); + } + + @Override + public BlindZealot copy() { + return new BlindZealot(this); + } +} + +class BlindZealotTriggeredAbility extends TriggeredAbilityImpl { + + public BlindZealotTriggeredAbility() { + super(Zone.BATTLEFIELD, new BlindZealotEffect(), false); + } + + public BlindZealotTriggeredAbility(final BlindZealotTriggeredAbility ability) { + super(ability); + } + + @Override + public BlindZealotTriggeredAbility copy() { + return new BlindZealotTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) + && ((DamagedPlayerEvent) event).isCombatDamage()) { + + Player player = game.getPlayer(this.getControllerId()); + Permanent sourcePermanent = game.getPermanent(this.getSourceId()); + + if (player != null && sourcePermanent != null) { + StringBuilder sb = new StringBuilder(); + sb.append("Do you wish to sacrifice ").append(sourcePermanent.getName()); + sb.append(" to destroy target creature controlled by "); + sb.append(game.getPlayer(event.getTargetId()).getName()).append("?"); + if (player.chooseUse(Outcome.DestroyPermanent, sb.toString(), game)) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.getControllerId().add(event.getTargetId()); + filter.setNotController(false); + filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getName()); + this.addTarget(new TargetCreaturePermanent(filter)); + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever Blind Zealot deals combat damage to a player, you may sacrifice it. If you do, destroy target creature that player controls."; + } +} + +class BlindZealotEffect extends OneShotEffect { + + public BlindZealotEffect() { + super(Outcome.DestroyPermanent); + } + + public BlindZealotEffect(final BlindZealotEffect effect) { + super(effect); + } + + @Override + public BlindZealotEffect copy() { + return new BlindZealotEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent targetPermanent = game.getPermanent(source.getFirstTarget()); + + if (sourcePermanent != null && targetPermanent != null) { + if (sourcePermanent.sacrifice(source.getSourceId(), game)) { + targetPermanent.destroy(source.getId(), game, false); + } + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/FreshMeat.java b/Mage.Sets/src/mage/sets/newphyrexia/FreshMeat.java new file mode 100644 index 00000000000..78c8879c1ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/FreshMeat.java @@ -0,0 +1,140 @@ +/* + * 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.newphyrexia; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.token.BeastToken; +import mage.watchers.WatcherImpl; + +/** + * + * @author North + */ +public class FreshMeat extends CardImpl { + + public FreshMeat(UUID ownerId) { + super(ownerId, 109, "Fresh Meat", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{G}"); + this.expansionSetCode = "NPH"; + + this.color.setGreen(true); + + this.addWatcher(new FreshMeatWatcher()); + this.getSpellAbility().addEffect(new FreshMeatEffect()); + } + + public FreshMeat(final FreshMeat card) { + super(card); + } + + @Override + public FreshMeat copy() { + return new FreshMeat(this); + } +} + +class FreshMeatWatcher extends WatcherImpl { + + private int creaturesCount = 0; + + public FreshMeatWatcher() { + super("CreaturesDiedFreshMeat"); + condition = true; + } + + public FreshMeatWatcher(final FreshMeatWatcher watcher) { + super(watcher); + this.creaturesCount = watcher.creaturesCount; + } + + @Override + public FreshMeatWatcher copy() { + return new FreshMeatWatcher(this); + } + + public int getCreaturesCount() { + return creaturesCount; + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD + && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { + Card card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (card != null && card.getOwnerId().equals(this.controllerId) && card.getCardType().contains(CardType.CREATURE)) { + creaturesCount++; + } + } + } + + @Override + public void reset() { + super.reset(); + creaturesCount = 0; + } +} + +class FreshMeatEffect extends OneShotEffect { + + public FreshMeatEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Put a 3/3 green Beast creature token onto the battlefield for each creature put into your graveyard from the battlefield this turn"; + } + + public FreshMeatEffect(final FreshMeatEffect effect) { + super(effect); + } + + @Override + public FreshMeatEffect copy() { + return new FreshMeatEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FreshMeatWatcher watcher = (FreshMeatWatcher) game.getState().getWatchers().get(source.getControllerId(), "CreaturesDiedFreshMeat"); + int count = watcher.getCreaturesCount(); + BeastToken token = new BeastToken(); + for (int i = 0; i < count; i++) { + token.putOntoBattlefield(game, source.getSourceId(), source.getControllerId()); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java new file mode 100644 index 00000000000..0747d5f2efd --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java @@ -0,0 +1,159 @@ +/* + * 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.newphyrexia; + +import java.util.UUID; +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.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class PhyrexianIngester extends CardImpl { + + public PhyrexianIngester(UUID ownerId) { + super(ownerId, 41, "Phyrexian Ingester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}"); + this.expansionSetCode = "NPH"; + this.subtype.add("Beast"); + + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Imprint - When Phyrexian Ingester enters the battlefield, you may exile target nontoken creature. + Ability ability = new EntersBattlefieldTriggeredAbility(new PhyrexianIngesterImprintEffect(), true); + FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature") { + + @Override + public boolean match(Permanent permanent) { + if (!super.match(permanent)) { + return notFilter; + } + + if (permanent instanceof PermanentToken) { + return notFilter; + } + + return !notFilter; + } + }; + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + // Phyrexian Ingester gets +X/+Y, where X is the exiled creature card's power and Y is its toughness. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianIngesterBoostEffect())); + } + + public PhyrexianIngester(final PhyrexianIngester card) { + super(card); + } + + @Override + public PhyrexianIngester copy() { + return new PhyrexianIngester(this); + } +} + +class PhyrexianIngesterImprintEffect extends OneShotEffect { + + public PhyrexianIngesterImprintEffect() { + super(Outcome.Exile); + this.staticText = "exile target nontoken creature"; + } + + public PhyrexianIngesterImprintEffect(final PhyrexianIngesterImprintEffect effect) { + super(effect); + } + + @Override + public PhyrexianIngesterImprintEffect copy() { + return new PhyrexianIngesterImprintEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent targetPermanent = game.getPermanent(source.getFirstTarget()); + if (targetPermanent != null) { + targetPermanent.moveToExile(getId(), "Phyrexian Ingester (Imprint)", source.getSourceId(), game); + sourcePermanent.imprint(targetPermanent.getId(), game); + return true; + } + return false; + } +} + +class PhyrexianIngesterBoostEffect extends ContinuousEffectImpl { + + public PhyrexianIngesterBoostEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + this.staticText = "{this} gets +X/+Y, where X is the exiled creature card's power and Y is its toughness"; + } + + public PhyrexianIngesterBoostEffect(final PhyrexianIngesterBoostEffect effect) { + super(effect); + } + + @Override + public PhyrexianIngesterBoostEffect copy() { + return new PhyrexianIngesterBoostEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && !permanent.getImprinted().isEmpty()) { + Card card = game.getCard(permanent.getImprinted().get(0)); + if (card != null) { + permanent.addPower(card.getPower().getValue()); + permanent.addToughness(card.getToughness().getValue()); + return true; + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java b/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java new file mode 100644 index 00000000000..ed9d1642fae --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.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.newphyrexia; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility; +import mage.abilities.costs.VariableCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author North + */ +public class PostmortemLunge extends CardImpl { + + public PostmortemLunge(UUID ownerId) { + super(ownerId, 70, "Postmortem Lunge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{BP}"); + this.expansionSetCode = "NPH"; + + this.color.setBlack(true); + + this.getSpellAbility().addEffect(new PostmortemLungeEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + } + + public PostmortemLunge(final PostmortemLunge card) { + super(card); + } + + @Override + public PostmortemLunge copy() { + return new PostmortemLunge(this); + } + + @Override + public void adjustCosts(Ability ability, Game game) { + Card card = game.getCard(ability.getFirstTarget()); + if (card != null) { + // insert at the beginning (so it will be {2}{B}, not {B}{2}) + ability.getManaCostsToPay().add(0, new GenericManaCost(card.getManaCost().convertedManaCost())); + } + // no {X} anymore as we already have chosen the target with defined manacost + for (ManaCost cost : ability.getManaCostsToPay()) { + if (cost instanceof VariableCost) { + cost.setPaid(); + } + } + } +} + +class PostmortemLungeEffect extends OneShotEffect { + + public PostmortemLungeEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Return target creature card with converted mana cost X from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step"; + } + + public PostmortemLungeEffect(final PostmortemLungeEffect effect) { + super(effect); + } + + @Override + public PostmortemLungeEffect copy() { + return new PostmortemLungeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getFirstTarget()); + Player player = game.getPlayer(card.getOwnerId()); + if (card != null && player != null && player.removeFromGraveyard(card, game)) { + card.addAbility(HasteAbility.getInstance()); + card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); + + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(card.getId())); + DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + + return true; + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java new file mode 100644 index 00000000000..a1be1ca2486 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java @@ -0,0 +1,97 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.filter.Filter.ComparisonScope; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.token.EldraziSpawnToken; + +/** + * + * @author North + */ +public class BroodBirthing extends CardImpl { + + public BroodBirthing(UUID ownerId) { + super(ownerId, 138, "Brood Birthing", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "ROE"; + + this.color.setRed(true); + + this.getSpellAbility().addEffect(new BroodBirthingEffect()); + } + + public BroodBirthing(final BroodBirthing card) { + super(card); + } + + @Override + public BroodBirthing copy() { + return new BroodBirthing(this); + } +} + +class BroodBirthingEffect extends OneShotEffect { + + public BroodBirthingEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "If you control an Eldrazi Spawn, put three 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool.\" Otherwise, put one of those tokens onto the battlefield"; + } + + public BroodBirthingEffect(final BroodBirthingEffect effect) { + super(effect); + } + + @Override + public BroodBirthingEffect copy() { + return new BroodBirthingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Eldrazi Spawn"); + filter.getSubtype().add("Eldrazi"); + filter.getSubtype().add("Spawn"); + filter.setScopeSubtype(ComparisonScope.All); + + EldraziSpawnToken token = new EldraziSpawnToken(); + int count = game.getBattlefield().countAll(filter, source.getControllerId()) > 0 ? 3 : 1; + for (int i = 0; i < count; i++) { + token.putOntoBattlefield(game, source.getSourceId(), source.getControllerId()); + } + return true; + } +}