From 22440fa1ac07fcb793138882c77f1a286ff041ba Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 7 Oct 2012 02:49:19 +0200 Subject: [PATCH] [RTR] 11 cards with populate, 2 Charm cards, PopulateEffect --- .../sets/returntoravnica/AzoriusCharm.java | 80 +++++++++ .../sets/returntoravnica/CoursersAccord.java | 65 ++++++++ .../returntoravnica/DruidsDeliverance.java | 115 +++++++++++++ .../sets/returntoravnica/EyesInTheSkies.java | 79 +++++++++ .../sets/returntoravnica/GrowingRanks.java | 70 ++++++++ .../returntoravnica/HorncallersChant.java | 79 +++++++++ .../returntoravnica/RootbornDefenses.java | 72 ++++++++ .../sets/returntoravnica/SelesnyaCharm.java | 106 ++++++++++++ .../sets/returntoravnica/SunderingGrowth.java | 77 +++++++++ .../TrostaniSelesnyasVoice.java | 157 ++++++++++++++++++ .../returntoravnica/TrostanisJudgment.java | 65 ++++++++ .../returntoravnica/VituGhaziGuildmage.java | 74 +++++++++ .../sets/returntoravnica/WayfaringTemple.java | 75 +++++++++ .../effects/common/PopulateEffect.java | 110 ++++++++++++ .../game/permanent/token/CentaurToken.java | 50 ++++++ 15 files changed, 1274 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/AzoriusCharm.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/CoursersAccord.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/DruidsDeliverance.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/GrowingRanks.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/HorncallersChant.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/RootbornDefenses.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/SelesnyaCharm.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/SunderingGrowth.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/TrostanisJudgment.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/VituGhaziGuildmage.java create mode 100644 Mage.Sets/src/mage/sets/returntoravnica/WayfaringTemple.java create mode 100644 Mage/src/mage/abilities/effects/common/PopulateEffect.java create mode 100644 Mage/src/mage/game/permanent/token/CentaurToken.java diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AzoriusCharm.java b/Mage.Sets/src/mage/sets/returntoravnica/AzoriusCharm.java new file mode 100644 index 0000000000..a1cd11df7f --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/AzoriusCharm.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.returntoravnica; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Mode; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author LevelX2 + */ +public class AzoriusCharm extends CardImpl { + + public AzoriusCharm(UUID ownerId) { + super(ownerId, 145, "Azorius Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}{U}"); + this.expansionSetCode = "RTR"; + + this.color.setWhite(true); + this.color.setBlue(true); + + // Choose one — Creatures you control gain lifelink until end of turn; + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterControlledCreaturePermanent("Creatures"))); + + // or draw a card; + Mode mode = new Mode(); + mode.getEffects().add(new DrawCardControllerEffect(1)); + this.getSpellAbility().addMode(mode); + + // or put target attacking or blocking creature on top of its owner's library. + mode = new Mode(); + mode.getTargets().add(new TargetAttackingOrBlockingCreature()); + mode.getEffects().add(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addMode(mode); + } + + public AzoriusCharm(final AzoriusCharm card) { + super(card); + } + + @Override + public AzoriusCharm copy() { + return new AzoriusCharm(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CoursersAccord.java b/Mage.Sets/src/mage/sets/returntoravnica/CoursersAccord.java new file mode 100644 index 0000000000..355edbe795 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/CoursersAccord.java @@ -0,0 +1,65 @@ +/* + * 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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.game.permanent.token.CentaurToken; + +/** + * + * @author LevleX2 + */ +public class CoursersAccord extends CardImpl { + + public CoursersAccord(UUID ownerId) { + super(ownerId, 154, "Coursers' Accord", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{G}{W}"); + this.expansionSetCode = "RTR"; + + this.color.setGreen(true); + this.color.setWhite(true); + + // Put a 3/3 green Centaur creature token onto the battlefield, then populate. + // (Put a token onto the battlefield that's a copy of a creature token you control.) + this.getSpellAbility().addEffect(new CreateTokenEffect(new CentaurToken())); + this.getSpellAbility().addEffect(new PopulateEffect("then")); + } + + public CoursersAccord(final CoursersAccord card) { + super(card); + } + + @Override + public CoursersAccord copy() { + return new CoursersAccord(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DruidsDeliverance.java b/Mage.Sets/src/mage/sets/returntoravnica/DruidsDeliverance.java new file mode 100644 index 0000000000..b6203f1391 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/DruidsDeliverance.java @@ -0,0 +1,115 @@ +/* + * 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.returntoravnica; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.DamageEvent; +import mage.game.events.GameEvent; + +/** + * + * @author LevleX2 + */ +public class DruidsDeliverance extends CardImpl { + + public DruidsDeliverance(UUID ownerId) { + super(ownerId, 123, "Druid's Deliverance", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "RTR"; + + this.color.setBlue(true); + + // Prevent all combat damage that would be dealt to you this turn. Populate. + // (Put a token onto the battlefield that's a copy of a creature token you control.) + this.getSpellAbility().addEffect(new DruidsDeliverancePreventCombatDamageEffect()); + this.getSpellAbility().addEffect(new PopulateEffect()); + } + + public DruidsDeliverance(final DruidsDeliverance card) { + super(card); + } + + @Override + public DruidsDeliverance copy() { + return new DruidsDeliverance(this); + } +} + +class DruidsDeliverancePreventCombatDamageEffect extends PreventionEffectImpl { + + public DruidsDeliverancePreventCombatDamageEffect() { + super(Duration.EndOfTurn); + staticText = "Prevent all combat damage that would be dealt to you this turn"; + } + + public DruidsDeliverancePreventCombatDamageEffect(final DruidsDeliverancePreventCombatDamageEffect effect) { + super(effect); + } + + @Override + public DruidsDeliverancePreventCombatDamageEffect copy() { + return new DruidsDeliverancePreventCombatDamageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @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 true; + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + DamageEvent damageEvent = (DamageEvent) event; + if (event.getTargetId().equals(source.getControllerId()) && damageEvent.isCombatDamage()) { + return true; + } + } + return false; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java b/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java new file mode 100644 index 0000000000..dcd2c9b30c --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.game.permanent.token.Token; + +/** + * + * @author LevleX2 + */ +public class EyesInTheSkies extends CardImpl { + + public EyesInTheSkies(UUID ownerId) { + super(ownerId, 10, "Eyes in the Skies", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{W}"); + this.expansionSetCode = "RTR"; + + this.color.setWhite(true); + + // Put a 1/1 white Bird creature token with flying onto the battlefield, then populate. + // (Put a token onto the battlefield that's a copy of a creature token you control.) + this.getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken())); + this.getSpellAbility().addEffect(new PopulateEffect("then")); + } + + public EyesInTheSkies(final EyesInTheSkies card) { + super(card); + } + + @Override + public EyesInTheSkies copy() { + return new EyesInTheSkies(this); + } +} + +class BirdToken extends Token { + + public BirdToken() { + super("Bird", "1/1 white Bird creature token with flying"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Bird"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/GrowingRanks.java b/Mage.Sets/src/mage/sets/returntoravnica/GrowingRanks.java new file mode 100644 index 0000000000..9666b1d50f --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/GrowingRanks.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.returntoravnica; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * @author LevelX2 + */ +public class GrowingRanks extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT)); + } + + public GrowingRanks(UUID ownerId) { + super(ownerId, 217, "Growing Ranks", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G/W}{G/W}"); + this.expansionSetCode = "RTR"; + + this.color.setWhite(true); + this.color.setGreen(true); + + // At the beginning of your upkeep, populate. (Put a token onto the battlefield that's a copy of a creature token you control.) + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PopulateEffect(""), Constants.TargetController.YOU, false)); + } + + public GrowingRanks(final GrowingRanks card) { + super(card); + } + + @Override + public GrowingRanks copy() { + return new GrowingRanks(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/HorncallersChant.java b/Mage.Sets/src/mage/sets/returntoravnica/HorncallersChant.java new file mode 100644 index 0000000000..930e685f22 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/HorncallersChant.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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.game.permanent.token.Token; + +/** + * + * @author LevleX2 + */ +public class HorncallersChant extends CardImpl { + + public HorncallersChant(UUID ownerId) { + super(ownerId, 128, "Horncaller's Chant", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{7}{G}"); + this.expansionSetCode = "RTR"; + + this.color.setGreen(true); + + // Put a 4/4 green Rhino creature token with trample onto the battlefield, then populate. + // (Put a token onto the battlefield that's a copy of a creature token you control.) + this.getSpellAbility().addEffect(new CreateTokenEffect(new RhinoToken())); + this.getSpellAbility().addEffect(new PopulateEffect("then")); + } + + public HorncallersChant(final HorncallersChant card) { + super(card); + } + + @Override + public HorncallersChant copy() { + return new HorncallersChant(this); + } +} + +class RhinoToken extends Token { + + public RhinoToken() { + super("Rhino", "4/4 green Rhino creature token with trample"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Rhino"); + power = new MageInt(4); + toughness = new MageInt(4); + addAbility(TrampleAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/RootbornDefenses.java b/Mage.Sets/src/mage/sets/returntoravnica/RootbornDefenses.java new file mode 100644 index 0000000000..6777001fc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/RootbornDefenses.java @@ -0,0 +1,72 @@ +/* + * 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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.effects.common.PopulateEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.Token; + +/** + * + * @author LevleX2 + */ +public class RootbornDefenses extends CardImpl { + + public RootbornDefenses(UUID ownerId) { + super(ownerId, 19, "Rootborn Defenses", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "RTR"; + + this.color.setWhite(true); + + // Populate. Creatures you control are indestructible this turn. + // (To populate, put a token onto the battlefield that's a copy of a creature + // token you control. Damage and effects that say "destroy" don't destroy + // indestructible creatures.) + this.getSpellAbility().addEffect(new PopulateEffect()); + this.getSpellAbility().addEffect(new GainAbilityAllEffect(new IndestructibleAbility(), Duration.EndOfTurn, new FilterControlledCreaturePermanent(),"Creatures you control are indestructible this turn")); + } + + public RootbornDefenses(final RootbornDefenses card) { + super(card); + } + + @Override + public RootbornDefenses copy() { + return new RootbornDefenses(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SelesnyaCharm.java b/Mage.Sets/src/mage/sets/returntoravnica/SelesnyaCharm.java new file mode 100644 index 0000000000..b32c40a484 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/SelesnyaCharm.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.returntoravnica; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Mode; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SelesnyaCharm extends CardImpl { + + static private final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 5 or greater"); + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4)); + } + + public SelesnyaCharm(UUID ownerId) { + super(ownerId, 194, "Selesnya Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{G}{W}"); + this.expansionSetCode = "RTR"; + + this.color.setWhite(true); + this.color.setBlue(true); + + // Choose one — Target creature gets +2/+2 and gains trample until end of turn; + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect(2,2, Constants.Duration.EndOfTurn)); + this.getSpellAbility().getTargets().add(new TargetCreaturePermanent()); + + // or exile target creature with power 5 or greater; + Mode mode = new Mode(); + mode.getEffects().add(new ExileTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addMode(mode); + + // or put a 2/2 white Knight creature token with vigilance onto the battlefield. + mode = new Mode(); + mode.getEffects().add(new CreateTokenEffect(new KnightToken())); + this.getSpellAbility().addMode(mode); + } + + public SelesnyaCharm(final SelesnyaCharm card) { + super(card); + } + + @Override + public SelesnyaCharm copy() { + return new SelesnyaCharm(this); + } +} + +class KnightToken extends Token { + KnightToken() { + super("Knight", "2/2 white Knight creature token with vigilance"); + cardType.add(CardType.CREATURE); + color = ObjectColor.WHITE; + subtype.add("Knight"); + power = new MageInt(2); + toughness = new MageInt(2); + this.addAbility(VigilanceAbility.getInstance()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SunderingGrowth.java b/Mage.Sets/src/mage/sets/returntoravnica/SunderingGrowth.java new file mode 100644 index 0000000000..262adbb3c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/SunderingGrowth.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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LevleX2 + */ +public class SunderingGrowth extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public SunderingGrowth(UUID ownerId) { + super(ownerId, 223, "Sundering Growth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G/W}{G/W}"); + this.expansionSetCode = "RTR"; + + this.color.setGreen(true); + this.color.setWhite(true); + + // Destroy target artifact or enchantment, then populate. + // (Put a token onto the battlefield that's a copy of a creature token you control.) + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new PopulateEffect("then")); + } + + public SunderingGrowth(final SunderingGrowth card) { + super(card); + } + + @Override + public SunderingGrowth copy() { + return new SunderingGrowth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java b/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java new file mode 100644 index 0000000000..41b3efaf68 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java @@ -0,0 +1,157 @@ +/* +* 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.returntoravnica; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class TrostaniSelesnyasVoice extends CardImpl { + + public TrostaniSelesnyasVoice(UUID ownerId) { + super(ownerId, 206, "Trostani, Selesnya's Voice", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{G}{G}{W}{W}"); + this.expansionSetCode = "RTR"; + this.supertype.add("Legendary"); + this.subtype.add("Dryad"); + this.color.setGreen(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // Whenever another creature enters the battlefield under your control, you gain life equal to that creature's toughness. + this.addAbility(new TrostaniSelesnyasVoiceTriggeredAbility()); + + // {1}{G}{W}, {T}: Populate. (Put a token onto the battlefield that's a copy of a creature token you control.) + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PopulateEffect(), new ManaCostsImpl("{1}{G}{W}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public TrostaniSelesnyasVoice(final TrostaniSelesnyasVoice card) { + super(card); + } + + @Override + public TrostaniSelesnyasVoice copy() { + return new TrostaniSelesnyasVoice(this); + } +} + +class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl { + + public TrostaniSelesnyasVoiceTriggeredAbility() { + super(Zone.BATTLEFIELD, new TrostaniSelesnyasVoiceEffect(), false); + } + + public TrostaniSelesnyasVoiceTriggeredAbility(TrostaniSelesnyasVoiceTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD + && permanent.getCardType().contains(CardType.CREATURE) + && permanent.getControllerId().equals(this.controllerId) + && event.getTargetId() != this.getSourceId()) { + Effect effect = this.getEffects().get(0); + effect.setValue("lifeSource", event.getTargetId()); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever another creature enters the battlefield under your control, you gain life equal to that creature's toughness."; + } + + @Override + public TrostaniSelesnyasVoiceTriggeredAbility copy() { + return new TrostaniSelesnyasVoiceTriggeredAbility(this); + } +} + +class TrostaniSelesnyasVoiceEffect extends OneShotEffect { + + public TrostaniSelesnyasVoiceEffect() { + super(Constants.Outcome.GainLife); + staticText = "you gain life equal to its toughness"; + } + + public TrostaniSelesnyasVoiceEffect(final TrostaniSelesnyasVoiceEffect effect) { + super(effect); + } + + @Override + public TrostaniSelesnyasVoiceEffect copy() { + return new TrostaniSelesnyasVoiceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID creatureId = (UUID) getValue("lifeSource"); + Permanent creature = game.getPermanent(creatureId); + if (creature == null) { + creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD); + } + if (creature != null) { + int amount = creature.getToughness().getValue(); + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(amount, game); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TrostanisJudgment.java b/Mage.Sets/src/mage/sets/returntoravnica/TrostanisJudgment.java new file mode 100644 index 0000000000..85bd37601e --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/TrostanisJudgment.java @@ -0,0 +1,65 @@ +/* + * 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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevleX2 + */ +public class TrostanisJudgment extends CardImpl { + + public TrostanisJudgment(UUID ownerId) { + super(ownerId, 28, "Trostani's Judgment", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{5}{W}"); + this.expansionSetCode = "RTR"; + + this.color.setWhite(true); + + // Exile target creature, then populate. + // (Put a token onto the battlefield that's a copy of a creature token you control.) + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new PopulateEffect("then")); + } + + public TrostanisJudgment(final TrostanisJudgment card) { + super(card); + } + + @Override + public TrostanisJudgment copy() { + return new TrostanisJudgment(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VituGhaziGuildmage.java b/Mage.Sets/src/mage/sets/returntoravnica/VituGhaziGuildmage.java new file mode 100644 index 0000000000..73dcdd5691 --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/VituGhaziGuildmage.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.returntoravnica; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; + +/** + * + * @author LevelX2 + */ +public class VituGhaziGuildmage extends CardImpl { + + public VituGhaziGuildmage(UUID ownerId) { + super(ownerId, 207, "Vitu-Ghazi Guildmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{W}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Dryad"); + this.subtype.add("Shaman"); + this.color.setGreen(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {4}{G}{W}: Put a 3/3 green Centaur creature token onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new mage.game.permanent.token.CentaurToken()), new ManaCostsImpl("{4}{G}{W}"))); + + // {2}{G}{W}: Populate. (Put a token onto the battlefield that's a copy of a creature token you control.) + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PopulateEffect(), new ManaCostsImpl("{2}{G}{W}"))); + } + + public VituGhaziGuildmage(final VituGhaziGuildmage card) { + super(card); + } + + @Override + public VituGhaziGuildmage copy() { + return new VituGhaziGuildmage(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/WayfaringTemple.java b/Mage.Sets/src/mage/sets/returntoravnica/WayfaringTemple.java new file mode 100644 index 0000000000..6d2e05d87d --- /dev/null +++ b/Mage.Sets/src/mage/sets/returntoravnica/WayfaringTemple.java @@ -0,0 +1,75 @@ +/* +* 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.returntoravnica; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.PopulateEffect; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class WayfaringTemple extends CardImpl { + + public WayfaringTemple(UUID ownerId) { + super(ownerId, 209, "Wayfaring Temple", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Elemental"); + + this.color.setGreen(true); + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Wayfaring Temple's power and toughness are each equal to the number of creatures you control. + this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Constants.Duration.WhileOnBattlefield))); + + // Whenever Wayfaring Temple deals combat damage to a player, populate. (Put a token onto the battlefield that's a copy of a creature token you control.) + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PopulateEffect(), false)); + } + + public WayfaringTemple(final WayfaringTemple card) { + super(card); + } + + @Override + public WayfaringTemple copy() { + return new WayfaringTemple(this); + } +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/PopulateEffect.java b/Mage/src/mage/abilities/effects/common/PopulateEffect.java new file mode 100644 index 0000000000..ff83525800 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/PopulateEffect.java @@ -0,0 +1,110 @@ +/* + * Copyright 2011 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.abilities.effects.common; + +import mage.Constants.Outcome; +import mage.Constants.TargetController; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ + +// +// 701.27. Populate +// +// 701.27a To populate means to choose a creature token you control and put a +// token onto the battlefield that’s a copy of that creature token. +// +// 701.27b If you control no creature tokens when instructed to populate, you +// won’t put a token onto the battlefield. +// + + +public class PopulateEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterPermanent("token for populate"); + + static { + filter.add(new TokenPredicate()); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public PopulateEffect() { + this(""); + } + + public PopulateEffect(String prefixText) { + super(Outcome.Copy); + this.staticText = (prefixText.length()>0?prefixText+" p":"P")+"opulate (Put a token onto the battlefield that's a copy of a creature token you control.)"; + } + + public PopulateEffect(final PopulateEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Target target = new TargetPermanent(filter); + target.setRequired(true); + if (target.canChoose(source.getControllerId(), game)) { + player.choose(Outcome.Copy, target, source.getSourceId(), game); + Permanent tokenToCopy = game.getPermanent(target.getFirstTarget()); + if (tokenToCopy != null && tokenToCopy instanceof PermanentToken) { + Token newToken = ((PermanentToken) tokenToCopy).getToken().copy(); + if (newToken != null ) { + game.informPlayers("Token selected for populate: " + newToken.getName()); + return newToken.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + } + } + } + } + return false; + } + + @Override + public PopulateEffect copy() { + return new PopulateEffect(this); + } +} \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/CentaurToken.java b/Mage/src/mage/game/permanent/token/CentaurToken.java new file mode 100644 index 0000000000..ffe1e99570 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/CentaurToken.java @@ -0,0 +1,50 @@ +/* +* 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.game.permanent.token; + +import mage.Constants.CardType; +import mage.MageInt; +import mage.ObjectColor; + +/** + * + * @author LevelX2 + */ +public class CentaurToken extends Token { + + public CentaurToken() { + super("Centaur", "3/3 green Centaur creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.GREEN; + subtype.add("Centaur"); + power = new MageInt(3); + toughness = new MageInt(3); + } + +}