diff --git a/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java b/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java index 8213fca6641..351e2867fcd 100644 --- a/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java +++ b/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java @@ -49,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent; /** * - * @author anonymous + * @author Loki */ public class SkeletalVampire extends CardImpl { @@ -87,7 +87,7 @@ public class SkeletalVampire extends CardImpl { class BatToken extends Token { BatToken() { - super("Bat", "1/1 black Bat creature tokens with flying"); + super("Bat", "1/1 black Bat creature token with flying"); cardType.add(CardType.CREATURE); color = ObjectColor.BLACK; subtype.add("Bat"); diff --git a/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java b/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java index a3bda75a3a3..6a57006575b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java +++ b/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java @@ -112,19 +112,19 @@ class VengefulArchonEffect extends PreventionEffectImpl { if (!game.replaceEvent(preventEvent)) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { + int damage = event.getAmount(); if (event.getAmount() >= this.amount) { - int damage = event.getAmount(); - event.setAmount(event.getAmount() - amount); - player.damage(amount, source.getSourceId(), game, false, true); + event.setAmount(damage - this.amount); + damage = this.amount; this.used = true; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage)); } else { - int damage = event.getAmount(); event.setAmount(0); - amount -= damage; - player.damage(damage, source.getSourceId(), game, false, true); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage)); + this.amount -= damage; } + + player.damage(damage, source.getSourceId(), game, false, true); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, + source.getControllerId(), source.getId(), source.getControllerId(), damage)); } } return false; diff --git a/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java b/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java index 4a676f82d86..8e00449bca9 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java +++ b/Mage.Sets/src/mage/sets/mirrodin/SpikeshotGoblin.java @@ -90,17 +90,23 @@ class SpikeshotGoblinEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - Permanent permanent = game.getPermanent(source.getFirstTarget()); if (sourcePermanent == null) { sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); } - if (sourcePermanent != null && permanent != null) { - permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false); + if (sourcePermanent == null) { + return false; + } + + int damage = sourcePermanent.getPower().getValue(); + + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.damage(damage, sourcePermanent.getId(), game, true, false); return true; } Player player = game.getPlayer(source.getFirstTarget()); - if (sourcePermanent != null && player != null) { - player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true); + if (player != null) { + player.damage(damage, sourcePermanent.getId(), game, false, true); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ReinforcedBulwark.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ReinforcedBulwark.java index 4f3fe73da52..6a1ec091a1b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ReinforcedBulwark.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ReinforcedBulwark.java @@ -101,9 +101,9 @@ class ReinforcedBulwarkEffect extends PreventionEffectImpl 0) { event.setAmount(damage - 1); this.used = true; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, + source.getControllerId(), source.getId(), source.getControllerId(), 1)); } - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, - source.getControllerId(), source.getId(), source.getControllerId(), damage)); } return false; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java index 730c21d4066..a2eb6df95f5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SpikeshotElder.java @@ -87,17 +87,23 @@ class SpikeshotElderEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - Permanent permanent = game.getPermanent(source.getFirstTarget()); if (sourcePermanent == null) { sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD); } - if (sourcePermanent != null && permanent != null) { - permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false); + if (sourcePermanent == null) { + return false; + } + + int damage = sourcePermanent.getPower().getValue(); + + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.damage(damage, sourcePermanent.getId(), game, true, false); return true; } Player player = game.getPlayer(source.getFirstTarget()); - if (sourcePermanent != null && player != null) { - player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true); + if (player != null) { + player.damage(damage, sourcePermanent.getId(), game, false, true); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/WingPuncture.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/WingPuncture.java index 9d980bee827..ddbd51fc7ba 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/WingPuncture.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/WingPuncture.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; @@ -88,11 +89,14 @@ class WingPunctureEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent sourceDamage = (Permanent) game.getPermanent(source.getFirstTarget()); - Permanent target = (Permanent) game.getPermanent(source.getTargets().get(1).getFirstTarget()); + Permanent sourcePermanent = game.getPermanent(source.getFirstTarget()); + if (sourcePermanent == null) { + game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); + } - if (sourceDamage != null && target != null) { - target.damage(sourceDamage.getPower().getValue(), sourceDamage.getId(), game, true, false); + Permanent targetPermanent = (Permanent) game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (sourcePermanent != null && targetPermanent != null) { + targetPermanent.damage(sourcePermanent.getPower().getValue(), sourcePermanent.getId(), game, true, false); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java b/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java index 457d3d9dbb0..d6480be40cb 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java @@ -28,10 +28,9 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -53,18 +52,16 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class AngelsHerald extends CardImpl { - private static final FilterCard filter = new FilterCard("Empyrial Archangel"); - + private static final FilterCard filter = new FilterCard("card named Empyrial Archangel"); private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent("a green creature"); private static final FilterControlledCreaturePermanent filterWhite = new FilterControlledCreaturePermanent("a white creature"); private static final FilterControlledCreaturePermanent filterBlue = new FilterControlledCreaturePermanent("a blue creature"); static { + filter.add(new NamePredicate("Empyrial Archangel")); filterGreen.add(new ColorPredicate(ObjectColor.GREEN)); filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); - - filter.add(new NamePredicate("Empyrial Archangel")); } public AngelsHerald(UUID ownerId) { @@ -77,12 +74,14 @@ public class AngelsHerald extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - // {2}{W}, {tap}, Sacrifice a green creature, a white creature, and a blue creature: Search your library for a card named Empyrial Archangel and put it onto the battlefield. Then shuffle your library. - TargetCardInLibrary target = new TargetCardInLibrary(1, 1, new FilterCard(filter)); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target), new ManaCostsImpl("{2}{W}")); + // {2}{W}, {tap}, Sacrifice a green creature, a white creature, and a blue creature: + // Search your library for a card named Empyrial Archangel and put it onto the battlefield. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, 1, new FilterCard(filter))), + new ManaCostsImpl("{2}{W}")); ability.addCost(new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterWhite, false))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterGreen, false))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterWhite, false))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterBlue, false))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/worldwake/Dispel.java b/Mage.Sets/src/mage/sets/worldwake/Dispel.java index 1f1fad26209..9eedd697c81 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Dispel.java +++ b/Mage.Sets/src/mage/sets/worldwake/Dispel.java @@ -42,7 +42,7 @@ import mage.target.TargetSpell; */ public class Dispel extends CardImpl { - private static FilterSpell filter = new FilterSpell("instant spell"); + private static final FilterSpell filter = new FilterSpell("instant spell"); static { filter.add(new CardTypePredicate(CardType.INSTANT));