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"?>
<Manifest>
<identifier>RJW Menstruation</identifier>
<version>1.0.1.11</version>
<version>1.0.1.12</version>
<dependencies>
</dependencies>
<incompatibleWith />

Binary file not shown.

View File

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

View File

@ -74,6 +74,11 @@
<Option20_Label_5>Hostile Faction</Option20_Label_5>
<Option21_Label>target pawns</Option21_Label>
<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>

View File

@ -74,6 +74,11 @@
<Option20_Label_5>적대관계</Option20_Label_5>
<Option21_Label>표시 대상</Option21_Label>
<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>

View File

@ -4,10 +4,22 @@
<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Race's defName"]</xpath>
<value>
<li Class="RJW_Menstruation.PawnDNAModExtention">
<li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor>
<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>
</value>
</Operation>
@ -17,16 +29,52 @@
<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Human"]</xpath>
<value>
<li Class="RJW_Menstruation.PawnDNAModExtention">
<li Class="RJW_Menstruation.PawnDNAModExtension">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness>
<hybridExtension>
<Horse>
<Alien_Eponalike>1.0</Alien_Eponalike>
</Horse>
</hybridExtension>
</li>
</value>
</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
- added a button for opening status window in health tab
- added option for this

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
@ -51,6 +47,9 @@ namespace RJW_Menstruation
public static int BleedingAmount = BleedingAmountDefault;
public static bool EnableButtonInHT = false;
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 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,
Colonist = 1,
@ -120,6 +125,8 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true);
Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, 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();
}
@ -178,8 +185,8 @@ namespace RJW_Menstruation
listmain.Begin(mainRect);
listmain.Gap(20f);
Rect optionrect1 = listmain.GetRect(30f);
Widgets.CheckboxLabeled(optionrect1.LeftHalf(), Translations.Option1_Label_1, ref Configurations.EnableWombIcon);
Widgets.CheckboxLabeled(optionrect1.RightHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT);
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, false, null, null, true);
//listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT)
{
@ -210,7 +217,7 @@ namespace RJW_Menstruation
wombsection.Label(Translations.Option11_Desc_4);
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[] flagrects = new Rect[5];
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.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.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.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.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.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust/1000;
Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust / 1000;
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 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);
Configurations.BleedingAmount = (int)listmain.Slider(Configurations.BleedingAmount, 0, 200);
listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc);
if (Configurations.UseMultiplePregnancy)
{
float sectionheight = 50f;
float sectionheight = 75f;
if (Configurations.EnableEnzygoticTwins) sectionheight += 100;
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.Option15_Label, ref Configurations.EnableEnzygoticTwins, Translations.Option15_Desc);
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.EnzygoticTwinsChance = (float)Configurations.EnzygoticTwinsChanceAdjust / 1000;

View File

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

View File

@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
using RimWorld;
using rjw;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using Verse.Sound;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
@ -47,7 +43,7 @@ namespace RJW_Menstruation
float height = 820f;
if (!Configurations.DrawWombStatus) height -= wombRectHeight;
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);
fontstylecenter.normal.textColor = pawn.DrawColor;
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;
float wombrecth = 0;
@ -200,7 +196,7 @@ namespace RJW_Menstruation
{
wombrecth = wombRectHeight;
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);
@ -241,7 +237,7 @@ namespace RJW_Menstruation
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);

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using RimWorld;
using Verse;
namespace RJW_Menstruation
@ -50,7 +45,7 @@ namespace RJW_Menstruation
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
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.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
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)
where t.def == filthDef
@ -25,7 +22,7 @@ namespace RJW_Menstruation
for (int i = 0; i < 8; 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;
}

View File

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

View File

@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using Verse;
using RimWorld;
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.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using HugsLib;
using rjw;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
[Flags]public enum SeasonalBreed
[Flags]
public enum SeasonalBreed
{
Always = 0,
Spring = 1,
@ -104,7 +103,7 @@ namespace RJW_Menstruation
private int lutealIntervalhours = -1;
private int bleedingIntervalhours = -1;
private int recoveryIntervalhours = -1;
private float crampPain= -1;
private float crampPain = -1;
private Need sexNeed = null;
private string customwombtex = null;
private string customvagtex = null;
@ -164,7 +163,7 @@ namespace RJW_Menstruation
{
res += cum.volume;
}
return res/ Props.maxCumCapacity;
return res / Props.maxCumCapacity;
}
}
public float CumCapacity
@ -181,7 +180,7 @@ namespace RJW_Menstruation
get
{
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;
}
}
@ -202,8 +201,8 @@ namespace RJW_Menstruation
{
float factor = 1.0f;
if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f;
if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance/100f;
else factor *= RJWPregnancySettings.humanlike_impregnation_chance/100f;
if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance / 100f;
else factor *= RJWPregnancySettings.humanlike_impregnation_chance / 100f;
return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor;
}
}
@ -230,7 +229,7 @@ namespace RJW_Menstruation
float mixedsofar = 0;
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;
}
}
@ -308,9 +307,6 @@ namespace RJW_Menstruation
{
string res = "";
if (!eggs.NullOrEmpty())
{
if (cums.NullOrEmpty() || TotalFertCum == 0) return eggs.Count + " " + Translations.Dialog_WombInfo07;
else
{
int fertilized = 0;
foreach (Egg egg in eggs)
@ -319,6 +315,12 @@ namespace RJW_Menstruation
}
if (fertilized != 0) res += fertilized + " " + Translations.Dialog_WombInfo05;
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;
}
}
@ -332,7 +334,7 @@ namespace RJW_Menstruation
{
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;
}
@ -350,7 +352,7 @@ namespace RJW_Menstruation
{
get
{
if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs)
if (!eggs.NullOrEmpty()) foreach (Egg egg in eggs)
{
if (egg.fertilized) return egg.fertstage;
}
@ -501,14 +503,14 @@ namespace RJW_Menstruation
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
cum.fertvolume += volume * CumInFactor;
cum.FilthDef = filthdef;
merged = true;
}
cum.volume *= 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
{
@ -560,7 +562,7 @@ namespace RJW_Menstruation
cum.volume *= 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
{
@ -577,7 +579,7 @@ namespace RJW_Menstruation
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;
AfterNotCumIn();
@ -741,7 +743,7 @@ namespace RJW_Menstruation
if (cums.NullOrEmpty()) return;
else if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f;
List<Cum> removecums = new List<Cum>();
foreach(Cum cum in cums)
foreach (Cum cum in cums)
{
float vd = cum.volume;
cum.volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor));
@ -749,7 +751,7 @@ namespace RJW_Menstruation
vd -= cum.volume;
totalleak += AbsorbCum(cum, vd, absorber);
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.volume < 0.01f) removecums.Add(cum);
}
@ -861,7 +863,8 @@ namespace RJW_Menstruation
foreach (Egg egg in eggs)
{
if (!egg.fertilized) egg.fertilizer = Fertilize();
if (egg.fertilizer != null) {
if (egg.fertilizer != null)
{
egg.fertilized = true;
egg.lifespanhrs += 240;
onefertilized = true;
@ -898,6 +901,10 @@ namespace RJW_Menstruation
if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
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)
{
@ -914,7 +921,8 @@ namespace RJW_Menstruation
avglittersize = 1;
}
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)
{
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn);
@ -958,7 +966,7 @@ namespace RJW_Menstruation
public void AfterSimulator()
{
if (ovarypower < ovarypowerthreshold)
if (Configurations.EnableMenopause && ovarypower < ovarypowerthreshold)
{
if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
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()
{
@ -1010,7 +1042,7 @@ namespace RJW_Menstruation
{
List<Egg> deadeggs = new List<Egg>();
bool pregnant = false;
foreach(Egg egg in eggs)
foreach (Egg egg in eggs)
{
if (!egg.fertilized || egg.fertstage < 168) continue;
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()
{
//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;
}
@ -1105,7 +1137,7 @@ namespace RJW_Menstruation
if (absorber != null)
{
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)
{
absorber.absorbedfluids += amount;
@ -1136,7 +1168,7 @@ namespace RJW_Menstruation
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;
}
@ -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)
{
@ -1173,37 +1213,19 @@ namespace RJW_Menstruation
case Stage.Follicular:
action = delegate
{
if (Props.breedingSeason != SeasonalBreed.Always)
{
if (!Props.breedingSeason.HasFlag(SeasonalBreed.Spring) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Spring))
if (!IsBreedingSeason())
{
GoNextStage(Stage.Anestrus);
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)
{
GoNextStage(Stage.Ovulatory);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
if (!estrusflag && curStageHrs > FollicularIntervalHours - Props.estrusDaysBeforeOvulation*24)
curStageHrs += Configurations.CycleAcceleration;
if (!estrusflag && curStageHrs > FollicularIntervalHours - Props.estrusDaysBeforeOvulation * 24)
{
estrusflag = true;
SetEstrus(Props.eggLifespanDays + Props.estrusDaysBeforeOvulation);
@ -1265,7 +1287,7 @@ namespace RJW_Menstruation
}
else if (curStageHrs <= lutealIntervalhours)
{
curStageHrs+=Configurations.CycleAcceleration;
curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage();
}
else
@ -1280,11 +1302,7 @@ namespace RJW_Menstruation
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
if (crampPain >= 0.05f)
{
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));
AddCrampPain();
}
GoNextStage(Stage.Bleeding);
}
@ -1304,7 +1322,7 @@ namespace RJW_Menstruation
else
{
if (curStageHrs < bleedingIntervalhours / 4) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
curStageHrs+=Configurations.CycleAcceleration;
curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage();
}
};
@ -1366,7 +1384,7 @@ namespace RJW_Menstruation
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage();
}
};
@ -1429,7 +1447,7 @@ namespace RJW_Menstruation
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6);
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);
GoNextStage(Stage.ClimactericFollicular);
@ -1439,11 +1457,7 @@ namespace RJW_Menstruation
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
if (crampPain >= 0.05f)
{
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));
AddCrampPain();
}
GoNextStage(Stage.ClimactericBleeding);
}
@ -1470,25 +1484,7 @@ namespace RJW_Menstruation
case Stage.Anestrus:
action = delegate
{
if (Props.breedingSeason == SeasonalBreed.Always)
{
//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)))
if (IsBreedingSeason())
{
GoFollicularOrBleeding();
}
@ -1501,7 +1497,7 @@ namespace RJW_Menstruation
default:
curStage = Stage.Follicular;
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);
break;
}
@ -1562,7 +1558,7 @@ namespace RJW_Menstruation
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)
@ -1574,7 +1570,7 @@ namespace RJW_Menstruation
private float PainRandomizer()
{
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.8f) return Rand.Range(0.2f, 0.4f);
else if (rand < 0.95f) return Rand.Range(0.4f, 0.6f);
@ -1583,7 +1579,7 @@ namespace RJW_Menstruation
private Stage RandomStage()
{
int rand = Rand.Range(0,2);
int rand = Rand.Range(0, 2);
switch (rand)
{

View File

@ -1,13 +1,9 @@
using System;
using RimWorld;
using rjw;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using rjw;
using Verse;
using RimWorld;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
@ -96,7 +92,7 @@ namespace RJW_Menstruation
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
//var skin_whiteness = baby.story.melanin;
//var last_name = baby.story.birthLastName;
@ -130,7 +126,7 @@ namespace RJW_Menstruation
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
//var skin_whiteness = baby.story.melanin;
//var last_name = baby.story.birthLastName;
@ -356,6 +352,7 @@ namespace RJW_Menstruation
public PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father)
{
PawnKindDef spawn_kind_def = mother.kindDef;
int flag = 0;
if (xxx.is_human(mother)) flag += 2;
if (xxx.is_human(father)) flag += 1;
@ -394,14 +391,30 @@ namespace RJW_Menstruation
spawn_kind_def = mother.kindDef;
}
string MotherRaceName = "";
string FatherRaceName = "";
MotherRaceName = mother.kindDef.race.defName;
PawnKindDef tmp = spawn_kind_def;
if (father != null)
FatherRaceName = father.kindDef.race.defName;
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()));
@ -428,8 +441,7 @@ namespace RJW_Menstruation
}
}
}
}
}
else
@ -437,7 +449,6 @@ namespace RJW_Menstruation
spawn_kind_def = mother.RaceProps.AnyPawnKind;
}
if (spawn_kind_def.defName.Contains("Nymph"))
{
//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>
/// Copy from RJW
@ -564,7 +594,7 @@ namespace RJW_Menstruation
public bool Equals(Pawn x, Pawn y)
{
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)

View File

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

View File

@ -1,14 +1,9 @@
using System;
using HarmonyLib;
using rjw;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using Verse;
using RimWorld;
using rjw;
using UnityEngine;
using Verse.Sound;
using Verse;
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 = "";
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";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,26 +1,83 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using rjw;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
public class PawnDNAModExtention : DefModExtension
public class PawnDNAModExtension : DefModExtension
{
public string fetusTexPath;
public ColorInt cumColor;
public Color CumColor => cumColor.ToColor;
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 effectsAfterDirty = false;
@ -34,20 +91,20 @@ namespace RJW_Menstruation
public float absorbedfluids = 0;
public bool dirty = false;
public int wearhours = 0;
public virtual bool LeakAfterDirty => def.GetModExtension<AbsorberModExtention>().leakAfterDirty;
public virtual bool EffectAfterDirty => def.GetModExtension<AbsorberModExtention>().effectsAfterDirty;
public virtual ThingDef DirtyDef => def.GetModExtension<AbsorberModExtention>().dirtyDef;
public virtual int MinHrstoDirtyEffect => def.GetModExtension<AbsorberModExtention>().minHourstoDirtyEffect;
public virtual bool LeakAfterDirty => def.GetModExtension<AbsorberModExtension>().leakAfterDirty;
public virtual bool EffectAfterDirty => def.GetModExtension<AbsorberModExtension>().effectsAfterDirty;
public virtual ThingDef DirtyDef => def.GetModExtension<AbsorberModExtension>().dirtyDef;
public virtual int MinHrstoDirtyEffect => def.GetModExtension<AbsorberModExtension>().minHourstoDirtyEffect;
public Color fluidColor = Color.white;
public virtual void DirtyEffect() {}
public virtual void DirtyEffect() { }
public virtual void WearEffect()
{
absorbedfluids+=0.1f;
absorbedfluids += 0.1f;
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 Option21_Label = "Option21_Label".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();

View File

@ -1,14 +1,9 @@
using System;
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 RimWorld;
using rjw;
using RimWorld;
using System;
using System.Linq;
using UnityEngine;
using Verse;
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)
{
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);
m = (1 - rgb.g - 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));
}
@ -65,7 +60,7 @@ namespace RJW_Menstruation
{
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;
}
@ -178,7 +173,7 @@ namespace RJW_Menstruation
else if (hediff is Hediff_BasePregnancy)
{
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";
else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00";
else if (h.GestationProgress < 0.4f) icon += fetustex + "00";
@ -310,24 +305,24 @@ namespace RJW_Menstruation
{
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)
{
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)
{
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)
{
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 if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral)) return true;
else if ((Configurations.ShowFlag & Configurations.PawnFlags.Neutral) != 0) return true;
return false;
}
@ -345,7 +340,7 @@ namespace RJW_Menstruation
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.DrawTexture(rect, comp.GetEggIcon(), ScaleMode.ScaleToFit);
}

View File

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