public virtual TaskStatus OnUpdate() { Actor partner = this.Agent.Partner; this.Agent.Partner = (Actor)null; if (Object.op_Inequality((Object)partner, (Object)null)) { partner.Partner = (Actor)null; } if (this._changeToPartner) { switch (partner) { case AgentActor _: (partner as AgentActor).ChangeBehavior(Desire.ActionType.Normal); break; case MerchantActor _: MerchantActor merchantActor = partner as MerchantActor; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); break; } } this.Agent.TargetInSightActor = (Actor)null; return((TaskStatus)2); }
public void StartTalkSequence(Actor listener, int speakID, int listenID) { switch (listener) { case AgentActor _: IEnumerator enumerator1 = this._talkEnumerator = this.StartTalkSequenceCoroutine(listener, speakID, listenID); if (this._talkDisposable != null) { this._talkDisposable.Dispose(); } this._talkDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => enumerator1), false)); AgentActor agentActor = listener as AgentActor; agentActor.CommandPartner = this; agentActor.BehaviorResources.ChangeMode(Desire.ActionType.Idle); break; case MerchantActor _: IEnumerator enumerator2 = this._talkEnumerator = this.StartTalkSequenceCoroutine(listener, speakID, listenID); if (this._talkDisposable != null) { this._talkDisposable.Dispose(); } this._talkDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => enumerator2), false)); MerchantActor merchantActor = listener as MerchantActor; merchantActor.CommandPartner = this; merchantActor.ChangeBehavior(Merchant.ActionType.TalkWithAgent); break; } }
public virtual TaskStatus OnUpdate() { AgentActor agent = this.Agent; if (Object.op_Inequality((Object)agent.TargetInSightActionPoint, (Object)null)) { if (this._checkFollowType) { if (agent.TargetInSightActionPoint.AgentDateEventType.Contains(this._eventType)) { return((TaskStatus)2); } } else if (agent.TargetInSightActionPoint.AgentEventType.Contains(this._eventType)) { return((TaskStatus)2); } } if (Object.op_Equality((Object)this._destination, (Object)null)) { if (this._changeWarp) { agent.ChangeBehavior(Desire.ActionType.SearchWarpPoint); return((TaskStatus)2); } Actor partner = agent.Partner; if (Object.op_Inequality((Object)partner, (Object)null)) { agent.Partner = (Actor)null; partner.Partner = (Actor)null; if (partner is AgentActor) { (partner as AgentActor).BehaviorResources.ChangeMode(Desire.ActionType.Normal); } else if (partner is MerchantActor) { MerchantActor merchantActor = partner as MerchantActor; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); } } if (this._desireIfNotFound != Desire.Type.None) { int desireKey = Desire.GetDesireKey(this._desireIfNotFound); agent.SetDesire(desireKey, 0.0f); agent.ChangeBehavior(Desire.ActionType.Normal); } return((TaskStatus)1); } agent.TargetInSightActionPoint = this._destination; agent.EventKey = this._eventType; this._destination.Reserver = (Actor)agent; return((TaskStatus)2); }
private void ChangeForceBehavior(AgentActor agent, Desire.ActionType actionType) { AgentActor agentActor1 = agent; int num1 = -1; agent.PoseID = num1; int num2 = num1; agentActor1.ActionID = num2; agent.AgentData.CarryingItem = (StuffItem)null; agent.StateType = AIProject.Definitions.State.Type.Normal; if (Object.op_Inequality((Object)agent.CurrentPoint, (Object)null)) { agent.CurrentPoint.SetActiveMapItemObjs(true); agent.CurrentPoint.ReleaseSlot((Actor)agent); agent.CurrentPoint = (ActionPoint)null; } if (Object.op_Inequality((Object)agent.CommandPartner, (Object)null)) { Actor commandPartner = agent.CommandPartner; switch (commandPartner) { case AgentActor _: AgentActor agentActor2 = commandPartner as AgentActor; agentActor2.CommandPartner = (Actor)null; agentActor2.ChangeBehavior(Desire.ActionType.Normal); break; case MerchantActor _: MerchantActor merchantActor = commandPartner as MerchantActor; merchantActor.CommandPartner = (Actor)null; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); break; } agent.CommandPartner = (Actor)null; } agent.EventKey = (AIProject.EventType) 0; agent.CommandPartner = (Actor)null; agent.ResetActionFlag(); if (agent.Schedule.enabled) { Actor.BehaviorSchedule schedule = agent.Schedule; schedule.enabled = false; agent.Schedule = schedule; } agent.ClearItems(); agent.ClearParticles(); agent.ActivateNavMeshAgent(); agent.ActivateTransfer(true); agent.Animation.ResetDefaultAnimatorController(); agent.ChangeBehavior(actionType); }
private void OnComplete2() { AgentActor agent = this.Agent; Actor partner = agent.Partner; int desireKey = Desire.GetDesireKey(Desire.Type.H); agent.SetDesire(desireKey, 0.0f); if (partner is AgentActor) { (partner as AgentActor).SetDesire(desireKey, 0.0f); } agent.UpdateStatus(agent.ActionID, agent.PoseID); if (partner is AgentActor) { (partner as AgentActor).UpdateStatus(partner.ActionID, partner.PoseID); } if (partner is AgentActor) { Dictionary <int, int> relationShipTable = this.Agent.AgentData.FriendlyRelationShipTable; int num; if (!relationShipTable.TryGetValue(partner.ID, out num)) { num = 50; } relationShipTable[partner.ID] = Mathf.Clamp(num + 2, 0, 100); agent.ApplySituationResultParameter(24); (partner as AgentActor).ChangeBehavior(Desire.ActionType.Normal); } else if (partner is MerchantActor) { int num1; if (!this.Agent.AgentData.FriendlyRelationShipTable.TryGetValue(partner.ID, out num1)) { num1 = 50; } int num2; if (!Singleton <Resources> .Instance.MerchantProfile.ResultAddFriendlyRelationShipTable.TryGetValue(Merchant.ActionType.HWithAgent, out num2)) { num2 = 0; } this.Agent.AgentData.FriendlyRelationShipTable[partner.ID] = Mathf.Clamp(num1 + num2, 0, 100); this.Agent.ApplySituationResultParameter(26); MerchantActor merchantActor = partner as MerchantActor; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); if (Object.op_Equality((Object)agent, (Object)merchantActor.CommandPartner)) { merchantActor.CommandPartner = (Actor)null; } } this.OnReleaseProcessing(); }
public virtual TaskStatus OnUpdate() { if (Object.op_Equality((Object)this.Agent, (Object)null)) { return((TaskStatus)1); } MerchantActor targetInSightActor = this.Agent.TargetInSightActor as MerchantActor; if (Object.op_Equality((Object)targetInSightActor, (Object)null)) { return((TaskStatus)1); } targetInSightActor.ChangeBehavior(this._mode); return((TaskStatus)2); }
private void OnComplete() { AgentActor agent = this.Agent; int desireKey1 = Desire.GetDesireKey(agent.RuntimeDesire); if (desireKey1 != -1) { agent.SetDesire(desireKey1, 0.0f); } agent.RuntimeDesire = Desire.Type.None; if (agent.CommandPartner is AgentActor) { int num1 = this._relationShip + Random.Range(-10, 10); agent.AgentData.FriendlyRelationShipTable[agent.CommandPartner.ID] = Mathf.Clamp(num1, 0, 100); agent.ApplySituationResultParameter(23); AgentActor commandPartner = agent.CommandPartner as AgentActor; ChaFileGameInfo fileGameInfo = agent.ChaControl.fileGameInfo; if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(39)) { commandPartner.AddStatus(3, -20f); } int num2 = fileGameInfo.flavorState[4]; int num3 = fileGameInfo.flavorState[7]; int desireKey2 = Desire.GetDesireKey(Desire.Type.H); float? desire = agent.GetDesire(desireKey2); StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; bool flag = num2 >= statusProfile.LesbianBorder && num3 >= statusProfile.GirlsActionBorder && (desire.HasValue && (double)desire.GetValueOrDefault() >= (double)statusProfile.LesbianBorderDesire); int lesbianBorder = Singleton <Resources> .Instance.StatusProfile.LesbianBorder; if (flag) { agent.Partner = this._partner; commandPartner.Partner = (Actor)agent; agent.ChangeBehavior(Desire.ActionType.GotoLesbianSpot); commandPartner.BehaviorResources.ChangeMode(Desire.ActionType.GotoLesbianSpotFollow); } else { agent.ChangeBehavior(Desire.ActionType.Normal); commandPartner.ChangeBehavior(Desire.ActionType.Normal); } } else if (agent.CommandPartner is MerchantActor) { int num1; if (!Singleton <Resources> .Instance.MerchantProfile.ResultAddFriendlyRelationShipTable.TryGetValue(Merchant.ActionType.TalkWithAgent, out num1)) { num1 = 0; } int num2 = this._relationShip + num1; agent.AgentData.FriendlyRelationShipTable[agent.CommandPartner.ID] = Mathf.Clamp(num2, 0, 100); agent.ApplySituationResultParameter(25); MerchantActor commandPartner = agent.CommandPartner as MerchantActor; StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; int desireKey2 = Desire.GetDesireKey(Desire.Type.H); float? desire = agent.GetDesire(desireKey2); ChaFileGameInfo fileGameInfo = agent.ChaControl.fileGameInfo; int num3 = fileGameInfo.flavorState[4]; int num4 = fileGameInfo.flavorState[7]; if (statusProfile.LesbianBorder <= num3 && statusProfile.GirlsActionBorder <= num4 && (desire.HasValue && (double)statusProfile.LesbianBorderDesire <= (double)desire.GetValueOrDefault())) { agent.Partner = this._partner; this._partner.Partner = (Actor)agent; agent.ChangeBehavior(Desire.ActionType.GotoLesbianSpot); commandPartner.ChangeBehavior(Merchant.ActionType.GotoLesbianSpotFollow); } else { agent.ChangeBehavior(Desire.ActionType.Normal); commandPartner.ChangeBehavior(commandPartner.LastNormalMode); } } int desireKey3 = Desire.GetDesireKey(Desire.Type.Lonely); agent.SetDesire(desireKey3, 0.0f); agent.TargetInSightActor = (Actor)null; agent.CommandPartner = (Actor)null; }
private void Refresh(PlayerActor player) { ChaFileControl chaFileControl = new ChaFileControl(); int id = player.CurrentDevicePoint.ID; int num = 0; foreach (KeyValuePair <int, string> changedCharaFile in Singleton <Manager.Map> .Instance.ChangedCharaFiles) { string str = changedCharaFile.Value; AgentData agentData = Singleton <Game> .Instance.WorldData.AgentTable[changedCharaFile.Key]; if (agentData.ParameterLock) { agentData.ParameterLock = false; } bool flag = !str.IsNullOrEmpty() && Manager.Config.GraphicData.CharasEntry[changedCharaFile.Key] && chaFileControl.LoadCharaFile(str, (byte)1, false, true) && agentData.MapID == Singleton <Manager.Map> .Instance.MapID; AgentActor agent; if (Singleton <Manager.Map> .Instance.AgentTable.TryGetValue(changedCharaFile.Key, ref agent)) { agent.DisableBehavior(); agent.ClearItems(); agent.ClearParticles(); Actor.BehaviorSchedule schedule = agent.Schedule; schedule.enabled = false; agent.Schedule = schedule; agent.TargetInSightActor = (Actor)null; if (Object.op_Inequality((Object)agent.CurrentPoint, (Object)null)) { agent.CurrentPoint.SetActiveMapItemObjs(true); agent.CurrentPoint.ReleaseSlot((Actor)agent); agent.CurrentPoint = (ActionPoint)null; } agent.TargetInSightActionPoint = (ActionPoint)null; if (Object.op_Inequality((Object)agent.Partner, (Object)null)) { if (agent.Partner is PlayerActor) { (agent.Partner as PlayerActor).PlayerController.ChangeState("Normal"); } else if (agent.Partner is AgentActor) { AgentActor partner = agent.Partner as AgentActor; agent.StopLesbianSequence(); partner.StopLesbianSequence(); partner.Animation.EndIgnoreEvent(); Singleton <Game> .Instance.GetExpression(partner.ChaControl.fileParam.personality, "標準")?.Change(partner.ChaControl); partner.Animation.ResetDefaultAnimatorController(); partner.ChangeBehavior(Desire.ActionType.Normal); } else if (agent.Partner is MerchantActor) { MerchantActor partner = agent.Partner as MerchantActor; agent.StopLesbianSequence(); partner.ResetState(); partner.ChangeBehavior(partner.LastNormalMode); } agent.Partner = (Actor)null; } if (Object.op_Inequality((Object)agent.CommandPartner, (Object)null)) { if (agent.CommandPartner is AgentActor) { (agent.CommandPartner as AgentActor).ChangeBehavior(Desire.ActionType.Normal); } else if (agent.CommandPartner is MerchantActor) { MerchantActor commandPartner = agent.CommandPartner as MerchantActor; commandPartner.ChangeBehavior(commandPartner.LastNormalMode); } agent.CommandPartner = (Actor)null; } Singleton <Manager.Map> .Instance.RemoveAgent(agent); if (flag) { agent = Singleton <Manager.Map> .Instance.AddAgent(changedCharaFile.Key, agentData); agentData.PrevMapID = new int?(); } else { agent = (AgentActor)null; } } else if (flag) { agent = Singleton <Manager.Map> .Instance.AddAgent(changedCharaFile.Key, agentData); agentData.PrevMapID = new int?(); } else { agent = (AgentActor)null; } if (Object.op_Inequality((Object)agent, (Object)null)) { agent.RefreshWalkStatus(Singleton <Manager.Map> .Instance.PointAgent.Waypoints); Singleton <Manager.Map> .Instance.InitSearchActorTargets(agent); player.PlayerController.CommandArea.AddCommandableObject((ICommandable)agent); using (IEnumerator <KeyValuePair <int, AgentActor> > enumerator = Singleton <Manager.Map> .Instance.AgentTable.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <int, AgentActor> current = enumerator.Current; if (!Object.op_Equality((Object)current.Value, (Object)agent)) { current.Value.AddActor((Actor)agent); } } } agent.ActivateNavMeshAgent(); Transform recoverPoint = player.CurrentDevicePoint.RecoverPoints[num++]; agent.NavMeshAgent.Warp(recoverPoint.get_position()); agent.Rotation = recoverPoint.get_rotation(); agent.EnableBehavior(); agent.ChangeBehavior(Desire.ActionType.Normal); } } Resources.UnloadUnusedAssets(); GC.Collect(); }
private void OnComplete() { AgentActor agent = this.Agent; Actor partner = agent.Partner; int desireKey = Desire.GetDesireKey(Desire.Type.H); agent.SetDesire(desireKey, 0.0f); if (partner is AgentActor) { (partner as AgentActor).SetDesire(desireKey, 0.0f); } agent.Animation.CrossFadeScreen(-1f); agent.SetStand(agent.Animation.RecoveryPoint, false, 0.0f, 0); agent.Animation.RecoveryPoint = (Transform)null; partner.SetStand(partner.Animation.RecoveryPoint, false, 0.0f, 0); partner.Animation.RecoveryPoint = (Transform)null; agent.UpdateStatus(agent.ActionID, agent.PoseID); if (partner is AgentActor) { (partner as AgentActor).UpdateStatus(partner.ActionID, partner.PoseID); } agent.Partner = (Actor)null; partner.Partner = (Actor)null; agent.ActivateNavMeshAgent(); agent.SetActiveOnEquipedItem(true); partner.ActivateNavMeshAgent(); partner.SetActiveOnEquipedItem(true); if (partner is AgentActor) { Dictionary <int, int> relationShipTable = this.Agent.AgentData.FriendlyRelationShipTable; int num; if (!relationShipTable.TryGetValue(partner.ID, out num)) { num = 50; } relationShipTable[partner.ID] = Mathf.Clamp(num + 2, 0, 100); agent.ApplySituationResultParameter(24); (partner as AgentActor).ChangeBehavior(Desire.ActionType.Normal); } else if (partner is MerchantActor) { int num1; if (!this.Agent.AgentData.FriendlyRelationShipTable.TryGetValue(partner.ID, out num1)) { num1 = 50; } int num2; if (!Singleton <Resources> .Instance.MerchantProfile.ResultAddFriendlyRelationShipTable.TryGetValue(Merchant.ActionType.HWithAgent, out num2)) { num2 = 0; } this.Agent.AgentData.FriendlyRelationShipTable[partner.ID] = Mathf.Clamp(num1 + num2, 0, 100); this.Agent.ApplySituationResultParameter(26); MerchantActor merchantActor = partner as MerchantActor; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); if (Object.op_Equality((Object)agent, (Object)merchantActor.CommandPartner)) { merchantActor.CommandPartner = (Actor)null; } } if (Object.op_Inequality((Object)agent.CurrentPoint, (Object)null)) { agent.CurrentPoint.SetActiveMapItemObjs(true); agent.CurrentPoint.ReleaseSlot((Actor)agent); agent.CurrentPoint = (ActionPoint)null; } agent.TargetInSightActor = (Actor)null; agent.EventKey = (EventType)0; agent.Animation.EndIgnoreEvent(); partner.Animation.EndIgnoreEvent(); agent.Animation.ResetDefaultAnimatorController(); partner.Animation.ResetDefaultAnimatorController(); agent.ResetActionFlag(); if (!(partner is AgentActor)) { return; } (partner as AgentActor).ResetActionFlag(); }
public virtual TaskStatus OnUpdate() { if (Object.op_Equality((Object)this._partner, (Object)null)) { return((TaskStatus)1); } AgentActor agent = this.Agent; if (agent.LivesTalkSequence) { return((TaskStatus)3); } ChaFileGameInfo fileGameInfo = agent.ChaControl.fileGameInfo; int num1 = fileGameInfo.flavorState[4]; int num2 = fileGameInfo.flavorState[7]; int desireKey = Desire.GetDesireKey(Desire.Type.H); float? desire = agent.GetDesire(desireKey); StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; bool flag = num1 >= statusProfile.LesbianBorder && num2 >= statusProfile.GirlsActionBorder && (desire.HasValue && (double)desire.GetValueOrDefault() >= (double)statusProfile.LesbianBorderDesire); Actor partner = this._partner; if (flag) { agent.Partner = partner; partner.Partner = (Actor)agent; agent.ChangeBehavior(Desire.ActionType.GotoLesbianSpot); switch (partner) { case AgentActor _: AgentActor agentActor = partner as AgentActor; Desire.ActionType mode = Desire.ActionType.GotoLesbianSpotFollow; agentActor.Mode = mode; agentActor.BehaviorResources.ChangeMode(mode); break; case MerchantActor _: (partner as MerchantActor).ChangeBehavior(Merchant.ActionType.GotoLesbianSpotFollow); break; } } else { if ((double)Random.get_value() < 0.5) { agent.ChangeBehavior(Desire.ActionType.SearchMasturbation); } else { agent.SetDesire(desireKey, 0.0f); agent.ChangeBehavior(Desire.ActionType.Normal); } switch (partner) { case AgentActor _: (partner as AgentActor).ChangeBehavior(Desire.ActionType.Normal); break; case MerchantActor _: MerchantActor merchantActor = partner as MerchantActor; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); break; } } agent.CommandPartner = (Actor)null; agent.TargetInSightActor = (Actor)null; switch (partner) { case AgentActor _: (partner as AgentActor).CommandPartner = (Actor)null; break; case MerchantActor _: (partner as MerchantActor).CommandPartner = (Actor)null; break; } return((TaskStatus)2); }
private void EndMerchantStory0() { this._eventPoint.SetDedicatedNumber(1); MapUIContainer.SetVisibleHUD(true); if (!Singleton <Manager.Map> .IsInstance()) { return; } Manager.Map instance = Singleton <Manager.Map> .Instance; instance.SetActiveMapEffect(true); MerchantActor merchant = instance.Merchant; MerchantData merchantData = merchant.MerchantData; if (Object.op_Inequality((Object)merchant, (Object)null)) { if (merchantData != null) { merchantData.Unlock = true; } merchant.SetLookPtn(0, 3); merchant.SetLookTarget(0, 0, (Transform)null); merchant.ChangeBehavior(merchant.LastNormalMode); } AgentActor tutorialAgent = instance.TutorialAgent; if (Object.op_Inequality((Object)tutorialAgent, (Object)null)) { tutorialAgent.ChangeFirstNormalBehavior(); instance.TutorialAgent = (AgentActor)null; Manager.Map.SetTutorialProgressAndUIUpdate(16); } PlayerActor player = instance.Player; if (Object.op_Inequality((Object)player, (Object)null)) { if (Manager.Config.GraphicData.CharasEntry[0]) { player.CameraControl.Mode = CameraMode.Normal; player.PlayerController.ChangeState("Idle"); ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.SkipWhile <long>((IObservable <M0>)Observable.EveryUpdate(), (Func <M0, bool>)(_ => player.CameraControl.CinemachineBrain.get_IsBlending())), 1), (System.Action <M0>)(_ => { player.AddTutorialUI(Popup.Tutorial.Type.Girl, false); player.PlayerController.ChangeState("Normal"); })); } else { player.PlayerController.ChangeState("Idle"); Singleton <Manager.Map> .Instance.ApplyConfig((System.Action)(() => { // ISSUE: cast to a reference type // ISSUE: explicit reference operation CinemachineBlendDefinition.Style prevStyle = (CinemachineBlendDefinition.Style)(^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style; // ISSUE: cast to a reference type // ISSUE: explicit reference operation (^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style = (__Null)0; player.CameraControl.Mode = CameraMode.Normal; // ISSUE: cast to a reference type // ISSUE: explicit reference operation ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.Skip <long>((IObservable <M0>)Observable.EveryLateUpdate(), 1), 1), (System.Action <M0>)(_ => (^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style = (__Null)prevStyle)); }), (System.Action)(() => { player.AddTutorialUI(Popup.Tutorial.Type.Girl, false); player.PlayerController.ChangeState("Normal"); })); } } Singleton <Manager.Map> .Instance.SetBaseOpenState(-1, true); instance.Simulator.EnabledTimeProgression = true; }