| | |
| | | private int Times = 0; |
| | | private int NeedWaitTime = 4; |
| | | PackModel _playerPack; |
| | | PackModel playerPack { |
| | | PackModel playerPack |
| | | { |
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } |
| | | } |
| | | |
| | |
| | | AutomaticityBool = true; |
| | | TaskOverBool = false; |
| | | } |
| | | |
| | | |
| | | |
| | | private void onStageLoadFinish()//地图切换时调用 |
| | | { |
| | |
| | | |
| | | if (CrossServerUtility.IsCrossServer()) |
| | | { |
| | | var sendInfo = new CC106_tagCMCrossNPCTalk(); |
| | | var sendInfo = new CC106_tagCMCrossNPCTalk(); |
| | | sendInfo.ObjID = instanceId; |
| | | sendInfo.NPCID = (uint)NPcID; |
| | | sendInfo.PosX = (ushort)Posx; |
| | |
| | | } |
| | | } |
| | | |
| | | public int GetLatestMainTaskId()
|
| | | {
|
| | | var taskId = 0;
|
| | | foreach (var id in MainTaskDic.Keys)
|
| | | {
|
| | | if (id > taskId)
|
| | | {
|
| | | taskId = id;
|
| | | }
|
| | | }
|
| | | return taskId;
|
| | | public int GetLatestMainTaskId() |
| | | { |
| | | var taskId = 0; |
| | | foreach (var id in MainTaskDic.Keys) |
| | | { |
| | | if (id > taskId) |
| | | { |
| | | taskId = id; |
| | | } |
| | | } |
| | | return taskId; |
| | | } |
| | | |
| | | void DefaultDialogue()//关于打开默认对话界面 |
| | |
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing) |
| | | { |
| | | return; |
| | | }
|
| | |
|
| | | bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
|
| | | } |
| | | |
| | | var state = 0;
|
| | | if (TryGetCustomTaskState(taskID, out state))
|
| | | {
|
| | | var config = StoryMissionsConfig.GetConfig(taskID, state);
|
| | | if (config != null && NPCid == config.NpcID)
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<DialogueDuidanceWin>() && IsOpenMain
|
| | | && !WindowCenter.Instance.ExistAnyFullScreenOrMaskWin())
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | DialogueDuidanceWin.storyMissionId = config.id;
|
| | | WindowCenter.Instance.Open<DialogueDuidanceWin>();
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | | if (!WindowCenter.Instance.IsOpen<TaskBoxBGMWin>() && IsOpenMain)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>();
|
| | | return;
|
| | | }
|
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
|
| | | {
|
| | | if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing)
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | }
|
| | | }
|
| | | bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>(); |
| | | |
| | | var state = 0; |
| | | if (TryGetCustomTaskState(taskID, out state)) |
| | | { |
| | | var config = StoryMissionsConfig.GetConfig(taskID, state); |
| | | if (config != null && NPCid == config.NpcID) |
| | | { |
| | | if (!WindowCenter.Instance.IsOpen<DialogueDuidanceWin>() && IsOpenMain |
| | | && !WindowCenter.Instance.ExistAnyFullScreenOrMaskWin()) |
| | | { |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | DialogueDuidanceWin.storyMissionId = config.id; |
| | | WindowCenter.Instance.Open<DialogueDuidanceWin>(); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | if (!WindowCenter.Instance.IsOpen<TaskBoxBGMWin>() && IsOpenMain) |
| | | { |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>(); |
| | | return; |
| | | } |
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow)) |
| | | { |
| | | if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing) |
| | | { |
| | | RequestGetTaskAward("OK"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public bool TryGetCustomTaskState(int taskId, out int state)
|
| | | {
|
| | | state = 0;
|
| | | if (ReplaceDic.ContainsKey(taskId))
|
| | | {
|
| | | var keyValue = ReplaceDic[taskId];
|
| | | if (keyValue.ContainsKey("state"))
|
| | | {
|
| | | state = keyValue["state"];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | public bool TryGetCustomTaskState(int taskId, out int state) |
| | | { |
| | | state = 0; |
| | | if (ReplaceDic.ContainsKey(taskId)) |
| | | { |
| | | var keyValue = ReplaceDic[taskId]; |
| | | if (keyValue.ContainsKey("state")) |
| | | { |
| | | state = keyValue["state"]; |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | void AddMission(int MissionID, int MissionState, int DiscriptionIndex)//添加任务 |
| | |
| | | { |
| | | MainTaskDic.Add(_taskID, allMissionDict[_taskID]); |
| | | } |
| | | if (Event_MainlineTask != null)
|
| | | {
|
| | | if (Event_MainlineTask != null) |
| | | { |
| | | Event_MainlineTask(_taskID, MissionState); |
| | | }
|
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private List<int> m_NeedHideNpcList = new List<int>(); |
| | | |
| | | public void Task0820(H0820_tagMissionDict info)//0820信息字典 |
| | | { |
| | | m_NeedHideNpcList.Clear(); |
| | | foreach (var _id in NPCShowDic.Keys) |
| | | { |
| | | if (NPCShowDic[_id] == 1) |
| | | { |
| | | var _npcConfig = NPCConfig.Get(_id); |
| | | if (_npcConfig.Show == 0) |
| | | { |
| | | m_NeedHideNpcList.Add(_id); |
| | | } |
| | | } |
| | | } |
| | | foreach (var _id in m_NeedHideNpcList) |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(_id, false); |
| | | NPCShowDic[_id] = 0; |
| | | } |
| | | Dictionary<string, int> dic = null; |
| | | ReplaceDic.TryGetValue((int)info.MissionID, out dic); |
| | | if (dic == null) |
| | | { |
| | | dic = new Dictionary<string, int>(); |
| | | StorageNPCDic(info.DictKey, (int)info.DictValue); |
| | | StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue); |
| | | dic.Add(info.DictKey, (int)info.DictValue); |
| | | ReplaceDic.Add((int)info.MissionID, dic); |
| | | } |
| | |
| | | { |
| | | if (dic.ContainsKey(info.DictKey)) |
| | | { |
| | | StorageNPCDic(info.DictKey, (int)info.DictValue); |
| | | StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue); |
| | | dic[info.DictKey] = (int)info.DictValue; |
| | | if (info.DictKey == "around_allcount") |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | StorageNPCDic(info.DictKey, (int)info.DictValue); |
| | | StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue); |
| | | dic.Add(info.DictKey, (int)info.DictValue); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | private PackModel m_PlayerBackModel; |
| | | private PackModel PlayerBackModel { |
| | | get { |
| | | private PackModel PlayerBackModel |
| | | { |
| | | get |
| | | { |
| | | return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PackModel>()); |
| | | } |
| | | } |
| | |
| | | return 0; |
| | | } |
| | | |
| | | private void StorageNPCDic(string key, int Value)//关于NPC的显隐 |
| | | private void StorageNPCDic(uint taskId, string key, int Value)//关于NPC的显隐 |
| | | { |
| | | string[] str = key.Split('_'); |
| | | if (str[0] == "Show") |
| | |
| | | if (NPCShowDic.ContainsKey(NPCid)) |
| | | { |
| | | NPCShowDic[NPCid] = Value; |
| | | |
| | | } |
| | | else |
| | | { |
| | | NPCShowDic.Add(NPCid, Value); |
| | | } |
| | | |
| | | ShowNpc((int)taskId, NPCid); |
| | | } |
| | | } |
| | | |
| | | private void ShowNpc(int taskID, int Npcid = -1) |
| | | { |
| | | if (ReplaceDic.ContainsKey(taskID)) |
| | | { |
| | | if (Npcid > 0) |
| | | { |
| | | if (Npcid != 0 && NPCShowDic.ContainsKey(Npcid)) |
| | | { |
| | | if (NPCShowDic[Npcid] == 0) |
| | | { |
| | | if (FaBaoNPCIdList.Contains(Npcid)) |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, false, 0.5f, (Vector3 _pos) => |
| | | { |
| | | WindowCenter.Instance.Open<EffectToFaBaoWin>(); |
| | | UIeffectFabaoVec = _pos; |
| | | }, 0.3f); |
| | | } |
| | | else |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, false); |
| | | } |
| | | |
| | | } |
| | | else if (NPCShowDic[Npcid] == 1) |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void IsShowNpC(int _taskID)//关于NPC的显隐 |
| | | { |
| | |
| | | else |
| | | { |
| | | IsGetOnBool = false; |
| | | }
|
| | |
|
| | | if (TaskOverBool)
|
| | | {
|
| | | Times += 1;
|
| | | if (Times >= NeedTime)
|
| | | {
|
| | | TaskOverBool = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (Times != 0)
|
| | | {
|
| | | Times = 0;
|
| | | }
|
| | | } |
| | | |
| | | if (TaskOverBool) |
| | | { |
| | | Times += 1; |
| | | if (Times >= NeedTime) |
| | | { |
| | | TaskOverBool = false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (Times != 0) |
| | | { |
| | | Times = 0; |
| | | } |
| | | } |
| | | } |
| | | |