Jump to content

Help with Sanity Aura


Recommended Posts

Hello, This is my first time working on a mod and I am not sure how to set this up right. I am editing the Illyasviel Von Einzbern character mod by Silhh and Arcade for my own game. I am only doing it to tailor it more to what I want and scale back the characters OPness a bit, I will not upload it so as to keep to the authors rules. I am giving Berserker (the giant she can summon) a sanity aura, which I already have gotten done and working, but I want the aura just to effect her. I doubt others would gain sanity from being near a killer giant. Does anyone know how I would edit the Sanity Aura to do that?


    -- Sanity Aura
    inst:AddComponent("sanityaura")
    inst.components.sanityaura.aura = 2

This is the code I use for the Aura. Any help would be very much appreciated.

Link to comment
Share on other sites

You'll need to set sanityaura's  aurafn to make it return a value higher than 0 only when the player is illya, like so:

local function CalcSanityAura(inst, observer)
    return observer.prefab == "illya" and 2 or 0
end

...

inst.components.sanityaura.aurafn = CalcSanityAura

 

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