灵兽羁绊,御兽斋红点提交
parent
d3b53a0eba
commit
87b9c2dd0d
|
|
@ -228,29 +228,8 @@ function this.GetPokemonRefreshFetter(_sid)
|
||||||
if pokemonGet[_sid] then
|
if pokemonGet[_sid] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pokemonGet[_sid] = _sid
|
pokemonGet[_sid] = _sid
|
||||||
local allActivityFetterIds = {}
|
CheckRedPointStatus(RedPointType.Pokemon_Fetter)
|
||||||
for key, configInfo in ConfigPairs(ConfigManager.GetConfig(ConfigName.SpiritAnimalBook)) do
|
|
||||||
if pokemonFetter[key] then--已有的羁绊去掉
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local stateNum = 0
|
|
||||||
for i = 1, #configInfo.Teamers do
|
|
||||||
if configInfo.Teamers[i] == _sid then
|
|
||||||
stateNum = stateNum + 1
|
|
||||||
else
|
|
||||||
if pokemonGet[configInfo.Teamers[i]] then
|
|
||||||
stateNum = stateNum + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if stateNum >= #configInfo.Teamers then
|
|
||||||
table.insert(allActivityFetterIds,configInfo)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #allActivityFetterIds > 0 then
|
|
||||||
--CheckRedPointStatus()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--获取所有的灵兽种类
|
--获取所有的灵兽种类
|
||||||
|
|
@ -518,11 +497,43 @@ end
|
||||||
|
|
||||||
--可激活的羁绊
|
--可激活的羁绊
|
||||||
function this.RefreshPokemonFetterRedPoint()
|
function this.RefreshPokemonFetterRedPoint()
|
||||||
|
local curGetAllPokemonFetter = this.GetAllPokemonFetterDatas()
|
||||||
|
local curPokemonSidList = this.GetAllPokemonGetDatas()
|
||||||
|
for k,v in ipairs(curGetAllPokemonFetter) do
|
||||||
|
local config = spiritAnimalBook[v.id]
|
||||||
|
local isCompound = this:IsCompound(config.Teamers,curPokemonSidList)
|
||||||
|
if v.enabled == 0 and isCompound then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
function this.IsCompound(Teamers,curPokemonSidList)
|
||||||
|
local isCompound = true
|
||||||
|
for k,v in ipairs(Teamers) do
|
||||||
|
if curPokemonSidList[v] == nil then
|
||||||
|
if isCompound then
|
||||||
|
isCompound = false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return isCompound
|
||||||
end
|
end
|
||||||
|
|
||||||
--免费抽卡次数
|
--免费抽卡次数
|
||||||
function this.RefreshPokemonRecruitRedPoint()
|
function this.RefreshPokemonRecruitRedPoint()
|
||||||
|
--获取免费次数
|
||||||
|
local currLottery= ConfigManager.GetConfigData(ConfigName.LotterySetting,RecruitType.LingShowSingle)
|
||||||
|
local freeTimesId=currLottery.FreeTimes
|
||||||
|
local freeTime = 0
|
||||||
|
if freeTimesId>0 then
|
||||||
|
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
|
||||||
|
end
|
||||||
|
local isFree = freeTime and freeTime >= 1
|
||||||
|
if isFree then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return this
|
return this
|
||||||
|
|
@ -41,7 +41,7 @@ function this.RecruitRequest(recruitType, func, privilegeId,_itemId,_itemNum)
|
||||||
if BagManager.GetItemCountById(itemId) >= itemNum or (this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1) then
|
if BagManager.GetItemCountById(itemId) >= itemNum or (this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1) then
|
||||||
NetManager.RecruitRequest(recruitType, function(msg)
|
NetManager.RecruitRequest(recruitType, function(msg)
|
||||||
local data = ConfigManager.GetConfigData(ConfigName.LotterySetting,recruitType)
|
local data = ConfigManager.GetConfigData(ConfigName.LotterySetting,recruitType)
|
||||||
if (RecruitType.Single == recruitType or RecruitType.NormalSingle==recruitType or (data.LotteryType == 3 and data.PerCount == 1) or(data.LotteryType == 9 and data.PerCount == 1) or RecruitType.LingShowSingle==recruitType ) then --若某抽卡类型有免费次数
|
if (RecruitType.Single == recruitType or RecruitType.NormalSingle==recruitType or (data.LotteryType == 3 and data.PerCount == 1) or(data.LotteryType == 9 and data.PerCount == 1) or RecruitType.LingShowSingle== recruitType ) then --若某抽卡类型有免费次数
|
||||||
if this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1 then
|
if this.freeUseTimeList[privilegeId] and this.freeUseTimeList[privilegeId] >= 1 then
|
||||||
PrivilegeManager.RefreshPrivilegeUsedTimes(privilegeId, 1)
|
PrivilegeManager.RefreshPrivilegeUsedTimes(privilegeId, 1)
|
||||||
this.freeUseTimeList[privilegeId] = PrivilegeManager.GetPrivilegeRemainValue(privilegeId)
|
this.freeUseTimeList[privilegeId] = PrivilegeManager.GetPrivilegeRemainValue(privilegeId)
|
||||||
|
|
@ -49,6 +49,7 @@ function this.RecruitRequest(recruitType, func, privilegeId,_itemId,_itemNum)
|
||||||
CheckRedPointStatus(RedPointType.Recruit_Normal)
|
CheckRedPointStatus(RedPointType.Recruit_Normal)
|
||||||
CheckRedPointStatus(RedPointType.TimeLimited)
|
CheckRedPointStatus(RedPointType.TimeLimited)
|
||||||
CheckRedPointStatus(RedPointType.QianKunBox)
|
CheckRedPointStatus(RedPointType.QianKunBox)
|
||||||
|
CheckRedPointStatus(RedPointType.Pokemon_Recruit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if func then
|
if func then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue