xiyou_sanguo
zhangjiannan 2025-10-23 18:47:36 +08:00
parent 356925708a
commit dbdf53dfea
4 changed files with 210 additions and 215 deletions

View File

@ -572,7 +572,7 @@ function this.IsActivityTypeOpen(type)
table.walk(globalActConfigs, function(actConfigInfo) table.walk(globalActConfigs, function(actConfigInfo)
if this.mission and this.mission[actConfigInfo.Id] then if this.mission and this.mission[actConfigInfo.Id] then
activityId = actConfigInfo.Id activityId = actConfigInfo.Id
LogError("找到服务器活动相关配置,类型:" .. tostring(activityId)) --LogError("找到服务器活动相关配置,类型:" .. tostring(activityId))
end end
end) end)
return activityId return activityId

View File

@ -1,133 +1,137 @@
--新的命格管理 --新的命格管理
GiftManager = {} GiftManager = {}
local this = GiftManager local this = GiftManager
local giftConfig=ConfigManager.GetConfig(ConfigName.GiftConfig) local giftConfig = ConfigManager.GetConfig(ConfigName.GiftConfig)
local equipConfig=ConfigManager.GetConfig(ConfigName.EquipConfig) local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
function this.Initialize() function this.Initialize()
this.allHeroGifts={} this.allHeroGifts = {}
this.playerGifts={} this.playerGifts = {}
end end
--初始化命石 --初始化命石
function this.InitGemsInfo(msg) function this.InitGemsInfo(msg)
end end
--初始化英雄礼物 --初始化英雄礼物
function this.InitHeroGift(id,list) function this.InitHeroGift(id, list)
this.allHeroGifts[id]=list this.allHeroGifts[id] = list
end end
--初始化主角礼物 --初始化主角礼物
function this.InitPlayerGift(list) function this.InitPlayerGift(list)
this.playerGifts=list this.playerGifts = list
end end
--获取收取等级和最大数量 --获取收取等级和最大数量
function this.GetCollectLvAndNum() function this.GetCollectLvAndNum()
local lv=0 local lv = 0
local maxNum=0 local maxNum = 0
local collect=0 local collect = 0
local curNum=0 local curNum = 0
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
if equipConfig[id] then if equipConfig[id] then
collect=collect+equipConfig[id].Gift collect = collect + equipConfig[id].Gift
end end
end end
if CheckFunctionOpen(FUNCTION_OPEN_TYPE.Train) then if CheckFunctionOpen(FUNCTION_OPEN_TYPE.Train) then
collect=collect+HeroManager.ReturnGiftCount() collect = collect + HeroManager.ReturnGiftCount()
end end
for k, v in ConfigPairs(giftConfig) do for k, v in ConfigPairs(giftConfig) do
if collect>=v.Gift and HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).value >= v.Harmony then if collect >= v.Gift and HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).value >= v.Harmony then
lv=v.Id lv = v.Id
curNum=v.Box curNum = v.Box
else else
maxNum=v.Box maxNum = v.Box
break break
end end
end end
if maxNum==0 then if maxNum == 0 then
maxNum=curNum maxNum = curNum
end end
return lv,curNum,maxNum return lv, curNum, maxNum
end end
--设置英雄礼物 type 1穿 2 --设置英雄礼物 type 1穿 2
function this.SetHeroGift(id,list,type) function this.SetHeroGift(id, list, type)
if this.allHeroGifts[id]==nil then if this.allHeroGifts[id] == nil then
this.allHeroGifts[id]={} this.allHeroGifts[id] = {}
end end
for i=1,#list do for i = 1, #list do
if type==1 then if type == 1 then
table.insert(this.allHeroGifts[id],list[i]) table.insert(this.allHeroGifts[id], list[i])
elseif type==2 then elseif type == 2 then
table.removebyvalue(this.allHeroGifts[id],list[i]) table.removebyvalue(this.allHeroGifts[id], list[i])
end end
end end
HeroManager.ChangeHeroGift(id,this.allHeroGifts[id]) HeroManager.ChangeHeroGift(id, this.allHeroGifts[id])
end end
--设置主角礼物 --设置主角礼物
function this.SetPlayerGift(list) function this.SetPlayerGift(list)
for i=1,#list do for i = 1, #list do
table.insert(this.playerGifts,list[i]) table.insert(this.playerGifts, list[i])
end end
end end
--移除主角礼物 --移除主角礼物
function this.RemovePlayerGift(list) function this.RemovePlayerGift(list)
for i=1,#list do for i = 1, #list do
table.removebyvalue(this.playerGifts,list[i]) table.removebyvalue(this.playerGifts, list[i])
end end
end end
function this.GetHeroGifts(_id) function this.GetHeroGifts(_id)
if this.allHeroGifts[_id] then if this.allHeroGifts[_id] then
return this.allHeroGifts[_id] return this.allHeroGifts[_id]
end end
return {} return {}
end end
function this.GetPlayerGifts() function this.GetPlayerGifts()
return this.playerGifts return this.playerGifts
end end
function this.changeGiftsByType(_type,_list) function this.changeGiftsByType(_type, _list)
end end
--获取英雄礼物增加的属性 --获取英雄礼物增加的属性
function this.GetHeroGiftAddPro(_id) function this.GetHeroGiftAddPro(_id)
local data={} local data = {}
if not this.allHeroGifts[_id] then if not this.allHeroGifts[_id] then
LogError("英雄gift======================nil") LogError("英雄gift======================nil")
return data return data
end end
local addPro=0 local addPro = 0
if this.playerGifts and #this.playerGifts>0 then if this.playerGifts and #this.playerGifts > 0 then
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
if equipConfig[id] and equipConfig[id].HeroGitUp and equipConfig[id].HeroGitUp>0 then if equipConfig[id] and equipConfig[id].HeroGitUp and equipConfig[id].HeroGitUp > 0 then
addPro=addPro + equipConfig[id].HeroGitUp addPro = addPro + equipConfig[id].HeroGitUp
end end
end end
end end
--HeroGitUp --HeroGitUp
local list=this.allHeroGifts[_id] local list = this.allHeroGifts[_id]
for i=1,#list do for i = 1, #list do
local id=list[i] local id = list[i]
local pro = equipConfig[id].Property local pro = equipConfig[id].Property
if pro and #pro>0 then if pro and #pro > 0 then
for k = 1, #pro do for k = 1, #pro do
local key=pro[k][1] local key = pro[k][1]
local value=pro[k][2] local value = pro[k][2]
if tonumber(key)~=0 and tonumber(key)~=nil then if tonumber(key) ~= 0 and tonumber(key) ~= nil then
if not data[key] then if not data[key] then
data[key] = 0 data[key] = 0
end end
data[key] = data[key] + value data[key] = data[key] + value
end end
end end
end end
--英雄礼物不会加成主角属性 --英雄礼物不会加成主角属性
-- local pro2 = equipConfig[id].PlayerProperty -- local pro2 = equipConfig[id].PlayerProperty
-- if pro2 and #pro2>0 then -- if pro2 and #pro2>0 then
@ -139,16 +143,16 @@ function this.GetHeroGiftAddPro(_id)
-- end -- end
-- end -- end
end end
local trainAdd=0 local trainAdd = 0
if CheckFunctionOpen(FUNCTION_OPEN_TYPE.Train) then if CheckFunctionOpen(FUNCTION_OPEN_TYPE.Train) then
trainAdd=HeroManager.ReturnGiftAtt() trainAdd = HeroManager.ReturnGiftAtt()
-- for k, v in ipairs(data) do -- for k, v in ipairs(data) do
-- data[k]=data[k]*(1+t) -- data[k]=data[k]*(1+t)
-- end -- end
end end
if addPro>0 then if addPro > 0 then
for k, v in pairs(data) do for k, v in pairs(data) do
data[k]=math.floor(v*(1+addPro/10000+trainAdd)+0.5) data[k] = math.floor(v * (1 + addPro / 10000 + trainAdd) + 0.5)
end end
end end
return data return data
@ -156,39 +160,39 @@ end
--获取英雄礼物增加的白板属性属性(表里配置的属性) --获取英雄礼物增加的白板属性属性(表里配置的属性)
function this.GetHeroGiftAddOriginalPro(_id) function this.GetHeroGiftAddOriginalPro(_id)
local data={} local data = {}
if not this.allHeroGifts[_id] then if not this.allHeroGifts[_id] then
LogError("英雄gift======================nil") LogError("英雄gift======================nil")
return data return data
end end
local addPro=0 local addPro = 0
if this.playerGifts and #this.playerGifts>0 then if this.playerGifts and #this.playerGifts > 0 then
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
if equipConfig[id] and equipConfig[id].HeroGitUp and equipConfig[id].HeroGitUp>0 then if equipConfig[id] and equipConfig[id].HeroGitUp and equipConfig[id].HeroGitUp > 0 then
addPro=addPro + equipConfig[id].HeroGitUp addPro = addPro + equipConfig[id].HeroGitUp
end end
end end
end end
--HeroGitUp --HeroGitUp
local list=this.allHeroGifts[_id] local list = this.allHeroGifts[_id]
for i=1,#list do for i = 1, #list do
local id=list[i] local id = list[i]
local pro = equipConfig[id].Property local pro = equipConfig[id].Property
if pro and #pro>0 then if pro and #pro > 0 then
for k = 1, #pro do for k = 1, #pro do
local key=pro[k][1] local key = pro[k][1]
local value=pro[k][2] local value = pro[k][2]
if tonumber(key)~=0 and tonumber(key)~=nil then if tonumber(key) ~= 0 and tonumber(key) ~= nil then
if not data[key] then if not data[key] then
data[key] = 0 data[key] = 0
end end
data[key] = data[key] + value data[key] = data[key] + value
end end
end end
end end
--英雄礼物不会加成主角属性 --英雄礼物不会加成主角属性
-- local pro2 = equipConfig[id].PlayerProperty -- local pro2 = equipConfig[id].PlayerProperty
-- if pro2 and #pro2>0 then -- if pro2 and #pro2>0 then
@ -200,54 +204,53 @@ function this.GetHeroGiftAddOriginalPro(_id)
-- end -- end
-- end -- end
end end
return data return data
end end
--检测英雄礼物合成红点 --检测英雄礼物合成红点
function this.CheckHeroGiftComRed() function this.CheckHeroGiftComRed()
local giftList=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.EquipConfig,"Position",8) local giftList = ConfigManager.TryGetAllConfigsDataByKey(ConfigName.EquipConfig, "Position", 8)
if giftList then if giftList then
for i=1,#giftList do for i = 1, #giftList do
local curequipSign=giftList[i] local curequipSign = giftList[i]
if curequipSign.Formula and #curequipSign.Formula>0 and type(curequipSign.Formula[1][1])~="userdata" then if curequipSign.Formula and #curequipSign.Formula > 0 and type(curequipSign.Formula[1][1]) ~= "userdata" then
local key=curequipSign.Formula[1][1] local key = curequipSign.Formula[1][1]
local value=curequipSign.Formula[1][2] local value = curequipSign.Formula[1][2]
local isMatEnough=false local isMatEnough = false
local datas = BagManager.GetBagItemDataByItemType(ItemBaseType.HeroGift) local datas = BagManager.GetBagItemDataByItemType(ItemBaseType.HeroGift)
local curBagSoulPrintDatas = {} local curBagSoulPrintDatas = {}
local maxNum=0 local maxNum = 0
for i = 1, #datas do for i = 1, #datas do
if curequipSign.Star>0 then if curequipSign.Star > 0 then
if datas[i].id == key then if datas[i].id == key then
for j=1,datas[i].num do for j = 1, datas[i].num do
if maxNum==value then if maxNum == value then
break break
end end
maxNum=maxNum+1 maxNum = maxNum + 1
end end
end end
else else
if equipConfig[datas[i].id].Quality == key then if equipConfig[datas[i].id].Quality == key then
for j=1,datas[i].num do for j = 1, datas[i].num do
if maxNum==value then if maxNum == value then
break break
end end
maxNum=maxNum+1 maxNum = maxNum + 1
end end
end end
end end
end end
if maxNum>=value then if maxNum >= value then
isMatEnough=true isMatEnough = true
end end
local resource=curequipSign.Resource local resource = curequipSign.Resource
local isGoldEough=true local isGoldEough = true
if resource and #resource>0 and type(resource[1][1])~="userdata" then if resource and #resource > 0 and type(resource[1][1]) ~= "userdata" then
for i=1,#resource do for i = 1, #resource do
if BagManager.GetItemCountById(resource[i][1]) <resource[i][2] then if BagManager.GetItemCountById(resource[i][1]) < resource[i][2] then
isGoldEough=false isGoldEough = false
end end
end end
end end
@ -258,53 +261,51 @@ function this.CheckHeroGiftComRed()
end end
end end
return false return false
end end
--检测主角礼物合成红点 --检测主角礼物合成红点
function this.CheckPlayerGiftComRed() function this.CheckPlayerGiftComRed()
local giftList=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.EquipConfig,"Position",7) local giftList = ConfigManager.TryGetAllConfigsDataByKey(ConfigName.EquipConfig, "Position", 7)
if giftList then if giftList then
for i=1,#giftList do for i = 1, #giftList do
local curequipSign=giftList[i] local curequipSign = giftList[i]
if curequipSign.Formula and #curequipSign.Formula>0 and type(curequipSign.Formula[1][1])~="userdata" then if curequipSign.Formula and #curequipSign.Formula > 0 and type(curequipSign.Formula[1][1]) ~= "userdata" then
local key=curequipSign.Formula[1][1] local key = curequipSign.Formula[1][1]
local value=curequipSign.Formula[1][2] local value = curequipSign.Formula[1][2]
local isMatEnough=false local isMatEnough = false
local datas = BagManager.GetBagItemDataByItemType(ItemBaseType.PlayerGift) local datas = BagManager.GetBagItemDataByItemType(ItemBaseType.PlayerGift)
local curBagSoulPrintDatas = {} local curBagSoulPrintDatas = {}
local maxNum=0 local maxNum = 0
for i = 1, #datas do for i = 1, #datas do
if curequipSign.Star>0 then if curequipSign.Star > 0 then
if datas[i].id == key then if datas[i].id == key then
for j=1,datas[i].num do for j = 1, datas[i].num do
if maxNum==value then if maxNum == value then
break break
end end
maxNum=maxNum+1 maxNum = maxNum + 1
end end
end end
else else
if equipConfig[datas[i].id].Quality == key then if equipConfig[datas[i].id].Quality == key then
for j=1,datas[i].num do for j = 1, datas[i].num do
if maxNum==value then if maxNum == value then
break break
end end
maxNum=maxNum+1 maxNum = maxNum + 1
end end
end end
end end
end end
if maxNum>=value then if maxNum >= value then
isMatEnough=true isMatEnough = true
end end
local resource=curequipSign.Resource local resource = curequipSign.Resource
local isGoldEough=true local isGoldEough = true
if resource and #resource>0 and type(resource[1][1])~="userdata" then if resource and #resource > 0 and type(resource[1][1]) ~= "userdata" then
for i=1,#resource do for i = 1, #resource do
if BagManager.GetItemCountById(resource[i][1]) <resource[i][2] then if BagManager.GetItemCountById(resource[i][1]) < resource[i][2] then
isGoldEough=false isGoldEough = false
end end
end end
end end
@ -315,28 +316,28 @@ function this.CheckPlayerGiftComRed()
end end
end end
return false return false
end end
--检测英雄红点 --检测英雄红点
function this.CheckRoleRedPointById(_id) function this.CheckRoleRedPointById(_id)
local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.Gift) local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.Gift)
if isOpen==false then if isOpen == false then
return false return false
end end
local lv,cur,max=this.GetCollectLvAndNum() local lv, cur, max = this.GetCollectLvAndNum()
--LogError("lv==============="..lv.." cur=="..cur.." max=="..max) --LogError("lv==============="..lv.." cur=="..cur.." max=="..max)
if this.allHeroGifts[_id] then if this.allHeroGifts[_id] then
local list=this.allHeroGifts[_id] local list = this.allHeroGifts[_id]
if #list>=cur then if #list >= cur then
return false return false
end end
local suitIds={} local suitIds = {}
for i=1,#list do for i = 1, #list do
table.insert(suitIds,equipConfig[list[i]].SuiteID) table.insert(suitIds, equipConfig[list[i]].SuiteID)
end end
local allEquip = BagManager.GetBagItemDataByItemType(ItemBaseType.HeroGift) local allEquip = BagManager.GetBagItemDataByItemType(ItemBaseType.HeroGift)
for i=1,#allEquip do for i = 1, #allEquip do
if CheckListIsContainValue1(list,allEquip[i].id)==false and CheckListIsContainValue1(suitIds,equipConfig[allEquip[i].id].SuiteID)==false then if CheckListIsContainValue1(list, allEquip[i].id) == false and CheckListIsContainValue1(suitIds, equipConfig[allEquip[i].id].SuiteID) == false then
return true return true
end end
end end
@ -346,59 +347,58 @@ function this.CheckRoleRedPointById(_id)
return false return false
end end
--检测主角红点 --检测主角红点
function this.CheckPlayerRedPoint() function this.CheckPlayerRedPoint()
local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.Gift) local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.Gift)
if isOpen==false then if isOpen == false then
return false return false
end end
local suitIds={} local suitIds = {}
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
table.insert(suitIds,equipConfig[this.playerGifts[i]].SuiteID) table.insert(suitIds, equipConfig[this.playerGifts[i]].SuiteID)
end end
local allEquip = BagManager.GetBagItemDataByItemType(ItemBaseType.PlayerGift) local allEquip = BagManager.GetBagItemDataByItemType(ItemBaseType.PlayerGift)
for i=1,#allEquip do for i = 1, #allEquip do
if CheckListIsContainValue1(this.playerGifts,allEquip[i].id)==false and CheckListIsContainValue1(suitIds,equipConfig[allEquip[i].id].SuiteID)==false then if CheckListIsContainValue1(this.playerGifts, allEquip[i].id) == false and CheckListIsContainValue1(suitIds, equipConfig[allEquip[i].id].SuiteID) == false then
return true return true
end end
end end
return false return false
end end
--获取英雄潜能等级 --获取英雄潜能等级
function this.GetHeroPotencyLvById(did) function this.GetHeroPotencyLvById(did)
local lv=0 local lv = 0
if this.playerGifts and #this.playerGifts>0 then if this.playerGifts and #this.playerGifts > 0 then
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 and type(equipConfig[id].PotentialNew[1])~="userdata" then if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew > 0 and type(equipConfig[id].PotentialNew[1]) ~= "userdata" then
lv=lv+equipConfig[id].PotentialNew[2] lv = lv + equipConfig[id].PotentialNew[2]
end end
end end
end end
if this.allHeroGifts and this.allHeroGifts[did] then if this.allHeroGifts and this.allHeroGifts[did] then
local list=this.allHeroGifts[did] local list = this.allHeroGifts[did]
for i=1,#list do for i = 1, #list do
local id=list[i] local id = list[i]
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 and type(equipConfig[id].PotentialNew[1])~="userdata" then if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew > 0 and type(equipConfig[id].PotentialNew[1]) ~= "userdata" then
lv=lv+equipConfig[id].PotentialNew[2] lv = lv + equipConfig[id].PotentialNew[2]
end end
end end
end end
--LogError("礼物增加 潜能 lv====================================="..lv) --LogError("礼物增加 潜能 lv====================================="..lv)
lv=lv+TianShuMiJuanManger.GetAddPotentialLV() lv = lv + TianShuMiJuanManger.GetAddPotentialLV()
return lv return lv
end end
--获取主角礼物添加的潜能等级 --获取主角礼物添加的潜能等级
function this.GetPlayerGiftAddPotencyLv() function this.GetPlayerGiftAddPotencyLv()
local lv=0 local lv = 0
if this.playerGifts and #this.playerGifts>0 then if this.playerGifts and #this.playerGifts > 0 then
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 and type(equipConfig[id].PotentialNew[1])~="userdata" then if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew > 0 and type(equipConfig[id].PotentialNew[1]) ~= "userdata" then
lv=lv+equipConfig[id].PotentialNew[2] lv = lv + equipConfig[id].PotentialNew[2]
end end
end end
end end
@ -407,33 +407,32 @@ end
--获取英雄礼物添加的潜能等级 --获取英雄礼物添加的潜能等级
function this.GetHeroGiftAddPotencyLv(did) function this.GetHeroGiftAddPotencyLv(did)
local lv=0 local lv = 0
if this.allHeroGifts and this.allHeroGifts[did] then if this.allHeroGifts and this.allHeroGifts[did] then
local list=this.allHeroGifts[did] local list = this.allHeroGifts[did]
for i=1,#list do for i = 1, #list do
local id=list[i] local id = list[i]
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 and type(equipConfig[id].PotentialNew[1])~="userdata" then if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew > 0 and type(equipConfig[id].PotentialNew[1]) ~= "userdata" then
lv=lv+equipConfig[id].PotentialNew[2] lv = lv + equipConfig[id].PotentialNew[2]
end end
end end
end end
return lv return lv
end end
--获取主角礼物增加的属性 --获取主角礼物增加的属性
function this.GetPlayerGiftAddPro() function this.GetPlayerGiftAddPro()
local data={} local data = {}
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
LogError("id=========================="..id) LogError("id==========================" .. id)
local pro = equipConfig[id].PlayerProperty local pro = equipConfig[id].PlayerProperty
if pro and #pro>0 then if pro and #pro > 0 then
for k = 1, #pro do for k = 1, #pro do
local key=pro[k][1] local key = pro[k][1]
local value= pro[k][2] local value = pro[k][2]
if tonumber(key) ~=nil and tonumber(key)~=0 then if tonumber(key) ~= nil and tonumber(key) ~= 0 then
if key~=0 and key~=nil then if key ~= 0 and key ~= nil then
if not data[key] then if not data[key] then
data[key] = 0 data[key] = 0
end end
@ -442,55 +441,46 @@ function this.GetPlayerGiftAddPro()
end end
end end
end end
local pro2 = equipConfig[id].Property local pro2 = equipConfig[id].Property
if pro2 and #pro2>0 and pro2[1][1]~=0 and pro2[1][1]~=nil then if pro2 and #pro2 > 0 and pro2[1][1] ~= 0 and pro2[1][1] ~= nil then
for k = 1, #pro2 do for k = 1, #pro2 do
local key=pro2[k][1] local key = pro2[k][1]
local value=pro2[k][2] local value = pro2[k][2]
if tonumber(key) ~=nil and tonumber(key)~=0 then if tonumber(key) ~= nil and tonumber(key) ~= 0 then
if not data[key] then if not data[key] then
data[key] = 0 data[key] = 0
end end
if value and value~=0 then if value and value ~= 0 then
LogError("pro2[k][1]==="..key.." value=="..value) LogError("pro2[k][1]===" .. key .. " value==" .. value)
data[key] = data[key] + value data[key] = data[key] + value
end end
end end
end end
end end
end end
return data return data
end end
function this.CheckGemRed() function this.CheckGemRed()
return false return false
end end
function this.CheckSuperGemRed() function this.CheckSuperGemRed()
return false return false
end end
function this.GetPlayerGiftAdd() function this.GetPlayerGiftAdd()
local addPro=0 local addPro = 0
if this.playerGifts and #this.playerGifts>0 then if this.playerGifts and #this.playerGifts > 0 then
for i=1,#this.playerGifts do for i = 1, #this.playerGifts do
local id=this.playerGifts[i] local id = this.playerGifts[i]
if equipConfig[id] and equipConfig[id].HeroGitUp and equipConfig[id].HeroGitUp>0 then if equipConfig[id] and equipConfig[id].HeroGitUp and equipConfig[id].HeroGitUp > 0 then
addPro=addPro + equipConfig[id].HeroGitUp addPro = addPro + equipConfig[id].HeroGitUp
end end
end end
end end
return addPro/100 return addPro / 100
end end
return this
return this

View File

@ -175,7 +175,7 @@ function this.RefreshWindowData()
--显示上面赠送的 --显示上面赠送的
local list = GiftManager.GetPlayerGifts() local list = GiftManager.GetPlayerGifts()
LogError("#list=============================" .. #list) LogError("#list=============================" .. #list)
local maxNum = 16 local maxNum = 12
if #list > maxNum then if #list > maxNum then
maxNum = #list + 4 maxNum = #list + 4
end end

View File

@ -31,7 +31,7 @@ function RoleGiftPanel:InitComponent()
for i = 1, 2 do for i = 1, 2 do
tabs[i] = Util.GetGameObject(self.transform, "Tabs/Btn" .. i) tabs[i] = Util.GetGameObject(self.transform, "Tabs/Btn" .. i)
local nameTxt = Util.GetGameObject(tabs[i], "Text"):GetComponent("Text") local nameTxt = Util.GetGameObject(tabs[i], "Text"):GetComponent("Text")
nameTxt.fontSize = 40 nameTxt.fontSize = 40
nameTxt.text = tableName[i] nameTxt.text = tableName[i]
redTabs[i] = Util.GetGameObject(tabs[i], "red") redTabs[i] = Util.GetGameObject(tabs[i], "red")
if i == 2 then if i == 2 then
@ -226,6 +226,8 @@ function this.RefreshWindowData()
--显示上面赠送的 --显示上面赠送的
local list = GiftManager.GetHeroGifts(curHeroData.dynamicId) local list = GiftManager.GetHeroGifts(curHeroData.dynamicId)
lv, curNum, maxNum = GiftManager.GetCollectLvAndNum() lv, curNum, maxNum = GiftManager.GetCollectLvAndNum()
LogError("礼物数量:" .. tostring(lv) .. "/" .. tostring(curNum) .. "/" .. tostring(maxNum) .. "/" .. tostring(#list))
--[[
if #list >= 50 then if #list >= 50 then
curNum = #list + 6 curNum = #list + 6
maxNum = #list + 6 maxNum = #list + 6
@ -233,8 +235,10 @@ function this.RefreshWindowData()
curNum = 50 curNum = 50
maxNum = 50 maxNum = 50
end end
this.lvTxt.text = Language[12731] .. lv .. Language[10065] ]]
LogError("lv=========" .. lv .. " curnum==" .. curNum .. " maxNum==" .. maxNum) local giftConfig = ConfigManager.GetConfig(ConfigName.GiftConfig)
this.lvTxt.text = GetLanguageStrById("鸿蒙阵") .. giftConfig[lv].Harmony .. Language[10065]
--LogError("lv=========" .. lv .. " curnum==" .. curNum .. " maxNum==" .. maxNum)
--maxNum=0 --maxNum=0
local giftDatas = {} local giftDatas = {}
allUpIds = {} allUpIds = {}
@ -300,7 +304,6 @@ function this.RefreshWindowData()
.. string.format(GetLanguageStrById(Language[12183]), math.floor(originalList[i] * HeroManager.ReturnGiftAtt()), .. string.format(GetLanguageStrById(Language[12183]), math.floor(originalList[i] * HeroManager.ReturnGiftAtt()),
HeroManager.ReturnGiftAtt()) HeroManager.ReturnGiftAtt())
]] ]]
elseif i == #proList then elseif i == #proList then
this.proGrid.transform:GetChild(i - 1).gameObject:SetActive(true) this.proGrid.transform:GetChild(i - 1).gameObject:SetActive(true)
this.proGrid.transform:GetChild(i - 1):GetComponent("Text").text = proList[i] this.proGrid.transform:GetChild(i - 1):GetComponent("Text").text = proList[i]
@ -359,7 +362,9 @@ function this.SingleUpItemShow(_go, data, _index)
add:SetActive(false) add:SetActive(false)
red:SetActive(false) red:SetActive(false)
lockText.gameObject:SetActive(true) lockText.gameObject:SetActive(true)
lockText.text = Language[12731] .. lv + 1 .. Language[10056] --lockText.text = Language[12731] .. lv + 1 .. Language[10056]
local giftConfig = ConfigManager.GetConfig(ConfigName.GiftConfig)
lockText.text = GetLanguageStrById("鸿蒙阵") .. giftConfig[lv + 1].Harmony .. Language[10056]
else else
lockObj:SetActive(false) lockObj:SetActive(false)
lockText.gameObject:SetActive(false) lockText.gameObject:SetActive(false)