Jump to content

Recommended Posts

Aiight, so here's what I'm trying to do. I'm trying to code a character so that he has a global damage penalty of 0.89. That's simple enough, just toss this in:

inst.components.combat.damagemultiplier = 0.89

HOWEVER

I'm trying to make a long-range specialist, who gets a x3 multiplier on the boomerang and the blow dart. My problem is, I don't know how to make this multiplier weapon specific! I've tried reverse engineering a handful of mods to get to to work, but it's such a nasty hodge-podge that I've finally decided to ask the much more experienced community for some pointers. How do I go about this?

    inst:ListenForEvent("equip", function()
        local equippedwep = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)
        if equippedwep ~= nil and equippedwep:HasTag("projectile") then
            inst.components.combat.damagemultiplier = 1.11
        else
            inst.components.combat.damagemultiplier = 0.89
        end
    end)

-----

If you want it for other things other than projectile, for example thrown(most thrown weapons have projectile tag too), this should work;

if equippedwep ~= nil and (equippedwep:HasTag("projectile") or equippedwep:HasTag("thrown"))  then

Edited by Aquaterion

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