diff --git a/Mage.Sets/src/mage/cards/a/ActOfHeroism.java b/Mage.Sets/src/mage/cards/a/ActOfHeroism.java index 9bec8199467..54e3d518c6c 100644 --- a/Mage.Sets/src/mage/cards/a/ActOfHeroism.java +++ b/Mage.Sets/src/mage/cards/a/ActOfHeroism.java @@ -54,7 +54,7 @@ public class ActOfHeroism extends CardImpl { // It gets +2/+2 until end of turn effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); - effect.setText("It gets +2/+2"); + effect.setText("It gets +2/+2 until end of turn"); this.getSpellAbility().addEffect(effect); // and can block an additional creature this turn diff --git a/Mage.Sets/src/mage/cards/a/AdventuringGear.java b/Mage.Sets/src/mage/cards/a/AdventuringGear.java index f8b2a4616a8..1652dcdedd0 100644 --- a/Mage.Sets/src/mage/cards/a/AdventuringGear.java +++ b/Mage.Sets/src/mage/cards/a/AdventuringGear.java @@ -31,7 +31,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.common.LandfallAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -39,10 +39,6 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SubType; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.target.common.TargetCreaturePermanent; /** * @@ -53,8 +49,12 @@ public class AdventuringGear extends CardImpl { public AdventuringGear(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); this.subtype.add(SubType.EQUIPMENT); + + // Landfall — Whenever a land enters the battlefield under your control, equipped creature gets +2/+2 until end of turn. + this.addAbility(new LandfallAbility(new BoostEquippedEffect(2, 2, Duration.EndOfTurn), false)); + + // Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); - this.addAbility(new AdventuringGearAbility()); } public AdventuringGear(final AdventuringGear card) { @@ -65,40 +65,4 @@ public class AdventuringGear extends CardImpl { public AdventuringGear copy() { return new AdventuringGear(this); } - -} - -class AdventuringGearAbility extends LandfallAbility { - - public AdventuringGearAbility() { - super(null, false); - this.addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - this.addTarget(new TargetCreaturePermanent()); - } - - public AdventuringGearAbility(final AdventuringGearAbility ability) { - super(ability); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (super.checkTrigger(event, game)) { - Permanent equipment = game.getPermanent(this.sourceId); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(equipment.getAttachedTo()); - if (creature != null) { - this.getTargets().get(0).clearChosen(); - this.getTargets().get(0).add(creature.getId(), game); - return true; - } - } - } - return false; - } - - @Override - public AdventuringGearAbility copy() { - return new AdventuringGearAbility(this); - } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/a/AllSunsDawn.java b/Mage.Sets/src/mage/cards/a/AllSunsDawn.java index 60f1597bbca..57c828bdedd 100644 --- a/Mage.Sets/src/mage/cards/a/AllSunsDawn.java +++ b/Mage.Sets/src/mage/cards/a/AllSunsDawn.java @@ -91,7 +91,7 @@ class AllSunsDawnEffect extends OneShotEffect { public AllSunsDawnEffect() { super(Outcome.ReturnToHand); - this.staticText = "For each color, return up to one target card of that color from your graveyard to your hand. Exile {this}"; + this.staticText = "For each color, return up to one target card of that color from your graveyard to your hand"; } public AllSunsDawnEffect(final AllSunsDawnEffect effect) { diff --git a/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java b/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java index 2ede2838f86..ecf501e0a25 100644 --- a/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java +++ b/Mage.Sets/src/mage/cards/a/ArgothianTreefolk.java @@ -77,6 +77,7 @@ class PreventDamageToSourceByCardTypeEffect extends PreventAllDamageToSourceEffe public PreventDamageToSourceByCardTypeEffect(CardType cardT){ super(Duration.WhileOnBattlefield); + staticText = "Prevent all damage that would be dealt to {this} by artifact sources"; cardType = cardT; } diff --git a/Mage.Sets/src/mage/cards/b/BeastHunt.java b/Mage.Sets/src/mage/cards/b/BeastHunt.java index 2d5e8796fb8..f59d9c7a5e2 100644 --- a/Mage.Sets/src/mage/cards/b/BeastHunt.java +++ b/Mage.Sets/src/mage/cards/b/BeastHunt.java @@ -44,7 +44,7 @@ public class BeastHunt extends CardImpl { public BeastHunt(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); - this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(3, new FilterCreatureCard(), Zone.GRAVEYARD)); + this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(3, new FilterCreatureCard("creature cards"), Zone.GRAVEYARD)); } public BeastHunt(final BeastHunt card) { diff --git a/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java b/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java index d915c46989e..4afd172f028 100644 --- a/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java +++ b/Mage.Sets/src/mage/cards/b/BladeOfTheBloodchief.java @@ -30,6 +30,7 @@ package mage.cards.b; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.EquipAbility; @@ -56,8 +57,11 @@ public class BladeOfTheBloodchief extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); this.subtype.add(SubType.EQUIPMENT); + // Whenever a creature dies, put a +1/+1 counter on equipped creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead. + this.addAbility(new DiesCreatureTriggeredAbility(new BladeOfTheBloodchiefEffect(), false)); + + //Equip {1} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); - this.addAbility(new BladeOfTheBloodChiefTriggeredAbility()); } public BladeOfTheBloodchief(final BladeOfTheBloodchief card) { @@ -70,50 +74,6 @@ public class BladeOfTheBloodchief extends CardImpl { } } -class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl { - - private static final String text = "Whenever a creature dies, put a +1/+1 counter on equipped " - + "creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead."; - - BladeOfTheBloodChiefTriggeredAbility() { - super(Zone.BATTLEFIELD, new BladeOfTheBloodchiefEffect()); - } - - BladeOfTheBloodChiefTriggeredAbility(final BladeOfTheBloodChiefTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.ZONE_CHANGE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.isCreature()) { - Permanent enchantment = game.getPermanent(getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - return true; - } - } - } - return false; - } - - @Override - public BladeOfTheBloodChiefTriggeredAbility copy() { - return new BladeOfTheBloodChiefTriggeredAbility(this); - } - - @Override - public String getRule() { - return text; - } -} - class BladeOfTheBloodchiefEffect extends OneShotEffect { BladeOfTheBloodchiefEffect() { diff --git a/Mage.Sets/src/mage/cards/b/Boil.java b/Mage.Sets/src/mage/cards/b/Boil.java index bfb9eabadd9..ae5788a2b3e 100644 --- a/Mage.Sets/src/mage/cards/b/Boil.java +++ b/Mage.Sets/src/mage/cards/b/Boil.java @@ -42,7 +42,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class Boil extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("islands"); + private static final FilterPermanent filter = new FilterPermanent("Islands"); static { filter.add(new SubtypePredicate(SubType.ISLAND)); diff --git a/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java b/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java index 8238fb2197a..78d3f3809ad 100644 --- a/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java +++ b/Mage.Sets/src/mage/cards/b/BontusLastReckoning.java @@ -35,6 +35,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.TargetController; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterCreaturePermanent; @@ -48,10 +49,10 @@ public class BontusLastReckoning extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); // Destroy all creatures. Lands you control don't untap during your next untap step. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES)); this.getSpellAbility().addEffect(new DontUntapInControllersUntapStepAllEffect( Duration.UntilYourNextTurn, TargetController.YOU, new FilterControlledLandPermanent("Lands you control")) - .setText("Lands you control don't untap during your next untap phase")); + .setText("Lands you control don't untap during your next untap step")); } public BontusLastReckoning(final BontusLastReckoning card) { diff --git a/Mage.Sets/src/mage/cards/b/BroodmateDragon.java b/Mage.Sets/src/mage/cards/b/BroodmateDragon.java index afd583941e5..05ed5f8413a 100644 --- a/Mage.Sets/src/mage/cards/b/BroodmateDragon.java +++ b/Mage.Sets/src/mage/cards/b/BroodmateDragon.java @@ -55,8 +55,9 @@ public class BroodmateDragon extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(dragonToken), false)); this.addAbility(FlyingAbility.getInstance()); + + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(dragonToken), false)); } public BroodmateDragon(final BroodmateDragon card) { diff --git a/Mage.Sets/src/mage/cards/b/BuildersBlessing.java b/Mage.Sets/src/mage/cards/b/BuildersBlessing.java index de5fdda18d2..1fb3ce8b129 100644 --- a/Mage.Sets/src/mage/cards/b/BuildersBlessing.java +++ b/Mage.Sets/src/mage/cards/b/BuildersBlessing.java @@ -47,7 +47,7 @@ public class BuildersBlessing extends CardImpl { // Untapped creatures you control get +0/+2. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 2, Duration.WhileOnBattlefield, new FilterUntappedCreature()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 2, Duration.WhileOnBattlefield, new FilterUntappedCreature("untapped creatures")))); } public BuildersBlessing(final BuildersBlessing card) { diff --git a/Mage.Sets/src/mage/cards/b/BullElephant.java b/Mage.Sets/src/mage/cards/b/BullElephant.java index 8ad3fdc6090..70c93e99a41 100644 --- a/Mage.Sets/src/mage/cards/b/BullElephant.java +++ b/Mage.Sets/src/mage/cards/b/BullElephant.java @@ -16,7 +16,7 @@ import java.util.UUID; public class BullElephant extends CardImpl { - private static FilterControlledLandPermanent controlledForest = new FilterControlledLandPermanent("Forests you control"); + private static FilterControlledLandPermanent controlledForest = new FilterControlledLandPermanent("Forests"); static { controlledForest.add(new SubtypePredicate(SubType.FOREST)); diff --git a/Mage.Sets/src/mage/cards/c/CallToTheGrave.java b/Mage.Sets/src/mage/cards/c/CallToTheGrave.java index dec95a73edd..3e010c44b1e 100644 --- a/Mage.Sets/src/mage/cards/c/CallToTheGrave.java +++ b/Mage.Sets/src/mage/cards/c/CallToTheGrave.java @@ -54,7 +54,7 @@ import java.util.UUID; public class CallToTheGrave extends CardImpl { private static final String ruleText = "At the beginning of the end step, if no creatures are on the battlefield, sacrifice {this}."; - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a non-Zombie creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Zombie creature"); static { filter.add(Predicates.not(new SubtypePredicate(SubType.ZOMBIE))); diff --git a/Mage.Sets/src/mage/cards/c/CallerOfGales.java b/Mage.Sets/src/mage/cards/c/CallerOfGales.java index 58283d36522..6316c5223ec 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfGales.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfGales.java @@ -57,7 +57,9 @@ public class CallerOfGales extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{U}")); + + // {1}{U}, {T}: Target creature gains flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/ConsecrateLand.java b/Mage.Sets/src/mage/cards/c/ConsecrateLand.java index 6f406002071..d6c19230e63 100644 --- a/Mage.Sets/src/mage/cards/c/ConsecrateLand.java +++ b/Mage.Sets/src/mage/cards/c/ConsecrateLand.java @@ -64,7 +64,7 @@ public class ConsecrateLand extends CardImpl { this.addAbility(ability); // Enchanted land is indestructible and can't be enchanted by other Auras. - Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(), AttachmentType.AURA)); + Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted land is indestructible")); ability2.addEffect(new ConsecrateLandRuleEffect()); this.addAbility(ability2); } diff --git a/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java b/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java index 10097e67219..da16ebabea6 100644 --- a/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java +++ b/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java @@ -131,7 +131,7 @@ class CyclopeanTombCreateTriggeredEffect extends OneShotEffect { public CyclopeanTombCreateTriggeredEffect() { super(Outcome.Benefit); - this.staticText = "At the beginning of each of your upkeeps for the rest of the game, remove all mire counters from a land that a mire counter was put onto with {this} but that a mire counter has not been removed from with {this}"; + this.staticText = "at the beginning of each of your upkeeps for the rest of the game, remove all mire counters from a land that a mire counter was put onto with {this} but that a mire counter has not been removed from with {this}"; } public CyclopeanTombCreateTriggeredEffect(final CyclopeanTombCreateTriggeredEffect effect) { diff --git a/Mage.Sets/src/mage/cards/d/DeadDrop.java b/Mage.Sets/src/mage/cards/d/DeadDrop.java index 935acb85679..6f4d6e5bdfc 100644 --- a/Mage.Sets/src/mage/cards/d/DeadDrop.java +++ b/Mage.Sets/src/mage/cards/d/DeadDrop.java @@ -48,7 +48,7 @@ public class DeadDrop extends CardImpl { // Delve this.addAbility(new DelveAbility()); // Target player sacrifices two creatures - this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 2, "Target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURES, 2, "Target player")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/d/DesertNomads.java b/Mage.Sets/src/mage/cards/d/DesertNomads.java index ae20e300bb8..fd45c9ecdb2 100644 --- a/Mage.Sets/src/mage/cards/d/DesertNomads.java +++ b/Mage.Sets/src/mage/cards/d/DesertNomads.java @@ -88,6 +88,7 @@ class PreventDamageToSourceBySubtypeEffect extends PreventAllDamageToSourceEffec public PreventDamageToSourceBySubtypeEffect(SubType sub){ super(Duration.WhileOnBattlefield); subtype = sub; + staticText = "Prevent all damage that would be dealt to {this} by " + subtype.getDescription(); } @Override diff --git a/Mage.Sets/src/mage/cards/d/DevoutHarpist.java b/Mage.Sets/src/mage/cards/d/DevoutHarpist.java index 7dc2394b8e6..8bffe41bad7 100644 --- a/Mage.Sets/src/mage/cards/d/DevoutHarpist.java +++ b/Mage.Sets/src/mage/cards/d/DevoutHarpist.java @@ -51,7 +51,7 @@ import mage.target.TargetPermanent; * @author Plopman */ public class DevoutHarpist extends CardImpl { - private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Auras attached to a creature"); + private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Aura attached to a creature"); static { filter.add(new SubtypePredicate(SubType.AURA)); diff --git a/Mage.Sets/src/mage/cards/d/DispellersCapsule.java b/Mage.Sets/src/mage/cards/d/DispellersCapsule.java index 14c76a507f4..e67ef3cb888 100644 --- a/Mage.Sets/src/mage/cards/d/DispellersCapsule.java +++ b/Mage.Sets/src/mage/cards/d/DispellersCapsule.java @@ -40,6 +40,7 @@ import mage.filter.StaticFilters; import mage.target.TargetPermanent; import java.util.UUID; +import mage.abilities.costs.common.TapSourceCost; /** * @@ -50,7 +51,9 @@ public class DispellersCapsule extends CardImpl { public DispellersCapsule (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{W}"); + // {2}{W}, {T}, Sacrifice Dispeller's Capsule: Destroy target artifact or enchantment. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{W}")); + ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/Doomsday.java b/Mage.Sets/src/mage/cards/d/Doomsday.java index cfd5d807b4f..ef4832cc365 100644 --- a/Mage.Sets/src/mage/cards/d/Doomsday.java +++ b/Mage.Sets/src/mage/cards/d/Doomsday.java @@ -70,7 +70,7 @@ class DoomsdayEffect extends OneShotEffect { public DoomsdayEffect() { super(Outcome.LoseLife); - staticText = "Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up"; + staticText = "Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order"; } public DoomsdayEffect(final DoomsdayEffect effect) { diff --git a/Mage.Sets/src/mage/cards/d/Dredge.java b/Mage.Sets/src/mage/cards/d/Dredge.java index 60247271134..273273645d0 100644 --- a/Mage.Sets/src/mage/cards/d/Dredge.java +++ b/Mage.Sets/src/mage/cards/d/Dredge.java @@ -43,7 +43,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class Dredge extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("a creature or land"); + private static final FilterPermanent filter = new FilterPermanent("creature or land"); static { filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); diff --git a/Mage.Sets/src/mage/cards/e/Earthbind.java b/Mage.Sets/src/mage/cards/e/Earthbind.java index 72d1b4b4e9a..27fddb5906f 100644 --- a/Mage.Sets/src/mage/cards/e/Earthbind.java +++ b/Mage.Sets/src/mage/cards/e/Earthbind.java @@ -86,7 +86,7 @@ class EarthbindEffect extends OneShotEffect { public EarthbindEffect() { super(Outcome.Damage); - staticText = "if enchanted creature has flying, {this} deals 2 damage to that creature and Earthbind gains 'Enchanted creature loses flying.'"; + staticText = "if enchanted creature has flying, {this} deals 2 damage to that creature and Earthbind gains \"Enchanted creature loses flying.\""; } public EarthbindEffect(final EarthbindEffect effect) { diff --git a/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java b/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java new file mode 100644 index 00000000000..99545b678a3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EvraHalcyonWitness.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.e; + +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.OneShotEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public class EvraHalcyonWitness extends CardImpl { + + public EvraHalcyonWitness(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.AVATAR); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // {4}: Exchange your life total with Evra, Halcyon Witness's power. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EvraHalcyonWitnessEffect(), new ManaCostsImpl("{4}"))); + } + + public EvraHalcyonWitness(final EvraHalcyonWitness card) { + super(card); + } + + @Override + public EvraHalcyonWitness copy() { + return new EvraHalcyonWitness(this); + } +} + +class EvraHalcyonWitnessEffect extends OneShotEffect { + + public EvraHalcyonWitnessEffect() { + super(Outcome.GainLife); + staticText = "Exchange your life total with {this}'s power"; + } + + public EvraHalcyonWitnessEffect(final EvraHalcyonWitnessEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.isLifeTotalCanChange()) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { + int amount = perm.getPower().getValue(); + int life = player.getLife(); + if (life == amount) { + return false; + } + if (life < amount && !player.isCanGainLife()) { + return false; + } + if (life > amount && !player.isCanLoseLife()) { + return false; + } + player.setLife(amount, game); + game.addEffect(new SetPowerToughnessSourceEffect(life, Integer.MIN_VALUE, Duration.Custom, SubLayer.SetPT_7b), source); + return true; + } + } + return false; + } + + @Override + public EvraHalcyonWitnessEffect copy() { + return new EvraHalcyonWitnessEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/cards/f/Farmstead.java b/Mage.Sets/src/mage/cards/f/Farmstead.java index b1ddf161262..4620c4be674 100644 --- a/Mage.Sets/src/mage/cards/f/Farmstead.java +++ b/Mage.Sets/src/mage/cards/f/Farmstead.java @@ -66,7 +66,7 @@ public class Farmstead extends CardImpl { new DoIfCostPaid(new GainLifeEffect(1), new ManaCostsImpl("{W}{W}")), TargetController.YOU, true); Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); - effect.setText("Enchanted artifact has \"At the beginning of your upkeep, you may pay {W}{W}. If you do, you gain 1 life.\""); + effect.setText("Enchanted land has \"At the beginning of your upkeep, you may pay {W}{W}. If you do, you gain 1 life.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/g/GathererOfGraces.java b/Mage.Sets/src/mage/cards/g/GathererOfGraces.java index a7f891f67d5..ac788999739 100644 --- a/Mage.Sets/src/mage/cards/g/GathererOfGraces.java +++ b/Mage.Sets/src/mage/cards/g/GathererOfGraces.java @@ -51,7 +51,7 @@ import mage.target.common.TargetControlledPermanent; */ public class GathererOfGraces extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("an aura"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Aura"); static { filter.add(new SubtypePredicate(SubType.AURA)); diff --git a/Mage.Sets/src/mage/cards/g/GenjuOfTheFalls.java b/Mage.Sets/src/mage/cards/g/GenjuOfTheFalls.java index c8d40d5154e..ad8011fd361 100644 --- a/Mage.Sets/src/mage/cards/g/GenjuOfTheFalls.java +++ b/Mage.Sets/src/mage/cards/g/GenjuOfTheFalls.java @@ -67,7 +67,7 @@ public class GenjuOfTheFalls extends CardImpl { this.addAbility(ability); // {2}: Enchanted Island becomes a 3/2 blue Spirit creature with flying until end of turn. It's still a land. - Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect(new SpiritToken(), "Enchanted Island becomes a 3/2 blue Spirit creature with flying until end of turn. It's still a land", Duration.EndOfTurn), new GenericManaCost(2)); + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedWithActivatedAbilityOrSpellEffect(new SpiritToken(), "Enchanted Island becomes a 3/2 blue Spirit creature with flying until end of turn. It's still a land", Duration.EndOfTurn), new GenericManaCost(2)); this.addAbility(ability2); // When enchanted Island is put into a graveyard, you may return Genju of the Falls from your graveyard to your hand. TargetPermanent auraTarget = new TargetLandPermanent(filter); diff --git a/Mage.Sets/src/mage/cards/g/GhostlyVisit.java b/Mage.Sets/src/mage/cards/g/GhostlyVisit.java index f338a78fffb..c947d6e907f 100644 --- a/Mage.Sets/src/mage/cards/g/GhostlyVisit.java +++ b/Mage.Sets/src/mage/cards/g/GhostlyVisit.java @@ -54,7 +54,7 @@ public class GhostlyVisit extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}"); // Destroy target nonblack creature. - this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); } diff --git a/Mage.Sets/src/mage/cards/h/HourOfReckoning.java b/Mage.Sets/src/mage/cards/h/HourOfReckoning.java index 91c21c844ed..2b87fa483ad 100644 --- a/Mage.Sets/src/mage/cards/h/HourOfReckoning.java +++ b/Mage.Sets/src/mage/cards/h/HourOfReckoning.java @@ -43,7 +43,7 @@ import mage.filter.predicate.permanent.TokenPredicate; */ public class HourOfReckoning extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creatures"); static { filter.add(Predicates.not(new TokenPredicate())); diff --git a/Mage.Sets/src/mage/cards/i/ImperialRecruiter.java b/Mage.Sets/src/mage/cards/i/ImperialRecruiter.java index 1f4bd609b42..1b2cc1587b7 100644 --- a/Mage.Sets/src/mage/cards/i/ImperialRecruiter.java +++ b/Mage.Sets/src/mage/cards/i/ImperialRecruiter.java @@ -46,7 +46,7 @@ import mage.target.common.TargetCardInLibrary; */ public class ImperialRecruiter extends CardImpl { - private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card with power 2 or less"); + private static final FilterCreatureCard filter = new FilterCreatureCard("creature card with power 2 or less"); static{ filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3)); diff --git a/Mage.Sets/src/mage/cards/i/InBolassClutches.java b/Mage.Sets/src/mage/cards/i/InBolassClutches.java new file mode 100644 index 00000000000..0cee40b900e --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InBolassClutches.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.cards.i; + +import java.util.UUID; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.AddCardSuperTypeAttachedEffect; +import mage.abilities.effects.common.continuous.ControlEnchantedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class InBolassClutches extends CardImpl { + + public InBolassClutches(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.AURA); + + // Enchant permanent + TargetPermanent auraTarget = new TargetPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // You control enchanted permanent. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect("permanent"))); + + // Enchanted permanent is legendary. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new AddCardSuperTypeAttachedEffect(SuperType.LEGENDARY, Duration.WhileOnBattlefield, AttachmentType.AURA) + )); + } + + public InBolassClutches(final InBolassClutches card) { + super(card); + } + + @Override + public InBolassClutches copy() { + return new InBolassClutches(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/Instigator.java b/Mage.Sets/src/mage/cards/i/Instigator.java index 02eba17dbfc..d6bc254d2a7 100644 --- a/Mage.Sets/src/mage/cards/i/Instigator.java +++ b/Mage.Sets/src/mage/cards/i/Instigator.java @@ -87,7 +87,7 @@ class InstigatorEffect extends OneShotEffect { public InstigatorEffect() { super(Outcome.Detriment); - staticText = "Creatures target player control attack this turn if able"; + staticText = "Creatures target player controls attack this turn if able"; } public InstigatorEffect(final InstigatorEffect effect) { diff --git a/Mage.Sets/src/mage/cards/i/InstillFuror.java b/Mage.Sets/src/mage/cards/i/InstillFuror.java index 1290546a712..ed7ebfb59b6 100644 --- a/Mage.Sets/src/mage/cards/i/InstillFuror.java +++ b/Mage.Sets/src/mage/cards/i/InstillFuror.java @@ -75,7 +75,7 @@ public class InstillFuror extends CardImpl { new ConditionalOneShotEffect(new SacrificeSourceEffect(), new InvertCondition(AttackedThisTurnSourceCondition.instance), "sacrifice this creature unless it attacked this turn"), TargetController.YOU, false); Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield); - effect.setText("Enchanted creature has \"At the beginning of your upkeep, sacrifice this creature unless it attacked this turn.\""); + effect.setText("Enchanted creature has \"At the beginning of your end step, sacrifice this creature unless it attacked this turn.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect), new AttackedThisTurnWatcher()); } diff --git a/Mage.Sets/src/mage/cards/j/JettingGlasskite.java b/Mage.Sets/src/mage/cards/j/JettingGlasskite.java index 30ea01320c1..6cbd976edd5 100644 --- a/Mage.Sets/src/mage/cards/j/JettingGlasskite.java +++ b/Mage.Sets/src/mage/cards/j/JettingGlasskite.java @@ -59,7 +59,7 @@ public class JettingGlasskite extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - // Whenever Jetting Glasskite becomes the target of a spell or ability for the first time in a turn, counter that spell or ability. + // Whenever Jetting Glasskite becomes the target of a spell or ability for the first time each turn, counter that spell or ability. this.addAbility(new JettingGlasskiteAbility()); } @@ -112,7 +112,7 @@ class JettingGlasskiteAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever {this} becomes the target of a spell or ability for the first time in a turn, counter that spell or ability."; + return "Whenever {this} becomes the target of a spell or ability for the first time each turn, counter that spell or ability."; } } diff --git a/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java b/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java new file mode 100644 index 00000000000..9213c61956d --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KazarovSengirPureblood.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class KazarovSengirPureblood extends CardImpl { + + public KazarovSengirPureblood(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever a creature an opponent controls is dealt damage, put a +1/+1 counter on Kazarov, Sengir Pureblood. + this.addAbility(new KazarovSengirPurebloodTriggeredAbility()); + + // {3}{R}: Kazarov deals 2 damage to target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{3}{R}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KazarovSengirPureblood(final KazarovSengirPureblood card) { + super(card); + } + + @Override + public KazarovSengirPureblood copy() { + return new KazarovSengirPureblood(this); + } +} + +class KazarovSengirPurebloodTriggeredAbility extends TriggeredAbilityImpl { + + public KazarovSengirPurebloodTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance())); + } + + public KazarovSengirPurebloodTriggeredAbility(final KazarovSengirPurebloodTriggeredAbility effect) { + super(effect); + } + + @Override + public KazarovSengirPurebloodTriggeredAbility copy() { + return new KazarovSengirPurebloodTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_CREATURE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event == null) { + return false; + } + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); + if (permanent == null) { + return false; + } + if (permanent.getControllerId() == this.getControllerId()) { + return false; + } + return true; + } + + @Override + public String getRule() { + return "Whenever a creature an opponent controls is dealt damage, put a +1/+1 counter on {this}."; + } +} diff --git a/Mage.Sets/src/mage/cards/k/Kismet.java b/Mage.Sets/src/mage/cards/k/Kismet.java index 15ff6534d9a..abcbda0c4c8 100644 --- a/Mage.Sets/src/mage/cards/k/Kismet.java +++ b/Mage.Sets/src/mage/cards/k/Kismet.java @@ -52,7 +52,7 @@ public class Kismet extends CardImpl { public Kismet(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}"); - // Artifacts, creatures, and lands played by your opponents enter the battlefield tapped. + // Artifacts, creatures, and lands your opponents control enter the battlefield tapped. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KismetEffect())); } @@ -70,7 +70,7 @@ class KismetEffect extends ReplacementEffectImpl { KismetEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); - staticText = "Artifacts, creatures, and lands played by your opponents enter the battlefield tapped"; + staticText = "Artifacts, creatures, and lands your opponents control enter the battlefield tapped"; } KismetEffect(final KismetEffect effect) { diff --git a/Mage.Sets/src/mage/cards/k/Knighthood.java b/Mage.Sets/src/mage/cards/k/Knighthood.java index b912b579166..2279be201a3 100644 --- a/Mage.Sets/src/mage/cards/k/Knighthood.java +++ b/Mage.Sets/src/mage/cards/k/Knighthood.java @@ -48,7 +48,7 @@ public class Knighthood extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); // Creatures you control have first strike. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES, false))); } diff --git a/Mage.Sets/src/mage/cards/k/KoboldTaskmaster.java b/Mage.Sets/src/mage/cards/k/KoboldTaskmaster.java index 3a53691f78e..aa8f85c2653 100644 --- a/Mage.Sets/src/mage/cards/k/KoboldTaskmaster.java +++ b/Mage.Sets/src/mage/cards/k/KoboldTaskmaster.java @@ -44,7 +44,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; */ public class KoboldTaskmaster extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Other Kobold creatures you control"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Kobold creatures you control"); static { filter.add(new ControllerPredicate(TargetController.YOU)); diff --git a/Mage.Sets/src/mage/cards/l/LeadBellyChimera.java b/Mage.Sets/src/mage/cards/l/LeadBellyChimera.java index c6f7d53957f..765c67ef8f8 100644 --- a/Mage.Sets/src/mage/cards/l/LeadBellyChimera.java +++ b/Mage.Sets/src/mage/cards/l/LeadBellyChimera.java @@ -53,7 +53,7 @@ import java.util.UUID; */ public class LeadBellyChimera extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Chimera creature you control"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Chimera creature"); static { filter.add(new SubtypePredicate(SubType.CHIMERA)); diff --git a/Mage.Sets/src/mage/cards/l/Levitation.java b/Mage.Sets/src/mage/cards/l/Levitation.java index 48cdeb37c8c..9fd7dea9cad 100644 --- a/Mage.Sets/src/mage/cards/l/Levitation.java +++ b/Mage.Sets/src/mage/cards/l/Levitation.java @@ -38,6 +38,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; import mage.filter.predicate.mageobject.CardTypePredicate; /** @@ -46,16 +47,10 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class Levitation extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("creatures "); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - public Levitation (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}{U}"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter, false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES, false))); } public Levitation (final Levitation card) { diff --git a/Mage.Sets/src/mage/cards/l/LichsMastery.java b/Mage.Sets/src/mage/cards/l/LichsMastery.java new file mode 100644 index 00000000000..1abafd5a67c --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LichsMastery.java @@ -0,0 +1,252 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.l; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.LoseGameSourceControllerEffect; +import mage.constants.SuperType; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class LichsMastery extends CardImpl { + + public LichsMastery(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + + // You can't lose the game. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LichsMasteryCantLoseEffect())); + + // Whenever you gain life, draw that many cards. + this.addAbility(new GainLifeControllerTriggeredAbility(new LichsMasteryDrawCardsEffect(), false, true)); + + // Whenever you lose life, for each 1 life you lost, exile a permanent you control or a card from your hand or graveyard. + this.addAbility(new LichsMasteryLoseLifeTriggeredAbility()); + + // When Lich's Mastery leaves the battlefield, you lose the game. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new LoseGameSourceControllerEffect(), false)); + } + + public LichsMastery(final LichsMastery card) { + super(card); + } + + @Override + public LichsMastery copy() { + return new LichsMastery(this); + } +} + +class LichsMasteryCantLoseEffect extends ContinuousRuleModifyingEffectImpl { + + public LichsMasteryCantLoseEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit, false, false); + staticText = "You can't lose the game"; + } + + public LichsMasteryCantLoseEffect(final LichsMasteryCantLoseEffect effect) { + super(effect); + } + + @Override + public LichsMasteryCantLoseEffect copy() { + return new LichsMasteryCantLoseEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getType() == GameEvent.EventType.LOSES && event.getPlayerId().equals(source.getControllerId()); + } +} + +class LichsMasteryDrawCardsEffect extends OneShotEffect { + + public LichsMasteryDrawCardsEffect() { + super(Outcome.Benefit); + this.staticText = "draw that many cards"; + } + + public LichsMasteryDrawCardsEffect(final LichsMasteryDrawCardsEffect effect) { + super(effect); + } + + @Override + public LichsMasteryDrawCardsEffect copy() { + return new LichsMasteryDrawCardsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int lifeGained = (Integer) this.getValue("gainedLife"); + if (lifeGained > 0) { + return new DrawCardSourceControllerEffect(lifeGained).apply(game, source); + } + return false; + } +} + +class LichsMasteryLoseLifeTriggeredAbility extends TriggeredAbilityImpl { + + public LichsMasteryLoseLifeTriggeredAbility() { + super(Zone.BATTLEFIELD, new LichsMasteryLoseLifeEffect(), false); + } + + public LichsMasteryLoseLifeTriggeredAbility(final LichsMasteryLoseLifeTriggeredAbility ability) { + super(ability); + } + + @Override + public LichsMasteryLoseLifeTriggeredAbility copy() { + return new LichsMasteryLoseLifeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.LOST_LIFE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.getControllerId())) { + for (Effect effect : this.getEffects()) { + if (effect instanceof LichsMasteryLoseLifeEffect) { + ((LichsMasteryLoseLifeEffect) effect).setAmount(event.getAmount()); + } + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you lose life, for each 1 life you lost, exile a permanent you control or a card from your hand or graveyard."; + } +} + +class LichsMasteryLoseLifeEffect extends OneShotEffect { + + private int amount = 0; + + public LichsMasteryLoseLifeEffect() { + super(Outcome.Exile); + this.staticText = "for each 1 life you lost, exile a permanent you control or a card from your hand or graveyard."; + } + + public LichsMasteryLoseLifeEffect(final LichsMasteryLoseLifeEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public LichsMasteryLoseLifeEffect copy() { + return new LichsMasteryLoseLifeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + FilterPermanent filter = new FilterPermanent(); + filter.add(new ControllerIdPredicate(controller.getId())); + for (int i = 0; i < amount; i++) { + int handCount = controller.getHand().size(); + int graveCount = controller.getGraveyard().size(); + int permCount = game.getBattlefield().getActivePermanents(filter, controller.getId(), game).size(); + if (graveCount + handCount == 0 || (permCount > 0 && controller.chooseUse(Outcome.Exile, "Exile permanent you control? (No = from hand or graveyard)", source, game))) { + Target target = new TargetControlledPermanent(1, 1, new FilterControlledPermanent(), true); + controller.choose(outcome, target, source.getSourceId(), game); + Effect effect = new ExileTargetEffect(); + effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game)); + effect.apply(game, source); + } else if (graveCount == 0 || (handCount > 0 && controller.chooseUse(Outcome.Exile, "Exile a card from your hand? (No = from graveyard)", source, game))) { + Target target = new TargetCardInHand(1, 1, new FilterCard()); + controller.choose(outcome, target, source.getSourceId(), game); + Card card = controller.getHand().get(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, Zone.EXILED, source, game); + } + } else if (graveCount > 0) { + Target target = new TargetCardInYourGraveyard(1, 1, new FilterCard(), true); + target.choose(Outcome.Exile, source.getControllerId(), source.getSourceId(), game); + Card card = controller.getGraveyard().get(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, Zone.EXILED, source, game); + } + } + } + return true; + } + + public void setAmount(int amount) { + this.amount = amount; + } +} diff --git a/Mage.Sets/src/mage/cards/l/LotusCobra.java b/Mage.Sets/src/mage/cards/l/LotusCobra.java index a5d1c81d94a..248f8dc9ac7 100644 --- a/Mage.Sets/src/mage/cards/l/LotusCobra.java +++ b/Mage.Sets/src/mage/cards/l/LotusCobra.java @@ -50,7 +50,8 @@ public class LotusCobra extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - this.addAbility(new LandfallAbility(new AddManaOfAnyColorEffect(), false)); + // Landfall — Whenever a land enters the battlefield under your control, you may add one mana of any color to your mana pool. + this.addAbility(new LandfallAbility(new AddManaOfAnyColorEffect(), true)); } public LotusCobra(final LotusCobra card) { diff --git a/Mage.Sets/src/mage/cards/l/LoxodonHierarch.java b/Mage.Sets/src/mage/cards/l/LoxodonHierarch.java index 49eb454675a..d263554ba6e 100644 --- a/Mage.Sets/src/mage/cards/l/LoxodonHierarch.java +++ b/Mage.Sets/src/mage/cards/l/LoxodonHierarch.java @@ -51,7 +51,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; */ public class LoxodonHierarch extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("each creature you control"); + private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control"); static { filter.add(new ControllerPredicate(TargetController.YOU)); diff --git a/Mage.Sets/src/mage/cards/m/MakeAStand.java b/Mage.Sets/src/mage/cards/m/MakeAStand.java index 1d89686c534..63203aff8d9 100644 --- a/Mage.Sets/src/mage/cards/m/MakeAStand.java +++ b/Mage.Sets/src/mage/cards/m/MakeAStand.java @@ -36,6 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; +import mage.filter.StaticFilters; /** * @@ -46,11 +47,11 @@ public class MakeAStand extends CardImpl { public MakeAStand(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}"); - // Creature you control get +1/+0 and gain indestructible until end of turn. + // Creatures you control get +1/+0 and gain indestructible until end of turn. Effect effect1 = new BoostControlledEffect(1, 0, Duration.EndOfTurn); - effect1.setText("Creature you control get +1/+0"); + effect1.setText("Creatures you control get +1/+0"); this.getSpellAbility().addEffect(effect1); - Effect effect2 = new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn); + Effect effect2 = new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES); effect2.setText("and gain indestructible until end of turn"); this.getSpellAbility().addEffect(effect2); } diff --git a/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java b/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java index 0afc6f5a71c..8e56033d624 100644 --- a/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java +++ b/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java @@ -76,7 +76,7 @@ class NetherbornPhalanxEffect extends OneShotEffect { NetherbornPhalanxEffect() { super(Outcome.Sacrifice); - this.staticText = "Each opponent loses 1 life for each creature he or she controls"; + this.staticText = "each opponent loses 1 life for each creature he or she controls"; } NetherbornPhalanxEffect(final NetherbornPhalanxEffect effect) { diff --git a/Mage.Sets/src/mage/cards/o/OnSerrasWings.java b/Mage.Sets/src/mage/cards/o/OnSerrasWings.java new file mode 100644 index 00000000000..bbcd0329941 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OnSerrasWings.java @@ -0,0 +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.cards.o; + +import java.util.UUID; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.target.common.TargetCreaturePermanent; +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.AddCardSuperTypeAttachedEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class OnSerrasWings extends CardImpl { + + public OnSerrasWings(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature is legendary, gets +1/+1, and has flying, vigilance, and lifelink. + Effect effect = new AddCardSuperTypeAttachedEffect(SuperType.LEGENDARY, Duration.WhileOnBattlefield, AttachmentType.AURA); + effect.setText("Enchanted creature is legendary,"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + effect = new BoostEnchantedEffect(4, 4, Duration.WhileOnBattlefield); + effect.setText("gets +1/+1,"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA); + effect.setText("vigilance,"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), AttachmentType.AURA); + effect.setText("and lifelink"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public OnSerrasWings(final OnSerrasWings card) { + super(card); + } + + @Override + public OnSerrasWings copy() { + return new OnSerrasWings(this); + } +} diff --git a/Mage.Sets/src/mage/cards/o/OrcishVandal.java b/Mage.Sets/src/mage/cards/o/OrcishVandal.java new file mode 100644 index 00000000000..f2612992554 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OrcishVandal.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.cards.o; + +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.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlayer; + +import java.util.UUID; +/** + * + * @author themattfiles + */ +public class OrcishVandal extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public OrcishVandal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.ORC); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {t}, Sacrifice an artifact: Orcish Vandal deals 2 damage to any target. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public OrcishVandal(final OrcishVandal card) { + super(card); + } + + @Override + public OrcishVandal copy() { + return new OrcishVandal(this); + } +} diff --git a/Mage.Sets/src/mage/cards/p/PresenceOfGond.java b/Mage.Sets/src/mage/cards/p/PresenceOfGond.java index 7867daff6b1..281492f9a5f 100644 --- a/Mage.Sets/src/mage/cards/p/PresenceOfGond.java +++ b/Mage.Sets/src/mage/cards/p/PresenceOfGond.java @@ -69,7 +69,7 @@ public class PresenceOfGond extends CardImpl { // Enchanted creature has "{tap}: Create a 1/1 green Elf Warrior creature token." Ability abilityToGain = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ElfToken()), new TapSourceCost()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(abilityToGain, AttachmentType.AURA, Duration.WhileOnBattlefield, - "Enchanted creature has \"{t}: Create a 1/1 green Elf Warrior creature token.\""))); + "Enchanted creature has \"{T}: Create a 1/1 green Elf Warrior creature token.\""))); } public PresenceOfGond(final PresenceOfGond card) { diff --git a/Mage.Sets/src/mage/cards/q/QuicksilverDagger.java b/Mage.Sets/src/mage/cards/q/QuicksilverDagger.java index 9da954dd660..b98b816b553 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksilverDagger.java +++ b/Mage.Sets/src/mage/cards/q/QuicksilverDagger.java @@ -72,7 +72,7 @@ public class QuicksilverDagger extends CardImpl { gainAbility.addEffect(new DrawCardSourceControllerEffect(1)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, - "Enchanted creature has \"{tap}: This creature deals 1 damage to target player. You draw a card.\"") + "Enchanted creature has \"{T}: This creature deals 1 damage to target player. You draw a card.\"") )); } diff --git a/Mage.Sets/src/mage/cards/r/Reap.java b/Mage.Sets/src/mage/cards/r/Reap.java index 242acfd7f40..43f3903dbe0 100644 --- a/Mage.Sets/src/mage/cards/r/Reap.java +++ b/Mage.Sets/src/mage/cards/r/Reap.java @@ -78,7 +78,7 @@ public class Reap extends CardImpl { opponentId = target.getFirstTarget(); } int numbTargets = game.getBattlefield().getAllActivePermanents(filter, opponentId, game).size(); - ability.addTarget(new TargetCardInYourGraveyard(0, numbTargets, new FilterCard("cards from your graveyard"))); + ability.addTarget(new TargetCardInYourGraveyard(0, numbTargets, new FilterCard("card" + (numbTargets == 1 ? "" : "s") + " from your graveyard"))); } } } diff --git a/Mage.Sets/src/mage/cards/r/RendFlesh.java b/Mage.Sets/src/mage/cards/r/RendFlesh.java index 95f2f1a9734..3621497bd15 100644 --- a/Mage.Sets/src/mage/cards/r/RendFlesh.java +++ b/Mage.Sets/src/mage/cards/r/RendFlesh.java @@ -46,7 +46,7 @@ import java.util.UUID; */ public class RendFlesh extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Non-Spirit"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Non-Spirit creature"); static { filter.add(Predicates.not(new SubtypePredicate(SubType.SPIRIT))); @@ -56,6 +56,7 @@ public class RendFlesh extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}"); this.subtype.add(SubType.ARCANE); + // Destroy target non-Spirit creature. Target target = new TargetCreaturePermanent(filter); this.getSpellAbility().addTarget(target); this.getSpellAbility().addEffect(new DestroyTargetEffect()); diff --git a/Mage.Sets/src/mage/cards/r/RockSlide.java b/Mage.Sets/src/mage/cards/r/RockSlide.java index 80e1638e2e9..2a24e823a48 100644 --- a/Mage.Sets/src/mage/cards/r/RockSlide.java +++ b/Mage.Sets/src/mage/cards/r/RockSlide.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCreaturePermanentAmount; */ public class RockSlide extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("attacking or blocking creatures without flying"); static { filter.add(Predicates.or( diff --git a/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java b/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java index d84b5ae2019..fb276041f72 100644 --- a/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java +++ b/Mage.Sets/src/mage/cards/s/SeshiroTheAnointed.java @@ -51,7 +51,7 @@ import java.util.UUID; */ public class SeshiroTheAnointed extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Snakes"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Snake creatures"); static { filter.add(new SubtypePredicate(SubType.SNAKE)); @@ -65,7 +65,10 @@ public class SeshiroTheAnointed extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(4); + + // Other Snake creatures you control get +2/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, true))); + // Whenever a Snake you control deals combat damage to a player, you may draw a card. this.addAbility(new SeshiroTheAnointedAbility()); } diff --git a/Mage.Sets/src/mage/cards/s/ShadowLance.java b/Mage.Sets/src/mage/cards/s/ShadowLance.java index 19df12e5cb2..72199b4a596 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowLance.java +++ b/Mage.Sets/src/mage/cards/s/ShadowLance.java @@ -33,6 +33,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; @@ -60,7 +61,7 @@ public class ShadowLance extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA))); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"))); } public ShadowLance(final ShadowLance card) { diff --git a/Mage.Sets/src/mage/cards/s/ShisatoWhisperingHunter.java b/Mage.Sets/src/mage/cards/s/ShisatoWhisperingHunter.java index 025af26c308..b4ba46d4be4 100644 --- a/Mage.Sets/src/mage/cards/s/ShisatoWhisperingHunter.java +++ b/Mage.Sets/src/mage/cards/s/ShisatoWhisperingHunter.java @@ -67,7 +67,7 @@ public class ShisatoWhisperingHunter extends CardImpl { // At the beginning of your upkeep, sacrifice a Snake. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(filter, 1,""), TargetController.YOU, false)); // Whenever Shisato, Whispering Hunter deals combat damage to a player, that player skips their next untap step. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SkipNextPlayerUntapStepEffect("that "),false, true)); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SkipNextPlayerUntapStepEffect("that"), false, true)); } public ShisatoWhisperingHunter(final ShisatoWhisperingHunter card) { diff --git a/Mage.Sets/src/mage/cards/s/Skeletonize.java b/Mage.Sets/src/mage/cards/s/Skeletonize.java index 0093290847b..df34cd23805 100644 --- a/Mage.Sets/src/mage/cards/s/Skeletonize.java +++ b/Mage.Sets/src/mage/cards/s/Skeletonize.java @@ -77,7 +77,7 @@ class SkeletonizeEffect extends OneShotEffect { public SkeletonizeEffect() { super(Outcome.PutCreatureInPlay); - this.staticText = "When a creature dealt damage this way dies this turn, create a 1/1 black Skeleton creature token with \"{B}: Regenerate this creature\""; + this.staticText = "When a creature dealt damage this way dies this turn, create a 1/1 black Skeleton creature token with \"{B}: Regenerate this creature.\""; } public SkeletonizeEffect(final SkeletonizeEffect effect) { diff --git a/Mage.Sets/src/mage/cards/s/Subversion.java b/Mage.Sets/src/mage/cards/s/Subversion.java index 483e166d0d7..9c3769e0ff3 100644 --- a/Mage.Sets/src/mage/cards/s/Subversion.java +++ b/Mage.Sets/src/mage/cards/s/Subversion.java @@ -66,7 +66,7 @@ public class Subversion extends CardImpl { public SubversionEffect() { super(Outcome.Damage); - staticText = "Each opponent loses 1 life. You gain life equal to the life lost this way"; + staticText = "each opponent loses 1 life. You gain life equal to the life lost this way"; } public SubversionEffect(final SubversionEffect effect) { diff --git a/Mage.Sets/src/mage/cards/s/SupremeVerdict.java b/Mage.Sets/src/mage/cards/s/SupremeVerdict.java index 29e84077f13..870a9cd0fd0 100644 --- a/Mage.Sets/src/mage/cards/s/SupremeVerdict.java +++ b/Mage.Sets/src/mage/cards/s/SupremeVerdict.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; /** @@ -51,7 +52,7 @@ public class SupremeVerdict extends CardImpl { this.addAbility(ability); // Destroy all creatures. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); + this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES)); } public SupremeVerdict(final SupremeVerdict card) { diff --git a/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java b/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java index 9365f0a6911..5862565ea8e 100644 --- a/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java +++ b/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java @@ -78,7 +78,7 @@ public class SurrakDragonclaw extends CardImpl { // Other creatures you control have trample. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); + new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES, true))); } diff --git a/Mage.Sets/src/mage/cards/s/SurvivalOfTheFittest.java b/Mage.Sets/src/mage/cards/s/SurvivalOfTheFittest.java index c83b54b5fcd..8f093590580 100644 --- a/Mage.Sets/src/mage/cards/s/SurvivalOfTheFittest.java +++ b/Mage.Sets/src/mage/cards/s/SurvivalOfTheFittest.java @@ -37,12 +37,11 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; import java.util.UUID; +import mage.filter.StaticFilters; /** * @@ -50,18 +49,12 @@ import java.util.UUID; */ public class SurvivalOfTheFittest extends CardImpl { - private static final FilterCard filter = new FilterCard("a creature card"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - public SurvivalOfTheFittest(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); // {G}, Discard a creature card: Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), new ColoredManaCost(ColoredManaSymbol.G)); - ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true), new ColoredManaCost(ColoredManaSymbol.G)); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TreasureMap.java b/Mage.Sets/src/mage/cards/t/TreasureMap.java index 941a9358a3e..0e3aa7cf6a9 100644 --- a/Mage.Sets/src/mage/cards/t/TreasureMap.java +++ b/Mage.Sets/src/mage/cards/t/TreasureMap.java @@ -83,7 +83,7 @@ class TreasureMapEffect extends OneShotEffect { this.staticText = "Scry 1. Put a landmark counter on {this}. " + "Then if there are three or more landmark counters on it, " + "remove those counters, transform {this}, and create " - + "three colorless Treasure artifact tokens with \"{T}, Sacrifice this artifact: Add one mana of any color to your mana pool."; + + "three colorless Treasure artifact tokens with \"{T}, Sacrifice this artifact: Add one mana of any color to your mana pool.\""; } TreasureMapEffect(final TreasureMapEffect effect) { diff --git a/Mage.Sets/src/mage/cards/t/TwoHeadedGiant.java b/Mage.Sets/src/mage/cards/t/TwoHeadedGiant.java new file mode 100644 index 00000000000..f78aecccc93 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TwoHeadedGiant.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public class TwoHeadedGiant extends CardImpl { + + public TwoHeadedGiant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + + this.subtype.add(SubType.GIANT); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Two-Headed Giant attacks, flip two coins. If both coins come up heads, Two-Headed Giant gains double strike until end of turn. If both coins come up tails, Two-Headed Giant gains menace until end of turn. + this.addAbility(new AttacksTriggeredAbility(new TwoHeadedGiantEffect(), false)); + } + + public TwoHeadedGiant(final TwoHeadedGiant card) { + super(card); + } + + @Override + public TwoHeadedGiant copy() { + return new TwoHeadedGiant(this); + } +} + +class TwoHeadedGiantEffect extends OneShotEffect { + + public TwoHeadedGiantEffect() { + super(Outcome.Benefit); + this.staticText = "flip two coins. If both coins come up heads, {this} gains double strike until end of turn." + + " If both coins come up tails, {this} gains menace until end of turn"; + } + + public TwoHeadedGiantEffect(final TwoHeadedGiantEffect effect) { + super(effect); + } + + @Override + public TwoHeadedGiantEffect copy() { + return new TwoHeadedGiantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + boolean head1 = player.flipCoin(game); + boolean head2 = player.flipCoin(game); + if (head1 == head2) { + if (head1) { + new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance()).apply(game, source); + } else { + new GainAbilitySourceEffect(new MenaceAbility()).apply(game, source); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/u/UncleIstvan.java b/Mage.Sets/src/mage/cards/u/UncleIstvan.java index 8013328b3ca..23e5dfd0e21 100644 --- a/Mage.Sets/src/mage/cards/u/UncleIstvan.java +++ b/Mage.Sets/src/mage/cards/u/UncleIstvan.java @@ -72,6 +72,7 @@ class PreventDamageToSourceByCardTypeEffect extends PreventAllDamageToSourceEffe public PreventDamageToSourceByCardTypeEffect() { super(Duration.WhileOnBattlefield); + staticText = "Prevent all damage that would be dealt to {this} by creatures"; } public PreventDamageToSourceByCardTypeEffect(final PreventDamageToSourceByCardTypeEffect effect) { diff --git a/Mage.Sets/src/mage/cards/u/UrzasTome.java b/Mage.Sets/src/mage/cards/u/UrzasTome.java new file mode 100644 index 00000000000..37e8e5e2a05 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UrzasTome.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.u; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.common.FilterHistoricCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public class UrzasTome extends CardImpl { + + public UrzasTome(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + // {3}, {T}: Draw a card. Then discard a card unless you exile a historic card from your graveyard. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UrzasTomeEffect(), new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public UrzasTome(final UrzasTome card) { + super(card); + } + + @Override + public UrzasTome copy() { + return new UrzasTome(this); + } +} + +class UrzasTomeEffect extends OneShotEffect { + + public UrzasTomeEffect() { + super(Outcome.Discard); + staticText = "Draw a card. Then discard a card unless you exile a historic card from your graveyard"; + } + + public UrzasTomeEffect(final UrzasTomeEffect effect) { + super(effect); + } + + @Override + public UrzasTomeEffect copy() { + return new UrzasTomeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + new DrawCardSourceControllerEffect(1).apply(game, source); + if (controller != null + && controller.chooseUse(Outcome.Discard, "Exile a historic card from your graveyard?", source, game)) { + Cost cost = new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterHistoricCard())); + if (cost.canPay(source, source.getSourceId(), controller.getId(), game)) { + if (cost.pay(source, game, source.getSourceId(), controller.getId(), false, null)) { + return true; + } + } + } + if (controller != null) { + controller.discard(1, false, source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/v/VanquishersBanner.java b/Mage.Sets/src/mage/cards/v/VanquishersBanner.java index 18d9a70697e..e443450b32e 100644 --- a/Mage.Sets/src/mage/cards/v/VanquishersBanner.java +++ b/Mage.Sets/src/mage/cards/v/VanquishersBanner.java @@ -68,7 +68,7 @@ public class VanquishersBanner extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.Benefit))); // Creatures you control of the chosen type get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllOfChosenSubtypeEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllOfChosenSubtypeEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); // Whenever you cast a creature spell of the chosen type, draw a card. this.addAbility(new DrawCardIfCreatureTypeAbility()); diff --git a/Mage.Sets/src/mage/cards/w/WarriorsHonor.java b/Mage.Sets/src/mage/cards/w/WarriorsHonor.java index 1659dd4d9aa..25b014072e8 100644 --- a/Mage.Sets/src/mage/cards/w/WarriorsHonor.java +++ b/Mage.Sets/src/mage/cards/w/WarriorsHonor.java @@ -44,7 +44,7 @@ public class WarriorsHonor extends CardImpl { public WarriorsHonor(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}"); - this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES, false)); } public WarriorsHonor(final WarriorsHonor card) { diff --git a/Mage.Sets/src/mage/cards/w/WarriorsStand.java b/Mage.Sets/src/mage/cards/w/WarriorsStand.java index 52b4327e479..4b16188dd40 100644 --- a/Mage.Sets/src/mage/cards/w/WarriorsStand.java +++ b/Mage.Sets/src/mage/cards/w/WarriorsStand.java @@ -58,7 +58,7 @@ public class WarriorsStand extends CardImpl { this.addAbility(ability); // Creatures you control get +2/+2 until end of turn. - this.getSpellAbility().addEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES, false)); } public WarriorsStand(final WarriorsStand card) { diff --git a/Mage.Sets/src/mage/cards/w/Wildfire.java b/Mage.Sets/src/mage/cards/w/Wildfire.java index 467a53531b2..553d6ba4d93 100644 --- a/Mage.Sets/src/mage/cards/w/Wildfire.java +++ b/Mage.Sets/src/mage/cards/w/Wildfire.java @@ -43,7 +43,7 @@ import mage.filter.common.FilterControlledPermanent; */ public class Wildfire extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("land"); + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("lands"); public Wildfire(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{R}{R}"); @@ -52,7 +52,7 @@ public class Wildfire extends CardImpl { //Each player sacrifices four lands. this.getSpellAbility().addEffect(new SacrificeAllEffect(4, filter)); //Wildfire deals 4 damage to each creature. - this.getSpellAbility().addEffect(new DamageAllEffect(4, StaticFilters.FILTER_PERMANENT_CREATURES)); + this.getSpellAbility().addEffect(new DamageAllEffect(4, StaticFilters.FILTER_PERMANENT_CREATURE)); } public Wildfire(final Wildfire card) { diff --git a/Mage.Sets/src/mage/cards/y/YoseiTheMorningStar.java b/Mage.Sets/src/mage/cards/y/YoseiTheMorningStar.java index 8667ad513e4..4416cacdcb4 100644 --- a/Mage.Sets/src/mage/cards/y/YoseiTheMorningStar.java +++ b/Mage.Sets/src/mage/cards/y/YoseiTheMorningStar.java @@ -70,7 +70,7 @@ public class YoseiTheMorningStar extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Yosei, the Morning Star dies, target player skips their next untap step. Tap up to five target permanents that player controls. - Ability ability = new DiesTriggeredAbility(new SkipNextPlayerUntapStepEffect("target ")); + Ability ability = new DiesTriggeredAbility(new SkipNextPlayerUntapStepEffect("target")); ability.addTarget(new TargetPlayer()); ability.addTarget(new YoseiTheMorningStarTarget()); ability.addEffect(new YoseiTheMorningStarTapEffect()); diff --git a/Mage.Sets/src/mage/sets/Dominaria.java b/Mage.Sets/src/mage/sets/Dominaria.java index debfdbcd725..a33caea713a 100644 --- a/Mage.Sets/src/mage/sets/Dominaria.java +++ b/Mage.Sets/src/mage/sets/Dominaria.java @@ -104,6 +104,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Drudge Sentinel", 89, Rarity.COMMON, mage.cards.d.DrudgeSentinel.class)); cards.add(new SetCardInfo("Dub", 15, Rarity.SPECIAL, mage.cards.d.Dub.class)); cards.add(new SetCardInfo("Eviscerate", 91, Rarity.COMMON, mage.cards.e.Eviscerate.class)); + cards.add(new SetCardInfo("Evra, Halcyon Witness", 16, Rarity.RARE, mage.cards.e.EvraHalcyonWitness.class)); cards.add(new SetCardInfo("Excavation Elephant", 17, Rarity.COMMON, mage.cards.e.ExcavationElephant.class)); cards.add(new SetCardInfo("Fall of the Thran", 18, Rarity.RARE, mage.cards.f.FallOfTheThran.class)); cards.add(new SetCardInfo("Feral Abomination", 92, Rarity.COMMON, mage.cards.f.FeralAbomination.class)); @@ -139,6 +140,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Homarid Explorer", 53, Rarity.UNCOMMON, mage.cards.h.HomaridExplorer.class)); cards.add(new SetCardInfo("Howling Golem", 218, Rarity.UNCOMMON, mage.cards.h.HowlingGolem.class)); cards.add(new SetCardInfo("Icy Manipulator", 219, Rarity.UNCOMMON, mage.cards.i.IcyManipulator.class)); + cards.add(new SetCardInfo("In Bolas's Clutches", 54, Rarity.UNCOMMON, mage.cards.i.InBolassClutches.class)); cards.add(new SetCardInfo("Invoke the Divine", 22, Rarity.COMMON, mage.cards.i.InvokeTheDivine.class)); cards.add(new SetCardInfo("Island", 254, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 255, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); @@ -156,6 +158,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Karn, Scion of Urza", 1, Rarity.MYTHIC, mage.cards.k.KarnScionOfUrza.class)); cards.add(new SetCardInfo("Karn's Temporal Sundering", 55, Rarity.RARE, mage.cards.k.KarnsTemporalSundering.class)); cards.add(new SetCardInfo("Karplusan Hound", 277, Rarity.UNCOMMON, mage.cards.k.KarplusanHound.class)); + cards.add(new SetCardInfo("Kazarov, Sengir Pureblood", 96, Rarity.RARE, mage.cards.k.KazarovSengirPureblood.class)); cards.add(new SetCardInfo("Keldon Overseer", 134, Rarity.COMMON, mage.cards.k.KeldonOverseer.class)); cards.add(new SetCardInfo("Keldon Raider", 135, Rarity.COMMON, mage.cards.k.KeldonRaider.class)); cards.add(new SetCardInfo("Keldon Warcaller", 136, Rarity.COMMON, mage.cards.k.KeldonWarcaller.class)); @@ -163,6 +166,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Knight of Malice", 97, Rarity.UNCOMMON, mage.cards.k.KnightOfMalice.class)); cards.add(new SetCardInfo("Knight of New Benalia", 24, Rarity.COMMON, mage.cards.k.KnightOfNewBenalia.class)); cards.add(new SetCardInfo("Kwende, Pride of Femeref", 25, Rarity.UNCOMMON, mage.cards.k.KwendePrideOfFemeref.class)); + cards.add(new SetCardInfo("Lich's Mastery", 98, Rarity.RARE, mage.cards.l.LichsMastery.class)); cards.add(new SetCardInfo("Lingering Phantom", 99, Rarity.UNCOMMON, mage.cards.l.LingeringPhantom.class)); cards.add(new SetCardInfo("Llanowar Elves", 168, Rarity.COMMON, mage.cards.l.LlanowarElves.class)); cards.add(new SetCardInfo("Llanowar Envoy", 169, Rarity.COMMON, mage.cards.l.LlanowarEnvoy.class)); @@ -189,7 +193,9 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Naru Meha, Master Wizard", 59, Rarity.MYTHIC, mage.cards.n.NaruMehaMasterWizard.class)); cards.add(new SetCardInfo("Nature's Spiral", 175, Rarity.UNCOMMON, mage.cards.n.NaturesSpiral.class)); cards.add(new SetCardInfo("Niambi, Faithful Healer", 272, Rarity.RARE, mage.cards.n.NiambiFaithfulHealer.class)); + cards.add(new SetCardInfo("On Serra's Wings", 28, Rarity.UNCOMMON, mage.cards.o.OnSerrasWings.class)); cards.add(new SetCardInfo("Opt", 60, Rarity.COMMON, mage.cards.o.Opt.class)); + cards.add(new SetCardInfo("Orcish Vandal", 137, Rarity.COMMON, mage.cards.o.OrcishVandal.class)); cards.add(new SetCardInfo("Pardic Wanderer", 226, Rarity.COMMON, mage.cards.p.PardicWanderer.class)); cards.add(new SetCardInfo("Pegasus Courser", 29, Rarity.COMMON, mage.cards.p.PegasusCourser.class)); cards.add(new SetCardInfo("Pierce the Sky", 176, Rarity.COMMON, mage.cards.p.PierceTheSky.class)); @@ -252,9 +258,11 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Tragic Poet", 37, Rarity.COMMON, mage.cards.t.TragicPoet.class)); cards.add(new SetCardInfo("Traxos, Scourge of Kroog", 234, Rarity.RARE, mage.cards.t.TraxosScourgeOfKroog.class)); cards.add(new SetCardInfo("Triumph of Gerrard", 38, Rarity.UNCOMMON, mage.cards.t.TriumphOfGerrard.class)); + cards.add(new SetCardInfo("Two-Headed Giant", 147, Rarity.RARE, mage.cards.t.TwoHeadedGiant.class)); cards.add(new SetCardInfo("Untamed Kavu", 186, Rarity.UNCOMMON, mage.cards.u.UntamedKavu.class)); cards.add(new SetCardInfo("Unwind", 72, Rarity.COMMON, mage.cards.u.Unwind.class)); cards.add(new SetCardInfo("Urza's Ruinous Blast", 39, Rarity.RARE, mage.cards.u.UrzasRuinousBlast.class)); + cards.add(new SetCardInfo("Urza's Tome", 235, Rarity.UNCOMMON, mage.cards.u.UrzasTome.class)); cards.add(new SetCardInfo("Verdant Force", 187, Rarity.RARE, mage.cards.v.VerdantForce.class)); cards.add(new SetCardInfo("Verix Bladewing", 149, Rarity.MYTHIC, mage.cards.v.VerixBladewing.class)); cards.add(new SetCardInfo("Vicious Offering", 110, Rarity.COMMON, mage.cards.v.ViciousOffering.class)); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java index c139dae7fd1..700b59deb68 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java @@ -101,11 +101,11 @@ public class GideonTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gideon, Champion of Justice"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Until end of turn"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Until end of turn"); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Put a loyalty counter on", playerB); - activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Until end of turn"); + activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Until end of turn"); setStopAt(5, PhaseStep.BEGIN_COMBAT); execute(); @@ -146,7 +146,7 @@ public class GideonTest extends CardTestPlayerBase { attack(2, playerB, "Silvercoat Lion"); attack(2, playerB, "Pillarfield Ox"); - activateAbility(4, PhaseStep.PRECOMBAT_MAIN, playerB, "+0: Until "); + activateAbility(4, PhaseStep.PRECOMBAT_MAIN, playerB, "0: Until "); activateAbility(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {2}", "Gideon, Battle-Forged"); attack(4, playerB, "Gideon, Battle-Forged"); // 7 damage diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java index f5606cc2ed5..1324fb02c7f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java @@ -58,7 +58,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Gideon, Ally of Zendikar", 1); // put 2/2 knight ally token on battlefield - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Create a"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Create a"); // next, activate Gideon to make him a 5/5 human soldier ally creature activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until end of turn"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/ChandraPyromasterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/ChandraPyromasterTest.java index ee9f0bf6bbc..ad7ed8d9ca8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/ChandraPyromasterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/ChandraPyromasterTest.java @@ -3,7 +3,6 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ - package org.mage.test.cards.single; import mage.constants.PhaseStep; @@ -15,30 +14,29 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ChandraPyromasterTest extends CardTestPlayerBase { @Test public void testAbility2CastCardFromExile() { addCard(Zone.BATTLEFIELD, playerA, "Chandra, Pyromaster"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); - + skipInitShuffling(); addCard(Zone.LIBRARY, playerA, "Mizzium Mortars"); - + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Exile the top card of your library. You may play it this turn."); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Exile the top card of your library. You may play it this turn."); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mizzium Mortars", "Silvercoat Lion"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerA, 20); assertLife(playerB, 20); - + assertPermanentCount(playerA, "Chandra, Pyromaster", 1); assertGraveyardCount(playerA, "Mizzium Mortars", 1); - + assertPermanentCount(playerB, "Silvercoat Lion", 0); assertGraveyardCount(playerB, "Silvercoat Lion", 1); @@ -54,7 +52,7 @@ public class ChandraPyromasterTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Exile the top card of your library. You may play it this turn."); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Exile the top card of your library. You may play it this turn."); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -66,29 +64,29 @@ public class ChandraPyromasterTest extends CardTestPlayerBase { assertExileCount(playerA, "Ancestral Vision", 1); } - + @Test public void testAbility2CastCardFromExileWithOverlaod() { - + addCard(Zone.BATTLEFIELD, playerA, "Chandra, Pyromaster"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); - + skipInitShuffling(); addCard(Zone.LIBRARY, playerA, "Mizzium Mortars"); - + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); - - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Exile the top card of your library. You may play it this turn."); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Exile the top card of your library. You may play it this turn."); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mizzium Mortars with overload"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerA, 20); assertLife(playerB, 20); - + assertPermanentCount(playerA, "Chandra, Pyromaster", 1); assertGraveyardCount(playerA, "Mizzium Mortars", 1); - + assertPermanentCount(playerB, "Silvercoat Lion", 0); assertGraveyardCount(playerB, "Silvercoat Lion", 2); diff --git a/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java b/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java index 81ccc47d8f1..993aa0959da 100644 --- a/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java +++ b/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java @@ -121,7 +121,7 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter private AlternativeCost2 convertToAlternativeCost(Cost cost) { //return cost != null ? new AlternativeCost2Impl(null, cost.getText(), cost) : null; - return cost != null ? new AlternativeCost2Impl(null, "", cost) : null; + return cost != null ? new AlternativeCost2Impl(null, "", "", cost) : null; } @Override diff --git a/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java b/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java index 24a40a8f3be..20b7f4d2124 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java @@ -47,7 +47,7 @@ public class PayLoyaltyCost extends CostImpl { public PayLoyaltyCost(int amount) { this.amount = amount; this.text = Integer.toString(amount); - if (amount >= 0) { + if (amount > 0) { this.text = '+' + this.text; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java index b26560d8f25..ee844548314 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java @@ -26,7 +26,7 @@ public class ChooseBasicLandTypeEffect extends OneShotEffect { public ChooseBasicLandTypeEffect(Outcome outcome) { super(outcome); - this.staticText = "Choose a basic land type"; + this.staticText = "choose a basic land type"; } public ChooseBasicLandTypeEffect(final ChooseBasicLandTypeEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/RevealCardsFromLibraryUntilEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RevealCardsFromLibraryUntilEffect.java index 9b53e3227ec..50d924df59e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/RevealCardsFromLibraryUntilEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/RevealCardsFromLibraryUntilEffect.java @@ -158,7 +158,7 @@ public class RevealCardsFromLibraryUntilEffect extends OneShotEffect { if (anyOrder) { sb.append("any"); } else { - sb.append("random"); + sb.append("a random"); } sb.append(" order."); diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java index 5c891be7dfd..92d50216493 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java @@ -182,7 +182,7 @@ public class SacrificeOpponentsUnlessPayEffect extends OneShotEffect{ private void setText() { StringBuilder sb = new StringBuilder(); - sb.append("Each opponent sacrifices "); + sb.append("each opponent sacrifices "); if (amount.toString().equals("X")) { sb.append(amount.toString()); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSuperTypeAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSuperTypeAttachedEffect.java new file mode 100644 index 00000000000..05498643efd --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardSuperTypeAttachedEffect.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common.continuous; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author nantuko + */ +public class AddCardSuperTypeAttachedEffect extends ContinuousEffectImpl { + + private final SuperType addedSuperType; + private final AttachmentType attachmentType; + + public AddCardSuperTypeAttachedEffect(SuperType addedSuperType, Duration duration, AttachmentType attachmentType) { + super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + this.addedSuperType = addedSuperType; + this.attachmentType = attachmentType; + setText(); + } + + public AddCardSuperTypeAttachedEffect(final AddCardSuperTypeAttachedEffect effect) { + super(effect); + this.addedSuperType = effect.addedSuperType; + this.attachmentType = effect.attachmentType; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent target = game.getPermanent(equipment.getAttachedTo()); + if (target != null && !target.getSuperType().contains(addedSuperType)) { + target.addSuperType(addedSuperType); + } + } + return true; + } + + @Override + public AddCardSuperTypeAttachedEffect copy() { + return new AddCardSuperTypeAttachedEffect(this); + } + + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append(attachmentType.verb()); + sb.append(" permanent is ").append(addedSuperType.toString()); //TODO add attacked card type detection + staticText = sb.toString(); + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java index e16c81de1f1..caac0da6e08 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java @@ -58,11 +58,11 @@ public class BoostAllEffect extends ContinuousEffectImpl { } public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("All creatures"), false); + this(power, toughness, duration, new FilterCreaturePermanent("all creatures"), false); } public BoostAllEffect(int power, int toughness, Duration duration, boolean excludeSource) { - this(power, toughness, duration, new FilterCreaturePermanent("All creatures"), excludeSource); + this(power, toughness, duration, new FilterCreaturePermanent("all creatures"), excludeSource); } public BoostAllEffect(int power, int toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) { diff --git a/Mage/src/main/java/mage/abilities/keyword/MenaceAbility.java b/Mage/src/main/java/mage/abilities/keyword/MenaceAbility.java index 4359a51a2a4..711b7b8d2a4 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MenaceAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MenaceAbility.java @@ -39,7 +39,7 @@ public class MenaceAbility extends StaticAbility { // Menace may not be a Single @Override public String getRule() { - String res = "Menace"; + String res = "menace"; if (this.showAbilityHint) { res += " (This creature can't be blocked except by two or more creatures.)"; } diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 7f2ae4f357b..c72ddb6fadb 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -1077,7 +1077,7 @@ public abstract class GameImpl implements Game, Serializable { // 20180408 - 901.5 if (gameOptions.planeChase) { Plane plane = Plane.getRandomPlane(); - plane.setControllerId(getActivePlayerId()); + plane.setControllerId(startingPlayerId); addPlane(plane, null, getActivePlayerId()); state.setPlaneChase(this, gameOptions.planeChase); } diff --git a/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java b/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java index 31e6718c840..63b68946924 100644 --- a/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/AcademyAtTolariaWestPlane.java @@ -33,17 +33,23 @@ import mage.abilities.Ability; import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.HellbentCondition; +import mage.abilities.condition.Condition; import mage.abilities.condition.common.MainPhaseStackEmptyCondition; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.RollPlanarDieEffect; import mage.abilities.effects.common.discard.DiscardHandControllerEffect; +import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; +import mage.game.Game; import mage.game.command.Plane; +import mage.players.Player; import mage.target.Target; +import mage.util.CardUtil; import mage.watchers.common.PlanarRollWatcher; /** @@ -57,7 +63,7 @@ public class AcademyAtTolariaWestPlane extends Plane { this.setExpansionSetCodeForImage("PCA"); // At the beginning of your end step, if you have 0 cards in hand, draw seven cards - Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.COMMAND, new DrawCardSourceControllerEffect(7), TargetController.ANY, HellbentCondition.instance, false); + Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.COMMAND, new DrawCardsActivePlayerEffect(7), TargetController.ANY, HellbentAPCondition.instance, false); this.getAbilities().add(ability); // Active player can roll the planar die: Whenever you roll {CHAOS}, discard your hand @@ -77,3 +83,66 @@ public class AcademyAtTolariaWestPlane extends Plane { this.getAbilities().add(new SimpleStaticAbility(Zone.ALL, new PlanarDieRollCostIncreasingEffect(chaosAbility.getOriginalId()))); } } + +class DrawCardsActivePlayerEffect extends OneShotEffect { + + protected DynamicValue amount; + + public DrawCardsActivePlayerEffect(int amount) { + this(new StaticValue(amount)); + } + + public DrawCardsActivePlayerEffect(DynamicValue amount) { + super(Outcome.DrawCard); + this.amount = amount.copy(); + setText(); + } + + public DrawCardsActivePlayerEffect(final DrawCardsActivePlayerEffect effect) { + super(effect); + this.amount = effect.amount.copy(); + } + + @Override + public DrawCardsActivePlayerEffect copy() { + return new DrawCardsActivePlayerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if (game.getState().getCurrentPlane() != null) { + if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - Academy at Tolaria West")) { + return false; + } + } + + Player player = game.getPlayer(game.getActivePlayerId()); + if (player != null) { + player.drawCards(amount.calculate(game, source, this), game); + return true; + } + return false; + } + + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("draw ").append(CardUtil.numberToText(amount.toString())).append(" cards"); + staticText = sb.toString(); + } + +} + +enum HellbentAPCondition implements Condition { + + instance; + + @Override + public boolean apply(Game game, Ability source) { + return game.getPlayer(game.getActivePlayerId()).getHand().isEmpty(); + } + + @Override + public String toString() { + return "if you have no cards in hand"; + } +} diff --git a/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java b/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java index 54653f8bf96..56cf30cd309 100644 --- a/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java @@ -29,15 +29,17 @@ package mage.game.command.planes; import java.util.ArrayList; import java.util.List; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MainPhaseStackEmptyCondition; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RollPlanarDieEffect; +import mage.abilities.effects.common.SkipUntapStepEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.constants.Duration; @@ -120,11 +122,19 @@ class EdgeOfMalacolEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { // Prevent untap event of creatures of target player if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getState().getCurrentPlane() != null) { + if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - Edge of Malacol")) { + return false; + } + } Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && filter.match(permanent, game)) { + if (permanent != null && filter.match(permanent, game) && permanent.getControllerId() == game.getActivePlayerId()) { + UUID oldController = source.getControllerId(); + source.setControllerId(game.getActivePlayerId()); Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)); effect.setTargetPointer(new FixedTarget(permanent, game)); effect.apply(game, source); + source.setControllerId(oldController); return true; } } diff --git a/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java b/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java index e3206a4be94..0b3b3ca70f6 100644 --- a/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/HedronFieldsOfAgadeemPlane.java @@ -117,6 +117,11 @@ class HedronFieldsOfAgadeemRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { + if (game.getState().getCurrentPlane() != null) { + if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - Hedron Fields of Agadeem")) { + return false; + } + } return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); } } diff --git a/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java b/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java index f599e400778..f952056ac72 100644 --- a/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/TheEonFogPlane.java @@ -34,14 +34,18 @@ import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MainPhaseStackEmptyCondition; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RollPlanarDieEffect; -import mage.abilities.effects.common.SkipUntapStepEffect; import mage.abilities.effects.common.UntapAllControllerEffect; +import mage.constants.Duration; +import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; import mage.game.command.Plane; +import mage.game.events.GameEvent; import mage.target.Target; import mage.watchers.common.PlanarRollWatcher; @@ -56,7 +60,7 @@ public class TheEonFogPlane extends Plane { this.setExpansionSetCodeForImage("PCA"); // All players miss their untap step - Ability ability = new SimpleStaticAbility(Zone.COMMAND, new SkipUntapStepEffect()); + Ability ability = new SimpleStaticAbility(Zone.COMMAND, new TheEonFogSkipUntapStepEffect(Duration.Custom, true)); this.getAbilities().add(ability); // Active player can roll the planar die: Whenever you roll {CHAOS}, untap all permanents you control @@ -76,3 +80,40 @@ public class TheEonFogPlane extends Plane { this.getAbilities().add(new SimpleStaticAbility(Zone.ALL, new PlanarDieRollCostIncreasingEffect(chaosAbility.getOriginalId()))); } } + +class TheEonFogSkipUntapStepEffect extends ContinuousRuleModifyingEffectImpl { + + boolean allPlayers = false; + + public TheEonFogSkipUntapStepEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral, false, false); + this.allPlayers = false; + staticText = "Players skip their untap steps"; + } + + public TheEonFogSkipUntapStepEffect(Duration d, boolean allPlayers) { + super(d, Outcome.Neutral, false, false); + this.allPlayers = allPlayers; + staticText = "Players skip their untap steps"; + } + + public TheEonFogSkipUntapStepEffect(final TheEonFogSkipUntapStepEffect effect) { + super(effect); + this.allPlayers = effect.allPlayers; + } + + @Override + public TheEonFogSkipUntapStepEffect copy() { + return new TheEonFogSkipUntapStepEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getState().getCurrentPlane() != null) { + if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - The Eon Fog")) { + return false; + } + } + return event.getType() == GameEvent.EventType.UNTAP_STEP; + } +} diff --git a/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java b/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java index 9f3ba9642ad..d15724ba1b7 100644 --- a/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/UndercityReachesPlane.java @@ -29,14 +29,16 @@ package mage.game.command.planes; import java.util.ArrayList; import java.util.List; +import static jdk.nashorn.internal.objects.NativeRegExp.source; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MainPhaseStackEmptyCondition; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.RollPlanarDieEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect.HandSizeModification; @@ -53,6 +55,7 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.Target; +import mage.target.targetpointer.FixedTarget; import mage.watchers.common.PlanarRollWatcher; /** @@ -96,7 +99,7 @@ public class UndercityReachesPlane extends Plane { class UndercityReachesTriggeredAbility extends TriggeredAbilityImpl { public UndercityReachesTriggeredAbility() { - super(Zone.COMMAND, new DrawCardSourceControllerEffect(1), true); + super(Zone.COMMAND, null, true); } public UndercityReachesTriggeredAbility(final UndercityReachesTriggeredAbility ability) { @@ -118,6 +121,9 @@ class UndercityReachesTriggeredAbility extends TriggeredAbilityImpl { if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null) { + Effect effect = new DrawCardTargetEffect(new StaticValue(1), false, true); + effect.setTargetPointer(new FixedTarget(creature.getControllerId())); + effect.apply(game, null); return true; } } diff --git a/Mage/src/main/java/mage/game/permanent/token/WaspToken.java b/Mage/src/main/java/mage/game/permanent/token/WaspToken.java index c53e361553b..0f1b1abda55 100644 --- a/Mage/src/main/java/mage/game/permanent/token/WaspToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/WaspToken.java @@ -39,7 +39,7 @@ import mage.abilities.keyword.FlyingAbility; public class WaspToken extends TokenImpl { public WaspToken() { - super("Wasp", "1/1 colorless Insect artifact creature token with flying"); + super("Wasp", "1/1 colorless Insect artifact creature token with flying named Wasp"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); this.subtype.add(SubType.INSECT); diff --git a/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java b/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java index b107528f6e6..3e41731f98f 100644 --- a/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java +++ b/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java @@ -50,7 +50,7 @@ public class TargetActivatedAbility extends TargetObject { protected final FilterAbility filter; public TargetActivatedAbility() { - this(new FilterAbility()); + this(new FilterAbility("activated ability")); } public TargetActivatedAbility(FilterAbility filter) {