예제 #1
0
        protected override bool CommonAllow(SimDescription sim)
        {
            if (sim.IsEngaged)
            {
                IncStat("Already Engaged");
                return(false);
            }

            if (mTestScoring)
            {
                Relationship relation = ManagerSim.GetRelationship(Sim, Target);
                if (relation == null)
                {
                    return(false);
                }

                if (relation.LTR.Liking < GetValue <CooldownMarriageScenario.LikingGateOption, int>())
                {
                    AddStat("No Like", relation.LTR.Liking);
                    return(false);
                }
                else if (AddScoring("Engagement Cooldown", GetElapsedTime <DayOfLastPartnerOption>(sim) - GetValue <MinTimeFromPartnerToEngagementOption, int>()) < 0)
                {
                    AddStat("Too Early", GetElapsedTime <DayOfLastPartnerOption>(sim));
                    return(false);
                }
            }

            return(base.CommonAllow(sim));
        }
예제 #2
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (Sim.Household == sim.Household)
            {
                IncStat("Same House");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            Relationship relation = ManagerSim.GetRelationship(Sim, sim);

            if (relation == null)
            {
                IncStat("Bad Relation");
                return(false);
            }

            if ((!relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.BreakUp)) &&
                (!relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.Divorce)))
            {
                IncStat("Not Breakup");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
예제 #3
0
        protected override bool TargetAllow(SimDescription sim)
        {
            Relationship relationship = ManagerSim.GetRelationship(Sim, Target);

            if (relationship == null)
            {
                IncStat("Bad Relation");
                return(false);
            }
            else if (relationship.AreRomantic())
            {
                IncStat("Already Romantic");
                return(false);
            }
            else if (Sim.Partner == Target)
            {
                IncStat("Partnered");
                return(false);
            }

            LongTermRelationship LTR = relationship.LTR;

            if (LTR == null)
            {
                IncStat("Bad LTR");
                return(false);
            }
            else if (LTR.Liking <= Sims3.Gameplay.Actors.Sim.kRomanceUseLikingGate)
            {
                IncStat("Too Low");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
예제 #4
0
        public static bool AreEnemies(SimDescription a, SimDescription b, int maximum)
        {
            Relationship relation = ManagerSim.GetRelationship(a, b);

            if (relation == null)
            {
                return(false);
            }

            return(relation.LTR.Liking < maximum);
        }
예제 #5
0
        public static bool AreRomantic(SimDescription a, SimDescription b)
        {
            Relationship relation = ManagerSim.GetRelationship(a, b);

            if (relation == null)
            {
                return(false);
            }

            return(relation.AreRomantic());
        }
예제 #6
0
        protected override bool TargetAllow(SimDescription sim)
        {
            Relationship relation = ManagerSim.GetRelationship(sim, Sim);

            if (relation == null)
            {
                IncStat("No Relation");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
예제 #7
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            bool breakup = false;

            Relationship relation = ManagerSim.GetRelationship(Sim, Target);

            if ((relation != null) && (relation.CurrentLTRLiking <= GetValue <MaximumForceBreakupOption, int>()))
            {
                breakup = true;
            }
            else
            {
                int scoreA = AddScoring("Breakup", Target, Sim);
                int scoreB = AddScoring("Breakup", Sim, Target);

                if ((scoreA > 0) && (scoreB > 0))
                {
                    breakup = true;
                }
                else if ((scoreA > 0) || (scoreB > 0))
                {
                    if ((GetValue <SplitOpposingClanOption, bool>()) && (!Romances.Allow(this, Sim, Target)))
                    {
                        breakup       = true;
                        mOpposingClan = true;
                    }
                    else
                    {
                        int chance = (scoreA + scoreB);
                        if ((chance > 0) && (RandomUtil.RandomChance(AddScoring("Chance", chance))))
                        {
                            breakup = true;
                        }
                        else
                        {
                            Add(frame, new ExistingEnemyManualScenario(Sim, Target, -25, 0), ScenarioResult.Start);
                        }
                    }
                }
            }

            if (breakup)
            {
                return(base.PrivateUpdate(frame));
            }

            return(false);
        }
예제 #8
0
        public static bool HandleNemesis(SimDescription sim, SimDescription target)
        {
            Relationship relation = ManagerSim.GetRelationship(sim, target);

            if (relation == null)
            {
                return(false);
            }

            if ((relation.LTR.Liking <= -100) &&
                (!relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.MakeEnemy)))
            {
                relation.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.MakeEnemy);

                return(true);
            }

            return(false);
        }
예제 #9
0
        protected override bool TargetAllow(SimDescription target)
        {
            if (target.ChildOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (Sim.Partner == target)
            {
                IncStat("Partner");
                return(false);
            }


            bool check = true;

            if (GetValue <SplitOpposingClanOption, bool>())
            {
                if (!Households.Allow(this, Sim, target, Managers.Manager.AllowCheck.None))
                {
                    check = false;
                }
            }

            if (check)
            {
                Relationship relation = ManagerSim.GetRelationship(Sim, target);
                if (relation == null)
                {
                    IncStat("Bad Relation");
                    return(false);
                }

                if (AddScoring("MoveAwayFrom", target, Sim) < 20)
                {
                    IncStat("Score Fail");
                    return(false);
                }
            }

            return(base.TargetAllow(target));
        }
예제 #10
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Relationship relation = ManagerSim.GetRelationship(Sim, Target);

            if (relation == null)
            {
                IncStat("No Relation");
                return(false);
            }

            relation.MakeAcquaintances();

            int liking = GetValue <OptionV2, int>();

            if (relation.LTR.Liking < liking)
            {
                relation.LTR.SetLiking(liking);
            }

            return(true);
        }
예제 #11
0
        public static bool WasOldLover(SimDescription a, SimDescription b)
        {
            Relationship relation = ManagerSim.GetRelationship(a, b);

            if (relation == null)
            {
                return(false);
            }

            if (relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.BreakUp))
            {
                return(true);
            }

            if (relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.Divorce))
            {
                return(true);
            }

            return(false);
        }
예제 #12
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if ((Sim.Partner == Target) && (Sim.IsMarried))
            {
                IncStat("Married");
                return(false);
            }

            Relationship relationship = ManagerSim.GetRelationship(Sim, Target);

            if (relationship == null)
            {
                return(false);
            }

            LongTermRelationship LTR = relationship.LTR;

            if (LTR == null)
            {
                return(false);
            }

            if (LTR.Liking <= Sims3.Gameplay.Actors.Sim.kRomanceUseLikingGate)
            {
                IncStat("Romance Gated");
                return(false);
            }
            else if (LTR.Liking <= Sims3.Gameplay.Actors.Sim.kWooHooUseLikingGate)
            {
                IncStat("WooHoo Gated");
                return(false);
            }
            else if (!relationship.AreRomantic())
            {
                IncStat("Not Romantic");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
예제 #13
0
        protected override bool TargetAllow(SimDescription sim)
        {
            Relationship relationship = ManagerSim.GetRelationship(Sim, Target);

            if (relationship == null)
            {
                IncStat("Bad Relation");
                return(false);
            }
            else if (!relationship.AreRomantic())
            {
                IncStat("Not Romantic");
                return(false);
            }

            LongTermRelationship LTR = relationship.LTR;

            if (LTR == null)
            {
                IncStat("Bad LTR");
                return(false);
            }
            else if (LTR.Liking <= Sims3.Gameplay.Actors.Sim.kRomanceUseLikingGate)
            {
                IncStat("Too Low");
                return(false);
            }

            if (mAffairStory == ManagerRomance.AffairStory.None)
            {
                if (!Romances.AllowAffair(this, Sim, Target, Managers.Manager.AllowCheck.None))
                {
                    IncStat("Affair Denied");
                    return(false);
                }
            }

            return(base.TargetAllow(sim));
        }
예제 #14
0
        public bool BumpToEngagement(Common.IStatGenerator stats, SimDescription a, SimDescription b)
        {
            if (a.Partner != b)
            {
                IncStat("BumpUp: Not Partner");
                stats.IncStat("BumpUp: Not Partner");
                return(false);
            }

            Relationship relation = ManagerSim.GetRelationship(a, b);

            while (relation.CurrentLTR != LongTermRelationshipTypes.Fiancee)
            {
                if (!BumpToHigherState(stats, a, b))
                {
                    break;
                }
            }

            if (relation.CurrentLTR != LongTermRelationshipTypes.Fiancee)
            {
                IncStat("BumpUp: Not Engaged");
                stats.IncStat("BumpUp: Not Engaged");
                return(false);
            }

            if (a.CreatedSim != null)
            {
                a.CreatedSim.BuffManager.AddElement(BuffNames.NewlyEngaged, Origin.FromSocialization);
            }

            if (b.CreatedSim != null)
            {
                b.CreatedSim.BuffManager.AddElement(BuffNames.NewlyEngaged, Origin.FromSocialization);
            }

            return(true);
        }
예제 #15
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Relationship relationship = ManagerSim.GetRelationship(Sim, Target);

            if (relationship == null)
            {
                return(false);
            }

            LongTermRelationship LTR = relationship.LTR;

            if (LTR == null)
            {
                return(false);
            }

            Sim.SetFirstKiss(Target);
            Sim.SetFirstRomance(Target);

            SetElapsedTime <DayOfLastFlirtOption>(Sim);
            SetElapsedTime <DayOfLastFlirtOption>(Target);

            if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
            {
                EventTracker.SendEvent(new AskOnDateEvent(Sim.CreatedSim, Target.CreatedSim, true));
            }

            Romances.BumpToHigherState(this, Sim, Target);

            IncStat(LTR.CurrentLTR.ToString());

            if (SimID.Matches(Flirts.PreviousLoveLoss, Sim))
            {
                Flirts.PreviousLoveLoss = null;
            }

            return(true);
        }
예제 #16
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.Partner != null)
            {
                Relationship relation = ManagerSim.GetRelationship(sim, sim.Partner);
                if (relation != null)
                {
                    if (relation.LTR.CurrentLTR == LongTermRelationshipTypes.Fiancee)
                    {
                        IncStat("Fiance");
                        return(false);
                    }
                }
            }

            if (!HasAnyValue <ArrangedMarriageCasteOption, CasteOptions>(sim))
            {
                IncStat("Caste Fail");
                return(false);
            }

            return(base.Allow(sim));
        }
예제 #17
0
        public bool BumpToHighestState(Common.IStatGenerator stats, SimDescription a, SimDescription b)
        {
            while (BumpToHigherState(stats, a, b))
            {
                ;
            }

            if ((!a.IsMarried) && (!b.IsMarried))
            {
                IncStat("BumpUp: Not Married");
                stats.IncStat("BumpUp: Not Married");
                return(false);
            }

            if (a.CreatedSim != null)
            {
                a.CreatedSim.BuffManager.AddElement(BuffNames.JustMarried, Origin.FromSocialization);
                a.CreatedSim.BuffManager.RemoveElement(BuffNames.NewlyEngaged);
                ActiveTopic.AddToSim(a.CreatedSim, "Wedding");
            }

            if (b.CreatedSim != null)
            {
                b.CreatedSim.BuffManager.AddElement(BuffNames.JustMarried, Origin.FromSocialization);
                b.CreatedSim.BuffManager.RemoveElement(BuffNames.NewlyEngaged);
                ActiveTopic.AddToSim(b.CreatedSim, "Wedding");
            }

            if ((a.CreatedSim != null) && (b.CreatedSim != null))
            {
                SocialCallback.GiveDaysOffIfRequired(a.CreatedSim, b.CreatedSim);
            }

            a.Genealogy.Marry(b.Genealogy);

            Relationship relationship = ManagerSim.GetRelationship(a, b);

            if (relationship != null)
            {
                MidlifeCrisisManager.OnBecameMarried(a, b);

                relationship.LTR.RemoveInteractionBit(LongTermRelationship.InteractionBits.Divorce);
                relationship.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.Marry);

                relationship.SetMarriedInGame();

                if (SeasonsManager.Enabled)
                {
                    relationship.WeddingAnniversary      = new WeddingAnniversary(SeasonsManager.CurrentSeason, (int)SeasonsManager.DaysElapsed);
                    relationship.WeddingAnniversary.SimA = relationship.SimDescriptionA;
                    relationship.WeddingAnniversary.SimB = relationship.SimDescriptionB;
                    relationship.WeddingAnniversary.CreateAlarm();
                }

                return(true);
            }
            else
            {
                IncStat("BumpUp: Relation Fail");
                stats.IncStat("BumpUp: Relation Fail");
                return(false);
            }
        }
예제 #18
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Career job = Career;

            if (job == null)
            {
                return(false);
            }

            Corrections.RemoveInvalidCoworkers(job);

            if (job.CareerLoc == null)
            {
                return(false);
            }

            job.CareerLoc.CheckWorkers();

            List <SimDescription> coworkers = new List <SimDescription>();

            if (job.Coworkers != null)
            {
                coworkers.AddRange(job.Coworkers);
            }

            foreach (SimDescription coworker in coworkers)
            {
                if (!IsValid(job, coworker, false))
                {
                    job.RemoveCoworker(coworker);

                    IncStat("Dropped: Bad");
                }
                else if (GetValue <MeetImmediatelyOption, bool>())
                {
                    Relationship relation = ManagerSim.GetRelationship(job.OwnerDescription, coworker);
                    if (relation != null)
                    {
                        relation.MakeAcquaintances();
                    }
                }
            }

            coworkers.Clear();
            if (job.Coworkers != null)
            {
                coworkers.AddRange(job.Coworkers);
            }

            foreach (SimDescription coworker in coworkers)
            {
                if ((job.Coworkers == null) || (job.Coworkers.Count <= job.SharedData.MaxCoworkers))
                {
                    break;
                }

                job.RemoveCoworker(coworker);
                IncStat("Dropped: Too Many");
            }

            int iRequired = (job.SharedData.MaxCoworkers - job.Coworkers.Count);

            AddScoring("Required", iRequired);

            for (int i = iRequired; i > 0; i--)
            {
                AddCoworker(job);
            }

            return(mNewCoworkers.Count > 0);
        }
예제 #19
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (mNewSim != null)
            {
                mSpecies = mNewSim.Species;
            }

            if (HouseholdsEx.IsFull(this, Sim.Household, mSpecies, 0, true, true))
            {
                IncStat("Full");
                return(false);
            }

            bool created = false;

            if (mNewSim == null)
            {
                using (SimFromBin <ManagerLot> simBin = new SimFromBin <ManagerLot>(this, Lots))
                {
                    CASAgeGenderFlags gender = BabyGenderScenario.GetGenderByFirstBorn(Manager, GetValue <ImmigrateScenario.GenderOption, BabyGenderScenario.FirstBornGender>(), false);

                    mNewSim = simBin.CreateNewSim(Ages, gender, mSpecies);
                    created = true;
                }
            }

            if (mNewSim != null)
            {
                if (Households.MoveSim(mNewSim, Sim.Household))
                {
                    mNewSim.LastName   = Sim.LastName;
                    mNewSim.WasAdopted = true;

                    Relationship relation = ManagerSim.GetRelationship(Sim, mNewSim);
                    if (relation != null)
                    {
                        relation.LTR.SetLiking(Delta);
                    }

                    Relationships.CheckAddHumanParentFlagOnAdoption(Sim, mNewSim);

                    if (Sim.Partner != null)
                    {
                        Relationships.CheckAddHumanParentFlagOnAdoption(Sim.Partner, mNewSim);
                    }

                    if (SimTypes.IsEquivalentSpecies(mNewSim, Sim))
                    {
                        Sim.Genealogy.AddChild(mNewSim.Genealogy);
                    }

                    UpdateDayOfLastOption(Sim);

                    if ((Sim.Partner != null) && (Sim.IsMarried))
                    {
                        if (SimTypes.IsEquivalentSpecies(mNewSim, Sim))
                        {
                            Sim.Partner.Genealogy.AddChild(mNewSim.Genealogy);
                        }

                        UpdateDayOfLastOption(Sim.Partner);
                    }
                    return(true);
                }
                else if (created)
                {
                    mNewSim.Dispose();
                    mNewSim = null;
                }
            }

            IncStat("No New Sim");
            return(false);
        }
예제 #20
0
        protected override bool TargetAllow(SimDescription sim)
        {
            Relationship relation = ManagerSim.GetRelationship(Sim, Target);

            if (relation == null)
            {
                return(false);
            }

            if ((!mForce) && (relation.LTR.Liking <= Sims3.Gameplay.Actors.Sim.kRomanceUseLikingGate))
            {
                IncStat("Under Gate");
                return(false);
            }
            else if ((!AllowAffair) && (ManagerRomance.IsAffair(Sim, Target)))
            {
                IncStat("Affair");
                return(false);
            }

            if (Sim.Partner == Target)
            {
                IncStat("Already Partner");
                return(false);
            }
            else if (!Romances.Allow(this, Sim, Target))
            {
                return(false);
            }

            if (!mForce)
            {
                if (relation.LTR.Liking < GetValue <PartnerLikingGateOption, int>())
                {
                    AddStat("No Like", relation.LTR.Liking);
                    return(false);
                }
                else if (!relation.AreRomantic())
                {
                    IncStat("Not Romantic");
                    return(false);
                }
                else if (GetElapsedTime <DayOfLastPartnerOption>(Sim) < GetValue <MinTimeFromBreakupToPartnerOption, int>())
                {
                    AddStat("Too Early", GetElapsedTime <DayOfLastPartnerOption>(Sim));
                    return(false);
                }
                else if (GetElapsedTime <DayOfLastPartnerOption>(Target) < GetValue <MinTimeFromBreakupToPartnerOption, int>())
                {
                    AddStat("Too Early", GetElapsedTime <DayOfLastPartnerOption>(Target));
                    return(false);
                }
                else if ((AddScoring("SettleDown", Target, Sim) <= 0) &&
                         (AddScoring("SettleDown", Sim, Target) <= 0))
                {
                    IncStat("Score Fail");
                    return(false);
                }
            }

            return(base.TargetAllow(sim));
        }
예제 #21
0
        public bool BumpToLowerState(Common.IStatGenerator stats, SimDescription a, SimDescription b, bool story)
        {
            if (a.Partner == b)
            {
                if ((!AllowBreakup(this, a, Managers.Manager.AllowCheck.None)) || (!AllowBreakup(this, b, Managers.Manager.AllowCheck.None)))
                {
                    IncStat("BumpDown: Breakup: User Denied");
                    stats.IncStat("BumpDown: Breakup: User Denied");
                    return(false);
                }

                SetElapsedTime <DayOfLastPartnerOption>(a);
                SetElapsedTime <DayOfLastPartnerOption>(b);

                try
                {
                    a.Partner = null;
                }
                catch (Exception e)
                {
                    Common.DebugException(a, e);
                }

                try
                {
                    b.Partner = null;
                }
                catch (Exception e)
                {
                    Common.DebugException(b, e);
                }

                if ((a.CreatedSim != null) && (a.CreatedSim.BuffManager != null))
                {
                    a.CreatedSim.BuffManager.RemoveElement(BuffNames.NewlyEngaged);
                    a.CreatedSim.BuffManager.RemoveElement(BuffNames.FirstKiss);
                    a.CreatedSim.BuffManager.RemoveElement(BuffNames.FirstRomance);
                    a.CreatedSim.BuffManager.RemoveElement(BuffNames.JustMarried);
                    a.CreatedSim.BuffManager.RemoveElement(BuffNames.WeddingDay);
                }

                if ((b.CreatedSim != null) && (b.CreatedSim.BuffManager != null))
                {
                    b.CreatedSim.BuffManager.RemoveElement(BuffNames.NewlyEngaged);
                    b.CreatedSim.BuffManager.RemoveElement(BuffNames.FirstKiss);
                    b.CreatedSim.BuffManager.RemoveElement(BuffNames.FirstRomance);
                    b.CreatedSim.BuffManager.RemoveElement(BuffNames.JustMarried);
                    b.CreatedSim.BuffManager.RemoveElement(BuffNames.WeddingDay);
                }

                if (story)
                {
                    Stories.PrintStory(this, "Breakup", new object[] { a, b }, null);
                }
            }

            Relationship relation = ManagerSim.GetRelationship(a, b);

            if (relation != null)
            {
                LongTermRelationshipTypes currentState = relation.LTR.CurrentLTR;

                LongTermRelationshipTypes nextState = ChangeRelationship.NextNegativeRomanceState(currentState, relation.IsPetToPetRelationship);
                if (nextState != LongTermRelationshipTypes.Undefined)
                {
                    float liking = relation.LTR.Liking;

                    AddStat("BumpDown: Pre", liking);
                    stats.AddStat("BumpDown: Pre", liking);

                    ForceChangeState(relation, nextState);

                    int score = AddScoring("BumpDown: Hate Loss", ScoringLookup.GetScore("HateRomanceLoss", b));
                    if ((SimTypes.IsSelectable(a)) || (SimTypes.IsSelectable(b)) || (stats.AddScoring("BumpDown: Hate Loss", score) <= 0))
                    {
                        if (liking > relation.LTR.Liking)
                        {
                            try
                            {
                                relation.LTR.SetLiking(liking);
                            }
                            catch (Exception e)
                            {
                                Common.DebugException(a, b, e);

                                IncStat("BumpDown: Reset Liking Fail");
                                stats.IncStat("BumpDown: Reset Liking Fail");
                            }
                        }
                    }

                    AddStat("BumpDown: Post", relation.LTR.Liking);
                    stats.AddStat("BumpDown: Post", relation.LTR.Liking);

                    IncStat("BumpDown " + relation.LTR.CurrentLTR);
                    stats.IncStat("BumpDown " + relation.LTR.CurrentLTR);
                }
            }
            return(true);
        }
예제 #22
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Relationship relationship = ManagerSim.GetRelationship(Sim, Target);

            if (relationship == null)
            {
                return(false);
            }

            LongTermRelationship LTR = relationship.LTR;

            if (LTR == null)
            {
                return(false);
            }

            if (Sim.TraitManager.HasElement(TraitNames.GreatKisser) || Target.TraitManager.HasElement(TraitNames.GreatKisser))
            {
                if (Sim.CreatedSim != null)
                {
                    ManagerSim.AddBuff(this, Sim, BuffNames.GreatKisser, Origin.FromSocialization);
                }
                if (Target.CreatedSim != null)
                {
                    ManagerSim.AddBuff(this, Target, BuffNames.GreatKisser, Origin.FromSocialization);
                }
            }

            if (SimID.Matches(Flirts.PreviousLoveLoss, Sim))
            {
                Flirts.PreviousLoveLoss = null;
            }

            if (LTR.Liking > Sims3.Gameplay.Actors.Sim.kWooHooUseLikingGate)
            {
                if (!Sim.HadFirstWooHoo)
                {
                    Sim.SetFirstWooHoo();

                    if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
                    {
                        EventTracker.SendEvent(EventTypeId.kHadFirstWoohoo, Sim.CreatedSim, Target.CreatedSim);
                    }
                }

                if (!Target.HadFirstWooHoo)
                {
                    Target.SetFirstWooHoo();

                    if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
                    {
                        EventTracker.SendEvent(EventTypeId.kHadFirstWoohoo, Target.CreatedSim, Sim.CreatedSim);
                    }
                }

                LTR.AddInteractionBit(LongTermRelationship.InteractionBits.Kissed);
                LTR.AddInteractionBit(LongTermRelationship.InteractionBits.WooHoo);

                if (Sim.IsHuman)
                {
                    Sim.SetFirstKiss(Target);
                    Target.SetFirstKiss(Sim);
                }
                else
                {
                    if ((Sim.CreatedSim != null) && (Target.CreatedSim != null))
                    {
                        EventTracker.SendEvent(EventTypeId.kPetWooHooed, Sim.CreatedSim, Target.CreatedSim);
                        EventTracker.SendEvent(EventTypeId.kPetWooHooed, Target.CreatedSim, Sim.CreatedSim);
                    }
                }

                if (mPregnancyChance != 0)
                {
                    Add(frame, new UnexpectedPregnancyScenario(Sim, Target, mPregnancyChance), ScenarioResult.Start);
                }
                else
                {
                    Romances.AddWoohooerNotches(Sim, Target, false, false);
                }
            }

            if (OnRomanceAffairScenario != null)
            {
                OnRomanceAffairScenario(this, frame);
            }

            return(false);
        }
예제 #23
0
        public bool BumpToHigherState(Common.IStatGenerator stats, SimDescription a, SimDescription b)
        {
            Relationship relation = ManagerSim.GetRelationship(a, b);

            if (relation == null)
            {
                IncStat("BumpUp: Bad Relation");
                stats.IncStat("BumpUp: Bad Relation");
                return(false);
            }

            LongTermRelationshipTypes currentState = relation.LTR.CurrentLTR;

            LongTermRelationshipTypes nextState = ChangeRelationship.NextPositiveRomanceState(currentState, relation.IsPetToPetRelationship);

            if (nextState == LongTermRelationshipTypes.Undefined)
            {
                IncStat("BumpUp: No Next Level");
                stats.IncStat("BumpUp: No Next Level");
                return(false);
            }

            if (currentState == LongTermRelationshipTypes.RomanticInterest)
            {
                if (Flirts.IsCloselyRelated(a, b))
                {
                    IncStat("BumpUp: Related");
                    stats.IncStat("BumpUp: Related");
                    return(false);
                }

                if ((!GetValue <AllowSteadyOption, bool>(a)) || (!GetValue <AllowSteadyOption, bool>(b)))
                {
                    IncStat("BumpUp: Steady Denied");
                    stats.IncStat("BumpUp: Steady Denied");
                    return(false);
                }

                if (!DumpOtherRomances(stats, a, b))
                {
                    return(false);
                }
                if (!DumpOtherRomances(stats, b, a))
                {
                    return(false);
                }

                if ((a.Partner != b) || (b.Partner != a))
                {
                    try
                    {
                        a.SetPartner(b);

                        SetElapsedTime <DayOfLastPartnerOption>(a);
                        SetElapsedTime <DayOfLastPartnerOption>(b);

                        SetElapsedTime <DayOfLastRomanceOption>(a);
                        SetElapsedTime <DayOfLastRomanceOption>(b);
                    }
                    catch (Exception e)
                    {
                        Common.DebugException(a, b, e);
                    }
                }
            }
            else if (currentState == LongTermRelationshipTypes.Partner)
            {
                if ((a.TeenOrBelow) || (b.TeenOrBelow))
                {
                    if ((!GetValue <AllowMarriageOption, bool>(a)) || (!GetValue <AllowMarriageOption, bool>(b)))
                    {
                        IncStat("BumpUp: Marriage Denied");
                        stats.IncStat("BumpUp: Marriage Denied");
                        return(false);
                    }
                    else if (GetValue <MarriageScenario.AllowTeenOnlyOnPregnancyOption, bool>())
                    {
                        if ((!a.IsPregnant) && (!b.IsPregnant))
                        {
                            IncStat("BumpUp: Non-Pregnant Marriage Denied");
                            stats.IncStat("BumpUp: Non-Pregnant Marriage Denied");
                            return(false);
                        }
                    }
                }

                relation.ProposerDesc = a;
            }

            float liking = relation.LTR.Liking;

            ForceChangeState(relation, nextState);

            if (liking > relation.LTR.Liking)
            {
                relation.LTR.SetLiking(liking);
            }

            if (currentState == relation.LTR.CurrentLTR)
            {
                IncStat("Invalid: " + currentState);
                stats.IncStat("Invalid: " + currentState);
                return(false);
            }

            IncStat("BumpUp: " + currentState + " to " + relation.LTR.CurrentLTR);
            stats.IncStat("BumpUp: " + currentState + " to " + relation.LTR.CurrentLTR);
            return(true);
        }
예제 #24
0
        protected bool AlterRelationship()
        {
            Relationship relation = ManagerSim.GetRelationship(Sim, Target);

            if (relation == null)
            {
                IncStat("No Relation");
                return(false);
            }

            int delta = Delta;

            if (delta == 0)
            {
                IncStat("No Delta");
                return(false);
            }

            if ((delta > 0) && (delta < 10))
            {
                delta = 10;
            }
            else if ((delta > -10) && (delta < 0))
            {
                delta = -10;
            }

            AddScoring("Delta", delta);

            try
            {
                int celebrity = GetValue <HobnobCelebrityPointsOption, int>();

                if (delta > 0)
                {
                    ManagerSim.AddBuff(Manager, Sim, BuffNames.Delighted, Origin.FromSocialization);
                    ManagerSim.AddBuff(Manager, Target, BuffNames.Delighted, Origin.FromSocialization);

                    delta = RandomUtil.GetInt(delta);

                    float value = 125;
                    if (delta > 75)
                    {
                        value = 1000;

                        celebrity *= 3;
                    }
                    else if (delta > 50)
                    {
                        value = 500;

                        celebrity *= 2;
                    }
                    else if (delta > 25)
                    {
                        value = 250;
                    }

                    if (IsRomantic)
                    {
                        relation.STC.Update(Sim, Target, CommodityTypes.Amorous, value);
                    }

                    relation.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.CelebrityImpressed);

                    relation.LTR.UpdateLiking(delta);
                }
                else
                {
                    if (GetValue <ExtremeHatredOption, bool>())
                    {
                        delta *= 2;
                    }

                    ManagerSim.AddBuff(Manager, Sim, BuffNames.Upset, Origin.FromSocialization);
                    ManagerSim.AddBuff(Manager, Target, BuffNames.Upset, Origin.FromSocialization);

                    delta = -RandomUtil.GetInt(-delta);

                    float value = 125;
                    if (delta < -75)
                    {
                        value = 1000;

                        celebrity *= 3;
                    }
                    else if (delta < -50)
                    {
                        value = 500;

                        celebrity *= 2;
                    }
                    else if (delta < -25)
                    {
                        value = 250;
                    }

                    relation.STC.Update(Sim, Target, CommodityTypes.Insulting, value);

                    relation.LTR.UpdateLiking(delta);
                }

                if (Sim.CelebrityLevel > Target.CelebrityLevel)
                {
                    Friends.AccumulateCelebrity(Target, celebrity);
                }
                else if (Sim.CelebrityLevel < Target.CelebrityLevel)
                {
                    Friends.AccumulateCelebrity(Sim, celebrity);
                }
            }
            catch (Exception e)
            {
                Common.DebugException(Sim, Target, e);
            }

            AddStat("Liking", relation.LTR.Liking);
            return(true);
        }