From dbedca4eb82fdfa79c1dd746720e1c7fd6f8979f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 13 Sep 2013 08:37:49 +0200 Subject: [PATCH] [THS] Added Reaper of the Wilds and Spellheard Chimera. --- .../src/mage/sets/magic2010/MoldAdder.java | 5 +- .../mage/sets/theros/ReaperOfTheWilds.java | 78 +++++++++++ .../mage/sets/theros/SpellheartChimera.java | 122 ++++++++++++++++++ .../SetPowerToughnessSourceEffect.java | 6 +- Mage/src/mage/util/CardUtil.java | 4 +- 5 files changed, 209 insertions(+), 6 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/theros/ReaperOfTheWilds.java create mode 100644 Mage.Sets/src/mage/sets/theros/SpellheartChimera.java diff --git a/Mage.Sets/src/mage/sets/magic2010/MoldAdder.java b/Mage.Sets/src/mage/sets/magic2010/MoldAdder.java index 5ceadadd07..a88c4d8405 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MoldAdder.java +++ b/Mage.Sets/src/mage/sets/magic2010/MoldAdder.java @@ -28,13 +28,13 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SpellCastOpponentTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; @@ -47,7 +47,6 @@ import mage.filter.predicate.mageobject.ColorPredicate; public class MoldAdder extends CardImpl { private static final FilterSpell filter = new FilterSpell("blue or black spell"); - static { filter.add(Predicates.or( new ColorPredicate(ObjectColor.BLUE), diff --git a/Mage.Sets/src/mage/sets/theros/ReaperOfTheWilds.java b/Mage.Sets/src/mage/sets/theros/ReaperOfTheWilds.java new file mode 100644 index 0000000000..7fed2773cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/theros/ReaperOfTheWilds.java @@ -0,0 +1,78 @@ +/* + * 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.theros; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ScryEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class ReaperOfTheWilds extends CardImpl { + + public ReaperOfTheWilds(UUID ownerId) { + super(ownerId, 201, "Reaper of the Wilds", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + this.expansionSetCode = "THS"; + this.subtype.add("Gorgon"); + + this.color.setGreen(true); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Whenever another creature dies, scry 1. + this.addAbility(new DiesCreatureTriggeredAbility(new ScryEffect(1), false, true)); + // {B}: Reaper of the Wilds gains deathtouch until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + // {1}{G}: Reaper of the Wilds gains hexproof until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}{G}"))); + } + + public ReaperOfTheWilds(final ReaperOfTheWilds card) { + super(card); + } + + @Override + public ReaperOfTheWilds copy() { + return new ReaperOfTheWilds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/SpellheartChimera.java b/Mage.Sets/src/mage/sets/theros/SpellheartChimera.java new file mode 100644 index 0000000000..b649a58a36 --- /dev/null +++ b/Mage.Sets/src/mage/sets/theros/SpellheartChimera.java @@ -0,0 +1,122 @@ +/* + * 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.theros; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SpellheartChimera extends CardImpl { + + public SpellheartChimera(UUID ownerId) { + super(ownerId, 204, "Spellheart Chimera", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{R}"); + this.expansionSetCode = "THS"; + this.subtype.add("Chimera"); + + this.color.setRed(true); + this.color.setBlue(true); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Spellheart Chimera's power is equal to the number of instant and sorcery cards in your graveyard. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellheartChimeraEffect())); + } + + public SpellheartChimera(final SpellheartChimera card) { + super(card); + } + + @Override + public SpellheartChimera copy() { + return new SpellheartChimera(this); + } +} + +class SpellheartChimeraEffect extends ContinuousEffectImpl { + + private static final FilterCard filter = new FilterInstantOrSorceryCard(); + + public SpellheartChimeraEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + staticText = "{this}'s power is equal to the number of instant and sorcery cards in your graveyard"; + } + + + public SpellheartChimeraEffect(final SpellheartChimeraEffect effect) { + super(effect); + } + + @Override + public SpellheartChimeraEffect copy() { + return new SpellheartChimeraEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getSourceId()); + if (target != null) { + int number = 0; + + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + number = player.getGraveyard().count(filter, game); + } + + target.getPower().setValue(number); + return true; + + } + return false; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java index 2bd3d30f74..1a39120d70 100644 --- a/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java @@ -84,10 +84,12 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl