This commit is contained in:
tool4EvEr
2021-05-19 16:29:38 +02:00
parent ce3bab8a33
commit 6f9d557a64
2 changed files with 4 additions and 7 deletions

View File

@@ -1551,7 +1551,8 @@ public class AbilityUtils {
boolean alreadyPaid = false;
for (Player payer : allPayers) {
if (unlessCost.equals("LifeTotalHalfUp")) {
cost = new Cost("PayLife<Count$YourLifeTotal/HalfUp>", true);
String halfup = Integer.toString(Math.max(0,(int) Math.ceil(payer.getLife() / 2.0)));
cost = new Cost("PayLife<" + halfup + ">", true);
}
alreadyPaid |= payer.getController().payCostToPreventEffect(cost, sa, alreadyPaid, allPayers);
}

View File

@@ -265,15 +265,11 @@ public class HumanPlay {
boolean mayRemovePart = true;
if (part instanceof CostPayLife) {
if (!part.canPay(sourceAbility, p)) {
final int amount = getAmountFromPart(part, source, sourceAbility);
if (!p.canPayLife(amount)) {
return false;
}
int amount = getAmountFromPart(part, source, sourceAbility);
if (part.getAmount().contains("/Half")) {
amount = Math.max(amount, 0);
}
if (!p.getController().confirmPayment(part, Localizer.getInstance().getMessage("lblDoYouWantPayNLife", String.valueOf(amount)) + orString, sourceAbility)) {
return false;
}