From f277d6c55f20d59fb48b47f5ee4a3af90961b7fb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 30 Dec 2013 23:05:54 +0100 Subject: [PATCH] Added Avatar of Fury, Ruination and From the Ashes. --- .../mage/sets/commander/DeathByDragons.java | 117 +++++++++++++ .../src/mage/sets/commander/Ruination.java | 52 ++++++ .../mage/sets/commander2013/FromTheAshes.java | 2 +- .../src/mage/sets/prophecy/AvatarOfFury.java | 164 ++++++++++++++++++ .../src/mage/sets/stronghold/Ruination.java | 70 ++++++++ 5 files changed, 404 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/commander/DeathByDragons.java create mode 100644 Mage.Sets/src/mage/sets/commander/Ruination.java create mode 100644 Mage.Sets/src/mage/sets/prophecy/AvatarOfFury.java create mode 100644 Mage.Sets/src/mage/sets/stronghold/Ruination.java diff --git a/Mage.Sets/src/mage/sets/commander/DeathByDragons.java b/Mage.Sets/src/mage/sets/commander/DeathByDragons.java new file mode 100644 index 0000000000..1d9629ba69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/DeathByDragons.java @@ -0,0 +1,117 @@ +/* + * 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.commander; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class DeathByDragons extends CardImpl { + + public DeathByDragons(UUID ownerId) { + super(ownerId, 118, "Death by Dragons", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{R}"); + this.expansionSetCode = "CMD"; + + this.color.setRed(true); + + // Each player other than target player puts a 5/5 red Dragon creature token with flying onto the battlefield. + this.getSpellAbility().addEffect(new DeathByDragonsEffect()); + this.getSpellAbility().addTarget(new TargetPlayer(true)); + } + + public DeathByDragons(final DeathByDragons card) { + super(card); + } + + @Override + public DeathByDragons copy() { + return new DeathByDragons(this); + } +} + +class DeathByDragonsEffect extends OneShotEffect { + + public DeathByDragonsEffect() { + super(Outcome.Detriment); + this.staticText = "Each player other than target player puts a 5/5 red Dragon creature token with flying onto the battlefield"; + } + + public DeathByDragonsEffect(final DeathByDragonsEffect effect) { + super(effect); + } + + @Override + public DeathByDragonsEffect copy() { + return new DeathByDragonsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) { + Token token = new DragonToken(); + token.putOntoBattlefield(1, game, source.getSourceId(), playerId); + } + } + return true; + } + return false; + } +} + +class DragonToken extends Token { + + public DragonToken() { + super("Dragon", "5/5 red Dragon creature token with flying"); + cardType.add(CardType.CREATURE); + color = ObjectColor.RED; + subtype.add("Dragon"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + // set a set with correct token image + this.setOriginalExpansionSetCode("WWK"); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/Ruination.java b/Mage.Sets/src/mage/sets/commander/Ruination.java new file mode 100644 index 0000000000..e284cb0c4f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/Ruination.java @@ -0,0 +1,52 @@ +/* + * 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.commander; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Ruination extends mage.sets.stronghold.Ruination { + + public Ruination(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "CMD"; + } + + public Ruination(final Ruination card) { + super(card); + } + + @Override + public Ruination copy() { + return new Ruination(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/FromTheAshes.java b/Mage.Sets/src/mage/sets/commander2013/FromTheAshes.java index 4d095dcc36..9456839056 100644 --- a/Mage.Sets/src/mage/sets/commander2013/FromTheAshes.java +++ b/Mage.Sets/src/mage/sets/commander2013/FromTheAshes.java @@ -77,7 +77,7 @@ public class FromTheAshes extends CardImpl { class FromTheAshesEffect extends OneShotEffect { - private static final FilterLandPermanent filter = new FilterLandPermanent("creature an opponent controls"); + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic lands"); static { filter.add(new CardTypePredicate(CardType.LAND)); filter.add(Predicates.not(new SupertypePredicate("Basic"))); diff --git a/Mage.Sets/src/mage/sets/prophecy/AvatarOfFury.java b/Mage.Sets/src/mage/sets/prophecy/AvatarOfFury.java new file mode 100644 index 0000000000..ea0e1ed94f --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/AvatarOfFury.java @@ -0,0 +1,164 @@ +/* + * 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.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.AdjustingSourceCosts; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class AvatarOfFury extends CardImpl { + + public AvatarOfFury(UUID ownerId) { + super(ownerId, 82, "Avatar of Fury", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{R}{R}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Avatar"); + + this.color.setRed(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // If an opponent controls seven or more lands, Avatar of Fury costs {6} less to cast. + this.addAbility(new AvatarOfFuryAdjustingCostsAbility()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {R}: Avatar of Fury gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public AvatarOfFury(final AvatarOfFury card) { + super(card); + } + + @Override + public AvatarOfFury copy() { + return new AvatarOfFury(this); + } +} + +class AvatarOfFuryAdjustingCostsAbility extends SimpleStaticAbility implements AdjustingSourceCosts { + + public AvatarOfFuryAdjustingCostsAbility() { + super(Zone.OUTSIDE, null /*new AvatarOfFuryAdjustingCostsEffect()*/); + } + + public AvatarOfFuryAdjustingCostsAbility(final AvatarOfFuryAdjustingCostsAbility ability) { + super(ability); + } + + @Override + public SimpleStaticAbility copy() { + return new AvatarOfFuryAdjustingCostsAbility(this); + } + + @Override + public String getRule() { + return "If an opponent controls seven or more lands, Avatar of Fury costs {6} less to cast"; + } + + @Override + public void adjustCosts(Ability ability, Game game) { + FilterPermanent filter = new FilterLandPermanent(); + for (UUID playerId: game.getOpponents(ability.getControllerId())) { + if (game.getBattlefield().countAll(filter, playerId, game) > 6) { + CardUtil.adjustCost((SpellAbility)ability, 6); + break; + } + } + } +} + +//class AvatarOfFuryAdjustingCostsEffect extends CostModificationEffectImpl { +// +// public AvatarOfFuryAdjustingCostsEffect() { +// super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST); +// } +// +// public AvatarOfFuryAdjustingCostsEffect(final AvatarOfFuryAdjustingCostsEffect effect) { +// super(effect); +// } +// +// @Override +// public boolean apply(Game game, Ability source, Ability abilityToModify) { +// SpellAbility spellAbility = (SpellAbility)abilityToModify; +// Mana mana = spellAbility.getManaCostsToPay().getMana(); +// +// boolean condition = false; +// FilterPermanent filter = new FilterLandPermanent(); +// for (UUID playerId: game.getOpponents(source.getControllerId())) { +// if (game.getBattlefield().countAll(filter, playerId, game) > 6) { +// condition = true; +// break; +// } +// } +// +// if (mana.getColorless() > 0 && condition) { +// int newCount = mana.getColorless() - 6; +// if (newCount < 0) { +// newCount = 0; +// } +// mana.setColorless(newCount); +// spellAbility.getManaCostsToPay().load(mana.toString()); +// return true; +// } +// return false; +// } +// +// @Override +// public boolean applies(Ability abilityToModify, Ability source, Game game) { +// if ((abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility || abilityToModify instanceof RetraceAbility) +// && abilityToModify.getSourceId().equals(source.getSourceId())) { +// return true; +// } +// return false; +// } +// +// @Override +// public AvatarOfFuryAdjustingCostsEffect copy() { +// return new AvatarOfFuryAdjustingCostsEffect(this); +// } +//} diff --git a/Mage.Sets/src/mage/sets/stronghold/Ruination.java b/Mage.Sets/src/mage/sets/stronghold/Ruination.java new file mode 100644 index 0000000000..f6008e9ece --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Ruination.java @@ -0,0 +1,70 @@ +/* + * 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.stronghold; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author LevelX2 + */ +public class Ruination extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic lands"); + static { + filter.add(new CardTypePredicate(CardType.LAND)); + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + + public Ruination(UUID ownerId) { + super(ownerId, 95, "Ruination", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "STH"; + + this.color.setRed(true); + + // Destroy all nonbasic lands. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public Ruination(final Ruination card) { + super(card); + } + + @Override + public Ruination copy() { + return new Ruination(this); + } +}