Card: add Embalmed flag into it, used in CopyPermanentEffect and CloneEffect Vizier of Many Faces

This commit is contained in:
Hanmac
2017-04-14 17:05:38 +00:00
parent 292a89f0c2
commit dc83cdb2b1
3 changed files with 18 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ package forge.game.ability.effects;
import forge.GameCommand;
import forge.card.CardStateName;
import forge.card.MagicColor;
import forge.card.mana.ManaCost;
import forge.game.Game;
import forge.game.ability.AbilityFactory;
import forge.game.ability.AbilityUtils;
@@ -329,6 +331,12 @@ public class CloneEffect extends SpellAbilityEffect {
}
}
tgtCard.addColor(shortColors, !sa.hasParam("OverwriteColors"), tgtCard.getTimestamp());
if (sa.hasParam("Embalm") && tgtCard.isEmbalmed()) {
tgtCard.addType("Zombie");
tgtCard.setColor(MagicColor.WHITE);
tgtCard.setManaCost(ManaCost.NO_COST);
}
}
}

View File

@@ -248,6 +248,8 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
copy.addType("Zombie");
copy.setColor(MagicColor.WHITE);
copy.setManaCost(ManaCost.NO_COST);
copy.setEmbalmed(true);
String name = copy.getName().replace(",", "").replace(" ", "_").toLowerCase();
copy.setImageKey(ImageKeys.getTokenKey("embalm_" + name));
}

View File

@@ -165,6 +165,7 @@ public class Card extends GameEntity implements Comparable<Card> {
private boolean suspendCast = false;
private boolean suspend = false;
private boolean tributed = false;
private boolean embalmed = false;
private boolean madness = false;
private boolean phasedOut = false;
@@ -6197,6 +6198,13 @@ public class Card extends GameEntity implements Comparable<Card> {
tributed = b;
}
public final boolean isEmbalmed() {
return embalmed;
}
public final void setEmbalmed(final boolean b) {
embalmed = b;
}
public boolean isMadness() {
return madness;
}