From e980240553d763af8f3cda4b6252ad01e7accc84 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 3 May 2019 10:18:29 -0500 Subject: [PATCH] - small fixes to some "Curse" cards. --- Mage.Sets/src/mage/cards/c/CurseOfPredation.java | 12 ++---------- Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java | 5 ++--- Mage.Sets/src/mage/cards/c/CurseOfTheCabal.java | 11 ++++++++--- Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java | 10 ++-------- Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java | 12 ++++++++---- Mage.Sets/src/mage/cards/c/CurseOfThirst.java | 12 ++++++------ Mage.Sets/src/mage/cards/c/CurseOfVengeance.java | 7 ++++--- Mage.Sets/src/mage/cards/e/EverythingamajigE.java | 2 +- 8 files changed, 33 insertions(+), 38 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CurseOfPredation.java b/Mage.Sets/src/mage/cards/c/CurseOfPredation.java index a130d37685..7616a3cc56 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfPredation.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfPredation.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -29,10 +28,9 @@ import mage.target.targetpointer.FixedTarget; public final class CurseOfPredation extends CardImpl { public CurseOfPredation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.subtype.add(SubType.AURA, SubType.CURSE); - // Enchant player TargetPlayer auraTarget = new TargetPlayer(); this.getSpellAbility().addTarget(auraTarget); @@ -75,17 +73,11 @@ class CurseOfPredationTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Player defender = game.getPlayer(event.getTargetId()); - if (defender == null) { - Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null) { - defender = game.getPlayer(planeswalker.getControllerId()); - } - } if (defender != null) { Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null && enchantment.isAttachedTo(defender.getId())) { - for (Effect effect: this.getEffects()) { + for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getSourceId())); } return true; diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java b/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java index 18040ebb79..1d12b1daf5 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheBloodyTome.java @@ -1,4 +1,3 @@ - package mage.cards.c; import mage.abilities.Ability; @@ -29,16 +28,16 @@ import java.util.UUID; public final class CurseOfTheBloodyTome extends CardImpl { public CurseOfTheBloodyTome(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); this.subtype.add(SubType.AURA, SubType.CURSE); - // Enchant player TargetPlayer target = new TargetPlayer(); this.getSpellAbility().addTarget(target); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(target.getTargetName()); this.addAbility(ability); + // At the beginning of enchanted player's upkeep, that player puts the top two cards of their library into their graveyard. this.addAbility(new CurseOfTheBloodyTomeAbility()); diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheCabal.java b/Mage.Sets/src/mage/cards/c/CurseOfTheCabal.java index 8e2ab315d4..0c4554afc9 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheCabal.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheCabal.java @@ -1,4 +1,3 @@ - package mage.cards.c; import mage.abilities.Ability; @@ -42,10 +41,13 @@ public final class CurseOfTheCabal extends CardImpl { // Target player sacrifices half the permanents he or she controls, rounded down. this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new CurseOfTheCabalSacrificeEffect()); + // Suspend 2-{2}{B}{B} this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{2}{B}{B}"), this)); + // At the beginning of each player's upkeep, if Curse of the Cabal is suspended, that player may sacrifice a permanent. If he or she does, put two time counters on Curse of the Cabal. this.addAbility(new CurseOfTheCabalInterveningIfTriggeredAbility()); + } public CurseOfTheCabal(final CurseOfTheCabal card) { @@ -84,7 +86,8 @@ class CurseOfTheCabalSacrificeEffect extends OneShotEffect { } Target target = new TargetControlledPermanent(amount, amount, StaticFilters.FILTER_CONTROLLED_PERMANENT, true); if (target.canChoose(targetPlayer.getId(), game)) { - while (!target.isChosen() && target.canChoose(targetPlayer.getId(), game) && targetPlayer.canRespond()) { + while (!target.isChosen() + && target.canChoose(targetPlayer.getId(), game) && targetPlayer.canRespond()) { targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game); } //sacrifice all chosen (non null) permanents @@ -107,7 +110,9 @@ class CurseOfTheCabalInterveningIfTriggeredAbility extends ConditionalIntervenin TargetController.ANY, false, true ), SuspendedCondition.instance, - "At the beginning of each player's upkeep, if {this} is suspended, that player may sacrifice a permanent. If he or she does, put two time counters on {this}." + "At the beginning of each player's upkeep, if {this} is suspended, " + + "that player may sacrifice a permanent. If he or she does, " + + "put two time counters on {this}." ); // controller has to sac a permanent // counters aren't placed diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java b/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java index f240a0e5d6..ee09485bc1 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheForsaken.java @@ -1,4 +1,3 @@ - package mage.cards.c; import mage.abilities.TriggeredAbilityImpl; @@ -29,7 +28,7 @@ import java.util.UUID; public final class CurseOfTheForsaken extends CardImpl { public CurseOfTheForsaken(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.subtype.add(SubType.AURA, SubType.CURSE); // Enchant player @@ -40,6 +39,7 @@ public final class CurseOfTheForsaken extends CardImpl { // Whenever a creature attacks enchanted player, its controller gains 1 life. this.addAbility(new CurseOfTheForsakenTriggeredAbility()); + } public CurseOfTheForsaken(final CurseOfTheForsaken card) { @@ -74,12 +74,6 @@ class CurseOfTheForsakenTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Player defender = game.getPlayer(event.getTargetId()); - if (defender == null) { - Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null) { - defender = game.getPlayer(planeswalker.getControllerId()); - } - } if (defender != null) { Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java index 6332c7987e..ece104889a 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java @@ -1,4 +1,3 @@ - package mage.cards.c; import mage.abilities.Ability; @@ -29,8 +28,10 @@ public final class CurseOfTheSwine extends CardImpl { // Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token. this.getSpellAbility().addEffect(new CurseOfTheSwineEffect()); + // Correct number of targets will be set in adjustTargets this.getSpellAbility().setTargetAdjuster(CurseOfTheSwineAdjuster.instance); + } public CurseOfTheSwine(final CurseOfTheSwine card) { @@ -57,7 +58,8 @@ class CurseOfTheSwineEffect extends OneShotEffect { public CurseOfTheSwineEffect() { super(Outcome.Exile); - this.staticText = "Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token"; + this.staticText = "Exile X target creatures. For each creature exiled this way, " + + "its controller creates a 2/2 green Boar creature token"; } public CurseOfTheSwineEffect(final CurseOfTheSwineEffect effect) { @@ -78,13 +80,15 @@ class CurseOfTheSwineEffect extends OneShotEffect { Permanent creature = game.getPermanent(targetId); if (creature != null) { if (controller.moveCards(creature, Zone.EXILED, source, game)) { - playersWithTargets.put(creature.getControllerId(), playersWithTargets.getOrDefault(creature.getControllerId(), 0) + 1); + playersWithTargets.put(creature.getControllerId(), + playersWithTargets.getOrDefault(creature.getControllerId(), 0) + 1); } } } CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken(); for (Map.Entry exiledByController : playersWithTargets.entrySet()) { - swineToken.putOntoBattlefield(exiledByController.getValue(), game, source.getSourceId(), exiledByController.getKey()); + swineToken.putOntoBattlefield(exiledByController.getValue(), + game, source.getSourceId(), exiledByController.getKey()); } return true; } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfThirst.java b/Mage.Sets/src/mage/cards/c/CurseOfThirst.java index 97c1c9c1ea..05e564079e 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfThirst.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfThirst.java @@ -1,4 +1,3 @@ - package mage.cards.c; import mage.abilities.Ability; @@ -31,10 +30,9 @@ import java.util.UUID; public final class CurseOfThirst extends CardImpl { public CurseOfThirst(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}"); this.subtype.add(SubType.AURA, SubType.CURSE); - // Enchant player TargetPlayer auraTarget = new TargetPlayer(); this.getSpellAbility().addTarget(auraTarget); @@ -91,7 +89,8 @@ class CurseOfThirstAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her."; + return "At the beginning of enchanted player's upkeep, Curse of Thirst " + + "deals damage to that player equal to the number of Curses attached to him or her."; } } @@ -108,10 +107,11 @@ class CursesAttachedCount implements DynamicValue { if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null) { - for (UUID attachmentId: player.getAttachments()) { + for (UUID attachmentId : player.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) + if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) { count++; + } } } } diff --git a/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java b/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java index 318a99d37e..e12fb3e6da 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfVengeance.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -130,7 +129,8 @@ class CurseOfVengeancePlayerLosesTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When enchanted player loses the game, you gain X life and draw X cards, where X is the number of spite counters on {this}"; + return "When enchanted player loses the game, you gain X life and " + + "draw X cards, where X is the number of spite counters on {this}"; } } @@ -138,7 +138,8 @@ class CurseOfVengeanceDrawLifeEffect extends OneShotEffect { public CurseOfVengeanceDrawLifeEffect() { super(Outcome.Benefit); - staticText = "you gain X life and draw X cards, where X is the number of spite counters on {this}"; + staticText = "you gain X life and draw X cards, where X is the " + + "number of spite counters on {this}"; } public CurseOfVengeanceDrawLifeEffect(final CurseOfVengeanceDrawLifeEffect effect) { diff --git a/Mage.Sets/src/mage/cards/e/EverythingamajigE.java b/Mage.Sets/src/mage/cards/e/EverythingamajigE.java index 439a921abd..bad33f9ba5 100644 --- a/Mage.Sets/src/mage/cards/e/EverythingamajigE.java +++ b/Mage.Sets/src/mage/cards/e/EverythingamajigE.java @@ -129,7 +129,7 @@ class UrzasHotTubPredicate implements Predicate { } private boolean sharesWordWithName(String str) { - if (referenceName == null || referenceName == "") { + if (referenceName == null || referenceName.equals("")) { return false; } String[] arr = referenceName.split("\\s+");