Floor values are set for max health, combat regen, health regen, melee damage, and projectile damage when changing them now.

This commit is contained in:
luisc committed 2021-12-04 12:46:53 -06:00
1 parent cd5b4c0633
commit 3c1bc30e44
6 files changed
+16 -12

No files matched your search

+5 -2
View File
@@ -8,6 +8,9 @@ import noppes.npcs.constants.EnumPotionType;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.util.ValueUtil;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class DataStats {
private float attackStrength = 5;
@@ -173,12 +176,12 @@ public class DataStats {
return attackStrength;
}
public void setAttackStrength(float strength){
attackStrength = strength;
attackStrength = (float)(Math.floor(strength));
npc.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackStrength);
}
public void setMaxHealth(double maxHealth) {
this.maxHealth = maxHealth;
this.maxHealth = Math.floor(maxHealth);
npc.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
}
}