Update - 1.9.0.103
EN: 1.9.0.103 CN: 1.9.0.104 JP: 1.9.0.106 KR: 1.9.0.108
This commit is contained in:
@@ -139,6 +139,12 @@ function StarTowerSweepData:Init(mapMeta, mapRoom, mapBag)
|
||||
self.nRankBattleTime = 0
|
||||
end
|
||||
self.nRoomType = mapRoom.Data.RoomType == nil and -1 or mapRoom.Data.RoomType
|
||||
local mapStarTower = ConfigTable.GetData("StarTower", self.nTowerId)
|
||||
if mapStarTower then
|
||||
local nTeamIndex = PlayerData.StarTower:GetGroupFormation(mapStarTower.GroupId)
|
||||
local nPreselectionId = PlayerData.Team:GetTeamPreselectionId(nTeamIndex)
|
||||
self.mapPreselectionData = PlayerData.PotentialPreselection:GetPreselectionById(nPreselectionId)
|
||||
end
|
||||
if mapBag ~= nil then
|
||||
for _, mapFateCardEft in ipairs(mapBag.FateCard) do
|
||||
self._mapFateCard[mapFateCardEft.Tid] = {
|
||||
@@ -194,7 +200,9 @@ function StarTowerSweepData:BuildCharacterData(tbCharacterData, tbDiscData)
|
||||
local mapEquipmentInfo = {
|
||||
Lock = false,
|
||||
Attributes = starTowerEquipment.Attributes,
|
||||
AlterAttributes = {}
|
||||
AlterAttributes = {},
|
||||
OverlockCount = starTowerEquipment.OverlockCount,
|
||||
AlterOverlockCount = {}
|
||||
}
|
||||
local equipmentData = EquipmentData.new(mapEquipmentInfo, mapChar.Id, nGemId)
|
||||
table.insert(tbEquipment, equipmentData)
|
||||
@@ -1651,6 +1659,33 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
for _, mapData in ipairs(tbPotentialData) do
|
||||
table.insert(tbPotential, mapData.Id)
|
||||
end
|
||||
if self.mapPreselectionData ~= nil then
|
||||
local tbRecommend = {}
|
||||
for k, v in ipairs(self.mapPreselectionData.tbCharPotential) do
|
||||
if k == 1 then
|
||||
if self.tbTeam[k] == v.nCharId then
|
||||
for _, potential in ipairs(v.tbPotential) do
|
||||
if table.indexof(tbPotential, potential.nId) > 0 then
|
||||
table.insert(tbRecommend, {
|
||||
nId = potential.nId,
|
||||
nLevel = potential.nLevel
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif 1 < table.indexof(self.tbTeam, v.nCharId) then
|
||||
for _, potential in ipairs(v.tbPotential) do
|
||||
if table.indexof(tbPotential, potential.nId) > 0 then
|
||||
table.insert(tbRecommend, {
|
||||
nId = potential.nId,
|
||||
nLevel = potential.nLevel
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return tbRecommend
|
||||
end
|
||||
local ret = {}
|
||||
local curRarity = 999
|
||||
for _, nPotentialId in ipairs(tbPotential) do
|
||||
@@ -1663,9 +1698,9 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
if curRarity > nRarity then
|
||||
ret = {}
|
||||
curRarity = nRarity
|
||||
table.insert(ret, nPotentialId)
|
||||
table.insert(ret, {nId = nPotentialId})
|
||||
elseif nRarity == curRarity then
|
||||
table.insert(ret, nPotentialId)
|
||||
table.insert(ret, {nId = nPotentialId})
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1684,7 +1719,8 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
for _, nPotentialId in ipairs(ret) do
|
||||
for _, v in ipairs(ret) do
|
||||
local nPotentialId = v.nId
|
||||
local potentialCfg = ConfigTable.GetData("Potential", nPotentialId)
|
||||
if potentialCfg ~= nil then
|
||||
local nCharId = potentialCfg.CharId
|
||||
@@ -1692,14 +1728,14 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
if nCurCount < 0 then
|
||||
nCurCharId = nCharId
|
||||
nCurCount = nCount
|
||||
table.insert(ret1, nPotentialId)
|
||||
table.insert(ret1, {nId = nPotentialId})
|
||||
elseif nCharId ~= nCurCharId and nCount < nCurCount then
|
||||
ret1 = {}
|
||||
nCurCharId = nCharId
|
||||
nCurCount = nCount
|
||||
table.insert(ret1, nPotentialId)
|
||||
table.insert(ret1, {nId = nPotentialId})
|
||||
else
|
||||
table.insert(ret1, nPotentialId)
|
||||
table.insert(ret1, {nId = nPotentialId})
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1735,34 +1771,35 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
end
|
||||
return ret, retBuild
|
||||
end
|
||||
for _, nPotentialId in ipairs(ret1) do
|
||||
for _, v in ipairs(ret1) do
|
||||
local nPotentialId = v.nId
|
||||
local nCount, nBuild = GetPotentialBuildCount(nPotentialId)
|
||||
if nCurBuildCount < 0 and nBuild ~= 0 then
|
||||
table.insert(ret2, nPotentialId)
|
||||
table.insert(ret2, {nId = nPotentialId})
|
||||
nCurBuildCount = nCount
|
||||
bHasBuild = nBuild ~= GameEnum.potentialBuild.PotentialBuildCommon
|
||||
elseif bHasBuild then
|
||||
if nBuild ~= GameEnum.potentialBuild.PotentialBuildCommon then
|
||||
if nCount == nCurBuildCount then
|
||||
table.insert(ret2, nPotentialId)
|
||||
table.insert(ret2, {nId = nPotentialId})
|
||||
elseif nCount > nCurBuildCount then
|
||||
ret2 = {}
|
||||
table.insert(ret2, nPotentialId)
|
||||
table.insert(ret2, {nId = nPotentialId})
|
||||
nCurBuildCount = nCount
|
||||
bHasBuild = nBuild ~= GameEnum.potentialBuild.PotentialBuildCommon
|
||||
end
|
||||
end
|
||||
elseif nBuild == GameEnum.potentialBuild.PotentialBuildCommon then
|
||||
if nCount == nCurBuildCount then
|
||||
table.insert(ret2, nPotentialId)
|
||||
table.insert(ret2, {nId = nPotentialId})
|
||||
elseif nCount > nCurBuildCount then
|
||||
ret2 = {}
|
||||
table.insert(ret2, nPotentialId)
|
||||
table.insert(ret2, {nId = nPotentialId})
|
||||
nCurBuildCount = nCount
|
||||
end
|
||||
else
|
||||
ret2 = {}
|
||||
table.insert(ret2, nPotentialId)
|
||||
table.insert(ret2, {nId = nPotentialId})
|
||||
nCurBuildCount = nCount
|
||||
bHasBuild = true
|
||||
end
|
||||
@@ -1775,7 +1812,8 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
end
|
||||
local ret3 = {}
|
||||
local curLessPotential = -1
|
||||
for _, nPotentialId in ipairs(ret2) do
|
||||
for _, v in ipairs(ret2) do
|
||||
local nPotentialId = v.nId
|
||||
local potentialCfg = ConfigTable.GetData("Potential", nPotentialId)
|
||||
if potentialCfg ~= nil then
|
||||
local nCharId = potentialCfg.CharId
|
||||
@@ -1784,13 +1822,13 @@ function StarTowerSweepData:GetRecommondPotential(tbPotentialData)
|
||||
nCurCount = self._mapPotential[nCharId][nPotentialId]
|
||||
end
|
||||
if curLessPotential < 0 then
|
||||
table.insert(ret3, nPotentialId)
|
||||
table.insert(ret3, {nId = nPotentialId})
|
||||
curLessPotential = nCurCount
|
||||
elseif nCurCount == curLessPotential then
|
||||
table.insert(ret3, nPotentialId)
|
||||
table.insert(ret3, {nId = nPotentialId})
|
||||
elseif nCurCount < curLessPotential then
|
||||
ret3 = {}
|
||||
table.insert(ret3, nPotentialId)
|
||||
table.insert(ret3, {nId = nPotentialId})
|
||||
curLessPotential = nCurCount
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user