------------------------------------------------ --作者: dhq --日期: 2019-10-22 --文件: SuitGemBossLogic.lua --模块: SuitGemBossLogic ------------------------------------------------ local SuitGemBossLogic = { --父逻辑系统 Parent = nil, Msg = nil, --服务器返回消息 LeaveTimerCounter = nil, } function SuitGemBossLogic:OnEnterScene(parent) self.Parent = parent --设置开关 GameCenter.MapLogicSwitch.CanRide = true GameCenter.MapLogicSwitch.CanFly = true GameCenter.MapLogicSwitch.CanRollDoge = true GameCenter.MapLogicSwitch.CanMandate = true GameCenter.MapLogicSwitch.CanOpenTeam = true GameCenter.MapLogicSwitch.ShowNewFunction = true GameCenter.MapLogicSwitch.UseAutoStrikeBack = true GameCenter.MapLogicSwitch.CanTeleport = true GameCenter.MapLogicSwitch.IsCopyMap = true GameCenter.MapLogicSwitch.IsPlaneCopyMap = false GameCenter.MapLogicSwitch.HoldFighting = false GameCenter.MapLogicSwitch.EventOpen = UnityUtils.GetObjct2Int(UILuaEventDefine.UISuitGemWorldBossCopyLeftForm_OPEN) GameCenter.MapLogicSwitch.EventClose = UnityUtils.GetObjct2Int(UILuaEventDefine.UISuitGemWorldBossCopyLeftForm_CLOSE) GameCenter.MapLogicSwitch.OtherSprName = "tongyong" if GameCenter.BossSystem.SuitGemBossType == SuitGemBossEnum.SuitBoss then GameCenter.MapLogicSwitch.OtherName = DataConfig.DataMessageString.Get("Boss_Suit_Title") elseif GameCenter.BossSystem.SuitGemBossType == SuitGemBossEnum.GemBoss then GameCenter.MapLogicSwitch.OtherName = DataConfig.DataMessageString.Get("Boss_Gem_Title") end local _bossID = GameCenter.BossSystem.CurSelectBossID if _bossID <= 0 then _bossID = GameCenter.BossInfoTipsSystem.CustomCfgID end local _bossCfg = DataConfig.DataBossnewWorld[_bossID] if _bossCfg then local _curMapID = self.Parent.MapCfg.MapId if _curMapID == _bossCfg.CloneMap then local _posList = Utils.SplitStr(_bossCfg.Pos, "_") local _pos = Vector2(tonumber(_posList[1]),tonumber(_posList[2])) GameCenter.PathSearchSystem:SearchPathToPosBoss(true, _pos, _bossID) end end GameCenter.PushFixEvent(UIEventDefine.UIBossForm_CLOSE) --关掉菜单 GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_MAINMENU) GameCenter.PushFixEvent(UIEventDefine.UISuitGemWorldBossCopyForm_OPEN) GameCenter.PushFixEvent(UIEventDefine.UIBossUpdateItemUseForm_OPEN, MapLogicTypeDefine.SuitGemCopy) self.LeaveTimerCounter = nil end function SuitGemBossLogic:OnLeaveScene() self.Msg = nil GameCenter.PushFixEvent(UIEventDefine.UISuitGemWorldBossCopyForm_CLOSE) end --处理协议 function SuitGemBossLogic:OnMsgHandle(msg) if msg.MsgID == GameCenter.Network.GetMsgID("MSG_Boss.ResSuitGemBossEndTime") then --天罚值满了,进入倒计时状态 self.LeaveTimerCounter = 30 end end --更新 function SuitGemBossLogic:Update(dt) if self.LeaveTimerCounter ~= nil then self.LeaveTimerCounter = self.LeaveTimerCounter - dt if self.LeaveTimerCounter < 0 then --发送退出消息 GameCenter.MapLogicSystem:SendLeaveMapMsg() self.LeaveTimerCounter = nil end end end function SuitGemBossLogic:GetMainUIState() return { [MainFormSubPanel.PlayerHead] = true, --主角头像 [MainFormSubPanel.TargetHead] = true, --目标头像 [MainFormSubPanel.TopMenu] = true, --顶部菜单 [MainFormSubPanel.MiniMap] = true, --小地图 [MainFormSubPanel.FlySwordGrave] = true, --境界 [MainFormSubPanel.TaskAndTeam] = true, --任务和组队 [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 SuitGemBossLogic:GetMainLeftUIState() return { [MainLeftSubPanel.Task] = false, --任务分页 [MainLeftSubPanel.Team] = true, --队伍分页 [MainLeftSubPanel.Other] = true, --其他分页 } end return SuitGemBossLogic