Exemple #1
0
 private void OnStart(PlayerActor player)
 {
     MapUIContainer.RefreshCommands(0, player.SleepCommandInfos);
     MapUIContainer.CommandList.CancelEvent = (System.Action)(() =>
     {
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
         ActorAnimInfo animInfo = player.Animation.AnimInfo;
         player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
         player.Animation.RecoveryPoint   = (Transform)null;
         player.Animation.RefsActAnimInfo = true;
         player.Controller.ChangeState("Normal");
         player.ReleaseCurrentPoint();
         if (Object.op_Inequality((Object)player.PlayerController.CommandArea, (Object)null))
         {
             ((Behaviour)player.PlayerController.CommandArea).set_enabled(true);
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
         player.ActivateNavMeshAgent();
         player.IsKinematic = false;
         MapUIContainer.SetActiveCommandList(false);
     });
     MapUIContainer.SetActiveCommandList(true, "睡眠");
     this._onEndActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(__ =>
     {
         Dictionary <int, Dictionary <int, Dictionary <int, PlayState> > > playerActionAnimTable = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable;
         PoseKeyPair wakeupPoseId = Singleton <Resources> .Instance.PlayerProfile.PoseIDData.WakeupPoseID;
         PlayState info           = playerActionAnimTable[(int)player.ChaControl.sex][wakeupPoseId.postureID][wakeupPoseId.poseID];
         player.Animation.StopAllAnimCoroutine();
         player.Animation.InitializeStates(info);
         player.ActivateNavMeshAgent();
         player.IsKinematic     = false;
         ActorAnimInfo animInfo = player.Animation.AnimInfo;
         player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, 0);
         player.Animation.PlayInAnimation(info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.MainStateInfo.FadeOutTime, info.Layer);
         player.CameraControl.Mode = CameraMode.Normal;
         player.CameraControl.RecoverShotType();
         player.CameraControl.EnabledInput = true;
     }));
     this._onEndInAnimDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnim, 1), (System.Action <M0>)(__ =>
     {
         ActorAnimInfo animInfo = player.Animation.AnimInfo;
         player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
         player.Animation.RefsActAnimInfo = true;
         player.Controller.ChangeState("Normal");
         player.ReleaseCurrentPoint();
         if (Object.op_Inequality((Object)player.PlayerController.CommandArea, (Object)null))
         {
             ((Behaviour)player.PlayerController.CommandArea).set_enabled(true);
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
     }));
 }
Exemple #2
0
        private bool TryGetWakeUpAnimState(
            int personalID,
            out PoseKeyPair pose,
            out PlayState playState)
        {
            AgentProfile agentProfile = Singleton <Resources> .Instance.AgentProfile;

            if (!agentProfile.TutorialWakeUpPoseTable.TryGetValue(personalID, out pose) && !agentProfile.TutorialWakeUpPoseTable.TryGetValue(0, out pose))
            {
                playState = (PlayState)null;
                return(false);
            }
            Dictionary <int, PlayState> dictionary;

            if (Singleton <Resources> .Instance.Animation.AgentActionAnimTable.TryGetValue(pose.postureID, out dictionary) && dictionary.TryGetValue(pose.poseID, out playState))
            {
                return(true);
            }
            playState = (PlayState)null;
            return(false);
        }
Exemple #3
0
 private void StartEventSeq(PlayerActor player)
 {
     if (Object.op_Inequality((Object)this._agent, (Object)null))
     {
         DevicePoint devicePoint = player.CurrentDevicePoint;
         AgentData   agentData   = Singleton <Game> .Instance.WorldData.AgentTable[devicePoint.ID];
         AgentActor  agent       = this._agent;
         if (agentData.PlayEnterScene)
         {
             return;
         }
         agentData.PlayEnterScene = true;
         int           personality    = agent.ChaControl.fileParam.personality;
         PoseKeyPair   appearId       = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.AppearIDList[personality];
         PlayState     playState      = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[appearId.postureID][appearId.poseID];
         ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
         {
             layer          = playState.Layer,
             inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
             inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
             outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
             outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
             directionType  = playState.DirectionType,
             endEnableBlend = playState.EndEnableBlend,
             endBlendSec    = playState.EndBlendRate
         };
         agent.Animation.AnimInfo = actorAnimInfo1;
         ActorAnimInfo   actorAnimInfo2  = actorAnimInfo1;
         AssetBundleInfo assetBundleInfo = playState.MainStateInfo.AssetBundleInfo;
         agent.ChangeAnimator((string)assetBundleInfo.assetbundle, (string)assetBundleInfo.asset);
         float  shapeBodyValue      = agent.ChaControl.GetShapeBodyValue(0);
         string heightParameterName = Singleton <Resources> .Instance.DefinePack.AnimatorParameter.HeightParameterName;
         agent.Animation.Animator.SetFloat(heightParameterName, shapeBodyValue);
         this._locator.SetFloat(heightParameterName, shapeBodyValue);
         agent.Animation.LoadEventKeyTable(appearId.postureID, appearId.poseID);
         agent.LoadEventItems(playState);
         agent.LoadEventParticles(appearId.postureID, appearId.poseID);
         agent.Animation.InitializeStates(playState.MainStateInfo.InStateInfo.StateInfos, playState.MainStateInfo.OutStateInfo.StateInfos, playState.MainStateInfo.AssetBundleInfo);
         Transform basePoint = devicePoint.PivotPoint;
         agent.Position = basePoint.get_position();
         agent.Rotation = basePoint.get_rotation();
         agent.Animation.PlayInLocoAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, actorAnimInfo2.layer);
         devicePoint.PlayInAnimation();
         this._locator.set_speed(1f);
         this.PlayCameraAnimation(this._locator, personality);
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(__ =>
         {
             this.packData.Init();
             this.openData.FindLoad("0", agent.AgentData.param.charaID, 6);
             this.packData.SetParam((IParams)agent.AgentData, (IParams)player.PlayerData);
             this.packData.onComplete = (System.Action)(() =>
             {
                 if (agent.IsEvent)
                 {
                     agent.IsEvent = false;
                 }
                 if (!Manager.Config.GraphicData.CharasEntry[agent.ID])
                 {
                     this.packData.Release();
                     Singleton <Manager.ADV> .Instance.Captions.EndADV((System.Action)null);
                     devicePoint.PlayOutAnimation();
                     this.PlayCloseSE(player, basePoint);
                     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)0, 1f, true), (System.Action <M0>)(_ => {}), (System.Action)(() =>
                     {
                         Singleton <Manager.Map> .Instance.RemoveAgent(agent);
                         agent = (AgentActor)null;
                         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)1, 1f, true), (System.Action <M0>)(_ => {}), (System.Action)(() => this.Elapsed(player)));
                     }));
                 }
                 else
                 {
                     this.packData.Release();
                     Singleton <Manager.ADV> .Instance.Captions.EndADV((System.Action)null);
                     this.Elapsed(player);
                     devicePoint.PlayOutAnimation();
                     this.PlayCloseSE(player, basePoint);
                 }
             });
             Singleton <MapUIContainer> .Instance.OpenADV(this.openData, (IPack)this.packData);
         }));
     }
     else
     {
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(__ =>
         {
             player.CurrentDevicePoint = (DevicePoint)null;
             player.PlayerController.CommandArea.UpdateCollision(player);
             player.Controller.ChangeState("Normal");
         }));
     }
 }
Exemple #4
0
 protected override void OnAwake(PlayerActor player)
 {
     player.EventKey = (EventType)0;
     player.SetActiveOnEquipedItem(false);
     player.ChaControl.setAllLayerWeight(0.0f);
     if (player.PlayerController.PrevStateName != "Onbu")
     {
         Resources   instance   = Singleton <Resources> .Instance;
         PoseKeyPair menuPoseId = instance.PlayerProfile.PoseIDData.MenuPoseID;
         PlayState   playState  = instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][menuPoseId.postureID][menuPoseId.poseID];
         player.Animation.LoadEventKeyTable(menuPoseId.postureID, menuPoseId.poseID);
         if (player.ChaControl.visibleAll)
         {
             player.LoadEventItems(playState);
             player.LoadEventParticles(menuPoseId.postureID, menuPoseId.poseID);
         }
         player.Animation.InitializeStates(playState);
         ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
         {
             layer          = playState.Layer,
             inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
             inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
             outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
             outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
             directionType  = playState.DirectionType,
             isLoop         = playState.MainStateInfo.IsLoop,
             endEnableBlend = playState.EndEnableBlend,
             endBlendSec    = playState.EndBlendRate
         };
         player.Animation.AnimInfo = actorAnimInfo;
         ActorAnimInfo animInfo = actorAnimInfo;
         player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
         if (player.OldEnabledHoldingHand)
         {
             ((Behaviour)player.HandsHolder).set_enabled(false);
             if (player.HandsHolder.EnabledHolding)
             {
                 player.HandsHolder.EnabledHolding = false;
             }
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
         player.Animation.StopAllAnimCoroutine();
         player.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.layer);
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndMenu, 1), (Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
         this._onEndOutAnimDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndOutAnimation, 1), (Action <M0>)(_ =>
         {
             if (this._onEndInputDisposable != null)
             {
                 this._onEndInputDisposable.Dispose();
             }
             this.EndState(player);
         }));
     }
     ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnimation, 1), (Action <M0>)(_ => MapUIContainer.SetActiveSystemMenuUI(true)));
     this._onEndInputDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInput, 1), (Action <M0>)(_ =>
     {
         if (this._onEndOutAnimDisposable != null)
         {
             this._onEndOutAnimDisposable.Dispose();
         }
         this.EndState(player);
     }));
 }
Exemple #5
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = (EventType)0;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            Resources   instance   = Singleton <Resources> .Instance;
            PoseKeyPair leftPoseId = instance.PlayerProfile.PoseIDData.LeftPoseID;
            PlayState   info       = instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][leftPoseId.postureID][leftPoseId.poseID];

            player.Animation.InitializeStates(info);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = info.Layer,
                inEnableBlend  = info.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = info.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = info.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = info.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = info.DirectionType,
                isLoop         = info.MainStateInfo.IsLoop,
                endEnableBlend = info.EndEnableBlend,
                endBlendSec    = info.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;

            this._hasAction = info.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = info.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(info.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = info.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            bool enabled = ((Behaviour)player.HandsHolder).get_enabled();

            player.OldEnabledHoldingHand = enabled;
            if (enabled)
            {
                ((Behaviour)player.HandsHolder).set_enabled(false);
                if (player.HandsHolder.EnabledHolding)
                {
                    player.HandsHolder.EnabledHolding = false;
                }
            }
            player.Animation.StopAllAnimCoroutine();
            player.Animation.PlayInLocoAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, actorAnimInfo2.layer);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInput, 1), (Action <M0>)(__ =>
            {
                player.CameraControl.CrossFade.FadeStart(-1f);
                if (player.Animation.PlayingInLocoAnimation)
                {
                    player.Animation.StopInLocoAnimCoroutine();
                }
                if (player.Animation.PlayingActAnimation)
                {
                    player.Animation.StopActionAnimCoroutine();
                }
                player.CameraControl.Mode = CameraMode.Normal;
                player.Controller.ChangeState("Normal");
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
            }));
        }
 protected override void OnAwake(PlayerActor player)
 {
     this._eventPoint = player.CurrentEventPoint;
     if (Object.op_Equality((Object)this._eventPoint, (Object)null))
     {
         this.ErrorEnd(player, "イベントポイント持っていないのにバルブ扉を開こうとした");
     }
     else
     {
         if (Object.op_Equality((Object)this._eventPoint, (Object)EventPoint.GetTargetPoint()))
         {
             EventPoint.SetTargetID(-1, -1);
         }
         HarborDoorAnimation component = (HarborDoorAnimation)((Component)this._eventPoint).GetComponent <HarborDoorAnimation>();
         if (Object.op_Equality((Object)component, (Object)null))
         {
             this.ErrorEnd(player, "イベントポイントからHarborDoorAnimationが取得できなかった");
         }
         else
         {
             this._prevAcceptionState = MapUIContainer.CommandLabel.Acception;
             if (this._prevAcceptionState != CommandLabel.AcceptionState.None)
             {
                 MapUIContainer.CommandLabel.Acception = CommandLabel.AcceptionState.None;
             }
             this._animData  = component.AnimData;
             player.EventKey = EventType.DoorOpen;
             this._poseInfo  = component.PoseInfo;
             player.SetActiveOnEquipedItem(false);
             player.ChaControl.setAllLayerWeight(0.0f);
             Transform t = component.BasePoint ?? ((Component)this._eventPoint).get_transform();
             player.Animation.RecoveryPoint = component.RecoveryPoint;
             int sex       = (int)player.ChaControl.sex;
             int postureId = this._poseInfo.postureID;
             int poseId    = this._poseInfo.poseID;
             this._info = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[sex][postureId][poseId];
             ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
             {
                 layer          = this._info.Layer,
                 inEnableBlend  = this._info.MainStateInfo.InStateInfo.EnableFade,
                 inBlendSec     = this._info.MainStateInfo.InStateInfo.FadeSecond,
                 outEnableBlend = this._info.MainStateInfo.OutStateInfo.EnableFade,
                 outBlendSec    = this._info.MainStateInfo.OutStateInfo.FadeSecond,
                 directionType  = this._info.DirectionType,
                 endEnableBlend = this._info.EndEnableBlend,
                 endBlendSec    = this._info.EndBlendRate
             };
             player.Animation.AnimInfo = actorAnimInfo;
             ActorAnimInfo animInfo = actorAnimInfo;
             player.Animation.LoadSEEventKeyTable(postureId, poseId);
             player.Animation.InitializeStates(this._info.MainStateInfo.InStateInfo.StateInfos, this._info.MainStateInfo.OutStateInfo.StateInfos, this._info.MainStateInfo.AssetBundleInfo);
             player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, this._info.MainStateInfo.FadeOutTime, animInfo.layer);
             ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
             player.DeactivateNavMeshAgent();
             player.IsKinematic = true;
             player.SetStand(t, this._info.MainStateInfo.InStateInfo.EnableFade, this._info.MainStateInfo.InStateInfo.FadeSecond, this._info.DirectionType);
             if (Object.op_Inequality((Object)this._animData, (Object)null))
             {
                 this._animData.AnimEndAction = (Action)(() => this._animData.PlayOpenIdleAnimation(false, 0.0f, 0.0f, 0));
                 this._animData.PlayToOpenAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, this._info.MainStateInfo.FadeOutTime, animInfo.layer);
             }
             ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onComplete, 1), (Action <M0>)(_ =>
             {
                 if (this._animData is AreaOpenLinkedHarborDoorAnimData)
                 {
                     Singleton <Manager.Map> .Instance.SetOpenAreaState((this._animData as AreaOpenLinkedHarborDoorAnimData).AreaOpenID, true);
                 }
                 if (this._eventPoint.GroupID == 1)
                 {
                     switch (this._eventPoint.PointID)
                     {
                     case 2:
                         Manager.Map.ForcedSetTutorialProgress(26);
                         break;
                     }
                 }
                 if (this._prevAcceptionState != MapUIContainer.CommandLabel.Acception)
                 {
                     MapUIContainer.CommandLabel.Acception = this._prevAcceptionState;
                 }
                 player.ActivateNavMeshAgent();
                 player.PlayerController.ChangeState("Normal");
             }));
             player.CameraControl.Mode = CameraMode.ActionFreeLook;
             player.CameraControl.SetShotTypeForce(ShotType.Near);
             player.CameraControl.LoadActionCameraFile(postureId, poseId, (Transform)null);
             player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
             if (player.OldEnabledHoldingHand)
             {
                 ((Behaviour)player.HandsHolder).set_enabled(false);
                 player.HandsHolder.Weight = 0.0f;
                 if (player.HandsHolder.EnabledHolding)
                 {
                     player.HandsHolder.EnabledHolding = false;
                 }
             }
             this._initSuccess = true;
         }
     }
 }
Exemple #7
0
        private void ChangeModeRelatedSleep(PlayerActor player)
        {
            PoseKeyPair        sleepTogetherRight = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.SleepTogetherRight;
            PoseKeyPair        sleepTogetherLeft  = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.SleepTogetherLeft;
            List <ActionPoint> groupActionPoints  = player.CurrentPoint.GroupActionPoints;
            ActionPoint        actionPoint1       = (ActionPoint)null;

            foreach (ActionPoint actionPoint2 in groupActionPoints)
            {
                if (actionPoint2.IsNeutralCommand)
                {
                    actionPoint1 = actionPoint2;
                    break;
                }
            }
            bool            flag    = false;
            ActionPointInfo outInfo = new ActionPointInfo();

            if (Object.op_Inequality((Object)actionPoint1, (Object)null))
            {
                flag = actionPoint1.FindAgentActionPointInfo(AIProject.EventType.Sleep, sleepTogetherRight.poseID, out outInfo) || actionPoint1.FindAgentActionPointInfo(AIProject.EventType.Sleep, sleepTogetherLeft.poseID, out outInfo);
            }
            List <AgentActor> agentActorList1 = ListPool <AgentActor> .Get();

            List <AgentActor> agentActorList2 = ListPool <AgentActor> .Get();

            using (IEnumerator <KeyValuePair <int, AgentActor> > enumerator = Singleton <Manager.Map> .Instance.AgentTable.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <int, AgentActor> current = enumerator.Current;
                    if (current.Value.Mode != Desire.ActionType.Cold2A && current.Value.Mode != Desire.ActionType.Cold2B && (current.Value.Mode != Desire.ActionType.Cold3A && current.Value.Mode != Desire.ActionType.Cold3B) && (current.Value.Mode != Desire.ActionType.OverworkA && current.Value.Mode != Desire.ActionType.OverworkB && (current.Value.Mode != Desire.ActionType.Cold2BMedicated && current.Value.Mode != Desire.ActionType.Cold3BMedicated)) && (current.Value.Mode != Desire.ActionType.WeaknessA && current.Value.Mode != Desire.ActionType.WeaknessB && (current.Value.Mode != Desire.ActionType.FoundPeeping && current.Value.EventKey != AIProject.EventType.Sleep) && (current.Value.EventKey != AIProject.EventType.Toilet && current.Value.EventKey != AIProject.EventType.Bath && (current.Value.EventKey != AIProject.EventType.Move && current.Value.EventKey != AIProject.EventType.Masturbation))) && current.Value.EventKey != AIProject.EventType.Lesbian)
                    {
                        MapArea mapArea = current.Value.MapArea;
                        int?    nullable1;
                        int?    nullable2;
                        if (mapArea == null)
                        {
                            nullable1 = new int?();
                            nullable2 = nullable1;
                        }
                        else
                        {
                            nullable2 = new int?(mapArea.ChunkID);
                        }
                        nullable1 = nullable2;
                        int num = !nullable1.HasValue ? current.Value.AgentData.ChunkID : nullable1.Value;
                        if (player.ChunkID == num)
                        {
                            if (Game.isAdd01 && current.Value.ChaControl.fileGameInfo.hSkill.ContainsValue(13))
                            {
                                agentActorList1.Add(current.Value);
                            }
                            else if (flag && current.Value.ChaControl.fileGameInfo.flavorState[1] >= Singleton <Resources> .Instance.StatusProfile.SoineReliabilityBorder && (current.Value.Mode == Desire.ActionType.Normal || current.Value.Mode == Desire.ActionType.SearchSleep || current.Value.Mode == Desire.ActionType.Encounter))
                            {
                                agentActorList2.Add(current.Value);
                            }
                        }
                    }
                }
            }
            AgentActor element1 = agentActorList1.GetElement <AgentActor>(Random.Range(0, agentActorList1.Count));

            ListPool <AgentActor> .Release(agentActorList1);

            AgentActor element2 = agentActorList2.GetElement <AgentActor>(Random.Range(0, agentActorList2.Count));

            ListPool <AgentActor> .Release(agentActorList2);

            if (Object.op_Inequality((Object)element1, (Object)null))
            {
                element1.Animation.ResetDefaultAnimatorController();
                element1.TargetInSightActionPoint = (ActionPoint)null;
                element1.TargetInSightActor       = (Actor)player;
                this.ChangeForceBehavior(element1, Desire.ActionType.ChaseYobai);
            }
            else
            {
                if (!Object.op_Inequality((Object)element2, (Object)null))
                {
                    return;
                }
                element2.Animation.ResetDefaultAnimatorController();
                actionPoint1.Reserver             = (Actor)element2;
                element2.TargetInSightActionPoint = actionPoint1;
                element2.TargetInSightActor       = (Actor)null;
                this.ChangeForceBehavior(element2, Desire.ActionType.ComeSleepTogether);
            }
        }