From e1292a0ea3291e1fd4044bda0ee19dd3a6a0ee33 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 24 Jan 2019 11:58:13 -0600 Subject: [PATCH] - Fixed #5547 #5546 --- .../main/java/mage/players/PlayerImpl.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index f74b6617175..a930e83d58b 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -1404,19 +1404,34 @@ public abstract class PlayerImpl implements Player, Serializable { if (zone != Zone.HAND) { if (Zone.GRAVEYARD == zone && canPlayCardsFromGraveyard()) { for (ActivatedAbility ability : candidateAbilites.getPlayableAbilities(Zone.HAND)) { - if (canUse || ability.getAbilityType() == AbilityType.SPECIAL_ACTION) { + if (canUse + || ability.getAbilityType() == AbilityType.SPECIAL_ACTION) { if (ability.canActivate(playerId, game).canActivate()) { output.put(ability.getId(), ability); } } } } - if (zone != Zone.BATTLEFIELD /*&& null != game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, null, this.getId(), game)*/) { + if (zone != Zone.BATTLEFIELD) { for (Ability ability : candidateAbilites) { - if (null != game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, ability, this.getId(), game)) { - if (canUse || ability.getAbilityType() == AbilityType.SPECIAL_ACTION) { + if (game.getContinuousEffects().asThough(object.getId(), + AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, + null, + this.getId(), + game) + != null + // if anyone sees an issue with this code, please report it. Worked in my testing. + || game.getContinuousEffects().asThough(object.getId(), + AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, + ability, + this.getId(), + game) + != null) { + if (canUse + || ability.getAbilityType() == AbilityType.SPECIAL_ACTION) { ability.setControllerId(this.getId()); - if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND) + if (ability instanceof ActivatedAbility + && ability.getZone().match(Zone.HAND) && ((ActivatedAbility) ability).canActivate(playerId, game).canActivate()) { output.put(ability.getId(), (ActivatedAbility) ability); }