From 3167fc0896522e608db103f46567caa69207766c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 19 Jan 2014 02:55:08 +0100 Subject: [PATCH] [BNG] Added 9 cards. Some fixes to other BNS cards. Some framework changes. --- .../bornofthegods/EpharaGodOfThePolis.java | 147 +++++++++++++ .../bornofthegods/EpharasEnlightenment.java | 92 ++++++++ .../sets/bornofthegods/FanaticOfXenagos.java | 82 +++++++ .../bornofthegods/FlameWreathedPhoenix.java | 1 - .../bornofthegods/KarametraGodOfHarvests.java | 92 ++++++++ .../bornofthegods/KioraTheCrashingWave.java | 202 ++++++++++++++++++ .../mage/sets/bornofthegods/Ragemonger.java | 76 +++++++ .../sets/bornofthegods/SilentSentinel.java | 7 +- .../bornofthegods/TempleOfEnlightenment.java | 67 ++++++ .../sets/bornofthegods/TempleOfMalice.java | 67 ++++++ .../sets/bornofthegods/TempleOfPlenty.java | 67 ++++++ .../sets/commander2013/OrderOfSuccession.java | 19 +- .../mage/sets/modernmasters/Riftsweeper.java | 2 +- .../src/mage/sets/morningtide/Deglamer.java | 2 +- .../sets/timespiral/LocketOfYesterdays.java | 2 +- .../ConditionalTriggeredAbility.java | 2 +- .../common/ReturnToHandSourceEffect.java | 2 +- .../cost/SpellsCostReductionEffect.java | 32 ++- .../search/SearchLibraryPutInPlayEffect.java | 2 +- Mage/src/mage/util/CardUtil.java | 39 ++-- .../mage/watchers/common/MorbidWatcher.java | 3 +- 21 files changed, 965 insertions(+), 40 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/EpharaGodOfThePolis.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/EpharasEnlightenment.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/FanaticOfXenagos.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/KarametraGodOfHarvests.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/Ragemonger.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/TempleOfEnlightenment.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/TempleOfMalice.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/TempleOfPlenty.java diff --git a/Mage.Sets/src/mage/sets/bornofthegods/EpharaGodOfThePolis.java b/Mage.Sets/src/mage/sets/bornofthegods/EpharaGodOfThePolis.java new file mode 100644 index 0000000000..e3d82d3805 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/EpharaGodOfThePolis.java @@ -0,0 +1,147 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.watchers.Watcher; +import mage.watchers.WatcherImpl; + +/** + * + * @author LevelX2 + */ +public class EpharaGodOfThePolis extends CardImpl { + + public EpharaGodOfThePolis(UUID ownerId) { + super(ownerId, 145, "Ephara, God of the Polis", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{W}{U}"); + this.expansionSetCode = "BNG"; + this.supertype.add("Legendary"); + this.subtype.add("God"); + + this.color.setBlue(true); + this.color.setWhite(true); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + // As long as your devotion to white and blue is less than seven, Ephara isn't a creature. + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.W, ColoredManaSymbol.U), 7); + effect.setText("As long as your devotion to white and blue is less than seven, Ephara isn't a creature"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + // At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card. + this.addAbility(new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), TargetController.ANY, false), + HadAnotherCreatureEnterTheBattlefieldCondition.getInstance(), + "At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card.")); + this.addWatcher(new CreatureEnteredBattlefieldLastTurnWatcher()); + + } + + public EpharaGodOfThePolis(final EpharaGodOfThePolis card) { + super(card); + } + + @Override + public EpharaGodOfThePolis copy() { + return new EpharaGodOfThePolis(this); + } +} + +class HadAnotherCreatureEnterTheBattlefieldCondition implements Condition { + + private static HadAnotherCreatureEnterTheBattlefieldCondition fInstance = new HadAnotherCreatureEnterTheBattlefieldCondition(); + + public static HadAnotherCreatureEnterTheBattlefieldCondition getInstance() { + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + Watcher watcher = game.getState().getWatchers().get("CreatureEnteredBattlefieldLastTurnWatcher", source.getSourceId()); + return watcher != null && watcher.conditionMet(); + } +} + +class CreatureEnteredBattlefieldLastTurnWatcher extends WatcherImpl { + + private boolean anotherCreatureEntered = false; + + public CreatureEnteredBattlefieldLastTurnWatcher() { + super("CreatureEnteredBattlefieldLastTurnWatcher", WatcherScope.CARD); + } + + public CreatureEnteredBattlefieldLastTurnWatcher(final CreatureEnteredBattlefieldLastTurnWatcher watcher) { + super(watcher); + this.anotherCreatureEntered = watcher.anotherCreatureEntered; + } + + @Override + public void watch(GameEvent event, Game game) { + if (!anotherCreatureEntered && event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { + if (!event.getTargetId().equals(this.getSourceId()) && event.getPlayerId().equals(this.getControllerId())) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { + anotherCreatureEntered = true; + } + } + } + } + + @Override + public void reset() { + condition = anotherCreatureEntered; + anotherCreatureEntered = false; + } + + @Override + public CreatureEnteredBattlefieldLastTurnWatcher copy() { + return new CreatureEnteredBattlefieldLastTurnWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/EpharasEnlightenment.java b/Mage.Sets/src/mage/sets/bornofthegods/EpharasEnlightenment.java new file mode 100644 index 0000000000..d0c8a1ba99 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/EpharasEnlightenment.java @@ -0,0 +1,92 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddCountersAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class EpharasEnlightenment extends CardImpl { + + public EpharasEnlightenment(UUID ownerId) { + super(ownerId, 146, "Ephara's Enlightenment", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{U}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Aura"); + + this.color.setBlue(true); + this.color.setWhite(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When Ephara's Enlightenment enters the battlefield, put a +1/+1 counter on enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "enchanted creature"), false)); + // Enchanted creature has flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); + // Whenever a creature enters the battlefield under your control, you may return Ephara's Enlightenment to its owner's hand. + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, + new ReturnToHandSourceEffect(true), + new FilterCreaturePermanent("a creature"), + true)); + + } + + public EpharasEnlightenment(final EpharasEnlightenment card) { + super(card); + } + + @Override + public EpharasEnlightenment copy() { + return new EpharasEnlightenment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FanaticOfXenagos.java b/Mage.Sets/src/mage/sets/bornofthegods/FanaticOfXenagos.java new file mode 100644 index 0000000000..b539b9bddd --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/FanaticOfXenagos.java @@ -0,0 +1,82 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.TributeNotPaidCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.TributeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class FanaticOfXenagos extends CardImpl { + + public FanaticOfXenagos(UUID ownerId) { + super(ownerId, 147, "Fanatic of Xenagos", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Centaur"); + this.subtype.add("Warrior"); + + this.color.setRed(true); + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Tribute 1 + this.addAbility(new TributeAbility(1)); + // When Fanatic of Xenagos enters the battlefield, if its tribute wasn't paid, it gets +1/+1 and gains haste until end of turn. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(1,1, Duration.EndOfTurn)); + ability.addEffect( new GainAbilitySourceEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn))); + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + "When {this} enters the battlefield, if its tribute wasn't paid, it gets +1/+1 and gains haste until end of turn.")); + } + + public FanaticOfXenagos(final FanaticOfXenagos card) { + super(card); + } + + @Override + public FanaticOfXenagos copy() { + return new FanaticOfXenagos(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FlameWreathedPhoenix.java b/Mage.Sets/src/mage/sets/bornofthegods/FlameWreathedPhoenix.java index 1e74e7efc2..03d354021a 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/FlameWreathedPhoenix.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/FlameWreathedPhoenix.java @@ -66,7 +66,6 @@ public class FlameWreathedPhoenix extends CardImpl { this.addAbility(new TributeAbility(2)); // When Flame-Wreathed Phoenix enters the battlefield, if its tribute wasn't paid, it gains haste and "When this creature dies, return it to its owner's hand." TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); - Effect effect = new GainAbilitySourceEffect(new DiesTriggeredAbility(new ReturnToHandSourceEffect())); ability.addEffect(effect); this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), diff --git a/Mage.Sets/src/mage/sets/bornofthegods/KarametraGodOfHarvests.java b/Mage.Sets/src/mage/sets/bornofthegods/KarametraGodOfHarvests.java new file mode 100644 index 0000000000..66f6999133 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/KarametraGodOfHarvests.java @@ -0,0 +1,92 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class KarametraGodOfHarvests extends CardImpl { + + private static final FilterCard filter = new FilterCard("a Forest or Plains card"); + static { + filter.add(Predicates.or( + new SubtypePredicate("Forest"), + new SubtypePredicate("Plains"))); + } + public KarametraGodOfHarvests(UUID ownerId) { + super(ownerId, 148, "Karametra, God of Harvests", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{W}"); + this.expansionSetCode = "BNG"; + this.supertype.add("Legendary"); + this.subtype.add("God"); + + this.color.setGreen(true); + this.color.setWhite(true); + this.power = new MageInt(6); + this.toughness = new MageInt(7); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + // As long as your devotion to green and white is less than seven, Karametra isn't a creature. + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.G, ColoredManaSymbol.W), 7); + effect.setText("As long as your devotion to green and white is less than seven, Karametra isn't a creature"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + // Whenever you cast a creature spell, you may search your library for a Forest or Plains card, put it onto the battlefield tapped, then shuffle your library. + this.addAbility(new SpellCastControllerTriggeredAbility( + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new FilterCreatureSpell("a creature spell"), true)); + } + + public KarametraGodOfHarvests(final KarametraGodOfHarvests card) { + super(card); + } + + @Override + public KarametraGodOfHarvests copy() { + return new KarametraGodOfHarvests(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java b/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java new file mode 100644 index 0000000000..9b47e26081 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java @@ -0,0 +1,202 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.continious.PlayAdditionalLandsControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.command.Emblem; +import mage.game.events.DamageEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.game.turn.Step; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class KioraTheCrashingWave extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("permanent an opponent control"); + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public KioraTheCrashingWave(UUID ownerId) { + super(ownerId, 149, "Kiora, the Crashing Wave", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{U}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Kiora"); + + this.color.setBlue(true); + this.color.setGreen(true); + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), false)); + + // +1: Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls. + LoyaltyAbility ability = new LoyaltyAbility(new KioraPreventionEffect(), 1); + ability.addTarget(new TargetPermanent(filter, true)); + this.addAbility(ability); + + // -1: Draw a card. You may play an additional land this turn. + ability = new LoyaltyAbility(new DrawCardControllerEffect(1), -1); + ability.addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn)); + this.addAbility(ability); + + // -5: You get an emblem with "At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield." + this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new KioraEmblem()), -5)); + + + } + + public KioraTheCrashingWave(final KioraTheCrashingWave card) { + super(card); + } + + @Override + public KioraTheCrashingWave copy() { + return new KioraTheCrashingWave(this); + } +} + +class KioraPreventionEffect extends PreventionEffectImpl { + + public KioraPreventionEffect() { + super(Duration.Custom); + staticText = "Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls"; + } + + public KioraPreventionEffect(final KioraPreventionEffect effect) { + super(effect); + } + + @Override + public KioraPreventionEffect copy() { + return new KioraPreventionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + for(UUID targetId :this.getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(),"[All damage that would be dealt to and dealt by this permanent is prevented.]"); + } + } + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game) && event instanceof DamageEvent) { + Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (event.getSourceId().equals(targetPermanent.getId()) || event.getTargetId().equals(targetPermanent.getId())) { + return true; + } + } + return false; + } + + @Override + public boolean isInactive(Ability source, Game game) { + if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) + { + if (game.getActivePlayerId().equals(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { + for(UUID targetId :this.getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(),""); + } + } + return true; + } + } + return false; + } +} + +/** + * Emblem: "At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield." + */ +class KioraEmblem extends Emblem { + public KioraEmblem() { + Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.COMMAND, new CreateTokenEffect(new KioraKrakenToken()), TargetController.YOU, null, false); + this.getAbilities().add(ability); + } +} + +class KioraKrakenToken extends Token { + + public KioraKrakenToken() { + super("Kraken", "9/9 blue Kraken creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.BLUE; + subtype.add("Kraken"); + power = new MageInt(9); + toughness = new MageInt(9); + this.setOriginalExpansionSetCode("BNG"); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/Ragemonger.java b/Mage.Sets/src/mage/sets/bornofthegods/Ragemonger.java new file mode 100644 index 0000000000..d886c1d8b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/Ragemonger.java @@ -0,0 +1,76 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.cost.SpellsCostReductionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LevelX2 + */ +public class Ragemonger extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("Minotaur spells"); + static { + filter.add(new SubtypePredicate("Minotaur")); + } + + public Ragemonger(UUID ownerId) { + super(ownerId, 153, "Ragemonger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Minotaur"); + this.subtype.add("Shaman"); + + this.color.setRed(true); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Minotaur spells you cast cost {B}{R} less to cast. This effect reduces only the amount of colored mana you pay. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionEffect(filter, new ManaCostsImpl("{B}{R}")))); + } + + public Ragemonger(final Ragemonger card) { + super(card); + } + + @Override + public Ragemonger copy() { + return new Ragemonger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SilentSentinel.java b/Mage.Sets/src/mage/sets/bornofthegods/SilentSentinel.java index 653963f2ca..d9a45c136a 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/SilentSentinel.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/SilentSentinel.java @@ -32,14 +32,14 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; -import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.Filter; +import mage.constants.TargetController; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.other.OwnerPredicate; import mage.target.common.TargetCardInGraveyard; /** @@ -48,9 +48,10 @@ import mage.target.common.TargetCardInGraveyard; */ public class SilentSentinel extends CardImpl { - private static final FilterCard filter = new FilterCard("enchantment card"); + private static final FilterCard filter = new FilterCard("enchantment card from your graveyard"); static { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); + filter.add(new OwnerPredicate(TargetController.YOU)); } public SilentSentinel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/bornofthegods/TempleOfEnlightenment.java b/Mage.Sets/src/mage/sets/bornofthegods/TempleOfEnlightenment.java new file mode 100644 index 0000000000..66ac171a1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/TempleOfEnlightenment.java @@ -0,0 +1,67 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ScryEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class TempleOfEnlightenment extends CardImpl { + + public TempleOfEnlightenment(UUID ownerId) { + super(ownerId, 163, "Temple of Enlightenment", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BNG"; + + // Temple of Enlightenment enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + // When Temple of Enlightenment enters the battlefield, scry 1. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(1))); + // {T}: Add {W} or {U} to your mana pool. + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } + + public TempleOfEnlightenment(final TempleOfEnlightenment card) { + super(card); + } + + @Override + public TempleOfEnlightenment copy() { + return new TempleOfEnlightenment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/TempleOfMalice.java b/Mage.Sets/src/mage/sets/bornofthegods/TempleOfMalice.java new file mode 100644 index 0000000000..27f26771e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/TempleOfMalice.java @@ -0,0 +1,67 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ScryEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class TempleOfMalice extends CardImpl { + + public TempleOfMalice(UUID ownerId) { + super(ownerId, 164, "Temple of Malice", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BNG"; + + // Temple of Malice enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + // When Temple of Malice enters the battlefield, scry 1. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(1))); + // {T}: Add {B} or {R} to your mana pool. + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + } + + public TempleOfMalice(final TempleOfMalice card) { + super(card); + } + + @Override + public TempleOfMalice copy() { + return new TempleOfMalice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/TempleOfPlenty.java b/Mage.Sets/src/mage/sets/bornofthegods/TempleOfPlenty.java new file mode 100644 index 0000000000..f76bd9b693 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/TempleOfPlenty.java @@ -0,0 +1,67 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ScryEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class TempleOfPlenty extends CardImpl { + + public TempleOfPlenty(UUID ownerId) { + super(ownerId, 165, "Temple of Plenty", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BNG"; + + // Temple of Plenty enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + // When Temple of Plenty enters the battlefield, scry 1. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(1))); + // {T}: Add {G} or {W} to your mana pool. + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + } + + public TempleOfPlenty(final TempleOfPlenty card) { + super(card); + } + + @Override + public TempleOfPlenty copy() { + return new TempleOfPlenty(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/OrderOfSuccession.java b/Mage.Sets/src/mage/sets/commander2013/OrderOfSuccession.java index 477bb7ecc8..2bcea905ca 100644 --- a/Mage.Sets/src/mage/sets/commander2013/OrderOfSuccession.java +++ b/Mage.Sets/src/mage/sets/commander2013/OrderOfSuccession.java @@ -116,18 +116,15 @@ class OrderOfSuccessionEffect extends OneShotEffect { firstNextPlayer = nextPlayer.getId(); } // if player is in range he chooses an creature to control - if (controller.getInRange().contains(currentPlayer.getId())) { - if (currentPlayer != null && nextPlayer != null) { - FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature controlled by ").append(nextPlayer.getName()).toString()); - filter.add(new ControllerIdPredicate(nextPlayer.getId())); - Target target = new TargetCreaturePermanent(filter, true); - target.setNotTarget(false); - if (target.canChoose(source.getSourceId(), currentPlayer.getId(), game)) { - if (currentPlayer.chooseTarget(outcome, target, source, game)) { - playerCreature.put(currentPlayer.getId(), target.getFirstTarget()); - } + if (currentPlayer != null && controller.getInRange().contains(currentPlayer.getId())) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature controlled by ").append(nextPlayer.getName()).toString()); + filter.add(new ControllerIdPredicate(nextPlayer.getId())); + Target target = new TargetCreaturePermanent(filter, true); + target.setNotTarget(false); + if (target.canChoose(source.getSourceId(), currentPlayer.getId(), game)) { + if (currentPlayer.chooseTarget(outcome, target, source, game)) { + playerCreature.put(currentPlayer.getId(), target.getFirstTarget()); } - } } currentPlayer = nextPlayer; diff --git a/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java b/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java index 3f23cce82a..f023492bf8 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java +++ b/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java @@ -106,7 +106,7 @@ class RiftsweeperEffect extends OneShotEffect { card.getCounters().clear(); // move to exile card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - game.getState().getPlayer(card.getOwnerId()).getLibrary().shuffle(); + game.getPlayer(card.getOwnerId()).getLibrary().shuffle(); game.informPlayers(new StringBuilder("Riftsweeper: Choosen card was ").append(card.getName()).toString()); return true; } diff --git a/Mage.Sets/src/mage/sets/morningtide/Deglamer.java b/Mage.Sets/src/mage/sets/morningtide/Deglamer.java index efd68682dd..82e53a8324 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Deglamer.java +++ b/Mage.Sets/src/mage/sets/morningtide/Deglamer.java @@ -99,7 +99,7 @@ class DeglamerShuffleIntoLibraryEffect extends OneShotEffect manaCostsToReduce = null; + + + public SpellsCostReductionEffect(FilterSpell filter, ManaCosts manaCostsToReduce) { + super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); + this.filter = filter; + this.amount = 0; + this.manaCostsToReduce = manaCostsToReduce; + + StringBuilder sb = new StringBuilder(); + sb.append(filter.getMessage()).append(" you cast cost "); + for (String manaSymbol :manaCostsToReduce.getSymbols()) { + sb.append(manaSymbol); + } + sb.append(" less to cast. This effect reduces only the amount of colored mana you pay."); + this.staticText = sb.toString(); + } + public SpellsCostReductionEffect(FilterSpell filter, int amount) { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); @@ -67,7 +85,11 @@ public class SpellsCostReductionEffect extends CostModificationEffectImpl 0) { if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) { sb.append("any number of ").append(" "); diff --git a/Mage/src/mage/util/CardUtil.java b/Mage/src/mage/util/CardUtil.java index 2548bc4c33..c80b9c0322 100644 --- a/Mage/src/mage/util/CardUtil.java +++ b/Mage/src/mage/util/CardUtil.java @@ -123,7 +123,18 @@ public class CardUtil { adjustCost(ability, reduceCount); adjustAlternativeCosts(ability, reduceCount); } - + + /** + * Adjusts spell or ability cost to be paid. + * + * @param spellAbility + * @param reduceCount + */ + public static void adjustCost(SpellAbility spellAbility, int reduceCount) { + CardUtil.adjustCost((Ability) spellAbility, reduceCount); + adjustAlternativeCosts(spellAbility, reduceCount); + } + private static void adjustAlternativeCosts(Ability ability, int reduceCount) { for (AlternativeCost alternativeCost : ability.getAlternativeCosts()) { if (alternativeCost instanceof AlternativeCostImpl) { @@ -158,16 +169,7 @@ public class CardUtil { } } - /** - * Adjusts spell or ability cost to be paid. - * - * @param spellAbility - * @param reduceCount - */ - public static void adjustCost(SpellAbility spellAbility, int reduceCount) { - CardUtil.adjustCost((Ability) spellAbility, reduceCount); - adjustAlternativeCosts(spellAbility, reduceCount); - } + /** * Adjusts ability cost to be paid. @@ -202,13 +204,18 @@ public class CardUtil { ability.getManaCostsToPay().addAll(adjustedCost); } + public static void adjustCost(SpellAbility spellAbility, ManaCosts manaCostsToReduce) { + adjustCost(spellAbility, manaCostsToReduce, true); + } + /** * Adjusts spell or ability cost to be paid by colored and generic mana. * * @param spellAbility * @param manaCostsToReduce costs to reduce + * @param convertToGeneric colored mana does reduce generic mana if no appropriate colored mana is in the costs included */ - public static void adjustCost(SpellAbility spellAbility, ManaCosts manaCostsToReduce) { + public static void adjustCost(SpellAbility spellAbility, ManaCosts manaCostsToReduce, boolean convertToGeneric) { ManaCosts previousCost = spellAbility.getManaCostsToPay(); ManaCosts adjustedCost = new ManaCostsImpl(); // save X value (e.g. convoke ability) @@ -279,7 +286,12 @@ public class CardUtil { } } // subtract colorless mana, use all mana that is left - int reduceAmount = reduceMana.count(); + int reduceAmount; + if (convertToGeneric) { + reduceAmount = reduceMana.count(); + } else { + reduceAmount = reduceMana.getColorless(); + } for (ManaCost newManaCost : previousCost) { Mana mana = newManaCost.getMana(); if (mana.getColorless() == 0) { @@ -302,6 +314,7 @@ public class CardUtil { spellAbility.getManaCostsToPay().clear(); spellAbility.getManaCostsToPay().addAll(adjustedCost); } + /** * Returns function that copies params\abilities from one card to another. * diff --git a/Mage/src/mage/watchers/common/MorbidWatcher.java b/Mage/src/mage/watchers/common/MorbidWatcher.java index d14dd6b501..f8d61e3982 100644 --- a/Mage/src/mage/watchers/common/MorbidWatcher.java +++ b/Mage/src/mage/watchers/common/MorbidWatcher.java @@ -53,8 +53,9 @@ public class MorbidWatcher extends WatcherImpl { @Override public void watch(GameEvent event, Game game) { - if (condition == true) //no need to check - condition has already occured + if (condition == true) { return; + } if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (p != null && p.getCardType().contains(CardType.CREATURE)) {