挂机修改提交

tcx_xiyou_solider
PC-202302260912\Administrator 2024-03-20 15:50:34 +08:00
parent 718e52d874
commit 4b9a2cca1e
1 changed files with 23 additions and 9 deletions

View File

@ -541,16 +541,21 @@ function this.ShowBattleInfo()
end end
end end
if this.timer then
this.timer:Stop() end
this.timer = nil
function this.BattleLogic()
if this.battleTimer then
this.battleTimer:Stop()
this.battleTimer = nil
end end
local cd=0 local cd=0
local battleTime=curSoliderStageConfig.Time local battleTime=curSoliderStageConfig.Time
local bossHp=curSoliderStageConfig.Hp local bossHp=curSoliderStageConfig.Hp
local isHit=false local isHit=false
LogError("curSoliderStageConfig.Time===="..curSoliderStageConfig.Time.." curSoliderStageConfig.Hp=="..curSoliderStageConfig.Hp) LogError("curSoliderStageConfig.Time===="..curSoliderStageConfig.Time.." curSoliderStageConfig.Hp=="..curSoliderStageConfig.Hp)
this.timer = Timer.New(function() this.battleTimer = Timer.New(function()
cd=cd+1 cd=cd+1
--每隔三秒攻击一次 --每隔三秒攻击一次
@ -619,15 +624,15 @@ function this.ShowBattleInfo()
--战斗时间到了,重头开始打 --战斗时间到了,重头开始打
if battleTime<=0 then if battleTime<=0 then
LogError("战斗结束") LogError("战斗结束")
this.timer:Stop() this.battleTimer:Stop()
cd=0 cd=0
battleTime=curSoliderStageConfig.Time battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp bossHp=curSoliderStageConfig.Hp
this.timer:Start() this.battleTimer:Start()
end end
if bossHp<=0 then if bossHp<=0 then
LogError("boss被击败") LogError("boss被击败")
this.timer:Stop() this.battleTimer:Stop()
NetManager.SoldierFightCheckRequest(function(msg) NetManager.SoldierFightCheckRequest(function(msg)
--战斗成功 --战斗成功
if msg.result==1 then if msg.result==1 then
@ -648,7 +653,7 @@ function this.ShowBattleInfo()
--刷新挂机奖励 --刷新挂机奖励
this.IntiReward() this.IntiReward()
end end
this.timer:Start() this.battleTimer:Start()
cd=0 cd=0
battleTime=curSoliderStageConfig.Time battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp bossHp=curSoliderStageConfig.Hp
@ -656,9 +661,12 @@ function this.ShowBattleInfo()
end) end)
end end
end, 1, -1, true) end, 1, -1, true)
this.timer:Start() this.battleTimer:Start()
end end
function this.SetInitAnim() function this.SetInitAnim()
-- 隐藏界面特效 -- 隐藏界面特效
-- count = 1 -- count = 1
@ -761,6 +769,7 @@ end
function FightPointPassMainPanel:OnShow() function FightPointPassMainPanel:OnShow()
--LogError("SmallSoldierManager.changeSolider.type=========="..SmallSoldierManager.changeSolider.type) --LogError("SmallSoldierManager.changeSolider.type=========="..SmallSoldierManager.changeSolider.type)
this.RefreshSoliderInfo() this.RefreshSoliderInfo()
this.BattleLogic()
CheckRedPointStatus(RedPointType.XiaoYaoYouRedPoint) CheckRedPointStatus(RedPointType.XiaoYaoYouRedPoint)
CheckRedPointStatus(RedPointType.numberGame) CheckRedPointStatus(RedPointType.numberGame)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge)
@ -1287,6 +1296,11 @@ function FightPointPassMainPanel:OnDestroy()
soliderPreList={} soliderPreList={}
this.bossLiveGO=nil this.bossLiveGO=nil
this.bossLiveName=nil this.bossLiveName=nil
this.Floater:Dispose()
if this.battleTimer then
this.battleTimer:Stop()
this.battleTimer=nil
end
end end
--跳转显示新手提示圈 --跳转显示新手提示圈
function FightPointPassMainPanel.ShowGuideGo(btnIndex) function FightPointPassMainPanel.ShowGuideGo(btnIndex)