From dcabc4692488b8cb638ea5aa58d55c5cb5bf129f Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 12 Sep 2015 14:24:49 +0300 Subject: [PATCH] Implement cards: Aven Farseer, Fatal Mutation, Root Elemental, and Woodcloaker --- .../src/mage/sets/scourge/AvenFarseer.java | 69 +++++++++++ .../src/mage/sets/scourge/FatalMutation.java | 115 ++++++++++++++++++ .../src/mage/sets/scourge/RootElemental.java | 68 +++++++++++ .../src/mage/sets/scourge/Woodcloaker.java | 73 +++++++++++ 4 files changed, 325 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/scourge/AvenFarseer.java create mode 100644 Mage.Sets/src/mage/sets/scourge/FatalMutation.java create mode 100644 Mage.Sets/src/mage/sets/scourge/RootElemental.java create mode 100644 Mage.Sets/src/mage/sets/scourge/Woodcloaker.java diff --git a/Mage.Sets/src/mage/sets/scourge/AvenFarseer.java b/Mage.Sets/src/mage/sets/scourge/AvenFarseer.java new file mode 100644 index 00000000000..b4c80304688 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/AvenFarseer.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.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpAllTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; + +/** + * + * @author LoneFox + */ +public class AvenFarseer extends CardImpl { + + public AvenFarseer(UUID ownerId) { + super(ownerId, 3, "Aven Farseer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever a permanent is turned face up, put a +1/+1 counter on Aven Farseer. + this.addAbility(new TurnedFaceUpAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new FilterPermanent("a permanent"))); + } + + public AvenFarseer(final AvenFarseer card) { + super(card); + } + + @Override + public AvenFarseer copy() { + return new AvenFarseer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/FatalMutation.java b/Mage.Sets/src/mage/sets/scourge/FatalMutation.java new file mode 100644 index 00000000000..65205011891 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/FatalMutation.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.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FatalMutation extends CardImpl { + + public FatalMutation(UUID ownerId) { + super(ownerId, 66, "Fatal Mutation", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted creature is turned face up, destroy it. It can't be regenerated. + this.addAbility(new FatalMutationAbility(new DestroyAttachedEffect("it", true))); + } + + public FatalMutation(final FatalMutation card) { + super(card); + } + + @Override + public FatalMutation copy() { + return new FatalMutation(this); + } +} + +class FatalMutationAbility extends TriggeredAbilityImpl { + + public FatalMutationAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + } + + public FatalMutationAbility(final FatalMutationAbility ability) { + super(ability); + } + + @Override + public FatalMutationAbility copy() { + return new FatalMutationAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TURNEDFACEUP; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent attachment = game.getPermanent(this.getSourceId()); + if(attachment != null && event.getTargetId().equals(attachment.getAttachedTo())) { + return true; + } + return false; + + } + + @Override + public String getRule() { + return "Whenever enchanted creature is turned face up, " + super.getRule(); + } + +} + diff --git a/Mage.Sets/src/mage/sets/scourge/RootElemental.java b/Mage.Sets/src/mage/sets/scourge/RootElemental.java new file mode 100644 index 00000000000..46d93c2732c --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/RootElemental.java @@ -0,0 +1,68 @@ +/* + * 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.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; + +/** + * + * @author LoneFox + */ +public class RootElemental extends CardImpl { + + public RootElemental(UUID ownerId) { + super(ownerId, 127, "Root Elemental", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Elemental"); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Morph {5}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{5}{G}{G}"))); + // When Root Elemental is turned face up, you may put a creature card from your hand onto the battlefield. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new PutPermanentOnBattlefieldEffect(new FilterCreatureCard("a creature card")))); + } + + public RootElemental(final RootElemental card) { + super(card); + } + + @Override + public RootElemental copy() { + return new RootElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/Woodcloaker.java b/Mage.Sets/src/mage/sets/scourge/Woodcloaker.java new file mode 100644 index 00000000000..0fc2a523f84 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/Woodcloaker.java @@ -0,0 +1,73 @@ +/* + * 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.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; + +/** + * + * @author LoneFox + */ +public class Woodcloaker extends CardImpl { + + public Woodcloaker(UUID ownerId) { + super(ownerId, 134, "Woodcloaker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Elf"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Morph {2}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{G}{G}"))); + // When Woodcloaker is turned face up, target creature gains trample until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Woodcloaker(final Woodcloaker card) { + super(card); + } + + @Override + public Woodcloaker copy() { + return new Woodcloaker(this); + } +}