------------------------------------------------ --作者: 杨全福 --日期: 2020-02-10 --文件: GuildTaskCopyLogic.lua --模块: GuildTaskCopyLogic --描述: 公会任务副本逻辑 ------------------------------------------------ local GuildTaskCopyLogic = { Parent = nil, --等待时间 WaitStartTime = 0, --等待时间戳 WaitStartTickTime = 0, --剩余时间 RemainTime = 0, --结束时间戳 EndTickTime = 0, --当前剩余的怪物数量 RemainMonsterCount = 0, --当前阶段 CurStage = 0, --最大阶段 MaxStage = 0, } function GuildTaskCopyLogic:OnEnterScene(parent) self.Parent = parent --设置开关 GameCenter.MapLogicSwitch.CanRide = false GameCenter.MapLogicSwitch.CanFly = false GameCenter.MapLogicSwitch.CanRollDoge = true GameCenter.MapLogicSwitch.CanMandate = true GameCenter.MapLogicSwitch.CanOpenTeam = false GameCenter.MapLogicSwitch.ShowNewFunction = false GameCenter.MapLogicSwitch.UseAutoStrikeBack = true GameCenter.MapLogicSwitch.CanTeleport = false GameCenter.MapLogicSwitch.IsCopyMap = true GameCenter.MapLogicSwitch.IsPlaneCopyMap = false GameCenter.MapLogicSwitch.HoldFighting = true --关掉菜单 GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_MAINMENU) --打开副本主界面 GameCenter.PushFixEvent(UIEventDefine.UIGuildTaskCopyMainForm_OPEN, self) --进入就开始挂机 GameCenter.MandateSystem:Start() --关掉小地图功能 GameCenter.MainFunctionSystem:SetFunctionVisible(FunctionStartIdCode.AreaMap, false) end function GuildTaskCopyLogic:OnLeaveScene() GameCenter.PushFixEvent(UIEventDefine.UIGuildTaskCopyMainForm_CLOSE) --打开小地图功能 GameCenter.MainFunctionSystem:SetFunctionVisible(FunctionStartIdCode.AreaMap, true) end function GuildTaskCopyLogic:OnMsgHandle(msg) if msg.MsgID == GameCenter.Network.GetMsgID("MSG_copyMap.ResGuildTaskCopyEnter") then --副本时间 local _serverTime = Time.ServerTime() self.WaitStartTickTime = msg.startTime self.WaitStartTime = self.WaitStartTickTime - _serverTime self.EndTickTime = msg.endTime self.RemainTime = self.EndTickTime - _serverTime self.RemainMonsterCount = msg.monsterCount self.CurStage = msg.stage self.MaxStage = msg.stageCount GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_REFRESH_GUILDTASKCOPY_INFO, self) if self.WaitStartTime > 0 then GameCenter.ScreenCDSystem:ShowCDEffect(self.WaitStartTime, DataConfig.DataMessageString.Get("WarBeComing")) end elseif msg.MsgID == GameCenter.Network.GetMsgID("MSG_copyMap.ResGuildTaskCopyInfo") then self.RemainMonsterCount = msg.monsterCount self.CurStage = msg.stage GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_REFRESH_GUILDTASKCOPY_INFO, self) elseif msg.MsgID == GameCenter.Network.GetMsgID("MSG_copyMap.ResGuildTaskCopyResult") then --主角准备退出 GameCenter.MapLogicSwitch:DoPlayerExitPrepare() --副本结算 GameCenter.PushFixEvent(UIEventDefine.UIGuildTaskCopyResultForm_OPEN, msg) end end function GuildTaskCopyLogic:Update(dt) local _serverTime = Time.ServerTime() self.WaitStartTime = self.WaitStartTickTime - _serverTime if self.WaitStartTime < 0 then self.WaitStartTime = 0 end self.RemainTime = self.EndTickTime - _serverTime if self.RemainTime < 0 then self.RemainTime = 0 end end function GuildTaskCopyLogic:GetMainUIState() return { [MainFormSubPanel.PlayerHead] = true, --主角头像 [MainFormSubPanel.TargetHead] = true, --目标头像 [MainFormSubPanel.TopMenu] = true, --顶部菜单 [MainFormSubPanel.MiniMap] = true, --小地图 [MainFormSubPanel.FlySwordGrave] = true, --境界 [MainFormSubPanel.TaskAndTeam] = false, --任务和组队 [MainFormSubPanel.Joystick] = true, --摇杆 [MainFormSubPanel.Exp] = true, --经验 [MainFormSubPanel.MiniChat] = true, --小聊天框 [MainFormSubPanel.Skill] = true, --技能 [MainFormSubPanel.SelectPkMode] = true, --选择PK模式 [MainFormSubPanel.FunctionFly] = true, --新功能开启飞行界面 [MainFormSubPanel.FastPrompt] = true, --快速提醒界面 [MainFormSubPanel.FastBts] = true, --快速操作按钮界面 [MainFormSubPanel.Ping] = true, --ping [MainFormSubPanel.SkillWarning] = false, --技能释放警示 [MainFormSubPanel.CustomBtn] = true, --自定义按钮 [MainFormSubPanel.SitDown] = false, --打坐 [MainFormSubPanel.RemotePlayerHead] = true, --远程玩家头像 [MainFormSubPanel.ChangeSkill] = true, --变身技能 } end function GuildTaskCopyLogic:GetMainLeftUIState() return { [MainLeftSubPanel.Task] = false, --任务分页 [MainLeftSubPanel.Team] = false, --队伍分页 [MainLeftSubPanel.Other] = false, --其他分页 } end return GuildTaskCopyLogic