GUI: fixed wrong card sides, data and errors for transform and double side cards;

This commit is contained in:
Oleg Agafonov 2021-11-09 10:16:39 +04:00
parent 3515647c7b
commit 3284cb5b24
10 changed files with 72 additions and 69 deletions

View file

@ -98,7 +98,7 @@ public class CopyEffect extends ContinuousEffectImpl {
permanent.setName(copyFromObject.getName());
permanent.getColor(game).setColor(copyFromObject.getColor(game));
permanent.getManaCost().clear();
permanent.getManaCost().add(copyFromObject.getManaCost());
permanent.getManaCost().add(copyFromObject.getManaCost().copy());
permanent.removeAllCardTypes(game);
for (CardType type : copyFromObject.getCardType(game)) {
permanent.addCardType(game, type);

View file

@ -42,10 +42,11 @@ public class TransformAbility extends SimpleStaticAbility {
return;
}
permanent.setTransformed(true);
permanent.setName(sourceCard.getName());
permanent.getColor(game).setColor(sourceCard.getColor(game));
permanent.getManaCost().clear();
permanent.getManaCost().add(sourceCard.getManaCost());
permanent.getManaCost().add(sourceCard.getManaCost().copy());
permanent.removeAllCardTypes(game);
for (CardType type : sourceCard.getCardType(game)) {
permanent.addCardType(game, type);

View file

@ -38,8 +38,7 @@ public class ModalDoubleFacesCardHalfImpl extends CardImpl implements ModalDoubl
@Override
public String getImageName() {
// TODO: own name?
return parentCard.getImageName();
return name;
}
@Override

View file

@ -74,7 +74,6 @@ public class PermanentCard extends PermanentImpl {
if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId()) != null
|| NightboundAbility.checkCard(this, game)) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId(), null);
setTransformed(true);
TransformAbility.transformPermanent(this, getSecondCardFace(), game, null);
}
}

View file

@ -66,7 +66,7 @@ public class CopyTokenFunction implements Function<Token, Card> {
target.setName(sourceObj.getName());
target.getColor().setColor(sourceObj.getColor());
target.getManaCost().clear();
target.getManaCost().add(sourceObj.getManaCost());
target.getManaCost().add(sourceObj.getManaCost().copy());
target.removeAllCardTypes();
for (CardType type : sourceObj.getCardType()) {
target.addCardType(type);