Jump to content

Insane Perks


Recommended Posts

@icantevenname

inst:ListenForEvent(
    "sanitydelta",
    function(inst, data)
        inst.components.combat.damagemultiplier = (1.0-inst.components.sanity:GetPercent())*2.0+1.0
    end
)

From 1.0 to 3.0 damage at 100% sanity to 0% sanity.

AddPrefabPostInit(
    "wormhole",
    function(inst)
        if not GLOBAL.TheWorld.ismastersim
        then
            return
        end
        local onActivate_old = inst.components.teleporter.onActivate
        inst.components.teleporter.onActivate = function(inst, doer, ...)
            if doer.prefab == "waxwell"
            then
                doer.components.sanity:SetPercent(0)
            end
            return onActivate_old(inst, doer, ...)
        end
    end
)

With waxwell being your character's prefab.

Link to comment
Share on other sites

1 hour ago, CarlZalph said:

@icantevenname


inst:ListenForEvent(
    "sanitydelta",
    function(inst, data)
        inst.components.combat.damagemultiplier = (1.0-inst.components.sanity:GetPercent())*2.0+1.0
    end
)

From 1.0 to 3.0 damage at 100% sanity to 0% sanity.


AddPrefabPostInit(
    "wormhole",
    function(inst)
        if not GLOBAL.TheWorld.ismastersim
        then
            return
        end
        local onActivate_old = inst.components.teleporter.onActivate
        inst.components.teleporter.onActivate = function(inst, doer, ...)
            if doer.prefab == "waxwell"
            then
                doer.components.sanity:SetPercent(0)
            end
            return onActivate_old(inst, doer, ...)
        end
    end
)

With waxwell being your character's prefab.

Thanks for the answer, but I can't use this now. Since the autocompiler isn't even compiling the character I'm working on. Can you or anyone you know help?

Nevermind, somehow I made it work again.

Edited by icantevenname
Updating
Link to comment
Share on other sites

Probably someone could help. I suggest you to make a new topic with explaination of the problem, .zip of your mod and all that could be useful. And verify first if you can't solve the problem yourself. Usually problems of compiling are because you changed something the wrong way in the character template. One option is to save your work somewhere and use a clean character template so you can at least test the code.

Anyway, when you ask very different things (like code and problem of compiling) it's better to do different topics.

Link to comment
Share on other sites

1 minute ago, Lumina said:

Probably someone could help. I suggest you to make a new topic with explaination of the problem, .zip of your mod and all that could be useful. And verify first if you can't solve the problem yourself. Usually problems of compiling are because you changed something the wrong way in the character template. One option is to save your work somewhere and use a clean character template so you can at least test the code.

Anyway, when you ask very different things (like code and problem of compiling) it's better to do different topics.

I'll keep that in mind. It's okay now, I managed to get it working.

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