Jump to content

Lose Sanity when Murdering a rabbit/bird?

Recommended Posts

I used this topic to give my character the ability to pick up rabbits, but I also want to give him a sanity penalty for MURDERING them, including any other animal not including bugs. I already have a sanity penalty for killing them but I'm not sure how to do it for murdering? I can't seem to find an Event for murder either : ( 

Edited by headofmarimo
Link to comment
Share on other sites

5 hours ago, thomas4846 said:

        act.doer:PushEvent("murdered", { victim = murdered, stackmult = stacksize })
        act.doer:PushEvent("killed", { victim = murdered, stackmult = stacksize })

to use victim and stackmult use  data.victim

okay, thanks! What is the stackmult and  stacksize variable though? would I do data.victim and data.victim.stackmult?

Also would I put my sanity penalty under ListenforEvent then and put this in my character.lua?

Edited by headofmarimo
Link to comment
Share on other sites

local stacksize = murdered.components.stackable ~= nil and murdered.components.stackable:StackSize() or 1

stacksize is the how many there are in the stack if there is one

stackmult is just the name of it when you use it 

if data.stackmult then
   delta = delta * data.stackmult
   --do delta but stacked

I think you would use it like this so if you kill more than 1 it will add the additional amount instead of just the one

or run a loop with the amount of murdered ones

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

  • Create New...