This commit is contained in:
puxuan 2025-10-17 11:45:47 +08:00
parent 7101d45a3d
commit 07c11aded9
8 changed files with 90 additions and 14 deletions

View File

@ -376,6 +376,7 @@ local BUFF_NAME = {
FOREVER_DEC_DMG_ALL_ADD = "forever_dec_dmg_all_add", FOREVER_DEC_DMG_ALL_ADD = "forever_dec_dmg_all_add",
FOREVER_THORNS = "forever_thorns", FOREVER_THORNS = "forever_thorns",
RANDOM_UNIVERSAL = "random_universal", RANDOM_UNIVERSAL = "random_universal",
MAIN_HERO_ENERGYADD = "main_hero_energyadd",
} }
BattleConst.BUFF_NAME = BUFF_NAME BattleConst.BUFF_NAME = BUFF_NAME

View File

@ -1409,6 +1409,21 @@ function BattleBaseController:onLinkOver()
for elementType, count in pairs(elementTypeMap) do for elementType, count in pairs(elementTypeMap) do
self.teampSkillBreakEnergyMap[elementType] = (self.teampSkillBreakEnergyMap[elementType] or 0) + count self.teampSkillBreakEnergyMap[elementType] = (self.teampSkillBreakEnergyMap[elementType] or 0) + count
end end
-- 检测主英雄额外增加能量buff
local hadExt, num = self.atkTeam:checkMainHeroExtAdd()
if hadExt then
local maxType
local maxNum = 0
for k,v in pairs(self.teampSkillBreakEnergyMap) do
if v > maxNum then
maxType = k
maxNum = v
end
end
if maxType then
self.teampSkillBreakEnergyMap[maxType] = self.teampSkillBreakEnergyMap[maxType] + num
end
end
self:addSkillEnergy(self.teampSkillBreakEnergyMap) self:addSkillEnergy(self.teampSkillBreakEnergyMap)
end end
self.battleData:clearGridSequence() self.battleData:clearGridSequence()
@ -2305,7 +2320,7 @@ function BattleBaseController:getRandomGridInfo()
-- end -- end
local elementType = math.random(1, BattleConst.ELEMENT_TYPE.PURPLE) local elementType = math.random(1, BattleConst.ELEMENT_TYPE.PURPLE)
local isUniversal = false local isUniversal = false
if self.atkTeam:checkUniversal() then if self.atkTeam:checkUniversal() and not self.battleData:hadUniversalGrid() then
isUniversal = true isUniversal = true
end end

View File

@ -495,6 +495,44 @@ local _addSkillLinkNumRound = function(skillId, skillInfo, battleBaseData, battl
end end
end end
local _addEnergyRandomOne = function(skillId, skillInfo, battleBaseData, battleController, value, side)
if not skillInfo.parameter then
return
end
local num = skillInfo.parameter[1]
if not num then
return
end
local elementType = math.random(1, BattleConst.ELEMENT_TYPE.PURPLE)
local map = {
[elementType] = num
}
battleController:addSkillEnergy(map)
battleController.battleUI:refreshSkill(nil, nil, battleController:getCurActionSide())
battleController:onFillBoardOver()
end
local _addEnergyAll = function(skillId, skillInfo, battleBaseData, battleController, value, side)
if not skillInfo.parameter then
return
end
local num = skillInfo.parameter[1]
if not num then
return
end
local map = {}
for i = 1, BattleConst.ELEMENT_TYPE.PURPLE do
map[i] = num
end
battleController:addSkillEnergy(map)
battleController.battleUI:refreshSkill(nil, nil, battleController:getCurActionSide())
battleController:onFillBoardOver()
end
BattleRogueSkillHandle._effectOn = { BattleRogueSkillHandle._effectOn = {
[1] = _changeBaseSkill, -- 改变初始技能ID [1] = _changeBaseSkill, -- 改变初始技能ID
[2] = _addEliminationRange, -- 增加消除数量 [2] = _addEliminationRange, -- 增加消除数量
@ -515,11 +553,8 @@ BattleRogueSkillHandle._effectOn = {
[17] = _addSkillBreakEnergyMultiple, -- 增加技能消除的元素的能量倍数 [17] = _addSkillBreakEnergyMultiple, -- 增加技能消除的元素的能量倍数
[18] = _addSkillMerge, -- 融合技能参数配本表的ID获得后直接让配的技能ID都生效 [18] = _addSkillMerge, -- 融合技能参数配本表的ID获得后直接让配的技能ID都生效
[19] = _addSkillLinkNumRound, -- 需要做成链接超X个元素时将主技能的第几个BUFF的回合数增加。参数配置[链接数,第几个BUFF回合数加值] [19] = _addSkillLinkNumRound, -- 需要做成链接超X个元素时将主技能的第几个BUFF的回合数增加。参数配置[链接数,第几个BUFF回合数加值]
-- [20] = _randomOneUniversal, -- 概率刷出万能块技能参数parameter配置其概率 [20] = _addEnergyRandomOne, -- 随机1名英雄能量+Xparameter配置能量增加数
-- [21] = _addSkillLinkNumRound, -- 每次消除获得的主要英雄能量+Xparameter配置能量增加数 [21] = _addEnergyAll, -- 全体英雄能量+Xparameter配置能量增加数
-- [22] = _addSkillLinkNumRound, -- 随机1名英雄能量+Xparameter配置能量增加数
-- [23] = _addSkillLinkNumRound, -- 全体英雄能量+Xparameter配置能量增加数
-- [24] = _addSkillLinkNumRound, -- 随机将一个技能能量加满
} }
function BattleRogueSkillHandle.takeEffect(skillId, battleData, battleController, value, side, isSnapshot) function BattleRogueSkillHandle.takeEffect(skillId, battleData, battleController, value, side, isSnapshot)

View File

@ -694,13 +694,30 @@ function BattleTeam:hadUniversalBuff()
return false return false
end end
-- 回合结束的时候要结算buff和技能 function BattleTeam:hadUMainHeroExtAddBuff()
for i,v in ipairs(self.buffList) do
if v.buff:getName() == BattleConst.BUFF_NAME.MAIN_HERO_ENERGYADD then
return true, v.buff:getEffectNum()
end
end
return false
end
-- 检查是否带有万能块buff
function BattleTeam:checkUniversal() function BattleTeam:checkUniversal()
if self:hadUniversalBuff() then if self:hadUniversalBuff() then
return true return true
end end
end end
-- 检查是否带有额外能量加层
function BattleTeam:checkMainHeroExtAdd()
local hadBuff, effectNum = self:hadUMainHeroExtAddBuff()
if hadBuff then
return true, effectNum
end
end
function BattleTeam:getBuffCountByName(buffName) function BattleTeam:getBuffCountByName(buffName)
return self.sameBuffCount[buffName] or 0 return self.sameBuffCount[buffName] or 0
end end

View File

@ -1680,6 +1680,7 @@ function BattleBaseUI:generateSkillAni(map, callback, side)
local entity = self.generateSkillGridEntities[elementType] local entity = self.generateSkillGridEntities[elementType]
if entity and entity:getCell() then if entity and entity:getCell() then
count = count + 1 count = count + 1
local count1 = count
entity:setSkilId(info.skillId, false, side) entity:setSkilId(info.skillId, false, side)
local cell = entity:getCell() local cell = entity:getCell()
cell:refresh(entity) cell:refresh(entity)
@ -1694,8 +1695,8 @@ function BattleBaseUI:generateSkillAni(map, callback, side)
self.generateSkillSfxs[count]:setAnchoredPosition(pos.x, pos.y) self.generateSkillSfxs[count]:setAnchoredPosition(pos.x, pos.y)
self:setGenerateSkillSfxsParent(info.posId, self.generateSkillSfxs[count]) self:setGenerateSkillSfxsParent(info.posId, self.generateSkillSfxs[count])
self.generateSkillAniSeq:AppendCallback(function() self.generateSkillAniSeq:AppendCallback(function()
self.generateSkillSfxs[count]:setActive(true) self.generateSkillSfxs[count1]:setActive(true)
self.generateSkillSfxs[count]:play() self.generateSkillSfxs[count1]:play()
end) end)
end end
end end

View File

@ -23,9 +23,6 @@ function BattleSelectSkillCell:refresh(skillId, func)
value = I18N:getText("skill_rogue", skillId, "desc", value) value = I18N:getText("skill_rogue", skillId, "desc", value)
end end
else else
if EDITOR_MODE then
Logger.logHighlight("=================== skillId = %s", skillId)
end
value = ModuleManager.HeroManager:getSkillRogueDesc(skillId, self.value) value = ModuleManager.HeroManager:getSkillRogueDesc(skillId, self.value)
end end
end end

View File

@ -413,6 +413,15 @@ function BattleBaseData:getGridEntity(posId)
return self.gridEntities[posId] return self.gridEntities[posId]
end end
function BattleBaseData:hadUniversalGrid()
for k,v in pairs(self.gridEntities) do
if v:getIsUniversal() then
return true
end
end
return false
end
function BattleBaseData:exchangeGridEntities(posId1, posId2) function BattleBaseData:exchangeGridEntities(posId1, posId2)
local e1 = self.gridEntities[posId1] local e1 = self.gridEntities[posId1]
local e2 = self.gridEntities[posId2] local e2 = self.gridEntities[posId2]

View File

@ -28,8 +28,9 @@ function BattleBuffEntity:init(effectParams, owner, hostSkill)
end end
function BattleBuffEntity:isActive() function BattleBuffEntity:isActive()
if self.ratio < BattleConst.DEFAULT_FACTOR then -- ratio 是附加buff的概率 effectNum是触发buff概率
if BattleHelper:random(1, BattleConst.DEFAULT_FACTOR) > self.ratio then -- 没有通过命中概率 if self.effectNum < BattleConst.DEFAULT_FACTOR then
if BattleHelper:random(1, BattleConst.DEFAULT_FACTOR) > self.effectNum then -- 没有通过命中概率
return false return false
end end
end end