mirror of
https://github.com/correl/mage.git
synced 2025-01-14 03:00:10 +00:00
Reverting back - 711.1. Tokens and cards with a Magic card back can't transform.
This commit is contained in:
parent
da2bdfb893
commit
3ee7c808e1
8 changed files with 8 additions and 48 deletions
|
@ -128,9 +128,9 @@ class ScreechingBatTransformSourceEffect extends OneShotEffect<ScreechingBatTran
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
if (permanent.canTransform()) {
|
Cost cost = new ManaCostsImpl("{2}{B}{B}");
|
||||||
Cost cost = new ManaCostsImpl("{2}{B}{B}");
|
if (cost.pay(source, game, permanent.getControllerId(), permanent.getControllerId(), false)) {
|
||||||
if (cost.pay(source, game, permanent.getControllerId(), permanent.getControllerId(), false)) {
|
if (permanent.canTransform()) {
|
||||||
permanent.setTransformed(!permanent.isTransformed());
|
permanent.setTransformed(!permanent.isTransformed());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,10 @@ class TransformEffect extends ContinuousEffectImpl<TransformEffect> {
|
||||||
|
|
||||||
Card card = permanent.getSecondCardFace();
|
Card card = permanent.getSecondCardFace();
|
||||||
|
|
||||||
|
if (card == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
permanent.setName(card.getName());
|
permanent.setName(card.getName());
|
||||||
permanent.getColor().setColor(card.getColor());
|
permanent.getColor().setColor(card.getColor());
|
||||||
permanent.getManaCost().clear();
|
permanent.getManaCost().clear();
|
||||||
|
|
|
@ -61,13 +61,11 @@ public interface Card extends MageObject {
|
||||||
public boolean isFaceDown();
|
public boolean isFaceDown();
|
||||||
|
|
||||||
public boolean canTransform();
|
public boolean canTransform();
|
||||||
public void setCanTransform(boolean value);
|
|
||||||
public Card getSecondCardFace();
|
public Card getSecondCardFace();
|
||||||
public void setSecondCardFace(Card card);
|
|
||||||
|
|
||||||
public boolean isNightCard();
|
public boolean isNightCard();
|
||||||
|
|
||||||
public void assignNewId();
|
public void assignNewId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the card to the specified zone
|
* Moves the card to the specified zone
|
||||||
* @param zone
|
* @param zone
|
||||||
|
|
|
@ -387,13 +387,4 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
||||||
return this.nightCard;
|
return this.nightCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCanTransform(boolean canTransform) {
|
|
||||||
this.canTransform = canTransform;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSecondCardFace(Card card) {
|
|
||||||
this.secondSideCard = card;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,6 @@ public class Token extends MageObjectImpl<Token> {
|
||||||
|
|
||||||
protected String description;
|
protected String description;
|
||||||
private UUID lastAddedTokenId;
|
private UUID lastAddedTokenId;
|
||||||
private boolean canTransform;
|
|
||||||
private Card secondCardFace;
|
|
||||||
|
|
||||||
public Token(String name, String description) {
|
public Token(String name, String description) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -70,7 +68,6 @@ public class Token extends MageObjectImpl<Token> {
|
||||||
public Token(final Token token) {
|
public Token(final Token token) {
|
||||||
super(token);
|
super(token);
|
||||||
this.description = token.description;
|
this.description = token.description;
|
||||||
this.canTransform = token.canTransform;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
|
@ -99,10 +96,6 @@ public class Token extends MageObjectImpl<Token> {
|
||||||
amount = event.getAmount();
|
amount = event.getAmount();
|
||||||
for (int i = 0; i < amount; i++) {
|
for (int i = 0; i < amount; i++) {
|
||||||
PermanentToken permanent = new PermanentToken(this, controllerId, setCode);
|
PermanentToken permanent = new PermanentToken(this, controllerId, setCode);
|
||||||
if (this.canTransform) {
|
|
||||||
permanent.setCanTransform(this.canTransform);
|
|
||||||
permanent.setSecondCardFace(this.secondCardFace);
|
|
||||||
}
|
|
||||||
game.getBattlefield().addPermanent(permanent);
|
game.getBattlefield().addPermanent(permanent);
|
||||||
this.lastAddedTokenId = permanent.getId();
|
this.lastAddedTokenId = permanent.getId();
|
||||||
permanent.entersBattlefield(sourceId, game);
|
permanent.entersBattlefield(sourceId, game);
|
||||||
|
@ -113,12 +106,4 @@ public class Token extends MageObjectImpl<Token> {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCanTransform(boolean canTransform) {
|
|
||||||
this.canTransform = canTransform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSecondCardFace(Card card) {
|
|
||||||
this.secondCardFace = card;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,10 +351,6 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCanTransform(boolean value) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Card getSecondCardFace() {
|
public Card getSecondCardFace() {
|
||||||
return null;
|
return null;
|
||||||
|
@ -440,9 +436,5 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
||||||
public void setCopiedSpell(boolean isCopied) {
|
public void setCopiedSpell(boolean isCopied) {
|
||||||
this.copiedSpell = isCopied;
|
this.copiedSpell = isCopied;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSecondCardFace(Card card) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,11 +79,6 @@ public class CopyFunction implements Function<Card, Card> {
|
||||||
target.getPower().setValue(source.getPower().getValue());
|
target.getPower().setValue(source.getPower().getValue());
|
||||||
target.getToughness().setValue(source.getToughness().getValue());
|
target.getToughness().setValue(source.getToughness().getValue());
|
||||||
|
|
||||||
if (source.canTransform()) {
|
|
||||||
target.setCanTransform(true);
|
|
||||||
target.setSecondCardFace(source.getSecondCardFace());
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,11 +80,6 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
||||||
target.getPower().setValue(source.getPower().getValue());
|
target.getPower().setValue(source.getPower().getValue());
|
||||||
target.getToughness().setValue(source.getToughness().getValue());
|
target.getToughness().setValue(source.getToughness().getValue());
|
||||||
|
|
||||||
if (source.canTransform()) {
|
|
||||||
target.setCanTransform(true);
|
|
||||||
target.setSecondCardFace(source.getSecondCardFace());
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue