* The Flame of Keld - Fixed game exception during copy.

This commit is contained in:
LevelX2 2018-04-19 23:32:04 +02:00
parent 160cd06743
commit 7a79b57515

View file

@ -28,17 +28,15 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID; import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SagaAbility; import mage.abilities.common.SagaAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.discard.DiscardHandControllerEffect; import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
import mage.constants.*;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -99,7 +97,7 @@ class TheFlameOfKeldDamageEffect extends ReplacementEffectImpl {
@Override @Override
public boolean checksEventType(GameEvent event, Game game) { public boolean checksEventType(GameEvent event, Game game) {
switch(event.getType()) { switch (event.getType()) {
case DAMAGE_CREATURE: case DAMAGE_CREATURE:
case DAMAGE_PLANESWALKER: case DAMAGE_PLANESWALKER:
case DAMAGE_PLAYER: case DAMAGE_PLAYER:
@ -111,13 +109,12 @@ class TheFlameOfKeldDamageEffect extends ReplacementEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { 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; MageObject sourceObject;
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
if(sourcePermanent == null) { if (sourcePermanent == null) {
sourceObject = game.getObject(event.getSourceId()); sourceObject = game.getObject(event.getSourceId());
} } else {
else {
sourceObject = sourcePermanent; sourceObject = sourcePermanent;
} }
return sourceObject != null && sourceObject.getColor(game).isRed() && !sourceObject.getId().equals(source.getSourceId()); return sourceObject != null && sourceObject.getColor(game).isRed() && !sourceObject.getId().equals(source.getSourceId());
@ -126,7 +123,8 @@ class TheFlameOfKeldDamageEffect extends ReplacementEffectImpl {
} }
@Override @Override
public ContinuousEffect copy() { public TheFlameOfKeldDamageEffect copy() {
return null; return new TheFlameOfKeldDamageEffect(this);
} }
} }