From cd13dcbcc488a58b421191e084e8823ecd03f9bc Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 29 Jun 2015 11:52:58 +0300 Subject: [PATCH 1/7] Implement cards: Crumbling Sanctuary, Ihsan's Shade, Lava Runner, and Nantuko Cultivator --- .../src/mage/sets/homelands/IhsansShade.java | 74 ++++++++++++ .../sets/masterseditionii/IhsansShade.java | 55 +++++++++ .../mercadianmasques/CrumblingSanctuary.java | 106 ++++++++++++++++ .../sets/mercadianmasques/LavaRunner.java | 108 +++++++++++++++++ .../mage/sets/torment/NantukoCultivator.java | 113 ++++++++++++++++++ 5 files changed, 456 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/homelands/IhsansShade.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/IhsansShade.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/CrumblingSanctuary.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/LavaRunner.java create mode 100644 Mage.Sets/src/mage/sets/torment/NantukoCultivator.java diff --git a/Mage.Sets/src/mage/sets/homelands/IhsansShade.java b/Mage.Sets/src/mage/sets/homelands/IhsansShade.java new file mode 100644 index 0000000000..3e4dc11a06 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/IhsansShade.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.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class IhsansShade extends CardImpl { + + private static final FilterCard filter = new FilterCard("white"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public IhsansShade(UUID ownerId) { + super(ownerId, 16, "Ihsan's Shade", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "HML"; + this.supertype.add("Legendary"); + this.subtype.add("Shade"); + this.subtype.add("Knight"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Protection from white + this.addAbility(new ProtectionAbility(filter)); + } + + public IhsansShade(final IhsansShade card) { + super(card); + } + + @Override + public IhsansShade copy() { + return new IhsansShade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/IhsansShade.java b/Mage.Sets/src/mage/sets/masterseditionii/IhsansShade.java new file mode 100644 index 0000000000..c252e9874c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/IhsansShade.java @@ -0,0 +1,55 @@ +/* + * 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.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class IhsansShade extends mage.sets.homelands.IhsansShade { + + public IhsansShade(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.RARE; + } + + public IhsansShade(final IhsansShade card) { + super(card); + } + + @Override + public IhsansShade copy() { + return new IhsansShade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CrumblingSanctuary.java b/Mage.Sets/src/mage/sets/mercadianmasques/CrumblingSanctuary.java new file mode 100644 index 0000000000..69087dd02a --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CrumblingSanctuary.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.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.PreventionEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author LoneFox + + */ +public class CrumblingSanctuary extends CardImpl { + + public CrumblingSanctuary(UUID ownerId) { + super(ownerId, 292, "Crumbling Sanctuary", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "MMQ"; + + // If damage would be dealt to a player, that player exiles that many cards from the top of his or her library instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CrumblingSanctuaryEffect())); + } + + public CrumblingSanctuary(final CrumblingSanctuary card) { + super(card); + } + + @Override + public CrumblingSanctuary copy() { + return new CrumblingSanctuary(this); + } +} + +class CrumblingSanctuaryEffect extends PreventionEffectImpl { + + public CrumblingSanctuaryEffect() { + super(Duration.WhileOnBattlefield, Integer.MAX_VALUE, false, false); + staticText = "If damage would be dealt to a player, that player exiles that many cards from the top of his or her library instead."; + } + + public CrumblingSanctuaryEffect(final CrumblingSanctuaryEffect effect) { + super(effect); + } + + @Override + public CrumblingSanctuaryEffect copy() { + return new CrumblingSanctuaryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + int amount = event.getAmount(); + Player player = game.getPlayer(event.getTargetId()); + if(player != null) { + preventDamageAction(event, source, game); + player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.EXILED, source, game); + return true; + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return super.applies(event, source, game) && (game.getPlayer(event.getTargetId()) != null); + } + +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/LavaRunner.java b/Mage.Sets/src/mage/sets/mercadianmasques/LavaRunner.java new file mode 100644 index 0000000000..3ab5e2cfe7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/LavaRunner.java @@ -0,0 +1,108 @@ +/* + * 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.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.SacrificeEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LoneFox + + */ +public class LavaRunner extends CardImpl { + + public LavaRunner(UUID ownerId) { + super(ownerId, 200, "Lava Runner", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Lizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Whenever Lava Runner becomes the target of a spell or ability, that spell or ability's controller sacrifices a land. + this.addAbility(new LavaRunnerAbility()); + } + + public LavaRunner(final LavaRunner card) { + super(card); + } + + @Override + public LavaRunner copy() { + return new LavaRunner(this); + } +} + +class LavaRunnerAbility extends TriggeredAbilityImpl { + + public LavaRunnerAbility() { + super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterLandPermanent(), 1, ""), false); + } + + public LavaRunnerAbility(final LavaRunnerAbility ability) { + super(ability); + } + + @Override + public LavaRunnerAbility copy() { + return new LavaRunnerAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if(event.getTargetId().equals(this.getSourceId())) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} becomes the target of a spell or ability, that spell or ability's controller sacrifices a land."; + } +} diff --git a/Mage.Sets/src/mage/sets/torment/NantukoCultivator.java b/Mage.Sets/src/mage/sets/torment/NantukoCultivator.java new file mode 100644 index 0000000000..56b910855e --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/NantukoCultivator.java @@ -0,0 +1,113 @@ +/* + * 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.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterLandCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author LoneFox + + */ +public class NantukoCultivator extends CardImpl { + + public NantukoCultivator(UUID ownerId) { + super(ownerId, 133, "Nantuko Cultivator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Insect"); + this.subtype.add("Druid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Nantuko Cultivator enters the battlefield, you may discard any number of land cards. Put that many +1/+1 counters on Nantuko Cultivator and draw that many cards. + this.addAbility(new EntersBattlefieldTriggeredAbility(new NantukoCultivatorEffect(), true)); + } + + public NantukoCultivator(final NantukoCultivator card) { + super(card); + } + + @Override + public NantukoCultivator copy() { + return new NantukoCultivator(this); + } +} + +class NantukoCultivatorEffect extends OneShotEffect { + + public NantukoCultivatorEffect() { + super(Outcome.BoostCreature); + staticText = "you may discard any number of land cards. Put that many +1/+1 counters on {this} and draw that many cards."; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if(player != null) { + TargetCardInHand toDiscard = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterLandCard()); + if(player.chooseTarget(Outcome.Discard, toDiscard, source, game)) { + int count = 0; + for(UUID targetId: toDiscard.getTargets()) { + player.discard(game.getCard(targetId), source, game); + count++; + } + Permanent permanent = game.getPermanent(source.getSourceId()); + if(permanent != null) { + permanent.addCounters(CounterType.P1P1.createInstance(count), game); + } + player.drawCards(count, game); + } + return true; + } + return false; + } + + public NantukoCultivatorEffect(final NantukoCultivatorEffect effect) { + super(effect); + } + + @Override + public NantukoCultivatorEffect copy() { + return new NantukoCultivatorEffect(this); + } + +} From 6084fea92748c95b4844021d004bb1dfd36db5a9 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 29 Jun 2015 12:10:25 +0300 Subject: [PATCH 2/7] Add FilterEnchantmentCard and implement a card that uses it: Azorius First-Wing --- .../sets/dissension/AzoriusFirstWing.java | 67 +++++++++++++++++++ .../filter/common/FilterEnchantmentCard.java | 58 ++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/AzoriusFirstWing.java create mode 100644 Mage/src/mage/filter/common/FilterEnchantmentCard.java diff --git a/Mage.Sets/src/mage/sets/dissension/AzoriusFirstWing.java b/Mage.Sets/src/mage/sets/dissension/AzoriusFirstWing.java new file mode 100644 index 0000000000..fe31a8c266 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/AzoriusFirstWing.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.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterEnchantmentCard; + +/** + * + * @author LoneFox + + */ +public class AzoriusFirstWing extends CardImpl { + + public AzoriusFirstWing(UUID ownerId) { + super(ownerId, 105, "Azorius First-Wing", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}{U}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Griffin"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from enchantments + this.addAbility(new ProtectionAbility(new FilterEnchantmentCard("enchantments"))); + } + + public AzoriusFirstWing(final AzoriusFirstWing card) { + super(card); + } + + @Override + public AzoriusFirstWing copy() { + return new AzoriusFirstWing(this); + } +} diff --git a/Mage/src/mage/filter/common/FilterEnchantmentCard.java b/Mage/src/mage/filter/common/FilterEnchantmentCard.java new file mode 100644 index 0000000000..d30a6c7fda --- /dev/null +++ b/Mage/src/mage/filter/common/FilterEnchantmentCard.java @@ -0,0 +1,58 @@ +/* + * 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.filter.common; + +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author LoneFox + */ +public class FilterEnchantmentCard extends FilterCard { + + public FilterEnchantmentCard() { + this("enchantment"); + } + + public FilterEnchantmentCard(String name) { + super(name); + this.add(new CardTypePredicate(CardType.ENCHANTMENT)); + } + + public FilterEnchantmentCard(final FilterEnchantmentCard filter) { + super(filter); + } + + @Override + public FilterEnchantmentCard copy() { + return new FilterEnchantmentCard(this); + } +} From 8acf2990755e986b861bf005ed169de9b73c99f9 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 29 Jun 2015 12:11:14 +0300 Subject: [PATCH 3/7] Fix Southern Paladin's tooltip text --- Mage.Sets/src/mage/sets/seventhedition/SouthernPaladin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/seventhedition/SouthernPaladin.java b/Mage.Sets/src/mage/sets/seventhedition/SouthernPaladin.java index 4a7cacace6..587f6b8ae1 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/SouthernPaladin.java +++ b/Mage.Sets/src/mage/sets/seventhedition/SouthernPaladin.java @@ -50,7 +50,7 @@ import mage.target.TargetPermanent; */ public class SouthernPaladin extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("red"); + private static final FilterPermanent filter = new FilterPermanent("red permanent"); static { filter.add(new ColorPredicate(ObjectColor.RED)); From 0267061ced45f026b71a78d4f0c4fa7f7ebbb817 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 30 Jun 2015 09:17:07 +0300 Subject: [PATCH 4/7] Add BecomesColorSourceEffect. Use it for Spiritmonger and Wild Mongrel. Implement cards: Alloy Golem, Caldera Kavu, Kavu Chameleon, and Rainbow Crow --- .../mage/sets/apocalypse/Spiritmonger.java | 47 +------ .../src/mage/sets/invasion/AlloyGolem.java | 67 +++++++++ .../src/mage/sets/invasion/KavuChameleon.java | 71 ++++++++++ .../src/mage/sets/invasion/RainbowCrow.java | 71 ++++++++++ .../src/mage/sets/odyssey/WildMongrel.java | 48 +------ .../src/mage/sets/planeshift/CalderaKavu.java | 70 ++++++++++ .../continuous/BecomesColorSourceEffect.java | 128 ++++++++++++++++++ 7 files changed, 413 insertions(+), 89 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/invasion/AlloyGolem.java create mode 100644 Mage.Sets/src/mage/sets/invasion/KavuChameleon.java create mode 100644 Mage.Sets/src/mage/sets/invasion/RainbowCrow.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/CalderaKavu.java create mode 100644 Mage/src/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java diff --git a/Mage.Sets/src/mage/sets/apocalypse/Spiritmonger.java b/Mage.Sets/src/mage/sets/apocalypse/Spiritmonger.java index 41d8070f2c..0d08b363d4 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Spiritmonger.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Spiritmonger.java @@ -29,27 +29,18 @@ package mage.sets.apocalypse; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.DealsDamageToACreatureTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.RegenerateSourceEffect; -import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; /** * @@ -70,7 +61,7 @@ public class Spiritmonger extends CardImpl { // {B}: Regenerate Spiritmonger. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); // {G}: Spiritmonger becomes the color of your choice until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpiritmongerChangeColorEffect(), new ManaCostsImpl("{G}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}"))); } public Spiritmonger(final Spiritmonger card) { @@ -82,37 +73,3 @@ public class Spiritmonger extends CardImpl { return new Spiritmonger(this); } } - -class SpiritmongerChangeColorEffect extends OneShotEffect { - - public SpiritmongerChangeColorEffect() { - super(Outcome.Neutral); - staticText = "{this} becomes the color of your choice until end of turn"; - } - - public SpiritmongerChangeColorEffect(final SpiritmongerChangeColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent wildMongrel = game.getPermanent(source.getSourceId()); - if (player != null && wildMongrel != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.Neutral, colorChoice, game)) { - game.informPlayers(wildMongrel.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - ContinuousEffect effect = new BecomesColorTargetEffect(colorChoice.getColor(), Duration.EndOfTurn, "is " + colorChoice.getChoice()); - effect.setTargetPointer(new FixedTarget(source.getSourceId())); - game.addEffect(effect, source); - return true; - } - } - return false; - } - - @Override - public SpiritmongerChangeColorEffect copy() { - return new SpiritmongerChangeColorEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/invasion/AlloyGolem.java b/Mage.Sets/src/mage/sets/invasion/AlloyGolem.java new file mode 100644 index 0000000000..92799396ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/AlloyGolem.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class AlloyGolem extends CardImpl { + + public AlloyGolem(UUID ownerId) { + super(ownerId, 297, "Alloy Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + this.expansionSetCode = "INV"; + this.subtype.add("Golem"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // As Alloy Golem enters the battlefield, choose a color. + // Alloy Golem is the chosen color. + this.addAbility(new EntersBattlefieldAbility(new BecomesColorSourceEffect(Duration.WhileOnBattlefield), + null, true, "As {this} enters the battlefield, choose a color.\n{this} is the chosen color.", "")); + } + + public AlloyGolem(final AlloyGolem card) { + super(card); + } + + @Override + public AlloyGolem copy() { + return new AlloyGolem(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/KavuChameleon.java b/Mage.Sets/src/mage/sets/invasion/KavuChameleon.java new file mode 100644 index 0000000000..3390be985b --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/KavuChameleon.java @@ -0,0 +1,71 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CantBeCounteredSourceEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class KavuChameleon extends CardImpl { + + public KavuChameleon(UUID ownerId) { + super(ownerId, 191, "Kavu Chameleon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Kavu Chameleon can't be countered. + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantBeCounteredSourceEffect())); + // {G}: Kavu Chameleon becomes the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + } + + public KavuChameleon(final KavuChameleon card) { + super(card); + } + + @Override + public KavuChameleon copy() { + return new KavuChameleon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/RainbowCrow.java b/Mage.Sets/src/mage/sets/invasion/RainbowCrow.java new file mode 100644 index 0000000000..eea212e746 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/RainbowCrow.java @@ -0,0 +1,71 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class RainbowCrow extends CardImpl { + + public RainbowCrow(UUID ownerId) { + super(ownerId, 69, "Rainbow Crow", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "INV"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // + // {1}: Rainbow Crow becomes the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}"))); + } + + public RainbowCrow(final RainbowCrow card) { + super(card); + } + + @Override + public RainbowCrow copy() { + return new RainbowCrow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/WildMongrel.java b/Mage.Sets/src/mage/sets/odyssey/WildMongrel.java index 34bef98fed..99fa8ef85f 100644 --- a/Mage.Sets/src/mage/sets/odyssey/WildMongrel.java +++ b/Mage.Sets/src/mage/sets/odyssey/WildMongrel.java @@ -32,23 +32,15 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardTargetCost; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCardInHand; -import mage.target.targetpointer.FixedTarget; /** * @author magenoxx_at_gmail.com @@ -67,7 +59,9 @@ public class WildMongrel extends CardImpl { Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn); effect.setText("{this} gets +1/+1"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new DiscardTargetCost(new TargetCardInHand())); - ability.addEffect(new ChangeColorEffect()); + effect = new BecomesColorSourceEffect(Duration.EndOfTurn); + effect.setText("and becomes the color of your choice until end of turn."); + ability.addEffect(effect); this.addAbility(ability); } @@ -80,37 +74,3 @@ public class WildMongrel extends CardImpl { return new WildMongrel(this); } } - -class ChangeColorEffect extends OneShotEffect { - - public ChangeColorEffect() { - super(Outcome.Neutral); - staticText = "and becomes the color of your choice until end of turn"; - } - - public ChangeColorEffect(final ChangeColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent wildMongrel = game.getPermanent(source.getSourceId()); - if (player != null && wildMongrel != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.Neutral, colorChoice, game)) { - game.informPlayers(wildMongrel.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - ContinuousEffect effect = new BecomesColorTargetEffect(colorChoice.getColor(), Duration.EndOfTurn, "is " + colorChoice.getChoice()); - effect.setTargetPointer(new FixedTarget(source.getSourceId())); - game.addEffect(effect, source); - return true; - } - } - return false; - } - - @Override - public ChangeColorEffect copy() { - return new ChangeColorEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/planeshift/CalderaKavu.java b/Mage.Sets/src/mage/sets/planeshift/CalderaKavu.java new file mode 100644 index 0000000000..3ef6d7a9f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/CalderaKavu.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.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class CalderaKavu extends CardImpl { + + public CalderaKavu(UUID ownerId) { + super(ownerId, 58, "Caldera Kavu", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Kavu"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{B}: Caldera Kavu gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"))); + // {G}: Caldera Kavu becomes the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + } + + public CalderaKavu(final CalderaKavu card) { + super(card); + } + + @Override + public CalderaKavu copy() { + return new CalderaKavu(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java new file mode 100644 index 0000000000..e7205a7b5b --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java @@ -0,0 +1,128 @@ +/* + * + * 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.abilities.effects.common.continuous; + +import java.util.UUID; +import mage.MageObject; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.choices.ChoiceColor; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.game.Game; +import mage.players.Player; + +/** + * @author LoneFox + */ +public class BecomesColorSourceEffect extends ContinuousEffectImpl { + + private ObjectColor setColor; + + public BecomesColorSourceEffect(Duration duration) { + this(null, duration); + } + + public BecomesColorSourceEffect(ObjectColor setColor, Duration duration) { + super(duration, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit); + this.setColor = setColor; + } + + public BecomesColorSourceEffect(final BecomesColorSourceEffect effect) { + super(effect); + this.setColor = effect.setColor; + } + + @Override + public BecomesColorSourceEffect copy() { + return new BecomesColorSourceEffect(this); + } + + @Override + public void init(Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller == null) { + return; + } + if(setColor == null) { + ChoiceColor choice = new ChoiceColor(); + while(!choice.isChosen()) { + controller.choose(Outcome.PutManaInPool, choice, game); + if(!controller.isInGame()) { + return; + } + } + if(choice.getColor() != null) { + setColor = choice.getColor(); + } + else { + return; + } + if(!game.isSimulation()) { + game.informPlayers(controller.getLogName() + " has chosen the color: " + setColor.toString()); + } + } + super.init(source, game); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + if(setColor != null) { + MageObject sourceObject = game.getObject(source.getSourceId()); + if(sourceObject != null) { + sourceObject.getColor(game).setColor(setColor); + } + else { + this.discard(); + } + return true; + } else { + throw new UnsupportedOperationException("No color set"); + } + } + + @Override + public String getText(Mode mode) { + if(staticText != null && !staticText.isEmpty()) { + return staticText; + } + return "{this} becomes " + (setColor == null ? "the color of your choice" : setColor.getDescription()) + + " " + duration.toString(); + } +} From 60b8bdb08230329e32d9b51020d64fd657920edd Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 30 Jun 2015 09:56:26 +0300 Subject: [PATCH 5/7] Implement some trivial cards from Invasion --- .../mage/sets/invasion/GlimmeringAngel.java | 71 +++++++++++++++ .../src/mage/sets/invasion/HoodedKavu.java | 68 +++++++++++++++ .../src/mage/sets/invasion/NoblePanther.java | 68 +++++++++++++++ .../mage/sets/invasion/ObsidianAcolyte.java | 86 +++++++++++++++++++ .../src/mage/sets/invasion/RiptideCrab.java | 67 +++++++++++++++ .../mage/sets/invasion/SabertoothNishoba.java | 78 +++++++++++++++++ .../mage/sets/invasion/ShorelineRaider.java | 73 ++++++++++++++++ .../src/mage/sets/invasion/UrborgDrake.java | 66 ++++++++++++++ .../mage/sets/invasion/YavimayaBarbarian.java | 73 ++++++++++++++++ 9 files changed, 650 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/invasion/GlimmeringAngel.java create mode 100644 Mage.Sets/src/mage/sets/invasion/HoodedKavu.java create mode 100644 Mage.Sets/src/mage/sets/invasion/NoblePanther.java create mode 100644 Mage.Sets/src/mage/sets/invasion/ObsidianAcolyte.java create mode 100644 Mage.Sets/src/mage/sets/invasion/RiptideCrab.java create mode 100644 Mage.Sets/src/mage/sets/invasion/SabertoothNishoba.java create mode 100644 Mage.Sets/src/mage/sets/invasion/ShorelineRaider.java create mode 100644 Mage.Sets/src/mage/sets/invasion/UrborgDrake.java create mode 100644 Mage.Sets/src/mage/sets/invasion/YavimayaBarbarian.java diff --git a/Mage.Sets/src/mage/sets/invasion/GlimmeringAngel.java b/Mage.Sets/src/mage/sets/invasion/GlimmeringAngel.java new file mode 100644 index 0000000000..445e6635ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/GlimmeringAngel.java @@ -0,0 +1,71 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class GlimmeringAngel extends CardImpl { + + public GlimmeringAngel(UUID ownerId) { + super(ownerId, 17, "Glimmering Angel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Angel"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {U}: Glimmering Angel gains shroud until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(ShroudAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + } + + public GlimmeringAngel(final GlimmeringAngel card) { + super(card); + } + + @Override + public GlimmeringAngel copy() { + return new GlimmeringAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/HoodedKavu.java b/Mage.Sets/src/mage/sets/invasion/HoodedKavu.java new file mode 100644 index 0000000000..183e345912 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/HoodedKavu.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class HoodedKavu extends CardImpl { + + public HoodedKavu(UUID ownerId) { + super(ownerId, 147, "Hooded Kavu", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}: Hooded Kavu gains fear until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FearAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public HoodedKavu(final HoodedKavu card) { + super(card); + } + + @Override + public HoodedKavu copy() { + return new HoodedKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/NoblePanther.java b/Mage.Sets/src/mage/sets/invasion/NoblePanther.java new file mode 100644 index 0000000000..6c36ac2b5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/NoblePanther.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class NoblePanther extends CardImpl { + + public NoblePanther(UUID ownerId) { + super(ownerId, 257, "Noble Panther", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Cat"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {1}: Noble Panther gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}"))); + } + + public NoblePanther(final NoblePanther card) { + super(card); + } + + @Override + public NoblePanther copy() { + return new NoblePanther(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/ObsidianAcolyte.java b/Mage.Sets/src/mage/sets/invasion/ObsidianAcolyte.java new file mode 100644 index 0000000000..c66eca2dcf --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/ObsidianAcolyte.java @@ -0,0 +1,86 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class ObsidianAcolyte extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public ObsidianAcolyte(UUID ownerId) { + super(ownerId, 22, "Obsidian Acolyte", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + // {W}: Target creature gains protection from black until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ProtectionAbility(filter), Duration.EndOfTurn), new ManaCostsImpl("{W}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public ObsidianAcolyte(final ObsidianAcolyte card) { + super(card); + } + + @Override + public ObsidianAcolyte copy() { + return new ObsidianAcolyte(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/RiptideCrab.java b/Mage.Sets/src/mage/sets/invasion/RiptideCrab.java new file mode 100644 index 0000000000..f84917c312 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/RiptideCrab.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class RiptideCrab extends CardImpl { + + public RiptideCrab(UUID ownerId) { + super(ownerId, 266, "Riptide Crab", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{U}"); + this.expansionSetCode = "INV"; + this.subtype.add("Crab"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // When Riptide Crab dies, draw a card. + this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + } + + public RiptideCrab(final RiptideCrab card) { + super(card); + } + + @Override + public RiptideCrab copy() { + return new RiptideCrab(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/SabertoothNishoba.java b/Mage.Sets/src/mage/sets/invasion/SabertoothNishoba.java new file mode 100644 index 0000000000..1865864369 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/SabertoothNishoba.java @@ -0,0 +1,78 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class SabertoothNishoba extends CardImpl { + + private static final FilterCard filter = new FilterCard("blue and from red"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLUE), new ColorPredicate(ObjectColor.RED))); + } + + public SabertoothNishoba(UUID ownerId) { + super(ownerId, 268, "Sabertooth Nishoba", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Cat"); + this.subtype.add("Beast"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // protection from blue and from red + this.addAbility(new ProtectionAbility(filter)); + } + + public SabertoothNishoba(final SabertoothNishoba card) { + super(card); + } + + @Override + public SabertoothNishoba copy() { + return new SabertoothNishoba(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/ShorelineRaider.java b/Mage.Sets/src/mage/sets/invasion/ShorelineRaider.java new file mode 100644 index 0000000000..1e12aeb986 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/ShorelineRaider.java @@ -0,0 +1,73 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + + */ +public class ShorelineRaider extends CardImpl { + + private static final FilterCard filter = new FilterCard("Kavu"); + + static { + filter.add(new SubtypePredicate("Kavu")); + } + + + public ShorelineRaider(UUID ownerId) { + super(ownerId, 73, "Shoreline Raider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "INV"; + this.subtype.add("Merfolk"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Protection from Kavu + this.addAbility(new ProtectionAbility(filter)); + } + + public ShorelineRaider(final ShorelineRaider card) { + super(card); + } + + @Override + public ShorelineRaider copy() { + return new ShorelineRaider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/UrborgDrake.java b/Mage.Sets/src/mage/sets/invasion/UrborgDrake.java new file mode 100644 index 0000000000..70b2e6962c --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/UrborgDrake.java @@ -0,0 +1,66 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class UrborgDrake extends CardImpl { + + public UrborgDrake(UUID ownerId) { + super(ownerId, 283, "Urborg Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{B}"); + this.expansionSetCode = "INV"; + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Urborg Drake attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + } + + public UrborgDrake(final UrborgDrake card) { + super(card); + } + + @Override + public UrborgDrake copy() { + return new UrborgDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/YavimayaBarbarian.java b/Mage.Sets/src/mage/sets/invasion/YavimayaBarbarian.java new file mode 100644 index 0000000000..7ac05ce33a --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/YavimayaBarbarian.java @@ -0,0 +1,73 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class YavimayaBarbarian extends CardImpl { + + private static final FilterCard filter = new FilterCard("blue"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public YavimayaBarbarian(UUID ownerId) { + super(ownerId, 290, "Yavimaya Barbarian", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}{G}"); + this.expansionSetCode = "INV"; + this.subtype.add("Elf"); + this.subtype.add("Barbarian"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Protection from blue + this.addAbility(new ProtectionAbility(filter)); + } + + public YavimayaBarbarian(final YavimayaBarbarian card) { + super(card); + } + + @Override + public YavimayaBarbarian copy() { + return new YavimayaBarbarian(this); + } +} From e9ea86bc65cd5fa0cdd7d9ea7200bbe8fb61a257 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 30 Jun 2015 10:42:25 +0300 Subject: [PATCH 6/7] Implement the Emissary cycle from Invasion --- .../mage/sets/invasion/BenalishEmissary.java | 75 ++++++++++++++++ .../mage/sets/invasion/ShivanEmissary.java | 85 +++++++++++++++++++ .../mage/sets/invasion/TolarianEmissary.java | 78 +++++++++++++++++ .../mage/sets/invasion/UrborgEmissary.java | 75 ++++++++++++++++ 4 files changed, 313 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/invasion/BenalishEmissary.java create mode 100644 Mage.Sets/src/mage/sets/invasion/ShivanEmissary.java create mode 100644 Mage.Sets/src/mage/sets/invasion/TolarianEmissary.java create mode 100644 Mage.Sets/src/mage/sets/invasion/UrborgEmissary.java diff --git a/Mage.Sets/src/mage/sets/invasion/BenalishEmissary.java b/Mage.Sets/src/mage/sets/invasion/BenalishEmissary.java new file mode 100644 index 0000000000..b57b7f379a --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/BenalishEmissary.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + + */ +public class BenalishEmissary extends CardImpl { + + public BenalishEmissary(UUID ownerId) { + super(ownerId, 5, "Benalish Emissary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Kicker {1}{G} + this.addAbility(new KickerAbility("{1}{G}")); + // When Benalish Emissary enters the battlefield, if it was kicked, destroy target land. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + "When {this} enters the battlefield, if it was kicked, destroy target land.")); + } + + public BenalishEmissary(final BenalishEmissary card) { + super(card); + } + + @Override + public BenalishEmissary copy() { + return new BenalishEmissary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/ShivanEmissary.java b/Mage.Sets/src/mage/sets/invasion/ShivanEmissary.java new file mode 100644 index 0000000000..b99c94748f --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/ShivanEmissary.java @@ -0,0 +1,85 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class ShivanEmissary extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public ShivanEmissary(UUID ownerId) { + super(ownerId, 166, "Shivan Emissary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Kicker {1}{B} + this.addAbility(new KickerAbility("{1}{B}")); + // When Shivan Emissary enters the battlefield, if it was kicked, destroy target nonblack creature. It can't be regenerated. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(true)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + "When {this} enters the battlefield, if it was kicked, destroy target nonblack creature. It can't be regenerated.")); + } + + public ShivanEmissary(final ShivanEmissary card) { + super(card); + } + + @Override + public ShivanEmissary copy() { + return new ShivanEmissary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/TolarianEmissary.java b/Mage.Sets/src/mage/sets/invasion/TolarianEmissary.java new file mode 100644 index 0000000000..91d7eff0e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/TolarianEmissary.java @@ -0,0 +1,78 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + + */ +public class TolarianEmissary extends CardImpl { + + public TolarianEmissary(UUID ownerId) { + super(ownerId, 81, "Tolarian Emissary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "INV"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Kicker {1}{W} + this.addAbility(new KickerAbility("{1}{W}")); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Tolarian Emissary enters the battlefield, if it was kicked, destroy target enchantment. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + "When {this} enters the battlefield, if it was kicked, destroy target enchantment.")); + } + + public TolarianEmissary(final TolarianEmissary card) { + super(card); + } + + @Override + public TolarianEmissary copy() { + return new TolarianEmissary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/UrborgEmissary.java b/Mage.Sets/src/mage/sets/invasion/UrborgEmissary.java new file mode 100644 index 0000000000..8ebec497e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/UrborgEmissary.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + + */ +public class UrborgEmissary extends CardImpl { + + public UrborgEmissary(UUID ownerId) { + super(ownerId, 131, "Urborg Emissary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "INV"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Kicker {1}{U} + this.addAbility(new KickerAbility("{1}{U}")); + // When Urborg Emissary enters the battlefield, if it was kicked, return target permanent to its owner's hand. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); + ability.addTarget(new TargetPermanent()); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + "When {this} enters the battlefield, if it was kicked, return target permanent to its owner's hand.")); + } + + public UrborgEmissary(final UrborgEmissary card) { + super(card); + } + + @Override + public UrborgEmissary copy() { + return new UrborgEmissary(this); + } +} From 215af147be225b30d7222d932c71643e2aadfb74 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 30 Jun 2015 11:17:15 +0300 Subject: [PATCH 7/7] Implement cards: Ardent Soldier, Faerie Squadron, Kavu Aggressor, and Prison Barricade --- .../src/mage/sets/invasion/ArdentSoldier.java | 74 +++++++++++++++++ .../mage/sets/invasion/FaerieSquadron.java | 77 ++++++++++++++++++ .../src/mage/sets/invasion/KavuAggressor.java | 73 +++++++++++++++++ .../mage/sets/invasion/PrisonBarricade.java | 80 +++++++++++++++++++ 4 files changed, 304 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java create mode 100644 Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java create mode 100644 Mage.Sets/src/mage/sets/invasion/KavuAggressor.java create mode 100644 Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java diff --git a/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java b/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java new file mode 100644 index 0000000000..8fb23c7cc3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.KickerAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + + */ +public class ArdentSoldier extends CardImpl { + + public ArdentSoldier(UUID ownerId) { + super(ownerId, 3, "Ardent Soldier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Kicker {2} + this.addAbility(new KickerAbility("{2}")); + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // If Ardent Soldier was kicked, it enters the battlefield with a +1/+1 counter on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), + KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); + } + + public ArdentSoldier(final ArdentSoldier card) { + super(card); + } + + @Override + public ArdentSoldier copy() { + return new ArdentSoldier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java b/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java new file mode 100644 index 0000000000..d463f15af2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.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.invasion; + + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + + */ +public class FaerieSquadron extends CardImpl { + + public FaerieSquadron(UUID ownerId) { + super(ownerId, 58, "Faerie Squadron", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "INV"; + this.subtype.add("Faerie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Kicker {3}{U} + this.addAbility(new KickerAbility("{3}{U}")); + // If Faerie Squadron was kicked, it enters the battlefield with two +1/+1 counters on it and with flying. + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), + KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", ""); + ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); + this.addAbility(ability); + } + + public FaerieSquadron(final FaerieSquadron card) { + super(card); + } + + @Override + public FaerieSquadron copy() { + return new FaerieSquadron(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java b/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java new file mode 100644 index 0000000000..b0ce21efa9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java @@ -0,0 +1,73 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + + */ +public class KavuAggressor extends CardImpl { + + public KavuAggressor(UUID ownerId) { + super(ownerId, 148, "Kavu Aggressor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Kicker {4} + this.addAbility(new KickerAbility("{4}")); + // Kavu Aggressor can't block. + this.addAbility(new CantBlockAbility()); + // If Kavu Aggressor was kicked, it enters the battlefield with a +1/+1 counter on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), + KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); + } + + public KavuAggressor(final KavuAggressor card) { + super(card); + } + + @Override + public KavuAggressor copy() { + return new KavuAggressor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java b/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java new file mode 100644 index 0000000000..308b7b9a5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + + */ +public class PrisonBarricade extends CardImpl { + + public PrisonBarricade(UUID ownerId) { + super(ownerId, 25, "Prison Barricade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "INV"; + this.subtype.add("Wall"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Kicker {1}{W} + this.addAbility(new KickerAbility("{1}{W}")); + // If Prison Barricade was kicked, it enters the battlefield with a +1/+1 counter on it and with "Prison Barricade can attack as though it didn't have defender." + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), + KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", ""); + ability.addEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); + this.addAbility(ability); + } + + public PrisonBarricade(final PrisonBarricade card) { + super(card); + } + + @Override + public PrisonBarricade copy() { + return new PrisonBarricade(this); + } +}