From 7a79b57515d8dda33c97a23b09d68c8707cf77ce Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 19 Apr 2018 23:32:04 +0200 Subject: [PATCH] * The Flame of Keld - Fixed game exception during copy. --- .../src/mage/cards/t/TheFlameOfKeld.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java b/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java index 3fb08c92c758..a2b30e363fe2 100644 --- a/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java +++ b/Mage.Sets/src/mage/cards/t/TheFlameOfKeld.java @@ -28,17 +28,15 @@ package mage.cards.t; import java.util.UUID; - import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SagaAbility; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.discard.DiscardHandControllerEffect; -import mage.constants.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -52,7 +50,7 @@ public class TheFlameOfKeld extends CardImpl { public TheFlameOfKeld(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); - + this.subtype.add(SubType.SAGA); // (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.) @@ -99,7 +97,7 @@ public boolean replaceEvent(GameEvent event, Ability source, Game game) { @Override public boolean checksEventType(GameEvent event, Game game) { - switch(event.getType()) { + switch (event.getType()) { case DAMAGE_CREATURE: case DAMAGE_PLANESWALKER: case DAMAGE_PLAYER: @@ -111,13 +109,12 @@ public boolean checksEventType(GameEvent event, Game game) { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if(source.getControllerId().equals(game.getControllerId(event.getSourceId()))) { + if (source.getControllerId().equals(game.getControllerId(event.getSourceId()))) { MageObject sourceObject; Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if(sourcePermanent == null) { + if (sourcePermanent == null) { sourceObject = game.getObject(event.getSourceId()); - } - else { + } else { sourceObject = sourcePermanent; } return sourceObject != null && sourceObject.getColor(game).isRed() && !sourceObject.getId().equals(source.getSourceId()); @@ -126,7 +123,8 @@ public boolean applies(GameEvent event, Ability source, Game game) { } @Override - public ContinuousEffect copy() { - return null; + public TheFlameOfKeldDamageEffect copy() { + return new TheFlameOfKeldDamageEffect(this); } + }