Files
Main/Assets/GameAssets/Resources/Lua/Logic/MapLogicEx/NewWorldBoss/NewComLogic.lua
2025-01-25 04:38:09 +08:00

132 lines
5.1 KiB
Lua

------------------------------------------------
--作者: 何健
--日期: 2019-08-21
--文件: NewComLogic.lua
--模块: NewComLogic
--描述: 无极虚域新手层
------------------------------------------------
local NewComLogic = {
--父逻辑系统
Parent = nil,
--是否已经展示了进入提示
IsShowEnterTips = false,
--剩余时间
RemainTime = 0.0,
--副本是否完成
IsFinish = false,
--副本完成延迟打开结算面板
RelaxTime = 0,
--结算结果
ResultMsg = nil,
}
function NewComLogic: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.GetNewItemSystem.PauseGetNewItemTips = true;
GameCenter.MapLogicSwitch.EventOpen = UnityUtils.GetObjct2Int(UIEventDefine.UINewCompCopyForm_OPEN)
GameCenter.MapLogicSwitch.EventClose = UnityUtils.GetObjct2Int(UIEventDefine.UINewCompCopyForm_CLOSE)
GameCenter.MapLogicSwitch.OtherSprName = "tongyong"
GameCenter.MapLogicSwitch.OtherName = DataConfig.DataMessageString.Get("BOSS_WORLD_TITTLE")
--关掉小地图功能
GameCenter.MainFunctionSystem:SetFunctionVisible(FunctionStartIdCode.AreaMap, false)
--关掉菜单
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_MAINMENU)
--打开福地夺宝副本UI
GameCenter.PushFixEvent(UIEventDefine.UINewCompCopyMainForm_OPEN)
GameCenter.PushFixEvent(UIEventDefine.UIBossForm_CLOSE)
self.IsShowEnterTips = false;
end
function NewComLogic:OnLeaveScene()
--打开小地图功能
GameCenter.MainFunctionSystem:SetFunctionVisible(FunctionStartIdCode.AreaMap, true)
--关闭夺宝副本UI
GameCenter.PushFixEvent(UIEventDefine.UINewCompCopyForm_CLOSE)
GameCenter.PushFixEvent(UIEventDefine.UINewCompCopyMainForm_CLOSE)
GameCenter.Network.Send("MSG_Boss.ReqNoobBossPannel", {})
end
--更新
function NewComLogic:Update(dt)
if self.RemainTime > 0.0 then
self.RemainTime = self.RemainTime - dt
end
if self.IsFinish and self.RelaxTime < 4 then
self.RelaxTime = self.RelaxTime + dt
if self.RelaxTime >= 4 then
GameCenter.BossSystem:ResBossStateResultPanl(self.ResultMsg)
end
end
if not GameCenter.MandateSystem:IsRunning() and not GameCenter.BlockingUpPromptSystem:IsRunning() then
GameCenter.MandateSystem:Start()
end
end
--处理协议
function NewComLogic:OnMsgHandle(msg)
if msg.MsgID == GameCenter.Network.GetMsgID("MSG_copyMap.ResCopymapNeedTime") then
--副本时间
self.RemainTime = msg.EndTime;
elseif msg.MsgID == GameCenter.Network.GetMsgID("MSG_zone.ResBossStateResultPanl") then
self.ResultMsg = msg
if self.ResultMsg.state then
self.IsFinish = true
self.RelaxTime = 0
else
GameCenter.BossSystem:ResBossStateResultPanl(self.ResultMsg)
end
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_NEWCOMP_RESULT)
end
end
function NewComLogic: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 NewComLogic:GetMainLeftUIState()
return {
[MainLeftSubPanel.Task] = false, --任务分页
[MainLeftSubPanel.Team] = true, --队伍分页
[MainLeftSubPanel.Other] = true, --其他分页
}
end
return NewComLogic;