挂机自动打关卡修改==============同bt

tcx_xiyou_dev
wangzhenxing 2024-06-04 19:24:48 +08:00
parent 195fb8bfd4
commit 15c9bd1b77
1 changed files with 33 additions and 20 deletions

View File

@ -70,33 +70,46 @@ function this.InitData(msg)
cd=cd-1 cd=cd-1
if cd<=0 or bossHp<=0 then if cd<=0 or bossHp<=0 then
--LogError("发送小兵挂机战斗请求======================================================") --LogError("发送小兵挂机战斗请求======================================================")
NetManager.SoldierFightCheckRequest(0,function (msg) local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
if curConfig.OpenRule[1][2]<=GetOpenServerDayNum() then
NetManager.SoldierFightCheckRequest(0,function (msg)
local lvConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) local lvConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
if msg.result==1 then if msg.result==1 then
if lvConfig and lvConfig.NextId and lvConfig.NextId~=0 then if lvConfig and lvConfig.NextId and lvConfig.NextId~=0 then
FightPointPassManager.soldierLayerId = lvConfig.NextId FightPointPassManager.soldierLayerId = lvConfig.NextId
local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
if curConfig then if curConfig then
cd=curConfig.Time cd=curConfig.Time
end
bossHp=lvConfig.Hp
end end
bossHp=lvConfig.Hp if cd==0 then
end cd=lvConfig.Time
if cd==0 then bossHp=lvConfig.Hp
end
else
cd=lvConfig.Time cd=lvConfig.Time
bossHp=lvConfig.Hp bossHp=lvConfig.Hp
end if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then
else if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then
cd=lvConfig.Time UIManager.OpenPanel(UIName.SmallSoldierFailPop)
bossHp=lvConfig.Hp end
if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then
UIManager.OpenPanel(UIName.SmallSoldierFailPop)
end 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