This commit is contained in:
xiekaidong 2023-09-13 09:19:02 +08:00
parent 9b5c3ab2fc
commit 24b8242de8

View File

@ -230,6 +230,36 @@ function BattleControllerDungeonRune:getInitBoard()
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
end
function BattleControllerDungeonRune:getRandomGridInfo()
local list, fixedRandomGrid = self:getInitBoard()
local fixedRandomList = fixedRandomGrid[self.curBoardIndex]
local gridType = 0
local elementType
if fixedRandomList and fixedRandomList[1] then
elementType = table.remove(fixedRandomList, 1)
else
local map = self.battleData:getElementTypeMap()
self.getRandomGridInfoIndexs = table.clearOrCreate(self.getRandomGridInfoIndexs)
self.getRandomGridInfoTypeList = table.clearOrCreate(self.getRandomGridInfoTypeList)
for typeName, typeNum in pairs(BattleConst.ELEMENT_TYPE) do
if not self:getSealElementType()[typeNum] and self:getSkillEntityByElement(typeNum) then
local weight = 100
if self.elementWeightMap and self.elementWeightMap[typeNum] then
weight = weight + self.elementWeightMap[typeNum]
end
table.insert(self.getRandomGridInfoIndexs, weight)
table.insert(self.getRandomGridInfoTypeList, typeNum)
end
end
local index = GFunc.getRandomIndex(self.getRandomGridInfoIndexs)
elementType = self.getRandomGridInfoTypeList[index]
end
return {gridType = gridType, elementType = elementType}
end
function BattleControllerDungeonRune:onLoadComplete(...)
-- 处理技能
local unlockAllSkill = function(side)