Exemple #1
0
        public void ChangeMode(Tutorial.ActionType mode)
        {
            AgentBehaviorTree agentBehaviorTree;

            if (!this._behaviorTreeTable.TryGetValue(mode, out agentBehaviorTree) || Object.op_Equality((Object)agentBehaviorTree, (Object)null) || Object.op_Equality((Object)this._current, (Object)agentBehaviorTree))
            {
                return;
            }
            this.Mode = mode;
            if (this._current != null)
            {
                this._current.DisableBehavior(false);
            }
            this._current = agentBehaviorTree;
            if (this._nextDisposable != null)
            {
                this._nextDisposable.Dispose();
            }
            this._nextDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.NextFrame((FrameCountType)0), (System.Action <M0>)(_ => this.Current.EnableBehavior()));
        }
Exemple #2
0
 public AgentBehaviorTree GetBehaviorTree(Tutorial.ActionType mode)
 {
     return((AgentBehaviorTree)null);
 }
        private bool CanTalk()
        {
            Tutorial.ActionType tutorialType = this._agent.TutorialType;
            int num;

            switch (tutorialType)
            {
            case Tutorial.ActionType.PassFishingRod:
            case Tutorial.ActionType.FoodRequest:
            case Tutorial.ActionType.WaitAtBase:
                num = 1;
                break;

            default:
                num = tutorialType == Tutorial.ActionType.GrilledFishRequest ? 1 : 0;
                break;
            }
            if (num == 0)
            {
                return(false);
            }
            switch (tutorialType)
            {
            case Tutorial.ActionType.PassFishingRod:
                return(true);

            case Tutorial.ActionType.FoodRequest:
                if (Singleton <Manager.Map> .IsInstance() && Singleton <Resources> .IsInstance() && Manager.Map.GetTutorialProgress() == 7)
                {
                    List <StuffItem> itemList = Singleton <Manager.Map> .Instance?.Player?.PlayerData?.ItemList;
                    List <FishingDefinePack.ItemIDPair> fishList = Singleton <Resources> .Instance?.FishingDefinePack?.IDInfo?.FishList;
                    if (itemList.IsNullOrEmpty <StuffItem>() || fishList.IsNullOrEmpty <FishingDefinePack.ItemIDPair>())
                    {
                        return(false);
                    }
                    using (List <FishingDefinePack.ItemIDPair> .Enumerator enumerator = fishList.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            FishingDefinePack.ItemIDPair fishID = enumerator.Current;
                            if (itemList.Exists((Predicate <StuffItem>)(x => x.CategoryID == fishID.CategoryID && x.ID == fishID.ItemID && 0 < x.Count)))
                            {
                                return(true);
                            }
                        }
                        break;
                    }
                }
                else
                {
                    break;
                }

            case Tutorial.ActionType.WaitAtBase:
                return(true);

            case Tutorial.ActionType.GrilledFishRequest:
                if (Singleton <Manager.Map> .IsInstance() && Singleton <Resources> .IsInstance() && Manager.Map.GetTutorialProgress() == 13)
                {
                    List <StuffItem>             itemList      = Singleton <Manager.Map> .Instance?.Player?.PlayerData?.ItemList;
                    FishingDefinePack.ItemIDPair?grilledFishID = Singleton <Resources> .Instance?.FishingDefinePack?.IDInfo?.GrilledFish;
                    return(!itemList.IsNullOrEmpty <StuffItem>() && grilledFishID.HasValue && itemList.Exists((Predicate <StuffItem>)(x => x.CategoryID == grilledFishID.Value.CategoryID && x.ID == grilledFishID.Value.ItemID && 0 < x.Count)));
                }
                break;
            }
            return(false);
        }