【修行】提交

dev_chengFeng
ZhangBiao 2021-05-13 17:37:47 +08:00
parent 98e4de79b2
commit 8df2338780
9 changed files with 3305 additions and 76 deletions

View File

@ -191,7 +191,8 @@ ConfigName = {
ComposeActivity = "ComposeActivity",
ComposeBook = "ComposeBook",
StoryMapConfig = "StoryMapConfig",
XiuXianConfig = "XiuXian"
XiuXianConfig = "XiuXian",
XiuXianSkillConfig = "XiuXianSkill",
}
require "Framework/GameDataBase"

View File

@ -199,13 +199,13 @@ HONGMENGSTELENEWHANDINDICATION = protobuf.Descriptor();
HONGMENGSTELENEWHANDINDICATION_STATE_FIELD = protobuf.FieldDescriptor();
UPPRACTICELEVELREQUEST = protobuf.Descriptor();
UPPRACTICELEVELRESPONSE = protobuf.Descriptor();
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD = protobuf.FieldDescriptor();
REPLACEPURPLEMANSIONSEALREQUEST = protobuf.Descriptor();
REPLACEPURPLEMANSIONSEALREQUEST_OLDSEALID_FIELD = protobuf.FieldDescriptor();
REPLACEPURPLEMANSIONSEALREQUEST_NEWSEALID_FIELD = protobuf.FieldDescriptor();
REPLACEPURPLEMANSIONSEALREQUEST_SUBID_FIELD = protobuf.FieldDescriptor();
REPLACEPRUPLEMANSIONSEALRESPONSE = protobuf.Descriptor();
PURPLEMANSIONSEALINDICATION = protobuf.Descriptor();
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD = protobuf.FieldDescriptor();
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD = protobuf.FieldDescriptor();
GETHEROLISTINFOREQUEST_INDEX_FIELD.name = "index"
GETHEROLISTINFOREQUEST_INDEX_FIELD.full_name = ".rpc.protocols.GetHeroListInfoRequest.index"
@ -1963,11 +1963,21 @@ UPPRACTICELEVELREQUEST.enum_types = {}
UPPRACTICELEVELREQUEST.fields = {}
UPPRACTICELEVELREQUEST.is_extendable = false
UPPRACTICELEVELREQUEST.extensions = {}
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.name = "practiceLevel"
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.full_name = ".rpc.protocols.UpPracticeLevelResponse.practiceLevel"
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.number = 1
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.index = 0
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.label = 1
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.has_default_value = false
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.default_value = 0
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.type = 5
UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD.cpp_type = 1
UPPRACTICELEVELRESPONSE.name = "UpPracticeLevelResponse"
UPPRACTICELEVELRESPONSE.full_name = ".rpc.protocols.UpPracticeLevelResponse"
UPPRACTICELEVELRESPONSE.nested_types = {}
UPPRACTICELEVELRESPONSE.enum_types = {}
UPPRACTICELEVELRESPONSE.fields = {}
UPPRACTICELEVELRESPONSE.fields = {UPPRACTICELEVELRESPONSE_PRACTICELEVEL_FIELD}
UPPRACTICELEVELRESPONSE.is_extendable = false
UPPRACTICELEVELRESPONSE.extensions = {}
REPLACEPURPLEMANSIONSEALREQUEST_OLDSEALID_FIELD.name = "oldSealId"
@ -2007,31 +2017,24 @@ REPLACEPURPLEMANSIONSEALREQUEST.enum_types = {}
REPLACEPURPLEMANSIONSEALREQUEST.fields = {REPLACEPURPLEMANSIONSEALREQUEST_OLDSEALID_FIELD, REPLACEPURPLEMANSIONSEALREQUEST_NEWSEALID_FIELD, REPLACEPURPLEMANSIONSEALREQUEST_SUBID_FIELD}
REPLACEPURPLEMANSIONSEALREQUEST.is_extendable = false
REPLACEPURPLEMANSIONSEALREQUEST.extensions = {}
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.name = "sealList"
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.full_name = ".rpc.protocols.ReplacePrupleMansionSealResponse.sealList"
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.number = 1
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.index = 0
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.label = 3
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.has_default_value = false
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.default_value = {}
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.message_type = CommonProto_pb.PURPLEMANSIONSEAL
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.type = 11
REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD.cpp_type = 10
REPLACEPRUPLEMANSIONSEALRESPONSE.name = "ReplacePrupleMansionSealResponse"
REPLACEPRUPLEMANSIONSEALRESPONSE.full_name = ".rpc.protocols.ReplacePrupleMansionSealResponse"
REPLACEPRUPLEMANSIONSEALRESPONSE.nested_types = {}
REPLACEPRUPLEMANSIONSEALRESPONSE.enum_types = {}
REPLACEPRUPLEMANSIONSEALRESPONSE.fields = {}
REPLACEPRUPLEMANSIONSEALRESPONSE.fields = {REPLACEPRUPLEMANSIONSEALRESPONSE_SEALLIST_FIELD}
REPLACEPRUPLEMANSIONSEALRESPONSE.is_extendable = false
REPLACEPRUPLEMANSIONSEALRESPONSE.extensions = {}
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.name = "sealList"
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.full_name = ".rpc.protocols.PurpleMansionSealIndication.sealList"
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.number = 1
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.index = 0
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.label = 3
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.has_default_value = false
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.default_value = {}
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.message_type = CommonProto_pb.PURPLEMANSIONSEAL
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.type = 11
PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD.cpp_type = 10
PURPLEMANSIONSEALINDICATION.name = "PurpleMansionSealIndication"
PURPLEMANSIONSEALINDICATION.full_name = ".rpc.protocols.PurpleMansionSealIndication"
PURPLEMANSIONSEALINDICATION.nested_types = {}
PURPLEMANSIONSEALINDICATION.enum_types = {}
PURPLEMANSIONSEALINDICATION.fields = {PURPLEMANSIONSEALINDICATION_SEALLIST_FIELD}
PURPLEMANSIONSEALINDICATION.is_extendable = false
PURPLEMANSIONSEALINDICATION.extensions = {}
AllBookEnableRequest = protobuf.Message(ALLBOOKENABLEREQUEST)
CancelHeroChangeRequest = protobuf.Message(CANCELHEROCHANGEREQUEST)
@ -2087,7 +2090,6 @@ PokemonFreeRequest = protobuf.Message(POKEMONFREEREQUEST)
PokemonFreeResponse = protobuf.Message(POKEMONFREERESPONSE)
PokenmonUpLevelRequest = protobuf.Message(POKENMONUPLEVELREQUEST)
PokenmonUpLevelResponse = protobuf.Message(POKENMONUPLEVELRESPONSE)
PurpleMansionSealIndication = protobuf.Message(PURPLEMANSIONSEALINDICATION)
ReplacePrupleMansionSealResponse = protobuf.Message(REPLACEPRUPLEMANSIONSEALRESPONSE)
ReplacePurpleMansionSealRequest = protobuf.Message(REPLACEPURPLEMANSIONSEALREQUEST)
ReplaceTeamPokemonInfoRequest = protobuf.Message(REPLACETEAMPOKEMONINFOREQUEST)

File diff suppressed because one or more lines are too long

View File

@ -43,7 +43,7 @@ function PracticeStatePreview:OnShow(_parent,_args)
self:SetSingleData(index,go,self.previewData[index])
end)
ForceRebuildLayout(self.GameObject.transform)
self.ScrollView:SetIndex(PracticeManager.PracticeBigLevel)
self.ScrollView:SetIndex(PracticeManager.PracticeBigLevel - 1 > 0 and PracticeManager.PracticeBigLevel - 1 or 1)
end
function PracticeStatePreview:SetSingleData(index,_go,_data)

View File

@ -224,7 +224,9 @@ function this.PlayerInfoRequest(func)
QinglongSerectTreasureManager.SetTreasureBuyStatus(msg.hadBuyTreasure)
PlayerManager.RefreshWorldLeveData(msg.worldLeve)
PlayerManager.InitSkinTitleMountData(msg.userSkinList,msg.userTitleList,msg.userMountList)
PracticeManager.UpdataFromServer(msg.practiceLevel)
--修行
PracticeManager.UpdataFromServer(msg.practiceLevel)--修行等级
PracticeManager.UpdataImprintDataFromServer(msg.sealList)--神印列表
if func then
func(msg)
end
@ -5013,9 +5015,13 @@ function this.PracticeImprintRequest(_oldSealId,_newSealId,_subId,func)
data.newSealId = _newSealId
data.subId = _subId
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.ReplacePurpleMansionSealRequest, MessageTypeProto_pb.ReplacePurpleMansionSealResponse, msg, function()
Network:SendMessageWithCallBack(MessageTypeProto_pb.ReplacePurpleMansionSealRequest, MessageTypeProto_pb.ReplacePurpleMansionSealResponse, msg, function(buffer)
local data = buffer:DataByte()
local msg = HeroInfoProto_pb.ReplacePrupleMansionSealResponse()
msg:ParseFromString(data)
PracticeManager.UpdataImprintDataFromServer(msg.sealList)
if func then
func()
func(msg)
end
end)
end

View File

@ -1,14 +1,41 @@
local PracticeImprint = quick_class("PracticeImprint", BasePanel)
local orginLayer
local curImprintData={}
function PracticeImprint:InitComponent()
self.backBtn = Util.GetGameObject(self.gameObject, "backBtn")
self.Scroll = Util.GetGameObject(self.gameObject, "Scroll")
self.ImprintPre = Util.GetGameObject(self.gameObject, "ImprintPre")
self.ImprintInfo = Util.GetGameObject(self.gameObject, "ImprintInfo")
self.ImprintInfoBack = Util.GetGameObject(self.ImprintInfo, "close")
self.leftInfo = Util.GetGameObject(self.ImprintInfo, "Content/Layout/Left")
self.leftTitle = Util.GetGameObject(self.leftInfo, "Title/Text"):GetComponent("Text")
self.leftDetail = Util.GetGameObject(self.leftInfo, "TextArena/Text"):GetComponent("Text")
self.rightInfo = Util.GetGameObject(self.ImprintInfo, "Content/Layout/Right")
self.tightTitle = Util.GetGameObject(self.rightInfo, "Title/Text"):GetComponent("Text")
self.doBtn = Util.GetGameObject(self.ImprintInfo, "Content/Btn")
self.doBtnText = Util.GetGameObject(self.doBtn, "Text"):GetComponent("Text")
local rootHight = self.Scroll.transform.rect.height
local width = self.Scroll.transform.rect.width
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.Scroll.transform,
self.ImprintPre, nil,Vector2.New(width, rootHight), 1, 1,Vector2.New(15, 0))
self.ScrollView.moveTween.MomentumAmount = 1
self.ScrollView.moveTween.Strength = 2
end
function PracticeImprint:BindEvent()
Util.AddClick(self.backBtn, function()
self:ClosePanel()
end)
Util.AddClick(self.ImprintInfoBack, function()
self.ImprintInfo:SetActive(false)
end)
Util.AddClick(self.doBtn, function()
LogGreen("按钮")
end)
end
function PracticeImprint:AddListener()
@ -25,8 +52,85 @@ function PracticeImprint:OnSortingOrderChange()
end
function PracticeImprint:OnShow()
self.allImprintData = PracticeManager.GetAllImprintData()
self.ImprintInfo:SetActive(false)
self.ScrollView:SetData(self.allImprintData, function(index, go)
self:SetPre(index,go,self.allImprintData[index])
end)
end
--设置每一期的三个神印
function PracticeImprint:SetPre(index,_go,_data)
local title = Util.GetGameObject(_go, "title/Text"):GetComponent("Text")
title.text = string.format("%s期",_data.RealmName)
for i = 1, 3 do
local Imprint = Util.GetGameObject(_go, "Content/Imprint"..i)
self:SetSingleImprint(Imprint,_data.TeamSkill[i])
end
end
--设置单个神印信息
function PracticeImprint:SetSingleImprint(_go,_imprintId)
local serverData,configData = PracticeManager.GetSingleImprintData(_imprintId)--获取神印信息
local maskBtn = Util.GetGameObject(_go, "mask")
local stateImg = Util.GetGameObject(_go, "state"):GetComponent("Image")
local heroImg = Util.GetGameObject(_go, "hero"):GetComponent("Image")
local icon = Util.GetGameObject(_go, "icon"):GetComponent("Image")
if not serverData then--未解锁
stateImg.gameObject:SetActive(true)
stateImg.sprite = Util.LoadSprite("r_Dungeon_lockon")
heroImg.gameObject:SetActive(false)
else--已解锁
if serverData.state == 0 then--未使用
stateImg.gameObject:SetActive(false)
heroImg.gameObject:SetActive(false)
elseif serverData.state == 1 then--已使用
stateImg.gameObject:SetActive(true)
stateImg.sprite = Util.LoadSprite("t_tianshumijuan_yijihuo_zh")
heroImg.gameObject:SetActive(serverData.subId ~= "")
end
end
icon.sprite = Util.LoadSprite(GetResourcePath(configData.Icon))
Util.AddOnceClick(maskBtn,function ()
self.ImprintInfo:SetActive(true)
self:ShowSingleImprintInfoLayout(serverData,configData)
end)
end
--设置下方神印信息界面
function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
local curHero = ""
if not _serverData then
self.rightInfo:SetActive(false)
self.doBtnText.text = string.format("%s期解锁",_configData.Name)
else
if _configData.Type == 0 then
self.rightInfo:SetActive(false)
self.doBtnText.text = "选择神印"
elseif _configData.Type == 1 then
self.rightInfo:SetActive(true)
self.doBtnText.text = "取消神印"
end
end
self.leftTitle.text = string.format("通用神印·%s",_configData.Name)
self.leftDetail.text = _configData.Desc
if _serverData then
Util.AddOnceClick(self.doBtn,function ()
local old,new,sub = 0,0,""
old = PracticeManager.BigLevelImprintList[_configData.UnlockId]
new = _configData.Id
sub = tostring(curHero)
NetManager.PracticeImprintRequest(old,new,sub,function ()
self:OnShow()
end)
end)
end
end
function PracticeImprint:OnClose()
end

View File

@ -1,25 +1,28 @@
PracticeManager = {}
local this = PracticeManager
local XinXianConfig = ConfigManager.GetConfig(ConfigName.XiuXianConfig)
local XiuXianConfig = ConfigManager.GetConfig(ConfigName.XiuXianConfig)
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local XiuXianSkillConfig = ConfigManager.GetConfig(ConfigName.XiuXianSkillConfig)
function this.Initialize()
this.PracticeLevel = 1
this.PracticeBigLevel = 1
this.StarNum = 0
this.PracticeConfigData = {}
this.PracticeLevel = 1--小境界id
this.PracticeBigLevel = 1--大境界数
this.StarNum = 0--星星的数量
-- this.PracticeConfigData = {}
this.ImprintServerData = {}--服务器发来的神印信息
this.BigLevelImprintList = {}--大境界对应的神印
end
--从服务器更新当前修行等级
function this.UpdataFromServer(_level)
this.PracticeLevel = _level
this.PracticeLevel = this.PracticeLevel > 0 and this.PracticeLevel or 1
this.PracticeBigLevel = XinXianConfig[this.PracticeLevel].RealmId
this.PracticeBigLevel = XiuXianConfig[this.PracticeLevel].RealmId
this.StarNum = PlayerManager.level
end
--获取当前等级表数据
function this.GetCurConfigData()
return XinXianConfig[this.PracticeLevel]
return XiuXianConfig[this.PracticeLevel]
end
function this.BuildAddTemplate()
@ -35,7 +38,7 @@ end
--获取每一小点属性加成
function this.GetSinglePointAdd()
local singlePointAddList = {}
local TotalPros = XinXianConfig[this.PracticeLevel].TotalPros
local TotalPros = XiuXianConfig[this.PracticeLevel].TotalPros
for i = 1, #TotalPros do
if not singlePointAddList[TotalPros[i][1]] then
singlePointAddList[TotalPros[i][1]] = 0
@ -49,9 +52,12 @@ end
function this.GetCurAllGetAdd()
local PropertyList = this.BuildAddTemplate()
for i = 1, this.PracticeLevel do
if XinXianConfig[this.PracticeLevel].TotalPros then
local Pros = XinXianConfig[this.PracticeLevel].TotalPros
-- LogPink("i:"..tostring(i))
if XiuXianConfig[i].TotalPros then
local Pros = XiuXianConfig[i].TotalPros
-- LogGreen("#Pros:"..tostring(#Pros))
for i = 1, #Pros do
-- LogBlue("ProsId:"..tostring(Pros[i][1]).." ProsNum:"..tostring(Pros[i][2]))
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
end
end
@ -59,11 +65,11 @@ function this.GetCurAllGetAdd()
return PropertyList
end
--获取各个大境界中所有小属性加成的总和+模板的
--获取各个大境界中所有小属性加成的总和 +模板的
function this.GetAddsListWithTemplate()
local PropertyList = this.BuildAddTemplate()
local addsList = {}
for i, v in ConfigPairs(XinXianConfig) do
for i, v in ConfigPairs(XiuXianConfig) do
if v.TotalPros then
local Pros = v.TotalPros
for i = 1, #Pros do
@ -74,10 +80,10 @@ function this.GetAddsListWithTemplate()
return PropertyList
end
--获取各个大境界中所有小属性加成的总和不加模板的
--获取各个大境界中所有小属性加成的总和 不加模板的
function this.GetAddsListWithOutTemplate()
local addsList = {}
for i, v in ConfigPairs(XinXianConfig) do
for i, v in ConfigPairs(XiuXianConfig) do
if not addsList[v.RealmId] then
addsList[v.RealmId] = {}
end
@ -110,8 +116,57 @@ function this.GetPreViewData()
return previewList
end
--返回预览界面文字
function this.GetPreviewSingleText(id,value)
return string.format("全体神将%s+%s",PropertyConfig[id].Info,value)
end
--获取所有神印信息
function this.GetAllImprintData()
local AllImprintList = {}
for i, v in ConfigPairs(XiuXianConfig) do
if v.TeamSkill then
table.insert(AllImprintList,v)
end
end
return AllImprintList
end
--服务器发来的神印信息
function this.UpdataImprintDataFromServer(_imprintList)
this.BigLevelWithImprint()--初始化大境界对应的神印
for key, value in pairs(_imprintList) do
if value and value.id then
if not this.ImprintServerData[value.id] then
this.ImprintServerData[value.id] = {}
end
this.ImprintServerData[value.id].type = value.type
this.ImprintServerData[value.id].subId = value.subId
this.ImprintServerData[value.id].state = value.state
LogPurple("id:"..tostring(value.id).." state:"..tostring(value.state))
if value.state == 1 then
this.BigLevelImprintList[XiuXianSkillConfig[value.id].UnlockId] = value.id
end
end
end
end
--初始化大境界对应的神印
function this.BigLevelWithImprint()
for i, v in ConfigPairs(XiuXianSkillConfig) do
if v.UnlockId > 0 then
this.BigLevelImprintList[v.UnlockId] = 0
end
end
end
--获取单个神印的信息(服务器+表)
function this.GetSingleImprintData(id)
if this.ImprintServerData[id] then
return this.ImprintServerData[id],XiuXianSkillConfig[id]
else
return nil,XiuXianSkillConfig[id]
end
end
return PracticeManager

View File

@ -16,7 +16,7 @@ function Practice:InitComponent()
self.additionBtn = Util.GetGameObject(self.gameObject, "Btns/additionBtn")
self.imprintBtn = Util.GetGameObject(self.gameObject, "Btns/imprintBtn")
self.starBtn = Util.GetGameObject(self.gameObject, "Btns/starBtn")
self.starNum = Util.GetGameObject(self.starBtn, "starNum")
self.starNum = Util.GetGameObject(self.starBtn, "starNum"):GetComponent("Text")
--MidPart
self.mid = Util.GetGameObject(self.gameObject, "Mid")
self.levelName = Util.GetGameObject(self.mid, "Text"):GetComponent("Text")
@ -60,7 +60,7 @@ function Practice:BindEvent()
LogGreen("打开山河社稷图")
end)
Util.AddClick(self.button, function()
self:UpgradeCheck()
-- self:UpgradeCheck()
NetManager.UpPracticeLevelRequest(function ()
self:OnShow()
end)
@ -68,9 +68,11 @@ function Practice:BindEvent()
end
function Practice:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, self.OnShow,self)
end
function Practice:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, self.OnShow,self)
end
--待功能扩展(试图打开某个状态)
@ -91,6 +93,7 @@ end
function Practice:OnShow()
FormationManager.RefreshMainFormationPower()
self.curLevelConfig = PracticeManager.GetCurConfigData()
LogYellow("PracticeLevel:"..tostring(PracticeManager.PracticeLevel))
self:RefreshMid()
self:RefreshPoints()
self:RefreshBtn()
@ -98,6 +101,7 @@ end
function Practice:RefreshMid()
self.levelName.text = string.format("%s期",self.curLevelConfig.RealmName)
self.starNum.text = PlayerManager.level
end
function Practice:RefreshPoints()
@ -137,7 +141,7 @@ function Practice:RefreshBtn()
self.needs:SetActive(false)
self.content:SetActive(true)
self.needStar.text = self.curLevelConfig.NeedStarNum
if self.curLevelConfig.NeedStarNum < 300 then
if self.curLevelConfig.NeedStarNum > PlayerManager.level then
self.needStar.text = string.format("<color=red>%s</color>",self.curLevelConfig.NeedStarNum)
end
self.buttonText.text = "破 境"