Fixed clones not triggering death ability of Old-Growth Troll (fixes #7601)

This commit is contained in:
Daniel Bomar 2021-02-19 15:49:25 -06:00
parent a8bda04daf
commit 238ab4fcc8
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 8 additions and 0 deletions

View file

@ -3,6 +3,7 @@ package mage.cards.o;
import mage.MageInt; import mage.MageInt;
import mage.Mana; import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.DiesSourceTriggeredAbility; import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -169,6 +170,10 @@ class OldGrowthTrollContinuousEffect extends ContinuousEffectImpl {
troll.addSubType(game, SubType.AURA); troll.addSubType(game, SubType.AURA);
break; break;
case AbilityAddingRemovingEffects_6: case AbilityAddingRemovingEffects_6:
// Spell Ability can be null with clone effects (ex. Moritte)
if (troll.getSpellAbility() == null) {
troll.addAbility(new SpellAbility(null, null), source.getSourceId(), game);
}
troll.getSpellAbility().getTargets().clear(); troll.getSpellAbility().getTargets().clear();
troll.getSpellAbility().getEffects().clear(); troll.getSpellAbility().getEffects().clear();
TargetPermanent auraTarget = new TargetPermanent(filter); TargetPermanent auraTarget = new TargetPermanent(filter);

View file

@ -36,6 +36,9 @@ public class ConditionalInterveningIfTriggeredAbility extends TriggeredAbilityIm
*/ */
public ConditionalInterveningIfTriggeredAbility(TriggeredAbility ability, Condition condition, String text) { public ConditionalInterveningIfTriggeredAbility(TriggeredAbility ability, Condition condition, String text) {
super(ability.getZone(), null); super(ability.getZone(), null);
if (ability.isLeavesTheBattlefieldTrigger()) {
this.setLeavesTheBattlefieldTrigger(true);
}
this.ability = ability; this.ability = ability;
this.condition = condition; this.condition = condition;
this.abilityText = text; this.abilityText = text;