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(); o.run();
} }
public void heal(int amount) { public boolean fullHeal() {
life = Math.min(life + amount, maxLife); if (life < maxLife) {
onLifeTotalChangeList.emit(); life = Math.max(maxLife, life);
onLifeTotalChangeList.emit();
return true;
}
return false;
} }
public void potionOfFalseLife() { public void potionOfFalseLife() {