154 lines
5.9 KiB
Lua
154 lines
5.9 KiB
Lua
------------------------------------------------
|
|
--作者: xihan
|
|
--日期: 2019-05-28
|
|
--文件: ArenaShouXiLogic.lua
|
|
--模块: ArenaShouXiLogic
|
|
--描述: 首席竞技场副本
|
|
------------------------------------------------
|
|
|
|
local LoversFightFreelogic = {
|
|
--父逻辑系统
|
|
Parent = nil,
|
|
--剩余时间
|
|
RemainTime = 0.0,
|
|
--是否检查了观战
|
|
CheckWatch = false,
|
|
--是否是观战
|
|
IsWatch = true,
|
|
CameraControl = nil,
|
|
}
|
|
|
|
function LoversFightFreelogic:OnEnterScene(parent)
|
|
self.ReadyTime = 0
|
|
self.StartFight = false
|
|
self.CheckWatch = false
|
|
self.IsWatch = true
|
|
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 = false;
|
|
GameCenter.MapLogicSwitch.AutoUseXPSkill = false;
|
|
GameCenter.MandateSystem:Start()
|
|
|
|
--关掉小地图功能
|
|
GameCenter.MainFunctionSystem:SetFunctionVisible(FunctionStartIdCode.AreaMap, false);
|
|
--关掉菜单
|
|
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_MAINMENU);
|
|
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_ALL_FORM,
|
|
{"UIPanelCopyFailedForm", "UIHUDForm", "UIMainForm", "UIMainFormPC", "UIGuideForm", "UIReliveForm", "UIMsgPromptForm", "UIMsgMarqueeForm", "UILoadingForm", "UICinematicForm", "UIGetEquipTIps", "UIPowerSaveForm", "UIPropertyChangeForm" })
|
|
GameCenter.PushFixEvent(UILuaEventDefine.UILoversFightCopyForm_OPEN)
|
|
end
|
|
|
|
function LoversFightFreelogic:OnLeaveScene()
|
|
self.CheckWatch = true
|
|
if self.IsWatch then
|
|
if self.CameraControl ~= nil then
|
|
self.CameraControl.FreeMode = false
|
|
local _lp = GameCenter.GameSceneSystem:GetLocalPlayer()
|
|
if _lp ~= nil then
|
|
_lp.IsCatching = false
|
|
_lp.IsShowModel = true
|
|
_lp.IsShowHUD = true
|
|
end
|
|
end
|
|
end
|
|
GameCenter.MandateSystem:End()
|
|
--打开小地图功能
|
|
GameCenter.MainFunctionSystem:SetFunctionVisible(FunctionStartIdCode.AreaMap, true);
|
|
--关闭副本UI
|
|
GameCenter.PushFixEvent(UILuaEventDefine.UILoversFightCopyForm_CLOSE)
|
|
end
|
|
|
|
function LoversFightFreelogic:IsCheckWatch(msg)
|
|
if not self.CheckWatch then
|
|
if msg ~= nil then
|
|
local _lp = GameCenter.GameSceneSystem:GetLocalPlayer()
|
|
if _lp ~= nil then
|
|
local _lpId = _lp.ID
|
|
if msg.player ~= nil then
|
|
for i = 1, #msg.player do
|
|
local _player = msg.player[i]
|
|
if _player.id == _lpId then
|
|
self.IsWatch = false
|
|
break
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
self.CheckWatch = true
|
|
if self.IsWatch then
|
|
--如果是观察者
|
|
local _scene = GameCenter.GameSceneSystem.ActivedScene
|
|
self.CameraControl = _scene.SceneCameraControl
|
|
self.CameraControl.FreeMode = true
|
|
self.CameraControl.CurDis = 30
|
|
self.CameraControl.CurYaw = 90
|
|
self.CameraControl.CurPitch = 45
|
|
self.CameraControl.CurOffsetY = -3
|
|
self.CameraControl.CurOffsetX = 0
|
|
self.CameraControl.CurFov = 45
|
|
local _lp = GameCenter.GameSceneSystem:GetLocalPlayer()
|
|
if _lp ~= nil then
|
|
_lp.IsCatching = true;
|
|
_lp.IsShowModel = false;
|
|
_lp.IsShowHUD = false;
|
|
Debug.LogError("设置玩家是观察者!")
|
|
end
|
|
end
|
|
end
|
|
|
|
--更新
|
|
function LoversFightFreelogic:Update(dt)
|
|
end
|
|
|
|
--处理协议
|
|
function LoversFightFreelogic:OnMsgHandle(msg)
|
|
--GameCenter.ScreenCDSystem:ShowCDEffect(3, DataConfig.DataMessageString.Get("WarBeComing"))
|
|
end
|
|
|
|
function LoversFightFreelogic:GetMainUIState()
|
|
return {
|
|
[MainFormSubPanel.PlayerHead] = false, --主角头像
|
|
[MainFormSubPanel.TargetHead] = true, --目标头像
|
|
[MainFormSubPanel.TopMenu] = false, --顶部菜单
|
|
[MainFormSubPanel.MiniMap] = false, --小地图
|
|
[MainFormSubPanel.FlySwordGrave] = false, --境界
|
|
[MainFormSubPanel.TaskAndTeam] = false, --任务和组队
|
|
[MainFormSubPanel.Joystick] = true, --摇杆
|
|
[MainFormSubPanel.Exp] = true, --经验
|
|
[MainFormSubPanel.MiniChat] = true, --小聊天框
|
|
[MainFormSubPanel.Skill] = true, --技能
|
|
[MainFormSubPanel.SelectPkMode] = false, --选择PK模式
|
|
[MainFormSubPanel.FunctionFly] = false, --新功能开启飞行界面
|
|
[MainFormSubPanel.FastPrompt] = false, --快速提醒界面
|
|
[MainFormSubPanel.FastBts] = false, --快速操作按钮界面
|
|
[MainFormSubPanel.Ping] = true, --ping
|
|
[MainFormSubPanel.SkillWarning] = false, --技能释放警示
|
|
[MainFormSubPanel.CustomBtn] = false, --自定义按钮
|
|
[MainFormSubPanel.SitDown] = false, --打坐
|
|
[MainFormSubPanel.RemotePlayerHead] = false, --远程玩家头像
|
|
[MainFormSubPanel.ChangeSkill] = true, --变身技能
|
|
}
|
|
end
|
|
|
|
function LoversFightFreelogic:GetMainLeftUIState()
|
|
return {
|
|
[MainLeftSubPanel.Task] = false, --任务分页
|
|
[MainLeftSubPanel.Team] = false, --队伍分页
|
|
[MainLeftSubPanel.Other] = false, --其他分页
|
|
}
|
|
end
|
|
|
|
return LoversFightFreelogic; |