mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Prevent mana not deducting from pool when manually paying mana costs
This commit is contained in:
@@ -40,7 +40,8 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
protected ManaCostBeingPaid manaCost;
|
protected ManaCostBeingPaid manaCost;
|
||||||
protected final SpellAbility saPaidFor;
|
protected final SpellAbility saPaidFor;
|
||||||
|
|
||||||
boolean bPaid = false;
|
private boolean bPaid = false;
|
||||||
|
private Boolean canPayManaCost = null;
|
||||||
|
|
||||||
protected InputPayMana(SpellAbility saToPayFor) {
|
protected InputPayMana(SpellAbility saToPayFor) {
|
||||||
this.player = saToPayFor.getActivatingPlayer();
|
this.player = saToPayFor.getActivatingPlayer();
|
||||||
@@ -302,15 +303,18 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
|
|
||||||
protected final void updateMessage() {
|
protected final void updateMessage() {
|
||||||
if (supportAutoPay()) {
|
if (supportAutoPay()) {
|
||||||
//use AI utility to determine if mana cost can be paid
|
if (canPayManaCost == null) {
|
||||||
Evaluator<Boolean> proc = new Evaluator<Boolean>() {
|
//use AI utility to determine if mana cost can be paid if that hasn't been determined yet
|
||||||
@Override
|
Evaluator<Boolean> proc = new Evaluator<Boolean>() {
|
||||||
public Boolean evaluate() {
|
@Override
|
||||||
return ComputerUtilMana.canPayManaCost(manaCost, saPaidFor, player);
|
public Boolean evaluate() {
|
||||||
}
|
return ComputerUtilMana.canPayManaCost(manaCost, saPaidFor, player);
|
||||||
};
|
}
|
||||||
player.getController().runAsAi(proc);
|
};
|
||||||
if (proc.getResult()) {
|
player.getController().runAsAi(proc);
|
||||||
|
canPayManaCost = proc.getResult();
|
||||||
|
}
|
||||||
|
if (canPayManaCost) {
|
||||||
ButtonUtil.enableAllFocusOk(); //enabled Auto button if mana cost can be paid
|
ButtonUtil.enableAllFocusOk(); //enabled Auto button if mana cost can be paid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user