Jump to content

Recommended Posts

this it?

local FLOWER_TAGS = { "flower" }
local function sanityfn(inst)--, dt)
    local delta = inst.components.temperature:IsFreezing() and -TUNING.SANITYAURA_LARGE or 0
    local x, y, z = inst.Transform:GetWorldPosition()
    local max_rad = 10
    local ents = TheSim:FindEntities(x, y, z, max_rad, FLOWER_TAGS)
    for i, v in ipairs(ents) do
        if v.components.burnable ~= nil and v.components.burnable:IsBurning() then
            local rad = v.components.burnable:GetLargestLightRadius() or 1
            local sz = TUNING.SANITYAURA_TINY * math.min(max_rad, rad) / max_rad
            local distsq = inst:GetDistanceSqToInst(v) - 9
            -- shift the value so that a distance of 3 is the minimum
            delta = delta + sz / math.max(1, distsq)
        end
    end
    return delta
end
Edited by BHL

image.png.ec3a51a9a6a5f6ced625a63de448040c.pngimage.png.8a96710effe80fe4854bb935cbcb56b0.png

This is very specific to willow and its mechanics with fire...
 

You have to change a lot there and then implement that in character.
 

This willow function should be noted, but you need to understand what each part does.

I think you can look at Walter's tree sanity gain, it's probably going to be closer to flowers than fire :D

Edited by Leonidas IV

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...