From aa67d4fb7966ecd8504c6b957c63c41948700f11 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 17 Jan 2015 18:57:48 -0600 Subject: [PATCH] - Added Din of the Fireherd, Grief Tyrant, and Kulrath Knight. --- .../sets/shadowmoor/DinOfTheFireherd.java | 134 ++++++++++++++++++ .../src/mage/sets/shadowmoor/GriefTyrant.java | 106 ++++++++++++++ .../mage/sets/shadowmoor/KulrathKnight.java | 121 ++++++++++++++++ 3 files changed, 361 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/shadowmoor/DinOfTheFireherd.java create mode 100644 Mage.Sets/src/mage/sets/shadowmoor/GriefTyrant.java create mode 100644 Mage.Sets/src/mage/sets/shadowmoor/KulrathKnight.java diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DinOfTheFireherd.java b/Mage.Sets/src/mage/sets/shadowmoor/DinOfTheFireherd.java new file mode 100644 index 00000000000..b2087ddf0d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/DinOfTheFireherd.java @@ -0,0 +1,134 @@ +/* + * 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.shadowmoor; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class DinOfTheFireherd extends CardImpl { + + public DinOfTheFireherd(UUID ownerId) { + super(ownerId, 184, "Din of the Fireherd", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{B/R}{B/R}{B/R}"); + this.expansionSetCode = "SHM"; + + // Put a 5/5 black and red Elemental creature token onto the battlefield. Target opponent sacrifices a creature for each black creature you control, then sacrifices a land for each red creature you control. + this.getSpellAbility().addEffect(new DinOfTheFireherdEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + + } + + public DinOfTheFireherd(final DinOfTheFireherd card) { + super(card); + } + + @Override + public DinOfTheFireherd copy() { + return new DinOfTheFireherd(this); + } +} + +class DinOfTheFireherdEffect extends OneShotEffect { + + private final static FilterControlledCreaturePermanent blackCreatureFilter = new FilterControlledCreaturePermanent("black creatures you control"); + private final static FilterControlledCreaturePermanent redCreatureFilter = new FilterControlledCreaturePermanent("red creatures you control"); + + static { + blackCreatureFilter.add(new ColorPredicate(ObjectColor.BLACK)); + redCreatureFilter.add(new ColorPredicate(ObjectColor.RED)); + } + + public DinOfTheFireherdEffect() { + super(Outcome.Neutral); + this.staticText = "Put a 5/5 black and red Elemental creature token onto the battlefield. Target opponent sacrifices a creature for each black creature you control, then sacrifices a land for each red creature you control"; + } + + public DinOfTheFireherdEffect(final DinOfTheFireherdEffect effect) { + super(effect); + } + + @Override + public DinOfTheFireherdEffect copy() { + return new DinOfTheFireherdEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean applied = false; + int blackCreaturesControllerControls = game.getBattlefield().countAll(blackCreatureFilter, source.getControllerId(), game); + int redCreaturesControllerControls = game.getBattlefield().countAll(redCreatureFilter, source.getControllerId(), game); + + Token token = new DinOfTheFireherdToken(); + applied = token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + + Player targetOpponent = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetOpponent != null) { + Effect effect = new SacrificeEffect(new FilterControlledCreaturePermanent(), blackCreaturesControllerControls, "Target Opponent"); + effect.setTargetPointer(new FixedTarget(targetOpponent.getId())); + effect.apply(game, source); + + Effect effect2 = new SacrificeEffect(new FilterControlledLandPermanent(), redCreaturesControllerControls, "Target Opponent"); + effect.setTargetPointer(new FixedTarget(targetOpponent.getId())); + effect2.apply(game, source); + applied = true; + } + return applied; + } +} + +class DinOfTheFireherdToken extends Token { + public DinOfTheFireherdToken() { + super("", "5/5 black and red Elemental creature"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setBlack(true); + color.setRed(true); + power = new MageInt(5); + toughness = new MageInt(5); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GriefTyrant.java b/Mage.Sets/src/mage/sets/shadowmoor/GriefTyrant.java new file mode 100644 index 00000000000..8dd07ee046e --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/GriefTyrant.java @@ -0,0 +1,106 @@ +/* + * 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.shadowmoor; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class GriefTyrant extends CardImpl { + + public GriefTyrant(UUID ownerId) { + super(ownerId, 189, "Grief Tyrant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{B/R}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Horror"); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // Grief Tyrant enters the battlefield with four -1/-1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)))); + + // When Grief Tyrant dies, put a -1/-1 counter on target creature for each -1/-1 counter on Grief Tyrant. + Ability ability = new DiesTriggeredAbility(new GriefTyrantEffect()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public GriefTyrant(final GriefTyrant card) { + super(card); + } + + @Override + public GriefTyrant copy() { + return new GriefTyrant(this); + } +} + +class GriefTyrantEffect extends OneShotEffect { + + public GriefTyrantEffect() { + super(Outcome.Neutral); + this.staticText = "put a -1/-1 counter on target creature for each -1/-1 counter on {this}"; + } + + public GriefTyrantEffect(final GriefTyrantEffect effect) { + super(effect); + } + + @Override + public GriefTyrantEffect copy() { + return new GriefTyrantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source)); + Permanent griefTyrant = game.getPermanentOrLKIBattlefield(source.getSourceId()); + int countersOnGriefTyrant = griefTyrant.getCounters().getCount(CounterType.M1M1); + if (targetCreature != null) { + targetCreature.addCounters(CounterType.M1M1.createInstance(countersOnGriefTyrant), game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/KulrathKnight.java b/Mage.Sets/src/mage/sets/shadowmoor/KulrathKnight.java new file mode 100644 index 00000000000..b64a82666e0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/KulrathKnight.java @@ -0,0 +1,121 @@ +/* + * 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.shadowmoor; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.WitherAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.CounterAnyPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class KulrathKnight extends CardImpl { + + public KulrathKnight(UUID ownerId) { + super(ownerId, 190, "Kulrath Knight", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B/R}{B/R}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Elemental"); + this.subtype.add("Knight"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Wither + this.addAbility(WitherAbility.getInstance()); + + // Creatures your opponents control with counters on them can't attack or block. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KulrathKnightRestrictionEffect())); + + } + + public KulrathKnight(final KulrathKnight card) { + super(card); + } + + @Override + public KulrathKnight copy() { + return new KulrathKnight(this); + } +} + +class KulrathKnightRestrictionEffect extends RestrictionEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control with counters on them"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + filter.add(new CounterAnyPredicate()); + } + + public KulrathKnightRestrictionEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Creatures your opponents control with counters on them can't attack or block."; + } + + public KulrathKnightRestrictionEffect(final KulrathKnightRestrictionEffect effect) { + super(effect); + } + + @Override + public KulrathKnightRestrictionEffect copy() { + return new KulrathKnightRestrictionEffect(this); + } + + @Override + public boolean canAttack(Game game) { + return false; + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + } +}