c1_lua/lua/app/userdata/battle/skill/battle_buff_entity.lua
2023-04-20 12:06:33 +08:00

85 lines
1.7 KiB
Lua

local BattleBuffEntity = class("BattleBuffEntity", BaseData)
function BattleBuffEntity:ctor()
end
function BattleBuffEntity:init(effectParams, owner)
self.name = effectParams.type
self.effectNum = effectParams.num
self.round = effectParams.round
self.ratio = effectParams.ratio
self.owner = owner
self.targetSide = nil
self.buffInfo = ConfigManager:getConfigWithOtherKey("buff", "name")[self.name]
self.buffType = self.buffInfo.buff_type
end
function BattleBuffEntity:setOwner(owner)
self.owner = owner
end
function BattleBuffEntity:getName()
return self.name
end
function BattleBuffEntity:getDesc()
if self.desc == nil then
local buff18NInfo = I18N:getConfigWithOtherKey("buff", "name")[self.name]
if buff18NInfo then
self.desc = buff18NInfo.desc or GConst.EMPTY_STRING
else
self.desc = GConst.EMPTY_STRING
end
end
return self.desc
end
function BattleBuffEntity:getBuffType()
return self.buffType
end
function BattleBuffEntity:getEffectNum()
return self.effectNum
end
function BattleBuffEntity:setEffectNum(num)
self.effectNum = num
end
function BattleBuffEntity:getFormula()
return self.buffInfo.formula
end
function BattleBuffEntity:getRatio()
return self.ratio
end
function BattleBuffEntity:setRatio(ratio)
self.ratio = ratio
end
function BattleBuffEntity:getRound()
return self.round
end
function BattleBuffEntity:setRound(num)
self.round = num
end
function BattleBuffEntity:getBuffHitFxId()
return nil
end
function BattleBuffEntity:getTartgetSide()
return self.targetSide
end
function BattleBuffEntity:setTargetSide(side)
self.targetSide = side
end
function BattleBuffEntity:getIcon()
return self.buffInfo.icon
end
return BattleBuffEntity