コード例 #1
0
        public static bool Prefix_HScene_InitCoroutine()
        {
            HSceneManager manager = HSceneManager.Instance;

            if (RealTime.Value)
            {
                foreach (AgentActor actor in Map.Instance.AgentTable.Values)
                {
                    if (actor != null && actor != manager.females[0] && actor != manager.females[1])
                    {
                        actor.EnableEntity();
                    }
                }

                if (!manager.bMerchant)
                {
                    MerchantActor merchant = Map.Instance.Merchant;
                    merchant.Controller.enabled        = true;
                    merchant.AnimationMerchant.enabled = true;

                    merchant.EnableEntity();
                }
            }

            return(true);
        }
コード例 #2
0
        static void HSceneInitMerchant(MerchantActor Merchant, AgentActor agent)
        {
#if DEBUG
            AdditionalAccessoryControlsPlugin.Instance.Log.LogInfo("HScene Init Merchant");
#endif
            Singleton <Manager.Map> .Instance.Player.ChaControl.gameObject.GetComponent <AdditionalAccessoryControlsController>().HandleVisibilityRules(hstart: true);

            hActors.Add(Singleton <Manager.Map> .Instance.Player.ChaControl);
            if (agent != null)
            {
#if DEBUG
                AdditionalAccessoryControlsPlugin.Instance.Log.LogInfo($"Sending event for: {agent?.ChaControl?.fileParam?.fullname}");
#endif
                agent.ChaControl.gameObject.GetComponent <AdditionalAccessoryControlsController>().HandleVisibilityRules(hstart: true);
                hActors.Add(agent.ChaControl);
            }
            if (Merchant != null)
            {
#if DEBUG
                AdditionalAccessoryControlsPlugin.Instance.Log.LogInfo($"Sending event for: {Merchant?.ChaControl?.fileParam?.fullname}");
#endif
                Merchant.ChaControl.gameObject.GetComponent <AdditionalAccessoryControlsController>().HandleVisibilityRules(hstart: true);
                hActors.Add(Merchant.ChaControl);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: Actor.cs プロジェクト: request-time-out/A-Scripts
        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;
            }
        }
コード例 #5
0
 private IEnumerator HsceneInit(MerchantActor Merchant, AgentActor agent = null)
 {
     // ISSUE: object of a compiler-generated type is created
     return((IEnumerator) new HSceneManager.\u003CHsceneInit\u003Ec__Iterator1()
     {
         agent = agent,
         \u0024this = this
     });
 }
コード例 #6
0
        public override void OnEnd()
        {
            MerchantActor  merchant  = this.Merchant;
            ActorAnimation animation = merchant.Animation;

            animation.Targets.Clear();
            animation.Animator.InterruptMatchTarget(false);
            merchant.NavMeshObstacle.set_carveOnlyStationary(true);
            base.OnEnd();
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        public static void Postfix_HSceneManager_HsceneInit(MerchantActor Merchant, AgentActor agent = null)
        {
            if (!partners.Contains(Merchant.ChaControl))
            {
                partners.Add(Merchant.ChaControl);
            }

            if (agent != null && !partners.Contains(agent.ChaControl))
            {
                partners.Add(agent.ChaControl);
            }
        }
コード例 #9
0
ファイル: Lie.cs プロジェクト: request-time-out/A-Scripts
        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);
        }
コード例 #10
0
        public virtual TaskStatus OnUpdate()
        {
            MerchantActor merchant           = this.Merchant;
            ActionPoint   bookingActionPoint = merchant.BookingActionPoint;

            if (Object.op_Equality((Object)bookingActionPoint, (Object)null))
            {
                return((TaskStatus)1);
            }
            bookingActionPoint.RemoveBooking((Actor)merchant);
            merchant.BookingActionPoint = (ActionPoint)null;
            return((TaskStatus)2);
        }
コード例 #11
0
ファイル: Lesbian.cs プロジェクト: request-time-out/A-Scripts
        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();
        }
コード例 #12
0
        public void UpdateState()
        {
            this.CalcAnimSpeed();
            MerchantActor     actor             = this._actor as MerchantActor;
            NavMeshAgent      navMeshAgent      = actor.NavMeshAgent;
            LocomotionProfile locomotionProfile = Singleton <Resources> .Instance.LocomotionProfile;
            AgentProfile      agentProfile      = Singleton <Resources> .Instance.AgentProfile;

            if (actor.CurrentMode == Merchant.ActionType.GotoLesbianSpotFollow)
            {
                if (((Behaviour)navMeshAgent).get_isActiveAndEnabled() && !navMeshAgent.get_pathPending())
                {
                    if (!actor.IsRunning && (double)agentProfile.RunDistance < (double)navMeshAgent.get_remainingDistance())
                    {
                        actor.IsRunning = true;
                    }
                    float num;
                    if (actor.IsRunning)
                    {
                        this.AnimState.moveDirection = Vector3.op_Multiply(this.MoveDirection, locomotionProfile.MerchantSpeed.runSpeed);
                        num = locomotionProfile.MerchantSpeed.runSpeed;
                    }
                    else
                    {
                        this.AnimState.moveDirection = Vector3.op_Multiply(this.MoveDirection, locomotionProfile.MerchantSpeed.walkSpeed);
                        num = locomotionProfile.MerchantSpeed.walkSpeed;
                    }
                    navMeshAgent.set_speed(Mathf.Lerp(navMeshAgent.get_speed(), num, locomotionProfile.LerpSpeed));
                }
                else
                {
                    this.AnimState.moveDirection = Vector3.op_Multiply(this.MoveDirection, locomotionProfile.MerchantSpeed.walkSpeed);
                }
            }
            else if (this.MovePoseID == 0)
            {
                this.AnimState.moveDirection   = Vector3.op_Multiply(this.MoveDirection, locomotionProfile.MerchantSpeed.walkSpeed);
                this.AnimState.setMediumOnWalk = true;
                this.AnimState.medVelocity     = locomotionProfile.MerchantSpeed.walkSpeed;
                this.AnimState.maxVelocity     = locomotionProfile.MerchantSpeed.runSpeed;
            }
            else
            {
                this.AnimState.moveDirection   = Vector3.get_zero();
                this.AnimState.setMediumOnWalk = false;
                this.AnimState.maxVelocity     = locomotionProfile.MerchantSpeed.walkSpeed;
            }
            this.CharacterAnimation.UpdateState(this.AnimState);
        }
コード例 #13
0
 private void Awake()
 {
     if (Object.op_Equality((Object)this.merchant, (Object)null))
     {
         this.merchant = (MerchantActor)((Component)this).GetComponent <MerchantActor>();
     }
     if (Object.op_Equality((Object)this.merchant, (Object)null))
     {
         Object.Destroy((Object)this);
     }
     else
     {
         this.InstanceID = this.merchant.InstanceID;
     }
 }
コード例 #14
0
        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);
        }
コード例 #15
0
        public static void LateUpdate()
        {
            if (povEnabled)
            {
                if (inHScene != Tools.IsHScene())
                {
                    inHScene    = Tools.IsHScene();
                    characters  = GetSceneCharacters();
                    targetFocus = povFocus = GetValidFocus(Player);
                    SetPoVCharacter(GetValidCharacterFromFocus(ref povFocus));
                    SetTargetCharacter(GetValidCharacterFromFocus(ref targetFocus));
                }

                // Make it so that the player doesn't go visible if they're not supposed to be in the scene.
                if (!inHScene || Map.Instance.Player.ChaControl.visibleAll)
                {
                    Map.Instance.Player.ChaControl.visibleAll = true;
                }

                if (inHScene && agentHead != null)
                {
                    ResetAgentHeadRotation();
                }
            }

            if (AI_PovX.RevealAll.Value)
            {
                foreach (KeyValuePair <int, AgentActor> agent in Map.Instance.AgentTable)
                {
                    agent.Value.ChaControl.visibleAll = true;
                }

                MerchantActor merchant = Map.Instance.Merchant;

                if (merchant != null)
                {
                    merchant.ChaControl.visibleAll = true;
                }
            }

            if (AI_PovX.RevealPartner.Value)
            {
                if (Map.Instance.Player.AgentPartner != null)
                {
                    Map.Instance.Player.AgentPartner.ChaControl.visibleAll = true;
                }
            }
        }
コード例 #16
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            this.counter = 0.0f;
            this.Merchant.ActivateNavMeshObstacle(this.Merchant.Position);
            this.prevTalkable = this.Merchant.Talkable;
            if (!this.prevTalkable)
            {
                this.Merchant.Talkable = true;
            }
            this._player = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player;

            this._merchant = this.Merchant;
            ChaControl chaControl = this.Merchant.ChaControl;

            chaControl.ChangeLookNeckTarget(1, this._player.FovTargetPointTable.get_Item(Actor.FovBodyPart.Head), 0.5f, 0.0f, 1f, 0.8f);
            chaControl.ChangeLookNeckPtn(1, 1f);
        }
コード例 #17
0
        public static void LateUpdate()
        {
            if (toggled)
            {
                bool hScene = Tools.IsHScene();

                // Make it so that the player doesn't go visible if they're not supposed to be in the scene.
                if (!hScene || Map.Instance.Player.ChaControl.visibleAll)
                {
                    Map.Instance.Player.ChaControl.visibleAll = true;
                }

                if (hScene && AI_PovX.HSceneLockCursor.Value && !showCursor)
                {
                    Cursor.lockState = CursorLockMode.Locked;
                    Cursor.visible   = false;
                }
            }

            if (showCursor)
            {
                Cursor.lockState = CursorLockMode.None;
                Cursor.visible   = true;
            }

            if (AI_PovX.RevealAll.Value)
            {
                foreach (KeyValuePair <int, AgentActor> agent in Map.Instance.AgentTable)
                {
                    agent.Value.ChaControl.visibleAll = true;
                }

                MerchantActor merchant = Map.Instance.Merchant;

                if (merchant != null)
                {
                    merchant.ChaControl.visibleAll = true;
                }
            }
        }
コード例 #18
0
ファイル: Configuration.cs プロジェクト: GeBo1/GeBoPlugins
        private static IEnumerator RegisterMerchantReplacements()
        {
            yield return(new WaitUntil(MerchantReady));

            ChaControl    chaControl    = null;
            MerchantActor merchant      = null;
            string        origCharaName = null;

            Map.Instance.SafeProc(i => i.Merchant.SafeProc(m => merchant = m));
            merchant.SafeProc(m => m.ChaControl.SafeProc(cc =>
            {
                chaControl        = cc;
                MerchantCharaName = null;
                origCharaName     = merchant.CharaName;
            }));
            if (chaControl == null || !chaControl.TryGetTranslationHelperController(out var controller))
            {
                yield break;
            }
            controller.TranslateCardNames();
            var scope = NameScope.DefaultNameScope;

            chaControl.chaFile.SafeProc(cf => scope = new NameScope(cf.GetSex()));
            yield return(controller.WaitOnTranslations());


            controller.StartMonitoredCoroutine(CardNameTranslationManager.Instance.TranslateCardName(origCharaName,
                                                                                                     scope, result =>
            {
                if (!result.Succeeded)
                {
                    return;
                }
                MerchantCharaName = result.TranslatedText;
                TranslationHelper.RegistrationManager.RegisterReplacementStrings(
                    new Dictionary <string, string> {
                    { MerchantCharaName, MerchantCharaName }
                });
            }));
        }
コード例 #19
0
        private void OnUpdateMerchantMarker()
        {
            if (Object.op_Equality((Object)this.CameraTransform, (Object)null))
            {
                return;
            }
            int num1 = MerchantMarker.MerchantMarkerTable.Count - this._merchantMarkers.Count;

            if (0 < num1)
            {
                for (int index = 0; index < num1; ++index)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this._markerPrefab);
                    gameObject.get_transform().SetParent(((Component)this._canvas).get_transform(), false);
                    this._merchantMarkers.Add(gameObject);
                }
            }
            else if (num1 < 0)
            {
                for (int index = 0; index < this._merchantMarkers.Count; ++index)
                {
                    this._merchantMarkers[index].SetActive(index < this._merchantMarkers.Count + num1);
                }
            }
            int num2 = 0;

            foreach (int key in MerchantMarker.Keys)
            {
                MerchantActor merchantActor = (MerchantActor)null;
                if (MerchantMarker.MerchantMarkerTable.TryGetValue(key, out merchantActor))
                {
                    Vector2    screenPoint    = RectTransformUtility.WorldToScreenPoint(Camera.get_main(), merchantActor.Position);
                    GameObject merchantMarker = this._merchantMarkers[num2++];
                    merchantMarker.get_transform().set_position(Vector2.op_Implicit(screenPoint));
                    float num3 = Quaternion.Angle(Quaternion.LookRotation(Vector3.op_Subtraction(merchantActor.Position, this.CameraTransform.get_position())), this.CameraTransform.get_rotation());
                    merchantMarker.SetActive((double)num3 < 60.0);
                }
            }
        }
コード例 #20
0
        private void CheckMerchant()
        {
            List <Actor> actorList1 = ListPool <Actor> .Get();

            foreach (Actor targetActor in this.Agent.TargetActors)
            {
                MerchantActor  merchantActor = targetActor as MerchantActor;
                CollisionState collisionState;
                if (!Object.op_Equality((Object)merchantActor, (Object)null) && this.Agent.ActorCollisionStateTable.TryGetValue(targetActor.InstanceID, out collisionState) && (collisionState == CollisionState.Enter && merchantActor.IsNeutralCommand))
                {
                    actorList1.Add(targetActor);
                }
            }
            if (actorList1.IsNullOrEmpty <Actor>())
            {
                ListPool <Actor> .Release(actorList1);
            }
            else
            {
                List <Actor> actorList2 = ListPool <Actor> .Get();

                foreach (Actor actor in actorList1)
                {
                    actorList2.Add(actor);
                }
                ActorController capturedInSight = AgentActor.GetCapturedInSight(this.Agent, actorList2);
                ListPool <Actor> .Release(actorList2);

                if (Object.op_Equality((Object)capturedInSight, (Object)null) || !(capturedInSight.Actor is MerchantActor))
                {
                    ListPool <Actor> .Release(actorList1);
                }
                else
                {
                    this.Agent.TargetInSightActor = capturedInSight.Actor;
                    ListPool <Actor> .Release(actorList1);
                }
            }
        }
コード例 #21
0
        private bool IsMatchPoint(MerchantPoint _point, bool _isMiddlePoint)
        {
            if (Object.op_Equality((Object)_point, (Object)null))
            {
                return(false);
            }
            Merchant.EventType eventType    = !_isMiddlePoint ? Merchant.EventType.Search : Merchant.EventType.Wait;
            MerchantActor      merchant     = this.Merchant;
            MerchantData       merchantData = merchant.MerchantData;
            int           openAreaId        = merchant.OpenAreaID;
            int           pointAreaId       = merchantData.PointAreaID;
            int           pointGroupId      = merchantData.PointGroupID;
            MerchantPoint prevMerchantPoint = this.PrevMerchantPoint;

            if (openAreaId < _point.AreaID || (_point.EventType & eventType) != eventType || _point.AreaID != pointAreaId)
            {
                return(false);
            }
            if (_isMiddlePoint)
            {
                return(_point.GroupID == 0);
            }
            return(_point.GroupID != pointGroupId || Object.op_Inequality((Object)_point, (Object)prevMerchantPoint));
        }
コード例 #22
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]));
            }
        }
コード例 #23
0
ファイル: Talk.cs プロジェクト: request-time-out/A-Scripts
        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;
        }
コード例 #24
0
        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);
        }
コード例 #25
0
        public void SetStand(
            MerchantActor merchant,
            Transform t,
            bool enableFade,
            float fadeTime,
            int dirc,
            System.Action onComplete = null)
        {
            if (Object.op_Equality((Object)merchant, (Object)null) || Object.op_Equality((Object)t, (Object)null))
            {
                System.Action action = onComplete;
                if (action == null)
                {
                    return;
                }
                action();
            }
            else
            {
                IConnectableObservable <TimeInterval <float> > iconnectableObservable = (IConnectableObservable <TimeInterval <float> >)Observable.Publish <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Linear(fadeTime, false), false));
                IDisposable disposable1 = iconnectableObservable.Connect();
                merchant.DisposeSequenceAction();
                Vector3    position = merchant.Position;
                Quaternion rotation = merchant.Rotation;
                switch (dirc)
                {
                case 0:
                    if (enableFade)
                    {
                        merchant.AddSequenceActionDisposable(disposable1);
                        IDisposable disposable2 = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)iconnectableObservable, (System.Action <M0>)(x =>
                        {
                            merchant.Position = Vector3.Lerp(position, t.get_position(), ((TimeInterval <float>) ref x).get_Value());
                            merchant.Rotation = Quaternion.Lerp(rotation, t.get_rotation(), ((TimeInterval <float>) ref x).get_Value());
                        })), (Component)merchant);
                        merchant.AddSequenceActionDisposable(disposable2);
                        IDisposable disposable3 = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float>[]>((IObservable <M0>)Observable.WhenAll <TimeInterval <float> >((IObservable <M0>[]) new IObservable <TimeInterval <float> >[1]
                        {
                            (IObservable <TimeInterval <float> >)iconnectableObservable
                        }), (System.Action <M0>)(_ =>
                        {
                            System.Action action = onComplete;
                            if (action != null)
                            {
                                action();
                            }
                            merchant.ClearSequenceAction();
                        })), (Component)merchant);
                        merchant.AddSequenceActionDisposable(disposable3);
                        merchant.AddSequenceActionOnComplete(onComplete);
                        break;
                    }
                    merchant.Position = t.get_position();
                    merchant.Rotation = t.get_rotation();
                    System.Action action1 = onComplete;
                    if (action1 == null)
                    {
                        break;
                    }
                    action1();
                    break;

                case 1:
                    Vector3 vector3 = Vector3.op_Subtraction(((Component)this).get_transform().get_position(), merchant.Position);
                    vector3.y = (__Null)0.0;
                    Quaternion lookRotation = Quaternion.LookRotation(((Vector3) ref vector3).get_normalized(), Vector3.get_up());
                    if (enableFade)
                    {
                        IDisposable disposable2 = ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)iconnectableObservable, (System.Action <M0>)(x => merchant.Rotation = Quaternion.Lerp(rotation, lookRotation, ((TimeInterval <float>) ref x).get_Value())));
                        merchant.AddSequenceActionDisposable(disposable2);
                        IDisposable disposable3 = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float>[]>((IObservable <M0>)Observable.WhenAll <TimeInterval <float> >((IObservable <M0>[]) new IObservable <TimeInterval <float> >[1]
                        {
                            (IObservable <TimeInterval <float> >)iconnectableObservable
                        }), (System.Action <M0>)(_ =>
                        {
                            System.Action action = onComplete;
                            if (action == null)
                            {
                                return;
                            }
                            action();
                        })), (Component)merchant);
                        merchant.AddSequenceActionDisposable(disposable3);
                        merchant.AddSequenceActionOnComplete(onComplete);
                        break;
                    }
                    merchant.Rotation = lookRotation;
                    System.Action action3 = onComplete;
                    if (action3 == null)
                    {
                        break;
                    }
                    action3();
                    break;

                default:
                    System.Action action4 = onComplete;
                    if (action4 == null)
                    {
                        break;
                    }
                    action4();
                    break;
                }
            }
        }
コード例 #26
0
 public virtual void OnStart()
 {
     ((Task)this).OnStart();
     this._merchant = this.Merchant;
 }
コード例 #27
0
        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();
        }
コード例 #28
0
ファイル: Lesbian.cs プロジェクト: request-time-out/A-Scripts
        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();
        }
コード例 #29
0
 public virtual void OnAwake()
 {
     ((Task)this).OnAwake();
     this._merchant = this.Merchant;
 }
コード例 #30
0
 public virtual void OnAwake()
 {
     ((Task)this).OnAwake();
     this._merchant     = this.Merchant;
     this._navMeshAgent = this._merchant.NavMeshAgent;
 }