From da392d42975650df1320d48089bfeb0029859995 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 21 Jan 2014 00:45:36 +0100 Subject: [PATCH] [BNG] Added 5 cards. --- .../sets/bornofthegods/GlimpseTheSunGod.java | 80 +++++++ .../mage/sets/bornofthegods/HeroesPodium.java | 199 ++++++++++++++++++ .../bornofthegods/NessianWildsRavager.java | 82 ++++++++ .../sets/bornofthegods/ReapWhatIsSown.java | 68 ++++++ .../bornofthegods/XenagosGodOfRevels.java | 132 ++++++++++++ .../src/mage/sets/conflux/WorldlyCounsel.java | 6 +- .../BeginningOfCombatTriggeredAbility.java | 2 +- .../continious/GainAbilityTargetEffect.java | 6 +- 8 files changed, 570 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/GlimpseTheSunGod.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/HeroesPodium.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/ReapWhatIsSown.java create mode 100644 Mage.Sets/src/mage/sets/bornofthegods/XenagosGodOfRevels.java diff --git a/Mage.Sets/src/mage/sets/bornofthegods/GlimpseTheSunGod.java b/Mage.Sets/src/mage/sets/bornofthegods/GlimpseTheSunGod.java new file mode 100644 index 00000000000..08e7ff79a28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/GlimpseTheSunGod.java @@ -0,0 +1,80 @@ +/* + * 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.SpellAbility; +import mage.abilities.effects.common.ScryEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class GlimpseTheSunGod extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); + + public GlimpseTheSunGod(UUID ownerId) { + super(ownerId, 13, "Glimpse the Sun God", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{W}"); + this.expansionSetCode = "BNG"; + + this.color.setWhite(true); + + // Tap X target creatures. Scry 1. + this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1,filter, false)); + this.getSpellAbility().addEffect(new ScryEffect(1)); + } + + public GlimpseTheSunGod(final GlimpseTheSunGod card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + ability.getTargets().clear(); + int numberToTap = ability.getManaCostsToPay().getX(); + numberToTap = Math.min(game.getBattlefield().count(filter, ability.getSourceId(), ability.getControllerId(), game), numberToTap); + ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, filter, false)); + } + } + + @Override + public GlimpseTheSunGod copy() { + return new GlimpseTheSunGod(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/HeroesPodium.java b/Mage.Sets/src/mage/sets/bornofthegods/HeroesPodium.java new file mode 100644 index 00000000000..96e424a2c4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/HeroesPodium.java @@ -0,0 +1,199 @@ +/* + * 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.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostControlledEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author LevelX2 + */ +public class HeroesPodium extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Each legendary creature you control"); + static { + filter.add(new SupertypePredicate("Legendary")); + } + public HeroesPodium(UUID ownerId) { + super(ownerId, 159, "Heroes' Podium", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "BNG"; + this.supertype.add("Legendary"); + + // Each legendary creature you control gets +1/+1 for each other legendary creature you control. + DynamicValue xValue = new HeroesPodiumLegendaryCount(); + Effect effect = new BoostControlledEffect(xValue, xValue, Duration.WhileOnBattlefield, filter, false); + effect.setText("Each legendary creature you control gets +1/+1 for each other legendary creature you control"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + // {X}, {T}: Look at the top X cards of your library. You may reveal a legendary creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HeroesPodiumEffect(), new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public HeroesPodium(final HeroesPodium card) { + super(card); + } + + @Override + public HeroesPodium copy() { + return new HeroesPodium(this); + } +} + +class HeroesPodiumLegendaryCount implements DynamicValue { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other legendary creature you control"); + static { + filter.add(new SupertypePredicate("Legendary")); + } + + @Override + public int calculate(Game game, Ability sourceAbility) { + int value = game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); + if (value > 0) { + value--; + } + return value; + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return filter.getMessage(); + } + + @Override + public HeroesPodiumLegendaryCount copy() { + return new HeroesPodiumLegendaryCount(); + } +} + +class HeroesPodiumEffect extends OneShotEffect { + + private static final FilterCreatureCard filter = new FilterCreatureCard("a legendary creature card"); + static { + filter.add(new SupertypePredicate(("Legendary"))); + } + + public HeroesPodiumEffect() { + super(Outcome.DrawCard); + this.staticText = "Look at the top X cards of your library. You may reveal a legendary creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order"; + } + + public HeroesPodiumEffect(final HeroesPodiumEffect effect) { + super(effect); + } + + @Override + public HeroesPodiumEffect copy() { + return new HeroesPodiumEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + Cards cards = new CardsImpl(Zone.PICK); + int count = source.getManaCostsToPay().getX(); + count = Math.min(player.getLibrary().size(), count); + boolean legendaryIncluded = false; + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + if (filter.match(card, game)) { + legendaryIncluded = true; + } + game.setZone(card.getId(), Zone.PICK); + } + } + player.lookAtCards("Heroes' Podium", cards, game); + + // You may reveal a legendary creature card from among them and put it into your hand. + if (!cards.isEmpty() && legendaryIncluded && player.chooseUse(outcome, "Put a legendary creature card into your hand?", game)) { + if (cards.size() == 1) { + Card card = cards.getRandom(game); + cards.remove(card); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + return true; + } else { + TargetCard target = new TargetCard(Zone.PICK, filter); + if (player.choose(outcome, cards, target, game)) { + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + } + } + } + } + + // Put the rest on the bottom of your library in a random order + while (cards.size() > 0) { + Card card = cards.getRandom(game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java b/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java new file mode 100644 index 00000000000..3b83529752a --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.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.FightTargetsEffect; +import mage.abilities.keyword.TributeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class NessianWildsRavager extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature"); + static { + filter.add(new AnotherPredicate()); + } + + public NessianWildsRavager(UUID ownerId) { + super(ownerId, 129, "Nessian Wilds Ravager", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Hydra"); + + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Tribute 6 + this.addAbility(new TributeAbility(6)); + // When Nessian Wilds Ravager enters the battlefield, if tribute wasn't paid, you may have Nessian Wilds Ravager fight another target creature. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new FightTargetsEffect(), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + "When {this} enters the battlefield, if its tribute wasn't paid, you may have {this} fight another target creature.")); + } + + public NessianWildsRavager(final NessianWildsRavager card) { + super(card); + } + + @Override + public NessianWildsRavager copy() { + return new NessianWildsRavager(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/ReapWhatIsSown.java b/Mage.Sets/src/mage/sets/bornofthegods/ReapWhatIsSown.java new file mode 100644 index 00000000000..88bed8e214f --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/ReapWhatIsSown.java @@ -0,0 +1,68 @@ +/* + * 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.effects.Effect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ReapWhatIsSown extends CardImpl { + + public ReapWhatIsSown(UUID ownerId) { + super(ownerId, 154, "Reap What Is Sown", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}{W}"); + this.expansionSetCode = "BNG"; + + this.color.setGreen(true); + this.color.setWhite(true); + + // Put a +1/+1 counter on each of up to three target creatures. + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setText("Put a +1/+1 counter on each of up to three target creatures"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 3, new FilterCreaturePermanent("creatures"), false)); + } + + public ReapWhatIsSown(final ReapWhatIsSown card) { + super(card); + } + + @Override + public ReapWhatIsSown copy() { + return new ReapWhatIsSown(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/XenagosGodOfRevels.java b/Mage.Sets/src/mage/sets/bornofthegods/XenagosGodOfRevels.java new file mode 100644 index 00000000000..ac70e31bb3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/XenagosGodOfRevels.java @@ -0,0 +1,132 @@ +/* + * 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.BeginningOfCombatTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class XenagosGodOfRevels extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another target creature you control"); + static { + filter.add(new AnotherPredicate()); + } + + public XenagosGodOfRevels(UUID ownerId) { + super(ownerId, 156, "Xenagos, God of Revels", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{R}{G}"); + this.expansionSetCode = "BNG"; + this.supertype.add("Legendary"); + this.subtype.add("God"); + + this.color.setRed(true); + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + // As long as your devotion to red and green is less than seven, Xenagos isn't a creature. + Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.R, ColoredManaSymbol.G), 7); + effect.setText("As long as your devotion to red and green is less than seven, Xenagos isn't a creature"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // At the beginning of combat on your turn, another target creature you control gains haste and gets +X/+X until end of turn, where X is that creature's power. + effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); + effect.setText("another target creature you control gains haste"); + Ability ability = new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false, false); + ability.addEffect(new XenagosGodOfRevelsEffect()); + ability.addTarget(new TargetControlledCreaturePermanent(1,1,filter, false, true)); + this.addAbility(ability); + } + + public XenagosGodOfRevels(final XenagosGodOfRevels card) { + super(card); + } + + @Override + public XenagosGodOfRevels copy() { + return new XenagosGodOfRevels(this); + } +} + +class XenagosGodOfRevelsEffect extends OneShotEffect { + + public XenagosGodOfRevelsEffect() { + super(Outcome.BoostCreature); + this.staticText = "and gets +X/+X until end of turn, where X is that creature's power"; + } + + public XenagosGodOfRevelsEffect(final XenagosGodOfRevelsEffect effect) { + super(effect); + } + + @Override + public XenagosGodOfRevelsEffect copy() { + return new XenagosGodOfRevelsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (targetCreature != null) { + ContinuousEffect effect = new BoostTargetEffect(targetCreature.getPower().getValue(), targetCreature.getToughness().getValue(), Duration.EndOfTurn); + effect.setTargetPointer(this.getTargetPointer()); + game.addEffect(effect, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java b/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java index b1b95a4c88c..a809f245a58 100644 --- a/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java +++ b/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java @@ -109,7 +109,7 @@ class WorldlyCounselEffect extends OneShotEffect { if (cards.size() == 1) { Card card = cards.getRandom(game); cards.remove(card); - card.moveToZone(Zone.HAND, source.getId(), game, false); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); return true; } else { TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put into your hand")); @@ -117,7 +117,7 @@ class WorldlyCounselEffect extends OneShotEffect { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { cards.remove(card); - card.moveToZone(Zone.HAND, source.getId(), game, false); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); } } } @@ -137,7 +137,7 @@ class WorldlyCounselEffect extends OneShotEffect { } if (cards.size() == 1) { Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); } return true; } diff --git a/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java b/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java index ffb57c372f5..01614484fb9 100644 --- a/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BeginningOfCombatTriggeredAbility.java @@ -74,7 +74,7 @@ public class BeginningOfCombatTriggeredAbility extends TriggeredAbilityImpl