initial commit

This commit is contained in:
2021-10-24 15:36:18 -04:00
commit b9a5a8fe23
11982 changed files with 220468 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
modifier_bosses_random_health_effect = class({})
local public = modifier_bosses_random_health_effect
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return false
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
--------------------------------------------------------------------------------
function public:OnCreated(kv)
if IsServer() then
local caster = self:GetParent()
if caster.random_boss_health_buff ~= true then
caster.random_boss_health_buff = true
local health = math.min(MAX_HEALTH, caster:GetMaxHealth()*1.25)
caster.random_health_factor = health/caster:GetMaxHealth()
caster:SetBaseMaxHealth(health)
caster:SetMaxHealth(health)
caster:SetHealth(caster:GetHealth()*caster.random_health_factor)
end
end
end
function public:OnDestroy(kv)
if IsServer() then
local caster = self:GetParent()
if caster.random_boss_health_buff == true and caster.random_health_factor ~= nil then
local health = caster:GetMaxHealth()/caster.random_health_factor
caster:SetBaseMaxHealth(health)
caster:SetMaxHealth(health)
caster:SetHealth(caster:GetHealth()/caster.random_health_factor)
caster.random_boss_health_buff = false
end
end
end
--------------------------------------------------------------------------------
function public:GetTexture()
return "random_boss_buff_health"
end