From 7fb3cf5eca130a3b4959b97dee193453b9f91b7f Mon Sep 17 00:00:00 2001 From: fireshoes Date: Wed, 19 Aug 2015 22:21:39 -0500 Subject: [PATCH 01/35] Fixed UrzaTerrainValue calculation filters for previous Tronland subtype fix. --- .../abilities/dynamicvalue/common/UrzaTerrainValue.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java b/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java index 3db1e5f9aab..d3dd6be074c 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java @@ -18,21 +18,24 @@ public class UrzaTerrainValue implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { FilterControlledPermanent pp = new FilterControlledPermanent("Urza's Power Plant"); - pp.add(new SubtypePredicate("Urza's Power-Plant")); + pp.add(new SubtypePredicate("Urza's")); + pp.add(new SubtypePredicate("Power-Plant")); PermanentsOnBattlefieldCount ppP = new PermanentsOnBattlefieldCount(pp); if (ppP.calculate(game, sourceAbility, effect) < 1) { return 1; } FilterControlledPermanent to = new FilterControlledPermanent("Urza's Tower"); - to.add(new SubtypePredicate("Urza's Tower")); + to.add(new SubtypePredicate("Urza's")); + to.add(new SubtypePredicate("Tower")); PermanentsOnBattlefieldCount toP = new PermanentsOnBattlefieldCount(to); if (toP.calculate(game, sourceAbility, effect) < 1) { return 1; } FilterControlledPermanent mi = new FilterControlledPermanent("Urza's Mine"); - mi.add(new SubtypePredicate("Urza's Mine")); + mi.add(new SubtypePredicate("Urza's")); + mi.add(new SubtypePredicate("Mine")); PermanentsOnBattlefieldCount miP = new PermanentsOnBattlefieldCount(mi); if (miP.calculate(game, sourceAbility, effect) < 1) { return 1; From 9c213ac460a6afcd83602307620e82a5071afc3c Mon Sep 17 00:00:00 2001 From: fireshoes Date: Thu, 20 Aug 2015 00:02:03 -0500 Subject: [PATCH 02/35] Fixed Taniwha mana cost. --- Mage.Sets/src/mage/sets/mirage/Taniwha.java | 2 +- Utils/mtg-cards-data.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/mirage/Taniwha.java b/Mage.Sets/src/mage/sets/mirage/Taniwha.java index 15b0e0426ff..ca2154c5021 100644 --- a/Mage.Sets/src/mage/sets/mirage/Taniwha.java +++ b/Mage.Sets/src/mage/sets/mirage/Taniwha.java @@ -51,7 +51,7 @@ import mage.players.Player; public class Taniwha extends CardImpl { public Taniwha(UUID ownerId) { - super(ownerId, 95, "Taniwha", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + super(ownerId, 95, "Taniwha", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.expansionSetCode = "MIR"; this.supertype.add("Legendary"); this.subtype.add("Serpent"); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 0d144644ba1..23af435890d 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -12260,7 +12260,7 @@ Sea Scryer|Mirage|90|C|{1}{U}|Creature - Merfolk Wizard|1|1|{tap}: Add {1} to yo Shaper Guildmage|Mirage|91|C|{U}|Creature - Human Wizard|1|1|{W}, {tap}: Target creature gains first strike until end of turn.${B}, {tap}: Target creature gets +1/+0 until end of turn.| Soar|Mirage|93|C|{1}{U}|Enchantment - Aura|||You may cast Soar as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step.$Enchant creature$Enchanted creature gets +0/+1 and has flying.| Suq'Ata Firewalker|Mirage|94|U|{1}{U}{U}|Creature - Human Wizard|0|1|Suq'Ata Firewalker can't be the target of red spells or abilities from red sources.${tap}: Suq'Ata Firewalker deals 1 damage to target creature or player.| -Taniwha|Mirage|95|R|{3}{U}|Legendary Creature - Serpent|7|7|Trample$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$At the beginning of your upkeep, all lands you control phase out. (They phase in before you untap during your next untap step.)| +Taniwha|Mirage|95|R|{3}{U}{U}|Legendary Creature - Serpent|7|7|Trample$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$At the beginning of your upkeep, all lands you control phase out. (They phase in before you untap during your next untap step.)| Teferi's Curse|Mirage|96|C|{1}{U}|Enchantment - Aura|||Enchant artifact or creature$Enchanted permanent has phasing. (It phases in or out before its controller untaps during each of his or her untap steps. While it's phased out, it's treated as though it doesn't exist.)| Teferi's Drake|Mirage|97|C|{2}{U}|Creature - Drake|3|2|Flying$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)| Teferi's Imp|Mirage|98|R|{2}{U}|Creature - Imp|1|1|Flying$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$Whenever Teferi's Imp phases out, discard a card.$Whenever Teferi's Imp phases in, draw a card.| From 852442e49203c19483a034cce4080f2d55fe9f66 Mon Sep 17 00:00:00 2001 From: Jesse Whyte Date: Thu, 20 Aug 2015 17:01:02 +1000 Subject: [PATCH 03/35] Implemented Retribution of the Meek --- .../sets/visions/RetributionOfTheMeek.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java diff --git a/Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java b/Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java new file mode 100644 index 00000000000..e4c7e81c2b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java @@ -0,0 +1,69 @@ +/* + * 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.visions; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author Jesse Whyte + */ +public class RetributionOfTheMeek extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 4 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 3)); + } + + public RetributionOfTheMeek (UUID ownerId) { + super(ownerId, 119, "Retribution of the Meek", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "VIS"; + + // Destroy all creatures with power 4 or greater. They can't be regenerated. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter, true)); + } + + public RetributionOfTheMeek(final RetributionOfTheMeek card) { + super(card); + } + + @Override + public Card copy() { + return new RetributionOfTheMeek(this); + } + +} From 4c981a49affa6a56b5508e11e8a9af0cf8087c84 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 20 Aug 2015 17:50:55 +0300 Subject: [PATCH 04/35] Add ODY Aura Graft and 10E Karplusan Strider --- .../src/mage/sets/odyssey/AuraGraft.java | 52 +++++++++++++++++++ .../sets/tenthedition/KarplusanStrider.java | 52 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/AuraGraft.java create mode 100644 Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.java diff --git a/Mage.Sets/src/mage/sets/odyssey/AuraGraft.java b/Mage.Sets/src/mage/sets/odyssey/AuraGraft.java new file mode 100644 index 00000000000..788ded625bd --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/AuraGraft.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.odyssey; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AuraGraft extends mage.sets.tenthedition.AuraGraft { + + public AuraGraft(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "ODY"; + } + + public AuraGraft(final AuraGraft card) { + super(card); + } + + @Override + public AuraGraft copy() { + return new AuraGraft(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.java b/Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.java new file mode 100644 index 00000000000..cdbf27c76be --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.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.tenthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class KarplusanStrider extends mage.sets.modernmasters2015.KarplusanStrider { + + public KarplusanStrider(UUID ownerId) { + super(ownerId); + this.cardNumber = 272; + this.expansionSetCode = "10E"; + } + + public KarplusanStrider(final KarplusanStrider card) { + super(card); + } + + @Override + public KarplusanStrider copy() { + return new KarplusanStrider(this); + } +} From b42587e5ea9251416bd3adbf750d0ff1af2d04f3 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 20 Aug 2015 19:04:39 +0300 Subject: [PATCH 05/35] Implement cards: Keldon Halberdier, Stormcloud Djinn, Thrill of the Hunt, and Verdant Embrace --- .../sets/timespiral/KeldonHalberdier.java | 67 +++++++++++++++ .../mage/sets/timespiral/StormcloudDjinn.java | 80 +++++++++++++++++ .../mage/sets/timespiral/ThrillOfTheHunt.java | 66 ++++++++++++++ .../mage/sets/timespiral/VerdantEmbrace.java | 86 +++++++++++++++++++ 4 files changed, 299 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java diff --git a/Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.java b/Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.java new file mode 100644 index 00000000000..c24c20da263 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class KeldonHalberdier extends CardImpl { + + public KeldonHalberdier(UUID ownerId) { + super(ownerId, 167, "Keldon Halberdier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Suspend 4-{R} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{R}"), this)); + } + + public KeldonHalberdier(final KeldonHalberdier card) { + super(card); + } + + @Override + public KeldonHalberdier copy() { + return new KeldonHalberdier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java b/Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java new file mode 100644 index 00000000000..31c7a73b90e --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +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 StormcloudDjinn extends CardImpl { + + public StormcloudDjinn(UUID ownerId) { + super(ownerId, 82, "Stormcloud Djinn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Djinn"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Stormcloud Djinn can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + // {R}{R}: Stormcloud Djinn gets +2/+0 until end of turn and deals 1 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), + new ManaCostsImpl("{R}{R}")); + Effect effect = new DamageControllerEffect(1); + effect.setText("and deals 1 damage to you"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public StormcloudDjinn(final StormcloudDjinn card) { + super(card); + } + + @Override + public StormcloudDjinn copy() { + return new StormcloudDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java b/Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java new file mode 100644 index 00000000000..22fe2e6b1c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ThrillOfTheHunt extends CardImpl { + + public ThrillOfTheHunt(UUID ownerId) { + super(ownerId, 229, "Thrill of the Hunt", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "TSP"; + + // Target creature gets +1/+2 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(1, 2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Flashback {W} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT)); + } + + public ThrillOfTheHunt(final ThrillOfTheHunt card) { + super(card); + } + + @Override + public ThrillOfTheHunt copy() { + return new ThrillOfTheHunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java b/Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java new file mode 100644 index 00000000000..57a2adc8b3d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.permanent.token.SaprolingToken; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class VerdantEmbrace extends CardImpl { + + public VerdantEmbrace(UUID ownerId) { + super(ownerId, 232, "Verdant Embrace", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +3/+3 and has "At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield." + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)); + Ability grantedAbility = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SaprolingToken()), TargetController.ANY, false); + Effect effect = new GainAbilityAttachedEffect(grantedAbility, AttachmentType.AURA); + effect.setText("and has \"At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield.\""); + ability.addEffect(effect); + this.addAbility(ability); + } + + public VerdantEmbrace(final VerdantEmbrace card) { + super(card); + } + + @Override + public VerdantEmbrace copy() { + return new VerdantEmbrace(this); + } +} From 597d1323fafb05ab0280b7d7637bb1ce77e9acd9 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 20 Aug 2015 21:10:03 +0300 Subject: [PATCH 06/35] Implement cards: Corpulent Corpse, Viashino Bladescout, Wurmcalling, and Yavimaya Dryad --- .../mage/sets/archenemy/YavimayaDryad.java | 75 +++++++++++++ .../mage/sets/timespiral/CorpulentCorpse.java | 66 +++++++++++ .../sets/timespiral/ViashinoBladescout.java | 73 ++++++++++++ .../src/mage/sets/timespiral/Wurmcalling.java | 104 ++++++++++++++++++ .../mage/sets/timespiral/YavimayaDryad.java | 52 +++++++++ 5 files changed, 370 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.java diff --git a/Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java b/Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java new file mode 100644 index 00000000000..c83ae5e7b38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class YavimayaDryad extends CardImpl { + + private static final FilterLandCard filter = new FilterLandCard("a Forest card"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public YavimayaDryad(UUID ownerId) { + super(ownerId, 75, "Yavimaya Dryad", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "ARC"; + this.subtype.add("Dryad"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Forestwalk + this.addAbility(new ForestwalkAbility()); + // When Yavimaya Dryad enters the battlefield, you may search your library for a Forest card and put it onto the battlefield tapped under target player's control. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), true)); + } + + public YavimayaDryad(final YavimayaDryad card) { + super(card); + } + + @Override + public YavimayaDryad copy() { + return new YavimayaDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java b/Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java new file mode 100644 index 00000000000..52190d73722 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FearAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CorpulentCorpse extends CardImpl { + + public CorpulentCorpse(UUID ownerId) { + super(ownerId, 98, "Corpulent Corpse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Fear + this.addAbility(FearAbility.getInstance()); + // Suspend 5-{B} + this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{B}"), this)); + } + + public CorpulentCorpse(final CorpulentCorpse card) { + super(card); + } + + @Override + public CorpulentCorpse copy() { + return new CorpulentCorpse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.java b/Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.java new file mode 100644 index 00000000000..0bc7db02d78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.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.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ViashinoBladescout extends CardImpl { + + public ViashinoBladescout(UUID ownerId) { + super(ownerId, 185, "Viashino Bladescout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Viashino"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // When Viashino Bladescout enters the battlefield, target creature gains first strike until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ViashinoBladescout(final ViashinoBladescout card) { + super(card); + } + + @Override + public ViashinoBladescout copy() { + return new ViashinoBladescout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java b/Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java new file mode 100644 index 00000000000..fac4952c75b --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java @@ -0,0 +1,104 @@ +/* + * 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.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class Wurmcalling extends CardImpl { + + public Wurmcalling(UUID ownerId) { + super(ownerId, 234, "Wurmcalling", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}"); + this.expansionSetCode = "TSP"; + + // Buyback {2}{G} + this.addAbility(new BuybackAbility("{2}{G}")); + // Put an X/X green Wurm creature token onto the battlefield. + this.getSpellAbility().addEffect(new WurmcallingEffect()); + } + + public Wurmcalling(final Wurmcalling card) { + super(card); + } + + @Override + public Wurmcalling copy() { + return new Wurmcalling(this); + } +} + +class WurmcallingEffect extends OneShotEffect { + + public WurmcallingEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Put an X/X green Wurm creature token onto the battlefield"; + } + + public WurmcallingEffect(WurmcallingEffect ability) { + super(ability); + } + + @Override + public boolean apply(Game game, Ability source) { + int count = source.getManaCostsToPay().getX(); + WurmToken token = new WurmToken(); + token.getPower().initValue(count); + token.getToughness().initValue(count); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + + @Override + public WurmcallingEffect copy() { + return new WurmcallingEffect(this); + } +} + +class WurmToken extends Token { + public WurmToken() { + super("Wurm", "X/X green Wurm creature token"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Wurm"); + power = new MageInt(0); + toughness = new MageInt(0); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.java b/Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.java new file mode 100644 index 00000000000..e066abdbceb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.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.timespiral; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class YavimayaDryad extends mage.sets.archenemy.YavimayaDryad { + + public YavimayaDryad(UUID ownerId) { + super(ownerId); + this.cardNumber = 235; + this.expansionSetCode = "TSP"; + } + + public YavimayaDryad(final YavimayaDryad card) { + super(card); + } + + @Override + public YavimayaDryad copy() { + return new YavimayaDryad(this); + } +} From 93eb216e73eb8a05f2bc1bc44ca06503d3b6d059 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 20 Aug 2015 22:02:05 +0300 Subject: [PATCH 07/35] Implement cards: Basalt Gargoyle, Cloudchaser Kestrel, Scarwood Treefolk, and Squall Line --- .../mage/sets/timespiral/BasaltGargoyle.java | 72 ++++++++++++++++ .../sets/timespiral/CloudchaserKestrel.java | 82 +++++++++++++++++++ .../sets/timespiral/ScarwoodTreefolk.java | 65 +++++++++++++++ .../src/mage/sets/timespiral/SquallLine.java | 67 +++++++++++++++ 4 files changed, 286 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/SquallLine.java diff --git a/Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java b/Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java new file mode 100644 index 00000000000..b1499a154bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.EchoAbility; +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 BasaltGargoyle extends CardImpl { + + public BasaltGargoyle(UUID ownerId) { + super(ownerId, 145, "Basalt Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Echo {2}{R} + this.addAbility(new EchoAbility("{2}{R}")); + // {R}: Basalt Gargoyle gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public BasaltGargoyle(final BasaltGargoyle card) { + super(card); + } + + @Override + public BasaltGargoyle copy() { + return new BasaltGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java b/Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java new file mode 100644 index 00000000000..a7762404cd7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +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; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class CloudchaserKestrel extends CardImpl { + + public CloudchaserKestrel(UUID ownerId) { + super(ownerId, 10, "Cloudchaser Kestrel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Cloudchaser Kestrel enters the battlefield, destroy target enchantment. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + // {W}: Target permanent becomes white until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn), new ManaCostsImpl("{W}")); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public CloudchaserKestrel(final CloudchaserKestrel card) { + super(card); + } + + @Override + public CloudchaserKestrel copy() { + return new CloudchaserKestrel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java b/Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java new file mode 100644 index 00000000000..e6d8718bdb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.TapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ScarwoodTreefolk extends CardImpl { + + private static final String staticText = "{this} enters the battlefield tapped"; + + public ScarwoodTreefolk(UUID ownerId) { + super(ownerId, 214, "Scarwood Treefolk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Treefolk"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Scarwood Treefolk enters the battlefield tapped. + this.addAbility(new EntersBattlefieldAbility(new TapSourceEffect(), staticText)); + } + + public ScarwoodTreefolk(final ScarwoodTreefolk card) { + super(card); + } + + @Override + public ScarwoodTreefolk copy() { + return new ScarwoodTreefolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SquallLine.java b/Mage.Sets/src/mage/sets/timespiral/SquallLine.java new file mode 100644 index 00000000000..4a310fd1127 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SquallLine.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.timespiral; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class SquallLine extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public SquallLine(UUID ownerId) { + super(ownerId, 222, "Squall Line", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{G}{G}"); + this.expansionSetCode = "TSP"; + + // Squall Line deals X damage to each creature with flying and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); } + + public SquallLine(final SquallLine card) { + super(card); + } + + @Override + public SquallLine copy() { + return new SquallLine(this); + } +} From 9f5de672480bd99802bb497a451dcc393debe39d Mon Sep 17 00:00:00 2001 From: fireshoes Date: Thu, 20 Aug 2015 14:20:11 -0500 Subject: [PATCH 08/35] Changed Rebel Informer and Mercenary Informer to use FilterObject instead of FilterStackObject. Added alternate art versions of ATQ and ARN cards. Implemented Extinction and Tsabo's Decree. Fixed Necropotence tooltip. --- ...shrasFactory.java => MishrasFactory1.java} | 104 +++--- .../sets/antiquities/MishrasFactory2.java | 52 +++ .../sets/antiquities/MishrasFactory3.java | 52 +++ .../sets/antiquities/MishrasFactory4.java | 52 +++ .../{StripMine.java => StripMine1.java} | 104 +++--- .../src/mage/sets/antiquities/StripMine2.java | 52 +++ .../src/mage/sets/antiquities/StripMine3.java | 52 +++ .../src/mage/sets/antiquities/StripMine4.java | 52 +++ .../{UrzasMine.java => UrzasMine1.java} | 108 +++--- .../src/mage/sets/antiquities/UrzasMine2.java | 54 +++ .../src/mage/sets/antiquities/UrzasMine3.java | 54 +++ .../src/mage/sets/antiquities/UrzasMine4.java | 54 +++ ...sPowerPlant.java => UrzasPowerPlant1.java} | 108 +++--- .../sets/antiquities/UrzasPowerPlant2.java | 54 +++ .../sets/antiquities/UrzasPowerPlant3.java | 54 +++ .../sets/antiquities/UrzasPowerPlant4.java | 54 +++ .../{UrzasTower.java => UrzasTower1.java} | 108 +++--- .../mage/sets/antiquities/UrzasTower2.java | 54 +++ .../mage/sets/antiquities/UrzasTower3.java | 54 +++ .../mage/sets/antiquities/UrzasTower4.java | 54 +++ .../{BirdMaiden.java => BirdMaiden1.java} | 104 +++--- .../mage/sets/arabiannights/BirdMaiden2.java | 52 +++ .../{ErgRaiders.java => ErgRaiders1.java} | 104 +++--- .../mage/sets/arabiannights/ErgRaiders2.java | 53 +++ .../{FishliverOil.java => FishliverOil1.java} | 10 +- .../sets/arabiannights/FishliverOil2.java | 31 ++ ...GiantTortoise.java => GiantTortoise1.java} | 104 +++--- .../sets/arabiannights/GiantTortoise2.java | 52 +++ .../{HasranOgress.java => HasranOgress1.java} | 104 +++--- .../sets/arabiannights/HasranOgress2.java | 53 +++ ...orishCavalry.java => MoorishCavalry1.java} | 108 +++--- .../sets/arabiannights/MoorishCavalry2.java | 54 +++ .../{RukhEgg.java => RukhEgg1.java} | 10 +- .../src/mage/sets/arabiannights/RukhEgg2.java | 53 +++ ...gDevils.java => StoneThrowingDevils1.java} | 126 +++---- .../arabiannights/StoneThrowingDevils2.java | 31 ++ .../{WyluliWolf.java => WyluliWolf1.java} | 10 +- .../mage/sets/arabiannights/WyluliWolf2.java | 54 +++ .../src/mage/sets/eighthedition/RukhEgg.java | 2 +- .../src/mage/sets/iceage/Necropotence.java | 324 +++++++++--------- .../src/mage/sets/invasion/TsabosDecree.java | 133 +++++++ .../mage/sets/ninthedition/FishliverOil.java | 2 +- .../src/mage/sets/ninthedition/RukhEgg.java | 2 +- .../mage/sets/prophecy/MercenaryInformer.java | 3 +- .../src/mage/sets/prophecy/RebelInformer.java | 3 +- .../src/mage/sets/tempest/Extinction.java | 112 ++++++ 46 files changed, 2251 insertions(+), 773 deletions(-) rename Mage.Sets/src/mage/sets/antiquities/{MishrasFactory.java => MishrasFactory1.java} (86%) create mode 100644 Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.java rename Mage.Sets/src/mage/sets/antiquities/{StripMine.java => StripMine1.java} (87%) create mode 100644 Mage.Sets/src/mage/sets/antiquities/StripMine2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/StripMine3.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/StripMine4.java rename Mage.Sets/src/mage/sets/antiquities/{UrzasMine.java => UrzasMine1.java} (87%) create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasMine2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasMine3.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasMine4.java rename Mage.Sets/src/mage/sets/antiquities/{UrzasPowerPlant.java => UrzasPowerPlant1.java} (86%) create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.java rename Mage.Sets/src/mage/sets/antiquities/{UrzasTower.java => UrzasTower1.java} (87%) create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasTower2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasTower3.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/UrzasTower4.java rename Mage.Sets/src/mage/sets/arabiannights/{BirdMaiden.java => BirdMaiden1.java} (87%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.java rename Mage.Sets/src/mage/sets/arabiannights/{ErgRaiders.java => ErgRaiders1.java} (87%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java rename Mage.Sets/src/mage/sets/arabiannights/{FishliverOil.java => FishliverOil1.java} (93%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java rename Mage.Sets/src/mage/sets/arabiannights/{GiantTortoise.java => GiantTortoise1.java} (86%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.java rename Mage.Sets/src/mage/sets/arabiannights/{HasranOgress.java => HasranOgress1.java} (86%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java rename Mage.Sets/src/mage/sets/arabiannights/{MoorishCavalry.java => MoorishCavalry1.java} (86%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.java rename Mage.Sets/src/mage/sets/arabiannights/{RukhEgg.java => RukhEgg1.java} (95%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java rename Mage.Sets/src/mage/sets/arabiannights/{StoneThrowingDevils.java => StoneThrowingDevils1.java} (88%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java rename Mage.Sets/src/mage/sets/arabiannights/{WyluliWolf.java => WyluliWolf1.java} (89%) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.java create mode 100644 Mage.Sets/src/mage/sets/invasion/TsabosDecree.java create mode 100644 Mage.Sets/src/mage/sets/tempest/Extinction.java diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory1.java similarity index 86% rename from Mage.Sets/src/mage/sets/antiquities/MishrasFactory.java rename to Mage.Sets/src/mage/sets/antiquities/MishrasFactory1.java index 6d6b78a838e..22b9008494e 100644 --- a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory.java +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory1.java @@ -1,52 +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.antiquities; - -import java.util.UUID; - -/** - * - * @author North - */ -public class MishrasFactory extends mage.sets.elspethvstezzeret.MishrasFactory { - - public MishrasFactory(UUID ownerId) { - super(ownerId); - this.cardNumber = 66; - this.expansionSetCode = "ATQ"; - } - - public MishrasFactory(final MishrasFactory card) { - super(card); - } - - @Override - public MishrasFactory copy() { - return new MishrasFactory(this); - } -} +/* + * 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.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory1 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory1(UUID ownerId) { + super(ownerId); + this.cardNumber = 66; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory1(final MishrasFactory1 card) { + super(card); + } + + @Override + public MishrasFactory1 copy() { + return new MishrasFactory1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.java new file mode 100644 index 00000000000..9458ff624d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.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.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory2 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory2(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory2(final MishrasFactory2 card) { + super(card); + } + + @Override + public MishrasFactory2 copy() { + return new MishrasFactory2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.java new file mode 100644 index 00000000000..b16a376ccc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.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.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory3 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory3(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory3(final MishrasFactory3 card) { + super(card); + } + + @Override + public MishrasFactory3 copy() { + return new MishrasFactory3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.java new file mode 100644 index 00000000000..231cc38ca58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.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.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory4 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory4(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory4(final MishrasFactory4 card) { + super(card); + } + + @Override + public MishrasFactory4 copy() { + return new MishrasFactory4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine.java b/Mage.Sets/src/mage/sets/antiquities/StripMine1.java similarity index 87% rename from Mage.Sets/src/mage/sets/antiquities/StripMine.java rename to Mage.Sets/src/mage/sets/antiquities/StripMine1.java index 3c782223293..c79ee940f21 100644 --- a/Mage.Sets/src/mage/sets/antiquities/StripMine.java +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine1.java @@ -1,52 +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.antiquities; - -import java.util.UUID; - -/** - * - * @author jeffwadsworth - */ -public class StripMine extends mage.sets.fourthedition.StripMine { - - public StripMine(UUID ownerId) { - super(ownerId); - this.cardNumber = 71; - this.expansionSetCode = "ATQ"; - } - - public StripMine(final StripMine card) { - super(card); - } - - @Override - public StripMine copy() { - return new StripMine(this); - } -} +/* + * 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.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine1 extends mage.sets.fourthedition.StripMine { + + public StripMine1(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "ATQ"; + } + + public StripMine1(final StripMine1 card) { + super(card); + } + + @Override + public StripMine1 copy() { + return new StripMine1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine2.java b/Mage.Sets/src/mage/sets/antiquities/StripMine2.java new file mode 100644 index 00000000000..5c21b154770 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine2.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.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine2 extends mage.sets.fourthedition.StripMine { + + public StripMine2(UUID ownerId) { + super(ownerId); + this.cardNumber = 72; + this.expansionSetCode = "ATQ"; + } + + public StripMine2(final StripMine2 card) { + super(card); + } + + @Override + public StripMine2 copy() { + return new StripMine2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine3.java b/Mage.Sets/src/mage/sets/antiquities/StripMine3.java new file mode 100644 index 00000000000..f88759c681b --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine3.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.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine3 extends mage.sets.fourthedition.StripMine { + + public StripMine3(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "ATQ"; + } + + public StripMine3(final StripMine3 card) { + super(card); + } + + @Override + public StripMine3 copy() { + return new StripMine3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine4.java b/Mage.Sets/src/mage/sets/antiquities/StripMine4.java new file mode 100644 index 00000000000..86e04cbcc99 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine4.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.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine4 extends mage.sets.fourthedition.StripMine { + + public StripMine4(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "ATQ"; + } + + public StripMine4(final StripMine4 card) { + super(card); + } + + @Override + public StripMine4 copy() { + return new StripMine4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine1.java similarity index 87% rename from Mage.Sets/src/mage/sets/antiquities/UrzasMine.java rename to Mage.Sets/src/mage/sets/antiquities/UrzasMine1.java index 559743cbbb2..fc87a23f361 100644 --- a/Mage.Sets/src/mage/sets/antiquities/UrzasMine.java +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine1.java @@ -1,54 +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.antiquities; - -import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author North - */ -public class UrzasMine extends mage.sets.fifthedition.UrzasMine { - - public UrzasMine(UUID ownerId) { - super(ownerId); - this.cardNumber = 75; - this.expansionSetCode = "ATQ"; - this.rarity = Rarity.UNCOMMON; - } - - public UrzasMine(final UrzasMine card) { - super(card); - } - - @Override - public UrzasMine copy() { - return new UrzasMine(this); - } -} +/* + * 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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine1 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine1(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine1(final UrzasMine1 card) { + super(card); + } + + @Override + public UrzasMine1 copy() { + return new UrzasMine1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine2.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine2.java new file mode 100644 index 00000000000..d57c1ea7d7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine2.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine2 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine2(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine2(final UrzasMine2 card) { + super(card); + } + + @Override + public UrzasMine2 copy() { + return new UrzasMine2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine3.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine3.java new file mode 100644 index 00000000000..73e045a5ae7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine3.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine3 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine3(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine3(final UrzasMine3 card) { + super(card); + } + + @Override + public UrzasMine3 copy() { + return new UrzasMine3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine4.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine4.java new file mode 100644 index 00000000000..024ab021ba6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine4.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine4 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine4(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine4(final UrzasMine4 card) { + super(card); + } + + @Override + public UrzasMine4 copy() { + return new UrzasMine4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant1.java similarity index 86% rename from Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant.java rename to Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant1.java index 2dbae8f015b..d829ecee1fb 100644 --- a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant.java +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant1.java @@ -1,54 +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.antiquities; - -import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author North - */ -public class UrzasPowerPlant extends mage.sets.fifthedition.UrzasPowerPlant { - - public UrzasPowerPlant(UUID ownerId) { - super(ownerId); - this.cardNumber = 79; - this.expansionSetCode = "ATQ"; - this.rarity = Rarity.UNCOMMON; - } - - public UrzasPowerPlant(final UrzasPowerPlant card) { - super(card); - } - - @Override - public UrzasPowerPlant copy() { - return new UrzasPowerPlant(this); - } -} +/* + * 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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant1 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant1(UUID ownerId) { + super(ownerId); + this.cardNumber = 79; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant1(final UrzasPowerPlant1 card) { + super(card); + } + + @Override + public UrzasPowerPlant1 copy() { + return new UrzasPowerPlant1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.java new file mode 100644 index 00000000000..db3047ee783 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant2 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant2(UUID ownerId) { + super(ownerId); + this.cardNumber = 80; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant2(final UrzasPowerPlant2 card) { + super(card); + } + + @Override + public UrzasPowerPlant2 copy() { + return new UrzasPowerPlant2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.java new file mode 100644 index 00000000000..03a017e941b --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant3 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant3(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant3(final UrzasPowerPlant3 card) { + super(card); + } + + @Override + public UrzasPowerPlant3 copy() { + return new UrzasPowerPlant3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.java new file mode 100644 index 00000000000..35ab56cf636 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant4 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant4(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant4(final UrzasPowerPlant4 card) { + super(card); + } + + @Override + public UrzasPowerPlant4 copy() { + return new UrzasPowerPlant4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower1.java similarity index 87% rename from Mage.Sets/src/mage/sets/antiquities/UrzasTower.java rename to Mage.Sets/src/mage/sets/antiquities/UrzasTower1.java index dbca4117bf7..9164d8a9ebc 100644 --- a/Mage.Sets/src/mage/sets/antiquities/UrzasTower.java +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower1.java @@ -1,54 +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.antiquities; - -import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author North - */ -public class UrzasTower extends mage.sets.fifthedition.UrzasTower { - - public UrzasTower(UUID ownerId) { - super(ownerId); - this.cardNumber = 83; - this.expansionSetCode = "ATQ"; - this.rarity = Rarity.UNCOMMON; - } - - public UrzasTower(final UrzasTower card) { - super(card); - } - - @Override - public UrzasTower copy() { - return new UrzasTower(this); - } -} +/* + * 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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower1 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower1(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower1(final UrzasTower1 card) { + super(card); + } + + @Override + public UrzasTower1 copy() { + return new UrzasTower1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower2.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower2.java new file mode 100644 index 00000000000..78554254747 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower2.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower2 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower2(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower2(final UrzasTower2 card) { + super(card); + } + + @Override + public UrzasTower2 copy() { + return new UrzasTower2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower3.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower3.java new file mode 100644 index 00000000000..6df76eb4e6c --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower3.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower3 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower3(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower3(final UrzasTower3 card) { + super(card); + } + + @Override + public UrzasTower3 copy() { + return new UrzasTower3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower4.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower4.java new file mode 100644 index 00000000000..9c7633bcc0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower4.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower4 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower4(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower4(final UrzasTower4 card) { + super(card); + } + + @Override + public UrzasTower4 copy() { + return new UrzasTower4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden.java b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden1.java similarity index 87% rename from Mage.Sets/src/mage/sets/arabiannights/BirdMaiden.java rename to Mage.Sets/src/mage/sets/arabiannights/BirdMaiden1.java index 42d94fcf21f..af3bc6ebc12 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden.java +++ b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden1.java @@ -1,52 +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.arabiannights; - -import java.util.UUID; - -/** - * - * @author North - */ -public class BirdMaiden extends mage.sets.fifthedition.BirdMaiden { - - public BirdMaiden(UUID ownerId) { - super(ownerId); - this.cardNumber = 45; - this.expansionSetCode = "ARN"; - } - - public BirdMaiden(final BirdMaiden card) { - super(card); - } - - @Override - public BirdMaiden copy() { - return new BirdMaiden(this); - } -} +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author North + */ +public class BirdMaiden1 extends mage.sets.fifthedition.BirdMaiden { + + public BirdMaiden1(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "ARN"; + } + + public BirdMaiden1(final BirdMaiden1 card) { + super(card); + } + + @Override + public BirdMaiden1 copy() { + return new BirdMaiden1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.java b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.java new file mode 100644 index 00000000000..fe4077e9c4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.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.arabiannights; + +import java.util.UUID; + +/** + * + * @author North + */ +public class BirdMaiden2 extends mage.sets.fifthedition.BirdMaiden { + + public BirdMaiden2(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "ARN"; + } + + public BirdMaiden2(final BirdMaiden2 card) { + super(card); + } + + @Override + public BirdMaiden2 copy() { + return new BirdMaiden2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders1.java similarity index 87% rename from Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java rename to Mage.Sets/src/mage/sets/arabiannights/ErgRaiders1.java index 840710323ef..30162adc48e 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java +++ b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders1.java @@ -1,53 +1,53 @@ -/* - * 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.arabiannights; - -import java.util.UUID; - -/** - * +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * * @author LoneFox - - */ -public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders { - - public ErgRaiders(UUID ownerId) { - super(ownerId); - this.cardNumber = 3; - this.expansionSetCode = "ARN"; - } - - public ErgRaiders(final ErgRaiders card) { - super(card); - } - - @Override - public ErgRaiders copy() { - return new ErgRaiders(this); - } -} + + */ +public class ErgRaiders1 extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders1(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "ARN"; + } + + public ErgRaiders1(final ErgRaiders1 card) { + super(card); + } + + @Override + public ErgRaiders1 copy() { + return new ErgRaiders1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java new file mode 100644 index 00000000000..542000552a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java @@ -0,0 +1,53 @@ +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class ErgRaiders2 extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders2(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "ARN"; + } + + public ErgRaiders2(final ErgRaiders2 card) { + super(card); + } + + @Override + public ErgRaiders2 copy() { + return new ErgRaiders2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/FishliverOil.java b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil1.java similarity index 93% rename from Mage.Sets/src/mage/sets/arabiannights/FishliverOil.java rename to Mage.Sets/src/mage/sets/arabiannights/FishliverOil1.java index 26176b08226..623b9ca2a32 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/FishliverOil.java +++ b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil1.java @@ -47,9 +47,9 @@ import mage.target.common.TargetCreaturePermanent; /** * @author Laxika */ -public class FishliverOil extends CardImpl { +public class FishliverOil1 extends CardImpl { - public FishliverOil(UUID ownerId) { + public FishliverOil1(UUID ownerId) { super(ownerId, 17, "Fishliver Oil", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "ARN"; this.subtype.add("Aura"); @@ -66,12 +66,12 @@ public class FishliverOil extends CardImpl { new GainAbilityAttachedEffect(new IslandwalkAbility(), AttachmentType.AURA, Duration.WhileOnBattlefield))); } - public FishliverOil(final FishliverOil card) { + public FishliverOil1(final FishliverOil1 card) { super(card); } @Override - public FishliverOil copy() { - return new FishliverOil(this); + public FishliverOil1 copy() { + return new FishliverOil1(this); } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java new file mode 100644 index 00000000000..7540256d518 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FishliverOil2 extends mage.sets.arabiannights.FishliverOil1 { + + public FishliverOil2(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "ARN"; + } + + public FishliverOil2(final FishliverOil2 card) { + super(card); + } + + @Override + public FishliverOil2 copy() { + return new FishliverOil2(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise.java b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise1.java similarity index 86% rename from Mage.Sets/src/mage/sets/arabiannights/GiantTortoise.java rename to Mage.Sets/src/mage/sets/arabiannights/GiantTortoise1.java index 2f8af150c36..c91458b42a6 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise.java +++ b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise1.java @@ -1,52 +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.arabiannights; - -import java.util.UUID; - -/** - * - * @author LevelX2 - */ -public class GiantTortoise extends mage.sets.fourthedition.GiantTortoise { - - public GiantTortoise(UUID ownerId) { - super(ownerId); - this.cardNumber = 20; - this.expansionSetCode = "ARN"; - } - - public GiantTortoise(final GiantTortoise card) { - super(card); - } - - @Override - public GiantTortoise copy() { - return new GiantTortoise(this); - } -} +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiantTortoise1 extends mage.sets.fourthedition.GiantTortoise { + + public GiantTortoise1(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "ARN"; + } + + public GiantTortoise1(final GiantTortoise1 card) { + super(card); + } + + @Override + public GiantTortoise1 copy() { + return new GiantTortoise1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.java b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.java new file mode 100644 index 00000000000..2e9ca156d75 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiantTortoise2 extends mage.sets.fourthedition.GiantTortoise { + + public GiantTortoise2(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "ARN"; + } + + public GiantTortoise2(final GiantTortoise2 card) { + super(card); + } + + @Override + public GiantTortoise2 copy() { + return new GiantTortoise2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress1.java similarity index 86% rename from Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java rename to Mage.Sets/src/mage/sets/arabiannights/HasranOgress1.java index 767c07fa5c3..dc6dea357e6 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java +++ b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress1.java @@ -1,53 +1,53 @@ -/* - * 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.arabiannights; - -import java.util.UUID; - -/** - * +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * * @author LoneFox - - */ -public class HasranOgress extends mage.sets.masterseditioniv.HasranOgress { - - public HasranOgress(UUID ownerId) { - super(ownerId); - this.cardNumber = 6; - this.expansionSetCode = "ARN"; - } - - public HasranOgress(final HasranOgress card) { - super(card); - } - - @Override - public HasranOgress copy() { - return new HasranOgress(this); - } -} + + */ +public class HasranOgress1 extends mage.sets.masterseditioniv.HasranOgress { + + public HasranOgress1(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "ARN"; + } + + public HasranOgress1(final HasranOgress1 card) { + super(card); + } + + @Override + public HasranOgress1 copy() { + return new HasranOgress1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java new file mode 100644 index 00000000000..9b64f3a8e8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java @@ -0,0 +1,53 @@ +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class HasranOgress2 extends mage.sets.masterseditioniv.HasranOgress { + + public HasranOgress2(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "ARN"; + } + + public HasranOgress2(final HasranOgress2 card) { + super(card); + } + + @Override + public HasranOgress2 copy() { + return new HasranOgress2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry.java b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry1.java similarity index 86% rename from Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry.java rename to Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry1.java index b23fcaf7717..98a8c4369e8 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry.java +++ b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry1.java @@ -1,54 +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.arabiannights; - -import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author North - */ -public class MoorishCavalry extends mage.sets.timeshifted.MoorishCavalry { - - public MoorishCavalry(UUID ownerId) { - super(ownerId); - this.cardNumber = 62; - this.expansionSetCode = "ARN"; - this.rarity = Rarity.COMMON; - } - - public MoorishCavalry(final MoorishCavalry card) { - super(card); - } - - @Override - public MoorishCavalry copy() { - return new MoorishCavalry(this); - } -} +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class MoorishCavalry1 extends mage.sets.timeshifted.MoorishCavalry { + + public MoorishCavalry1(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; + } + + public MoorishCavalry1(final MoorishCavalry1 card) { + super(card); + } + + @Override + public MoorishCavalry1 copy() { + return new MoorishCavalry1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.java b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.java new file mode 100644 index 00000000000..f394fa38940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.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.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class MoorishCavalry2 extends mage.sets.timeshifted.MoorishCavalry { + + public MoorishCavalry2(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; + } + + public MoorishCavalry2(final MoorishCavalry2 card) { + super(card); + } + + @Override + public MoorishCavalry2 copy() { + return new MoorishCavalry2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/RukhEgg.java b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg1.java similarity index 95% rename from Mage.Sets/src/mage/sets/arabiannights/RukhEgg.java rename to Mage.Sets/src/mage/sets/arabiannights/RukhEgg1.java index 393148c71c3..41dc334a37c 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/RukhEgg.java +++ b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg1.java @@ -45,9 +45,9 @@ import mage.game.permanent.token.Token; * * @author anonymous */ -public class RukhEgg extends CardImpl { +public class RukhEgg1 extends CardImpl { - public RukhEgg(UUID ownerId) { + public RukhEgg1(UUID ownerId) { super(ownerId, 52, "Rukh Egg", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ARN"; this.subtype.add("Bird"); @@ -61,13 +61,13 @@ public class RukhEgg extends CardImpl { this.addAbility(ability); } - public RukhEgg(final RukhEgg card) { + public RukhEgg1(final RukhEgg1 card) { super(card); } @Override - public RukhEgg copy() { - return new RukhEgg(this); + public RukhEgg1 copy() { + return new RukhEgg1(this); } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java new file mode 100644 index 00000000000..1b5866538c2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java @@ -0,0 +1,53 @@ +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class RukhEgg2 extends mage.sets.arabiannights.RukhEgg1 { + + public RukhEgg2(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "ARN"; + } + + public RukhEgg2(final RukhEgg2 card) { + super(card); + } + + @Override + public RukhEgg2 copy() { + return new RukhEgg2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils.java b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils1.java similarity index 88% rename from Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils.java rename to Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils1.java index 49f849fd727..8414e847aad 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils.java +++ b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils1.java @@ -1,63 +1,63 @@ -/* - * 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.arabiannights; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.keyword.FirstStrikeAbility; -import mage.cards.CardImpl; - -/** - * - * @author North - */ -public class StoneThrowingDevils extends CardImpl { - - public StoneThrowingDevils(UUID ownerId) { - super(ownerId, 14, "Stone-Throwing Devils", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); - this.expansionSetCode = "ARN"; - this.subtype.add("Devil"); - - this.power = new MageInt(1); - this.toughness = new MageInt(1); - - // First strike - this.addAbility(FirstStrikeAbility.getInstance()); - } - - public StoneThrowingDevils(final StoneThrowingDevils card) { - super(card); - } - - @Override - public StoneThrowingDevils copy() { - return new StoneThrowingDevils(this); - } -} +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class StoneThrowingDevils1 extends CardImpl { + + public StoneThrowingDevils1(UUID ownerId) { + super(ownerId, 14, "Stone-Throwing Devils", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "ARN"; + this.subtype.add("Devil"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + } + + public StoneThrowingDevils1(final StoneThrowingDevils1 card) { + super(card); + } + + @Override + public StoneThrowingDevils1 copy() { + return new StoneThrowingDevils1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java new file mode 100644 index 00000000000..90262547593 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StoneThrowingDevils2 extends mage.sets.arabiannights.StoneThrowingDevils1 { + + public StoneThrowingDevils2(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "ARN"; + } + + public StoneThrowingDevils2(final StoneThrowingDevils2 card) { + super(card); + } + + @Override + public StoneThrowingDevils2 copy() { + return new StoneThrowingDevils2(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf.java b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf1.java similarity index 89% rename from Mage.Sets/src/mage/sets/arabiannights/WyluliWolf.java rename to Mage.Sets/src/mage/sets/arabiannights/WyluliWolf1.java index 4cddf18a716..1b15f355179 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf.java +++ b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf1.java @@ -34,21 +34,21 @@ import mage.constants.Rarity; * * @author Quercitron */ -public class WyluliWolf extends mage.sets.fifthedition.WyluliWolf { +public class WyluliWolf1 extends mage.sets.fifthedition.WyluliWolf { - public WyluliWolf(UUID ownerId) { + public WyluliWolf1(UUID ownerId) { super(ownerId); this.cardNumber = 40; this.expansionSetCode = "ARN"; this.rarity = Rarity.COMMON; } - public WyluliWolf(final WyluliWolf card) { + public WyluliWolf1(final WyluliWolf1 card) { super(card); } @Override - public WyluliWolf copy() { - return new WyluliWolf(this); + public WyluliWolf1 copy() { + return new WyluliWolf1(this); } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.java b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.java new file mode 100644 index 00000000000..9f2e093f71d --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.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.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author Quercitron + */ +public class WyluliWolf2 extends mage.sets.fifthedition.WyluliWolf { + + public WyluliWolf2(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; + } + + public WyluliWolf2(final WyluliWolf2 card) { + super(card); + } + + @Override + public WyluliWolf2 copy() { + return new WyluliWolf2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java b/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java index 88bff7441dd..63122fceb5d 100644 --- a/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java +++ b/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author anonymous */ -public class RukhEgg extends mage.sets.arabiannights.RukhEgg { +public class RukhEgg extends mage.sets.arabiannights.RukhEgg1 { public RukhEgg(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/iceage/Necropotence.java b/Mage.Sets/src/mage/sets/iceage/Necropotence.java index 40d11e6a202..c4e3bfbce56 100644 --- a/Mage.Sets/src/mage/sets/iceage/Necropotence.java +++ b/Mage.Sets/src/mage/sets/iceage/Necropotence.java @@ -1,162 +1,162 @@ -/* - * 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; -import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; -import mage.abilities.costs.common.PayLifeCost; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.effects.common.ReturnToHandTargetEffect; -import mage.abilities.effects.common.SkipDrawStepEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -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; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author LevelX2 - */ -public class Necropotence extends CardImpl { - - public Necropotence(UUID ownerId) { - super(ownerId, 42, "Necropotence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}"); - this.expansionSetCode = "ICE"; - - // Skip your draw step. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); - // Whenever you discard a card, exile that card from your graveyard. - Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD); - effect.setText("exile that card from your graveyard"); - this.addAbility(new NecropotenceTriggeredAbility(effect)); - // Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new NecropotenceEffect(), new PayLifeCost(1))); - - } - - public Necropotence(final Necropotence card) { - super(card); - } - - @Override - public Necropotence copy() { - return new Necropotence(this); - } -} - -class NecropotenceTriggeredAbility extends TriggeredAbilityImpl { - - NecropotenceTriggeredAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect, false); - } - - NecropotenceTriggeredAbility(final NecropotenceTriggeredAbility ability) { - super(ability); - } - - @Override - public NecropotenceTriggeredAbility copy() { - return new NecropotenceTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DISCARDED_CARD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(event.getPlayerId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever you discards a card, " + super.getRule(); - } -} - -class NecropotenceEffect extends OneShotEffect { - - public NecropotenceEffect() { - super(Outcome.Benefit); - this.staticText = "Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step"; - } - - public NecropotenceEffect(final NecropotenceEffect effect) { - super(effect); - } - - @Override - public NecropotenceEffect copy() { - return new NecropotenceEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - if (controller.getLibrary().size() > 0) { - Card card = controller.getLibrary().removeFromTop(game); - if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, false)) { - card.setFaceDown(true, game); - Effect returnToHandEffect = new ReturnToHandTargetEffect(false); - returnToHandEffect.setText("put that face down card into your hand"); - returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - return true; - } - return false; - } -} +/* + * 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; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.SkipDrawStepEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +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; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class Necropotence extends CardImpl { + + public Necropotence(UUID ownerId) { + super(ownerId, 42, "Necropotence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}"); + this.expansionSetCode = "ICE"; + + // Skip your draw step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); + // Whenever you discard a card, exile that card from your graveyard. + Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD); + effect.setText("exile that card from your graveyard"); + this.addAbility(new NecropotenceTriggeredAbility(effect)); + // Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new NecropotenceEffect(), new PayLifeCost(1))); + + } + + public Necropotence(final Necropotence card) { + super(card); + } + + @Override + public Necropotence copy() { + return new Necropotence(this); + } +} + +class NecropotenceTriggeredAbility extends TriggeredAbilityImpl { + + NecropotenceTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + } + + NecropotenceTriggeredAbility(final NecropotenceTriggeredAbility ability) { + super(ability); + } + + @Override + public NecropotenceTriggeredAbility copy() { + return new NecropotenceTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (getControllerId().equals(event.getPlayerId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you discard a card, " + super.getRule(); + } +} + +class NecropotenceEffect extends OneShotEffect { + + public NecropotenceEffect() { + super(Outcome.Benefit); + this.staticText = "Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step"; + } + + public NecropotenceEffect(final NecropotenceEffect effect) { + super(effect); + } + + @Override + public NecropotenceEffect copy() { + return new NecropotenceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); + if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, false)) { + card.setFaceDown(true, game); + Effect returnToHandEffect = new ReturnToHandTargetEffect(false); + returnToHandEffect.setText("put that face down card into your hand"); + returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/TsabosDecree.java b/Mage.Sets/src/mage/sets/invasion/TsabosDecree.java new file mode 100644 index 00000000000..b18b50240a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/TsabosDecree.java @@ -0,0 +1,133 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class TsabosDecree extends CardImpl { + + public TsabosDecree(UUID ownerId) { + super(ownerId, 129, "Tsabo's Decree", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{5}{B}"); + this.expansionSetCode = "INV"; + + // Choose a creature type. Target player reveals his or her hand and discards all creature cards of that type. Then destroy all creatures of that type that player controls. They can't be regenerated. + this.getSpellAbility().addEffect(new TsabosDecreeEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public TsabosDecree(final TsabosDecree card) { + super(card); + } + + @Override + public TsabosDecree copy() { + return new TsabosDecree(this); + } +} + +class TsabosDecreeEffect extends OneShotEffect { + + public TsabosDecreeEffect() { + super(Outcome.UnboostCreature); + staticText = "Choose a creature type. Target player reveals his or her hand and discards all creature cards of that type. Then destroy all creatures of that type that player controls. They can't be regenerated"; + } + + public TsabosDecreeEffect(final TsabosDecreeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type:"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(outcome, typeChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + if (typeChoice.getChoice() != null) { + game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice()); + } + targetPlayer.revealCards("hand of " + targetPlayer.getName(), targetPlayer.getHand(), game); + FilterCard filterCard = new FilterCard(); + filterCard.add(new SubtypePredicate(typeChoice.getChoice())); + List toDiscard = new ArrayList<>(); + for (Card card : targetPlayer.getHand().getCards(game)) { + if(filterCard.match(card, game)) { + toDiscard.add(card); + } + } + for(Card card: toDiscard) { + targetPlayer.discard(card, source, game); + } + FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent(); + filterCreaturePermanent.add(new SubtypePredicate(typeChoice.getChoice())); + for (Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent, source.getSourceId(), game)) { + if (creature.getControllerId().equals(targetPlayer.getId())) { + creature.destroy(source.getSourceId(), game, true); + } + } + return true; + } + return false; + } + + @Override + public TsabosDecreeEffect copy() { + return new TsabosDecreeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java b/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java index ebad40a8646..f10d10bc854 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java +++ b/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java @@ -32,7 +32,7 @@ import java.util.UUID; /** * @author Laxika */ -public class FishliverOil extends mage.sets.arabiannights.FishliverOil { +public class FishliverOil extends mage.sets.arabiannights.FishliverOil1 { public FishliverOil(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java b/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java index 511c5a81db2..4afbb0214eb 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java +++ b/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author anonymous */ -public class RukhEgg extends mage.sets.arabiannights.RukhEgg { +public class RukhEgg extends mage.sets.arabiannights.RukhEgg1 { public RukhEgg(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java b/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java index 2837baf4cf4..551ee698f35 100644 --- a/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java +++ b/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java @@ -41,6 +41,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.FilterObject; import mage.filter.FilterPermanent; import mage.filter.FilterStackObject; import mage.filter.predicate.Predicates; @@ -55,7 +56,7 @@ import mage.target.TargetPermanent; */ public class MercenaryInformer extends CardImpl { - private static final FilterStackObject filterBlack = new FilterStackObject("black spells or abilities from black sources"); + private static final FilterObject filterBlack = new FilterStackObject("black spells or abilities from black sources"); private static final FilterPermanent filterMercenary = new FilterPermanent("nontoken Mercenary"); static { diff --git a/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java b/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java index f593ed193a6..3522832f5a9 100644 --- a/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java +++ b/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java @@ -41,6 +41,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.FilterObject; import mage.filter.FilterPermanent; import mage.filter.FilterStackObject; import mage.filter.predicate.Predicates; @@ -55,7 +56,7 @@ import mage.target.TargetPermanent; */ public class RebelInformer extends CardImpl { - private static final FilterStackObject filterWhite = new FilterStackObject("white spells or abilities from white sources"); + private static final FilterObject filterWhite = new FilterStackObject("white spells or abilities from white sources"); private static final FilterPermanent filterRebel = new FilterPermanent("nontoken Rebel"); static { diff --git a/Mage.Sets/src/mage/sets/tempest/Extinction.java b/Mage.Sets/src/mage/sets/tempest/Extinction.java new file mode 100644 index 00000000000..e7a8e8b49b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Extinction.java @@ -0,0 +1,112 @@ +/* + * 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.tempest; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class Extinction extends CardImpl { + + public Extinction(UUID ownerId) { + super(ownerId, 29, "Extinction", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}"); + this.expansionSetCode = "TMP"; + + // Destroy all creatures of the creature type of your choice. + this.getSpellAbility().addEffect(new ExtinctionEffect()); + } + + public Extinction(final Extinction card) { + super(card); + } + + @Override + public Extinction copy() { + return new Extinction(this); + } +} + +class ExtinctionEffect extends OneShotEffect { + + public ExtinctionEffect() { + super(Outcome.UnboostCreature); + staticText = "Destroy all creatures of the creature type of your choice"; + } + + public ExtinctionEffect(final ExtinctionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type:"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(outcome, typeChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + if (typeChoice.getChoice() != null) { + game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice()); + } + FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent(); + filterCreaturePermanent.add(new SubtypePredicate(typeChoice.getChoice())); + for (Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent, source.getSourceId(), game)) { + creature.destroy(source.getSourceId(), game, true); + } + return true; + } + return false; + } + + @Override + public ExtinctionEffect copy() { + return new ExtinctionEffect(this); + } +} From 971958b32cf5d7666f941d91d233b6392e07ac03 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 20 Aug 2015 23:55:58 +0300 Subject: [PATCH 09/35] Implement cards: Ith, High Arcanist; PendelHaven Elder; Sarpadian Empires, Vol. VII; and Unyaro Bees --- .../mage/sets/timespiral/IthHighArcanist.java | 87 ++++++++ .../sets/timespiral/PendelhavenElder.java | 80 ++++++++ .../timespiral/SarpadianEmpiresVolVii.java | 188 ++++++++++++++++++ .../src/mage/sets/timespiral/UnyaroBees.java | 78 ++++++++ 4 files changed, 433 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/UnyaroBees.java diff --git a/Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java b/Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java new file mode 100644 index 00000000000..eed301275f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java @@ -0,0 +1,87 @@ +/* + * 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.MageInt; +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.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author LoneFox + */ +public class IthHighArcanist extends CardImpl { + + public IthHighArcanist(UUID ownerId) { + super(ownerId, 241, "Ith, High Arcanist", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}{U}"); + this.expansionSetCode = "TSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // {T}: Untap target attacking creature. Prevent all combat damage that would be dealt to and dealt by that creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt to"); + ability.addEffect(effect); + effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true); + effect.setText("and dealt by that creature this turn"); + ability.addEffect(effect); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(ability); + // Suspend 4-{W}{U} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{W}{U}"), this)); + } + + public IthHighArcanist(final IthHighArcanist card) { + super(card); + } + + @Override + public IthHighArcanist copy() { + return new IthHighArcanist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java b/Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java new file mode 100644 index 00000000000..ba17f4d8573 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.mageobject.ToughnessPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class PendelhavenElder extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each 1/1 creature you control"); + static { + filter.add(new PowerPredicate(Filter.ComparisonType.Equal, 1)); + filter.add(new ToughnessPredicate(Filter.ComparisonType.Equal, 1)); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public PendelhavenElder(UUID ownerId) { + super(ownerId, 209, "Pendelhaven Elder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Each 1/1 creature you control gets +1/+2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 2, Duration.EndOfTurn, filter, false), new TapSourceCost())); + } + + public PendelhavenElder(final PendelhavenElder card) { + super(card); + } + + @Override + public PendelhavenElder copy() { + return new PendelhavenElder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java b/Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java new file mode 100644 index 00000000000..406595d7c1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java @@ -0,0 +1,188 @@ +/* + * 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.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.token.GoblinToken; +import mage.game.permanent.token.SaprolingToken; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class SarpadianEmpiresVolVii extends CardImpl { + + public SarpadianEmpiresVolVii(UUID ownerId) { + super(ownerId, 263, "Sarpadian Empires, Vol. VII", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "TSP"; + + // As Sarpadian Empires, Vol. VII enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseTokenEffect())); + // {3}, {T}: Put a 1/1 creature token of the chosen color and type onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateSelectedTokenEffect(), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public SarpadianEmpiresVolVii(final SarpadianEmpiresVolVii card) { + super(card); + } + + @Override + public SarpadianEmpiresVolVii copy() { + return new SarpadianEmpiresVolVii(this); + } +} + +class ChooseTokenEffect extends OneShotEffect { + + public ChooseTokenEffect() { + super(Outcome.Neutral); + this.staticText = "choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling"; + } + + public ChooseTokenEffect(final ChooseTokenEffect effect) { + super(effect); + } + + @Override + public ChooseTokenEffect copy() { + return new ChooseTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if(sourceObject != null && controller != null) { + ChoiceImpl choices = new ChoiceImpl(true); + choices.setMessage("Choose token type"); + choices.getChoices().add("White Citizen"); + choices.getChoices().add("Blue Camarid"); + choices.getChoices().add("Black Thrull"); + choices.getChoices().add("Red Goblin"); + choices.getChoices().add("Green Saproling"); + if(controller.choose(Outcome.Neutral, choices, game)) { + game.informPlayers(sourceObject.getLogName() + ": chosen token type is " + choices.getChoice()); + game.getState().setValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii", choices.getChoice()); + return true; + } + } + return false; + } +} + +class CreateSelectedTokenEffect extends OneShotEffect { + + public CreateSelectedTokenEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "put a 1/1 creature token of the chosen color and type onto the battlefield"; + } + + public CreateSelectedTokenEffect(final CreateSelectedTokenEffect effect) { + super(effect); + } + + @Override + public CreateSelectedTokenEffect copy() { + return new CreateSelectedTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + String tokenType = game.getState().getValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii").toString(); + Token token; + if(tokenType.equals("White Citizen")) { + token = new CitizenToken(); + } + else if(tokenType.equals("Blue Camarid")) { + token = new CamaridToken(); + } + else if(tokenType.equals("Black Thrull")) { + token = new ThrullToken(); + } + else if(tokenType.equals("Red Goblin")) { + token = new GoblinToken(); + } + else { + token = new SaprolingToken(); + } + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } +} + +class CitizenToken extends Token { + public CitizenToken() { + super("Citizen", "1/1 white Citizen creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Citizen"); + color.setWhite(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} + +class CamaridToken extends Token { + public CamaridToken() { + super("Camarid", "1/1 blue Camarid creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Camarid"); + color.setBlue(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} + +class ThrullToken extends Token { + public ThrullToken() { + super("Thrull", "1/1 black Thrull creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Thrull"); + color.setBlack(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/UnyaroBees.java b/Mage.Sets/src/mage/sets/timespiral/UnyaroBees.java new file mode 100644 index 00000000000..0d08284a89a --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/UnyaroBees.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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +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; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class UnyaroBees extends CardImpl { + + public UnyaroBees(UUID ownerId) { + super(ownerId, 231, "Unyaro Bees", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}{G}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {G}: Unyaro Bees gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + // {3}{G}, Sacrifice Unyaro Bees: Unyaro Bees deals 2 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{3}{G}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public UnyaroBees(final UnyaroBees card) { + super(card); + } + + @Override + public UnyaroBees copy() { + return new UnyaroBees(this); + } +} From e490a3445ab2a98d3e39e7b768f255f822cb2b99 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Thu, 20 Aug 2015 22:42:12 -0500 Subject: [PATCH 10/35] Implemented Grozoth, Dementia Sliver, and Planewalker's Scorn, Fury, Favor, and Mirth. --- .../championsofkamigawa/InameDeathAspect.java | 217 +++++++++--------- .../sets/planeshift/PlaneswalkersFavor.java | 117 ++++++++++ .../sets/planeshift/PlaneswalkersFury.java | 105 +++++++++ .../sets/planeshift/PlaneswalkersMirth.java | 106 +++++++++ .../sets/planeshift/PlaneswalkersScorn.java | 117 ++++++++++ Mage.Sets/src/mage/sets/ravnica/Grozoth.java | 138 +++++++++++ .../mage/sets/timespiral/DementiaSliver.java | 132 +++++++++++ 7 files changed, 822 insertions(+), 110 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java create mode 100644 Mage.Sets/src/mage/sets/ravnica/Grozoth.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java index 238a54f0116..006973f52e9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java @@ -1,111 +1,108 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.championsofkamigawa; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.SearchEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; -import mage.target.common.TargetCardInLibrary; - -/** - * - * @author Loki - */ -public class InameDeathAspect extends CardImpl { - - public InameDeathAspect(UUID ownerId) { - super(ownerId, 118, "Iname, Death Aspect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); - this.expansionSetCode = "CHK"; - this.supertype.add("Legendary"); - this.subtype.add("Spirit"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - this.addAbility(new EntersBattlefieldTriggeredAbility(new InameDeathAspectEffect(), true)); - } - - public InameDeathAspect(final InameDeathAspect card) { - super(card); - } - - @Override - public InameDeathAspect copy() { - return new InameDeathAspect(this); - } -} - -class InameDeathAspectEffect extends SearchEffect { - - private static final FilterCreatureCard filter = new FilterCreatureCard(); - - static { - filter.add(new SubtypePredicate("Spirit")); - } - - public InameDeathAspectEffect() { - super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral); - staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library"; - } - - public InameDeathAspectEffect(final InameDeathAspectEffect effect) { - super(effect); - } - - @Override - public InameDeathAspectEffect copy() { - return new InameDeathAspectEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { - player.moveCards(new CardsImpl(target.getTargets()), Zone.LIBRARY, Zone.GRAVEYARD, source, game); - } - player.shuffleLibrary(game); - return true; - } - return false; - } +/* + * 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.championsofkamigawa; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.SearchEffect; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Loki + */ +public class InameDeathAspect extends CardImpl { + + public InameDeathAspect(UUID ownerId) { + super(ownerId, 118, "Iname, Death Aspect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "CHK"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.addAbility(new EntersBattlefieldTriggeredAbility(new InameDeathAspectEffect(), true)); + } + + public InameDeathAspect(final InameDeathAspect card) { + super(card); + } + + @Override + public InameDeathAspect copy() { + return new InameDeathAspect(this); + } +} + +class InameDeathAspectEffect extends SearchEffect { + + private static final FilterCreatureCard filter = new FilterCreatureCard(); + + static { + filter.add(new SubtypePredicate("Spirit")); + } + + public InameDeathAspectEffect() { + super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral); + staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library"; + } + + public InameDeathAspectEffect(final InameDeathAspectEffect effect) { + super(effect); + } + + @Override + public InameDeathAspectEffect copy() { + return new InameDeathAspectEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + player.moveCards(new CardsImpl(target.getTargets()), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + player.shuffleLibrary(game); + return true; + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java new file mode 100644 index 00000000000..7fc8f0b20f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersFavor extends CardImpl { + + public PlaneswalkersFavor(UUID ownerId) { + super(ownerId, 86, "Planeswalker's Favor", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "PLS"; + + // {3}{G}: Target opponent reveals a card at random from his or her hand. Target creature gets +X/+X until end of turn, where X is the revealed card's converted mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersFavorEffect(), new ManaCostsImpl("{3}{G}")); + Target target = new TargetOpponent(); + ability.addTarget(target); + target = new TargetCreaturePermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public PlaneswalkersFavor(final PlaneswalkersFavor card) { + super(card); + } + + @Override + public PlaneswalkersFavor copy() { + return new PlaneswalkersFavor(this); + } +} + +class PlaneswalkersFavorEffect extends OneShotEffect { + + public PlaneswalkersFavorEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. Target creature gets +X/+X until end of turn, where X is the revealed card's converted mana cost"; + } + + public PlaneswalkersFavorEffect(final PlaneswalkersFavorEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget()); + if (opponent != null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + int boostValue = card.getManaCost().convertedManaCost(); + opponent.revealCards("Planeswalker's Favor", revealed, game); + ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); + game.addEffect(effect, source); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersFavorEffect copy() { + return new PlaneswalkersFavorEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java new file mode 100644 index 00000000000..c95d3ae35d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersFury extends CardImpl { + + public PlaneswalkersFury(UUID ownerId) { + super(ownerId, 70, "Planeswalker's Fury", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "PLS"; + + // {3}{R}: Target opponent reveals a card at random from his or her hand. Planeswalker's Fury deals damage equal to that card's converted mana cost to that player. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersFuryEffect(), new ManaCostsImpl("{3}{R}")); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public PlaneswalkersFury(final PlaneswalkersFury card) { + super(card); + } + + @Override + public PlaneswalkersFury copy() { + return new PlaneswalkersFury(this); + } +} + +class PlaneswalkersFuryEffect extends OneShotEffect { + + public PlaneswalkersFuryEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. Planeswalker's Fury deals damage equal to that card's converted mana cost to that player"; + } + + public PlaneswalkersFuryEffect(final PlaneswalkersFuryEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + if (opponent != null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + opponent.revealCards("Planeswalker's Fury", revealed, game); + opponent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersFuryEffect copy() { + return new PlaneswalkersFuryEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java new file mode 100644 index 00000000000..c468a5f7988 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersMirth extends CardImpl { + + public PlaneswalkersMirth(UUID ownerId) { + super(ownerId, 12, "Planeswalker's Mirth", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "PLS"; + + // {3}{W}: Target opponent reveals a card at random from his or her hand. You gain life equal to that card's converted mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersMirthEffect(), new ManaCostsImpl("{3}{W}")); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public PlaneswalkersMirth(final PlaneswalkersMirth card) { + super(card); + } + + @Override + public PlaneswalkersMirth copy() { + return new PlaneswalkersMirth(this); + } +} + +class PlaneswalkersMirthEffect extends OneShotEffect { + + public PlaneswalkersMirthEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. You gain life equal to that card's converted mana cost"; + } + + public PlaneswalkersMirthEffect(final PlaneswalkersMirthEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + Player player = game.getPlayer(source.getControllerId()); + if (opponent != null && player!= null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + opponent.revealCards("Planeswalker's Mirth", revealed, game); + player.gainLife(card.getManaCost().convertedManaCost(), game); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersMirthEffect copy() { + return new PlaneswalkersMirthEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java new file mode 100644 index 00000000000..d1b42fbd758 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersScorn extends CardImpl { + + public PlaneswalkersScorn(UUID ownerId) { + super(ownerId, 52, "Planeswalker's Scorn", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "PLS"; + + // {3}{B}: Target opponent reveals a card at random from his or her hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersScornEffect(), new ManaCostsImpl("{3}{B}")); + Target target = new TargetOpponent(); + ability.addTarget(target); + target = new TargetCreaturePermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public PlaneswalkersScorn(final PlaneswalkersScorn card) { + super(card); + } + + @Override + public PlaneswalkersScorn copy() { + return new PlaneswalkersScorn(this); + } +} + +class PlaneswalkersScornEffect extends OneShotEffect { + + public PlaneswalkersScornEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost"; + } + + public PlaneswalkersScornEffect(final PlaneswalkersScornEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget()); + if (opponent != null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + int boostValue = -1 * card.getManaCost().convertedManaCost(); + opponent.revealCards("Planeswalker's Scorn", revealed, game); + ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); + game.addEffect(effect, source); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersScornEffect copy() { + return new PlaneswalkersScornEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ravnica/Grozoth.java b/Mage.Sets/src/mage/sets/ravnica/Grozoth.java new file mode 100644 index 00000000000..275279bbff5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/Grozoth.java @@ -0,0 +1,138 @@ +/* + * 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.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.SearchEffect; +import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class Grozoth extends CardImpl { + + public Grozoth(UUID ownerId) { + super(ownerId, 53, "Grozoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Leviathan"); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // When Grozoth enters the battlefield, you may search your library for any number of cards that have converted mana cost 9, reveal them, and put them into your hand. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GrozothEffect(), true)); + + // {4}: Grozoth loses defender until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn), + new ManaCostsImpl("{4}"))); + + // Transmute {1}{U}{U} + this.addAbility(new TransmuteAbility("{1}{U}{U}")); + } + + public Grozoth(final Grozoth card) { + super(card); + } + + @Override + public Grozoth copy() { + return new Grozoth(this); + } +} + +class GrozothEffect extends SearchEffect { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, 9)); + } + + public GrozothEffect() { + super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.DrawCard); + staticText = "you may search your library for any number of cards that have converted mana cost 9, reveal them, and put them into your hand. If you do, shuffle your library"; + } + + public GrozothEffect(final GrozothEffect effect) { + super(effect); + } + + @Override + public GrozothEffect copy() { + return new GrozothEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card sourceCard = game.getCard(source.getSourceId()); + if (sourceCard != null && player != null && player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + Cards cards = new CardsImpl(); + for (UUID cardId : target.getTargets()) { + Card card = player.getLibrary().remove(cardId, game); + if (card != null) { + cards.add(card); + } + } + player.revealCards(sourceCard.getIdName(), cards, game); + player.moveCards(cards, Zone.LIBRARY, Zone.HAND, source, game); + } + player.shuffleLibrary(game); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java b/Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java new file mode 100644 index 00000000000..838e853ff7c --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class DementiaSliver extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("All Slivers"); + + static { + filter.add(new SubtypePredicate("Sliver")); + } + + public DementiaSliver(UUID ownerId) { + super(ownerId, 236, "Dementia Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Sliver"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // All Slivers have "{tap}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it. Activate this ability only during your turn." + Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.getInstance()); + gainedAbility.addEffect(new DementiaSliverEffect()); + gainedAbility.addTarget(new TargetOpponent()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, filter, + "All Slivers have \"{tap}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it\""))); + } + + public DementiaSliver(final DementiaSliver card) { + super(card); + } + + @Override + public DementiaSliver copy() { + return new DementiaSliver(this); + } +} + +class DementiaSliverEffect extends OneShotEffect { + + public DementiaSliverEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it"; + } + + public DementiaSliverEffect(final DementiaSliverEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = game.getObject(source.getSourceId()); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + if (opponent != null && sourceObject != null && !cardName.isEmpty()) { + if (opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + opponent.revealCards(sourceObject.getName(), revealed, game); + if (card.getName().equals(cardName)) { + opponent.discard(card, source, game); + } + } + } + return true; + } + return false; + } + + @Override + public DementiaSliverEffect copy() { + return new DementiaSliverEffect(this); + } + +} \ No newline at end of file From 979afc0cace9e75c3ac8fbc5df080b9f3615d11a Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 21 Aug 2015 10:07:59 +0300 Subject: [PATCH 11/35] Implement cards: D'Avenant Healer, Drudge Reavers, Flamecore Elemental, and Foriysian Interceptor --- .../mage/sets/timespiral/DAvenantHealer.java | 79 +++++++++++++++++++ .../mage/sets/timespiral/DrudgeReavers.java | 68 ++++++++++++++++ .../sets/timespiral/FlamecoreElemental.java | 62 +++++++++++++++ .../sets/timespiral/ForiysianInterceptor.java | 71 +++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java diff --git a/Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.java b/Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.java new file mode 100644 index 00000000000..8f1a6ca0e00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.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.timespiral; + +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.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingOrBlockingCreature; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class DAvenantHealer extends CardImpl { + + public DAvenantHealer(UUID ownerId) { + super(ownerId, 11, "D'Avenant Healer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Archer"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}: D'Avenant Healer deals 1 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetAttackingOrBlockingCreature()); + this.addAbility(ability); + // {T}: Prevent the next 1 damage that would be dealt to target creature or player this turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public DAvenantHealer(final DAvenantHealer card) { + super(card); + } + + @Override + public DAvenantHealer copy() { + return new DAvenantHealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.java b/Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.java new file mode 100644 index 00000000000..a46a1d52fcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class DrudgeReavers extends CardImpl { + + public DrudgeReavers(UUID ownerId) { + super(ownerId, 105, "Drudge Reavers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Skeleton"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // {B}: Regenerate Drudge Reavers. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public DrudgeReavers(final DrudgeReavers card) { + super(card); + } + + @Override + public DrudgeReavers copy() { + return new DrudgeReavers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.java b/Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.java new file mode 100644 index 00000000000..1b2e8615ab3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FlamecoreElemental extends CardImpl { + + public FlamecoreElemental(UUID ownerId) { + super(ownerId, 154, "Flamecore Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Echo {2}{R}{R} + this.addAbility(new EchoAbility("{2}{R}{R}")); + } + + public FlamecoreElemental(final FlamecoreElemental card) { + super(card); + } + + @Override + public FlamecoreElemental copy() { + return new FlamecoreElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java b/Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java new file mode 100644 index 00000000000..ec3759abe24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ForiysianInterceptor extends CardImpl { + + public ForiysianInterceptor(UUID ownerId) { + super(ownerId, 18, "Foriysian Interceptor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(0); + this.toughness = new MageInt(5); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Foriysian Interceptor can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public ForiysianInterceptor(final ForiysianInterceptor card) { + super(card); + } + + @Override + public ForiysianInterceptor copy() { + return new ForiysianInterceptor(this); + } +} From 1d5b7240639af24e931e2d4dceb9ce7b435820f8 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 21 Aug 2015 10:48:44 +0300 Subject: [PATCH 12/35] Implement cards: Molder, Sprout, Tectonic Fiend, and Viscerid Deepwalker --- .../src/mage/sets/timespiral/Molder.java | 80 +++++++++++++++++++ .../src/mage/sets/timespiral/Sprout.java | 59 ++++++++++++++ .../mage/sets/timespiral/TectonicFiend.java | 65 +++++++++++++++ .../sets/timespiral/VisceridDeepwalker.java | 70 ++++++++++++++++ 4 files changed, 274 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/Molder.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/Sprout.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.java diff --git a/Mage.Sets/src/mage/sets/timespiral/Molder.java b/Mage.Sets/src/mage/sets/timespiral/Molder.java new file mode 100644 index 00000000000..8e65c7b5e12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Molder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Molder extends CardImpl { + + public Molder(UUID ownerId) { + super(ownerId, 206, "Molder", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{G}"); + this.expansionSetCode = "TSP"; + + // Destroy target artifact or enchantment with converted mana cost X. It can't be regenerated. You gain X life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost X"))); + this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if(ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterArtifactOrEnchantmentPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost X"); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue)); + ability.addTarget(new TargetPermanent(filter)); + } + } + + public Molder(final Molder card) { + super(card); + } + + @Override + public Molder copy() { + return new Molder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Sprout.java b/Mage.Sets/src/mage/sets/timespiral/Sprout.java new file mode 100644 index 00000000000..ae16ecf750d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Sprout.java @@ -0,0 +1,59 @@ +/* + * 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.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.SaprolingToken; + +/** + * + * @author LoneFox + */ +public class Sprout extends CardImpl { + + public Sprout(UUID ownerId) { + super(ownerId, 221, "Sprout", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "TSP"; + + // Put a 1/1 green Saproling creature token onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken())); + } + + public Sprout(final Sprout card) { + super(card); + } + + @Override + public Sprout copy() { + return new Sprout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java b/Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java new file mode 100644 index 00000000000..ddb1bf268c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TectonicFiend extends CardImpl { + + public TectonicFiend(UUID ownerId) { + super(ownerId, 181, "Tectonic Fiend", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Elemental"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Echo {4}{R}{R} + this.addAbility(new EchoAbility("{4}{R}{R}")); + // Tectonic Fiend attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + } + + public TectonicFiend(final TectonicFiend card) { + super(card); + } + + @Override + public TectonicFiend copy() { + return new TectonicFiend(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.java b/Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.java new file mode 100644 index 00000000000..810f9e4952a --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class VisceridDeepwalker extends CardImpl { + + public VisceridDeepwalker(UUID ownerId) { + super(ownerId, 91, "Viscerid Deepwalker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Homarid"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {U}: Viscerid Deepwalker gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + // Suspend 4-{U} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{U}"), this)); + } + + public VisceridDeepwalker(final VisceridDeepwalker card) { + super(card); + } + + @Override + public VisceridDeepwalker copy() { + return new VisceridDeepwalker(this); + } +} From 23039572f2206ade860f5835e9b85e82a9c4b2a1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 21 Aug 2015 09:49:53 +0200 Subject: [PATCH 13/35] Xmage 1.4.3v3 --- Mage.Client/serverlist.txt | 3 +-- Mage.Common/src/mage/utils/MageVersion.java | 2 +- .../sets/morningtide/VendilionClique.java | 26 ++++++++++--------- .../mage/cards/repository/CardRepository.java | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Mage.Client/serverlist.txt b/Mage.Client/serverlist.txt index 46138917a32..cff928b3be7 100644 --- a/Mage.Client/serverlist.txt +++ b/Mage.Client/serverlist.txt @@ -1,7 +1,6 @@ XMage.de 1 (Europe/Germany) fast :xmage.de:17171 woogerworks (North America/USA) :xmage.woogerworks.info:17171 -XMage.info 1 (Europe/France) slow :176.31.186.181:17171 -XMage.info 2 (Europe/France) slow :176.31.186.181:17000 +XMage.info 1 (Europe/France) new network code -> see forum :176.31.186.181:17171 IceMage (Europe/Netherlands) :ring0.cc:17171 Seedds Server (Asia) :115.29.203.80:17171 localhost -> connect to your local server (must be started):localhost:17171 diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index 79ff05b9782..3357d3052b3 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -41,7 +41,7 @@ public class MageVersion implements Serializable, Comparable { public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_PATCH = 3; - public final static String MAGE_VERSION_MINOR_PATCH = "v2"; + public final static String MAGE_VERSION_MINOR_PATCH = "v3"; public final static String MAGE_VERSION_INFO = ""; private final int major; diff --git a/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java b/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java index 8a69fe999c5..fcc33b174d6 100644 --- a/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java +++ b/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java @@ -28,10 +28,8 @@ package mage.sets.morningtide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -40,7 +38,9 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterNonlandCard; import mage.game.Game; @@ -85,6 +85,7 @@ public class VendilionClique extends CardImpl { } class VendilionCliqueEffect extends OneShotEffect { + VendilionCliqueEffect() { super(Outcome.Discard); staticText = "look at target player's hand. You may choose a nonland card from it. If you do, that player reveals the chosen card, puts it on the bottom of his or her library, then draws a card"; @@ -97,17 +98,18 @@ class VendilionCliqueEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); - Player sourcePlayer = game.getPlayer(source.getControllerId()); - if (player != null && sourcePlayer != null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (player != null && controller != null && sourceObject != null) { TargetCard targetCard = new TargetCard(Zone.ALL, new FilterNonlandCard()); targetCard.setRequired(false); - if (sourcePlayer.choose(Outcome.Discard, player.getHand(), targetCard, game)) { - Card c = game.getCard(targetCard.getFirstTarget()); - if (c != null) { + if (controller.choose(Outcome.Discard, player.getHand(), targetCard, game)) { + Card card = game.getCard(targetCard.getFirstTarget()); + if (card != null) { CardsImpl cards = new CardsImpl(); - cards.add(c); - player.revealCards("Vendilion Clique effect", cards, game); - c.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + cards.add(card); + player.revealCards(sourceObject.getIdName(), cards, game); + player.putCardsOnBottomOfLibrary(cards, game, source, true); player.drawCards(1, game); } } @@ -120,4 +122,4 @@ class VendilionCliqueEffect extends OneShotEffect { public VendilionCliqueEffect copy() { return new VendilionCliqueEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 046c25eb1b4..5aec317ec69 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -63,7 +63,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 41; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 33; + private static final long CARD_CONTENT_VERSION = 34; private final Random random = new Random(); private Dao cardDao; From 47f84835384bfe0b40c7c5a9d9fd572e269beeab Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 21 Aug 2015 14:53:56 -0500 Subject: [PATCH 14/35] - Added Ratcatcher --- .../src/mage/sets/dissension/Ratcatcher.java | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/Ratcatcher.java diff --git a/Mage.Sets/src/mage/sets/dissension/Ratcatcher.java b/Mage.Sets/src/mage/sets/dissension/Ratcatcher.java new file mode 100644 index 00000000000..ca891b48256 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/Ratcatcher.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author jeffwadsworth + */ +public class Ratcatcher extends CardImpl { + + private static final FilterCard filter = new FilterCard("Rat card"); + + static { + filter.add(new SubtypePredicate("Rat")); + } + + public Ratcatcher(UUID ownerId) { + super(ownerId, 52, "Ratcatcher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Ogre"); + this.subtype.add("Rogue"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Fear + this.addAbility(FearAbility.getInstance()); + + // At the beginning of your upkeep, you may search your library for a Rat card, reveal it, and put it into your hand. If you do, shuffle your library. + TargetCardInLibrary targetCard = new TargetCardInLibrary(1, 1, filter); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(targetCard, true, true), TargetController.YOU, true)); + + } + + public Ratcatcher(final Ratcatcher card) { + super(card); + } + + @Override + public Ratcatcher copy() { + return new Ratcatcher(this); + } +} From 90003d99f30510e56b23d3728ed4ad891cdd4b66 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 22 Aug 2015 19:26:42 +0300 Subject: [PATCH 15/35] Implement cards: Flame Burst, Muscle Burst, and Pardic Firecat --- .../mage/sets/odyssey/DiligentFarmhand.java | 4 +- .../src/mage/sets/odyssey/FlameBurst.java | 122 +++++++++++++++++ .../src/mage/sets/odyssey/MuscleBurst.java | 123 ++++++++++++++++++ .../src/mage/sets/odyssey/PardicFirecat.java | 65 +++++++++ .../common/CardsInAllGraveyardsCount.java | 4 +- 5 files changed, 313 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/odyssey/FlameBurst.java create mode 100644 Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java create mode 100644 Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java diff --git a/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java b/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java index fbd76745f53..eff14e87010 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java +++ b/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java @@ -31,10 +31,8 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -63,7 +61,7 @@ public class DiligentFarmhand extends CardImpl { ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); // If Diligent Farmhand is in a graveyard, effects from spells named Muscle Burst count it as a card named Muscle Burst. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("If Diligent Farmhand is in a graveyard, effects from spells named Muscle Burst count it as a card named Muscle Burst"))); + this.addAbility(MuscleBurst.getCountAsAbility()); } public DiligentFarmhand(final DiligentFarmhand card) { diff --git a/Mage.Sets/src/mage/sets/odyssey/FlameBurst.java b/Mage.Sets/src/mage/sets/odyssey/FlameBurst.java new file mode 100644 index 00000000000..b10502aa3e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/FlameBurst.java @@ -0,0 +1,122 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class FlameBurst extends CardImpl { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(Predicates.or(new NamePredicate("Flame Burst"), + new AbilityPredicate(CountAsFlameBurstAbility.class))); + } + + public FlameBurst(UUID ownerId) { + super(ownerId, 194, "Flame Burst", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ODY"; + + // Flame Burst deals X damage to target creature or player, where X is 2 plus the number of cards named Flame Burst in all graveyards. + Effect effect = new DamageTargetEffect(new FlameBurstCount(filter)); + effect.setText("{this} deals X damage to target creature or player, where X is 2 plus the number of cards named Flame Burst in all graveyards."); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public FlameBurst(final FlameBurst card) { + super(card); + } + + @Override + public FlameBurst copy() { + return new FlameBurst(this); + } + + public static Ability getCountAsAbility() { + return new CountAsFlameBurstAbility(); + } +} + +class FlameBurstCount extends CardsInAllGraveyardsCount { + + public FlameBurstCount(FilterCard filter) { + super(filter); + } + + public FlameBurstCount(FlameBurstCount value) { + super(value); + } + + public FlameBurstCount copy() { + return new FlameBurstCount(this); + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + return super.calculate(game, source, effect) + 2; + } + +} + +class CountAsFlameBurstAbility extends SimpleStaticAbility { + + public CountAsFlameBurstAbility() { + super(Zone.GRAVEYARD, new InfoEffect("If {this} is in a graveyard, effects from spells named Flame Burst count it as a card named Flame Burst")); + } + + public CountAsFlameBurstAbility(CountAsFlameBurstAbility ability) { + super(ability); + } + + @Override + public CountAsFlameBurstAbility copy() { + return new CountAsFlameBurstAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java b/Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java new file mode 100644 index 00000000000..d2108c88c4d --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java @@ -0,0 +1,123 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.InfoEffect; +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.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MuscleBurst extends CardImpl { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(Predicates.or(new NamePredicate("Muscle Burst"), + new AbilityPredicate(CountAsMuscleBurstAbility.class))); + } + + public MuscleBurst(UUID ownerId) { + super(ownerId, 252, "Muscle Burst", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "ODY"; + + // Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards. + MuscleBurstCount count = new MuscleBurstCount(filter); + Effect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn, true); + effect.setText("Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards."); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public MuscleBurst(final MuscleBurst card) { + super(card); + } + + @Override + public MuscleBurst copy() { + return new MuscleBurst(this); + } + + public static Ability getCountAsAbility() { + return new CountAsMuscleBurstAbility(); + } +} + +class MuscleBurstCount extends CardsInAllGraveyardsCount { + + public MuscleBurstCount(FilterCard filter) { + super(filter); + } + + public MuscleBurstCount(MuscleBurstCount value) { + super(value); + } + + public MuscleBurstCount copy() { + return new MuscleBurstCount(this); + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + return super.calculate(game, source, effect) + 3; + } + +} + +class CountAsMuscleBurstAbility extends SimpleStaticAbility { + + public CountAsMuscleBurstAbility() { + super(Zone.GRAVEYARD, new InfoEffect("If {this} is in a graveyard, effects from spells named Muscle Burst count it as a card named Muscle Burst")); + } + + public CountAsMuscleBurstAbility(CountAsMuscleBurstAbility ability) { + super(ability); + } + + @Override + public CountAsMuscleBurstAbility copy() { + return new CountAsMuscleBurstAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java b/Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java new file mode 100644 index 00000000000..fa4acba3663 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class PardicFirecat extends CardImpl { + + public PardicFirecat(UUID ownerId) { + super(ownerId, 211, "Pardic Firecat", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Elemental"); + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // If Pardic Firecat is in a graveyard, effects from spells named Flame Burst count it as a card named Flame Burst. + this.addAbility(FlameBurst.getCountAsAbility()); + } + + public PardicFirecat(final PardicFirecat card) { + super(card); + } + + @Override + public PardicFirecat copy() { + return new PardicFirecat(this); + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java index caec5c530a7..901845974a5 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java @@ -51,8 +51,8 @@ public class CardsInAllGraveyardsCount implements DynamicValue { this.filter = filter; } - private CardsInAllGraveyardsCount(CardsInAllGraveyardsCount dynamicValue) { - this.filter = dynamicValue.filter; + public CardsInAllGraveyardsCount(CardsInAllGraveyardsCount dynamicValue) { + this.filter = dynamicValue.filter.copy(); } @Override From 77279fd5a24279714306a1cb3302f7ba596d823c Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 22 Aug 2015 20:16:40 +0300 Subject: [PATCH 16/35] Implement cards: Balshan Collaborator, Liquify, Narcissism, and Pardic Collaborator --- .../sets/torment/BalshanCollaborator.java | 70 ++++++++++++++++++ Mage.Sets/src/mage/sets/torment/Liquify.java | 70 ++++++++++++++++++ .../src/mage/sets/torment/Narcissism.java | 74 +++++++++++++++++++ .../mage/sets/torment/PardicCollaborator.java | 70 ++++++++++++++++++ 4 files changed, 284 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/torment/BalshanCollaborator.java create mode 100644 Mage.Sets/src/mage/sets/torment/Liquify.java create mode 100644 Mage.Sets/src/mage/sets/torment/Narcissism.java create mode 100644 Mage.Sets/src/mage/sets/torment/PardicCollaborator.java diff --git a/Mage.Sets/src/mage/sets/torment/BalshanCollaborator.java b/Mage.Sets/src/mage/sets/torment/BalshanCollaborator.java new file mode 100644 index 00000000000..02000670863 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/BalshanCollaborator.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.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +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 BalshanCollaborator extends CardImpl { + + public BalshanCollaborator(UUID ownerId) { + super(ownerId, 25, "Balshan Collaborator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {B}: Balshan Collaborator gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public BalshanCollaborator(final BalshanCollaborator card) { + super(card); + } + + @Override + public BalshanCollaborator copy() { + return new BalshanCollaborator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/Liquify.java b/Mage.Sets/src/mage/sets/torment/Liquify.java new file mode 100644 index 00000000000..2ff79251434 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/Liquify.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.torment; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class Liquify extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("spell with converted mana cost 3 or less"); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4)); + } + + public Liquify(UUID ownerId) { + super(ownerId, 41, "Liquify", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "TOR"; + + // Counter target spell with converted mana cost 3 or less. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED)); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public Liquify(final Liquify card) { + super(card); + } + + @Override + public Liquify copy() { + return new Liquify(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/Narcissism.java b/Mage.Sets/src/mage/sets/torment/Narcissism.java new file mode 100644 index 00000000000..e42647943b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/Narcissism.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.torment; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +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.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Narcissism extends CardImpl { + + public Narcissism(UUID ownerId) { + super(ownerId, 134, "Narcissism", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "TOR"; + + // {G}, Discard a card: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // {G}, Sacrifice Narcissism: Target creature gets +2/+2 until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Narcissism(final Narcissism card) { + super(card); + } + + @Override + public Narcissism copy() { + return new Narcissism(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PardicCollaborator.java b/Mage.Sets/src/mage/sets/torment/PardicCollaborator.java new file mode 100644 index 00000000000..8465052736a --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PardicCollaborator.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.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PardicCollaborator extends CardImpl { + + public PardicCollaborator(UUID ownerId) { + super(ownerId, 106, "Pardic Collaborator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {B}: Pardic Collaborator gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public PardicCollaborator(final PardicCollaborator card) { + super(card); + } + + @Override + public PardicCollaborator copy() { + return new PardicCollaborator(this); + } +} From 532d4e0af026bf8d8695d77b025a5c4bd7895b8d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 22 Aug 2015 19:29:57 +0200 Subject: [PATCH 17/35] * Added automatic handling for order of triggered abilities going to stack (fixes #701 / related to #328). --- .../src/main/java/mage/client/cards/Card.java | 252 +++++++++++------- .../main/java/mage/client/cards/CardArea.java | 237 ++++++++++------ .../mage/client/cards/CardEventSource.java | 62 ++--- .../java/mage/client/cards/Permanent.java | 20 +- .../mage/client/dialog/PickPileDialog.java | 104 ++++---- .../mage/client/dialog/ShowCardsDialog.java | 63 ++--- .../java/mage/client/draft/DraftPanel.java | 2 +- .../main/java/mage/client/game/GamePanel.java | 179 +++++++++++-- .../java/mage/client/game/PlayAreaPanel.java | 12 + .../plugins/adapters/MageActionCallback.java | 56 ++-- .../mage/client/unusedFiles/PlayerPanel.java | 74 +++-- .../main/java/mage/client/util/Listener.java | 55 ++-- .../java/org/mage/card/arcane/CardPanel.java | 93 ++++--- Mage.Common/src/mage/cards/MageCard.java | 34 ++- .../src/mage/cards/action/ActionCallback.java | 2 +- .../mage/cards/action/impl/EmptyCallback.java | 2 +- .../src/mage/player/human/HumanPlayer.java | 98 ++++++- .../java/mage/server/game/GameController.java | 2 +- .../java/org/mage/test/player/TestPlayer.java | 4 +- .../continuous/BoostControlledEffect.java | 4 +- Mage/src/mage/constants/PlayerAction.java | 10 +- Mage/src/mage/game/Game.java | 4 +- Mage/src/mage/game/GameImpl.java | 17 +- .../mage/game/events/PlayerQueryEvent.java | 30 ++- Mage/src/mage/players/Player.java | 2 +- Mage/src/mage/players/PlayerImpl.java | 2 +- Utils/release/getting_implemented_cards.txt | 159 +---------- 27 files changed, 914 insertions(+), 665 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/Card.java b/Mage.Client/src/main/java/mage/client/cards/Card.java index ca322655e8c..1ef0d5c415f 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Card.java +++ b/Mage.Client/src/main/java/mage/client/cards/Card.java @@ -1,45 +1,84 @@ /* -* 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. -*/ + * 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. + */ /* * Card.java * * Created on 17-Dec-2009, 9:20:50 PM */ - package mage.client.cards; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.Popup; +import javax.swing.PopupFactory; +import javax.swing.text.BadLocationException; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; +import javax.swing.text.StyledDocument; import mage.cards.CardDimensions; import mage.cards.MagePermanent; import mage.cards.Sets; import mage.cards.TextPopup; import mage.cards.action.ActionCallback; import mage.client.MageFrame; +import static mage.client.constants.Constants.CONTENT_MAX_XOFFSET; +import static mage.client.constants.Constants.FRAME_MAX_HEIGHT; +import static mage.client.constants.Constants.FRAME_MAX_WIDTH; +import static mage.client.constants.Constants.NAME_FONT_MAX_SIZE; +import static mage.client.constants.Constants.NAME_MAX_YOFFSET; +import static mage.client.constants.Constants.POWBOX_TEXT_MAX_LEFT; +import static mage.client.constants.Constants.POWBOX_TEXT_MAX_TOP; +import static mage.client.constants.Constants.SYMBOL_MAX_XOFFSET; +import static mage.client.constants.Constants.SYMBOL_MAX_YOFFSET; +import static mage.client.constants.Constants.TYPE_MAX_YOFFSET; import mage.client.game.PlayAreaPanel; import mage.client.util.Config; import mage.client.util.DefaultActionCallback; @@ -48,18 +87,11 @@ import mage.client.util.gui.ArrowBuilder; import mage.constants.CardType; import mage.constants.EnlargeMode; import mage.remote.Session; -import mage.view.*; - -import javax.swing.*; -import javax.swing.text.*; -import java.awt.*; -import java.awt.event.*; -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import static mage.client.constants.Constants.*; +import mage.view.AbilityView; +import mage.view.CardView; +import mage.view.CounterView; +import mage.view.PermanentView; +import mage.view.StackAbilityView; /** * @@ -77,15 +109,18 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected final UUID gameId; protected final BigCard bigCard; protected CardView card; - protected Popup popup; - protected boolean popupShowing; + protected Popup tooltipPopup; + protected boolean tooltipShowing; - protected TextPopup popupText = new TextPopup(); + protected TextPopup tooltipText = new TextPopup(); protected BufferedImage background; protected BufferedImage image = new BufferedImage(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT, BufferedImage.TYPE_INT_RGB); protected BufferedImage small; protected String backgroundName; + // if this is set, it's opened if the user right clicks on the card panel + private JPopupMenu popupMenu; + /** * Creates new form Card * @@ -126,7 +161,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void update(PermanentView permanent) { - this.update((CardView)permanent); + this.update((CardView) permanent); } @Override @@ -141,7 +176,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis background = ImageHelper.getBackground(card, backgroundName); } - popupText.setText(getText(cardType)); + tooltipText.setText(getText(cardType)); gImage.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gImage.setColor(Color.BLACK); @@ -159,8 +194,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis gImage.drawString(card.getName(), CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET); if (card.getCardTypes().contains(CardType.CREATURE)) { gImage.drawString(card.getPower() + "/" + card.getToughness(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); - } - else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { + } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { gImage.drawString(card.getLoyalty(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); } @@ -174,8 +208,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis gSmall.drawString(card.getName(), Config.dimensions.contentXOffset, Config.dimensions.nameYOffset); if (card.getCardTypes().contains(CardType.CREATURE)) { gSmall.drawString(card.getPower() + "/" + card.getToughness(), Config.dimensions.powBoxTextLeft, Config.dimensions.powBoxTextTop); - } - else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { + } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { gSmall.drawString(card.getLoyalty(), Config.dimensions.powBoxTextLeft, Config.dimensions.powBoxTextTop); } @@ -194,11 +227,10 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected String getText(String cardType) { StringBuilder sb = new StringBuilder(); if (card instanceof StackAbilityView || card instanceof AbilityView) { - for (String rule: getRules()) { + for (String rule : getRules()) { sb.append("\n").append(rule); } - } - else { + } else { sb.append(card.getName()); if (card.getManaCost().size() > 0) { sb.append("\n").append(card.getManaCost()); @@ -209,11 +241,10 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis } if (card.getCardTypes().contains(CardType.CREATURE)) { sb.append("\n").append(card.getPower()).append("/").append(card.getToughness()); - } - else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { + } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { sb.append("\n").append(card.getLoyalty()); } - for (String rule: getRules()) { + for (String rule : getRules()) { sb.append("\n").append(rule); } if (card.getExpansionSetCode() != null && card.getExpansionSetCode().length() > 0) { @@ -233,8 +264,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis StringBuilder sb = new StringBuilder(); if (card.getCardTypes().contains(CardType.LAND)) { sb.append("land").append(card.getSuperTypes()).append(card.getSubTypes()); - } - else if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) { + } else if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) { sb.append("creature"); } sb.append(card.getColor()).append(card.getRarity()).append(card.getExpansionSetCode()); @@ -246,10 +276,11 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis StyledDocument doc = text.getStyledDocument(); try { - for (String rule: getRules()) { + for (String rule : getRules()) { doc.insertString(doc.getLength(), rule + "\n", doc.getStyle("small")); } - } catch (BadLocationException e) {} + } catch (BadLocationException e) { + } text.setCaretPosition(0); } @@ -257,12 +288,11 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected List getRules() { if (card.getCounters() != null) { List rules = new ArrayList<>(card.getRules()); - for (CounterView counter: card.getCounters()) { + for (CounterView counter : card.getCounters()) { rules.add(counter.getCount() + " x " + counter.getName()); } return rules; - } - else { + } else { return card.getRules(); } } @@ -270,17 +300,17 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected String getType(CardView card) { StringBuilder sbType = new StringBuilder(); - for (String superType: card.getSuperTypes()) { + for (String superType : card.getSuperTypes()) { sbType.append(superType).append(" "); } - for (CardType cardType: card.getCardTypes()) { + for (CardType cardType : card.getCardTypes()) { sbType.append(cardType.toString()).append(" "); } if (card.getSubTypes().size() > 0) { sbType.append("- "); - for (String subType: card.getSubTypes()) { + for (String subType : card.getSubTypes()) { sbType.append(subType).append(" "); } } @@ -288,10 +318,10 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis return sbType.toString(); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -343,7 +373,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void mouseMoved(MouseEvent arg0) { this.bigCard.showTextComponent(); - this.bigCard.setCard(card.getId(), EnlargeMode.NORMAL, image, getRules()); + this.bigCard.setCard(card.getId(), EnlargeMode.NORMAL, image, getRules()); } @Override @@ -362,18 +392,18 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void mouseEntered(MouseEvent arg0) { - if (!popupShowing) { - if (popup != null) { - popup.hide(); + if (!tooltipShowing) { + if (tooltipPopup != null) { + tooltipPopup.hide(); } PopupFactory factory = PopupFactory.getSharedInstance(); - popup = factory.getPopup(this, popupText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); - popup.show(); - //hack to get popup to resize to fit text - popup.hide(); - popup = factory.getPopup(this, popupText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); - popup.show(); - popupShowing = true; + tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); + tooltipPopup.show(); + //hack to get tooltipPopup to resize to fit text + tooltipPopup.hide(); + tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); + tooltipPopup.show(); + tooltipShowing = true; // Draw Arrows for targets List targets = card.getTargets(); @@ -383,14 +413,14 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis if (playAreaPanel != null) { Point target = playAreaPanel.getLocationOnScreen(); Point me = this.getLocationOnScreen(); - ArrowBuilder.getBuilder().addArrow(gameId, (int)me.getX() + 35, (int)me.getY(), (int)target.getX() + 40, (int)target.getY() - 40, Color.red, ArrowBuilder.Type.TARGET); + ArrowBuilder.getBuilder().addArrow(gameId, (int) me.getX() + 35, (int) me.getY(), (int) target.getX() + 40, (int) target.getY() - 40, Color.red, ArrowBuilder.Type.TARGET); } else { for (PlayAreaPanel pa : MageFrame.getGame(gameId).getPlayers().values()) { MagePermanent permanent = pa.getBattlefieldPanel().getPermanents().get(uuid); if (permanent != null) { Point target = permanent.getLocationOnScreen(); Point me = this.getLocationOnScreen(); - ArrowBuilder.getBuilder().addArrow(gameId, (int)me.getX() + 35, (int)me.getY(), (int)target.getX() + 40, (int)target.getY() + 10, Color.red, ArrowBuilder.Type.TARGET); + ArrowBuilder.getBuilder().addArrow(gameId, (int) me.getX() + 35, (int) me.getY(), (int) target.getX() + 40, (int) target.getY() + 10, Color.red, ArrowBuilder.Type.TARGET); } } } @@ -401,12 +431,12 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void mouseExited(MouseEvent arg0) { - if(getMousePosition(true) != null) { + if (getMousePosition(true) != null) { return; } - if (popup != null) { - popup.hide(); - popupShowing = false; + if (tooltipPopup != null) { + tooltipPopup.hide(); + tooltipShowing = false; ArrowBuilder.getBuilder().removeArrowsByType(gameId, ArrowBuilder.Type.TARGET); ArrowBuilder.getBuilder().removeArrowsByType(gameId, ArrowBuilder.Type.PAIRED); ArrowBuilder.getBuilder().removeArrowsByType(gameId, ArrowBuilder.Type.SOURCE); @@ -421,8 +451,8 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void focusLost(FocusEvent arg0) { - if (popup != null) { - popup.hide(); + if (tooltipPopup != null) { + tooltipPopup.hide(); } this.repaint(); } @@ -437,42 +467,54 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis // End of variables declaration//GEN-END:variables @Override - public void componentResized(ComponentEvent e) { } + public void componentResized(ComponentEvent e) { + } @Override - public void componentMoved(ComponentEvent e) { } + public void componentMoved(ComponentEvent e) { + } @Override - public void componentShown(ComponentEvent e) { } + public void componentShown(ComponentEvent e) { + } @Override public void componentHidden(ComponentEvent e) { - if (popup != null) { - popup.hide(); + if (tooltipPopup != null) { + tooltipPopup.hide(); } } @Override - public List getLinks() {return null;} + public List getLinks() { + return null; + } @Override - public boolean isTapped() {return false;} + public boolean isTapped() { + return false; + } @Override - public boolean isFlipped() {return false;} + public boolean isFlipped() { + return false; + } @Override - public void onBeginAnimation() {} + public void onBeginAnimation() { + } @Override - public void onEndAnimation() {} + public void onEndAnimation() { + } @Override - public void setAlpha(float transparency) {} + public void setAlpha(float transparency) { + } @Override public CardView getOriginal() { - return card; + return card; } @Override @@ -539,6 +581,14 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis public void setTextOffset(int yOffset) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } - - + + @Override + public JPopupMenu getPopupMenu() { + return popupMenu; + } + + @Override + public void setPopupMenu(JPopupMenu popupMenu) { + this.popupMenu = popupMenu; + } } diff --git a/Mage.Client/src/main/java/mage/client/cards/CardArea.java b/Mage.Client/src/main/java/mage/client/cards/CardArea.java index 1d40d21f806..783724d1a4e 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardArea.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardArea.java @@ -1,56 +1,64 @@ /* -* Copyright 2012 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. -*/ - + * Copyright 2012 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.client.cards; -import mage.cards.CardDimensions; -import mage.cards.MageCard; -import mage.client.plugins.impl.Plugins; -import mage.client.util.CardsViewUtil; -import mage.client.util.Config; -import mage.view.AbilityView; -import mage.view.CardView; -import mage.view.CardsView; -import mage.view.SimpleCardsView; -import org.mage.card.arcane.CardPanel; - -import javax.swing.*; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.List; import java.util.UUID; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import mage.cards.CardDimensions; +import mage.cards.MageCard; +import mage.client.plugins.impl.Plugins; +import mage.client.util.Config; +import mage.client.util.Event; +import mage.client.util.Listener; +import mage.view.AbilityView; +import mage.view.CardView; +import mage.view.CardsView; +import mage.view.SimpleCardView; +import org.mage.card.arcane.CardPanel; -public class CardArea extends JPanel { +public class CardArea extends JPanel implements MouseListener { + + protected CardEventSource cardEventSource = new CardEventSource(); private boolean reloaded = false; private final javax.swing.JLayeredPane cardArea; private final javax.swing.JScrollPane scrollPane; - private int yTextOffset; + private int yTextOffset; /** * Create the panel. @@ -68,28 +76,23 @@ public class CardArea extends JPanel { } public void cleanUp() { - for(Component comp: cardArea.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel) comp).cleanUp(); - cardArea.remove(comp); - } - } - } - - public void loadCards(SimpleCardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, MouseListener listener) { - loadCards(CardsViewUtil.convertSimple(showCards), bigCard, dimension, gameId, listener); + for (Component comp : cardArea.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); + cardArea.remove(comp); + } + } } - public void loadCards(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, MouseListener listener) { + public void loadCards(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) { this.reloaded = true; cardArea.removeAll(); if (showCards != null && showCards.size() < 10) { yTextOffset = 10; - loadCardsFew(showCards, bigCard, gameId, listener); - } - else { + loadCardsFew(showCards, bigCard, gameId); + } else { yTextOffset = 0; - loadCardsMany(showCards, bigCard, gameId, listener, dimension); + loadCardsMany(showCards, bigCard, gameId, dimension); } cardArea.revalidate(); @@ -97,28 +100,28 @@ public class CardArea extends JPanel { this.repaint(); } - public void loadCardsNarrow(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, MouseListener listener) { + public void loadCardsNarrow(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) { this.reloaded = true; cardArea.removeAll(); - yTextOffset = 0; - loadCardsMany(showCards, bigCard, gameId, listener, dimension); + yTextOffset = 0; + loadCardsMany(showCards, bigCard, gameId, dimension); cardArea.revalidate(); this.revalidate(); this.repaint(); } - private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId, MouseListener listener) { + private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) { Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight); Dimension dimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight); for (CardView card : showCards.values()) { - addCard(card, bigCard, gameId, rectangle, dimension, Config.dimensions, listener); + addCard(card, bigCard, gameId, rectangle, dimension, Config.dimensions); rectangle.translate(Config.dimensions.frameWidth, 0); } cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth * showCards.size(), Config.dimensions.frameHeight)); } - private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, Dimension dimension, CardDimensions cardDimensions, MouseListener listener) { + private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, Dimension dimension, CardDimensions cardDimensions) { if (card instanceof AbilityView) { CardView tmp = ((AbilityView) card).getSourceCard(); tmp.overrideRules(card.getRules()); @@ -127,28 +130,26 @@ public class CardArea extends JPanel { tmp.setAbility(card); // cross-reference, required for ability picker card = tmp; } - MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, dimension, gameId, true); + MageCard cardPanel = Plugins.getInstance().getMageCard(card, bigCard, dimension, gameId, true); - cardImg.setBounds(rectangle); - if (listener != null) { - cardImg.addMouseListener(listener); - } - cardArea.add(cardImg); - cardArea.moveToFront(cardImg); - cardImg.update(card); - cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight); - cardImg.setTextOffset(yTextOffset); - cardImg.showCardTitle(); + cardPanel.setBounds(rectangle); + cardPanel.addMouseListener(this); + cardArea.add(cardPanel); + cardArea.moveToFront(cardPanel); + cardPanel.update(card); + cardPanel.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight); + cardPanel.setTextOffset(yTextOffset); + cardPanel.showCardTitle(); } - private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId, MouseListener listener, CardDimensions cardDimensions) { + private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId, CardDimensions cardDimensions) { int columns = 1; if (showCards != null && showCards.size() > 0) { Rectangle rectangle = new Rectangle(cardDimensions.frameWidth, cardDimensions.frameHeight); Dimension dimension = new Dimension(cardDimensions.frameWidth, cardDimensions.frameHeight); int count = 0; for (CardView card : showCards.values()) { - addCard(card, bigCard, gameId, rectangle, dimension, cardDimensions, listener); + addCard(card, bigCard, gameId, rectangle, dimension, cardDimensions); if (count >= 20) { rectangle.translate(cardDimensions.frameWidth, -400); columns++; @@ -169,11 +170,11 @@ public class CardArea extends JPanel { public void clearReloaded() { this.reloaded = false; } - + public void selectCards(List selected) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { - MageCard mageCard = (MageCard)component; + MageCard mageCard = (MageCard) component; if (selected.contains(mageCard.getOriginal().getId())) { mageCard.setSelected(true); } @@ -184,7 +185,7 @@ public class CardArea extends JPanel { public void markCards(List marked) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { - MageCard mageCard = (MageCard)component; + MageCard mageCard = (MageCard) component; if (marked.contains(mageCard.getOriginal().getId())) { mageCard.setChoosable(true); } @@ -192,4 +193,82 @@ public class CardArea extends JPanel { } } + public void setPopupMenu(JPopupMenu popupMenu) { + for (Component component : cardArea.getComponents()) { + if (component instanceof MageCard) { + MageCard mageCard = (MageCard) component; + mageCard.setPopupMenu(popupMenu); + } + } + } + + public void addCardEventListener(Listener listener) { + cardEventSource.addListener(listener); + } + + public void clearCardEventListeners() { + cardEventSource.clearListeners(); + } + + @Override + public void mouseClicked(MouseEvent e) { + } + + @Override + public void mousePressed(MouseEvent e) { + if (e.getClickCount() >= 1 && !e.isConsumed()) { + Object obj = e.getSource(); + if (e.getClickCount() == 2) { + e.consume(); + if (obj instanceof Card) { + if (e.isAltDown()) { + cardEventSource.altDoubleClick(((Card) obj).getOriginal(), "alt-double-click"); + } else { + cardEventSource.doubleClick(((Card) obj).getOriginal(), "double-click"); + } + } else if (obj instanceof MageCard) { + if (e.isAltDown()) { + cardEventSource.altDoubleClick(((MageCard) obj).getOriginal(), "alt-double-click"); + } else { + cardEventSource.doubleClick(((MageCard) obj).getOriginal(), "double-click"); + } + } + } + if (obj instanceof MageCard) { + checkMenu(e, ((MageCard) obj).getOriginal()); + } else { + checkMenu(e, null); + } + } + } + + @Override + public void mouseReleased(MouseEvent e) { + if (!e.isConsumed()) { + Object obj = e.getSource(); + if (obj instanceof MageCard) { + checkMenu(e, ((MageCard) obj).getOriginal()); + } else { + checkMenu(e, null); + } + } else { + cardEventSource.actionConsumedEvent("action-consumed"); + } + } + + private void checkMenu(MouseEvent Me, SimpleCardView card) { + if (Me.isPopupTrigger()) { + Me.consume(); + cardEventSource.showPopupMenuEvent(card, Me.getComponent(), Me.getX(), Me.getY(), "show-popup-menu"); + } + } + + @Override + public void mouseEntered(MouseEvent e) { + } + + @Override + public void mouseExited(MouseEvent e) { + } + } diff --git a/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java b/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java index 5aa243ffc10..01528dd06b0 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java @@ -1,49 +1,48 @@ /* -* 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. -*/ - + * 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.client.cards; import java.awt.Component; +import java.io.Serializable; import mage.client.util.Event; import mage.client.util.EventDispatcher; import mage.client.util.EventSource; import mage.client.util.Listener; import mage.view.SimpleCardView; -import java.io.Serializable; - /** * * @author BetaSteward_at_googlemail.com */ public class CardEventSource implements EventSource, Serializable { - protected final EventDispatcher dispatcher = new EventDispatcher() {}; + protected final EventDispatcher dispatcher = new EventDispatcher() { + }; @Override public void addListener(Listener listener) { @@ -74,6 +73,9 @@ public class CardEventSource implements EventSource, Serializable { dispatcher.fireEvent(new Event(card, message, x, y, component)); } + public void actionConsumedEvent(String message) { + dispatcher.fireEvent(new Event(null, message)); + } @Override public void clearListeners() { diff --git a/Mage.Client/src/main/java/mage/client/cards/Permanent.java b/Mage.Client/src/main/java/mage/client/cards/Permanent.java index e7401b39de4..a01e368641d 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Permanent.java +++ b/Mage.Client/src/main/java/mage/client/cards/Permanent.java @@ -254,20 +254,20 @@ public class Permanent extends Card { @Override public void mouseEntered(MouseEvent arg0) { - if (!popupShowing) { - if (popup != null) { - popup.hide(); + if (!tooltipShowing) { + if (tooltipPopup != null) { + tooltipPopup.hide(); } PopupFactory factory = PopupFactory.getSharedInstance(); int x = (int) this.getLocationOnScreen().getX() + (permanent.isTapped()?Config.dimensions.frameHeight:Config.dimensions.frameWidth); int y = (int) this.getLocationOnScreen().getY() + 40; - popup = factory.getPopup(this, popupText, x, y); - popup.show(); - //hack to get popup to resize to fit text - popup.hide(); - popup = factory.getPopup(this, popupText, x, y); - popup.show(); - popupShowing = true; + tooltipPopup = factory.getPopup(this, tooltipText, x, y); + tooltipPopup.show(); + //hack to get tooltipPopup to resize to fit text + tooltipPopup.hide(); + tooltipPopup = factory.getPopup(this, tooltipText, x, y); + tooltipPopup.show(); + tooltipShowing = true; } } diff --git a/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java index d2e63313b46..698e14ea6cb 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java @@ -1,33 +1,41 @@ /* -* Copyright 2012 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. -*/ - + * Copyright 2012 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.client.dialog; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.UUID; +import javax.swing.JButton; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; import mage.cards.CardDimensions; import mage.client.MageFrame; import mage.client.cards.BigCard; @@ -35,18 +43,12 @@ import mage.client.cards.CardArea; import mage.client.util.SettingsManager; import mage.client.util.gui.GuiDisplayUtil; import mage.view.CardsView; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.UUID; import org.mage.card.arcane.CardPanel; /** -* -* @author BetaSteward_at_googlemail.com -*/ + * + * @author BetaSteward_at_googlemail.com + */ public class PickPileDialog extends MageDialog { private final CardArea pile1; @@ -94,24 +96,24 @@ public class PickPileDialog extends MageDialog { } public void cleanUp() { - for(Component comp: pile1.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel) comp).cleanUp(); - pile1.remove(comp); - } - } - for(Component comp: pile2.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel) comp).cleanUp(); - pile2.remove(comp); - } - } + for (Component comp : pile1.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); + pile1.remove(comp); + } + } + for (Component comp : pile2.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); + pile2.remove(comp); + } + } } - + public void loadCards(String name, CardsView pile1, CardsView pile2, BigCard bigCard, CardDimensions dimension, UUID gameId) { this.title = name; - this.pile1.loadCardsNarrow(pile1, bigCard, dimension, gameId, null); - this.pile2.loadCardsNarrow(pile2, bigCard, dimension, gameId, null); + this.pile1.loadCardsNarrow(pile1, bigCard, dimension, gameId); + this.pile2.loadCardsNarrow(pile2, bigCard, dimension, gameId); if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) { MageFrame.getDesktop().add(this, JLayeredPane.MODAL_LAYER); diff --git a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java index 3257c665cd2..dffa208b6c7 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java @@ -35,28 +35,28 @@ package mage.client.dialog; import java.awt.Component; import java.awt.Point; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.io.Serializable; import java.util.Map; import java.util.UUID; import javax.swing.JLayeredPane; +import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import mage.cards.CardDimensions; import mage.client.MageFrame; import mage.client.cards.BigCard; import mage.client.cards.CardArea; -import mage.client.util.CardsViewUtil; +import mage.client.util.Event; +import mage.client.util.Listener; import mage.client.util.SettingsManager; import mage.client.util.gui.GuiDisplayUtil; +import mage.game.events.PlayerQueryEvent.QueryType; import mage.view.CardsView; -import mage.view.SimpleCardsView; import org.mage.card.arcane.CardPanel; /** * @author BetaSteward_at_googlemail.com */ -public class ShowCardsDialog extends MageDialog implements MouseListener { +public class ShowCardsDialog extends MageDialog { // remember if this dialog was already auto positioned, so don't do it after the first time private boolean positioned; @@ -83,18 +83,13 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { } } - public void loadCards(String name, SimpleCardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) { - loadCards(name, CardsViewUtil.convertSimple(showCards), bigCard, dimension, gameId, modal); - } - - public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) { - loadCards(name, showCards, bigCard, dimension, gameId, modal, null); - } - - public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map options) { + public void loadCards(String name, CardsView showCards, BigCard bigCard, + CardDimensions dimension, UUID gameId, boolean modal, Map options, + JPopupMenu popupMenu, Listener eventListener) { this.title = name; this.setTitelBarToolTip(name); - cardArea.loadCards(showCards, bigCard, dimension, gameId, this); + cardArea.clearCardEventListeners(); + cardArea.loadCards(showCards, bigCard, dimension, gameId); if (options != null) { if (options.containsKey("chosen")) { java.util.List chosenCards = (java.util.List) options.get("chosen"); @@ -104,6 +99,15 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { java.util.List choosableCards = (java.util.List) options.get("choosable"); cardArea.markCards(choosableCards); } + if (options.containsKey("queryType") && QueryType.PICK_ABILITY.equals(options.get("queryType"))) { + cardArea.setPopupMenu(popupMenu); + } + } + if (popupMenu != null) { + this.cardArea.setPopupMenu(popupMenu); + } + if (eventListener != null) { + this.cardArea.addCardEventListener(eventListener); } if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) { @@ -141,38 +145,9 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { setResizable(true); getContentPane().setLayout(new java.awt.BorderLayout()); getContentPane().add(cardArea, java.awt.BorderLayout.CENTER); - this.addMouseListener(this); pack(); } private CardArea cardArea; - - @Override - public void mouseClicked(MouseEvent e) { - if (e.getSource() instanceof CardPanel) { - this.hideDialog(); - } - } - - @Override - public void mousePressed(MouseEvent e) { - // only hide dialog, if a cardPanel was selected - if (e.getSource() instanceof CardPanel) { - this.hideDialog(); - } - } - - @Override - public void mouseReleased(MouseEvent e) { - } - - @Override - public void mouseEntered(MouseEvent e) { - } - - @Override - public void mouseExited(MouseEvent e) { - } - } diff --git a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java index 5752dbe8ece..31269b247f4 100644 --- a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java +++ b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java @@ -326,7 +326,7 @@ public class DraftPanel extends javax.swing.JPanel { if (view != null) { loadCardsToPickedCardsArea(view.getPicks()); draftBooster.loadBooster(emptyView, bigCard); - Plugins.getInstance().getActionCallback().hidePopup(); + Plugins.getInstance().getActionCallback().hideTooltipPopup(); setMessage("Waiting for other players"); } } diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 2d172a6a33f..aab803819d8 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -66,8 +66,10 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLayeredPane; +import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.KeyStroke; import javax.swing.SwingWorker; import javax.swing.border.Border; @@ -100,7 +102,9 @@ import mage.client.plugins.adapters.MageActionCallback; import mage.client.plugins.impl.Plugins; import mage.client.util.CardsViewUtil; import mage.client.util.Config; +import mage.client.util.Event; import mage.client.util.GameManager; +import mage.client.util.Listener; import mage.client.util.audio.AudioManager; import mage.client.util.gui.ArrowBuilder; import mage.client.util.gui.MageDialogState; @@ -118,7 +122,13 @@ import static mage.constants.PhaseStep.FIRST_COMBAT_DAMAGE; import static mage.constants.PhaseStep.UNTAP; import static mage.constants.PhaseStep.UPKEEP; import mage.constants.PlayerAction; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_ABILITY_FIRST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_ABILITY_LAST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_NAME_FIRST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_NAME_LAST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.constants.Zone; +import mage.game.events.PlayerQueryEvent; import mage.remote.Session; import mage.view.AbilityPickerView; import mage.view.CardView; @@ -131,6 +141,7 @@ import mage.view.PlayerView; import mage.view.RevealedView; import mage.view.SimpleCardsView; import org.apache.log4j.Logger; +import org.mage.card.arcane.CardPanel; import org.mage.plugins.card.utils.impl.ImageManagerImpl; /** @@ -143,6 +154,13 @@ public final class GamePanel extends javax.swing.JPanel { private static final String YOUR_HAND = "Your hand"; private static final int X_PHASE_WIDTH = 55; private static final int STACK_MIN_CARDS_OFFSET_Y = 7; + + private static final String CMD_AUTO_ORDER_FIRST = "cmdAutoOrderFirst"; + private static final String CMD_AUTO_ORDER_LAST = "cmdAutoOrderLast"; + private static final String CMD_AUTO_ORDER_NAME_FIRST = "cmdAutoOrderNameFirst"; + private static final String CMD_AUTO_ORDER_NAME_LAST = "cmdAutoOrderNameLast"; + private static final String CMD_AUTO_ORDER_RESET_ALL = "cmdAutoOrderResetAll"; + private final Map players = new HashMap<>(); // non modal frames @@ -174,9 +192,22 @@ public final class GamePanel extends javax.swing.JPanel { private MageDialogState choiceWindowState; + private enum PopUpMenuType { + + TRIGGER_ORDER + } + // CardView popupMenu was invoked last + private CardView cardViewPopupMenu; + + // popup menu for a card + private JPopupMenu popupMenuCardPanel; + public GamePanel() { initComponents(); + createTriggerOrderPupupMenu(); + this.add(popupMenuCardPanel); + pickNumber = new PickNumberDialog(); MageFrame.getDesktop().add(pickNumber, JLayeredPane.MODAL_LAYER); @@ -281,7 +312,7 @@ public final class GamePanel extends javax.swing.JPanel { pickTargetDialog.cleanUp(); pickTargetDialog.removeDialog(); } - Plugins.getInstance().getActionCallback().hidePopup(); + Plugins.getInstance().getActionCallback().hideTooltipPopup(); try { Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); @@ -957,31 +988,37 @@ public final class GamePanel extends javax.swing.JPanel { * @param messageId */ public void pickTarget(String message, CardsView cardView, GameView gameView, Set targets, boolean required, Map options, int messageId) { - ShowCardsDialog dialog = null; - if (options != null && options.containsKey("targetZone")) { - if (Zone.HAND.equals(options.get("targetZone"))) { // mark selectable target cards in hand - List choosen = null; - if (options.containsKey("chosen")) { - choosen = (List) options.get("chosen"); - } - for (CardView card : gameView.getHand().values()) { - if (targets == null || targets.isEmpty()) { - card.setPlayable(false); - card.setChoosable(true); - } else if (targets.contains(card.getId())) { - card.setPlayable(false); - card.setChoosable(true); + PopUpMenuType popupMenuType = null; + if (options != null) { + if (options.containsKey("targetZone")) { + if (Zone.HAND.equals(options.get("targetZone"))) { // mark selectable target cards in hand + List choosen = null; + if (options.containsKey("chosen")) { + choosen = (List) options.get("chosen"); } - if (choosen != null && choosen.contains(card.getId())) { - card.setSelected(true); + for (CardView card : gameView.getHand().values()) { + if (targets == null || targets.isEmpty()) { + card.setPlayable(false); + card.setChoosable(true); + } else if (targets.contains(card.getId())) { + card.setPlayable(false); + card.setChoosable(true); + } + if (choosen != null && choosen.contains(card.getId())) { + card.setSelected(true); + } } } } + if (options.containsKey("queryType") && PlayerQueryEvent.QueryType.PICK_ABILITY.equals(options.get("queryType"))) { + popupMenuType = PopUpMenuType.TRIGGER_ORDER; + } } updateGame(gameView); Map options0 = options == null ? new HashMap() : options; + ShowCardsDialog dialog = null; if (cardView != null && cardView.size() > 0) { - dialog = showCards(message, cardView, required, options0); + dialog = showCards(message, cardView, required, options0, popupMenuType); options0.put("dialog", dialog); } this.feedbackPanel.getFeedback(required ? FeedbackMode.INFORM : FeedbackMode.CANCEL, message, gameView.getSpecial(), options0, messageId); @@ -1066,10 +1103,16 @@ public final class GamePanel extends javax.swing.JPanel { ((MageActionCallback) callback).hideGameUpdate(gameId); } - private ShowCardsDialog showCards(String title, CardsView cards, boolean required, Map options) { + private ShowCardsDialog showCards(String title, CardsView cards, boolean required, Map options, PopUpMenuType popupMenuType) { hideAll(); ShowCardsDialog showCards = new ShowCardsDialog(); - showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options); + JPopupMenu popupMenu = null; + Listener eventListener = null; + if (PopUpMenuType.TRIGGER_ORDER.equals(popupMenuType)) { + popupMenu = getTriggerOrderPopupMenu(); + eventListener = getTriggerOrderEventListener(showCards); + } + showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options, popupMenu, eventListener); return showCards; } @@ -1942,6 +1985,102 @@ public final class GamePanel extends javax.swing.JPanel { hoverButtons.put(name, button); } + // TriggerOrderPopupMenu + private Listener getTriggerOrderEventListener(final ShowCardsDialog dialog) { + return new Listener() { + @Override + public void event(Event event) { + if (event.getEventName().equals("show-popup-menu")) { + if (event.getComponent() != null && event.getComponent() instanceof CardPanel) { + JPopupMenu menu = ((CardPanel) event.getComponent()).getPopupMenu(); + if (menu != null) { + cardViewPopupMenu = ((CardView) event.getSource()); + menu.show(event.getComponent(), event.getxPos(), event.getyPos()); + } + } + } + if (event.getEventName().equals("action-consumed")) { + dialog.hideDialog(); + } + } + }; + } + + public void handleTriggerOrderPopupMenuEvent(ActionEvent e) { + UUID abilityId = null; + String abilityRuleText = null; + if (cardViewPopupMenu instanceof CardView && cardViewPopupMenu.getAbility() != null) { + abilityId = cardViewPopupMenu.getAbility().getId(); + if (!cardViewPopupMenu.getAbility().getRules().isEmpty() && !cardViewPopupMenu.getAbility().getRules().equals("")) { + abilityRuleText = cardViewPopupMenu.getAbility().getRules().get(0); + } + } + switch (e.getActionCommand()) { + case CMD_AUTO_ORDER_FIRST: + session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_FIRST, gameId, abilityId); + break; + case CMD_AUTO_ORDER_LAST: + session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_LAST, gameId, abilityId); + break; + case CMD_AUTO_ORDER_NAME_FIRST: + if (abilityRuleText != null) { + session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_FIRST, gameId, abilityRuleText); + } + break; + case CMD_AUTO_ORDER_NAME_LAST: + if (abilityRuleText != null) { + session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_LAST, gameId, abilityRuleText); + } + break; + case CMD_AUTO_ORDER_RESET_ALL: + session.sendPlayerAction(TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); + break; + } + } + + public JPopupMenu getTriggerOrderPopupMenu() { + return popupMenuCardPanel; + } + + private void createTriggerOrderPupupMenu() { + + ActionListener actionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleTriggerOrderPopupMenuEvent(e); + } + }; + + popupMenuCardPanel = new JPopupMenu(); + + // String tooltipText = ""; + JMenuItem menuItem; + menuItem = new JMenuItem("Put this ability always first on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_FIRST); + menuItem.addActionListener(actionListener); + popupMenuCardPanel.add(menuItem); + + menuItem = new JMenuItem("Put this ability always last on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_LAST); + menuItem.addActionListener(actionListener); + popupMenuCardPanel.add(menuItem); + + menuItem = new JMenuItem("Put all abilities with that rule text always first on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_NAME_FIRST); + menuItem.addActionListener(actionListener); + popupMenuCardPanel.add(menuItem); + + menuItem = new JMenuItem("Put all abilities with that rule text always last on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_NAME_LAST); + menuItem.addActionListener(actionListener); + popupMenuCardPanel.add(menuItem); + + menuItem = new JMenuItem("Reset all order settings for triggered abilities"); + menuItem.setActionCommand(CMD_AUTO_ORDER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuCardPanel.add(menuItem); + } + public String getGameLog() { return gameChatPanel.getText(); } diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index a3d2f246c4d..cdf949d1494 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -278,6 +278,18 @@ public class PlayAreaPanel extends javax.swing.JPanel { } }); + menuItem = new JMenuItem("Triggered abilities - reset auto stack order"); + menuItem.setMnemonic(KeyEvent.VK_T); + menuItem.setToolTipText("Deletes all triggered ability order settings you added during the game."); + automaticConfirmsMenu.add(menuItem); + // Reset the replacement effcts that were auto selected for the game + menuItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + gamePanel.getSession().sendPlayerAction(PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); + } + }); + JMenu handCardsMenu = new JMenu("Cards on hand"); handCardsMenu.setMnemonic(KeyEvent.VK_H); popupMenu.add(handCardsMenu); diff --git a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java index c55072a95fa..2d7f70b7a2b 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java +++ b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java @@ -65,12 +65,12 @@ public class MageActionCallback implements ActionCallback { public static final int MIN_X_OFFSET_REQUIRED = 20; - private Popup popup; + private Popup tooltipPopup; private JPopupMenu jPopupMenu; private BigCard bigCard; protected static final DefaultActionCallback defaultCallback = DefaultActionCallback.getInstance(); protected static Session session = MageFrame.getSession(); - private CardView popupCard; + private CardView tooltipCard; private TransferData popupData; private JComponent cardInfoPane; private volatile boolean popupTextWindowOpen = false; @@ -92,7 +92,7 @@ public class MageActionCallback implements ActionCallback { private boolean isDragging; private Point initialCardPos; private Point initialMousePos; - private Set cardPanels = new HashSet(); + private final Set cardPanels = new HashSet<>(); public MageActionCallback() { enlargeMode = EnlargeMode.NORMAL; @@ -117,10 +117,10 @@ public class MageActionCallback implements ActionCallback { @Override public void mouseEntered(MouseEvent e, final TransferData data) { - hidePopup(); + hideTooltipPopup(); cancelTimeout(); - this.popupCard = data.card; + this.tooltipCard = data.card; this.popupData = data; Component parentComponent = SwingUtilities.getRoot(data.component); @@ -154,12 +154,12 @@ public class MageActionCallback implements ActionCallback { } data.locationOnScreen = data.component.getLocationOnScreen(); } - popup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); - popup.show(); + tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); + tooltipPopup.show(); // hack to get popup to resize to fit text - popup.hide(); - popup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); - popup.show(); + tooltipPopup.hide(); + tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); + tooltipPopup.show(); } else { sumbitShowPopupTask(data, parentComponent, parentPoint); } @@ -171,7 +171,7 @@ public class MageActionCallback implements ActionCallback { public void run() { ThreadUtils.sleep(300); - if (popupCard == null || !popupCard.equals(data.card) || session == null || !popupTextWindowOpen || !enlargedWindowState.equals(EnlargedWindowState.CLOSED)) { + if (tooltipCard == null || !tooltipCard.equals(data.card) || session == null || !popupTextWindowOpen || !enlargedWindowState.equals(EnlargedWindowState.CLOSED)) { return; } @@ -229,13 +229,15 @@ public class MageActionCallback implements ActionCallback { initialMousePos = new Point((int) mouse.getX(), (int) mouse.getY()); initialCardPos = data.component.getLocation(); // Closes popup & enlarged view if a card/Permanent is selected - hidePopup(); + hideTooltipPopup(); } @Override public void mouseReleased(MouseEvent e, TransferData transferData) { CardPanel card = ((CardPanel) transferData.component); - if (card.getZone() != null && card.getZone().equalsIgnoreCase("hand")) { + if (e.isPopupTrigger() /*&& card.getPopupMenu() != null*/) { + hideTooltipPopup(); + } else if (card.getZone() != null && card.getZone().equalsIgnoreCase("hand")) { int maxXOffset = 0; if (isDragging) { Point mouse = new Point(e.getX(), e.getY()); @@ -250,13 +252,15 @@ public class MageActionCallback implements ActionCallback { transferData.component.requestFocusInWindow(); defaultCallback.mouseClicked(e, transferData.gameId, session, transferData.card); // Closes popup & enlarged view if a card/Permanent is selected - hidePopup(); + hideTooltipPopup(); } + e.consume(); } else { transferData.component.requestFocusInWindow(); defaultCallback.mouseClicked(e, transferData.gameId, session, transferData.card); // Closes popup & enlarged view if a card/Permanent is selected - hidePopup(); + hideTooltipPopup(); + e.consume(); } } @@ -264,7 +268,7 @@ public class MageActionCallback implements ActionCallback { if (this.startedDragging && prevCard != null && card != null) { for (Component component : card.getCardArea().getComponents()) { if (component instanceof CardPanel) { - if (cardPanels.contains(component)) { + if (cardPanels.contains((CardPanel) component)) { component.setLocation(component.getLocation().x, component.getLocation().y - GO_DOWN_ON_DRAG_Y_OFFSET); } } @@ -323,7 +327,7 @@ public class MageActionCallback implements ActionCallback { for (Component component : container.getComponents()) { if (component instanceof CardPanel) { if (!component.equals(card)) { - if (!cardPanels.contains(component)) { + if (!cardPanels.contains((CardPanel) component)) { component.setLocation(component.getLocation().x, component.getLocation().y + GO_DOWN_ON_DRAG_Y_OFFSET); } cardPanels.add((CardPanel) component); @@ -405,10 +409,10 @@ public class MageActionCallback implements ActionCallback { * */ @Override - public void hidePopup() { - this.popupCard = null; - if (popup != null) { - popup.hide(); + public void hideTooltipPopup() { + this.tooltipCard = null; + if (tooltipPopup != null) { + tooltipPopup.hide(); } if (jPopupMenu != null) { jPopupMenu.setVisible(false); @@ -421,7 +425,7 @@ public class MageActionCallback implements ActionCallback { Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); } catch (Exception e2) { - e2.printStackTrace(); + logger.warn("Can't set tooltip to visible = false", e2); } } @@ -433,7 +437,7 @@ public class MageActionCallback implements ActionCallback { } public void hideAll(UUID gameId) { - hidePopup(); + hideTooltipPopup(); startHideTimeout(); this.popupTextWindowOpen = false; if (gameId != null) { @@ -483,7 +487,7 @@ public class MageActionCallback implements ActionCallback { cardView = popupData.card; } if (this.popupTextWindowOpen) { - hidePopup(); + hideTooltipPopup(); } if (cardView != null) { if (cardView.isToRotate()) { @@ -506,7 +510,7 @@ public class MageActionCallback implements ActionCallback { cardPreviewContainer.setVisible(false); } catch (InterruptedException e) { - e.printStackTrace(); + logger.warn("Can't hide enlarged card", e); } } } @@ -582,7 +586,7 @@ public class MageActionCallback implements ActionCallback { } } catch (Exception e) { - e.printStackTrace(); + logger.warn("Problem dring display of enlarged card", e); } } }); diff --git a/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java b/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java index 6e35211152e..b1f0a8774e7 100644 --- a/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java +++ b/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java @@ -1,37 +1,36 @@ /* -* 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. -*/ + * 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. + */ /* * PlayerPanel.java * * Created on Nov 18, 2009, 3:01:31 PM */ - package mage.client.unusedFiles; //package mage.client.game; @@ -58,7 +57,9 @@ public class PlayerPanel extends javax.swing.JPanel { private ShowCardsDialog graveyard; private BigCard bigCard; - /** Creates new form PlayerPanel */ + /** + * Creates new form PlayerPanel + */ public PlayerPanel() { initComponents(); } @@ -79,19 +80,17 @@ public class PlayerPanel extends javax.swing.JPanel { this.btnPlayerName.setText(player.getName()); if (player.isActive()) { this.btnPlayerName.setBackground(Color.DARK_GRAY); - } - else if (player.hasLeft()) { + } else if (player.hasLeft()) { this.btnPlayerName.setBackground(Color.RED); - } - else { + } else { this.btnPlayerName.setBackground(Color.LIGHT_GRAY); } } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -201,10 +200,9 @@ public class PlayerPanel extends javax.swing.JPanel { if (graveyard == null) { graveyard = new ShowCardsDialog(); } - graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false); + graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false, null, null, null); }//GEN-LAST:event_btnGraveActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnGrave; private javax.swing.JButton btnPlayerName; diff --git a/Mage.Client/src/main/java/mage/client/util/Listener.java b/Mage.Client/src/main/java/mage/client/util/Listener.java index 8c7ce8dc99f..6fb209b684c 100644 --- a/Mage.Client/src/main/java/mage/client/util/Listener.java +++ b/Mage.Client/src/main/java/mage/client/util/Listener.java @@ -1,31 +1,30 @@ /* -* 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. -*/ - + * 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.client.util; import java.io.Serializable; @@ -33,7 +32,9 @@ import java.io.Serializable; /** * * @author BetaSteward_at_googlemail.com + * @param */ public interface Listener extends Serializable { + void event(E event); } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index 774fea3adb1..5f50c709569 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -29,6 +29,7 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import mage.cards.MagePermanent; import mage.cards.TextPopup; import mage.cards.action.ActionCallback; @@ -63,15 +64,16 @@ import org.mage.plugins.card.utils.impl.ImageManagerImpl; */ @SuppressWarnings({"unchecked", "rawtypes"}) public class CardPanel extends MagePermanent implements MouseListener, MouseMotionListener, MouseWheelListener, ComponentListener { + private static final long serialVersionUID = -3272134219262184410L; - private static final Logger log = Logger.getLogger(CardPanel.class); + private static final Logger logger = Logger.getLogger(CardPanel.class); private static final int WIDTH_LIMIT = 90; // card width limit to create smaller counter public static final double TAPPED_ANGLE = Math.PI / 2; public static final double FLIPPED_ANGLE = Math.PI; public static final float ASPECT_RATIO = 3.5f / 2.5f; - public static final int POPUP_X_GAP = 1; // prevent popup window from blinking + public static final int POPUP_X_GAP = 1; // prevent tooltip window from blinking public static CardPanel dragAnimationPanel; @@ -120,7 +122,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private GlowText ptText; private boolean displayEnabled = true; private boolean isAnimationPanel; - public int cardXOffset, cardYOffset, cardWidth, cardHeight; + public int cardXOffset, cardYOffset, cardWidth, cardHeight; private boolean isSelected; private boolean isPlayable; @@ -132,8 +134,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private ActionCallback callback; - protected boolean popupShowing; - protected TextPopup popupText = new TextPopup(); + protected boolean tooltipShowing; + protected TextPopup tooltipText = new TextPopup(); protected UUID gameId; private TransferData data = new TransferData(); @@ -152,6 +154,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private int yTextOffset = 10; + // if this is set, it's opened if the user right clicks on the card panel + private JPopupMenu popupMenu; + public CardPanel(CardView newGameCard, UUID gameId, final boolean loadImage, ActionCallback callback, final boolean foil, Dimension dimension) { this.gameCard = newGameCard; this.callback = callback; @@ -165,7 +170,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti //for container debug (don't remove) //setBorder(BorderFactory.createLineBorder(Color.green)); - if (this.gameCard.canTransform()) { buttonPanel = new JPanel(); buttonPanel.setLayout(null); @@ -222,14 +226,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } if (newGameCard.isAbility()) { if (AbilityType.TRIGGERED.equals(newGameCard.getAbilityType())) { - setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(),"Triggered Ability"); + setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(), "Triggered Ability"); } else if (AbilityType.ACTIVATED.equals(newGameCard.getAbilityType())) { - setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(),"Activated Ability"); + setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(), "Activated Ability"); } } if (this.gameCard.isToken()) { - setTypeIcon(ImageManagerImpl.getInstance().getTokenIconImage(),"Token Permanent"); + setTypeIcon(ImageManagerImpl.getInstance().getTokenIconImage(), "Token Permanent"); } // icon to inform about permanent is copying something @@ -299,7 +303,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti imagePanel.setScalingMultiPassType(MultipassType.none); String cardType = getType(newGameCard); - popupText.setText(getText(cardType, newGameCard)); + tooltipText.setText(getText(cardType, newGameCard)); Util.threadPool.submit(new Runnable() { @Override @@ -326,9 +330,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } setText(gameCard); } catch (Exception e) { - e.printStackTrace(); + logger.fatal("Problem during image animation", e); } catch (Error err) { - err.printStackTrace(); + logger.error("Problem during image animation", err); } } }); @@ -344,7 +348,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti typeButton.setLocation(2, 2); typeButton.setSize(25, 25); - iconPanel.setVisible(true); typeButton.setIcon(new ImageIcon(bufferedImage)); if (toolTipText != null) { @@ -355,17 +358,17 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti public void cleanUp() { if (dayNightButton != null) { - for(ActionListener al: dayNightButton.getActionListeners()) { + for (ActionListener al : dayNightButton.getActionListeners()) { dayNightButton.removeActionListener(al); } } - for(MouseListener ml: this.getMouseListeners() ){ + for (MouseListener ml : this.getMouseListeners()) { this.removeMouseListener(ml); } - for(MouseMotionListener ml: this.getMouseMotionListeners() ){ + for (MouseMotionListener ml : this.getMouseMotionListeners()) { this.removeMouseMotionListener(ml); } - for(MouseWheelListener ml: this.getMouseWheelListeners() ){ + for (MouseWheelListener ml : this.getMouseWheelListeners()) { this.removeMouseWheelListener(ml); } // this holds reference to ActionCallback forever so set it to null to prevent @@ -394,7 +397,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } } - @Override public void setZone(String zone) { this.zone = zone; @@ -502,7 +504,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } else if (isPlayable) { g2d.setColor(new Color(153, 102, 204, 200)); //g2d.fillRoundRect(cardXOffset + 1, cardYOffset + 1, cardWidth - 2, cardHeight - 2, cornerSize, cornerSize); - g2d.fillRoundRect(cardXOffset, cardYOffset , cardWidth , cardHeight , cornerSize, cornerSize); + g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize); } if (canAttack) { @@ -512,10 +514,10 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti //TODO:uncomment /* - if (gameCard.isAttacking()) { - g2d.setColor(new Color(200,10,10,200)); - g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize); - }*/ + if (gameCard.isAttacking()) { + g2d.setColor(new Color(200,10,10,200)); + g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize); + }*/ } @Override @@ -562,8 +564,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti if (counterPanel != null) { counterPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize); counterPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2); - int size = cardWidth > WIDTH_LIMIT ? 40: 20; - + int size = cardWidth > WIDTH_LIMIT ? 40 : 20; minusCounterLabel.setLocation(counterPanel.getWidth() - size, counterPanel.getHeight() - size * 2); minusCounterLabel.setSize(size, size); @@ -577,7 +578,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti otherCounterLabel.setLocation(5, counterPanel.getHeight() - size); otherCounterLabel.setSize(size, size); - } int fontHeight = Math.round(cardHeight * (27f / 680)); boolean showText = (!isAnimationPanel && fontHeight < 12); @@ -823,7 +823,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti this.gameCard = card; String cardType = getType(card); - popupText.setText(getText(cardType, card)); + tooltipText.setText(getText(cardType, card)); if (hasSickness && CardUtil.isCreature(gameCard) && isPermanent) { overlayPanel.setVisible(true); @@ -864,11 +864,11 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti minusCounterLabel.setVisible(false); loyaltyCounterLabel.setVisible(false); otherCounterLabel.setVisible(false); - for (CounterView counterView:card.getCounters()) { + for (CounterView counterView : card.getCounters()) { if (counterView.getCount() == 0) { continue; } - switch(counterView.getName()) { + switch (counterView.getName()) { case "+1/+1": if (counterView.getCount() != plusCounter) { plusCounter = counterView.getCount(); @@ -913,10 +913,10 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } private static ImageIcon getCounterImageWithAmount(int amount, BufferedImage image, int cardWidth) { - int factor = cardWidth > WIDTH_LIMIT ? 2 :1; + int factor = cardWidth > WIDTH_LIMIT ? 2 : 1; int xOffset = amount > 9 ? 2 : 5; - int fontSize = factor == 1 ? amount < 10 ? 12 : amount < 100 ? 10 : amount < 1000 ? 7: 6 - :amount < 10 ? 19 : amount < 100 ? 15 : amount < 1000 ? 12: amount < 10000 ?9 : 8; + int fontSize = factor == 1 ? amount < 10 ? 12 : amount < 100 ? 10 : amount < 1000 ? 7 : 6 + : amount < 10 ? 19 : amount < 100 ? 15 : amount < 1000 ? 12 : amount < 10000 ? 9 : 8; BufferedImage newImage; if (cardWidth > WIDTH_LIMIT) { newImage = ImageManagerImpl.deepCopy(image); @@ -925,7 +925,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } Graphics graphics = newImage.getGraphics(); graphics.setColor(Color.BLACK); - graphics.setFont(new Font("Arial Black", amount > 100 ? Font.PLAIN : Font.BOLD, fontSize )); + graphics.setFont(new Font("Arial Black", amount > 100 ? Font.PLAIN : Font.BOLD, fontSize)); graphics.drawString(Integer.toString(amount), xOffset * factor, 11 * factor); return new ImageIcon(newImage); } @@ -977,12 +977,12 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti if (gameCard.hideInfo()) { return; } - if (!popupShowing) { + if (!tooltipShowing) { synchronized (this) { - if (!popupShowing) { + if (!tooltipShowing) { TransferData transferData = getTransferDataForMouseEntered(); if (this.isShowing()) { - popupShowing = true; + tooltipShowing = true; callback.mouseEntered(e, transferData); } } @@ -1013,13 +1013,13 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti if (getMousePosition(true) != null) { return; } - if (popupShowing) { + if (tooltipShowing) { synchronized (this) { - if (popupShowing) { - popupShowing = false; + if (tooltipShowing) { + tooltipShowing = false; data.component = this; data.card = this.gameCard; - data.popupText = popupText; + data.popupText = tooltipText; callback.mouseExited(e, data); } } @@ -1047,7 +1047,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private TransferData getTransferDataForMouseEntered() { data.component = this; data.card = this.gameCard; - data.popupText = popupText; + data.popupText = tooltipText; data.gameId = this.gameId; data.locationOnScreen = data.component.getLocationOnScreen(); // we need this for popup data.popupOffsetX = isTapped() ? cardHeight + cardXOffset + POPUP_X_GAP : cardWidth + cardXOffset + POPUP_X_GAP; @@ -1145,7 +1145,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti dayNightButton.setIcon(new ImageIcon(night)); } if (this.gameCard.getSecondCardFace() == null) { - log.error("no second side for card to transform!"); + logger.error("no second side for card to transform!"); return; } if (!isPermanent) { // use only for custom transformation (when pressing day-night button) @@ -1210,5 +1210,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti yTextOffset = yOffset; } + @Override + public JPopupMenu getPopupMenu() { + return popupMenu; + } + + @Override + public void setPopupMenu(JPopupMenu popupMenu) { + this.popupMenu = popupMenu; + } } diff --git a/Mage.Common/src/mage/cards/MageCard.java b/Mage.Common/src/mage/cards/MageCard.java index 320e9d11390..275c3773c03 100644 --- a/Mage.Common/src/mage/cards/MageCard.java +++ b/Mage.Common/src/mage/cards/MageCard.java @@ -1,35 +1,61 @@ package mage.cards; +import java.awt.Image; +import java.util.UUID; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; import mage.cards.action.ActionCallback; import mage.view.CardView; -import javax.swing.*; -import java.awt.*; -import java.util.UUID; - public abstract class MageCard extends JPanel { + private static final long serialVersionUID = 6089945326434301879L; public abstract void onBeginAnimation(); + public abstract void onEndAnimation(); + public abstract boolean isTapped(); + public abstract boolean isFlipped(); + public abstract void setAlpha(float transparency); + public abstract float getAlpha(); + public abstract CardView getOriginal(); + // sets the vertical text offset for the card name on the image public abstract void setTextOffset(int yOffset); + public abstract void setCardBounds(int x, int y, int width, int height); + public abstract void update(CardView card); + public abstract void updateImage(); + public abstract Image getImage(); + public abstract void setZone(String zone); + public abstract String getZone(); + public abstract void updateCallback(ActionCallback callback, UUID gameId); + public abstract void toggleTransformed(); + public abstract boolean isTransformed(); + public abstract void showCardTitle(); + public abstract void setSelected(boolean selected); + public abstract void setCardAreaRef(JPanel cardArea); + public abstract void setChoosable(boolean isChoosable); + + public abstract void setPopupMenu(JPopupMenu popupMenu); + + public abstract JPopupMenu getPopupMenu(); + } diff --git a/Mage.Common/src/mage/cards/action/ActionCallback.java b/Mage.Common/src/mage/cards/action/ActionCallback.java index c355ff4faeb..a2b1345f019 100644 --- a/Mage.Common/src/mage/cards/action/ActionCallback.java +++ b/Mage.Common/src/mage/cards/action/ActionCallback.java @@ -12,6 +12,6 @@ public interface ActionCallback { void mouseEntered(MouseEvent e, TransferData data); void mouseExited(MouseEvent e, TransferData data); void mouseWheelMoved(MouseWheelEvent e, TransferData data); - void hidePopup(); + void hideTooltipPopup(); } diff --git a/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java b/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java index 425225a573a..9db675f342a 100644 --- a/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java +++ b/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java @@ -35,7 +35,7 @@ public class EmptyCallback implements ActionCallback { } @Override - public void hidePopup() { + public void hideTooltipPopup() { } @Override diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index c96384e4dcc..aed2451d8bd 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -63,6 +63,7 @@ import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.PlayerAction; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.constants.RangeOfInfluence; import mage.constants.Zone; import mage.filter.common.FilterAttackingCreature; @@ -109,6 +110,11 @@ public class HumanPlayer extends PlayerImpl { protected HashSet autoSelectReplacementEffects = new HashSet<>(); protected ManaCost currentlyUnpaidMana; + protected Set triggerAutoOrderAbilityFirst = new HashSet<>(); + protected Set triggerAutoOrderAbilityLast = new HashSet<>(); + protected Set triggerAutoOrderNameFirst = new HashSet<>(); + protected Set triggerAutoOrderNameLast = new HashSet<>(); + public HumanPlayer(String name, RangeOfInfluence range, int skill) { super(name, range); replacementEffectChoice = new ChoiceImpl(true); @@ -669,12 +675,39 @@ public class HumanPlayer extends PlayerImpl { @Override public TriggeredAbility chooseTriggeredAbility(List abilities, Game game) { + // try to set trigger auto order + List abilitiesWithNoOrderSet = new ArrayList<>(); + TriggeredAbility abilityOrderLast = null; + for (TriggeredAbility ability : abilities) { + if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { + return ability; + } + if (triggerAutoOrderNameFirst.contains(ability.getRule())) { + return ability; + } + if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { + abilityOrderLast = ability; + continue; + } + if (triggerAutoOrderNameLast.contains(ability.getRule())) { + abilityOrderLast = ability; + continue; + } + abilitiesWithNoOrderSet.add(ability); + } + if (abilitiesWithNoOrderSet.isEmpty()) { + return abilityOrderLast; + } + if (abilitiesWithNoOrderSet.size() == 1) { + return abilitiesWithNoOrderSet.iterator().next(); + } + updateGameStatePriority("chooseTriggeredAbility", game); while (!abort) { - game.fireSelectTargetEvent(playerId, "Pick triggered ability (goes to the stack first)", abilities); + game.fireSelectTargetTriggeredAbilityEvent(playerId, "Pick triggered ability (goes to the stack first)", abilitiesWithNoOrderSet); waitForResponse(game); if (response.getUUID() != null) { - for (TriggeredAbility ability : abilities) { + for (TriggeredAbility ability : abilitiesWithNoOrderSet) { if (ability.getId().equals(response.getUUID())) { return ability; } @@ -1309,11 +1342,60 @@ public class HumanPlayer extends PlayerImpl { } @Override - public void sendPlayerAction(PlayerAction playerAction, Game game) { - if (PlayerAction.RESET_AUTO_SELECT_REPLACEMENT_EFFECTS.equals(playerAction)) { - autoSelectReplacementEffects.clear(); - } else { - super.sendPlayerAction(playerAction, game); + public void sendPlayerAction(PlayerAction playerAction, Game game, Object data) { + switch (playerAction) { + case RESET_AUTO_SELECT_REPLACEMENT_EFFECTS: + autoSelectReplacementEffects.clear(); + break; + case TRIGGER_AUTO_ORDER_ABILITY_FIRST: + case TRIGGER_AUTO_ORDER_ABILITY_LAST: + case TRIGGER_AUTO_ORDER_NAME_FIRST: + case TRIGGER_AUTO_ORDER_NAME_LAST: + case TRIGGER_AUTO_ORDER_RESET_ALL: + setTriggerAutoOrder(playerAction, game, data); + break; + default: + super.sendPlayerAction(playerAction, game, data); + } + } + + private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object data) { + if (playerAction.equals(TRIGGER_AUTO_ORDER_RESET_ALL)) { + triggerAutoOrderAbilityFirst.clear(); + triggerAutoOrderAbilityLast.clear(); + triggerAutoOrderNameFirst.clear(); + triggerAutoOrderNameLast.clear(); + return; + } + if (data instanceof UUID) { + UUID abilityId = (UUID) data; + UUID originalId = null; + for (TriggeredAbility ability : game.getState().getTriggered(getId())) { + if (ability.getId().equals(abilityId)) { + originalId = ability.getOriginalId(); + break; + } + } + if (originalId != null) { + switch (playerAction) { + case TRIGGER_AUTO_ORDER_ABILITY_FIRST: + triggerAutoOrderAbilityFirst.add(originalId); + break; + case TRIGGER_AUTO_ORDER_ABILITY_LAST: + triggerAutoOrderAbilityFirst.add(originalId); + break; + } + } + } else if (data instanceof String) { + String abilityName = (String) data; + switch (playerAction) { + case TRIGGER_AUTO_ORDER_NAME_FIRST: + triggerAutoOrderNameFirst.add(abilityName); + break; + case TRIGGER_AUTO_ORDER_NAME_LAST: + triggerAutoOrderNameLast.add(abilityName); + break; + } } } @@ -1332,7 +1414,7 @@ public class HumanPlayer extends PlayerImpl { } if (!chooseUse(Outcome.Detriment, GameLog.getPlayerConfirmColoredText("You have still mana in your mana pool. Pass regardless?") + GameLog.getSmallSecondLineText(activePlayerText + " / " + game.getStep().getType().toString() + priorityPlayerText), null, game)) { - sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, game); + sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, game, null); return false; } } diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 30fbe4fcd17..07ed9e64e96 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -582,7 +582,7 @@ public class GameController implements GameCallback { } break; default: - game.sendPlayerAction(playerAction, getPlayerId(userId)); + game.sendPlayerAction(playerAction, getPlayerId(userId), data); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index 1b7945ff260..eb098ea1829 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -1384,8 +1384,8 @@ public class TestPlayer implements Player { } @Override - public void sendPlayerAction(mage.constants.PlayerAction playerAction, Game game) { - computerPlayer.sendPlayerAction(playerAction, game); + public void sendPlayerAction(mage.constants.PlayerAction playerAction, Game game, Object data) { + computerPlayer.sendPlayerAction(playerAction, game, data); } @Override diff --git a/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java index 197e1b040d0..eb834b17d70 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java @@ -54,11 +54,11 @@ public class BoostControlledEffect extends ContinuousEffectImpl { protected boolean lockedIn = false; public BoostControlledEffect(int power, int toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("Creatures"), false); + this(power, toughness, duration, new FilterCreaturePermanent("creatures"), false); } public BoostControlledEffect(DynamicValue power, DynamicValue toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("Creatures"), false); + this(power, toughness, duration, new FilterCreaturePermanent("creatures"), false); } public BoostControlledEffect(int power, int toughness, Duration duration, boolean excludeSource) { diff --git a/Mage/src/mage/constants/PlayerAction.java b/Mage/src/mage/constants/PlayerAction.java index 82c18616d72..e572a6f2b65 100644 --- a/Mage/src/mage/constants/PlayerAction.java +++ b/Mage/src/mage/constants/PlayerAction.java @@ -29,16 +29,22 @@ package mage.constants; /** * Defines player actions for a game - * + * * @author LevelX2 */ public enum PlayerAction { + PASS_PRIORITY_UNTIL_MY_NEXT_TURN, PASS_PRIORITY_UNTIL_TURN_END_STEP, PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, PASS_PRIORITY_UNTIL_NEXT_TURN, PASS_PRIORITY_UNTIL_STACK_RESOLVED, PASS_PRIORITY_CANCEL_ALL_ACTIONS, + TRIGGER_AUTO_ORDER_ABILITY_FIRST, + TRIGGER_AUTO_ORDER_NAME_FIRST, + TRIGGER_AUTO_ORDER_ABILITY_LAST, + TRIGGER_AUTO_ORDER_NAME_LAST, + TRIGGER_AUTO_ORDER_RESET_ALL, ROLLBACK_TURNS, UNDO, CONCEDE, @@ -55,4 +61,4 @@ public enum PlayerAction { DENY_PERMISSON_TO_ROLLBACK_TURN, PERMISSION_REQUESTS_ALLOWED_ON, PERMISSION_REQUESTS_ALLOWED_OFF -} \ No newline at end of file +} diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 1e0a491f923..0c10ca220a6 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -229,7 +229,7 @@ public interface Game extends MageItem, Serializable { void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options); - void fireSelectTargetEvent(UUID playerId, String message, List abilities); + void fireSelectTargetTriggeredAbilityEvent(UUID playerId, String message, List abilities); void fireSelectTargetEvent(UUID playerId, String message, List perms, boolean required); @@ -353,7 +353,7 @@ public interface Game extends MageItem, Serializable { void addPermanent(Permanent permanent); // priority method - void sendPlayerAction(PlayerAction playerAction, UUID playerId); + void sendPlayerAction(PlayerAction playerAction, UUID playerId, Object data); /** * This version supports copying of copies of any depth. diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index e30b539ce25..bddd512b7bb 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -1136,10 +1136,10 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void sendPlayerAction(PlayerAction playerAction, UUID playerId) { + public void sendPlayerAction(PlayerAction playerAction, UUID playerId, Object data) { Player player = state.getPlayer(playerId); if (player != null) { - player.sendPlayerAction(playerAction, this); + player.sendPlayerAction(playerAction, this, data); } } @@ -1929,11 +1929,16 @@ public abstract class GameImpl implements Game, Serializable { playerQueryEventSource.target(playerId, message, cards, required, options); } + /** + * Only used from human players to select order triggered abilities go to + * the stack. + * + * @param playerId + * @param message + * @param abilities + */ @Override - public void fireSelectTargetEvent(UUID playerId, String message, List abilities) { - if (simulation) { - return; - } + public void fireSelectTargetTriggeredAbilityEvent(UUID playerId, String message, List abilities) { playerQueryEventSource.target(playerId, message, abilities); } diff --git a/Mage/src/mage/game/events/PlayerQueryEvent.java b/Mage/src/mage/game/events/PlayerQueryEvent.java index c6d18ba396a..6b299f2085e 100644 --- a/Mage/src/mage/game/events/PlayerQueryEvent.java +++ b/Mage/src/mage/game/events/PlayerQueryEvent.java @@ -29,6 +29,7 @@ package mage.game.events; import java.io.Serializable; import java.util.EventObject; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -60,8 +61,8 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri private Set targets; private Cards cards; private List booster; - private QueryType queryType; - private UUID playerId; + private final QueryType queryType; + private final UUID playerId; private boolean required; private int min; private int max; @@ -72,11 +73,6 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri private Choice choice; private PlayerQueryEvent(UUID playerId, String message, List abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required, Map options) { - this(playerId, message, abilities, choices, targets, cards, queryType, min, max, required); - this.options = options; - } - - private PlayerQueryEvent(UUID playerId, String message, List abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required) { super(playerId); this.queryType = queryType; this.message = message; @@ -88,6 +84,12 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri this.required = required; this.min = min; this.max = max; + if (options == null) { + this.options = new HashMap<>(); + } else { + this.options = options; + } + this.options.put("queryType", queryType); } private PlayerQueryEvent(UUID playerId, String message, List booster, QueryType queryType, int time) { @@ -148,7 +150,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent askEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false, null); } public static PlayerQueryEvent chooseAbilityEvent(UUID playerId, String message, String objectName, List choices) { @@ -157,7 +159,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri nameAsSet = new HashSet<>(); nameAsSet.add(objectName); } - return new PlayerQueryEvent(playerId, message, choices, nameAsSet, null, null, QueryType.CHOOSE_ABILITY, 0, 0, false); + return new PlayerQueryEvent(playerId, message, choices, nameAsSet, null, null, QueryType.CHOOSE_ABILITY, 0, 0, false, null); } public static PlayerQueryEvent choosePileEvent(UUID playerId, String message, List pile1, List pile2) { @@ -173,7 +175,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required) { - return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required); + return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required, null); } public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { @@ -185,7 +187,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent targetEvent(UUID playerId, String message, List abilities) { - return new PlayerQueryEvent(playerId, message, abilities, null, null, null, QueryType.PICK_ABILITY, 0, 0, true); + return new PlayerQueryEvent(playerId, message, abilities, null, null, null, QueryType.PICK_ABILITY, 0, 0, true, null); } public static PlayerQueryEvent targetEvent(UUID playerId, String message, List perms, boolean required) { @@ -193,7 +195,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent selectEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.SELECT, 0, 0, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.SELECT, 0, 0, false, null); } public static PlayerQueryEvent selectEvent(UUID playerId, String message, Map options) { @@ -205,11 +207,11 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent playXManaEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_X_MANA, 0, 0, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_X_MANA, 0, 0, false, null); } public static PlayerQueryEvent amountEvent(UUID playerId, String message, int min, int max) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.AMOUNT, min, max, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.AMOUNT, min, max, false, null); } public static PlayerQueryEvent pickCard(UUID playerId, String message, List booster, int time) { diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index 8e12ba8b251..5c960e650c2 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -402,7 +402,7 @@ public interface Player extends MageItem, Copyable { void skip(); // priority, undo, ... - void sendPlayerAction(PlayerAction passPriorityAction, Game game); + void sendPlayerAction(PlayerAction passPriorityAction, Game game, Object data); int getStoredBookmark(); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 7bfa31a2b01..4ee90b73ca1 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1878,7 +1878,7 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public void sendPlayerAction(PlayerAction playerAction, Game game) { + public void sendPlayerAction(PlayerAction playerAction, Game game, Object data) { switch (playerAction) { case PASS_PRIORITY_UNTIL_MY_NEXT_TURN: // F9 passedUntilNextMain = false; diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt index 95d40c590e8..98eacef81cd 100644 --- a/Utils/release/getting_implemented_cards.txt +++ b/Utils/release/getting_implemented_cards.txt @@ -6,157 +6,7 @@ git log tagOrSha1..HEAD --diff-filter=A --name-status | sed -ne 's/^A[^u]Mage.Se for Windows: you need to replace ' by "" and remove -u in sort -Example for cards implemented from 0.8.7 till 0.9: -git log 9ac166abc92f70aebdbe34825880ff8f909465ed..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.0.2-release: -git log 6b38cd5b18298b07962b969bfa2eb69c62839575..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.0.3-release: -git log 7ba3d451da95183b8c1cfb732b332f640963cc4a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -git log 68333a2eff6b643b2028d18dad16d1f228be7a2c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -20130901 -git log 10902581140fe4268fc12408f099ad82347d7cd0..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.1.0-release: -git log d6c1075125e657d4dd2e7bb120e108bb4c4536ff..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.1.2-2013_10_26-release: -git log 63889f5bd4faa0a0915bb1e845ca3a0bc1093070..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.2.0 -git log b724d7fe136abbe09144eb2824739df3238061ee..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-02-03 -git log 9c5d5208b96e28e1e767574e1143b845e6b7308f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-02-15 -git log 88d8c30b6c3dbf7c90354eccfd04107641c308f1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-04-25 -git log a1cfd040d74dd6d2100168754961cfebb154f153..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-05-10 -git log e93cd580dd8ff985fbda018bb5ea652134c1865e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-05-10v2 -git log e484da4028e6c0498bbcd76b83af39bca93d26b1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-05-30v1 -git log 99a60c3063521551ab08c506386729f1feaee257..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-06-15 -git log 6c8b818d890e9e0ce4bc5e3128249bb9e62c0b23..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-06-28 -git log 1129858a6c5c0dae5d1e29ea931804c1165b8c38..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-07-11 -git log 458255cd0627af90c2ebeab4c410a16d55a36f41..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-07-19 -git log 75eb0bdfdf36ba83dd5a3e2c6a204ceb186c9d5e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-07-30 -git log 69ce53e6e8036bf01bdd090e8785f4d63c486d1e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-08-11 -git log 709dc83ae6fd6778e5b52e5176a978f1c6fda3b7..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-08-19 -git log edd1563c12422f69c10bc76d310e0a84421ab4a2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-08-30 -git log fbc2a7258face1e908f3f08da1c2fec4ec0f86fe..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-09-13 -git log 632f711fe237defe43111f9b7236fda1da74bfc0..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-09-26 -git log b76102b0cdb911c7217fc2f510b4de86651f91d2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-10-05 -git log 8121849a185b913ef2de59fff2f3d9a6c9b3a613..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-10-18v1 -git log 58bbe60c724c7940996cf33db690d5eb1abfce0a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-10-18v2 (2014-10-20) -git log 974cb4435bb826769b935aaffc8335eeaa83d53f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-10-18v3 (2014-10-25) -git log 26b5a277c4404a93e3b41ba477c5ec58dedcf826..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-01v1 -git log 8426816b0948991fdb100ce010f009a4aae7796a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-08v1 -git log 0ce2348e3362c60972c7901b1c083361c926f861..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v1 -git log 3446953a9d594f324a4b4e36ea13560f1fe2685b..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v2 -git log 68f2b65c345d4f16f33f6f23d849d48b1924bbd1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v3 -git log 68fed320f79a43a4af21ed9238b7659df53a008e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v4 (2014-12-13) -git log 96ce77e9d0e21610569071c81e661f91c53a3a17..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v5 (2014-12-27) -git log c4ad51c4af2467f3483204e29f23b76c53f8f880..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-29v7 (2015-01-01) -git log c370189787cff7fc129b1ccf1b223807143460de..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-29v8 (2015-01-17) -git log 79ceae999a72151e2fadd1e15ddd37ec76c3f205..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-29v10 (2015-01-23) -git log 79ceae999a72151e2fadd1e15ddd37ec76c3f205..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v1 -git log e0b17eacc7b3abff4f6a6e878c01ebfab577df9e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v3 -git log ba1fb775b2efd63d4de60786ab9d7857e00c3a57..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v4 -git log 7d7afb60d6fbe6d3f15a8fae9af147df3d3f31c6..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v7 -git log 6bd17716cd23e0f19142fb59c9c1bc44d87441e3..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v1 -git log ece4d69f367536ffb80cdf94d5a3dd771ba40f04..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v2 -git log b78d6f69af6d2b565c95b3ac20f76dd7eeecb3f8..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v2 -git log 78df43fd30850568c6494fb12c1f9d8415ef850f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v5 -git log 65f731557bb55d0c85723e382001bdf9701f0a7f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v6 -git log b79d6e64cff01726be93cbbfffca8a6f18188a3c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v8 -git log 47b17535194c6aa5397a966463c8b17d37f8bd44..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v9 -git log 00692410273d4c2ff70eec7bfcf6a601fb404bf9..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.0.v0 -git log fa847e8feb646e94d77fc8abc35e1d9817622f8a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.0.v1 -git log e8b2e01cd465f6a8ced2c83ec52a698ee093baa4..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.4.0.v2 -git log eb96b08dfac3de4f78403d6f23e41ce8d41ece6f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v0 -git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v1 -git log 3e9b4cfb7c22d363755d28f5ff1de351f6b7123c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v2 -git log 675801e8d493b023add4333e7835751d20da07a1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v3 -git log 757b9ea99ec1f0ce46bb533f9f86f3473d122a60..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v0 -git log cd0cba6ec7d8799bb85247b7b4f5d545e170b093..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v1 -git log 0b26aaff6ec033a538179bf607b1c7a7736aedb2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v2 -git log 8d5137e40ebe1c029e737ef475935ff7cc40bb64..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v3 -git log 60c7a2b34b5dd9a64bd415b65424a559294cf52b..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v4 -git log 193177d9999d56729a687ca3b1a2fc3f3b96d9e2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +Example for cards implemented since hash: since 1.4.2.v5 git log 8dca887fadbbea41fb649ff17c5fe547a82ef23a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt @@ -167,6 +17,13 @@ git log 5de4637d9c7967612c207d3cf915c2861d922029..HEAD --diff-filter=A --name-st since 1.4.3.v2 git log 6d8378d5e49629a2fa126baf84340156a28f25db..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +since 1.4.3.v3 +git log 23039572f2206ade860f5835e9b85e82a9c4b2a1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.3.v2 +git log 6d8378d5e49629a2fa126baf84340156a28f25db..23039572f2206ade860f5835e9b85e82a9c4b2a1 --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + + 3. Copy added_cards.txt to trunk\Utils folder 4. Run script: > perl extract_in_wiki_format.perl From 9a22cd206807fd86e85efa6eeb475dbf542b48ce Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 22 Aug 2015 23:23:02 +0200 Subject: [PATCH 18/35] Added a test. --- .../cards/continuous/BoostEnchantedTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java index f7db7fd18d7..ffe53bab72c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java @@ -89,4 +89,37 @@ public class BoostEnchantedTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Boomerang", 1); assertPowerToughness(playerA, "Silvercoat Lion", 3, 2); } + + /** + * If the aura moves between activation and resolution, the new enchanted + * creature should be boosted, not the old one. + */ + + @Test + public void testFirebreathingWithAuraGraft() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing"); // {R} Enchantment - Aura + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); + // Gain control of target Aura that's attached to a permanent. Attach it to another permanent it can enchant. + addCard(Zone.HAND, playerB, "Aura Graft"); // {1}{U} Instant + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Aura Graft", "Firebreathing"); + setChoice(playerB, "Pillarfield Ox"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Aura Graft", 1); + assertPermanentCount(playerB, "Firebreathing", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 2, 2); + assertPowerToughness(playerB, "Pillarfield Ox", 3, 4); + + } + } From c0c7dc590002cb3ca1e5b103bdf17cb7918eae08 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Aug 2015 00:57:05 +0200 Subject: [PATCH 19/35] * Fixed a bug of deck import not finding cards that were never included in regular core or expansion sets (e.g. Command Tower). The deck imports are now case insensitive (and also a little bit slower). --- .../cards/decks/importer/DecDeckImporter.java | 2 +- .../cards/decks/importer/MWSDeckImporter.java | 2 +- .../cards/decks/importer/TxtDeckImporter.java | 4 +-- .../mage/cards/repository/CardRepository.java | 32 ++++++++++++++++--- Mage/src/mage/game/draft/DraftCube.java | 2 +- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Mage/src/mage/cards/decks/importer/DecDeckImporter.java b/Mage/src/mage/cards/decks/importer/DecDeckImporter.java index 617313d634e..b1b095cf605 100644 --- a/Mage/src/mage/cards/decks/importer/DecDeckImporter.java +++ b/Mage/src/mage/cards/decks/importer/DecDeckImporter.java @@ -55,7 +55,7 @@ public class DecDeckImporter extends DeckImporter { String lineName = line.substring(delim).trim(); try { int num = Integer.parseInt(lineNum); - CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName); + CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); if (cardInfo == null) { sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); } else { diff --git a/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java b/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java index 3b29c552950..f8bb97629ae 100644 --- a/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java +++ b/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java @@ -74,7 +74,7 @@ public class MWSDeckImporter extends DeckImporter { cardInfo = cards.get(new Random().nextInt(cards.size())); } } else { - cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName); + cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); } if (cardInfo == null) { diff --git a/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java b/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java index dbfb00b268b..3f5cf742f06 100644 --- a/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java +++ b/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java @@ -74,7 +74,7 @@ public class TxtDeckImporter extends DeckImporter { } String lineNum = line.substring(0, delim).trim(); String lineName = line.substring(delim).replace("’", "\'").trim(); - lineName = lineName.replace("&", "//").replace("Æ", "AE").replace("ö", "ö"); + lineName = lineName.replace("&", "//").replace("Æ", "AE").replace("ö", "ö").replace("û", "u").replace("\"", "'"); if (lineName.contains("//") && !lineName.contains(" // ")) { lineName = lineName.replace("//", " // "); } @@ -86,7 +86,7 @@ public class TxtDeckImporter extends DeckImporter { } try { int num = Integer.parseInt(lineNum.replaceAll("\\D+", "")); - CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName); + CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); if (cardInfo == null) { sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); } else { diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 5aec317ec69..115c36f9285 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -29,6 +29,7 @@ package mage.cards.repository; import com.j256.ormlite.dao.Dao; import com.j256.ormlite.dao.DaoManager; +import com.j256.ormlite.dao.GenericRawResults; import com.j256.ormlite.jdbc.JdbcConnectionSource; import com.j256.ormlite.stmt.QueryBuilder; import com.j256.ormlite.stmt.SelectArg; @@ -40,7 +41,6 @@ import java.io.File; import java.sql.SQLException; import java.util.ArrayList; import java.util.Date; -import java.util.GregorianCalendar; import java.util.List; import java.util.Random; import java.util.Set; @@ -318,11 +318,16 @@ public enum CardRepository { return null; } - public CardInfo findPreferedCoreExpansionCard(String name) { - List cards = findCards(name); + public CardInfo findPreferedCoreExpansionCard(String name, boolean caseInsensitive) { + List cards; + if (caseInsensitive) { + cards = findCardsCaseInsensitive(name); + } else { + cards = findCards(name); + } if (!cards.isEmpty()) { - Date lastReleaseDate = new GregorianCalendar(1900, 1, 1).getTime(); - Date lastExpansionDate = new GregorianCalendar(1900, 1, 1).getTime(); + Date lastReleaseDate = null; + Date lastExpansionDate = null; CardInfo cardToUse = null; for (CardInfo cardinfo : cards) { ExpansionInfo set = ExpansionRepository.instance.getSetByCode(cardinfo.getSetCode()); @@ -353,6 +358,23 @@ public enum CardRepository { return new ArrayList<>(); } + public List findCardsCaseInsensitive(String name) { + try { + String sqlName = name.toLowerCase().replaceAll("\'", "\'\'"); + GenericRawResults rawResults = cardDao.queryRaw( + "select * from " + CardRepository.VERSION_ENTITY_NAME + " where lower(name) = '" + sqlName + "'", + cardDao.getRawRowMapper()); + List result = new ArrayList<>(); + for (CardInfo cardinfo : rawResults) { + result.add(cardinfo); + } + return result; + } catch (SQLException ex) { + Logger.getLogger(CardRepository.class).error("Error during execution of raw sql statement", ex); + } + return new ArrayList<>(); + } + public List findCards(CardCriteria criteria) { try { QueryBuilder queryBuilder = cardDao.queryBuilder(); diff --git a/Mage/src/mage/game/draft/DraftCube.java b/Mage/src/mage/game/draft/DraftCube.java index cb17656cca8..974ca560955 100644 --- a/Mage/src/mage/game/draft/DraftCube.java +++ b/Mage/src/mage/game/draft/DraftCube.java @@ -112,7 +112,7 @@ public abstract class DraftCube { cardInfo = cardList.get(0); } } else { - cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardId.getName()); + cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardId.getName(), false); } if (cardInfo != null) { From 479a0117d6d4b8b569d548f55a6210e8ba48cc7c Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sat, 22 Aug 2015 21:24:56 -0500 Subject: [PATCH 20/35] Implemented Zombie Trailblazer, Wormwood Treefolk, Wormwood Dryad, Witch Engine, Viscid Lemures, and Boggart Loggers. Fixed Nirkana Revenant's triggered ability to now be a mana ability. --- .../src/mage/sets/lorwyn/BoggartLoggers.java | 87 ++++++ .../masterseditioniii/WormwoodTreefolk.java | 54 ++++ .../riseoftheeldrazi/NirkanaRevenant.java | 265 ++++++++---------- .../mage/sets/thedark/WormwoodTreefolk.java | 79 ++++++ .../mage/sets/timespiral/ViscidLemures.java | 72 +++++ .../mage/sets/timespiral/WormwoodDryad.java | 79 ++++++ .../mage/sets/torment/ZombieTrailblazer.java | 93 ++++++ .../src/mage/sets/urzassaga/WitchEngine.java | 111 ++++++++ 8 files changed, 693 insertions(+), 147 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.java create mode 100644 Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java create mode 100644 Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/WitchEngine.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java b/Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java new file mode 100644 index 00000000000..77a14666bda --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java @@ -0,0 +1,87 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class BoggartLoggers extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Treefolk or Forest"); + + static { + filter.add(Predicates.or( + new SubtypePredicate("Treefolk"), + new SubtypePredicate("Forest"))); + } + + public BoggartLoggers(UUID ownerId) { + super(ownerId, 103, "Boggart Loggers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Goblin"); + this.subtype.add("Rogue"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Forestwalk + this.addAbility(new ForestwalkAbility()); + + // {2}{B}, Sacrifice Boggart Loggers: Destroy target Treefolk or Forest. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public BoggartLoggers(final BoggartLoggers card) { + super(card); + } + + @Override + public BoggartLoggers copy() { + return new BoggartLoggers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.java b/Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.java new file mode 100644 index 00000000000..4e6beb8c3f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.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 fireshoes + */ +public class WormwoodTreefolk extends mage.sets.thedark.WormwoodTreefolk { + + public WormwoodTreefolk(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.UNCOMMON; + } + + public WormwoodTreefolk(final WormwoodTreefolk card) { + super(card); + } + + @Override + public WormwoodTreefolk copy() { + return new WormwoodTreefolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java index 27d3eca54aa..a38db325a64 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java @@ -1,147 +1,118 @@ -/* - * 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.riseoftheeldrazi; - -import java.util.UUID; -import mage.MageInt; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author jeffwadsworth - */ -public class NirkanaRevenant extends CardImpl { - - public NirkanaRevenant(UUID ownerId) { - super(ownerId, 120, "Nirkana Revenant", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Vampire"); - this.subtype.add("Shade"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - - // Whenever you tap a Swamp for mana, add {B} to your mana pool. - this.addAbility(new NirkanaRevenantTriggeredAbility()); - - // {B}: Nirkana Revenant gets +1/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); - } - - public NirkanaRevenant(final NirkanaRevenant card) { - super(card); - } - - @Override - public NirkanaRevenant copy() { - return new NirkanaRevenant(this); - } -} - -class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl { - - public NirkanaRevenantTriggeredAbility() { - super(Zone.BATTLEFIELD, new NirkanaRevenantEffect()); - } - - public NirkanaRevenantTriggeredAbility(final NirkanaRevenantTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED_FOR_MANA; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - return false; - } - - @Override - public NirkanaRevenantTriggeredAbility copy() { - return new NirkanaRevenantTriggeredAbility(this); - } - - @Override - public String getRule() { - return "Whenever you tap a Swamp for mana, add {B} to your mana pool."; - } -} - -class NirkanaRevenantEffect extends OneShotEffect { - - NirkanaRevenantEffect() { - super(Outcome.PutManaInPool); - } - - NirkanaRevenantEffect(final NirkanaRevenantEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.getManaPool().addMana(Mana.BlackMana, game, source); - return true; - } - return false; - } - - @Override - public NirkanaRevenantEffect copy() { - return new NirkanaRevenantEffect(this); - } -} +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.mana.TriggeredManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class NirkanaRevenant extends CardImpl { + + public NirkanaRevenant(UUID ownerId) { + super(ownerId, 120, "Nirkana Revenant", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Vampire"); + this.subtype.add("Shade"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever you tap a Swamp for mana, add {B} to your mana pool. + this.addAbility(new NirkanaRevenantTriggeredAbility()); + + // {B}: Nirkana Revenant gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public NirkanaRevenant(final NirkanaRevenant card) { + super(card); + } + + @Override + public NirkanaRevenant copy() { + return new NirkanaRevenant(this); + } +} + +class NirkanaRevenantTriggeredAbility extends TriggeredManaAbility { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Swamp"); + static { + filter.add(new SubtypePredicate("Swamp")); + } + + public NirkanaRevenantTriggeredAbility() { + super(Zone.BATTLEFIELD, new BasicManaEffect(Mana.BlackMana), false); + this.usesStack = false; + } + + public NirkanaRevenantTriggeredAbility(NirkanaRevenantTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent land = game.getPermanent(event.getTargetId()); + return land != null && filter.match(land, this.getSourceId(), this.getControllerId(), game); + } + + @Override + public NirkanaRevenantTriggeredAbility copy() { + return new NirkanaRevenantTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever you tap a Swamp for mana, add {B} to your mana pool."; + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java b/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java new file mode 100644 index 00000000000..57c626eef29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.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.thedark; + +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.common.DamageControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class WormwoodTreefolk extends CardImpl { + + public WormwoodTreefolk(UUID ownerId) { + super(ownerId, 55, "Wormwood Treefolk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Treefolk"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {G}{G}: Wormwood Treefolk gains forestwalk until end of turn and deals 2 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new ForestwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{G}{G}")); + ability.addEffect(new DamageControllerEffect(2)); + this.addAbility(ability); + + // {B}{B}: Wormwood Treefolk gains swampwalk until end of turn and deals 2 damage to you. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{B}{B}")); + ability.addEffect(new DamageControllerEffect(2)); + this.addAbility(ability); + } + + public WormwoodTreefolk(final WormwoodTreefolk card) { + super(card); + } + + @Override + public WormwoodTreefolk copy() { + return new WormwoodTreefolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java b/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java new file mode 100644 index 00000000000..892ce1a364f --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class ViscidLemures extends CardImpl { + + public ViscidLemures(UUID ownerId) { + super(ownerId, 141, "Viscid Lemures", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Spirit"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // {0}: Viscid Lemures gets -1/-0 and gains swampwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn), new GenericManaCost(0)); + ability.addEffect(new BoostSourceEffect(-1, 0, Duration.EndOfTurn)); + this.addAbility(ability); + } + + public ViscidLemures(final ViscidLemures card) { + super(card); + } + + @Override + public ViscidLemures copy() { + return new ViscidLemures(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java b/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java new file mode 100644 index 00000000000..75a7d7c1e29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.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.timespiral; + +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.common.DamageControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class WormwoodDryad extends CardImpl { + + public WormwoodDryad(UUID ownerId) { + super(ownerId, 233, "Wormwood Dryad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Dryad"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {G}: Wormwood Dryad gains forestwalk until end of turn and deals 1 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new ForestwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addEffect(new DamageControllerEffect(1)); + this.addAbility(ability); + + // {B}: Wormwood Dryad gains swampwalk until end of turn and deals 1 damage to you. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{B}")); + ability.addEffect(new DamageControllerEffect(1)); + this.addAbility(ability); + } + + public WormwoodDryad(final WormwoodDryad card) { + super(card); + } + + @Override + public WormwoodDryad copy() { + return new WormwoodDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java b/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java new file mode 100644 index 00000000000..afbb37a7d6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class ZombieTrailblazer extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an untapped Zombie you control"); + + static { + filter.add(new SubtypePredicate("Zombie")); + filter.add(Predicates.not(new TappedPredicate())); + } + + public ZombieTrailblazer(UUID ownerId) { + super(ownerId, 89, "Zombie Trailblazer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}{B}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Zombie"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Tap an untapped Zombie you control: Target land becomes a Swamp until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Swamp"), new TapTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + + // Tap an untapped Zombie you control: Target creature gains swampwalk until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new SwampwalkAbility(), Duration.EndOfTurn), new TapTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ZombieTrailblazer(final ZombieTrailblazer card) { + super(card); + } + + @Override + public ZombieTrailblazer copy() { + return new ZombieTrailblazer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/WitchEngine.java b/Mage.Sets/src/mage/sets/urzassaga/WitchEngine.java new file mode 100644 index 00000000000..71092fd879f --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/WitchEngine.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.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class WitchEngine extends CardImpl { + + public WitchEngine(UUID ownerId) { + super(ownerId, 169, "Witch Engine", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Horror"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + + // {tap}: Add {B}{B}{B}{B} to your mana pool. Target opponent gains control of Witch Engine. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 4, 0, 0)), new TapSourceCost()); + ability.addEffect(new WitchEngineEffect()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public WitchEngine(final WitchEngine card) { + super(card); + } + + @Override + public WitchEngine copy() { + return new WitchEngine(this); + } +} + +class WitchEngineEffect extends ContinuousEffectImpl { + + public WitchEngineEffect() { + super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + staticText = "target opponent gains control of {this}"; + } + + public WitchEngineEffect(final WitchEngineEffect effect) { + super(effect); + } + + @Override + public WitchEngineEffect copy() { + return new WitchEngineEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + if (permanent != null) { + return permanent.changeControllerId(source.getFirstTarget(), game); + } else { + discard(); + } + return false; + } + +} From d5af4f8c21f6b543c8e2335ca663bf9b4fe8d5ca Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sun, 23 Aug 2015 10:46:51 +0300 Subject: [PATCH 21/35] Implement cards: Daru Sanctifiers, Patron of the Wild, Primal Whisperer, and Skinthinner --- .../src/mage/sets/legions/DaruSanctifier.java | 72 +++++++++++++++++ .../mage/sets/legions/PatronOfTheWild.java | 72 +++++++++++++++++ .../mage/sets/legions/PrimalWhisperer.java | 80 ++++++++++++++++++ .../src/mage/sets/legions/Skinthinner.java | 81 +++++++++++++++++++ 4 files changed, 305 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/DaruSanctifier.java create mode 100644 Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java create mode 100644 Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java create mode 100644 Mage.Sets/src/mage/sets/legions/Skinthinner.java diff --git a/Mage.Sets/src/mage/sets/legions/DaruSanctifier.java b/Mage.Sets/src/mage/sets/legions/DaruSanctifier.java new file mode 100644 index 00000000000..060f45dc675 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/DaruSanctifier.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class DaruSanctifier extends CardImpl { + + public DaruSanctifier(UUID ownerId) { + super(ownerId, 9, "Daru Sanctifier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Morph {1}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{W}"))); + // When Daru Sanctifier is turned face up, destroy target enchantment. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + } + + public DaruSanctifier(final DaruSanctifier card) { + super(card); + } + + @Override + public DaruSanctifier copy() { + return new DaruSanctifier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java b/Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java new file mode 100644 index 00000000000..5d0f7300698 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PatronOfTheWild extends CardImpl { + + public PatronOfTheWild(UUID ownerId) { + super(ownerId, 134, "Patron of the Wild", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Elf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Morph {2}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{G}"))); + // When Patron of the Wild is turned face up, target creature gets +3/+3 until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public PatronOfTheWild(final PatronOfTheWild card) { + super(card); + } + + @Override + public PatronOfTheWild copy() { + return new PatronOfTheWild(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java b/Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java new file mode 100644 index 00000000000..bd748955f12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.FaceDownPredicate; + +/** + * + * @author LoneFox + */ +public class PrimalWhisperer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("face-down creature"); + + static { + filter.add(new FaceDownPredicate()); + } + + public PrimalWhisperer(UUID ownerId) { + super(ownerId, 135, "Primal Whisperer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Elf"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Primal Whisperer gets +2/+2 for each face-down creature on the battlefield. + PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield))); + // Morph {3}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{G}"))); + } + + public PrimalWhisperer(final PrimalWhisperer card) { + super(card); + } + + @Override + public PrimalWhisperer copy() { + return new PrimalWhisperer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/Skinthinner.java b/Mage.Sets/src/mage/sets/legions/Skinthinner.java new file mode 100644 index 00000000000..5ce6863d4cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/Skinthinner.java @@ -0,0 +1,81 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Skinthinner extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public Skinthinner(UUID ownerId) { + super(ownerId, 80, "Skinthinner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Morph {3}{B}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{B}{B}"))); + // When Skinthinner is turned face up, destroy target nonblack creature. It can't be regenerated. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DestroyTargetEffect(true)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public Skinthinner(final Skinthinner card) { + super(card); + } + + @Override + public Skinthinner copy() { + return new Skinthinner(this); + } +} From 185e99bd628063982aa2e985be0edf37c89fd308 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sun, 23 Aug 2015 11:35:35 +0300 Subject: [PATCH 22/35] Implement cards: Akroma's Devoted, Defender of the Order, Liege of the Axe, and Vile Deacon --- .../src/mage/sets/legions/AkromasDevoted.java | 69 ++++++++++++++++ .../mage/sets/legions/DefenderOfTheOrder.java | 69 ++++++++++++++++ .../src/mage/sets/legions/LiegeOfTheAxe.java | 71 +++++++++++++++++ .../src/mage/sets/legions/VileDeacon.java | 78 +++++++++++++++++++ 4 files changed, 287 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/AkromasDevoted.java create mode 100644 Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java create mode 100644 Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java create mode 100644 Mage.Sets/src/mage/sets/legions/VileDeacon.java diff --git a/Mage.Sets/src/mage/sets/legions/AkromasDevoted.java b/Mage.Sets/src/mage/sets/legions/AkromasDevoted.java new file mode 100644 index 00000000000..daffd0c13ba --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/AkromasDevoted.java @@ -0,0 +1,69 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AkromasDevoted extends CardImpl { + + public AkromasDevoted(UUID ownerId) { + super(ownerId, 2, "Akroma's Devoted", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Cleric creatures have vigilance. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(VigilanceAbility.getInstance(), + Duration.WhileOnBattlefield, new FilterCreaturePermanent("Cleric", "Cleric creatures")))); + } + + public AkromasDevoted(final AkromasDevoted card) { + super(card); + } + + @Override + public AkromasDevoted copy() { + return new AkromasDevoted(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java b/Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java new file mode 100644 index 00000000000..9a179436446 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java @@ -0,0 +1,69 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DefenderOfTheOrder extends CardImpl { + + public DefenderOfTheOrder(UUID ownerId) { + super(ownerId, 11, "Defender of the Order", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Morph {W}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{W}{W}"))); + // When Defender of the Order is turned face up, creatures you control get +0/+2 until end of turn. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostControlledEffect(0, 2, Duration.EndOfTurn))); + } + + public DefenderOfTheOrder(final DefenderOfTheOrder card) { + super(card); + } + + @Override + public DefenderOfTheOrder copy() { + return new DefenderOfTheOrder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java b/Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java new file mode 100644 index 00000000000..908ac75e6ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LiegeOfTheAxe extends CardImpl { + + public LiegeOfTheAxe(UUID ownerId) { + super(ownerId, 16, "Liege of the Axe", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // Morph {1}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{W}"))); + // When Liege of the Axe is turned face up, untap it. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new UntapSourceEffect())); + } + + public LiegeOfTheAxe(final LiegeOfTheAxe card) { + super(card); + } + + @Override + public LiegeOfTheAxe copy() { + return new LiegeOfTheAxe(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/VileDeacon.java b/Mage.Sets/src/mage/sets/legions/VileDeacon.java new file mode 100644 index 00000000000..ee55e4a80f4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/VileDeacon.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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class VileDeacon extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Clerics"); + + static { + filter.add(new SubtypePredicate("Cleric")); + } + + public VileDeacon(UUID ownerId) { + super(ownerId, 85, "Vile Deacon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Vile Deacon attacks, it gets +X/+X until end of turn, where X is the number of Clerics on the battlefield. + PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter); + Effect effect = new BoostSourceEffect(amount, amount, Duration.EndOfTurn); + effect.setText("it gets +X/+X until end of turn, where X is the number of Clerics on the battlefield"); + this.addAbility(new AttacksTriggeredAbility(effect, false)); + } + + public VileDeacon(final VileDeacon card) { + super(card); + } + + @Override + public VileDeacon copy() { + return new VileDeacon(this); + } +} From a0728f36f3da134b5cc37a09f29491f17c6ecdd5 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sun, 23 Aug 2015 12:26:11 +0300 Subject: [PATCH 23/35] Implement cards: Aven Warhawk, Keeper of the Nine Gales, Sunstrike Legionnaire, and Wingbeat Warrior --- .../src/mage/sets/legions/AvenWarhawk.java | 67 ++++++++++++++ .../sets/legions/KeeperOfTheNineGales.java | 87 ++++++++++++++++++ .../sets/legions/SunstrikeLegionnaire.java | 91 +++++++++++++++++++ .../mage/sets/legions/WingbeatWarrior.java | 78 ++++++++++++++++ 4 files changed, 323 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/AvenWarhawk.java create mode 100644 Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java create mode 100644 Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java create mode 100644 Mage.Sets/src/mage/sets/legions/WingbeatWarrior.java diff --git a/Mage.Sets/src/mage/sets/legions/AvenWarhawk.java b/Mage.Sets/src/mage/sets/legions/AvenWarhawk.java new file mode 100644 index 00000000000..84d5ccfb93c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/AvenWarhawk.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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.AmplifyEffect; +import mage.abilities.keyword.AmplifyAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AvenWarhawk extends CardImpl { + + public AvenWarhawk(UUID ownerId) { + super(ownerId, 4, "Aven Warhawk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Amplify 1 + this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public AvenWarhawk(final AvenWarhawk card) { + super(card); + } + + @Override + public AvenWarhawk copy() { + return new AvenWarhawk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java b/Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java new file mode 100644 index 00000000000..220ed6699a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java @@ -0,0 +1,87 @@ +/* + * 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.legions; + +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.costs.common.TapTargetCost; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class KeeperOfTheNineGales extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Birds you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate("Bird")); + } + + public KeeperOfTheNineGales(UUID ownerId) { + super(ownerId, 42, "Keeper of the Nine Gales", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {tap}, Tap two untapped Birds you control: Return target permanent to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new TapSourceCost()); + ability.addCost(new TapTargetCost(new TargetControlledPermanent(2, 2, filter, false))); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public KeeperOfTheNineGales(final KeeperOfTheNineGales card) { + super(card); + } + + @Override + public KeeperOfTheNineGales copy() { + return new KeeperOfTheNineGales(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java b/Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java new file mode 100644 index 00000000000..5b2637ee78a --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java @@ -0,0 +1,91 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SunstrikeLegionnaire extends CardImpl { + + private static final FilterCreaturePermanent untapFilter = new FilterCreaturePermanent("another creature"); + private static final FilterCreaturePermanent tapFilter = new FilterCreaturePermanent("creature with converted mana cost 3 or less"); + + static { + untapFilter.add(new AnotherPredicate()); + tapFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4)); + } + + public SunstrikeLegionnaire(UUID ownerId) { + super(ownerId, 22, "Sunstrike Legionnaire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Sunstrike Legionnaire doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + // Whenever another creature enters the battlefield, untap Sunstrike Legionnaire. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), untapFilter, false, null)); + // {tap}: Tap target creature with converted mana cost 3 or less. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(tapFilter)); + this.addAbility(ability); + } + + public SunstrikeLegionnaire(final SunstrikeLegionnaire card) { + super(card); + } + + @Override + public SunstrikeLegionnaire copy() { + return new SunstrikeLegionnaire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/WingbeatWarrior.java b/Mage.Sets/src/mage/sets/legions/WingbeatWarrior.java new file mode 100644 index 00000000000..69cf7136757 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/WingbeatWarrior.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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WingbeatWarrior extends CardImpl { + + public WingbeatWarrior(UUID ownerId) { + super(ownerId, 29, "Wingbeat Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Morph {2}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{W}"))); + // When Wingbeat Warrior is turned face up, target creature gains first strike until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public WingbeatWarrior(final WingbeatWarrior card) { + super(card); + } + + @Override + public WingbeatWarrior copy() { + return new WingbeatWarrior(this); + } +} From be25ff1dbf23b6af8e754165a01dda383a7ee8b4 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sun, 23 Aug 2015 17:36:47 +0300 Subject: [PATCH 24/35] Implement cards: Cloudreach Cavalry, Covert Operative, Glintwing Invoker, and Smokespew Invoker --- .../mage/sets/legions/CloudreachCavalry.java | 87 +++++++++++++++++++ .../mage/sets/legions/CovertOperative.java | 63 ++++++++++++++ .../mage/sets/legions/GlintwingInvoker.java | 78 +++++++++++++++++ .../mage/sets/legions/SmokespewInvoker.java | 72 +++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java create mode 100644 Mage.Sets/src/mage/sets/legions/CovertOperative.java create mode 100644 Mage.Sets/src/mage/sets/legions/GlintwingInvoker.java create mode 100644 Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java diff --git a/Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java b/Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java new file mode 100644 index 00000000000..67f5da43517 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java @@ -0,0 +1,87 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +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; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class CloudreachCavalry extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Bird"); + + static { + filter.add(new SubtypePredicate("Bird")); + } + + public CloudreachCavalry(UUID ownerId) { + super(ownerId, 7, "Cloudreach Cavalry", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // As long as you control a Bird, Cloudreach Cavalry gets +2/+2 and has flying. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter), + "As long as you control a Bird, {this} gets +2/+2")); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(FlyingAbility.getInstance()), + new PermanentsOnTheBattlefieldCondition(filter), + "and has flying")); + this.addAbility(ability); + } + + public CloudreachCavalry(final CloudreachCavalry card) { + super(card); + } + + @Override + public CloudreachCavalry copy() { + return new CloudreachCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/CovertOperative.java b/Mage.Sets/src/mage/sets/legions/CovertOperative.java new file mode 100644 index 00000000000..304ed117dc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/CovertOperative.java @@ -0,0 +1,63 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CovertOperative extends CardImpl { + + public CovertOperative(UUID ownerId) { + super(ownerId, 33, "Covert Operative", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Covert Operative can't be blocked. + this.addAbility(new CantBeBlockedSourceAbility()); + } + + public CovertOperative(final CovertOperative card) { + super(card); + } + + @Override + public CovertOperative copy() { + return new CovertOperative(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/GlintwingInvoker.java b/Mage.Sets/src/mage/sets/legions/GlintwingInvoker.java new file mode 100644 index 00000000000..2c753d85752 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GlintwingInvoker.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.legions; + +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 GlintwingInvoker extends CardImpl { + + public GlintwingInvoker(UUID ownerId) { + super(ownerId, 40, "Glintwing Invoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.subtype.add("Mutant"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {7}{U}: Glintwing Invoker gets +3/+3 and gains flying until end of turn. + Effect effect = new BoostSourceEffect(3, 3, Duration.EndOfTurn); + effect.setText("{this} gets +3/+3"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{7}{U}")); + effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public GlintwingInvoker(final GlintwingInvoker card) { + super(card); + } + + @Override + public GlintwingInvoker copy() { + return new GlintwingInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java b/Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java new file mode 100644 index 00000000000..e7e9bef6f1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +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.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SmokespewInvoker extends CardImpl { + + public SmokespewInvoker(UUID ownerId) { + super(ownerId, 81, "Smokespew Invoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.subtype.add("Mutant"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {7}{B}: Target creature gets -3/-3 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-3, -3, Duration.EndOfTurn), + new ManaCostsImpl("{7}{B}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SmokespewInvoker(final SmokespewInvoker card) { + super(card); + } + + @Override + public SmokespewInvoker copy() { + return new SmokespewInvoker(this); + } +} From 91482964dc35b1aa14ae4970d777357e69065b81 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Aug 2015 22:46:22 +0200 Subject: [PATCH 25/35] * Megrim - Fixed target handling (using always the target from first time the ability triggered). --- .../src/mage/sets/tenthedition/Megrim.java | 52 +++---------------- ...DiscardsACardOpponentTriggeredAbility.java | 25 ++++++++- 2 files changed, 29 insertions(+), 48 deletions(-) diff --git a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java index 0f7b676328e..cd2af2536d1 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java @@ -25,20 +25,15 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.tenthedition; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DiscardsACardOpponentTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; 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; -import mage.game.events.GameEvent.EventType; -import mage.target.common.TargetOpponent; +import mage.constants.SetTargetPointer; /** * @@ -46,14 +41,15 @@ import mage.target.common.TargetOpponent; */ public class Megrim extends CardImpl { - public Megrim (UUID ownerId) { + public Megrim(UUID ownerId) { super(ownerId, 157, "Megrim", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "10E"; - this.addAbility(new MergimTriggeredAbility()); + // Whenever an opponent discards a card, Megrim deals 2 damage to that player. + this.addAbility(new DiscardsACardOpponentTriggeredAbility(new DamageTargetEffect(2, true, "that player"), false, SetTargetPointer.PLAYER)); } - public Megrim (final Megrim card) { + public Megrim(final Megrim card) { super(card); } @@ -63,39 +59,3 @@ public class Megrim extends CardImpl { } } - -class MergimTriggeredAbility extends TriggeredAbilityImpl { - - MergimTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(2)); - this.addTarget(new TargetOpponent()); - } - - MergimTriggeredAbility(final MergimTriggeredAbility ability) { - super(ability); - } - - @Override - public MergimTriggeredAbility copy() { - return new MergimTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DISCARDED_CARD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { - this.getTargets().get(0).add(event.getPlayerId(), game); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an opponent discards a card, {this} deals 2 damage to that player."; - } -} \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java b/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java index 866245a65e4..f922f325ee7 100644 --- a/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java @@ -6,10 +6,11 @@ package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; +import mage.target.targetpointer.FixedTarget; /** * @@ -17,12 +18,20 @@ import mage.game.events.GameEvent.EventType; */ public class DiscardsACardOpponentTriggeredAbility extends TriggeredAbilityImpl { + private SetTargetPointer setTargetPointer; + public DiscardsACardOpponentTriggeredAbility(Effect effect, Boolean isOptional) { + this(effect, isOptional, SetTargetPointer.NONE); + } + + public DiscardsACardOpponentTriggeredAbility(Effect effect, Boolean isOptional, SetTargetPointer setTargetPointer) { super(Zone.BATTLEFIELD, effect, isOptional); + this.setTargetPointer = setTargetPointer; } public DiscardsACardOpponentTriggeredAbility(final DiscardsACardOpponentTriggeredAbility ability) { super(ability); + this.setTargetPointer = ability.setTargetPointer; } @Override @@ -37,7 +46,19 @@ public class DiscardsACardOpponentTriggeredAbility extends TriggeredAbilityImpl @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getOpponents(controllerId).contains(event.getPlayerId()); + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { + switch (setTargetPointer) { + case PLAYER: + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } + break; + default: + throw new UnsupportedOperationException(setTargetPointer.toString() + " not supported for this ability."); + } + return true; + } + return false; } @Override From b6eab4977ae82abd36f17e0dcf341ccbce0103b5 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Aug 2015 22:48:05 +0200 Subject: [PATCH 26/35] * Burning-Tree Shaman - Fixed target handling (using always the target from first time the ability triggered). --- .../src/mage/sets/guildpact/BurningTreeShaman.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java index 16d2340db19..0405ecd60a3 100644 --- a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java +++ b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java @@ -30,6 +30,7 @@ package mage.sets.guildpact; import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.constants.AbilityType; @@ -41,6 +42,7 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; /** * @@ -56,6 +58,8 @@ public class BurningTreeShaman extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(4); + + // Whenever a player activates an ability that isn't a mana ability, Burning-Tree Shaman deals 1 damage to that player. this.addAbility(new BurningTreeShamanTriggeredAbility()); } @@ -72,7 +76,7 @@ public class BurningTreeShaman extends CardImpl { class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { BurningTreeShamanTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); + super(Zone.BATTLEFIELD, new DamageTargetEffect(1, false, "that player")); this.addTarget(new TargetPlayer()); } @@ -94,7 +98,9 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) { - this.getTargets().get(0).add(event.getPlayerId(), game); + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } return true; } return false; From 8b02e6805ff716ad29224fc628c05f26c27ef7c2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Aug 2015 23:23:31 +0200 Subject: [PATCH 27/35] * Fixed wrong card numbers of some Fifthedition cards. Smoke, Stasis, SeaSerpent, Tsunami, Spirit Link, Mind Warp, Recall, Flare. --- .../src/mage/sets/fifthedition/Flare.java | 4 +-- .../src/mage/sets/fifthedition/MindWarp.java | 2 +- .../src/mage/sets/fifthedition/Recall.java | 2 +- .../mage/sets/fifthedition/SeaSerpent.java | 6 ++-- .../src/mage/sets/fifthedition/Smoke.java | 6 ++-- .../mage/sets/fifthedition/SpiritLink.java | 2 +- .../src/mage/sets/fifthedition/Stasis.java | 15 ++++++---- .../src/mage/sets/fifthedition/Tsunami.java | 2 +- Utils/mtg-cards-data.txt | 30 +++++++++---------- 9 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fifthedition/Flare.java b/Mage.Sets/src/mage/sets/fifthedition/Flare.java index 9a11b49dbd9..5531722534a 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Flare.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Flare.java @@ -44,13 +44,13 @@ import mage.target.common.TargetCreatureOrPlayer; public class Flare extends CardImpl { public Flare(UUID ownerId) { - super(ownerId, 11, "Flare", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + super(ownerId, 230, "Flare", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); this.expansionSetCode = "5ED"; // Flare deals 1 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(1)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - + // Draw a card at the beginning of the next turn's upkeep. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); } diff --git a/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java b/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java index f42c1a10399..b0226a30880 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java +++ b/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java @@ -37,7 +37,7 @@ public class MindWarp extends mage.sets.iceage.MindWarp { public MindWarp(UUID ownerId) { super(ownerId); - this.cardNumber = 14; + this.cardNumber = 39; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Recall.java b/Mage.Sets/src/mage/sets/fifthedition/Recall.java index ff5e44b188d..605470d167b 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Recall.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Recall.java @@ -50,7 +50,7 @@ import mage.target.common.TargetCardInYourGraveyard; public class Recall extends CardImpl { public Recall(UUID ownerId) { - super(ownerId, 93, "Recall", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); + super(ownerId, 115, "Recall", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); this.expansionSetCode = "5ED"; // Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. diff --git a/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java b/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java index 1a040174683..90620ebf689 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java +++ b/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java @@ -31,14 +31,14 @@ import java.util.UUID; /** * - * @author KholdFuzion - + * @author KholdFuzion + * */ public class SeaSerpent extends mage.sets.limitedalpha.SeaSerpent { public SeaSerpent(UUID ownerId) { super(ownerId); - this.cardNumber = 52; + this.cardNumber = 118; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Smoke.java b/Mage.Sets/src/mage/sets/fifthedition/Smoke.java index 84d2d546f23..c2b8f811122 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Smoke.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Smoke.java @@ -31,14 +31,14 @@ import java.util.UUID; /** * - * @author KholdFuzion - + * @author KholdFuzion + * */ public class Smoke extends mage.sets.limitedalpha.Smoke { public Smoke(UUID ownerId) { super(ownerId); - this.cardNumber = 64; + this.cardNumber = 268; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java index 43087118a1e..b69812b8efb 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java +++ b/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java @@ -37,7 +37,7 @@ public class SpiritLink extends mage.sets.seventhedition.SpiritLink { public SpiritLink(UUID ownerId) { super(ownerId); - this.cardNumber = 288; + this.cardNumber = 340; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Stasis.java b/Mage.Sets/src/mage/sets/fifthedition/Stasis.java index 7d792b17ed4..4cd54133f3c 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Stasis.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Stasis.java @@ -28,8 +28,6 @@ package mage.sets.fifthedition; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -37,6 +35,12 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -48,10 +52,9 @@ import mage.players.Player; public class Stasis extends CardImpl { public Stasis(UUID ownerId) { - super(ownerId, 28, "Stasis", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + super(ownerId, 127, "Stasis", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "5ED"; - // Players skip their untap steps. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapStepEffect())); @@ -89,8 +92,8 @@ class SkipUntapStepEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - return event.getType() == GameEvent.EventType.UNTAP_STEP - && controller != null + return event.getType() == GameEvent.EventType.UNTAP_STEP + && controller != null && controller.getInRange().contains(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java b/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java index 7258385defc..935c3b513b7 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java @@ -37,7 +37,7 @@ public class Tsunami extends mage.sets.fourthedition.Tsunami { public Tsunami(UUID ownerId) { super(ownerId); - this.cardNumber = 52; + this.cardNumber = 196; this.expansionSetCode = "5ED"; } diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 23af435890d..c170305f4a4 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -4892,15 +4892,15 @@ Phantasmal Terrain|Fifth Edition|107|C|{U}{U}|Enchantment - Aura|||Enchant land$ Phantom Monster|Fifth Edition|108|U|{3}{U}|Creature - Illusion|3|3|Flying| Pirate Ship|Fifth Edition|109|R|{4}{U}|Creature - Human Pirate|4|3|Pirate Ship can't attack unless defending player controls an Island.${tap}: Pirate Ship deals 1 damage to target creature or player.$When you control no Islands, sacrifice Pirate Ship.| Broken Visage|Fifth Edition|11|R|{4}{B}|Instant|||Destroy target nonartifact attacking creature. It can't be regenerated. Put a black Spirit creature token with that creature's power and toughness onto the battlefield. Sacrifice the token at the beginning of the next end step.| -Flare|Fifth Edition|11|C|{2}{R}|Instant|||Flare deals 1 damage to target creature or player.$$Draw a card at the beginning of the next turn's upkeep.| Portent|Fifth Edition|110|C|{U}|Sorcery|||Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle his or her library.$Draw a card at the beginning of the next turn's upkeep.| Power Sink|Fifth Edition|111|U|{X}{U}|Instant|||Counter target spell unless its controller pays {X}. If he or she doesn't, that player taps all lands with mana abilities he or she controls and empties his or her mana pool.| Prodigal Sorcerer|Fifth Edition|112|C|{2}{U}|Creature - Human Wizard|1|1|{tap}: Prodigal Sorcerer deals 1 damage to target creature or player.| Psychic Venom|Fifth Edition|113|C|{1}{U}|Enchantment - Aura|||Enchant land$Whenever enchanted land becomes tapped, Psychic Venom deals 2 damage to that land's controller.| -Venom|Fifth Edition|113|C|{1}{G}{G}|Enchantment - Aura|||Enchant creature$Whenever enchanted creature blocks or becomes blocked by a non-Wall creature, destroy the other creature at end of combat.| Ray of Command|Fifth Edition|114|C|{3}{U}|Instant|||Untap target creature an opponent controls and gain control of it until end of turn. That creature gains haste until end of turn. When you lose control of the creature, tap it.| +Recall|Fifth Edition|115|R|{X}{X}{U}|Sorcery|||Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. Exile Recall.| Reef Pirates|Fifth Edition|116|C|{1}{U}{U}|Creature - Zombie Pirate|2|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.| Remove Soul|Fifth Edition|117|C|{1}{U}|Instant|||Counter target creature spell.| +Sea Serpent|Fifth Edition|118|C|{5}{U}|Creature - Serpent|5|5|Sea Serpent can't attack unless defending player controls an Island.$$When you control no Islands, sacrifice Sea Serpent.| Sea Spirit|Fifth Edition|119|U|{4}{U}|Creature - Elemental Spirit|2|3|{U}: Sea Spirit gets +1/+0 until end of turn.| Carrion Ants|Fifth Edition|12|U|{2}{B}{B}|Creature - Insect|0|1|{1}: Carrion Ants gets +1/+1 until end of turn.| Sea Sprite|Fifth Edition|120|U|{1}{U}|Creature - Faerie|1|1|Flying, protection from red| @@ -4910,6 +4910,7 @@ Sibilant Spirit|Fifth Edition|123|R|{5}{U}|Creature - Spirit|5|6|Flying$Whenever Sleight of Mind|Fifth Edition|124|R|{U}|Instant|||Change the text of target spell or permanent by replacing all instances of one color word with another. (For example, you may change "target black spell" to "target blue spell." This effect lasts indefinitely.)| Soul Barrier|Fifth Edition|125|C|{2}{U}|Enchantment|||Whenever an opponent casts a creature spell, Soul Barrier deals 2 damage to that player unless he or she pays {2}.| Spell Blast|Fifth Edition|126|C|{X}{U}|Instant|||Counter target spell with converted mana cost X.| +Stasis|Fifth Edition|127|R|{1}{U}|Enchantment|||Players skip their untap steps.$$At the beginning of your upkeep, sacrifice Stasis unless you pay {U}.| Steal Artifact|Fifth Edition|128|U|{2}{U}{U}|Enchantment - Aura|||Enchant artifact$You control enchanted artifact.| Time Elemental|Fifth Edition|129|R|{2}{U}|Creature - Elemental|0|2|When Time Elemental attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you.${2}{U}{U}, {tap}: Return target permanent that isn't enchanted to its owner's hand.| Cloak of Confusion|Fifth Edition|13|C|{1}{B}|Enchantment - Aura|||Enchant creature you control$Whenever enchanted creature attacks and isn't blocked, you may have it assign no combat damage this turn. If you do, defending player discards a card at random.| @@ -4924,7 +4925,6 @@ Zephyr Falcon|Fifth Edition|137|C|{1}{U}|Creature - Bird|1|1|Flying, vigilance| Zur's Weirding|Fifth Edition|138|R|{3}{U}|Enchantment|||Players play with their hands revealed.$If a player would draw a card, he or she reveals it instead. Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard. Otherwise, that player draws a card.| An-Havva Constable|Fifth Edition|139|R|{1}{G}{G}|Creature - Human|2|1+*|An-Havva Constable's toughness is equal to 1 plus the number of green creatures on the battlefield.| Cursed Land|Fifth Edition|14|U|{2}{B}{B}|Enchantment - Aura|||Enchant land$At the beginning of the upkeep of enchanted land's controller, Cursed Land deals 1 damage to that player.| -Mind Warp|Fifth Edition|14|U|{X}{3}{B}|Sorcery|||Look at target player's hand and choose X cards from it. That player discards those cards.| Aspect of Wolf|Fifth Edition|140|R|{1}{G}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +X/+Y, where X is half the number of Forests you control, rounded down, and Y is half the number of Forests you control, rounded up.| Aurochs|Fifth Edition|141|C|{3}{G}|Creature - Aurochs|2|3|Trample$Whenever Aurochs attacks, it gets +1/+0 until end of turn for each other attacking Aurochs.| Birds of Paradise|Fifth Edition|142|R|{G}|Creature - Bird|0|1|Flying${tap}: Add one mana of any color to your mana pool.| @@ -4960,6 +4960,7 @@ Killer Bees|Fifth Edition|169|U|{1}{G}{G}|Creature - Insect|0|1|Flying${G}: Kill Derelor|Fifth Edition|17|R|{3}{B}|Creature - Thrull|4|4|Black spells you cast cost {B} more to cast.| Ley Druid|Fifth Edition|170|C|{2}{G}|Creature - Human Druid|1|1|{tap}: Untap target land.| Lhurgoyf|Fifth Edition|171|R|{2}{G}{G}|Creature - Lhurgoyf|*|1+*|Lhurgoyf's power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1.| +Lifeforce|Fifth Edition|172|U|{G}{G}|Enchantment|||{G}{G}: Counter target black spell.| Living Artifact|Fifth Edition|173|R|{G}|Enchantment - Aura|||Enchant artifact$Whenever you're dealt damage, put that many vitality counters on Living Artifact.$At the beginning of your upkeep, you may remove a vitality counter from Living Artifact. If you do, you gain 1 life.| Living Lands|Fifth Edition|174|R|{3}{G}|Enchantment|||All Forests are 1/1 creatures that are still lands.| Llanowar Elves|Fifth Edition|175|C|{G}|Creature - Elf Druid|1|1|{tap}: Add {G} to your mana pool.| @@ -4978,6 +4979,7 @@ Scavenger Folk|Fifth Edition|185|C|{G}|Creature - Human|1|1|{G}, {tap}, Sacrific Scryb Sprites|Fifth Edition|186|C|{G}|Creature - Faerie|1|1|Flying| Shanodin Dryads|Fifth Edition|187|C|{G}|Creature - Nymph Dryad|1|1|Forestwalk| Shrink|Fifth Edition|188|C|{G}|Instant|||Target creature gets -5/-0 until end of turn.| +Stampede|Fifth Edition|189|R|{1}{G}{G}|Instant|||Attacking creatures get +1/+0 and gain trample until end of turn.| Drudge Skeletons|Fifth Edition|19|C|{1}{B}|Creature - Skeleton|1|1|{B}: Regenerate Drudge Skeletons. (The next time this creature would be destroyed this turn, it isn't. Instead tap it, remove all damage from it, and remove it from combat.)| Stream of Life|Fifth Edition|190|C|{X}{G}|Sorcery|||Target player gains X life.| Sylvan Library|Fifth Edition|191|R|{1}{G}|Enchantment|||At the beginning of your draw step, you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library.| @@ -4985,8 +4987,9 @@ Tarpan|Fifth Edition|192|C|{G}|Creature - Horse|1|1|When Tarpan dies, you gain 1 Thicket Basilisk|Fifth Edition|193|U|{3}{G}{G}|Creature - Basilisk|2|4|Whenever Thicket Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat.| Titania's Song|Fifth Edition|194|R|{3}{G}|Enchantment|||Each noncreature artifact loses all abilities and becomes an artifact creature with power and toughness each equal to its converted mana cost. If Titania's Song leaves the battlefield, this effect continues until end of turn.| Tranquility|Fifth Edition|195|C|{2}{G}|Sorcery|||Destroy all enchantments.| -Truce|Fifth Edition|195|R|{2}{W}|Instant|||Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life.| +Tsunami|Fifth Edition|196|U|{3}{G}|Sorcery|||Destroy all Islands.| Untamed Wilds|Fifth Edition|197|U|{2}{G}|Sorcery|||Search your library for a basic land card and put that card onto the battlefield. Then shuffle your library.| +Venom|Fifth Edition|198|C|{1}{G}{G}|Enchantment - Aura|||Enchant creature$Whenever enchanted creature blocks or becomes blocked by a non-Wall creature, destroy the other creature at end of combat.| Verduran Enchantress|Fifth Edition|199|R|{1}{G}{G}|Creature - Human Druid|0|2|Whenever you cast an enchantment spell, you may draw a card.| Animate Dead|Fifth Edition|2|U|{1}{B}|Enchantment - Aura|||Enchant creature card in a graveyard$When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.$Enchanted creature gets -1/-0.| Erg Raiders|Fifth Edition|20|C|{1}{B}|Creature - Human Warrior|2|3|At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn.| @@ -5023,6 +5026,7 @@ Fireball|Fifth Edition|227|C|{X}{R}|Sorcery|||Fireball deals X damage divided ev Firebreathing|Fifth Edition|228|C|{R}|Enchantment - Aura|||Enchant creature${R}: Enchanted creature gets +1/+0 until end of turn.| Flame Spirit|Fifth Edition|229|U|{4}{R}|Creature - Elemental Spirit|2|3|{R}: Flame Spirit gets +1/+0 until end of turn.| Fallen Angel|Fifth Edition|23|U|{3}{B}{B}|Creature - Angel|3|3|Flying$Sacrifice a creature: Fallen Angel gets +2/+1 until end of turn.| +Flare|Fifth Edition|230|C|{2}{R}|Instant|||Flare deals 1 damage to target creature or player.$$Draw a card at the beginning of the next turn's upkeep.| Flashfires|Fifth Edition|231|U|{3}{R}|Sorcery|||Destroy all Plains.| Game of Chaos|Fifth Edition|232|R|{R}{R}{R}|Sorcery|||Flip a coin. If you win the flip, you gain 1 life and target opponent loses 1 life, and you decide whether to flip again. If you lose the flip, you lose 1 life and that opponent gains 1 life, and that player decides whether to flip again. Double the life stakes with each flip.| Giant Strength|Fifth Edition|233|C|{R}{R}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+2.| @@ -5034,7 +5038,6 @@ Goblin Warrens|Fifth Edition|238|R|{2}{R}|Enchantment|||{2}{R}, Sacrifice two Go The Wretched|Fifth Edition|239|R|{3}{B}{B}|Creature - Demon|2|5|At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched.| Hill Giant|Fifth Edition|239|C|{3}{R}|Creature - Giant|3|3|| Fear|Fifth Edition|24|C|{B}{B}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Enchanted creature has fear. (It can't be blocked except by artifact creatures and/or black creatures.)| -Stampede|Fifth Edition|24|R|{1}{G}{G}|Instant|||Attacking creatures get +1/+0 and gain trample until end of turn.| Hurloon Minotaur|Fifth Edition|240|C|{1}{R}{R}|Creature - Minotaur|2|3|| Imposing Visage|Fifth Edition|241|C|{R}|Enchantment - Aura|||Enchant creature$Enchanted creature can't be blocked except by two or more creatures.| Incinerate|Fifth Edition|242|C|{1}{R}|Instant|||Incinerate deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn.| @@ -5065,8 +5068,11 @@ Sabretooth Tiger|Fifth Edition|264|C|{2}{R}|Creature - Cat|2|1|First strike| Shatter|Fifth Edition|265|C|{1}{R}|Instant|||Destroy target artifact.| Shatterstorm|Fifth Edition|266|U|{2}{R}{R}|Sorcery|||Destroy all artifacts. They can't be regenerated.| Shivan Dragon|Fifth Edition|267|R|{4}{R}{R}|Creature - Dragon|5|5|Flying${R}: Shivan Dragon gets +1/+0 until end of turn.| +Smoke|Fifth Edition|268|R|{R}{R}|Enchantment|||Players can't untap more than one creature during their untap steps.| Stone Giant|Fifth Edition|269|U|{2}{R}{R}|Creature - Giant|3|4|{tap}: Target creature you control with toughness less than Stone Giant's power gains flying until end of turn. Destroy that creature at the beginning of the next end step.| +Gloom|Fifth Edition|27|U|{2}{B}|Enchantment|||White spells cost {3} more to cast.$Activated abilities of white enchantments cost {3} more to activate.| Stone Rain|Fifth Edition|270|C|{2}{R}|Sorcery|||Destroy target land.| +Stone Spirit|Fifth Edition|271|U|{4}{R}|Creature - Elemental Spirit|4|3|Stone Spirit can't be blocked by creatures with flying.| The Brute|Fifth Edition|272|C|{1}{R}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+0.${R}{R}{R}: Regenerate enchanted creature.| Wall of Fire|Fifth Edition|273|U|{1}{R}{R}|Creature - Wall|0|5|Defender (This creature can't attack.)${R}: Wall of Fire gets +1/+0 until end of turn.| Wall of Stone|Fifth Edition|274|U|{1}{R}{R}|Creature - Wall|0|8|Defender (This creature can't attack.)| @@ -5076,7 +5082,6 @@ Abbey Gargoyles|Fifth Edition|277|U|{2}{W}{W}{W}|Creature - Gargoyle|3|4|Flying, Akron Legionnaire|Fifth Edition|278|R|{6}{W}{W}|Creature - Giant Soldier|8|4|Except for creatures named Akron Legionnaire and artifact creatures, creatures you control can't attack.| Alabaster Potion|Fifth Edition|279|C|{X}{W}{W}|Instant|||Choose one - Target player gains X life; or prevent the next X damage that would be dealt to target creature or player this turn.| Greater Werewolf|Fifth Edition|28|U|{4}{B}|Creature - Werewolf|2|4|At end of combat, put a -0/-2 counter on each creature blocking or blocked by Greater Werewolf.| -Stasis|Fifth Edition|28|R|{1}{U}|Enchantment|||Players skip their untap steps.$$At the beginning of your upkeep, sacrifice Stasis unless you pay {U}.| Angry Mob|Fifth Edition|280|U|{2}{W}{W}|Creature - Human|2+*|2+*|Trample$As long as it's your turn, Angry Mob's power and toughness are each equal to 2 plus the number of Swamps your opponents control. As long as it's not your turn, Angry Mob's power and toughness are each 2.| Animate Wall|Fifth Edition|281|R|{W}|Enchantment - Aura|||Enchant Wall$Enchanted Wall can attack as though it didn't have defender.| Arenson's Aura|Fifth Edition|282|U|{2}{W}|Enchantment|||{W}, Sacrifice an enchantment: Destroy target enchantment.$${3}{U}{U}: Counter target enchantment spell.| @@ -5086,7 +5091,6 @@ Aysen Bureaucrats|Fifth Edition|285|C|{1}{W}|Creature - Human Advisor|1|1|{tap}: Benalish Hero|Fifth Edition|286|C|{W}|Creature - Human Soldier|1|1|Banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)| Blessed Wine|Fifth Edition|287|C|{1}{W}|Instant|||You gain 1 life.$Draw a card at the beginning of the next turn's upkeep.| Blinking Spirit|Fifth Edition|288|R|{3}{W}|Creature - Spirit|2|2|{0}: Return Blinking Spirit to its owner's hand.| -Spirit Link|Fifth Edition|288|U|{W}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Whenever enchanted creature deals damage, you gain that much life.| Brainwash|Fifth Edition|289|C|{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack unless its controller pays {3}.| Hecatomb|Fifth Edition|29|R|{1}{B}{B}|Enchantment|||When Hecatomb enters the battlefield, sacrifice Hecatomb unless you sacrifice four creatures.$Tap an untapped Swamp you control: Hecatomb deals 1 damage to target creature or player.| Caribou Range|Fifth Edition|290|R|{2}{W}{W}|Enchantment - Aura|||Enchant land you control$Enchanted land has "{W}{W}, {tap}: Put a 0/1 white Caribou creature token onto the battlefield."$Sacrifice a Caribou token: You gain 1 life.| @@ -5142,6 +5146,8 @@ Serra Bestiary|Fifth Edition|336|U|{W}{W}|Enchantment - Aura|||Enchant creature$ Serra Paladin|Fifth Edition|337|U|{2}{W}{W}|Creature - Human Knight|2|2|{tap}: Prevent the next 1 damage that would be dealt to target creature or player this turn.${1}{W}{W}, {tap}: Target creature gains vigilance until end of turn.| Shield Wall|Fifth Edition|339|C|{1}{W}|Instant|||Creatures you control get +0/+2 until end of turn.| Krovikan Fetish|Fifth Edition|34|C|{2}{B}|Enchantment - Aura|||Enchant creature$When Krovikan Fetish enters the battlefield, draw a card at the beginning of the next turn's upkeep.$Enchanted creature gets +1/+1.| +Spirit Link|Fifth Edition|340|U|{W}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Whenever enchanted creature deals damage, you gain that much life.| +Truce|Fifth Edition|341|R|{2}{W}|Instant|||Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life.| Tundra Wolves|Fifth Edition|342|C|{W}|Creature - Wolf|1|1|First strike (This creature deals combat damage before creatures without first strike.)| Wall of Swords|Fifth Edition|343|U|{3}{W}|Creature - Wall|3|5|Defender, flying (This creature can't attack, and it can block creatures with flying.)| White Knight|Fifth Edition|344|U|{W}{W}|Creature - Human Knight|2|2|First strike (This creature deals combat damage before creatures without first strike.)$Protection from black (This creature can't be blocked, targeted, dealt damage, or enchanted by anything black.)| @@ -5194,6 +5200,7 @@ Joven's Tools|Fifth Edition|386|U|{6}|Artifact|||{4}, {tap}: Target creature can Library of Leng|Fifth Edition|387|U|{1}|Artifact|||You have no maximum hand size.$If an effect causes you to discard a card, discard it, but you may put it on top of your library instead of into your graveyard.| Mana Vault|Fifth Edition|388|R|{1}|Artifact|||Mana Vault doesn't untap during your untap step.$At the beginning of your upkeep, you may pay {4}. If you do, untap Mana Vault.$At the beginning of your draw step, if Mana Vault is tapped, it deals 1 damage to you.${tap}: Add {3} to your mana pool.| Meekstone|Fifth Edition|389|R|{1}|Artifact|||Creatures with power 3 or greater don't untap during their controllers' untap steps.| +Mind Warp|Fifth Edition|39|U|{X}{3}{B}|Sorcery|||Look at target player's hand and choose X cards from it. That player discards those cards.| Millstone|Fifth Edition|390|R|{2}|Artifact|||{2}, {tap}: Target player puts the top two cards of his or her library into his or her graveyard.| Nevinyrral's Disk|Fifth Edition|391|R|{4}|Artifact|||Nevinyrral's Disk enters the battlefield tapped.${1}, {tap}: Destroy all artifacts, creatures, and enchantments.| Obelisk of Undoing|Fifth Edition|392|R|{1}|Artifact|||{6}, {tap}: Return target permanent you both own and control to your hand.| @@ -5202,6 +5209,7 @@ Pentagram of the Ages|Fifth Edition|394|R|{4}|Artifact|||{4}, {tap}: The next ti Primal Clay|Fifth Edition|395|R|{4}|Artifact Creature - Shapeshifter|*|*|As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types. (A creature with defender can't attack.)| Rod of Ruin|Fifth Edition|396|U|{4}|Artifact|||{3}, {tap}: Rod of Ruin deals 1 damage to target creature or player.| Serpent Generator|Fifth Edition|397|R|{6}|Artifact|||{4}, {tap}: Put a 1/1 colorless Snake artifact creature token onto the battlefield. It has "Whenever this creature deals damage to a player, that player gets a poison counter." (A player with ten or more poison counters loses the game.)| +Shapeshifter|Fifth Edition|398|U|{6}|Artifact Creature - Shapeshifter|*|7-*|As Shapeshifter enters the battlefield, choose a number between 0 and 7.$At the beginning of your upkeep, you may choose a number between 0 and 7.$Shapeshifter's power is equal to the last chosen number and its toughness is equal to 7 minus that number.| Skull Catapult|Fifth Edition|399|U|{4}|Artifact|||{1}, {tap}, Sacrifice a creature: Skull Catapult deals 2 damage to target creature or player.| Bad Moon|Fifth Edition|4|R|{1}{B}|Enchantment|||Black creatures get +1/+1.| Shield Bearer|Fifth Edition|4|C|{1}{W}|Creature - Human Soldier|0|3|Banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)| @@ -5264,14 +5272,11 @@ Nether Shadow|Fifth Edition|45|R|{B}{B}|Creature - Spirit|1|1|Haste$At the begin Nightmare|Fifth Edition|46|R|{5}{B}|Creature - Nightmare Horse|*|*|Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.| Paralyze|Fifth Edition|47|C|{B}|Enchantment - Aura|||Enchant creature$When Paralyze enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$At the beginning of the upkeep of enchanted creature's controller, that player may pay {4}. If he or she does, untap the creature.| Pestilence|Fifth Edition|48|C|{2}{B}{B}|Enchantment|||At the beginning of the end step, if no creatures are on the battlefield, sacrifice Pestilence.${B}: Pestilence deals 1 damage to each creature and each player.| -Gloom|Fifth Edition|49|U|{2}{B}|Enchantment|||White spells cost {3} more to cast.$Activated abilities of white enchantments cost {3} more to activate.| Pit Scorpion|Fifth Edition|49|C|{2}{B}|Creature - Scorpion|1|1|Whenever Pit Scorpion deals damage to a player, that player gets a poison counter. (A player with ten or more poison counters loses the game.)| Black Knight|Fifth Edition|5|U|{B}{B}|Creature - Human Knight|2|2|First strike (This creature deals combat damage before creatures without first strike.)$Protection from white (This creature can't be blocked, targeted, dealt damage, or enchanted by anything white.)| Plague Rats|Fifth Edition|50|C|{2}{B}|Creature - Rat|*|*|Plague Rats's power and toughness are each equal to the number of creatures named Plague Rats on the battlefield.| Pox|Fifth Edition|51|R|{B}{B}{B}|Sorcery|||Each player loses a third of his or her life, then discards a third of the cards in his or her hand, then sacrifices a third of the creatures he or she controls, then sacrifices a third of the lands he or she controls. Round up each time.| Rag Man|Fifth Edition|52|R|{2}{B}{B}|Creature - Human Minion|2|1|{B}{B}{B}, {tap}: Target opponent reveals his or her hand and discards a creature card at random. Activate this ability only during your turn.| -Sea Serpent|Fifth Edition|52|C|{5}{U}|Creature - Serpent|5|5|Sea Serpent can't attack unless defending player controls an Island.$$When you control no Islands, sacrifice Sea Serpent.| -Tsunami|Fifth Edition|52|U|{3}{G}|Sorcery|||Destroy all Islands.| Raise Dead|Fifth Edition|53|C|{B}|Sorcery|||Return target creature card from your graveyard to your hand.| Scathe Zombies|Fifth Edition|54|C|{2}{B}|Creature - Zombie|2|2|| Sengir Autocrat|Fifth Edition|55|R|{3}{B}|Creature - Human|2|2|When Sengir Autocrat enters the battlefield, put three 0/1 black Serf creature tokens onto the battlefield.$When Sengir Autocrat leaves the battlefield, exile all Serf tokens.| @@ -5282,12 +5287,9 @@ Blight|Fifth Edition|6|U|{B}{B}|Enchantment - Aura|||Enchant land$When enchanted Justice|Fifth Edition|6|U|{2}{W}{W}|Enchantment|||At the beginning of your upkeep, sacrifice Justice unless you pay {W}{W}.$$Whenever a red creature or spell deals damage, Justice deals that much damage to that creature's or spell's controller.| Thrull Retainer|Fifth Edition|60|U|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1.$Sacrifice Thrull Retainer: Regenerate enchanted creature.| Torture|Fifth Edition|61|C|{B}|Enchantment - Aura|||Enchant creature${1}{B}: Put a -1/-1 counter on enchanted creature.| -Stone Spirit|Fifth Edition|61|U|{4}{R}|Creature - Elemental Spirit|4|3|Stone Spirit can't be blocked by creatures with flying.| -Shapeshifter|Fifth Edition|62|U|{6}|Artifact Creature - Shapeshifter|*|7-*|As Shapeshifter enters the battlefield, choose a number between 0 and 7.$At the beginning of your upkeep, you may choose a number between 0 and 7.$Shapeshifter's power is equal to the last chosen number and its toughness is equal to 7 minus that number.| Touch of Death|Fifth Edition|62|C|{2}{B}|Sorcery|||Touch of Death deals 1 damage to target player. You gain 1 life.$$Draw a card at the beginning of the next turn's upkeep.| Unholy Strength|Fifth Edition|63|C|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+1.| Vampire Bats|Fifth Edition|64|C|{B}|Creature - Bat|0|1|Flying (This creature can't be blocked except by creatures with flying or reach.)${B}: Vampire Bats gets +1/+0 until end of turn. Activate this ability no more than twice each turn.| -Smoke|Fifth Edition|64|R|{R}{R}|Enchantment|||Players can't untap more than one creature during their untap steps.| Wall of Bone|Fifth Edition|65|U|{2}{B}|Creature - Skeleton Wall|1|4|Defender (This creature can't attack.)${B}: Regenerate Wall of Bone. (The next time this creature would be destroyed this turn, it isn't. Instead tap it, remove all damage from it, and remove it from combat.)| Warp Artifact|Fifth Edition|66|R|{B}{B}|Enchantment - Aura|||Enchant artifact$At the beginning of the upkeep of enchanted artifact's controller, Warp Artifact deals 1 damage to that player.| Weakness|Fifth Edition|67|C|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -2/-1.| @@ -5317,11 +5319,9 @@ Force Spike|Fifth Edition|88|C|{U}|Instant|||Counter target spell unless its con Forget|Fifth Edition|89|R|{U}{U}|Sorcery|||Target player discards two cards, then draws as many cards as he or she discarded this way.| Bog Wraith|Fifth Edition|9|U|{3}{B}|Creature - Wraith|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| Gaseous Form|Fifth Edition|90|C|{2}{U}|Enchantment - Aura|||Enchant creature$Prevent all combat damage that would be dealt to and dealt by enchanted creature.| -Lifeforce|Fifth Edition|90|U|{G}{G}|Enchantment|||{G}{G}: Counter target black spell.| Glacial Wall|Fifth Edition|91|U|{2}{U}|Creature - Wall|0|7|Defender (This creature can't attack.)| Homarid Warrior|Fifth Edition|92|C|{4}{U}|Creature - Homarid Warrior|3|3|{U}: Homarid Warrior gains shroud until end of turn and doesn't untap during your next untap step. Tap Homarid Warrior. (A permanent with shroud can't be the target of spells or abilities.)| Hurkyl's Recall|Fifth Edition|93|R|{1}{U}|Instant|||Return all artifacts target player owns to his or her hand.| -Recall|Fifth Edition|93|R|{X}{X}{U}|Sorcery|||Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. Exile Recall.| Hydroblast|Fifth Edition|94|U|{U}|Instant|||Choose one - Counter target spell if it's red; or destroy target permanent if it's red.| Juxtapose|Fifth Edition|95|R|{3}{U}|Sorcery|||You and target player exchange control of the creature you each control with the highest converted mana cost. Then exchange control of artifacts the same way. If two or more permanents a player controls are tied for highest cost, their controller chooses one of them.| Krovikan Sorcerer|Fifth Edition|96|C|{2}{U}|Creature - Human Wizard|1|1|{tap}, Discard a nonblack card: Draw a card.${tap}, Discard a black card: Draw two cards, then discard one of them.| From c024318489024805750f9a83bb3267b111fd362d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 24 Aug 2015 01:53:24 +0200 Subject: [PATCH 28/35] * Kira, Great Glass-Spinner - Some fixes to the triggered ability that controlled creatures gain. --- .../KiraGreatGlassSpinner.java | 91 ++++++++++++++----- 1 file changed, 67 insertions(+), 24 deletions(-) diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java index abdfe0da0fe..3c6753f007e 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java @@ -31,8 +31,10 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import mage.MageInt; +import mage.MageObjectReference; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.FlyingAbility; @@ -40,12 +42,15 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.WatcherScope; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.target.TargetStackObject; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.watchers.Watcher; /** * @@ -59,7 +64,6 @@ public class KiraGreatGlassSpinner extends CardImpl { this.subtype.add("Spirit"); this.supertype.add("Legendary"); - this.power = new MageInt(2); this.toughness = new MageInt(2); @@ -67,7 +71,10 @@ public class KiraGreatGlassSpinner extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Creatures you control have "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability." - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures you control")))); + Effect effect = new CounterTargetEffect(); + effect.setText("counter that spell or ability"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(effect), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures you control"))), + new CreatureWasTargetedThisTurnWatcher()); } @@ -80,21 +87,15 @@ public class KiraGreatGlassSpinner extends CardImpl { return new KiraGreatGlassSpinner(this); } } -// TODO: -// not perfectly implemented. It doesnt't handles if a creature was already targeted the turn Kira comes into play. -// Maybe it's better to implement it with a watcher class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { - protected Map turnUsed = new HashMap<>(); - - public KiraGreatGlassSpinnerAbility() { - super(Zone.BATTLEFIELD, new CounterTargetEffect(), false); + public KiraGreatGlassSpinnerAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); } public KiraGreatGlassSpinnerAbility(final KiraGreatGlassSpinnerAbility ability) { super(ability); - turnUsed = ability.turnUsed; } @Override @@ -110,20 +111,15 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { - Integer turn = turnUsed.get(event.getTargetId()); - if (turn == null || turn < game.getTurnNum()) { - this.getTargets().clear(); - TargetStackObject target = new TargetStackObject(); - target.add(event.getSourceId(), game); - this.addTarget(target); - if (turnUsed.containsKey(event.getTargetId())) { - turnUsed.remove(event.getTargetId()); - turnUsed.put(event.getTargetId(), game.getTurnNum()); - } else { - turnUsed.put(event.getTargetId(), game.getTurnNum()); + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.CREATURE)) { + CreatureWasTargetedThisTurnWatcher watcher = (CreatureWasTargetedThisTurnWatcher) game.getState().getWatchers().get("CreatureWasTargetedThisTurn"); + if (watcher != null && watcher.notMoreThanOnceTargetedThisTurn(permanent, game)) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + } + return true; } - - return true; } } return false; @@ -135,3 +131,50 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { } } + +class CreatureWasTargetedThisTurnWatcher extends Watcher { + + private final Map creaturesTargeted = new HashMap<>(); + + public CreatureWasTargetedThisTurnWatcher() { + super("CreatureWasTargetedThisTurn", WatcherScope.GAME); + } + + public CreatureWasTargetedThisTurnWatcher(final CreatureWasTargetedThisTurnWatcher watcher) { + super(watcher); + this.creaturesTargeted.putAll(creaturesTargeted); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TARGETED) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.CREATURE)) { + MageObjectReference mor = new MageObjectReference(permanent, game); + int amount = 0; + if (creaturesTargeted.containsKey(mor)) { + amount = creaturesTargeted.get(mor); + } + creaturesTargeted.put(mor, ++amount); + } + } + } + + public boolean notMoreThanOnceTargetedThisTurn(Permanent creature, Game game) { + if (creaturesTargeted.containsKey(new MageObjectReference(creature, game))) { + return creaturesTargeted.get(new MageObjectReference(creature, game)) < 2; + } + return true; + } + + @Override + public void reset() { + super.reset(); + creaturesTargeted.clear(); + } + + @Override + public CreatureWasTargetedThisTurnWatcher copy() { + return new CreatureWasTargetedThisTurnWatcher(this); + } +} From 1868631a96d7c8599cf931d4a414221323ef40f3 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 24 Aug 2015 08:31:06 +0200 Subject: [PATCH 29/35] * Kira, Great Glass-Spinner - Some fixes to the triggered ability that controlled creatures gain. --- .../mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java index 3c6753f007e..1c2c466eeb1 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java @@ -112,7 +112,7 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { CreatureWasTargetedThisTurnWatcher watcher = (CreatureWasTargetedThisTurnWatcher) game.getState().getWatchers().get("CreatureWasTargetedThisTurn"); if (watcher != null && watcher.notMoreThanOnceTargetedThisTurn(permanent, game)) { for (Effect effect : getEffects()) { @@ -149,7 +149,7 @@ class CreatureWasTargetedThisTurnWatcher extends Watcher { public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.TARGETED) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { MageObjectReference mor = new MageObjectReference(permanent, game); int amount = 0; if (creaturesTargeted.containsKey(mor)) { From d157b38cddf4ce5eecba01cd5fd8c9a9cf83d49e Mon Sep 17 00:00:00 2001 From: BijanT Date: Mon, 24 Aug 2015 19:17:41 -0500 Subject: [PATCH 30/35] Implemented Card: Heroes Remembered --- .../sets/planarchaos/HeroesRemembered.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java diff --git a/Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java b/Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java new file mode 100644 index 00000000000..54d15e377e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java @@ -0,0 +1,33 @@ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +public class HeroesRemembered extends CardImpl{ + + public HeroesRemembered(UUID ownerId){ + super(ownerId, 7, "Heroes Remembered", Rarity.RARE, new CardType[] {CardType.SORCERY}, "{6}{W}{W}{W}"); + this.expansionSetCode = "PLC"; + + //You gain 20 life. + this.getSpellAbility().addEffect(new GainLifeEffect(20)); + //Suspend 10-{W} + this.addAbility(new SuspendAbility(10, new ManaCostsImpl("{W}"), this)); + } + + public HeroesRemembered(final HeroesRemembered card) { + super(card); + } + + @Override + public Card copy() { + return new HeroesRemembered(this); + } + +} From 61188dbdc3b4f495891bf415e51c4f9f79f18217 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 13:40:44 +0200 Subject: [PATCH 31/35] * Fixed a problem with rule text generation. Reworked rule text generation of landwalk abilities. --- .../src/mage/sets/fifthdawn/HelmOfKaldra.java | 10 +-- .../sets/journeyintonyx/ChariotOfVictory.java | 2 +- .../mage/sets/limitedalpha/ZombieMaster.java | 8 ++- .../mage/sets/magic2012/SwiftfootBoots.java | 24 +++++-- .../mage/sets/timespiral/TrompTheDomains.java | 4 +- .../mage/sets/timespiral/ViscidLemures.java | 10 ++- .../mage/sets/torment/ZombieTrailblazer.java | 10 +-- Mage/src/mage/abilities/AbilityImpl.java | 16 +++-- .../continuous/GainAbilityTargetEffect.java | 6 +- .../abilities/keyword/FirstStrikeAbility.java | 64 +++++++++-------- .../abilities/keyword/ForestwalkAbility.java | 15 ++-- .../mage/abilities/keyword/HasteAbility.java | 62 ++++++++--------- .../abilities/keyword/HexproofAbility.java | 7 +- .../abilities/keyword/IslandwalkAbility.java | 13 ++-- .../abilities/keyword/LandwalkAbility.java | 69 +++++++++++++++---- .../keyword/MountainwalkAbility.java | 15 ++-- .../abilities/keyword/PlainswalkAbility.java | 15 ++-- .../abilities/keyword/SwampwalkAbility.java | 21 +++--- .../abilities/keyword/TrampleAbility.java | 64 +++++++++-------- 19 files changed, 242 insertions(+), 193 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java b/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java index 2d6382fd5b3..754ae29be75 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java @@ -60,6 +60,7 @@ import mage.game.permanent.token.Token; * @author LevelX2 */ public class HelmOfKaldra extends CardImpl { + public static final FilterControlledArtifactPermanent filterHelm = new FilterControlledArtifactPermanent(); public static final FilterControlledArtifactPermanent filterShield = new FilterControlledArtifactPermanent(); public static final FilterControlledArtifactPermanent filterSword = new FilterControlledArtifactPermanent(); @@ -82,7 +83,7 @@ public class HelmOfKaldra extends CardImpl { effect.setText(", trample"); ability.addEffect(effect); effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); - effect.setText(" and haste"); + effect.setText("and haste"); ability.addEffect(effect); this.addAbility(ability); // {1}: If you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, put a legendary 4/4 colorless Avatar creature token named Kaldra onto the battlefield and attach those Equipment to it. @@ -108,7 +109,6 @@ public class HelmOfKaldra extends CardImpl { class HelmOfKaldraCondition implements Condition { - @Override public boolean apply(Game game, Ability source) { if (game.getBattlefield().count(HelmOfKaldra.filterHelm, source.getSourceId(), source.getControllerId(), game) < 1) { @@ -150,17 +150,17 @@ class HelmOfKaldraEffect extends OneShotEffect { Permanent kaldra = game.getPermanent(kaldraId); if (kaldra != null) { // Attach helm to the token - for (Permanent kaldrasHelm :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterHelm, source.getControllerId(), game)) { + for (Permanent kaldrasHelm : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterHelm, source.getControllerId(), game)) { kaldra.addAttachment(kaldrasHelm.getId(), game); break; } // Attach shield to the token - for (Permanent kaldrasShield :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) { + for (Permanent kaldrasShield : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) { kaldra.addAttachment(kaldrasShield.getId(), game); break; } // Attach sword to the token - for (Permanent kaldrasSword :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) { + for (Permanent kaldrasSword : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) { kaldra.addAttachment(kaldrasSword.getId(), game); break; } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java b/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java index 747069e6406..7959491202b 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java @@ -61,7 +61,7 @@ public class ChariotOfVictory extends CardImpl { effect.setText(", trample"); ability.addEffect(effect); effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); - effect.setText(" and haste"); + effect.setText("and haste"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java b/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java index f5cd33ec398..92b181a680f 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java @@ -51,7 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class ZombieMaster extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("Zombies"); + private static final FilterPermanent filter = new FilterPermanent("Zombie creatures"); static { filter.add(new SubtypePredicate("Zombie")); @@ -66,9 +66,11 @@ public class ZombieMaster extends CardImpl { this.toughness = new MageInt(3); // Other Zombie creatures have swampwalk. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new SwampwalkAbility(), Duration.WhileOnBattlefield, filter, true))); + Effect effect = new GainAbilityAllEffect(new SwampwalkAbility(), Duration.WhileOnBattlefield, filter, true); + effect.setText("Other Zombie creatures have swampwalk. (They can't be blocked as long as defending player controls a Swamp.)"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // Other Zombies have "{B}: Regenerate this permanent." - Effect effect = new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")), Duration.WhileOnBattlefield, filter, true); + effect = new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")), Duration.WhileOnBattlefield, filter, true); effect.setText("Other Zombies have \"{B}: Regenerate this permanent.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java b/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java index e47fb8f405e..c328b1ed5a4 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java +++ b/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java @@ -25,19 +25,23 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.*; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -45,17 +49,23 @@ import mage.cards.CardImpl; */ public class SwiftfootBoots extends CardImpl { - public SwiftfootBoots (UUID ownerId) { + public SwiftfootBoots(UUID ownerId) { super(ownerId, 219, "Swiftfoot Boots", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "M12"; this.subtype.add("Equipment"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); + + // Equipped creature has hexproof and haste. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT)); + Effect effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); + effect.setText("and haste"); + this.addAbility(ability); + + // Equip {1} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); } - public SwiftfootBoots (final SwiftfootBoots card) { + public SwiftfootBoots(final SwiftfootBoots card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java b/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java index 6fbd03506b2..3533d54b41a 100644 --- a/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java +++ b/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java @@ -38,7 +38,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; /** @@ -51,14 +50,13 @@ public class TrompTheDomains extends CardImpl { super(ownerId, 230, "Tromp the Domains", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{5}{G}"); this.expansionSetCode = "TSP"; - // Domain - Until end of turn, creatures you control gain trample and get +1/+1 for each basic land type among lands you control. Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("Domain - Until end of turn, creatures you control gain Trample"); this.getSpellAbility().addEffect(effect); DynamicValue domain = new DomainValue(); effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, new FilterCreaturePermanent(), false); - effect.setText(" and get +1/+1 for each basic land type among lands you control"); + effect.setText("and get +1/+1 for each basic land type among lands you control"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java b/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java index 892ce1a364f..47ed07fc566 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java +++ b/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java @@ -32,6 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.SwampwalkAbility; @@ -55,9 +56,12 @@ public class ViscidLemures extends CardImpl { this.toughness = new MageInt(3); // {0}: Viscid Lemures gets -1/-0 and gains swampwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn), new GenericManaCost(0)); - ability.addEffect(new BoostSourceEffect(-1, 0, Duration.EndOfTurn)); + Effect effect = new BoostSourceEffect(-1, 0, Duration.EndOfTurn); + effect.setText("{this} gets -1/-0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(0)); + effect = new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn); + effect.setText("and gains swampwalk until end of turn. (It can't be blocked as long as defending player controls a Swamp.)"); + ability.addEffect(effect); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java b/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java index afbb37a7d6d..67ae57e6c9b 100644 --- a/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java +++ b/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java @@ -53,7 +53,7 @@ import mage.target.common.TargetLandPermanent; * @author fireshoes */ public class ZombieTrailblazer extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an untapped Zombie you control"); static { @@ -70,14 +70,14 @@ public class ZombieTrailblazer extends CardImpl { this.toughness = new MageInt(2); // Tap an untapped Zombie you control: Target land becomes a Swamp until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Swamp"), new TapTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); - + // Tap an untapped Zombie you control: Target creature gains swampwalk until end of turn. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilityTargetEffect(new SwampwalkAbility(), Duration.EndOfTurn), new TapTargetCost(new TargetControlledPermanent(filter))); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new SwampwalkAbility(false), Duration.EndOfTurn), new TapTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index bc6ccd434b1..d9723850a2e 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -761,20 +761,24 @@ public abstract class AbilityImpl implements Ability { if (abilityWord != null) { sbRule.insert(0, new StringBuilder("").append(abilityWord.toString()).append(" — ")); } + String ruleStart = sbRule.toString(); String text = modes.getText(); + String rule; if (!text.isEmpty()) { - if (sbRule.length() > 1) { - String end = sbRule.substring(sbRule.length() - 2).trim(); + if (ruleStart.length() > 1) { + String end = ruleStart.substring(ruleStart.length() - 2).trim(); if (end.isEmpty() || end.equals(":") || end.equals(".")) { - sbRule.append(Character.toUpperCase(text.charAt(0))).append(text.substring(1)); + rule = ruleStart + Character.toUpperCase(text.charAt(0)) + text.substring(1); } else { - sbRule.append(text); + rule = ruleStart + text; } } else { - sbRule.append(text); + rule = ruleStart + text; } + } else { + rule = ruleStart; } - return sbRule.toString(); + return rule; } @Override diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java index 097da54a5dc..8117823221a 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java @@ -170,11 +170,11 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { sb.append(target.getTargetName()).append(" gains "); } + sb.append(ability.getRule()); if (durationPhaseStep != null) { sb.append(" until your next ").append(durationPhaseStep.toString().toLowerCase(Locale.ENGLISH)); - } - if (!duration.toString().isEmpty()) { - sb.append(ability.getRule()).append(" ").append(duration.toString()); + } else if (!duration.toString().isEmpty()) { + sb.append(" ").append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java b/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java index 7ef603879a6..c1485c345d3 100644 --- a/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java +++ b/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java @@ -1,38 +1,36 @@ /* -* 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. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { - private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); + private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "First strike"; + return "first strike"; } @Override @@ -64,4 +62,4 @@ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { return fINSTANCE; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java index a6f6d1545b1..d9759823acd 100644 --- a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,7 +36,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class ForestwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + private static final FilterLandPermanent filter = new FilterLandPermanent("forest"); static { filter.add(new SubtypePredicate("Forest")); @@ -55,4 +54,4 @@ public class ForestwalkAbility extends LandwalkAbility { public ForestwalkAbility copy() { return new ForestwalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/HasteAbility.java b/Mage/src/mage/abilities/keyword/HasteAbility.java index 5fa8d6e89d0..58f4281ab7b 100644 --- a/Mage/src/mage/abilities/keyword/HasteAbility.java +++ b/Mage/src/mage/abilities/keyword/HasteAbility.java @@ -1,38 +1,36 @@ /* -* 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. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class HasteAbility extends StaticAbility implements MageSingleton { - private static final HasteAbility fINSTANCE = new HasteAbility(); + private static final HasteAbility fINSTANCE = new HasteAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class HasteAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "Haste"; + return "haste"; } @Override diff --git a/Mage/src/mage/abilities/keyword/HexproofAbility.java b/Mage/src/mage/abilities/keyword/HexproofAbility.java index 900f9eba621..255781973c6 100644 --- a/Mage/src/mage/abilities/keyword/HexproofAbility.java +++ b/Mage/src/mage/abilities/keyword/HexproofAbility.java @@ -1,14 +1,13 @@ package mage.abilities.keyword; import java.io.ObjectStreamException; - import mage.abilities.MageSingleton; import mage.abilities.common.SimpleStaticAbility; import mage.constants.Zone; /** - * Hexproof - * (This creature or player can't be the target of spells or abilities your opponents control.) + * Hexproof (This creature or player can't be the target of spells or abilities + * your opponents control.) * * @author loki */ @@ -39,6 +38,6 @@ public class HexproofAbility extends SimpleStaticAbility implements MageSingleto @Override public String getRule() { - return "Hexproof"; + return "hexproof"; } } diff --git a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java index cdd8da7a4c2..af767fd91b1 100644 --- a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,7 +36,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class IslandwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Island"); + private static final FilterLandPermanent filter = new FilterLandPermanent("island"); static { filter.add(new SubtypePredicate("Island")); diff --git a/Mage/src/mage/abilities/keyword/LandwalkAbility.java b/Mage/src/mage/abilities/keyword/LandwalkAbility.java index f3870eb7663..2ff19c332b6 100644 --- a/Mage/src/mage/abilities/keyword/LandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/LandwalkAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,18 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; -import mage.constants.Duration; import mage.abilities.Ability; import mage.abilities.EvasionAbility; import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -43,7 +42,11 @@ import mage.game.permanent.Permanent; public class LandwalkAbility extends EvasionAbility { public LandwalkAbility(FilterLandPermanent filter) { - this.addEffect(new LandwalkEffect(filter)); + this(filter, true); + } + + public LandwalkAbility(FilterLandPermanent filter, boolean withHintText) { + this.addEffect(new LandwalkEffect(filter, withHintText)); } public LandwalkAbility(final LandwalkAbility ability) { @@ -55,16 +58,25 @@ public class LandwalkAbility extends EvasionAbility { return new LandwalkAbility(this); } + @Override + public String getRule() { + String ruleText = super.getRule(); + if (!ruleText.isEmpty() && ruleText.endsWith(".")) { + return ruleText.substring(0, ruleText.length() - 1); + } + return ruleText; + } + } class LandwalkEffect extends RestrictionEffect { protected FilterLandPermanent filter; - public LandwalkEffect(FilterLandPermanent filter) { + public LandwalkEffect(FilterLandPermanent filter, boolean withHintText) { super(Duration.WhileOnBattlefield); this.filter = filter; - staticText = filter.getMessage() + "walk"; + staticText = setText(withHintText); } public LandwalkEffect(final LandwalkEffect effect) { @@ -79,10 +91,7 @@ class LandwalkEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; + return permanent.getId().equals(source.getSourceId()); } @Override @@ -90,4 +99,34 @@ class LandwalkEffect extends RestrictionEffect { return new LandwalkEffect(this); } -} \ No newline at end of file + private String setText(boolean withHintText) { + // Swampwalk (This creature can't be blocked as long as defending player controls a Swamp.) + StringBuilder sb = new StringBuilder(); + sb.append(filter.getMessage()).append("walk"); + if (withHintText) { + sb.append(" (This creature can't be blocked as long as defending player controls a "); + switch (filter.getMessage()) { + case "swamp": + sb.append("Swamp"); + break; + case "plains": + sb.append("Plains"); + break; + case "mountain": + sb.append("Mountain"); + break; + case "forest": + sb.append("Forest"); + break; + case "island": + sb.append("Island"); + break; + default: + sb.append(filter.getMessage()); + + } + sb.append(".)"); + } + return sb.toString(); + } +} diff --git a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java index 4bb1b8c4986..7624395b402 100644 --- a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,7 +36,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class MountainwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); + private static final FilterLandPermanent filter = new FilterLandPermanent("mountain"); static { filter.add(new SubtypePredicate("Mountain")); @@ -55,4 +54,4 @@ public class MountainwalkAbility extends LandwalkAbility { public MountainwalkAbility copy() { return new MountainwalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java index bdd8b688d21..553101661b9 100644 --- a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java +++ b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,7 +36,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class PlainswalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Plains"); + private static final FilterLandPermanent filter = new FilterLandPermanent("plains"); static { filter.add(new SubtypePredicate("Plains")); @@ -55,4 +54,4 @@ public class PlainswalkAbility extends LandwalkAbility { public PlainswalkAbility copy() { return new PlainswalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java index 4da62606752..492ff7bb292 100644 --- a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,14 +36,18 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class SwampwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); + private static final FilterLandPermanent filter = new FilterLandPermanent("swamp"); static { filter.add(new SubtypePredicate("Swamp")); } public SwampwalkAbility() { - super(filter); + this(true); + } + + public SwampwalkAbility(boolean withHintText) { + super(filter, withHintText); } public SwampwalkAbility(final SwampwalkAbility ability) { @@ -55,4 +58,4 @@ public class SwampwalkAbility extends LandwalkAbility { public SwampwalkAbility copy() { return new SwampwalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/TrampleAbility.java b/Mage/src/mage/abilities/keyword/TrampleAbility.java index ea6d253ff7a..20827ee62f3 100644 --- a/Mage/src/mage/abilities/keyword/TrampleAbility.java +++ b/Mage/src/mage/abilities/keyword/TrampleAbility.java @@ -1,38 +1,36 @@ /* -* 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. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class TrampleAbility extends StaticAbility implements MageSingleton { - private static final TrampleAbility fINSTANCE = new TrampleAbility(); + private static final TrampleAbility fINSTANCE = new TrampleAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class TrampleAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "Trample"; + return "trample"; } @Override @@ -64,4 +62,4 @@ public class TrampleAbility extends StaticAbility implements MageSingleton { return fINSTANCE; } -} \ No newline at end of file +} From ad9e08991e7d7861b51421ef234e383ceb8c90c7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 14:25:42 +0200 Subject: [PATCH 32/35] * Buyback - Fixed that the buyback spell with activated buyback returned also to hand if the spell fizzled or was countered. --- .../cards/abilities/keywords/BuybackTest.java | 116 ++++++++++++++++++ .../abilities/keyword/BuybackAbility.java | 3 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java new file mode 100644 index 00000000000..a3b73c7f6f7 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java @@ -0,0 +1,116 @@ +/* + * 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 org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class BuybackTest extends CardTestPlayerBase { + + /** + * Tests boosting on being blocked + */ + @Test + public void testNormal() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Buyback {4} (You may pay an additional as you cast this spell. If you do, put this card into your hand as it resolves.) + // Target creature gets +2/+2 until end of turn. + addCard(Zone.HAND, playerA, "Elvish Fury", 1); // Instant {G} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elvish Fury", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); + assertHandCount(playerA, "Elvish Fury", 1); + } + + /** + * It seems that a spell with it's buyback cost paid returned to hand after + * it fizzled (by failing to target) when it should go to graveyard. + * + * "Q: If I pay a spell's buyback cost, but it fizzles, do I get the card + * back anyway? A: If you pay a buyback cost, you would get the card back + * during the spell's resolution. So if it never resolves (i.e., something + * counters it or it fizzles against all of its targets), you don't get the + * card back." + */ + @Test + public void testBuybackSpellFizzles() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Buyback {4} (You may pay an additional as you cast this spell. If you do, put this card into your hand as it resolves.) + // Target creature gets +2/+2 until end of turn. + addCard(Zone.HAND, playerA, "Elvish Fury", 1); // Instant {G} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Boomerang", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elvish Fury", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Boomerang", "Silvercoat Lion", "Elvish Fury"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Boomerang", 1); + assertHandCount(playerA, "Silvercoat Lion", 1); + assertHandCount(playerA, "Elvish Fury", 0); + assertGraveyardCount(playerA, "Elvish Fury", 1); + } + + @Test + public void testBuybackSpellWasCountered() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Buyback {4} (You may pay an additional as you cast this spell. If you do, put this card into your hand as it resolves.) + // Target creature gets +2/+2 until end of turn. + addCard(Zone.HAND, playerA, "Elvish Fury", 1); // Instant {G} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Counterspell", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elvish Fury", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Elvish Fury", "Elvish Fury"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Counterspell", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 2, 2); + assertHandCount(playerA, "Elvish Fury", 0); + assertGraveyardCount(playerA, "Elvish Fury", 1); + } +} diff --git a/Mage/src/mage/abilities/keyword/BuybackAbility.java b/Mage/src/mage/abilities/keyword/BuybackAbility.java index b6981811892..05059e4e53c 100644 --- a/Mage/src/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/mage/abilities/keyword/BuybackAbility.java @@ -186,7 +186,8 @@ class BuybackEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.STACK) { + if (zEvent.getFromZone() == Zone.STACK + && source.getSourceId().equals(event.getSourceId())) { // if spell fizzled, the sourceId is null return true; } } From c5718e3f19b8b70c8bb01c6d530c803ea77538f1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 15:09:44 +0200 Subject: [PATCH 33/35] * Phasing - Fixed that idirect phasing (attachments of permanents with phasing) were not phased out with the permanent they attached to. --- .../mage/sets/weatherlight/TolarianDrake.java | 7 +- .../cards/abilities/keywords/PhasingTest.java | 74 ++++++- Mage/src/mage/game/permanent/Battlefield.java | 197 +++++++++--------- 3 files changed, 167 insertions(+), 111 deletions(-) diff --git a/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java b/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java index d235b884073..36fd5e37428 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java +++ b/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java @@ -28,12 +28,12 @@ package mage.sets.weatherlight; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.PhasingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -49,7 +49,10 @@ public class TolarianDrake extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); + + // Phasing this.addAbility(PhasingAbility.getInstance()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java index 53027c46f22..77bd021e04b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java @@ -36,27 +36,25 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class PhasingTest extends CardTestPlayerBase { - - /** - * Test that abilities of phased out cards do not trigger or apply their effects + * Test that abilities of phased out cards do not trigger or apply their + * effects */ @Test public void TestAbilitiesOfPhasedOutAreNotApplied() { addCard(Zone.BATTLEFIELD, playerA, "Island", 3); - // At the beginning of each player's upkeep, that player chooses artifact, creature, land, or non-Aura enchantment. - // All nontoken permanents of that type phase out. + // At the beginning of each player's upkeep, that player chooses artifact, creature, land, or non-Aura enchantment. + // All nontoken permanents of that type phase out. addCard(Zone.HAND, playerA, "Teferi's Realm", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Crusade", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Teferi's Realm"); - - setChoice(playerB, "Non-Aura enchantment"); + + setChoice(playerB, "Non-Aura enchantment"); setStopAt(2, PhaseStep.PRECOMBAT_MAIN); execute(); @@ -64,4 +62,60 @@ public class PhasingTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); assertPowerToughness(playerB, "Silvercoat Lion", 2, 2); } -} \ No newline at end of file + + /** + * I had Fireshrieker equipped to Taniwha. When Taniwha phased out, the + * Fireshrieker remained visible on the battlefield, appearing to be + * attached to a Coldsteel Heart. The Fireshrieker should have been phased + * out indirectly. + * + * 502.15i When a permanent phases out, any local enchantments or Equipment + * attached to that permanent phase out at the same time. This alternate way + * of phasing out is known as phasing out "indirectly." An enchantment or + * Equipment that phased out indirectly won't phase in by itself, but + * instead phases in along with the card it's attached to. + */ + @Test + public void TestIndirectPhasing() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Flying + // Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.) + // All nontoken permanents of that type phase out. + addCard(Zone.HAND, playerA, "Tolarian Drake", 1); + // Enchant creature + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing", 1); // {R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Tolarian Drake"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Tolarian Drake", 0); + assertPermanentCount(playerA, "Firebreathing", 0); + } + + @Test + public void TestIndirectPhasingAgainPhasedIn() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Flying + // Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.) + // All nontoken permanents of that type phase out. + addCard(Zone.HAND, playerA, "Tolarian Drake", 1); + // Enchant creature + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing", 1); // {R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Tolarian Drake"); + + setStopAt(5, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Tolarian Drake", 1); + assertPermanentCount(playerA, "Firebreathing", 1); + } +} diff --git a/Mage/src/mage/game/permanent/Battlefield.java b/Mage/src/mage/game/permanent/Battlefield.java index e44a9c59f74..115e78a3c38 100644 --- a/Mage/src/mage/game/permanent/Battlefield.java +++ b/Mage/src/mage/game/permanent/Battlefield.java @@ -1,31 +1,30 @@ /* -* 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. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.game.permanent; import java.io.Serializable; @@ -51,10 +50,11 @@ public class Battlefield implements Serializable { private final Map field = new LinkedHashMap<>(); - public Battlefield () {} + public Battlefield() { + } public Battlefield(final Battlefield battlefield) { - for (Entry entry: battlefield.field.entrySet()) { + for (Entry entry : battlefield.field.entrySet()) { field.put(entry.getKey(), entry.getValue().copy()); } } @@ -64,7 +64,7 @@ public class Battlefield implements Serializable { } public void reset(Game game) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { perm.reset(game); } } @@ -74,11 +74,13 @@ public class Battlefield implements Serializable { } /** - * Returns a count of all {@link Permanent} that match the filter and are controlled by controllerId. - * - * Some filter predicates do not work here (e.g. AnotherPredicate() because filter.match() is called - * without controllerId. To use this predicates you can use count() instead of countAll() - * + * Returns a count of all {@link Permanent} that match the filter and are + * controlled by controllerId. + * + * Some filter predicates do not work here (e.g. AnotherPredicate() because + * filter.match() is called without controllerId. To use this predicates you + * can use count() instead of countAll() + * * @param filter * @param controllerId * @param game @@ -86,7 +88,7 @@ public class Battlefield implements Serializable { */ public int countAll(FilterPermanent filter, UUID controllerId, Game game) { int count = 0; - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game) && permanent.isPhasedIn()) { count++; } @@ -95,29 +97,28 @@ public class Battlefield implements Serializable { } /** - * Returns a count of all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. + * Returns a count of all {@link Permanent} that are within the range of + * influence of the specified player id and that match the supplied filter. * * @param filter - * @param sourceId - sourceId of the MageObject the calling effect/ability belongs to + * @param sourceId - sourceId of the MageObject the calling effect/ability + * belongs to * @param sourcePlayerId * @param game * @return count */ - public int count(FilterPermanent filter, UUID sourceId, UUID sourcePlayerId, Game game) { int count = 0; if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent permanent: field.values()) { - if (filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { + for (Permanent permanent : field.values()) { + if (filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; } } - } - else { + } else { Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent permanent: field.values()) { - if (range.contains(permanent.getControllerId()) && filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { + for (Permanent permanent : field.values()) { + if (range.contains(permanent.getControllerId()) && filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; } } @@ -127,8 +128,7 @@ public class Battlefield implements Serializable { /** * Returns true if the battlefield contains at least 1 {@link Permanent} - * that matches the filter. - * This method ignores the range of influence. + * that matches the filter. This method ignores the range of influence. * * @param filter * @param num @@ -137,7 +137,7 @@ public class Battlefield implements Serializable { */ public boolean contains(FilterPermanent filter, int num, Game game) { int count = 0; - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (filter.match(permanent, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -150,8 +150,8 @@ public class Battlefield implements Serializable { /** * Returns true if the battlefield contains num or more {@link Permanent} - * that matches the filter and is controlled by controllerId. - * This method ignores the range of influence. + * that matches the filter and is controlled by controllerId. This method + * ignores the range of influence. * * @param filter * @param controllerId @@ -161,7 +161,7 @@ public class Battlefield implements Serializable { */ public boolean contains(FilterPermanent filter, UUID controllerId, int num, Game game) { int count = 0; - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -174,8 +174,8 @@ public class Battlefield implements Serializable { /** * Returns true if the battlefield contains num or more {@link Permanent} - * that is within the range of influence of the specified player id - * and that matches the supplied filter. + * that is within the range of influence of the specified player id and that + * matches the supplied filter. * * @param filter * @param sourcePlayerId @@ -186,7 +186,7 @@ public class Battlefield implements Serializable { public boolean contains(FilterPermanent filter, UUID sourcePlayerId, Game game, int num) { int count = 0; if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (filter.match(permanent, null, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -194,10 +194,9 @@ public class Battlefield implements Serializable { } } } - } - else { + } else { Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (range.contains(permanent.getControllerId()) && filter.match(permanent, null, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -226,13 +225,13 @@ public class Battlefield implements Serializable { } public void beginningOfTurn(Game game) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { perm.beginningOfTurn(game); } } public void endOfTurn(UUID controllerId, Game game) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { perm.endOfTurn(game); } } @@ -247,7 +246,7 @@ public class Battlefield implements Serializable { public List getAllActivePermanents() { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn()) { active.add(perm); } @@ -256,16 +255,16 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} on the battlefield that are controlled by the specified - * player id. The method ignores the range of influence. - * + * Returns all {@link Permanent} on the battlefield that are controlled by + * the specified player id. The method ignores the range of influence. + * * @param controllerId * @return a list of {@link Permanent} * @see Permanent */ public List getAllActivePermanents(UUID controllerId) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) { active.add(perm); } @@ -274,16 +273,16 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} on the battlefield that match the specified {@link CardType}. - * This method ignores the range of influence. - * + * Returns all {@link Permanent} on the battlefield that match the specified + * {@link CardType}. This method ignores the range of influence. + * * @param type * @return a list of {@link Permanent} * @see Permanent */ public List getAllActivePermanents(CardType type) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && perm.getCardType().contains(type)) { active.add(perm); } @@ -292,9 +291,9 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} on the battlefield that match the supplied filter. - * This method ignores the range of influence. - * + * Returns all {@link Permanent} on the battlefield that match the supplied + * filter. This method ignores the range of influence. + * * * @param filter * @param game @@ -303,7 +302,7 @@ public class Battlefield implements Serializable { */ public List getAllActivePermanents(FilterPermanent filter, Game game) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && filter.match(perm, game)) { active.add(perm); } @@ -312,8 +311,8 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that match the filter and are controlled by controllerId. - * This method ignores the range of influence. + * Returns all {@link Permanent} that match the filter and are controlled by + * controllerId. This method ignores the range of influence. * * @param filter * @param controllerId @@ -323,7 +322,7 @@ public class Battlefield implements Serializable { */ public List getAllActivePermanents(FilterPermanent filter, UUID controllerId, Game game) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId) && filter.match(perm, game)) { active.add(perm); } @@ -332,8 +331,8 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. + * Returns all {@link Permanent} that are within the range of influence of + * the specified player id and that match the supplied filter. * * @param filter * @param sourcePlayerId @@ -346,9 +345,9 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. - * + * Returns all {@link Permanent} that are within the range of influence of + * the specified player id and that match the supplied filter. + * * @param filter * @param sourcePlayerId * @param sourceId @@ -359,15 +358,14 @@ public class Battlefield implements Serializable { public List getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, UUID sourceId, Game game) { List active = new ArrayList<>(); if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && filter.match(perm, sourceId, sourcePlayerId, game)) { active.add(perm); } } - } - else { + } else { Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && range.contains(perm.getControllerId()) && filter.match(perm, sourceId, sourcePlayerId, game)) { active.add(perm); } @@ -377,8 +375,9 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id. - * + * Returns all {@link Permanent} that are within the range of influence of + * the specified player id. + * * @param sourcePlayerId * @param game * @return a list of {@link Permanent} @@ -387,11 +386,10 @@ public class Battlefield implements Serializable { public List getActivePermanents(UUID sourcePlayerId, Game game) { if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { return getAllActivePermanents(); - } - else { + } else { List active = new ArrayList<>(); Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && range.contains(perm.getControllerId())) { active.add(perm); } @@ -402,7 +400,7 @@ public class Battlefield implements Serializable { public List getPhasedIn(UUID controllerId) { List phasedIn = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.getAbilities().containsKey(PhasingAbility.getInstance().getId()) && perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) { phasedIn.add(perm); } @@ -412,7 +410,7 @@ public class Battlefield implements Serializable { public List getPhasedOut(UUID controllerId) { List phasedOut = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (!perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) { phasedOut.add(perm); } @@ -421,23 +419,24 @@ public class Battlefield implements Serializable { } public void resetPermanentsControl() { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn()) { perm.resetControl(); } } } - + /** - * since control could change several times during applyEvents we only want to fire - * control changed events after all control change effects have been applied - * - * @param game + * since control could change several times during applyEvents we only want + * to fire control changed events after all control change effects have been + * applied + * + * @param game * @return */ public boolean fireControlChangeEvents(Game game) { boolean controlChanged = false; - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn()) { controlChanged |= perm.checkControlChanged(game); } From 30e0f8b85a31151a992888261c81fc30c13bfadc Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 15:21:45 +0200 Subject: [PATCH 34/35] * Commander - Fixed that a player lost by commander damage was posted continuously to the game log while the multiplayer game was ongoing. --- Mage/src/mage/game/GameCommanderImpl.java | 2 +- Mage/src/mage/watchers/common/CommanderInfoWatcher.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Mage/src/mage/game/GameCommanderImpl.java b/Mage/src/mage/game/GameCommanderImpl.java index f6a47aad006..4181efc3e4c 100644 --- a/Mage/src/mage/game/GameCommanderImpl.java +++ b/Mage/src/mage/game/GameCommanderImpl.java @@ -193,7 +193,7 @@ public abstract class GameCommanderImpl extends GameImpl { for (Map.Entry entrySet : damageWatcher.getDamageToPlayer().entrySet()) { if (entrySet.getValue() > 20) { Player opponent = getPlayer(entrySet.getKey()); - if (opponent != null && player.isInGame()) { + if (opponent != null && !opponent.hasLost() && player.isInGame()) { opponent.lost(this); } } diff --git a/Mage/src/mage/watchers/common/CommanderInfoWatcher.java b/Mage/src/mage/watchers/common/CommanderInfoWatcher.java index 963fcaf374e..6a81f5505e1 100644 --- a/Mage/src/mage/watchers/common/CommanderInfoWatcher.java +++ b/Mage/src/mage/watchers/common/CommanderInfoWatcher.java @@ -113,13 +113,12 @@ public class CommanderInfoWatcher extends Watcher { sb.append(" ").append(castCount).append(castCount == 1 ? " time" : " times").append(" casted from the command zone."); } this.addInfo(object, "Commander", sb.toString(), game); - if (checkCommanderDamage) { for (Map.Entry entry : damageToPlayer.entrySet()) { Player damagedPlayer = game.getPlayer(entry.getKey()); - sb.setLength(0); sb.append("Commander did ").append(entry.getValue()).append(" combat damage to player ").append(damagedPlayer.getLogName()).append("."); - this.addInfo(object, new StringBuilder("Commander").append(entry.getKey()).toString(), sb.toString(), game); + this.addInfo(object, "Commander" + entry.getKey(), + "Commander did " + entry.getValue() + " combat damage to player " + damagedPlayer.getLogName() + ".", game); } } } From dc6dc07e47ced34b10b13549382fefd637a96598 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 16:41:28 +0200 Subject: [PATCH 35/35] * Mighty Emergence - Fixed that the effect also worked for not controlled creatures. --- .../sets/shardsofalara/MightyEmergence.java | 109 +++--------------- 1 file changed, 14 insertions(+), 95 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java b/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java index d409f300f14..3ccec281d24 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java @@ -28,39 +28,39 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.Filter; -import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; /** * * @author Plopman */ public class MightyEmergence extends CardImpl { - + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature with power 5 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4)); + } + public MightyEmergence(UUID ownerId) { super(ownerId, 137, "Mighty Emergence", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "ALA"; - // Whenever a creature with power 5 or greater enters the battlefield under your control, you may put two +1/+1 counters on it. - this.addAbility(new MightyEmergenceTriggeredAbility()); + Effect effect = new AddCountersTargetEffect(CounterType.P2P2.createInstance()); + effect.setText("you may put two +1/+1 counters on it"); + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, effect, filter, true, SetTargetPointer.PERMANENT, "", true)); } public MightyEmergence(final MightyEmergence card) { @@ -72,84 +72,3 @@ public class MightyEmergence extends CardImpl { return new MightyEmergence(this); } } - - -class MightyEmergenceTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterCreatureCard filter = new FilterCreatureCard("creature with power 5 or greater"); - static { - filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4)); - } - - public MightyEmergenceTriggeredAbility() { - super(Zone.BATTLEFIELD, new MightyEmergenceAddCountersTargetEffect(), true); - } - - public MightyEmergenceTriggeredAbility(MightyEmergenceTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (filter.match(permanent, getSourceId(), getControllerId(), game)) { - if (getTargets().size() == 0) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(targetId)); - } - } - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever a creature with power 5 or greater enters the battlefield under your control, you may put two +1/+1 counters on it"; - } - - @Override - public MightyEmergenceTriggeredAbility copy() { - return new MightyEmergenceTriggeredAbility(this); - } -} - -class MightyEmergenceAddCountersTargetEffect extends OneShotEffect { - - - - public MightyEmergenceAddCountersTargetEffect() { - super(Outcome.Benefit); - } - - public MightyEmergenceAddCountersTargetEffect(final MightyEmergenceAddCountersTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null) { - permanent.addCounters(CounterType.P1P1.createInstance(2), game); - return true; - } - return false; - } - - @Override - public String getText(Mode mode) { - return "put two +1/+1 counters on it"; - } - - @Override - public MightyEmergenceAddCountersTargetEffect copy() { - return new MightyEmergenceAddCountersTargetEffect(this); - } - - -}