少年修仙传客户端代码仓库
4846 子 【1.3】前XX级,无操作时,可自动执行主线 / 【前端】【1.3】XX级前玩家无操作时自动执行主线任务
3个文件已修改
84 ■■■■■ 已修改文件
Fight/GameActor/GA_Hero.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/DialogueDuidanceWin.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/PlayerTaskDatas.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_Hero.cs
@@ -829,7 +829,8 @@
    #region 自动开启自动战斗逻辑
    private float m_CalculAutoFightTime;
    PlayerTaskDatas m_TaskModel;
    PlayerTaskDatas taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } }
    private void UpdateAutoStartFight()
    {
        if (DTCB105_tagMCPlayerWallow.forceOffLine)
@@ -841,6 +842,17 @@
        {
            return;
        }
        if (taskmodel.IsTaskMove())
        {
            if (Time.realtimeSinceStartup - m_CalculAutoFightTime > taskmodel.TaskAutoTime
                 && !NewBieCenter.Instance.inGuiding
                 && PlayerTaskDatas.IsOPenAutoResolve())
            {
                DebugEx.LogError(taskmodel.currentMission+"GGGG");
                taskmodel.TaskMove(taskmodel.currentMission);
            }
        }
        if (MapArea.IsInMapArea(CurMapArea, MapArea.E_Type.Safe)
         || MapArea.IsInMapArea(CurMapArea, MapArea.E_Type.RebornSafe))
System/MainInterfacePanel/DialogueDuidanceWin.cs
@@ -119,35 +119,12 @@
        protected override void OnAfterOpen()
        {
            //Treasure treasure = null;
            //if (treasureModel.TryGetTreasure(FabaoId, out treasure))
            //{
            //    if (treasure.state != TreasureState.Collecting && !NewBieCenter.Instance.inGuiding)
            //    {
            //        StartCoroutine("GetMainSelfMotion");
            //    }
            //}
        }
        //IEnumerator GetMainSelfMotion()
        //{
        //    if (mainModel.IsSelfMotionTask)
        //    {
        //        yield return WaitingForSecondConst.WaitMS1500;
        //    }
        //    else
        //    {
        //        yield return new WaitForSeconds(AwaitSecond);
        //    }
        //    OnClickSKIPButton();
        //    mainModel.IsSelfMotionTask = true;
        //    yield break;
        //}
        protected override void OnPreClose()
        {
            MainInterfaceWin.IsOpenMaininterface -= IsOpenMaininterface;
            UI3DModelExhibition.Instance.StopShow();
           // StopCoroutine("GetMainSelfMotion");
        }
        private void IsOpenMaininterface()
@@ -253,6 +230,7 @@
            }
            mainModel.IsSelfMotionTask = false;
            Close();
            HeroAIRecorder.ClearRecord();
            WindowCenter.Instance.Open<MainInterfaceWin>();
        }
        #endregion
System/MainInterfacePanel/PlayerTaskDatas.cs
@@ -128,7 +128,9 @@
    private float BossDelayTimeint = 0;
    private List<int> FaBaoNPCIdList = new List<int>();//用于获取需要消失的法宝NPCID;
    public Vector3 UIeffectFabaoVec = new Vector3();//法宝NPC消失时获取的坐标
    //----关于前期无操作自动执行主线
    public int TaskAutoLv = 0;
    public int TaskAutoTime = 0;
    PlayerPackModel _playerPack;
    PlayerPackModel playerPack
@@ -150,6 +152,9 @@
        }
        string BossDelayTime = Config.Instance.Get<FuncConfigConfig>("BossDelayTime").Numerical1;
        BossDelayTimeint = float.Parse(BossDelayTime);
        var Task_Auto = Config.Instance.Get<FuncConfigConfig>("TaskAuto");
        TaskAutoLv = int.Parse(Task_Auto.Numerical1);
        TaskAutoTime= int.Parse(Task_Auto.Numerical2);
    }
    public override void UnInit()
@@ -1313,17 +1318,9 @@
        {
            yield break;
        }
        try
        {
            if (allMissionDict.ContainsKey(_taskID) && !NewBieCenter.Instance.inGuiding)
            {
                // GetNowTaskID = _taskID;
                string _strTest = allMissionDict[_taskID].InforList;
                string strTask = TaskAllocation.Instance.GetTaskInfo(Config.Instance.Get<TASKINFOConfig>(_strTest).show_writing, _taskID);
                HrefAnalysis.Inst.ExcuteHrefEvent(strTask);
                DropItemManager.StopMissionPickup = false;
            }
            TaskMove(_taskID);
        }
        catch (Exception ex)
        {
@@ -1559,4 +1556,33 @@
            IsGetOnBool = false;
        }
    }
    public bool IsTaskMove()
    {
        bool IsBool = false;
        if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
        {
            return IsBool;
        }
        if (PlayerDatas.Instance.baseData.LV > TaskAutoLv)
        {
            return IsBool;
        }
        if (GetTaskStatus(currentMission) == TaskStatus.Normal)
        {
            IsBool = true;
        }
        return IsBool;
    }
    public void TaskMove(int _taskID)
    {
        if (allMissionDict.ContainsKey(_taskID) && !NewBieCenter.Instance.inGuiding)
        {
            string _strTest = allMissionDict[_taskID].InforList;
            string strTask = TaskAllocation.Instance.GetTaskInfo(Config.Instance.Get<TASKINFOConfig>(_strTest).show_writing, _taskID);
            HrefAnalysis.Inst.ExcuteHrefEvent(strTask);
            DropItemManager.StopMissionPickup = false;
        }
    }
}