initial commit
This commit is contained in:
117
scripts/vscripts/modifiers/power/modifier_ability_power_minoriko.lua
Executable file
117
scripts/vscripts/modifiers/power/modifier_ability_power_minoriko.lua
Executable file
@@ -0,0 +1,117 @@
|
||||
modifier_ability_power_minoriko = class({})
|
||||
|
||||
local public = modifier_ability_power_minoriko
|
||||
|
||||
local m_modifier_funcs=
|
||||
{
|
||||
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL,
|
||||
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL_VALUE,
|
||||
}
|
||||
|
||||
local power_bonus = {
|
||||
["thtd_minoriko_01"] = {
|
||||
[1] = {
|
||||
["grow_time"] = 10,
|
||||
},
|
||||
[2] = {
|
||||
["grow_time"] = 20,
|
||||
},
|
||||
[3] = {
|
||||
["grow_time"] = 30,
|
||||
},
|
||||
},
|
||||
["thtd_minoriko_02"] = {
|
||||
[1] = {
|
||||
["max_count"] = 1,
|
||||
},
|
||||
[2] = {
|
||||
["max_count"] = 2,
|
||||
},
|
||||
[3] = {
|
||||
["max_count"] = 3,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
function public:IsHidden()
|
||||
return true
|
||||
end
|
||||
|
||||
function public:IsPermanent()
|
||||
return true
|
||||
end
|
||||
|
||||
function public:RemoveOnDeath()
|
||||
return false
|
||||
end
|
||||
|
||||
function public:IsDebuff()
|
||||
return false
|
||||
end
|
||||
|
||||
function public:IsPurgable()
|
||||
return false
|
||||
end
|
||||
|
||||
function public:DeclareFunctions()
|
||||
return m_modifier_funcs
|
||||
end
|
||||
|
||||
-- function public:OnCreated( kv )
|
||||
-- if not IsServer() then return end
|
||||
-- self:OnRefresh( kv )
|
||||
-- end
|
||||
|
||||
-- function public:OnRefresh( kv )
|
||||
-- if not IsServer() then return end
|
||||
-- end
|
||||
|
||||
-- function public:OnDestroy(kv)
|
||||
-- if not IsServer() then return end
|
||||
-- end
|
||||
|
||||
function public:GetModifierOverrideAbilitySpecial( params )
|
||||
if self:GetParent() == nil or params.ability == nil then
|
||||
return 0
|
||||
end
|
||||
|
||||
local abilityName = params.ability:GetAbilityName()
|
||||
local level = self:GetStackCount()
|
||||
local valueName = params.ability_special_value
|
||||
|
||||
if power_bonus[abilityName] == nil then
|
||||
return 0
|
||||
end
|
||||
|
||||
if power_bonus[abilityName][level] == nil then
|
||||
level = 3
|
||||
end
|
||||
if power_bonus[abilityName][level] == nil then
|
||||
return 0
|
||||
end
|
||||
|
||||
if power_bonus[abilityName][level][valueName] == nil then
|
||||
return 0
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
||||
|
||||
function public:GetModifierOverrideAbilitySpecialValue( params )
|
||||
local abilityName = params.ability:GetAbilityName()
|
||||
local level = self:GetStackCount()
|
||||
local valueName = params.ability_special_value
|
||||
local specialLevel = params.ability_special_level
|
||||
|
||||
if power_bonus[abilityName][level] == nil then
|
||||
level = 3
|
||||
end
|
||||
|
||||
if abilityName == "thtd_minoriko_01" then
|
||||
return math.floor(params.ability:GetLevelSpecialValueNoOverride(valueName, specialLevel) * (1 - power_bonus[abilityName][level][valueName]/100))
|
||||
elseif abilityName == "thtd_minoriko_02" then
|
||||
-- local bonus = math.max(0, math.floor((self:GetParent():GetPhysicalArmorBaseValue() - 100)/50))
|
||||
-- return params.ability:GetLevelSpecialValueNoOverride(valueName, specialLevel) + power_bonus[abilityName][level][valueName] + bonus
|
||||
return math.floor(params.ability:GetLevelSpecialValueNoOverride(valueName, specialLevel) + power_bonus[abilityName][level][valueName]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user