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:
SL1900
2026-04-18 00:15:00 +09:00
parent 35fe1f046d
commit e0549005e1
1150 changed files with 941124 additions and 19847 deletions
@@ -3,18 +3,23 @@ local Actor2DManager = require("Game.Actor2D.Actor2DManager")
local AdventureModuleHelper = CS.AdventureModuleHelper
local TimerManager = require("GameCore.Timer.TimerManager")
local mapEventConfig = {
LevelStateChanged = "OnEvent_SendMsgFinishBattle",
LoadLevelRefresh = "OnEvent_LoadLevelRefresh",
[EventId.AbandonBattle] = "OnEvent_AbandonBattle",
AdventureModuleEnter = "OnEvent_AdventureModuleEnter",
BattlePause = "OnEvent_Pause",
ActivityInstance_Result = "LevelResultChange",
ActivityLevelSettle_Failed = "OnEvent_ActivityLevelSettleFailed"
ActivityLevelSettle_Failed = "OnEvent_ActivityLevelSettleFailed",
ActivityLevels_Instance_Gameplay_Time = "OnEvent_ActivityLevels_Time"
}
function ActivityLevelsInstanceLevel:Init(parent, nActivityId, nLevelId, nBuildId)
self.parent = parent
self.nLevelId = nLevelId
self.nActivityId = nActivityId
self.isSettlement = false
self.nBuildId = nBuildId
self.curFloorIdx = 1
self.levelTotalTime = 0
local GetBuildCallback = function(mapBuildData)
self.mapBuildData = mapBuildData
self.tbCharId = {}
@@ -32,8 +37,12 @@ function ActivityLevelsInstanceLevel:Init(parent, nActivityId, nLevelId, nBuildI
local stActorInfo = self:CalCharFixedEffect(nTid, idx == 1, self.tbDiscId)
self.mapActorInfo[nTid] = stActorInfo
end
PlayerData.nCurGameType = AllEnum.WorldMapNodeType.EquipmentInstance
CS.AdventureModuleHelper.EnterActivityLevelsInstance(nLevelId, self.tbCharId)
PlayerData.nCurGameType = AllEnum.WorldMapNodeType.ActivityLevels
local mapParams = {
tostring(self.curFloorIdx),
tostring(self.levelTotalTime)
}
CS.AdventureModuleHelper.EnterActivityLevelsInstance(nLevelId, self.tbCharId, mapParams)
NovaAPI.EnterModule("AdventureModuleScene", true, 17)
end
PlayerData.Build:GetBuildDetailData(GetBuildCallback, nBuildId)
@@ -42,7 +51,7 @@ function ActivityLevelsInstanceLevel:OnEvent_LoadLevelRefresh()
local mapAllEft, mapDiscEft, mapNoteEffect, tbNoteInfo = PlayerData.Build:GetBuildAllEft(self.mapBuildData.nBuildId)
safe_call_cs_func(CS.AdventureModuleHelper.SetNoteInfo, tbNoteInfo)
self.mapEftData = UTILS.AddBuildEffect(mapAllEft, mapDiscEft, mapNoteEffect)
EventManager.Hit("OpenActivityLevelsInstanceRoomInfo", self.nLevelId)
EventManager.Hit("OpenActivityLevelsInstanceRoomInfo", self.nLevelId, self.levelTotalTime)
end
function ActivityLevelsInstanceLevel:OnEvent_LevelResult(tbStar, bAbandon)
end
@@ -59,6 +68,40 @@ function ActivityLevelsInstanceLevel:OnEvent_AdventureModuleEnter()
safe_call_cs_func(CS.AdventureModuleHelper.SetActorAttribute, nCharId, stActorInfo)
end
end
function ActivityLevelsInstanceLevel:OnEvent_SendMsgFinishBattle()
local mapCfg = ConfigTable.GetData("ActivityLevelsLevel", self.nLevelId)
if self.curFloorIdx < #mapCfg.FloorId then
local GetBuildCallback = function(mapBuildData)
self.curFloorIdx = self.curFloorIdx + 1
self.mapBuildData = mapBuildData
self.tbCharId = {}
for _, mapChar in ipairs(self.mapBuildData.tbChar) do
table.insert(self.tbCharId, mapChar.nTid)
end
self.tbDiscId = {}
for _, nDiscId in ipairs(self.mapBuildData.tbDisc) do
if 0 < nDiscId then
table.insert(self.tbDiscId, nDiscId)
end
end
self.mapActorInfo = {}
for idx, nTid in ipairs(self.tbCharId) do
local stActorInfo = self:CalCharFixedEffect(nTid, idx == 1, self.tbDiscId)
self.mapActorInfo[nTid] = stActorInfo
end
PlayerData.nCurGameType = AllEnum.WorldMapNodeType.ActivityLevels
local mapParams = {
tostring(self.curFloorIdx),
tostring(self.levelTotalTime)
}
CS.AdventureModuleHelper.EnterActivityLevelsInstance(self.nLevelId, self.tbCharId, mapParams)
CS.AdventureModuleHelper.LevelStateChanged(false)
self:OnEvent_AdventureModuleEnter()
end
PlayerData.Build:GetBuildDetailData(GetBuildCallback, self.nBuildId)
return
end
end
function ActivityLevelsInstanceLevel:LevelResultChange(isWin, totalTime)
EventManager.Hit("ActivityLevelsInstanceBattleEnd")
self:SettleLevelsInstance(isWin, totalTime)
@@ -121,7 +164,9 @@ function ActivityLevelsInstanceLevel:PlaySuccessPerform(FixedRewardItems, FirstR
local tbChar = self.tbCharId
local function levelEndCallback()
EventManager.Remove("ADVENTURE_LEVEL_UNLOAD_COMPLETE", self, levelEndCallback)
local nType = ConfigTable.GetData("ActivityLevelsFloor", ConfigTable.GetData("ActivityLevelsLevel", self.nLevelId).FloorId).Theme
local tabFloor = ConfigTable.GetData("ActivityLevelsLevel", self.nLevelId).FloorId
local tabFloorCount = #tabFloor
local nType = ConfigTable.GetData("ActivityLevelsFloor", tabFloor[tabFloorCount]).Theme
local sName = ConfigTable.GetData("EndSceneType", nType).EndSceneName
local tbSkin = {}
for _, nCharId in ipairs(tbChar) do
@@ -204,4 +249,7 @@ end
function ActivityLevelsInstanceLevel:OnEvent_Pause()
EventManager.Hit("OpenActivityLevelsInstancePause", self.nActivityId, self.nLevelId, self.tbCharId)
end
function ActivityLevelsInstanceLevel:OnEvent_ActivityLevels_Time(nTime)
self.levelTotalTime = nTime
end
return ActivityLevelsInstanceLevel
@@ -84,8 +84,7 @@ function JointDrillLevelData_1:Init(parent, nLevelId, nBuildId, nCurLevel, nLeve
tostring(self.bChangeLevel),
tostring(self.nGameTime)
}
self.bRestart = false
if not self.bChangeLevel then
if not self.bChangeLevel and not self.bRestart then
AdventureModuleHelper.EnterDynamic(self.nLevelId, self.tbCharId, GameEnum.dynamicLevelType.JointDrill, mapParams)
NovaAPI.EnterModule("AdventureModuleScene", true, 17)
else
@@ -161,7 +160,6 @@ function JointDrillLevelData_1:CacheTempData(bCharacter, bBoss, bChangeTeam, bCh
self.mapTempData.mapCharacterTempData = {}
self.mapTempData.mapBossTempData = {}
if bCharacter then
local id = AdventureModuleHelper.GetCurrentActivePlayer()
self.mapTempData.mapCharacterTempData.hpInfo = {}
self.mapTempData.mapCharacterTempData.skillInfo = {}
self.mapTempData.mapCharacterTempData.effectInfo = {}
@@ -170,7 +168,7 @@ function JointDrillLevelData_1:CacheTempData(bCharacter, bBoss, bChangeTeam, bCh
self.mapTempData.mapCharacterTempData.ammoInfo = {}
self.mapTempData.mapCharacterTempData.sommonInfo = AdventureModuleHelper.GetSummonMonsterInfos()
self.mapActorInfo = self:GetActorHp()
self.mapTempData.mapCharacterTempData.hpInfo = self:GetActorHp()
self.mapTempData.mapCharacterTempData.hpInfo = self.mapActorInfo
local playerids = AdventureModuleHelper.GetCurrentGroupPlayers()
local Count = playerids.Count - 1
for i = 0, Count do
@@ -437,10 +435,19 @@ function JointDrillLevelData_1:CheckJointDrillGameOver()
local nChallengeCount = self.parent:GetJointDrillBattleCount()
local nAllChallengeCount = self.parent:GetMaxChallengeCount(self.nLevelId)
if nChallengeCount >= nAllChallengeCount then
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.ChallengeEnd, netMsg)
local nHp, nHpMax = 0, 0
local data, nDataLength = self:CacheTempData(false, true, true)
if self.mapTempData ~= nil and self.mapTempData.mapBossTempData ~= nil then
nHp = self.mapTempData.mapBossTempData.nHp
nHpMax = self.mapTempData.mapBossTempData.nHpMax
end
self.parent:JointDrillGameOver(callback)
local syncCallback = function()
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.ChallengeEnd, netMsg)
end
self.parent:JointDrillGameOver(callback)
end
self.parent:JointDrillSync(self.nCurLevel, self.nGameTime, self.nDamageValue, nHp, nHpMax, data, syncCallback)
else
local bBossFloor = self.mapFloor.FloorType == GameEnum.JointDrillFloorType.Boss
local data, nDataLength = self:CacheTempData(false, bBossFloor, true, false, true)
@@ -538,7 +545,7 @@ function JointDrillLevelData_1:OnEvent_MonsterSpawn(nBossId)
if self.bChangeLevel then
return
end
local data, nDataLength = self:CacheTempData(true, bBoss, true)
local data, nDataLength = self:CacheTempData(false, bBoss, true)
local nHp, nHpMax = 1, 1
if self.mapTempData ~= nil and self.mapTempData.mapBossTempData ~= nil then
nHp = self.mapTempData.mapBossTempData.nHp
@@ -551,6 +558,8 @@ function JointDrillLevelData_1:OnEvent_BattleLvsToggle(nBattleLv, nTotalTime, nD
if nBattleLv < self.nCurLevel then
return
end
self.bChangeLevel = true
self.bRestart = false
nTotalTime = math.min(self.mapLevel.BattleTime * 1000, self:GetSyncGameTime(nTotalTime))
self.nCurLevel = nBattleLv + 1
self.nDamageValue = self.nDamageValue + nDamageValue
@@ -563,6 +572,7 @@ function JointDrillLevelData_1:OnEvent_BattleLvsToggle(nBattleLv, nTotalTime, nD
local func = function()
local syncCallback = function()
PanelManager.InputEnable()
EventManager.Hit("CloseJointDrillPause")
local wait = function()
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
AdventureModuleHelper.LevelStateChanged(false)
@@ -607,6 +617,7 @@ function JointDrillLevelData_1:OnEvent_GiveUpBattle()
end
function JointDrillLevelData_1:OnEvent_RestartJointDrill()
self.bRestart = true
self.bChangeLevel = false
self.parent:SetGameTime(0)
AdventureModuleHelper.ClearCharacterDamageRecord(true)
local sRecord = self.parent:EncodeTempDataJson(self.mapInitTempData)
@@ -614,6 +625,7 @@ function JointDrillLevelData_1:OnEvent_RestartJointDrill()
self.parent:SetRecorderExcludeIds(true)
AdventureModuleHelper.LevelStateChanged(false)
EventManager.Hit("ResetBossHUD")
EventManager.Hit("JointDrillReset")
end
function JointDrillLevelData_1:OnEvent_RetreatJointDrill()
local callback = function()
@@ -650,11 +662,20 @@ function JointDrillLevelData_1:JointDrillTimeOut()
end
self.bInResult = true
NovaAPI.DispatchEventWithData("JointDrill_Level_TimeOut")
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.ChallengeEnd, netMsg)
local nHp, nHpMax = 0, 0
local data, nDataLength = self:CacheTempData(false, true, true)
if self.mapTempData ~= nil and self.mapTempData.mapBossTempData ~= nil then
nHp = self.mapTempData.mapBossTempData.nHp
nHpMax = self.mapTempData.mapBossTempData.nHpMax
end
self.parent:AddJointDrillTeam(self.mapBuildData, self.nGameTime, self.nDamageValue)
self.parent:JointDrillGameOver(callback)
local syncCallback = function()
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.ChallengeEnd, netMsg)
end
self.parent:AddJointDrillTeam(self.mapBuildData, self.nGameTime, self.nDamageValue)
self.parent:JointDrillGameOver(callback)
end
self.parent:JointDrillSync(self.nCurLevel, self.nGameTime, self.nDamageValue, nHp, nHpMax, data, syncCallback)
end
function JointDrillLevelData_1:OnEvent_CharDamageValue(charDamageValue)
for nCharId, nValue in pairs(charDamageValue) do
@@ -195,39 +195,44 @@ end
function JointDrillLevelData_2:CheckJointDrillGameOver()
local nChallengeCount = self.parent:GetJointDrillBattleCount()
local nAllChallengeCount = self.parent:GetMaxChallengeCount(self.nLevelId)
if nChallengeCount >= nAllChallengeCount then
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.ChallengeEnd, netMsg, self.nCurLevel)
end
self.parent:JointDrillGameOver(callback)
else
function self.recordCallback(sRecord)
function self.recordCallback(sRecord)
if nChallengeCount >= nAllChallengeCount then
local syncCallback = function()
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.ChallengeEnd, netMsg, self.nCurLevel)
end
self.parent:JointDrillGameOver(callback)
end
self.parent:JointDrillSync(self.nCurLevel, self.nGameTime, self.nDamageValue, "", syncCallback)
else
local callback = function(netMsg)
self:JointDrillFail(AllEnum.JointDrillResultType.BattleEnd, netMsg, self.nCurLevel)
end
self.parent:JointDrillGiveUp(self.nCurLevel, self.nGameTime, self.nDamageValue, sRecord, callback)
end
NovaAPI.DispatchEventWithData("JointDrill_CacheTempData_Start", nil, {
false,
true,
true,
false,
0,
0
})
end
NovaAPI.DispatchEventWithData("JointDrill_CacheTempData_Start", nil, {
false,
true,
true,
false,
0,
0
})
end
function JointDrillLevelData_2:JointDrillFail(nResultType, netMsg, nLevel)
local bossInfo = {}
local mapAllBossInfo = self.parent:GetBossInfo()
local mapCurBossInfo = mapAllBossInfo[nLevel]
for nIndex, v in ipairs(mapCurBossInfo) do
if v.nBossCfgId ~= 0 then
table.insert(bossInfo, {
nBossId = v.nBossCfgId,
nHp = v.nHp,
nHpMax = v.nHpMax
})
if mapCurBossInfo ~= nil then
for nIndex, v in ipairs(mapCurBossInfo) do
if v.nBossCfgId ~= 0 then
table.insert(bossInfo, {
nBossId = v.nBossCfgId,
nHp = v.nHp,
nHpMax = v.nHpMax
})
end
end
end
local bSimulate = self.parent:GetBattleSimulate()
@@ -71,6 +71,9 @@ function PreviewLevel:PlaySuccessPerform()
elseif self.nLevelType == GameEnum.worldLevelType.DailyInstance then
local nType = ConfigTable.GetData("DailyInstanceFloor", self.nLevelId).Theme
sName = ConfigTable.GetData("EndSceneType", nType).EndSceneName
elseif self.nLevelType == GameEnum.worldLevelType.ActivityStory then
local nType = ConfigTable.GetData("ActivityLevelsFloor", self.nLevelId).Theme
sName = ConfigTable.GetData("EndSceneType", nType).EndSceneName
else
local nType = ConfigTable.GetData("StarTowerMap", self.nLevelId).Theme
sName = ConfigTable.GetData("EndSceneType", nType).EndSceneName
@@ -294,6 +294,12 @@ function StarTowerLevelData:Init(mapMeta, mapRoom, mapBag, lastId)
}
}
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
self.cachedClientData = mapMeta.ClientData
self.mapCharacterTempData = DecodeTempDataJson(mapMeta.ClientData)
self.mapEffectTriggerCount = {}
@@ -961,7 +967,9 @@ function StarTowerLevelData: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)
@@ -2430,6 +2438,33 @@ function StarTowerLevelData: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
@@ -2442,9 +2477,9 @@ function StarTowerLevelData: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
@@ -2463,7 +2498,8 @@ function StarTowerLevelData: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
@@ -2471,14 +2507,14 @@ function StarTowerLevelData: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
@@ -2514,34 +2550,35 @@ function StarTowerLevelData: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
@@ -2554,7 +2591,8 @@ function StarTowerLevelData: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
@@ -2563,13 +2601,13 @@ function StarTowerLevelData: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
@@ -1396,9 +1396,15 @@ function StarTowerPrologueLevel:CacheTempData()
self.mapCharacterTempData.ammoInfo[charTid].nAmmo1 = tbAmmo[0]
self.mapCharacterTempData.ammoInfo[charTid].nAmmo2 = tbAmmo[1]
self.mapCharacterTempData.ammoInfo[charTid].nAmmo3 = tbAmmo[2]
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax1 = tbAmmo[3]
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax2 = tbAmmo[4]
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax3 = tbAmmo[5]
if tbAmmo.Length >= 6 then
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax1 = tbAmmo[3]
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax2 = tbAmmo[4]
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax3 = tbAmmo[5]
else
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax1 = 0
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax2 = 0
self.mapCharacterTempData.ammoInfo[charTid].nAmmoMax3 = 0
end
end
end
end
@@ -1696,9 +1702,9 @@ function StarTowerPrologueLevel: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
@@ -1717,7 +1723,8 @@ function StarTowerPrologueLevel: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
@@ -1725,14 +1732,14 @@ function StarTowerPrologueLevel: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
@@ -1755,16 +1762,17 @@ function StarTowerPrologueLevel:GetRecommondPotential(tbPotentialData)
end
return ret
end
for _, nPotentialId in ipairs(ret1) do
for _, v in ipairs(ret1) do
local nPotentialId = v.nId
local nCount = GetPotentialBuildCount(nPotentialId)
if nCurBuildCount < 0 then
table.insert(ret2, nPotentialId)
table.insert(ret2, {nId = nPotentialId})
nCurBuildCount = nCount
elseif 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
end
@@ -1773,7 +1781,8 @@ function StarTowerPrologueLevel: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
@@ -1782,13 +1791,13 @@ function StarTowerPrologueLevel: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
@@ -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
+13 -4
View File
@@ -36,8 +36,13 @@ function StoryLevel:Init(parent, nLevelId, nBuildId, bActivityStory)
table.insert(self.tbDiscId, nDiscId)
end
end
PlayerData.nCurGameType = AllEnum.WorldMapNodeType.Mainline
CS.AdventureModuleHelper.EnterMainlineMap(mapStory.FloorId[1], self.tbCharId, {})
if bActivityStory then
PlayerData.nCurGameType = AllEnum.WorldMapNodeType.ActivityStory
CS.AdventureModuleHelper.EnterActivityStoryLevelsInstance(mapStory.FloorId[1], self.tbCharId)
else
PlayerData.nCurGameType = AllEnum.WorldMapNodeType.Mainline
CS.AdventureModuleHelper.EnterMainlineMap(mapStory.FloorId[1], self.tbCharId, {})
end
NovaAPI.EnterModule("AdventureModuleScene", true, 17)
end
if self.bTrialLevel then
@@ -178,7 +183,7 @@ function StoryLevel:PlaySuccessPerform(FadeTime, mapChangeInfo, sVideoName)
local storyCfg = self.bActivityStory == true and ConfigTable.GetData("ActivityStory", self.nLevelId) or ConfigTable.GetData_Story(self.nLevelId)
local nFloorCount = #storyCfg.FloorId
local nMapId = storyCfg.FloorId[nFloorCount]
local nType = ConfigTable.GetData("MainlineFloor", nMapId).Theme
local nType = self.bActivityStory == true and ConfigTable.GetData("ActivityLevelsFloor", nMapId).Theme or ConfigTable.GetData("MainlineFloor", nMapId).Theme
local sName = ConfigTable.GetData("EndSceneType", nType).EndSceneName
EventManager.Add("SettlementPerformLoadFinish", self, openBattleResultPanel)
local tbSkin = {}
@@ -271,7 +276,11 @@ function StoryLevel:ChangeFloor()
self:SetCharStatus()
end
EventManager.Add("ADVENTURE_LEVEL_UNLOAD_COMPLETE", self, levelUnloadCallback)
CS.AdventureModuleHelper.EnterMainlineMap(mapStory.FloorId[self.curFloorIdx], self.tbCharId, {})
if self.bActivityStory then
CS.AdventureModuleHelper.EnterActivityStoryLevelsInstance(mapStory.FloorId[self.curFloorIdx], self.tbCharId)
else
CS.AdventureModuleHelper.EnterMainlineMap(mapStory.FloorId[self.curFloorIdx], self.tbCharId, {})
end
CS.AdventureModuleHelper.LevelStateChanged(false)
self.bSettle = false
end