神兵属性,神兵羁绊,神兵分解提交

dev_chengFeng
wangzhenxing 2023-04-04 11:15:32 +08:00
parent feaeb268f5
commit 12e2cecaa1
12 changed files with 188 additions and 24 deletions

View File

@ -978,6 +978,7 @@ RedPointType = {
TianShuMiJuan = 799, --天书秘卷红点 TianShuMiJuan = 799, --天书秘卷红点
TianShuPokemon_Fetter = 800,--灵兽羁绊 TianShuPokemon_Fetter = 800,--灵兽羁绊
Equip_Fetter = 805, --装备羁绊 Equip_Fetter = 805, --装备羁绊
Weapon_Fetter = 806, --神兵羁绊
--跨服天梯 --跨服天梯
JumpServer_MainCity = 820,--主界面跨服天梯 JumpServer_MainCity = 820,--主界面跨服天梯

View File

@ -50,6 +50,16 @@ function CheckListIsContainValue1(_list,_value)
return false return false
end end
function CheckListIsContainValue2(_list,_value)
if _list and _value then
for key, value in pairs(_list) do
if value[1] ==_value then
return true
end
end
end
return false
end
--适配 --适配
function screenAdapte(go) function screenAdapte(go)

View File

@ -1136,6 +1136,7 @@ function this.GetItemListFromTempBag(drop, isSave)
itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity) itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
itemdata.icon = GetResourcePath(itemConfig.ResourceID) itemdata.icon = GetResourcePath(itemConfig.ResourceID)
itemdata.num = 1 itemdata.num = 1
GodWeaponManager.AddHandBook(itemdata.sId)
table.insert(itemDataList, itemdata) table.insert(itemDataList, itemdata)
end end
end end

View File

@ -83,6 +83,10 @@ function this.SingleItemDataShow(_go,_itemData)
NetManager.RequestMagicSoldierLocation(_itemData.dynamicId,upPos,function() NetManager.RequestMagicSoldierLocation(_itemData.dynamicId,upPos,function()
GodWeaponManager.SetWeaponUpZhen(_itemData.dynamicId,upPos) GodWeaponManager.SetWeaponUpZhen(_itemData.dynamicId,upPos)
local godWeaponData=GodWeaponManager.GetSingleWeaponData(_itemData.dynamicId) local godWeaponData=GodWeaponManager.GetSingleWeaponData(_itemData.dynamicId)
local newWarPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
--飘战力
PokemonManager.PiaoWarPowerChange(oldWarPower,newWarPower)
FormationManager.CheckHeroIdExist()
Game.GlobalEvent:DispatchEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel,godWeaponData) Game.GlobalEvent:DispatchEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel,godWeaponData)
parent:ClosePanel() parent:ClosePanel()
end) end)
@ -114,6 +118,11 @@ function this.SingleItemDataShow(_go,_itemData)
GodWeaponManager.SetWeaponUpZhen(_itemData.dynamicId,upZhenIndex) GodWeaponManager.SetWeaponUpZhen(_itemData.dynamicId,upZhenIndex)
Game.GlobalEvent:DispatchEvent(GameEvent.Pokemon.PokemonUpZhenRefresh) Game.GlobalEvent:DispatchEvent(GameEvent.Pokemon.PokemonUpZhenRefresh)
this:OnShow(parent,nil,upZhenIndex) this:OnShow(parent,nil,upZhenIndex)
local newWarPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
--飘战力
PokemonManager.PiaoWarPowerChange(oldWarPower,newWarPower)
FormationManager.CheckHeroIdExist()
parent:ClosePanel()
end) end)
end end
end) end)

View File

@ -12,7 +12,7 @@ end
function this.InitAllGodWeaponData(msg) function this.InitAllGodWeaponData(msg)
LogError("#msg.infos============"..#msg.infos) --LogError("#msg.infos============"..#msg.infos)
for i = 1, #msg.infos do for i = 1, #msg.infos do
local GodWeapon={} local GodWeapon={}
GodWeapon.Did=msg.infos[i].id GodWeapon.Did=msg.infos[i].id
@ -30,16 +30,27 @@ function this.InitAllGodWeaponData(msg)
GodWeapon.config=shenBingConfig[staticId] GodWeapon.config=shenBingConfig[staticId]
allGodWeapons[GodWeapon.Did]=GodWeapon allGodWeapons[GodWeapon.Did]=GodWeapon
if pos~=0 then if pos~=0 then
LogError("pos============================="..pos) --LogError("pos============================="..pos)
godWeaponTeamInfo[pos]=GodWeapon godWeaponTeamInfo[pos]=GodWeapon
end end
LogError("static=="..staticId) --LogError("static=="..staticId)
end end
for i = 1, #msg.book do for i = 1, #msg.book do
LogError("msg.book[i]====="..msg.book[i]) --LogError("msg.book[i]====="..msg.book[i])
handBook[msg.book[i]]=msg.book[i] handBook[msg.book[i]]=msg.book[i]
end end
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Weapon)
end end
function this.AddHandBook(id)
handBook[id]=id
end
function this.GetAllHandData()
return handBook
end
function this.GetAllWeapon() function this.GetAllWeapon()
return allGodWeapons return allGodWeapons
end end
@ -48,6 +59,30 @@ function this.GetAllTeamWeapon()
return godWeaponTeamInfo return godWeaponTeamInfo
end end
--移除多个灵兽数据
function this.RemoveWeaponData(ids)
if not ids then
return
end
for i = 1,#ids do
local id=ids[i]
this.RemoveSingleWeaponData(id)
end
end
--获取所有灵兽羁绊总和属性 (羁绊属性直接加在团队属性上)
function this.GetAllWeaponFetterAddPros()
return TianShuMiJuanManger.GetAllFetterAddProsBy(5)
end
--移除灵兽数据
function this.RemoveSingleWeaponData(_did)
if not _did then return end
if allGodWeapons[_did] then
allGodWeapons[_did] = nil
end
end
function this.GetAllTeamWeaponId() function this.GetAllTeamWeaponId()
local list={} local list={}
for key, value in pairs(godWeaponTeamInfo) do for key, value in pairs(godWeaponTeamInfo) do
@ -74,7 +109,7 @@ function this.InitSingleGodWeaponData(data)
GodWeapon.config=shenBingConfig[staticId] GodWeapon.config=shenBingConfig[staticId]
allGodWeapons[GodWeapon.Did]=GodWeapon allGodWeapons[GodWeapon.Did]=GodWeapon
handBook[staticId]=staticId handBook[staticId]=staticId
LogError("single static=="..staticId) --LogError("single static=="..staticId)
end end
function this.GetSingleWeaponData(_id) function this.GetSingleWeaponData(_id)
@ -129,7 +164,7 @@ end
function this.GetNoUpZhenWeapons() function this.GetNoUpZhenWeapons()
local list={} local list={}
for i = 1, #allGodWeapons do for i = 1, #allGodWeapons do
LogError("allGodWeapons[i].point=="..allGodWeapons[i].point) --LogError("allGodWeapons[i].point=="..allGodWeapons[i].point)
end end
for key, value in pairs(allGodWeapons) do for key, value in pairs(allGodWeapons) do
@ -174,6 +209,7 @@ function this.SetWeaponUpZhen(id,pos)
allGodWeapons[id].point=pos allGodWeapons[id].point=pos
godWeaponTeamInfo[point1]=nil godWeaponTeamInfo[point1]=nil
end end
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Weapon)
end end
end end
@ -194,8 +230,10 @@ end
--获取灵兽编队属性 --获取灵兽编队属性
function this.GetPokemonFormationAddPro() function this.GetPokemonFormationAddPro()
local allPro = {} local allPro = {}
--LogError("获取神兵编对属性-----------------------")
for key, value in pairs(godWeaponTeamInfo) do for key, value in pairs(godWeaponTeamInfo) do
if key and allGodWeapons[value.Did] then if key and allGodWeapons[value.Did] then
--LogError("value.did=================="..value.Did)
local curPokemonAddPro = this.GetSinglePokemonAddProData(value.Did) local curPokemonAddPro = this.GetSinglePokemonAddProData(value.Did)
HeroManager.DoubleTableCompound(allPro, curPokemonAddPro) HeroManager.DoubleTableCompound(allPro, curPokemonAddPro)
end end
@ -203,6 +241,19 @@ function this.GetPokemonFormationAddPro()
return allPro return allPro
end end
--获取神兵编队属性 在编队中的团队属性加成 除以英雄编队人数
function this.GetWeaponFormationTeamAddPro(heroFormationNum)
local allPro = this.GetPokemonFormationAddPro()
-- local formationHeros = FormationManager.GetWuJinFormationHeroIds(formationIndex)
-- local heroFormationNum = #formationHeros
for key, value in pairs(allPro) do
--LogError("key====="..key.." value=="..value/heroFormationNum)
allPro[key] = math.floor(value/heroFormationNum)
end
return allPro
end
--获取单个神兵属性 (灵兽属性/编队人数 神兵属性会平分给上阵的所有神将) --获取单个神兵属性 (灵兽属性/编队人数 神兵属性会平分给上阵的所有神将)
function this.GetSinglePokemonAddProData(_did,_star,_lv)--_star 传值的话就用此星级计算属性 function this.GetSinglePokemonAddProData(_did,_star,_lv)--_star 传值的话就用此星级计算属性
-- LogPink("_did 1 ".._did) -- LogPink("_did 1 ".._did)

View File

@ -1904,9 +1904,15 @@ function this.GetAllHeroTeamAddProVal(teamHeroInfos,curteamHeroDid)
--灵兽编队加成 --灵兽编队加成
local pokemonFormationAllHeroProVal = PokemonManager.GetPokemonFormationTeamAddPro(heroAllNum) local pokemonFormationAllHeroProVal = PokemonManager.GetPokemonFormationTeamAddPro(heroAllNum)
this.DoubleTableCompound(teamProVal, pokemonFormationAllHeroProVal) this.DoubleTableCompound(teamProVal, pokemonFormationAllHeroProVal)
--神兵编队加成
local weaponFormationAllHeroProVal = GodWeaponManager.GetWeaponFormationTeamAddPro(heroAllNum)
this.DoubleTableCompound(teamProVal, weaponFormationAllHeroProVal)
--灵兽羁绊加成 --灵兽羁绊加成
local pokemonFetterAddPro = PokemonManager.GetAllPokemonFetterAddPros() local pokemonFetterAddPro = PokemonManager.GetAllPokemonFetterAddPros()
this.DoubleTableCompound(teamProVal, pokemonFetterAddPro) this.DoubleTableCompound(teamProVal, pokemonFetterAddPro)
--神兵羁绊加成
local weaponFetterAddPro = GodWeaponManager.GetAllWeaponFetterAddPros()
this.DoubleTableCompound(teamProVal, weaponFetterAddPro)
--神将羁绊加成 --神将羁绊加成
local heroFetterAddPro = TianShuMiJuanManger.GetAllFetterAddProsBy(1) local heroFetterAddPro = TianShuMiJuanManger.GetAllFetterAddProsBy(1)
this.DoubleTableCompound(teamProVal, heroFetterAddPro) this.DoubleTableCompound(teamProVal, heroFetterAddPro)
@ -2035,10 +2041,25 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt
end end
LogRed_Prop("灵兽加成") LogRed_Prop("灵兽加成")
LogRedTable_Prop(pokemonFormationAllHeroProVal) LogRedTable_Prop(pokemonFormationAllHeroProVal)
--神兵 现在只在编队战力中计算 因为单个英雄可以上多个编队
local weaponFormationAllHeroProVal = {}
if formationId then
local formation = FormationManager.GetFormationByID(formationId)
local formationHeroNum = #formation.teamHeroInfos
if formationHeroNum and formationHeroNum > 0 then
weaponFormationAllHeroProVal = GodWeaponManager.GetWeaponFormationTeamAddPro(formationHeroNum)
end
end
LogRed_Prop("神兵加成")
LogRedTable_Prop(weaponFormationAllHeroProVal)
--灵兽羁绊 --灵兽羁绊
local pokemonFetterAddPro = PokemonManager.GetAllPokemonFetterAddPros() local pokemonFetterAddPro = PokemonManager.GetAllPokemonFetterAddPros()
LogRed_Prop("灵兽羁绊 最终 加成 ") LogRed_Prop("灵兽羁绊 最终 加成 ")
LogRedTable_Prop(pokemonFetterAddPro) LogRedTable_Prop(pokemonFetterAddPro)
--神兵羁绊
local weaponFetterAddPro=GodWeaponManager.GetAllWeaponFetterAddPros()
LogRed_Prop("神兵羁绊 最终 加成 ")
LogRedTable_Prop(weaponFetterAddPro)
--神将羁绊 --神将羁绊
local heroFetterAddPro = TianShuMiJuanManger.GetAllFetterAddProsBy(1) local heroFetterAddPro = TianShuMiJuanManger.GetAllFetterAddProsBy(1)
LogRed_Prop("神将羁绊 最终 加成 ") LogRed_Prop("神将羁绊 最终 加成 ")
@ -2087,9 +2108,11 @@ function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upSt
this.DoubleTableCompound(allHeroProVal, heroSkillAllHeroProVal) this.DoubleTableCompound(allHeroProVal, heroSkillAllHeroProVal)
this.DoubleTableCompound(allHeroProVal, teamAddPro) this.DoubleTableCompound(allHeroProVal, teamAddPro)
this.DoubleTableCompound(allHeroProVal, pokemonFetterAddPro) this.DoubleTableCompound(allHeroProVal, pokemonFetterAddPro)
this.DoubleTableCompound(allHeroProVal, weaponFetterAddPro)
this.DoubleTableCompound(allHeroProVal, heroFetterAddPro) this.DoubleTableCompound(allHeroProVal, heroFetterAddPro)
this.DoubleTableCompound(allHeroProVal, hunyinFetterAddPro) this.DoubleTableCompound(allHeroProVal, hunyinFetterAddPro)
this.DoubleTableCompound(allHeroProVal, pokemonFormationAllHeroProVal) this.DoubleTableCompound(allHeroProVal, pokemonFormationAllHeroProVal)
this.DoubleTableCompound(allHeroProVal, weaponFormationAllHeroProVal)
this.DoubleTableCompound(allHeroProVal, practiceAddPro) this.DoubleTableCompound(allHeroProVal, practiceAddPro)
end end
--4公式特殊减乘所有属性加成 --4公式特殊减乘所有属性加成

View File

@ -18,6 +18,8 @@ Func_Prop_Type = {
TailsManSou = 15, -- 法宝之魂 TailsManSou = 15, -- 法宝之魂
Incarnation = 16, --身外化身 Incarnation = 16, --身外化身
Gem = 17, --命格 Gem = 17, --命格
Weapon =18, --神兵
WeaponFetter=19, --神兵羁绊
} }
-- 计算需要缓存数据的方法 -- 计算需要缓存数据的方法
@ -114,6 +116,24 @@ Func_Prop_Func = {
local allPro = GemManager.GetAllAttri() local allPro = GemManager.GetAllAttri()
return allPro return allPro
end, end,
--神兵属性加成
[Func_Prop_Type.Weapon] = function()
--LogError("计算神兵属性+++++++++++++++++++++++++++++")
local allPro = GodWeaponManager.GetPokemonFormationAddPro()
for key, value in pairs(allPro) do
allPro[key] = value
end
return allPro
end,
--神兵羁绊属性加成
[Func_Prop_Type.WeaponFetter] = function()
--LogError("计算神兵羁绊+++++++++++++++++++++++++++++")
local allPro = GodWeaponManager.GetAllWeaponFetterAddPros()
for key, value in pairs(allPro) do
allPro[key] = value
end
return allPro
end,
} }
@ -195,4 +215,23 @@ Func_Prop_Filter = {
[Func_Prop_Type.Gem] = function(funcData, heroData) [Func_Prop_Type.Gem] = function(funcData, heroData)
return funcData return funcData
end, end,
--神兵属性加成
[Func_Prop_Type.Weapon] = function(funcData, heroData,formationId)
local heroFormationNum = FormationManager.GetCurIndexForMationNum(formationId)
if heroFormationNum <= 0 then
return {}
end
local allPro = {}
for key, value in pairs(funcData) do
if value > 0 then
allPro[key] = math.floor(value/heroFormationNum)
end
end
return allPro
end,
--神兵羁绊属性加成
[Func_Prop_Type.WeaponFetter] = function(funcData, heroData)
return funcData
end,
} }

View File

@ -277,9 +277,11 @@ function this.AllBookEnableResponse(func)
end end
-- 设置脏数据 -- 设置脏数据
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.PokemonFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.PokemonFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.WeaponFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HeroFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HeroFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HunYinFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HunYinFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.EquipFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.EquipFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.WeaponFetter)
end) end)
end end
@ -5009,6 +5011,7 @@ function this.PokemonBookEnableRequest(id,func)
msg:ParseFromString(data) msg:ParseFromString(data)
--设置战斗力脏数据 --设置战斗力脏数据
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.PokemonFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.PokemonFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.WeaponFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HeroFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HeroFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HunYinFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.HunYinFetter)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.EquipFetter) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.EquipFetter)
@ -7199,6 +7202,7 @@ function NetManager.RequestMagicSoldierStrong(_id,_type,_num,_costIds,_func)
GodWeaponManager.SetGodWeaponUpStarCost(_costIds) GodWeaponManager.SetGodWeaponUpStarCost(_costIds)
end end
if _func then if _func then
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Weapon)
_func(msg) _func(msg)
end end
end) end)

View File

@ -53,8 +53,10 @@ function this:OnShow(_parent,...)
local type=args[3] local type=args[3]
if type==1 then if type==1 then
this.infoTxt.text=Language[11576] this.infoTxt.text=Language[11576]
this.titleText.text=Language[11573]
else else
this.infoTxt.text="确认要分解所选的神兵或神兵碎片?" this.infoTxt.text="确认要分解所选的神兵或神兵碎片?"
this.titleText.text="确认分解"
end end
LogError("#args[1]====="..#args[1]) LogError("#args[1]====="..#args[1])
ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[1]) ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[1])

View File

@ -23,7 +23,7 @@ function this:InitComponent(gameObject)
this.helpPos=this.helpBtn:GetComponent("RectTransform").localPosition this.helpPos=this.helpBtn:GetComponent("RectTransform").localPosition
--回溯按钮 --回溯按钮
this.confirmBtn=Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/ConfirmBtn") this.confirmBtn=Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/ConfirmBtn")
Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/ConfirmBtn/Image"):GetComponent("Image").sprite=this.spLoader:LoadSprite("lingshou_fangshenganniu_zh") Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/ConfirmBtn/Image"):GetComponent("Image").sprite=this.spLoader:LoadSprite("h_xianji_fenjieanniu_zh")
this.shopBtn=Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/shopBtn") this.shopBtn=Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/shopBtn")
this.selectText = Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/selectNumText"):GetComponent("Text") this.selectText = Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/selectNumText"):GetComponent("Text")
this.selectBtn = Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/btns/selectBtn") this.selectBtn = Util.GetGameObject(gameObject,"Content/Resolve_GodWeapon/btns/selectBtn")
@ -110,21 +110,33 @@ function this:BindEvent()
for key, value in pairs(selectHeroData) do for key, value in pairs(selectHeroData) do
--升级消耗 --升级消耗
table.insert(pokemonIds,key) table.insert(pokemonIds,key)
local lvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalLevel,"Level",value.lv,"Quality",value.quality) local lvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenBingLevel,"Level",value.lv,"Quality",value.quality)
if lvConfig then if lvConfig then
local matrs=lvConfig.SumConsume local matrs=lvConfig.SumConsume
if matrs then if matrs then
for i = 1, #matrs do for i = 1, #matrs do
local mat=matrs[i] local mat=matrs[i]
table.insert(allMaterials,{mat[1],mat[2]}) if CheckListIsContainValue2(allMaterials,mat[1]) then
end --allMaterials[mat[1]]=allMaterials[mat[1]]+mat[2]
for key, value in pairs(allMaterials) do
if value[1]==mat[1] then
value[2]=value[2]+mat[2]
end
end
else
table.insert(allMaterials,{mat[1],mat[2]})
end
end
end end
end end
--升星消耗 --升星消耗
local lingshouConfig=ConfigManager.GetConfigData(ConfigName.SpiritAnimal,value.id) local lingshouConfig=ConfigManager.GetConfigData(ConfigName.ShenBing,value.id)
local haveNum=0 local haveNum=0
if value.star>0 then if value.star>=0 then
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalStar,"Star",value.star,"Quality",value.quality) LogError("value.star====="..value.star)
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ShenbingStar,"Star",value.star,"Quality",value.quality)
if starConfig then if starConfig then
haveNum=starConfig.SumItemNum haveNum=starConfig.SumItemNum
local starMatrs=starConfig.SumConsume local starMatrs=starConfig.SumConsume
@ -136,12 +148,14 @@ function this:BindEvent()
end end
end end
end end
--消耗本体数量,分解成碎片
LogError("havenum==="..haveNum)
allCoin=allCoin+starConfig.CoinReturn[2]
end end
--消耗本体数量,分解成碎片
allCoin=allCoin+lingshouConfig.CoinReturn[2]*(haveNum+1)
end end
--加上所有的分解币 --加上所有的分解币
table.insert(allMaterials,{1205,allCoin}) table.insert(allMaterials,{22302,allCoin})
else--灵兽碎片 else--灵兽碎片
local itemConfig=ConfigManager.GetConfigData(ConfigName.ItemConfig,selectChipId) local itemConfig=ConfigManager.GetConfigData(ConfigName.ItemConfig,selectChipId)
if itemConfig then if itemConfig then
@ -162,10 +176,10 @@ function this:BindEvent()
LogError("灵兽长度 "..#pokemonIds.."碎片id "..selectChipId.." num"..selectChipNum) LogError("灵兽长度 "..#pokemonIds.."碎片id "..selectChipId.." num"..selectChipNum)
if isPokemon then if isPokemon then
NetManager.PokemonFreeRequest(pokemonIds,selectChipId,selectChipNum,function(msg) NetManager.RequestMagicSoldierSpilt(pokemonIds,function(msg)
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1) UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1)
if pokemonIds and #pokemonIds>0 then if pokemonIds and #pokemonIds>0 then
PokemonManager.RemovePokemonData(pokemonIds) GodWeaponManager.RemoveWeaponData(pokemonIds)
end end
selectChipId = 0 selectChipId = 0
oldChoosed = nil oldChoosed = nil
@ -181,9 +195,6 @@ function this:BindEvent()
UIManager.OpenPanel(UIName.RewardItemPopup,drop) UIManager.OpenPanel(UIName.RewardItemPopup,drop)
end) end)
end end
end,2) end,2)
end) end)
end end

View File

@ -25,7 +25,7 @@ local tabs = {
-- }, -- },
[5] = { --神兵 [5] = { --神兵
default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",tabName = "神兵篇", default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",tabName = "神兵篇",
rpType = RedPointType.Equip_Fetter,funcType = FUNCTION_OPEN_TYPE.COMPOUND,bg = "t_tianshumijuan_shengjiangditu",zi = "GodWeaponAtlas_handbook_title_zh", rpType = RedPointType.Weapon_Fetter,funcType = FUNCTION_OPEN_TYPE.POKEMON,bg = "t_tianshumijuan_shengjiangditu",zi = "GodWeaponAtlas_handbook_title_zh",
}, },
} }
local status = { local status = {

View File

@ -24,6 +24,7 @@ function this.OnLevelChange()
this.CheckFetterStatus(2) this.CheckFetterStatus(2)
this.CheckFetterStatus(3) this.CheckFetterStatus(3)
this.CheckFetterStatus(4) this.CheckFetterStatus(4)
this.CheckFetterStatus(5)
end end
function this.CheckRedPointType(redType) function this.CheckRedPointType(redType)
@ -35,6 +36,8 @@ function this.CheckRedPointType(redType)
return this.CheckRedPoint(3) return this.CheckRedPoint(3)
elseif redType == RedPointType.Equip_Fetter then elseif redType == RedPointType.Equip_Fetter then
return this.CheckRedPoint(4) return this.CheckRedPoint(4)
elseif redType == RedPointType.Weapon_Fetter then
return this.CheckRedPoint(5)
end end
end end
@ -73,6 +76,7 @@ function this.UpdateFetterId(ids)
this.CheckFetterStatus(2) this.CheckFetterStatus(2)
this.CheckFetterStatus(3) this.CheckFetterStatus(3)
this.CheckFetterStatus(4) this.CheckFetterStatus(4)
this.CheckFetterStatus(5)
end end
--检测条件变化,判断羁绊是否可激活 --检测条件变化,判断羁绊是否可激活
@ -94,6 +98,10 @@ function this.CheckFetterStatus(fetterType)
local curPokemonSidList = EquipManager.GetHaveEquipDatas() local curPokemonSidList = EquipManager.GetHaveEquipDatas()
this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList) this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
CheckRedPointStatus(RedPointType.Equip_Fetter) CheckRedPointStatus(RedPointType.Equip_Fetter)
elseif fetterType ==5 then
local curPokemonSidList = GodWeaponManager.GetAllHandData()
this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
CheckRedPointStatus(RedPointType.Weapon_Fetter)
end end
end end
@ -101,6 +109,7 @@ end
function this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList) function this.GetAllPokemonFetterDatas(fetterType,curPokemonSidList)
local SpiritAnimalBookList = {} local SpiritAnimalBookList = {}
for k,v in pairs(this.fetterData) do for k,v in pairs(this.fetterData) do
--LogError("fetterType=="..fetterType.." v.fettertype=="..v.fetterType)
if v.fetterType == fetterType and v.enabled == -1 then if v.fetterType == fetterType and v.enabled == -1 then
if this.IsCompound(v.teamers,curPokemonSidList,v.fetterType) then if this.IsCompound(v.teamers,curPokemonSidList,v.fetterType) then
v.enabled = 0 v.enabled = 0
@ -154,6 +163,7 @@ end
--根据type获取羁绊数据 --根据type获取羁绊数据
function this.GetFetterDataByFetterType(fetterType) function this.GetFetterDataByFetterType(fetterType)
local data = {} local data = {}
--LogError("fetterType===="..fetterType)
for k,v in pairs(this.fetterData) do for k,v in pairs(this.fetterData) do
if v.fetterType == fetterType and v.enabled ~= -2 then if v.fetterType == fetterType and v.enabled ~= -2 then
-- 神将篇判断神将是否加入版本,有一个不在版本内就不显示 -- 神将篇判断神将是否加入版本,有一个不在版本内就不显示
@ -170,6 +180,7 @@ function this.GetFetterDataByFetterType(fetterType)
table.insert(data,v) table.insert(data,v)
end end
else else
--LogError("+++++++++++++++++++++++")
table.insert(data,v) table.insert(data,v)
end end
end end
@ -227,6 +238,8 @@ function this.IsHaveItem(fetterType,id,num)
data = PokemonManager.GetAllPokemonGetDatas() data = PokemonManager.GetAllPokemonGetDatas()
elseif fetterType == 4 then elseif fetterType == 4 then
data = EquipManager.GetHaveEquipDatas() data = EquipManager.GetHaveEquipDatas()
elseif fetterType ==5 then
data = GodWeaponManager.GetAllHandData()
end end
if fetterType == 4 then if fetterType == 4 then
if data[id] and data[id] >= num then if data[id] and data[id] >= num then