mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Simplify implementation of pre-announcing X
This commit is contained in:
@@ -696,6 +696,9 @@ public class HumanPlay {
|
||||
toPay.setXManaCostPaid(xPaid, ability.getParam("XColor"));
|
||||
source.setXManaCostPaid(xPaid);
|
||||
}
|
||||
else if (source.getXManaCostPaid() > 0) { //ensure pre-announced X value retained
|
||||
toPay.setXManaCostPaid(source.getXManaCostPaid(), ability.getParam("XColor"));
|
||||
}
|
||||
|
||||
int timesMultikicked = source.getKickerMagnitude();
|
||||
if (timesMultikicked > 0 && ability.isAnnouncing("Multikicker")) {
|
||||
@@ -716,7 +719,7 @@ public class HumanPlay {
|
||||
if (isActivatedSa) {
|
||||
ManaCostAdjustment.adjust(toPay, ability, false);
|
||||
}
|
||||
|
||||
|
||||
InputPayMana inpPayment;
|
||||
if (ability.isOffering() && ability.getSacrificedAsOffering() == null) {
|
||||
System.out.println("Sacrifice input for Offering cancelled");
|
||||
|
||||
@@ -229,20 +229,12 @@ public class HumanPlaySpellAbility {
|
||||
|
||||
if (needX && manaCost != null && manaCost.getAmountOfX() > 0) {
|
||||
String sVar = ability.getSVar("X"); //only prompt for new X value if card doesn't determine it another way
|
||||
if ("Count$xPaid".equals(sVar) || StringUtils.isNumeric(sVar) || sVar.isEmpty()) {
|
||||
if ("Count$xPaid".equals(sVar) || sVar.isEmpty()) {
|
||||
Integer value = controller.announceRequirements(ability, "X", allowZero && manaCost.canXbe0());
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ability.setSVar("X", value.toString());
|
||||
card.setSVar("X", value.toString());
|
||||
|
||||
// announce to sub-abilities
|
||||
SpellAbility sub = ability;
|
||||
while ((sub = sub.getSubAbility()) != null) {
|
||||
sub.setSVar("X", value.toString());
|
||||
}
|
||||
card.setXManaCostPaid(value);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user