| | |
| | | public int currentMission { get; private set; }
|
| | | public int currentMissionState { get; private set; }
|
| | |
|
| | | public int GetNowTaskID { get; set; }
|
| | | public int GetNowTaskID { get; set; }//获取当前选中条的任务ID
|
| | |
|
| | | private bool AutomaticityBool = false;//控制是否自动进行自动任务
|
| | | private int retainTaskID = 0;
|
| | | private float BossDelayTimeint = 0;
|
| | | private List<int> FaBaoNPCIdList = new List<int>();//用于获取需要消失的法宝NPCID;
|
| | | public Vector3 UIeffectFabaoVec = new Vector3();//法宝NPC消失时获取的坐标
|
| | |
|
| | |
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | | {
|
| | |
| | | StageManager.Instance.onStageLoadFinish += onStageLoadFinish;
|
| | | NPCInteractProcessor.s_NpcInteractEvent += NpcInterac;
|
| | | FaBaoNPCIdList.Clear();
|
| | | string strFabao = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("FaBaoNPCID").Numerical1;
|
| | | string strFabao = Config.Instance.Get<FuncConfigConfig>("FaBaoNPCID").Numerical1;
|
| | | string[] strFabaoNpcID = ConfigParse.GetMultipleStr(strFabao);//解析出数组|
|
| | |
|
| | | for (int i = 0; i < strFabaoNpcID.Length; i++)
|
| | | {
|
| | | FaBaoNPCIdList.Add(int.Parse(strFabaoNpcID[i]));
|
| | | }
|
| | | string BossDelayTime = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("BossDelayTime").Numerical1;
|
| | | string BossDelayTime = Config.Instance.Get<FuncConfigConfig>("BossDelayTime").Numerical1;
|
| | | BossDelayTimeint = float.Parse(BossDelayTime);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= secondEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += secondEvent;
|
| | | AutomaticityBool = true;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | private void onStageLoadFinish()//地图切换时调用
|
| | | {
|
| | |
| | | {
|
| | | try
|
| | | {
|
| | | var pytaskM = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID);
|
| | | if (AutomaticityBool && MissionState!=3)
|
| | | {
|
| | | TaskupToDate = MissionID;
|
| | | }
|
| | | var pytaskM = Config.Instance.Get<PyTaskConfig>(MissionID);
|
| | | if (pytaskM == null)
|
| | | {
|
| | | return;
|
| | |
| | |
|
| | | if (allMissionDict.ContainsKey(MissionID))
|
| | | {
|
| | | int missionState = allMissionDict[MissionID].MissionState;
|
| | | if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool)
|
| | | {
|
| | | if (CompletionOfTaskEvent != null)
|
| | |
| | | }
|
| | | TaskChanges(MissionID, MissionState, DiscriptionIndex);//任务的状态修改
|
| | |
|
| | | if (Event_TaskRefreshes != null)//刷新任务
|
| | | if (missionState == 0 && (MissionState == 1 || MissionState==2))
|
| | | {
|
| | | Event_TaskRefreshes(MissionID);
|
| | | if (Event_TaskToAdd != null)//任务添加(用于存储于身上的未接取任务的特殊处理)
|
| | | {
|
| | | Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (Event_TaskRefreshes != null)//刷新任务
|
| | | {
|
| | | Event_TaskRefreshes(MissionID);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DesignDebug.Log(ex);
|
| | | DebugEx.Log(ex.StackTrace);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | void DefaultDialogue()//关于打开默认对话界面
|
| | | {
|
| | | bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>();
|
| | | if (!WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>() && IsOpenMain)
|
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | | bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
|
| | | if (!WindowCenter.Instance.IsOpen<DefaultDialogueBoxWin>() && IsOpenMain)
|
| | | {
|
| | | WindowCenter.Instance.Open<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | var config = ConfigManager.Instance.GetTemplate<StoryMissionsConfig>(taskID);
|
| | | bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>();
|
| | | var config = Config.Instance.Get<StoryMissionsConfig>(taskID);
|
| | | bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
|
| | | var treasureStageUpShow = ModelCenter.Instance.GetModel<TreasureModel>().treasureStageUpShow;
|
| | | if (config != null)
|
| | | {
|
| | |
| | | {
|
| | | if (NPCid == config.NpcID[i])
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>() && IsOpenMain
|
| | | if (!WindowCenter.Instance.IsOpen<DialogueDuidanceWin>() && IsOpenMain
|
| | | && !treasureStageUpShow && !WindowCenter.Instance.ExitAnyFullScreenOrMaskWin())
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | if (!WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow)
|
| | | if (!WindowCenter.Instance.IsOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>();
|
| | |
| | | {
|
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing)
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow)
|
| | | if (!WindowCenter.Instance.IsOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>();
|
| | |
| | | {
|
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing)
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | } |
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | void AddMission(int MissionID, int MissionState, int DiscriptionIndex)//添加任务
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID);
|
| | | var config = Config.Instance.Get<PyTaskConfig>(MissionID);
|
| | | if (config == null)
|
| | | {
|
| | | DesignDebug.LogError(MissionID + "表格中不存在此任务ID");
|
| | | DebugEx.LogError(MissionID + "表格中不存在此任务ID");
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | SideQuestsType17 = 17,//支线17-21新增
|
| | | SideQuestsType18 = 18,
|
| | | SideQuestsType19 = 19,
|
| | | SideQuestsType20 = 20,
|
| | | SideQuestsType20 = 20,//(后端特殊处理,暂定不让使用)
|
| | | SideQuestsType21 = 21,
|
| | | }
|
| | |
|
| | |
| | |
|
| | | void TaskChanges(int MissionID, int MissionState, int DiscriptionIndex)//存在的任务的修改
|
| | | {
|
| | | var pytaskM = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID);
|
| | | var pytaskM = Config.Instance.Get<PyTaskConfig>(MissionID);
|
| | | if (pytaskM == null)
|
| | | return;
|
| | | allMissionDict[MissionID].Time = DateTime.Now;
|
| | |
| | | {
|
| | | if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null && _DictValue == 0)
|
| | | {
|
| | | |
| | | if (IsGetOnBool)
|
| | | {
|
| | | GetNowTaskID = _MissionId;
|
| | | }
|
| | | MainCardLevelChange(_MissionId);
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | if (_DicTaskInformation[_MissionId].ContainsKey(_DictKey))
|
| | | {
|
| | | _DicTaskInformation[_MissionId][_DictKey] = _DictValue.ToString();
|
| | | if (_DictKey == "kaji" && _DictValue == 0)
|
| | | if (_DictKey == "kaji" && (_DictValue == 0|| _DictValue == 1))//kaji:0为主线卡级变更,kaji:1为魔族卡级变更
|
| | | {
|
| | | if (CardLevelChange != null)
|
| | | {
|
| | | CardLevelChange(_MissionId);
|
| | | }
|
| | | if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null)
|
| | | {
|
| | | MainCardLevelChange(_MissionId);
|
| | | if (MainTaskDic.ContainsKey(_MissionId))
|
| | | { |
| | | if (IsGetOnBool)
|
| | | {
|
| | | GetNowTaskID = _MissionId;
|
| | | }
|
| | | if (MainCardLevelChange != null)
|
| | | {
|
| | | MainCardLevelChange(_MissionId);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //if (_NpcID == allMissionDict[key].LightList.NpcId)
|
| | | //{
|
| | | // if (allMissionDict[key].LightList.StateLight > Light)
|
| | | // {
|
| | | // Light = allMissionDict[key].LightList.StateLight;
|
| | | // }
|
| | |
|
| | | //}
|
| | | }
|
| | |
|
| | | return Light;
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | if (FairyAuDic.Count != 0)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | public void DailyBountyMove()//日常赏金任务
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | if (BountyDic.Count != 0)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private int Autotasking(int taskID)
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | else if (FairyAuDic.ContainsKey(_taskID))//仙盟任务
|
| | | {
|
| | |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DesignDebug.Log(ex);
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var _singleModel = PlayerBackModel.GetSinglePackModel(PackType.rptEquip);
|
| | | // 如果有守护, 则不拾取
|
| | | var _itemModel = _singleModel.GetItemModelByIndex((int)RoleEquipType.retSpiritAnimal);
|
| | | if (_itemModel == null || !GeneralConfig.Instance.GuardianPickUpID.Contains(_itemModel.itemId))
|
| | | if (_itemModel == null || !GeneralDefine.GuardianPickUpID.Contains(_itemModel.itemId))
|
| | | {
|
| | | float _chkDistanceSqrt;
|
| | | DropItemManager.DropObject _obj = null;
|
| | |
| | | {
|
| | | break;
|
| | | }
|
| | |
|
| | | if (MapTransferUtility.Instance.MapTransferDoType != MapTransferUtility.E_MapTransferDoType.None)
|
| | | {
|
| | | break;
|
| | |
| | | yield break;
|
| | | }
|
| | |
|
| | | if (WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>())
|
| | | if (WindowCenter.Instance.IsOpen<TreasureLevelUpWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | |
|
| | | if (WindowCenter.Instance.CheckOpen<MysteriousMissionWin>())
|
| | | if (WindowCenter.Instance.IsOpen<MysteriousMissionWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | |
| | | {
|
| | | // GetNowTaskID = _taskID;
|
| | | string _strTest = allMissionDict[_taskID].InforList;
|
| | | string strTask = TaskAllocation.Instance.GetTaskInfo(ConfigManager.Instance.GetTemplate<TASKINFOConfig>(_strTest).show_writing, _taskID);
|
| | | string strTask = TaskAllocation.Instance.GetTaskInfo(Config.Instance.Get<TASKINFOConfig>(_strTest).show_writing, _taskID);
|
| | | HrefAnalysis.Inst.ExcuteHrefEvent(strTask);
|
| | | DropItemManager.StopMissionPickup = false;
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DesignDebug.Log(ex);
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, true);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private bool IsDungeon()//判断是否在副本中
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(mapId);
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | return mapConfig != null && mapConfig.MapFBType != 0;
|
| | | }
|
| | | public bool IsGather(int npdId)//是否能采集NPC
|
| | | {
|
| | | var taskListConfig = ConfigManager.Instance.GetTemplate<TaskListConfig>(currentMission);
|
| | | var taskListConfig = Config.Instance.Get<TaskListConfig>(currentMission);
|
| | | if (taskListConfig != null)
|
| | | {
|
| | | int[] collectNPCList = taskListConfig.CollectNPC;
|
| | |
| | |
|
| | | public static bool IsOPenAutoResolve()//任务面板不开启自动挂机状态
|
| | | {
|
| | | WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>();
|
| | | WindowCenter.Instance.IsOpen<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.IsOpen<DialogueDuidanceWin>();
|
| | | bool _bool = true;
|
| | | if (WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>())
|
| | | if (WindowCenter.Instance.IsOpen<TaskBoxBGMWin>())
|
| | | {
|
| | | _bool = false;
|
| | | }
|
| | | else if (WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>())
|
| | | else if (WindowCenter.Instance.IsOpen<DefaultDialogueBoxWin>())
|
| | | {
|
| | | _bool = false;
|
| | | }
|
| | | else if (WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>())
|
| | | else if (WindowCenter.Instance.IsOpen<DialogueDuidanceWin>())
|
| | | {
|
| | | _bool = false;
|
| | | }
|
| | |
| | | {
|
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>();
|
| | | var point = mapModel.GetRecommendHangPoint();
|
| | | var config = ConfigManager.Instance.GetTemplate<MapEventPointConfig>(point);
|
| | | var config = Config.Instance.Get<MapEventPointConfig>(point);
|
| | | MapTransferUtility.Instance.MoveToNPC(config.NPCID);
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | return -1;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public int GetQuestState(int _taskId)
|
| | |
| | | return -1;
|
| | | }
|
| | | }
|
| | | //--------主要用于记录任务列表选中条的智能性 (-_-||)
|
| | | public int TaskupToDate = 0;//获取最新任务ID
|
| | | public int GetOnTaskId = 0;
|
| | | public bool IsGetOnBool = false;
|
| | | private int NeedTime = 10;
|
| | | private DateTime dateTimeA;
|
| | | public void GetTaskGetOnNow(int TaskID, string DictKey)//记录下信息字典的ID
|
| | | {
|
| | | string key1Str = "on_kill_" + TaskID;
|
| | | string key2Str = "get_byid_" + TaskID;
|
| | | if (TaskID > 1 && (key1Str== DictKey || key2Str== DictKey))
|
| | | {
|
| | | GetOnTaskId = TaskID;
|
| | | dateTimeA =DateTime.Now;
|
| | | }
|
| | |
|
| | | }
|
| | | private void secondEvent()
|
| | | {
|
| | | TimeSpan timeS =DateTime.Now- dateTimeA;
|
| | | int timeSend = timeS.Seconds;
|
| | | if (timeSend >= NeedTime)
|
| | | {
|
| | | IsGetOnBool = true;
|
| | | GetOnTaskId = GetNowTaskID;//获取当前选中的ID |
| | | }
|
| | | else
|
| | | {
|
| | | IsGetOnBool = false;
|
| | | }
|
| | | }
|
| | | }
|