Jump to content

SanityAura Size//Strength


Recommended Posts

Hey guys I am working on a sanity aura and all i have is 

inst:AddComponent("sanityaura")
    inst.components.sanityaura.aura = TUNING.SANITYAURA_MED

But i dont know how to go about changing the strength of the aura or the effect radius of the aura any help would be appreciated.

Link to comment
Share on other sites

@SKrnPride TUNING.SANITYAURA_MED is just a variable that holds the value 100/(30*5). You can look in scripts/tuning.lua to see these values. So... to change the strength of it, you could use another one of the SANITYAURA variables, or just give it your own value, or multiply it by something:

inst.components.sanityaura.aura = TUNING.SANITYAURA_MED
inst.components.sanityaura.aura = TUNING.SANITYAURA_LARGE
inst.components.sanityaura.aura = TUNING.SANITYAURA_MED*1.5
inst.components.sanityaura.aura = 100/30

The value is just how much sanity per second it gives. So 100/30 would be 100 over 30 seconds.

The radius you cannot change, because it's hardcoded on line 290 of scripts/components/sanity.lua. It's not really a flat radius, though, it's exponential falloff-- it takes the distance, squares it, raises it up to at least 1, and then divides the sanityaura's value by that. So... if you had a sanityaura of 100, and were 4 away (1 tile), then you'd gain 100/(4^2) = 6.25 per second. If you were within 1 unit, you'd gain the full 100.

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