mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
set castSA on copy
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user