Branch_DNA
parent
bff87cd4ae
commit
f57d12f1c8
|
|
@ -231,7 +231,9 @@ local ManagerNames = {
|
|||
"PowerCenter/PowerCenterManager",
|
||||
--!!!!红点管理(尽量放在最后)!!!!--
|
||||
"Player/RedpotManager",
|
||||
|
||||
--命格
|
||||
"Gem/GiftManager",
|
||||
"Incarnation/IncarnationManager",
|
||||
}
|
||||
|
||||
return ManagerNames
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
local GiftConfig = {
|
||||
__count = 300,
|
||||
__indexs = {1.003},
|
||||
__values = {0,1.992},
|
||||
__fields = {
|
||||
'Id',
|
||||
'Gift',
|
||||
'Box'
|
||||
},
|
||||
__defaults = {
|
||||
nil,
|
||||
nil
|
||||
},
|
||||
__refs = {
|
||||
{1.003},
|
||||
{13,.992}
|
||||
},
|
||||
__refPoss = {
|
||||
nil,
|
||||
nil
|
||||
},
|
||||
}
|
||||
return GiftConfig
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2d500ef8fdf5ef04681c700a3d69835a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -35,9 +35,6 @@ function this.GetCollectLvAndNum()
|
|||
collect=collect+equipConfig[id].Gift
|
||||
end
|
||||
end
|
||||
if CheckFunctionOpen(FUNCTION_OPEN_TYPE.Train) then
|
||||
collect=collect+HeroManager.ReturnGiftCount()
|
||||
end
|
||||
for k, v in ConfigPairs(giftConfig) do
|
||||
if collect>=v.Gift then
|
||||
lv=v.Id
|
||||
|
|
@ -139,18 +136,6 @@ function this.GetHeroGiftAddPro(_id)
|
|||
-- end
|
||||
-- end
|
||||
end
|
||||
local trainAdd=0
|
||||
if CheckFunctionOpen(FUNCTION_OPEN_TYPE.Train) then
|
||||
trainAdd=HeroManager.ReturnGiftAtt()
|
||||
-- for k, v in ipairs(data) do
|
||||
-- data[k]=data[k]*(1+t)
|
||||
-- end
|
||||
end
|
||||
if addPro>0 then
|
||||
for k, v in pairs(data) do
|
||||
data[k]=math.floor(v*(1+addPro/10000+trainAdd)+0.5)
|
||||
end
|
||||
end
|
||||
return data
|
||||
end
|
||||
|
||||
|
|
@ -319,10 +304,6 @@ function this.CheckPlayerGiftComRed()
|
|||
end
|
||||
--检测英雄红点
|
||||
function this.CheckRoleRedPointById(_id)
|
||||
local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.Gift)
|
||||
if isOpen==false then
|
||||
return false
|
||||
end
|
||||
local lv,cur,max=this.GetCollectLvAndNum()
|
||||
if this.allHeroGifts[_id] then
|
||||
local list=this.allHeroGifts[_id]
|
||||
|
|
@ -348,7 +329,7 @@ end
|
|||
|
||||
--检测主角红点
|
||||
function this.CheckPlayerRedPoint()
|
||||
local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.Gift)
|
||||
local isOpen=ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.Gift)
|
||||
if isOpen==false then
|
||||
return false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -348,11 +348,9 @@ function this.TrainUpdateHeroDatas(_msgHeroData, _isFindHandBook, _isExtern)
|
|||
return heroData
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetHeroEquipIdList(heroDid)
|
||||
return heroDatas[heroDid].equipIdList
|
||||
end
|
||||
|
||||
function this.GetHeroEquipIdList1(heroDid, id)
|
||||
for i = 1, #heroDatas[heroDid].equipIdList do
|
||||
if equipConfig[tonumber(heroDatas[heroDid].equipIdList[i])].Position == equipConfig[tonumber(id)].Position then
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d84815008ec8db5468b3ce3d656a066b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,546 @@
|
|||
IncarnationManager = {}
|
||||
local this = IncarnationManager
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
--local ChangingCard = ConfigManager.GetConfig(ConfigName.ChangingCard)
|
||||
--local PassiveSkillConfig = ConfigManager.GetConfig(ConfigName.PlayerSkill)
|
||||
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||
this.itemDataList = {} --state -1 未拥有 0 已有未激活 1激活未上阵 2上阵
|
||||
this.SingleIncarnationPro = {}
|
||||
this.SingleIncarnationProDes = ""
|
||||
this.incarnationForceLv=1 --化身之力等级id
|
||||
function this.Initialize()
|
||||
this.InitItemDataList()
|
||||
end
|
||||
|
||||
function this.InitItemDataList()
|
||||
--[[
|
||||
for k,v in ConfigPairs(ChangingCard) do
|
||||
this.CreatEmptyItemData(v.Id)
|
||||
end
|
||||
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig,138)
|
||||
local strs = string.split(config.Value,"|")
|
||||
for i = 1,#strs do
|
||||
local str = string.split(strs[i],"#")
|
||||
local proId = tonumber(str[1])
|
||||
local proNum = tonumber(str[2])
|
||||
if not this.SingleIncarnationPro[proId] then
|
||||
this.SingleIncarnationPro[proId] = 0
|
||||
end
|
||||
this.SingleIncarnationPro[proId] = this.SingleIncarnationPro[proId] + proNum
|
||||
end
|
||||
]]
|
||||
this.SingleIncarnationProDes = ""
|
||||
this.SingleIncarnationProDes = this.GetproDesStr(this.SingleIncarnationProDes,this.SingleIncarnationPro)
|
||||
--Game.GlobalEvent:AddEvent(GameEvent.Bag.GetNewItemIncarnation, this.GetbagIncarnationData)
|
||||
end
|
||||
|
||||
function this.CreatEmptyItemData(id)
|
||||
if id==nil then
|
||||
return
|
||||
end
|
||||
if ChangingCard[id].IsOpen == 0 then
|
||||
return
|
||||
end
|
||||
--以state字段来判断状态 pos 字段只是位置,不做判断
|
||||
if not this.itemDataList[id] then
|
||||
this.itemDataList[id] = {}
|
||||
this.itemDataList[id].id = id
|
||||
this.itemDataList[id].level=1
|
||||
this.itemDataList[id].star=0
|
||||
this.itemDataList[id].itemId = ChangingCard[id].CardId
|
||||
this.itemDataList[id].name = itemConfig[ChangingCard[id].CardId].Name
|
||||
this.itemDataList[id].state = -1
|
||||
this.itemDataList[id].pos = 0
|
||||
this.itemDataList[id].property = itemConfig[ChangingCard[id].CardId].PropertyName
|
||||
this.itemDataList[id].quality = itemConfig[ChangingCard[id].CardId].Quantity
|
||||
this.itemDataList[id].icon = itemConfig[ChangingCard[id].CardId].ResourceID
|
||||
this.itemDataList[id].heroId = ChangingCard[id].desc2
|
||||
this.itemDataList[id].proDatas =this.GetChangeCardProperty(id)
|
||||
this.itemDataList[id].skillDatas = ChangingCard[id].Skill[1]
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetproDesStr(_str,dataList)
|
||||
local str = _str
|
||||
for k,v in pairs(dataList) do
|
||||
str = str..PropertyConfig[k].Info.."+"..GetPropertyFormatStrOne(PropertyConfig[k].Style,v).." "
|
||||
end
|
||||
return str
|
||||
end
|
||||
--获取化身卡指定星级的技能描述
|
||||
function this.GetSkillDesStr(id,Star)
|
||||
local skillId= ChangingCard[id].Skill[Star+1]
|
||||
local skillDes= PassiveSkillConfig[skillId].Desc
|
||||
return skillDes
|
||||
end
|
||||
---获取属性信息和技能信息
|
||||
function this.GetCardPropDesStr(id)
|
||||
local proDesList = {}
|
||||
local str = "激活属性:"
|
||||
str = this.GetproDesStr(str,this.itemDataList[id].proDatas)
|
||||
table.insert(proDesList,str)
|
||||
local skillDes = PassiveSkillConfig[this.itemDataList[id].skillDatas].Desc
|
||||
table.insert(proDesList,skillDes)
|
||||
return proDesList
|
||||
end
|
||||
|
||||
function this.GetproDesLst(dataList,_color)
|
||||
local lis1 = {}
|
||||
for k,v in pairs(dataList) do
|
||||
table.insert(lis1,{str = string.format("<color=#%s>%s+%s</color>",_color,PropertyConfig[k].Info,GetPropertyFormatStrOne(PropertyConfig[k].Style,v)) ,sort = PropertyConfig[k].SortId})
|
||||
end
|
||||
table.sort(lis1,function(a,b)
|
||||
return a.sort < b.sort
|
||||
end)
|
||||
local list = {}
|
||||
for i = 1,#lis1 do
|
||||
table.insert(list,lis1[i].str)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
-- 初始化赋值操作 _incarnationForceLv化身之力等级id
|
||||
function this.SetItemDataList(dataList,_incarnationForceLv)
|
||||
for i = 1,#dataList do
|
||||
local state = dataList[i].status
|
||||
if dataList[i].status == 0 then
|
||||
state = 1
|
||||
elseif dataList[i].status == 1 then
|
||||
state = 2
|
||||
end
|
||||
this.SetItemDataByid(dataList[i].id,state,dataList[i].index)
|
||||
this.SetLevel(dataList[i].id,dataList[i].level)
|
||||
this.SetStar(dataList[i].id,dataList[i].star)
|
||||
this.SetSkillData(dataList[i].id)
|
||||
this.SetPropDatas(dataList[i].id)
|
||||
end
|
||||
this.incarnationForceLv=_incarnationForceLv
|
||||
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Incarnation)
|
||||
end
|
||||
|
||||
function this.GetbagIncarnationData()
|
||||
local data = BagManager.GetDataByItemType(ItemType.Incarnation)
|
||||
for i = 1,#data do
|
||||
this.SetItemDataByCardId(data[i].id)
|
||||
end
|
||||
end
|
||||
|
||||
function this.SetItemDataByCardId(id)
|
||||
local config = ConfigManager.TryGetConfigDataByKey(ConfigName.ChangingCard,"CardId",id)
|
||||
if config then
|
||||
if this.itemDataList[config.Id] and this.itemDataList[config.Id].state < 1 then
|
||||
if BagManager.GetItemCountById(id) > 0 then
|
||||
this.SetItemDataByid(config.Id,0,0)
|
||||
else
|
||||
this.SetItemDataByid(config.Id,-1,0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this.SetItemDataByid(id,state,pos)
|
||||
if not this.itemDataList[id] then
|
||||
this.CreatEmptyItemData(id)
|
||||
end
|
||||
this.itemDataList[id].state = state
|
||||
this.itemDataList[id].pos = pos
|
||||
CheckRedPointStatus(this.itemDataList[id].property + 43801)
|
||||
end
|
||||
|
||||
function this.SetLevel(id,level)
|
||||
if level<=0 then
|
||||
this.itemDataList[id].level=1
|
||||
else
|
||||
this.itemDataList[id].level=level
|
||||
end
|
||||
end
|
||||
|
||||
function this.SetStar(id,star)
|
||||
this.itemDataList[id].star=star
|
||||
end
|
||||
--设置激活技能数据
|
||||
function this.SetSkillData(id)
|
||||
local changeCardData=this.itemDataList[id]
|
||||
changeCardData.skillDatas = ChangingCard[id].Skill[changeCardData.star+1]
|
||||
end
|
||||
--设置奥义卡所有属性加成
|
||||
function this.SetPropDatas(id)
|
||||
this.itemDataList[id].proDatas =this.GetChangeCardProperty(id)
|
||||
end
|
||||
|
||||
function this.GetStatusByItemId(id)
|
||||
local config = ConfigManager.TryGetConfigDataByKey(ConfigName.ChangingCard,"CardId",id)
|
||||
if config then
|
||||
return this.itemDataList[config.Id].state
|
||||
end
|
||||
return -1
|
||||
end
|
||||
|
||||
|
||||
|
||||
local sortData = {
|
||||
[-1] = 0,
|
||||
[0] = 2,
|
||||
[1] = 1,
|
||||
[2] = 1,
|
||||
}
|
||||
|
||||
--根据属性获取化身数据
|
||||
function this.GetItemDataListByPro(property)
|
||||
local datas = {}
|
||||
for k,v in pairs(this.itemDataList) do
|
||||
if v.property == property then
|
||||
table.insert(datas,v)
|
||||
end
|
||||
end
|
||||
table.sort(datas,function(a,b)
|
||||
if sortData[a.state] == sortData[b.state] then
|
||||
if a.quality == b.quality then
|
||||
return a.id < b.id
|
||||
else
|
||||
return a.quality > b.quality
|
||||
end
|
||||
else
|
||||
return sortData[a.state] > sortData[b.state]
|
||||
end
|
||||
end)
|
||||
return datas
|
||||
end
|
||||
|
||||
--获取化身之力属性加成
|
||||
function this.GetIncarnationPower()
|
||||
local id =this.incarnationForceLv
|
||||
if id==0 then
|
||||
id=1
|
||||
end
|
||||
local lvConfig=ConfigManager.GetConfigData(ConfigName.ChangingForce,id)
|
||||
local proList=lvConfig.PropList
|
||||
return proList
|
||||
end
|
||||
---获取身外化身所有属性加成
|
||||
function this.GetIncarnationTotalPro()
|
||||
local proList = {}
|
||||
for k,v in pairs(this.itemDataList) do
|
||||
if v.state > 0 then
|
||||
for k,v in pairs(v.proDatas) do
|
||||
if not proList[k] then
|
||||
proList[k] = 0
|
||||
end
|
||||
proList[k] = proList[k] + v
|
||||
--LogError("单个化身技------------------------- k=="..k.." v===="..v)
|
||||
end
|
||||
end
|
||||
end
|
||||
--主角等级表加的属性
|
||||
local playerConfig=ConfigManager.TryGetConfigData(ConfigName.PlayerLevelConfig,PlayerManager.level)
|
||||
if playerConfig and playerConfig.PlayerPropList then
|
||||
for key, v in pairs(playerConfig.PlayerPropList) do
|
||||
if proList[v[1]] then
|
||||
proList[v[1]]=proList[v[1]]+v[2]
|
||||
else
|
||||
proList[v[1]]=v[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
-- for k,v in pairs(proList) do
|
||||
-- LogError("化身技啊------------------------- k=="..k.." v===="..v)
|
||||
-- end
|
||||
|
||||
--屏蔽化身之力战斗力 2023/08/08
|
||||
-- local proList1 = this.GetIncarnationPower()
|
||||
-- for k,v in pairs(proList1) do
|
||||
-- if not proList[v[1]] then
|
||||
-- proList[v[1]] = 0
|
||||
-- end
|
||||
-- proList[v[1]] = proList[v[1]] + v[2]
|
||||
-- end
|
||||
return proList
|
||||
end
|
||||
|
||||
--获取已上阵的奥义卡 --界面获取
|
||||
function this.GetIncarnationData1()
|
||||
local datas = {}
|
||||
for k,v in pairs(this.itemDataList) do
|
||||
if v.state == 2 then
|
||||
datas[v.pos] = v
|
||||
end
|
||||
end
|
||||
return datas
|
||||
end
|
||||
|
||||
--获取已上阵的奥义卡 --战斗获取
|
||||
function this.GetIncarnationData()
|
||||
local datas = {}
|
||||
for k,v in pairs(this.itemDataList) do
|
||||
if v.state == 2 then
|
||||
table.insert(datas,v.id)
|
||||
end
|
||||
end
|
||||
return datas
|
||||
end
|
||||
|
||||
--获取已上阵的奥义卡 --战斗获取
|
||||
function this.GetIncarnationDataById(id)
|
||||
for k,v in pairs(this.itemDataList) do
|
||||
if v.itemId == id then
|
||||
return v
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function this.CheckRedData(red)
|
||||
local list = {}
|
||||
--return false
|
||||
if red == RedPointType.incarnation_people then
|
||||
list = this.GetItemDataListByPro(1)
|
||||
elseif red == RedPointType.incarnation_buddish then
|
||||
list = this.GetItemDataListByPro(2)
|
||||
elseif red == RedPointType.incarnation_demon then
|
||||
list = this.GetItemDataListByPro(3)
|
||||
elseif red == RedPointType.incarnation_Kong then
|
||||
list = this.GetItemDataListByPro(5)
|
||||
else
|
||||
list = this.GetItemDataListByPro(4)
|
||||
end
|
||||
for k,v in pairs(list) do
|
||||
if v.state == 0 then
|
||||
return true
|
||||
end
|
||||
if v.state>0 and (this.CheckCardUpLvRedData(v.id) or this.CheckCardUpStarRedData(v.id)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--检测化身卡是否可以升级
|
||||
function this.CheckCardUpLvRedData(id)
|
||||
local poolId= ChangingCard[id].LevelUpPool
|
||||
local level= this.itemDataList[id].level
|
||||
local upExp= ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardLevel,"PoolId",poolId,"Level",level).Exp
|
||||
if upExp then
|
||||
if BagManager.GetItemCountById(upExp[1])>=upExp[2] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--检测化身卡是否可以升星
|
||||
function this.CheckCardUpStarRedData(id)
|
||||
local star= this.itemDataList[id].star
|
||||
LogError("id======================"..id.." star=="..star)
|
||||
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardStar,"PoolId",ChangingCard[id].Star,"Level",star)
|
||||
local isShow=true
|
||||
if starConfig and star<ChangingCard[id].StarMax then
|
||||
local cost=starConfig.PropList
|
||||
for i = 1, #cost do
|
||||
if cost[i][1]==0 then
|
||||
local num=BagManager.GetItemCountById(ChangingCard[id].CardId)
|
||||
LogError("num==========="..num.." cost[i][2]=="..cost[i][2])
|
||||
if num<cost[i][2] then
|
||||
isShow=false
|
||||
end
|
||||
else
|
||||
local num2=BagManager.GetItemCountById(cost[i][1])
|
||||
LogError("num==========="..num2.." cost[i][2]=="..cost[i][2])
|
||||
if num2<cost[i][2] then
|
||||
isShow=false
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
isShow=false
|
||||
end
|
||||
return isShow
|
||||
-- if star<#starCost then
|
||||
-- local costData=starCost[star+1]
|
||||
-- local allItemList= BagManager.GetBagAllDataByItemType(29)
|
||||
-- local curHaveItemNum=0
|
||||
-- for i, v in pairs(allItemList) do
|
||||
-- if v.quality==costData[1] and v.num>0 then
|
||||
-- curHaveItemNum=curHaveItemNum+v.num
|
||||
-- end
|
||||
-- end
|
||||
-- if curHaveItemNum>=costData[2] then
|
||||
-- return true
|
||||
-- end
|
||||
-- end
|
||||
--return false
|
||||
end
|
||||
|
||||
---检测化身之力红点
|
||||
function this.CheckPowerBtnRedData(red)
|
||||
--屏蔽化身之力红点
|
||||
return false
|
||||
-- this.configData = ConfigManager.GetConfigData(ConfigName.ChangingForce,this.incarnationForceLv)
|
||||
-- if not this.configData.ExpCost then
|
||||
-- return false
|
||||
-- end
|
||||
-- local curHaveItemNum=BagManager.GetItemCountById(this.configData.ExpCost[1])
|
||||
-- local curCostItemNum=this.configData.ExpCost[2]
|
||||
-- if curHaveItemNum >=curCostItemNum then
|
||||
-- return true
|
||||
-- end
|
||||
-- return false
|
||||
end
|
||||
|
||||
function this.GetChangeCardProperty(cardId,isNextLv,isNextStar)
|
||||
local changeCardInfo=this.itemDataList[cardId]
|
||||
local star=changeCardInfo.star
|
||||
local level=changeCardInfo.level
|
||||
if isNextStar then
|
||||
star=star+1
|
||||
end
|
||||
if isNextLv then
|
||||
level=level+1
|
||||
end
|
||||
|
||||
|
||||
|
||||
if changeCardInfo then
|
||||
local cardConfig=ConfigManager.GetConfigData(ConfigName.ChangingCard,cardId)
|
||||
LogError("cardConfig.Star=="..cardConfig.Star.." star=="..star)
|
||||
|
||||
local propList={}
|
||||
for k,v in pairs(cardConfig.PropList) do
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
for k,v in pairs(cardConfig.PlayerPropList) do
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
if changeCardInfo then
|
||||
if star>=0 then
|
||||
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardStar,"PoolId",cardConfig.Star,"Level",star)
|
||||
local startProp
|
||||
-- if star==1 then
|
||||
-- startProp=cardConfig.Star1UpProps
|
||||
-- elseif star==2 then
|
||||
-- startProp=cardConfig.Star2UpProps
|
||||
-- elseif star==3 then
|
||||
-- startProp=cardConfig.Star3UpProps
|
||||
-- elseif star==4 then
|
||||
-- startProp=cardConfig.Star4UpProps
|
||||
-- elseif star==5 then
|
||||
-- startProp=cardConfig.Star5UpProps
|
||||
-- end
|
||||
startProp=starConfig.Exp
|
||||
for k,v in pairs(startProp) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
|
||||
end
|
||||
for k,v in pairs(starConfig.PlayerPropList) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if level>0 then
|
||||
local cardLvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardLevel,"Level",level,"PoolId",cardConfig.LevelUpPool)
|
||||
for k,v in pairs(cardLvConfig.PropList) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
end
|
||||
for k,v in pairs(cardLvConfig.PlayerPropList) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
-- local playerConfig=ConfigManager.TryGetConfigData(ConfigName.PlayerLevelConfig,PlayerManager.level)
|
||||
-- if playerConfig and playerConfig.PlayerPropList then
|
||||
-- for key, v in pairs(playerConfig.PlayerPropList) do
|
||||
-- if propList[v[1]] then
|
||||
-- propList[v[1]]=propList[v[1]]+v[2]
|
||||
-- else
|
||||
-- propList[v[1]]=v[2]
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
return propList
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function this.GetChangeCardPropertyAdd(cardId,level,star)
|
||||
local cardConfig=ConfigManager.GetConfigData(ConfigName.ChangingCard,cardId)
|
||||
local propList={}
|
||||
for k,v in pairs(cardConfig.PropList) do
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
if star>=0 then
|
||||
local startProp
|
||||
-- if star==1 then
|
||||
-- startProp=cardConfig.Star1UpProps
|
||||
-- elseif star==2 then
|
||||
-- startProp=cardConfig.Star2UpProps
|
||||
-- elseif star==3 then
|
||||
-- startProp=cardConfig.Star3UpProps
|
||||
-- end
|
||||
local starConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardStar,"PoolId",cardConfig.Star,"Level",star)
|
||||
for k,v in pairs(starConfig.Exp) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
|
||||
end
|
||||
for k,v in pairs(starConfig.PlayerPropList) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
if level>0 then
|
||||
local cardLvConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.ChangingCardLevel,"Level",level,"PoolId",cardConfig.LevelUpPool)
|
||||
for k,v in pairs(cardLvConfig.PropList) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
end
|
||||
for k,v in pairs(cardLvConfig.PlayerPropList) do
|
||||
if propList[v[1]] then
|
||||
propList[v[1]]=propList[v[1]]+v[2]
|
||||
else
|
||||
propList[v[1]]=v[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
-- local playerConfig=ConfigManager.TryGetConfigData(ConfigName.PlayerLevelConfig,PlayerManager.level)
|
||||
-- if playerConfig and playerConfig.PlayerPropList then
|
||||
-- for key, v in pairs(playerConfig.PlayerPropList) do
|
||||
-- if propList[v[1]] then
|
||||
-- propList[v[1]]=propList[v[1]]+v[2]
|
||||
-- else
|
||||
-- propList[v[1]]=v[2]
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
return propList
|
||||
end
|
||||
|
||||
|
||||
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a7d881b4d17a84242bd487ef37c96d16
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
require("Base/BasePanel")
|
||||
RoleGiftPanel = Inherit(BasePanel)
|
||||
local spcialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
||||
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
|
|
@ -22,7 +23,8 @@ local heroListData
|
|||
local isDown=false
|
||||
--初始化组件(用于子类重写)RoleEquipChangePopup
|
||||
function RoleGiftPanel:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
LogError("dddddddddddddddddddddddddddd")
|
||||
--this.spLoader = SpriteLoader.New()
|
||||
this.bg2 = Util.GetGameObject(self.transform, "bg2")
|
||||
screenAdapte(this.bg2)
|
||||
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, {showType = UpViewOpenType.ShowLeft})
|
||||
|
|
@ -68,7 +70,7 @@ function RoleGiftPanel:InitComponent()
|
|||
this.UpScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.transform, "upScroll").transform,this.upItemPre, nil,Vector2.New(v1.width,v1.height),1 ,4, Vector2.New(50,65))
|
||||
this.UpScrollView.moveTween.MomentumAmount = 1
|
||||
this.UpScrollView.moveTween.Strength = 1
|
||||
Util.GetGameObject(self.transform, "powerBtn"):GetComponent("Image").sprite = this.spLoader:LoadSprite("UI_hz_shenjiang_15_zh")
|
||||
Util.GetGameObject(self.transform, "powerBtn"):GetComponent("Image").sprite = Util.LoadSprite("UI_hz_shenjiang_15_zh")
|
||||
this.force = Util.GetGameObject(self.transform, "powerBtn/value"):GetComponent("Text")
|
||||
this.itemNumText = Util.GetGameObject(self.transform, "itemNumText"):GetComponent("Text")
|
||||
this.upLvEffect = Util.GetGameObject(self.transform, "powerBtn/effect")
|
||||
|
|
@ -79,7 +81,7 @@ function RoleGiftPanel:InitComponent()
|
|||
this.mask:SetActive(false)
|
||||
this.collectImg=Util.GetGameObject(self.gameObject, "collectImg"):GetComponent("Image")
|
||||
this.lvTxt=Util.GetGameObject(self.gameObject, "lvTxt"):GetComponent("Text")
|
||||
--this.collectImg.sprite=this.spLoader:LoadSprite("gh_tt_8")
|
||||
--this.collectImg.sprite=Util.LoadSprite("gh_tt_8")
|
||||
|
||||
this.btn_help=Util.GetGameObject(self.gameObject, "btn_help")
|
||||
this.listObj = Util.GetGameObject(self.transform, "listObj")
|
||||
|
|
@ -92,8 +94,8 @@ function RoleGiftPanel:InitComponent()
|
|||
--this.tipInfo = Util.GetGameObject(self.transform, "tipInfo"):GetComponent("Text")
|
||||
|
||||
this.proEmptyObj = Util.GetGameObject(self.transform, "proEmptyObj")
|
||||
Util.GetGameObject(self.transform, "proEmptyObj/TextImage/Text"):GetComponent("Text").text="暂无加成属性"
|
||||
|
||||
Util.GetGameObject(self.transform, "proEmptyObj/Text"):GetComponent("Text").text="暂无加成属性"
|
||||
LogError("vvvvvvvvvvvvvvvvvvvvvvvvv")
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
|
@ -203,7 +205,7 @@ function RoleGiftPanel:OnShow()
|
|||
index = i
|
||||
end
|
||||
end
|
||||
teamHero = FormationManager.GetAllMainFormationHeroId()
|
||||
teamHero = FormationManager.GetAllFormationHeroId()
|
||||
this.RefreshWindowData()
|
||||
end
|
||||
|
||||
|
|
@ -219,12 +221,16 @@ function this.RefreshWindowData()
|
|||
return
|
||||
end
|
||||
isUpZhen=teamHero[curHeroData.dynamicId]
|
||||
if isUpZhen then
|
||||
--[[
|
||||
if isUpZhen then
|
||||
WarPower = HeroPowerManager.GetHeroPower(curHeroData.dynamicId, FormationTypeDef.FORMATION_NORMAL)
|
||||
else
|
||||
WarPower = HeroPowerManager.GetHeroPower(curHeroData.dynamicId)
|
||||
end
|
||||
this.force.text = WarPower
|
||||
|
||||
]]
|
||||
this.force.text = ""
|
||||
--显示上面赠送的
|
||||
local list=GiftManager.GetHeroGifts(curHeroData.dynamicId)
|
||||
lv,curNum,maxNum=GiftManager.GetCollectLvAndNum()
|
||||
|
|
@ -329,7 +335,7 @@ function this.SingleUpItemShow(_go,data,_index)
|
|||
local starGrid=Util.GetGameObject(_go,"starGrid")
|
||||
if data.id and data.id~=0 then
|
||||
red:SetActive(false)
|
||||
frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(itemConfig[data.id].Quantity))
|
||||
frame.sprite=Util.LoadSprite(GetQuantityImageByquality(itemConfig[data.id].Quantity))
|
||||
icon.gameObject:SetActive(true)
|
||||
name.gameObject:SetActive(true)
|
||||
lockObj:SetActive(false)
|
||||
|
|
@ -337,8 +343,8 @@ function this.SingleUpItemShow(_go,data,_index)
|
|||
lockText.gameObject:SetActive(false)
|
||||
add:SetActive(false)
|
||||
name.text=itemConfig[data.id].Name
|
||||
icon.sprite=this.spLoader:LoadSprite(GetResourcePath(itemConfig[data.id].ResourceID))
|
||||
SetHeroStars(this.spLoader,starGrid,equipConfig[data.id].Star,1,nil,-15)
|
||||
icon.sprite=Util.LoadSprite(GetResourcePath(itemConfig[data.id].ResourceID))
|
||||
SetHeroStars(starGrid,equipConfig[data.id].Star,1,nil,-15)
|
||||
Util.AddOnceClick(icon.gameObject,function()
|
||||
if curHeroData==nil then
|
||||
return
|
||||
|
|
@ -348,7 +354,7 @@ function this.SingleUpItemShow(_go,data,_index)
|
|||
end
|
||||
)
|
||||
else
|
||||
frame.sprite=this.spLoader:LoadSprite("UI_hz_beibao_duigoudi")
|
||||
frame.sprite=Util.LoadSprite("UI_hz_beibao_duigoudi")
|
||||
icon.gameObject:SetActive(false)
|
||||
name.gameObject:SetActive(false)
|
||||
starGrid:SetActive(false)
|
||||
|
|
|
|||
Loading…
Reference in New Issue