mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Fixed pay life cost
This commit is contained in:
parent
96ff08dc9a
commit
ba09f43f56
1 changed files with 5 additions and 1 deletions
|
@ -54,10 +54,14 @@ public class PayLifeCost extends CostImpl<PayLifeCost> {
|
|||
|
||||
@Override
|
||||
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
|
||||
//118.4. If a cost or effect allows a player to pay an amount of life greater than 0,
|
||||
//the player may do so only if his or her life total is greater than or equal to the
|
||||
//amount of the payment. If a player pays life, the payment is subtracted from his or
|
||||
//her life total; in other words, the player loses that much life. (Players can always pay 0 life.)
|
||||
if (amount > 0 && !game.getPlayer(controllerId).canPayLifeCost()) {
|
||||
return false;
|
||||
}
|
||||
return game.getPlayer(controllerId).getLife() > amount;
|
||||
return game.getPlayer(controllerId).getLife() >= amount || amount == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue