aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/sh_buff.lua
blob: ac46df99446a6e447e48e7ca1f53798ecc81c789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--This was probably a mistake
do return end

local pmeta = FindMetaTable("Player")

pmeta.buffs = {}
local buffid = 0
function pmeta:ApplyBuff(buff)
    if self.buffs[buff.type] == nil then
        self.buffs[buff.type] = {}
    end
    local id = buffid
    buffid = buffid + 1
    self.buffs[buff.type][id] = buff
    self.buffs[id] = buff.type
    return id
end

function pmeta:RemoveBuff(buffid)
    local bufftype = self.buffs[buffid]
    self.buffs[buff.type][buffid] = nil
    self.buffs[buffid] = nil
end

hook.Add("EntityTakeDamage","arterybuffs",function(ent,info)

end)

--[[
    Add buff types here I guess
]]