Exemplo n.º 1
0
        protected override void OnAwake(PlayerActor player)
        {
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            DateActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, EventType.Lesbian, out outInfo);
            player.HPoseID = outInfo.poseIDA;
            MapUIContainer.RefreshCommands(0, player.SpecialHCommandInfo);
            MapUIContainer.CommandList.CancelEvent = (Action)(() =>
            {
                Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
                MapUIContainer.SetActiveCommandList(false);
                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(true, "特殊エッチ");
        }
Exemplo n.º 2
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = EventType.Eat;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            MapUIContainer.RefreshCommands(0, player.ExitEatEventCommandInfo);
            MapUIContainer.SetActiveCommandList(true, "食事");
            MapUIContainer.CommandList.CancelEvent = (Action)null;
            player.OldEnabledHoldingHand           = ((Behaviour)player.HandsHolder).get_enabled();
            if (!player.OldEnabledHoldingHand)
            {
                return;
            }
            ((Behaviour)player.HandsHolder).set_enabled(false);
            if (!player.HandsHolder.EnabledHolding)
            {
                return;
            }
            player.HandsHolder.EnabledHolding = false;
        }
Exemplo n.º 3
0
        protected override void OnAwake(PlayerActor player)
        {
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            MapUIContainer.SetVisibleHUDExceptStoryUI(false);
            MapUIContainer.StorySupportUI.Close();
            MapUIContainer.RefreshCommands(0, player.WarpCommandInfos);
            MapUIContainer.CommandList.CancelEvent = (Action)(() => player.CancelWarp());
            MapUIContainer.SetActiveCommandList(true, "ワープ");
        }
Exemplo n.º 4
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);
     }));
 }
        public static void RefreshSheets()
        {
            List <ADMSheet>  sheets     = new List <ADMSheet>();
            PlayerActor      player     = Map.Instance.Player;
            PlayerController controller = player.PlayerController;

            DevicePoint[] devices = Object.FindObjectsOfType <DevicePoint>();

            if (devices != null && devices.Length > 0)
            {
                DevicePoint device = devices.FirstOrDefault(v => v.ID == 0);

                if (device != null)
                {
                    sheets.Add(new ADMSheet("数据终端", () =>
                    {
                        MapUIContainer.SystemMenuUI.IsActiveControl = false;

                        Manager.Resources.Instance.SoundPack.Play(SoundPack.SystemSE.BootDevice);
                        MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);

                        player.CurrentDevicePoint = device;

                        MapUIContainer.RefreshCommands(0, player.DeviceCommandInfos);
                        MapUIContainer.SetActiveCommandList(true, "データ端末");
                        controller.ChangeState("DeviceMenu");
                    }));
                }
            }

            sheets.Add(MakeSheet(controller, /*"Item Box"*/ "物品箱", "ItemBox", MapUIContainer.ItemBoxUI));
            sheets.Add(MakeSheet(controller, /*"Bathing Outfits"*/ "更衣处", "DressRoom", MapUIContainer.DressRoomUI));
            sheets.Add(MakeSheet(controller, /*"Closet Outfits"*/ "服装棚", "ClothChange", MapUIContainer.ClosetUI));
            sheets.Add(MakeSheet(controller, /*"Shan's Shop"*/ "商店", null, MapUIContainer.ShopUI, true));

            sheets.Add(new ADMSheet(/*"Kitchen"*/ "灶台", () =>
            {
                MapUIContainer.SystemMenuUI.IsActiveControl = false;

                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                MapUIContainer.RefreshCommands(0, player.CookCommandInfos);
                MapUIContainer.SetActiveCommandList(true, "料理");
                controller.ChangeState("Kitchen");
            }));

            sheets.Add(MakeSheet(controller, /*"Pet Synthesis"*/ "宠物合成", "Craft", MapUIContainer.PetCraftUI, true));
            sheets.Add(MakeSheet(controller, /*"Medicine Table"*/ "制药台", "Craft", MapUIContainer.MedicineCraftUI, true));
            sheets.Add(MakeSheet(controller, /*"Jukebox"*/ "更改BGM", null, MapUIContainer.JukeBoxUI, true));

            sheet.SetSheets(sheets);
        }
Exemplo n.º 6
0
 private void OnStart(PlayerActor player)
 {
     Singleton <Manager.Map> .Instance.AccessDeviceID = player.CurrentDevicePoint.ID;
     MapUIContainer.RefreshCommands(0, player.DeviceCommandInfos);
     MapUIContainer.CommandList.CancelEvent = (Action)(() =>
     {
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
         Singleton <Manager.Map> .Instance.AccessDeviceID = -1;
         MapUIContainer.SetActiveCommandList(false);
         MapUIContainer.SetVisibleHUDExceptStoryUI(true);
         MapUIContainer.StorySupportUI.Open();
         player.Controller.ChangeState("Normal");
         player.CurrentDevicePoint = (DevicePoint)null;
     });
     MapUIContainer.SetActiveCommandList(true, "データ端末");
 }
Exemplo n.º 7
0
            static void OpenDeviceMenu()
            {
                DevicePoint[] devices = FindObjectsOfType <DevicePoint>();
                DevicePoint   device  = devices?.FirstOrDefault(v => v.ID == 0);

                if (device != null)
                {
                    PlayerActor player = Map.Instance.Player;
                    player.CurrentDevicePoint = device;

                    Resources.Instance.SoundPack.Play(SoundPack.SystemSE.BootDevice);
                    MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                    MapUIContainer.RefreshCommands(0, player.DeviceCommandInfos);
                    MapUIContainer.SetActiveCommandList(true, "データ端末");
                    player.PlayerController.ChangeState("DeviceMenu");
                }
            }
Exemplo n.º 8
0
        protected override void OnAwake(PlayerActor player)
        {
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            MapUIContainer.SetVisibleHUDExceptStoryUI(false);
            MapUIContainer.StorySupportUI.Close();
            MapUIContainer.RefreshCommands(0, player.BaseCommandInfos);
            MapUIContainer.CommandList.CancelEvent = (Action)(() =>
            {
                MapUIContainer.SetActiveCommandList(false);
                MapUIContainer.SetVisibleHUDExceptStoryUI(true);
                MapUIContainer.StorySupportUI.Open();
                player.Controller.ChangeState("Normal");
            });
            MapUIContainer.SetActiveCommandList(true, "拠点");
        }
Exemplo n.º 9
0
        public virtual TaskStatus OnUpdate()
        {
            AgentActor agent = this.Agent;

            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)0, 1f, true), (System.Action <M0>)(_ => {}), (System.Action)(() =>
            {
                Singleton <Manager.Map> .Instance.Player.PlayerController.ChangeState("Sex");
                Singleton <Manager.Map> .Instance.Player.StartSneakH(agent);
            }));
            agent.ChangeBehavior(Desire.ActionType.Idle);
            Singleton <Manager.Map> .Instance.Player.PlayerController.ChangeState("Idle");

            MapUIContainer.SetActiveCommandList(false);
            Singleton <Manager.Map> .Instance.Player.SetScheduledInteractionState(false);

            Singleton <Manager.Map> .Instance.Player.ReleaseInteraction();

            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            return((TaskStatus)2);
        }
Exemplo n.º 10
0
        protected override void OnAwake(PlayerActor player)
        {
            this._currentFarmPoint = player.CurrentFarmPoint;
            if (Object.op_Equality((Object)this._currentFarmPoint, (Object)null))
            {
                player.PlayerController.ChangeState("Normal");
            }
            else
            {
                this._input = Singleton <Input> .Instance;
                Input.ValidType state = this._input.State;
                this._input.ReserveState(Input.ValidType.UI);
                this._input.SetupState();
                this._input.ReserveState(state);
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                MapUIContainer.SetVisibleHUD(false);
                int registerId = this._currentFarmPoint.RegisterID;
                List <AIProject.SaveData.Environment.ChickenInfo> chickenInfoList1 = (List <AIProject.SaveData.Environment.ChickenInfo>)null;
                Dictionary <int, List <AIProject.SaveData.Environment.ChickenInfo> > dictionary = !Singleton <Game> .IsInstance() ? (Dictionary <int, List <AIProject.SaveData.Environment.ChickenInfo> >)null : Singleton <Game> .Instance.Environment?.ChickenTable;

                if (dictionary != null && (!dictionary.TryGetValue(registerId, out chickenInfoList1) || chickenInfoList1 == null))
                {
                    List <AIProject.SaveData.Environment.ChickenInfo> chickenInfoList2 = new List <AIProject.SaveData.Environment.ChickenInfo>();
                    dictionary[registerId] = chickenInfoList2;
                    chickenInfoList1       = chickenInfoList2;
                }
                if (chickenInfoList1 == null)
                {
                    chickenInfoList1 = new List <AIProject.SaveData.Environment.ChickenInfo>();
                }
                MapUIContainer.ChickenCoopUI.currentChickens = chickenInfoList1;
                MapUIContainer.ChickenCoopUI.ClosedEvent     = (Action)(() => MapUIContainer.CommandList.Visibled = true);
                MapUIContainer.RefreshCommands(0, player.ChickenCoopCommandInfos);
                MapUIContainer.CommandList.CancelEvent = (Action)(() =>
                {
                    MapUIContainer.SetActiveCommandList(false);
                    player.PlayerController.ChangeState("Normal");
                });
                MapUIContainer.SetActiveCommandList(true, "鶏小屋");
            }
        }
Exemplo n.º 11
0
 private void OnStart(PlayerActor player)
 {
     MapUIContainer.RefreshCommands(0, player.CookCommandInfos);
     MapUIContainer.CommandList.CancelEvent = (Action)(() =>
     {
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
         MapUIContainer.SetActiveCommandList(false);
         MapUIContainer.SetVisibleHUDExceptStoryUI(true);
         MapUIContainer.StorySupportUI.Open();
         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(true, "料理");
 }
Exemplo n.º 12
0
        public void HousingHEnter(Actor actor, HPoint hpoint)
        {
            this._isH            = true;
            this.IsHousingHEnter = true;
            MapUIContainer.SetActiveCommandList(false);
            this.choiceDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)MapUIContainer.CommandList.OnCompletedStopAsObservable(), 1), (System.Action <M0>)(_ => MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None)));
            Singleton <MapUIContainer> .Instance.MinimapUI.MiniMap.SetActive(false);

            Singleton <MapUIContainer> .Instance.MinimapUI.MiniMapIcon.SetActive(false);

            Singleton <Map> .Instance.SetActiveMapEffect(false);

            if (Object.op_Equality((Object)this.HSceneSet, (Object)null))
            {
                this.HSceneSet = Singleton <Resources> .Instance.HSceneTable.HSceneSet;
            }
            if (Object.op_Equality((Object)this.HSceneUISet, (Object)null))
            {
                this.HSceneUISet = Singleton <Resources> .Instance.HSceneTable.HSceneUISet;
            }
            this.Player = Singleton <Map> .Instance.Player;
            ((Behaviour)this.Player).set_enabled(false);
            this.handsIK = ((Behaviour)this.Player.HandsHolder).get_enabled();
            if (this.handsIK)
            {
                ((Behaviour)this.Player.HandsHolder).set_enabled(false);
            }
            this.Player.SetActiveOnEquipedItem(false);
            this.Player.ChaControl.setAllLayerWeight(0.0f);
            this.Agent[0] = (AgentActor)((Component)actor).GetComponent <AgentActor>();
            this.Agent[0].BehaviorResources.ChangeMode(Desire.ActionType.Idle);
            this.Agent[0].DisableBehavior();
            this.Agent[0].AnimationAgent.DisableItems();
            ((Behaviour)this.Agent[0].Controller).set_enabled(false);
            ((Behaviour)this.Agent[0].AnimationAgent).set_enabled(false);
            this.PersonalPhase[0] = this.Agent[0].ChaControl.fileGameInfo.phase;
            this.Personality[0]   = this.Agent[0].ChaControl.chaFile.parameter.personality;
            this.Agent[0].SetActiveOnEquipedItem(false);
            this.Agent[0].ChaControl.setAllLayerWeight(0.0f);
            this.HSkil               = this.Agent[0].ChaControl.fileGameInfo.hSkill;
            this.isCtrl              = false;
            this.endStatus           = (byte)0;
            AnimalBase.CreateDisplay = false;
            AnimalManager instance = Singleton <AnimalManager> .Instance;

            for (int index1 = 0; index1 < instance.Animals.Count; ++index1)
            {
                int index2 = index1;
                instance.Animals[index2].BodyEnabled = false;
                ((Behaviour)instance.Animals[index2]).set_enabled(false);
            }
            instance.ClearAnimalPointBehavior();
            if (!this.bMerchant)
            {
                this.Temperature = this.Agent[0].AgentData.StatsTable[0];
                this.Mood[0]     = this.Agent[0].AgentData.StatsTable[1];
                this.Mood[1]     = !Object.op_Implicit((Object)this.Agent[1]) ? 0.0f : this.Agent[1].AgentData.StatsTable[1];
                if ((double)this.Mood[0] < (double)this.Agent[0].ChaControl.fileGameInfo.moodBound.lower)
                {
                    this.isForce = true;
                }
                this.Toilet         = this.Agent[0].AgentData.DesireTable[Desire.GetDesireKey(Desire.Type.Toilet)];
                this.Bath           = this.Agent[0].AgentData.DesireTable[Desire.GetDesireKey(Desire.Type.Bath)];
                this.Reliability    = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Reliability);
                this.Instinct       = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Instinct);
                this.Dirty          = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Dirty);
                this.RiskManagement = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Wariness);
                this.Darkness       = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Darkness);
                this.Sociability    = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Sociability);
                this.Pheromone      = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Pheromone);
                this.isHAddTaii     = new bool[2]
                {
                    this.Agent[0].ChaControl.fileGameInfo.isHAddTaii0,
                    this.Agent[0].ChaControl.fileGameInfo.isHAddTaii1
                };
            }
            this.Player.Controller.ChangeState("Sex");
            this.ReturnActionTypes.Clear();
            this.EventKind = HSceneManager.HEvent.Normal;
            if (this.EventKind == HSceneManager.HEvent.Back)
            {
                Singleton <HSceneFlagCtrl> .Instance.AddParam(31, 1);
            }
            Singleton <Voice> .Instance.StopAll(true);

            this.height     = (int)hpoint._nPlace[0].Item1;
            this.enterPoint = hpoint;
            this.StartCoroutine(this.HsceneInit(this.Agent));
        }
Exemplo n.º 13
0
        public void HsceneEnter(
            Actor actor,
            int isMerchantLimitType        = -1,
            AgentActor agent2              = null,
            HSceneManager.HEvent _numEvent = HSceneManager.HEvent.Normal)
        {
            this._isH            = true;
            this.enterPoint      = (HPoint)null;
            this.IsHousingHEnter = false;
            MapUIContainer.SetActiveCommandList(false);
            this.choiceDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)MapUIContainer.CommandList.OnCompletedStopAsObservable(), 1), (System.Action <M0>)(_ => MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None)));
            Singleton <MapUIContainer> .Instance.MinimapUI.MiniMap.SetActive(false);

            Singleton <MapUIContainer> .Instance.MinimapUI.MiniMapIcon.SetActive(false);

            Singleton <Map> .Instance.SetActiveMapEffect(false);

            if (Object.op_Equality((Object)this.HSceneSet, (Object)null))
            {
                this.HSceneSet = Singleton <Resources> .Instance.HSceneTable.HSceneSet;
            }
            if (Object.op_Equality((Object)this.HSceneUISet, (Object)null))
            {
                this.HSceneUISet = Singleton <Resources> .Instance.HSceneTable.HSceneUISet;
            }
            this.Player = Singleton <Map> .Instance.Player;
            ((Behaviour)this.Player).set_enabled(false);
            this.handsIK = ((Behaviour)this.Player.HandsHolder).get_enabled();
            if (this.handsIK)
            {
                ((Behaviour)this.Player.HandsHolder).set_enabled(false);
            }
            this.Player.SetActiveOnEquipedItem(false);
            this.Player.ChaControl.setAllLayerWeight(0.0f);
            this.bMerchant           = Object.op_Inequality((Object)((Component)actor).GetComponent <MerchantActor>(), (Object)null);
            this.MerchantLimit       = isMerchantLimitType;
            this.FemaleLumpActive[0] = false;
            this.FemaleLumpActive[1] = false;
            if (!this.bMerchant)
            {
                this.Agent[0] = (AgentActor)((Component)actor).GetComponent <AgentActor>();
                this.Agent[0].BehaviorResources.ChangeMode(Desire.ActionType.Idle);
                this.Agent[0].DisableBehavior();
                this.Agent[0].AnimationAgent.DisableItems();
                ((Behaviour)this.Agent[0].Controller).set_enabled(false);
                ((Behaviour)this.Agent[0].AnimationAgent).set_enabled(false);
                this.PersonalPhase[0] = this.Agent[0].ChaControl.fileGameInfo.phase;
                this.Personality[0]   = this.Agent[0].ChaControl.chaFile.parameter.personality;
                if (Object.op_Inequality((Object)this.Agent[0].ChaControl.objExtraAccessory[3], (Object)null))
                {
                    this.FemaleLumpActive[0] = this.Agent[0].ChaControl.objExtraAccessory[3].get_activeSelf();
                    this.Agent[0].ChaControl.ShowExtraAccessory(ChaControlDefine.ExtraAccessoryParts.Waist, false);
                }
                this.Agent[0].SetActiveOnEquipedItem(false);
                this.Agent[0].ChaControl.setAllLayerWeight(0.0f);
                this.HSkil = this.Agent[0].ChaControl.fileGameInfo.hSkill;
            }
            else
            {
                this.merchantActor = (MerchantActor)((Component)actor).GetComponent <MerchantActor>();
                this.merchantActor.DisableBehavior();
                ((Behaviour)this.merchantActor.Controller).set_enabled(false);
                ((Behaviour)this.merchantActor.AnimationMerchant).set_enabled(false);
                this.PersonalPhase[0] = 3;
            }
            if (Object.op_Inequality((Object)agent2, (Object)null))
            {
                this.Agent[1] = agent2;
                this.Agent[1].BehaviorResources.ChangeMode(Desire.ActionType.Idle);
                this.Agent[1].DisableBehavior();
                this.Agent[1].AnimationAgent.DisableItems();
                ((Behaviour)this.Agent[1].Controller).set_enabled(false);
                ((Behaviour)this.Agent[1].AnimationAgent).set_enabled(false);
                this.PersonalPhase[1] = this.Agent[1].ChaControl.fileGameInfo.phase;
                this.Personality[1]   = this.Agent[1].ChaControl.chaFile.parameter.personality;
                if (Object.op_Inequality((Object)this.Agent[1].ChaControl.objExtraAccessory[3], (Object)null))
                {
                    this.FemaleLumpActive[1] = this.Agent[1].ChaControl.objExtraAccessory[3].get_activeSelf();
                    this.Agent[1].ChaControl.ShowExtraAccessory(ChaControlDefine.ExtraAccessoryParts.Waist, false);
                }
                this.Agent[1].SetActiveOnEquipedItem(false);
                this.Agent[1].ChaControl.setAllLayerWeight(0.0f);
            }
            this.isCtrl              = false;
            this.endStatus           = (byte)0;
            AnimalBase.CreateDisplay = false;
            AnimalManager instance = Singleton <AnimalManager> .Instance;

            for (int index1 = 0; index1 < instance.Animals.Count; ++index1)
            {
                int index2 = index1;
                instance.Animals[index2].BodyEnabled = false;
                ((Behaviour)instance.Animals[index2]).set_enabled(false);
            }
            instance.ClearAnimalPointBehavior();
            if (!this.bMerchant)
            {
                this.Temperature = this.Agent[0].AgentData.StatsTable[0];
                this.Mood[0]     = this.Agent[0].AgentData.StatsTable[1];
                this.Mood[1]     = !Object.op_Implicit((Object)this.Agent[1]) ? 0.0f : this.Agent[1].AgentData.StatsTable[1];
                if (this.ReserveToilet.HasValue)
                {
                    this.Toilet        = this.ReserveToilet.Value;
                    this.ReserveToilet = new float?();
                }
                else
                {
                    this.Toilet = this.Agent[0].AgentData.DesireTable[Desire.GetDesireKey(Desire.Type.Toilet)];
                }
                this.Bath           = this.Agent[0].AgentData.DesireTable[Desire.GetDesireKey(Desire.Type.Bath)];
                this.Reliability    = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Reliability);
                this.Instinct       = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Instinct);
                this.Dirty          = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Dirty);
                this.RiskManagement = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Wariness);
                this.Darkness       = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Darkness);
                this.Sociability    = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Sociability);
                this.Pheromone      = this.Agent[0].GetFlavorSkill(FlavorSkill.Type.Pheromone);
                this.isHAddTaii     = new bool[2]
                {
                    this.Agent[0].ChaControl.fileGameInfo.isHAddTaii0,
                    this.Agent[0].ChaControl.fileGameInfo.isHAddTaii1
                };
            }
            this.Player.Controller.ChangeState("Sex");
            this.ReturnActionTypes.Clear();
            this.EventKind = _numEvent;
            Singleton <Voice> .Instance.StopAll(true);

            if (!this.bMerchant)
            {
                this.StartCoroutine(this.HsceneInit(this.Agent));
            }
            else
            {
                this.StartCoroutine(this.HsceneInit(this.merchantActor, !Object.op_Inequality((Object)agent2, (Object)null) ? (AgentActor)null : this.Agent[1]));
            }
        }
Exemplo n.º 14
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Eat;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            Singleton <Manager.Input> .Instance.ReserveState(Manager.Input.ValidType.UI);

            Singleton <Manager.Input> .Instance.SetupState();

            ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds(1.0)), (System.Action <M0>)(_ =>
            {
                MapUIContainer.RefreshCommands(0, player.DateEatCommandInfos);
                MapUIContainer.SetActiveCommandList(true, "食事");
                MapUIContainer.CommandList.CancelEvent = (System.Action)null;
            }));
            int type = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.Eat].Item1;
            DateActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, AIProject.EventType.Eat, out outInfo);
            AgentActor partner = player.Partner as AgentActor;
            int        poseIda = outInfo.poseIDA;

            player.PoseID = poseIda;
            int index   = poseIda;
            int poseIdb = outInfo.poseIDB;

            partner.PoseID = poseIdb;
            int        poseIDB = poseIdb;
            Transform  t1      = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameA)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            Transform  t2      = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameB)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop1   = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameA);

            player.Animation.RecoveryPoint = loop1?.get_transform();
            GameObject loop2 = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameB);

            player.Partner.Animation.RecoveryPoint = loop2?.get_transform();
            PlayState playState1 = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][type][index];

            player.Animation.LoadEventKeyTable(type, outInfo.poseIDA);
            player.LoadEventItems(playState1);
            player.LoadEventParticles(type, outInfo.poseIDA);
            player.Animation.InitializeStates(playState1);
            partner.Animation.LoadEventKeyTable(type, outInfo.poseIDB);
            PlayState playState2 = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[type][outInfo.poseIDB];

            partner.LoadEventItems(playState2);
            partner.LoadEventParticles(type, outInfo.poseIDB);
            partner.Animation.InitializeStates(playState2);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = playState1.Layer,
                inEnableBlend  = playState1.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState1.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState1.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState1.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState1.DirectionType,
                isLoop         = playState1.MainStateInfo.IsLoop,
                endEnableBlend = playState1.EndEnableBlend,
                endBlendSec    = playState1.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo3 = new ActorAnimInfo()
            {
                layer          = playState2.Layer,
                inEnableBlend  = playState2.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState2.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState2.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState2.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState1.DirectionType,
                isLoop         = playState1.MainStateInfo.IsLoop,
                endEnableBlend = playState1.EndEnableBlend,
                endBlendSec    = playState1.EndBlendRate,
                loopMinTime    = playState2.MainStateInfo.LoopMin,
                loopMaxTime    = playState2.MainStateInfo.LoopMax,
                hasAction      = playState2.ActionInfo.hasAction
            };

            partner.Animation.AnimInfo = actorAnimInfo3;
            ActorAnimInfo actorAnimInfo4 = actorAnimInfo3;
            List <int>    intList        = ListPool <int> .Get();

            foreach (KeyValuePair <int, Dictionary <int, int> > foodDateEventItem in Singleton <Resources> .Instance.Map.FoodDateEventItemList)
            {
                foreach (KeyValuePair <int, int> keyValuePair in foodDateEventItem.Value)
                {
                    if (keyValuePair.Value != -1)
                    {
                        intList.Add(keyValuePair.Value);
                    }
                }
            }
            int num = -1;

            if (!intList.IsNullOrEmpty <int>())
            {
                num = intList.GetElement <int>(Random.Range(0, intList.Count));
            }
            ListPool <int> .Release(intList);

            ActionItemInfo eventItemInfo;

            if (Singleton <Resources> .Instance.Map.EventItemList.TryGetValue(num, out eventItemInfo))
            {
                string     rootParentName = Singleton <Resources> .Instance.LocomotionProfile.RootParentName;
                GameObject gameObject1    = player.LoadEventItem(num, rootParentName, false, eventItemInfo);
                if (Object.op_Inequality((Object)gameObject1, (Object)null))
                {
                    foreach (Renderer componentsInChild in (Renderer[])gameObject1.GetComponentsInChildren <Renderer>(true))
                    {
                        componentsInChild.set_enabled(true);
                    }
                }
                GameObject gameObject2 = partner.LoadEventItem(num, rootParentName, false, eventItemInfo);
                if (Object.op_Inequality((Object)gameObject2, (Object)null))
                {
                    foreach (Renderer componentsInChild in (Renderer[])gameObject2.GetComponentsInChildren <Renderer>(true))
                    {
                        componentsInChild.set_enabled(true);
                    }
                }
            }
            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            partner.SetActiveOnEquipedItem(false);
            partner.ChaControl.setAllLayerWeight(0.0f);
            partner.DeactivateNavMeshAgent();
            partner.IsKinematic = true;
            this._hasAction     = playState1.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = playState1.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(playState1.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = playState1.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            player.Animation.PlayInAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, playState1.MainStateInfo.FadeOutTime, actorAnimInfo2.layer);
            player.SetStand(t1, playState1.MainStateInfo.InStateInfo.EnableFade, playState1.MainStateInfo.InStateInfo.FadeSecond, playState1.DirectionType);
            partner.Animation.PlayInAnimation(actorAnimInfo4.inEnableBlend, actorAnimInfo4.inBlendSec, playState2.MainStateInfo.FadeOutTime, actorAnimInfo4.layer);
            partner.SetStand(t2, playState2.MainStateInfo.InStateInfo.EnableFade, playState2.MainStateInfo.InStateInfo.FadeSecond, actorAnimInfo4.layer);
            ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.Skip <long>((IObservable <M0>)Observable.EveryLateUpdate(), 1), 1), (System.Action <M0>)(_ => this.ChangeCamera(type, poseIDB, (Actor)partner)));
            player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
            if (!player.OldEnabledHoldingHand)
            {
                return;
            }
            ((Behaviour)player.HandsHolder).set_enabled(false);
            if (!player.HandsHolder.EnabledHolding)
            {
                return;
            }
            player.HandsHolder.EnabledHolding = false;
        }