From 3b408829d1a01264778e1ddf52b518f4b6ba5bb3 Mon Sep 17 00:00:00 2001 From: tonydero Date: Mon, 21 Oct 2024 16:57:48 -0600 Subject: [PATCH] fix loss of precision warnings --- scripts/NPC.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/NPC.gd b/scripts/NPC.gd index 52c46ce..7b90d75 100644 --- a/scripts/NPC.gd +++ b/scripts/NPC.gd @@ -19,7 +19,7 @@ func _random_mod_health() -> void: randomize() # noise factor var noise_factor = randf_range(7, 10) - self.maxHealth *= noise_factor + self.maxHealth = round(noise_factor * self.maxHealth) # difficulty factor match self.npcDifficulty: NPCDifficulty.MINION: @@ -33,7 +33,7 @@ func _random_mod_health() -> void: NPCDifficulty.BBEG: self.maxHealth *= 16 # npcTier factor - self.maxHealth *= exp(self.npcTier) + self.maxHealth = round(exp(self.npcTier) * self.maxHealth) # fun factor (just additional factor to tweak) self.maxHealth *= 10