Show the debug due date on the gizmo for Biotech pregnancies

This commit is contained in:
lutepickle 2023-02-28 18:02:20 -08:00
parent 5c27575446
commit ca895ef296
5 changed files with 18 additions and 8 deletions

Binary file not shown.

View File

@ -466,12 +466,6 @@ namespace RJW_Menstruation
pawn.story.traits.allTraits = selectedTraits;
}
public string DueDate()
{
if (pawn.Tile == -1) return "";
return GenDate.DateFullStringWithHourAt(GenDate.TickGameToAbs((int)p_end_tick), Find.WorldGrid.LongLatOf(pawn.Tile));
}
public override bool TryMergeWith(Hediff other)
{
return false;

View File

@ -48,8 +48,10 @@ namespace RJW_Menstruation
{
description
.AppendFormat("{0}: {1}\n", comp.curStage, comp.curStageHrs);
if (comp.Pregnancy is Hediff_MultiplePregnancy preg) description
.AppendFormat("due: {0}\n", preg.DueDate());
if (comp.Pregnancy is Hediff_BasePregnancy rjwpreg) description
.AppendFormat("due: {0}\n", rjwpreg.DueDate());
else if (comp.Pregnancy is Hediff_Pregnant biopreg) description
.AppendFormat("due: {0}\n", biopreg.DueDate());
description
.AppendFormat("fertcums: {0}\n" +
"ovarypower: {1}\n" +

View File

@ -304,5 +304,19 @@ namespace RJW_Menstruation
CopyBodyPartRecord(baby, original, Genital_Helper.get_uddersBPR(baby), Genital_Helper.get_uddersBPR(original));
CopyBodyPartRecord(baby, original, Genital_Helper.get_anusBPR(baby), Genital_Helper.get_anusBPR(original));
}
public static string DueDate(this Hediff_BasePregnancy preg)
{
if (preg.pawn.Tile == -1) return "";
return GenDate.DateFullStringWithHourAt(GenDate.TickGameToAbs((int)preg.p_end_tick), Find.WorldGrid.LongLatOf(preg.pawn.Tile));
}
public static string DueDate(this Hediff_Pregnant preg)
{
if (preg.pawn.Tile == -1) return "";
int ticksRemaining = (int)((1f - preg.GestationProgress) * preg.pawn.RaceProps.gestationPeriodDays * GenDate.TicksPerDay);
int dueTickAbs = GenTicks.TicksAbs + ticksRemaining;
return GenDate.DateFullStringWithHourAt(dueTickAbs, Find.WorldGrid.LongLatOf(preg.pawn.Tile));
}
}
}