add simple check for full heal

This commit is contained in:
Anthony Calosa
2022-08-13 14:13:11 +08:00
committed by GitHub
parent 007757187a
commit 86927e8076

View File

@@ -447,9 +447,13 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
o.run();
}
public void heal(int amount) {
life = Math.min(life + amount, maxLife);
onLifeTotalChangeList.emit();
public boolean fullHeal() {
if (life < maxLife) {
life = Math.max(maxLife, life);
onLifeTotalChangeList.emit();
return true;
}
return false;
}
public void potionOfFalseLife() {