1小兵关卡不在后端校验,后台不再打 2 抽小兵添加限制 3关卡红点修改

tcx_xiyou_bt_ios
wangzhenxing 2024-06-21 18:00:48 +08:00
parent bacb821742
commit 9558c4c53e
5 changed files with 139 additions and 109 deletions

View File

@ -1819,6 +1819,7 @@ FUNCTION_OPEN_TYPE = {
TrainBuild = 151, --特训建筑
HelpFight = 152, --助阵
AutoSoliderDraw =154,--自动抽小兵
SoliderDraw=155, --抽小兵
}

View File

@ -372,6 +372,11 @@ function FightPointPassMainPanel:BindEvent()
end
end)
Util.AddClick(this.btn_draw, function ()
local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw)
if isOpen==false then
PopupTipPanel.ShowTip(GetFunctionOpenTip(FUNCTION_OPEN_TYPE.SoliderDraw))
return
end
if BagManager.GetItemCountById(tonumber(cost[1]))<tonumber(cost[2]) then
PopupTipPanel.ShowTip("道具不足")
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,126)
@ -518,7 +523,7 @@ function this.RefreshBossInfo()
-- end
-- end
-- end
this.GetLevelInfo(curFight)
--this.GetLevelInfo(curFight)
if nextLv==0 then
nextLv=curFight
end
@ -530,8 +535,28 @@ function this.RefreshBossInfo()
end
end
LogError("nextBossLv====================="..nextBossLv)
if #levelList>0 then
this.bossObj:SetActive(true)
-- if #levelList>0 then
-- this.bossObj:SetActive(true)
-- this.bossNum.text=#levelList
-- this.fightLock:SetActive(false)
-- this.fightSaoGuang:SetActive(true)
-- --this.fightGuideEffect:SetActive(true)
-- this.fightRP:SetActive(true)
-- else
-- this.bossObj:SetActive(false)
-- this.fightLock:SetActive(true)
-- this.fightRP:SetActive(false)
-- this.fightSaoGuang:SetActive(false)
-- --this.fightGuideEffect:SetActive(false)
-- --this.lockText.text=string.format("再推%s关后开启",nextBossLv-FightPointPassManager.soldierLayerId)
-- local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv)
-- LogError("tip======================="..tip)
-- LogError("btntxt============================="..btnTxt)
-- this.lockText.text=tip
-- end
local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv)
if isOk then
this.bossObj:SetActive(false)
this.bossNum.text=#levelList
this.fightLock:SetActive(false)
this.fightSaoGuang:SetActive(true)
@ -544,11 +569,9 @@ function this.RefreshBossInfo()
this.fightSaoGuang:SetActive(false)
--this.fightGuideEffect:SetActive(false)
--this.lockText.text=string.format("再推%s关后开启",nextBossLv-FightPointPassManager.soldierLayerId)
local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv)
LogError("tip======================="..tip)
LogError("btntxt============================="..btnTxt)
this.lockText.text=tip
end
this.openFun:SetActive(true)
this.openFunNeedInfo.text=name
this.fightText.text = "挑战Boss"
@ -594,8 +617,8 @@ function this.RefreshSoliderInfo()
end
local haveNum=BagManager.GetItemCountById(tonumber(cost[1]))
this.costTxt.text=haveNum
this.chouRed:SetActive(haveNum>0)
this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() )
this.chouRed:SetActive(haveNum>0 and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw))
this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) )
local openList=lotteryConfig.SoldierType
local dataList=SmallSoldierManager.soldierList
LogError("dataList=========================================================="..#dataList)
@ -936,9 +959,9 @@ function this.BattleLogic()
this.battleTimer:Stop()
--判断当前开服天数是否开启当前关卡
if curSoliderStageConfig.OpenRule[1][2]<=GetOpenServerDayNum() then
NetManager.SoldierFightCheckRequest(1,function(msg)
--NetManager.SoldierFightCheckRequest(1,function(msg)
--战斗成功
if msg.result==1 then
--if msg.result==1 then
if curSoliderStageConfig.NextId~=0 then
FightPointPassManager.soldierLayerId=curSoliderStageConfig.NextId
this.floorTxt.text=string.format("第%s关",FightPointPassManager.soldierLayerId)
@ -961,18 +984,19 @@ function this.BattleLogic()
this.bossLiveGO.transform.localScale=Vector3.one * roleConfig[curSoliderStageConfig.Hero].enemy_liveScale*0.5
bossSpine=this.bossLiveGO:GetComponent("SkeletonGraphic")
end
PlayerPrefs.SetInt("SmallSoldierLevel"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
--刷新挂机奖励
--this.IntiReward()
this.UpdateOpenSeverWelfare()
else
--PopupTipPanel.ShowTip("服务器战斗验证失败")
if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
if not GuideManager.IsInMainGuide() then
--UIManager.OpenPanel(UIName.SmallSoldierFailPop)
end
PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
end
end
--this.UpdateOpenSeverWelfare()
-- else
-- --PopupTipPanel.ShowTip("服务器战斗验证失败")
-- if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
-- if not GuideManager.IsInMainGuide() then
-- --UIManager.OpenPanel(UIName.SmallSoldierFailPop)
-- end
-- PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
-- end
-- end
if this.battleTimer then
this.battleTimer:Start()
end
@ -982,7 +1006,7 @@ function this.BattleLogic()
--this.hpBar.fillAmount=bossHp/curSoliderStageConfig.Hp
this.SetHp(curSoliderStageConfig.Hp,bossHp,curSoliderStageConfig.HpNumber)
this.RefreshBossInfo()
end)
--end)
else
if this.battleTimer then
this.battleTimer:Start()
@ -1564,17 +1588,17 @@ function this.ExcuteBattle()
else
-- 检测是否有前置引导
GuideManager.BeforeFightCheck(curFightId, function()
if #levelList<=0 then
LogError("没有要打的boss关卡")
return
end
-- if #levelList<=0 then
-- LogError("没有要打的boss关卡")
-- return
-- end
--屏蔽弹怪追认的动画
--this.SetInitAnim()
local isBoss = FightPointPassManager.IsFightBoss()
local sound = isBoss and SoundConfig.Sound_FightArea_Boss or SoundConfig.Sound_FightArea_Monster
SoundManager.PlaySound(sound, AUDIO_FADE_TYPE.FADE_OUT_NOT_IN, AUDIO_RUN_TYPE.CONC, nil, 20)
LogError("levelList[1]=================================="..levelList[1])
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.STORY, levelList[1])
--LogError("levelList[1]=================================="..levelList[1])
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.STORY, curFightId)
end)
end
end
@ -1629,8 +1653,8 @@ function FightPointPassMainPanel:OnSortingOrderChange()
local haveNum=BagManager.GetItemCountById(tonumber(cost[1]))
this.costTxt.text=haveNum
this.chouRed:SetActive(haveNum>0)
this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() )
this.chouRed:SetActive(haveNum>0 and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw))
this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) )
end
--界面关闭时调用(用于子类重写)

View File

@ -59,8 +59,12 @@ function this.InitAllFightPointState(msg)
this.HangOnTime = msg.duration
this.curOpenFight = msg.fightId
this.soldierStartTime = msg.soldierStartTime
this.soldierLayerId = msg.soldierLayerId
LogError("msg.soldierLayerId========================================================="..msg.soldierLayerId)
local level=PlayerPrefs.GetInt("SmallSoldierLevel"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
if level==0 then
level=1
end
this.soldierLayerId =level --msg.soldierLayerId
--LogError("msg.soldierLayerId========================================================="..msg.soldierLayerId)
if mainLevelConfig[this.curOpenFight].SortId-1 > 0 then
this.lastPassFightId = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId", mainLevelConfig[this.curOpenFight].SortId-1).Id
LogError("this.lastPassFightId=="..this.lastPassFightId)
@ -425,18 +429,18 @@ end
-- 判断是否显示关卡按钮红点
function this.IsShowFightRP()
local lotteryConfig=ConfigManager.GetConfigData(ConfigName.SoldiersLotteryConfig,SmallSoldierManager.level)
if BagManager.GetItemCountById(lotteryConfig.Soldiers[1])>lotteryConfig.Soldiers[2] then
return true
end
if BagManager.GetItemCountById(126)>0 and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) then
return true
end
local curFight=FightPointPassManager.curOpenFight
local nextLv=0
for k,v in ConfigPairs(mainLevelConfig) do
local aa=v
if k>=curFight then
if aa.OpenRule and (aa.OpenRule[1][1]==9 or aa.OpenRule[1][1]==0 ) and FightPointPassManager.soldierLayerId>=aa.OpenRule[1][2] then
return true
end
end
end
local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(curFight)
--return this.IsCanFight(this.curOpenFight)
return false
return isOk
end
-- 挑战按钮的文字显示

View File

@ -44,80 +44,81 @@ function this.InitData(msg)
--LogError("服务器发过来的小兵 this.soldierList=================len=="..#this.soldierList.." msg.soldiers===="..#msg.soldiers)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Solider)
local cd=10
local attackCD=0
local bossHp=0
Timer.New(function()
if FightPointPassManager.soldierLayerId>1 then
--local cd=10
--local attackCD=0
--local bossHp=0
-- Timer.New(function()
-- if FightPointPassManager.soldierLayerId>1 then
--LogError("cd============================"..cd)
--if cd<=0 then
if UIManager.GetOpenPanel(UIName.FightPointPassMainPanel)==nil then
if this.isFirst and SmallSoldierManager.bossInfo then
cd=SmallSoldierManager.bossInfo.time
bossHp=SmallSoldierManager.bossInfo.hp
this.isFirst=false
end
attackCD=attackCD+1
--到达攻击间隔
if attackCD>=timeStamp then
bossHp=bossHp - this.GetCurrAllAttack()
attackCD=0
if bossHp<=0 then
-- LogError("后台挂机boss被击败------------------------------------")
end
end
cd=cd-1
if cd<=0 or bossHp<=0 then
--LogError("发送小兵挂机战斗请求======================================================")
local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
if curConfig.OpenRule[1][2]<=GetOpenServerDayNum() then
NetManager.SoldierFightCheckRequest(0,function (msg)
-- --LogError("cd============================"..cd)
-- --if cd<=0 then
-- if UIManager.GetOpenPanel(UIName.FightPointPassMainPanel)==nil then
-- if this.isFirst and SmallSoldierManager.bossInfo then
-- cd=SmallSoldierManager.bossInfo.time
-- bossHp=SmallSoldierManager.bossInfo.hp
-- this.isFirst=false
-- end
-- attackCD=attackCD+1
-- --到达攻击间隔
-- if attackCD>=timeStamp then
-- bossHp=bossHp - this.GetCurrAllAttack()
-- attackCD=0
-- if bossHp<=0 then
-- -- LogError("后台挂机boss被击败------------------------------------")
-- end
-- end
-- cd=cd-1
-- if cd<=0 or bossHp<=0 then
-- --LogError("发送小兵挂机战斗请求======================================================")
-- local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
-- LogError("GetOpenServerDayNum()========================="..GetOpenServerDayNum().." FightPointPassManager.soldierLayerId=="..FightPointPassManager.soldierLayerId)
-- if curConfig.OpenRule[1][2]<=GetOpenServerDayNum() then
-- NetManager.SoldierFightCheckRequest(0,function (msg)
local lvConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
if msg.result==1 then
if lvConfig and lvConfig.NextId and lvConfig.NextId~=0 then
FightPointPassManager.soldierLayerId = lvConfig.NextId
local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
if curConfig then
cd=curConfig.Time
end
bossHp=lvConfig.Hp
end
if cd==0 then
cd=lvConfig.Time
bossHp=lvConfig.Hp
end
else
cd=lvConfig.Time
bossHp=lvConfig.Hp
if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then
UIManager.OpenPanel(UIName.SmallSoldierFailPop)
end
PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
end
end
end)
else
cd=curConfig.Time
bossHp=curConfig.Hp
if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then
UIManager.OpenPanel(UIName.SmallSoldierFailPop)
end
PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
end
end
-- local lvConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
-- if msg.result==1 then
-- if lvConfig and lvConfig.NextId and lvConfig.NextId~=0 then
-- FightPointPassManager.soldierLayerId = lvConfig.NextId
-- local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
-- if curConfig then
-- cd=curConfig.Time
-- end
-- bossHp=lvConfig.Hp
-- end
-- if cd==0 then
-- cd=lvConfig.Time
-- bossHp=lvConfig.Hp
-- end
-- else
-- cd=lvConfig.Time
-- bossHp=lvConfig.Hp
-- if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
-- if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then
-- UIManager.OpenPanel(UIName.SmallSoldierFailPop)
-- end
-- PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
-- end
-- end
-- end)
-- else
-- cd=curConfig.Time
-- bossHp=curConfig.Hp
-- if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
-- if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then
-- UIManager.OpenPanel(UIName.SmallSoldierFailPop)
-- end
-- PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
-- end
-- end
end
-- end
end
--end
end
-- end
-- --end
-- end
end, 1, -1, true):Start()
-- end, 1, -1, true):Start()
end

View File

@ -182,7 +182,7 @@ function this.InitRedPointAllRelate()
--逍遥游
RPData:SetParent(RedPointType.XiaoYaoYouRedPoint, RedPointType.SecretTer)
RPData:SetParent(RedPointType.tuijianzhenrong, RedPointType.SecretTer)
--RPData:SetParent(RedPointType.tuijianzhenrong, RedPointType.SecretTer)
-- 外敌
RPData:SetParent(RedPointType.SecretTer_Boss, RedPointType.Alien)
RPData:SetParent(RedPointType.SecretTer_CallAlianInvasionTime, RedPointType.Alien)