mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Fix paying negative life
This commit is contained in:
@@ -76,9 +76,13 @@ public class CostPayLife extends CostPart {
|
||||
Integer amount = this.convertAmount();
|
||||
if (amount == null) { // try to calculate when it's defined.
|
||||
amount = AbilityUtils.calculateAmount(ability.getHostCard(), getAmount(), ability);
|
||||
// CR 107.1b
|
||||
if (getAmount().contains("/Half")) {
|
||||
amount = Math.max(amount, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((amount != null) && !payer.canPayLife(amount)) {
|
||||
if (amount != null && !payer.canPayLife(amount)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
public final boolean canPayLife(final int lifePayment) {
|
||||
if (life < lifePayment) {
|
||||
if (lifePayment > 0 && life < lifePayment) {
|
||||
return false;
|
||||
}
|
||||
return (lifePayment <= 0) || !hasKeyword("Your life total can't change.");
|
||||
|
||||
Reference in New Issue
Block a user