Fixed NPE errors for some cards (#5471)

This commit is contained in:
Oleg Agafonov 2019-01-02 20:06:01 +04:00
parent 6e2b6aa7a3
commit e9f9b05141
12 changed files with 69 additions and 142 deletions

View file

@ -1,28 +1,12 @@
package mage.player.ai; package mage.player.ai;
import java.io.File;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.ActivatedAbility; import mage.abilities.ActivatedAbility;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
import mage.abilities.common.PassAbility; import mage.abilities.common.PassAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.SearchEffect; import mage.abilities.effects.SearchEffect;
import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.*;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.ExaltedAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.keyword.ReachAbility;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.Cards; import mage.cards.Cards;
import mage.choices.Choice; import mage.choices.Choice;
@ -49,8 +33,11 @@ import mage.target.Targets;
import mage.util.RandomUtil; import mage.util.RandomUtil;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import java.io.File;
import java.util.*;
import java.util.concurrent.*;
/** /**
*
* @author nantuko * @author nantuko
*/ */
public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
@ -180,10 +167,9 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
if (!suggested.isEmpty() && !(ability instanceof PassAbility)) { if (!suggested.isEmpty() && !(ability instanceof PassAbility)) {
Iterator<String> it = suggested.iterator(); Iterator<String> it = suggested.iterator();
while (it.hasNext()) { while (it.hasNext()) {
Card card = game.getCard(ability.getSourceId());
String action = it.next(); String action = it.next();
logger.info("Suggested action=" + action + ";card=" + card); Card card = game.getCard(ability.getSourceId());
if (action.equals(card.getName())) { if (card != null && action.equals(card.getName())) {
logger.info("-> removed from suggested=" + action); logger.info("-> removed from suggested=" + action);
it.remove(); it.remove();
} }
@ -930,7 +916,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
String line = scanner.nextLine(); String line = scanner.nextLine();
if (line.startsWith("cast:") if (line.startsWith("cast:")
|| line.startsWith("play:")) { || line.startsWith("play:")) {
suggested.add(line.substring(5, line.length())); suggested.add(line.substring(5));
} }
} }
System.out.println("suggested::"); System.out.println("suggested::");
@ -953,7 +939,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
if (action != null if (action != null
&& (action.startsWith("cast:") && (action.startsWith("cast:")
|| action.startsWith("play:"))) { || action.startsWith("play:"))) {
suggested.add(action.substring(5, action.length())); suggested.add(action.substring(5));
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
@ -27,8 +25,9 @@ import mage.game.stack.Spell;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class CherishedHatchling extends CardImpl { public final class CherishedHatchling extends CardImpl {
@ -113,48 +112,3 @@ class CherishedHatchlingTriggeredAbility extends DelayedTriggeredAbility {
return "and whenever you cast a Dinosaur spell this turn, " + super.getRule(); return "and whenever you cast a Dinosaur spell this turn, " + super.getRule();
} }
} }
//class CherishedHatchlingGainAbilityEffect extends ContinuousEffectImpl {
//
// private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
//
// static {
// filter.add(new AnotherPredicate());
// }
// private Ability abilityToAdd = null;
// private Card relatedCard = null;
//
// public CherishedHatchlingGainAbilityEffect() {
// super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
// staticText = "it gains \"When this creature enters the battlefield, you may have it fight another target creature.\"";
// }
//
// public CherishedHatchlingGainAbilityEffect(final CherishedHatchlingGainAbilityEffect effect) {
// super(effect);
// this.abilityToAdd = effect.abilityToAdd;
// this.relatedCard = effect.relatedCard;
// }
//
// @Override
// public CherishedHatchlingGainAbilityEffect copy() {
// return new CherishedHatchlingGainAbilityEffect(this);
// }
//
// @Override
// public boolean apply(Game game, Ability source) {
// if (relatedCard == null) {
// Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
// if (spell != null) {
// relatedCard = game.getCard(spell.getSourceId());
// Effect effect = new FightTargetSourceEffect();
// effect.setText("you may have it fight another target creature");
// abilityToAdd = new EntersBattlefieldTriggeredAbility(effect, true);
// abilityToAdd.addTarget(new TargetCreaturePermanent(filter));
// }
// }
// if (relatedCard != null) {
// game.getState().addOtherAbility(relatedCard, abilityToAdd, false);
// }
// return true;
// }
//}

View file

@ -1,9 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect;
@ -23,8 +19,11 @@ import mage.players.Player;
import mage.target.common.TargetPermanentOrSuspendedCard; import mage.target.common.TargetPermanentOrSuspendedCard;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author spjspj * @author spjspj
*/ */
public final class Clockspinning extends CardImpl { public final class Clockspinning extends CardImpl {
@ -133,7 +132,6 @@ class ClockspinningAddOrRemoveCounterEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget()); Permanent permanent = game.getPermanent(source.getFirstTarget());
Card card = game.getCard(source.getFirstTarget());
if (player != null && permanent != null) { if (player != null && permanent != null) {
if (player.chooseUse(Outcome.Neutral, "Do you want to to remove a counter?", source, game)) { if (player.chooseUse(Outcome.Neutral, "Do you want to to remove a counter?", source, game)) {
@ -151,6 +149,8 @@ class ClockspinningAddOrRemoveCounterEffect extends OneShotEffect {
} }
return true; return true;
} }
Card card = game.getCard(source.getFirstTarget());
if (player != null && card != null) { if (player != null && card != null) {
if (player.chooseUse(Outcome.Neutral, "Do you want to to remove a counter?", source, game)) { if (player.chooseUse(Outcome.Neutral, "Do you want to to remove a counter?", source, game)) {
Counter counter = selectCounterType(game, source, card); Counter counter = selectCounterType(game, source, card);

View file

@ -1,8 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.List;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.DiesTriggeredAbility;
@ -20,6 +17,9 @@ import mage.players.Player;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.List;
import java.util.UUID;
/** /**
* @author nantuko * @author nantuko
*/ */
@ -117,12 +117,14 @@ class CloneShellDiesEffect extends OneShotEffect {
List<UUID> imprinted = permanent.getImprinted(); List<UUID> imprinted = permanent.getImprinted();
if (!imprinted.isEmpty()) { if (!imprinted.isEmpty()) {
Card imprintedCard = game.getCard(imprinted.get(0)); Card imprintedCard = game.getCard(imprinted.get(0));
if (imprinted != null) {
imprintedCard.setFaceDown(false, game); imprintedCard.setFaceDown(false, game);
if (imprintedCard.isCreature()) { if (imprintedCard.isCreature()) {
controller.moveCards(imprintedCard, Zone.BATTLEFIELD, source, game); controller.moveCards(imprintedCard, Zone.BATTLEFIELD, source, game);
} }
} }
} }
}
return true; return true;
} }
return false; return false;

View file

@ -17,7 +17,6 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class CommuneWithLava extends CardImpl { public final class CommuneWithLava extends CardImpl {
@ -60,7 +59,7 @@ class CommuneWithLavaEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Card sourceCard = game.getCard(source.getSourceId()); Card sourceCard = game.getCard(source.getSourceId());
if (controller != null) { if (controller != null && sourceCard != null) {
int amount = source.getManaCostsToPay().getX(); int amount = source.getManaCostsToPay().getX();
Set<Card> cards = controller.getLibrary().getTopCards(game, amount); Set<Card> cards = controller.getLibrary().getTopCards(game, amount);
controller.moveCardsToExile(cards, source, game, true, CardUtil.getCardExileZoneId(game, source), sourceCard.getIdName()); controller.moveCardsToExile(cards, source, game, true, CardUtil.getCardExileZoneId(game, source), sourceCard.getIdName());
@ -105,9 +104,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
@Override @Override
public boolean isInactive(Ability source, Game game) { public boolean isInactive(Ability source, Game game) {
if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) { if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
if (game.isActivePlayer(source.getControllerId())) { return game.isActivePlayer(source.getControllerId());
return true;
}
} }
return false; return false;
} }

View file

@ -1,9 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.AsEntersBattlefieldAbility;
@ -22,8 +18,11 @@ import mage.game.stack.StackObject;
import mage.players.Player; import mage.players.Player;
import mage.util.SubTypeList; import mage.util.SubTypeList;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
/** /**
*
* @author anonymous * @author anonymous
*/ */
public final class Conspiracy extends CardImpl { public final class Conspiracy extends CardImpl {
@ -72,14 +71,14 @@ class ConspiracyEffect extends ContinuousEffectImpl {
// in graveyard // in graveyard
for (UUID cardId : controller.getGraveyard()) { for (UUID cardId : controller.getGraveyard()) {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card.isCreature()) { if (card != null && card.isCreature()) {
setCreatureSubtype(card, subType, game); setCreatureSubtype(card, subType, game);
} }
} }
// on Hand // on Hand
for (UUID cardId : controller.getHand()) { for (UUID cardId : controller.getHand()) {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card.isCreature()) { if (card != null && card.isCreature()) {
setCreatureSubtype(card, subType, game); setCreatureSubtype(card, subType, game);
} }
} }
@ -99,7 +98,7 @@ class ConspiracyEffect extends ContinuousEffectImpl {
for (UUID commanderId : controller.getCommandersIds()) { for (UUID commanderId : controller.getCommandersIds()) {
if (game.getState().getZone(commanderId) == Zone.COMMAND) { if (game.getState().getZone(commanderId) == Zone.COMMAND) {
Card card = game.getCard(commanderId); Card card = game.getCard(commanderId);
if (card.isCreature()) { if (card != null && card.isCreature()) {
setCreatureSubtype(card, subType, game); setCreatureSubtype(card, subType, game);
} }
} }

View file

@ -1,6 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,19 +9,16 @@ import mage.abilities.keyword.TransformAbility;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeEvent;
import mage.players.Player; import mage.players.Player;
import mage.watchers.common.CreatureWasCastWatcher; import mage.watchers.common.CreatureWasCastWatcher;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class ContainmentPriest extends CardImpl { public final class ContainmentPriest extends CardImpl {
@ -94,16 +90,14 @@ class ContainmentPriestReplacementEffect extends ReplacementEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD) { if (((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD) {
Card card = game.getCard(event.getTargetId());
Object entersTransformed = game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + event.getTargetId()); Object entersTransformed = game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + event.getTargetId());
if (entersTransformed instanceof Boolean && (Boolean) entersTransformed && card.getSecondCardFace() != null) { Card card = game.getCard(event.getTargetId());
if (card != null && entersTransformed instanceof Boolean && (Boolean) entersTransformed && card.getSecondCardFace() != null) {
card = card.getSecondCardFace(); card = card.getSecondCardFace();
} }
if (card.isCreature()) { // TODO: Bestow Card cast as Enchantment probably not handled correctly if (card != null && card.isCreature()) { // TODO: Bestow Card cast as Enchantment probably not handled correctly
CreatureWasCastWatcher watcher = (CreatureWasCastWatcher) game.getState().getWatchers().get(CreatureWasCastWatcher.class.getSimpleName()); CreatureWasCastWatcher watcher = (CreatureWasCastWatcher) game.getState().getWatchers().get(CreatureWasCastWatcher.class.getSimpleName());
if (watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId())) { return watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId());
return true;
}
} }
} }
return false; return false;

View file

@ -93,9 +93,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
MageObject object = game.getObject(event.getSourceId()); MageObject object = game.getObject(event.getSourceId());
String needName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); String needName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (object != null && CardUtil.haveSameNames(object.getName(), needName)) { return object != null && CardUtil.haveSameNames(object.getName(), needName);
return true;
}
} }
return false; return false;
} }
@ -123,9 +121,11 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl
if ((abilityToModify instanceof SpellAbility) if ((abilityToModify instanceof SpellAbility)
&& abilityToModify.isControlledBy(source.getControllerId())) { && abilityToModify.isControlledBy(source.getControllerId())) {
Card card = game.getCard(abilityToModify.getSourceId()); Card card = game.getCard(abilityToModify.getSourceId());
if (card != null) {
String needName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); String needName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
return CardUtil.haveSameNames(card.getName(), needName); return CardUtil.haveSameNames(card.getName(), needName);
} }
}
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.Card;
@ -21,8 +19,9 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class CruelRevival extends CardImpl { public final class CruelRevival extends CardImpl {
@ -70,10 +69,11 @@ class CruelRevivalEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent targetDestroy = game.getPermanent(source.getFirstTarget()); Permanent targetDestroy = game.getPermanent(source.getFirstTarget());
Card targetRetrieve = game.getCard(source.getTargets().get(1).getFirstTarget());
if (targetDestroy != null) { if (targetDestroy != null) {
targetDestroy.destroy(source.getSourceId(), game, true); targetDestroy.destroy(source.getSourceId(), game, true);
} }
Card targetRetrieve = game.getCard(source.getTargets().get(1).getFirstTarget());
if (targetRetrieve != null) { if (targetRetrieve != null) {
targetRetrieve.moveToZone(Zone.HAND, source.getSourceId(), game, true); targetRetrieve.moveToZone(Zone.HAND, source.getSourceId(), game, true);
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@ -21,8 +19,9 @@ import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
*
* @author North * @author North
*/ */
public final class CruelUltimatum extends CardImpl { public final class CruelUltimatum extends CardImpl {
@ -80,7 +79,8 @@ class CruelUltimatumEffect extends OneShotEffect {
if (card == null) { if (card == null) {
return false; return false;
} }
controller.moveCards(card, Zone.HAND, source, game);
return controller.moveCards(card, Zone.HAND, source, game);
} }
return true; return true;
} }

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpecialAction; import mage.abilities.SpecialAction;
@ -39,11 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -51,8 +46,9 @@ import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public class DampingEngine extends CardImpl { public class DampingEngine extends CardImpl {
@ -119,8 +115,7 @@ class DampingEngineEffect extends ContinuousRuleModifyingEffectImpl {
Player player = game.getPlayer(event.getPlayerId()); Player player = game.getPlayer(event.getPlayerId());
Permanent dampingEngine = game.getPermanent(source.getSourceId()); Permanent dampingEngine = game.getPermanent(source.getSourceId());
final Card card = game.getCard(event.getSourceId()); final Card card = game.getCard(event.getSourceId());
if (player != null if (player != null || card != null) {
|| card != null) {
// check type of spell // check type of spell
if (card.isCreature() if (card.isCreature()
|| card.isArtifact() || card.isArtifact()
@ -129,13 +124,10 @@ class DampingEngineEffect extends ContinuousRuleModifyingEffectImpl {
// check to see if the player has more permanents // check to see if the player has more permanents
if (new ControlsMorePermanentsThanEachOtherPlayer(player).apply(game, source)) { if (new ControlsMorePermanentsThanEachOtherPlayer(player).apply(game, source)) {
// check to see if the player choose to ignore the effect // check to see if the player choose to ignore the effect
if (game.getState().getValue("ignoreEffect") != null return game.getState().getValue("ignoreEffect") == null
&& dampingEngine != null || dampingEngine == null
&& game.getState().getValue("ignoreEffect").equals || !game.getState().getValue("ignoreEffect").equals
(dampingEngine.getId() + "ignoreEffect" + game.getState().getPriorityPlayerId() + game.getState().getTurnNum())) { (dampingEngine.getId() + "ignoreEffect" + game.getState().getPriorityPlayerId() + game.getState().getTurnNum());
return false;
}
return true;
} }
} }
} }

View file

@ -1,4 +1,3 @@
package mage.abilities.keyword; package mage.abilities.keyword;
import mage.MageObjectReference; import mage.MageObjectReference;
@ -84,7 +83,11 @@ class CascadeEffect extends OneShotEffect {
return false; return false;
} }
ExileZone exile = game.getExile().createZone(source.getSourceId(), controller.getName() + " Cascade"); ExileZone exile = game.getExile().createZone(source.getSourceId(), controller.getName() + " Cascade");
int sourceCost = game.getCard(source.getSourceId()).getConvertedManaCost(); card = game.getCard(source.getSourceId());
if (card == null) {
return false;
}
int sourceCost = card.getConvertedManaCost();
do { do {
card = controller.getLibrary().getFromTop(game); card = controller.getLibrary().getFromTop(game);
if (card == null) { if (card == null) {