挑战副本脚本提交
parent
9ebdab46b3
commit
bd3bed7e41
|
|
@ -30,6 +30,8 @@ BATTLE_SERVER_TYPE = {
|
|||
QiJieShiLian = 23,--七界试炼
|
||||
CrossYuxuLunDaoFight = 24,--玉虚论道
|
||||
LINGMAIMIJING = 25, --灵脉秘境
|
||||
ENDLESS_NEW_TEAM = 28, --新无尽副本
|
||||
TREASURE_TEAM=29, --宝物副本
|
||||
}
|
||||
|
||||
BattleEventName = {
|
||||
|
|
|
|||
|
|
@ -1071,6 +1071,7 @@ this.challengeCopyDataTable = {}
|
|||
function this.InitChallengeCopyData(msg)
|
||||
for i = 1 , #msg.info do
|
||||
local index = msg.info[i].type
|
||||
this.challengeCopyDataTable[index] = {}
|
||||
this.challengeCopyDataTable[index].type = msg.info[i].type
|
||||
this.challengeCopyDataTable[index].currentFloor = msg.info[i].currentFloor--层数
|
||||
this.challengeCopyDataTable[index].openState = msg.info[i].overTime--0:关闭 1:开启
|
||||
|
|
@ -1087,5 +1088,9 @@ function this.CheckChallengeCopyId(type,id)
|
|||
end
|
||||
return 0
|
||||
end
|
||||
---更新挑战层数
|
||||
function this.UpdateChallengeCopyFloor(_type)
|
||||
this.challengeCopyDataTable[_type].currentFloor=this.challengeCopyDataTable[_type].currentFloor+1
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -35,8 +35,8 @@ local qualityBg={
|
|||
local itemList={}--奖励容器
|
||||
|
||||
--每日副本服务器数据
|
||||
local buyTime=0--购买次数
|
||||
local freeTime=0--免费次数
|
||||
local buyTime=0--剩余购买次数
|
||||
local freeTime=0--剩余免费次数
|
||||
|
||||
--Tab
|
||||
local TabBox = require("Modules/Common/TabBox")
|
||||
|
|
@ -125,7 +125,7 @@ end
|
|||
function ChallengeCopyPanel:RefreshRedPotShow()
|
||||
local tabs = Util.GetGameObject(this.tabBox,"box").transform
|
||||
for i = 1,tabs.childCount do
|
||||
Util.GetGameObject(tabs:GetChild(i-1),"Redpot").gameObject:SetActive(CarbonManager.GetDailyCarbons(i).state)
|
||||
Util.GetGameObject(tabs:GetChild(i-1),"Redpot").gameObject:SetActive(freeTime>0)
|
||||
end
|
||||
CheckRedPointStatus(RedPointType.HeroExplore)
|
||||
end
|
||||
|
|
@ -231,13 +231,16 @@ function this.SetData(root, data, ldata)
|
|||
goIcon:SetActive(false)
|
||||
goIconNum:SetActive( false)
|
||||
|
||||
local usedTime=PrivilegeManager.GetPrivilegeUsedTimes(storeData.Limit)--已使用次数
|
||||
local limitTime=PrivilegeManager.GetPrivilegeNumber(storeData.Limit) --购买次数上限
|
||||
local buyTimes = (usedTime + 1) > limitTime and limitTime or usedTime+1
|
||||
LogBlue("~~~~~~~usedTime:"..usedTime.." limitTime"..limitTime)
|
||||
if freeTime<=0 then
|
||||
goIconNumText.text=storeData.Cost[2][4]
|
||||
goIconNumText.text=storeData.Cost[2][buyTimes]
|
||||
end
|
||||
--表现显示
|
||||
Util.SetGray(goBtn, not isOpen)
|
||||
|
||||
LogBlue(data.Section.."~~~~~~~~~~~"..type)
|
||||
if type==1 or type==2 then
|
||||
goBtnText.text=Language[10287]
|
||||
goBtnImage.sprite=this.spLoader:LoadSprite("s_slbz_1anniuhuangse")
|
||||
|
|
@ -271,7 +274,6 @@ function this.SetData(root, data, ldata)
|
|||
PopupTipPanel.ShowTip(string.format(Language[10295], GetLanguageStrById(mainLevelConfig[_point].Name)))
|
||||
return
|
||||
end
|
||||
|
||||
if not isOpen then
|
||||
PopupTipPanel.ShowTip(Language[10296])
|
||||
return
|
||||
|
|
@ -282,18 +284,20 @@ function this.SetData(root, data, ldata)
|
|||
PopupTipPanel.ShowTip(Language[10297])
|
||||
return
|
||||
end
|
||||
|
||||
--检测妖晶数量
|
||||
local itemId=storeData.Cost[1][1] --消耗道具
|
||||
if BagManager.GetItemCountById(itemId)<storeData.Cost[2][4] and freeTime<=0 and type==2 then
|
||||
|
||||
if BagManager.GetItemCountById(itemId)<storeData.Cost[2][buyTimes] and freeTime<=0 and type==2 then
|
||||
PopupTipPanel.ShowTip(string.format(Language[10298],GetLanguageStrById(itemConfig[itemId].Name)))
|
||||
return
|
||||
end
|
||||
|
||||
--当免费次数不足 是扫荡 购买次数
|
||||
if freeTime<=0 and type==2 then
|
||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeData.Id,1,function() end)
|
||||
end
|
||||
LogBlue("----------------------------发起挑战")
|
||||
|
||||
|
||||
-- TODO: 没有战斗结果校验
|
||||
NetManager.ChallengeCopyRequest(data.Chapter,type,data.Id,function(msg)
|
||||
local fightData = BattleManager.GetBattleServerData(msg)
|
||||
|
|
@ -302,7 +306,7 @@ function this.SetData(root, data, ldata)
|
|||
if result.result ==0 then
|
||||
elseif result.result==1 then
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
-- CarbonManager.AddDailyChallengeInfo(data.Id)
|
||||
CarbonManager.UpdateChallengeCopyFloor(data.Chapter)
|
||||
this.RefreshShow(carbonIndex,false,false)
|
||||
end)
|
||||
end
|
||||
|
|
@ -324,6 +328,8 @@ function this.SetTimeTip()
|
|||
local freeTimeId=curData[1].PivilegeID[2]
|
||||
buyTime= ShopManager.GetShopItemRemainBuyTimes(SHOP_TYPE.FUNCTION_SHOP,storeData.Id) --购买次数
|
||||
freeTime=PrivilegeManager.GetPrivilegeRemainValue(freeTimeId) --免费次数
|
||||
LogGreen("购买次数:"..buyTime.." 免费次数:"..freeTime)
|
||||
LogGreen("storeData.Id:"..storeData.Id.." GoodsName"..storeData.GoodsName)
|
||||
local str=""
|
||||
if freeTime>0 then
|
||||
str=string.format(Language[12292],tostring(freeTime))
|
||||
|
|
@ -342,9 +348,9 @@ function this.TabAdapter(tab, index, status)
|
|||
lock:SetActive(islock)
|
||||
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(_TabData[index][status])
|
||||
end
|
||||
|
||||
---检测tab是否锁定
|
||||
function this.TabIsLockCheck(index)
|
||||
if CarbonManager.challengeCopyDataTable[index].openState==1 then
|
||||
if CarbonManager.challengeCopyDataTable[index].openState==0 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -5106,6 +5106,7 @@ end
|
|||
|
||||
--请求挑战 copyType:1无尽副本 2宝物副本 type:1为挑战 2为扫荡 id:ChallengeStage表id
|
||||
function this.ChallengeCopyRequest(copyType,type,id,func)
|
||||
LogBlue("---copyType----------type---------------id"..copyType.." "..type.." "..id)
|
||||
local data = PlayerInfoProto_pb.ChallengeRequest()
|
||||
data.type=copyType
|
||||
data.model=type
|
||||
|
|
|
|||
Loading…
Reference in New Issue