components/health.lua
43444546474849
else
self.penalty = SaveGameIndex:GetResurrectorPenalty()
end
self:DoDelta(0)
end
434445464748
else
self.penalty = SaveGameIndex:GetResurrectorPenalty()
end
self:DoDelta(0)
end
5152535455565758596061
function Health:OnLoad(data)
self.penalty = data.penalty or self.penalty
if data.health then
self:SetVal(data.health, "loading")
self:DoDelta(0) --to update hud
elseif data.percent then
-- used for setpieces!
self:SetPercent(data.percent, "loading")
self:DoDelta(0) --to update hud
end
end
5051525354555657585960
function Health:OnLoad(data)
self.penalty = data.penalty or self.penalty
if data.health then
self:SetVal(data.health, "file_load")
self:DoDelta(0) --to update hud
elseif data.percent then
-- used for setpieces!
self:SetPercent(data.percent, "file_load")
self:DoDelta(0) --to update hud
end
end
213214215216217218219
end
function Health:SetVal(val, cause)
local old_percent = self:GetPercent()
self.currenthealth = val
212213214215216217
end
function Health:SetVal(val, cause)
local old_percent = self:GetPercent()
self.currenthealth = val