Jump to content

Ignore Defense/Armor


Recommended Posts

You could set the damage to 0 and do this:

local function OnAttack(inst,attacker,target)
    if target and target.components.health then
        target.components.health:DoDelta(-20)--replace it with the damage you would like it make
    end
end

--fn()
inst.components.weapon:SetOnAttack(OnAttack)

 

Link to comment
Share on other sites

Posted (edited)
On 3/30/2022 at 5:07 AM, Monti18 said:

You could set the damage to 0 and do this:


local function OnAttack(inst,attacker,target)
    if target and target.components.health then
        target.components.health:DoDelta(-20)--replace it with the damage you would like it make
    end
end

--fn()
inst.components.weapon:SetOnAttack(OnAttack)

 

Nope, the damage is still reduced. Not to mention the stun animation doesn't play at all.

Though, if you take out the minus, you could make something that beats someone to life.

 

Just thought of something, is there a way to force the stun animation every hit?

Edited by icantevenname
Link to comment
Share on other sites

Try it with this:

local function OnAttack(inst,attacker,target)
    if target and target.components.health then
    	local old_val = target.components.health.currenthealth
        target.components.health:SetVal(old_val - 20)	--replace it with the damage you would like it make
        target:PushEvent("attacked", { attacker = attacker, damage = 0, weapon = inst })
    end
end

--fn()
inst.components.weapon:SetOnAttack(OnAttack)

This should set the value of the health directly to one minus the damage of the weapon.
Not tested, but I think you can just push the event attacked like the fire and icestaff do to have the target play the stun animation.

Not sure about the forcing stunlock each hit, I think if you add stimuli = "stun" to the PushEvent, it will stun every hit. 

target:PushEvent("attacked", { attacker = attacker, damage = 0, weapon = inst, stimuli = "stun" })

 

Edited by Monti18
  • Thanks 1
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...