Jump to content

Recommended Posts

Hey there. I'm trying to code a character that has a sanity gain when around passive insects (I.e. bees, butterflies, etc.) and no sanity loss when around aggressive entities (I.e. spiders). I'm pretty new to the process of modding, and I've had little success surfing the forums. Any help would be greatly appreciated. :)

Edited by GibusPyro
-- For your character
inst.components.sanity:AddSanityAuraImmunity("hostile")
inst.components.sanity:AddSanityAuraImmunity("monster")

for i, v in pairs({ "bee", "butterfly", "moonbutterfly" }) do
    AddPrefabPostInit(v, function(inst)
        inst:AddComponent("sanityaura")
        inst.components.sanityaura.aura = 24 / TUNING.TOTAL_DAY_TIME
    end)
end

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