mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2026-06-18 19:36:20 +00:00
Compare commits
11 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5df8b1dce | ||
|
|
d8b98ca05e | ||
|
|
a8caad85c6 | ||
|
|
ef909091f8 | ||
|
|
8341d3f213 | ||
|
|
1600f0ea58 | ||
|
|
18d316c26b | ||
|
|
82216c5a7d | ||
|
|
c38464c806 | ||
|
|
714eba8e9c | ||
|
|
df134584d7 |
17 changed files with 202 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -343,3 +343,6 @@ healthchecksdb
|
||||||
*.psd
|
*.psd
|
||||||
*.dds
|
*.dds
|
||||||
*.pdn
|
*.pdn
|
||||||
|
|
||||||
|
Directory.Build.props
|
||||||
|
Directory.Build.targets
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
11
1.6/Defs/RJWTab/PawnColumnDefs_Menstruation.xml
Normal file
11
1.6/Defs/RJWTab/PawnColumnDefs_Menstruation.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Defs>
|
||||||
|
<PawnColumnDef>
|
||||||
|
<defName>RJWMenstruation_Womb</defName>
|
||||||
|
<headerIcon>Womb/Womb</headerIcon>
|
||||||
|
<headerTip>Open womb status. Click the header to sort by womb presence and cycle stage.</headerTip>
|
||||||
|
<workerClass>RJW_Menstruation.MainTab.PawnColumnWorker_WombStatus</workerClass>
|
||||||
|
<sortable>true</sortable>
|
||||||
|
<width>34</width>
|
||||||
|
</PawnColumnDef>
|
||||||
|
</Defs>
|
||||||
Binary file not shown.
19
1.6/Patches/RJW_PawnTableDefs.xml
Normal file
19
1.6/Patches/RJW_PawnTableDefs.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Patch>
|
||||||
|
<Operation Class="PatchOperationSequence">
|
||||||
|
<operations>
|
||||||
|
<li Class="PatchOperationInsert">
|
||||||
|
<xpath>/Defs/PawnTableDef[defName="RJW_PawnTable_Colonists"]/columns/li[text()="Pregnant"]</xpath>
|
||||||
|
<value>
|
||||||
|
<li>RJWMenstruation_Womb</li>
|
||||||
|
</value>
|
||||||
|
</li>
|
||||||
|
<li Class="PatchOperationInsert">
|
||||||
|
<xpath>/Defs/PawnTableDef[defName="RJW_PawnTable_Property"]/columns/li[text()="Pregnant"]</xpath>
|
||||||
|
<value>
|
||||||
|
<li>RJWMenstruation_Womb</li>
|
||||||
|
</value>
|
||||||
|
</li>
|
||||||
|
</operations>
|
||||||
|
</Operation>
|
||||||
|
</Patch>
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -169,6 +169,13 @@ namespace RJW_Menstruation
|
||||||
Scribe_Values.Look(ref useCustomColor, "useCustomColor", false);
|
Scribe_Values.Look(ref useCustomColor, "useCustomColor", false);
|
||||||
Scribe_Values.Look(ref customColor, "customColor", default);
|
Scribe_Values.Look(ref customColor, "customColor", default);
|
||||||
Scribe_Defs.Look(ref filthDef, "filthDef");
|
Scribe_Defs.Look(ref filthDef, "filthDef");
|
||||||
|
if (Scribe.mode == LoadSaveMode.PostLoadInit &&
|
||||||
|
(Single.IsInfinity(FertVolume) || Single.IsNaN(FertVolume) || volume < 0f))
|
||||||
|
{
|
||||||
|
Log.Error($"Invalid amount of {pawn}'s cum in a womb");
|
||||||
|
volume = 0;
|
||||||
|
fertility = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MakeThinner(float speed)
|
public void MakeThinner(float speed)
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ namespace RJW_Menstruation
|
||||||
protected int? opcache = null;
|
protected int? opcache = null;
|
||||||
protected float antisperm = 0.0f;
|
protected float antisperm = 0.0f;
|
||||||
// RJW pregnancy, or Biotech pregnancy/labor/laborpushing
|
// RJW pregnancy, or Biotech pregnancy/labor/laborpushing
|
||||||
protected Hediff pregnancy = null;
|
protected Hediff pregnancy = null; // Remove, instead reference per-genital pregnancy list
|
||||||
|
|
||||||
protected int eggLifeSpanTicks = GenDate.DaysToTicks(2);
|
protected int eggLifeSpanTicks = GenDate.DaysToTicks(2);
|
||||||
protected EstrusLevel estrusLevel = EstrusLevel.Visible;
|
protected EstrusLevel estrusLevel = EstrusLevel.Visible;
|
||||||
|
|
@ -313,7 +313,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
StatDefOf.Fertility.Worker.ClearCacheForThing(Pawn); // No effect for now, but a future RW update might add caching for this
|
StatDefOf.Fertility.Worker.ClearCacheForThing(Pawn); // No effect for now, but a future RW update might add caching for this
|
||||||
calculatingOvulationChance = true;
|
calculatingOvulationChance = true;
|
||||||
ovulationChance *= PawnCapacityUtility.CalculateCapacityLevel(Pawn.health.hediffSet, xxx.reproduction);
|
ovulationChance *= PawnCapacityUtility.CalculateCapacityLevel(Pawn.health.hediffSet, xxx.reproduction); // Add genital fertility
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -882,6 +882,11 @@ namespace RJW_Menstruation
|
||||||
return cums?.Find(cum => !cum.notcum && cum.pawn == pawn);
|
return cums?.Find(cum => !cum.notcum && cum.pawn == pawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Cum> GetFluids()
|
||||||
|
{
|
||||||
|
return cums ?? Enumerable.Empty<Cum>();
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerable<Cum> GetFluids(Pawn pawn)
|
public IEnumerable<Cum> GetFluids(Pawn pawn)
|
||||||
{
|
{
|
||||||
return cums?.Where(cum => cum.pawn == pawn) ?? Enumerable.Empty<Cum>();
|
return cums?.Where(cum => cum.pawn == pawn) ?? Enumerable.Empty<Cum>();
|
||||||
|
|
@ -1476,7 +1481,7 @@ namespace RJW_Menstruation
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn} into {parent}, father {egg.fertilizer}");
|
if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn} into {parent}, father {egg.fertilizer}");
|
||||||
if (pregnancy == null)
|
if (pregnancy == null) // Support pregnancy list, maybe split off into function
|
||||||
{
|
{
|
||||||
Configurations.PregnancyType usePregnancy = xxx.is_human(Pawn) ? Configurations.PregnancySource : Configurations.PregnancyType.MultiplePregnancy;
|
Configurations.PregnancyType usePregnancy = xxx.is_human(Pawn) ? Configurations.PregnancySource : Configurations.PregnancyType.MultiplePregnancy;
|
||||||
switch (usePregnancy)
|
switch (usePregnancy)
|
||||||
|
|
@ -1494,7 +1499,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
case Configurations.PregnancyType.MultiplePregnancy:
|
case Configurations.PregnancyType.MultiplePregnancy:
|
||||||
if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy");
|
if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy");
|
||||||
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer);
|
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer); // Add fertility comp of mother
|
||||||
pregnant = true;
|
pregnant = true;
|
||||||
deadeggs.Add(egg);
|
deadeggs.Add(egg);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
using RimWorld;
|
||||||
|
using UnityEngine;
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace RJW_Menstruation.MainTab
|
||||||
|
{
|
||||||
|
public class PawnColumnWorker_WombStatus : PawnColumnWorker
|
||||||
|
{
|
||||||
|
private const float CellIconSize = 24f;
|
||||||
|
private const float ProgressBarHeight = 2f;
|
||||||
|
private const float IconScale = 0.85f;
|
||||||
|
private const int HasVisibleWombOffset = 100;
|
||||||
|
|
||||||
|
public override void DoCell(Rect rect, Pawn pawn, PawnTable table)
|
||||||
|
{
|
||||||
|
HediffComp_Menstruation comp = GetDisplayComp(pawn);
|
||||||
|
if (comp == null) return;
|
||||||
|
|
||||||
|
Gizmo_Womb gizmo = Pawn_GetGizmos.CreateGizmo_WombStatus(pawn, comp);
|
||||||
|
Rect iconRect = new Rect(
|
||||||
|
rect.x + (rect.width - CellIconSize) / 2f,
|
||||||
|
rect.y + Mathf.Max((rect.height - CellIconSize) / 2f, 0f),
|
||||||
|
CellIconSize,
|
||||||
|
CellIconSize);
|
||||||
|
|
||||||
|
DrawCellIcon(iconRect, gizmo);
|
||||||
|
|
||||||
|
if (Mouse.IsOver(iconRect) && !gizmo.defaultDesc.NullOrEmpty())
|
||||||
|
{
|
||||||
|
TooltipHandler.TipRegion(iconRect, gizmo.defaultDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Widgets.ButtonInvisible(iconRect, doMouseoverSound: false))
|
||||||
|
{
|
||||||
|
Dialog_WombStatus.ToggleWindow(pawn, comp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetMinWidth(PawnTable table)
|
||||||
|
{
|
||||||
|
return 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetMaxWidth(PawnTable table)
|
||||||
|
{
|
||||||
|
return GetMinWidth(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetMinCellHeight(Pawn pawn)
|
||||||
|
{
|
||||||
|
return 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int Compare(Pawn a, Pawn b)
|
||||||
|
{
|
||||||
|
int result = GetSortValue(a).CompareTo(GetSortValue(b));
|
||||||
|
if (result != 0) return result;
|
||||||
|
|
||||||
|
return string.CompareOrdinal(a.LabelShortCap, b.LabelShortCap);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static HediffComp_Menstruation GetDisplayComp(Pawn pawn)
|
||||||
|
{
|
||||||
|
if (!pawn.ShowStatus() || !pawn.ShouldCycle()) return null;
|
||||||
|
|
||||||
|
HediffComp_Menstruation comp = pawn.GetFirstMenstruationComp();
|
||||||
|
if (comp == null) return null;
|
||||||
|
|
||||||
|
if (!Configurations.ShowInfertileIcon &&
|
||||||
|
(comp.CurrentVisibleStage == HediffComp_Menstruation.Stage.Infertile ||
|
||||||
|
comp.CurrentVisibleStage == HediffComp_Menstruation.Stage.None))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return comp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int GetSortValue(Pawn pawn)
|
||||||
|
{
|
||||||
|
if (!pawn.ShowStatus() || !pawn.ShouldCycle()) return int.MinValue;
|
||||||
|
|
||||||
|
HediffComp_Menstruation comp = pawn.GetFirstMenstruationComp();
|
||||||
|
if (comp == null) return int.MinValue + 1;
|
||||||
|
|
||||||
|
return HasVisibleWombOffset + GetStageSortValue(comp.CurrentVisibleStage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int GetStageSortValue(HediffComp_Menstruation.Stage stage)
|
||||||
|
{
|
||||||
|
switch (stage)
|
||||||
|
{
|
||||||
|
case HediffComp_Menstruation.Stage.Luteal:
|
||||||
|
return 9;
|
||||||
|
case HediffComp_Menstruation.Stage.Ovulatory:
|
||||||
|
return 8;
|
||||||
|
case HediffComp_Menstruation.Stage.Follicular:
|
||||||
|
return 7;
|
||||||
|
case HediffComp_Menstruation.Stage.Pregnant:
|
||||||
|
return 6;
|
||||||
|
case HediffComp_Menstruation.Stage.Bleeding:
|
||||||
|
return 5;
|
||||||
|
case HediffComp_Menstruation.Stage.Recover:
|
||||||
|
return 4;
|
||||||
|
case HediffComp_Menstruation.Stage.Anestrus:
|
||||||
|
return 3;
|
||||||
|
case HediffComp_Menstruation.Stage.Infertile:
|
||||||
|
return 2;
|
||||||
|
case HediffComp_Menstruation.Stage.None:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DrawCellIcon(Rect rect, Gizmo_Womb gizmo)
|
||||||
|
{
|
||||||
|
Texture baseIcon = gizmo.icon ?? BaseContent.BadTex;
|
||||||
|
Texture overlay = gizmo.icon_overlay ?? BaseContent.BadTex;
|
||||||
|
|
||||||
|
Widgets.DrawTextureFitted(rect, baseIcon, IconScale);
|
||||||
|
|
||||||
|
Color oldColor = GUI.color;
|
||||||
|
GUI.color = gizmo.cumcolor;
|
||||||
|
Widgets.DrawTextureFitted(rect, overlay, IconScale);
|
||||||
|
GUI.color = Color.white;
|
||||||
|
|
||||||
|
if (Configurations.DrawEggOverlay)
|
||||||
|
{
|
||||||
|
gizmo.comp.DrawEggOverlay(rect, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Rect progressRect = new Rect(rect.x + 2f, rect.y, rect.width - 4f, ProgressBarHeight);
|
||||||
|
Widgets.FillableBar(progressRect, gizmo.comp.StageProgress, gizmo.comp.GetStageTexture);
|
||||||
|
GUI.color = oldColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -46,7 +46,7 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static Gizmo CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp)
|
internal static Gizmo_Womb CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp)
|
||||||
{
|
{
|
||||||
if (!comp.loaded)
|
if (!comp.loaded)
|
||||||
comp.Initialize();
|
comp.Initialize();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true;
|
if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true;
|
||||||
if (!mother.ShouldCycle()) return true;
|
if (!mother.ShouldCycle()) return true;
|
||||||
if (!InteractionCanCausePregnancy(props)) return false;
|
if (!InteractionCanCausePregnancy(props)) return true;
|
||||||
|
|
||||||
List<Hediff> pawnparts = Genital_Helper.get_PartsHediffList(father, Genital_Helper.get_genitalsBPR(father));
|
List<Hediff> pawnparts = Genital_Helper.get_PartsHediffList(father, Genital_Helper.get_genitalsBPR(father));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@
|
||||||
<Compile Include="HediffComps\HediffComp_Breast.cs" />
|
<Compile Include="HediffComps\HediffComp_Breast.cs" />
|
||||||
<Compile Include="Hediff_MultiplePregnancy.cs" />
|
<Compile Include="Hediff_MultiplePregnancy.cs" />
|
||||||
<Compile Include="JobDrivers.cs" />
|
<Compile Include="JobDrivers.cs" />
|
||||||
|
<Compile Include="MainTab\PawnColumnWorker_WombStatus.cs" />
|
||||||
<Compile Include="UI\Gizmo_Womb.cs" />
|
<Compile Include="UI\Gizmo_Womb.cs" />
|
||||||
<Compile Include="Patch\Harmony.cs" />
|
<Compile Include="Patch\Harmony.cs" />
|
||||||
<Compile Include="HediffComps\HediffComp_Menstruation.cs" />
|
<Compile Include="HediffComps\HediffComp_Menstruation.cs" />
|
||||||
|
|
|
||||||
|
|
@ -207,8 +207,8 @@ namespace RJW_Menstruation
|
||||||
Hediff hediff = pawn.GetBreastList().MaxBy(h => h.Severity);
|
Hediff hediff = pawn.GetBreastList().MaxBy(h => h.Severity);
|
||||||
HediffComp_Breast comp = hediff.TryGetComp<HediffComp_Breast>();
|
HediffComp_Breast comp = hediff.TryGetComp<HediffComp_Breast>();
|
||||||
string icon;
|
string icon;
|
||||||
if (breastCount > 1) icon = "Breasts_Udder/Breast_Breast";
|
if (breastCount > 1) icon = "Breasts_Udder/Breast";
|
||||||
else icon = comp?.BreastTex ?? "Breasts/Breast_Breast";
|
else icon = comp?.BreastTex ?? "Breasts/Breast";
|
||||||
|
|
||||||
if (hediff.Severity < 0.20f) icon += "_Breast00";
|
if (hediff.Severity < 0.20f) icon += "_Breast00";
|
||||||
else if (hediff.Severity < 0.40f) icon += "_Breast01";
|
else if (hediff.Severity < 0.40f) icon += "_Breast01";
|
||||||
|
|
@ -339,7 +339,7 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
public static string GetBreastLabel(this Pawn pawn)
|
public static string GetBreastLabel(this Pawn pawn)
|
||||||
{
|
{
|
||||||
Hediff hediff = pawn.health.hediffSet.hediffs.FirstOrDefault(h => VariousDefOf.AllBreasts.Contains(h.def));
|
Hediff hediff = pawn.health.hediffSet.hediffs.Where(h => VariousDefOf.AllBreasts.Contains(h.def)).MaxByWithFallback(h => h.Severity);
|
||||||
if (hediff != null) return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")";
|
if (hediff != null) return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")";
|
||||||
else return "";
|
else return "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<identifier>RJW Menstruation</identifier>
|
<identifier>RJW Menstruation</identifier>
|
||||||
<version>1.6.2.2</version>
|
<version>1.6.2.4</version>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<incompatibleWith />
|
<incompatibleWith />
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
Version 1.6.2.4
|
||||||
|
- Fix error on startup and missing womb status in RJW tab with RJW 6.1.4.
|
||||||
|
|
||||||
|
Version 1.6.2.3
|
||||||
|
- Fix multiple breasts not appearing in the menstruation UI.
|
||||||
|
- Status of wombs now appears in RJW main tab, contributed by GhostClinic.
|
||||||
|
|
||||||
Version 1.6.2.2
|
Version 1.6.2.2
|
||||||
- Pawns with multiple breasts will now display an udder in the menstruation UI.
|
- Pawns with multiple breasts will now display an udder in the menstruation UI.
|
||||||
- Updated Traditional Chinese translation by Hydrogen.
|
- Updated Traditional Chinese translation by Hydrogen.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue