天书密卷
parent
0b538b6e1e
commit
147d358e11
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9688251a9bcbb744f9586db49d18f885
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3d0047ade6df7174886f0227dd7bdeeb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 92d745c8cc0a3084680488befb2c76f2
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -845,11 +845,17 @@ RedPointType = {
|
|||
PokemonMainCity = 790,--灵兽主界面
|
||||
Pokemon_UpLv = 791,--灵兽升级
|
||||
Pokemon_UpStar = 792,--灵兽升星
|
||||
Pokemon_CanUpZhen = 793,--灵兽可上阵
|
||||
Pokemon_Fetter = 794,--灵兽羁绊
|
||||
Pokemon_CanUpZhen = 793,--灵兽可上阵
|
||||
Pokemon_Recruit = 795,--灵兽 御兽斋免费
|
||||
Pokemon_ChipCompound = 796,--灵兽 碎片合成
|
||||
|
||||
--羁绊
|
||||
Pokemon_Fetter = 794,--灵兽羁绊
|
||||
Hero_Fetter = 797, --神将羁绊
|
||||
SoulPrint_Fetter = 798, --魂印羁绊
|
||||
TianShuMiJuan = 799, --天书秘卷红点
|
||||
TianShuPokemon_Fetter = 800,--灵兽羁绊
|
||||
|
||||
--鸿蒙阵
|
||||
HongMeng = 801, -- 鸿蒙阵界面
|
||||
HongMeng_Evory = 8011, -- 鸿蒙使者格子
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ local ManagerNames = {
|
|||
--主题活动管理器
|
||||
"DynamicActivity/DynamicActivityManager",
|
||||
"Hero/HeroSkinManager",
|
||||
"TianShuMiJuan/TianShuMiJuanManger",
|
||||
--!!!!红点管理(尽量放在最后)!!!!--
|
||||
"Player/RedpotManager",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ GETPLAYERINFORESPONSE_HADADVANCELUCKTIME_FIELD = protobuf.FieldDescriptor();
|
|||
GETPLAYERINFORESPONSE_WORLDLEVE_FIELD = protobuf.FieldDescriptor();
|
||||
GETPLAYERINFORESPONSE_DEMONSTRIALREWARDINFO_FIELD = protobuf.FieldDescriptor();
|
||||
GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD = protobuf.FieldDescriptor();
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD = protobuf.FieldDescriptor();
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD = protobuf.FieldDescriptor();
|
||||
GETITEMINFOREQUEST = protobuf.Descriptor();
|
||||
GETITEMINFOREQUEST_INDEX_FIELD = protobuf.FieldDescriptor();
|
||||
GETITEMINFORESPONSE = protobuf.Descriptor();
|
||||
|
|
@ -1056,11 +1058,31 @@ GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD.message_type = CommonProto_pb.HEADFRAME
|
|||
GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD.type = 11
|
||||
GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD.cpp_type = 10
|
||||
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.name = "allFetters"
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.full_name = ".rpc.protocols.GetPlayerInfoResponse.allFetters"
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.number = 37
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.index = 36
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.label = 3
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.has_default_value = false
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.default_value = {}
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.type = 5
|
||||
GETPLAYERINFORESPONSE_ALLFETTERS_FIELD.cpp_type = 1
|
||||
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.name = "allSoulPrint"
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.full_name = ".rpc.protocols.GetPlayerInfoResponse.allSoulPrint"
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.number = 38
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.index = 37
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.label = 3
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.has_default_value = false
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.default_value = {}
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.type = 5
|
||||
GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD.cpp_type = 1
|
||||
|
||||
GETPLAYERINFORESPONSE.name = "GetPlayerInfoResponse"
|
||||
GETPLAYERINFORESPONSE.full_name = ".rpc.protocols.GetPlayerInfoResponse"
|
||||
GETPLAYERINFORESPONSE.nested_types = {}
|
||||
GETPLAYERINFORESPONSE.enum_types = {}
|
||||
GETPLAYERINFORESPONSE.fields = {GETPLAYERINFORESPONSE_PLAYER_FIELD, GETPLAYERINFORESPONSE_NEWPLAYERGUIDEPOINT_FIELD, GETPLAYERINFORESPONSE_PRIVILEGE_FIELD, GETPLAYERINFORESPONSE_GIFTGOODSINFO_FIELD, GETPLAYERINFORESPONSE_BUYGOODSID_FIELD, GETPLAYERINFORESPONSE_SUDDENLYBOSSINFO_FIELD, GETPLAYERINFORESPONSE_VIPLEVETAKE_FIELD, GETPLAYERINFORESPONSE_USERCREATETIME_FIELD, GETPLAYERINFORESPONSE_REDTYPE_FIELD, GETPLAYERINFORESPONSE_RANDCOUNT_FIELD, GETPLAYERINFORESPONSE_HEROHANDBOOK_FIELD, GETPLAYERINFORESPONSE_EQUIPHANDBOOK_FIELD, GETPLAYERINFORESPONSE_TOWERRECEIVEDREWARD_FIELD, GETPLAYERINFORESPONSE_GOODSTYPEDURATION_FIELD, GETPLAYERINFORESPONSE_TREASURELEVEL_FIELD, GETPLAYERINFORESPONSE_HADBUYTREASURE_FIELD, GETPLAYERINFORESPONSE_SIGNININFO_FIELD, GETPLAYERINFORESPONSE_FIRSTTENTH_FIELD, GETPLAYERINFORESPONSE_MONSTERATTACKTIME_FIELD, GETPLAYERINFORESPONSE_ISDAYFIRST_FIELD, GETPLAYERINFORESPONSE_ENDINFO_FIELD, GETPLAYERINFORESPONSE_PLAYERBINDPHONE_FIELD, GETPLAYERINFORESPONSE_QUESTIONSTATE_FIELD, GETPLAYERINFORESPONSE_SOULEQUIPPOOL_FIELD, GETPLAYERINFORESPONSE_PLAYEDMAPTYPES_FIELD, GETPLAYERINFORESPONSE_AMOUNT_FIELD, GETPLAYERINFORESPONSE_VIPDAILY_FIELD, GETPLAYERINFORESPONSE_MISSINGREFRESHCOUNT_FIELD, GETPLAYERINFORESPONSE_MONTHINFOS_FIELD, GETPLAYERINFORESPONSE_DAILYCHALLENGEINFO_FIELD, GETPLAYERINFORESPONSE_EXPEDITIONLEVE_FIELD, GETPLAYERINFORESPONSE_HADLUCKTIME_FIELD, GETPLAYERINFORESPONSE_HADADVANCELUCKTIME_FIELD, GETPLAYERINFORESPONSE_WORLDLEVE_FIELD, GETPLAYERINFORESPONSE_DEMONSTRIALREWARDINFO_FIELD, GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD}
|
||||
GETPLAYERINFORESPONSE.fields = {GETPLAYERINFORESPONSE_PLAYER_FIELD, GETPLAYERINFORESPONSE_NEWPLAYERGUIDEPOINT_FIELD, GETPLAYERINFORESPONSE_PRIVILEGE_FIELD, GETPLAYERINFORESPONSE_GIFTGOODSINFO_FIELD, GETPLAYERINFORESPONSE_BUYGOODSID_FIELD, GETPLAYERINFORESPONSE_SUDDENLYBOSSINFO_FIELD, GETPLAYERINFORESPONSE_VIPLEVETAKE_FIELD, GETPLAYERINFORESPONSE_USERCREATETIME_FIELD, GETPLAYERINFORESPONSE_REDTYPE_FIELD, GETPLAYERINFORESPONSE_RANDCOUNT_FIELD, GETPLAYERINFORESPONSE_HEROHANDBOOK_FIELD, GETPLAYERINFORESPONSE_EQUIPHANDBOOK_FIELD, GETPLAYERINFORESPONSE_TOWERRECEIVEDREWARD_FIELD, GETPLAYERINFORESPONSE_GOODSTYPEDURATION_FIELD, GETPLAYERINFORESPONSE_TREASURELEVEL_FIELD, GETPLAYERINFORESPONSE_HADBUYTREASURE_FIELD, GETPLAYERINFORESPONSE_SIGNININFO_FIELD, GETPLAYERINFORESPONSE_FIRSTTENTH_FIELD, GETPLAYERINFORESPONSE_MONSTERATTACKTIME_FIELD, GETPLAYERINFORESPONSE_ISDAYFIRST_FIELD, GETPLAYERINFORESPONSE_ENDINFO_FIELD, GETPLAYERINFORESPONSE_PLAYERBINDPHONE_FIELD, GETPLAYERINFORESPONSE_QUESTIONSTATE_FIELD, GETPLAYERINFORESPONSE_SOULEQUIPPOOL_FIELD, GETPLAYERINFORESPONSE_PLAYEDMAPTYPES_FIELD, GETPLAYERINFORESPONSE_AMOUNT_FIELD, GETPLAYERINFORESPONSE_VIPDAILY_FIELD, GETPLAYERINFORESPONSE_MISSINGREFRESHCOUNT_FIELD, GETPLAYERINFORESPONSE_MONTHINFOS_FIELD, GETPLAYERINFORESPONSE_DAILYCHALLENGEINFO_FIELD, GETPLAYERINFORESPONSE_EXPEDITIONLEVE_FIELD, GETPLAYERINFORESPONSE_HADLUCKTIME_FIELD, GETPLAYERINFORESPONSE_HADADVANCELUCKTIME_FIELD, GETPLAYERINFORESPONSE_WORLDLEVE_FIELD, GETPLAYERINFORESPONSE_DEMONSTRIALREWARDINFO_FIELD, GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD, GETPLAYERINFORESPONSE_ALLFETTERS_FIELD, GETPLAYERINFORESPONSE_ALLSOULPRINT_FIELD}
|
||||
GETPLAYERINFORESPONSE.is_extendable = false
|
||||
GETPLAYERINFORESPONSE.extensions = {}
|
||||
GETITEMINFOREQUEST_INDEX_FIELD.name = "index"
|
||||
|
|
|
|||
|
|
@ -222,6 +222,9 @@ function this.PlayerInfoRequest(func)
|
|||
QinglongSerectTreasureManager.SetLevel(msg.treasureLevel)
|
||||
QinglongSerectTreasureManager.SetTreasureBuyStatus(msg.hadBuyTreasure)
|
||||
PlayerManager.RefreshWorldLeveData(msg.worldLeve)
|
||||
|
||||
TianShuMiJuanManger.UpdateFetterId(msg.allFetters)
|
||||
SoulPrintManager.UpdateAllHavedSoulPrint(msg.allSoulPrint)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
|
|
@ -854,7 +857,6 @@ function this.DiffMonsterRequest(_start,func)
|
|||
PokemonManager.InitPokemonsData(msg.pokemonInfo)--pokemonInfo)
|
||||
if not msg.pokemonInfo or (msg.pokemonInfo and #msg.pokemonInfo < 20) then
|
||||
PokemonManager.UpdatePokemonFormationDatas(msg.teamPokemonInfos)--msg.pokemonInfo)
|
||||
PokemonManager.InitPokemonsFetterData(msg.pokemonBookEnabled)
|
||||
PokemonManager.InitPokemonsGetrData(msg.pokemonGot)
|
||||
if func then
|
||||
func(msg)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ function this.UpdatePokemonDatas(_msgPokemonData,isRefreshFetter)--单个掉落
|
|||
pokemons[singPokemonData.dynamicId] = singPokemonData
|
||||
if isRefreshFetter then
|
||||
this.GetPokemonRefreshFetter(singPokemonData.id)
|
||||
CheckRedPointStatus(RedPointType.Pokemon_Fetter)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -267,54 +266,12 @@ function this.InitPokemonsGetrData(_msgPokemonGetList)
|
|||
if not _msgPokemonGetList then
|
||||
return
|
||||
end
|
||||
--Log("灵兽羁绊" .. #_msgPokemonFetterList)
|
||||
pokemonGet = {}
|
||||
-- LogRed("_msgPokemonGetList[i]:"..#_msgPokemonGetList)
|
||||
for i = 1, #_msgPokemonGetList do
|
||||
-- LogRed("_msgPokemonGetList[i]:".._msgPokemonGetList[i])
|
||||
pokemonGet[_msgPokemonGetList[i]] = _msgPokemonGetList[i]
|
||||
end
|
||||
end
|
||||
|
||||
function this.InitPokemonsFetterData(_msgPokemonFetterList)
|
||||
-- Log("灵兽羁绊" .. #_msgPokemonFetterList)
|
||||
pokemonFetter = {}
|
||||
if not _msgPokemonFetterList then
|
||||
return
|
||||
end
|
||||
for i = 1, #_msgPokemonFetterList do
|
||||
this.UpdatePokemonFetterDatas(_msgPokemonFetterList[i])
|
||||
end
|
||||
end
|
||||
|
||||
--刷新本地灵兽羁绊数据
|
||||
function this.UpdatePokemonFetterDatas(_msgPokemonFetter)
|
||||
local singPokemonFetterData = {}
|
||||
pokemonFetter[_msgPokemonFetter] = _msgPokemonFetter
|
||||
end
|
||||
|
||||
function this.GetAllPokemonFetterDatas()
|
||||
local SpiritAnimalBookList = {}
|
||||
local singPokemonFetterData = {}
|
||||
local curPokemonSidList = this.GetAllPokemonGetDatas()
|
||||
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.SpiritAnimalBook)) do
|
||||
if v.FetterType == 3 then
|
||||
local singPokemonFetterData = {}
|
||||
singPokemonFetterData.id = v.Id
|
||||
if pokemonFetter and pokemonFetter[singPokemonFetterData.id] then
|
||||
singPokemonFetterData.enabled = 1--已经激活的
|
||||
elseif this.IsCompound(v.Teamers,curPokemonSidList) then
|
||||
singPokemonFetterData.enabled = 0--可以激活的
|
||||
else
|
||||
singPokemonFetterData.enabled = -1--不能激活的
|
||||
end
|
||||
table.insert(SpiritAnimalBookList,singPokemonFetterData)
|
||||
end
|
||||
end
|
||||
-- LogGreen("#SpiritAnimalBookList:"..#SpiritAnimalBookList)
|
||||
return SpiritAnimalBookList
|
||||
end
|
||||
|
||||
function this.GetAllPokemonGetDatas()
|
||||
return pokemonGet
|
||||
end
|
||||
|
|
@ -324,7 +281,8 @@ function this.GetPokemonRefreshFetter(_sid)
|
|||
if pokemonGet[_sid] then
|
||||
return
|
||||
end
|
||||
pokemonGet[_sid] = _sid
|
||||
pokemonGet[_sid] = _sid
|
||||
TianShuMiJuanManger.CheckFetterStatus(3)
|
||||
end
|
||||
|
||||
--获取所有的灵兽种类
|
||||
|
|
@ -338,34 +296,12 @@ end
|
|||
|
||||
--获取所有灵兽羁绊总和属性 (羁绊属性直接加在团队属性上)
|
||||
function this.GetAllPokemonFetterAddPros()
|
||||
local addAllProVal = {}
|
||||
for key, value in pairs(pokemonFetter) do
|
||||
local curspiritAnimalBook = spiritAnimalBook[key]
|
||||
if curspiritAnimalBook and #curspiritAnimalBook.ActivePara > 0 then
|
||||
for i = 1, #curspiritAnimalBook.ActivePara do
|
||||
local curPro = curspiritAnimalBook.ActivePara[i]
|
||||
if curPro[2] > 0 then
|
||||
if addAllProVal[curPro[1]] then
|
||||
addAllProVal[curPro[1]]=addAllProVal[curPro[1]]+curPro[2]
|
||||
else
|
||||
addAllProVal[curPro[1]]=curPro[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return addAllProVal
|
||||
return TianShuMiJuanManger.GetAllFetterAddProsBy(3)
|
||||
end
|
||||
|
||||
----获取所有灵兽羁绊总和静态战力
|
||||
function this.GetAllPokemonFetterAddProsSWarPower()
|
||||
local addPowerVal = 0
|
||||
for key, value in pairs(pokemonFetter) do
|
||||
local curspiritAnimalBook = spiritAnimalBook[key]
|
||||
if curspiritAnimalBook and curspiritAnimalBook.ActiveForce > 0 then
|
||||
addPowerVal = addPowerVal + curspiritAnimalBook.ActiveForce
|
||||
end
|
||||
end
|
||||
return addPowerVal
|
||||
return TianShuMiJuanManger.GetAllPokemonFetterAddProsSWarPower(3)
|
||||
end
|
||||
|
||||
---------------------------------------------
|
||||
|
|
@ -593,32 +529,9 @@ end
|
|||
|
||||
--可激活的羁绊
|
||||
function this.RefreshPokemonFetterRedPoint()
|
||||
local isOpen = ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.POKEMON)
|
||||
if not isOpen then
|
||||
return false
|
||||
end
|
||||
local curGetAllPokemonFetter = this.GetAllPokemonFetterDatas()
|
||||
for k,v in ipairs(curGetAllPokemonFetter) do
|
||||
if v.enabled == 0 then
|
||||
-- LogPink("可激活的羁绊true")
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- LogPink("可激活的羁绊false")
|
||||
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
|
||||
this.CheckRedPoint(3)
|
||||
end
|
||||
|
||||
--免费抽卡次数
|
||||
function this.RefreshPokemonRecruitRedPoint()
|
||||
local isOpen = ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.POKEMON)
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ function this.SingleItemDataShow(_go,_fetterData)
|
|||
end
|
||||
|
||||
function this:OnClose()
|
||||
CheckRedPointStatus(RedPointType.Pokemon_Fetter)
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@ this.soulEquipPool=0
|
|||
local remainExp = {}
|
||||
local currentNeedExp = {}
|
||||
local currentProprty = {}
|
||||
|
||||
|
||||
|
||||
local singleSoulPrintData=
|
||||
{
|
||||
sid = 0,
|
||||
|
|
@ -36,7 +33,27 @@ function this.Initialize()
|
|||
this.chooseExpShow=0
|
||||
this.chooseLevelShow=0
|
||||
this.chooseExpUpLevel=0
|
||||
this.allHavedSoulPrint = {} --拥有过的魂印
|
||||
end
|
||||
|
||||
function this.UpdateAllHavedSoulPrint(allSoulPrint)
|
||||
local isCheck = false
|
||||
for i = 1 ,#allSoulPrint do
|
||||
if not this.allHavedSoulPrint[allSoulPrint] then
|
||||
isCheck = true
|
||||
this.allHavedSoulPrint[allSoulPrint] = allSoulPrint
|
||||
end
|
||||
end
|
||||
if isCheck then
|
||||
TianShuMiJuanManger.CheckFetterStatus(2)
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetAllHavedSoulPrint()
|
||||
return this.allHavedSoulPrint
|
||||
end
|
||||
|
||||
|
||||
function this.CreateSoulPrintData()
|
||||
return {
|
||||
--升级后剩余经验
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b9fc9300f006668459eb326552d599a2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
require("Base/BasePanel")
|
||||
local TianShuMiJuanMainPanel = Inherit(BasePanel)
|
||||
local this = TianShuMiJuanMainPanel
|
||||
-- Tab管理器
|
||||
local TabBox = require("Modules/Common/TabBox")
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:InitComponent()
|
||||
|
||||
-- 上部货币显示
|
||||
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft})
|
||||
end
|
||||
--绑定事件(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:BindEvent()
|
||||
-- 初始化Tab管理器
|
||||
this.PageTabCtrl = TabBox.New()
|
||||
this.PageTabCtrl:SetTabAdapter(this.PageTabAdapter)
|
||||
this.PageTabCtrl:SetTabIsLockCheck(this.PageTabIsLockCheck)
|
||||
this.PageTabCtrl:SetChangeTabCallBack(this.OnPageTabChange)
|
||||
-- 关闭界面打开主城
|
||||
Util.AddClick(this.btnBack, function()
|
||||
this:ClosePanel()
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:AddListener()
|
||||
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:RemoveListener()
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:OnOpen(chooseIndex)
|
||||
|
||||
end
|
||||
|
||||
-- 打开,重新打开时回调
|
||||
function TianShuMiJuanMainPanel:OnShow()
|
||||
|
||||
end
|
||||
|
||||
----==========================一级页签相关===========================================
|
||||
-- tab按钮自定义显示设置
|
||||
function this.PageTabAdapter(tab, index, status)
|
||||
local img = Util.GetGameObject(tab, "img"):GetComponent("Image")
|
||||
local lock = Util.GetGameObject(tab, "lock")
|
||||
local redpot = Util.GetGameObject(tab, "redpot")
|
||||
|
||||
img.sprite = Util.LoadSprite(tabs[index][status])
|
||||
img:SetNativeSize()
|
||||
local islock = status == "lock"
|
||||
Util.SetGray(img.gameObject, islock)
|
||||
lock:SetActive(islock)
|
||||
|
||||
-- 判断是否需要检测红点
|
||||
redpot:SetActive(false)
|
||||
if not islock then
|
||||
this.ClearPageRedpot(index)
|
||||
this.BindPageRedpot(index, redpot)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- tab可用性检测
|
||||
function this.PageTabIsLockCheck(index)
|
||||
return false
|
||||
end
|
||||
|
||||
-- tab改变事件
|
||||
function this.OnPageTabChange(index)
|
||||
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:OnClose()
|
||||
|
||||
end
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function TianShuMiJuanMainPanel:OnDestroy()
|
||||
SubUIManager.Close(this.UpView)
|
||||
end
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2de099396f6d3a849834f372e33eaa11
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
MonsterCampManager = {}
|
||||
local this = TianShuMiJuanManger
|
||||
this.fetterData = {}
|
||||
--读表
|
||||
function this.Initialize()
|
||||
this.fetterData = {}
|
||||
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.SpiritAnimalBook)) do
|
||||
local configData = this.CreatSingleConfigData(v)
|
||||
this.fetterData[configData.id] = configData
|
||||
end
|
||||
end
|
||||
|
||||
function this.CreatSingleConfigData(configData)
|
||||
local data = {}
|
||||
data.id = configData.id
|
||||
data.name = GetLanguageStrById(configData.Name)
|
||||
data.teamers = configData.Teamers
|
||||
data.activePara = configData.ActivePara
|
||||
data.activeForce = configData.ActiveForce
|
||||
data.fetterType = configData.Type
|
||||
data.reward = configData.Reward
|
||||
data.openLevel = configData.OpenLevel
|
||||
data.enabled = -1
|
||||
return data
|
||||
end
|
||||
|
||||
--刷新已经激活的羁绊
|
||||
function this.UpdateFetterId(ids)
|
||||
for i = 1, #ids do
|
||||
if this.fetterData[ids[i]] then
|
||||
this.fetterData[ids[i]].enabled = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--检测条件变化,判断羁绊是否可激活
|
||||
function this.CheckFetterStatus(fetterType)
|
||||
if fetterType == 1 then
|
||||
local curPokemonSidList = PlayerManager.heroHandBook
|
||||
this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
|
||||
CheckRedPointStatus(RedPointType.Hero_Fetter)
|
||||
elseif fetterType == 2 then
|
||||
local curPokemonSidList = SoulPrintManager.GetAllHavedSoulPrint()
|
||||
this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
|
||||
CheckRedPointStatus(RedPointType.SoulPrint_Fetter)
|
||||
elseif fetterType == 3 then
|
||||
local curPokemonSidList = PokemonManager.GetAllPokemonGetDatas()
|
||||
this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
|
||||
CheckRedPointStatus(RedPointType.Pokemon_Fetter)
|
||||
CheckRedPointStatus(RedPointType.TianShuPokemon_Fetter)
|
||||
end
|
||||
end
|
||||
|
||||
--刷新羁绊状态
|
||||
function this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
|
||||
local SpiritAnimalBookList = {}
|
||||
for k,v in pairs(this.fetterData) do
|
||||
if v.FetterType == fetterType and v.enabled == -1 then
|
||||
if this.IsCompound(v.teamers,curPokemonSidList) then
|
||||
v.enabled = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this.CheckRedPoint(fetterType)
|
||||
for k,v in pairs(this.fetterData) do
|
||||
if v.FetterType == fetterType and v.enabled == 0 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
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
|
||||
|
||||
--根据type获取羁绊数据
|
||||
function this.GetFetterDataByFetterType(fetterType)
|
||||
local data = {}
|
||||
for k,v in pairs(this.fetterData) do
|
||||
if v.fetterType == fetterType then
|
||||
table.insert(data,v)
|
||||
end
|
||||
end
|
||||
return data
|
||||
end
|
||||
|
||||
--获取所有羁绊总和属性 (羁绊属性直接加在团队属性上)
|
||||
function this.GetAllFetterAddProsBy(fetterType)
|
||||
local fetterData = this.GetFetterDataByFetterType(fetterType)
|
||||
local addAllProVal = {}
|
||||
for key, value in pairs(fetterData) do
|
||||
if value.enabled == 1 and #value.activePara > 0 then
|
||||
for i = 1, #value.activePara do
|
||||
local curPro = value.activePara[i]
|
||||
if curPro[2] > 0 then
|
||||
if addAllProVal[curPro[1]] then
|
||||
addAllProVal[curPro[1]]=addAllProVal[curPro[1]]+curPro[2]
|
||||
else
|
||||
addAllProVal[curPro[1]]=curPro[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return addAllProVal
|
||||
end
|
||||
|
||||
----获取所有羁绊总和静态战力
|
||||
function this.GetAllPokemonFetterAddProsSWarPower(fetterType)
|
||||
local fetterData = this.GetFetterDataByFetterType(fetterType)
|
||||
local addPowerVal = 0
|
||||
for key, value in pairs(fetterData) do
|
||||
if value.enabled == 1 and value.activeForce > 0 then
|
||||
addPowerVal = addPowerVal + value.ActiveForce
|
||||
end
|
||||
end
|
||||
return addPowerVal
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d9080345e626efd45bfb95351fda0a8a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue