Merge branch 'dev'

This commit is contained in:
lutepickle 2022-08-24 11:06:35 -07:00
commit c03aede9f4
23 changed files with 225 additions and 219 deletions

Binary file not shown.

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs> <Defs>
<TaleDef> <TaleDef>
<defName>CameInside</defName> <defName>CameInside</defName>

View file

@ -2,14 +2,14 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="RJW_FertPill"]/ingestible/outcomeDoers</xpath> <xpath>/Defs/ThingDef[defName="RJW_FertPill"]/ingestible/outcomeDoers</xpath>
<value> <value>
<li Class="RJW_Menstruation.FertPillOutcomeDoer"/> <li Class="RJW_Menstruation.FertPillOutcomeDoer"/>
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="RJW_Contraceptive"]/ingestible/outcomeDoers</xpath> <xpath>/Defs/ThingDef[defName="RJW_Contraceptive"]/ingestible/outcomeDoers</xpath>
<value> <value>
<li Class="RJW_Menstruation.ContraceptiveOutcomeDoer"/> <li Class="RJW_Menstruation.ContraceptiveOutcomeDoer"/>
</value> </value>

View file

@ -9,7 +9,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="Vagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="Vagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -31,7 +31,7 @@
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GenericVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="GenericVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -51,7 +51,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="HydraulicVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="HydraulicVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -65,7 +65,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="BionicVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="BionicVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -79,7 +79,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="ArchotechVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="ArchotechVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -100,7 +100,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="Anus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="Anus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">
@ -111,7 +111,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="HydraulicAnus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="HydraulicAnus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">
@ -122,7 +122,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="BionicAnus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="BionicAnus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">
@ -133,7 +133,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="ArchotechAnus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="ArchotechAnus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">

View file

@ -11,7 +11,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DogVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="DogVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -32,7 +32,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="CatVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="CatVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_InducedOvulator"> <li Class="RJW_Menstruation.CompProperties_InducedOvulator">
@ -54,7 +54,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="HorseVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="HorseVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -77,7 +77,7 @@
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DragonVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="DragonVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -98,7 +98,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NarrowVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="NarrowVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -119,7 +119,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="RodentVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="RodentVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_InducedOvulator"> <li Class="RJW_Menstruation.CompProperties_InducedOvulator">
@ -140,7 +140,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="SlimeVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="SlimeVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_InducedOvulator"> <li Class="RJW_Menstruation.CompProperties_InducedOvulator">
@ -161,7 +161,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DemonVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="DemonVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_InducedOvulator"> <li Class="RJW_Menstruation.CompProperties_InducedOvulator">

View file

@ -3,7 +3,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="Breasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="Breasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -15,7 +15,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="HydraulicBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="HydraulicBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -27,7 +27,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="BionicBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="BionicBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -39,7 +39,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="ArchotechBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="ArchotechBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -51,7 +51,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="SlimeBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="SlimeBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">

View file

@ -2,35 +2,35 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="Cloth"]/stuffProps/statFactors</xpath> <xpath>/Defs/ThingDef[defName="Cloth"]/stuffProps/statFactors</xpath>
<value> <value>
<MaxAbsorbable>1.0</MaxAbsorbable> <MaxAbsorbable>1.0</MaxAbsorbable>
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="Synthread"]/stuffProps/statFactors</xpath> <xpath>/Defs/ThingDef[defName="Synthread"]/stuffProps/statFactors</xpath>
<value> <value>
<MaxAbsorbable>2.0</MaxAbsorbable> <MaxAbsorbable>2.0</MaxAbsorbable>
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="DevilstrandCloth"]/stuffProps/statFactors</xpath> <xpath>/Defs/ThingDef[defName="DevilstrandCloth"]/stuffProps/statFactors</xpath>
<value> <value>
<MaxAbsorbable>0.5</MaxAbsorbable> <MaxAbsorbable>0.5</MaxAbsorbable>
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="Hyperweave"]/stuffProps/statFactors</xpath> <xpath>/Defs/ThingDef[defName="Hyperweave"]/stuffProps/statFactors</xpath>
<value> <value>
<MaxAbsorbable>0.25</MaxAbsorbable> <MaxAbsorbable>0.25</MaxAbsorbable>
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[@Name="WoolBase"]/stuffProps/statFactors</xpath> <xpath>/Defs/ThingDef[@Name="WoolBase"]/stuffProps/statFactors</xpath>
<value> <value>
<MaxAbsorbable>1.5</MaxAbsorbable> <MaxAbsorbable>1.5</MaxAbsorbable>
</value> </value>

View file

@ -34,7 +34,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Human"]</xpath> <xpath>/Defs/ThingDef[defName="Human"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath> <fetusTexPath>Fetus/Fetus_Default</fetusTexPath>

View file

@ -27,7 +27,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[@Name="BigBirdThingBase"]</xpath> <xpath>/Defs/ThingDef[@Name="BigBirdThingBase"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath> <fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath>
@ -40,7 +40,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Chicken"]</xpath> <xpath>/Defs/ThingDef[defName="Chicken"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath> <fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath>
@ -53,7 +53,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Duck"]</xpath> <xpath>/Defs/ThingDef[defName="Duck"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath> <fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath>
@ -66,7 +66,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Goose"]</xpath> <xpath>/Defs/ThingDef[defName="Goose"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath> <fetusTexPath>Fetus/Birds/Fetus_Bird</fetusTexPath>
@ -79,7 +79,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="YorkshireTerrier"]</xpath> <xpath>/Defs/ThingDef[defName="YorkshireTerrier"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -93,7 +93,7 @@
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Husky"]</xpath> <xpath>/Defs/ThingDef[defName="Husky"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -106,7 +106,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="LabradorRetriever"]</xpath> <xpath>/Defs/ThingDef[defName="LabradorRetriever"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -119,7 +119,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="YorkshireTerrier"]</xpath> <xpath>/Defs/ThingDef[defName="YorkshireTerrier"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -133,7 +133,7 @@
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Warg"]</xpath> <xpath>/Defs/ThingDef[defName="Warg"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -146,7 +146,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[@Name="ThingBaseWolf"]</xpath> <xpath>/Defs/ThingDef[@Name="ThingBaseWolf"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -159,7 +159,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[@Name="ThingBaseFox"]</xpath> <xpath>/Defs/ThingDef[@Name="ThingBaseFox"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath> <fetusTexPath>Fetus/Canines/Fetus_Dog</fetusTexPath>
@ -172,7 +172,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Pig"]</xpath> <xpath>/Defs/ThingDef[defName="Pig"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Livestocks/Fetus_Pig</fetusTexPath> <fetusTexPath>Fetus/Livestocks/Fetus_Pig</fetusTexPath>
@ -185,7 +185,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="WildBoar"]</xpath> <xpath>/Defs/ThingDef[defName="WildBoar"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Livestocks/Fetus_Pig</fetusTexPath> <fetusTexPath>Fetus/Livestocks/Fetus_Pig</fetusTexPath>
@ -198,7 +198,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAddModExtension"> <Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[@Name="BaseInsect"]</xpath> <xpath>/Defs/ThingDef[@Name="BaseInsect"]</xpath>
<value> <value>
<li Class="RJW_Menstruation.PawnDNAModExtension"> <li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Insects/Fetus_Insect</fetusTexPath> <fetusTexPath>Fetus/Insects/Fetus_Insect</fetusTexPath>

View file

@ -11,7 +11,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="CervineVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="CervineVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -32,7 +32,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="CactoidVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="CactoidVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -53,7 +53,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="TreeVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="TreeVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -74,7 +74,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="PistilVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="PistilVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -95,7 +95,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -116,7 +116,7 @@
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhostVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="GhostVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -137,7 +137,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NecroVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="NecroVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">

View file

@ -4,7 +4,7 @@
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="BigRaceBreats"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="BigRaceBreats"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -16,7 +16,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="OrcBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="OrcBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -28,7 +28,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhoulBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="GhoulBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -40,7 +40,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhostBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="GhostBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -52,7 +52,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NecroBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="NecroBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -64,7 +64,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NephilaBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="NephilaBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -76,7 +76,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">
@ -88,7 +88,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="UdderBreasts"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="UdderBreasts"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Breast"> <li Class="RJW_Menstruation.CompProperties_Breast">

View file

@ -9,7 +9,7 @@
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="ElfVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="ElfVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -30,7 +30,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="ElfAnus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="ElfAnus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">
@ -41,7 +41,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="OrcVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="OrcVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -62,7 +62,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="OrcAnus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="OrcAnus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">
@ -75,7 +75,7 @@
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhoulVagina"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="GhoulVagina"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
@ -96,7 +96,7 @@
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhoulAnus"]</xpath> <xpath>/Defs/rjw.HediffDef_PartBase[defName="GhoulAnus"]</xpath>
<value> <value>
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Anus"> <li Class="RJW_Menstruation.CompProperties_Anus">

View file

@ -14,15 +14,10 @@ namespace RJW_Menstruation
return pawn?.def is ThingDef_AlienRace; return pawn?.def is ThingDef_AlienRace;
} }
public static AlienPartGenerator.AlienComp GetHARComp(this Pawn pawn)
{
return pawn?.TryGetComp<AlienPartGenerator.AlienComp>();
}
public static void CopyHARProperties(Pawn baby, Pawn original) public static void CopyHARProperties(Pawn baby, Pawn original)
{ {
AlienPartGenerator.AlienComp babyHARComp = baby.GetHARComp(); AlienPartGenerator.AlienComp babyHARComp = baby?.TryGetComp<AlienPartGenerator.AlienComp>();
AlienPartGenerator.AlienComp originalHARComp = original.GetHARComp(); AlienPartGenerator.AlienComp originalHARComp = original?.TryGetComp<AlienPartGenerator.AlienComp>();
if (babyHARComp == null || originalHARComp == null) return; if (babyHARComp == null || originalHARComp == null) return;
babyHARComp.crownType = originalHARComp.crownType; babyHARComp.crownType = originalHARComp.crownType;
@ -37,8 +32,8 @@ namespace RJW_Menstruation
// HAR doesn't populate variants until the graphics are called for, so this has to happen late // HAR doesn't populate variants until the graphics are called for, so this has to happen late
public static void CopyHARPropertiesPostBirth(Pawn baby, Pawn original) public static void CopyHARPropertiesPostBirth(Pawn baby, Pawn original)
{ {
AlienPartGenerator.AlienComp babyHARComp = baby.GetHARComp(); AlienPartGenerator.AlienComp babyHARComp = baby?.TryGetComp<AlienPartGenerator.AlienComp>();
AlienPartGenerator.AlienComp originalHARComp = original.GetHARComp(); AlienPartGenerator.AlienComp originalHARComp = original?.TryGetComp<AlienPartGenerator.AlienComp>();
if (babyHARComp == null || originalHARComp == null) return; if (babyHARComp == null || originalHARComp == null) return;
if (originalHARComp.addonVariants != null) // Testing has shown that the addons are valid by this point, but it's better to be safe if (originalHARComp.addonVariants != null) // Testing has shown that the addons are valid by this point, but it's better to be safe
babyHARComp.addonVariants = new List<int>(originalHARComp.addonVariants); babyHARComp.addonVariants = new List<int>(originalHARComp.addonVariants);

View file

@ -68,7 +68,7 @@ namespace RJW_Menstruation
get get
{ {
if (babyHalfAge > 0f) return babyHalfAge; if (babyHalfAge > 0f) return babyHalfAge;
List<LifeStageAge> ages = parent.pawn.def.race.lifeStageAges; List<LifeStageAge> ages = Pawn.def.race.lifeStageAges;
if (ages?.Count > 1) if (ages?.Count > 1)
babyHalfAge = ages[1].minAge / 2; babyHalfAge = ages[1].minAge / 2;
@ -165,9 +165,8 @@ namespace RJW_Menstruation
try try
{ {
if ( if (
!parent.pawn.IsHashIntervalTick(tickInterval) || !Pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns !Pawn.Spawned // TODO: Add option to simulate off-map pawns
parent.pawn.health.Dead
) )
{ {
return; return;
@ -178,7 +177,7 @@ namespace RJW_Menstruation
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error($"Error processing breasts of {parent.pawn}: {ex}"); Log.Error($"Error processing breasts of {Pawn}: {ex}");
} }
} }
@ -186,14 +185,14 @@ namespace RJW_Menstruation
public override void CompPostPostAdd(DamageInfo? dinfo) public override void CompPostPostAdd(DamageInfo? dinfo)
{ {
if (!loaded) Initialize(); if (!loaded) Initialize();
if (ageOfLastBirth > parent.pawn.ageTracker.AgeChronologicalTicks) ageOfLastBirth = CalculateLastBirth(); // catch transplant issues if (ageOfLastBirth > Pawn.ageTracker.AgeChronologicalTicks) ageOfLastBirth = CalculateLastBirth(); // catch transplant issues
} }
public override void CompPostPostRemoved() public override void CompPostPostRemoved()
{ {
if (parent.pawn.health.hediffSet.hediffs.Contains(parent)) if (Pawn.health.hediffSet.hediffs.Contains(parent))
{ {
Log.Warning($"Attempted to remove breast comp from wrong pawn ({parent.pawn})."); Log.Warning($"Attempted to remove breast comp from wrong pawn ({Pawn}).");
return; return;
} }
base.CompPostPostRemoved(); base.CompPostPostRemoved();
@ -202,23 +201,23 @@ namespace RJW_Menstruation
protected long CalculateLastBirth() protected long CalculateLastBirth()
{ {
long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either
if ((parent.pawn.relations?.ChildrenCount ?? 0) > 0) if ((Pawn.relations?.ChildrenCount ?? 0) > 0)
{ {
foreach (Pawn child in parent.pawn.relations.Children) foreach (Pawn child in Pawn.relations.Children)
{ {
bool isFetus = false; bool isFetus = false;
if (parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child))) if (Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child)))
{ {
isFetus = true; isFetus = true;
break; break;
} }
if ( if (
parent.pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth && Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth &&
!isFetus && !isFetus &&
child.GetMother() == parent.pawn // Don't do Dad's boobs child.GetMother() == Pawn // Don't do Dad's boobs
) )
youngestAge = parent.pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks; youngestAge = Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks;
} }
} }
return youngestAge; return youngestAge;
@ -255,7 +254,7 @@ namespace RJW_Menstruation
protected void CalculateBreastSize() protected void CalculateBreastSize()
{ {
// Scenario A: the youngest child is less than halfway into babyhood: Full size // Scenario A: the youngest child is less than halfway into babyhood: Full size
if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > parent.pawn.ageTracker.AgeBiologicalTicks) if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > Pawn.ageTracker.AgeBiologicalTicks)
{ {
debugGrowthStatus = "Full size due to young child"; debugGrowthStatus = "Full size due to young child";
if (breastSizeIncreased < MaxBreastIncrement) if (breastSizeIncreased < MaxBreastIncrement)
@ -265,9 +264,9 @@ namespace RJW_Menstruation
} }
} }
// Scenario B: Pregnant, grow in the second half of first trimester // Scenario B: Pregnant, grow in the second half of first trimester
else if (parent.pawn.IsPregnant()) else if (Pawn.IsRJWPregnant())
{ {
float pregnancySize = Mathf.InverseLerp(breastGrowthStart, breastGrowthEnd, parent.pawn.GetFarthestPregnancyProgress()) * MaxBreastIncrement; float pregnancySize = Mathf.InverseLerp(breastGrowthStart, breastGrowthEnd, Pawn.GetFarthestPregnancyProgress()) * MaxBreastIncrement;
if (breastSizeIncreased > pregnancySize) if (breastSizeIncreased > pregnancySize)
{ {
debugGrowthStatus = "Shrinking due to being oversize for pregnancy"; debugGrowthStatus = "Shrinking due to being oversize for pregnancy";
@ -299,13 +298,15 @@ namespace RJW_Menstruation
protected void CalculateNipples() protected void CalculateNipples()
{ {
float newNippleProgress; float newNippleProgress;
if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > parent.pawn.ageTracker.AgeBiologicalTicks) if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > Pawn.ageTracker.AgeBiologicalTicks)
newNippleProgress = 1f; newNippleProgress = 1f;
else if (parent.pawn.IsPregnant()) else if (Pawn.IsRJWPregnant())
newNippleProgress = nippleTransitions.Evaluate(parent.pawn.GetFarthestPregnancyProgress()); newNippleProgress = nippleTransitions.Evaluate(Pawn.GetFarthestPregnancyProgress());
else else
newNippleProgress = 0f; newNippleProgress = 0f;
if (newNippleProgress < 0) newNippleProgress = 0;
if (newNippleProgress == nippleProgress) return; // Nothing to change if (newNippleProgress == nippleProgress) return; // Nothing to change
else if (newNippleProgress > nippleProgress) else if (newNippleProgress > nippleProgress)
{ {
@ -352,7 +353,7 @@ namespace RJW_Menstruation
cachedNipple = baseNipple + nippleProgress * nippleChange; cachedNipple = baseNipple + nippleProgress * nippleChange;
// For some reason, Props can go null when RJW relocates the chest (e.g. some animals), so catch that // For some reason, Props can go null when RJW relocates the chest (e.g. some animals), so catch that
cachedColor = Colors.CMYKLerp(parent.pawn.story?.SkinColor ?? Color.white, (Props?.BlackNippleColor ?? CompProperties_Breast.DefaultBlacknippleColor.ToColor), Alpha); cachedColor = Colors.CMYKLerp(Pawn.story?.SkinColor ?? Color.white, (Props?.BlackNippleColor ?? CompProperties_Breast.DefaultBlacknippleColor.ToColor), Alpha);
} }
public void CopyBreastProperties(HediffComp_Breast original) public void CopyBreastProperties(HediffComp_Breast original)

View file

@ -75,7 +75,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
switch (curStage) switch (curStage)
{ {

View file

@ -1,4 +1,5 @@
using RimWorld; using RimWorld;
using RimWorld.Planet;
using rjw; using rjw;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -123,7 +124,7 @@ namespace RJW_Menstruation
get get
{ {
if (pregnancy == null) return null; if (pregnancy == null) return null;
else if (!parent.pawn.health.hediffSet.hediffs.Contains(pregnancy)) else if (!Pawn.health.hediffSet.hediffs.Contains(pregnancy))
{ {
pregnancy = null; pregnancy = null;
return null; return null;
@ -142,7 +143,7 @@ namespace RJW_Menstruation
float avglittersize; float avglittersize;
try try
{ {
avglittersize = Mathf.Max(Rand.ByCurveAverage(parent.pawn.def.race.litterSizeCurve), 1.0f); avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.def.race.litterSizeCurve), 1.0f);
} }
catch catch
{ {
@ -152,7 +153,7 @@ namespace RJW_Menstruation
opcache = (int)(RaceCyclesPerYear() * opcache = (int)(RaceCyclesPerYear() *
avglittersize * avglittersize *
6f * 6f *
(parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)); (Pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy));
return opcache; return opcache;
} }
} }
@ -185,7 +186,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
float res = Props.maxCumCapacity * parent.pawn.BodySize; float res = Props.maxCumCapacity * Pawn.BodySize;
if (curStage != Stage.Pregnant || (pregnancy?.Severity ?? 0f) < 0.175f) res *= 500f; if (curStage != Stage.Pregnant || (pregnancy?.Severity ?? 0f) < 0.175f) res *= 500f;
return res; return res;
} }
@ -195,7 +196,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f; if (xxx.has_quirk(Pawn, "Breeder")) return 0.5f;
return 1.0f; return 1.0f;
} }
@ -206,8 +207,8 @@ namespace RJW_Menstruation
get get
{ {
float factor = 1.0f; float factor = 1.0f;
if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f; if (Pawn.Has(Quirk.Breeder)) factor = 10.0f;
return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * factor; return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * factor;
} }
} }
public IEnumerable<string> GetCumsInfo public IEnumerable<string> GetCumsInfo
@ -419,7 +420,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
switch (curStage) switch (curStage)
{ {
@ -450,7 +451,7 @@ namespace RJW_Menstruation
{ {
try try
{ {
Color c = parent.pawn.def.race.BloodDef.graphicData.color; Color c = Pawn.def.race.BloodDef.graphicData.color;
return c; return c;
} }
catch catch
@ -466,7 +467,7 @@ namespace RJW_Menstruation
{ {
if (breastcache == null) if (breastcache == null)
{ {
breastcache = parent.pawn.GetBreastComp(); breastcache = Pawn.GetBreastComp();
} }
return breastcache; return breastcache;
} }
@ -505,8 +506,8 @@ namespace RJW_Menstruation
// Luteal will appear to progress, hitting the end of the phase when the pregnancy is discovered // Luteal will appear to progress, hitting the end of the phase when the pregnancy is discovered
float discoveryTime = 0.5f; float discoveryTime = 0.5f;
if (parent.pawn.story?.bodyType == BodyTypeDefOf.Thin) discoveryTime = 0.25f; if (Pawn.story?.bodyType == BodyTypeDefOf.Thin) discoveryTime = 0.25f;
else if (parent.pawn.story?.bodyType == BodyTypeDefOf.Female) discoveryTime = 0.35f; else if (Pawn.story?.bodyType == BodyTypeDefOf.Female) discoveryTime = 0.35f;
// Estimated; there's no way to get the exact value after the fact without writing it into the save // Estimated; there's no way to get the exact value after the fact without writing it into the save
float lutealProgressWhenImplanted = Math.Min(0.5f, maxImplantDelayHours / (Props.lutealIntervalDays * 24)); float lutealProgressWhenImplanted = Math.Min(0.5f, maxImplantDelayHours / (Props.lutealIntervalDays * 24));
@ -558,17 +559,16 @@ namespace RJW_Menstruation
try try
{ {
if ( if (
!parent.pawn.IsHashIntervalTick(tickInterval) || !Pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns !Pawn.Spawned || // TODO: Add option to simulate off-map pawns
parent.pawn.health.Dead || (Pawn.IsAnimal() && !Configurations.EnableAnimalCycle)
(parent.pawn.IsAnimal() && !Configurations.EnableAnimalCycle)
) )
{ {
return; return;
} }
CumOut(); CumOut();
if (pregnancy == null && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; if (pregnancy == null && Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
switch (curStage) switch (curStage)
{ {
case Stage.Follicular: case Stage.Follicular:
@ -614,7 +614,7 @@ namespace RJW_Menstruation
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error($"Error processing womb of {parent.pawn}: {ex}"); Log.Error($"Error processing womb of {Pawn}: {ex}");
} }
} }
@ -622,12 +622,13 @@ namespace RJW_Menstruation
{ {
// If a hediff is removed from a pawn that does not have it, CompPostPostRemoved is still called on the pawn that does. // If a hediff is removed from a pawn that does not have it, CompPostPostRemoved is still called on the pawn that does.
// If it was a legitimate removal, then it won't be in this pawn's hediff list anymore, as that removal occurs first // If it was a legitimate removal, then it won't be in this pawn's hediff list anymore, as that removal occurs first
if (parent.pawn.health.hediffSet.hediffs.Contains(parent)) if (Pawn.health.hediffSet.hediffs.Contains(parent))
{ {
Log.Warning($"Attempted to remove menstruation comp from wrong pawn ({parent.pawn})."); Log.Warning($"Attempted to remove menstruation comp from wrong pawn ({Pawn}).");
return; return;
} }
pregnancy?.Miscarry(); if (!(pregnancy is Hediff_MechanoidPregnancy))
pregnancy.Miscarry();
base.CompPostPostRemoved(); base.CompPostPostRemoved();
} }
@ -666,7 +667,7 @@ namespace RJW_Menstruation
public void CumIn(Pawn pawn, float volume, float fertility = 1.0f, ThingDef filthdef = null) public void CumIn(Pawn pawn, float volume, float fertility = 1.0f, ThingDef filthdef = null)
{ {
if (volume <= 0) return; if (volume <= 0) return;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) fertility /= 100f; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) fertility /= 100f;
float cumd = TotalCumPercent; float cumd = TotalCumPercent;
float tmp = TotalCum + volume; float tmp = TotalCum + volume;
if (tmp > CumCapacity) if (tmp > CumCapacity)
@ -700,7 +701,7 @@ namespace RJW_Menstruation
} }
cumd = TotalCumPercent - cumd; cumd = TotalCumPercent - cumd;
parent.pawn.records.AddTo(VariousDefOf.AmountofCreampied, volume); Pawn.records.AddTo(VariousDefOf.AmountofCreampied, volume);
AfterCumIn(pawn); AfterCumIn(pawn);
AfterFluidIn(cumd); AfterFluidIn(cumd);
} }
@ -776,13 +777,13 @@ namespace RJW_Menstruation
protected void BeforeCumOut(out Absorber absorber) protected void BeforeCumOut(out Absorber absorber)
{ {
Hediff asa = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_ASA); Hediff asa = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_ASA);
float asafactor = asa?.Severity ?? 0f; float asafactor = asa?.Severity ?? 0f;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f + asafactor; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f + asafactor;
else antisperm = 0.0f + asafactor; else antisperm = 0.0f + asafactor;
absorber = (Absorber)parent.pawn.apparel?.WornApparel?.Find(x => x is Absorber); absorber = (Absorber)Pawn.apparel?.WornApparel?.Find(x => x is Absorber);
if (absorber != null) if (absorber != null)
{ {
absorber.WearEffect(); absorber.WearEffect();
@ -795,7 +796,7 @@ namespace RJW_Menstruation
/// </summary> /// </summary>
protected virtual void AfterCumOut() protected virtual void AfterCumOut()
{ {
parent.pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids); Pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids);
} }
/// <summary> /// <summary>
@ -821,13 +822,13 @@ namespace RJW_Menstruation
List<string> filthlabels = new List<string>(); List<string> filthlabels = new List<string>();
BeforeCumOut(out Absorber absorber); BeforeCumOut(out Absorber absorber);
if (cums.NullOrEmpty()) return; if (cums.NullOrEmpty()) return;
if (TotalCum > Props.maxCumCapacity * parent.pawn.BodySize) leakfactor = Math.Min(1 + (TotalCum - Props.maxCumCapacity * parent.pawn.BodySize) / 10, 2f); 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 (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f;
if (parent.pawn.jobs?.curJob?.def == rjw.xxx.knotted) leakfactor = 0f; if (Pawn.jobs?.curJob?.def == xxx.knotted) leakfactor = 0f;
List<Cum> removecums = new List<Cum>(); List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums) foreach (Cum cum in cums)
{ {
cum.CumEffects(parent.pawn); cum.CumEffects(Pawn);
float vd = cum.DismishNatural(leakfactor, antisperm); float vd = cum.DismishNatural(leakfactor, antisperm);
cum.MakeThinner(Configurations.CycleAcceleration); cum.MakeThinner(Configurations.CycleAcceleration);
totalleak += AbsorbCum(vd, absorber); totalleak += AbsorbCum(vd, absorber);
@ -912,7 +913,7 @@ namespace RJW_Menstruation
cums.Remove(cum); cums.Remove(cum);
} }
removecums.Clear(); removecums.Clear();
return new CumMixture(parent.pawn, totalleak, cumlabels, color, mixtureDef, pure); return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure);
} }
/// <summary> /// <summary>
@ -958,7 +959,7 @@ namespace RJW_Menstruation
if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent(); if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent();
if (currentIntervalHours < 0) if (currentIntervalHours < 0)
{ {
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
else if (!IsBreedingSeason()) curStage = Stage.Anestrus; else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
else curStage = RandomStage(); else curStage = RandomStage();
if (curStage == Stage.Follicular) if (curStage == Stage.Follicular)
@ -978,7 +979,7 @@ namespace RJW_Menstruation
if (pregnancy == null) if (pregnancy == null)
{ {
// If this womb isn't marked pregnant, search for pregnancies that have no womb and claim one // If this womb isn't marked pregnant, search for pregnancies that have no womb and claim one
foreach (Hediff_BasePregnancy preg in parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>()) foreach (Hediff_BasePregnancy preg in Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>())
{ {
if (preg.GetMenstruationComp() == null) if (preg.GetMenstruationComp() == null)
{ {
@ -990,7 +991,7 @@ namespace RJW_Menstruation
} }
} }
//Log.Message(parent.pawn.Label + " - Initialized menstruation comp"); //Log.Message(Pawn.Label + " - Initialized menstruation comp");
loaded = true; loaded = true;
} }
@ -1016,19 +1017,18 @@ namespace RJW_Menstruation
public int GetOvaryPowerByAge() public int GetOvaryPowerByAge()
{ {
Pawn pawn = parent.pawn;
float avglittersize; float avglittersize;
try try
{ {
avglittersize = Mathf.Max(Rand.ByCurveAverage(pawn.def.race.litterSizeCurve), 1.0f); avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.def.race.litterSizeCurve), 1.0f);
} }
catch (NullReferenceException) catch (NullReferenceException)
{ {
avglittersize = 1.0f; avglittersize = 1.0f;
} }
float fertStartAge = pawn.RaceProps.lifeStageAges?.Find(stage => stage.def.reproductive)?.minAge ?? 0.0f; float fertStartAge = Pawn.RaceProps.lifeStageAges?.Find(stage => stage.def.reproductive)?.minAge ?? 0.0f;
float fertEndAge = pawn.RaceProps.lifeExpectancy * (pawn.IsAnimal() ? RJWPregnancySettings.fertility_endage_female_animal : RJWPregnancySettings.fertility_endage_female_humanlike); float fertEndAge = Pawn.RaceProps.lifeExpectancy * (Pawn.IsAnimal() ? RJWPregnancySettings.fertility_endage_female_animal : RJWPregnancySettings.fertility_endage_female_humanlike);
if (fertEndAge < fertStartAge) fertEndAge = fertStartAge; if (fertEndAge < fertStartAge) fertEndAge = fertStartAge;
float raceCyclesPerYear = RaceCyclesPerYear(); float raceCyclesPerYear = RaceCyclesPerYear();
@ -1036,7 +1036,7 @@ namespace RJW_Menstruation
int lifetimeEggs = (int)(lifetimeCycles * avglittersize * Utility.RandGaussianLike(0.70f, 1.30f, 5)); int lifetimeEggs = (int)(lifetimeCycles * avglittersize * Utility.RandGaussianLike(0.70f, 1.30f, 5));
float pawnCyclesPerYear = raceCyclesPerYear * cycleSpeed; float pawnCyclesPerYear = raceCyclesPerYear * cycleSpeed;
float pawnCyclesElapsed = Mathf.Max((pawn.ageTracker.AgeBiologicalYearsFloat - fertStartAge) * pawnCyclesPerYear, 0.0f); float pawnCyclesElapsed = Mathf.Max((Pawn.ageTracker.AgeBiologicalYearsFloat - fertStartAge) * pawnCyclesPerYear, 0.0f);
int pawnEggsUsed = PawnEggsUsed(pawnCyclesElapsed, avglittersize); int pawnEggsUsed = PawnEggsUsed(pawnCyclesElapsed, avglittersize);
return Math.Max(lifetimeEggs - pawnEggsUsed, 0); return Math.Max(lifetimeEggs - pawnEggsUsed, 0);
@ -1053,16 +1053,16 @@ namespace RJW_Menstruation
ovarypower = GetOvaryPowerByAge(); ovarypower = GetOvaryPowerByAge();
if (ovarypower < 1) if (ovarypower < 1)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, Pawn);
hediff.Severity = 0.2f; hediff.Severity = 0.2f;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
curStage = Stage.Young; curStage = Stage.Young;
} }
else if (ovarypower < OvaryPowerThreshold) else if (ovarypower < OvaryPowerThreshold)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, Pawn);
hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower); hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower);
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
} }
} }
} }
@ -1081,7 +1081,7 @@ namespace RJW_Menstruation
{ {
if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold) if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold)
{ {
if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed); if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
else else
{ {
if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.01f; if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.01f;
@ -1092,16 +1092,16 @@ namespace RJW_Menstruation
public void SetEstrus(int days) public void SetEstrus(int days)
{ {
HediffDef estrusdef = Props.concealedEstrus ? VariousDefOf.Hediff_Estrus_Concealed : VariousDefOf.Hediff_Estrus; HediffDef estrusdef = Props.concealedEstrus ? VariousDefOf.Hediff_Estrus_Concealed : VariousDefOf.Hediff_Estrus;
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef);
if (Props.concealedEstrus) if (Props.concealedEstrus)
{ {
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus)) return; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus)) return;
} }
else else
{ {
Hediff concealedHediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Estrus_Concealed); Hediff concealedHediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Estrus_Concealed);
if (concealedHediff != null) parent.pawn.health.RemoveHediff(concealedHediff); if (concealedHediff != null) Pawn.health.RemoveHediff(concealedHediff);
} }
if (hediff != null) if (hediff != null)
@ -1110,19 +1110,20 @@ namespace RJW_Menstruation
} }
else else
{ {
hediff = HediffMaker.MakeHediff(estrusdef, parent.pawn); hediff = HediffMaker.MakeHediff(estrusdef, Pawn);
hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f; hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f;
parent.pawn.health.AddHediff(hediff); Pawn.health.AddHediff(hediff);
} }
} }
public bool IsBreedingSeason() public bool IsBreedingSeason()
{ {
if (Props.breedingSeason == SeasonalBreed.Always) return true; if (Props.breedingSeason == SeasonalBreed.Always) return true;
Map map = parent.pawn.Map;
if (map == null) map = Find.AnyPlayerHomeMap; int tile = Pawn.Tile;
if (map == null) return true; if (tile < 0) tile = Find.AnyPlayerHomeMap?.Tile ?? -1;
switch (GenLocalDate.Season(map)) if (tile < 0) return true;
switch (GenLocalDate.Season(tile))
{ {
case Season.Spring: case Season.Spring:
return (Props.breedingSeason & SeasonalBreed.Spring) != 0; return (Props.breedingSeason & SeasonalBreed.Spring) != 0;
@ -1142,7 +1143,7 @@ namespace RJW_Menstruation
protected Pawn Fertilize() protected Pawn Fertilize()
{ {
if (cums.NullOrEmpty()) return null; if (cums.NullOrEmpty()) return null;
List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(parent.pawn) == xxx.is_animal(cum.pawn))); List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn)));
if (eligibleCum.Count == 0) return null; if (eligibleCum.Count == 0) return null;
float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume); float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);
@ -1150,7 +1151,7 @@ namespace RJW_Menstruation
if (Rand.Range(0.0f, 1.0f) > 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor)) if (Rand.Range(0.0f, 1.0f) > 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor))
return null; return null;
parent.pawn.records.AddTo(VariousDefOf.AmountofFertilizedEggs, 1); Pawn.records.AddTo(VariousDefOf.AmountofFertilizedEggs, 1);
float selection = Rand.Range(0.0f, totalFertPower); float selection = Rand.Range(0.0f, totalFertPower);
foreach (Cum cum in eligibleCum) foreach (Cum cum in eligibleCum)
@ -1181,7 +1182,7 @@ namespace RJW_Menstruation
deadeggs.Add(egg); deadeggs.Add(egg);
continue; continue;
} }
else if (parent.pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any() || pregnancy is Hediff_MechanoidPregnancy) else if (Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any() || pregnancy is Hediff_MechanoidPregnancy)
{ {
deadeggs.Add(egg); deadeggs.Add(egg);
continue; continue;
@ -1194,7 +1195,7 @@ namespace RJW_Menstruation
{ {
if (pregnancy is Hediff_MultiplePregnancy h) if (pregnancy is Hediff_MultiplePregnancy h)
{ {
h.AddNewBaby(parent.pawn, egg.fertilizer); h.AddNewBaby(Pawn, egg.fertilizer);
} }
pregnant = true; pregnant = true;
deadeggs.Add(egg); deadeggs.Add(egg);
@ -1209,15 +1210,15 @@ namespace RJW_Menstruation
{ {
if (!Configurations.UseMultiplePregnancy) if (!Configurations.UseMultiplePregnancy)
{ {
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer); PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
// I hate having to do this, but it gets the newest pregnancy // I hate having to do this, but it gets the newest pregnancy
pregnancy = parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID); pregnancy = Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID);
pregnant = true; pregnant = true;
break; break;
} }
else else
{ {
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(parent.pawn, egg.fertilizer); pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer);
pregnant = true; pregnant = true;
deadeggs.Add(egg); deadeggs.Add(egg);
} }
@ -1246,8 +1247,7 @@ namespace RJW_Menstruation
protected void BleedOut() protected void BleedOut()
{ {
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); CumIn(Pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood, -5.0f, Pawn.def.race?.BloodDef ?? ThingDefOf.Filth_Blood);
CumIn(parent.pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood, -5.0f, parent.pawn.def.race?.BloodDef ?? ThingDefOf.Filth_Blood);
Cum blood = GetNotCum(Translations.Menstrual_Blood); Cum blood = GetNotCum(Translations.Menstrual_Blood);
if (blood != null) blood.Color = BloodColor; if (blood != null) blood.Color = BloodColor;
} }
@ -1259,7 +1259,8 @@ namespace RJW_Menstruation
/// <param name="amount"></param> /// <param name="amount"></param>
protected void MakeCumFilth(Cum cum, float amount) protected void MakeCumFilth(Cum cum, float amount)
{ {
if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn?.LabelShort ?? "Unknown"); if (Pawn.Map == null) return;
if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(Pawn.Position, Pawn.Map, cum.FilthDef, cum.pawn?.LabelShort ?? "Unknown");
} }
/// <summary> /// <summary>
@ -1274,7 +1275,7 @@ namespace RJW_Menstruation
if (absorber == null) if (absorber == null)
{ {
//if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); //if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(Pawn.Position, Pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
@ -1282,11 +1283,11 @@ namespace RJW_Menstruation
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)
{ {
//if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); //if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(Pawn.Position, Pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
absorber.absorbedfluids += amount; absorber.absorbedfluids += amount;
if (absorber.absorbedfluids > absorbable && !parent.pawn.apparel.IsLocked(absorber)) if (absorber.absorbedfluids > absorbable && !Pawn.apparel.IsLocked(absorber))
{ {
absorber.def = absorber.DirtyDef; absorber.def = absorber.DirtyDef;
//absorber.fluidColor = GetCumMixtureColor; //absorber.fluidColor = GetCumMixtureColor;
@ -1297,10 +1298,10 @@ namespace RJW_Menstruation
protected float MakeCumFilthMixture(float amount, List<string> cumlabels) protected float MakeCumFilthMixture(float amount, List<string> cumlabels)
{ {
if (Pawn.Map == null) return 0;
if (amount >= minmakefilthvalue) if (amount >= minmakefilthvalue)
{ {
FilthMaker_Colored.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, VariousDefOf.FilthMixture, cumlabels, GetCumMixtureColor, false); FilthMaker_Colored.TryMakeFilth(Pawn.Position, Pawn.Map, VariousDefOf.FilthMixture, cumlabels, GetCumMixtureColor, false);
} }
return amount; return amount;
} }
@ -1333,11 +1334,11 @@ namespace RJW_Menstruation
protected void AddCrampPain() protected void AddCrampPain()
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, Pawn);
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f); hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props; HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
Prop.severityPerDay = -hediff.Severity / (currentIntervalHours / 24) * Configurations.CycleAcceleration; Prop.severityPerDay = -hediff.Severity / (currentIntervalHours / 24) * Configurations.CycleAcceleration;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
} }
protected virtual void FollicularAction(bool climacteric) protected virtual void FollicularAction(bool climacteric)
@ -1381,7 +1382,7 @@ namespace RJW_Menstruation
float eggnum; float eggnum;
try try
{ {
eggnum = Rand.ByCurve(parent.pawn.def.race.litterSizeCurve); eggnum = Rand.ByCurve(Pawn.def.race.litterSizeCurve);
} }
catch (NullReferenceException) catch (NullReferenceException)
{ {
@ -1389,7 +1390,7 @@ namespace RJW_Menstruation
} }
catch (ArgumentException e) catch (ArgumentException e)
{ {
Log.Warning($"Invalid litterSizeCurve for {parent.pawn.def}: {e}"); Log.Warning($"Invalid litterSizeCurve for {Pawn.def}: {e}");
eggnum = 1; eggnum = 1;
} }
eggnum += eggstack; eggnum += eggstack;
@ -1404,19 +1405,19 @@ namespace RJW_Menstruation
if (Configurations.EnableMenopause && ovarypower < 1) if (Configurations.EnableMenopause && ovarypower < 1)
{ {
eggs.Clear(); eggs.Clear();
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, Pawn);
hediff.Severity = 0.2f; hediff.Severity = 0.2f;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
ovarypower = 0; ovarypower = 0;
GoNextStage(Stage.Young); GoNextStage(Stage.Young);
} }
else if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold) else if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, Pawn);
hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower); hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower);
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
GoNextStage(Stage.ClimactericLuteal); GoNextStage(Stage.ClimactericLuteal);
} }
else else
@ -1483,8 +1484,8 @@ namespace RJW_Menstruation
} }
else if (curStageHrs >= currentIntervalHours) else if (curStageHrs >= currentIntervalHours)
{ {
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
int totalFollicularHours = PeriodRandomizer(climacteric ? Stage.ClimactericFollicular : Stage.Follicular, climacteric ? 6.0f : 1.0f); // The total amount of time for both bleeding and follicular int totalFollicularHours = PeriodRandomizer(climacteric ? Stage.ClimactericFollicular : Stage.Follicular, climacteric ? 6.0f : 1.0f); // The total amount of time for both bleeding and follicular
if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase
GoOvulatoryStage(climacteric); GoOvulatoryStage(climacteric);
@ -1511,7 +1512,7 @@ namespace RJW_Menstruation
Implant(); Implant();
} }
if (parent.pawn.health.hediffSet.hediffs.Contains(pregnancy)) if (Pawn.health.hediffSet.hediffs.Contains(pregnancy))
{ {
curStageHrs += 1; curStageHrs += 1;
StayCurrentStageConst(Stage.Pregnant); StayCurrentStageConst(Stage.Pregnant);
@ -1531,7 +1532,7 @@ namespace RJW_Menstruation
{ {
GoNextStage(Stage.ClimactericFollicular); GoNextStage(Stage.ClimactericFollicular);
} }
else if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) == 0) else if (Pawn.health.capacities.GetLevel(xxx.reproduction) == 0)
{ {
GoNextStage(Stage.Young); GoNextStage(Stage.Young);
} }
@ -1553,7 +1554,7 @@ namespace RJW_Menstruation
{ {
RemoveClimactericEffect(); RemoveClimactericEffect();
} }
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0)
{ {
StayCurrentStageConst(Stage.Young); StayCurrentStageConst(Stage.Young);
} }
@ -1578,54 +1579,54 @@ namespace RJW_Menstruation
protected virtual void ThoughtCumInside(Pawn cummer) protected virtual void ThoughtCumInside(Pawn cummer)
{ {
if (!xxx.is_human(parent.pawn) || !xxx.is_human(cummer)) return; if (!xxx.is_human(Pawn) || !xxx.is_human(cummer)) return;
if ((cummer.Has(Quirk.Teratophile) != (parent.pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)) || if ((cummer.Has(Quirk.Teratophile) != (Pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)) ||
cummer.Has(Quirk.ImpregnationFetish) || cummer.Has(Quirk.ImpregnationFetish) ||
cummer.Has(Quirk.Breeder)) cummer.Has(Quirk.Breeder))
{ {
if (cummer.relations.OpinionOf(parent.pawn) <= -25) if (cummer.relations.OpinionOf(Pawn) <= -25)
{ {
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, parent.pawn); cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, Pawn);
} }
else else
{ {
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, parent.pawn); cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, Pawn);
} }
} }
if (IsDangerDay) if (IsDangerDay)
{ {
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish)) if (Pawn.Has(Quirk.Breeder) || Pawn.Has(Quirk.ImpregnationFetish))
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
} }
else if (parent.pawn.relations.OpinionOf(cummer) <= -5) else if (Pawn.relations.OpinionOf(cummer) <= -5)
{ {
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer); Pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer); Pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer);
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
} }
else if (parent.pawn.IsInEstrus() && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup) else if (Pawn.IsInEstrus() && Pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
{ {
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer); Pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer);
} }
else if (!parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer)) else if (!Pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !Pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer))
{ {
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer); if (Pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer); else Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer);
} }
} }
else else
{ {
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish)) if (Pawn.Has(Quirk.Breeder) || Pawn.Has(Quirk.ImpregnationFetish))
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer);
} }
else if (parent.pawn.relations.OpinionOf(cummer) <= -5) else if (Pawn.relations.OpinionOf(cummer) <= -5)
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer);
} }
} }
} }
@ -1633,11 +1634,11 @@ namespace RJW_Menstruation
protected virtual void TaleCumInside(Pawn cummer) protected virtual void TaleCumInside(Pawn cummer)
{ {
// Only make the tale for human-on-human, consentual sex. Otherwise the art just gets too hard to phrase properly // Only make the tale for human-on-human, consentual sex. Otherwise the art just gets too hard to phrase properly
if (!xxx.is_human(parent.pawn) || !xxx.is_human(cummer) || parent.pawn == cummer) return; if (!xxx.is_human(Pawn) || !xxx.is_human(cummer) || Pawn == cummer) return;
if (parent.pawn.CurJobDef != xxx.casual_sex && parent.pawn.CurJobDef != xxx.gettin_loved) return; if (Pawn.CurJobDef != xxx.casual_sex && Pawn.CurJobDef != xxx.gettin_loved) return;
if (!(parent.pawn.IsColonist || parent.pawn.IsPrisonerOfColony) && !(cummer.IsColonist || cummer.IsPrisonerOfColony)) return; if (!(Pawn.IsColonist || Pawn.IsPrisonerOfColony) && !(cummer.IsColonist || cummer.IsPrisonerOfColony)) return;
if (!IsDangerDay) return; if (!IsDangerDay) return;
TaleRecorder.RecordTale(VariousDefOf.TaleCameInside, new object[] { cummer, parent.pawn }); TaleRecorder.RecordTale(VariousDefOf.TaleCameInside, new object[] { cummer, Pawn });
} }
protected void GoNextStage(Stage nextstage, bool calculateHours = true) protected void GoNextStage(Stage nextstage, bool calculateHours = true)
@ -1678,10 +1679,10 @@ namespace RJW_Menstruation
protected void RemoveClimactericEffect() protected void RemoveClimactericEffect()
{ {
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause); hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding; if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular; else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal; else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
@ -1712,10 +1713,10 @@ namespace RJW_Menstruation
protected float InterspeciesImplantFactor(Pawn fertilizer) protected float InterspeciesImplantFactor(Pawn fertilizer)
{ {
if (fertilizer.def.defName == parent.pawn.def.defName) return 1.0f; if (fertilizer.def.defName == Pawn.def.defName) return 1.0f;
else else
{ {
if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(Pawn, fertilizer);
else return RJWPregnancySettings.interspecies_impregnation_modifier; else return RJWPregnancySettings.interspecies_impregnation_modifier;
} }
} }

View file

@ -51,7 +51,7 @@ namespace RJW_Menstruation
"eggs: " + comp.GetNumofEggs + "\n"; "eggs: " + comp.GetNumofEggs + "\n";
} }
else description += comp.GetCurStageLabel + "\n"; else description += comp.GetCurStageLabel + "\n";
if (pawn.IsPregnant()) if (pawn.IsRJWPregnant())
{ {
Hediff_BasePregnancy hediff = comp.Pregnancy; Hediff_BasePregnancy hediff = comp.Pregnancy;
if (hediff != null && Utility.ShowFetusImage(hediff)) if (hediff != null && Utility.ShowFetusImage(hediff))

View file

@ -57,10 +57,9 @@ namespace RJW_Menstruation
if (__state == null || __state.Pregnancy != null) return; if (__state == null || __state.Pregnancy != null) return;
// It was pregnant, but not anymore. This probably means the pregnancy was destroyed by e.g. a mech implant // It was pregnant, but not anymore. This probably means the pregnancy was destroyed by e.g. a mech implant
Pawn pawn = props.partner; Pawn pawn = props.partner;
Hediff_BasePregnancy newestPregnancy = pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID); Hediff_BasePregnancy newestPregnancy = pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxByWithFallback(hediff => hediff.loadID);
if (newestPregnancy == null) return;
if (pawn.GetMenstruationComps().Any(comp => comp.Pregnancy == newestPregnancy)) return; // One of the wombs did get it if (newestPregnancy == null || pawn.GetMenstruationComps().Any(comp => comp.Pregnancy == newestPregnancy)) return; // One of the wombs did get it
else __state.Pregnancy = newestPregnancy; else __state.Pregnancy = newestPregnancy;
} }

View file

@ -135,15 +135,19 @@ namespace RJW_Menstruation
else return false; else return false;
} }
public static bool IsRJWPregnant(this Pawn pawn)
{
return pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any();
}
public static float GetFarthestPregnancyProgress(this Pawn pawn) public static float GetFarthestPregnancyProgress(this Pawn pawn)
{ {
return pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.GestationProgress)?.GestationProgress ?? -1; return pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxByWithFallback(hediff => hediff.GestationProgress)?.GestationProgress ?? 0;
} }
public static float GetPregnancyProgress(this HediffComp_Menstruation comp) public static float GetPregnancyProgress(this HediffComp_Menstruation comp)
{ {
if (comp.Pregnancy == null) return -1; if (comp.Pregnancy == null) return 0;
else return comp.Pregnancy.GestationProgress; else return comp.Pregnancy.GestationProgress;
} }

View file

@ -14,7 +14,7 @@ namespace RJW_Menstruation.Sexperience
[HarmonyPatch("HasJobOnThing")] [HarmonyPatch("HasJobOnThing")]
public static bool HasJobOnThing(Pawn pawn, ref bool __result) public static bool HasJobOnThing(Pawn pawn, ref bool __result)
{ {
if (pawn.GetMenstruationComps().Any(comp => comp.DoCleanWomb && comp.TotalCumPercent > 0.001f) && pawn.Map.listerBuildings.ColonistsHaveBuilding(VariousDefOf.CumBucket)) if (pawn.GetMenstruationComps().Any(comp => comp.DoCleanWomb && comp.TotalCumPercent > 0.001f) && (pawn.Map?.listerBuildings.ColonistsHaveBuilding(VariousDefOf.CumBucket) ?? false))
{ {
__result = true; __result = true;
return false; return false;

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.7.1</version> <version>1.0.7.2</version>
<dependencies> <dependencies>
</dependencies> </dependencies>
<incompatibleWith /> <incompatibleWith />

View file

@ -1,3 +1,8 @@
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)
- Removing a vagina won't end a mechanoid implant anymore.
Version 1.0.7.1 Version 1.0.7.1
- Null reference error fix for multiple wombs when one is pregnant. - Null reference error fix for multiple wombs when one is pregnant.
- Fix the progress bar on pregnancy again. Also make undiscovered pregnancies a little more subtle. - Fix the progress bar on pregnancy again. Also make undiscovered pregnancies a little more subtle.