707.10: Copied spells incomplete

This commit is contained in:
tool4EvEr
2022-04-12 22:24:48 +02:00
parent 80c51f4ef5
commit 2ef5f67fb8
3 changed files with 20 additions and 21 deletions

View File

@@ -1258,14 +1258,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
}
public final int getXManaCostPaid() {
SpellAbility castSA;
if (getCopiedPermanent() != null) {
castSA = getCopiedPermanent().getCastSA();
} else {
castSA = getCastSA();
}
if (castSA != null) {
Integer paid = castSA.getXManaCostPaid();
if (getCastSAFallBack() != null) {
Integer paid = getCastSAFallBack().getXManaCostPaid();
return paid == null ? 0 : paid;
}
return 0;
@@ -6092,6 +6086,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
public SpellAbility getCastSA() {
return castSA;
}
public SpellAbility getCastSAFallBack() {
return getCopiedPermanent() != null ? getCopiedPermanent().getCastSA() : castSA;
}
public void setCastSA(SpellAbility castSA) {
this.castSA = castSA;

View File

@@ -124,6 +124,8 @@ public class CardFactory {
final Game game = source.getGame();
final Card c = new Card(game.nextCardId(), original.getPaperCard(), game);
copyCopiableCharacteristics(original, c);
// fix old cardstates
buildAbilities(c);
if (sourceSA.hasParam("NonLegendary")) {
c.removeType(CardType.Supertype.Legendary);

View File

@@ -1680,40 +1680,40 @@ public class CardProperty {
if (!card.isOptionalCostPaid(OptionalCost.Generic)) return false;
}
} else if (property.equals("surged")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isSurged();
return card.getCastSAFallBack().isSurged();
} else if (property.equals("blitzed")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isBlitz();
} else if (property.equals("dashed")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isDash();
return card.getCastSAFallBack().isDash();
} else if (property.equals("escaped")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isEscape();
return card.getCastSAFallBack().isEscape();
} else if (property.equals("evoked")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isEvoke();
return card.getCastSAFallBack().isEvoke();
} else if (property.equals("prowled")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isProwl();
return card.getCastSAFallBack().isProwl();
} else if (property.equals("spectacle")) {
if (card.getCastSA() == null) {
if (card.getCastSAFallBack() == null) {
return false;
}
return card.getCastSA().isSpectacle();
return card.getCastSAFallBack().isSpectacle();
} else if (property.equals("foretold")) {
if (!card.isForetold()) {
return false;