From 5d6a6117bf1b362a6c541812df782392d54f6f9d Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Thu, 8 Mar 2012 22:49:59 -0500 Subject: [PATCH] 2 DKA --- .../mage/sets/darkascension/PredatorOoze.java | 74 +++++++++++++++++++ .../sets/darkascension/SecretsOfTheDead.java | 71 ++++++++++++++++++ .../mage/test/cards/TestSecretsOfTheDead.java | 44 +++++++++++ 3 files changed, 189 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java create mode 100644 Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/TestSecretsOfTheDead.java diff --git a/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java b/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java new file mode 100644 index 00000000000..f96cbb6574f --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/PredatorOoze.java @@ -0,0 +1,74 @@ +/* + * 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.darkascension; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.counters.CounterType; + +/** + * + * @author BetaSteward + */ +public class PredatorOoze extends CardImpl { + + public PredatorOoze(UUID ownerId) { + super(ownerId, 124, "Predator Ooze", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}{G}{G}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Ooze"); + + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Predator Ooze is indestructible. + this.addAbility(IndestructibleAbility.getInstance()); + + // Whenever Predator Ooze attacks, put a +1/+1 counter on it. + this.addAbility(new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); + + // Whenever a creature dealt damage by Predator Ooze this turn dies, put a +1/+1 counter on Predator Ooze. + this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()))); + } + + public PredatorOoze(final PredatorOoze card) { + super(card); + } + + @Override + public PredatorOoze copy() { + return new PredatorOoze(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java b/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java new file mode 100644 index 00000000000..51c450b1c82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darkascension/SecretsOfTheDead.java @@ -0,0 +1,71 @@ +/* + * 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.darkascension; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.filter.FilterSpell; + +/** + * + * @author BetaSteward + */ +public class SecretsOfTheDead extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("a spell from your graveyard"); + + static { + filter.setFromZone(Constants.Zone.GRAVEYARD); + } + + public SecretsOfTheDead(UUID ownerId) { + super(ownerId, 48, "Secrets of the Dead", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "DKA"; + + this.color.setBlue(true); + + // Whenever you cast a spell from your graveyard, draw a card. + this.addAbility(new SpellCastTriggeredAbility(new DrawCardControllerEffect(1), filter, false)); + } + + public SecretsOfTheDead(final SecretsOfTheDead card) { + super(card); + } + + @Override + public SecretsOfTheDead copy() { + return new SecretsOfTheDead(this); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/TestSecretsOfTheDead.java b/Mage.Tests/src/test/java/org/mage/test/cards/TestSecretsOfTheDead.java new file mode 100644 index 00000000000..ee409a93d8b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/TestSecretsOfTheDead.java @@ -0,0 +1,44 @@ +package org.mage.test.cards; + +import mage.Constants; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author BetaSteward + */ +public class TestSecretsOfTheDead extends CardTestPlayerBase { + + @Test + public void testCard() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Secrets of the Dead"); + addCard(Constants.Zone.GRAVEYARD, playerA, "Lingering Souls"); + + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}"); + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + assertPermanentCount(playerA, "Spirit", 2); + assertHandCount(playerA, 1); + } + + @Test + public void testCard1() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Constants.Zone.GRAVEYARD, playerA, "Lingering Souls"); + + activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}"); + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + assertPermanentCount(playerA, "Spirit", 2); + assertHandCount(playerA, 0); + } + +}