private static Pregnancy StartPregnancy(Sim woman, Sim man, bool isAutonomous, bool playChimes) { string reason; GreyedOutTooltipCallback callback = null; if (!CanGetPreggers(woman, isAutonomous, ref callback, out reason)) { if (callback != null) { Common.DebugNotify("Pregnancy: " + callback(), woman); } return(null); } else if (woman.SimDescription.IsPregnant) { Common.DebugNotify("Already Pregnant", woman); return(woman.SimDescription.Pregnancy); } Pregnancy p = Pregnancies.Start(woman, man.SimDescription, !Woohooer.Settings.mAllowPlantSimPregnancy); if (p != null) { if ((playChimes) && ((woman.IsSelectable) || (man.IsSelectable))) { Audio.StartSound("sting_baby_conception"); } Common.DebugNotify("Pregnancy: Success", woman); } return(p); }
public override void Perform(Sim sim, DiseaseVector vector) { if (sim.SimDescription.IsPregnant) { return; } if (mClone) { Pregnancies.Start(sim, sim.SimDescription, mHandlePlantSim); } else if (vector.Infector != 0) { SimDescription other = SimDescription.Find(vector.Infector); if (other != null) { if (!mAllowCloseRelations) { if (Relationships.IsCloselyRelated(sim.SimDescription, other, false)) { return; } } Pregnancies.Start(sim, other, mHandlePlantSim); } } }
public static bool Perform(SimDescription a, SimDescription b, bool applyAll) { if (b == a) { return(Perform(a, (SimDescription)null, applyAll)); } else if (a == null) { if (b == null) { return(true); } return(Perform(b, a, applyAll)); } Sim woman = a.CreatedSim; if (woman == null) { return(true); } Sim man = null; if (b != null) { man = b.CreatedSim; } else { man = woman; } string reason = null; if (!Pollinate.Allow(woman, ref reason)) { Common.Notify(reason); return(true); } if (Pregnancies.Start(woman, man.SimDescription, false) != null) { if (!applyAll) { SimpleMessageDialog.Show(Common.Localize("Pollinate:MenuName"), Common.Localize("Pollinate:Success", woman.IsFemale, new object[] { woman })); } else { Common.Notify(Common.Localize("Pollinate:Success", woman.IsFemale, new object[] { woman })); } } return(true); }
public override bool InRabbitHole() { try { SimDescription male; int num; if (!PetAdoption.BreedMare(Actor, Target, Horse.FullName, out male, out num)) { return(false); } CancellableByPlayer = false; Pregnancies.Start(Horse, male, false); Actor.ModifyFunds(-num); EventTracker.SendEvent(new WooHooEvent(EventTypeId.kWooHooed, Horse, null, Target)); StartStages(); BeginCommodityUpdates(); bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); AssignHorseAndPosture(Horse, RabbitHole.SimRabbitHoleState.Leading); EndCommodityUpdates(succeeded); return(succeeded); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }