diff --git a/lua/app/config/buff.lua b/lua/app/config/buff.lua index bbfcaa6d..a562cfec 100644 --- a/lua/app/config/buff.lua +++ b/lua/app/config/buff.lua @@ -395,7 +395,7 @@ local buff = { ["id"]=48, ["name"]="burn", ["buff_type"]=4, - ["stack"]=1, + ["stack"]=0, ["decr"]=2, ["formula"]=4, ["icon"]="burn", @@ -694,6 +694,7 @@ local buff = { ["name"]="invincible_shield", ["buff_type"]=7, ["decr"]=3, + ["stack"]=3, ["icon"]="invincible_shield", ["fx_continued"]={ 26 diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 3307ebf9..60722256 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -415,6 +415,7 @@ function GFunc.getPerStr(key, str) key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE_REBOUND_400 or key == GConst.BattleConst.BUFF_NAME.BURN or key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE or + key == GConst.BattleConst.BUFF_NAME.SHIELD_ICE_02 or key == GConst.BattleConst.BUFF_NAME.BLOCK or key == GConst.BattleConst.BUFF_NAME.CRIT_ADD then diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index 5041d939..d9d76831 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -124,7 +124,8 @@ BattleConst.BUFF_TYPE = { BattleConst.BUFF_STACK_TYPE = { CANT_ADD = 0, ADD_ROUND = 1, - ADD = 2 + ADD = 2, + REMOVE_LAST = 3, } BattleConst.BUFF_DECR_TYPE = { @@ -338,6 +339,7 @@ local BUFF_NAME = { END_DMG_ADDITION_ALL_ADD = "end_dmg_addition_all_add", END_DMG_DEC_ALL_ADD = "end_dmg_dec_all_add", INVINCIBLE_SHIELD = "invincible_shield", + SHIELD_ICE_02 = "shield_ice_02", } BattleConst.BUFF_NAME = BUFF_NAME diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index a3085979..cead002f 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1631,10 +1631,12 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d if num < 0 then -- 伤害 local delayTime = 0 if shieldHpDiff < 0 or shieldWorkOn then - if shieldHpDiff == 0 then - shieldHpDiff = damage + if shieldHpDiff == 0 then -- 护盾血量没有减少, 但是被抵消了 + shieldHpDiff = -1 + damage = 0 + else + damage = damage - shieldHpDiff end - damage = damage - shieldHpDiff delayTime = BattleConst.EFFECT_NUMBER_DELAY if self.lastBlueNumberTime == time then self.lastSameTimeBlueCount = self.lastSameTimeBlueCount + 1 diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 24704b49..f724399d 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -229,6 +229,7 @@ function BattleTeam:handleShield(reduceShield, unit) while currShieldBuff do if reduceShield <= 0 and currShieldBuff.buff and currShieldBuff.buff:getName() == BattleConst.BUFF_NAME.INVINCIBLE_SHIELD then reduceShield = currShieldBuff.result - 1 + needReedRefreshBuff = true else reduceShield = reduceShield + currShieldBuff.result end @@ -278,6 +279,13 @@ function BattleTeam:addBuff(buffEffect) bEffect[fieldName] = buffEffect[fieldName] end end + if bEffect.buff:getEffectNum() < buffEffect.buff:getEffectNum() then + bEffect.buff:setEffectNum(buffEffect.buff:getEffectNum()) + end + needRecycle = bEffect + break + elseif bEffect.buff:getEffectNum() < buffEffect.buff:getEffectNum() then + bEffect.buff:setEffectNum(buffEffect.buff:getEffectNum()) needRecycle = bEffect break else @@ -304,6 +312,10 @@ function BattleTeam:addBuff(buffEffect) end end elseif stack == BattleConst.BUFF_STACK_TYPE.ADD then + + elseif stack == BattleConst.BUFF_STACK_TYPE.REMOVE_LAST then + local buffName = buffEffect.buff:getName() + self:removeBuffByName(buffName) end if needRecycle then diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua index 43d640d7..bc9ba71d 100644 --- a/lua/app/ui/battle/battle_base_ui.lua +++ b/lua/app/ui/battle/battle_base_ui.lua @@ -427,7 +427,7 @@ function BattleBaseUI:refreshBuff(side, buffList) local cell = self.tinyBuffCells[side][index] if cell then cell:getBaseObject():setVisible(true) - cell:refresh(buffObj.buff:getIcon(), buffObj.round) + cell:refresh(buffObj.buff:getIcon(), buffObj.round, buffObj.buff:getEffectNum(), buffObj.result) end index = index + 1 if index > buffCellCount then diff --git a/lua/app/ui/battle/cell/tiny_buff_cell.lua b/lua/app/ui/battle/cell/tiny_buff_cell.lua index 4ae37ecd..93ec90a8 100644 --- a/lua/app/ui/battle/cell/tiny_buff_cell.lua +++ b/lua/app/ui/battle/cell/tiny_buff_cell.lua @@ -1,6 +1,6 @@ local TinyBuffCell = class("TinyBuffCell", BaseCell) -function TinyBuffCell:refresh(buffName, round) +function TinyBuffCell:refresh(buffName, round, num, result) if round <= 1 or round > 9 then round = GConst.EMPTY_STRING else @@ -10,6 +10,15 @@ function TinyBuffCell:refresh(buffName, round) local uiMap = self:getUIMap() uiMap["tiny_buff_cell.buff_icon"]:setSprite(GConst.ATLAS_PATH.ICON_BUFF, buffName) uiMap["tiny_buff_cell.round_text"]:setText(round) + + local buffNum = uiMap["tiny_buff_cell.buff_num"] + if buffName == GConst.BattleConst.BUFF_NAME.INVINCIBLE_SHIELD then + uiMap["tiny_buff_cell.round_text"]:setText(GConst.EMPTY_STRING) + result = result or num + buffNum:setText(result or GConst.EMPTY_STRING) + else + buffNum:setText(GConst.EMPTY_STRING) + end end return TinyBuffCell \ No newline at end of file