From 87b9c2dd0dbe12cb3a4f2b1ceea8d7cde3a1ccc6 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Thu, 29 Oct 2020 16:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=B5=E5=85=BD=E7=BE=81=E7=BB=8A=EF=BC=8C?= =?UTF-8?q?=E5=BE=A1=E5=85=BD=E6=96=8B=E7=BA=A2=E7=82=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Pokemon/PokemonManager.lua | 63 +++++++++++-------- .../~Lua/Modules/Recruit/RecruitManager.lua | 3 +- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua index 9ba386be57..235ca55b26 100644 --- a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua @@ -228,29 +228,8 @@ function this.GetPokemonRefreshFetter(_sid) if pokemonGet[_sid] then return end - pokemonGet[_sid] = _sid - local allActivityFetterIds = {} - 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 + pokemonGet[_sid] = _sid + CheckRedPointStatus(RedPointType.Pokemon_Fetter) end --获取所有的灵兽种类 @@ -518,11 +497,43 @@ end --可激活的羁绊 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 - --免费抽卡次数 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 return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua index 8b89ca361e..060f35c6dd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua @@ -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 NetManager.RecruitRequest(recruitType, function(msg) 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 PrivilegeManager.RefreshPrivilegeUsedTimes(privilegeId, 1) this.freeUseTimeList[privilegeId] = PrivilegeManager.GetPrivilegeRemainValue(privilegeId) @@ -49,6 +49,7 @@ function this.RecruitRequest(recruitType, func, privilegeId,_itemId,_itemNum) CheckRedPointStatus(RedPointType.Recruit_Normal) CheckRedPointStatus(RedPointType.TimeLimited) CheckRedPointStatus(RedPointType.QianKunBox) + CheckRedPointStatus(RedPointType.Pokemon_Recruit) end end if func then