Jump to content

Sanity Gain in Snow


Recommended Posts

Not planning to put this in a workshop mod. Just playing around. Why gain sanity when it snows? Snow is very calming to watch and in my opinion, exciting and refreshing.

I've been searching for the code that makes rain turn to snow in DST, but I'm having no luck. I figured it was an event and maybe I could base the sanity gain on that.

Link to comment
Share on other sites

@DextersComicLaboratory It's controlled by the weather component, and registers some variables in the worldstate component. I'm guessing you want the sanity gain to occur specifically while it's snowing, as opposed to when snow is on the ground?

inst:WatchWorldState("issnowing", function(inst, issnowing)
	if issnowing then
		inst.components.sanity._dapperness = inst.components.sanity._dapperness or inst.components.sanity.dapperness
		inst.components.sanity.dapperness = inst.components.sanity._dapperness + my_snow_dapperness_amount
	elseif inst.components.sanity._dapperness then
		inst.components.sanity.dapperness = inst.components.sanity._dapperness
		inst.components.sanity._dapperness = nil
	end
end)

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...