Skip to content

Commit

Permalink
Add ensure_scaling_disabled hp option
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed May 3, 2024
1 parent d3a3b9d commit e887a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,10 @@ private void setHealth(Player player, User user) {
}

private void applyScaling(Player player) {
if (!Traits.HP.isEnabled()) return;
AttributeInstance attribute = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
if (attribute == null) return;

if (Traits.HP.optionBoolean("health_scaling")) {
if (Traits.HP.optionBoolean("health_scaling") && Traits.HP.isEnabled()) {
double health = attribute.getValue();
player.setHealthScaled(true);
int scaledHearts = 0;
Expand All @@ -173,7 +172,7 @@ private void applyScaling(Player player) {
scaledHearts = 10;
}
player.setHealthScale(scaledHearts * 2);
} else {
} else if (Traits.HP.optionBoolean("ensure_scaling_disabled")) {
player.setHealthScaled(false);
}
}
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/resources/stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ traits:
update_delay: 0
force_base_health: false
keep_full_on_increase: false
ensure_scaling_disabled: true
auraskills/saturation_regen:
enabled: true
use_custom_delay: false
Expand Down Expand Up @@ -134,4 +135,4 @@ traits:
auraskills/double_drop:
enabled: true
max_percent: 100
file_version: 2
file_version: 3

0 comments on commit e887a46

Please sign in to comment.