From cc313eb0de28b1d08f017065d5e220bfaa689dce Mon Sep 17 00:00:00 2001 From: North Date: Mon, 16 May 2011 08:20:22 +0300 Subject: [PATCH] Card added: Fangren Marauder --- .../mirrodinbesieged/FangrenMarauder.java | 64 ++++++++++++++++ .../sets/scarsofmirrodin/MolderBeast.java | 42 +---------- ...oGraveFromBattlefieldTriggeredAbility.java | 75 +++++++++++++++++++ 3 files changed, 143 insertions(+), 38 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java create mode 100644 Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java new file mode 100644 index 0000000000..8596e4a588 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java @@ -0,0 +1,64 @@ +/* + * 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.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.ArtifactIntoGraveFromBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class FangrenMarauder extends CardImpl { + + public FangrenMarauder(UUID ownerId) { + super(ownerId, 79, "Fangren Marauder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Beast"); + + this.color.setGreen(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + this.addAbility(new ArtifactIntoGraveFromBattlefieldTriggeredAbility(new GainLifeEffect(5), true)); + } + + public FangrenMarauder(final FangrenMarauder card) { + super(card); + } + + @Override + public FangrenMarauder copy() { + return new FangrenMarauder(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java index bb6110fc94..b38e85315b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java @@ -34,14 +34,9 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.ArtifactIntoGraveFromBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.BoostSourceEffect; -import mage.cards.Card; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.ZoneChangeEvent; -import mage.game.permanent.Permanent; /** * @@ -53,10 +48,12 @@ public class MolderBeast extends CardImpl { super(ownerId, 125, "Molder Beast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Beast"); + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(3); - this.addAbility(new MolderBeastTriggeredAbility()); + + this.addAbility(new ArtifactIntoGraveFromBattlefieldTriggeredAbility(new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn), false)); } public MolderBeast (final MolderBeast card) { @@ -68,35 +65,4 @@ public class MolderBeast extends CardImpl { return new MolderBeast(this); } -} - -class MolderBeastTriggeredAbility extends TriggeredAbilityImpl { - MolderBeastTriggeredAbility() { - super(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn)); - } - - MolderBeastTriggeredAbility(final MolderBeastTriggeredAbility ability) { - super(ability); - } - - @Override - public MolderBeastTriggeredAbility copy() { - return new MolderBeastTriggeredAbility(this); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getFromZone() == Constants.Zone.BATTLEFIELD && zEvent.getToZone() == Constants.Zone.GRAVEYARD && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)) { - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever an artifact is put into a graveyard from the battlefield, Molder Beast gets +2/+0 until end of turn."; - } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java new file mode 100644 index 0000000000..ba82533510 --- /dev/null +++ b/Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java @@ -0,0 +1,75 @@ +/* + * 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.abilities.common; + +import mage.Constants; +import mage.Constants.Zone; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; + +/** + * + * @author North + */ +public class ArtifactIntoGraveFromBattlefieldTriggeredAbility extends TriggeredAbilityImpl { + + public ArtifactIntoGraveFromBattlefieldTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public ArtifactIntoGraveFromBattlefieldTriggeredAbility(final ArtifactIntoGraveFromBattlefieldTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTarget().getCardType().contains(Constants.CardType.ARTIFACT)) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever an artifact is put into a graveyard from the battlefield, " + super.getRule(); + } + + @Override + public ArtifactIntoGraveFromBattlefieldTriggeredAbility copy() { + return new ArtifactIntoGraveFromBattlefieldTriggeredAbility(this); + } +} \ No newline at end of file