From 4cce3bb36b195148514f486e24f986c0ceb0226e Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 15 Jun 2023 14:17:48 +0800 Subject: [PATCH] =?UTF-8?q?buff=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 2 +- lua/app/userdata/battle/skill/battle_buff_entity.lua | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 3a144f3b..3b29809f 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -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 diff --git a/lua/app/userdata/battle/skill/battle_buff_entity.lua b/lua/app/userdata/battle/skill/battle_buff_entity.lua index d64456e3..d35bccfe 100644 --- a/lua/app/userdata/battle/skill/battle_buff_entity.lua +++ b/lua/app/userdata/battle/skill/battle_buff_entity.lua @@ -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 = "" .. self.showNameStr .. "" + if self:isIncreaseGain() then + self.showNameRedColor = "" .. self.showNameStr .. "" + else + self.showNameRedColor = "" .. self.showNameStr .. "" + end end if needRedColor then return self.showNameRedColor