From f9796b3cbbfc24851d4544eef6f424db6a61752f Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 31 Oct 2013 16:54:12 -0500 Subject: [PATCH] - Added Groundling Pouncer, Cankerous Thirst, Duergar Mine Captain, Fire At Will, Grazing Kelpie, Invert the Skies. Little text fix Noblis of War. --- .../mage/sets/eventide/CankerousThirst.java | 74 ++++++++ .../sets/eventide/DuergarMineCaptain.java | 77 +++++++++ .../src/mage/sets/eventide/FireAtWill.java | 77 +++++++++ .../src/mage/sets/eventide/GrazingKelpie.java | 79 +++++++++ .../mage/sets/eventide/GroundlingPouncer.java | 162 ++++++++++++++++++ .../mage/sets/eventide/InvertTheSkies.java | 112 ++++++++++++ .../src/mage/sets/eventide/NobilisOfWar.java | 2 +- 7 files changed, 582 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/eventide/CankerousThirst.java create mode 100644 Mage.Sets/src/mage/sets/eventide/DuergarMineCaptain.java create mode 100644 Mage.Sets/src/mage/sets/eventide/FireAtWill.java create mode 100644 Mage.Sets/src/mage/sets/eventide/GrazingKelpie.java create mode 100644 Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java create mode 100644 Mage.Sets/src/mage/sets/eventide/InvertTheSkies.java diff --git a/Mage.Sets/src/mage/sets/eventide/CankerousThirst.java b/Mage.Sets/src/mage/sets/eventide/CankerousThirst.java new file mode 100644 index 00000000000..07ae3d656cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/CankerousThirst.java @@ -0,0 +1,74 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.abilities.condition.common.ManaWasSpentCondition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.ManaType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + + */ +public class CankerousThirst extends CardImpl { + + public CankerousThirst(UUID ownerId) { + super(ownerId, 116, "Cankerous Thirst", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{B/G}"); + this.expansionSetCode = "EVE"; + + this.color.setGreen(true); + this.color.setBlack(true); + + // If {B} was spent to cast Cankerous Thirst, you may have target creature get -3/-3 until end of turn. If {G} was spent to cast Cankerous Thirst, you may have target creature get +3/+3 until end of turn. + this.getSpellAbility().addEffect(new ConditionalContinousEffect( + new BoostTargetEffect(-3, -3, Duration.EndOfTurn), + new ManaWasSpentCondition(ManaType.BLACK), "If {B} was spent to cast {this}, you may have target creature get -3/-3 until end of turn", true)); + this.getSpellAbility().addEffect(new ConditionalContinousEffect( + new BoostTargetEffect(3, 3, Duration.EndOfTurn), + new ManaWasSpentCondition(ManaType.GREEN), "If {G} was spent to cast {this}, you may have target creature get +3/+3 until end of turn", true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.addInfo("Info1", "(Do both if {B}{G} was spent.)"); + } + + public CankerousThirst(final CankerousThirst card) { + super(card); + } + + @Override + public CankerousThirst copy() { + return new CankerousThirst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/DuergarMineCaptain.java b/Mage.Sets/src/mage/sets/eventide/DuergarMineCaptain.java new file mode 100644 index 00000000000..d2489c1ad93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/DuergarMineCaptain.java @@ -0,0 +1,77 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.UntapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author jeffwadsworth + + */ +public class DuergarMineCaptain extends CardImpl { + + public DuergarMineCaptain(UUID ownerId) { + super(ownerId, 138, "Duergar Mine-Captain", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R/W}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Dwarf"); + this.subtype.add("Soldier"); + + this.color.setRed(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {1}{RW}, {untap}: Attacking creatures get +1/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.EndOfTurn, new FilterAttackingCreature(), false), new ManaCostsImpl("{1}{R/W}")); + ability.addCost(new UntapSourceCost()); + this.addAbility(ability); + + } + + public DuergarMineCaptain(final DuergarMineCaptain card) { + super(card); + } + + @Override + public DuergarMineCaptain copy() { + return new DuergarMineCaptain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/FireAtWill.java b/Mage.Sets/src/mage/sets/eventide/FireAtWill.java new file mode 100644 index 00000000000..1b26ddc0e89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/FireAtWill.java @@ -0,0 +1,77 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.BlockingPredicate; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author jeffwadsworth + * + */ +public class FireAtWill extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("attacking or blocking creatures"); + + static { + filter.add(Predicates.or( + new AttackingPredicate(), + new BlockingPredicate())); + } + + public FireAtWill(UUID ownerId) { + super(ownerId, 140, "Fire at Will", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R/W}{R/W}{R/W}"); + this.expansionSetCode = "EVE"; + + this.color.setRed(true); + this.color.setWhite(true); + + // Fire at Will deals 3 damage divided as you choose among one, two, or three target attacking or blocking creatures. + this.getSpellAbility().addEffect(new DamageMultiEffect(3)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3, filter)); + + } + + public FireAtWill(final FireAtWill card) { + super(card); + } + + @Override + public FireAtWill copy() { + return new FireAtWill(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/GrazingKelpie.java b/Mage.Sets/src/mage/sets/eventide/GrazingKelpie.java new file mode 100644 index 00000000000..47845c919c4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/GrazingKelpie.java @@ -0,0 +1,79 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.keyword.PersistAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author jeffwadsworth + + */ +public class GrazingKelpie extends CardImpl { + + public GrazingKelpie(UUID ownerId) { + super(ownerId, 153, "Grazing Kelpie", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G/U}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Beast"); + + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {GU}, Sacrifice Grazing Kelpie: Put target card from a graveyard on the bottom of its owner's library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(false), new ManaCostsImpl("{G/U}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCardInGraveyard()); + this.addAbility(ability); + + // Persist + this.addAbility(new PersistAbility()); + } + + public GrazingKelpie(final GrazingKelpie card) { + super(card); + } + + @Override + public GrazingKelpie copy() { + return new GrazingKelpie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java b/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java new file mode 100644 index 00000000000..24dea74ff88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java @@ -0,0 +1,162 @@ +/* + * 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.eventide; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.StackAbility; +import mage.game.stack.StackObject; +import mage.watchers.WatcherImpl; + +/** + * + * @author jeffwadsworth + * + */ +public class GroundlingPouncer extends CardImpl { + + private String rule = "{this} gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying."; + + public GroundlingPouncer(UUID ownerId) { + super(ownerId, 154, "Groundling Pouncer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G/U}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Faerie"); + + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {GU}: Groundling Pouncer gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying. + Condition condition = new GroundingPouncerCondition(); + Effect effect = new BoostSourceEffect(1, 3, Duration.EndOfTurn); + Effect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true); + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{G/U}"), condition, rule); + ability.addEffect(effect2); + this.addAbility(ability); + this.addWatcher(new ActivatedAbilityUsedThisTurnWatcher()); + + } + + public GroundlingPouncer(final GroundlingPouncer card) { + super(card); + } + + @Override + public GroundlingPouncer copy() { + return new GroundlingPouncer(this); + } +} + +class GroundingPouncerCondition implements Condition { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + @Override + public boolean apply(Game game, Ability source) { + ActivatedAbilityUsedThisTurnWatcher watcher = (ActivatedAbilityUsedThisTurnWatcher) game.getState().getWatchers().get("ActivatedAbilityUsedThisTurn"); + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + if (game.getBattlefield().countAll(filter, opponentId, game) > 0 && !watcher.getActivatedThisTurn().contains(source.getId())) { + return true; + } + } + return false; + } + + @Override + public String toString() { + return "once each turn and only if an opponent controls a flying creature"; + } +} + +class ActivatedAbilityUsedThisTurnWatcher extends WatcherImpl { + + public Set activatedThisTurn = new HashSet(); + + public ActivatedAbilityUsedThisTurnWatcher() { + super("ActivatedAbilityUsedThisTurn", WatcherScope.GAME); + } + + public ActivatedAbilityUsedThisTurnWatcher(final ActivatedAbilityUsedThisTurnWatcher watcher) { + super(watcher); + this.activatedThisTurn.addAll(watcher.activatedThisTurn); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) { + StackObject stackObject = game.getStack().getStackObject(event.getTargetId()); + if (stackObject != null) { + StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getTargetId()); + if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) { + this.activatedThisTurn.add(stackAbility.getOriginalId()); + } + } + } + } + + public Set getActivatedThisTurn() { + return this.activatedThisTurn; + } + + @Override + public ActivatedAbilityUsedThisTurnWatcher copy() { + return new ActivatedAbilityUsedThisTurnWatcher(this); + } + + @Override + public void reset() { + super.reset(); + this.activatedThisTurn.clear(); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/InvertTheSkies.java b/Mage.Sets/src/mage/sets/eventide/InvertTheSkies.java new file mode 100644 index 00000000000..369185ae4b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/InvertTheSkies.java @@ -0,0 +1,112 @@ +/* + * 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.eventide; + +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.ManaWasSpentCondition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.ManaType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + + */ +public class InvertTheSkies extends CardImpl { + + public InvertTheSkies(UUID ownerId) { + super(ownerId, 155, "Invert the Skies", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G/U}"); + this.expansionSetCode = "EVE"; + + this.color.setBlue(true); + this.color.setGreen(true); + + // Creatures your opponents control lose flying until end of turn if {G} was spent to cast Invert the Skies, and creatures you control gain flying until end of turn if {U} was spent to cast it. + this.getSpellAbility().addEffect(new ConditionalContinousEffect( + new InvertTheSkiesEffect(), + new ManaWasSpentCondition(ManaType.GREEN), "Creatures your opponents control lose flying until end of turn if {G} was spent to cast {this},", true)); + this.getSpellAbility().addEffect(new ConditionalContinousEffect( + new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), + new ManaWasSpentCondition(ManaType.BLUE), "and creatures you control gain flying until end of turn if {U} was spent to cast it", true)); + this.addInfo("Info1", "(Do both if {G}{U} was spent.)"); + } + + public InvertTheSkies(final InvertTheSkies card) { + super(card); + } + + @Override + public InvertTheSkies copy() { + return new InvertTheSkies(this); + } +} + +class InvertTheSkiesEffect extends ContinuousEffectImpl { + + private static FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public InvertTheSkiesEffect() { + super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); + } + + public InvertTheSkiesEffect(final InvertTheSkiesEffect effect) { + super(effect); + } + + @Override + public InvertTheSkiesEffect copy() { + return new InvertTheSkiesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Set opponents = game.getOpponents(source.getControllerId()); + for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + if (opponents.contains(perm.getControllerId())) { + perm.getAbilities().remove(FlyingAbility.getInstance()); + } + } + return true; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/NobilisOfWar.java b/Mage.Sets/src/mage/sets/eventide/NobilisOfWar.java index 8535b16b051..6a99852781e 100644 --- a/Mage.Sets/src/mage/sets/eventide/NobilisOfWar.java +++ b/Mage.Sets/src/mage/sets/eventide/NobilisOfWar.java @@ -59,7 +59,7 @@ public class NobilisOfWar extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Attacking creatures you control get +2/+0. - BoostControlledEffect boostEffect = new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, new FilterAttackingCreature(), false); + BoostControlledEffect boostEffect = new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, new FilterAttackingCreature("Attacking creatures"), false); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, boostEffect)); }