mirror of
https://github.com/correl/mage.git
synced 2025-03-17 17:00:08 -09:00
Fixed NPE errors for some cards (#5471)
This commit is contained in:
parent
9c401e33a4
commit
a7db0a6f0a
4 changed files with 18 additions and 19 deletions
Mage.Sets/src/mage/cards
|
@ -1,8 +1,5 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
|
@ -30,8 +27,11 @@ import mage.target.TargetCard;
|
|||
import mage.util.CardUtil;
|
||||
import mage.util.GameLog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public final class ChromeMox extends CardImpl {
|
||||
|
@ -141,7 +141,7 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (!imprinted.isEmpty()) {
|
||||
if (imprinted != null && !imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
if (imprintedCard != null) {
|
||||
ObjectColor color = imprintedCard.getColor(game);
|
||||
|
@ -172,7 +172,7 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (permanent != null && player != null) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (!imprinted.isEmpty()) {
|
||||
if (imprinted != null && !imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
if (imprintedCard != null) {
|
||||
Choice choice = new ChoiceColor(true);
|
||||
|
|
|
@ -115,7 +115,7 @@ class CloneShellDiesEffect extends OneShotEffect {
|
|||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||
if (permanent != null) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (!imprinted.isEmpty()) {
|
||||
if (imprinted != null && !imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
if (imprintedCard != null) {
|
||||
imprintedCard.setFaceDown(false, game);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -22,8 +19,10 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public final class Duplicant extends CardImpl {
|
||||
|
@ -117,6 +116,9 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
|||
if (permanent != null) {
|
||||
if (!permanent.getImprinted().isEmpty()) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (imprinted == null || imprinted.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(imprinted.get(imprinted.size() - 1));
|
||||
if (card != null && card.isCreature()) {
|
||||
switch (layer) {
|
||||
|
@ -134,7 +136,6 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -21,6 +18,9 @@ import mage.players.Player;
|
|||
import mage.target.TargetCard;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
|
@ -113,11 +113,9 @@ class SemblanceAnvilCostReductionEffect extends CostModificationEffectImpl {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
List<UUID> imprinted = permanent.getImprinted();
|
||||
if (!imprinted.isEmpty()) {
|
||||
if (imprinted != null && !imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
if (imprintedCard != null && imprintedCard.shareTypes(sourceCard)) {
|
||||
return true;
|
||||
}
|
||||
return imprintedCard != null && imprintedCard.shareTypes(sourceCard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue