Merge branch '0功能/灵兽系统' of http://60.1.1.230/gaoxin/JL_Client into 0功能/灵兽系统
commit
73dce1a7c3
|
|
@ -46,6 +46,7 @@ function this.UpdateBagData(_itemData, isNoSendNewItemEvent)
|
|||
itemdata.frame = GetQuantityImageByquality(_itemCfgData.Quantity)
|
||||
itemdata.type = _itemCfgData.ItemBaseType
|
||||
itemdata.itemType = _itemCfgData.ItemType
|
||||
itemdata.name=_itemCfgData.Name
|
||||
-- if _itemCfgData.ItemBaseType == ItemBaseType.Equip then
|
||||
-- LogBlue( itemdata.id.." ".. _itemData.itemNum)
|
||||
-- end
|
||||
|
|
|
|||
|
|
@ -4560,14 +4560,33 @@ function this.PokemonBackRequest(pokemons, func)
|
|||
data.pokemonId = pokemons
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.POKEMON_BACK_REQUEST, MessageTypeProto_pb.POKEMON_BACK_RESPONSE, msg, function(buffer)
|
||||
-- local data = buffer:DataByte()
|
||||
-- msg:ParseFromString(data)
|
||||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.PokemonBackResponse()
|
||||
msg:ParseFromString(data)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
--请求灵兽放生
|
||||
function this.PokemonFreeRequest(pokemonIds,chipId,chipNum, func)
|
||||
local data = HeroInfoProto_pb.PokemonFreeRequest()
|
||||
if pokemonIds then
|
||||
for i = 1, #pokemonIds do
|
||||
data.pokemonId:append(pokemonIds[i])
|
||||
end
|
||||
end
|
||||
--data.pokemonId:append() = pokemonIds
|
||||
data.pieceId=chipId
|
||||
data.pieceNum=chipNum
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.POKEMON_FREE_REQUEST, MessageTypeProto_pb.POKEMON_FREE_RESPONSE, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.PokemonFreeResponse()
|
||||
end)
|
||||
end
|
||||
--摇骰子请求
|
||||
function this.JourneyDoResponse(mapId,func)
|
||||
local request = MapInfoProto_pb.JourneyDoRequest()
|
||||
|
|
@ -4582,6 +4601,8 @@ function this.JourneyDoResponse(mapId,func)
|
|||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
--替换灵兽编队
|
||||
function this.ReplaceTeamPokemonInfoRequest(_teamPokemonInfos, func)
|
||||
local data = HeroInfoProto_pb.ReplaceTeamPokemonInfoRequest()
|
||||
|
|
|
|||
|
|
@ -139,8 +139,11 @@ function PokemonInfoPanel:BindEvent()
|
|||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.PokemonResolve,lingshouConfig,allMaterials,function ()
|
||||
NetManager.PokemonBackRequest(curPokemonData.dynamicId,function(msg)
|
||||
-- this.OnClickTabBtn(curIndex)
|
||||
LogError("物品"..#msg.drop.itemlist)
|
||||
LogError("灵兽"..#msg.drop.pokemon)
|
||||
PopupTipPanel.ShowTip("涅槃成功!")
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
PopupTipPanel.ShowTip("涅槃成功!")
|
||||
PokemonManager.UpdateSinglePokemonData(curPokemonData.dynamicId,1,0)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ function this.UpdatePokemonDatas(_msgPokemonData,isRefreshFetter)--单个掉落
|
|||
this.GetPokemonRefreshFetter(singPokemonData.id)
|
||||
end
|
||||
end
|
||||
|
||||
--获取当前灵兽数据
|
||||
function this.GetSinglePokemonData(_did)
|
||||
if not _did then return nil end
|
||||
|
|
@ -66,6 +67,16 @@ function this.GetPokemonDatas()
|
|||
end
|
||||
return curAllPokemonList
|
||||
end
|
||||
--移除多个灵兽数据
|
||||
function this.RemovePokemonData(ids)
|
||||
if not ids then
|
||||
return
|
||||
end
|
||||
for i = 1,#ids do
|
||||
local id=ids[i]
|
||||
this.RemoveSinglePokemonData(id)
|
||||
end
|
||||
end
|
||||
--获取当前可上阵的所有灵兽数据
|
||||
function this.GetCanUpZhenPokemonDatas()
|
||||
local upZhenSidList = this.GetAllPokemonFormationSids()
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ function PokemonSummonOneResultPanel:OnOpen(...)
|
|||
this.itemIcon3.sprite=Util.LoadSprite(artResourcesConfig[ItemConfig[itemId].ResourceID].Name)
|
||||
--是否激活特权
|
||||
local isActive = PrivilegeManager.GetPrivilegeOpenStatusById(3004)
|
||||
local currPrivilege=privilegeConfig[3004]
|
||||
if itemId == 16 and isActive then
|
||||
itemNum=itemNum*(1+currPrivilege.Condition[1][2]/10000)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ function this:BindEvent()
|
|||
PopupTipPanel.ShowTip(Language[11139])
|
||||
return
|
||||
end
|
||||
LogError("请求涅槃")
|
||||
if fun then
|
||||
fun()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function this:InitComponent(gameObject)
|
|||
this.titleText.text="确认放生"
|
||||
this.infoTxt=Util.GetGameObject(gameObject,"Body/infoText"):GetComponent("Text")
|
||||
this.cancelBtn=Util.GetGameObject(gameObject,"CancelBtn")
|
||||
this.confirmBtn=Util.GetGameObject(gameObject,"ConfirmBtn")
|
||||
this.confirmBtn=Util.GetGameObject(gameObject,"resetBtn")
|
||||
Util.GetGameObject(gameObject,"resetBtn/Text"):GetComponent("Text").text="放生"
|
||||
--滚动条根节点
|
||||
this.root = Util.GetGameObject(gameObject, "Root")
|
||||
|
|
@ -45,10 +45,10 @@ function this:OnShow(_parent,...)
|
|||
sortingOrder = _parent.sortingOrder
|
||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||
local args = {...}
|
||||
this.num.text = args[1]
|
||||
fun = args[3]
|
||||
--this.num.text = args[1]
|
||||
fun = args[2]
|
||||
this.infoTxt.text="确认要放生所选的灵兽或灵兽碎片?"
|
||||
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[2])
|
||||
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[1])
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
|
|
|
|||
|
|
@ -56,9 +56,10 @@ function this:BindEvent()
|
|||
Util.SetGray(this.btn_add,false)
|
||||
end
|
||||
selectChipNum=selectChipNum-1
|
||||
this.chipNumTxt=selectChipNum
|
||||
end
|
||||
)
|
||||
this.chipNumTxt.text=selectChipNum
|
||||
end)
|
||||
|
||||
|
||||
--增加按钮
|
||||
Util.AddClick(this.btn_add,function()
|
||||
if selectChipNum==maxChipNum then
|
||||
|
|
@ -71,21 +72,14 @@ function this:BindEvent()
|
|||
Util.SetGray(this.btn_remove,false)
|
||||
end
|
||||
selectChipNum=selectChipNum + 1
|
||||
this.chipNumTxt=selectChipNum
|
||||
end
|
||||
)
|
||||
this.chipNumTxt.text=selectChipNum
|
||||
end)
|
||||
|
||||
|
||||
Util.AddClick(this.helpBtn,function()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.Resolve_Dismantle,this.helpPos.x,this.helpPos.y)
|
||||
end)
|
||||
Util.AddClick(this.confirmBtn,function()
|
||||
if tonumber(LengthOfTable(selectHeroData))==0 then
|
||||
PopupTipPanel.ShowTip(Language[12394])
|
||||
else
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ResolveDismantle,
|
||||
HeroManager.GetHeroReturnItems(selectHeroData,GENERAL_POPUP_TYPE.ResolveDismantle),selectHeroData,selectChipId,selectChipNum)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Util.AddClick(this.shopBtn, function()
|
||||
local isActive, errorTip = ShopManager.IsActive(SHOP_TYPE.SOUL_CONTRACT_SHOP)
|
||||
if not isActive then
|
||||
|
|
@ -94,6 +88,93 @@ function this:BindEvent()
|
|||
end
|
||||
UIManager.OpenPanel(UIName.MainShopPanel, SHOP_TYPE.SOUL_CONTRACT_SHOP)
|
||||
end)
|
||||
|
||||
--放生按钮
|
||||
Util.AddClick(this.confirmBtn,function()
|
||||
if isPokemon and tonumber(LengthOfTable(selectHeroData))==0 then
|
||||
PopupTipPanel.ShowTip(Language[12394])
|
||||
return
|
||||
end
|
||||
|
||||
if not isPokemon and (selectChipId==0 or selectChipNum==0) then
|
||||
PopupTipPanel.ShowTip(Language[12394])
|
||||
return
|
||||
end
|
||||
|
||||
--奖励物品
|
||||
--所有材料
|
||||
local allMaterials={}
|
||||
local pokemonIds={}
|
||||
--灵兽
|
||||
if isPokemon then
|
||||
local allCoin=0
|
||||
for key, value in pairs(selectHeroData) do
|
||||
--升级消耗
|
||||
table.insert(pokemonIds,key)
|
||||
local lvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalLevel,"Level",value.lv,"Quality",value.quality)
|
||||
if lvConfig then
|
||||
local matrs=lvConfig.SumConsume
|
||||
if matrs then
|
||||
for i = 1, #matrs do
|
||||
local mat=matrs[i]
|
||||
table.insert(allMaterials,{mat[1],mat[2]})
|
||||
end
|
||||
end
|
||||
end
|
||||
--升星消耗
|
||||
local lingshouConfig=ConfigManager.GetConfigData(ConfigName.SpiritAnimal,value.id)
|
||||
local haveNum=0
|
||||
if value.star>0 then
|
||||
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalStar,"Star",value.star,"Quality",value.quality)
|
||||
if starConfig then
|
||||
haveNum=starConfig.SumItemNum
|
||||
local starMatrs=starConfig.SumConsume
|
||||
--消耗材料
|
||||
if starMatrs then
|
||||
for i = 1, #starMatrs do
|
||||
local starm=starMatrs[i]
|
||||
table.insert(allMaterials,{starm[1],starm[2]})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--消耗本体数量,分解成碎片
|
||||
allCoin=allCoin+lingshouConfig.CoinReturn[2]*(haveNum+1)
|
||||
end
|
||||
--加上所有的分解币
|
||||
table.insert(allMaterials,{1203,allCoin})
|
||||
else--灵兽碎片
|
||||
local itemConfig=ConfigManager.GetConfigData(ConfigName.ItemConfig,selectChipId)
|
||||
if itemConfig then
|
||||
local groupId=itemConfig.RewardGroup[1]
|
||||
local groupConfig=ConfigManager.GetConfigData(ConfigName.RewardGroup,groupId)
|
||||
if groupConfig then
|
||||
LogError("掉落组显示:"..groupConfig.ShowItem[1][1])
|
||||
local pokemon=ConfigManager.GetConfigData(ConfigName.SpiritAnimal,groupConfig.ShowItem[1][1])
|
||||
if pokemon then
|
||||
table.insert(allMaterials,{pokemon.PiecesCoinReturn[1],pokemon.PiecesCoinReturn[2]*selectChipNum})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--显示分解界面
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.PokemonRestore,allMaterials,function()
|
||||
LogError("灵兽长度 "..#pokemonIds.."碎片id "..selectChipId.." num"..selectChipNum)
|
||||
NetManager.PokemonFreeRequest(pokemonIds,selectChipId,selectChipNum,function(msg)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1)
|
||||
if pokemonIds and #pokemonIds>0 then
|
||||
PokemonManager.RemovePokemonData(pokemonIds)
|
||||
else
|
||||
BagManager.HeroLvUpUpdateItemsNum(selectChipId,selectChipNum)
|
||||
end
|
||||
this.SortTypeClick(sortingOrder)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
|
|
@ -148,6 +229,7 @@ function this.SortTypeClick(_sortType)
|
|||
chip.num=v.num
|
||||
chip.name=v.name
|
||||
chip.returnCoin=0
|
||||
LogError(v.name)
|
||||
chip.dynamicId=v.id
|
||||
table.insert(items,chip)
|
||||
end
|
||||
|
|
@ -157,6 +239,10 @@ function this.SortTypeClick(_sortType)
|
|||
this.selectText.gameObject:SetActive(true)
|
||||
this.selectText.text = Language[11775].."0/"..maxSelectNum
|
||||
-- this.SortHeroDatas(heroDatas)
|
||||
if oldChoosed then
|
||||
LogError("2222222222222")
|
||||
oldChoosed:SetActive(false)
|
||||
end
|
||||
this.Empty:SetActive(#heroDatas <= 0)
|
||||
this.ScrollView:SetData(heroDatas, function (index, go)
|
||||
this.SingleHeroDataShow(go, heroDatas[index],false)
|
||||
|
|
@ -238,9 +324,6 @@ function this.SingleHeroDataShow(go,_heroData,isGray)
|
|||
--如果灵兽是选中状态,取消选中
|
||||
if selectHeroData[heroData.dynamicId] then
|
||||
choosed:SetActive(false)
|
||||
if oldChoosed then
|
||||
oldChoosed:SetActive(false)
|
||||
end
|
||||
selectChipId=0
|
||||
selectHeroData[heroData.dynamicId] = nil
|
||||
local haveNum=LengthOfTable(selectHeroData)
|
||||
|
|
@ -254,6 +337,10 @@ function this.SingleHeroDataShow(go,_heroData,isGray)
|
|||
end
|
||||
return
|
||||
end
|
||||
if oldChoosed then
|
||||
oldChoosed:SetActive(false)
|
||||
oldChoosed=nil
|
||||
end
|
||||
--如果选中灵兽的数量为最大
|
||||
if LengthOfTable(selectHeroData)==maxSelectNum then
|
||||
PopupTipPanel.ShowTip(string.format(Language[12396],maxSelectNum))
|
||||
|
|
|
|||
Loading…
Reference in New Issue