示例#1
0
        protected override void PrivatePerform(SimDescription sim, SimData data, ScenarioFrame frame)
        {
            PregnancySimData other = data.Get <PregnancySimData>();

            if (sim.IsPregnant)
            {
                if ((other.mLastCheckPregnancy != 0) && (other.mLastCheckPregnancy < SimClock.ElapsedCalendarDays()))
                {
                    if (!AllowProgression(sim))
                    {
                        // Delay pregnancy indefinitely
                        sim.Pregnancy.mHourOfPregnancy = other.mPregnancyHour;

                        IncStat("Pregnancy Suspended");
                    }
                    else
                    {
                        if (other.mPregnancyHour == sim.Pregnancy.mHourOfPregnancy)
                        {
                            IncStat(sim.FirstName + " " + sim.LastName + ": Stuck Pregnancy", Common.DebugLevel.High);

                            if (!SimTypes.IsSelectable(sim))
                            {
                                Sims.Reset(sim);

                                if ((sim.CreatedSim != null) && (sim.LotHome != null))
                                {
                                    SimDescription dad = ManagerSim.Find(sim.Pregnancy.DadDescriptionId);
                                    if (dad != null)
                                    {
                                        Sims.Instantiate(dad, sim.LotHome, false);
                                    }

                                    if (sim.Pregnancy.PreggersAlarm != AlarmHandle.kInvalidHandle)
                                    {
                                        AlarmManager.Global.RemoveAlarm(sim.Pregnancy.PreggersAlarm);
                                        sim.Pregnancy.PreggersAlarm = AlarmHandle.kInvalidHandle;
                                    }
                                    sim.Pregnancy.Continue(sim.CreatedSim, true);

                                    IncStat("Pregnancy Reset");
                                }
                            }
                        }
                    }
                }

                other.mPregnancyHour      = sim.Pregnancy.mHourOfPregnancy;
                other.mLastCheckPregnancy = SimClock.ElapsedCalendarDays();
            }
            else
            {
                other.mPregnancyHour      = 0;
                other.mLastCheckPregnancy = 0;
            }
        }
示例#2
0
        protected override void PrivatePerform(SimDescription sim, SimData data, ScenarioFrame frame)
        {
            MoodSimData other = data.Get <MoodSimData>();

            Sim createdSim = sim.CreatedSim;

            if ((createdSim != null) && (createdSim.InWorld) && (createdSim.Proxy != null) && (!SimTypes.IsSelectable(sim)))
            {
                if (createdSim.BuffManager != null)
                {
                    createdSim.BuffManager.RemoveElement(BuffNames.TooMuchSun);

                    if ((createdSim.BuffManager.HasElement(BuffNames.Starving)) ||
                        (createdSim.BuffManager.HasElement(BuffNames.MadlyThirsty)))
                    {
                        IncStat("Hunger Reset");

                        IncStat(sim.FullName + ": Stuck Sim", Common.DebugLevel.High);

                        Sims.Reset(sim);

                        other.mMoodPushedHome = 0;
                    }
                }

                if ((createdSim.MoodManager != null) && (createdSim.MoodManager.MoodFlavor == MoodFlavor.Miserable))
                {
                    if (other.mMoodPushedHome == 0)
                    {
                        if ((createdSim.InteractionQueue == null) || (sim.LotHome == null))
                        {
                            IncStat("Mood Reset");

                            IncStat(sim.FullName + ": Stuck Townie", Common.DebugLevel.High);

                            Sims.Reset(sim);

                            other.mMoodPushedHome = 0;
                        }
                        else
                        {
                            IncStat("Mood Push");

                            createdSim.InteractionQueue.CancelAllInteractions();
                            createdSim.InteractionQueue.Add(GoHome.Singleton.CreateInstance(sim.LotHome, createdSim, new Sims3.Gameplay.Interactions.InteractionPriority(Sims3.Gameplay.Interactions.InteractionPriorityLevel.UserDirected), false, true));

                            other.mMoodPushedHome = SimClock.ElapsedCalendarDays();
                        }
                    }
                    else if ((other.mMoodPushedHome + 1) < SimClock.ElapsedCalendarDays())
                    {
                        IncStat("Mood Reset");

                        IncStat(sim.FullName + ": Stuck Sim", Common.DebugLevel.High);

                        Sims.Reset(sim);

                        other.mMoodPushedHome = 0;
                    }
                }
                else
                {
                    other.mMoodPushedHome = 0;
                }
            }
        }
示例#3
0
 protected override void PrivatePerform(SimDescription sim, SimData data, ScenarioFrame frame)
 {
     data.Get <T>().Reset();
 }