Ejemplo n.º 1
0
        protected override OptionResult Run(Lot myLot, Household house)
        {
            try
            {
                AgingManager singleton = AgingManager.Singleton;

                string msg = null;

                foreach (SimDescription sim in Household.AllSimsLivingInWorld())
                {
                    msg += Common.NewLine + sim.FullName;
                    msg += Common.NewLine + " Aging Enabled: " + sim.AgingEnabled;

                    if (sim.AgingState == null)
                    {
                        msg += Common.NewLine + " No State";
                    }
                    else
                    {
                        msg += Common.NewLine + " Old Enough: " + singleton.SimIsOldEnoughToTransition(sim.AgingState);
                        msg += Common.NewLine + " DayPassed: " + sim.AgingState.DayPassedSinceLastTransition;
                        msg += Common.NewLine + " Stage: " + sim.Age;
                        msg += Common.NewLine + " Current: " + singleton.AgingYearsToSimDays(sim.AgingState.AgingYearsPassedSinceLastTransition);
                        msg += Common.NewLine + " Maximum: " + singleton.AgingYearsToSimDays(AgingManager.GetMaximumAgingStageLength(sim));

                        msg += Common.NewLine + " WithoutCake Alarm: " + sim.AgingState.AgeTransitionWithoutCakeAlarm;
                        msg += Common.NewLine + " EarlyMessage Alarm: " + sim.AgingState.AgeTransitionEarlyMessageAlarm;
                        msg += Common.NewLine + " EarlyMessage: " + sim.AgingState.AgeTransitionEarlyMessagesGiven;
                        msg += Common.NewLine + " Message Alarm: " + sim.AgingState.AgeTransitionMessageAlarm;
                        msg += Common.NewLine + " Message: " + sim.AgingState.AgeTransitionMessagesGiven;
                    }

                    msg += Common.NewLine;
                }

                Common.WriteLog(msg);
            }
            catch (Exception e)
            {
                Common.Exception(myLot, e);
            }
            return(OptionResult.SuccessClose);
        }
Ejemplo n.º 2
0
        public static bool MeetsCommonAfterschoolActivityRequirements(SimDescription actor, AfterschoolActivityType activityToCheck, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            bool teen = actor.Teen;

            if (!actor.Child && !teen)
            {
                return(false);
            }

            School school = actor.CareerManager.School;

            if (school == null)
            {
                return(false);
            }
            else if (actor.IsEnrolledInBoardingSchool())
            {
                return(false);
            }

            /*
             * else if (!AfterschoolActivity.WorldHasSchoolRabbitHole())
             * {
             *  return false;
             * }
             */
            else if (HasAfterschoolActivityOfType(actor, activityToCheck))
            {
                return(false);
            }
            else if (HasAfterschoolActivityOnDays(actor, GetDaysForActivityType(activityToCheck)))
            {
                greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(AfterschoolActivity.LocalizeString(actor.IsFemale, "DayConflict", new object[0x0]));
                return(false);
            }
            else if (DoesActivityConflictWithJob(actor, activityToCheck))
            {
                return(false);
            }
            else if (teen && school.HasCompletedTeenAfterschoolActivityRecital)
            {
                return(false);
            }
            else if (HasCompletedRecitalForType(school, activityToCheck))
            {
                return(false);
            }
            else if (IsChildActivity(activityToCheck) && AlreadyHasChildActivity(actor))
            {
                return(false);
            }

            AgingManager singleton = AgingManager.Singleton;
            float        num       = singleton.AgingYearsToSimDays(singleton.GetCurrentAgingStageLength(actor));
            float        num2      = singleton.AgingYearsToSimDays(actor.AgingYearsSinceLastAgeTransition);
            float        num3      = num - num2;

            if (num3 <= AfterschoolActivity.kDaysBeforeAgingTrigger)
            {
                greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(AfterschoolActivity.LocalizeString(actor.IsFemale, "AboutToAgeUp", new object[] { actor }));
                return(false);
            }

            return(true);
        }