unusualspycrab Posted October 16, 2022 Share Posted October 16, 2022 I want my character to have a positive sanity aura around Toadstool.. This is probably very simple code but i'm new to modding, please be forgiving. Link to comment https://forums.kleientertainment.com/forums/topic/143860-positive-sanity-aura-around-a-particular-mob/ Share on other sites More sharing options...
Bumber64 Posted October 17, 2022 Share Posted October 17, 2022 (edited) As far as I can tell, you're going to need to modify Toadstool to make it work. Put something like this in your modmain.lua: for k,v in ipairs({"toadstool", "toadstool_dark"}) do AddPrefabPostInit(v, function(inst) local sanityaura = inst.components.sanityaura local old_fn = sanityaura.aurafn sanityaura.aurafn = function(inst, observer) if observer.prefab == "your_character_prefab" then --Replace with your prefab name return -sanityaura.aura --This turns aura postitive. Toadstool's aura is -TUNING.SANITYAURA_HUGE while channeling mushrooms, else 0. --You might want to just return some value if you want it always active, or you could multiply/add to the aura value. elseif old_fn then --Other mods may have added their own aurafn return old_fn(inst, observer) end end end) end Edited October 17, 2022 by Bumber64 1 Link to comment https://forums.kleientertainment.com/forums/topic/143860-positive-sanity-aura-around-a-particular-mob/#findComment-1603255 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now