mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- CostAdjustment: account for cases when subability uses targeting and the parent SA doesn't (e.g. Spellwild Ouphe targeted with an AF Charm instant).
This commit is contained in:
@@ -510,12 +510,13 @@ public class CostAdjustment {
|
||||
}
|
||||
}
|
||||
if (params.containsKey("ValidTarget")) {
|
||||
if (!sa.usesTargeting()) {
|
||||
return false;
|
||||
}
|
||||
SpellAbility curSa = sa;
|
||||
boolean targetValid = false;
|
||||
outer: while (curSa != null) {
|
||||
if (!curSa.usesTargeting()) {
|
||||
curSa = curSa.getSubAbility();
|
||||
continue;
|
||||
}
|
||||
for (GameObject target : curSa.getTargets().getTargets()) {
|
||||
if (target.isValid(params.get("ValidTarget").split(","), hostCard.getController(), hostCard, curSa)) {
|
||||
targetValid = true;
|
||||
@@ -528,12 +529,13 @@ public class CostAdjustment {
|
||||
}
|
||||
}
|
||||
if (params.containsKey("ValidSpellTarget")) {
|
||||
if (!sa.usesTargeting()) {
|
||||
return false;
|
||||
}
|
||||
SpellAbility curSa = sa;
|
||||
boolean targetValid = false;
|
||||
outer: while (curSa != null) {
|
||||
if (!curSa.usesTargeting()) {
|
||||
curSa = curSa.getSubAbility();
|
||||
continue;
|
||||
}
|
||||
for (SpellAbility target : curSa.getTargets().getTargetSpells()) {
|
||||
Card targetCard = target.getHostCard();
|
||||
if (targetCard.isValid(params.get("ValidSpellTarget").split(","), hostCard.getController(), hostCard, curSa)) {
|
||||
|
||||
Reference in New Issue
Block a user