From f01692f80405ac38f6ff176f525a249c88891f2b Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 14 Feb 2014 17:19:26 -0600 Subject: [PATCH] - Added some requested cards. --- .../sets/commander/SzadekLordOfSecrets.java | 141 ++++++++++++++++++ .../dissension/MomirVigSimicVisionary.java | 95 ++++++++++++ .../mage/sets/eventide/CankerAbomination.java | 115 ++++++++++++++ .../mage/sets/lorwyn/DauntlessDourbark.java | 96 ++++++++++++ .../mage/sets/lorwyn/NathOfTheGiltLeaf.java | 86 +++++++++++ .../sets/ravnika/SzadekLordOfSecrets.java | 53 +++++++ ...DiscardsACardOpponentTriggeredAbility.java | 45 ++++++ 7 files changed, 631 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/SzadekLordOfSecrets.java create mode 100644 Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java create mode 100644 Mage.Sets/src/mage/sets/eventide/CankerAbomination.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/DauntlessDourbark.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/NathOfTheGiltLeaf.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/SzadekLordOfSecrets.java create mode 100644 Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java diff --git a/Mage.Sets/src/mage/sets/commander/SzadekLordOfSecrets.java b/Mage.Sets/src/mage/sets/commander/SzadekLordOfSecrets.java new file mode 100644 index 0000000000..f790b200dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/SzadekLordOfSecrets.java @@ -0,0 +1,141 @@ +/* + * 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.commander; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.DamagePlayerEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + * + */ +public class SzadekLordOfSecrets extends CardImpl { + + public SzadekLordOfSecrets(UUID ownerId) { + super(ownerId, 228, "Szadek, Lord of Secrets", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}{B}{B}"); + this.expansionSetCode = "CMD"; + this.supertype.add("Legendary"); + this.subtype.add("Vampire"); + + this.color.setBlue(true); + this.color.setBlack(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // If Szadek, Lord of Secrets would deal combat damage to a player, instead put that many +1/+1 counters on Szadek and that player puts that many cards from the top of his or her library into his or her graveyard. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SzadekLordOfSecretsEffect())); + + } + + public SzadekLordOfSecrets(final SzadekLordOfSecrets card) { + super(card); + } + + @Override + public SzadekLordOfSecrets copy() { + return new SzadekLordOfSecrets(this); + } +} + +class SzadekLordOfSecretsEffect extends ReplacementEffectImpl { + + List cards; + + SzadekLordOfSecretsEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If {this} would deal combat damage to a player, instead put that many +1/+1 counters on Szadek and that player puts that many cards from the top of his or her library into his or her graveyard"; + } + + SzadekLordOfSecretsEffect(final SzadekLordOfSecretsEffect effect) { + super(effect); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + DamagePlayerEvent damageEvent = (DamagePlayerEvent) event; + Player damagedPlayer = game.getPlayer(damageEvent.getTargetId()); + + if (damageEvent.isCombatDamage()) { + Permanent p = game.getPermanent(source.getSourceId()); + if (p != null) { + p.addCounters(CounterType.P1P1.createInstance(damageEvent.getAmount()), game); + if (damagedPlayer != null) { + cards = damagedPlayer.getLibrary().getTopCards(game, damageEvent.getAmount()); + } + for (Card card : cards) { + card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false); + } + } + } + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER + && event.getSourceId().equals(source.getSourceId())) { + DamagePlayerEvent damageEvent = (DamagePlayerEvent) event; + if (damageEvent.isCombatDamage()) { + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public SzadekLordOfSecretsEffect copy() { + return new SzadekLordOfSecretsEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java new file mode 100644 index 0000000000..ba45b81a51 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java @@ -0,0 +1,95 @@ +/* + * 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.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author jeffwadsworth + * + */ +public class MomirVigSimicVisionary extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a green creature spell"); + private static final FilterSpell filter2 = new FilterSpell("a blue creature spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter2.add(new ColorPredicate(ObjectColor.BLUE)); + filter2.add(new CardTypePredicate(CardType.CREATURE)); + } + + public MomirVigSimicVisionary(UUID ownerId) { + super(ownerId, 118, "Momir Vig, Simic Visionary", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{U}"); + this.expansionSetCode = "DIS"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you cast a green creature spell, you may search your library for a creature card and reveal it. If you do, shuffle your library and put that card on top of it. + Effect effect = new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(), true, true); + effect.setText("you may search your library for a creature card and reveal it. If you do, shuffle your library and put that card on top of it"); + this.addAbility(new SpellCastAllTriggeredAbility(effect, filter, true)); + + // Whenever you cast a blue creature spell, reveal the top card of your library. If it's a creature card, put that card into your hand. + Effect effect2 = new RevealLibraryPutIntoHandEffect(1, new FilterCreatureCard(), false); + effect2.setText("reveal the top card of your library. If it's a creature card, put that card into your hand"); + this.addAbility(new SpellCastAllTriggeredAbility(effect2, filter2, false)); + + } + + public MomirVigSimicVisionary(final MomirVigSimicVisionary card) { + super(card); + } + + @Override + public MomirVigSimicVisionary copy() { + return new MomirVigSimicVisionary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java b/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java new file mode 100644 index 0000000000..f249c1916c --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java @@ -0,0 +1,115 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetOpponent; + +/** + * + * @author jeffwadsworth + * + */ +public class CankerAbomination extends CardImpl { + + public CankerAbomination(UUID ownerId) { + super(ownerId, 115, "Canker Abomination", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B/G}{B/G}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Treefolk"); + this.subtype.add("Horror"); + + this.color.setGreen(true); + this.color.setBlack(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // As Canker Abomination enters the battlefield, choose an opponent. Canker Abomination enters the battlefield with a -1/-1 counter on it for each creature that player controls. + Ability ability = new AsEntersBattlefieldAbility(new CankerAbominationEffect()); + Target target = new TargetOpponent(true); + target.setNotTarget(true); + ability.addTarget(target); + this.addAbility(ability); + + } + + public CankerAbomination(final CankerAbomination card) { + super(card); + } + + @Override + public CankerAbomination copy() { + return new CankerAbomination(this); + } +} + +class CankerAbominationEffect extends OneShotEffect { + + public CankerAbominationEffect() { + super(Outcome.Neutral); + this.staticText = "choose an opponent. {this} enters the battlefield with a -1/-1 counter on it for each creature that player controls"; + } + + public CankerAbominationEffect(final CankerAbominationEffect effect) { + super(effect); + } + + @Override + public CankerAbominationEffect copy() { + return new CankerAbominationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent CankerAbomination = game.getPermanent(source.getSourceId()); + if (player != null && CankerAbomination != null) { + Player chosenPlayer = game.getPlayer(source.getFirstTarget()); + if (chosenPlayer != null) { + game.informPlayers(CankerAbomination.getName() + ": " + player.getName() + " has chosen " + chosenPlayer.getName()); + int amount = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), chosenPlayer.getId(), game).size(); + CankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/DauntlessDourbark.java b/Mage.Sets/src/mage/sets/lorwyn/DauntlessDourbark.java new file mode 100644 index 0000000000..1144b9bb26 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/DauntlessDourbark.java @@ -0,0 +1,96 @@ +/* + * 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.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.ControlsPermanentCondition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author jeffwadsworth + * + */ +public class DauntlessDourbark extends CardImpl { + + final static private FilterControlledPermanent filter = new FilterControlledPermanent("Forests you control plus the number of Treefolk you control"); + final static private FilterControlledPermanent filter2 = new FilterControlledPermanent(); + + static { + filter.add(Predicates.or(new SubtypePredicate("Forest"), + new SubtypePredicate("Treefolk"))); + filter2.add(new SubtypePredicate("Treefolk")); + filter2.add(new AnotherPredicate()); + } + + final static private String rule = "{this} has trample as long as you control another Treefolk"; + + public DauntlessDourbark(UUID ownerId) { + super(ownerId, 203, "Dauntless Dourbark", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Treefolk"); + this.subtype.add("Warrior"); + + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control. + DynamicValue amount = new PermanentsOnBattlefieldCount(filter); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(amount, Duration.WhileOnBattlefield))); + + // Dauntless Dourbark has trample as long as you control another Treefolk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), new ControlsPermanentCondition(filter2), rule))); + + } + + public DauntlessDourbark(final DauntlessDourbark card) { + super(card); + } + + @Override + public DauntlessDourbark copy() { + return new DauntlessDourbark(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/NathOfTheGiltLeaf.java b/Mage.Sets/src/mage/sets/lorwyn/NathOfTheGiltLeaf.java new file mode 100644 index 0000000000..b5f2ffd2a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/NathOfTheGiltLeaf.java @@ -0,0 +1,86 @@ +/* + * 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.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.DiscardsACardOpponentTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.permanent.token.ElfToken; +import mage.target.common.TargetOpponent; + +/** + * + * @author jeffwadsworth + * + */ +public class NathOfTheGiltLeaf extends CardImpl { + + public NathOfTheGiltLeaf(UUID ownerId) { + super(ownerId, 250, "Nath of the Gilt-Leaf", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + this.expansionSetCode = "LRW"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + + this.color.setGreen(true); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, you may have target opponent discard a card at random. + Effect effect = new DiscardTargetEffect(1, true); + effect.setText("you may have target opponent discard a card at random"); + Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, true); + ability.addTarget(new TargetOpponent(true)); + this.addAbility(ability); + + // Whenever an opponent discards a card, you may put a 1/1 green Elf Warrior creature token onto the battlefield. + Effect effect2 = new CreateTokenEffect(new ElfToken()); + effect2.setText("you may put a 1/1 green Elf Warrior creature token onto the battlefield"); + this.addAbility(new DiscardsACardOpponentTriggeredAbility(effect2, true)); + + } + + public NathOfTheGiltLeaf(final NathOfTheGiltLeaf card) { + super(card); + } + + @Override + public NathOfTheGiltLeaf copy() { + return new NathOfTheGiltLeaf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/SzadekLordOfSecrets.java b/Mage.Sets/src/mage/sets/ravnika/SzadekLordOfSecrets.java new file mode 100644 index 0000000000..396a559780 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/SzadekLordOfSecrets.java @@ -0,0 +1,53 @@ +/* + * 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.ravnika; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + + */ +public class SzadekLordOfSecrets extends mage.sets.commander.SzadekLordOfSecrets { + + public SzadekLordOfSecrets(UUID ownerId) { + super(ownerId); + this.cardNumber = 234; + this.expansionSetCode = "RAV"; + } + + public SzadekLordOfSecrets(final SzadekLordOfSecrets card) { + super(card); + } + + @Override + public SzadekLordOfSecrets copy() { + return new SzadekLordOfSecrets(this); + } +} diff --git a/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java b/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java new file mode 100644 index 0000000000..0ea342eaec --- /dev/null +++ b/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author jeffwadsworth + */ +public class DiscardsACardOpponentTriggeredAbility extends TriggeredAbilityImpl { + + public DiscardsACardOpponentTriggeredAbility(Effect effect, Boolean isOptional) { + super(Zone.BATTLEFIELD, effect, isOptional); + } + + public DiscardsACardOpponentTriggeredAbility(final DiscardsACardOpponentTriggeredAbility ability) { + super(ability); + } + + @Override + public DiscardsACardOpponentTriggeredAbility copy() { + return new DiscardsACardOpponentTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever an opponent discards a card, " + super.getRule(); + } +}