Merge branch 'dev'

This commit is contained in:
lutepickle 2022-08-27 19:49:49 -07:00
commit 7678a39368
16 changed files with 76 additions and 24 deletions

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -393,11 +393,8 @@ namespace RJW_Menstruation
{
get
{
if (!eggs.NullOrEmpty()) foreach (Egg egg in eggs)
{
if (egg.fertilized) return egg.fertstage;
}
return -1;
if (eggs.NullOrEmpty()) return -1;
return eggs.Max(egg => egg.fertstage);
}
}
public IEnumerable<Pawn> GetCummersAndFertilizers()
@ -567,6 +564,12 @@ namespace RJW_Menstruation
return;
}
if (Pregnancy != null && curStage != Stage.Pregnant)
{
Log.Warning($"{Pawn}'s womb has a pregnancy, but was not in the pregnant stage");
curStage = Stage.Pregnant;
}
CumOut();
if (pregnancy == null && Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
switch (curStage)
@ -627,7 +630,7 @@ namespace RJW_Menstruation
Log.Warning($"Attempted to remove menstruation comp from wrong pawn ({Pawn}).");
return;
}
if (!(pregnancy is Hediff_MechanoidPregnancy))
if (pregnancy != null && !(pregnancy is Hediff_MechanoidPregnancy))
pregnancy.Miscarry();
base.CompPostPostRemoved();
}
@ -824,7 +827,7 @@ namespace RJW_Menstruation
if (cums.NullOrEmpty()) return;
if (TotalCum > Props.maxCumCapacity * Pawn.BodySize) leakfactor = Math.Min(1 + (TotalCum - Props.maxCumCapacity * Pawn.BodySize) / 10, 2f);
if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f;
if (Pawn.jobs?.curJob?.def == xxx.knotted) leakfactor = 0f;
if (Pawn.CurJobDef == xxx.knotted) leakfactor = 0f;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
@ -1179,22 +1182,26 @@ namespace RJW_Menstruation
continue;
else if (egg.fertilizer == null)
{
if (Configurations.Debug) Log.Message($"Could not implant {Pawn}'s egg due to null father");
deadeggs.Add(egg);
continue;
}
else if (Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any() || pregnancy is Hediff_MechanoidPregnancy)
{
if (Configurations.Debug) Log.Message($"Could not implant {Pawn}'s egg due to insect or mechanoid pregnancy");
deadeggs.Add(egg);
continue;
}
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn}, father {egg.fertilizer}");
if (pregnancy != null)
{
if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins)
{
if (pregnancy is Hediff_MultiplePregnancy h)
{
if (Configurations.Debug) Log.Message($"Adding to existing pregnancy");
h.AddNewBaby(Pawn, egg.fertilizer);
}
pregnant = true;
@ -1210,6 +1217,7 @@ namespace RJW_Menstruation
{
if (!Configurations.UseMultiplePregnancy)
{
if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy");
PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
// I hate having to do this, but it gets the newest pregnancy
pregnancy = Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID);
@ -1218,6 +1226,7 @@ namespace RJW_Menstruation
}
else
{
if (Configurations.Debug) Log.Message($"Creating new pregnancy");
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer);
pregnant = true;
deadeggs.Add(egg);
@ -1225,7 +1234,11 @@ namespace RJW_Menstruation
}
}
else deadeggs.Add(egg);
else
{
if (Configurations.Debug) Log.Message($"Fertilized egg of {Pawn} failed to implant (father {egg.fertilizer})");
deadeggs.Add(egg);
}
}
if (pregnant && (!Configurations.UseMultiplePregnancy || !Configurations.EnableHeteroOvularTwins))

View file

@ -123,7 +123,7 @@ namespace RJW_Menstruation
{
for (int i = babycount; i > 1; i--)
{
Texture2D result = ContentFinder<Texture2D>.Get((path + "_Multiplet_" + i), false);
Texture2D result = ContentFinder<Texture2D>.Get(path + "_Multiplet_" + i, false);
if (result != null) return result;
}
return null;
@ -155,14 +155,30 @@ namespace RJW_Menstruation
Texture2D cumtex = ContentFinder<Texture2D>.Get((icon), true);
return cumtex;
}
public static Texture2D GetInsectEggedIcon(this HediffComp_Menstruation comp)
{
List<Hediff_InsectEgg> hediffs = comp.Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().ToList();
if (hediffs.NullOrEmpty()) return null;
string path = "Womb/Insect_Egged/";
if (hediffs.Max(hediff => hediff.eggssize) > 0.3) // The threshold for "large egg" in the debug
{
if (hediffs.Count == 1) return ContentFinder<Texture2D>.Get(path + "Womb_Egged_Large", true);
else return ContentFinder<Texture2D>.Get(path + "Womb_Egged_ManyMixed", true);
}
Texture2D result = ContentFinder<Texture2D>.Get(path + "Womb_Egged_" + hediffs.Count(), false);
if (result == null) result = ContentFinder<Texture2D>.Get(path + "Womb_Egged_Many", true);
return result;
}
public static Texture2D GetWombIcon(this HediffComp_Menstruation comp)
{
if (comp.Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().FirstOrDefault() != null) return ContentFinder<Texture2D>.Get(("Womb/Womb_Egged"), true);
Texture2D wombtex = comp.GetInsectEggedIcon();
if (wombtex != null) return wombtex;
string icon = comp.WombTex;
HediffComp_Menstruation.Stage stage = comp.curStage;
if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding";
Texture2D wombtex = ContentFinder<Texture2D>.Get((icon), true);
wombtex = ContentFinder<Texture2D>.Get(icon, true);
return wombtex;
}
@ -179,7 +195,15 @@ namespace RJW_Menstruation
case HediffComp_Menstruation.Stage.Follicular:
case HediffComp_Menstruation.Stage.ClimactericFollicular:
if (!includeOvary) break;
if (comp is HediffComp_InducedOvulator) break;
if (comp is HediffComp_InducedOvulator)
{
if (comp.Pawn.jobs.curDriver is JobDriver_Sex job &&
job.Sexprops != null &&
!job.Sexprops.usedCondom &&
(job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))
return ContentFinder<Texture2D>.Get("Ovaries/Ovary_01", true);
else break;
}
if (comp.curStageHrs > comp.CurStageIntervalHours - 30) // Approximate time for ovulation to occur
return ContentFinder<Texture2D>.Get("Ovaries/Ovary_01", true);
else break;

View file

@ -728,8 +728,15 @@ namespace RJW_Menstruation
public string DueDate()
{
if (pawn.Map == null) return "";
return GenDate.DateFullStringWithHourAt(GenDate.TickGameToAbs((int)p_end_tick), Find.WorldGrid.LongLatOf(pawn.Map.Tile));
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)
{
if (other is Hediff_MultiplePregnancy preg)
return this.GetMenstruationComp() == preg.GetMenstruationComp();
else return base.TryMergeWith(other);
}
}

View file

@ -88,7 +88,7 @@ namespace RJW_Menstruation
Color c = comp.GetCumMixtureColor;
Gizmo gizmo = new Gizmo_Womb
return new Gizmo_Womb
{
defaultLabel = pawn.LabelShort,
defaultDesc = description,
@ -98,16 +98,14 @@ namespace RJW_Menstruation
cumcolor = c,
comp = comp,
order = 100,
hotKey = VariousDefOf.OpenStatusWindowKey,
hotKey = comp == pawn.GetFirstMenstruationComp() ? VariousDefOf.OpenStatusWindowKey : null,
groupKey = 0,
action = delegate
{
Dialog_WombStatus.ToggleWindow(pawn, comp);
}
};
return gizmo;
}
}

View file

@ -38,8 +38,11 @@ namespace RJW_Menstruation
}
public override bool GroupsWith(Gizmo other)
{
if (other is Gizmo_Womb womb && womb.comp != this.comp) return false;
else return base.GroupsWith(other);
}
}
}

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RJW Menstruation</identifier>
<version>1.0.7.2</version>
<version>1.0.7.3</version>
<dependencies>
</dependencies>
<incompatibleWith />

View file

@ -1,6 +1,13 @@
Version 1.0.7.3
- Fix null reference error upon birth of female pawns.
- Properly display multiple icons for pawns with multiple wombs.
- Fix only a single womb being able to become pregnant at a time. Requires multiple pregnancy enabled in the options.
- Show the 'about to ovulate' icon in the womb dialog for induced ovulators during vaginal sex.
- Display more insect eggs in a womb when someone has more, with new graphics by Euldrop.
Version 1.0.7.2
- Fix errors when trying to open dev actions when HAR is not installed
- Fix "error processing breasts" for pawns with vanilla pregnancy (e.g. animals)
- Fix errors when trying to open dev actions when HAR is not installed.
- Fix "error processing breasts" for pawns with vanilla pregnancy (e.g. animals).
- Removing a vagina won't end a mechanoid implant anymore.
Version 1.0.7.1