Skip to content

Commit

Permalink
tweak fall damage again
Browse files Browse the repository at this point in the history
  • Loading branch information
giantcavespider committed Nov 18, 2024
1 parent 4fe1822 commit b7e07e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stats/monster_primary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ function update(dt)

if self.fallDistance > minimumFallDistance and -self.lastYVelocity > minimumFallVel and mcontroller.onGround() and not inLiquid() then
--fall damage is proportional to max health, with 100.0 being the player's standard
local healthRatio = math.sqrt(status.stat("maxHealth") / 100.0)
local healthRatio = status.stat("maxHealth") / 100.0
if healthRatio > 1.0 then
healthRatio = math.sqrt(healthRatio)
end

local damage = (self.fallDistance - minimumFallDistance) * fallDistanceDamageFactor
damage = damage * (1.0 + (world.gravity(mcontroller.position()) - baseGravity) * gravityDiffFactor)
Expand Down

0 comments on commit b7e07e8

Please sign in to comment.