Skip to content
Snippets Groups Projects
Commit 46c7dec2 authored by Ed86's avatar Ed86
Browse files

fix for miscarrying mechanoid pregnancies

parent 022e6cf5
No related branches found
No related tags found
No related merge requests found
......@@ -178,30 +178,35 @@ namespace rjw
{
ageTicks++;
if (pawn.IsHashIntervalTick(1000))
{
//Log.Message("[RJW] Pregnancy is ticking for " + pawn + " this is " + this.def.defName + " will end in " + 1/progress_per_tick/TicksPerDay + " days resulting in "+ babies[0].def.defName);
if (pawn.needs.food != null && pawn.needs.food.CurCategory == HungerCategory.Starving && Rand.MTBEventOccurs(0.5f, TicksPerDay, MiscarryCheckInterval))
if (!pawn.health.hediffSet.HasHediff(HediffDef.Named("RJW_pregnancy_mech")))
{
if (Visible && PawnUtility.ShouldSendNotificationAbout(pawn))
//Log.Message("[RJW] Pregnancy is ticking for " + pawn + " this is " + this.def.defName + " will end in " + 1/progress_per_tick/TicksPerDay + " days resulting in "+ babies[0].def.defName);
//Rand.PopState();
//Rand.PushState(RJW_Multiplayer.PredictableSeed());
//miscarry after starving 0.5 day
if (pawn.needs.food != null && pawn.needs.food.CurCategory == HungerCategory.Starving && Rand.MTBEventOccurs(0.5f, TicksPerDay, MiscarryCheckInterval))
{
string text = "MessageMiscarriedStarvation".Translate(pawn.LabelIndefinite()).CapitalizeFirst();
Messages.Message(text, pawn, MessageTypeDefOf.NegativeHealthEvent);
if (Visible && PawnUtility.ShouldSendNotificationAbout(pawn))
{
string text = "MessageMiscarriedStarvation".Translate(pawn.LabelIndefinite()).CapitalizeFirst();
Messages.Message(text, pawn, MessageTypeDefOf.NegativeHealthEvent);
}
Miscarry();
return;
}
Miscarry();
return;
}
//let beatings only be important when pregnancy is developed somewhat
if (Visible && IsSeverelyWounded && Rand.MTBEventOccurs(0.5f, TicksPerDay, MiscarryCheckInterval))
{
if (Visible && PawnUtility.ShouldSendNotificationAbout(pawn))
//let beatings only be important when pregnancy is developed somewhat
//miscarry after SeverelyWounded 0.5 day
if (Visible && IsSeverelyWounded && Rand.MTBEventOccurs(0.5f, TicksPerDay, MiscarryCheckInterval))
{
string text = "MessageMiscarriedPoorHealth".Translate(pawn.LabelIndefinite()).CapitalizeFirst();
Messages.Message(text, pawn, MessageTypeDefOf.NegativeHealthEvent);
if (Visible && PawnUtility.ShouldSendNotificationAbout(pawn))
{
string text = "MessageMiscarriedPoorHealth".Translate(pawn.LabelIndefinite()).CapitalizeFirst();
Messages.Message(text, pawn, MessageTypeDefOf.NegativeHealthEvent);
}
Miscarry();
return;
}
Miscarry();
return;
}
}
if (xxx.has_quirk(pawn, "Breeder"))
GestationProgress += progress_per_tick * 1.25f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment