Example #1
0
        public virtual TaskStatus OnUpdate()
        {
            AgentActor    agent         = this.Agent;
            StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile;

            return(agent.ChaControl.fileGameInfo.morality < 50 && (double)agent.AgentData.StatsTable[2] < (double)statusProfile.ShallowSleepHungerLowBorder && (double)Random.Range(0.0f, 100f) < (double)statusProfile.ShallowSleepProb ? (TaskStatus)2 : (TaskStatus)1);
        }
Example #2
0
        public virtual TaskStatus OnUpdate()
        {
            AgentActor agent = this.Agent;
            List <SearchAreaProbabilities.AddProb> addProbList = ListPool <SearchAreaProbabilities.AddProb> .Get();

            StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile;

            if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(10))
            {
                addProbList.Add(new SearchAreaProbabilities.AddProb(6, statusProfile.FishingSearchProbBuff));
            }
            if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(18))
            {
                addProbList.Add(new SearchAreaProbabilities.AddProb(0, statusProfile.HandSearchProbBuff));
            }
            if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(42))
            {
                addProbList.Add(new SearchAreaProbabilities.AddProb(4, statusProfile.PickelSearchProbBuff));
            }
            if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(47))
            {
                addProbList.Add(new SearchAreaProbabilities.AddProb(3, statusProfile.ShovelSearchProbBuff));
            }
            if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(48))
            {
                addProbList.Add(new SearchAreaProbabilities.AddProb(5, statusProfile.NetSearchProbBuff));
            }
            Dictionary <int, bool> dictionary = DictionaryPool <int, bool> .Get();

            dictionary[0]      = true;
            dictionary[3]      = agent.AgentData.EquipedShovelItem.ID > -1;
            dictionary[4]      = agent.AgentData.EquipedPickelItem.ID > -1;
            dictionary[5]      = agent.AgentData.EquipedPickelItem.ID > -1;
            dictionary[6]      = agent.AgentData.EquipedFishingItem.ID > -1;
            agent.SearchAreaID = addProbList.Count <= 0 ? Singleton <Resources> .Instance.CommonDefine.ProbSearchAreaProfile.Lottery(dictionary, (List <SearchAreaProbabilities.AddProb>) null) : Singleton <Resources> .Instance.CommonDefine.ProbSearchAreaProfile.Lottery(dictionary, addProbList);

            DictionaryPool <int, bool> .Release(dictionary);

            ListPool <SearchAreaProbabilities.AddProb> .Release(addProbList);

            return((TaskStatus)2);
        }
Example #3
0
        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;
        }
        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);
        }