2021-04-20 13:58:00 +08:00
|
|
|
|
BuffCtrl = {}
|
2020-11-01 15:46:48 +08:00
|
|
|
|
|
|
|
|
|
local BuffTypeToConfigType = {
|
|
|
|
|
[BuffName.PropertyChange] = 1,
|
|
|
|
|
[BuffName.Control] = 2,
|
|
|
|
|
[BuffName.DOT] = 3,
|
|
|
|
|
[BuffName.HOT] = 4,
|
|
|
|
|
[BuffName.Shield] = 5,
|
|
|
|
|
[BuffName.Immune] = 6,
|
|
|
|
|
[BuffName.Curse] = 7,
|
2020-12-30 14:29:06 +08:00
|
|
|
|
[BuffName.KylinMark] = 8,
|
|
|
|
|
[BuffName.Exile] = 9,
|
2021-09-30 09:53:31 +08:00
|
|
|
|
[BuffName.Blood] = 10,
|
2021-11-17 15:01:24 +08:00
|
|
|
|
[BuffName.BanBlood] = 11,
|
2021-12-03 18:53:48 +08:00
|
|
|
|
[BuffName.SigilSign] = 12,
|
|
|
|
|
[BuffName.CommonSign] = 13,
|
2021-12-09 14:25:02 +08:00
|
|
|
|
[BuffName.BreakArmor] = 14,
|
2022-04-19 17:23:37 +08:00
|
|
|
|
[BuffName.AddAttack] = 15,
|
2022-08-03 14:20:57 +08:00
|
|
|
|
[BuffName.Suppress] = 16,
|
2023-02-15 18:48:53 +08:00
|
|
|
|
[BuffName.BuDongSign] = 17,
|
2023-04-06 14:02:32 +08:00
|
|
|
|
[BuffName.FalseNoDead] = 18,
|
|
|
|
|
[BuffName.SuckBlood] =19,
|
2020-11-01 15:46:48 +08:00
|
|
|
|
}
|
|
|
|
|
local function _GetPropChangeBuffCType(pName)
|
|
|
|
|
for cType, pn in ipairs(BattlePropList) do
|
|
|
|
|
if pn == pName then
|
|
|
|
|
return cType
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
local function _GetBuffEffectConfig(buff)
|
|
|
|
|
local bType = buff.type
|
|
|
|
|
local cType = 1
|
|
|
|
|
if bType == BuffName.PropertyChange then
|
|
|
|
|
cType = _GetPropChangeBuffCType(buff.propertyName)
|
|
|
|
|
elseif bType == BuffName.HOT then
|
2021-10-20 21:33:37 +08:00
|
|
|
|
--cType = 1
|
|
|
|
|
cType = buff.hotType
|
2020-11-01 15:46:48 +08:00
|
|
|
|
elseif bType == BuffName.DOT then
|
|
|
|
|
cType = buff.damageType
|
|
|
|
|
elseif bType == BuffName.Brand then
|
|
|
|
|
cType = buff.flag
|
|
|
|
|
elseif bType == BuffName.Control then
|
|
|
|
|
cType = buff.ctrlType
|
|
|
|
|
elseif bType == BuffName.Shield then
|
|
|
|
|
cType = buff.shieldType
|
|
|
|
|
-- 无敌吸血盾特殊判断
|
|
|
|
|
if cType == ShieldTypeName.AllReduce and buff.shieldValue ~= 0 then
|
|
|
|
|
cType = 4
|
|
|
|
|
end
|
|
|
|
|
elseif bType == BuffName.Immune then
|
|
|
|
|
cType = buff.immuneType
|
|
|
|
|
elseif bType == BuffName.Curse then
|
|
|
|
|
cType = buff.curseType
|
2020-12-30 14:29:06 +08:00
|
|
|
|
elseif bType== BuffName.KylinMark then
|
|
|
|
|
cType = 1
|
|
|
|
|
elseif bType== BuffName.Exile then
|
|
|
|
|
cType = 1
|
2021-08-12 15:11:38 +08:00
|
|
|
|
elseif bType== BuffName.Blood then
|
|
|
|
|
cType = 1
|
2021-11-17 15:01:24 +08:00
|
|
|
|
elseif bType==BuffName.BanBlood then
|
|
|
|
|
cType = 1
|
2021-12-02 17:42:31 +08:00
|
|
|
|
elseif bType==BuffName.SigilSign then
|
2023-02-15 18:48:53 +08:00
|
|
|
|
cType = 1
|
|
|
|
|
elseif bType==BuffName.BuDongSign then
|
2021-12-03 17:17:47 +08:00
|
|
|
|
cType = 1
|
|
|
|
|
elseif bType==BuffName.CommonSign then
|
2021-12-09 14:25:02 +08:00
|
|
|
|
cType = 1
|
|
|
|
|
elseif bType==BuffName.BreakArmor then
|
|
|
|
|
cType=buff.signType
|
2022-08-03 14:20:57 +08:00
|
|
|
|
elseif bType==BuffName.Suppress then
|
|
|
|
|
cType=1
|
2021-12-09 14:25:02 +08:00
|
|
|
|
else
|
|
|
|
|
cType = 1
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local type = BuffTypeToConfigType[bType]
|
|
|
|
|
local config = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.BuffEffectConfig, "Type", type, "CType", cType)
|
|
|
|
|
return config
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function BuffCtrl.New(unit, buffRoot)
|
|
|
|
|
local o = {}
|
|
|
|
|
setmetatable(o, {__index = BuffCtrl})
|
|
|
|
|
o:ctor(unit, buffRoot)
|
|
|
|
|
return o
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:ctor(unit, buffRoot)
|
2021-01-26 17:08:39 +08:00
|
|
|
|
-- LogPink("Buffctrl "..unit.camp.."|"..unit.role.position)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
self.owner = unit
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffStart, self.OnBuffStart, self)
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffCover, self.OnBuffCover, self)
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffTrigger, self.OnBuffTrigger, self)
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffEnd, self.OnBuffEnd, self)
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffDodge, self.OnBuffDodge, self)
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffRoundChange, self.OnBuffRoundChange, self)
|
|
|
|
|
self.owner.role.Event:AddEvent(BattleEventName.BuffDurationChange, self.OnBuffRoundChange, self)
|
|
|
|
|
|
|
|
|
|
self.buffRoot = buffRoot
|
|
|
|
|
self.BuffIconList = {}
|
|
|
|
|
self.BuffEffectList = {}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:Update()
|
|
|
|
|
for k, v in pairs(self.BuffIconList) do
|
|
|
|
|
v:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 加载并播放动画
|
|
|
|
|
function BuffCtrl:AddBuffEffect(buffName, isTrigger, offset)
|
|
|
|
|
if not buffName or buffName == "" then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if not self.BuffEffectList then
|
|
|
|
|
self.BuffEffectList = {}
|
|
|
|
|
end
|
|
|
|
|
if not self.BuffEffectList[buffName] then
|
|
|
|
|
self.BuffEffectList[buffName] = {}
|
|
|
|
|
self.BuffEffectList[buffName].node = nil
|
|
|
|
|
self.BuffEffectList[buffName].count = 0
|
|
|
|
|
end
|
|
|
|
|
--
|
|
|
|
|
if not self.BuffEffectList[buffName].node then
|
2021-11-25 14:46:46 +08:00
|
|
|
|
local sortingOrder = self.owner.GameObject:GetComponent("Canvas").sortingOrder
|
|
|
|
|
-- if self.owner.camp == 0 then
|
|
|
|
|
-- sortingOrder = self.owner.GameObject:GetComponent("Canvas").sortingOrder
|
|
|
|
|
-- --混乱特效因为贴图不显示特殊处理
|
|
|
|
|
-- if buffName=="TongYong_Effect_buff_hunluan_1" then
|
|
|
|
|
-- sortingOrder=sortingOrder+1
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
-- --混乱特效因为贴图不显示特殊处理
|
|
|
|
|
-- if sortingOrder==nil and buffName=="TongYong_Effect_buff_hunluan_1" then
|
|
|
|
|
-- sortingOrder=BattleManager.GetBattleSorting()+1
|
|
|
|
|
-- end
|
2021-11-26 14:27:58 +08:00
|
|
|
|
local node = BattleManager.LoadAsset(buffName)
|
|
|
|
|
Util.SetParticleSortLayer(node, sortingOrder - 1) -- buff特效比血条低一个层级
|
|
|
|
|
node.name = tostring(sortingOrder - 1)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
-- node.transform:SetParent(self.RootPanel.transform)
|
|
|
|
|
-- node.transform.localScale = Vector3.one
|
|
|
|
|
node.transform:SetParent(self.owner.GameObject.transform)
|
|
|
|
|
node.transform.localScale = Vector3.one
|
2021-11-26 17:20:28 +08:00
|
|
|
|
node.transform.localPosition = offset and Vector3.New(offset[1], offset[2] + 50, 0) or Vector3.New(0, 50, 0)--self.GameObject.transform.localPosition
|
2020-11-01 15:46:48 +08:00
|
|
|
|
self.BuffEffectList[buffName].node = node
|
|
|
|
|
end
|
|
|
|
|
self.BuffEffectList[buffName].node:SetActive(false)
|
|
|
|
|
self.BuffEffectList[buffName].node:SetActive(true)
|
|
|
|
|
-- 触发特效不计数
|
|
|
|
|
if not isTrigger then
|
|
|
|
|
self.BuffEffectList[buffName].count = self.BuffEffectList[buffName].count + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- 卸载动画
|
|
|
|
|
function BuffCtrl:RemoveBuffEffect(buffName)
|
|
|
|
|
if not buffName or buffName == "" then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if not self.BuffEffectList then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if not self.BuffEffectList[buffName] then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if not self.BuffEffectList[buffName].node then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
-- 节点存在,数量不存在直接回收
|
|
|
|
|
if not self.BuffEffectList[buffName].count then
|
|
|
|
|
poolManager:UnLoadAsset(buffName, self.BuffEffectList[buffName].node, PoolManager.AssetType.GameObject)
|
|
|
|
|
self.BuffEffectList[buffName] = nil
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
-- 引用数量减1
|
|
|
|
|
self.BuffEffectList[buffName].count = self.BuffEffectList[buffName].count - 1
|
|
|
|
|
if self.BuffEffectList[buffName].count <= 0 then
|
|
|
|
|
poolManager:UnLoadAsset(buffName, self.BuffEffectList[buffName].node, PoolManager.AssetType.GameObject)
|
|
|
|
|
self.BuffEffectList[buffName] = nil
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- 卸载所有动画
|
|
|
|
|
function BuffCtrl:RemoveAllBuffEffect()
|
|
|
|
|
if not self.BuffEffectList then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
for name, v in pairs(self.BuffEffectList) do
|
|
|
|
|
poolManager:UnLoadAsset(name, v.node, PoolManager.AssetType.GameObject)
|
|
|
|
|
end
|
|
|
|
|
self.BuffEffectList = {}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
function BuffCtrl:AddBuffIcon(buff, icon)
|
2021-03-12 11:04:06 +08:00
|
|
|
|
local currBuff=buff
|
|
|
|
|
if not currBuff or not icon or icon == "" then
|
2020-11-01 15:46:48 +08:00
|
|
|
|
return
|
|
|
|
|
end
|
2021-03-12 11:04:06 +08:00
|
|
|
|
|
2020-11-01 15:46:48 +08:00
|
|
|
|
if not self.BuffIconList then
|
|
|
|
|
self.BuffIconList = {}
|
|
|
|
|
end
|
2021-03-12 11:04:06 +08:00
|
|
|
|
-- if not self.BuffIconList[buff.id] then
|
|
|
|
|
-- local buffGO = BattlePool.GetItem(self.buffRoot.transform, BATTLE_POOL_TYPE.BUFF_VIEW)
|
|
|
|
|
-- buffGO.transform.localScale = Vector3.one
|
|
|
|
|
-- buffGO.transform.localPosition = Vector3.zero
|
|
|
|
|
-- buffGO:SetActive(true)
|
|
|
|
|
-- self.BuffIconList[buff.id] = BuffView.New(buffGO, buff, icon)
|
|
|
|
|
-- else
|
|
|
|
|
-- self.BuffIconList[buff.id].count = self.BuffIconList[buff.id].count + 1
|
|
|
|
|
-- self.BuffIconList[buff.id]:SetCount()
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
LogRed(buff.id)
|
|
|
|
|
if not self.BuffIconList[currBuff.id] then
|
|
|
|
|
--便利所有之前存在的buff图标,有同类型,同数值的叠加,否则新建
|
|
|
|
|
for key, value in pairs(self.BuffIconList) do
|
|
|
|
|
local buffType=self.BuffIconList[key].buff.type
|
|
|
|
|
if currBuff.type == self.BuffIconList[key].buff.type then
|
|
|
|
|
if buffType == BuffName.PropertyChange then
|
|
|
|
|
--属性 判断属性类型,属性值,属性修改类型
|
|
|
|
|
local b = self.BuffIconList[key].buff
|
|
|
|
|
if self.BuffIconList[key].buffPropertyName == currBuff.propertyName and self.BuffIconList[key].buffCt == currBuff.changeType and self.BuffIconList[key].buffValue == currBuff.Value then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--持续伤害类型,伤害系数
|
|
|
|
|
elseif buffType==BuffName.DOT then
|
2021-12-06 09:40:51 +08:00
|
|
|
|
if self.BuffIconList[key].buffDamageType==currBuff.damageType and self.BuffIconList[key].buffDamageFactor==currBuff.damagePro then
|
2021-03-12 11:04:06 +08:00
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--控制类型
|
|
|
|
|
elseif buffType == BuffName.Control then
|
|
|
|
|
if self.BuffIconList[key].buffCtrlType==currBuff.ctrlType then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
elseif buffType == BuffName.HOT then
|
|
|
|
|
if self.BuffIconList[key].healValue==currBuff.healValue then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-03-16 20:25:24 +08:00
|
|
|
|
elseif buffType == BuffName.Immune then
|
|
|
|
|
if self.BuffIconList[key].immuneType==currBuff.immuneType then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
elseif buffType == BuffName.Curse then
|
|
|
|
|
if self.BuffIconList[key].curseType==currBuff.curseType then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-12-09 14:25:02 +08:00
|
|
|
|
elseif buffType ==BuffName.BreakArmor then
|
|
|
|
|
if self.BuffIconList[key].buffSignType==currBuff.signType then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
|
|
|
|
end
|
2022-08-03 14:20:57 +08:00
|
|
|
|
elseif buffType ==BuffName.Suppress then
|
|
|
|
|
-- if self.BuffIconList[key].buffSignType==currBuff.signType then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
2023-02-24 11:02:14 +08:00
|
|
|
|
elseif buffType ==BuffName.BuDongSign then
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
2023-04-06 14:02:32 +08:00
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1)
|
|
|
|
|
return
|
2021-03-12 11:04:06 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
2021-03-12 11:04:06 +08:00
|
|
|
|
|
2020-11-01 15:46:48 +08:00
|
|
|
|
|
2021-03-12 11:04:06 +08:00
|
|
|
|
local buffGO = BattlePool.GetItem(self.buffRoot.transform, BATTLE_POOL_TYPE.BUFF_VIEW)
|
|
|
|
|
buffGO.transform.localScale = Vector3.one
|
|
|
|
|
buffGO.transform.localPosition = Vector3.zero
|
|
|
|
|
buffGO:SetActive(true)
|
|
|
|
|
self.BuffIconList[currBuff.id] = BuffView.New(buffGO, buff, icon)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
|
|
|
|
function BuffCtrl:RemoveBuffIcon(buff)
|
|
|
|
|
if not buff then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if not self.BuffIconList then
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-03-27 12:37:50 +08:00
|
|
|
|
LogRed(buff.id.." type "..tostring(buff.type))
|
2021-03-12 11:04:06 +08:00
|
|
|
|
-- if self.BuffIconList[buff.id] then
|
|
|
|
|
-- local count=self.BuffIconList[buff.id].count
|
|
|
|
|
-- if count==1 then
|
|
|
|
|
-- self.BuffIconList[buff.id]:Dispose()
|
|
|
|
|
-- self.BuffIconList[buff.id] = nil
|
|
|
|
|
-- else
|
|
|
|
|
-- self.BuffIconList[buff.id]:SetCount(count-1)
|
|
|
|
|
-- end
|
|
|
|
|
-- return
|
|
|
|
|
-- end
|
|
|
|
|
|
2021-04-02 11:34:27 +08:00
|
|
|
|
--便利所有之前存在的buff图标,有同类型,同数值的叠加,否则新建
|
|
|
|
|
for key, value in pairs(self.BuffIconList) do
|
|
|
|
|
local buffType = self.BuffIconList[key].buff.type
|
|
|
|
|
local floor = self.BuffIconList[key].count
|
|
|
|
|
|
|
|
|
|
if buff.type == buffType then
|
|
|
|
|
if buffType == BuffName.PropertyChange then
|
|
|
|
|
--属性 判断属性类型,属性值,属性修改类型
|
|
|
|
|
if self.BuffIconList[key].buffPropertyName==buff.propertyName and self.BuffIconList[key].buffValue==buff.Value and self.BuffIconList[key].buffCt==buff.changeType then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--持续伤害类型,伤害系数
|
|
|
|
|
elseif buffType == BuffName.DOT then
|
2021-12-06 09:40:51 +08:00
|
|
|
|
if self.BuffIconList[key].buffDamageType==buff.damageType and self.BuffIconList[key].buffDamageFactor==buff.damagePro then
|
2021-04-02 11:34:27 +08:00
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--控制类型
|
|
|
|
|
elseif buffType == BuffName.Control then
|
|
|
|
|
if self.BuffIconList[key].buffCtrlType==buff.ctrlType then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
elseif buffType == BuffName.HOT then
|
|
|
|
|
if self.BuffIconList[key].healValue==buff.healValue then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
2021-03-12 11:04:06 +08:00
|
|
|
|
end
|
2021-04-02 11:34:27 +08:00
|
|
|
|
elseif buffType == BuffName.Immune then
|
|
|
|
|
if self.BuffIconList[key].immuneType==buff.immuneType then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
elseif buffType == BuffName.Curse then
|
2021-12-09 14:25:02 +08:00
|
|
|
|
if self.BuffIconList[key].curseType==buff.curseType then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
elseif buffType == BuffName.BreakArmor then
|
|
|
|
|
if self.BuffIconList[key].buffSignType==buff.signType then
|
2021-04-02 11:34:27 +08:00
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
2022-08-03 14:20:57 +08:00
|
|
|
|
elseif buffType == BuffName.Suppress then
|
|
|
|
|
--if self.BuffIconList[key].buffSignType==buff.signType then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
--end
|
2023-02-24 11:02:14 +08:00
|
|
|
|
elseif buffType == BuffName.BuDongSign then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
2023-04-06 14:02:32 +08:00
|
|
|
|
elseif buffType == BuffName.FalseNoDead then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
elseif buffType == BuffName.SuckBlood then
|
|
|
|
|
if floor==1 then
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:SetCount(floor-1)
|
|
|
|
|
end
|
|
|
|
|
return
|
2021-12-06 13:18:50 +08:00
|
|
|
|
else
|
|
|
|
|
self.BuffIconList[key]:Dispose()
|
|
|
|
|
self.BuffIconList[key] = nil
|
2021-04-02 11:34:27 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
|
|
|
|
-- 卸载所有动画
|
|
|
|
|
function BuffCtrl:RemoveAllBuffIcon()
|
|
|
|
|
if not self.BuffIconList then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
for id, v in pairs(self.BuffIconList) do
|
|
|
|
|
v:Dispose()
|
|
|
|
|
end
|
|
|
|
|
self.BuffIconList = {}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:OnBuffStart(buff)
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen("buff"..buff.type)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
-- 临时显示
|
|
|
|
|
if buff.type == BuffName.NoDead then
|
2021-06-30 10:40:52 +08:00
|
|
|
|
self.owner.Floater:ImageBuffFloating("z_zhandou_bumie_zh")
|
2020-11-01 15:46:48 +08:00
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local eConfig = _GetBuffEffectConfig(buff)
|
|
|
|
|
if not eConfig then return end
|
|
|
|
|
|
|
|
|
|
if buff.type == BuffName.PropertyChange then
|
|
|
|
|
if buff.changeType == 1 or buff.changeType == 2 then
|
|
|
|
|
self:AddBuffEffect(eConfig.Hit)
|
|
|
|
|
self:AddBuffEffect(eConfig.Continue, false, eConfig.ContinueOffset)
|
2021-06-30 10:40:52 +08:00
|
|
|
|
--self.owner.Floater:TextBuffFloating(eConfig.DescColorType, GetLanguageStrById(eConfig.Describe)..Language[10237])
|
|
|
|
|
self.owner.Floater:ImageBuffFloating(eConfig.DescribeIcon,nil,nil,1)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
self:AddBuffIcon(buff, eConfig.Icon)
|
|
|
|
|
SoundManager.PlaySound(SoundConfig.Sound_Buff)
|
|
|
|
|
else
|
|
|
|
|
self:AddBuffEffect(eConfig.DHit)
|
|
|
|
|
self:AddBuffEffect(eConfig.DContinue)
|
2021-06-30 10:40:52 +08:00
|
|
|
|
--self.owner.Floater:TextBuffFloating(eConfig.DDescColorType, GetLanguageStrById(eConfig.Describe)..Language[10238])
|
2022-03-14 17:10:15 +08:00
|
|
|
|
--self.owner.Floater:ImageBuffFloating(eConfig.DescribeIcon,nil,nil,2)
|
|
|
|
|
if eConfig.DescribeIcon and eConfig.DescribeIcon ~= "" then
|
|
|
|
|
self.owner.Floater:ImageBuffFloating(eConfig.DescribeIcon,nil,nil,2)
|
|
|
|
|
else
|
|
|
|
|
-- LogError("econif des=="..eConfig.Describe)
|
|
|
|
|
self.owner.Floater:TextBuffFloating(eConfig.DescColorType, GetLanguageStrById(eConfig.Describe))
|
|
|
|
|
end
|
2020-11-01 15:46:48 +08:00
|
|
|
|
self:AddBuffIcon(buff, eConfig.DIcon)
|
|
|
|
|
SoundManager.PlaySound(SoundConfig.Sound_DeBuff)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
self:AddBuffEffect(eConfig.Hit)
|
|
|
|
|
self:AddBuffEffect(eConfig.Continue, false, eConfig.ContinueOffset)
|
2021-07-07 20:29:37 +08:00
|
|
|
|
--一个伤害打死目标,同时被上buff 不显示buff提示(除非目标有不灭,死亡技能) change by:wangzhenxing,shihongyi 2021/7/7
|
|
|
|
|
if not self.owner.role:IsDead() or not self.owner.role:IsCanDead() or self.owner.role.isHaveNoDead then
|
|
|
|
|
if eConfig.DescribeIcon and eConfig.DescribeIcon ~= "" then
|
|
|
|
|
self.owner.Floater:ImageBuffFloating(eConfig.DescribeIcon)
|
|
|
|
|
else
|
2022-03-14 17:10:15 +08:00
|
|
|
|
|
|
|
|
|
-- LogError("econif des=="..eConfig.Describe)
|
2021-07-07 20:29:37 +08:00
|
|
|
|
self.owner.Floater:TextBuffFloating(eConfig.DescColorType, GetLanguageStrById(eConfig.Describe))
|
|
|
|
|
end
|
|
|
|
|
self:AddBuffIcon(buff, eConfig.Icon)
|
|
|
|
|
--else
|
|
|
|
|
-- LogError("//////////")
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
function BuffCtrl:OnBuffDodge(buff)
|
|
|
|
|
if buff.type == BuffName.Control and buff.caster.camp ~= self.owner.camp then
|
2021-01-26 17:08:39 +08:00
|
|
|
|
self.owner.Floater:ImageBuffFloating("z_zhandou_dikangzi_zh")
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
function BuffCtrl:OnBuffRoundChange(buff)
|
|
|
|
|
if self.BuffIconList[buff.id] then
|
|
|
|
|
self.BuffIconList[buff.id]:SetRound(buff)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:OnBuffCover(buff)
|
|
|
|
|
if self.BuffIconList[buff.id] then
|
|
|
|
|
self.BuffIconList[buff.id]:SetLayer(buff)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:OnBuffTrigger(buff)
|
|
|
|
|
local eConfig = _GetBuffEffectConfig(buff)
|
|
|
|
|
if not eConfig then return end
|
|
|
|
|
if buff.type == BuffName.PropertyChange then
|
|
|
|
|
if buff.changeType == 1 or buff.changeType == 2 then
|
|
|
|
|
self:AddBuffEffect(eConfig.Trigger, true)
|
|
|
|
|
else
|
|
|
|
|
self:AddBuffEffect(eConfig.DTrigger, true)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
self:AddBuffEffect(eConfig.Trigger, true)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:OnBuffEnd(buff)
|
|
|
|
|
-- 临时显示
|
|
|
|
|
if buff.type == BuffName.NoDead then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local eConfig = _GetBuffEffectConfig(buff)
|
|
|
|
|
if not eConfig then return end
|
|
|
|
|
|
|
|
|
|
if buff.type == BuffName.PropertyChange then
|
|
|
|
|
if buff.changeType == 1 or buff.changeType == 2 then
|
|
|
|
|
self:RemoveBuffEffect(eConfig.Hit)
|
|
|
|
|
self:RemoveBuffEffect(eConfig.Continue)
|
|
|
|
|
self:RemoveBuffEffect(eConfig.Trigger)
|
|
|
|
|
self:RemoveBuffIcon(buff, eConfig.Icon)
|
|
|
|
|
else
|
|
|
|
|
self:RemoveBuffEffect(eConfig.DHit)
|
|
|
|
|
self:RemoveBuffEffect(eConfig.DContinue)
|
|
|
|
|
self:RemoveBuffEffect(eConfig.DTrigger)
|
|
|
|
|
self:RemoveBuffIcon(buff, eConfig.DIcon)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
self:RemoveBuffEffect(eConfig.Hit)
|
|
|
|
|
self:RemoveBuffEffect(eConfig.Continue)
|
|
|
|
|
self:RemoveBuffEffect(eConfig.Trigger)
|
|
|
|
|
self:RemoveBuffIcon(buff, eConfig.Icon)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function BuffCtrl:Dispose()
|
|
|
|
|
|
|
|
|
|
-- 回收所有buff相关效果
|
|
|
|
|
self:RemoveAllBuffEffect()
|
|
|
|
|
self:RemoveAllBuffIcon()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return BuffCtrl
|