From 6830b9c903c33485870c2c798633dd6aaf1168c9 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 10 Nov 2015 12:07:29 +0200 Subject: [PATCH 1/8] Implement cards: Acorn Catapult, Lunar Avenger, Plunder, and Storm Spirit --- .../mage/sets/commander/AcornCatapult.java | 111 ++++++++++++++ .../src/mage/sets/fifthdawn/LunarAvenger.java | 139 ++++++++++++++++++ .../src/mage/sets/iceage/StormSpirit.java | 52 +++++++ .../sets/masterseditionii/StormSpirit.java | 73 +++++++++ .../src/mage/sets/timespiral/Plunder.java | 73 +++++++++ 5 files changed, 448 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/AcornCatapult.java create mode 100644 Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java create mode 100644 Mage.Sets/src/mage/sets/iceage/StormSpirit.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/Plunder.java diff --git a/Mage.Sets/src/mage/sets/commander/AcornCatapult.java b/Mage.Sets/src/mage/sets/commander/AcornCatapult.java new file mode 100644 index 00000000000..c1bcbce94e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/AcornCatapult.java @@ -0,0 +1,111 @@ +/* + * 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.commander; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.SquirrelToken; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class AcornCatapult extends CardImpl { + + public AcornCatapult(UUID ownerId) { + super(ownerId, 241, "Acorn Catapult", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "CMD"; + + // {1}, {tap}: Acorn Catapult deals 1 damage to target creature or player. That creature's controller or that player puts a 1/1 green Squirrel creature token onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addEffect(new AcornCatapultEffect()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AcornCatapult(final AcornCatapult card) { + super(card); + } + + @Override + public AcornCatapult copy() { + return new AcornCatapult(this); + } +} + + +class AcornCatapultEffect extends OneShotEffect { + + public AcornCatapultEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "that creature's controller or that player puts a 1/1 green Squirrel creature token onto the battlefield"; + } + + public AcornCatapultEffect(final AcornCatapultEffect effect) { + super(effect); + } + + @Override + public AcornCatapultEffect copy() { + return new AcornCatapultEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = getTargetPointer().getFirst(game, source); + Player player = game.getPlayer(targetId); + if(player == null) { + Permanent permanent = game.getPermanent(targetId); + if(permanent != null) { + player = game.getPlayer(permanent.getControllerId()); + } + } + + if(player != null) { + new SquirrelToken().putOntoBattlefield(1, game, source.getSourceId(), player.getId()); + return true; + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java b/Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java new file mode 100644 index 00000000000..99f441658eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java @@ -0,0 +1,139 @@ +/* + * 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.fifthdawn; + +import java.util.HashSet; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.SunburstAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +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.players.Player; + +/** + * + * @author LoneFox + */ +public class LunarAvenger extends CardImpl { + + public LunarAvenger(UUID ownerId) { + super(ownerId, 136, "Lunar Avenger", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "5DN"; + this.subtype.add("Golem"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sunburst + this.addAbility(new SunburstAbility(this)); + // Remove a +1/+1 counter from Lunar Avenger: Lunar Avenger gains your choice of flying, first strike, or haste until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LunarAvengerEffect(), + new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)))); + } + + public LunarAvenger(final LunarAvenger card) { + super(card); + } + + @Override + public LunarAvenger copy() { + return new LunarAvenger(this); + } +} + + +class LunarAvengerEffect extends OneShotEffect { + + private static final HashSet choices = new HashSet<>(); + + static { + choices.add("Flying"); + choices.add("First Strike"); + choices.add("Haste"); + } + + public LunarAvengerEffect() { + super(Outcome.AddAbility); + staticText = "{this} gains your choice of flying, first strike, or haste until end of turn"; + } + + public LunarAvengerEffect(final LunarAvengerEffect effect) { + super(effect); + } + + @Override + public LunarAvengerEffect copy() { + return new LunarAvengerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose ability to add"); + choice.setChoices(choices); + while(!controller.choose(outcome, choice, game)) { + if(controller.canRespond()) { + return false; + } + } + + Ability gainedAbility; + String chosen = choice.getChoice(); + if(chosen.equals("Flying")) { + gainedAbility = FlyingAbility.getInstance(); + } + else if(chosen.equals("First strike")) { + gainedAbility = FirstStrikeAbility.getInstance(); + } + else { + gainedAbility = HasteAbility.getInstance(); + } + + game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/StormSpirit.java b/Mage.Sets/src/mage/sets/iceage/StormSpirit.java new file mode 100644 index 00000000000..c59492cc623 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/StormSpirit.java @@ -0,0 +1,52 @@ +/* + * 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.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class StormSpirit extends mage.sets.masterseditionii.StormSpirit { + + public StormSpirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 381; + this.expansionSetCode = "ICE"; + } + + public StormSpirit(final StormSpirit card) { + super(card); + } + + @Override + public StormSpirit copy() { + return new StormSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.java b/Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.java new file mode 100644 index 00000000000..1bfc7f9e771 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.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.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class StormSpirit extends CardImpl { + + public StormSpirit(UUID ownerId) { + super(ownerId, 198, "Storm Spirit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{W}{U}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Elemental"); + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {tap}: Storm Spirit deals 2 damage to target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public StormSpirit(final StormSpirit card) { + super(card); + } + + @Override + public StormSpirit copy() { + return new StormSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Plunder.java b/Mage.Sets/src/mage/sets/timespiral/Plunder.java new file mode 100644 index 00000000000..f92736792d8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Plunder.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.timespiral; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Plunder extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or land"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.LAND))); + } + + public Plunder(UUID ownerId) { + super(ownerId, 174, "Plunder", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{R}"); + this.expansionSetCode = "TSP"; + + // Destroy target artifact or land. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + // Suspend 4-{1}{R} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{1}{R}"), this)); + } + + public Plunder(final Plunder card) { + super(card); + } + + @Override + public Plunder copy() { + return new Plunder(this); + } +} From c33e7ad59b9c8e6e0c86c137b2bc234164e2d9d1 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 10 Nov 2015 20:35:48 +0200 Subject: [PATCH 2/8] Add support for selecting the counter type during resolution to RemoveCounterTargetEffect. Use it for existing cards. Fix some tooltip text issues with the effect. Implement cards: Ferropede and Spinal Parasite --- .../src/mage/sets/fifthdawn/Ferropede.java | 70 ++++++++++++++ .../mage/sets/fifthdawn/SpinalParasite.java | 74 +++++++++++++++ .../mage/sets/gatecrash/ThrullParasite.java | 91 +------------------ .../mage/sets/shadowmoor/MedicineRunner.java | 86 +----------------- .../mage/abilities/TriggeredAbilityImpl.java | 3 +- .../counter/RemoveCounterTargetEffect.java | 82 +++++++++++++---- 6 files changed, 216 insertions(+), 190 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/fifthdawn/Ferropede.java create mode 100644 Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.java diff --git a/Mage.Sets/src/mage/sets/fifthdawn/Ferropede.java b/Mage.Sets/src/mage/sets/fifthdawn/Ferropede.java new file mode 100644 index 00000000000..f680e10eea1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/Ferropede.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.fifthdawn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Ferropede extends CardImpl { + + public Ferropede(UUID ownerId) { + super(ownerId, 122, "Ferropede", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "5DN"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Ferropede is unblockable. + this.addAbility(new CantBeBlockedSourceAbility()); + // Whenever Ferropede deals combat damage to a player, you may remove a counter from target permanent. + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new RemoveCounterTargetEffect(), true); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public Ferropede(final Ferropede card) { + super(card); + } + + @Override + public Ferropede copy() { + return new Ferropede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.java b/Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.java new file mode 100644 index 00000000000..c80e6946367 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.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.fifthdawn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; +import mage.abilities.keyword.SunburstAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class SpinalParasite extends CardImpl { + + public SpinalParasite(UUID ownerId) { + super(ownerId, 155, "Spinal Parasite", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "5DN"; + this.subtype.add("Insect"); + this.power = new MageInt(-1); + this.toughness = new MageInt(-1); + + // Sunburst + this.addAbility(new SunburstAbility(this)); + // Remove two +1/+1 counters from Spinal Parasite: Remove a counter from target permanent. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(), + new RemoveCountersSourceCost(CounterType.P1P1.createInstance(2))); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public SpinalParasite(final SpinalParasite card) { + super(card); + } + + @Override + public SpinalParasite copy() { + return new SpinalParasite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java b/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java index e989bcca14d..d53ebeca491 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java @@ -27,29 +27,18 @@ */ package mage.sets.gatecrash; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; import mage.abilities.keyword.ExtortAbility; import mage.cards.CardImpl; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.Counter; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetNonlandPermanent; /** @@ -69,7 +58,7 @@ public class ThrullParasite extends CardImpl { // Extort this.addAbility(new ExtortAbility()); // {tap}, Pay 2 life: Remove a counter from target nonland permanent. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(),new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(), new TapSourceCost()); ability.addTarget(new TargetNonlandPermanent()); ability.addCost(new PayLifeCost(2)); this.addAbility(ability); @@ -84,75 +73,3 @@ public class ThrullParasite extends CardImpl { return new ThrullParasite(this); } } - -class RemoveCounterTargetEffect extends OneShotEffect { - - private CounterType counterTypeToRemove; - - public RemoveCounterTargetEffect() { - super(Outcome.Detriment); - this.staticText = "Remove a counter from target nonland permanent"; - } - - public RemoveCounterTargetEffect(CounterType counterTypeToRemove) { - super(Outcome.Detriment); - this.staticText = "Remove a " + counterTypeToRemove.getName() + " counter from target nonland permanent"; - this.counterTypeToRemove = counterTypeToRemove; - } - - public RemoveCounterTargetEffect(final RemoveCounterTargetEffect effect) { - super(effect); - this.counterTypeToRemove = effect.counterTypeToRemove; - } - - @Override - public RemoveCounterTargetEffect copy() { - return new RemoveCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - boolean result = false; - Player controller = game.getPlayer(source.getControllerId()); - for (UUID targetId: getTargetPointer().getTargets(game, source)) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - if (permanent.getCounters().size() > 0 && (counterTypeToRemove == null || permanent.getCounters().containsKey(counterTypeToRemove))) { - String counterName = null; - if (counterTypeToRemove != null) { - counterName = counterTypeToRemove.getName(); - } else { - if (permanent.getCounters().size() > 1 && counterTypeToRemove == null) { - Choice choice = new ChoiceImpl(true); - Set choices = new HashSet(); - for (Counter counter : permanent.getCounters().values()) { - if (permanent.getCounters().getCount(counter.getName()) > 0) { - choices.add(counter.getName()); - } - } - choice.setChoices(choices); - choice.setMessage("Choose a counter type to remove from " + permanent.getName()); - controller.choose(Outcome.Detriment, choice, game); - counterName = choice.getChoice(); - } else { - for (Counter counter : permanent.getCounters().values()) { - if (counter.getCount() > 0) { - counterName = counter.getName(); - } - } - } - } - if (counterName != null) { - permanent.removeCounters(counterName, 1, game); - if (permanent.getCounters().getCount(counterName) == 0 ){ - permanent.getCounters().removeCounter(counterName); - } - result |= true; - game.informPlayers(new StringBuilder(controller.getLogName()).append(" removes a ").append(counterName).append(" counter from ").append(permanent.getName()).toString()); - } - } - } - } - return result; - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java b/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java index 002c393ef77..5c122ca7ae3 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java @@ -27,29 +27,19 @@ */ package mage.sets.shadowmoor; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; import mage.cards.CardImpl; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.counters.Counter; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; /** * - * @author jeffwadsworth using code from LevelX + * @author jeffwadsworth */ public class MedicineRunner extends CardImpl { @@ -77,75 +67,3 @@ public class MedicineRunner extends CardImpl { return new MedicineRunner(this); } } - -class RemoveCounterTargetEffect extends OneShotEffect { - - private CounterType counterTypeToRemove; - - public RemoveCounterTargetEffect() { - super(Outcome.Detriment); - this.staticText = "remove a counter from target permanent"; - } - - public RemoveCounterTargetEffect(CounterType counterTypeToRemove) { - super(Outcome.Detriment); - this.staticText = "remove a " + counterTypeToRemove.getName() + " counter from target permanent"; - this.counterTypeToRemove = counterTypeToRemove; - } - - public RemoveCounterTargetEffect(final RemoveCounterTargetEffect effect) { - super(effect); - this.counterTypeToRemove = effect.counterTypeToRemove; - } - - @Override - public RemoveCounterTargetEffect copy() { - return new RemoveCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - boolean result = false; - Player controller = game.getPlayer(source.getControllerId()); - for (UUID targetId : getTargetPointer().getTargets(game, source)) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - if (permanent.getCounters().size() > 0 && (counterTypeToRemove == null || permanent.getCounters().containsKey(counterTypeToRemove))) { - String counterName = null; - if (counterTypeToRemove != null) { - counterName = counterTypeToRemove.getName(); - } else { - if (permanent.getCounters().size() > 1 && counterTypeToRemove == null) { - Choice choice = new ChoiceImpl(true); - Set choices = new HashSet<>(); - for (Counter counter : permanent.getCounters().values()) { - if (permanent.getCounters().getCount(counter.getName()) > 0) { - choices.add(counter.getName()); - } - } - choice.setChoices(choices); - choice.setMessage("Choose a counter type to remove from " + permanent.getName()); - controller.choose(Outcome.Detriment, choice, game); - counterName = choice.getChoice(); - } else { - for (Counter counter : permanent.getCounters().values()) { - if (counter.getCount() > 0) { - counterName = counter.getName(); - } - } - } - } - if (counterName != null) { - permanent.removeCounters(counterName, 1, game); - if (permanent.getCounters().getCount(counterName) == 0) { - permanent.getCounters().removeCounter(counterName); - } - result |= true; - game.informPlayers(new StringBuilder(controller.getLogName()).append(" removes a ").append(counterName).append(" counter from ").append(permanent.getName()).toString()); - } - } - } - } - return result; - } -} diff --git a/Mage/src/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/mage/abilities/TriggeredAbilityImpl.java index aabda88d3c6..2db3f564bdd 100644 --- a/Mage/src/mage/abilities/TriggeredAbilityImpl.java +++ b/Mage/src/mage/abilities/TriggeredAbilityImpl.java @@ -133,7 +133,8 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge || ruleLow.startsWith("return") || ruleLow.startsWith("tap") || ruleLow.startsWith("untap") - || ruleLow.startsWith("put")) { + || ruleLow.startsWith("put") + || ruleLow.startsWith("remove")) { sb.append("you may "); } else { if (!ruleLow.startsWith("its controller may")) { diff --git a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java index 5b651f6662d..9f636d65b52 100644 --- a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java @@ -28,14 +28,19 @@ package mage.abilities.effects.common.counter; +import java.util.HashSet; +import java.util.Set; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; import mage.constants.Outcome; import mage.counters.Counter; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; import mage.util.CardUtil; /** @@ -46,6 +51,11 @@ import mage.util.CardUtil; public class RemoveCounterTargetEffect extends OneShotEffect { private final Counter counter; + public RemoveCounterTargetEffect() { + super(Outcome.UnboostCreature); + counter = null; + } + public RemoveCounterTargetEffect(Counter counter) { super(Outcome.UnboostCreature); this.counter = counter; @@ -53,21 +63,24 @@ public class RemoveCounterTargetEffect extends OneShotEffect { public RemoveCounterTargetEffect(RemoveCounterTargetEffect effect) { super(effect); - this.counter = effect.counter.copy(); + this.counter = effect.counter == null ? null : effect.counter.copy(); } @Override public boolean apply(Game game, Ability source) { Permanent p = game.getPermanent(targetPointer.getFirst(game, source)); - if (p != null && p.getCounters().getCount(counter.getName()) >= counter.getCount()) { - p.removeCounters(counter.getName(), counter.getCount(), game); - if (!game.isSimulation()) - game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) - .append(" counter from ").append(p.getName()).toString()); - return true; + if(p != null) { + Counter toRemove = (counter == null ? selectCounterType(game, source, p) : counter); + if(toRemove != null && p.getCounters().getCount(toRemove.getName()) >= toRemove.getCount()) { + p.removeCounters(toRemove.getName(), toRemove.getCount(), game); + if(!game.isSimulation()) + game.informPlayers("Removed " + toRemove.getCount() + " " + toRemove.getName() + + " counter from " + p.getName()); + return true; + } } Card c = game.getCard(targetPointer.getFirst(game, source)); - if (c != null && c.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { + if (c != null && counter != null && c.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { c.removeCounters(counter.getName(), counter.getCount(), game); if (!game.isSimulation()) game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) @@ -78,21 +91,54 @@ public class RemoveCounterTargetEffect extends OneShotEffect { return false; } + private Counter selectCounterType(Game game, Ability source, Permanent permanent) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null && permanent.getCounters().size() > 0) { + String counterName = null; + if(permanent.getCounters().size() > 1) { + Choice choice = new ChoiceImpl(true); + Set choices = new HashSet<>(); + for(Counter counter : permanent.getCounters().values()) { + if (permanent.getCounters().getCount(counter.getName()) > 0) { + choices.add(counter.getName()); + } + } + choice.setChoices(choices); + choice.setMessage("Choose a counter type to remove from " + permanent.getName()); + controller.choose(Outcome.Detriment, choice, game); + counterName = choice.getChoice(); + } else { + for(Counter counter : permanent.getCounters().values()) { + if(counter.getCount() > 0) { + counterName = counter.getName(); + } + } + } + return new Counter(counterName); + } + return null; + } + @Override public RemoveCounterTargetEffect copy() { return new RemoveCounterTargetEffect(this); } @Override - public String getText(Mode mode) { - if (staticText != null && !staticText.isEmpty()) { - return staticText; - } - StringBuilder sb = new StringBuilder("remove "); - sb.append(CardUtil.numberToText(counter.getCount(), "a")); - sb.append(" ").append(counter.getName()); - sb.append(counter.getCount() > 1 ?" counters from ":" counter from "); - sb.append(mode.getTargets().get(0).getTargetName()); - return sb.toString(); + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + + String text = "remove "; + if(counter == null) { + text += "a counter"; + } + else { + text += CardUtil.numberToText(counter.getCount(), "a") + " " + counter.getName(); + text += counter.getCount() > 1 ? " counters" : " counter"; + } + text += " from target " + mode.getTargets().get(0).getTargetName(); + return text; } } From 2c23d23566db62e7cee714fa4b4eb1c036a00c69 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 10 Nov 2015 21:11:11 +0200 Subject: [PATCH 3/8] Fix PlayWithTheTopCardRevealedEffect's text. Implement cards: Field of Dreams and Wizened Snitches --- .../src/mage/sets/legends/FieldOfDreams.java | 61 +++++++++++++++++ .../mage/sets/ravnica/WizenedSnitches.java | 68 +++++++++++++++++++ .../PlayWithTheTopCardRevealedEffect.java | 8 +-- 3 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/legends/FieldOfDreams.java create mode 100644 Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.java diff --git a/Mage.Sets/src/mage/sets/legends/FieldOfDreams.java b/Mage.Sets/src/mage/sets/legends/FieldOfDreams.java new file mode 100644 index 00000000000..5b44a48f7ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/FieldOfDreams.java @@ -0,0 +1,61 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FieldOfDreams extends CardImpl { + + public FieldOfDreams(UUID ownerId) { + super(ownerId, 55, "Field of Dreams", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "LEG"; + this.supertype.add("World"); + + // Players play with the top card of their libraries revealed. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect(true))); + } + + public FieldOfDreams(final FieldOfDreams card) { + super(card); + } + + @Override + public FieldOfDreams copy() { + return new FieldOfDreams(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.java b/Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.java new file mode 100644 index 00000000000..ae7d34724e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.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.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class WizenedSnitches extends CardImpl { + + public WizenedSnitches(UUID ownerId) { + super(ownerId, 75, "Wizened Snitches", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Faerie"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Players play with the top card of their libraries revealed. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect(true))); + } + + public WizenedSnitches(final WizenedSnitches card) { + super(card); + } + + @Override + public WizenedSnitches copy() { + return new WizenedSnitches(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java index e7a6b7cddc9..c7f6a8a0be7 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java @@ -41,18 +41,18 @@ import mage.players.Player; * @author nantuko */ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { - + protected boolean allPlayers; public PlayWithTheTopCardRevealedEffect() { this(false); } - + public PlayWithTheTopCardRevealedEffect(boolean allPlayers) { super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment); this.allPlayers = allPlayers; if (allPlayers) { - staticText = "Each player plays with the top card of his or her library revealed."; + staticText = "Players play with the top card of their libraries revealed."; } else { staticText = "Play with the top card of your library revealed"; @@ -89,4 +89,4 @@ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { return new PlayWithTheTopCardRevealedEffect(this); } -} \ No newline at end of file +} From f631f74faf709294ca71211383e1ea5ea72dd12c Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 10 Nov 2015 22:03:40 +0200 Subject: [PATCH 4/8] Fix Active Volcano to be able to target a nonland Island if such thing happens to be around. Implement cards: Cleanse, Flash Flood, and Spinal Villain --- .../src/mage/sets/legends/ActiveVolcano.java | 7 +- Mage.Sets/src/mage/sets/legends/Cleanse.java | 67 ++++++++++++++++ .../src/mage/sets/legends/FlashFlood.java | 79 +++++++++++++++++++ .../src/mage/sets/legends/SpinalVillain.java | 78 ++++++++++++++++++ .../sets/mastersedition/SpinalVillain.java | 54 +++++++++++++ .../mage/sets/masterseditioniii/Cleanse.java | 52 ++++++++++++ .../sets/masterseditioniii/FlashFlood.java | 54 +++++++++++++ 7 files changed, 387 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/legends/Cleanse.java create mode 100644 Mage.Sets/src/mage/sets/legends/FlashFlood.java create mode 100644 Mage.Sets/src/mage/sets/legends/SpinalVillain.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java diff --git a/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java b/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java index 553776ba1de..8acab9a6337 100644 --- a/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java +++ b/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java @@ -36,7 +36,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.FilterPermanent; -import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; @@ -46,9 +45,9 @@ import mage.target.TargetPermanent; * @author emerald000 */ public class ActiveVolcano extends CardImpl { - + private static final FilterPermanent filterBlue = new FilterPermanent("blue permanent"); - private static final FilterLandPermanent filterIsland = new FilterLandPermanent("Island"); + private static final FilterPermanent filterIsland = new FilterPermanent("Island"); static { filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); filterIsland.add(new SubtypePredicate("Island")); @@ -62,7 +61,7 @@ public class ActiveVolcano extends CardImpl { // Choose one - Destroy target blue permanent; this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filterBlue)); - + // or return target Island to its owner's hand. Mode mode = new Mode(); mode.getEffects().add(new ReturnToHandTargetEffect()); diff --git a/Mage.Sets/src/mage/sets/legends/Cleanse.java b/Mage.Sets/src/mage/sets/legends/Cleanse.java new file mode 100644 index 00000000000..bd851bdec0a --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Cleanse.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.legends; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class Cleanse extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public Cleanse(UUID ownerId) { + super(ownerId, 174, "Cleanse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}"); + this.expansionSetCode = "LEG"; + + // Destroy all black creatures. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public Cleanse(final Cleanse card) { + super(card); + } + + @Override + public Cleanse copy() { + return new Cleanse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/FlashFlood.java b/Mage.Sets/src/mage/sets/legends/FlashFlood.java new file mode 100644 index 00000000000..b9ea6449152 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/FlashFlood.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class FlashFlood extends CardImpl { + + private static final FilterPermanent filter1 = new FilterPermanent("red permanent"); + private static final FilterPermanent filter2 = new FilterPermanent("Mountain"); + + static { + filter1.add(new ColorPredicate(ObjectColor.RED)); + filter2.add(new SubtypePredicate("Mountain")); + } + + public FlashFlood(UUID ownerId) { + super(ownerId, 57, "Flash Flood", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "LEG"; + + // Choose one - Destroy target red permanent; + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter1)); + // or return target Mountain to its owner's hand. + Mode mode = new Mode(); + mode.getEffects().add(new ReturnToHandTargetEffect()); + mode.getTargets().add(new TargetPermanent(filter2)); + this.getSpellAbility().addMode(mode); + } + + public FlashFlood(final FlashFlood card) { + super(card); + } + + @Override + public FlashFlood copy() { + return new FlashFlood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/SpinalVillain.java b/Mage.Sets/src/mage/sets/legends/SpinalVillain.java new file mode 100644 index 00000000000..f5ed15de098 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/SpinalVillain.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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpinalVillain extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public SpinalVillain(UUID ownerId) { + super(ownerId, 161, "Spinal Villain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Beast"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Destroy target blue creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public SpinalVillain(final SpinalVillain card) { + super(card); + } + + @Override + public SpinalVillain copy() { + return new SpinalVillain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java b/Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java new file mode 100644 index 00000000000..38b8905645b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java @@ -0,0 +1,54 @@ +/* + * 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.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SpinalVillain extends mage.sets.legends.SpinalVillain { + + public SpinalVillain(UUID ownerId) { + super(ownerId); + this.cardNumber = 108; + this.expansionSetCode = "MED"; + this.rarity = Rarity.UNCOMMON; + } + + public SpinalVillain(final SpinalVillain card) { + super(card); + } + + @Override + public SpinalVillain copy() { + return new SpinalVillain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java b/Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java new file mode 100644 index 00000000000..e4334cf3de1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java @@ -0,0 +1,52 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Cleanse extends mage.sets.legends.Cleanse { + + public Cleanse(UUID ownerId) { + super(ownerId); + this.cardNumber = 5; + this.expansionSetCode = "ME3"; + } + + public Cleanse(final Cleanse card) { + super(card); + } + + @Override + public Cleanse copy() { + return new Cleanse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java b/Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java new file mode 100644 index 00000000000..86f6f8ccdc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java @@ -0,0 +1,54 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FlashFlood extends mage.sets.legends.FlashFlood { + + public FlashFlood(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.UNCOMMON; + } + + public FlashFlood(final FlashFlood card) { + super(card); + } + + @Override + public FlashFlood copy() { + return new FlashFlood(this); + } +} From bddb9999aabb62e6b8eca88d29811123d2895823 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 10 Nov 2015 23:46:46 +0200 Subject: [PATCH 5/8] Implement cards: Aliban's Tower, Folk of An-Havva, Leaping Lizard, and Reef Pirates --- .../mage/sets/fifthedition/ReefPirates.java | 52 +++++++++++++ .../mage/sets/homelands/AlibansTower1.java | 62 +++++++++++++++ .../mage/sets/homelands/AlibansTower2.java | 51 +++++++++++++ .../mage/sets/homelands/FolkOfAnHavva1.java | 64 ++++++++++++++++ .../mage/sets/homelands/FolkOfAnHavva2.java | 51 +++++++++++++ .../mage/sets/homelands/LeapingLizard.java | 76 +++++++++++++++++++ .../src/mage/sets/homelands/ReefPirates1.java | 67 ++++++++++++++++ .../src/mage/sets/homelands/ReefPirates2.java | 51 +++++++++++++ .../sets/masterseditionii/LeapingLizard.java | 52 +++++++++++++ 9 files changed, 526 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java create mode 100644 Mage.Sets/src/mage/sets/homelands/AlibansTower1.java create mode 100644 Mage.Sets/src/mage/sets/homelands/AlibansTower2.java create mode 100644 Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java create mode 100644 Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java create mode 100644 Mage.Sets/src/mage/sets/homelands/LeapingLizard.java create mode 100644 Mage.Sets/src/mage/sets/homelands/ReefPirates1.java create mode 100644 Mage.Sets/src/mage/sets/homelands/ReefPirates2.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java b/Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java new file mode 100644 index 00000000000..9bc5b4ba2b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java @@ -0,0 +1,52 @@ +/* + * 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.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ReefPirates extends mage.sets.homelands.ReefPirates1 { + + public ReefPirates(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "5ED"; + } + + public ReefPirates(final ReefPirates card) { + super(card); + } + + @Override + public ReefPirates copy() { + return new ReefPirates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AlibansTower1.java b/Mage.Sets/src/mage/sets/homelands/AlibansTower1.java new file mode 100644 index 00000000000..50f072111e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AlibansTower1.java @@ -0,0 +1,62 @@ +/* + * 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.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterBlockingCreature; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AlibansTower1 extends CardImpl { + + public AlibansTower1(UUID ownerId) { + super(ownerId, 76, "Aliban's Tower", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "HML"; + + // Target blocking creature gets +3/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 1, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterBlockingCreature())); + } + + public AlibansTower1(final AlibansTower1 card) { + super(card); + } + + @Override + public AlibansTower1 copy() { + return new AlibansTower1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AlibansTower2.java b/Mage.Sets/src/mage/sets/homelands/AlibansTower2.java new file mode 100644 index 00000000000..f9841cce182 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AlibansTower2.java @@ -0,0 +1,51 @@ +/* + * 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; + +/** + * + * @author LoneFox + */ +public class AlibansTower2 extends AlibansTower1 { + + public AlibansTower2(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + } + + public AlibansTower2(final AlibansTower2 card) { + super(card); + } + + @Override + public AlibansTower2 copy() { + return new AlibansTower2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java new file mode 100644 index 00000000000..22ad5c2d3e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java @@ -0,0 +1,64 @@ +/* + * 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.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FolkOfAnHavva1 extends CardImpl { + + public FolkOfAnHavva1(UUID ownerId) { + super(ownerId, 58, "Folk of An-Havva", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "HML"; + this.subtype.add("Human"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Folk of An-Havva blocks, it gets +2/+0 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false)); + } + + public FolkOfAnHavva1(final FolkOfAnHavva1 card) { + super(card); + } + + @Override + public FolkOfAnHavva1 copy() { + return new FolkOfAnHavva1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java new file mode 100644 index 00000000000..f28dbedca24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java @@ -0,0 +1,51 @@ +/* + * 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; + +/** + * + * @author LoneFox + */ +public class FolkOfAnHavva2 extends FolkOfAnHavva1 { + + public FolkOfAnHavva2(UUID ownerId) { + super(ownerId); + this.cardNumber = 59; + } + + public FolkOfAnHavva2(final FolkOfAnHavva2 card) { + super(card); + } + + @Override + public FolkOfAnHavva2 copy() { + return new FolkOfAnHavva2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/LeapingLizard.java b/Mage.Sets/src/mage/sets/homelands/LeapingLizard.java new file mode 100644 index 00000000000..a702e236f7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/LeapingLizard.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +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 LeapingLizard extends CardImpl { + + public LeapingLizard(UUID ownerId) { + super(ownerId, 63, "Leaping Lizard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "HML"; + this.subtype.add("Lizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {1}{G}: Leaping Lizard gets -0/-1 and gains flying until end of turn. + Effect effect = new BoostSourceEffect(0, -1, Duration.EndOfTurn); + effect.setText("{this} gets -0/-1"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{G}")); + effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LeapingLizard(final LeapingLizard card) { + super(card); + } + + @Override + public LeapingLizard copy() { + return new LeapingLizard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/ReefPirates1.java b/Mage.Sets/src/mage/sets/homelands/ReefPirates1.java new file mode 100644 index 00000000000..2414edbb0aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/ReefPirates1.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.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ReefPirates1 extends CardImpl { + + public ReefPirates1(UUID ownerId) { + super(ownerId, 45, "Reef Pirates", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "HML"; + this.subtype.add("Zombie"); + this.subtype.add("Pirate"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Reef Pirates deals damage to an opponent, that player puts the top card of his or her library into his or her graveyard. + Effect effect = new PutLibraryIntoGraveTargetEffect(1); + effect.setText("that player puts the top card of his or her library into his or her graveyard"); + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(effect, false, true)); + } + + public ReefPirates1(final ReefPirates1 card) { + super(card); + } + + @Override + public ReefPirates1 copy() { + return new ReefPirates1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/ReefPirates2.java b/Mage.Sets/src/mage/sets/homelands/ReefPirates2.java new file mode 100644 index 00000000000..d7e484c14cc --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/ReefPirates2.java @@ -0,0 +1,51 @@ +/* + * 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; + +/** + * + * @author LoneFox + */ +public class ReefPirates2 extends ReefPirates1 { + + public ReefPirates2(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + } + + public ReefPirates2(final ReefPirates2 card) { + super(card); + } + + @Override + public ReefPirates2 copy() { + return new ReefPirates2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java b/Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java new file mode 100644 index 00000000000..c0115ebbe56 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java @@ -0,0 +1,52 @@ +/* + * 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; + +/** + * + * @author LoneFox + */ +public class LeapingLizard extends mage.sets.homelands.LeapingLizard { + + public LeapingLizard(UUID ownerId) { + super(ownerId); + this.cardNumber = 171; + this.expansionSetCode = "ME2"; + } + + public LeapingLizard(final LeapingLizard card) { + super(card); + } + + @Override + public LeapingLizard copy() { + return new LeapingLizard(this); + } +} From f133854db1b671de3e945c76bc697b36dabed2dc Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 11 Nov 2015 09:49:25 +0200 Subject: [PATCH 6/8] Rename BecomesTappedTriggeredAbility -> BecomesTappedSourceTriggeredAbility --- .../src/mage/sets/lorwyn/Fallowsage.java | 4 +- .../src/mage/sets/lorwyn/Surgespanner.java | 4 +- .../mage/sets/morningtide/GrimoireThief.java | 40 +++++++++---------- .../morningtide/StonybrookSchoolmaster.java | 6 +-- .../mage/sets/seventhedition/CityOfBrass.java | 4 +- .../mage/sets/urzaslegacy/GoblinMedics.java | 4 +- ... BecomesTappedSourceTriggeredAbility.java} | 14 +++---- 7 files changed, 38 insertions(+), 38 deletions(-) rename Mage/src/mage/abilities/common/{BecomesTappedTriggeredAbility.java => BecomesTappedSourceTriggeredAbility.java} (84%) diff --git a/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java b/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java index 81387b1efed..94e15d4b70c 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; @@ -51,7 +51,7 @@ public class Fallowsage extends CardImpl { this.toughness = new MageInt(2); // Whenever Fallowsage becomes tapped, you may draw a card. - this.addAbility(new BecomesTappedTriggeredAbility(new DrawCardSourceControllerEffect(1))); + this.addAbility(new BecomesTappedSourceTriggeredAbility(new DrawCardSourceControllerEffect(1))); } public Fallowsage(final Fallowsage card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java b/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java index d7ded0f1762..2d915af972d 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java @@ -32,7 +32,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -55,7 +55,7 @@ public class Surgespanner extends CardImpl { this.toughness = new MageInt(2); // Whenever Surgespanner becomes tapped, you may pay {1}{U}. If you do, return target permanent to its owner's hand. - Ability ability = new BecomesTappedTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"))); + Ability ability = new BecomesTappedSourceTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"))); ability.addTarget(new TargetPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java b/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java index 47338c04dea..17d751edb03 100644 --- a/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java +++ b/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java @@ -34,7 +34,7 @@ import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeSourceCost; @@ -65,9 +65,9 @@ import mage.util.CardUtil; * @author jeffwadsworth */ public class GrimoireThief extends CardImpl { - + protected static final String VALUE_PREFIX = "ExileZones"; - + public GrimoireThief(UUID ownerId) { super(ownerId, 35, "Grimoire Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{U}{U}"); this.expansionSetCode = "MOR"; @@ -77,7 +77,7 @@ public class GrimoireThief extends CardImpl { this.toughness = new MageInt(2); // Whenever Grimoire Thief becomes tapped, exile the top three cards of target opponent's library face down. - Ability ability = new BecomesTappedTriggeredAbility(new GrimoireThiefExileEffect(), false); + Ability ability = new BecomesTappedSourceTriggeredAbility(new GrimoireThiefExileEffect(), false); ability.addTarget(new TargetOpponent()); this.addAbility(ability); @@ -88,13 +88,13 @@ public class GrimoireThief extends CardImpl { Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrimoireThiefCounterspellEffect(), new ManaCostsImpl("{U}")); ability2.addCost(new SacrificeSourceCost()); this.addAbility(ability2); - + } - + public GrimoireThief(final GrimoireThief card) { super(card); } - + @Override public GrimoireThief copy() { return new GrimoireThief(this); @@ -102,16 +102,16 @@ public class GrimoireThief extends CardImpl { } class GrimoireThiefExileEffect extends OneShotEffect { - + public GrimoireThiefExileEffect() { super(Outcome.Discard); staticText = "exile the top three cards of target opponent's library face down"; } - + public GrimoireThiefExileEffect(final GrimoireThiefExileEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player targetOpponent = game.getPlayer(source.getFirstTarget()); @@ -138,7 +138,7 @@ class GrimoireThiefExileEffect extends OneShotEffect { } return false; } - + @Override public GrimoireThiefExileEffect copy() { return new GrimoireThiefExileEffect(this); @@ -146,26 +146,26 @@ class GrimoireThiefExileEffect extends OneShotEffect { } class GrimoireThiefLookEffect extends AsThoughEffectImpl { - + public GrimoireThiefLookEffect() { super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); staticText = "You may look at the cards exiled with {this}"; } - + public GrimoireThiefLookEffect(final GrimoireThiefLookEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { return true; } - + @Override public GrimoireThiefLookEffect copy() { return new GrimoireThiefLookEffect(this); } - + @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) { @@ -193,16 +193,16 @@ class GrimoireThiefLookEffect extends AsThoughEffectImpl { } class GrimoireThiefCounterspellEffect extends OneShotEffect { - + public GrimoireThiefCounterspellEffect() { super(Outcome.Discard); staticText = "Turn all cards exiled with {this} face up. Counter all spells with those names"; } - + public GrimoireThiefCounterspellEffect(final GrimoireThiefCounterspellEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Cards cards = new CardsImpl(); @@ -245,7 +245,7 @@ class GrimoireThiefCounterspellEffect extends OneShotEffect { } return false; } - + @Override public GrimoireThiefCounterspellEffect copy() { return new GrimoireThiefCounterspellEffect(this); diff --git a/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java b/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java index 691d5c6c073..f4c59c8063f 100644 --- a/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java +++ b/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java @@ -29,7 +29,7 @@ package mage.sets.morningtide; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -51,7 +51,7 @@ public class StonybrookSchoolmaster extends CardImpl { this.toughness = new MageInt(2); // Whenever Stonybrook Schoolmaster becomes tapped, you may put a 1/1 blue Merfolk Wizard creature token onto the battlefield. - this.addAbility(new BecomesTappedTriggeredAbility(new CreateTokenEffect(new MerfolkWizardToken()), true)); + this.addAbility(new BecomesTappedSourceTriggeredAbility(new CreateTokenEffect(new MerfolkWizardToken()), true)); } public StonybrookSchoolmaster(final StonybrookSchoolmaster card) { @@ -62,4 +62,4 @@ public class StonybrookSchoolmaster extends CardImpl { public StonybrookSchoolmaster copy() { return new StonybrookSchoolmaster(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java b/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java index 6071037d519..35bb06cb880 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java +++ b/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java @@ -30,7 +30,7 @@ package mage.sets.seventhedition; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.DamageControllerEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; @@ -46,7 +46,7 @@ public class CityOfBrass extends CardImpl { this.expansionSetCode = "7ED"; // Whenever City of Brass becomes tapped, it deals 1 damage to you. - this.addAbility(new BecomesTappedTriggeredAbility(new DamageControllerEffect(1))); + this.addAbility(new BecomesTappedSourceTriggeredAbility(new DamageControllerEffect(1))); // {tap}: Add one mana of any color to your mana pool. this.addAbility(new AnyColorManaAbility()); diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java b/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java index 94df69ca9ab..0f51156ce52 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java @@ -32,7 +32,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.target.common.TargetCreatureOrPlayer; @@ -53,7 +53,7 @@ public class GoblinMedics extends CardImpl { this.toughness = new MageInt(1); // Whenever Goblin Medics becomes tapped, it deals 1 damage to target creature or player. - Ability ability = new BecomesTappedTriggeredAbility(new DamageTargetEffect(1)); + Ability ability = new BecomesTappedSourceTriggeredAbility(new DamageTargetEffect(1)); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTappedSourceTriggeredAbility.java similarity index 84% rename from Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java rename to Mage/src/mage/abilities/common/BecomesTappedSourceTriggeredAbility.java index 666e6b1f893..aeab425137c 100644 --- a/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BecomesTappedSourceTriggeredAbility.java @@ -38,23 +38,23 @@ import mage.game.events.GameEvent.EventType; * * @author nantuko */ -public class BecomesTappedTriggeredAbility extends TriggeredAbilityImpl { - - public BecomesTappedTriggeredAbility(Effect effect, boolean isOptional) { +public class BecomesTappedSourceTriggeredAbility extends TriggeredAbilityImpl { + + public BecomesTappedSourceTriggeredAbility(Effect effect, boolean isOptional) { super(Zone.BATTLEFIELD, effect, isOptional); } - public BecomesTappedTriggeredAbility(Effect effect) { + public BecomesTappedSourceTriggeredAbility(Effect effect) { super(Zone.BATTLEFIELD, effect); } - public BecomesTappedTriggeredAbility(final BecomesTappedTriggeredAbility ability) { + public BecomesTappedSourceTriggeredAbility(final BecomesTappedSourceTriggeredAbility ability) { super(ability); } @Override - public BecomesTappedTriggeredAbility copy() { - return new BecomesTappedTriggeredAbility(this); + public BecomesTappedSourceTriggeredAbility copy() { + return new BecomesTappedSourceTriggeredAbility(this); } @Override From 70f77b858ea7430544fd26c8712c01dee75bf75d Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 11 Nov 2015 10:18:49 +0200 Subject: [PATCH 7/8] Rename BecomesTappedCreatureControlledTriggeredAbility -> BecomesTappedTriggeredAbility and generalize it to allow all kinds of permanent fiilters instead of just controlled creatures. Implement cards: Lifeblood and Lifetap --- .../src/mage/sets/fifthedition/Lifetap.java | 70 +++++++++++++++++++ .../src/mage/sets/fourthedition/Lifetap.java | 52 ++++++++++++++ .../src/mage/sets/legends/Lifeblood.java | 70 +++++++++++++++++++ .../src/mage/sets/limitedalpha/Lifetap.java | 52 ++++++++++++++ .../src/mage/sets/limitedbeta/Lifetap.java | 52 ++++++++++++++ .../src/mage/sets/lorwyn/JudgeOfCurrents.java | 4 +- .../src/mage/sets/revisededition/Lifetap.java | 52 ++++++++++++++ .../mage/sets/unlimitededition/Lifetap.java | 52 ++++++++++++++ .../mage/sets/worldwake/QuestForRenewal.java | 16 ++--- ...ava => BecomesTappedTriggeredAbility.java} | 26 +++---- 10 files changed, 422 insertions(+), 24 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/Lifetap.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/Lifetap.java create mode 100644 Mage.Sets/src/mage/sets/legends/Lifeblood.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Lifetap.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java rename Mage/src/mage/abilities/common/{BecomesTappedCreatureControlledTriggeredAbility.java => BecomesTappedTriggeredAbility.java} (53%) diff --git a/Mage.Sets/src/mage/sets/fifthedition/Lifetap.java b/Mage.Sets/src/mage/sets/fifthedition/Lifetap.java new file mode 100644 index 00000000000..0b0f027a7b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Lifetap.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.fifthedition; + +import java.util.UUID; +import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class Lifetap extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Forest an opponent controls"); + + static { + filter.add(new SubtypePredicate("Forest")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public Lifetap(UUID ownerId) { + super(ownerId, 99, "Lifetap", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); + this.expansionSetCode = "5ED"; + + // Whenever a Forest an opponent controls becomes tapped, you gain 1 life. + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, filter)); + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Lifetap.java b/Mage.Sets/src/mage/sets/fourthedition/Lifetap.java new file mode 100644 index 00000000000..72046df5bde --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Lifetap.java @@ -0,0 +1,52 @@ +/* + * 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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "4ED"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Lifeblood.java b/Mage.Sets/src/mage/sets/legends/Lifeblood.java new file mode 100644 index 00000000000..9bca8d2d6ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Lifeblood.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.legends; + +import java.util.UUID; +import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class Lifeblood extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Mountain an opponent controls"); + + static { + filter.add(new SubtypePredicate("Mountain")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public Lifeblood(UUID ownerId) { + super(ownerId, 196, "Lifeblood", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "LEG"; + + // Whenever a Mountain an opponent controls becomes tapped, you gain 1 life. + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, filter)); + } + + public Lifeblood(final Lifeblood card) { + super(card); + } + + @Override + public Lifeblood copy() { + return new Lifeblood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java b/Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java new file mode 100644 index 00000000000..23838ead6b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java @@ -0,0 +1,52 @@ +/* + * 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.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "LEA"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java b/Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java new file mode 100644 index 00000000000..effd512e823 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java @@ -0,0 +1,52 @@ +/* + * 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.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "LEB"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java b/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java index 09bd019a922..b030484768d 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java +++ b/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java @@ -29,7 +29,7 @@ package mage.sets.lorwyn; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BecomesTappedCreatureControlledTriggeredAbility; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -51,7 +51,7 @@ public class JudgeOfCurrents extends CardImpl { this.toughness = new MageInt(1); // Whenever a Merfolk you control becomes tapped, you may gain 1 life. - this.addAbility(new BecomesTappedCreatureControlledTriggeredAbility(new GainLifeEffect(1), true, new FilterControlledCreaturePermanent("Merfolk", "a Merfolk you control"))); + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), true, new FilterControlledCreaturePermanent("Merfolk", "a Merfolk you control"))); } public JudgeOfCurrents(final JudgeOfCurrents card) { diff --git a/Mage.Sets/src/mage/sets/revisededition/Lifetap.java b/Mage.Sets/src/mage/sets/revisededition/Lifetap.java new file mode 100644 index 00000000000..fecddb4c9e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Lifetap.java @@ -0,0 +1,52 @@ +/* + * 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.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "3ED"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java b/Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java new file mode 100644 index 00000000000..2e900c7bb5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java @@ -0,0 +1,52 @@ +/* + * 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.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "2ED"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java b/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java index 0e54dc6ac14..bea09ad6d9f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java +++ b/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java @@ -28,7 +28,7 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.abilities.common.BecomesTappedCreatureControlledTriggeredAbility; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.decorator.ConditionalContinuousEffect; @@ -46,22 +46,20 @@ import mage.filter.common.FilterControlledCreaturePermanent; * @author jeffwadsworth */ public class QuestForRenewal extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control"); public QuestForRenewal(UUID ownerId) { super(ownerId, 110, "Quest for Renewal", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.expansionSetCode = "WWK"; - // Whenever a creature you control becomes tapped, you may put a quest counter on Quest for Renewal. - this.addAbility(new BecomesTappedCreatureControlledTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true)); - + this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), + true, new FilterControlledCreaturePermanent("a creature you control"))); + // As long as there are four or more quest counters on Quest for Renewal, untap all creatures you control during each other player's untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new UntapAllDuringEachOtherPlayersUntapStepEffect(filter), - new SourceHasCounterCondition(CounterType.QUEST, 4), - "As long as there are four or more quest counters on {this}, untap all creatures you control during each other player's untap step."))); + new UntapAllDuringEachOtherPlayersUntapStepEffect(new FilterControlledCreaturePermanent()), + new SourceHasCounterCondition(CounterType.QUEST, 4), + "As long as there are four or more quest counters on {this}, untap all creatures you control during each other player's untap step."))); } public QuestForRenewal(final QuestForRenewal card) { diff --git a/Mage/src/mage/abilities/common/BecomesTappedCreatureControlledTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java similarity index 53% rename from Mage/src/mage/abilities/common/BecomesTappedCreatureControlledTriggeredAbility.java rename to Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java index 4961f8af297..c771945c0ed 100644 --- a/Mage/src/mage/abilities/common/BecomesTappedCreatureControlledTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java @@ -7,7 +7,7 @@ package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -16,26 +16,26 @@ import mage.game.permanent.Permanent; * * @author Jeff */ -public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAbilityImpl{ - - FilterControlledCreaturePermanent filter; - - public BecomesTappedCreatureControlledTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, new FilterControlledCreaturePermanent("a creature you control")); +public class BecomesTappedTriggeredAbility extends TriggeredAbilityImpl{ + + FilterPermanent filter; + + public BecomesTappedTriggeredAbility(Effect effect, boolean optional) { + this(effect, optional, new FilterPermanent("a permanent")); } - public BecomesTappedCreatureControlledTriggeredAbility(Effect effect, boolean optional, FilterControlledCreaturePermanent filter) { + public BecomesTappedTriggeredAbility(Effect effect, boolean optional, FilterPermanent filter) { super(Zone.BATTLEFIELD, effect, optional); this.filter = filter; } - public BecomesTappedCreatureControlledTriggeredAbility(final BecomesTappedCreatureControlledTriggeredAbility ability) { + public BecomesTappedTriggeredAbility(final BecomesTappedTriggeredAbility ability) { super(ability); - this.filter = ability.filter; + this.filter = ability.filter.copy(); } @Override - public BecomesTappedCreatureControlledTriggeredAbility copy() { - return new BecomesTappedCreatureControlledTriggeredAbility(this); + public BecomesTappedTriggeredAbility copy() { + return new BecomesTappedTriggeredAbility(this); } @Override @@ -52,5 +52,5 @@ public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAb @Override public String getRule() { return "When " + filter.getMessage() + " becomes tapped, " + super.getRule(); - } + } } From 38ea922ea9f0311ce35cecd9ba433a7b748f7015 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 11 Nov 2015 11:07:13 +0200 Subject: [PATCH 8/8] Kill some unnecessary custom effects --- .../sets/dissension/PalliationAccord.java | 55 +++++------------- .../mage/sets/magic2012/GideonsAvenger.java | 54 ++++-------------- .../ninthedition/ViashinoSandstalker.java | 42 ++------------ .../sets/seventhedition/Thoughtleech.java | 56 +++++-------------- 4 files changed, 43 insertions(+), 164 deletions(-) diff --git a/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java b/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java index 0d98ccb2056..9014dce7344 100644 --- a/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java +++ b/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java @@ -29,7 +29,7 @@ package mage.sets.dissension; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.effects.PreventionEffectImpl; @@ -38,12 +38,14 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; +import mage.game.events.GameEvent; /** * @@ -51,13 +53,19 @@ import mage.game.permanent.Permanent; */ public class PalliationAccord extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + public PalliationAccord(UUID ownerId) { super(ownerId, 122, "Palliation Accord", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{U}"); this.expansionSetCode = "DIS"; // Whenever a creature an opponent controls becomes tapped, put a shield counter on Palliation Accord. - this.addAbility(new PallationAccordTriggeredAbility()); - + this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.SHIELD.createInstance()), false, filter)); + // Remove a shield counter from Palliation Accord: Prevent the next 1 damage that would be dealt to you this turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PalliationAccordPreventionEffect(), new RemoveCountersSourceCost(CounterType.SHIELD.createInstance()))); } @@ -72,41 +80,6 @@ public class PalliationAccord extends CardImpl { } } -class PallationAccordTriggeredAbility extends TriggeredAbilityImpl { - PallationAccordTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.SHIELD.createInstance())); - } - - PallationAccordTriggeredAbility(final PallationAccordTriggeredAbility ability) { - super(ability); - } - - @Override - public PallationAccordTriggeredAbility copy() { - return new PallationAccordTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { - if (game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever a creature an opponent controls becomes tapped, " + modes.getText(); - } -} - class PalliationAccordPreventionEffect extends PreventionEffectImpl { public PalliationAccordPreventionEffect() { @@ -151,4 +124,4 @@ class PalliationAccordPreventionEffect extends PreventionEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java index be7f26d1122..5d147f63c4e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java +++ b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java @@ -29,17 +29,15 @@ package mage.sets.magic2012; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; +import mage.constants.TargetController; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -47,6 +45,12 @@ import mage.game.permanent.Permanent; */ public class GideonsAvenger extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + public GideonsAvenger(UUID ownerId) { super(ownerId, 17, "Gideon's Avenger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); this.expansionSetCode = "M12"; @@ -56,7 +60,8 @@ public class GideonsAvenger extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new GideonsAvengerTriggeredAbility()); + // Whenever a creature an opponent controls becomes tapped, put a +1/+1 counter on Gideon's Avenger. + this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, filter)); } public GideonsAvenger(final GideonsAvenger card) { @@ -68,38 +73,3 @@ public class GideonsAvenger extends CardImpl { return new GideonsAvenger(this); } } - -class GideonsAvengerTriggeredAbility extends TriggeredAbilityImpl { - GideonsAvengerTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance())); - } - - GideonsAvengerTriggeredAbility(final GideonsAvengerTriggeredAbility ability) { - super(ability); - } - - @Override - public GideonsAvengerTriggeredAbility copy() { - return new GideonsAvengerTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { - if (game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever a creature an opponent controls becomes tapped, " + modes.getText(); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java index e506714d397..c769466b309 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java +++ b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java @@ -29,17 +29,14 @@ package mage.sets.ninthedition; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; /** * @@ -61,8 +58,8 @@ public class ViashinoSandstalker extends CardImpl { this.addAbility(HasteAbility.getInstance()); // At the beginning of the end step, return Viashino Sandstalker to its owner's hand. - this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), false)); - + this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), + TargetController.ANY, false)); } public ViashinoSandstalker(final ViashinoSandstalker card) { @@ -74,34 +71,3 @@ public class ViashinoSandstalker extends CardImpl { return new ViashinoSandstalker(this); } } - -class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { - - public BeginningOfEndStepTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } - - public BeginningOfEndStepTriggeredAbility(final BeginningOfEndStepTriggeredAbility ability) { - super(ability); - } - - @Override - public BeginningOfEndStepTriggeredAbility copy() { - return new BeginningOfEndStepTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.END_TURN_STEP_PRE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return true; - } - - @Override - public String getRule() { - return "At the beginning of the end step, return {this} to its owner's hand"; - } -} diff --git a/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java b/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java index 2354dc80e48..1650ce93e7e 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java +++ b/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java @@ -28,16 +28,15 @@ package mage.sets.seventhedition; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent.EventType; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -46,12 +45,19 @@ import mage.game.permanent.Permanent; */ public class Thoughtleech extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("an Island an opponent controls"); + + static { + filter.add(new SubtypePredicate("Island")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + public Thoughtleech(UUID ownerId) { super(ownerId, 274, "Thoughtleech", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); this.expansionSetCode = "7ED"; // Whenever an Island an opponent controls becomes tapped, you may gain 1 life. - this.addAbility(new ThoughtleechTriggeredAbility()); + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), true, filter)); } public Thoughtleech(final Thoughtleech card) { @@ -63,39 +69,3 @@ public class Thoughtleech extends CardImpl { return new Thoughtleech(this); } } - -class ThoughtleechTriggeredAbility extends TriggeredAbilityImpl { - - ThoughtleechTriggeredAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } - - ThoughtleechTriggeredAbility(final ThoughtleechTriggeredAbility ability) { - super(ability); - } - - @Override - public ThoughtleechTriggeredAbility copy() { - return new ThoughtleechTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if(p != null && p.getSubtype().contains("Island")) { - if(game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an Island an opponent controls becomes tapped, " + modes.getText(); - } -}