AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")

include("shared.lua")

function ENT:Initialize()
    self:SetModel("models/props_combine/health_charger001.mdl")
    self:PhysicsInit(SOLID_VPHYSICS)
    self:SetMoveType(MOVETYPE_VPHYSICS)
    self:SetSolid(SOLID_VPHYSICS)
    self:SetUseType(SIMPLE_USE)
    
    local phys = self:GetPhysicsObject()
    if phys:IsValid() then
        phys:Wake()
    end
    
    self:SetHealth(100)
    self.MaxHealth = 100
end

function ENT:Use(activator, caller)
    if activator:IsPlayer() then
        if activator:Health() < activator:GetMaxHealth() then
            activator:SetHealth(math.min(activator:Health() + 25, activator:GetMaxHealth()))
        end
        
        if activator.IsBleeding then
            activator:StopBleeding()
        end
    end
end
