diff --git a/lua/app/config/buff.lua b/lua/app/config/buff.lua index 9445d96d..e06d61bf 100644 --- a/lua/app/config/buff.lua +++ b/lua/app/config/buff.lua @@ -252,6 +252,11 @@ local buff = { ["fx_disappear"]={ 14 } + }, + [47]={ + ["name"]="burn", + ["buff_type"]=4, + ["formula"]=4 } } local keys = { @@ -301,12 +306,13 @@ local keys = { ["cured_add"]=buff[43], ["add_skill"]=buff[44], ["skill_fire_times"]=buff[45], - ["shield_rebound_200"]=buff[46] + ["shield_rebound_200"]=buff[46], + ["burn"]=buff[47] } } local config = { data=buff, keys=keys, -count=46 +count=47 } return config \ No newline at end of file diff --git a/lua/app/config/chapter.lua b/lua/app/config/chapter.lua index 5978fb60..8d706b94 100644 --- a/lua/app/config/chapter.lua +++ b/lua/app/config/chapter.lua @@ -96,6 +96,9 @@ local chapter = { 3 }, ["seal_element"]={ + 1, + 3, + 4, 5 }, ["not_involved_skill"]={ diff --git a/lua/app/config/skill.lua b/lua/app/config/skill.lua index 50c76ab6..f962ab54 100644 --- a/lua/app/config/skill.lua +++ b/lua/app/config/skill.lua @@ -336,6 +336,12 @@ local skill = { ["num"]=40000, ["ratio"]=10000, ["round"]=0 + }, + { + ["type"]="burn", + ["num"]=10000, + ["ratio"]=10000, + ["round"]=2 } }, ["obj"]=2, diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index f50c61c6..9c217e0f 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -90,6 +90,12 @@ BattleConst.BUFF_TYPE = { DIRECT_HURT = 3 } +BattleConst.BUFF_STACK_TYPE = { + CANT_ADD = 0, + ADD_ROUND = 1, + ADD = 2 +} + BattleConst.SKILL_MOVE_TYPE = { MOVE = 1, -- 移动到目标跟前使用 STAND = 2, -- 原地使用 diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 25d3188f..c5f1ceac 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1067,7 +1067,7 @@ function BattleUnitComp:addMaxHp(percent) end function BattleUnitComp:addBuff(buffEffect) - self.team:addBuff(buffEffect) + return self.team:addBuff(buffEffect) end function BattleUnitComp:updateBuffState(buff, num) @@ -1151,7 +1151,7 @@ function BattleUnitComp:takeEffect(buff, target) buffEffect.round = round buffEffect.target = target buffEffect.sender = self - target:addBuff(buffEffect) + buffEffect = target:addBuff(buffEffect) end local func = BattleBuffHandle.takeBuffEffect[buff:getBuffType()] if func then diff --git a/lua/app/module/battle/helper/battle_formula.lua b/lua/app/module/battle/helper/battle_formula.lua index 03f9e73e..e5b67f9f 100644 --- a/lua/app/module/battle/helper/battle_formula.lua +++ b/lua/app/module/battle/helper/battle_formula.lua @@ -39,6 +39,11 @@ BattleFormula.calculateFormula = { [3] = function(unitComp, buff, targetUnit) local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR * (unitComp.unitEntity:getCureAddition() + DEFAULT_FACTOR) // DEFAULT_FACTOR return result, 0 + end, + -- buff释放方攻击力*技能倍率 + [4] = function(unitComp, buff, targetUnit) + local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR + return result, 0 end } diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 41253e69..ec1ee9c0 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -228,11 +228,60 @@ function BattleTeam:handleShield(reduceShield, unit) end function BattleTeam:addBuff(buffEffect) - table.insert(self.buffList, buffEffect) - self:updateBuffState(buffEffect.buff, 1) - if buffEffect.buff:getIcon() then - self.battleController:refreshBuff(self.side, self.buffList) + local stack = buffEffect.buff:getStack() + local needRecycle + if not stack or stack == BattleConst.BUFF_STACK_TYPE.CANT_ADD then + local buffName = buffEffect.buff:getName() + local buffNum = self.sameBuffCount[buffName] + if buffNum and buffNum > 0 then + for _, bEffect in ipairs(self.buffList) do + if bEffect.buff:getName() == buffName then + if bEffect.round < buffEffect.round then + bEffect.round = buffEffect.round + for fieldName, v in pairs(bEffect) do + if fieldName ~= "buff" and fieldName ~= "round" then + bEffect[fieldName] = buffEffect[fieldName] + end + end + needRecycle = bEffect + break + end + end + end + end + elseif stack == BattleConst.BUFF_STACK_TYPE.ADD_ROUND then + local buffName = buffEffect.buff:getName() + local buffNum = self.sameBuffCount[buffName] + if buffNum and buffNum > 0 then + for _, bEffect in ipairs(self.buffList) do + if bEffect.buff:getName() == buffName then + bEffect.round = bEffect.round + buffEffect.round + for fieldName, v in pairs(bEffect) do + if fieldName ~= "buff" and fieldName ~= "round" then + bEffect[fieldName] = buffEffect[fieldName] + end + end + needRecycle = bEffect + break + end + end + end + elseif stack == BattleConst.BUFF_STACK_TYPE.ADD then end + + if needRecycle then + BattleHelper:recycleBuffEffect(buffEffect) + else + table.insert(self.buffList, buffEffect) + self:updateBuffState(buffEffect.buff, 1) + if buffEffect.buff:getIcon() then + self.battleController:refreshBuff(self.side, self.buffList) + end + + needRecycle = buffEffect + end + + return needRecycle end function BattleTeam:removeAllBuff() diff --git a/lua/app/userdata/battle/skill/battle_buff_entity.lua b/lua/app/userdata/battle/skill/battle_buff_entity.lua index 7bdc6a5e..d6694ada 100644 --- a/lua/app/userdata/battle/skill/battle_buff_entity.lua +++ b/lua/app/userdata/battle/skill/battle_buff_entity.lua @@ -81,6 +81,10 @@ function BattleBuffEntity:setTargetSide(side) self.targetSide = side end +function BattleBuffEntity:getStack() + return self.buffInfo.stack +end + function BattleBuffEntity:getIcon() return self.buffInfo.icon end