Jump to content

Recommended Posts

You could do something like this:

local regentask
local function OnWetnessDelta(inst, data)
    if inst.components.moisture:GetMoisturePercent() >= 0.3 then -- The '0.3' is the threshold the character needs to exceed to start the boosts
        inst.components.sanity.externalmodifiers:SetModifier(inst, 'yourvalue')

        if regentask == nil then
            regentask = inst:DoPeriodicTask(1, function(inst)
                inst.components.health:DoDelta(1, true)
            end)
        end

        return
    end

    regentask:Cancel()
    regentask = nil
end

-- Put this inside your master_postinit \/
inst:ListenForEvent("moisturedelta", OnWetnessDelta)
inst.components.sanity.no_moisture_penalty = true -- You would probably also want to set this to true

 

Edited by -t-

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...