Exemplo n.º 1
0
            public void HourlyCallback()
            {
                if (GameUtils.IsOnVacation() || GameUtils.IsUniversityWorld())
                {
                    return;
                }

                Pregnancy.mHourOfPregnancy++;

                if (Pregnancy.mHourOfPregnancy >= Abductor.Settings.mHourToStartPregnantWalk)
                {
                    ActiveTopic.AddToSim(Abductee, "Pregnant", Abductee.SimDescription);

                    if (!Pregnancy.mHasRequestedWalkStyle)
                    {
                        Pregnancy.mHasRequestedWalkStyle = Abductee.RequestWalkStyle(Sim.WalkStyle.Pregnant);
                    }
                }

                if (Pregnancy.mHourOfPregnancy == Abductor.Settings.mHourToStartLabor)
                {
                    for (int i = 0; i < Pregnancy.kNumberOfPuddlesForWaterBreak; i++)
                    {
                        PuddleManager.AddPuddle(Abductee.PositionOnFloor);
                    }

                    if (Abductee.IsSelectable)
                    {
                        StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Gameplay/ActorSystems/Pregnancy:BabyIsComingTNS",
                                                                                                          new object[] { Abductee }), StyledNotification.NotificationStyle.kGameMessageNegative));
                    }

                    //Abductee.BuffManager.RemoveElement(AbductionBuffs.sXenogenesis);
                    Abductee.BuffManager.AddElement(BuffsAndTraits.sBabyIsComing, Origin.FromPregnancy);

                    if (Pregnancy.mContractionBroadcast != null)
                    {
                        Pregnancy.mContractionBroadcast.Dispose();
                    }

                    Pregnancy.mContractionBroadcast = new ReactionBroadcaster(Abductee, Pregnancy.kContractionBroadcasterParams,
                                                                              new ReactionBroadcaster.BroadcastCallback(StartReaction), new ReactionBroadcaster.BroadcastCallback(CancelReaction));

                    Abductee.AddInteraction(TakeToHospitalEx.Singleton);
                    InteractionInstance interaction = Pregnancy.HaveContraction.Singleton.CreateInstance(Abductee, Abductee,
                                                                                                         new InteractionPriority(InteractionPriorityLevel.High, 10f), false, false);
                    interaction.Hidden = true;
                    Abductee.InteractionQueue.Add(interaction);
                    Pregnancy.mContractionsAlarm = Abductee.AddAlarmRepeating(5f, TimeUnit.Minutes, new AlarmTimerCallback(Pregnancy.TriggerContraction),
                                                                              5f, TimeUnit.Minutes, "Alien Pregnancy Trigger Contractions Alarm", AlarmType.AlwaysPersisted);
                    EventTracker.SendEvent(EventTypeId.kPregnancyContractionsStarted, Abductee);
                }

                if (Pregnancy.mHourOfPregnancy == Abductor.Settings.mHoursOfPregnancy)
                {
                    HaveTheBaby();
                }

                SetPregnancyMorph();
            }
Exemplo n.º 2
0
 public void StartPregnancy()
 {
     AgingManager.Singleton.CancelAgingAlarmsForSim(Abductee.SimDescription.AgingState);
     Pregnancy.PreggersAlarm = Abductee.AddAlarmRepeating(1f, TimeUnit.Hours, new AlarmTimerCallback(HourlyCallback),
                                                          1f, TimeUnit.Hours, "Hourly Alien Pregnancy Update Alarm", AlarmType.AlwaysPersisted);
 }