Files
Main/Assets/GameAssets/Resources/Lua/Logic/MapLogicEx/JiuTianZF/JiuTianZFLogic.lua

133 lines
5.1 KiB
Lua
Raw Normal View History

2025-01-25 04:38:09 +08:00
------------------------------------------------
--作者: 何健
--日期: 2019-07-22
--文件: JiuTianZFLogic.lua
--模块: JiuTianZFLogic
--描述: 九天争峰副本逻辑
------------------------------------------------
local L_TaskData = require("Logic.MapLogicEx.JiuTianZF.JiuTianTaskData")
local JiuTianZFLogic = {
Parent = nil,
--等待开始的时间
WaitStartTime = 0,
--剩余时间
RemainTime = 0,
--当前击杀的怪物数量
CurMonsterNum = 0,
--当前获得的总经验
TotalExp = 0,
--任务列表
TaskList = List:New(),
--BOSS列表
BossList = List:New(),
}
function JiuTianZFLogic: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.UIJiuTianCopyMainForm_OPEN, self.Parent.MapCfg.MapId);
--进入就开始挂机
GameCenter.MandateSystem:Start();
end
function JiuTianZFLogic:OnLeaveScene()
GameCenter.PushFixEvent(UIEventDefine.UIJiuTianCopyMainForm_CLOSE);
end
function JiuTianZFLogic:OnMsgHandle(msg)
if msg.MsgID == GameCenter.Network.GetMsgID("MSG_NineDaysFocused.ResOpenTasKPanelReuslt") then
--打开任务面板,返回的任务信息
for i = 1, #msg.tasklist do
self.TaskList:Add(L_TaskData:New(msg.tasklist[i]))
end
elseif msg.MsgID == GameCenter.Network.GetMsgID("MSG_NineDaysFocused.ResGetTasKRewardReuslt") then
--领取任务奖励结果
if msg.isSucceed == true then
end
--任务更新
self.TaskList:Clear()
for i = 1, #msg.tasklist do
self.TaskList:Add(L_TaskData:New(msg.tasklist[i]))
end
elseif msg.MsgID == GameCenter.Network.GetMsgID("MSG_NineDaysFocused.ResApplyNieDaysReuslt") then
--报名结果
if msg.isSucceed == true then
end
elseif msg.MsgID == GameCenter.Network.GetMsgID("MSG_NineDaysFocused.ResBossHurtInfo") then
--boss战场信息
local _bossData = {}
self.BossList:Clear()
if msg.bosslist then
for i = 1, #msg.bosslist do
_bossData.DBID = msg.bosslist[i].uid
_bossData.CampAhurtPer = msg.bosslist[i].campAhurtPer
_bossData.CampBhurtPer = msg.bosslist[i].campBhurtPer
self.BossList:Add(_bossData)
end
end
end
end
function JiuTianZFLogic:Update(dt)
if self.WaitStartTime > 0 then
self.WaitStartTime = self.WaitStartTime - dt;
if self.WaitStartTime < 0 then
--超时了,剩余时间做一次超时计算
self.RemainTime = self.RemainTime + self.WaitStartTime;
end
elseif self.RemainTime > 0 then
self.RemainTime = self.RemainTime - dt;
end
end
function JiuTianZFLogic:GetMainUIState()
return {
[MainFormSubPanel.PlayerHead] = true, --主角头像
[MainFormSubPanel.TargetHead] = true, --目标头像
[MainFormSubPanel.TopMenu] = true, --顶部菜单
[MainFormSubPanel.MiniMap] = true, --小地图
[MainFormSubPanel.FlySwordGrave] = false, --境界
[MainFormSubPanel.TaskAndTeam] = false, --任务和组队
[MainFormSubPanel.Joystick] = true, --摇杆
[MainFormSubPanel.Exp] = true, --经验
[MainFormSubPanel.MiniChat] = true, --小聊天框
[MainFormSubPanel.Skill] = true, --技能
[MainFormSubPanel.SelectPkMode] = true, --选择PK模式
[MainFormSubPanel.FunctionFly] = true, --新功能开启飞行界面
[MainFormSubPanel.FastPrompt] = false, --快速提醒界面
[MainFormSubPanel.FastBts] = true, --快速操作按钮界面
[MainFormSubPanel.Ping] = true, --ping
[MainFormSubPanel.SkillWarning] = false, --技能释放警示
[MainFormSubPanel.CustomBtn] = true, --自定义按钮
[MainFormSubPanel.SitDown] = false, --打坐
[MainFormSubPanel.RemotePlayerHead] = false, --远程玩家头像
[MainFormSubPanel.ChangeSkill] = true, --变身技能
}
end
function JiuTianZFLogic:GetMainLeftUIState()
return {
[MainLeftSubPanel.Task] = false, --任务分页
[MainLeftSubPanel.Team] = false, --队伍分页
[MainLeftSubPanel.Other] = false, --其他分页
}
end
return JiuTianZFLogic;