コード例 #1
0
        public virtual TaskStatus OnUpdate()
        {
            PointManager pointManager = !Singleton <Manager.Map> .IsInstance() ? (PointManager)null : Singleton <Manager.Map> .Instance.PointAgent;

            if ((!Object.op_Inequality((Object)pointManager, (Object)null) ? (Waypoint[])null : pointManager.Waypoints).IsNullOrEmpty <Waypoint>())
            {
                bool flag = false;
                Dictionary <int, List <Waypoint> > source = !Object.op_Inequality((Object)pointManager, (Object)null) ? (Dictionary <int, List <Waypoint> >)null : pointManager.HousingWaypointTable;
                if (!source.IsNullOrEmpty <int, List <Waypoint> >())
                {
                    foreach (KeyValuePair <int, List <Waypoint> > keyValuePair in source)
                    {
                        if (flag = !keyValuePair.Value.IsNullOrEmpty <Waypoint>())
                        {
                            break;
                        }
                    }
                }
                if (!flag)
                {
                    return((TaskStatus)3);
                }
            }
            if (this._agent.SearchAnimalEmpty)
            {
                return((TaskStatus)1);
            }
            if (this._agent.LivesAnimalCalc)
            {
                return((TaskStatus)3);
            }
            return(this._agent.SearchAnimalRoute.Count == 0 && Object.op_Equality((Object)this._agent.DestWaypoint, (Object)null) || !this._agent.LivesAnimalPatrol ? (TaskStatus)2 : (TaskStatus)3);
        }
コード例 #2
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            AgentActor         agent           = this.Agent;
            Vector3            position        = agent.Position;
            List <ActionPoint> actionPointList = ListPool <ActionPoint> .Get();

            PointManager pointAgent = Singleton <Manager.Map> .Instance.PointAgent;

            switch (Singleton <Manager.Map> .Instance.Simulator.Weather)
            {
            case Weather.Rain:
            case Weather.Storm:
                if (!agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(16))
                {
                    SetDesiredActionOtherChunk.CreateList(agent, pointAgent.AppendActionPoints, actionPointList, this._eventType, this._checkFollowType, true);
                    if (!actionPointList.IsNullOrEmpty <ActionPoint>())
                    {
                        this._destination = actionPointList.GetElement <ActionPoint>(Random.Range(0, actionPointList.Count));
                    }
                    if (Object.op_Equality((Object)this._destination, (Object)null))
                    {
                        actionPointList.Clear();
                        SetDesiredActionOtherChunk.CreateList(agent, pointAgent.ActionPoints, actionPointList, this._eventType, this._checkFollowType, true);
                        if (!actionPointList.IsNullOrEmpty <ActionPoint>())
                        {
                            this._destination = actionPointList.GetElement <ActionPoint>(Random.Range(0, actionPointList.Count));
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;
            }
            if (Object.op_Equality((Object)this._destination, (Object)null) && !agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(17))
            {
                actionPointList.Clear();
                SetDesiredActionOtherChunk.CreateList(agent, pointAgent.AppendActionPoints, actionPointList, this._eventType, this._checkFollowType, false);
                if (!actionPointList.IsNullOrEmpty <ActionPoint>())
                {
                    this._destination = actionPointList.GetElement <ActionPoint>(Random.Range(0, actionPointList.Count));
                }
            }
            if (Object.op_Equality((Object)this._destination, (Object)null))
            {
                actionPointList.Clear();
                SetDesiredActionOtherChunk.CreateList(agent, pointAgent.ActionPoints, actionPointList, this._eventType, this._checkFollowType, false);
                if (!actionPointList.IsNullOrEmpty <ActionPoint>())
                {
                    this._destination = actionPointList.GetElement <ActionPoint>(Random.Range(0, actionPointList.Count));
                }
            }
            ListPool <ActionPoint> .Release(actionPointList);
        }
コード例 #3
0
        public virtual TaskStatus OnUpdate()
        {
            StoryPoint storyPoint = (StoryPoint)null;

            if (Singleton <Manager.Map> .IsInstance())
            {
                PointManager pointAgent = Singleton <Manager.Map> .Instance.PointAgent;
                if (Object.op_Equality((Object)pointAgent, (Object)null))
                {
                    return((TaskStatus)1);
                }
                Dictionary <int, StoryPoint> storyPointTable = pointAgent.StoryPointTable;
                if (storyPointTable.IsNullOrEmpty <int, StoryPoint>())
                {
                    return((TaskStatus)1);
                }
                storyPointTable.TryGetValue(this._pointID, out storyPoint);
            }
            this.Agent.TargetStoryPoint = storyPoint;
            return(Object.op_Equality((Object)storyPoint, (Object)null) ? (TaskStatus)1 : (TaskStatus)2);
        }