set castSA on copy

This commit is contained in:
tool4EvEr
2022-04-13 11:46:12 +02:00
parent e782ec07c7
commit 16613fe1d0
4 changed files with 19 additions and 23 deletions

View File

@@ -815,7 +815,7 @@ public class GameAction {
} else {
c.setCastFrom(zoneFrom);
}
if (cause != null && cause.isSpell() && c.equals(cause.getHostCard()) && !c.isCopiedSpell()) {
if (cause != null && cause.isSpell() && c.equals(cause.getHostCard())) {
c.setCastSA(cause);
} else {
c.setCastSA(null);

View File

@@ -1258,8 +1258,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
}
public final int getXManaCostPaid() {
if (getCastSAFallBack() != null) {
Integer paid = getCastSAFallBack().getXManaCostPaid();
if (getCastSA() != null) {
Integer paid = getCastSA().getXManaCostPaid();
return paid == null ? 0 : paid;
}
return 0;
@@ -6086,9 +6086,6 @@ 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

@@ -163,6 +163,8 @@ public class CardFactory {
c.setCopiedSpell(true);
c.setCopiedPermanent(original);
c.setCastSA(targetSA);
c.setXManaCostPaidByColor(original.getXManaCostPaidByColor());
c.setKickerMagnitude(original.getKickerMagnitude());
@@ -792,9 +794,6 @@ public class CardFactory {
state.setImageKey(ImageKeys.getTokenKey("eternalize_" + name + "_" + set));
}
// set the host card for copied replacement effects
// needed for copied xPaid ETB effects (for the copy, xPaid = 0)
if (sa.hasParam("GainTextOf") && originalState != null) {
state.setSetCode(originalState.getSetCode());
state.setRarity(originalState.getRarity());

View File

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