From b4defa21aa7f6b0cabf768700ac2fa73cde6a0df Mon Sep 17 00:00:00 2001 From: Loki Date: Wed, 3 Aug 2011 22:54:43 +0300 Subject: [PATCH] 2 NPH --- .../mage/sets/newphyrexia/FurnaceScamp.java | 69 ++++++++++++++++++ .../mage/sets/newphyrexia/ImpalerShrike.java | 71 +++++++++++++++++++ .../effects/common/DamageTargetEffect.java | 18 ++++- 3 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/FurnaceScamp.java create mode 100644 Mage.Sets/src/mage/sets/newphyrexia/ImpalerShrike.java diff --git a/Mage.Sets/src/mage/sets/newphyrexia/FurnaceScamp.java b/Mage.Sets/src/mage/sets/newphyrexia/FurnaceScamp.java new file mode 100644 index 0000000000..c07909027b --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/FurnaceScamp.java @@ -0,0 +1,69 @@ +/* + * 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 mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; + +import java.util.UUID; + +/** + * + * @author Loki + */ +public class FurnaceScamp extends CardImpl { + + public FurnaceScamp(UUID ownerId) { + super(ownerId, 84, "Furnace Scamp", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "NPH"; + this.subtype.add("Beast"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeSourceEffect(), true, true); + ability.addEffect(new DamageTargetEffect(3, true, "that player")); + this.addAbility(ability); + } + + public FurnaceScamp(final FurnaceScamp card) { + super(card); + } + + @Override + public FurnaceScamp copy() { + return new FurnaceScamp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ImpalerShrike.java b/Mage.Sets/src/mage/sets/newphyrexia/ImpalerShrike.java new file mode 100644 index 0000000000..50200b1580 --- /dev/null +++ b/Mage.Sets/src/mage/sets/newphyrexia/ImpalerShrike.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.newphyrexia; + +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; + +import java.util.UUID; + +/** + * + * @author Loki + */ +public class ImpalerShrike extends CardImpl { + + public ImpalerShrike(UUID ownerId) { + super(ownerId, 36, "Impaler Shrike", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "NPH"; + this.subtype.add("Bird"); + + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeSourceEffect(), true); + ability.addEffect(new DrawCardControllerEffect(3)); + this.addAbility(ability); + } + + public ImpalerShrike(final ImpalerShrike card) { + super(card); + } + + @Override + public ImpalerShrike copy() { + return new ImpalerShrike(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java index e871c1552b..4cef65523c 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java @@ -47,6 +47,7 @@ public class DamageTargetEffect extends OneShotEffect { protected DynamicValue amount; protected boolean preventable; + protected String targetDescription; public DamageTargetEffect(int amount) { this(new StaticValue(amount), true); @@ -56,14 +57,23 @@ public class DamageTargetEffect extends OneShotEffect { this(new StaticValue(amount), preventable); } + public DamageTargetEffect(int amount, boolean preventable, String targetDescription) { + this(new StaticValue(amount), preventable, targetDescription); + } + public DamageTargetEffect(DynamicValue amount) { this(amount, true); } public DamageTargetEffect(DynamicValue amount, boolean preventable) { + this(amount, preventable, ""); + } + + public DamageTargetEffect(DynamicValue amount, boolean preventable, String targetDescription) { super(Outcome.Damage); this.amount = amount; this.preventable = preventable; + this.targetDescription = targetDescription; } public int getAmount() { @@ -78,6 +88,7 @@ public class DamageTargetEffect extends OneShotEffect { super(effect); this.amount = effect.amount.clone(); this.preventable = effect.preventable; + this.targetDescription = effect.targetDescription; } @Override @@ -108,8 +119,11 @@ public class DamageTargetEffect extends OneShotEffect { if (message.isEmpty() || !message.equals("1")) { sb.append(amount); } - sb.append(" damage to target "); - sb.append(mode.getTargets().get(0).getTargetName()); + sb.append(" damage to "); + if (targetDescription.length() > 0) + sb.append(targetDescription); + else + sb.append("target ").append(mode.getTargets().get(0).getTargetName()); if (message.length() > 0) { sb.append(message.equals("1") ? " equal to the number of " : " for each "); sb.append(message);