Update - 1.9.0.105
EN: 1.9.0.105 CN: 1.9.0.106 JP: 1.9.0.109 KR: 1.9.0.110
This commit is contained in:
@@ -15,6 +15,7 @@ function FilterData:Init()
|
||||
self.bFormationCharOrder = false
|
||||
self.nFormationDiscSrotType = AllEnum.SortType.Level
|
||||
self.bFormationDiscOrder = false
|
||||
self.tbCacheOptionData = {}
|
||||
end
|
||||
function FilterData:Reset(tbOption)
|
||||
if tbOption == nil then
|
||||
@@ -57,6 +58,16 @@ function FilterData:IsDirty(optionType)
|
||||
end
|
||||
return false
|
||||
end
|
||||
function FilterData:IsDirtyByOption(tbOption)
|
||||
for _, fKey in ipairs(tbOption) do
|
||||
for _, result in pairs(self.tbFilter[fKey]) do
|
||||
if result == true then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
function FilterData:_IsDirty(fKey)
|
||||
for _, result in pairs(self.tbFilter[fKey]) do
|
||||
if result == true then
|
||||
@@ -79,6 +90,30 @@ function FilterData:CheckFilterByChar(charId)
|
||||
isFilter = isFilter and self:_GetFilterByKey(AllEnum.ChooseOption.Char_AffiliatedForces, mapCharDescCfg.Tag[3])
|
||||
return isFilter
|
||||
end
|
||||
function FilterData:CheckFilterByCharAndOption(charId, tbOption)
|
||||
local charData = ConfigTable.GetData_Character(charId)
|
||||
local mapCharDescCfg = ConfigTable.GetData("CharacterDes", charId)
|
||||
local isFilter = true
|
||||
if mapCharDescCfg == nil or charData == nil then
|
||||
return isFilter
|
||||
end
|
||||
if table.indexof(tbOption, AllEnum.ChooseOption.Char_Element) > 0 then
|
||||
isFilter = self:_GetFilterByKey(AllEnum.ChooseOption.Char_Element, charData.EET)
|
||||
end
|
||||
if 0 < table.indexof(tbOption, AllEnum.ChooseOption.Char_Rarity) and isFilter then
|
||||
isFilter = self:_GetFilterByKey(AllEnum.ChooseOption.Char_Rarity, charData.Grade)
|
||||
end
|
||||
if 0 < table.indexof(tbOption, AllEnum.ChooseOption.Char_PowerStyle) and isFilter then
|
||||
isFilter = self:_GetFilterByKey(AllEnum.ChooseOption.Char_PowerStyle, charData.Class)
|
||||
end
|
||||
if 0 < table.indexof(tbOption, AllEnum.ChooseOption.Char_TacticalStyle) and isFilter then
|
||||
isFilter = self:_GetFilterByKey(AllEnum.ChooseOption.Char_TacticalStyle, mapCharDescCfg.Tag[2])
|
||||
end
|
||||
if 0 < table.indexof(tbOption, AllEnum.ChooseOption.Char_AffiliatedForces) and isFilter then
|
||||
isFilter = self:_GetFilterByKey(AllEnum.ChooseOption.Char_AffiliatedForces, mapCharDescCfg.Tag[3])
|
||||
end
|
||||
return isFilter
|
||||
end
|
||||
function FilterData:CheckFilterByDisc(discId)
|
||||
local discCfg = ConfigTable.GetData("Disc", discId)
|
||||
local discData = PlayerData.Disc:GetDiscById(discId)
|
||||
@@ -210,6 +245,20 @@ end
|
||||
function FilterData:GetFilterByKey(fKey, sKey)
|
||||
return self.tbFilter[fKey][sKey]
|
||||
end
|
||||
function FilterData:CacheFilterByOption(tbOption)
|
||||
self.tbCacheOptionData = {}
|
||||
for fKey, v in ipairs(self.tbFilter) do
|
||||
if table.indexof(tbOption, fKey) > 0 then
|
||||
self.tbCacheOptionData[fKey] = clone(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
function FilterData:ResetCacheFilter()
|
||||
for fKey, v in pairs(self.tbCacheOptionData) do
|
||||
self.tbFilter[fKey] = v
|
||||
end
|
||||
self.tbCacheOptionData = {}
|
||||
end
|
||||
function FilterData:SetCacheFilterByKey(fKey, sKey, flag)
|
||||
if self.tbCacheFilter[fKey] == nil then
|
||||
self.tbCacheFilter[fKey] = {}
|
||||
|
||||
@@ -175,12 +175,19 @@ function PlayerPotentialPreselectionData:UnPackPotentialData(b64Str)
|
||||
})
|
||||
end
|
||||
local nMaxLevel = ConfigTable.GetConfigNumber("PotentialPreselectionMaxLevel")
|
||||
local unpack_potential = function(tbPotential, tbAll, bSpecial)
|
||||
local unpack_potential = function(tbPotential, tbAll, bSpecial, nSpecialCount)
|
||||
for _, nId in ipairs(tbAll) do
|
||||
if bSpecial then
|
||||
local flag = read_bits(1)
|
||||
if flag == 1 then
|
||||
table.insert(tbPotential, {Id = nId, Level = 1})
|
||||
if nSpecialCount then
|
||||
nSpecialCount = nSpecialCount + 1
|
||||
if 2 < nSpecialCount then
|
||||
printError("特殊潜能数量超过2")
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local nLevel = read_bits(3)
|
||||
@@ -197,14 +204,15 @@ function PlayerPotentialPreselectionData:UnPackPotentialData(b64Str)
|
||||
end
|
||||
for k, v in ipairs(tbCharPotential) do
|
||||
if v.CharId > 0 then
|
||||
local nSpecialCount = 0
|
||||
local potentialCfg = ConfigTable.GetData("CharPotential", v.CharId)
|
||||
if potentialCfg then
|
||||
local bAvailable = true
|
||||
if k == 1 then
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.MasterSpecificPotentialIds, true)
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.MasterSpecificPotentialIds, true, nSpecialCount)
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.MasterNormalPotentialIds, false)
|
||||
else
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.AssistSpecificPotentialIds, true)
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.AssistSpecificPotentialIds, true, nSpecialCount)
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.AssistNormalPotentialIds, false)
|
||||
end
|
||||
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.CommonPotentialIds, false)
|
||||
|
||||
Reference in New Issue
Block a user