From 84701cfbab5a8cad45c5215f031169db47719708 Mon Sep 17 00:00:00 2001 From: ssouders412 Date: Wed, 13 Nov 2019 02:01:24 -0500 Subject: [PATCH] Fixed K'rrik, Son of Yawgmoth K'rrik's second ability is no longer active after he leaves the battlefield. KNOWN ISSUE: Cards you would not normally be able to play without this ability are still not highlighted as playable. --- Mage.Sets/src/mage/cards/k/KrrikSonOfYawgmoth.java | 9 ++++++--- Mage/src/main/java/mage/players/PlayerImpl.java | 11 +++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/k/KrrikSonOfYawgmoth.java b/Mage.Sets/src/mage/cards/k/KrrikSonOfYawgmoth.java index 60bb6c7ea8..f32e5a1770 100644 --- a/Mage.Sets/src/mage/cards/k/KrrikSonOfYawgmoth.java +++ b/Mage.Sets/src/mage/cards/k/KrrikSonOfYawgmoth.java @@ -24,6 +24,7 @@ import mage.filter.FilterMana; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; /** @@ -73,7 +74,7 @@ class KrrikSonOfYawgmothPhyrexianEffect extends ContinuousEffectImpl { public KrrikSonOfYawgmothPhyrexianEffect() { super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - this.staticText = "For each {B} in a cost, you may pay 2 life rather than pay that mana."; + this.staticText = "for each {B} in a cost, you may pay 2 life rather than pay that mana"; } public KrrikSonOfYawgmothPhyrexianEffect(final KrrikSonOfYawgmothPhyrexianEffect effect) { @@ -87,10 +88,12 @@ class KrrikSonOfYawgmothPhyrexianEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - FilterMana phyrexianBlack = new FilterMana(); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); + FilterMana phyrexianBlack = new FilterMana(); + phyrexianBlack.setBlack(true); - if (controller != null) { + if (controller != null && sourcePermanent != null) { for (UUID playerId: game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 0f50f83d60..a2db9a61dd 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -175,7 +175,7 @@ public abstract class PlayerImpl implements Player, Serializable { protected List designations = new ArrayList<>(); - protected FilterMana phyrexianColors = new FilterMana(); + protected FilterMana phyrexianColors; /** * During some steps we can't play anything @@ -194,6 +194,7 @@ public abstract class PlayerImpl implements Player, Serializable { manaPool = new ManaPool(playerId); library = new Library(playerId); sideboard = new CardsImpl(); + phyrexianColors = new FilterMana(); } protected PlayerImpl(UUID id) { @@ -277,10 +278,9 @@ public abstract class PlayerImpl implements Player, Serializable { this.castSourceIdManaCosts = player.castSourceIdManaCosts; this.castSourceIdCosts = player.castSourceIdCosts; this.payManaMode = player.payManaMode; + this.phyrexianColors = player.phyrexianColors.copy(); this.designations.addAll(player.designations); - - this.phyrexianColors = player.phyrexianColors; } @Override @@ -345,6 +345,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.castSourceIdWithAlternateMana = player.getCastSourceIdWithAlternateMana(); this.castSourceIdManaCosts = player.getCastSourceIdManaCosts(); this.castSourceIdCosts = player.getCastSourceIdCosts(); + this.phyrexianColors = player.getPhyrexianColors().copy(); this.designations.clear(); this.designations.addAll(player.getDesignations()); @@ -422,6 +423,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.castSourceIdManaCosts = null; this.castSourceIdCosts = null; this.getManaPool().init(); // needed to remove mana that not empties on step change from previous game if left + this.phyrexianColors = new FilterMana(); this.designations.clear(); } @@ -448,6 +450,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.castSourceIdManaCosts = null; this.castSourceIdCosts = null; this.getManaPool().clearEmptyManaPoolRules(); + this.phyrexianColors = new FilterMana(); } @Override @@ -4207,6 +4210,6 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public FilterMana getPhyrexianColors() { - return this.phyrexianColors.copy(); + return this.phyrexianColors; } }