This commit is contained in:
moreoreganostodump 2021-03-06 22:32:33 +09:00
parent 8d75d7aac1
commit a4e1be39f2
38 changed files with 1266 additions and 1171 deletions

View file

@ -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.0.1.11</version> <version>1.0.1.12</version>
<dependencies> <dependencies>
</dependencies> </dependencies>
<incompatibleWith /> <incompatibleWith />

Binary file not shown.

View file

@ -60,7 +60,7 @@
</tags> </tags>
</apparel> </apparel>
<modExtensions> <modExtensions>
<li Class="RJW_Menstruation.AbsorberModExtention"> <li Class="RJW_Menstruation.AbsorberModExtension">
<leakAfterDirty>false</leakAfterDirty> <leakAfterDirty>false</leakAfterDirty>
<effectsAfterDirty>true</effectsAfterDirty> <effectsAfterDirty>true</effectsAfterDirty>
<minHourstoDirtyEffect>8</minHourstoDirtyEffect> <minHourstoDirtyEffect>8</minHourstoDirtyEffect>
@ -113,7 +113,7 @@
</tags> </tags>
</apparel> </apparel>
<modExtensions> <modExtensions>
<li Class="RJW_Menstruation.AbsorberModExtention"> <li Class="RJW_Menstruation.AbsorberModExtension">
<leakAfterDirty>false</leakAfterDirty> <leakAfterDirty>false</leakAfterDirty>
<effectsAfterDirty>true</effectsAfterDirty> <effectsAfterDirty>true</effectsAfterDirty>
<minHourstoDirtyEffect>8</minHourstoDirtyEffect> <minHourstoDirtyEffect>8</minHourstoDirtyEffect>
@ -181,7 +181,7 @@
</tags> </tags>
</apparel> </apparel>
<modExtensions> <modExtensions>
<li Class="RJW_Menstruation.AbsorberModExtention"> <li Class="RJW_Menstruation.AbsorberModExtension">
<leakAfterDirty>true</leakAfterDirty> <leakAfterDirty>true</leakAfterDirty>
<effectsAfterDirty>false</effectsAfterDirty> <effectsAfterDirty>false</effectsAfterDirty>
<dirtyDef>Absorber_Pad_Dirty</dirtyDef> <dirtyDef>Absorber_Pad_Dirty</dirtyDef>
@ -233,7 +233,7 @@
</tags> </tags>
</apparel> </apparel>
<modExtensions> <modExtensions>
<li Class="RJW_Menstruation.AbsorberModExtention"> <li Class="RJW_Menstruation.AbsorberModExtension">
<leakAfterDirty>true</leakAfterDirty> <leakAfterDirty>true</leakAfterDirty>
<effectsAfterDirty>false</effectsAfterDirty> <effectsAfterDirty>false</effectsAfterDirty>
<dirtyDef>Absorber_Pad_Dirty</dirtyDef> <dirtyDef>Absorber_Pad_Dirty</dirtyDef>

View file

@ -74,6 +74,11 @@
<Option20_Label_5>Hostile Faction</Option20_Label_5> <Option20_Label_5>Hostile Faction</Option20_Label_5>
<Option21_Label>target pawns</Option21_Label> <Option21_Label>target pawns</Option21_Label>
<Option21_Desc>the gizmo and button will appear for these pawns</Option21_Desc> <Option21_Desc>the gizmo and button will appear for these pawns</Option21_Desc>
<Option22_Label>use hybrid extension</Option22_Label>
<Option22_Desc>overrides RJW and RaceSupport's hybrid definition&#10;Dominant hybrid extension determines whose definition used first. Not recommended to change this</Option22_Desc>
<Option23_Label>Dominant hybrid extension</Option23_Label>
<Option23_Label_1>Mother</Option23_Label_1>
<Option23_Label_2>Father</Option23_Label_2>
<FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf> <FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf>

View file

@ -74,6 +74,11 @@
<Option20_Label_5>적대관계</Option20_Label_5> <Option20_Label_5>적대관계</Option20_Label_5>
<Option21_Label>표시 대상</Option21_Label> <Option21_Label>표시 대상</Option21_Label>
<Option21_Desc>아이콘과 버튼을 표시할 대상입니다.</Option21_Desc> <Option21_Desc>아이콘과 버튼을 표시할 대상입니다.</Option21_Desc>
<Option22_Label>잡종 정의 대체</Option22_Label>
<Option22_Desc>RJW와 RaceSupport의 잡종정의를 대체합니다.&#10;우선순위는 누구의 잡종 정의를 우선으로 사용할지 정합니다. 변경하지 않는것을 추천합니다.</Option22_Desc>
<Option23_Label>우선순위</Option23_Label>
<Option23_Label_1></Option23_Label_1>
<Option23_Label_2></Option23_Label_2>
<FloatMenu_CleanSelf>질세척</FloatMenu_CleanSelf> <FloatMenu_CleanSelf>질세척</FloatMenu_CleanSelf>

View file

@ -4,10 +4,22 @@
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Race's defName"]</xpath> <xpath>Defs/ThingDef[defName="Race's defName"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtention"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath> <fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor> <cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness> <cumThickness>0.2</cumThickness>
<hybridExtension>
<Other Race's defName>
<Race or PawnKind defName>1.0</Race or PawnKind defName>
<Race or PawnKind defName>5.0</Race or PawnKind defName>
<Race or PawnKind defName>7.0</Race or PawnKind defName>
<Race or PawnKind defName>2.0</Race or PawnKind defName>
</Other Race's defName>
<Other Race's defName>
<Race or PawnKind defName>98.0</Race or PawnKind defName>
<Race or PawnKind defName>2.0</Race or PawnKind defName>
</Other Race's defName>
</hybridExtension>
</li> </li>
</value> </value>
</Operation> </Operation>
@ -17,16 +29,52 @@
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Human"]</xpath> <xpath>Defs/ThingDef[defName="Human"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtention"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath> <fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor> <cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness> <cumThickness>0.2</cumThickness>
<hybridExtension>
<Horse>
<Alien_Eponalike>1.0</Alien_Eponalike>
</Horse>
</hybridExtension>
</li> </li>
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Horse"]</xpath>
<value>
<li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness>
<hybridExtension>
<Donkey>
<Mule>1.0</Mule>
</Donkey>
</hybridExtension>
</li>
</value>
</Operation>
<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Donkey"]</xpath>
<value>
<li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness>
<hybridExtension>
<Horse>
<Hinny>1.0</Hinny>
</Horse>
</hybridExtension>
</li>
</value>
</Operation>

Binary file not shown.

Binary file not shown.

BIN
Textures/Fetus/Fetus.zip Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Textures/Womb/Womb.zip Normal file

Binary file not shown.

Binary file not shown.

View file

@ -1,3 +1,8 @@
Version 1.0.1.12
- added HybridExtension attribute to PawnDNAModExtension
- this will overrides RJW's hybrid definitions
- supports more detailed hybrid definition
- fixed bugs when menopause option off
Version 1.0.1.11 Version 1.0.1.11
- added a button for opening status window in health tab - added a button for opening status window in health tab
- added option for this - added option for this

View file

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using Verse; using Verse;
@ -51,6 +47,9 @@ namespace RJW_Menstruation
public static int BleedingAmount = BleedingAmountDefault; public static int BleedingAmount = BleedingAmountDefault;
public static bool EnableButtonInHT = false; public static bool EnableButtonInHT = false;
public static PawnFlags ShowFlag = PawnFlags.Colonist | PawnFlags.Prisoner; public static PawnFlags ShowFlag = PawnFlags.Colonist | PawnFlags.Prisoner;
public static bool UseHybridExtention = true;
public static bool MotherFirst = false;
public static bool HARActivated = false; public static bool HARActivated = false;
public static bool LLActivated = false; public static bool LLActivated = false;
@ -81,8 +80,14 @@ namespace RJW_Menstruation
} }
public static string HybridString(bool b)
{
if (b) return Translations.Option23_Label_1;
else return Translations.Option23_Label_2;
}
[Flags]public enum PawnFlags [Flags]
public enum PawnFlags
{ {
None = 0, None = 0,
Colonist = 1, Colonist = 1,
@ -120,6 +125,8 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true); Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true);
Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, true); Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, true);
Scribe_Values.Look(ref ShowFlag, "ShowFlag", ShowFlag, true); Scribe_Values.Look(ref ShowFlag, "ShowFlag", ShowFlag, true);
Scribe_Values.Look(ref UseHybridExtention, "UseHybridExtention", UseHybridExtention, true);
Scribe_Values.Look(ref MotherFirst, "MotherFirst", MotherFirst, true);
base.ExposeData(); base.ExposeData();
} }
@ -178,8 +185,8 @@ namespace RJW_Menstruation
listmain.Begin(mainRect); listmain.Begin(mainRect);
listmain.Gap(20f); listmain.Gap(20f);
Rect optionrect1 = listmain.GetRect(30f); Rect optionrect1 = listmain.GetRect(30f);
Widgets.CheckboxLabeled(optionrect1.LeftHalf(), Translations.Option1_Label_1, ref Configurations.EnableWombIcon); Widgets.CheckboxLabeled(optionrect1.LeftHalf(), Translations.Option1_Label_1, ref Configurations.EnableWombIcon,false,null,null,true);
Widgets.CheckboxLabeled(optionrect1.RightHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT); Widgets.CheckboxLabeled(optionrect1.RightHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT, false, null, null, true);
//listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); //listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT) if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT)
{ {
@ -210,7 +217,7 @@ namespace RJW_Menstruation
wombsection.Label(Translations.Option11_Desc_4); wombsection.Label(Translations.Option11_Desc_4);
break; break;
} }
wombsection.Label(Translations.Option21_Label + " " + Configurations.ShowFlag,-1, Translations.Option21_Desc); wombsection.Label(Translations.Option21_Label + " " + Configurations.ShowFlag, -1, Translations.Option21_Desc);
Rect flagrect = wombsection.GetRect(30f); Rect flagrect = wombsection.GetRect(30f);
Rect[] flagrects = new Rect[5]; Rect[] flagrects = new Rect[5];
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
@ -247,42 +254,49 @@ namespace RJW_Menstruation
listmain.CheckboxLabeled(Translations.Option12_Label, ref Configurations.EnableMenopause, Translations.Option12_Desc); listmain.CheckboxLabeled(Translations.Option12_Label, ref Configurations.EnableMenopause, Translations.Option12_Desc);
listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance*100 + "%", -1, Translations.Option3_Desc); listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance * 100 + "%", -1, Translations.Option3_Desc);
Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000); Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000);
Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust/100; Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust / 100;
listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance*100 + "%", -1, Translations.Option4_Desc); listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance * 100 + "%", -1, Translations.Option4_Desc);
Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000); Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000);
Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust/1000; Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust / 1000;
listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio*100 + "%", -1, Translations.Option5_Desc); listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio * 100 + "%", -1, Translations.Option5_Desc);
Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000); Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000);
Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust/1000; Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust / 1000;
listmain.Label(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio*100 + "%", -1, Translations.Option6_Desc); listmain.Label(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio * 100 + "%", -1, Translations.Option6_Desc);
Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000); Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000);
Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust/1000; Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust / 1000;
listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc); listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc);
Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50); Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration, 1, 50);
float var2 = EstimatedBleedingAmountPerHour; float var2 = EstimatedBleedingAmountPerHour;
float var1 = Math.Max(EstimatedBleedingAmount,var2); float var1 = Math.Max(EstimatedBleedingAmount, var2);
listmain.LabelDouble(Translations.Option19_Label_1, Translations.Option19_Label_2 + ": " + var1 + "ml, " + var2 + "ml/h", Translations.Option19_Desc); listmain.LabelDouble(Translations.Option19_Label_1, Translations.Option19_Label_2 + ": " + var1 + "ml, " + var2 + "ml/h", Translations.Option19_Desc);
Configurations.BleedingAmount = (int)listmain.Slider(Configurations.BleedingAmount, 0, 200); Configurations.BleedingAmount = (int)listmain.Slider(Configurations.BleedingAmount, 0, 200);
listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc); listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc);
if (Configurations.UseMultiplePregnancy) if (Configurations.UseMultiplePregnancy)
{ {
float sectionheight = 50f; float sectionheight = 75f;
if (Configurations.EnableEnzygoticTwins) sectionheight += 100; if (Configurations.EnableEnzygoticTwins) sectionheight += 100;
Listing_Standard twinsection = listmain.BeginSection_NewTemp(sectionheight); Listing_Standard twinsection = listmain.BeginSection_NewTemp(sectionheight);
Rect hybridrect = twinsection.GetRect(25);
Widgets.CheckboxLabeled(hybridrect.LeftHalf(), Translations.Option22_Label, ref Configurations.UseHybridExtention, false, null, null, true);
if (Widgets.ButtonText(hybridrect.RightHalf(), Translations.Option23_Label + ": " + Configurations.HybridString(Configurations.MotherFirst)))
{
Configurations.MotherFirst = !Configurations.MotherFirst;
}
twinsection.CheckboxLabeled(Translations.Option14_Label, ref Configurations.EnableHeteroOvularTwins, Translations.Option14_Desc); twinsection.CheckboxLabeled(Translations.Option14_Label, ref Configurations.EnableHeteroOvularTwins, Translations.Option14_Desc);
twinsection.CheckboxLabeled(Translations.Option15_Label, ref Configurations.EnableEnzygoticTwins, Translations.Option15_Desc); twinsection.CheckboxLabeled(Translations.Option15_Label, ref Configurations.EnableEnzygoticTwins, Translations.Option15_Desc);
if (Configurations.EnableEnzygoticTwins) if (Configurations.EnableEnzygoticTwins)
{ {
twinsection.Label(Translations.Option16_Label + " " + Configurations.EnzygoticTwinsChance*100 + "%", -1, Translations.Option16_Desc); twinsection.Label(Translations.Option16_Label + " " + Configurations.EnzygoticTwinsChance * 100 + "%", -1, Translations.Option16_Desc);
Configurations.EnzygoticTwinsChanceAdjust = (int)twinsection.Slider(Configurations.EnzygoticTwinsChanceAdjust, 0, 1000); Configurations.EnzygoticTwinsChanceAdjust = (int)twinsection.Slider(Configurations.EnzygoticTwinsChanceAdjust, 0, 1000);
Configurations.EnzygoticTwinsChance = (float)Configurations.EnzygoticTwinsChanceAdjust / 1000; Configurations.EnzygoticTwinsChance = (float)Configurations.EnzygoticTwinsChanceAdjust / 1000;

View file

@ -1,13 +1,7 @@
using System; using RimWorld;
using System.Collections; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine; using UnityEngine;
using rjw; using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -36,7 +30,7 @@ namespace RJW_Menstruation
} }
private Color customColor; private Color customColor;
public PawnDNAModExtention DNA public PawnDNAModExtension DNA
{ {
get get
{ {
@ -44,22 +38,22 @@ namespace RJW_Menstruation
{ {
try try
{ {
DNAcache = pawn.def.GetModExtension<PawnDNAModExtention>(); DNAcache = pawn.def.GetModExtension<PawnDNAModExtension>();
} }
catch (NullReferenceException) catch (NullReferenceException)
{ {
DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtention>(); DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtension>();
} }
if (DNAcache == null) if (DNAcache == null)
{ {
DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtention>(); DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtension>();
} }
return DNAcache; return DNAcache;
} }
else return DNAcache; else return DNAcache;
} }
} }
private PawnDNAModExtention DNAcache = null; private PawnDNAModExtension DNAcache = null;
public ThingDef FilthDef public ThingDef FilthDef
{ {
get get
@ -89,7 +83,7 @@ namespace RJW_Menstruation
} }
public Cum() {} public Cum() { }
public Cum(Pawn pawn) public Cum(Pawn pawn)
{ {

View file

@ -1,13 +1,9 @@
using System; using RimWorld;
using System.Collections.Generic; using rjw;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using Verse; using Verse;
using Verse.Sound; using Verse.Sound;
using RimWorld;
using rjw;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -47,7 +43,7 @@ namespace RJW_Menstruation
float height = 820f; float height = 820f;
if (!Configurations.DrawWombStatus) height -= wombRectHeight; if (!Configurations.DrawWombStatus) height -= wombRectHeight;
if (!Configurations.DrawVaginaStatus) height -= genitalRectHeight; if (!Configurations.DrawVaginaStatus) height -= genitalRectHeight;
return new Vector2(width,height); return new Vector2(width, height);
} }
} }
@ -192,7 +188,7 @@ namespace RJW_Menstruation
Rect pawnLabel2Rect = new Rect(0, pawnRectHeight + fontheight - 10, pawnRectWidth, fontheight - 10); Rect pawnLabel2Rect = new Rect(0, pawnRectHeight + fontheight - 10, pawnRectWidth, fontheight - 10);
fontstylecenter.normal.textColor = pawn.DrawColor; fontstylecenter.normal.textColor = pawn.DrawColor;
GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter); GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter);
if (pawn.story != null)GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter); if (pawn.story != null) GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter);
GUI.color = Color.white; GUI.color = Color.white;
float wombrecth = 0; float wombrecth = 0;
@ -200,7 +196,7 @@ namespace RJW_Menstruation
{ {
wombrecth = wombRectHeight; wombrecth = wombRectHeight;
cumcolor = comp.GetCumMixtureColor; cumcolor = comp.GetCumMixtureColor;
Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectWidth*0.9f); Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectWidth * 0.9f);
DrawWomb(wombRect); DrawWomb(wombRect);
@ -241,7 +237,7 @@ namespace RJW_Menstruation
Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight); Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight);
GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04); GUI.Label(cumlistTitle, Translations.Dialog_WombInfo04);
Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombrecth - fontheight); Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombrecth - fontheight);

View file

@ -1,9 +1,4 @@
using System; using RimWorld;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse; using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
@ -50,7 +45,7 @@ namespace RJW_Menstruation
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null) if (comp != null)
{ {
comp.eggstack += Rand.Range(1,4); comp.eggstack += Rand.Range(1, 4);
} }

View file

@ -1,18 +1,15 @@
using System; using RimWorld;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using UnityEngine; using UnityEngine;
using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
public class FilthMaker_Colored public class FilthMaker_Colored
{ {
public static bool TryMakeFilth(IntVec3 c, Map map, ThingDef filthDef, IEnumerable<string> sources, Color color , bool shouldPropagate, FilthSourceFlags additionalFlags = FilthSourceFlags.None) public static bool TryMakeFilth(IntVec3 c, Map map, ThingDef filthDef, IEnumerable<string> sources, Color color, bool shouldPropagate, FilthSourceFlags additionalFlags = FilthSourceFlags.None)
{ {
Filth_Colored filth = (Filth_Colored)(from t in c.GetThingList(map) Filth_Colored filth = (Filth_Colored)(from t in c.GetThingList(map)
where t.def == filthDef where t.def == filthDef
@ -25,7 +22,7 @@ namespace RJW_Menstruation
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
IntVec3 c2 = c + list[i]; IntVec3 c2 = c + list[i];
if (c2.InBounds(map) && TryMakeFilth(c2, map, filthDef, sources, color,false, FilthSourceFlags.None)) if (c2.InBounds(map) && TryMakeFilth(c2, map, filthDef, sources, color, false, FilthSourceFlags.None))
{ {
return true; return true;
} }

View file

@ -1,12 +1,5 @@
using System; using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse; using Verse;
using RimWorld;
using UnityEngine;
using Verse.Sound;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {

View file

@ -1,10 +1,5 @@
using System; using System.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse; using Verse;
using RimWorld;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {

View file

@ -1,17 +1,16 @@
using System; using HugsLib;
using RimWorld;
using rjw;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using HugsLib;
using rjw;
using UnityEngine; using UnityEngine;
using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
[Flags]public enum SeasonalBreed [Flags]
public enum SeasonalBreed
{ {
Always = 0, Always = 0,
Spring = 1, Spring = 1,
@ -104,7 +103,7 @@ namespace RJW_Menstruation
private int lutealIntervalhours = -1; private int lutealIntervalhours = -1;
private int bleedingIntervalhours = -1; private int bleedingIntervalhours = -1;
private int recoveryIntervalhours = -1; private int recoveryIntervalhours = -1;
private float crampPain= -1; private float crampPain = -1;
private Need sexNeed = null; private Need sexNeed = null;
private string customwombtex = null; private string customwombtex = null;
private string customvagtex = null; private string customvagtex = null;
@ -164,7 +163,7 @@ namespace RJW_Menstruation
{ {
res += cum.volume; res += cum.volume;
} }
return res/ Props.maxCumCapacity; return res / Props.maxCumCapacity;
} }
} }
public float CumCapacity public float CumCapacity
@ -181,7 +180,7 @@ namespace RJW_Menstruation
get get
{ {
float res = 1.0f; float res = 1.0f;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f; if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.01f;
return res; return res;
} }
} }
@ -202,8 +201,8 @@ namespace RJW_Menstruation
{ {
float factor = 1.0f; float factor = 1.0f;
if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f; if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f;
if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance/100f; if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance / 100f;
else factor *= RJWPregnancySettings.humanlike_impregnation_chance/100f; else factor *= RJWPregnancySettings.humanlike_impregnation_chance / 100f;
return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor; return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor;
} }
} }
@ -230,7 +229,7 @@ namespace RJW_Menstruation
float mixedsofar = 0; float mixedsofar = 0;
foreach (Cum cum in cums) foreach (Cum cum in cums)
{ {
mixedcolor = Colors.CMYKLerp(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume)); mixedcolor = Colors.CMYKLerp(mixedcolor, cum.color, cum.volume / (mixedsofar + cum.volume));
mixedsofar += cum.volume; mixedsofar += cum.volume;
} }
} }
@ -308,9 +307,6 @@ namespace RJW_Menstruation
{ {
string res = ""; string res = "";
if (!eggs.NullOrEmpty()) if (!eggs.NullOrEmpty())
{
if (cums.NullOrEmpty() || TotalFertCum == 0) return eggs.Count + " " + Translations.Dialog_WombInfo07;
else
{ {
int fertilized = 0; int fertilized = 0;
foreach (Egg egg in eggs) foreach (Egg egg in eggs)
@ -319,6 +315,12 @@ namespace RJW_Menstruation
} }
if (fertilized != 0) res += fertilized + " " + Translations.Dialog_WombInfo05; if (fertilized != 0) res += fertilized + " " + Translations.Dialog_WombInfo05;
if (fertilized != 0 && eggs.Count - fertilized != 0) res += ", "; if (fertilized != 0 && eggs.Count - fertilized != 0) res += ", ";
if (cums.NullOrEmpty() || TotalFertCum == 0)
{
if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo07;
}
else
{
if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo06; if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo06;
} }
} }
@ -332,7 +334,7 @@ namespace RJW_Menstruation
{ {
if (!eggs.NullOrEmpty()) if (!eggs.NullOrEmpty())
{ {
if (!cums.NullOrEmpty()) foreach(Cum cum in cums) if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{ {
if (cum.fertvolume > 0) return true; if (cum.fertvolume > 0) return true;
} }
@ -350,7 +352,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs) if (!eggs.NullOrEmpty()) foreach (Egg egg in eggs)
{ {
if (egg.fertilized) return egg.fertstage; if (egg.fertilized) return egg.fertstage;
} }
@ -501,14 +503,14 @@ namespace RJW_Menstruation
if (cum.pawn.Equals(pawn)) if (cum.pawn.Equals(pawn))
{ {
cum.volume += volume; cum.volume += volume;
cum.fertvolume += volume; cum.fertvolume += volume * CumInFactor;
cum.FilthDef = filthdef; cum.FilthDef = filthdef;
merged = true; merged = true;
} }
cum.volume *= 1 - cumoutrate; cum.volume *= 1 - cumoutrate;
cum.fertvolume *= 1 - cumoutrate; cum.fertvolume *= 1 - cumoutrate;
} }
if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate),fertility, filthdef)); if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), fertility, filthdef));
} }
else else
{ {
@ -560,7 +562,7 @@ namespace RJW_Menstruation
cum.volume *= 1 - cumoutrate; cum.volume *= 1 - cumoutrate;
cum.fertvolume *= 1 - cumoutrate; cum.fertvolume *= 1 - cumoutrate;
} }
if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef)); if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel, decayresist, filthdef));
} }
else else
{ {
@ -577,7 +579,7 @@ namespace RJW_Menstruation
merged = true; merged = true;
} }
} }
if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef)); if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel, decayresist, filthdef));
} }
cumd = TotalCumPercent - cumd; cumd = TotalCumPercent - cumd;
AfterNotCumIn(); AfterNotCumIn();
@ -741,7 +743,7 @@ namespace RJW_Menstruation
if (cums.NullOrEmpty()) return; if (cums.NullOrEmpty()) return;
else if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f; else if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f;
List<Cum> removecums = new List<Cum>(); List<Cum> removecums = new List<Cum>();
foreach(Cum cum in cums) foreach (Cum cum in cums)
{ {
float vd = cum.volume; float vd = cum.volume;
cum.volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor)); cum.volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor));
@ -749,7 +751,7 @@ namespace RJW_Menstruation
vd -= cum.volume; vd -= cum.volume;
totalleak += AbsorbCum(cum, vd, absorber); totalleak += AbsorbCum(cum, vd, absorber);
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString()); string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
filthlabels.Add(tmp.Replace(" x1","")); filthlabels.Add(tmp.Replace(" x1", ""));
if (cum.fertvolume < 0.01f) cum.fertvolume = 0; if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum); if (cum.volume < 0.01f) removecums.Add(cum);
} }
@ -861,7 +863,8 @@ namespace RJW_Menstruation
foreach (Egg egg in eggs) foreach (Egg egg in eggs)
{ {
if (!egg.fertilized) egg.fertilizer = Fertilize(); if (!egg.fertilized) egg.fertilizer = Fertilize();
if (egg.fertilizer != null) { if (egg.fertilizer != null)
{
egg.fertilized = true; egg.fertilized = true;
egg.lifespanhrs += 240; egg.lifespanhrs += 240;
onefertilized = true; onefertilized = true;
@ -898,6 +901,10 @@ namespace RJW_Menstruation
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause); hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
} }
else if (ovarypower < -50000) else if (ovarypower < -50000)
{ {
@ -914,7 +921,8 @@ namespace RJW_Menstruation
avglittersize = 1; avglittersize = 1;
} }
ovarypower = (int)(((Props.ovaryPower * Rand.Range(0.7f, 1.3f) * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy) ovarypower = (int)(((Props.ovaryPower * Rand.Range(0.7f, 1.3f) * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)
- (Math.Max(0, parent.pawn.ageTracker.AgeBiologicalYears - 15)) * (60 / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration)) * avglittersize); - (Math.Max(0, parent.pawn.ageTracker.AgeBiologicalYears - RJWSettings.sex_minimum_age * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy))
* (60 / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration)) * avglittersize);
if (ovarypower < 1) if (ovarypower < 1)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn);
@ -958,7 +966,7 @@ namespace RJW_Menstruation
public void AfterSimulator() public void AfterSimulator()
{ {
if (ovarypower < ovarypowerthreshold) if (Configurations.EnableMenopause && ovarypower < ovarypowerthreshold)
{ {
if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed); if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
else else
@ -987,6 +995,30 @@ namespace RJW_Menstruation
} }
} }
public bool IsBreedingSeason()
{
if (Props.breedingSeason == SeasonalBreed.Always) return true;
switch (GenLocalDate.Season(parent.pawn.Map))
{
case Season.Spring:
if ((Props.breedingSeason & SeasonalBreed.Spring) != 0) return true;
break;
case Season.Summer:
case Season.PermanentSummer:
if ((Props.breedingSeason & SeasonalBreed.Summer) != 0) return true;
break;
case Season.Fall:
if ((Props.breedingSeason & SeasonalBreed.Fall) != 0) return true;
break;
case Season.Winter:
case Season.PermanentWinter:
if ((Props.breedingSeason & SeasonalBreed.Winter) != 0) return true;
break;
default:
return false;
}
return false;
}
private Pawn Fertilize() private Pawn Fertilize()
{ {
@ -1010,7 +1042,7 @@ namespace RJW_Menstruation
{ {
List<Egg> deadeggs = new List<Egg>(); List<Egg> deadeggs = new List<Egg>();
bool pregnant = false; bool pregnant = false;
foreach(Egg egg in eggs) foreach (Egg egg in eggs)
{ {
if (!egg.fertilized || egg.fertstage < 168) continue; if (!egg.fertilized || egg.fertstage < 168) continue;
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer)) else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
@ -1078,7 +1110,7 @@ namespace RJW_Menstruation
private void BleedOut() private void BleedOut()
{ {
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label);
CumIn(parent.pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood); CumIn(parent.pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood, -5.0f, ThingDefOf.Filth_Blood);
GetNotCum(Translations.Menstrual_Blood).color = BloodColor; GetNotCum(Translations.Menstrual_Blood).color = BloodColor;
} }
@ -1105,7 +1137,7 @@ namespace RJW_Menstruation
if (absorber != null) if (absorber != null)
{ {
float absorbable = absorber.GetStatValue(VariousDefOf.MaxAbsorbable); float absorbable = absorber.GetStatValue(VariousDefOf.MaxAbsorbable);
absorber.SetColor(Colors.CMYKLerp(GetCumMixtureColor, absorber.DrawColor, 1f - amount/absorbable)); absorber.SetColor(Colors.CMYKLerp(GetCumMixtureColor, absorber.DrawColor, 1f - amount / absorbable));
if (!absorber.dirty) if (!absorber.dirty)
{ {
absorber.absorbedfluids += amount; absorber.absorbedfluids += amount;
@ -1136,7 +1168,7 @@ namespace RJW_Menstruation
if (amount >= minmakefilthvalue) if (amount >= minmakefilthvalue)
{ {
FilthMaker_Colored.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, VariousDefOf.FilthMixture, cumlabels,GetCumMixtureColor,false); FilthMaker_Colored.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, VariousDefOf.FilthMixture, cumlabels, GetCumMixtureColor, false);
} }
return amount; return amount;
} }
@ -1164,6 +1196,14 @@ namespace RJW_Menstruation
} }
} }
private void AddCrampPain()
{
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, parent.pawn);
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
Prop.severityPerDay = -hediff.Severity / (bleedingIntervalhours / 24) * Configurations.CycleAcceleration;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn));
}
private Action PeriodSimulator(Stage targetstage) private Action PeriodSimulator(Stage targetstage)
{ {
@ -1173,37 +1213,19 @@ namespace RJW_Menstruation
case Stage.Follicular: case Stage.Follicular:
action = delegate action = delegate
{ {
if (Props.breedingSeason != SeasonalBreed.Always) if (!IsBreedingSeason())
{
if (!Props.breedingSeason.HasFlag(SeasonalBreed.Spring) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Spring))
{ {
GoNextStage(Stage.Anestrus); GoNextStage(Stage.Anestrus);
return; return;
} }
else if (!Props.breedingSeason.HasFlag(SeasonalBreed.Summer) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Summer) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentSummer)))
{
GoNextStage(Stage.Anestrus);
return;
}
else if (!Props.breedingSeason.HasFlag(SeasonalBreed.Fall) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Fall))
{
GoNextStage(Stage.Anestrus);
return;
}
else if (!Props.breedingSeason.HasFlag(SeasonalBreed.Winter) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Winter) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentWinter)))
{
GoNextStage(Stage.Anestrus);
return;
}
}
if (curStageHrs >= FollicularIntervalHours) if (curStageHrs >= FollicularIntervalHours)
{ {
GoNextStage(Stage.Ovulatory); GoNextStage(Stage.Ovulatory);
} }
else else
{ {
curStageHrs+=Configurations.CycleAcceleration; curStageHrs += Configurations.CycleAcceleration;
if (!estrusflag && curStageHrs > FollicularIntervalHours - Props.estrusDaysBeforeOvulation*24) if (!estrusflag && curStageHrs > FollicularIntervalHours - Props.estrusDaysBeforeOvulation * 24)
{ {
estrusflag = true; estrusflag = true;
SetEstrus(Props.eggLifespanDays + Props.estrusDaysBeforeOvulation); SetEstrus(Props.eggLifespanDays + Props.estrusDaysBeforeOvulation);
@ -1265,7 +1287,7 @@ namespace RJW_Menstruation
} }
else if (curStageHrs <= lutealIntervalhours) else if (curStageHrs <= lutealIntervalhours)
{ {
curStageHrs+=Configurations.CycleAcceleration; curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage(); StayCurrentStage();
} }
else else
@ -1280,11 +1302,7 @@ namespace RJW_Menstruation
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor); bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
if (crampPain >= 0.05f) if (crampPain >= 0.05f)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, parent.pawn); AddCrampPain();
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
Prop.severityPerDay = - hediff.Severity / (bleedingIntervalhours/24) * Configurations.CycleAcceleration;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn));
} }
GoNextStage(Stage.Bleeding); GoNextStage(Stage.Bleeding);
} }
@ -1304,7 +1322,7 @@ namespace RJW_Menstruation
else else
{ {
if (curStageHrs < bleedingIntervalhours / 4) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut(); if (curStageHrs < bleedingIntervalhours / 4) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
curStageHrs+=Configurations.CycleAcceleration; curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage(); StayCurrentStage();
} }
}; };
@ -1366,7 +1384,7 @@ namespace RJW_Menstruation
} }
else else
{ {
curStageHrs+=Configurations.CycleAcceleration; curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage(); StayCurrentStage();
} }
}; };
@ -1429,7 +1447,7 @@ namespace RJW_Menstruation
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6); follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6);
GoNextStage(Stage.ClimactericFollicular); GoNextStage(Stage.ClimactericFollicular);
} }
else if (ovarypower < ovarypowerthreshold / 4 || (ovarypower < ovarypowerthreshold / 3 && Rand.Range(0.0f,1.0f) < 0.3f)) //skips bleeding else if (ovarypower < ovarypowerthreshold / 4 || (ovarypower < ovarypowerthreshold / 3 && Rand.Range(0.0f, 1.0f) < 0.3f)) //skips bleeding
{ {
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6); follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6);
GoNextStage(Stage.ClimactericFollicular); GoNextStage(Stage.ClimactericFollicular);
@ -1439,11 +1457,7 @@ namespace RJW_Menstruation
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor); bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
if (crampPain >= 0.05f) if (crampPain >= 0.05f)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, parent.pawn); AddCrampPain();
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
Prop.severityPerDay = -hediff.Severity / (bleedingIntervalhours / 24) * Configurations.CycleAcceleration;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn));
} }
GoNextStage(Stage.ClimactericBleeding); GoNextStage(Stage.ClimactericBleeding);
} }
@ -1470,25 +1484,7 @@ namespace RJW_Menstruation
case Stage.Anestrus: case Stage.Anestrus:
action = delegate action = delegate
{ {
if (Props.breedingSeason == SeasonalBreed.Always) if (IsBreedingSeason())
{
//case for XML changes
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Spring) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Spring))
{
GoFollicularOrBleeding();
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Summer) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Summer) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentSummer)))
{
GoFollicularOrBleeding();
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Fall) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Fall))
{
GoFollicularOrBleeding();
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Winter) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Winter) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentWinter)))
{ {
GoFollicularOrBleeding(); GoFollicularOrBleeding();
} }
@ -1501,7 +1497,7 @@ namespace RJW_Menstruation
default: default:
curStage = Stage.Follicular; curStage = Stage.Follicular;
curStageHrs = 0; curStageHrs = 0;
if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor); if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays * 24, Props.deviationFactor);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false); HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false);
break; break;
} }
@ -1562,7 +1558,7 @@ namespace RJW_Menstruation
private int PeriodRandomizer(int intervalhours, float deviation) private int PeriodRandomizer(int intervalhours, float deviation)
{ {
return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation)); return intervalhours + (int)(intervalhours * Rand.Range(-deviation, deviation));
} }
private float InterspeciesImplantFactor(Pawn fertilizer) private float InterspeciesImplantFactor(Pawn fertilizer)
@ -1574,7 +1570,7 @@ namespace RJW_Menstruation
private float PainRandomizer() private float PainRandomizer()
{ {
float rand = Rand.Range(0.0f, 1.0f); float rand = Rand.Range(0.0f, 1.0f);
if (rand < 0.01f) return Rand.Range(0.0f,0.2f); if (rand < 0.01f) return Rand.Range(0.0f, 0.2f);
else if (rand < 0.2f) return Rand.Range(0.1f, 0.2f); else if (rand < 0.2f) return Rand.Range(0.1f, 0.2f);
else if (rand < 0.8f) return Rand.Range(0.2f, 0.4f); else if (rand < 0.8f) return Rand.Range(0.2f, 0.4f);
else if (rand < 0.95f) return Rand.Range(0.4f, 0.6f); else if (rand < 0.95f) return Rand.Range(0.4f, 0.6f);
@ -1583,7 +1579,7 @@ namespace RJW_Menstruation
private Stage RandomStage() private Stage RandomStage()
{ {
int rand = Rand.Range(0,2); int rand = Rand.Range(0, 2);
switch (rand) switch (rand)
{ {

View file

@ -1,13 +1,9 @@
using System; using RimWorld;
using rjw;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using rjw;
using Verse;
using RimWorld;
using UnityEngine; using UnityEngine;
using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -96,7 +92,7 @@ namespace RJW_Menstruation
private void HumanlikeBirth(Pawn baby, List<Pawn> siblings) private void HumanlikeBirth(Pawn baby, List<Pawn> siblings)
{ {
Pawn mother = pawn; Pawn father = Utility.GetFather(baby,pawn); Pawn mother = pawn; Pawn father = Utility.GetFather(baby, pawn);
//backup melanin, LastName for when baby reset by other mod on spawn/backstorychange //backup melanin, LastName for when baby reset by other mod on spawn/backstorychange
//var skin_whiteness = baby.story.melanin; //var skin_whiteness = baby.story.melanin;
//var last_name = baby.story.birthLastName; //var last_name = baby.story.birthLastName;
@ -130,7 +126,7 @@ namespace RJW_Menstruation
private void BestialBirth(Pawn baby, List<Pawn> siblings) private void BestialBirth(Pawn baby, List<Pawn> siblings)
{ {
Pawn mother = pawn; Pawn father = Utility.GetFather(baby,pawn); Pawn mother = pawn; Pawn father = Utility.GetFather(baby, pawn);
//backup melanin, LastName for when baby reset by other mod on spawn/backstorychange //backup melanin, LastName for when baby reset by other mod on spawn/backstorychange
//var skin_whiteness = baby.story.melanin; //var skin_whiteness = baby.story.melanin;
//var last_name = baby.story.birthLastName; //var last_name = baby.story.birthLastName;
@ -356,6 +352,7 @@ namespace RJW_Menstruation
public PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father) public PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father)
{ {
PawnKindDef spawn_kind_def = mother.kindDef; PawnKindDef spawn_kind_def = mother.kindDef;
int flag = 0; int flag = 0;
if (xxx.is_human(mother)) flag += 2; if (xxx.is_human(mother)) flag += 2;
if (xxx.is_human(father)) flag += 1; if (xxx.is_human(father)) flag += 1;
@ -394,14 +391,30 @@ namespace RJW_Menstruation
spawn_kind_def = mother.kindDef; spawn_kind_def = mother.kindDef;
} }
string MotherRaceName = ""; string MotherRaceName = "";
string FatherRaceName = ""; string FatherRaceName = "";
MotherRaceName = mother.kindDef.race.defName; MotherRaceName = mother.kindDef.race.defName;
PawnKindDef tmp = spawn_kind_def;
if (father != null) if (father != null)
FatherRaceName = father.kindDef.race.defName; FatherRaceName = father.kindDef.race.defName;
if (MotherRaceName != FatherRaceName && FatherRaceName != "") if (MotherRaceName != FatherRaceName && FatherRaceName != "")
{ {
if (Configurations.UseHybridExtention)
{
if (Configurations.MotherFirst)
{
spawn_kind_def = GetHybrid(mother, father);
}
else
{
spawn_kind_def = GetHybrid(father, mother);
}
Log.Message("pawnkind: " + spawn_kind_def?.defName);
}
if (!Configurations.UseHybridExtention || spawn_kind_def == null)
{
spawn_kind_def = tmp;
var groups = DefDatabase<RaceGroupDef>.AllDefs.Where(x => !(x.hybridRaceParents.NullOrEmpty() || x.hybridChildKindDef.NullOrEmpty())); var groups = DefDatabase<RaceGroupDef>.AllDefs.Where(x => !(x.hybridRaceParents.NullOrEmpty() || x.hybridChildKindDef.NullOrEmpty()));
@ -428,8 +441,7 @@ namespace RJW_Menstruation
} }
} }
} }
}
} }
else else
@ -437,7 +449,6 @@ namespace RJW_Menstruation
spawn_kind_def = mother.RaceProps.AnyPawnKind; spawn_kind_def = mother.RaceProps.AnyPawnKind;
} }
if (spawn_kind_def.defName.Contains("Nymph")) if (spawn_kind_def.defName.Contains("Nymph"))
{ {
//child is nymph, try to find other PawnKindDef //child is nymph, try to find other PawnKindDef
@ -463,6 +474,25 @@ namespace RJW_Menstruation
} }
public PawnKindDef GetHybrid(Pawn first, Pawn second)
{
PawnDNAModExtension dna;
PawnKindDef res = null;
dna = first.def.GetModExtension<PawnDNAModExtension>();
if (dna != null)
{
res = dna.GetHybridWith(second.def.defName) ?? null;
}
else
{
dna = second.def.GetModExtension<PawnDNAModExtension>();
if (dna != null)
{
res = dna.GetHybridWith(first.def.defName) ?? null;
}
}
return res;
}
/// <summary> /// <summary>
/// Copy from RJW /// Copy from RJW
@ -564,7 +594,7 @@ namespace RJW_Menstruation
public bool Equals(Pawn x, Pawn y) public bool Equals(Pawn x, Pawn y)
{ {
if (Utility.GetFather(x, mother) == null && Utility.GetFather(y, mother) == null) return true; if (Utility.GetFather(x, mother) == null && Utility.GetFather(y, mother) == null) return true;
return Utility.GetFather(x,mother)?.Label.Equals(Utility.GetFather(y,mother)?.Label) ?? false; return Utility.GetFather(x, mother)?.Label.Equals(Utility.GetFather(y, mother)?.Label) ?? false;
} }
public int GetHashCode(Pawn obj) public int GetHashCode(Pawn obj)

View file

@ -1,10 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using Verse.AI; using Verse.AI;
namespace RJW_Menstruation namespace RJW_Menstruation

View file

@ -1,14 +1,9 @@
using System; using HarmonyLib;
using rjw;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using Verse;
using RimWorld;
using rjw;
using UnityEngine; using UnityEngine;
using Verse.Sound; using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -50,9 +45,9 @@ namespace RJW_Menstruation
} }
private static Gizmo CreateGizmo_WombStatus(Pawn pawn , HediffComp_Menstruation comp) private static Gizmo CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp)
{ {
Texture2D icon,icon_overay; Texture2D icon, icon_overay;
string description = ""; string description = "";
if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum + "\n" + "ovarypower: " + comp.ovarypower + "\n" + "eggs: " + comp.GetNumofEggs + "\n"; if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum + "\n" + "ovarypower: " + comp.ovarypower + "\n" + "eggs: " + comp.GetNumofEggs + "\n";
else description += comp.GetCurStageLabel + "\n"; else description += comp.GetCurStageLabel + "\n";

View file

@ -1,13 +1,6 @@
using System; using HarmonyLib;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection; using System.Reflection;
using HarmonyLib;
using Verse; using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {

View file

@ -1,14 +1,10 @@
using System; using HarmonyLib;
using HugsLib;
using RimWorld;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using RimWorld;
using Verse; using Verse;
using HarmonyLib;
using HugsLib;
using rjw;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {

View file

@ -1,9 +1,4 @@
using System; using HarmonyLib;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using rjw; using rjw;
using Verse; using Verse;

View file

@ -43,7 +43,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>..\..\..\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -92,6 +92,7 @@
<HintPath>..\..\..\..\RJW\1.2\Assemblies\RJW.dll</HintPath> <HintPath>..\..\..\..\RJW\1.2\Assemblies\RJW.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="System.Xml" />
<Reference Include="Unity.TextMeshPro"> <Reference Include="Unity.TextMeshPro">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll</HintPath> <HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll</HintPath>
<Private>False</Private> <Private>False</Private>

View file

@ -1,10 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection; using System.Reflection;
using RimWorld;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {

View file

@ -1,26 +1,83 @@
using System; using System;
using System.Xml;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld; using RimWorld;
using Verse;
using rjw; using rjw;
using UnityEngine; using UnityEngine;
using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
public class PawnDNAModExtention : DefModExtension public class PawnDNAModExtension : DefModExtension
{ {
public string fetusTexPath; public string fetusTexPath;
public ColorInt cumColor; public ColorInt cumColor;
public Color CumColor => cumColor.ToColor; public Color CumColor => cumColor.ToColor;
public float cumThickness = 0f; public float cumThickness = 0f;
public List<HybridExtension> hybridExtension;
public HybridExtension GetHybridExtention(string race)
{
if (hybridExtension.NullOrEmpty()) return null;
else
{
return hybridExtension.Find(x => x.thingDef.defName.Equals(race));
}
}
public PawnKindDef GetHybridWith(string race)
{
return GetHybridExtention(race)?.ChooseOne() ?? null;
}
}
public class HybridExtension
{
public Dictionary<string, float> hybridInfo;
public ThingDef thingDef;
public HybridExtension() { }
public PawnKindDef ChooseOne()
{
if (hybridInfo.EnumerableNullOrEmpty()) return null;
PawnKindDef res = null;
do
{
res = DefDatabase<PawnKindDef>.GetNamedSilentFail(hybridInfo.RandomElementByWeight(x => x.Value).Key);
if (res == null) res = DefDatabase<ThingDef>.GetNamedSilentFail(hybridInfo.RandomElementByWeight(x => x.Value).Key).race.AnyPawnKind;
if (res == null) hybridInfo.Remove(res.defName);
} while (res == null && !hybridInfo.EnumerableNullOrEmpty());
return res;
}
public void LoadDataFromXmlCustom(XmlNode xmlRoot)
{
hybridInfo = new Dictionary<string, float>();
DirectXmlCrossRefLoader.RegisterObjectWantsCrossRef(this, "thingDef", xmlRoot.Name);
XmlNodeList childNodes = xmlRoot.ChildNodes;
if (childNodes.Count >= 1) foreach (XmlNode node in childNodes)
{
//Log.Message(xmlRoot.Name + "HybridInfo: " + node.Name + " " + node.InnerText);
hybridInfo.Add(node.Name, ParseHelper.FromString<float>(node.InnerText));
}
}
} }
public class AbsorberModExtention : DefModExtension
public class AbsorberModExtension : DefModExtension
{ {
public bool leakAfterDirty = false; public bool leakAfterDirty = false;
public bool effectsAfterDirty = false; public bool effectsAfterDirty = false;
@ -34,20 +91,20 @@ namespace RJW_Menstruation
public float absorbedfluids = 0; public float absorbedfluids = 0;
public bool dirty = false; public bool dirty = false;
public int wearhours = 0; public int wearhours = 0;
public virtual bool LeakAfterDirty => def.GetModExtension<AbsorberModExtention>().leakAfterDirty; public virtual bool LeakAfterDirty => def.GetModExtension<AbsorberModExtension>().leakAfterDirty;
public virtual bool EffectAfterDirty => def.GetModExtension<AbsorberModExtention>().effectsAfterDirty; public virtual bool EffectAfterDirty => def.GetModExtension<AbsorberModExtension>().effectsAfterDirty;
public virtual ThingDef DirtyDef => def.GetModExtension<AbsorberModExtention>().dirtyDef; public virtual ThingDef DirtyDef => def.GetModExtension<AbsorberModExtension>().dirtyDef;
public virtual int MinHrstoDirtyEffect => def.GetModExtension<AbsorberModExtention>().minHourstoDirtyEffect; public virtual int MinHrstoDirtyEffect => def.GetModExtension<AbsorberModExtension>().minHourstoDirtyEffect;
public Color fluidColor = Color.white; public Color fluidColor = Color.white;
public virtual void DirtyEffect() {} public virtual void DirtyEffect() { }
public virtual void WearEffect() public virtual void WearEffect()
{ {
absorbedfluids+=0.1f; absorbedfluids += 0.1f;
wearhours++; wearhours++;
} }

View file

@ -80,6 +80,11 @@ namespace RJW_Menstruation
public static readonly string Option20_Label_5 = "Option20_Label_5".Translate(); public static readonly string Option20_Label_5 = "Option20_Label_5".Translate();
public static readonly string Option21_Label = "Option21_Label".Translate(); public static readonly string Option21_Label = "Option21_Label".Translate();
public static readonly string Option21_Desc = "Option21_Desc".Translate(); public static readonly string Option21_Desc = "Option21_Desc".Translate();
public static readonly string Option22_Label = "Option22_Label".Translate();
public static readonly string Option22_Desc = "Option22_Desc".Translate();
public static readonly string Option23_Label = "Option23_Label".Translate();
public static readonly string Option23_Label_1 = "Option23_Label_1".Translate();
public static readonly string Option23_Label_2 = "Option23_Label_2".Translate();
public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate(); public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate();

View file

@ -1,14 +1,9 @@
using System; using RimWorld;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using rjw; using rjw;
using RimWorld; using System;
using System.Linq;
using UnityEngine; using UnityEngine;
using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -27,14 +22,14 @@ namespace RJW_Menstruation
public static void RGBtoCMYK(Color rgb, out float c, out float m, out float y, out float k) public static void RGBtoCMYK(Color rgb, out float c, out float m, out float y, out float k)
{ {
k = 1 - Math.Max(rgb.r,Math.Max(rgb.g,rgb.b)); k = 1 - Math.Max(rgb.r, Math.Max(rgb.g, rgb.b));
c = (1 - rgb.r - k) / (1 - k); c = (1 - rgb.r - k) / (1 - k);
m = (1 - rgb.g - k) / (1 - k); m = (1 - rgb.g - k) / (1 - k);
y = (1 - rgb.b - k) / (1 - k); y = (1 - rgb.b - k) / (1 - k);
} }
public static Color CMYKtoRGB(float c,float m, float y, float k) public static Color CMYKtoRGB(float c, float m, float y, float k)
{ {
return new Color((1 - c) * (1 - k), (1 - m) * (1 - k), (1 - y) * (1 - k)); return new Color((1 - c) * (1 - k), (1 - m) * (1 - k), (1 - y) * (1 - k));
} }
@ -65,7 +60,7 @@ namespace RJW_Menstruation
{ {
res = 0.0f; res = 0.0f;
} }
if (pawn.Has(Quirk.Messy)) res *= Rand.Range(4.0f,8.0f); if (pawn.Has(Quirk.Messy)) res *= Rand.Range(4.0f, 8.0f);
return res; return res;
} }
@ -178,7 +173,7 @@ namespace RJW_Menstruation
else if (hediff is Hediff_BasePregnancy) else if (hediff is Hediff_BasePregnancy)
{ {
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
string fetustex = h.babies?.FirstOrDefault()?.def.GetModExtension<PawnDNAModExtention>()?.fetusTexPath ?? "Fetus/Fetus_Default"; string fetustex = h.babies?.FirstOrDefault()?.def.GetModExtension<PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default";
if (h.GestationProgress < 0.2f) icon = comp.wombTex + "_Implanted"; if (h.GestationProgress < 0.2f) icon = comp.wombTex + "_Implanted";
else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00";
else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; else if (h.GestationProgress < 0.4f) icon += fetustex + "00";
@ -310,24 +305,24 @@ namespace RJW_Menstruation
{ {
if (pawn.Faction.IsPlayer) if (pawn.Faction.IsPlayer)
{ {
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Colonist)) return true; if ((Configurations.ShowFlag & Configurations.PawnFlags.Colonist) != 0) return true;
} }
else if (pawn.IsPrisonerOfColony) else if (pawn.IsPrisonerOfColony)
{ {
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Prisoner)) return true; if ((Configurations.ShowFlag & Configurations.PawnFlags.Prisoner) != 0) return true;
} }
else if (pawn.Faction.PlayerRelationKind == FactionRelationKind.Ally) else if (pawn.Faction.PlayerRelationKind == FactionRelationKind.Ally)
{ {
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Ally)) return true; if ((Configurations.ShowFlag & Configurations.PawnFlags.Ally) != 0) return true;
} }
else if (pawn.Faction.PlayerRelationKind == FactionRelationKind.Hostile) else if (pawn.Faction.PlayerRelationKind == FactionRelationKind.Hostile)
{ {
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Hostile)) return true; if ((Configurations.ShowFlag & Configurations.PawnFlags.Hostile) != 0) return true;
} }
else if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral)) return true; else if ((Configurations.ShowFlag & Configurations.PawnFlags.Neutral) != 0) return true;
else return false; else return false;
} }
else if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral)) return true; else if ((Configurations.ShowFlag & Configurations.PawnFlags.Neutral) != 0) return true;
return false; return false;
} }
@ -345,7 +340,7 @@ namespace RJW_Menstruation
public static void DrawEggOverlay(this HediffComp_Menstruation comp, Rect wombRect) public static void DrawEggOverlay(this HediffComp_Menstruation comp, Rect wombRect)
{ {
Rect rect = new Rect(wombRect.xMax - wombRect.width/3, wombRect.y, wombRect.width / 3, wombRect.width / 3); Rect rect = new Rect(wombRect.xMax - wombRect.width / 3, wombRect.y, wombRect.width / 3, wombRect.width / 3);
GUI.color = Color.white; GUI.color = Color.white;
GUI.DrawTexture(rect, comp.GetEggIcon(), ScaleMode.ScaleToFit); GUI.DrawTexture(rect, comp.GetEggIcon(), ScaleMode.ScaleToFit);
} }

View file

@ -1,11 +1,7 @@
using System; using RimWorld;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw; using rjw;
using System.Linq;
using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {