Lots of content
This commit is contained in:
@@ -55,8 +55,12 @@ function M.needs(state, env, dt)
|
||||
local s = {}
|
||||
for k, v in pairs(state) do s[k] = v end
|
||||
local shelter = M.clamp(env.shelter or 0, 0, 1)
|
||||
s.wet = M.clamp(s.wet + ((env.rain and shelter < 0.6) and 1.2 or -0.35) * dt, 0, 100)
|
||||
local exposed = env.rain and shelter < 0.6
|
||||
local wet_rate = exposed and (env.clothing and 0.35 or 1.2)
|
||||
or (env.drying and -1.5 or -0.35)
|
||||
s.wet = M.clamp(s.wet + wet_rate * dt, 0, 100)
|
||||
local feels = env.temperature - s.wet * 0.09 + (env.heat or 0) * 14 + shelter * 5
|
||||
+ (env.clothing and 4 or 0)
|
||||
local target = M.clamp(60 + feels * 1.5, 0, 100)
|
||||
s.warmth = M.clamp(s.warmth + M.clamp(target - s.warmth, -0.16, 0.3) * dt, 0, 100)
|
||||
s.food = M.clamp(s.food - (env.sprinting and 0.035 or 0.012) * dt, 0, 100)
|
||||
|
||||
Reference in New Issue
Block a user