宝物 commit
parent
bfc45c822e
commit
87cc8867c7
|
@ -1340,46 +1340,39 @@ function this.TimeFormat()
|
||||||
end
|
end
|
||||||
|
|
||||||
--轮转活动,乾坤宝盒
|
--轮转活动,乾坤宝盒
|
||||||
local dynamicAct = not not ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
local dynamicAct = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
|
||||||
if dynamicAct then
|
if dynamicAct then
|
||||||
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
||||||
local tempTime = info.endTime - PlayerManager.serverTime
|
local tempTime = info.endTime - PlayerManager.serverTime
|
||||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then
|
|
||||||
if tempTime>= 86400 then
|
if tempTime>= 86400 then
|
||||||
this.DynamicActivityTime.text = TimeToDH(tempTime)
|
this.DynamicActivityTime.text = TimeToDH(tempTime)
|
||||||
else
|
else
|
||||||
this.DynamicActivityTime.text = TimeToHMS(tempTime)
|
this.DynamicActivityTime.text = TimeToHMS(tempTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
--青龙秘宝
|
--青龙秘宝
|
||||||
local QingLong = not not ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
local QingLong = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
if QingLong then
|
if QingLong then
|
||||||
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
local tempTime = info.endTime - PlayerManager.serverTime
|
local tempTime = info.endTime - PlayerManager.serverTime
|
||||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
|
||||||
if tempTime>= 86400 then
|
if tempTime>= 86400 then
|
||||||
this.treasureOfSlText.text = TimeToDH(tempTime)
|
this.treasureOfSlText.text = TimeToDH(tempTime)
|
||||||
else
|
else
|
||||||
this.treasureOfSlText.text = TimeToHMS(tempTime)
|
this.treasureOfSlText.text = TimeToHMS(tempTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
--云梦祈福
|
--云梦祈福
|
||||||
local YunMeng = not not ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Pray)
|
local YunMeng = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.Pray)
|
||||||
if YunMeng then
|
if YunMeng then
|
||||||
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Pray)
|
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Pray)
|
||||||
local tempTime = info.endTime - PlayerManager.serverTime
|
local tempTime = info.endTime - PlayerManager.serverTime
|
||||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.Pray) then
|
|
||||||
if tempTime>= 86400 then
|
if tempTime>= 86400 then
|
||||||
this.paryGiftTime.text = TimeToDH(tempTime)
|
this.paryGiftTime.text = TimeToDH(tempTime)
|
||||||
else
|
else
|
||||||
this.paryGiftTime.text = TimeToHMS(tempTime)
|
this.paryGiftTime.text = TimeToHMS(tempTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
--为限时折扣写的
|
--为限时折扣写的
|
||||||
function this:GetInfoList()
|
function this:GetInfoList()
|
||||||
|
|
|
@ -115,7 +115,7 @@ function this.TabAdapter(tab, index, status)
|
||||||
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status])
|
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status])
|
||||||
tabLab:GetComponent("Text").text = _TabData[index].name
|
tabLab:GetComponent("Text").text = _TabData[index].name
|
||||||
tabLab:GetComponent("Text").color = _TabFontColor[status]
|
tabLab:GetComponent("Text").color = _TabFontColor[status]
|
||||||
if _TabData[index].type ~= -1 and not ActivityGiftManager.GetActivityOpenStatus(_TabData[index].type) then
|
if _TabData[index].type ~= -1 and not ActivityGiftManager.IsActivityTypeOpen(_TabData[index].type) then
|
||||||
tab.gameObject:SetActive(false)
|
tab.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ end
|
||||||
--切换视图
|
--切换视图
|
||||||
function this.SwitchView(_index)
|
function this.SwitchView(_index)
|
||||||
if _index == 2 or _index == 3 then
|
if _index == 2 or _index == 3 then
|
||||||
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
||||||
PopupTipPanel.ShowTip("未在活动时间范围内")
|
PopupTipPanel.ShowTip("未在活动时间范围内")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -99,6 +99,7 @@ end
|
||||||
function this.GetTimeStartToEnd()
|
function this.GetTimeStartToEnd()
|
||||||
local info= ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
local info= ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
if info then
|
if info then
|
||||||
|
LogGreen("info.startTime:"..info.startTime.." info.endTime:"..info.endTime)
|
||||||
local startTime= this.GetTimeShow(info.startTime)
|
local startTime= this.GetTimeShow(info.startTime)
|
||||||
local endtime= this.GetTimeShow(info.endTime)
|
local endtime= this.GetTimeShow(info.endTime)
|
||||||
return startTime,endtime,info.endTime
|
return startTime,endtime,info.endTime
|
||||||
|
|
|
@ -41,9 +41,9 @@ function this.SetBasicValues(giftGoodsList)
|
||||||
|
|
||||||
local rechargeConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, giftGoodsInfo.goodsId)
|
local rechargeConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, giftGoodsInfo.goodsId)
|
||||||
|
|
||||||
-- LogGreen("------充值活动-----------礼包类型:".. rechargeConfig.Type .." 礼包ID:".. giftGoodsInfo.goodsId .." 已购:"
|
LogGreen("------充值活动-----------礼包类型:".. rechargeConfig.Type .." 礼包ID:".. giftGoodsInfo.goodsId .." 已购:"
|
||||||
-- ..giftGoodsInfo.buyTimes.." 开始:"..giftGoodsInfo.startTime.." 结束:"
|
..giftGoodsInfo.buyTimes.." 开始:"..giftGoodsInfo.startTime.." 结束:"
|
||||||
-- ..giftGoodsInfo.endTime .. " 可购(没卵用):" .. giftGoodsInfo.dynamicBuyTimes)
|
..giftGoodsInfo.endTime .. " 可购(没卵用):" .. giftGoodsInfo.dynamicBuyTimes)
|
||||||
|
|
||||||
|
|
||||||
if giftGoodsInfoList[rechargeConfig.Type] then
|
if giftGoodsInfoList[rechargeConfig.Type] then
|
||||||
|
|
|
@ -50,12 +50,13 @@ function this.InitSingleTreasureData(_singleData)
|
||||||
single.refineConfig = this.GetCurrTreasureLvConfig(2, currJewel.RankupPool, _singleData.rebuildLevel)
|
single.refineConfig = this.GetCurrTreasureLvConfig(2, currJewel.RankupPool, _singleData.rebuildLevel)
|
||||||
allTreasures[_singleData.id] = single
|
allTreasures[_singleData.id] = single
|
||||||
end
|
end
|
||||||
|
|
||||||
--获取玩家可以穿戴的宝物
|
--获取玩家可以穿戴的宝物
|
||||||
function this.GetTreasureDataByPos(_pos, _idDyn, PropertyName)
|
function this.GetTreasureDataByPos(_pos, _idDyn, PropertyName)
|
||||||
local equips = {}
|
local equips = {}
|
||||||
for i, v in pairs(allTreasures) do
|
for i, v in pairs(allTreasures) do
|
||||||
if v.equipType == _pos - 4 then
|
if v.equipType == _pos - 4 then
|
||||||
if (v.upHeroDid == "" or v.upHeroDid == _idDyn) and v.race == PropertyName then
|
if (v.upHeroDid == "" or v.upHeroDid ~= _idDyn) and v.race == PropertyName then
|
||||||
table.insert(equips, v)
|
table.insert(equips, v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -299,7 +299,7 @@ function this:AllEquipUpBtnOnClick()
|
||||||
for i = 1, 6 do
|
for i = 1, 6 do
|
||||||
local curPosEquip = {}
|
local curPosEquip = {}
|
||||||
local index = i
|
local index = i
|
||||||
if index == 5 or index == 6 and isCanUpEquipTreasure then
|
if (index == 5 or index == 6) and isCanUpEquipTreasure then
|
||||||
curPosEquip =
|
curPosEquip =
|
||||||
EquipTreasureManager.GetTreasureDataByPos(
|
EquipTreasureManager.GetTreasureDataByPos(
|
||||||
index,
|
index,
|
||||||
|
@ -310,42 +310,58 @@ function this:AllEquipUpBtnOnClick()
|
||||||
--获取到所有未装备的装备
|
--获取到所有未装备的装备
|
||||||
curPosEquip = BagManager.GetEquipDataByEquipPosition(curHeroData.heroConfig.Profession, index)
|
curPosEquip = BagManager.GetEquipDataByEquipPosition(curHeroData.heroConfig.Profession, index)
|
||||||
end
|
end
|
||||||
|
LogBlue("i:"..index.." #curPosEquip:".. #curPosEquip)
|
||||||
--计算每个位置可装备的装备战力 取战力最大的装备
|
LogBlue("计算每个位置可装备的装备战力")-- 取战力最大的装备
|
||||||
if curPosEquip and #curPosEquip > 0 then
|
if curPosEquip and #curPosEquip > 0 then
|
||||||
local equiData = {}
|
local equiData = {}
|
||||||
local indexMaxPower = 0
|
local indexMaxPower = 0
|
||||||
if curHeroEquipDatas[index] then
|
if curHeroEquipDatas[index] then
|
||||||
equiData = curHeroEquipDatas[index]
|
equiData = curHeroEquipDatas[index]
|
||||||
if curHeroEquipDatas[index].idDyn then
|
--获取到宝物战力
|
||||||
|
if index == 5 or index == 6 then
|
||||||
indexMaxPower = EquipTreasureManager.CalculateWarForce(curHeroEquipDatas[index].idDyn)
|
indexMaxPower = EquipTreasureManager.CalculateWarForce(curHeroEquipDatas[index].idDyn)
|
||||||
|
LogBlue("宝物id:"..curHeroEquipDatas[index].idDyn.." id:"..curHeroEquipDatas[index].id.." indexMaxPower:"..indexMaxPower)
|
||||||
else
|
else
|
||||||
|
--获取到装备战力
|
||||||
indexMaxPower = EquipManager.CalculateWarForce(curHeroEquipDatas[index].id)
|
indexMaxPower = EquipManager.CalculateWarForce(curHeroEquipDatas[index].id)
|
||||||
|
LogBlue("装备id:"..curHeroEquipDatas[index].id.." indexMaxPower:"..indexMaxPower)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogGreen("循环计算每个装备的战力")
|
||||||
for i = 1, #curPosEquip do
|
for i = 1, #curPosEquip do
|
||||||
local addPower = 0
|
local addPower = 0
|
||||||
local curEquip = curPosEquip[i]
|
local curEquip = curPosEquip[i]
|
||||||
if curEquip then
|
if curEquip then
|
||||||
if curEquip.idDyn then
|
if index == 5 or index == 6 then
|
||||||
addPower = EquipTreasureManager.CalculateWarForce(curEquip.idDyn)
|
addPower = EquipTreasureManager.CalculateWarForce(curEquip.idDyn)
|
||||||
|
LogGreen("宝物id:"..curEquip.idDyn.." id:"..curEquip.id.." addPower:"..addPower)
|
||||||
else
|
else
|
||||||
addPower = EquipManager.CalculateWarForce(curEquip.id)
|
addPower = EquipManager.CalculateWarForce(curEquip.id)
|
||||||
|
LogGreen("装备id:"..curEquip.id.." addPower:"..addPower)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if addPower >= indexMaxPower then
|
if addPower > indexMaxPower then
|
||||||
indexMaxPower = addPower
|
indexMaxPower = addPower
|
||||||
equiData = curEquip
|
equiData = curEquip
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if equiData.idDyn and isCanUpEquipTreasure
|
if index == 5 or index == 6 then
|
||||||
and ((curHeroEquipDatas[index] and equiData.idDyn ~= curHeroEquipDatas[index].idDyn) or (not curHeroEquipDatas[index])) then
|
LogYellow("宝物id:"..equiData.idDyn.." id:"..equiData.id)
|
||||||
table.insert(allTreasureIds, equiData.idDyn)
|
|
||||||
else
|
else
|
||||||
if (not curHeroEquipDatas[index] or tonumber(equiData.id) ~= tonumber(curHeroEquipDatas[index].id)) and (not equiData.idDyn) then
|
LogYellow("装备id:"..equiData.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
if (index == 5 or index == 6) then
|
||||||
|
if ((curHeroEquipDatas[index] and equiData.idDyn ~= curHeroEquipDatas[index].idDyn)
|
||||||
|
or (not curHeroEquipDatas[index])) then
|
||||||
|
table.insert(allTreasureIds, equiData.idDyn)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (not curHeroEquipDatas[index] or tonumber(equiData.id) ~= tonumber(curHeroEquipDatas[index].id)) then
|
||||||
table.insert(allEquipIds, tostring(equiData.id))
|
table.insert(allEquipIds, tostring(equiData.id))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--特效
|
--特效
|
||||||
if curHeroEquipDatas[equiData.position] then
|
if curHeroEquipDatas[equiData.position] then
|
||||||
if equiData.idDyn then
|
if equiData.idDyn then
|
||||||
|
@ -362,12 +378,15 @@ function this:AllEquipUpBtnOnClick()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogYellow("装备:"..#allEquipIds)
|
||||||
|
LogYellow("宝物:"..#allTreasureIds)
|
||||||
|
LogYellow("isCanUpEquipTreasure:"..tostring(isCanUpEquipTreasure))
|
||||||
if (allEquipIds and #allEquipIds > 0) or (isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0) then
|
if (allEquipIds and #allEquipIds > 0) or (isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0) then
|
||||||
--isCanUpEquipTreasure
|
--isCanUpEquipTreasure
|
||||||
if allEquipIds and #allEquipIds > 0 then
|
if allEquipIds and #allEquipIds > 0 then
|
||||||
-- for i = 1, #allEquipIds do
|
for i = 1, #allEquipIds do
|
||||||
-- LogGreen(curHeroData.dynamicId .. " " .. allEquipIds[i])
|
LogGreen("一键装备"..allEquipIds[i])
|
||||||
-- end
|
end
|
||||||
--穿装备协议
|
--穿装备协议
|
||||||
NetManager.EquipWearRequest(
|
NetManager.EquipWearRequest(
|
||||||
curHeroData.dynamicId,
|
curHeroData.dynamicId,
|
||||||
|
@ -386,11 +405,10 @@ function this:AllEquipUpBtnOnClick()
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
--穿戴宝物
|
--穿戴宝物
|
||||||
LogBlue(tostring(isCanUpEquipTreasure))
|
|
||||||
if isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0 then
|
if isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0 then
|
||||||
--for i = 1, #allEquipIds do
|
for i = 1, #allTreasureIds do
|
||||||
-- Log(curHeroData.dynamicId.. " "..curHeroData.id .." "..curHeroData.lv.." 一键宝物 "..i.." "..allEquipIds[i])
|
LogGreen("一键宝物"..allTreasureIds[i])
|
||||||
--end
|
end
|
||||||
--穿装备协议
|
--穿装备协议
|
||||||
NetManager.EquipWearRequest(
|
NetManager.EquipWearRequest(
|
||||||
curHeroData.dynamicId,
|
curHeroData.dynamicId,
|
||||||
|
|
Loading…
Reference in New Issue