diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index 86f523a..4ca22ea 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -381,7 +381,7 @@ public class Player { // Only heal if player isnt already in anchor range if (isInRange && isInRange != this.inAnchorRange) { - this.getCurrentLineup().heal(10000); + this.getCurrentLineup().heal(10000, true); } this.inAnchorRange = isInRange; } diff --git a/src/main/java/emu/lunarcore/game/player/PlayerLineup.java b/src/main/java/emu/lunarcore/game/player/PlayerLineup.java index a871a33..025bf9d 100644 --- a/src/main/java/emu/lunarcore/game/player/PlayerLineup.java +++ b/src/main/java/emu/lunarcore/game/player/PlayerLineup.java @@ -93,7 +93,7 @@ public class PlayerLineup { } } - public void heal(int heal) { + public void heal(int heal, boolean allowRevive) { // Flag to set if at least one avatar in the team has been healed boolean hasHealed = false; @@ -102,6 +102,12 @@ public class PlayerLineup { GameAvatar avatar = this.getOwner().getAvatarById(avatarId); if (avatar == null) continue; + // Dont heal dead avatars if we are not allowed to revive + if (avatar.getCurrentHp() <= 0 && !allowRevive) { + continue; + } + + // Heal avatar if (avatar.getCurrentHp() < 10000) { avatar.setCurrentHp(Math.min(avatar.getCurrentHp() + heal, 10000)); avatar.save(); diff --git a/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java b/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java index a346c43..b3e3562 100644 --- a/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java +++ b/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java @@ -53,7 +53,7 @@ public class EntityProp implements GameEntity { if (excel.isRecoverMp()) { scene.getPlayer().getCurrentLineup().addMp(2); } else if (excel.isRecoverHp()) { - scene.getPlayer().getCurrentLineup().heal(2500); + scene.getPlayer().getCurrentLineup().heal(2500, false); } }