Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-05-29 10:54:13 +08:00
commit 003d962422
4 changed files with 53 additions and 3 deletions

View File

@ -1582,7 +1582,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d
end end
local hpPercent = self.unitEntity:getHpPercent() local hpPercent = self.unitEntity:getHpPercent()
self.battleController:refreshHp(self.side, hp, hpPercent) self.battleController:refreshHp(self.side, hp, hpPercent)
if not atker:getIsFinalBlock() then if not atker:getIsFinalBlock() or not self.battleController:getIsLastInstruction() then
if damage < 0 then if damage < 0 then
self:playHurt() self:playHurt()
end end

View File

@ -1234,6 +1234,14 @@ function BattleController:exeInstructions(callback)
end end
end end
function BattleController:getIsLastInstruction()
if not self.instructions or not self.instructions[1] then
return true
end
return false
end
function BattleController:generateBoard(isFirst) function BattleController:generateBoard(isFirst)
local boardList, _, mysteryBoxIndexMap = self:getInitBoard() local boardList, _, mysteryBoxIndexMap = self:getInitBoard()
if self.curBoardIndex and self.curBoardIndex >= #boardList then if self.curBoardIndex and self.curBoardIndex >= #boardList then

View File

@ -21,8 +21,19 @@ local _changeBaseSkill = function(skillId, skillInfo, battleData, battleControll
if not battleData.atkTeam then if not battleData.atkTeam then
return return
end end
if battleData.atkTeam:getAllMembers()[elementType] then local unitEntity = battleData.atkTeam:getAllMembers()[elementType]
battleData.atkTeam:getAllMembers()[elementType]:changeSkillId(skillId, newSkillId) if unitEntity then
unitEntity:changeSkillId(skillId, newSkillId)
Logger.logHighlight("------------")
Logger.printTable(skillEntity:getSkillRoundAdd())
Logger.printTable(skillEntity:getSkillEffecuNumAdd())
for effectType, effect in pairs(skillEntity:getSkillRoundAdd()) do -- 技能回合数
unitEntity:addSkillRound(newSkillId, effect)
end
for effectType, effect in pairs(skillEntity:getSkillEffecuNumAdd()) do -- 技能效果
unitEntity:addSkillParams(newSkillId, effect)
end
end end
end end
end end
@ -135,6 +146,7 @@ local _addSkillEffectParams = function(skillId, skillInfo, battleData, battleCon
local skillEntity = battleData:getSkillEntityByElement(elementType) local skillEntity = battleData:getSkillEntityByElement(elementType)
if skillEntity then if skillEntity then
local skillId = skillEntity:getSkillId() local skillId = skillEntity:getSkillId()
skillEntity:addSkillEffecuNumAdd(effect)
if not battleData.atkTeam then if not battleData.atkTeam then
return return
end end
@ -173,6 +185,7 @@ local _addSkillRound = function(skillId, skillInfo, battleData, battleController
local skillEntity = battleData:getSkillEntityByElement(elementType) local skillEntity = battleData:getSkillEntityByElement(elementType)
if skillEntity then if skillEntity then
local skillId = skillEntity:getSkillId() local skillId = skillEntity:getSkillId()
skillEntity:addSkillRoundAdd(effect)
if not battleData.atkTeam then if not battleData.atkTeam then
return return
end end

View File

@ -11,6 +11,8 @@ function BattleBoardSkillEntity:ctor(skillId)
self.elementCountEffectEntities = {} -- 根据消除数量获得次数的技能效果 type = 13 self.elementCountEffectEntities = {} -- 根据消除数量获得次数的技能效果 type = 13
self.linkCountMoreEffects = {} -- 链接超过x元素获得一次技能效果 type = 14 self.linkCountMoreEffects = {} -- 链接超过x元素获得一次技能效果 type = 14
self.linkCountPowerEffects = {} -- 链接超过x元素获得倍数技能效果 type = 15 self.linkCountPowerEffects = {} -- 链接超过x元素获得倍数技能效果 type = 15
self.skillEffectNumAdd = {} -- 技能效果参数增加 type = 7 用于技能替换时生效
self.skillRoundAdd = {} -- 技能效果回合增加 type = 8 用于技能替换时生效
self.upSkillIdMap = {} self.upSkillIdMap = {}
self.getUpSkillKind = 0 self.getUpSkillKind = 0
@ -446,4 +448,31 @@ function BattleBoardSkillEntity:getLinkCountPowerEffects()
return self.linkCountPowerEffects return self.linkCountPowerEffects
end end
function BattleBoardSkillEntity:addSkillEffecuNumAdd(effect)
local effectInfo = self.skillEffectNumAdd[effect.type]
if effectInfo then
effectInfo.num = effectInfo.num + effect.num
else
self.skillEffectNumAdd[effect.type] = effect
end
end
function BattleBoardSkillEntity:getSkillEffecuNumAdd()
return self.skillEffectNumAdd
end
function BattleBoardSkillEntity:addSkillRoundAdd(effect)
local effectInfo = self.skillRoundAdd[effect.type]
if effectInfo then
effectInfo.round = effectInfo.round + effect.round
else
self.skillRoundAdd[effect.type] = effect
end
end
function BattleBoardSkillEntity:getSkillRoundAdd()
return self.skillRoundAdd
end
return BattleBoardSkillEntity return BattleBoardSkillEntity