From e941ce108b42f14c52e4d980b24bfbe8aaf062c3 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 2 Feb 2021 01:40:12 +0400 Subject: [PATCH] [KHM] fixed Old-Growth Troll - correct addAbility usage for permanents; --- Mage.Sets/src/mage/cards/o/OldGrowthTroll.java | 2 +- .../main/java/mage/abilities/effects/AsThoughEffectImpl.java | 2 +- .../src/main/java/mage/abilities/effects/ContinuousEffects.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java b/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java index 9fa01a737d..c8c8781542 100644 --- a/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java +++ b/Mage.Sets/src/mage/cards/o/OldGrowthTroll.java @@ -174,7 +174,7 @@ class OldGrowthTrollContinuousEffect extends ContinuousEffectImpl { TargetPermanent auraTarget = new TargetPermanent(filter); troll.getSpellAbility().addTarget(auraTarget); troll.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - troll.addAbility(new EnchantAbility(auraTarget.getTargetName())); + troll.addAbility(new EnchantAbility(auraTarget.getTargetName()), source.getSourceId(), game); // add the activated ability troll.addAbility(makeAbility(), source.getSourceId(), game); diff --git a/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java b/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java index 8f98c2c879..38db6d30f3 100644 --- a/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java +++ b/Mage/src/main/java/mage/abilities/effects/AsThoughEffectImpl.java @@ -40,7 +40,7 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) { // affectedControllerId = player to check (example: you can activate ability from opponent's card) // by default it applies to full object - // if you AsThough effect type needs affected ability then override that method + // if your AsThough effect type needs affected ability then override that method return applies(objectId, source, playerId, game); } diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java index 7b09409d48..2e4c8d115e 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java @@ -519,7 +519,7 @@ public class ContinuousEffects implements Serializable { // P.S. In theory a same AsThough effect can be applied to object or to ability, so if you really, really // need it then disable that check or add extra param to AsThoughEffectType like needAffectedAbilityOrFullObject if (!type.needAffectedAbility() && affectedAbility != null) { - throw new IllegalArgumentException("ERROR, you can't call AsThough check to affected ability, call it empty affected ability instead: " + type); + throw new IllegalArgumentException("ERROR, you can't call AsThough check to affected ability, call it with empty affected ability instead: " + type); } List asThoughEffectsList = getApplicableAsThoughEffects(type, game);