restructure
This commit is contained in:
128
game/scripts/vscripts/modifiers/power/modifier_ability_power_yuuka.lua
Executable file
128
game/scripts/vscripts/modifiers/power/modifier_ability_power_yuuka.lua
Executable file
@@ -0,0 +1,128 @@
|
||||
modifier_ability_power_yuuka = class({})
|
||||
|
||||
local public = modifier_ability_power_yuuka
|
||||
|
||||
local m_modifier_funcs=
|
||||
{
|
||||
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL,
|
||||
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL_VALUE,
|
||||
MODIFIER_PROPERTY_COOLDOWN_REDUCTION_CONSTANT,
|
||||
}
|
||||
|
||||
local power_bonus = {
|
||||
["thtd_yuuka_03"] = {
|
||||
[1] = {
|
||||
["max_count"] = 50,
|
||||
},
|
||||
[2] = {
|
||||
["max_count"] = 100,
|
||||
},
|
||||
[3] = {
|
||||
["max_count"] = 150,
|
||||
},
|
||||
[4] = {
|
||||
["max_count"] = 400,
|
||||
},
|
||||
[5] = {
|
||||
["max_count"] = 400,
|
||||
},
|
||||
},
|
||||
["thtd_yuuka_04"] = {
|
||||
[1] = {
|
||||
["cd"] = 2,
|
||||
},
|
||||
[2] = {
|
||||
["cd"] = 4,
|
||||
},
|
||||
[3] = {
|
||||
["cd"] = 8,
|
||||
},
|
||||
[4] = {
|
||||
["cd"] = 8,
|
||||
},
|
||||
[5] = {
|
||||
["cd"] = 8,
|
||||
["power_damage"] = 5,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
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: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_yuuka_03" then
|
||||
return params.ability:GetLevelSpecialValueNoOverride(valueName, specialLevel) + power_bonus[abilityName][level][valueName]
|
||||
else
|
||||
return params.ability:GetLevelSpecialValueNoOverride(valueName, specialLevel) * power_bonus[abilityName][level][valueName]
|
||||
end
|
||||
end
|
||||
|
||||
function public:GetModifierCooldownReduction_Constant( params )
|
||||
if self:GetParent() == nil or params.ability == nil then
|
||||
return 0
|
||||
end
|
||||
|
||||
if params.ability:GetAbilityName() == "thtd_yuuka_04" then
|
||||
return power_bonus["thtd_yuuka_04"][self:GetStackCount()]["cd"] or 0
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user