Fix a bug with Animar's cost reduction effect.

This commit is contained in:
dilnu 2018-07-29 11:19:51 -04:00
parent 339779c8bd
commit 988b64866c
2 changed files with 32 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -85,7 +86,7 @@ class AnimarCostReductionEffect extends CostModificationEffectImpl {
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility) {
if (abilityToModify.isControlledBy(source.getControllerId())) {
Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId());
Card spell = ((SpellAbility) abilityToModify).getCharachteristics(game);
if (spell != null) {
return spell.isCreature();
}