me.damage = function(name, l, w)
if me.mp and me.hp then
if w[2] == "精气" then
me.mp = me.mp - tonumber(w[1]) -- 计算挨打之后剩余精气
elseif w[2] == "气血" then
me.hp = me.hp - tonumber(w[1]) -- 计算挨打之后剩余气血
end
me.full() -- 调用吃大红的方法
end
me.check() -- 调用获取当前气血的方法 hp -s
end
me.check = function()
local ct = os.time()
local lt = me.lt
if ct - lt > 1 then -- 这句话可以避免连续因调用造成被雷劈!!!
me.lt = ct
Send("hp -s")
end
end