Files
2HUCardTDGame/game/scripts/vscripts/modifiers/power/modifier_ability_power_koishi.lua
2021-11-10 08:48:00 -05:00

111 lines
2.1 KiB
Lua
Executable File

modifier_ability_power_koishi = class({})
local public = modifier_ability_power_koishi
local m_modifier_funcs=
{
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL,
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL_VALUE,
}
local power_bonus = {
["thtd_koishi_03"] = {
[1] = {
["self_crit"] = 1,
},
[2] = {
["self_crit"] = 2,
},
[3] = {
["self_crit"] = 3,
},
},
["thtd_koishi_04"] = {
[1] = {
["duration_time"] = 2,
},
[2] = {
["duration_time"] = 4,
},
[3] = {
["duration_time"] = 8,
},
[4] = {
["power_base"] = 1000,
["duration_time"] = 9,
},
[5] = {
["power_base"] = 1000,
["power_up"] = 300,
["duration_time"] = 9,
},
},
}
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_koishi_01" 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