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

(cherry picked from commit 15c9bd1b77)
tcx_xiyou_bt_ios
wangzhenxing 2024-06-04 19:24:48 +08:00
parent facb94e393
commit e38dc71064
1 changed files with 33 additions and 20 deletions

View File

@ -70,33 +70,46 @@ function this.InitData(msg)
cd=cd-1
if cd<=0 or bossHp<=0 then
--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)
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
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
bossHp=lvConfig.Hp
end
if cd==0 then
if cd==0 then
cd=lvConfig.Time
bossHp=lvConfig.Hp
end
else
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)
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
PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId)
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