From 61188dbdc3b4f495891bf415e51c4f9f79f18217 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 13:40:44 +0200 Subject: [PATCH 01/14] * 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 2d6382fd5b..754ae29be7 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 747069e640..7959491202 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 f5cd33ec39..92b181a680 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 e47fb8f405..c328b1ed5a 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 6fbd03506b..3533d54b41 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 892ce1a364..47ed07fc56 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 afbb37a7d6..67ae57e6c9 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 bc6ccd434b..d9723850a2 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 097da54a5d..8117823221 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 7ef603879a..c1485c345d 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 a6f6d1545b..d9759823ac 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 5fa8d6e89d..58f4281ab7 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 900f9eba62..255781973c 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 cdd8da7a4c..af767fd91b 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 f3870eb766..2ff19c332b 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 4bb1b8c498..7624395b40 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 bdd8b688d2..553101661b 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 4da6260675..492ff7bb29 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 ea6d253ff7..20827ee62f 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 02/14] * 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 0000000000..a3b73c7f6f --- /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 b698181189..05059e4e53 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 03/14] * 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 d235b88407..36fd5e3742 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 53027c46f2..77bd021e04 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 e44a9c59f7..115e78a3c3 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 04/14] * 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 f6a47aad00..4181efc3e4 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 963fcaf374..6a81f5505e 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 05/14] * 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 d409f300f1..3ccec281d2 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); - } - - -} From b62dadf95d45444ffcefb067debd23e792c273cb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 22:38:45 +0200 Subject: [PATCH 06/14] * Fixed that conditional mana (e.g. River of Tears) did not trigger mana adding effects like Vorinclex, Voice of Hunger. --- .../src/mage/sets/judgment/MirarisWake.java | 4 +- .../newphyrexia/VorinclexVoiceOfHunger.java | 2 + .../mana/VorinclexVoiceOfHungerTest.java | 65 +++++++++++++++++++ .../decorator/ConditionalManaEffect.java | 57 +++++++++++++--- .../abilities/mana/TriggeredManaAbility.java | 13 ++-- 5 files changed, 124 insertions(+), 17 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.java diff --git a/Mage.Sets/src/mage/sets/judgment/MirarisWake.java b/Mage.Sets/src/mage/sets/judgment/MirarisWake.java index c59f9b7f1b..f040d301d5 100644 --- a/Mage.Sets/src/mage/sets/judgment/MirarisWake.java +++ b/Mage.Sets/src/mage/sets/judgment/MirarisWake.java @@ -50,9 +50,9 @@ public class MirarisWake extends CardImpl { super(ownerId, 139, "Mirari's Wake", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{W}"); this.expansionSetCode = "JUD"; - // Creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1,1,Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield))); + // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. AddManaOfAnyTypeProducedEffect effect = new AddManaOfAnyTypeProducedEffect(); effect.setText("add one mana to your mana pool of any type that land produced"); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java index 00d838eea5..90f4773e0d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java @@ -62,7 +62,9 @@ public class VorinclexVoiceOfHunger extends CardImpl { this.power = new MageInt(7); this.toughness = new MageInt(6); + // Trample this.addAbility(TrampleAbility.getInstance()); + // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. ManaEffect effect = new AddManaOfAnyTypeProducedEffect(); effect.setText("add one mana to your mana pool of any type that land produced"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.java new file mode 100644 index 0000000000..abc87ae69d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.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 org.mage.test.cards.mana; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class VorinclexVoiceOfHungerTest extends CardTestPlayerBase { + + /** + * Vorinclex, Voice of Hunger is not mana doubling River of Tears. + */ + @Test + public void testRiverOfTears() { + // Trample + // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. + // Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step. + addCard(Zone.BATTLEFIELD, playerA, "Vorinclex, Voice of Hunger", 1); + // {T}: Add {U} to your mana pool. If you played a land this turn, add {B} to your mana pool instead. + addCard(Zone.BATTLEFIELD, playerA, "River of Tears", 1); + addCard(Zone.HAND, playerA, "Vedalken Mastermind", 1); + + // because available mana calculation does not work correctly with Vorinclex, Voice of Hunger we have to tap the land manually + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U} to your mana pool"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vedalken Mastermind"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Vedalken Mastermind", 1); + + } + +} diff --git a/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java b/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java index 4ec4d37870..77eaf343e2 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.decorator; import mage.Mana; @@ -33,14 +32,14 @@ import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ManaEffect; +import mage.choices.ChoiceColor; import mage.game.Game; +import mage.players.Player; /** * * @author LevelX2 */ - - public class ConditionalManaEffect extends ManaEffect { private BasicManaEffect effect; @@ -70,14 +69,46 @@ public class ConditionalManaEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } if (condition.apply(game, source)) { effect.setTargetPointer(this.targetPointer); - return effect.apply(game, source); } else if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); - return otherwiseEffect.apply(game, source); } - return false; + Mana mana = getMana(game, source); + + if (mana != null && mana.getAny() > 0) { + int amount = mana.getAny(); + + ChoiceColor choice = new ChoiceColor(true); + Mana createdMana = null; + if (controller.choose(outcome, choice, game)) { + if (choice.getColor() == null) { + return false; // it happens, don't know how + } + + if (choice.getColor().isBlack()) { + createdMana = Mana.BlackMana(amount); + } else if (choice.getColor().isBlue()) { + createdMana = Mana.BlueMana(amount); + } else if (choice.getColor().isRed()) { + createdMana = Mana.RedMana(amount); + } else if (choice.getColor().isGreen()) { + createdMana = Mana.GreenMana(amount); + } else if (choice.getColor().isWhite()) { + createdMana = Mana.WhiteMana(amount); + } + } + mana = createdMana; + } + + if (mana != null) { + controller.getManaPool().addMana(mana, game, source); + } + return true; } @Override @@ -85,12 +116,18 @@ public class ConditionalManaEffect extends ManaEffect { return new ConditionalManaEffect(this); } - public Mana getMana(Game game, Ability source) { + @Override + public Mana getMana(Game game, Ability source + ) { + Mana mana = null; if (condition.apply(game, source)) { - return effect.getMana(); + mana = effect.getMana(); } else if (otherwiseEffect != null) { - return otherwiseEffect.getMana(); + mana = otherwiseEffect.getMana(); } - return null; + if (mana != null) { + checkToFirePossibleEvents(mana, game, source); + } + return mana; } } diff --git a/Mage/src/mage/abilities/mana/TriggeredManaAbility.java b/Mage/src/mage/abilities/mana/TriggeredManaAbility.java index 4a2c997d83..f6f319a5ab 100644 --- a/Mage/src/mage/abilities/mana/TriggeredManaAbility.java +++ b/Mage/src/mage/abilities/mana/TriggeredManaAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * 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. @@ -29,10 +29,12 @@ package mage.abilities.mana; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ManaEffect; +import mage.constants.AbilityType; import mage.constants.Zone; /** * see 20110715 - 605.1b + * * @author BetaSteward_at_googlemail.com */ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl { @@ -44,6 +46,7 @@ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl { public TriggeredManaAbility(Zone zone, ManaEffect effect, boolean optional) { super(zone, effect, optional); this.usesStack = false; + this.abilityType = AbilityType.MANA; } public TriggeredManaAbility(final TriggeredManaAbility ability) { From 78071ce0a3e4d58979e600109fbb18ed0763b297 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 23:34:15 +0200 Subject: [PATCH 07/14] * Fixed a bug that order of triggered abilities of tokens were not shown to human player and the UI was locked (fixes #910). --- Mage.Common/src/mage/view/CardsView.java | 3 + .../java/mage/server/game/GameController.java | 3 +- .../mage/sets/tenthedition/VenerableMonk.java | 6 +- .../mage/sets/zendikar/RiteOfReplication.java | 9 ++- .../cards/replacement/DoublingSeasonTest.java | 61 ++++++++++++++++--- 5 files changed, 65 insertions(+), 17 deletions(-) diff --git a/Mage.Common/src/mage/view/CardsView.java b/Mage.Common/src/mage/view/CardsView.java index 4a7ee78da5..606918a3ee 100644 --- a/Mage.Common/src/mage/view/CardsView.java +++ b/Mage.Common/src/mage/view/CardsView.java @@ -89,6 +89,9 @@ public class CardsView extends LinkedHashMap { case EXILED: case GRAVEYARD: sourceObject = game.getCard(ability.getSourceId()); + if (sourceObject == null) { + sourceObject = game.getPermanent(ability.getSourceId()); + } isCard = true; break; case BATTLEFIELD: 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 07ed9e64e9..5242a01961 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -846,7 +846,8 @@ public class GameController implements GameCallback { perform(playerId, new Command() { @Override public void execute(UUID playerId) { - getGameSession(playerId).target(question, new CardsView(abilities, game), null, required, options); + CardsView cardsView = new CardsView(abilities, game); + getGameSession(playerId).target(question, cardsView, null, required, options); } }); } diff --git a/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java b/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java index 5b46688a5c..34c8825469 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java +++ b/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java @@ -28,12 +28,12 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -50,6 +50,8 @@ public class VenerableMonk extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); + + // When Venerable Monk enters the battlefield, you gain 2 life. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2))); } diff --git a/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java b/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java index 328c65228a..fd51ca2ee7 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java +++ b/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java @@ -28,16 +28,16 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.EmptyToken; @@ -54,7 +54,6 @@ public class RiteOfReplication extends CardImpl { super(ownerId, 61, "Rite of Replication", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); this.expansionSetCode = "ZEN"; - // Kicker {5} this.addAbility(new KickerAbility("{5}")); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java index e1cb48a3b5..677561abbc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java @@ -7,17 +7,19 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Doubling Season: - * If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead. - * If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead. + * Doubling Season: If an effect would put one or more tokens onto the + * battlefield under your control, it puts twice that many of those tokens onto + * the battlefield instead. If an effect would place one or more counters on a + * permanent you control, it places twice that many of those counters on that + * permanent instead. * * @author LevelX2 */ public class DoublingSeasonTest extends CardTestPlayerBase { /** - * Tests that instead of one spore counter there were two spore counters added to Pallid Mycoderm - * if Doubling Season is on the battlefield. + * Tests that instead of one spore counter there were two spore counters + * added to Pallid Mycoderm if Doubling Season is on the battlefield. */ @Test public void testDoubleSporeCounter() { @@ -35,8 +37,9 @@ public class DoublingSeasonTest extends CardTestPlayerBase { } /** - * Tests if 3 damage are prevented with Test of Faith and Doubling Season is on - * the battlefield, that 6 +1/+1 counters are added to the target creature. + * Tests if 3 damage are prevented with Test of Faith and Doubling Season is + * on the battlefield, that 6 +1/+1 counters are added to the target + * creature. */ @Test public void testDoubleP1P1Counter() { @@ -63,9 +66,10 @@ public class DoublingSeasonTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Silvercoat Lion", 8, 8); } + /** - * Tests that 2 Saproling tokens are created instead of one if Doubling Season is on - * the battlefield. + * Tests that 2 Saproling tokens are created instead of one if Doubling + * Season is on the battlefield. */ @Test public void testDoubleTokens() { @@ -89,4 +93,43 @@ public class DoublingSeasonTest extends CardTestPlayerBase { } + /** + * Creatures with enter the battlefield triggers are causing a bug when + * multiple copies are made simultaneously (ie via Doubling Season + + * Kiki-Jiki, Mirror Breaker or Rite of Replication). After the tokens have + * entered the battlefield it asks their controller to choose the order that + * the triggered abilities on the stack but no window opens to select the + * triggers leaving no option to move the game forward (besides rollback and + * just not making the tokens). Several attempts with the different + * combinations make it *seem to be a general bug about duplicates entering + * at the same time and not related to the specific cards. + */ + @Test + public void testDoubleRiteOfReplication() { + /** + * If an effect would put one or more tokens onto the battlefield under + * your control, it puts twice that many of those tokens onto the + * battlefield instead. If an effect would place one or more counters on + * a permanent you control, it places twice that many of those counters + * on that permanent instead. + */ + + addCard(Zone.BATTLEFIELD, playerA, "Doubling Season"); + addCard(Zone.BATTLEFIELD, playerA, "Island", 9); + + // Put a token that's a copy of target creature onto the battlefield. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. + addCard(Zone.HAND, playerA, "Rite of Replication"); + // When Venerable Monk enters the battlefield, you gain 2 life. + addCard(Zone.BATTLEFIELD, playerB, "Venerable Monk", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rite of Replication", "Venerable Monk"); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 40); + assertPermanentCount(playerA, "Venerable Monk", 10); + + } } From cc9384089784169305fc30c54b213bc1e71a5c79 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 26 Aug 2015 00:22:05 +0200 Subject: [PATCH 08/14] * Fixed some cards where effects for put into play tokens were not applied to all tokens if multiple tokens (e.g. caused by Doubling Season) were put into play. --- .../bornofthegods/FelhideSpiritbinder.java | 21 ++++----- .../TatsumasaTheDragonsFang.java | 34 +++++++++------ .../src/mage/sets/darkascension/Seance.java | 24 ++++++----- .../sets/dragonsoftarkir/MirrorMockery.java | 19 +++++--- .../sets/fatereforged/FlamerushRider.java | 11 +++-- .../src/mage/sets/fifthdawn/HelmOfKaldra.java | 43 +++++++++---------- .../magicorigins/FlameshadowConjuring.java | 29 +++++++------ .../saviorsofkamigawa/FeralLightning.java | 19 ++++---- .../mage/sets/scarsofmirrodin/MimicVat.java | 19 +++++--- ...tTokenOntoBattlefieldCopyTargetEffect.java | 43 +++++++++++-------- 10 files changed, 150 insertions(+), 112 deletions(-) diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java b/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java index 31d52cf2d2..7d31be41b0 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java @@ -71,7 +71,7 @@ public class FelhideSpiritbinder extends CardImpl { this.toughness = new MageInt(4); // Inspired - Whenever Felhide Spiritbinder becomes untapped, you may pay {1}{R}. If you do, put a token onto the battlefield that's a copy of another target creature except it's an enchantment in addition to its other types. It gains haste. Exile it at the beginning of the next end step. - Ability ability = new InspiredAbility(new DoIfCostPaid(new FelhideSpiritbinderEffect(), new ManaCostsImpl("{1}{R}"),"Use effect of {source}?")); + Ability ability = new InspiredAbility(new DoIfCostPaid(new FelhideSpiritbinderEffect(), new ManaCostsImpl("{1}{R}"), "Use effect of {source}?")); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } @@ -108,15 +108,16 @@ class FelhideSpiritbinderEffect extends OneShotEffect { if (permanent != null) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(null, CardType.ENCHANTMENT, true); effect.setTargetPointer(getTargetPointer()); - if (effect.apply(game, source) && effect.getAddedPermanent() != null) { - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + if (effect.apply(game, source)) { + for (Permanent tokenPermanent : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java index a9e7ff37db..1cd6c9b8a5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java @@ -35,9 +35,10 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.ExileSourceCost; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlSourceEffect; +import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.FlyingAbility; @@ -51,6 +52,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -73,7 +75,7 @@ public class TatsumasaTheDragonsFang extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TatsumaTheDragonsFangEffect(), new GenericManaCost(6)); ability.addCost(new ExileSourceCost(true)); this.addAbility(ability); - + // Equip {3} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); } @@ -106,14 +108,21 @@ class TatsumaTheDragonsFangEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - CreateTokenEffect effect = new CreateTokenEffect(new TatsumaDragonToken()); + CreateTokenEffect effect = new CreateTokenEffect(new TatsumaDragonToken()); effect.apply(game, source); - FixedTarget fixedTarget = new FixedTarget(effect.getLastAddedTokenId()); - DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : effect.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + FixedTarget fixedTarget = new FixedTarget(tokenPermanent, game); + Effect returnEffect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(); + returnEffect.setTargetPointer(new FixedTarget(source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId()))); + DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget, returnEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } return true; } @@ -123,8 +132,8 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility { protected FixedTarget fixedTarget; - public TatsumaTheDragonsFangTriggeredAbility(FixedTarget fixedTarget) { - super(new ReturnToBattlefieldUnderYourControlSourceEffect(), Duration.OneUse); + public TatsumaTheDragonsFangTriggeredAbility(FixedTarget fixedTarget, Effect effect) { + super(effect, Duration.OneUse); this.fixedTarget = fixedTarget; } @@ -155,11 +164,12 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility { @Override public String getRule() { - return "Return {this} to the battlefield under its owner's control when that token dies." ; + return "Return {this} to the battlefield under its owner's control when that token dies."; } } class TatsumaDragonToken extends Token { + public TatsumaDragonToken() { super("Dragon Spirit", "5/5 blue Dragon Spirit creature token with flying"); cardType.add(CardType.CREATURE); diff --git a/Mage.Sets/src/mage/sets/darkascension/Seance.java b/Mage.Sets/src/mage/sets/darkascension/Seance.java index 944b43994f..61a81d26e3 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Seance.java +++ b/Mage.Sets/src/mage/sets/darkascension/Seance.java @@ -43,6 +43,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; @@ -59,7 +60,6 @@ public class Seance extends CardImpl { super(ownerId, 20, "Seance", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "DKA"; - // At the beginning of each upkeep, you may exile target creature card from your graveyard. If you do, put a token onto the battlefield that's a copy of that card except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step. Ability ability = new BeginningOfUpkeepTriggeredAbility(new SeanceEffect(), TargetController.ANY, true); ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); @@ -103,16 +103,20 @@ class SeanceEffect extends OneShotEffect { if (!token.hasSubtype("Spirit")) { token.getSubtype().add("Spirit"); - } + } token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } } return true; diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java index ef10e70c1d..5eb71f49bd 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java @@ -110,13 +110,18 @@ class MirrorMockeryEffect extends OneShotEffect { token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java b/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java index 6775848ca0..721d26b3dd 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java +++ b/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java @@ -116,9 +116,14 @@ class FlamerushRiderEffect extends OneShotEffect { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(permanent); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true); - Effect effect = new ExileTargetEffect(); - effect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect), false).apply(game, source); + for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + Effect effect = new ExileTargetEffect(); + effect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect), false).apply(game, source); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java b/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java index 754ae29be7..40ae18645a 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java @@ -117,10 +117,7 @@ class HelmOfKaldraCondition implements Condition { if (game.getBattlefield().count(HelmOfKaldra.filterShield, source.getSourceId(), source.getControllerId(), game) < 1) { return false; } - if (game.getBattlefield().count(HelmOfKaldra.filterShield, source.getSourceId(), source.getControllerId(), game) < 1) { - return false; - } - return true; + return game.getBattlefield().count(HelmOfKaldra.filterShield, source.getSourceId(), source.getControllerId(), game) >= 1; } } @@ -146,25 +143,27 @@ class HelmOfKaldraEffect extends OneShotEffect { if (new HelmOfKaldraCondition().apply(game, source)) { CreateTokenEffect effect = new CreateTokenEffect(new KaldraToken()); effect.apply(game, source); - UUID kaldraId = effect.getLastAddedTokenId(); - Permanent kaldra = game.getPermanent(kaldraId); - if (kaldra != null) { - // Attach helm to the token - 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)) { - kaldra.addAttachment(kaldrasShield.getId(), game); - break; - } - // Attach sword to the token - for (Permanent kaldrasSword : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) { - kaldra.addAttachment(kaldrasSword.getId(), game); - break; - } + for (UUID tokenId : effect.getLastAddedTokenIds()) { + Permanent kaldra = game.getPermanent(tokenId); + if (kaldra != null) { + // Attach helm to the token + 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)) { + kaldra.addAttachment(kaldrasShield.getId(), game); + break; + } + // Attach sword to the token + for (Permanent kaldrasSword : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) { + kaldra.addAttachment(kaldrasSword.getId(), game); + break; + } + } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java b/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java index 6e3492eb4e..d8fa46e990 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java +++ b/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java @@ -54,9 +54,9 @@ import mage.target.targetpointer.FixedTarget; * @author fireshoes */ public class FlameshadowConjuring extends CardImpl { - + private static final FilterControlledCreaturePermanent filterNontoken = new FilterControlledCreaturePermanent("nontoken creature"); - + static { filterNontoken.add(Predicates.not(new TokenPredicate())); } @@ -66,8 +66,8 @@ public class FlameshadowConjuring extends CardImpl { this.expansionSetCode = "ORI"; // Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step. - Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new FlameshadowConjuringEffect(), filterNontoken, false, SetTargetPointer.PERMANENT, - "Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step"); + Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new FlameshadowConjuringEffect(), filterNontoken, false, SetTargetPointer.PERMANENT, + "Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step"); ability.addCost(new ManaCostsImpl("{R}")); this.addAbility(ability); } @@ -104,19 +104,20 @@ class FlameshadowConjuringEffect extends OneShotEffect { if (permanent != null) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(null, null, true); effect.setTargetPointer(getTargetPointer()); - if (effect.apply(game, source) && effect.getAddedPermanent() != null) { - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + if (effect.apply(game, source)) { + for (Permanent tokenPermanent : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java index ea95bd8916..36af9e621c 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java @@ -42,6 +42,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -56,7 +57,6 @@ public class FeralLightning extends CardImpl { super(ownerId, 97, "Feral Lightning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}{R}"); this.expansionSetCode = "SOK"; - // Put three 3/1 red Elemental creature tokens with haste onto the battlefield. Exile them at the beginning of the next end step. this.getSpellAbility().addEffect(new FeralLightningEffect()); @@ -95,13 +95,16 @@ class FeralLightningEffect extends OneShotEffect { CreateTokenEffect effect = new CreateTokenEffect(new FeralLightningElementalToken(), 3); effect.apply(game, source); for (UUID tokenId : effect.getLastAddedTokenIds()) { - ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD); - exileEffect.setTargetPointer(new FixedTarget(tokenId)); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java index 2a24c0196e..33664325db 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java @@ -210,13 +210,18 @@ class MimicVatCreateTokenEffect extends OneShotEffect { token.addAbility(HasteAbility.getInstance()); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } return true; } diff --git a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java index 43fd5f7120..7bb195b826 100644 --- a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java @@ -27,6 +27,8 @@ */ package mage.abilities.effects.common; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; @@ -57,13 +59,13 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { private final UUID playerId; private final CardType additionalCardType; private boolean gainsHaste; - private Permanent addedTokenPermanent; + private List addedTokenPermanents; public PutTokenOntoBattlefieldCopyTargetEffect() { super(Outcome.PutCreatureInPlay); this.playerId = null; this.additionalCardType = null; - this.addedTokenPermanent = null; + this.addedTokenPermanents = new ArrayList<>(); } public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId) { @@ -75,7 +77,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this.playerId = playerId; this.additionalCardType = additionalCardType; this.gainsHaste = gainsHaste; - this.addedTokenPermanent = null; + this.addedTokenPermanents = new ArrayList<>(); } public PutTokenOntoBattlefieldCopyTargetEffect(final PutTokenOntoBattlefieldCopyTargetEffect effect) { @@ -83,7 +85,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this.playerId = effect.playerId; this.additionalCardType = effect.additionalCardType; this.gainsHaste = effect.gainsHaste; - this.addedTokenPermanent = effect.addedTokenPermanent; + this.addedTokenPermanents.addAll(effect.addedTokenPermanents); } @Override @@ -118,21 +120,24 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { token.addAbility(HasteAbility.getInstance()); } token.putOntoBattlefield(1, game, source.getSourceId(), playerId == null ? source.getControllerId() : playerId); - addedTokenPermanent = game.getPermanent(token.getLastAddedToken()); - if (addedTokenPermanent != null) { - game.copyPermanent(copyFromPermanent, addedTokenPermanent, source, applier); - if (additionalCardType != null) { - ContinuousEffect effect = new AddCardTypeTargetEffect(additionalCardType, Duration.Custom); - effect.setTargetPointer(new FixedTarget(addedTokenPermanent.getId())); - game.addEffect(effect, source); + for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + addedTokenPermanents.add(tokenPermanent); + game.copyPermanent(copyFromPermanent, tokenPermanent, source, applier); + if (additionalCardType != null) { + ContinuousEffect effect = new AddCardTypeTargetEffect(additionalCardType, Duration.Custom); + effect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addEffect(effect, source); + } + if (gainsHaste) { + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); + effect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addEffect(effect, source); + } } - if (gainsHaste) { - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(addedTokenPermanent.getId())); - game.addEffect(effect, source); - } - return true; } + return true; } return false; } @@ -153,7 +158,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { } - public Permanent getAddedPermanent() { - return addedTokenPermanent; + public List getAddedPermanent() { + return addedTokenPermanents; } } From 1f24f68a117f4a3ff5ba630f7f77c04b0e60ffca Mon Sep 17 00:00:00 2001 From: fireshoes Date: Tue, 25 Aug 2015 21:59:14 -0500 Subject: [PATCH 09/14] Fixed spelling of CanAttackAsThoughItDidntHaveDefender. Added M2M2 and P1P0 counter types. Added "HintText" to other landwalks in addtion to swampwalk. Added 40 cards. --- .../src/mage/sets/alliances/Burnout.java | 107 ++++++++ .../mage/sets/alliances/CarrierPigeons1.java | 71 +++++ .../mage/sets/alliances/CarrierPigeons2.java | 52 ++++ .../mage/sets/alliances/EnslavedScout1.java | 70 +++++ .../mage/sets/alliances/EnslavedScout2.java | 52 ++++ .../mage/sets/alliances/FeveredStrength1.java | 68 +++++ .../mage/sets/alliances/FeveredStrength2.java | 52 ++++ .../mage/sets/antiquities/GateToPhyrexia.java | 101 +++++++ .../mage/sets/bornofthegods/PillarOfWar.java | 156 +++++------ .../sets/conspiracy/WakestoneGargoyle.java | 160 +++++------ .../dragonsoftarkir/AssaultFormation.java | 254 +++++++++--------- .../sets/dragonsoftarkir/GladeWatcher.java | 157 ++++++----- .../mage/sets/fallenempires/EbonPraetor.java | 52 ++++ .../mage/sets/fallenempires/FungalBloom.java | 76 ++++++ .../mage/sets/fallenempires/RiverMerfolk.java | 54 ++++ .../mage/sets/fallenempires/SporeFlower.java | 75 ++++++ .../sets/fallenempires/TheloniteDruid.java | 54 ++++ .../sets/fallenempires/TheloniteMonk.java | 84 ++++++ .../src/mage/sets/fifthedition/DarkMaze.java | 79 ++++++ .../src/mage/sets/homelands/AysenHighway.java | 72 +++++ .../src/mage/sets/homelands/DarkMaze1.java | 52 ++++ .../src/mage/sets/homelands/DarkMaze2.java | 52 ++++ .../src/mage/sets/homelands/DwarvenPony.java | 82 ++++++ .../mage/sets/homelands/VeldraneOfSengir.java | 73 +++++ .../src/mage/sets/iceage/Clairvoyance.java | 102 +++++++ Mage.Sets/src/mage/sets/iceage/ForceVoid.java | 69 +++++ .../src/mage/sets/iceage/LightningBlow.java | 69 +++++ Mage.Sets/src/mage/sets/iceage/Pyknite.java | 67 +++++ .../src/mage/sets/iceage/RayOfErasure.java | 68 +++++ .../src/mage/sets/iceage/Thermokarst.java | 54 ++++ .../src/mage/sets/iceage/WalkingWall.java | 52 ++++ .../mage/sets/invasion/PrisonBarricade.java | 4 +- .../src/mage/sets/judgment/ErhnamDjinn.java | 172 ++++++------ .../src/mage/sets/judgment/MirrorWall.java | 72 +++++ .../src/mage/sets/legends/PartWater.java | 79 ++++++ .../mage/sets/limitedalpha/AnimateWall.java | 4 +- .../mage/sets/lorwyn/StreambedAquitects.java | 184 ++++++------- .../sets/mastersedition/RiverMerfolk.java | 69 +++++ .../mage/sets/mastersedition/WalkingWall.java | 74 +++++ .../mage/sets/masterseditionii/Burnout.java | 52 ++++ .../sets/masterseditionii/EbonPraetor.java | 156 +++++++++++ .../sets/masterseditionii/FungalBloom.java | 52 ++++ .../sets/masterseditionii/SporeFlower.java | 52 ++++ .../sets/masterseditionii/TheloniteDruid.java | 95 +++++++ .../sets/masterseditionii/Thermokarst.java | 99 +++++++ .../masterseditioniii/FeveredStrength.java | 52 ++++ .../sets/masterseditioniii/LightningBlow.java | 54 ++++ .../sets/masterseditioniv/GateToPhyrexia.java | 52 ++++ .../mage/sets/mercadianmasques/CaveSense.java | 78 ++++++ .../sets/mercadianmasques/CavernCrawler.java | 70 +++++ .../mercadianmasques/HauntedCrossroads.java | 66 +++++ .../sets/mercadianmasques/TigerClaws.java | 82 ++++++ .../mage/sets/mercadianmasques/VineDryad.java | 81 ++++++ .../src/mage/sets/mirage/BenthicDjinn.java | 68 +++++ .../src/mage/sets/mirage/DirtwaterWraith.java | 70 +++++ .../src/mage/sets/mirage/GoblinScouts.java | 76 ++++++ .../src/mage/sets/mirage/UnseenWalker.java | 4 +- .../sets/mirrodinbesieged/SpireSerpent.java | 4 +- .../sets/morningtide/MerrowWitsniper.java | 68 +++++ .../src/mage/sets/portal/IngeniousThief.java | 105 ++++++++ .../src/mage/sets/portal/NaturesCloak.java | 52 ++++ .../src/mage/sets/ravnica/IvyDancer.java | 149 +++++----- .../sets/seventhedition/WallOfWonder.java | 4 +- .../mage/sets/shadowmoor/TattermungeDuo.java | 165 ++++++------ .../mage/sets/starter1999/IngeniousThief.java | 54 ++++ .../mage/sets/starter1999/NaturesCloak.java | 70 +++++ .../mage/sets/stronghold/RollingStones.java | 4 +- .../src/mage/sets/thedark/HiddenPath.java | 72 +++++ .../src/mage/sets/thedark/ScarwoodHag.java | 83 ++++++ .../mage/sets/thedark/WormwoodTreefolk.java | 10 +- .../src/mage/sets/theros/ColossusOfAkros.java | 182 ++++++------- .../src/mage/sets/theros/ReturnedPhalanx.java | 142 +++++----- .../mage/sets/timespiral/WormwoodDryad.java | 10 +- .../mage/sets/torment/SlitheryStalker.java | 96 +++++++ .../mage/sets/urzaslegacy/WeatherseedElf.java | 10 +- .../src/mage/sets/visions/FeralInstinct.java | 68 +++++ .../src/mage/sets/visions/Solfatara.java | 113 ++++++++ ...AsThoughItDidntHaveDefenderAllEffect.java} | 12 +- ...houghItDidntHaveDefenderSourceEffect.java} | 138 +++++----- ...houghItDidntHaveDefenderTargetEffect.java} | 168 ++++++------ .../abilities/keyword/ForestwalkAbility.java | 6 +- .../abilities/keyword/IslandwalkAbility.java | 6 +- .../keyword/MountainwalkAbility.java | 6 +- .../abilities/keyword/PlainswalkAbility.java | 8 +- Mage/src/mage/counters/CounterType.java | 6 + 85 files changed, 5264 insertions(+), 1050 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/alliances/Burnout.java create mode 100644 Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.java create mode 100644 Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.java create mode 100644 Mage.Sets/src/mage/sets/alliances/EnslavedScout1.java create mode 100644 Mage.Sets/src/mage/sets/alliances/EnslavedScout2.java create mode 100644 Mage.Sets/src/mage/sets/alliances/FeveredStrength1.java create mode 100644 Mage.Sets/src/mage/sets/alliances/FeveredStrength2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/SporeFlower.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/DarkMaze.java create mode 100644 Mage.Sets/src/mage/sets/homelands/AysenHighway.java create mode 100644 Mage.Sets/src/mage/sets/homelands/DarkMaze1.java create mode 100644 Mage.Sets/src/mage/sets/homelands/DarkMaze2.java create mode 100644 Mage.Sets/src/mage/sets/homelands/DwarvenPony.java create mode 100644 Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.java create mode 100644 Mage.Sets/src/mage/sets/iceage/Clairvoyance.java create mode 100644 Mage.Sets/src/mage/sets/iceage/ForceVoid.java create mode 100644 Mage.Sets/src/mage/sets/iceage/LightningBlow.java create mode 100644 Mage.Sets/src/mage/sets/iceage/Pyknite.java create mode 100644 Mage.Sets/src/mage/sets/iceage/RayOfErasure.java create mode 100644 Mage.Sets/src/mage/sets/iceage/Thermokarst.java create mode 100644 Mage.Sets/src/mage/sets/iceage/WalkingWall.java create mode 100644 Mage.Sets/src/mage/sets/judgment/MirrorWall.java create mode 100644 Mage.Sets/src/mage/sets/legends/PartWater.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/WalkingWall.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/Burnout.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.java create mode 100644 Mage.Sets/src/mage/sets/mirage/BenthicDjinn.java create mode 100644 Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.java create mode 100644 Mage.Sets/src/mage/sets/mirage/GoblinScouts.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.java create mode 100644 Mage.Sets/src/mage/sets/portal/IngeniousThief.java create mode 100644 Mage.Sets/src/mage/sets/portal/NaturesCloak.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/IngeniousThief.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/NaturesCloak.java create mode 100644 Mage.Sets/src/mage/sets/thedark/HiddenPath.java create mode 100644 Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java create mode 100644 Mage.Sets/src/mage/sets/torment/SlitheryStalker.java create mode 100644 Mage.Sets/src/mage/sets/visions/FeralInstinct.java create mode 100644 Mage.Sets/src/mage/sets/visions/Solfatara.java rename Mage/src/mage/abilities/effects/common/combat/{CanAttackAsThoughtItDidntHaveDefenderAllEffect.java => CanAttackAsThoughItDidntHaveDefenderAllEffect.java} (86%) rename Mage/src/mage/abilities/effects/common/combat/{CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java => CanAttackAsThoughItDidntHaveDefenderSourceEffect.java} (82%) rename Mage/src/mage/abilities/effects/common/combat/{CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java => CanAttackAsThoughItDidntHaveDefenderTargetEffect.java} (85%) diff --git a/Mage.Sets/src/mage/sets/alliances/Burnout.java b/Mage.Sets/src/mage/sets/alliances/Burnout.java new file mode 100644 index 0000000000..746f36cd8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/Burnout.java @@ -0,0 +1,107 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class Burnout extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("instant spell"); + + static { + filter.add(new CardTypePredicate(CardType.INSTANT)); + } + + public Burnout(UUID ownerId) { + super(ownerId, 101, "Burnout", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ALL"; + + // Counter target instant spell if it's blue. + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new BurnoutCounterTargetEffect()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public Burnout(final Burnout card) { + super(card); + } + + @Override + public Burnout copy() { + return new Burnout(this); + } +} + +class BurnoutCounterTargetEffect extends OneShotEffect { + + public BurnoutCounterTargetEffect() { + super(Outcome.Detriment); + } + + public BurnoutCounterTargetEffect(final BurnoutCounterTargetEffect effect) { + super(effect); + } + + @Override + public BurnoutCounterTargetEffect copy() { + return new BurnoutCounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){ + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } + + public String getText(Ability source) { + return "Counter target instant spell if it's blue"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.java b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.java new file mode 100644 index 0000000000..a4b0a0bc0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CarrierPigeons1 extends CardImpl { + + public CarrierPigeons1(UUID ownerId) { + super(ownerId, 125, "Carrier Pigeons", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Carrier Pigeons enters the battlefield, draw a card at the beginning of the next turn's upkeep. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false))); + } + + public CarrierPigeons1(final CarrierPigeons1 card) { + super(card); + } + + @Override + public CarrierPigeons1 copy() { + return new CarrierPigeons1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.java b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.java new file mode 100644 index 0000000000..974a74f035 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.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.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CarrierPigeons2 extends mage.sets.alliances.CarrierPigeons1 { + + public CarrierPigeons2(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "ALL"; + } + + public CarrierPigeons2(final CarrierPigeons1 card) { + super(card); + } + + @Override + public CarrierPigeons1 copy() { + return new CarrierPigeons1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/EnslavedScout1.java b/Mage.Sets/src/mage/sets/alliances/EnslavedScout1.java new file mode 100644 index 0000000000..0c8467c1de --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/EnslavedScout1.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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class EnslavedScout1 extends CardImpl { + + public EnslavedScout1(UUID ownerId) { + super(ownerId, 104, "Enslaved Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {2}: Enslaved Scout gains mountainwalk until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new MountainwalkAbility(false), Duration.EndOfTurn), + new GenericManaCost(2))); + } + + public EnslavedScout1(final EnslavedScout1 card) { + super(card); + } + + @Override + public EnslavedScout1 copy() { + return new EnslavedScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/EnslavedScout2.java b/Mage.Sets/src/mage/sets/alliances/EnslavedScout2.java new file mode 100644 index 0000000000..51a1f2cffa --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/EnslavedScout2.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.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EnslavedScout2 extends mage.sets.alliances.EnslavedScout1 { + + public EnslavedScout2(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "ALL"; + } + + public EnslavedScout2(final EnslavedScout1 card) { + super(card); + } + + @Override + public EnslavedScout1 copy() { + return new EnslavedScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/FeveredStrength1.java b/Mage.Sets/src/mage/sets/alliances/FeveredStrength1.java new file mode 100644 index 0000000000..8dbc22aa5d --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/FeveredStrength1.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.alliances; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +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.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FeveredStrength1 extends CardImpl { + + public FeveredStrength1(UUID ownerId) { + super(ownerId, 10, "Fevered Strength", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "ALL"; + + // Target creature gets +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public FeveredStrength1(final FeveredStrength1 card) { + super(card); + } + + @Override + public FeveredStrength1 copy() { + return new FeveredStrength1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/FeveredStrength2.java b/Mage.Sets/src/mage/sets/alliances/FeveredStrength2.java new file mode 100644 index 0000000000..9f87d7e30d --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/FeveredStrength2.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.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FeveredStrength2 extends mage.sets.alliances.FeveredStrength1 { + + public FeveredStrength2(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "ALL"; + } + + public FeveredStrength2(final FeveredStrength1 card) { + super(card); + } + + @Override + public FeveredStrength1 copy() { + return new FeveredStrength1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java new file mode 100644 index 0000000000..ca2291a5eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java @@ -0,0 +1,101 @@ +/* + * 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.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.target.common.TargetArtifactPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GateToPhyrexia extends CardImpl { + + public GateToPhyrexia(UUID ownerId) { + super(ownerId, 46, "Gate to Phyrexia", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); + this.expansionSetCode = "ATQ"; + + // Sacrifice a creature: Destroy target artifact. Activate this ability only during your upkeep and only once each turn. + Ability ability = new GateToPhyrexiaAbility(new DestroyTargetEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public GateToPhyrexia(final GateToPhyrexia card) { + super(card); + } + + @Override + public GateToPhyrexia copy() { + return new GateToPhyrexia(this); + } +} + +class GateToPhyrexiaAbility extends LimitedTimesPerTurnActivatedAbility { + + public GateToPhyrexiaAbility(Effect effect, Cost cost) { + super(Zone.BATTLEFIELD, effect, cost); + } + + public GateToPhyrexiaAbility(final GateToPhyrexiaAbility ability) { + super(ability); + } + + @Override + public GateToPhyrexiaAbility copy() { + return new GateToPhyrexiaAbility(this); + } + + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!game.getActivePlayerId().equals(controllerId) || !PhaseStep.UPKEEP.equals(game.getStep().getType())) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(""); + sb.append(super.getRule()).append(" Activate this ability only during your upkeep."); + return sb.toString(); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java b/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java index 7cad13237f..cc7caa3973 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java @@ -1,78 +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.bornofthegods; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.EnchantedCondition; -import mage.abilities.decorator.ConditionalAsThoughEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class PillarOfWar extends CardImpl { - - public PillarOfWar(UUID ownerId) { - super(ownerId, 160, "Pillar of War", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "BNG"; - this.subtype.add("Golem"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // As long as Pillar of War is enchanted, it can attack as though it didn't have defender. - Effect effect = new ConditionalAsThoughEffect( - new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - new EnchantedCondition()); - effect.setText("As long as {this} is enchanted, it can attack as though it didn't have defender"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - - } - - public PillarOfWar(final PillarOfWar card) { - super(card); - } - - @Override - public PillarOfWar copy() { - return new PillarOfWar(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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EnchantedCondition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class PillarOfWar extends CardImpl { + + public PillarOfWar(UUID ownerId) { + super(ownerId, 160, "Pillar of War", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Golem"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // As long as Pillar of War is enchanted, it can attack as though it didn't have defender. + Effect effect = new ConditionalAsThoughEffect( + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + new EnchantedCondition()); + effect.setText("As long as {this} is enchanted, it can attack as though it didn't have defender"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + } + + public PillarOfWar(final PillarOfWar card) { + super(card); + } + + @Override + public PillarOfWar copy() { + return new PillarOfWar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java b/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java index ef7df54b8b..aefa67bd5d 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java +++ b/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java @@ -1,80 +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.conspiracy; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderAllEffect; -import mage.abilities.keyword.DefenderAbility; -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.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.AbilityPredicate; - -/** - * - * @author LevelX2 - */ -public class WakestoneGargoyle extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control with defender"); - - static { - filter.add(new AbilityPredicate(DefenderAbility.class)); - } - - public WakestoneGargoyle(UUID ownerId) { - super(ownerId, 88, "Wakestone Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "CNS"; - this.subtype.add("Gargoyle"); - this.power = new MageInt(3); - this.toughness = new MageInt(4); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // Flying - this.addAbility(FlyingAbility.getInstance()); - // {1}{W}: Creatures you control with defender can attack this turn as though they didn't have defender. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{W}") )); - } - - public WakestoneGargoyle(final WakestoneGargoyle card) { - super(card); - } - - @Override - public WakestoneGargoyle copy() { - return new WakestoneGargoyle(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.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderAllEffect; +import mage.abilities.keyword.DefenderAbility; +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.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LevelX2 + */ +public class WakestoneGargoyle extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public WakestoneGargoyle(UUID ownerId) { + super(ownerId, 88, "Wakestone Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{W}: Creatures you control with defender can attack this turn as though they didn't have defender. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{W}") )); + } + + public WakestoneGargoyle(final WakestoneGargoyle card) { + super(card); + } + + @Override + public WakestoneGargoyle copy() { + return new WakestoneGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java index 75a189ac7a..cc4aa55047 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java @@ -1,127 +1,127 @@ -/* - * 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.dragonsoftarkir; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderTargetEffect; -import mage.abilities.effects.common.continuous.BoostControlledEffect; -import mage.abilities.keyword.DefenderAbility; -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.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.filter.predicate.permanent.ControllerIdPredicate; -import mage.game.Game; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class AssaultFormation extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender"); - - static { - filter.add(new AbilityPredicate(DefenderAbility.class)); - } - - public AssaultFormation(UUID ownerId) { - super(ownerId, 173, "Assault Formation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); - this.expansionSetCode = "DTK"; - - // Each creature you control assigns combat damage equal to its toughness rather than its power. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AssaultFormationCombatDamageRuleEffect())); - - // {G}: Target creature with defender can attack this turn as though it didn't have defender. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}")); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - - // {2}{G}: Creatures you control get +0/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0,1,Duration.EndOfTurn), new ManaCostsImpl("{2}{G}"))); - - } - - public AssaultFormation(final AssaultFormation card) { - super(card); - } - - @Override - public AssaultFormation copy() { - return new AssaultFormation(this); - } -} - -class AssaultFormationCombatDamageRuleEffect extends ContinuousEffectImpl { - - public AssaultFormationCombatDamageRuleEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Each creature you control assigns combat damage equal to its toughness rather than its power"; - } - - public AssaultFormationCombatDamageRuleEffect(final AssaultFormationCombatDamageRuleEffect effect) { - super(effect); - } - - @Override - public AssaultFormationCombatDamageRuleEffect copy() { - return new AssaultFormationCombatDamageRuleEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - // Change the rule - FilterCreaturePermanent filter = new FilterCreaturePermanent(); - filter.add(new ControllerIdPredicate(source.getControllerId())); - game.getCombat().setUseToughnessForDamage(true); - game.getCombat().addUseToughnessForDamageFilter(filter); - return true; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.RulesEffects; - } -} +/* + * 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.dragonsoftarkir; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderTargetEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.DefenderAbility; +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.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AssaultFormation extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public AssaultFormation(UUID ownerId) { + super(ownerId, 173, "Assault Formation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "DTK"; + + // Each creature you control assigns combat damage equal to its toughness rather than its power. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AssaultFormationCombatDamageRuleEffect())); + + // {G}: Target creature with defender can attack this turn as though it didn't have defender. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + // {2}{G}: Creatures you control get +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0,1,Duration.EndOfTurn), new ManaCostsImpl("{2}{G}"))); + + } + + public AssaultFormation(final AssaultFormation card) { + super(card); + } + + @Override + public AssaultFormation copy() { + return new AssaultFormation(this); + } +} + +class AssaultFormationCombatDamageRuleEffect extends ContinuousEffectImpl { + + public AssaultFormationCombatDamageRuleEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Each creature you control assigns combat damage equal to its toughness rather than its power"; + } + + public AssaultFormationCombatDamageRuleEffect(final AssaultFormationCombatDamageRuleEffect effect) { + super(effect); + } + + @Override + public AssaultFormationCombatDamageRuleEffect copy() { + return new AssaultFormationCombatDamageRuleEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + // Change the rule + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new ControllerIdPredicate(source.getControllerId())); + game.getCombat().setUseToughnessForDamage(true); + game.getCombat().addUseToughnessForDamageFilter(filter); + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.RulesEffects; + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java index 964d318d10..25e776fc6a 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java @@ -1,79 +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.dragonsoftarkir; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.ActivateIfConditionActivatedAbility; -import mage.abilities.condition.common.FormidableCondition; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.AbilityWord; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class GladeWatcher extends CardImpl { - - public GladeWatcher(UUID ownerId) { - super(ownerId, 188, "Glade Watcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "DTK"; - this.subtype.add("Elemental"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // Formidable - {G}: Glade Watcher can attack this turn as though it didn't have defender. Activate this ability only if creatures you control have total power 8 or greater. - Ability ability = new ActivateIfConditionActivatedAbility( - Zone.BATTLEFIELD, - new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), - new ManaCostsImpl("{G}"), - FormidableCondition.getInstance()); - ability.setAbilityWord(AbilityWord.FORMIDABLE); - this.addAbility(ability); - } - - public GladeWatcher(final GladeWatcher card) { - super(card); - } - - @Override - public GladeWatcher copy() { - return new GladeWatcher(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.dragonsoftarkir; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.FormidableCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class GladeWatcher extends CardImpl { + + public GladeWatcher(UUID ownerId) { + super(ownerId, 188, "Glade Watcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "DTK"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Formidable - {G}: Glade Watcher can attack this turn as though it didn't have defender. Activate this ability only if creatures you control have total power 8 or greater. + Ability ability = new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), + new ManaCostsImpl("{G}"), + FormidableCondition.getInstance()); + ability.setAbilityWord(AbilityWord.FORMIDABLE); + this.addAbility(ability); + } + + public GladeWatcher(final GladeWatcher card) { + super(card); + } + + @Override + public GladeWatcher copy() { + return new GladeWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.java b/Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.java new file mode 100644 index 0000000000..2f78159108 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.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.fallenempires; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EbonPraetor extends mage.sets.masterseditionii.EbonPraetor { + + public EbonPraetor(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "FEM"; + } + + public EbonPraetor(final EbonPraetor card) { + super(card); + } + + @Override + public EbonPraetor copy() { + return new EbonPraetor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java b/Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java new file mode 100644 index 0000000000..5f7689c098 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class FungalBloom extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Fungus"); + + static { + filter.add(new SubtypePredicate("Fungus")); + } + + public FungalBloom(UUID ownerId) { + super(ownerId, 79, "Fungal Bloom", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); + this.expansionSetCode = "FEM"; + + // {G}{G}: Put a spore counter on target Fungus. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new AddCountersTargetEffect(CounterType.SPORE.createInstance()), + new ManaCostsImpl("{G}{G}")); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public FungalBloom(final FungalBloom card) { + super(card); + } + + @Override + public FungalBloom copy() { + return new FungalBloom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.java b/Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.java new file mode 100644 index 0000000000..8c42a0096a --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.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.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RiverMerfolk extends mage.sets.mastersedition.RiverMerfolk { + + public RiverMerfolk(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.RARE; + } + + public RiverMerfolk(final RiverMerfolk card) { + super(card); + } + + @Override + public RiverMerfolk copy() { + return new RiverMerfolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/SporeFlower.java b/Mage.Sets/src/mage/sets/fallenempires/SporeFlower.java new file mode 100644 index 0000000000..adafcc64ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/SporeFlower.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.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.common.PreventAllDamageByAllEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author fireshoes + */ +public class SporeFlower extends CardImpl { + + public SporeFlower(UUID ownerId) { + super(ownerId, 86, "Spore Flower", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Fungus"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // At the beginning of your upkeep, put a spore counter on Spore Flower. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); + + // Remove three spore counters from Spore Flower: Prevent all combat damage that would be dealt this turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventAllDamageByAllEffect(Duration.EndOfTurn, true), + new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); + } + + public SporeFlower(final SporeFlower card) { + super(card); + } + + @Override + public SporeFlower copy() { + return new SporeFlower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.java b/Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.java new file mode 100644 index 0000000000..ded9f9f2cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.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.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class TheloniteDruid extends mage.sets.masterseditionii.TheloniteDruid { + + public TheloniteDruid(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.UNCOMMON; + } + + public TheloniteDruid(final TheloniteDruid card) { + super(card); + } + + @Override + public TheloniteDruid copy() { + return new TheloniteDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java b/Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java new file mode 100644 index 0000000000..6c750b0089 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java @@ -0,0 +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. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class TheloniteMonk extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("green creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public TheloniteMonk(UUID ownerId) { + super(ownerId, 93, "Thelonite Monk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Insect"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}, Sacrifice a green creature: Target land becomes a Forest. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.WhileOnBattlefield, "Forest"), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public TheloniteMonk(final TheloniteMonk card) { + super(card); + } + + @Override + public TheloniteMonk copy() { + return new TheloniteMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/DarkMaze.java b/Mage.Sets/src/mage/sets/fifthedition/DarkMaze.java new file mode 100644 index 0000000000..c4777eec23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/DarkMaze.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.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class DarkMaze extends CardImpl { + + public DarkMaze(UUID ownerId) { + super(ownerId, 80, "Dark Maze", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Wall"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {0}: Dark Maze can attack this turn as though it didn't have defender. Exile it at the beginning of the next end step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), + new GenericManaCost(0)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ExileSourceEffect()))); + this.addAbility(ability); + } + + public DarkMaze(final DarkMaze card) { + super(card); + } + + @Override + public DarkMaze copy() { + return new DarkMaze(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AysenHighway.java b/Mage.Sets/src/mage/sets/homelands/AysenHighway.java new file mode 100644 index 0000000000..6076d9727f --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AysenHighway.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.homelands; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.PlainswalkAbility; +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.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class AysenHighway extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public AysenHighway(UUID ownerId) { + super(ownerId, 107, "Aysen Highway", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}{W}"); + this.expansionSetCode = "HML"; + + // White creatures have plainswalk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(new PlainswalkAbility(false), Duration.WhileOnBattlefield, filter))); + } + + public AysenHighway(final AysenHighway card) { + super(card); + } + + @Override + public AysenHighway copy() { + return new AysenHighway(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DarkMaze1.java b/Mage.Sets/src/mage/sets/homelands/DarkMaze1.java new file mode 100644 index 0000000000..82d0978872 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DarkMaze1.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.homelands; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DarkMaze1 extends mage.sets.fifthedition.DarkMaze { + + public DarkMaze1(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + this.expansionSetCode = "HML"; + } + + public DarkMaze1(final DarkMaze1 card) { + super(card); + } + + @Override + public DarkMaze1 copy() { + return new DarkMaze1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DarkMaze2.java b/Mage.Sets/src/mage/sets/homelands/DarkMaze2.java new file mode 100644 index 0000000000..5d5cce4955 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DarkMaze2.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.homelands; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DarkMaze2 extends mage.sets.fifthedition.DarkMaze { + + public DarkMaze2(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + this.expansionSetCode = "HML"; + } + + public DarkMaze2(final DarkMaze2 card) { + super(card); + } + + @Override + public DarkMaze2 copy() { + return new DarkMaze2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DwarvenPony.java b/Mage.Sets/src/mage/sets/homelands/DwarvenPony.java new file mode 100644 index 0000000000..9c93806273 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DwarvenPony.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.homelands; + +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.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.MountainwalkAbility; +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.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DwarvenPony extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dwarf creature"); + + static { + filter.add(new SubtypePredicate("Dwarf")); + } + + public DwarvenPony(UUID ownerId) { + super(ownerId, 89, "Dwarven Pony", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "HML"; + this.subtype.add("Horse"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{R}, {tap}: Target Dwarf creature gains mountainwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new MountainwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DwarvenPony(final DwarvenPony card) { + super(card); + } + + @Override + public DwarvenPony copy() { + return new DwarvenPony(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.java b/Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.java new file mode 100644 index 0000000000..44cd78ecf5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.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.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class VeldraneOfSengir extends CardImpl { + + public VeldraneOfSengir(UUID ownerId) { + super(ownerId, 25, "Veldrane of Sengir", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "HML"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {1}{B}{B}: Veldrane of Sengir gets -3/-0 and gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-3, -0, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}{B}")); + ability.addEffect(new GainAbilitySourceEffect(new ForestwalkAbility(false), Duration.EndOfTurn)); + this.addAbility(ability); + } + + public VeldraneOfSengir(final VeldraneOfSengir card) { + super(card); + } + + @Override + public VeldraneOfSengir copy() { + return new VeldraneOfSengir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java b/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java new file mode 100644 index 0000000000..997effb3bd --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java @@ -0,0 +1,102 @@ +/* + * 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.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class Clairvoyance extends CardImpl { + + public Clairvoyance(UUID ownerId) { + super(ownerId, 63, "Clairvoyance", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "ICE"; + + // Look at target player's hand. + this.getSpellAbility().addEffect(new ClairvoyanceEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public Clairvoyance(final Clairvoyance card) { + super(card); + } + + @Override + public Clairvoyance copy() { + return new Clairvoyance(this); + } +} + +class ClairvoyanceEffect extends OneShotEffect { + + ClairvoyanceEffect() { + super(Outcome.DrawCard); + staticText = "Look at target player's hand"; + } + + ClairvoyanceEffect(final ClairvoyanceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = source.getSourceObject(game); + if (player != null && controller != null && sourceObject != null) { + controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); + } + return true; + } + + @Override + public ClairvoyanceEffect copy() { + return new ClairvoyanceEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/iceage/ForceVoid.java b/Mage.Sets/src/mage/sets/iceage/ForceVoid.java new file mode 100644 index 0000000000..5ade9bb6d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ForceVoid.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.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class ForceVoid extends CardImpl { + + public ForceVoid(UUID ownerId) { + super(ownerId, 70, "Force Void", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "ICE"; + + // Counter target spell unless its controller pays {1}. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(1))); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public ForceVoid(final ForceVoid card) { + super(card); + } + + @Override + public ForceVoid copy() { + return new ForceVoid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/LightningBlow.java b/Mage.Sets/src/mage/sets/iceage/LightningBlow.java new file mode 100644 index 0000000000..538d9b3a54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/LightningBlow.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.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class LightningBlow extends CardImpl { + + public LightningBlow(UUID ownerId) { + super(ownerId, 266, "Lightning Blow", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "ICE"; + + // Target creature gains first strike until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public LightningBlow(final LightningBlow card) { + super(card); + } + + @Override + public LightningBlow copy() { + return new LightningBlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Pyknite.java b/Mage.Sets/src/mage/sets/iceage/Pyknite.java new file mode 100644 index 0000000000..bd47c40fb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Pyknite.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.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Pyknite extends CardImpl { + + public Pyknite(UUID ownerId) { + super(ownerId, 146, "Pyknite", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Ouphe"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Pyknite enters the battlefield, draw a card at the beginning of the next turn's upkeep. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse)), false)); + } + + public Pyknite(final Pyknite card) { + super(card); + } + + @Override + public Pyknite copy() { + return new Pyknite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/RayOfErasure.java b/Mage.Sets/src/mage/sets/iceage/RayOfErasure.java new file mode 100644 index 0000000000..aa53042485 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/RayOfErasure.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.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class RayOfErasure extends CardImpl { + + public RayOfErasure(UUID ownerId) { + super(ownerId, 93, "Ray of Erasure", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "ICE"; + + // Target player puts the top card of his or her library into his or her graveyard. + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public RayOfErasure(final RayOfErasure card) { + super(card); + } + + @Override + public RayOfErasure copy() { + return new RayOfErasure(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Thermokarst.java b/Mage.Sets/src/mage/sets/iceage/Thermokarst.java new file mode 100644 index 0000000000..bfb85909f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Thermokarst.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.iceage; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Thermokarst extends mage.sets.masterseditionii.Thermokarst { + + public Thermokarst(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "ICE"; + this.rarity = Rarity.UNCOMMON; + } + + public Thermokarst(final Thermokarst card) { + super(card); + } + + @Override + public Thermokarst copy() { + return new Thermokarst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/WalkingWall.java b/Mage.Sets/src/mage/sets/iceage/WalkingWall.java new file mode 100644 index 0000000000..9db4cff12f --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/WalkingWall.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WalkingWall extends mage.sets.mastersedition.WalkingWall { + + public WalkingWall(UUID ownerId) { + super(ownerId); + this.cardNumber = 321; + this.expansionSetCode = "ICE"; + } + + public WalkingWall(final WalkingWall card) { + super(card); + } + + @Override + public WalkingWall copy() { + return new WalkingWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java b/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java index 308b7b9a5f..e28139b407 100644 --- a/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java +++ b/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DefenderAbility; @@ -65,7 +65,7 @@ public class PrisonBarricade extends CardImpl { // If Prison Barricade was kicked, it enters the battlefield with a +1/+1 counter on it and with "Prison Barricade can attack as though it didn't have defender." Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", ""); - ability.addEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java b/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java index 29da0bee89..722ad3248c 100644 --- a/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java +++ b/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java @@ -1,86 +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.judgment; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.ForestwalkAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.PhaseStep; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class ErhnamDjinn extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature an opponent controls"); - - static { - filter.add(Predicates.not(new SubtypePredicate("Wall"))); - filter.add(new ControllerPredicate(TargetController.OPPONENT)); - } - - public ErhnamDjinn(UUID ownerId) { - super(ownerId, 113, "Erhnam Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "JUD"; - this.subtype.add("Djinn"); - - this.power = new MageInt(4); - this.toughness = new MageInt(5); - - // At the beginning of your upkeep, target non-Wall creature an opponent controls gains forestwalk until your next upkeep. - GainAbilityTargetEffect effect = new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.Custom, - "target non-Wall creature an opponent controls gains forestwalk until your next upkeep"); - effect.setDurationToPhase(PhaseStep.UPKEEP); - Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - } - - public ErhnamDjinn(final ErhnamDjinn card) { - super(card); - } - - @Override - public ErhnamDjinn copy() { - return new ErhnamDjinn(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.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ErhnamDjinn extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature an opponent controls"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Wall"))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public ErhnamDjinn(UUID ownerId) { + super(ownerId, 113, "Erhnam Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Djinn"); + + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // At the beginning of your upkeep, target non-Wall creature an opponent controls gains forestwalk until your next upkeep. + GainAbilityTargetEffect effect = new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.Custom, + "target non-Wall creature an opponent controls gains forestwalk until your next upkeep"); + effect.setDurationToPhase(PhaseStep.UPKEEP); + Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ErhnamDjinn(final ErhnamDjinn card) { + super(card); + } + + @Override + public ErhnamDjinn copy() { + return new ErhnamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/MirrorWall.java b/Mage.Sets/src/mage/sets/judgment/MirrorWall.java new file mode 100644 index 0000000000..49e4b023fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/MirrorWall.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.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class MirrorWall extends CardImpl { + + public MirrorWall(UUID ownerId) { + super(ownerId, 47, "Mirror Wall", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Wall"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {W}: Mirror Wall can attack this turn as though it didn't have defender. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), + new ManaCostsImpl("{W}"))); + } + + public MirrorWall(final MirrorWall card) { + super(card); + } + + @Override + public MirrorWall copy() { + return new MirrorWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/PartWater.java b/Mage.Sets/src/mage/sets/legends/PartWater.java new file mode 100644 index 0000000000..6c9b191df2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PartWater.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class PartWater extends CardImpl { + + public PartWater(UUID ownerId) { + super(ownerId, 66, "Part Water", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); + this.expansionSetCode = "LEG"; + + // X target creatures gain islandwalk until end of turn. + Effect effect = new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn); + effect.setText("X target creatures gain islandwalk until end of turn"); + this.getSpellAbility().getEffects().add(effect); + this.getSpellAbility().getTargets().add(new TargetCreaturePermanent(1,1)); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain islandwalk until end of turn"); + ability.getTargets().add(new TargetCreaturePermanent(0, xValue, filter, false)); + } + } + + public PartWater(final PartWater card) { + super(card); + } + + @Override + public PartWater copy() { + return new PartWater(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java b/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java index 6e15de5467..61e59beef9 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -73,7 +73,7 @@ public class AnimateWall extends CardImpl { this.addAbility(ability); // Enchanted Wall can attack as though it didn't have defender. - Ability canAttackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); + Ability canAttackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); Effect enchantEffect = new GainAbilityAttachedEffect(canAttackAbility, AttachmentType.AURA, Duration.WhileOnBattlefield); enchantEffect.setText("Enchanted Wall can attack as though it didn't have defender"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, enchantEffect)); diff --git a/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java b/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java index 0f9fedacea..c479997933 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java +++ b/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java @@ -1,92 +1,92 @@ -/* - * 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.TapSourceCost; -import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; -import mage.abilities.effects.common.continuous.BoostTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.IslandwalkAbility; -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.mageobject.SubtypePredicate; -import mage.target.Target; -import mage.target.common.TargetCreaturePermanent; -import mage.target.common.TargetLandPermanent; - -/** - * - * @author LevelX2 - */ -public class StreambedAquitects extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Merfolk creature"); - static { - filter.add(new SubtypePredicate("Merfolk")); - } - - public StreambedAquitects(UUID ownerId) { - super(ownerId, 91, "Streambed Aquitects", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); - this.expansionSetCode = "LRW"; - this.subtype.add("Merfolk"); - this.subtype.add("Scout"); - - this.power = new MageInt(2); - this.toughness = new MageInt(3); - - // {tap}: Target Merfolk creature gets +1/+1 and gains islandwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1,1, Duration.EndOfTurn), new TapSourceCost()); - ability.addEffect(new GainAbilityTargetEffect(new IslandwalkAbility(), Duration.EndOfTurn)); - Target target = new TargetCreaturePermanent(filter); - ability.addTarget(target); - this.addAbility(ability); - - // {tap}: Target land becomes an Island until end of turn. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Island"), new TapSourceCost()); - target = new TargetLandPermanent(); - ability.addTarget(target); - this.addAbility(ability); - } - - public StreambedAquitects(final StreambedAquitects card) { - super(card); - } - - @Override - public StreambedAquitects copy() { - return new StreambedAquitects(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.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +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.mageobject.SubtypePredicate; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LevelX2 + */ +public class StreambedAquitects extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Merfolk creature"); + static { + filter.add(new SubtypePredicate("Merfolk")); + } + + public StreambedAquitects(UUID ownerId) { + super(ownerId, 91, "Streambed Aquitects", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + this.subtype.add("Scout"); + + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {tap}: Target Merfolk creature gets +1/+1 and gains islandwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1,1, Duration.EndOfTurn), new TapSourceCost()); + ability.addEffect(new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn)); + Target target = new TargetCreaturePermanent(filter); + ability.addTarget(target); + this.addAbility(ability); + + // {tap}: Target land becomes an Island until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Island"), new TapSourceCost()); + target = new TargetLandPermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public StreambedAquitects(final StreambedAquitects card) { + super(card); + } + + @Override + public StreambedAquitects copy() { + return new StreambedAquitects(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.java b/Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.java new file mode 100644 index 0000000000..4c82f59b69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.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.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class RiverMerfolk extends CardImpl { + + public RiverMerfolk(UUID ownerId) { + super(ownerId, 47, "River Merfolk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}{U}"); + this.expansionSetCode = "MED"; + this.subtype.add("Merfolk"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {U}: River Merfolk gains mountainwalk until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new MountainwalkAbility(false), Duration.EndOfTurn), + new ManaCostsImpl("{U}"))); + } + + public RiverMerfolk(final RiverMerfolk card) { + super(card); + } + + @Override + public RiverMerfolk copy() { + return new RiverMerfolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/WalkingWall.java b/Mage.Sets/src/mage/sets/mastersedition/WalkingWall.java new file mode 100644 index 0000000000..d920da69c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/WalkingWall.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.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class WalkingWall extends CardImpl { + + public WalkingWall(UUID ownerId) { + super(ownerId, 172, "Walking Wall", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MED"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(6); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {3}: Walking Wall gets +3/-1 until end of turn and can attack this turn as though it didn't have defender. Activate this ability only once each turn. + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, -1, Duration.EndOfTurn), new GenericManaCost(3)); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn)); + this.addAbility(ability); + } + + public WalkingWall(final WalkingWall card) { + super(card); + } + + @Override + public WalkingWall copy() { + return new WalkingWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Burnout.java b/Mage.Sets/src/mage/sets/masterseditionii/Burnout.java new file mode 100644 index 0000000000..523442c030 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Burnout.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Burnout extends mage.sets.alliances.Burnout { + + public Burnout(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "ME2"; + } + + public Burnout(final Burnout card) { + super(card); + } + + @Override + public Burnout copy() { + return new Burnout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java new file mode 100644 index 0000000000..4aac7c7bd1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java @@ -0,0 +1,156 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class EbonPraetor extends CardImpl { + + public EbonPraetor(UUID ownerId) { + super(ownerId, 89, "Ebon Praetor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Avatar"); + this.subtype.add("Praetor"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // At the beginning of your upkeep, put a -2/-2 counter on Ebon Praetor. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.M2M2.createInstance()), TargetController.YOU, false)); + + // Sacrifice a creature: Remove a -2/-2 counter from Ebon Praetor. If the sacrificed creature was a Thrull, put a +1/+0 counter on Ebon Praetor. Activate this ability only during your upkeep and only once each turn. + Ability ability = new EbonPraetorAbility(new RemoveCounterSourceEffect(CounterType.M2M2.createInstance()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addEffect(new EbonPraetorEffect()); + this.addAbility(ability); + } + + public EbonPraetor(final EbonPraetor card) { + super(card); + } + + @Override + public EbonPraetor copy() { + return new EbonPraetor(this); + } +} + +class EbonPraetorAbility extends LimitedTimesPerTurnActivatedAbility { + + public EbonPraetorAbility(Effect effect, Cost cost) { + super(Zone.BATTLEFIELD, effect, cost); + } + + public EbonPraetorAbility(final EbonPraetorAbility ability) { + super(ability); + } + + @Override + public EbonPraetorAbility copy() { + return new EbonPraetorAbility(this); + } + + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!game.getActivePlayerId().equals(controllerId) || !PhaseStep.UPKEEP.equals(game.getStep().getType())) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(""); + sb.append(super.getRule()).append(" Activate this ability only during your upkeep."); + return sb.toString(); + } +} + +class EbonPraetorEffect extends OneShotEffect { + + public EbonPraetorEffect() { + super(Outcome.BoostCreature); + this.staticText = "If the sacrificed creature was a Thrull, put a +1/+0 counter on {this}"; + } + + public EbonPraetorEffect(final EbonPraetorEffect effect) { + super(effect); + } + + @Override + public EbonPraetorEffect copy() { + return new EbonPraetorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost) { + Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sacrificedCreature.hasSubtype("Thrull") && sourceCreature != null) { + sourceCreature.addCounters(CounterType.P1P0.createInstance(), game); + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java b/Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java new file mode 100644 index 0000000000..9bde0a88d3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FungalBloom extends mage.sets.fallenempires.FungalBloom { + + public FungalBloom(UUID ownerId) { + super(ownerId); + this.cardNumber = 165; + this.expansionSetCode = "ME2"; + } + + public FungalBloom(final FungalBloom card) { + super(card); + } + + @Override + public FungalBloom copy() { + return new FungalBloom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java b/Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java new file mode 100644 index 0000000000..e31dcc7dec --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SporeFlower extends mage.sets.fallenempires.SporeFlower { + + public SporeFlower(UUID ownerId) { + super(ownerId); + this.cardNumber = 177; + this.expansionSetCode = "ME2"; + } + + public SporeFlower(final SporeFlower card) { + super(card); + } + + @Override + public SporeFlower copy() { + return new SporeFlower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java b/Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java new file mode 100644 index 0000000000..76a2c1bead --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; +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.permanent.token.Token; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class TheloniteDruid extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Forests you control"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public TheloniteDruid(UUID ownerId) { + super(ownerId, 182, "Thelonite Druid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{G}, {tap}, Sacrifice a creature: Forests you control become 2/3 creatures until end of turn. They're still lands. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BecomesCreatureAllEffect(new TheloniteDruidLandToken(), "Forests", filter, Duration.EndOfTurn), + new ManaCostsImpl("{1}{G}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.addAbility(ability); + } + + public TheloniteDruid(final TheloniteDruid card) { + super(card); + } + + @Override + public TheloniteDruid copy() { + return new TheloniteDruid(this); + } +} + +class TheloniteDruidLandToken extends Token { + public TheloniteDruidLandToken() { + super("", "2/3 creatures"); + cardType.add(CardType.CREATURE); + power = new MageInt(2); + toughness = new MageInt(3); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java new file mode 100644 index 0000000000..08305c042c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class Thermokarst extends CardImpl { + + public Thermokarst(UUID ownerId) { + super(ownerId, 183, "Thermokarst", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); + this.expansionSetCode = "ME2"; + + // Destroy target land. If that land was a snow land, you gain 1 life. + this.getSpellAbility().addEffect(new ThermokarstEffect()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + } + + public Thermokarst(final Thermokarst card) { + super(card); + } + + @Override + public Thermokarst copy() { + return new Thermokarst(this); + } +} + +class ThermokarstEffect extends OneShotEffect { + + public ThermokarstEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy target land. If that land was a snow land, you gain 1 life."; + } + + public ThermokarstEffect(final ThermokarstEffect effect) { + super(effect); + } + + @Override + public ThermokarstEffect copy() { + return new ThermokarstEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && controller != null) { + permanent.destroy(source.getSourceId(), game, false); + if (permanent.getSupertype().contains("Snow")) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(1, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java b/Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java new file mode 100644 index 0000000000..47fd69436c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FeveredStrength extends mage.sets.alliances.FeveredStrength1 { + + public FeveredStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 66; + this.expansionSetCode = "ME3"; + } + + public FeveredStrength(final FeveredStrength card) { + super(card); + } + + @Override + public FeveredStrength copy() { + return new FeveredStrength(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.java b/Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.java new file mode 100644 index 0000000000..b536eee6dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.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 LightningBlow extends mage.sets.iceage.LightningBlow { + + public LightningBlow(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public LightningBlow(final LightningBlow card) { + super(card); + } + + @Override + public LightningBlow copy() { + return new LightningBlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.java new file mode 100644 index 0000000000..0dcdf6b782 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GateToPhyrexia extends mage.sets.antiquities.GateToPhyrexia { + + public GateToPhyrexia(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "ME4"; + } + + public GateToPhyrexia(final GateToPhyrexia card) { + super(card); + } + + @Override + public GateToPhyrexia copy() { + return new GateToPhyrexia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java new file mode 100644 index 0000000000..e04760cb83 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.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.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CaveSense extends CardImpl { + + public CaveSense(UUID ownerId) { + super(ownerId, 179, "Cave Sense", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has mountainwalk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new MountainwalkAbility(), AttachmentType.AURA))); + } + + public CaveSense(final CaveSense card) { + super(card); + } + + @Override + public CaveSense copy() { + return new CaveSense(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.java b/Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.java new file mode 100644 index 0000000000..f800a3e61c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.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.mercadianmasques; + +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.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class CavernCrawler extends CardImpl { + + public CavernCrawler(UUID ownerId) { + super(ownerId, 181, "Cavern Crawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Mountainwalk + this.addAbility(new MountainwalkAbility()); + + // {R}: Cavern Crawler gets +1/-1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public CavernCrawler(final CavernCrawler card) { + super(card); + } + + @Override + public CavernCrawler copy() { + return new CavernCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java new file mode 100644 index 0000000000..47af6159d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.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.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author fireshoes + */ +public class HauntedCrossroads extends CardImpl { + + public HauntedCrossroads(UUID ownerId) { + super(ownerId, 138, "Haunted Crossroads", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "MMQ"; + + // {B}: Put target creature card from your graveyard on top of your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{B}")); + ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.addAbility(ability); + } + + public HauntedCrossroads(final HauntedCrossroads card) { + super(card); + } + + @Override + public HauntedCrossroads copy() { + return new HauntedCrossroads(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java new file mode 100644 index 0000000000..f18c186b97 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.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.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class TigerClaws extends CardImpl { + + public TigerClaws(UUID ownerId) { + super(ownerId, 279, "Tiger Claws", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Aura"); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has trample. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA))); + } + + public TigerClaws(final TigerClaws card) { + super(card); + } + + @Override + public TigerClaws copy() { + return new TigerClaws(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.java b/Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.java new file mode 100644 index 0000000000..1ce491629c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.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.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.ExileFromHandCost; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterOwnedCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardIdPredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInHand; + +/** + * + * @author fireshoes + */ +public class VineDryad extends CardImpl { + + public VineDryad(UUID ownerId) { + super(ownerId, 284, "Vine Dryad", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Dryad"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Forestwalk + this.addAbility(new ForestwalkAbility()); + + // You may exile a green card from your hand rather than pay Vine Dryad's mana cost. + FilterOwnedCard filter = new FilterOwnedCard("a green card from your hand"); + filter.add(new ColorPredicate(ObjectColor.GREEN)); + filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself + + this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter)))); + } + + public VineDryad(final VineDryad card) { + super(card); + } + + @Override + public VineDryad copy() { + return new VineDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/BenthicDjinn.java b/Mage.Sets/src/mage/sets/mirage/BenthicDjinn.java new file mode 100644 index 0000000000..e0602d4fee --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/BenthicDjinn.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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class BenthicDjinn extends CardImpl { + + public BenthicDjinn(UUID ownerId) { + super(ownerId, 317, "Benthic Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Djinn"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Islandwalk + this.addAbility(new IslandwalkAbility()); + + // At the beginning of your upkeep, you lose 2 life. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(2), TargetController.YOU, false)); + } + + public BenthicDjinn(final BenthicDjinn card) { + super(card); + } + + @Override + public BenthicDjinn copy() { + return new BenthicDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.java b/Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.java new file mode 100644 index 0000000000..285ca37a10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.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.mirage; + +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.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 DirtwaterWraith extends CardImpl { + + public DirtwaterWraith(UUID ownerId) { + super(ownerId, 15, "Dirtwater Wraith", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Wraith"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + + // {B}: Dirtwater Wraith gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public DirtwaterWraith(final DirtwaterWraith card) { + super(card); + } + + @Override + public DirtwaterWraith copy() { + return new DirtwaterWraith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/GoblinScouts.java b/Mage.Sets/src/mage/sets/mirage/GoblinScouts.java new file mode 100644 index 0000000000..87df71dda8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/GoblinScouts.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class GoblinScouts extends CardImpl { + + public GoblinScouts(UUID ownerId) { + super(ownerId, 178, "Goblin Scouts", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "MIR"; + + // Put three 1/1 red Goblin Scout creature tokens with mountainwalk onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinScoutsToken(), 3)); + } + + public GoblinScouts(final GoblinScouts card) { + super(card); + } + + @Override + public GoblinScouts copy() { + return new GoblinScouts(this); + } +} + +class GoblinScoutsToken extends Token { + + public GoblinScoutsToken() { + super("Goblin Scout", "1/1 red Goblin Scout creature tokens with mountainwalk"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Goblin"); + subtype.add("Scout"); + power = new MageInt(1); + toughness = new MageInt(1); + + this.addAbility(new MountainwalkAbility()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java b/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java index 79df8370f6..bf705f63b2 100644 --- a/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java +++ b/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java @@ -59,7 +59,9 @@ public class UnseenWalker extends CardImpl { this.addAbility(new ForestwalkAbility()); // {1}{G}{G}: Target creature gains forestwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{1}{G}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new ManaCostsImpl("{1}{G}{G}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java index f753cc56de..778d8e7cd6 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java @@ -41,7 +41,7 @@ import mage.abilities.decorator.ConditionalAsThoughEffect; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; @@ -64,7 +64,7 @@ public class SpireSerpent extends CardImpl { this.addAbility(DefenderAbility.getInstance()); ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), MetalcraftCondition.getInstance(), abilityText1); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); - Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), MetalcraftCondition.getInstance()); effect.setText("and can attack as though it didn't have defender"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.java b/Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.java new file mode 100644 index 0000000000..7d58ed1864 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.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.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class MerrowWitsniper extends CardImpl { + + public MerrowWitsniper(UUID ownerId) { + super(ownerId, 40, "Merrow Witsniper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Merrow Witsniper enters the battlefield, target player puts the top card of his or her library into his or her graveyard. + Ability ability = new EntersBattlefieldTriggeredAbility(new PutLibraryIntoGraveTargetEffect(1)); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public MerrowWitsniper(final MerrowWitsniper card) { + super(card); + } + + @Override + public MerrowWitsniper copy() { + return new MerrowWitsniper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/IngeniousThief.java b/Mage.Sets/src/mage/sets/portal/IngeniousThief.java new file mode 100644 index 0000000000..d6e59b8c80 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/IngeniousThief.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.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class IngeniousThief extends CardImpl { + + public IngeniousThief(UUID ownerId) { + super(ownerId, 59, "Ingenious Thief", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Ingenious Thief enters the battlefield, look at target player's hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new IngeniousThiefEffect(), false); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public IngeniousThief(final IngeniousThief card) { + super(card); + } + + @Override + public IngeniousThief copy() { + return new IngeniousThief(this); + } +} + +class IngeniousThiefEffect extends OneShotEffect { + + IngeniousThiefEffect() { + super(Outcome.Benefit); + staticText = "Look at target player's hand"; + } + + IngeniousThiefEffect(final IngeniousThiefEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = source.getSourceObject(game); + if (player != null && controller != null && sourceObject != null) { + controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); + } + return true; + } + + @Override + public IngeniousThiefEffect copy() { + return new IngeniousThiefEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/portal/NaturesCloak.java b/Mage.Sets/src/mage/sets/portal/NaturesCloak.java new file mode 100644 index 0000000000..747aacad57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/NaturesCloak.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.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NaturesCloak extends mage.sets.starter1999.NaturesCloak { + + public NaturesCloak(UUID ownerId) { + super(ownerId); + this.cardNumber = 103; + this.expansionSetCode = "POR"; + } + + public NaturesCloak(final NaturesCloak card) { + super(card); + } + + @Override + public NaturesCloak copy() { + return new NaturesCloak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java b/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java index 189daa2b9f..a8b1512d85 100644 --- a/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java +++ b/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java @@ -1,74 +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.ravnica; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.ForestwalkAbility; -import mage.cards.CardImpl; -import mage.constants.Duration; -import mage.constants.Zone; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author Loki - */ -public class IvyDancer extends CardImpl { - - public IvyDancer(UUID ownerId) { - super(ownerId, 171, "Ivy Dancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); - this.expansionSetCode = "RAV"; - this.subtype.add("Dryad"); - this.subtype.add("Shaman"); - - this.power = new MageInt(1); - this.toughness = new MageInt(2); - - // {tap}: Target creature gains forestwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } - - public IvyDancer(final IvyDancer card) { - super(card); - } - - @Override - public IvyDancer copy() { - return new IvyDancer(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.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +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 Loki + */ +public class IvyDancer extends CardImpl { + + public IvyDancer(UUID ownerId) { + super(ownerId, 171, "Ivy Dancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Dryad"); + this.subtype.add("Shaman"); + + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Target creature gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public IvyDancer(final IvyDancer card) { + super(card); + } + + @Override + public IvyDancer copy() { + return new IvyDancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java b/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java index 8626e9783a..bf3c94bce2 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java +++ b/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; @@ -60,7 +60,7 @@ public class WallOfWonder extends CardImpl { // {2}{U}{U}: Wall of Wonder gets +4/-4 until end of turn and can attack this turn as though it didn't have defender. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(4, -4, Duration.EndOfTurn), new ManaCostsImpl("{2}{U}{U}")); - ability.addEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.EndOfTurn)); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java index 834c2477a3..7e9554c4e2 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java @@ -1,82 +1,83 @@ -/* - * 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.shadowmoor; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.MageInt; -import mage.ObjectColor; -import mage.abilities.common.SpellCastControllerTriggeredAbility; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.ForestwalkAbility; -import mage.cards.CardImpl; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.ColorPredicate; - -/** - * - * @author North - */ -public class TattermungeDuo extends CardImpl { - - private static final FilterSpell redFilter = new FilterSpell("a red spell"); - private static final FilterSpell greenFilter = new FilterSpell("a green spell"); - - static { - redFilter.add(new ColorPredicate(ObjectColor.RED)); - greenFilter.add(new ColorPredicate(ObjectColor.GREEN)); - } - - public TattermungeDuo(UUID ownerId) { - super(ownerId, 218, "Tattermunge Duo", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R/G}"); - this.expansionSetCode = "SHM"; - this.subtype.add("Goblin"); - this.subtype.add("Warrior"); - this.subtype.add("Shaman"); - - this.power = new MageInt(2); - this.toughness = new MageInt(3); - - // Whenever you cast a red spell, Tattermunge Duo gets +1/+1 until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), redFilter, false)); - // Whenever you cast a green spell, Tattermunge Duo gains forestwalk until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new GainAbilitySourceEffect(new ForestwalkAbility(), Duration.EndOfTurn), greenFilter, false)); - } - - public TattermungeDuo(final TattermungeDuo card) { - super(card); - } - - @Override - public TattermungeDuo copy() { - return new TattermungeDuo(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.shadowmoor; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author North + */ +public class TattermungeDuo extends CardImpl { + + private static final FilterSpell redFilter = new FilterSpell("a red spell"); + private static final FilterSpell greenFilter = new FilterSpell("a green spell"); + + static { + redFilter.add(new ColorPredicate(ObjectColor.RED)); + greenFilter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public TattermungeDuo(UUID ownerId) { + super(ownerId, 218, "Tattermunge Duo", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R/G}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.subtype.add("Shaman"); + + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever you cast a red spell, Tattermunge Duo gets +1/+1 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), redFilter, false)); + // Whenever you cast a green spell, Tattermunge Duo gains forestwalk until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new GainAbilitySourceEffect(new ForestwalkAbility(false), + Duration.EndOfTurn), greenFilter, false)); + } + + public TattermungeDuo(final TattermungeDuo card) { + super(card); + } + + @Override + public TattermungeDuo copy() { + return new TattermungeDuo(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/IngeniousThief.java b/Mage.Sets/src/mage/sets/starter1999/IngeniousThief.java new file mode 100644 index 0000000000..5adce61ef9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/IngeniousThief.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.starter1999; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class IngeniousThief extends mage.sets.portal.IngeniousThief { + + public IngeniousThief(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + this.expansionSetCode = "S99"; + this.rarity = Rarity.COMMON; + } + + public IngeniousThief(final IngeniousThief card) { + super(card); + } + + @Override + public IngeniousThief copy() { + return new IngeniousThief(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/NaturesCloak.java b/Mage.Sets/src/mage/sets/starter1999/NaturesCloak.java new file mode 100644 index 0000000000..ef7f12e84d --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/NaturesCloak.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.starter1999; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class NaturesCloak extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Green creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public NaturesCloak(UUID ownerId) { + super(ownerId, 135, "Nature's Cloak", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "S99"; + + // Green creatures you control gain forestwalk until end of turn. + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + new ForestwalkAbility(false), Duration.EndOfTurn, filter)); + } + + public NaturesCloak(final NaturesCloak card) { + super(card); + } + + @Override + public NaturesCloak copy() { + return new NaturesCloak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/RollingStones.java b/Mage.Sets/src/mage/sets/stronghold/RollingStones.java index a37bc80bbe..f60560ec5c 100644 --- a/Mage.Sets/src/mage/sets/stronghold/RollingStones.java +++ b/Mage.Sets/src/mage/sets/stronghold/RollingStones.java @@ -29,7 +29,7 @@ package mage.sets.stronghold; import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderAllEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -56,7 +56,7 @@ public class RollingStones extends CardImpl { // Wall creatures can attack as though they didn't have defender. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration.WhileOnBattlefield, filter))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration.WhileOnBattlefield, filter))); } public RollingStones(final RollingStones card) { diff --git a/Mage.Sets/src/mage/sets/thedark/HiddenPath.java b/Mage.Sets/src/mage/sets/thedark/HiddenPath.java new file mode 100644 index 0000000000..0ca5e8d49c --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/HiddenPath.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.thedark; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.ForestwalkAbility; +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.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class HiddenPath extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Green creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public HiddenPath(UUID ownerId) { + super(ownerId, 41, "Hidden Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}{G}{G}"); + this.expansionSetCode = "DRK"; + + // Green creatures have forestwalk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(new ForestwalkAbility(false), Duration.WhileOnBattlefield, filter))); + } + + public HiddenPath(final HiddenPath card) { + super(card); + } + + @Override + public HiddenPath copy() { + return new HiddenPath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java new file mode 100644 index 0000000000..28b56da4c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java @@ -0,0 +1,83 @@ +/* + * 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.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +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 fireshoes + */ +public class ScarwoodHag extends CardImpl { + + public ScarwoodHag(UUID ownerId) { + super(ownerId, 49, "Scarwood Hag", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Hag"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}{G}{G}{G}, {tap}: Target creature gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new ManaCostsImpl("{G}{G}{G}{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {tap}: Target creature loses forestwalk until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new LoseAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ScarwoodHag(final ScarwoodHag card) { + super(card); + } + + @Override + public ScarwoodHag copy() { + return new ScarwoodHag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java b/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java index 57c626eef2..a19004a8f3 100644 --- a/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java +++ b/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java @@ -56,14 +56,14 @@ public class WormwoodTreefolk extends CardImpl { 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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new ForestwalkAbility(false), 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 = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{B}{B}")); ability.addEffect(new DamageControllerEffect(2)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java b/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java index 9515c4f37d..02b540a053 100644 --- a/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java +++ b/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java @@ -1,91 +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.theros; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.MonstrousCondition; -import mage.abilities.decorator.ConditionalAsThoughEffect; -import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.abilities.keyword.IndestructibleAbility; -import mage.abilities.keyword.MonstrosityAbility; -import mage.abilities.keyword.TrampleAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class ColossusOfAkros extends CardImpl { - - public ColossusOfAkros(UUID ownerId) { - super(ownerId, 214, "Colossus of Akros", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); - this.expansionSetCode = "THS"; - this.subtype.add("Golem"); - - this.power = new MageInt(10); - this.toughness = new MageInt(10); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // indestructible. - this.addAbility(IndestructibleAbility.getInstance()); - // {10}: Monstrosity 10. - this.addAbility(new MonstrosityAbility("{10}", 10)); - // As long as Colossus of Akros is monstrous, it has trample and can attack as though it didn't have defender. - Ability ability = new SimpleStaticAbility( - Zone.BATTLEFIELD, - new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), - "As long as {this} is monstrous, it has trample")); - Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - MonstrousCondition.getInstance()); - effect.setText("and can attack as though it didn't have defender"); - ability.addEffect(effect); - this.addAbility(ability); - } - - public ColossusOfAkros(final ColossusOfAkros card) { - super(card); - } - - @Override - public ColossusOfAkros copy() { - return new ColossusOfAkros(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.theros; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MonstrousCondition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.MonstrosityAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class ColossusOfAkros extends CardImpl { + + public ColossusOfAkros(UUID ownerId) { + super(ownerId, 214, "Colossus of Akros", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); + this.expansionSetCode = "THS"; + this.subtype.add("Golem"); + + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // indestructible. + this.addAbility(IndestructibleAbility.getInstance()); + // {10}: Monstrosity 10. + this.addAbility(new MonstrosityAbility("{10}", 10)); + // As long as Colossus of Akros is monstrous, it has trample and can attack as though it didn't have defender. + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), + MonstrousCondition.getInstance(), + "As long as {this} is monstrous, it has trample")); + Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + MonstrousCondition.getInstance()); + effect.setText("and can attack as though it didn't have defender"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public ColossusOfAkros(final ColossusOfAkros card) { + super(card); + } + + @Override + public ColossusOfAkros copy() { + return new ColossusOfAkros(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java b/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java index 8bb0b4f674..64e218429e 100644 --- a/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java +++ b/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java @@ -1,71 +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.theros; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class ReturnedPhalanx extends CardImpl { - - public ReturnedPhalanx(UUID ownerId) { - super(ownerId, 104, "Returned Phalanx", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "THS"; - this.subtype.add("Zombie"); - this.subtype.add("Soldier"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // {1}{U}: Returned Phalanx can attack this turn as though it didn't have defender. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}"))); - } - - public ReturnedPhalanx(final ReturnedPhalanx card) { - super(card); - } - - @Override - public ReturnedPhalanx copy() { - return new ReturnedPhalanx(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.theros; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class ReturnedPhalanx extends CardImpl { + + public ReturnedPhalanx(UUID ownerId) { + super(ownerId, 104, "Returned Phalanx", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "THS"; + this.subtype.add("Zombie"); + this.subtype.add("Soldier"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // {1}{U}: Returned Phalanx can attack this turn as though it didn't have defender. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}"))); + } + + public ReturnedPhalanx(final ReturnedPhalanx card) { + super(card); + } + + @Override + public ReturnedPhalanx copy() { + return new ReturnedPhalanx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java b/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java index 75a7d7c1e2..5bafb1249e 100644 --- a/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java +++ b/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java @@ -56,14 +56,14 @@ public class WormwoodDryad extends CardImpl { 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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new ForestwalkAbility(false), 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 = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{B}")); ability.addEffect(new DamageControllerEffect(1)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/torment/SlitheryStalker.java b/Mage.Sets/src/mage/sets/torment/SlitheryStalker.java new file mode 100644 index 0000000000..f3f36f2007 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/SlitheryStalker.java @@ -0,0 +1,96 @@ +/* + * 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.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnFromExileForSourceEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class SlitheryStalker extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a green or white creature an opponent controls"); + + static { + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.WHITE))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SlitheryStalker(UUID ownerId) { + super(ownerId, 84, "Slithery Stalker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Nightmare"); + this.subtype.add("Horror"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + + // When Slithery Stalker enters the battlefield, exile target green or white creature an opponent controls. + Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), true); + Target target = new TargetPermanent(filter); + ability1.addTarget(target); + this.addAbility(ability1); + + // When Slithery Stalker leaves the battlefield, return the exiled card to the battlefield under its owner's control. + Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); + this.addAbility(ability2); + } + + public SlitheryStalker(final SlitheryStalker card) { + super(card); + } + + @Override + public SlitheryStalker copy() { + return new SlitheryStalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java b/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java index 25985872da..99727c6a18 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java @@ -28,10 +28,6 @@ package mage.sets.urzaslegacy; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,6 +35,10 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.ForestwalkAbility; 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; /** @@ -57,7 +57,7 @@ public class WeatherseedElf extends CardImpl { // {tap}: Target creature gains forestwalk until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/visions/FeralInstinct.java b/Mage.Sets/src/mage/sets/visions/FeralInstinct.java new file mode 100644 index 0000000000..ce469c363f --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/FeralInstinct.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.visions; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +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.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FeralInstinct extends CardImpl { + + public FeralInstinct(UUID ownerId) { + super(ownerId, 57, "Feral Instinct", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "VIS"; + + // Target creature gets +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public FeralInstinct(final FeralInstinct card) { + super(card); + } + + @Override + public FeralInstinct copy() { + return new FeralInstinct(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Solfatara.java b/Mage.Sets/src/mage/sets/visions/Solfatara.java new file mode 100644 index 0000000000..293563acd9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/Solfatara.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class Solfatara extends CardImpl { + + public Solfatara(UUID ownerId) { + super(ownerId, 93, "Solfatara", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "VIS"; + + // Target player can't play land cards this turn. + this.getSpellAbility().addEffect(new SolfataraEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public Solfatara(final Solfatara card) { + super(card); + } + + @Override + public Solfatara copy() { + return new Solfatara(this); + } +} + +class SolfataraEffect extends ContinuousRuleModifyingEffectImpl { + + public SolfataraEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "Target player can't play land cards this turn."; + } + + public SolfataraEffect(final SolfataraEffect effect) { + super(effect); + } + + @Override + public SolfataraEffect copy() { + return new SolfataraEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject mageObject = game.getObject(source.getSourceId()); + if (mageObject != null) { + return "You can't play lands this turn (" + mageObject.getLogName() + ")."; + } + return null; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.PLAY_LAND && event.getPlayerId().equals(source.getFirstTarget())) { + return true; + } + return false; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderAllEffect.java b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java similarity index 86% rename from Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderAllEffect.java rename to Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java index 11b4b3b945..85a4e2eff6 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java @@ -42,28 +42,28 @@ import mage.game.permanent.Permanent; * * @author Quercitron */ -public class CanAttackAsThoughtItDidntHaveDefenderAllEffect extends AsThoughEffectImpl { +public class CanAttackAsThoughItDidntHaveDefenderAllEffect extends AsThoughEffectImpl { private final FilterPermanent filter; - public CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration duration) { + public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration) { this(duration, new FilterCreaturePermanent()); } - public CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration duration, FilterPermanent filter) { + public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration, FilterPermanent filter) { super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); this.filter = filter; this.staticText = getText(); } - public CanAttackAsThoughtItDidntHaveDefenderAllEffect(final CanAttackAsThoughtItDidntHaveDefenderAllEffect effect) { + public CanAttackAsThoughItDidntHaveDefenderAllEffect(final CanAttackAsThoughItDidntHaveDefenderAllEffect effect) { super(effect); this.filter = effect.filter.copy(); } @Override - public CanAttackAsThoughtItDidntHaveDefenderAllEffect copy() { - return new CanAttackAsThoughtItDidntHaveDefenderAllEffect(this); + public CanAttackAsThoughItDidntHaveDefenderAllEffect copy() { + return new CanAttackAsThoughItDidntHaveDefenderAllEffect(this); } @Override diff --git a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderSourceEffect.java similarity index 82% rename from Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java rename to Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderSourceEffect.java index eb7dcc3c53..955229cae2 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderSourceEffect.java @@ -1,69 +1,69 @@ -/* - * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.abilities.effects.common.combat; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.AsThoughEffectImpl; -import mage.constants.AsThoughEffectType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.game.Game; - -/** - * - * @author LevelX2 - */ - -public class CanAttackAsThoughtItDidntHaveDefenderSourceEffect extends AsThoughEffectImpl { - - public CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration duration) { - super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); - staticText = "{this} can attack as though it didn't have defender"; - } - - public CanAttackAsThoughtItDidntHaveDefenderSourceEffect(final CanAttackAsThoughtItDidntHaveDefenderSourceEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CanAttackAsThoughtItDidntHaveDefenderSourceEffect copy() { - return new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(this); - } - - @Override - public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return objectId.equals(source.getSourceId()); - } - -} +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ + +public class CanAttackAsThoughItDidntHaveDefenderSourceEffect extends AsThoughEffectImpl { + + public CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration duration) { + super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); + staticText = "{this} can attack as though it didn't have defender"; + } + + public CanAttackAsThoughItDidntHaveDefenderSourceEffect(final CanAttackAsThoughItDidntHaveDefenderSourceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CanAttackAsThoughItDidntHaveDefenderSourceEffect copy() { + return new CanAttackAsThoughItDidntHaveDefenderSourceEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return objectId.equals(source.getSourceId()); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderTargetEffect.java similarity index 85% rename from Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java rename to Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderTargetEffect.java index 604fa931fa..65b2e77b05 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderTargetEffect.java @@ -1,84 +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. - */ -package mage.abilities.effects.common.combat; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.AsThoughEffectImpl; -import mage.constants.AsThoughEffectType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.game.Game; - -/** - * - * @author LevelX2 - */ - -public class CanAttackAsThoughtItDidntHaveDefenderTargetEffect extends AsThoughEffectImpl { - - public CanAttackAsThoughtItDidntHaveDefenderTargetEffect(Duration duration) { - super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); - } - - public CanAttackAsThoughtItDidntHaveDefenderTargetEffect(final CanAttackAsThoughtItDidntHaveDefenderTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CanAttackAsThoughtItDidntHaveDefenderTargetEffect copy() { - return new CanAttackAsThoughtItDidntHaveDefenderTargetEffect(this); - } - - @Override - public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return this.getTargetPointer().getTargets(game, source).contains(objectId); - } - - @Override - public String getText(Mode mode) { - if (staticText != null && !staticText.isEmpty()) { - return staticText; - } - if (!mode.getTargets().isEmpty()) { - if (this.duration == Duration.EndOfTurn) { - return "Target " + mode.getTargets().get(0).getTargetName() + " can attack this turn as though it didn't have defender"; - } else { - return "Target " + mode.getTargets().get(0).getTargetName() + " can attack as though it didn't have defender"; - } - } else { - throw new UnsupportedOperationException("No target defined"); - } - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ + +public class CanAttackAsThoughItDidntHaveDefenderTargetEffect extends AsThoughEffectImpl { + + public CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration duration) { + super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); + } + + public CanAttackAsThoughItDidntHaveDefenderTargetEffect(final CanAttackAsThoughItDidntHaveDefenderTargetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CanAttackAsThoughItDidntHaveDefenderTargetEffect copy() { + return new CanAttackAsThoughItDidntHaveDefenderTargetEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return this.getTargetPointer().getTargets(game, source).contains(objectId); + } + + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + if (!mode.getTargets().isEmpty()) { + if (this.duration == Duration.EndOfTurn) { + return "Target " + mode.getTargets().get(0).getTargetName() + " can attack this turn as though it didn't have defender"; + } else { + return "Target " + mode.getTargets().get(0).getTargetName() + " can attack as though it didn't have defender"; + } + } else { + throw new UnsupportedOperationException("No target defined"); + } + } +} diff --git a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java index d9759823ac..7fd376b918 100644 --- a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java @@ -43,7 +43,11 @@ public class ForestwalkAbility extends LandwalkAbility { } public ForestwalkAbility() { - super(filter); + this(true); + } + + public ForestwalkAbility(boolean withHintText) { + super(filter, withHintText); } public ForestwalkAbility(final ForestwalkAbility ability) { diff --git a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java index af767fd91b..b3d8e356a9 100644 --- a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java @@ -43,7 +43,11 @@ public class IslandwalkAbility extends LandwalkAbility { } public IslandwalkAbility() { - super(filter); + this(true); + } + + public IslandwalkAbility(boolean withHintText) { + super(filter, withHintText); } public IslandwalkAbility(final IslandwalkAbility ability) { diff --git a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java index 7624395b40..01a4834556 100644 --- a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java @@ -43,7 +43,11 @@ public class MountainwalkAbility extends LandwalkAbility { } public MountainwalkAbility() { - super(filter); + this(true); + } + + public MountainwalkAbility(boolean withHintText) { + super(filter, withHintText); } public MountainwalkAbility(final MountainwalkAbility ability) { diff --git a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java index 553101661b..f16dfa05ff 100644 --- a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java +++ b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java @@ -32,7 +32,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; /** * - * @author nantuko + * @author BetaSteward_at_googlemail.com */ public class PlainswalkAbility extends LandwalkAbility { @@ -43,7 +43,11 @@ public class PlainswalkAbility extends LandwalkAbility { } public PlainswalkAbility() { - super(filter); + this(true); + } + + public PlainswalkAbility(boolean withHintText) { + super(filter, withHintText); } public PlainswalkAbility(final PlainswalkAbility ability) { diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index 15958a9d83..1516373241 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -68,7 +68,9 @@ public enum CounterType { LOYALTY("loyalty"), MANNEQUIN("mannequin"), M1M1(new BoostCounter(-1, -1).name), + M2M2(new BoostCounter(-2, -2).name), MINING("mining"), + P1P0(new BoostCounter(1, 0).name), P1P1(new BoostCounter(1, 1).name), P2P2(new BoostCounter(2, 2).name), PAGE("page"), @@ -126,12 +128,16 @@ public enum CounterType { */ public Counter createInstance(int amount) { switch (this) { + case P1P0: + return new BoostCounter(1, 0, amount); case P1P1: return new BoostCounter(1, 1, amount); case P2P2: return new BoostCounter(2, 2, amount); case M1M1: return new BoostCounter(-1, -1, amount); + case M2M2: + return new BoostCounter(-2, -2, amount); default: return new Counter(name, amount); } From d3ce238b53d4d133c73438a9329f8bc6b183a813 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 26 Aug 2015 15:48:47 +0200 Subject: [PATCH 10/14] Fixed a NPE of PutTokenOntoBattlefieldCopyTargetEffect. --- .../effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java index 7bb195b826..1d740f6f94 100644 --- a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java @@ -85,7 +85,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this.playerId = effect.playerId; this.additionalCardType = effect.additionalCardType; this.gainsHaste = effect.gainsHaste; - this.addedTokenPermanents.addAll(effect.addedTokenPermanents); + this.addedTokenPermanents = new ArrayList<>(effect.addedTokenPermanents); } @Override From 0ee22d90ca2331c2ff087d23c3e767e2c925f60e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 26 Aug 2015 16:29:57 +0200 Subject: [PATCH 11/14] Allow hand card ordering by drag'n'drop only with left mouse button. --- .../java/mage/client/plugins/adapters/MageActionCallback.java | 4 ++++ 1 file changed, 4 insertions(+) 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 2d7f70b7a2..83ba8b763d 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 @@ -292,6 +292,10 @@ public class MageActionCallback implements ActionCallback { // drag'n'drop is allowed for HAND zone only return; } + if (!SwingUtilities.isLeftMouseButton(e)) { + // only allow draging with the left mouse button + return; + } isDragging = true; prevCard = card; Point p = card.getCardLocation(); From 97a8b351b45872b43083a558c19f5f543e3a7cfa Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 26 Aug 2015 16:30:32 +0200 Subject: [PATCH 12/14] Fixed a problem that show cards window was not closed (e.g. for libraray card selection). --- .../main/java/mage/client/game/GamePanel.java | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) 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 aab803819d..7ba3fae85f 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -199,14 +199,14 @@ public final class GamePanel extends javax.swing.JPanel { // CardView popupMenu was invoked last private CardView cardViewPopupMenu; - // popup menu for a card - private JPopupMenu popupMenuCardPanel; + // popup menu for triggered abilities order + private JPopupMenu popupMenuTriggerOrder; public GamePanel() { initComponents(); - createTriggerOrderPupupMenu(); - this.add(popupMenuCardPanel); + initPopupMenuTriggerOrder(); + //this.add(popupMenuTriggerOrder); pickNumber = new PickNumberDialog(); MageFrame.getDesktop().add(pickNumber, JLayeredPane.MODAL_LAYER); @@ -1107,12 +1107,10 @@ public final class GamePanel extends javax.swing.JPanel { hideAll(); ShowCardsDialog showCards = new ShowCardsDialog(); JPopupMenu popupMenu = null; - Listener eventListener = null; if (PopUpMenuType.TRIGGER_ORDER.equals(popupMenuType)) { - popupMenu = getTriggerOrderPopupMenu(); - eventListener = getTriggerOrderEventListener(showCards); + popupMenu = popupMenuTriggerOrder; } - showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options, popupMenu, eventListener); + showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options, popupMenu, getShowCardsEventListener(showCards)); return showCards; } @@ -1985,8 +1983,8 @@ public final class GamePanel extends javax.swing.JPanel { hoverButtons.put(name, button); } - // TriggerOrderPopupMenu - private Listener getTriggerOrderEventListener(final ShowCardsDialog dialog) { + // Event listener for the ShowCardsDialog + private Listener getShowCardsEventListener(final ShowCardsDialog dialog) { return new Listener() { @Override public void event(Event event) { @@ -2011,7 +2009,8 @@ public final class GamePanel extends javax.swing.JPanel { String abilityRuleText = null; if (cardViewPopupMenu instanceof CardView && cardViewPopupMenu.getAbility() != null) { abilityId = cardViewPopupMenu.getAbility().getId(); - if (!cardViewPopupMenu.getAbility().getRules().isEmpty() && !cardViewPopupMenu.getAbility().getRules().equals("")) { + if (!cardViewPopupMenu.getAbility().getRules().isEmpty() + && !cardViewPopupMenu.getAbility().getRules().get(0).isEmpty()) { abilityRuleText = cardViewPopupMenu.getAbility().getRules().get(0); } } @@ -2038,11 +2037,7 @@ public final class GamePanel extends javax.swing.JPanel { } } - public JPopupMenu getTriggerOrderPopupMenu() { - return popupMenuCardPanel; - } - - private void createTriggerOrderPupupMenu() { + private void initPopupMenuTriggerOrder() { ActionListener actionListener = new ActionListener() { @Override @@ -2051,34 +2046,34 @@ public final class GamePanel extends javax.swing.JPanel { } }; - popupMenuCardPanel = new JPopupMenu(); + popupMenuTriggerOrder = 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); + popupMenuTriggerOrder.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); + popupMenuTriggerOrder.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); + popupMenuTriggerOrder.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); + popupMenuTriggerOrder.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); + popupMenuTriggerOrder.add(menuItem); } public String getGameLog() { From 3c8c439d19b27c41b35f7b367fce0c5c627c926e Mon Sep 17 00:00:00 2001 From: fireshoes Date: Wed, 26 Aug 2015 12:58:26 -0500 Subject: [PATCH 13/14] Cleaned up some of the cards from earlier and related cards. --- .../src/mage/sets/alliances/Burnout.java | 13 +- .../mage/sets/antiquities/GateToPhyrexia.java | 7 - .../darkascension/FalkenrathAristocrat.java | 234 +++++++-------- Mage.Sets/src/mage/sets/iceage/Icequake.java | 203 +++++++------ Mage.Sets/src/mage/sets/iceage/Pyroblast.java | 274 +++++++++--------- .../sets/masterseditionii/EbonPraetor.java | 2 +- .../sets/masterseditionii/Thermokarst.java | 5 +- .../mage/sets/mercadianmasques/CaveSense.java | 8 +- .../mercadianmasques/HauntedCrossroads.java | 4 +- .../sets/mercadianmasques/TigerClaws.java | 8 +- .../src/mage/sets/thedark/ScarwoodHag.java | 5 +- 11 files changed, 382 insertions(+), 381 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alliances/Burnout.java b/Mage.Sets/src/mage/sets/alliances/Burnout.java index 746f36cd8d..e0c33b0a1c 100644 --- a/Mage.Sets/src/mage/sets/alliances/Burnout.java +++ b/Mage.Sets/src/mage/sets/alliances/Burnout.java @@ -30,6 +30,7 @@ package mage.sets.alliances; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -41,6 +42,7 @@ import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; +import mage.game.stack.Spell; import mage.target.TargetSpell; /** @@ -60,8 +62,10 @@ public class Burnout extends CardImpl { this.expansionSetCode = "ALL"; // Counter target instant spell if it's blue. + Effect effect = new BurnoutCounterTargetEffect(); + effect.setText("Counter target instant spell if it's blue"); this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new BurnoutCounterTargetEffect()); + this.getSpellAbility().addEffect(effect); // Draw a card at the beginning of the next turn's upkeep. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( @@ -95,13 +99,10 @@ class BurnoutCounterTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){ + Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); + if(targetSpell != null && targetSpell.getColor(game).isBlue()){ game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return true; } - - public String getText(Ability source) { - return "Counter target instant spell if it's blue"; - } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java index ca2291a5eb..1d2a88c9ab 100644 --- a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java +++ b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java @@ -91,11 +91,4 @@ class GateToPhyrexiaAbility extends LimitedTimesPerTurnActivatedAbility { } return super.canActivate(playerId, game); } - - @Override - public String getRule() { - StringBuilder sb = new StringBuilder(""); - sb.append(super.getRule()).append(" Activate this ability only during your upkeep."); - return sb.toString(); - } } diff --git a/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java b/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java index f31b064250..75e242e096 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java +++ b/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java @@ -1,117 +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.darkascension; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.HasteAbility; -import mage.abilities.keyword.IndestructibleAbility; -import mage.cards.CardImpl; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.common.TargetControlledCreaturePermanent; - -/** - * - * @author North - */ -public class FalkenrathAristocrat extends CardImpl { - - public FalkenrathAristocrat(UUID ownerId) { - super(ownerId, 138, "Falkenrath Aristocrat", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); - this.expansionSetCode = "DKA"; - this.subtype.add("Vampire"); - - this.power = new MageInt(4); - this.toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - // Sacrifice a creature: Falkenrath Aristocrat is indestructible this turn. - // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addEffect(new FalkenrathAristocratEffect()); - this.addAbility(ability); - } - - public FalkenrathAristocrat(final FalkenrathAristocrat card) { - super(card); - } - - @Override - public FalkenrathAristocrat copy() { - return new FalkenrathAristocrat(this); - } -} - -class FalkenrathAristocratEffect extends OneShotEffect { - - public FalkenrathAristocratEffect() { - super(Outcome.BoostCreature); - this.staticText = "If the sacrificed creature was a Human, put a +1/+1 counter on {this}"; - } - - public FalkenrathAristocratEffect(final FalkenrathAristocratEffect effect) { - super(effect); - } - - @Override - public FalkenrathAristocratEffect copy() { - return new FalkenrathAristocratEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost) { - Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); - Permanent sourceCreature = game.getPermanent(source.getSourceId()); - if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) { - sourceCreature.addCounters(CounterType.P1P1.createInstance(), 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.darkascension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.IndestructibleAbility; +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.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author North + */ +public class FalkenrathAristocrat extends CardImpl { + + public FalkenrathAristocrat(UUID ownerId) { + super(ownerId, 138, "Falkenrath Aristocrat", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Vampire"); + + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + // Sacrifice a creature: Falkenrath Aristocrat is indestructible this turn. + // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addEffect(new FalkenrathAristocratEffect()); + this.addAbility(ability); + } + + public FalkenrathAristocrat(final FalkenrathAristocrat card) { + super(card); + } + + @Override + public FalkenrathAristocrat copy() { + return new FalkenrathAristocrat(this); + } +} + +class FalkenrathAristocratEffect extends OneShotEffect { + + public FalkenrathAristocratEffect() { + super(Outcome.BoostCreature); + this.staticText = "If the sacrificed creature was a Human, put a +1/+1 counter on {this}"; + } + + public FalkenrathAristocratEffect(final FalkenrathAristocratEffect effect) { + super(effect); + } + + @Override + public FalkenrathAristocratEffect copy() { + return new FalkenrathAristocratEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost) { + Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) { + sourceCreature.addCounters(CounterType.P1P1.createInstance(), game); + return true; + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Icequake.java b/Mage.Sets/src/mage/sets/iceage/Icequake.java index d2cfa144f7..378e27cbc2 100644 --- a/Mage.Sets/src/mage/sets/iceage/Icequake.java +++ b/Mage.Sets/src/mage/sets/iceage/Icequake.java @@ -1,103 +1,100 @@ -/* - * 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.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetLandPermanent; - - -/** - * - * @author fireshoes - */ -public class Icequake extends CardImpl { - - public Icequake(UUID ownerId) { - super(ownerId, 22, "Icequake", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); - this.expansionSetCode = "ICE"; - - // Destroy target land. - // If that land was a snow land, Icequake deals 1 damage to that land's controller. - this.getSpellAbility().addEffect(new IcequakeEffect()); - this.getSpellAbility().addTarget(new TargetLandPermanent()); - - - } - - public Icequake(final Icequake card) { - super(card); - } - - @Override - public Icequake copy() { - return new Icequake(this); - } -} - -class IcequakeEffect extends OneShotEffect { - - public IcequakeEffect() { - super(Outcome.Damage); - this.staticText = "Destroy target land.
If that land was a snow land, {this} deals 1 damage to that land's controller."; - } - - public IcequakeEffect(final IcequakeEffect effect) { - super(effect); - } - - @Override - public IcequakeEffect copy() { - return new IcequakeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null && controller != null) { - permanent.destroy(source.getSourceId(), game, false); - if (permanent.getSupertype().contains("Snow")) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - player.damage(1, source.getSourceId(), game, false, true); - } - } - 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.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetLandPermanent; + + +/** + * + * @author fireshoes + */ +public class Icequake extends CardImpl { + + public Icequake(UUID ownerId) { + super(ownerId, 22, "Icequake", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "ICE"; + + // Destroy target land. + // If that land was a snow land, Icequake deals 1 damage to that land's controller. + this.getSpellAbility().addEffect(new IcequakeEffect()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + + + } + + public Icequake(final Icequake card) { + super(card); + } + + @Override + public Icequake copy() { + return new Icequake(this); + } +} + +class IcequakeEffect extends OneShotEffect { + + public IcequakeEffect() { + super(Outcome.Damage); + this.staticText = "Destroy target land.
If that land was a snow land, {this} deals 1 damage to that land's controller."; + } + + public IcequakeEffect(final IcequakeEffect effect) { + super(effect); + } + + @Override + public IcequakeEffect copy() { + return new IcequakeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && controller != null) { + permanent.destroy(source.getSourceId(), game, false); + if (permanent.getSupertype().contains("Snow")) { + controller.damage(1, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java index 04784cb21b..3dc67daee7 100644 --- a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java +++ b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java @@ -1,136 +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.iceage; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.TargetPermanent; -import mage.target.TargetSpell; - -/** - * - * @author Plopman - */ -public class Pyroblast extends CardImpl { - - public Pyroblast(UUID ownerId) { - super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "ICE"; - - - // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. - this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); - this.getSpellAbility().addTarget(new TargetSpell()); - - Mode mode = new Mode(); - mode.getEffects().add(new DestroyTargetEffect()); - mode.getTargets().add(new TargetPermanent()); - - this.getSpellAbility().addMode(mode); - } - - public Pyroblast(final Pyroblast card) { - super(card); - } - - @Override - public Pyroblast copy() { - return new Pyroblast(this); - } -} - -class PyroblastCounterTargetEffect extends OneShotEffect { - - public PyroblastCounterTargetEffect() { - super(Outcome.Detriment); - } - - public PyroblastCounterTargetEffect(final PyroblastCounterTargetEffect effect) { - super(effect); - } - - @Override - public PyroblastCounterTargetEffect copy() { - return new PyroblastCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){ - game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Counter target spell if it's blue"; - } - -} - - -class DestroyTargetEffect extends OneShotEffect { - - - public DestroyTargetEffect() { - super(Outcome.DestroyPermanent); - } - - public DestroyTargetEffect(final DestroyTargetEffect effect) { - super(effect); - } - - @Override - public DestroyTargetEffect copy() { - return new DestroyTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); - if (permanent != null && permanent.getColor(game).isBlue()) { - permanent.destroy(source.getSourceId(), game, false); - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Destroy target permanent if it's blue"; - } - -} +/* + * 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.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.target.TargetPermanent; +import mage.target.TargetSpell; + +/** + * + * @author Plopman + */ +public class Pyroblast extends CardImpl { + + public Pyroblast(UUID ownerId) { + super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ICE"; + + + // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. + this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetPermanent()); + + this.getSpellAbility().addMode(mode); + } + + public Pyroblast(final Pyroblast card) { + super(card); + } + + @Override + public Pyroblast copy() { + return new Pyroblast(this); + } +} + +class PyroblastCounterTargetEffect extends OneShotEffect { + + public PyroblastCounterTargetEffect() { + super(Outcome.Detriment); + } + + public PyroblastCounterTargetEffect(final PyroblastCounterTargetEffect effect) { + super(effect); + } + + @Override + public PyroblastCounterTargetEffect copy() { + return new PyroblastCounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); + if(targetSpell != null && targetSpell.getColor(game).isBlue()){ + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Counter target spell if it's blue"; + } + +} + + +class DestroyTargetEffect extends OneShotEffect { + + + public DestroyTargetEffect() { + super(Outcome.DestroyPermanent); + } + + public DestroyTargetEffect(final DestroyTargetEffect effect) { + super(effect); + } + + @Override + public DestroyTargetEffect copy() { + return new DestroyTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); + if (permanent != null && permanent.getColor(game).isBlue()) { + permanent.destroy(source.getSourceId(), game, false); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Destroy target permanent if it's blue"; + } + +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java index 4aac7c7bd1..9b7905996e 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java @@ -151,6 +151,6 @@ class EbonPraetorEffect extends OneShotEffect { } } } - return false; + return true; } } diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java index 08305c042c..b555221479 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java @@ -87,10 +87,7 @@ class ThermokarstEffect extends OneShotEffect { if (permanent != null && controller != null) { permanent.destroy(source.getSourceId(), game, false); if (permanent.getSupertype().contains("Snow")) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.gainLife(1, game); - } + controller.gainLife(1, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java index e04760cb83..91bddccba4 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java @@ -30,6 +30,7 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -63,8 +64,11 @@ public class CaveSense extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 and has mountainwalk. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new MountainwalkAbility(), AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(new MountainwalkAbility(), AttachmentType.AURA); + effect.setText("and has mountainwalk"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); + ability.addEffect(effect); + this.addAbility(ability); } public CaveSense(final CaveSense card) { diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java index 47af6159d2..dbeedd4792 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java @@ -37,7 +37,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; -import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInYourGraveyard; /** * @@ -51,7 +51,7 @@ public class HauntedCrossroads extends CardImpl { // {B}: Put target creature card from your graveyard on top of your library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{B}")); - ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java index f18c186b97..1de3906ba4 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java @@ -30,6 +30,7 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -67,8 +68,11 @@ public class TigerClaws extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 and has trample. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has trample"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); + ability.addEffect(effect); + this.addAbility(ability); } public TigerClaws(final TigerClaws card) { diff --git a/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java index 28b56da4c8..823a74756b 100644 --- a/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java +++ b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java @@ -33,6 +33,7 @@ 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.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; import mage.abilities.keyword.ForestwalkAbility; @@ -65,8 +66,10 @@ public class ScarwoodHag extends CardImpl { this.addAbility(ability); // {tap}: Target creature loses forestwalk until end of turn. + Effect effect = new LoseAbilityTargetEffect(new ForestwalkAbility(true), Duration.EndOfTurn); + effect.setText("Target creature loses forestwalk until end of turn"); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new LoseAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); From 43fb00dc37e22828d21d582a32bbe5e25cef600a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 26 Aug 2015 22:18:47 +0200 Subject: [PATCH 14/14] * Reciprocate - Fixed wrong casting cost. --- .../sets/championsofkamigawa/Reciprocate.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java index 65eac2b615..5098fa1427 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java @@ -25,7 +25,6 @@ * 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.HashSet; @@ -48,8 +47,8 @@ import mage.watchers.common.PlayerDamagedBySourceWatcher; */ public class Reciprocate extends CardImpl { - public Reciprocate(UUID ownerId) { - super(ownerId, 40, "Reciprocate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + public Reciprocate(UUID ownerId) { + super(ownerId, 40, "Reciprocate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "CHK"; // Exile target creature that dealt damage to you this turn. @@ -81,7 +80,7 @@ class ReciprocateTarget extends TargetPermanent { @Override public boolean canTarget(UUID id, Ability source, Game game) { - PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource",source.getControllerId()); + PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", source.getControllerId()); if (watcher != null && watcher.hasSourceDoneDamage(id, game)) { return super.canTarget(id, source, game); } @@ -95,7 +94,7 @@ class ReciprocateTarget extends TargetPermanent { PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", sourceControllerId); for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if(permanent != null && watcher != null && watcher.hasSourceDoneDamage(targetId, game)){ + if (permanent != null && watcher != null && watcher.hasSourceDoneDamage(targetId, game)) { possibleTargets.add(targetId); } } @@ -111,14 +110,14 @@ class ReciprocateTarget extends TargetPermanent { int count = 0; MageObject targetSource = game.getObject(sourceId); PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", sourceControllerId); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { - if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game) + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { + if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && watcher != null && watcher.hasSourceDoneDamage(permanent.getId(), game)) { - count++; - if (count >= remainingTargets) { - return true; - } + count++; + if (count >= remainingTargets) { + return true; } + } } return false; }