Esempio n. 1
0
        public static new bool StartInternal(Sim abductee, SimDescription alien)
        {
            if (!CommonPregnancy.CanGetPregnant(abductee, true, out string reason))
            {
                Common.DebugNotify("Alien Pregnancy: Auto Fail - " + reason);
                return(false);
            }

            AgingManager.Singleton.CancelAgingAlarmsForSim(abductee.SimDescription.AgingState);

            if (abductee.IsHuman)
            {
                AlienPregnancyProxy pregnancy = new AlienPregnancyProxy(abductee, alien);
                pregnancy.PreggersAlarm = abductee.AddAlarmRepeating(1f, TimeUnit.Hours, new AlarmTimerCallback(pregnancy.HourlyCallback),
                                                                     1f, TimeUnit.Hours, "Hourly Alien Pregnancy Update Alarm", AlarmType.AlwaysPersisted);
                abductee.SimDescription.Pregnancy = pregnancy;
                EventTracker.SendEvent(new PregnancyEvent(EventTypeId.kGotPregnant, abductee, null, pregnancy, null));
            }
            else
            {
                Common.DebugNotify("Alien Pregnancy: Abductee is Pet");
                return(false);
            }

            ((AlienPregnancyProxy)abductee.SimDescription.Pregnancy).ApplyInitialMutationFactors();

            return(true);
        }
Esempio n. 2
0
        public static bool ShouldImpregnate(Sim abductee, SimDescription alien)
        {
            if (!CommonPregnancy.CanGetPregnant(abductee, true, out string reason))
            {
                Common.DebugNotify("Alien Pregnancy: Auto Fail - " + reason);
                return(false);
            }

            float chance = CommonPregnancy.sGetChanceOfSuccess(abductee, alien);

            return(RandomUtil.RandomChance(chance));
        }