how to make custom shield abilities?

can someone help?
You can have an ability in a ShieldSpecial hook and you need to check for the right shield type using player.powers[pw_shield] == SH_WHATEVER. Here's an example:
Lua:
addHook("ShieldSpecial", function(player)
    --Armageddon Shield
    if player.powers[pw_shield] == SH_ARMAGEDDON
        --do ability here
        return true
    end
    --There are special checks for Force Shield
    if player.powers[pw_shield]&SH_FORCE|SH_FORCEHP -- For full Force Shield
        --do ability here
        return true
    elseif player.powers[pw_shield]&SH_FORCE -- For 1HP Force Shield
        --do 1hp ability here
        return true
    end
end)
Hope this helps!
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top