buff显示修改

This commit is contained in:
xiekaidong 2023-06-15 14:17:48 +08:00
parent b951d8d2b7
commit 4cce3bb36b
2 changed files with 10 additions and 2 deletions

View File

@ -1487,7 +1487,7 @@ function BattleUnitComp:takeEffect(buff, target, conditionResult)
end
end
if self.unitEntity:getIsFrozen() and buff:getDecr() == BattleConst.BUFF_DECR_TYPE.INCREASE_GAIN then -- 冻结状态缓存增益buff
if self.unitEntity:getIsFrozen() and buff:isIncreaseGain() then -- 冻结状态缓存增益buff
if buff:getRound() > 0 then
local buffEffect = BattleHelper:getBuffEffect()
buffEffect.buff = buff

View File

@ -90,6 +90,10 @@ function BattleBuffEntity:getDecr()
return self.buffInfo.decr
end
function BattleBuffEntity:isIncreaseGain()
return self:getDecr() == BattleConst.BUFF_DECR_TYPE.INCREASE_GAIN
end
function BattleBuffEntity:getIcon()
return self.buffInfo.icon
end
@ -115,7 +119,11 @@ function BattleBuffEntity:getShowName(needRedColor)
self.showNameStr = I18N:getTextWithOtherKey("buff", "name", self:getName(), "show_name")
end
if not self.showNameRedColor and self.showNameStr then
self.showNameRedColor = "<color=#E35F6A>" .. self.showNameStr .. "</color>"
if self:isIncreaseGain() then
self.showNameRedColor = "<color=#4bff33>" .. self.showNameStr .. "</color>"
else
self.showNameRedColor = "<color=#ff5dfd>" .. self.showNameStr .. "</color>"
end
end
if needRedColor then
return self.showNameRedColor