From 687d3bdc979bde2e80a4d94c5ff5932d98d9a0ac Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 19 Apr 2018 22:55:26 -0400 Subject: [PATCH] more fixes --- .../src/mage/cards/a/AxelrodGunnarson.java | 4 +-- Mage.Sets/src/mage/cards/b/BrionStoutarm.java | 15 +++++------ .../src/mage/cards/c/CragganwickCremator.java | 11 +++----- .../src/mage/cards/d/DeathforgeShaman.java | 18 +++++-------- Mage.Sets/src/mage/cards/e/EternalFlame.java | 6 ++--- .../src/mage/cards/e/ExplodingBorders.java | 7 +++-- .../src/mage/cards/g/GoblinRazerunners.java | 11 ++++---- .../src/mage/cards/h/HellholeFlailer.java | 26 +++++++++---------- Mage.Sets/src/mage/cards/n/NobleVestige.java | 6 ++--- .../src/mage/cards/s/SorinsVengeance.java | 11 ++++---- .../src/mage/cards/s/SurestrikeTrident.java | 8 +++--- Mage.Sets/src/mage/cards/t/TasteOfBlood.java | 11 ++++---- 12 files changed, 58 insertions(+), 76 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AxelrodGunnarson.java b/Mage.Sets/src/mage/cards/a/AxelrodGunnarson.java index c36cb3c830..c389674311 100644 --- a/Mage.Sets/src/mage/cards/a/AxelrodGunnarson.java +++ b/Mage.Sets/src/mage/cards/a/AxelrodGunnarson.java @@ -42,7 +42,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.filter.StaticFilters; -import mage.target.TargetPlayer; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -66,7 +66,7 @@ public class AxelrodGunnarson extends CardImpl { Effect effect = new DamageTargetEffect(1); effect.setText("and {this} deals 1 damage to target player"); ability.addEffect(effect); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BrionStoutarm.java b/Mage.Sets/src/mage/cards/b/BrionStoutarm.java index 94273699ee..2beaac8387 100644 --- a/Mage.Sets/src/mage/cards/b/BrionStoutarm.java +++ b/Mage.Sets/src/mage/cards/b/BrionStoutarm.java @@ -36,6 +36,7 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -43,9 +44,8 @@ import mage.constants.*; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; -import mage.players.Player; -import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -60,7 +60,7 @@ public class BrionStoutarm extends CardImpl { } public BrionStoutarm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.GIANT, SubType.WARRIOR); @@ -73,7 +73,7 @@ public class BrionStoutarm extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BrionStoutarmEffect(), new ManaCostsImpl("{R}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); } @@ -91,7 +91,7 @@ class BrionStoutarmEffect extends OneShotEffect { public BrionStoutarmEffect() { super(Outcome.Benefit); - this.staticText = "{this} deals damage equal to the sacrificed creature's power to target player"; + this.staticText = "{this} deals damage equal to the sacrificed creature's power to target player or planeswalker"; } public BrionStoutarmEffect(final BrionStoutarmEffect effect) { @@ -113,10 +113,7 @@ class BrionStoutarmEffect extends OneShotEffect { } } if (amount > 0) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - } + return new DamageTargetEffect(amount).apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/cards/c/CragganwickCremator.java b/Mage.Sets/src/mage/cards/c/CragganwickCremator.java index 4fdbf66f84..08de7ad100 100644 --- a/Mage.Sets/src/mage/cards/c/CragganwickCremator.java +++ b/Mage.Sets/src/mage/cards/c/CragganwickCremator.java @@ -32,6 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -49,7 +50,7 @@ import mage.target.TargetPlayer; public class CragganwickCremator extends CardImpl { public CragganwickCremator(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.subtype.add(SubType.GIANT); this.subtype.add(SubType.SHAMAN); @@ -92,16 +93,12 @@ class CragganwickCrematorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { Card discardedCard = controller.discardOne(true, source, game); if (discardedCard != null && discardedCard.isCreature()) { - Player targetedPlayer = game.getPlayer(source.getFirstTarget()); - if (targetedPlayer != null) { - int damage = discardedCard.getPower().getValue(); - targetedPlayer.damage(damage, source.getSourceId(), game, false, true); - } + int damage = discardedCard.getPower().getValue(); + return new DamageTargetEffect(damage).apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java b/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java index f389704351..3247ce5a22 100644 --- a/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java +++ b/Mage.Sets/src/mage/cards/d/DeathforgeShaman.java @@ -34,6 +34,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.MultikickerCount; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.MultikickerAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -41,8 +42,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; import mage.game.Game; -import mage.players.Player; -import mage.target.TargetPlayer; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -51,7 +51,7 @@ import mage.target.TargetPlayer; public class DeathforgeShaman extends CardImpl { public DeathforgeShaman(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); this.subtype.add(SubType.OGRE); this.subtype.add(SubType.SHAMAN); @@ -63,7 +63,7 @@ public class DeathforgeShaman extends CardImpl { // When Deathforge Shaman enters the battlefield, it deals damage to target player equal to twice the number of times it was kicked. Ability ability = new EntersBattlefieldTriggeredAbility(new DeathforgeShamanEffect()); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); } @@ -81,7 +81,7 @@ class DeathforgeShamanEffect extends OneShotEffect { public DeathforgeShamanEffect() { super(Outcome.Damage); - staticText = "it deals damage to target player equal to twice the number of times it was kicked"; + staticText = "it deals damage to target player or planeswalker equal to twice the number of times it was kicked"; } public DeathforgeShamanEffect(final DeathforgeShamanEffect effect) { @@ -97,13 +97,7 @@ class DeathforgeShamanEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { DynamicValue value = new MultikickerCount(); int damage = value.calculate(game, source, this) * 2; - - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(damage, source.getSourceId(), game, false, true); - return true; - } - return false; + return new DamageTargetEffect(damage).apply(game, source); } } diff --git a/Mage.Sets/src/mage/cards/e/EternalFlame.java b/Mage.Sets/src/mage/cards/e/EternalFlame.java index 9c28d75f57..be9df520eb 100644 --- a/Mage.Sets/src/mage/cards/e/EternalFlame.java +++ b/Mage.Sets/src/mage/cards/e/EternalFlame.java @@ -46,14 +46,14 @@ import mage.target.common.TargetOpponent; */ public class EternalFlame extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountains you control"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountains you control"); - static { + static { filter.add(new SubtypePredicate(SubType.MOUNTAIN)); } public EternalFlame(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); // Eternal Flame deals X damage to target opponent, where X is the number of Mountains you control. It deals half X damage, rounded up, to you.); this.getSpellAbility().addEffect(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)).setText("{this} deals X damage to target opponent, where X is the number of Mountains you control")); diff --git a/Mage.Sets/src/mage/cards/e/ExplodingBorders.java b/Mage.Sets/src/mage/cards/e/ExplodingBorders.java index e6bc6cd6d6..4b963ef0dd 100644 --- a/Mage.Sets/src/mage/cards/e/ExplodingBorders.java +++ b/Mage.Sets/src/mage/cards/e/ExplodingBorders.java @@ -34,10 +34,10 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.StaticFilters; -import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; import java.util.UUID; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -46,13 +46,12 @@ import java.util.UUID; public class ExplodingBorders extends CardImpl { public ExplodingBorders(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{G}"); // Domain - Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. Exploding Borders deals X damage to target player, where X is the number of basic land types among lands you control. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true)); this.getSpellAbility().addEffect(new DamageTargetEffect(new DomainValue())); - this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); } public ExplodingBorders(final ExplodingBorders card) { diff --git a/Mage.Sets/src/mage/cards/g/GoblinRazerunners.java b/Mage.Sets/src/mage/cards/g/GoblinRazerunners.java index 9b0398b985..4ef3c4c38a 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinRazerunners.java +++ b/Mage.Sets/src/mage/cards/g/GoblinRazerunners.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.g; import java.util.UUID; @@ -46,8 +45,8 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.target.TargetPlayer; import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -57,8 +56,8 @@ public class GoblinRazerunners extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledLandPermanent("a land"); - public GoblinRazerunners (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); + public GoblinRazerunners(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.WARRIOR); @@ -72,11 +71,11 @@ public class GoblinRazerunners extends CardImpl { // At the beginning of your end step, you may have Goblin Razerunners deal damage equal to the number of +1/+1 counters on it to target player. ability = new BeginningOfYourEndStepTriggeredAbility(new DamageTargetEffect(new CountersSourceCount(CounterType.P1P1)), true); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); } - public GoblinRazerunners (final GoblinRazerunners card) { + public GoblinRazerunners(final GoblinRazerunners card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/h/HellholeFlailer.java b/Mage.Sets/src/mage/cards/h/HellholeFlailer.java index a649adf8c5..a71a10dcfd 100644 --- a/Mage.Sets/src/mage/cards/h/HellholeFlailer.java +++ b/Mage.Sets/src/mage/cards/h/HellholeFlailer.java @@ -26,7 +26,7 @@ * or implied, of BetaSteward_at_googlemail.com. */ package mage.cards.h; - + import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; @@ -41,41 +41,39 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.target.TargetPlayer; - +import mage.target.common.TargetPlayerOrPlaneswalker; + /** * * @author LevelX2 */ public class HellholeFlailer extends CardImpl { - + public HellholeFlailer(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); this.subtype.add(SubType.OGRE); this.subtype.add(SubType.WARRIOR); - - this.power = new MageInt(3); this.toughness = new MageInt(2); - + // Unleash (You may have this creature enter the battlefield with a +1/+1 counter on it. It can't block as long as it has a +1/+1 counter on it.) this.addAbility(new UnleashAbility()); - + // {2}{B}{R}, Sacrifice Hellhole Flailer: Hellhole Flailer deals damage equal to its power to target player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SourcePermanentPowerCount()), new ManaCostsImpl("{2}{B}{R}")); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayerOrPlaneswalker()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); - + } - + public HellholeFlailer(final HellholeFlailer card) { super(card); } - + @Override public HellholeFlailer copy() { return new HellholeFlailer(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/n/NobleVestige.java b/Mage.Sets/src/mage/cards/n/NobleVestige.java index c841127ede..f5b711993b 100644 --- a/Mage.Sets/src/mage/cards/n/NobleVestige.java +++ b/Mage.Sets/src/mage/cards/n/NobleVestige.java @@ -40,7 +40,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Zone; -import mage.target.TargetPlayer; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -49,7 +49,7 @@ import mage.target.TargetPlayer; public class NobleVestige extends CardImpl { public NobleVestige(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); @@ -57,7 +57,7 @@ public class NobleVestige extends CardImpl { this.addAbility(FlyingAbility.getInstance()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SorinsVengeance.java b/Mage.Sets/src/mage/cards/s/SorinsVengeance.java index 75f2ada2d9..3a3e4194d7 100644 --- a/Mage.Sets/src/mage/cards/s/SorinsVengeance.java +++ b/Mage.Sets/src/mage/cards/s/SorinsVengeance.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.s; import java.util.UUID; @@ -34,7 +33,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.target.TargetPlayer; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -42,15 +41,15 @@ import mage.target.TargetPlayer; */ public class SorinsVengeance extends CardImpl { - public SorinsVengeance (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}{B}{B}"); + public SorinsVengeance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{B}{B}"); this.getSpellAbility().addEffect(new DamageTargetEffect(10)); this.getSpellAbility().addEffect(new GainLifeEffect(10)); - this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); } - public SorinsVengeance (final SorinsVengeance card) { + public SorinsVengeance(final SorinsVengeance card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/s/SurestrikeTrident.java b/Mage.Sets/src/mage/cards/s/SurestrikeTrident.java index 1b039ef383..ebf82c74d2 100644 --- a/Mage.Sets/src/mage/cards/s/SurestrikeTrident.java +++ b/Mage.Sets/src/mage/cards/s/SurestrikeTrident.java @@ -48,7 +48,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.target.TargetPlayer; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -57,16 +57,16 @@ import mage.target.TargetPlayer; public class SurestrikeTrident extends CardImpl { public SurestrikeTrident(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); this.subtype.add(SubType.EQUIPMENT); // Equipped creature has first strike and "{T}, Unattach Surestrike Trident: This creature deals damage equal to its power to target player." Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)); DynamicValue xValue = new SourcePermanentPowerCount(); Effect effect = new DamageTargetEffect(xValue); - effect.setText("This creature deals damage equal to its power to target player"); + effect.setText("This creature deals damage equal to its power to target player or planeswalker"); Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); - gainedAbility.addTarget(new TargetPlayer()); + gainedAbility.addTarget(new TargetPlayerOrPlaneswalker()); gainedAbility.addCost(new UnattachCost(this.getName(), this.getId())); effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.EQUIPMENT); effect.setText("and \"{T}, Unattach {this}: This creature deals damage equal to its power to target player.\""); diff --git a/Mage.Sets/src/mage/cards/t/TasteOfBlood.java b/Mage.Sets/src/mage/cards/t/TasteOfBlood.java index dfd3a455f8..9d1f969564 100644 --- a/Mage.Sets/src/mage/cards/t/TasteOfBlood.java +++ b/Mage.Sets/src/mage/cards/t/TasteOfBlood.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.t; import java.util.UUID; @@ -34,7 +33,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.target.TargetPlayer; +import mage.target.common.TargetPlayerOrPlaneswalker; /** * @@ -42,15 +41,15 @@ import mage.target.TargetPlayer; */ public class TasteOfBlood extends CardImpl { - public TasteOfBlood (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); + public TasteOfBlood(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); this.getSpellAbility().addEffect(new DamageTargetEffect(1)); this.getSpellAbility().addEffect(new GainLifeEffect(1)); - this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); } - public TasteOfBlood (final TasteOfBlood card) { + public TasteOfBlood(final TasteOfBlood card) { super(card); }