remove useless files

This commit is contained in:
moreoreganostodump 2021-02-01 20:41:24 +09:00
parent c61af46130
commit 45877378b9
47 changed files with 0 additions and 6725 deletions

View File

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_Menstruation", "RJW_Menstruation\RJW_Menstruation.csproj", "{0E3D82EC-3048-43DC-8C7A-6377671928FA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E3D82EC-3048-43DC-8C7A-6377671928FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E3D82EC-3048-43DC-8C7A-6377671928FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E3D82EC-3048-43DC-8C7A-6377671928FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E3D82EC-3048-43DC-8C7A-6377671928FA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0E4B1D09-2A81-4440-AC1E-32ACCECBEE0B}
EndGlobalSection
EndGlobal

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,124 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
public class Configurations : ModSettings
{
public static readonly float ImplantationChanceDefault = 0.25f;
public static readonly int ImplantationChanceAdjustDefault = 25;
public static readonly float FertilizeChanceDefault = 0.05f;
public static readonly int FertilizeChanceAdjustDefault = 50;
public static readonly float CumDecayRatioDefault = 0.05f;
public static readonly int CumDecayRatioAdjustDefault = 50;
public static readonly float CumFertilityDecayRatioDefault = 0.2f;
public static readonly int CumFertilityDecayRatioAdjustDefault = 200;
public static readonly int CycleAccelerationDefault = 6;
public static float ImplantationChance = ImplantationChanceDefault;
public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
public static float FertilizeChance = FertilizeChanceDefault;
public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault;
public static float CumDecayRatio = CumDecayRatioDefault;
public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault;
public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault;
public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault;
public static int CycleAcceleration = CycleAccelerationDefault;
public static bool EnableWombIcon = true;
public static bool EnableAnimalCycle = false;
public static bool Debug = false;
public override void ExposeData()
{
Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true);
Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true);
Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true);
Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true);
Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true);
Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true);
Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true);
Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true);
Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true);
Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true);
base.ExposeData();
}
}
public class RJW_Menstruation : Mod
{
private readonly Configurations config;
public RJW_Menstruation(ModContentPack content) : base(content)
{
config = GetSettings<Configurations>();
}
public override string SettingsCategory()
{
return Translations.Mod_Title;
}
public override void DoSettingsWindowContents(Rect inRect)
{
Rect mainRect = inRect.ContractedBy(20f);
Listing_Standard listmain = new Listing_Standard();
listmain.Begin(mainRect);
listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_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;
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;
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;
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;
listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc);
Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50);
listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc);
if (listmain.ButtonText("reset to default"))
{
Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault;
Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault;
Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault;
Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault;
Configurations.EnableWombIcon = true;
Configurations.EnableAnimalCycle = false;
Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault;
}
listmain.End();
}
}
}

View File

@ -1,141 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using UnityEngine;
using rjw;
namespace RJW_Menstruation
{
public class Cum : IExposable
{
public Pawn pawn;
//public bool failedFertilization = false;
//public bool dead = false;
public float volume; // ml
public float fertvolume;
public float fertFactor = 1.0f;
public bool notcum = false; // for other fluids
public string notcumLabel = "";
private bool useCustomColor = false;
private float notcumthickness = 0;
public float decayresist
{
get
{
if (!notcum) return DNA.cumTickness;
else return notcumthickness;
}
set
{
notcumthickness = value;
}
}
private Color customColor;
public DNADef DNA
{
get
{
if (DNAcache == null)
{
DNAcache = DefDatabase<DNADef>.GetNamedSilentFail(pawn.def.defName);
if (DNAcache == null)
{
DNAcache = VariousDefOf.defaultDNA;
}
return DNAcache;
}
else return DNAcache;
}
}
private DNADef DNAcache = null;
public ThingDef FilthDef
{
get
{
if (filthDef == null) return VariousDefOf.CumFilth;
else return filthDef;
}
set
{
filthDef = value;
}
}
private ThingDef filthDef = null;
public Color color
{
get
{
if (!useCustomColor) return DNA.CumColor;
else return customColor;
}
set
{
useCustomColor = true;
customColor = value;
}
}
public Cum() {}
public Cum(Pawn pawn)
{
this.pawn = pawn;
volume = 1.0f;
fertvolume = 1.0f;
decayresist = 0;
}
public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null)
{
this.pawn = pawn;
this.volume = volume;
this.fertvolume = volume;
this.notcum = true;
this.notcumLabel = notcumlabel;
this.notcumthickness = decayresist;
this.filthDef = filthDef;
}
public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null)
{
this.pawn = pawn;
this.volume = volume;
if (fertility > 0)
{
this.fertvolume = volume;
this.fertFactor = fertility;
}
else this.fertvolume = 0;
this.filthDef = filthDef;
}
public void ExposeData()
{
Scribe_References.Look(ref pawn, "pawn", true);
Scribe_Values.Look(ref volume, "volume", volume, true);
Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true);
Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true);
Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true);
Scribe_Values.Look(ref notcum, "notcum", notcum, true);
Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true);
Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true);
Scribe_Values.Look(ref customColor, "customColor", customColor, true);
}
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
namespace RJW_Menstruation
{
public class DNADef : Def
{
public bool IsNone => string.IsNullOrEmpty(defName);
public static readonly DNADef None = new DNADef();
public string fetusTexPath;
public ColorInt cumColor;
public Color CumColor => cumColor.ToColor;
public float cumTickness = 0f;
}
}

View File

@ -1,204 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
public class Dialog_WombStatus : Window
{
private Pawn pawn;
private HediffComp_Menstruation comp;
private const float windowMargin = 20f;
private const float pawnRectWidth = 150f;
private const float pawnRectHeight = 150f;
private const float wombRectHeight = 270f;
private const float wombRectWidth = 300f;
private const float fontheight = 30;
private const float genitalRectWidth = 102;
private const float genitalRectHeight = 140;
private Texture2D womb;
private Texture2D cum;
private Texture2D vagina;
private Texture2D anal;
private Color cumcolor;
public override Vector2 InitialSize
{
get
{
return new Vector2(300f + 2*windowMargin,800f);
}
}
public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon)
{
this.pawn = pawn;
this.comp = comp;
womb = icon;
}
public override void DoWindowContents(Rect inRect)
{
bool flag = false;
soundClose = SoundDefOf.InfoCard_Close;
//closeOnClickedOutside = true;
absorbInputAroundWindow = false;
forcePause = false;
preventCameraMotion = false;
draggable = true;
//resizeable = true;
if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape))
{
flag = true;
Event.current.Use();
}
Rect windowRect = inRect.ContractedBy(windowMargin);
Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f);
Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f);
MainContents(mainRect);
if (Widgets.CloseButtonFor(closeRect))
{
Close();
}
}
private void MainContents(Rect mainRect)
{
GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter };
GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight };
GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft };
GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea);
GUIStyle buttonstyle = new GUIStyle(GUI.skin.button);
boxstyle.hover = boxstyle.normal;
boxstyle.onHover = boxstyle.normal;
boxstyle.onNormal = boxstyle.normal;
buttonstyle.onHover = buttonstyle.onNormal;
buttonstyle.hover = buttonstyle.normal;
boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4;
float preginfoheight = 0f;
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (pawn.IsPregnant())
{
womb = Utility.GetPregnancyIcon(comp, hediff);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp);
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
Pawn fetus = Utility.GetFetus(pawn);
preginfoheight = fontheight;
Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight);
if (fetus != null)
{
fontstyleright.normal.textColor = Color.white;
buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle);
GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright);
}
}
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else
{
womb = Utility.GetWombIcon(comp);
cum = Utility.GetCumIcon(comp);
}
Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight);
Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f);
Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10);
Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10);
fontstylecenter.normal.textColor = pawn.DrawColor;
GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter);
GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter);
GUI.color = Color.white;
Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight);
buttonstyle.normal.textColor = Color.white;
//boxstyle.normal.background = Texture2D.whiteTexture;
buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1);
GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle);
GUI.color = Color.white;
fontstyleright.normal.textColor = Color.red;
if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright);
else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright);
else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright);
//Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel);
cumcolor = comp.GetCumMixtureColor;
Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight);
GUI.color = new Color(1.00f,0.47f,0.47f,1);
GUI.Box(wombRect,"",boxstyle);
//GUI.color = Color.white;
//Widgets.DrawTextureFitted(wombRect, womb,1.0f);
//GUI.color = cumcolor;
//Widgets.DrawTextureFitted(wombRect, cum,1.0f);
GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0);
GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0);
GUI.color = Color.white;
Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight);
GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04);
Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight);
Listing_Standard cumlist = new Listing_Standard
{
maxOneColumn = true,
ColumnWidth = wombRectWidth - pawnRectWidth
};
cumlist.Begin(cumlistRect);
Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f);
foreach(string s in comp.GetCumsInfo)
{
cumlistsection.Label(s);
}
cumlist.EndSection(cumlistsection);
cumlist.End();
Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2);
Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight);
Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight);
Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight);
vagina = Utility.GetGenitalIcon(pawn);
anal = Utility.GetAnalIcon(pawn);
GUI.color = new Color(1.00f, 0.47f, 0.47f, 1);
GUI.Box(genitalRect, "", boxstyle);
GUI.color = pawn.story.SkinColor;
//Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f);
//Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f);
GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit);
GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit);
GUI.color = Color.white;
GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter);
GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter);
}
}
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
namespace RJW_Menstruation
{
public class FertPillOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
}
}
}

View File

@ -1,104 +0,0 @@
using System;
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;
namespace RJW_Menstruation
{
[HarmonyPatch(typeof(Pawn), "GetGizmos")]
public class Pawn_GetGizmos
{
public static void Postfix(ref IEnumerable<Gizmo> __result, Pawn __instance)
{
List<Gizmo> gizmoList = __result.ToList();
bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony);
if (!isCreatureMine)
{
return;
}
if (Configurations.EnableWombIcon && __instance.gender == Gender.Female)
{
if (!__instance.IsAnimal())
{
AddWombGizmos(__instance, ref gizmoList);
}
else if (Configurations.EnableAnimalCycle)
{
AddWombGizmos(__instance, ref gizmoList);
}
}
__result = gizmoList;
}
private static void AddWombGizmos(Pawn __instance, ref List<Gizmo> gizmoList)
{
gizmoList.Add(CreateGizmo_WombStatus(__instance));
}
private static Gizmo CreateGizmo_WombStatus(Pawn pawn)
{
HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp<HediffComp_Menstruation>();
Texture2D icon,icon_overay;
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
string description = "";
if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum;
else description += comp.GetCurStageLabel + "\n";
if (pawn.IsPregnant())
{
icon = Utility.GetPregnancyIcon(comp,hediff);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp);
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else
{
icon = Utility.GetWombIcon(comp);
icon_overay = Utility.GetCumIcon(comp);
}
foreach (string s in comp.GetCumsInfo) description += s + "\n";
Color c = comp.GetCumMixtureColor;
Gizmo gizmo = new Gizmo_Womb
{
defaultLabel = pawn.LabelShort,
defaultDesc = description,
icon = icon,
icon_overay = icon_overay,
cumcolor = c,
order = 100,
action = delegate
{
SoundDefOf.InfoCard_Open.PlayOneShotOnCamera();
Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon));
}
};
return gizmo;
}
}
}

View File

@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
using Verse.Sound;
namespace RJW_Menstruation
{
public class Gizmo_Womb : Command_Action
{
public Texture2D icon_overay;
public Color cumcolor;
protected override void DrawIcon(Rect rect, Material buttonMat = null)
{
Texture2D badTex = icon;
Texture2D overay = icon_overay;
Color color = cumcolor;
if (badTex == null)
{
badTex = BaseContent.BadTex;
}
if (overay == null)
{
overay = BaseContent.BadTex;
}
if (color == null) color = Color.white;
rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y);
GUI.color = IconDrawColor;
Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat);
GUI.color = color;
Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat);
GUI.color = Color.white;
}
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using HarmonyLib;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
[StaticConstructorOnStartup]
internal static class First
{
static First()
{
var har = new Harmony("LL");
har.PatchAll(Assembly.GetExecutingAssembly());
}
}
}

View File

@ -1,780 +0,0 @@
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;
namespace RJW_Menstruation
{
public class CompProperties_Menstruation : HediffCompProperties
{
public float maxCumCapacity; // ml
public float baseImplantationChanceFactor;
public float basefertilizationChanceFactor;
public float deviationFactor;
public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding
public int lutealIntervalDays = 14; //after ovulation until bleeding
public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays
public int recoveryIntervalDays = 10; //additional infertile days after gave birth
public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public CompProperties_Menstruation()
{
compClass = typeof(HediffComp_Menstruation);
}
}
public class HediffComp_Menstruation : HediffComp
{
const float minmakefilthvalue = 1.0f;
public static readonly int tickInterval = 2500; // an hour
public CompProperties_Menstruation Props;
public Stage curStage = Stage.Follicular;
public int curStageHrs = 0;
public enum Stage
{
Follicular,
Ovulatory,
Luteal,
Bleeding,
Fertilized,
Pregnant,
Recover
}
private List<Cum> cums;
private bool loaded = false;
private List<Egg> eggs;
private int follicularIntervalhours = -1;
private int lutealIntervalhours = -1;
private int bleedingIntervalhours = -1;
private int recoveryIntervalhours = -1;
private Action actionref;
public float TotalCum
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
res += cum.volume;
}
return res;
}
}
public float TotalFertCum
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
if (!cum.notcum) res += cum.fertvolume;
}
return res;
}
}
public float TotalCumPercent
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
res += cum.volume;
}
return res/ Props.maxCumCapacity;
}
}
public float CumCapacity
{
get
{
float res = Props.maxCumCapacity;
if (curStage == Stage.Pregnant) res *= 0.2f;
return res;
}
}
public float CumInFactor
{
get
{
float res = 1.0f;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f;
return res;
}
}
//make follicular interval into half and double egg lifespan
public float CycleFactor
{
get
{
if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f;
return 1.0f;
}
}
//effect on implant chance
public float ImplantFactor
{
get
{
float factor = 1.0f;
if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f;
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;
}
}
public IEnumerable<string> GetCumsInfo
{
get
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume);
else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume);
}
else yield return Translations.Info_noCum;
}
}
public Color GetCumMixtureColor
{
get
{
Color mixedcolor = Color.white;
if (!cums.NullOrEmpty())
{
float mixedsofar = 0;
foreach (Cum cum in cums)
{
mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume));
mixedsofar += cum.volume;
}
}
return mixedcolor;
}
}
public string GetCurStageLabel
{
get
{
switch (curStage)
{
case Stage.Follicular:
return Translations.Stage_Follicular;
case Stage.Ovulatory:
return Translations.Stage_Ovulatory;
case Stage.Luteal:
return Translations.Stage_Luteal;
case Stage.Bleeding:
return Translations.Stage_Bleeding;
case Stage.Fertilized:
return Translations.Stage_Fertilized;
case Stage.Pregnant:
return Translations.Stage_Pregnant;
case Stage.Recover:
return Translations.Stage_Recover;
default:
return "";
}
}
}
public bool GetEggFertilizing
{
get
{
if (!eggs.NullOrEmpty())
{
if (!cums.NullOrEmpty()) foreach(Cum cum in cums)
{
if (cum.fertvolume > 0) return true;
}
return false;
}
else return false;
}
}
public bool GetFertilization
{
get
{
if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs)
{
if (egg.fertilized) return true;
}
return false;
}
}
public bool GetEgg
{
get
{
return !eggs.NullOrEmpty();
}
}
public override void CompExposeData()
{
base.CompExposeData();
Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]);
Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]);
Scribe_Values.Look(ref curStage, "curStage", curStage, true);
Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true);
Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true);
Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true);
Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true);
Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true);
}
public override void CompPostTick(ref float severityAdjustment)
{
if (!loaded)
{
Props = (CompProperties_Menstruation)props;
if (follicularIntervalhours < 0)
{
follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor);
curStage = RandomStage();
}
if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor);
if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor);
if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor);
if (cums == null) cums = new List<Cum>();
if (eggs == null) eggs = new List<Egg>();
if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant;
if (Configurations.EnableAnimalCycle)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
}
else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
loaded = true;
}
}
public override void CompPostPostRemoved()
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref);
ModLog.Message(parent.pawn.Label + "tick scheduler removed");
base.CompPostPostRemoved();
}
public Cum GetNotCum(string notcumlabel)
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum;
}
return null;
}
public Cum GetCum(Pawn pawn)
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (!cum.notcum && cum.pawn.Equals(pawn)) return cum;
}
return null;
}
public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null)
{
float volume = injectedvolume * CumInFactor;
float tmp = TotalCum + volume;
if (tmp > Props.maxCumCapacity)
{
float cumoutrate = 1 - (Props.maxCumCapacity / tmp);
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
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));
}
else
{
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
cum.FilthDef = filthdef;
merged = true;
}
}
if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef));
}
}
public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null)
{
float tmp = TotalCum + volume;
if (tmp > Props.maxCumCapacity)
{
float cumoutrate = 1 - (Props.maxCumCapacity / tmp);
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel))
{
cum.volume += volume;
cum.decayresist = decayresist;
cum.fertvolume = 0;
cum.FilthDef = filthdef;
merged = true;
}
cum.volume *= 1 - cumoutrate;
cum.fertvolume *= 1 - cumoutrate;
}
if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef));
}
else
{
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel))
{
cum.volume += volume;
cum.decayresist = decayresist;
cum.fertvolume = 0;
cum.FilthDef = filthdef;
merged = true;
}
}
if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef));
}
}
public void CumOut()
{
if (cums.NullOrEmpty()) return;
List<Cum> removecums = new List<Cum>();
foreach(Cum cum in cums)
{
float vd = cum.volume;
cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))));
cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum);
}
foreach(Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
}
public float CumOut(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
float outcum = 0;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
float vd = cum.volume;
if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist));
cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist)));
cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum);
}
foreach (Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
return outcum;
}
//ignores cum.decayresist
public float CumOutForce(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
float outcum = 0;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
float vd = cum.volume;
if (cum.Equals(targetcum)) outcum = cum.volume * (portion);
cum.volume *= 1 - (portion);
cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio));
if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.1f) removecums.Add(cum);
}
foreach (Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
return outcum;
}
public bool FertilizationCheck()
{
if (!eggs.NullOrEmpty())
{
bool onefertilized = false;
foreach (Egg egg in eggs)
{
if (!egg.fertilized) egg.fertilizer = Fertilize();
if (egg.fertilizer != null) {
egg.fertilized = true;
onefertilized = true;
}
}
return onefertilized;
}
else return false;
}
private Pawn Fertilize()
{
if (cums.NullOrEmpty()) return null;
foreach (Cum cum in cums)
{
float rand = Rand.Range(0.0f, 1.0f);
if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor)
{
return cum.pawn;
}
}
return null;
}
//for now, only one egg can be implanted
private bool Implant()
{
if (!eggs.NullOrEmpty())
{
List<Egg> deadeggs = new List<Egg>();
bool pregnant = false;
foreach(Egg egg in eggs)
{
if (!egg.fertilized) continue;
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer);
pregnant = true;
break;
}
else deadeggs.Add(egg);
}
if (pregnant)
{
eggs.Clear();
deadeggs.Clear();
return true;
}
else if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
}
return false;
}
private void BleedOut()
{
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label);
CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood);
GetNotCum(Translations.Menstrual_Blood).color = Colors.blood;
}
private void MakeCumFilth(Cum cum)
{
FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
}
private void EggDecay()
{
List<Egg> deadeggs = new List<Egg>();
foreach (Egg egg in eggs)
{
egg.lifespanhrs--;
if (egg.lifespanhrs < 0) deadeggs.Add(egg);
}
if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
}
private Action PeriodSimulator(Enum targetstage)
{
Action action = null;
switch (targetstage)
{
case Stage.Follicular:
action = delegate
{
if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor)
{
GoNextStage(Stage.Ovulatory);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Ovulatory:
action = delegate
{
eggs.Add(new Egg(Props.eggLifespanDays * 24));
lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Luteal);
};
break;
case Stage.Luteal:
action = delegate
{
if (!eggs.NullOrEmpty())
{
if (FertilizationCheck())
{
GoNextStage(Stage.Fertilized);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
}
else if (curStageHrs <= lutealIntervalhours)
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
else
{
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Bleeding);
}
};
break;
case Stage.Bleeding:
action = delegate
{
if (curStageHrs >= bleedingIntervalhours)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Fertilized:
action = delegate
{
if (curStageHrs >= 24)
{
if (Implant())
{
GoNextStage(Stage.Pregnant);
}
else
{
GoNextStageSetHour(Stage.Luteal, 96);
}
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Pregnant:
action = delegate
{
if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant);
else GoNextStage(Stage.Recover);
};
break;
case Stage.Recover:
action = delegate
{
if (curStageHrs >= recoveryIntervalhours)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
default:
curStage = Stage.Follicular;
curStageHrs = 0;
if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false);
break;
}
action += () =>
{
CumOut();
if (!eggs.NullOrEmpty()) EggDecay();
};
actionref = action;
return action;
void GoNextStage(Stage nextstage, float factor = 1.0f)
{
curStageHrs = 0;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
}
void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f)
{
curStageHrs = hour;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
}
void StayCurrentStage(float factor = 1.0f)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false);
}
void StayCurrentStageConst(Stage curstage, float factor = 1.0f)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false);
}
}
private int PeriodRandomizer(int intervalhours, float deviation)
{
return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation));
}
private float InterspeciesImplantFactor(Pawn fertilizer)
{
if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer);
else return RJWPregnancySettings.interspecies_impregnation_modifier;
}
private Stage RandomStage()
{
int rand = Rand.Range(0,2);
switch (rand)
{
case 0:
curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24);
return Stage.Follicular;
case 1:
curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24);
return Stage.Luteal;
case 2:
curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
return Stage.Bleeding;
default: return Stage.Follicular;
}
}
public class Egg : IExposable
{
public bool fertilized;
public int lifespanhrs;
public Pawn fertilizer;
public Egg()
{
fertilized = false;
lifespanhrs = 96;
fertilizer = null;
}
public Egg(int lifespanhrs)
{
fertilized = false;
this.lifespanhrs = lifespanhrs;
fertilizer = null;
}
public void ExposeData()
{
Scribe_References.Look(ref fertilizer, "fertilizer", true);
Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true);
Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true);
}
}
}
}

View File

@ -1,350 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EED2F3B9-8C20-4194-919E-8D151B29F70B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>RJW_Menstruation</RootNamespace>
<AssemblyName>RJW_Menstruation</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>게시\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configurations.cs" />
<Compile Include="Cum.cs" />
<Compile Include="Dialog_WombStatus.cs" />
<Compile Include="DNADef.cs" />
<Compile Include="DrugOutcomDoers.cs" />
<Compile Include="GetGizmos.cs" />
<Compile Include="Gizmo_Womb.cs" />
<Compile Include="Harmony.cs" />
<Compile Include="HediffComp_Menstruation.cs" />
<Compile Include="RJW_Patch.cs" />
<Compile Include="Translations.cs" />
<Compile Include="Utility.cs" />
<Compile Include="VariousDefOf.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\..\..\RJW\1.1\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AccessibilityModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AndroidJNIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ARModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClothModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClusterInputModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClusterRendererModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CrashReportingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.DirectorModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.DSPGraphModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.FileSystemHttpModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.GameCenterModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.GridModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.HotReloadModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.LocalizationModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PerformanceReportingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ProfilerModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ScreenCaptureModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SharedInternalsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteMaskModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteShapeModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.StreamingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SubstanceModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainPhysicsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextCoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TilemapModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TLSModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UmbraModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UNETModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityAnalyticsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityConnectModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityTestProtocolModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestTextureModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VehiclesModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VFXModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VideoModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VRModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.WindModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.XRModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2%28x86 및 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,88 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using rjw;
using Verse;
namespace RJW_Menstruation
{
[HarmonyPatch(typeof(PregnancyHelper), "impregnate")]
public static class impregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None)
{
if (sextype == xxx.rjwSextype.Vaginal)
{
var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn);
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR);
var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner);
var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR);
if (Genital_Helper.has_vagina(partner, partnerparts))
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner);
if (comp != null)
{
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{
PregnancyHelper.Doimpregnate(pawn, partner);
return false;
}
else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0);
}
}
else if (Genital_Helper.has_vagina(pawn, pawnparts))
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null)
{
if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype))
{
PregnancyHelper.Doimpregnate(partner, pawn);
return false;
}
else comp.CumIn(partner, Utility.GetCumVolume(partner), 0);
}
}
}
return true;
}
}
[HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")]
public static class Doimpregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner);
if (comp != null)
{
if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn))
{
comp.CumIn(pawn, Utility.GetCumVolume(pawn),0);
return false;
}
else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction));
return false;
}
ModLog.Message("used original rjw method: Comp missing");
return true;
}
}
}

View File

@ -1,60 +0,0 @@
using Verse;
namespace RJW_Menstruation
{
public static class Translations
{
public static readonly string Mod_Title = "Mod_Title".Translate();
public static readonly string Info_noCum = "Info_noCum".Translate();
public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate();
public static readonly string Stage_Follicular = "Stage_Follicular".Translate();
public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate();
public static readonly string Stage_Luteal = "Stage_Luteal".Translate();
public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate();
public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate();
public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate();
public static readonly string Stage_Recover = "Stage_Recover".Translate();
public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate();
public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate();
public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate();
public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate();
public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate();
public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate();
public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate();
public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate();
public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate();
public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate();
public static readonly string Option1_Label = "Option1_Label".Translate();
public static readonly string Option1_Desc = "Option1_Desc".Translate();
public static readonly string Option2_Label = "Option2_Label".Translate();
public static readonly string Option2_Desc = "Option2_Desc".Translate();
public static readonly string Option3_Label = "Option3_Label".Translate();
public static readonly string Option3_Desc = "Option3_Desc".Translate();
public static readonly string Option4_Label = "Option4_Label".Translate();
public static readonly string Option4_Desc = "Option4_Desc".Translate();
public static readonly string Option5_Label = "Option5_Label".Translate();
public static readonly string Option5_Desc = "Option5_Desc".Translate();
public static readonly string Option6_Label = "Option6_Label".Translate();
public static readonly string Option6_Desc = "Option6_Desc".Translate();
public static readonly string Option7_Label = "Option7_Label".Translate();
public static readonly string Option7_Desc = "Option7_Desc".Translate();
public static readonly string Option8_Label = "Option8_Label".Translate();
public static readonly string Option8_Desc = "Option8_Desc".Translate();
public static readonly string Option9_Label = "Option9_Label".Translate();
public static readonly string Option9_Desc = "Option9_Desc".Translate();
public static readonly string Option10_Label = "Option10_Label".Translate();
public static readonly string Option10_Desc = "Option10_Desc".Translate();
public static readonly string Option11_Label = "Option11_Label".Translate();
public static readonly string Option11_Desc = "Option11_Desc".Translate();
public static readonly string Option12_Label = "Option12_Label".Translate();
public static readonly string Option12_Desc = "Option12_Desc".Translate();
public static readonly string Option13_Label = "Option13_Label".Translate();
public static readonly string Option13_Desc = "Option13_Desc".Translate();
}
}

View File

@ -1,223 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using rjw;
using RimWorld;
using UnityEngine;
namespace RJW_Menstruation
{
public static class Colors
{
public static Color blood = new Color(0.78f, 0, 0);
}
public static class Utility
{
public static float GetCumVolume(Pawn pawn)
{
CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f;
}
public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return null;
else
{
foreach (Hediff h in hedifflist)
{
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return result;
}
}
return null;
}
public static bool HasMenstruationComp(Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return false;
else
{
foreach (Hediff h in hedifflist)
{
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return true;
}
}
return false;
}
public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn)
{
return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding;
}
public static float GetPregnancyProgress(Pawn pawn)
{
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
return h.GestationProgress;
}
return -1;
}
public static Pawn GetFetus(Pawn pawn)
{
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
return h?.babies?.First() ?? null;
}
//else if (hediff is Hediff_HumanlikePregnancy)
//{
// Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff;
// return h?.babies?.First() ?? null;
//}
//else if (hediff is Hediff_BestialPregnancy)
//{
// Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff;
// return h?.babies?.First() ?? null;
//}
else if (hediff is Hediff_MechanoidPregnancy)
{
Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff;
return h?.babies?.First() ?? null;
}
return null;
}
public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff)
{
string icon = "";
if (hediff is Hediff_MechanoidPregnancy)
{
return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
}
else if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
string fetustex = DefDatabase<DNADef>.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default";
if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted";
else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00";
else if (h.GestationProgress < 0.4f) icon += fetustex + "00";
else if (h.GestationProgress < 0.5f) icon += fetustex + "01";
else if (h.GestationProgress < 0.6f) icon += fetustex + "02";
else if (h.GestationProgress < 0.7f) icon += fetustex + "03";
else if (h.GestationProgress < 0.8f) icon += fetustex + "04";
else icon += fetustex + "05";
}
else icon = "Fetus/Slime_Abomi02";
return ContentFinder<Texture2D>.Get((icon), true);
}
public static Texture2D GetCumIcon(HediffComp_Menstruation comp)
{
string icon = "Womb/";
float cumpercent = comp.TotalCumPercent;
if (cumpercent < 0.001f) icon += "Empty";
else if (cumpercent < 0.01f) icon += "Cum_00";
else if (cumpercent < 0.05f) icon += "Cum_01";
else if (cumpercent < 0.11f) icon += "Cum_02";
else if (cumpercent < 0.17f) icon += "Cum_03";
else if (cumpercent < 0.23f) icon += "Cum_04";
else if (cumpercent < 0.29f) icon += "Cum_05";
else if (cumpercent < 0.35f) icon += "Cum_06";
else if (cumpercent < 0.41f) icon += "Cum_07";
else if (cumpercent < 0.47f) icon += "Cum_08";
else if (cumpercent < 0.53f) icon += "Cum_09";
else if (cumpercent < 0.59f) icon += "Cum_10";
else if (cumpercent < 0.65f) icon += "Cum_11";
else if (cumpercent < 0.71f) icon += "Cum_12";
else if (cumpercent < 0.77f) icon += "Cum_13";
else if (cumpercent < 0.83f) icon += "Cum_14";
else if (cumpercent < 0.89f) icon += "Cum_15";
else if (cumpercent < 0.95f) icon += "Cum_16";
else icon += "Cum_17";
Texture2D cumtex = ContentFinder<Texture2D>.Get((icon), true);
return cumtex;
}
public static Texture2D GetWombIcon(HediffComp_Menstruation comp)
{
string icon = comp.Props.wombTex;
HediffComp_Menstruation.Stage stage = comp.curStage;
if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding";
Texture2D wombtex = ContentFinder<Texture2D>.Get((icon), true);
return wombtex;
}
public static Texture2D GetGenitalIcon(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
string icon = "Genitals/";
if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro
else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight
else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight
else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average
else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average
else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average
else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating
else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating
else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous
else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous
else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous
else icon += "Vagina11"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
}
public static Texture2D GetAnalIcon(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
string icon = "Genitals/";
if (hediff.Severity < 0.20f) icon += "Anal00"; //micro
else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight
else if (hediff.Severity < 0.60f) icon += "Anal02"; //average
else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating
else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous
else icon += "Anal05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
}
public static string GetVaginaLabel(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
return hediff.LabelBase + "\n" + hediff.LabelInBrackets;
}
public static string GetAnusLabel(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
return hediff.Label;
}
}
}

View File

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
public static class VariousDefOf
{
public static readonly DNADef defaultDNA = new DNADef
{
fetusTexPath = "Fetus/Fetus_Default",
cumColor = new ColorInt(255, 255, 255, 255),
cumTickness = 0
};
public static readonly ThingDef CumFilth = DefDatabase<ThingDef>.GetNamed("FilthCum");
public static readonly HediffDef RJW_IUD = DefDatabase<HediffDef>.GetNamed("RJW_IUD");
}
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,124 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
public class Configurations : ModSettings
{
public static readonly float ImplantationChanceDefault = 0.25f;
public static readonly int ImplantationChanceAdjustDefault = 25;
public static readonly float FertilizeChanceDefault = 0.05f;
public static readonly int FertilizeChanceAdjustDefault = 50;
public static readonly float CumDecayRatioDefault = 0.05f;
public static readonly int CumDecayRatioAdjustDefault = 50;
public static readonly float CumFertilityDecayRatioDefault = 0.2f;
public static readonly int CumFertilityDecayRatioAdjustDefault = 200;
public static readonly int CycleAccelerationDefault = 6;
public static float ImplantationChance = ImplantationChanceDefault;
public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
public static float FertilizeChance = FertilizeChanceDefault;
public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault;
public static float CumDecayRatio = CumDecayRatioDefault;
public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault;
public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault;
public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault;
public static int CycleAcceleration = CycleAccelerationDefault;
public static bool EnableWombIcon = true;
public static bool EnableAnimalCycle = false;
public static bool Debug = false;
public override void ExposeData()
{
Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true);
Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true);
Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true);
Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true);
Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true);
Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true);
Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true);
Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true);
Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true);
Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true);
base.ExposeData();
}
}
public class RJW_Menstruation : Mod
{
private readonly Configurations config;
public RJW_Menstruation(ModContentPack content) : base(content)
{
config = GetSettings<Configurations>();
}
public override string SettingsCategory()
{
return Translations.Mod_Title;
}
public override void DoSettingsWindowContents(Rect inRect)
{
Rect mainRect = inRect.ContractedBy(20f);
Listing_Standard listmain = new Listing_Standard();
listmain.Begin(mainRect);
listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_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;
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;
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;
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;
listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc);
Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50);
listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc);
if (listmain.ButtonText("reset to default"))
{
Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault;
Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault;
Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault;
Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault;
Configurations.EnableWombIcon = true;
Configurations.EnableAnimalCycle = false;
Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault;
}
listmain.End();
}
}
}

View File

@ -1,141 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using UnityEngine;
using rjw;
namespace RJW_Menstruation
{
public class Cum : IExposable
{
public Pawn pawn;
//public bool failedFertilization = false;
//public bool dead = false;
public float volume; // ml
public float fertvolume;
public float fertFactor = 1.0f;
public bool notcum = false; // for other fluids
public string notcumLabel = "";
private bool useCustomColor = false;
private float notcumthickness = 0;
public float decayresist
{
get
{
if (!notcum) return DNA.cumTickness;
else return notcumthickness;
}
set
{
notcumthickness = value;
}
}
private Color customColor;
public DNADef DNA
{
get
{
if (DNAcache == null)
{
DNAcache = DefDatabase<DNADef>.GetNamedSilentFail(pawn.def.defName);
if (DNAcache == null)
{
DNAcache = VariousDefOf.defaultDNA;
}
return DNAcache;
}
else return DNAcache;
}
}
private DNADef DNAcache = null;
public ThingDef FilthDef
{
get
{
if (filthDef == null) return VariousDefOf.CumFilth;
else return filthDef;
}
set
{
filthDef = value;
}
}
private ThingDef filthDef = null;
public Color color
{
get
{
if (!useCustomColor) return DNA.CumColor;
else return customColor;
}
set
{
useCustomColor = true;
customColor = value;
}
}
public Cum() {}
public Cum(Pawn pawn)
{
this.pawn = pawn;
volume = 1.0f;
fertvolume = 1.0f;
decayresist = 0;
}
public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null)
{
this.pawn = pawn;
this.volume = volume;
this.fertvolume = volume;
this.notcum = true;
this.notcumLabel = notcumlabel;
this.notcumthickness = decayresist;
this.filthDef = filthDef;
}
public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null)
{
this.pawn = pawn;
this.volume = volume;
if (fertility > 0)
{
this.fertvolume = volume;
this.fertFactor = fertility;
}
else this.fertvolume = 0;
this.filthDef = filthDef;
}
public void ExposeData()
{
Scribe_References.Look(ref pawn, "pawn", true);
Scribe_Values.Look(ref volume, "volume", volume, true);
Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true);
Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true);
Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true);
Scribe_Values.Look(ref notcum, "notcum", notcum, true);
Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true);
Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true);
Scribe_Values.Look(ref customColor, "customColor", customColor, true);
}
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
namespace RJW_Menstruation
{
public class DNADef : Def
{
public bool IsNone => string.IsNullOrEmpty(defName);
public static readonly DNADef None = new DNADef();
public string fetusTexPath;
public ColorInt cumColor;
public Color CumColor => cumColor.ToColor;
public float cumTickness = 0f;
}
}

View File

@ -1,204 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
public class Dialog_WombStatus : Window
{
private Pawn pawn;
private HediffComp_Menstruation comp;
private const float windowMargin = 20f;
private const float pawnRectWidth = 150f;
private const float pawnRectHeight = 150f;
private const float wombRectHeight = 270f;
private const float wombRectWidth = 300f;
private const float fontheight = 30;
private const float genitalRectWidth = 102;
private const float genitalRectHeight = 140;
private Texture2D womb;
private Texture2D cum;
private Texture2D vagina;
private Texture2D anal;
private Color cumcolor;
public override Vector2 InitialSize
{
get
{
return new Vector2(300f + 2*windowMargin,800f);
}
}
public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon)
{
this.pawn = pawn;
this.comp = comp;
womb = icon;
}
public override void DoWindowContents(Rect inRect)
{
bool flag = false;
soundClose = SoundDefOf.InfoCard_Close;
//closeOnClickedOutside = true;
absorbInputAroundWindow = false;
forcePause = false;
preventCameraMotion = false;
draggable = true;
//resizeable = true;
if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape))
{
flag = true;
Event.current.Use();
}
Rect windowRect = inRect.ContractedBy(windowMargin);
Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f);
Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f);
MainContents(mainRect);
if (Widgets.CloseButtonFor(closeRect))
{
Close();
}
}
private void MainContents(Rect mainRect)
{
GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter };
GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight };
GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft };
GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea);
GUIStyle buttonstyle = new GUIStyle(GUI.skin.button);
boxstyle.hover = boxstyle.normal;
boxstyle.onHover = boxstyle.normal;
boxstyle.onNormal = boxstyle.normal;
buttonstyle.onHover = buttonstyle.onNormal;
buttonstyle.hover = buttonstyle.normal;
boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4;
float preginfoheight = 0f;
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (pawn.IsPregnant())
{
womb = Utility.GetPregnancyIcon(comp, hediff);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp);
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
Pawn fetus = Utility.GetFetus(pawn);
preginfoheight = fontheight;
Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight);
if (fetus != null)
{
fontstyleright.normal.textColor = Color.white;
buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle);
GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright);
}
}
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else
{
womb = Utility.GetWombIcon(comp);
cum = Utility.GetCumIcon(comp);
}
Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight);
Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f);
Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10);
Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10);
fontstylecenter.normal.textColor = pawn.DrawColor;
GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter);
GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter);
GUI.color = Color.white;
Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight);
buttonstyle.normal.textColor = Color.white;
//boxstyle.normal.background = Texture2D.whiteTexture;
buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1);
GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle);
GUI.color = Color.white;
fontstyleright.normal.textColor = Color.red;
if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright);
else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright);
else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright);
//Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel);
cumcolor = comp.GetCumMixtureColor;
Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight);
GUI.color = new Color(1.00f,0.47f,0.47f,1);
GUI.Box(wombRect,"",boxstyle);
//GUI.color = Color.white;
//Widgets.DrawTextureFitted(wombRect, womb,1.0f);
//GUI.color = cumcolor;
//Widgets.DrawTextureFitted(wombRect, cum,1.0f);
GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0);
GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0);
GUI.color = Color.white;
Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight);
GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04);
Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight);
Listing_Standard cumlist = new Listing_Standard
{
maxOneColumn = true,
ColumnWidth = wombRectWidth - pawnRectWidth
};
cumlist.Begin(cumlistRect);
Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f);
foreach(string s in comp.GetCumsInfo)
{
cumlistsection.Label(s);
}
cumlist.EndSection(cumlistsection);
cumlist.End();
Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2);
Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight);
Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight);
Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight);
vagina = Utility.GetGenitalIcon(pawn);
anal = Utility.GetAnalIcon(pawn);
GUI.color = new Color(1.00f, 0.47f, 0.47f, 1);
GUI.Box(genitalRect, "", boxstyle);
GUI.color = pawn.story.SkinColor;
//Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f);
//Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f);
GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit);
GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit);
GUI.color = Color.white;
GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter);
GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter);
}
}
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
namespace RJW_Menstruation
{
public class FertPillOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
}
}
}

View File

@ -1,104 +0,0 @@
using System;
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;
namespace RJW_Menstruation
{
[HarmonyPatch(typeof(Pawn), "GetGizmos")]
public class Pawn_GetGizmos
{
public static void Postfix(ref IEnumerable<Gizmo> __result, Pawn __instance)
{
List<Gizmo> gizmoList = __result.ToList();
bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony);
if (!isCreatureMine)
{
return;
}
if (Configurations.EnableWombIcon && __instance.gender == Gender.Female)
{
if (!__instance.IsAnimal())
{
AddWombGizmos(__instance, ref gizmoList);
}
else if (Configurations.EnableAnimalCycle)
{
AddWombGizmos(__instance, ref gizmoList);
}
}
__result = gizmoList;
}
private static void AddWombGizmos(Pawn __instance, ref List<Gizmo> gizmoList)
{
gizmoList.Add(CreateGizmo_WombStatus(__instance));
}
private static Gizmo CreateGizmo_WombStatus(Pawn pawn)
{
HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp<HediffComp_Menstruation>();
Texture2D icon,icon_overay;
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
string description = "";
if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum;
else description += comp.GetCurStageLabel + "\n";
if (pawn.IsPregnant())
{
icon = Utility.GetPregnancyIcon(comp,hediff);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp);
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else
{
icon = Utility.GetWombIcon(comp);
icon_overay = Utility.GetCumIcon(comp);
}
foreach (string s in comp.GetCumsInfo) description += s + "\n";
Color c = comp.GetCumMixtureColor;
Gizmo gizmo = new Gizmo_Womb
{
defaultLabel = pawn.LabelShort,
defaultDesc = description,
icon = icon,
icon_overay = icon_overay,
cumcolor = c,
order = 100,
action = delegate
{
SoundDefOf.InfoCard_Open.PlayOneShotOnCamera();
Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon));
}
};
return gizmo;
}
}
}

View File

@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
using Verse.Sound;
namespace RJW_Menstruation
{
public class Gizmo_Womb : Command_Action
{
public Texture2D icon_overay;
public Color cumcolor;
protected override void DrawIcon(Rect rect, Material buttonMat = null)
{
Texture2D badTex = icon;
Texture2D overay = icon_overay;
Color color = cumcolor;
if (badTex == null)
{
badTex = BaseContent.BadTex;
}
if (overay == null)
{
overay = BaseContent.BadTex;
}
if (color == null) color = Color.white;
rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y);
GUI.color = IconDrawColor;
Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat);
GUI.color = color;
Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat);
GUI.color = Color.white;
}
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using HarmonyLib;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
[StaticConstructorOnStartup]
internal static class First
{
static First()
{
var har = new Harmony("LL");
har.PatchAll(Assembly.GetExecutingAssembly());
}
}
}

View File

@ -1,780 +0,0 @@
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;
namespace RJW_Menstruation
{
public class CompProperties_Menstruation : HediffCompProperties
{
public float maxCumCapacity; // ml
public float baseImplantationChanceFactor;
public float basefertilizationChanceFactor;
public float deviationFactor;
public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding
public int lutealIntervalDays = 14; //after ovulation until bleeding
public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays
public int recoveryIntervalDays = 10; //additional infertile days after gave birth
public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public CompProperties_Menstruation()
{
compClass = typeof(HediffComp_Menstruation);
}
}
public class HediffComp_Menstruation : HediffComp
{
const float minmakefilthvalue = 1.0f;
public static readonly int tickInterval = 2500; // an hour
public CompProperties_Menstruation Props;
public Stage curStage = Stage.Follicular;
public int curStageHrs = 0;
public enum Stage
{
Follicular,
Ovulatory,
Luteal,
Bleeding,
Fertilized,
Pregnant,
Recover
}
private List<Cum> cums;
private bool loaded = false;
private List<Egg> eggs;
private int follicularIntervalhours = -1;
private int lutealIntervalhours = -1;
private int bleedingIntervalhours = -1;
private int recoveryIntervalhours = -1;
private Action actionref;
public float TotalCum
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
res += cum.volume;
}
return res;
}
}
public float TotalFertCum
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
if (!cum.notcum) res += cum.fertvolume;
}
return res;
}
}
public float TotalCumPercent
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
res += cum.volume;
}
return res/ Props.maxCumCapacity;
}
}
public float CumCapacity
{
get
{
float res = Props.maxCumCapacity;
if (curStage == Stage.Pregnant) res *= 0.2f;
return res;
}
}
public float CumInFactor
{
get
{
float res = 1.0f;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f;
return res;
}
}
//make follicular interval into half and double egg lifespan
public float CycleFactor
{
get
{
if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f;
return 1.0f;
}
}
//effect on implant chance
public float ImplantFactor
{
get
{
float factor = 1.0f;
if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f;
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;
}
}
public IEnumerable<string> GetCumsInfo
{
get
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume);
else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume);
}
else yield return Translations.Info_noCum;
}
}
public Color GetCumMixtureColor
{
get
{
Color mixedcolor = Color.white;
if (!cums.NullOrEmpty())
{
float mixedsofar = 0;
foreach (Cum cum in cums)
{
mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume));
mixedsofar += cum.volume;
}
}
return mixedcolor;
}
}
public string GetCurStageLabel
{
get
{
switch (curStage)
{
case Stage.Follicular:
return Translations.Stage_Follicular;
case Stage.Ovulatory:
return Translations.Stage_Ovulatory;
case Stage.Luteal:
return Translations.Stage_Luteal;
case Stage.Bleeding:
return Translations.Stage_Bleeding;
case Stage.Fertilized:
return Translations.Stage_Fertilized;
case Stage.Pregnant:
return Translations.Stage_Pregnant;
case Stage.Recover:
return Translations.Stage_Recover;
default:
return "";
}
}
}
public bool GetEggFertilizing
{
get
{
if (!eggs.NullOrEmpty())
{
if (!cums.NullOrEmpty()) foreach(Cum cum in cums)
{
if (cum.fertvolume > 0) return true;
}
return false;
}
else return false;
}
}
public bool GetFertilization
{
get
{
if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs)
{
if (egg.fertilized) return true;
}
return false;
}
}
public bool GetEgg
{
get
{
return !eggs.NullOrEmpty();
}
}
public override void CompExposeData()
{
base.CompExposeData();
Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]);
Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]);
Scribe_Values.Look(ref curStage, "curStage", curStage, true);
Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true);
Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true);
Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true);
Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true);
Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true);
}
public override void CompPostTick(ref float severityAdjustment)
{
if (!loaded)
{
Props = (CompProperties_Menstruation)props;
if (follicularIntervalhours < 0)
{
follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor);
curStage = RandomStage();
}
if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor);
if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor);
if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor);
if (cums == null) cums = new List<Cum>();
if (eggs == null) eggs = new List<Egg>();
if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant;
if (Configurations.EnableAnimalCycle)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
}
else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
loaded = true;
}
}
public override void CompPostPostRemoved()
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref);
ModLog.Message(parent.pawn.Label + "tick scheduler removed");
base.CompPostPostRemoved();
}
public Cum GetNotCum(string notcumlabel)
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum;
}
return null;
}
public Cum GetCum(Pawn pawn)
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (!cum.notcum && cum.pawn.Equals(pawn)) return cum;
}
return null;
}
public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null)
{
float volume = injectedvolume * CumInFactor;
float tmp = TotalCum + volume;
if (tmp > Props.maxCumCapacity)
{
float cumoutrate = 1 - (Props.maxCumCapacity / tmp);
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
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));
}
else
{
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
cum.FilthDef = filthdef;
merged = true;
}
}
if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef));
}
}
public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null)
{
float tmp = TotalCum + volume;
if (tmp > Props.maxCumCapacity)
{
float cumoutrate = 1 - (Props.maxCumCapacity / tmp);
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel))
{
cum.volume += volume;
cum.decayresist = decayresist;
cum.fertvolume = 0;
cum.FilthDef = filthdef;
merged = true;
}
cum.volume *= 1 - cumoutrate;
cum.fertvolume *= 1 - cumoutrate;
}
if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef));
}
else
{
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel))
{
cum.volume += volume;
cum.decayresist = decayresist;
cum.fertvolume = 0;
cum.FilthDef = filthdef;
merged = true;
}
}
if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef));
}
}
public void CumOut()
{
if (cums.NullOrEmpty()) return;
List<Cum> removecums = new List<Cum>();
foreach(Cum cum in cums)
{
float vd = cum.volume;
cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))));
cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum);
}
foreach(Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
}
public float CumOut(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
float outcum = 0;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
float vd = cum.volume;
if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist));
cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist)));
cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum);
}
foreach (Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
return outcum;
}
//ignores cum.decayresist
public float CumOutForce(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
float outcum = 0;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
float vd = cum.volume;
if (cum.Equals(targetcum)) outcum = cum.volume * (portion);
cum.volume *= 1 - (portion);
cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio));
if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.1f) removecums.Add(cum);
}
foreach (Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
return outcum;
}
public bool FertilizationCheck()
{
if (!eggs.NullOrEmpty())
{
bool onefertilized = false;
foreach (Egg egg in eggs)
{
if (!egg.fertilized) egg.fertilizer = Fertilize();
if (egg.fertilizer != null) {
egg.fertilized = true;
onefertilized = true;
}
}
return onefertilized;
}
else return false;
}
private Pawn Fertilize()
{
if (cums.NullOrEmpty()) return null;
foreach (Cum cum in cums)
{
float rand = Rand.Range(0.0f, 1.0f);
if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor)
{
return cum.pawn;
}
}
return null;
}
//for now, only one egg can be implanted
private bool Implant()
{
if (!eggs.NullOrEmpty())
{
List<Egg> deadeggs = new List<Egg>();
bool pregnant = false;
foreach(Egg egg in eggs)
{
if (!egg.fertilized) continue;
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer);
pregnant = true;
break;
}
else deadeggs.Add(egg);
}
if (pregnant)
{
eggs.Clear();
deadeggs.Clear();
return true;
}
else if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
}
return false;
}
private void BleedOut()
{
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label);
CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood);
GetNotCum(Translations.Menstrual_Blood).color = Colors.blood;
}
private void MakeCumFilth(Cum cum)
{
FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
}
private void EggDecay()
{
List<Egg> deadeggs = new List<Egg>();
foreach (Egg egg in eggs)
{
egg.lifespanhrs--;
if (egg.lifespanhrs < 0) deadeggs.Add(egg);
}
if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
}
private Action PeriodSimulator(Enum targetstage)
{
Action action = null;
switch (targetstage)
{
case Stage.Follicular:
action = delegate
{
if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor)
{
GoNextStage(Stage.Ovulatory);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Ovulatory:
action = delegate
{
eggs.Add(new Egg(Props.eggLifespanDays * 24));
lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Luteal);
};
break;
case Stage.Luteal:
action = delegate
{
if (!eggs.NullOrEmpty())
{
if (FertilizationCheck())
{
GoNextStage(Stage.Fertilized);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
}
else if (curStageHrs <= lutealIntervalhours)
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
else
{
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Bleeding);
}
};
break;
case Stage.Bleeding:
action = delegate
{
if (curStageHrs >= bleedingIntervalhours)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Fertilized:
action = delegate
{
if (curStageHrs >= 24)
{
if (Implant())
{
GoNextStage(Stage.Pregnant);
}
else
{
GoNextStageSetHour(Stage.Luteal, 96);
}
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Pregnant:
action = delegate
{
if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant);
else GoNextStage(Stage.Recover);
};
break;
case Stage.Recover:
action = delegate
{
if (curStageHrs >= recoveryIntervalhours)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
default:
curStage = Stage.Follicular;
curStageHrs = 0;
if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false);
break;
}
action += () =>
{
CumOut();
if (!eggs.NullOrEmpty()) EggDecay();
};
actionref = action;
return action;
void GoNextStage(Stage nextstage, float factor = 1.0f)
{
curStageHrs = 0;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
}
void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f)
{
curStageHrs = hour;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
}
void StayCurrentStage(float factor = 1.0f)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false);
}
void StayCurrentStageConst(Stage curstage, float factor = 1.0f)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false);
}
}
private int PeriodRandomizer(int intervalhours, float deviation)
{
return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation));
}
private float InterspeciesImplantFactor(Pawn fertilizer)
{
if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer);
else return RJWPregnancySettings.interspecies_impregnation_modifier;
}
private Stage RandomStage()
{
int rand = Rand.Range(0,2);
switch (rand)
{
case 0:
curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24);
return Stage.Follicular;
case 1:
curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24);
return Stage.Luteal;
case 2:
curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
return Stage.Bleeding;
default: return Stage.Follicular;
}
}
public class Egg : IExposable
{
public bool fertilized;
public int lifespanhrs;
public Pawn fertilizer;
public Egg()
{
fertilized = false;
lifespanhrs = 96;
fertilizer = null;
}
public Egg(int lifespanhrs)
{
fertilized = false;
this.lifespanhrs = lifespanhrs;
fertilizer = null;
}
public void ExposeData()
{
Scribe_References.Look(ref fertilizer, "fertilizer", true);
Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true);
Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true);
}
}
}
}

View File

@ -1,350 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EED2F3B9-8C20-4194-919E-8D151B29F70B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>RJW_Menstruation</RootNamespace>
<AssemblyName>RJW_Menstruation</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>게시\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configurations.cs" />
<Compile Include="Cum.cs" />
<Compile Include="Dialog_WombStatus.cs" />
<Compile Include="DNADef.cs" />
<Compile Include="DrugOutcomDoers.cs" />
<Compile Include="GetGizmos.cs" />
<Compile Include="Gizmo_Womb.cs" />
<Compile Include="Harmony.cs" />
<Compile Include="HediffComp_Menstruation.cs" />
<Compile Include="RJW_Patch.cs" />
<Compile Include="Translations.cs" />
<Compile Include="Utility.cs" />
<Compile Include="VariousDefOf.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\..\..\RJW\1.1\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AccessibilityModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AndroidJNIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ARModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClothModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClusterInputModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClusterRendererModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CrashReportingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.DirectorModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.DSPGraphModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.FileSystemHttpModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.GameCenterModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.GridModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.HotReloadModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.LocalizationModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PerformanceReportingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ProfilerModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ScreenCaptureModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SharedInternalsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteMaskModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteShapeModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.StreamingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SubstanceModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainPhysicsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextCoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TilemapModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TLSModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UmbraModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UNETModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityAnalyticsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityConnectModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityTestProtocolModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestTextureModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VehiclesModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VFXModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VideoModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VRModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.WindModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.XRModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2%28x86 및 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,88 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using rjw;
using Verse;
namespace RJW_Menstruation
{
[HarmonyPatch(typeof(PregnancyHelper), "impregnate")]
public static class impregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None)
{
if (sextype == xxx.rjwSextype.Vaginal)
{
var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn);
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR);
var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner);
var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR);
if (Genital_Helper.has_vagina(partner, partnerparts))
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner);
if (comp != null)
{
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{
PregnancyHelper.Doimpregnate(pawn, partner);
return false;
}
else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0);
}
}
else if (Genital_Helper.has_vagina(pawn, pawnparts))
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null)
{
if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype))
{
PregnancyHelper.Doimpregnate(partner, pawn);
return false;
}
else comp.CumIn(partner, Utility.GetCumVolume(partner), 0);
}
}
}
return true;
}
}
[HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")]
public static class Doimpregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner);
if (comp != null)
{
if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn))
{
comp.CumIn(pawn, Utility.GetCumVolume(pawn),0);
return false;
}
else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction));
return false;
}
ModLog.Message("used original rjw method: Comp missing");
return true;
}
}
}

View File

@ -1,60 +0,0 @@
using Verse;
namespace RJW_Menstruation
{
public static class Translations
{
public static readonly string Mod_Title = "Mod_Title".Translate();
public static readonly string Info_noCum = "Info_noCum".Translate();
public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate();
public static readonly string Stage_Follicular = "Stage_Follicular".Translate();
public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate();
public static readonly string Stage_Luteal = "Stage_Luteal".Translate();
public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate();
public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate();
public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate();
public static readonly string Stage_Recover = "Stage_Recover".Translate();
public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate();
public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate();
public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate();
public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate();
public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate();
public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate();
public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate();
public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate();
public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate();
public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate();
public static readonly string Option1_Label = "Option1_Label".Translate();
public static readonly string Option1_Desc = "Option1_Desc".Translate();
public static readonly string Option2_Label = "Option2_Label".Translate();
public static readonly string Option2_Desc = "Option2_Desc".Translate();
public static readonly string Option3_Label = "Option3_Label".Translate();
public static readonly string Option3_Desc = "Option3_Desc".Translate();
public static readonly string Option4_Label = "Option4_Label".Translate();
public static readonly string Option4_Desc = "Option4_Desc".Translate();
public static readonly string Option5_Label = "Option5_Label".Translate();
public static readonly string Option5_Desc = "Option5_Desc".Translate();
public static readonly string Option6_Label = "Option6_Label".Translate();
public static readonly string Option6_Desc = "Option6_Desc".Translate();
public static readonly string Option7_Label = "Option7_Label".Translate();
public static readonly string Option7_Desc = "Option7_Desc".Translate();
public static readonly string Option8_Label = "Option8_Label".Translate();
public static readonly string Option8_Desc = "Option8_Desc".Translate();
public static readonly string Option9_Label = "Option9_Label".Translate();
public static readonly string Option9_Desc = "Option9_Desc".Translate();
public static readonly string Option10_Label = "Option10_Label".Translate();
public static readonly string Option10_Desc = "Option10_Desc".Translate();
public static readonly string Option11_Label = "Option11_Label".Translate();
public static readonly string Option11_Desc = "Option11_Desc".Translate();
public static readonly string Option12_Label = "Option12_Label".Translate();
public static readonly string Option12_Desc = "Option12_Desc".Translate();
public static readonly string Option13_Label = "Option13_Label".Translate();
public static readonly string Option13_Desc = "Option13_Desc".Translate();
}
}

View File

@ -1,223 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using rjw;
using RimWorld;
using UnityEngine;
namespace RJW_Menstruation
{
public static class Colors
{
public static Color blood = new Color(0.78f, 0, 0);
}
public static class Utility
{
public static float GetCumVolume(Pawn pawn)
{
CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f;
}
public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return null;
else
{
foreach (Hediff h in hedifflist)
{
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return result;
}
}
return null;
}
public static bool HasMenstruationComp(Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return false;
else
{
foreach (Hediff h in hedifflist)
{
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return true;
}
}
return false;
}
public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn)
{
return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding;
}
public static float GetPregnancyProgress(Pawn pawn)
{
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
return h.GestationProgress;
}
return -1;
}
public static Pawn GetFetus(Pawn pawn)
{
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
return h?.babies?.First() ?? null;
}
//else if (hediff is Hediff_HumanlikePregnancy)
//{
// Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff;
// return h?.babies?.First() ?? null;
//}
//else if (hediff is Hediff_BestialPregnancy)
//{
// Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff;
// return h?.babies?.First() ?? null;
//}
else if (hediff is Hediff_MechanoidPregnancy)
{
Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff;
return h?.babies?.First() ?? null;
}
return null;
}
public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff)
{
string icon = "";
if (hediff is Hediff_MechanoidPregnancy)
{
return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
}
else if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
string fetustex = DefDatabase<DNADef>.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default";
if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted";
else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00";
else if (h.GestationProgress < 0.4f) icon += fetustex + "00";
else if (h.GestationProgress < 0.5f) icon += fetustex + "01";
else if (h.GestationProgress < 0.6f) icon += fetustex + "02";
else if (h.GestationProgress < 0.7f) icon += fetustex + "03";
else if (h.GestationProgress < 0.8f) icon += fetustex + "04";
else icon += fetustex + "05";
}
else icon = "Fetus/Slime_Abomi02";
return ContentFinder<Texture2D>.Get((icon), true);
}
public static Texture2D GetCumIcon(HediffComp_Menstruation comp)
{
string icon = "Womb/";
float cumpercent = comp.TotalCumPercent;
if (cumpercent < 0.001f) icon += "Empty";
else if (cumpercent < 0.01f) icon += "Cum_00";
else if (cumpercent < 0.05f) icon += "Cum_01";
else if (cumpercent < 0.11f) icon += "Cum_02";
else if (cumpercent < 0.17f) icon += "Cum_03";
else if (cumpercent < 0.23f) icon += "Cum_04";
else if (cumpercent < 0.29f) icon += "Cum_05";
else if (cumpercent < 0.35f) icon += "Cum_06";
else if (cumpercent < 0.41f) icon += "Cum_07";
else if (cumpercent < 0.47f) icon += "Cum_08";
else if (cumpercent < 0.53f) icon += "Cum_09";
else if (cumpercent < 0.59f) icon += "Cum_10";
else if (cumpercent < 0.65f) icon += "Cum_11";
else if (cumpercent < 0.71f) icon += "Cum_12";
else if (cumpercent < 0.77f) icon += "Cum_13";
else if (cumpercent < 0.83f) icon += "Cum_14";
else if (cumpercent < 0.89f) icon += "Cum_15";
else if (cumpercent < 0.95f) icon += "Cum_16";
else icon += "Cum_17";
Texture2D cumtex = ContentFinder<Texture2D>.Get((icon), true);
return cumtex;
}
public static Texture2D GetWombIcon(HediffComp_Menstruation comp)
{
string icon = comp.Props.wombTex;
HediffComp_Menstruation.Stage stage = comp.curStage;
if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding";
Texture2D wombtex = ContentFinder<Texture2D>.Get((icon), true);
return wombtex;
}
public static Texture2D GetGenitalIcon(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
string icon = "Genitals/";
if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro
else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight
else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight
else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average
else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average
else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average
else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating
else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating
else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous
else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous
else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous
else icon += "Vagina11"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
}
public static Texture2D GetAnalIcon(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
string icon = "Genitals/";
if (hediff.Severity < 0.20f) icon += "Anal00"; //micro
else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight
else if (hediff.Severity < 0.60f) icon += "Anal02"; //average
else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating
else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous
else icon += "Anal05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
}
public static string GetVaginaLabel(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
return hediff.LabelBase + "\n" + hediff.LabelInBrackets;
}
public static string GetAnusLabel(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
return hediff.Label;
}
}
}

View File

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
public static class VariousDefOf
{
public static readonly DNADef defaultDNA = new DNADef
{
fetusTexPath = "Fetus/Fetus_Default",
cumColor = new ColorInt(255, 255, 255, 255),
cumTickness = 0
};
public static readonly ThingDef CumFilth = DefDatabase<ThingDef>.GetNamed("FilthCum");
public static readonly HediffDef RJW_IUD = DefDatabase<HediffDef>.GetNamed("RJW_IUD");
}
}

View File

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_Menstruation", "RJW_Menstruation\RJW_Menstruation.csproj", "{847C0F22-0689-42A0-A09E-FBE17A53BD08}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{847C0F22-0689-42A0-A09E-FBE17A53BD08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{847C0F22-0689-42A0-A09E-FBE17A53BD08}.Debug|Any CPU.Build.0 = Debug|Any CPU
{847C0F22-0689-42A0-A09E-FBE17A53BD08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{847C0F22-0689-42A0-A09E-FBE17A53BD08}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7C747E50-BD18-4B79-AB42-D6788A4024E3}
EndGlobalSection
EndGlobal

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,124 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
namespace RJW_Menstruation
{
public class Configurations : ModSettings
{
public static readonly float ImplantationChanceDefault = 0.25f;
public static readonly int ImplantationChanceAdjustDefault = 25;
public static readonly float FertilizeChanceDefault = 0.05f;
public static readonly int FertilizeChanceAdjustDefault = 50;
public static readonly float CumDecayRatioDefault = 0.05f;
public static readonly int CumDecayRatioAdjustDefault = 50;
public static readonly float CumFertilityDecayRatioDefault = 0.2f;
public static readonly int CumFertilityDecayRatioAdjustDefault = 200;
public static readonly int CycleAccelerationDefault = 6;
public static float ImplantationChance = ImplantationChanceDefault;
public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
public static float FertilizeChance = FertilizeChanceDefault;
public static int FertilizeChanceAdjust = FertilizeChanceAdjustDefault;
public static float CumDecayRatio = CumDecayRatioDefault;
public static int CumDecayRatioAdjust = CumDecayRatioAdjustDefault;
public static float CumFertilityDecayRatio = CumFertilityDecayRatioDefault;
public static int CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault;
public static int CycleAcceleration = CycleAccelerationDefault;
public static bool EnableWombIcon = true;
public static bool EnableAnimalCycle = false;
public static bool Debug = false;
public override void ExposeData()
{
Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true);
Scribe_Values.Look(ref ImplantationChance, "ImplantationChance", ImplantationChance, true);
Scribe_Values.Look(ref FertilizeChanceAdjust, "FertilizeChanceAdjust", FertilizeChanceAdjust, true);
Scribe_Values.Look(ref FertilizeChance, "FertilizeChance", FertilizeChance, true);
Scribe_Values.Look(ref CumDecayRatioAdjust, "CumDecayRatioAdjust", CumDecayRatioAdjust, true);
Scribe_Values.Look(ref CumDecayRatio, "CumDecayRatio", CumDecayRatio, true);
Scribe_Values.Look(ref CumFertilityDecayRatioAdjust, "CumFertilityDecayRatioAdjust", CumFertilityDecayRatioAdjust, true);
Scribe_Values.Look(ref CumFertilityDecayRatio, "CumFertilityDecayRatio", CumFertilityDecayRatio, true);
Scribe_Values.Look(ref EnableWombIcon, "EnableWombIcon", EnableWombIcon, true);
Scribe_Values.Look(ref EnableAnimalCycle, "EnableAnimalCycle", EnableAnimalCycle, true);
base.ExposeData();
}
}
public class RJW_Menstruation : Mod
{
private readonly Configurations config;
public RJW_Menstruation(ModContentPack content) : base(content)
{
config = GetSettings<Configurations>();
}
public override string SettingsCategory()
{
return Translations.Mod_Title;
}
public override void DoSettingsWindowContents(Rect inRect)
{
Rect mainRect = inRect.ContractedBy(20f);
Listing_Standard listmain = new Listing_Standard();
listmain.Begin(mainRect);
listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_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;
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;
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;
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;
listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc);
Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50);
listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc);
if (listmain.ButtonText("reset to default"))
{
Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault;
Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault;
Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault;
Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault;
Configurations.EnableWombIcon = true;
Configurations.EnableAnimalCycle = false;
Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault;
}
listmain.End();
}
}
}

View File

@ -1,141 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using UnityEngine;
using rjw;
namespace RJW_Menstruation
{
public class Cum : IExposable
{
public Pawn pawn;
//public bool failedFertilization = false;
//public bool dead = false;
public float volume; // ml
public float fertvolume;
public float fertFactor = 1.0f;
public bool notcum = false; // for other fluids
public string notcumLabel = "";
private bool useCustomColor = false;
private float notcumthickness = 0;
public float decayresist
{
get
{
if (!notcum) return DNA.cumTickness;
else return notcumthickness;
}
set
{
notcumthickness = value;
}
}
private Color customColor;
public DNADef DNA
{
get
{
if (DNAcache == null)
{
DNAcache = DefDatabase<DNADef>.GetNamedSilentFail(pawn.def.defName);
if (DNAcache == null)
{
DNAcache = VariousDefOf.defaultDNA;
}
return DNAcache;
}
else return DNAcache;
}
}
private DNADef DNAcache = null;
public ThingDef FilthDef
{
get
{
if (filthDef == null) return VariousDefOf.CumFilth;
else return filthDef;
}
set
{
filthDef = value;
}
}
private ThingDef filthDef = null;
public Color color
{
get
{
if (!useCustomColor) return DNA.CumColor;
else return customColor;
}
set
{
useCustomColor = true;
customColor = value;
}
}
public Cum() {}
public Cum(Pawn pawn)
{
this.pawn = pawn;
volume = 1.0f;
fertvolume = 1.0f;
decayresist = 0;
}
public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null)
{
this.pawn = pawn;
this.volume = volume;
this.fertvolume = volume;
this.notcum = true;
this.notcumLabel = notcumlabel;
this.notcumthickness = decayresist;
this.filthDef = filthDef;
}
public Cum(Pawn pawn, float volume, float fertility, ThingDef filthDef = null)
{
this.pawn = pawn;
this.volume = volume;
if (fertility > 0)
{
this.fertvolume = volume;
this.fertFactor = fertility;
}
else this.fertvolume = 0;
this.filthDef = filthDef;
}
public void ExposeData()
{
Scribe_References.Look(ref pawn, "pawn", true);
Scribe_Values.Look(ref volume, "volume", volume, true);
Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true);
Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true);
Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true);
Scribe_Values.Look(ref notcum, "notcum", notcum, true);
Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true);
Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true);
Scribe_Values.Look(ref customColor, "customColor", customColor, true);
}
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
namespace RJW_Menstruation
{
public class DNADef : Def
{
public bool IsNone => string.IsNullOrEmpty(defName);
public static readonly DNADef None = new DNADef();
public string fetusTexPath;
public ColorInt cumColor;
public Color CumColor => cumColor.ToColor;
public float cumTickness = 0f;
}
}

View File

@ -1,204 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
public class Dialog_WombStatus : Window
{
private Pawn pawn;
private HediffComp_Menstruation comp;
private const float windowMargin = 20f;
private const float pawnRectWidth = 150f;
private const float pawnRectHeight = 150f;
private const float wombRectHeight = 270f;
private const float wombRectWidth = 300f;
private const float fontheight = 30;
private const float genitalRectWidth = 102;
private const float genitalRectHeight = 140;
private Texture2D womb;
private Texture2D cum;
private Texture2D vagina;
private Texture2D anal;
private Color cumcolor;
public override Vector2 InitialSize
{
get
{
return new Vector2(300f + 2*windowMargin,800f);
}
}
public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon)
{
this.pawn = pawn;
this.comp = comp;
womb = icon;
}
public override void DoWindowContents(Rect inRect)
{
bool flag = false;
soundClose = SoundDefOf.InfoCard_Close;
//closeOnClickedOutside = true;
absorbInputAroundWindow = false;
forcePause = false;
preventCameraMotion = false;
draggable = true;
//resizeable = true;
if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape))
{
flag = true;
Event.current.Use();
}
Rect windowRect = inRect.ContractedBy(windowMargin);
Rect mainRect = new Rect(windowRect.x, windowRect.y, windowRect.width, windowRect.height - 20f);
Rect closeRect = new Rect(windowRect.xMax, 0f, 20f, 20f);
MainContents(mainRect);
if (Widgets.CloseButtonFor(closeRect))
{
Close();
}
}
private void MainContents(Rect mainRect)
{
GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter };
GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight };
GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft };
GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea);
GUIStyle buttonstyle = new GUIStyle(GUI.skin.button);
boxstyle.hover = boxstyle.normal;
boxstyle.onHover = boxstyle.normal;
boxstyle.onNormal = boxstyle.normal;
buttonstyle.onHover = buttonstyle.onNormal;
buttonstyle.hover = buttonstyle.normal;
boxstyle.border.left = 4; boxstyle.border.right = 4; boxstyle.border.bottom = 4; boxstyle.border.top = 4;
float preginfoheight = 0f;
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (pawn.IsPregnant())
{
womb = Utility.GetPregnancyIcon(comp, hediff);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
if (h.GestationProgress < 0.2f) cum = Utility.GetCumIcon(comp);
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
Pawn fetus = Utility.GetFetus(pawn);
preginfoheight = fontheight;
Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight);
if (fetus != null)
{
fontstyleright.normal.textColor = Color.white;
buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle);
GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + h.father.LabelShort + " ", fontstyleright);
}
}
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else
{
womb = Utility.GetWombIcon(comp);
cum = Utility.GetCumIcon(comp);
}
Rect pawnRect = new Rect(0, 0, pawnRectWidth, pawnRectHeight);
Widgets.DrawTextureFitted(pawnRect,PortraitsCache.Get(pawn, pawnRect.size),1.0f);
Rect pawnLabelRect = new Rect(0, pawnRectHeight, pawnRectWidth, fontheight-10);
Rect pawnLabel2Rect = new Rect(0, pawnRectHeight+fontheight-10, pawnRectWidth, fontheight-10);
fontstylecenter.normal.textColor = pawn.DrawColor;
GUI.Label(pawnLabelRect, pawn.Name.ToStringFull, fontstylecenter);
GUI.Label(pawnLabel2Rect, pawn.story.Title, fontstylecenter);
GUI.color = Color.white;
Rect wombInfoRect = new Rect(0f, mainRect.yMax - wombRectHeight - fontheight - 2, wombRectWidth, fontheight);
buttonstyle.normal.textColor = Color.white;
//boxstyle.normal.background = Texture2D.whiteTexture;
buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.backgroundColor = new Color(0.24f, 0.29f, 0.35f, 1);
GUI.Box(wombInfoRect, Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel,buttonstyle);
GUI.color = Color.white;
fontstyleright.normal.textColor = Color.red;
if (comp.GetFertilization) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo05 + " ", fontstyleright);
else if (comp.GetEggFertilizing) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo06 + " ", fontstyleright);
else if (comp.GetEgg) GUI.Label(wombInfoRect, Translations.Dialog_WombInfo07 + " ", fontstyleright);
//Widgets.Label(wombInfoRect,Translations.Dialog_WombInfo01 + ": " + comp.GetCurStageLabel);
cumcolor = comp.GetCumMixtureColor;
Rect wombRect = new Rect(0f, mainRect.yMax - wombRectHeight + preginfoheight, wombRectWidth, wombRectHeight);
GUI.color = new Color(1.00f,0.47f,0.47f,1);
GUI.Box(wombRect,"",boxstyle);
//GUI.color = Color.white;
//Widgets.DrawTextureFitted(wombRect, womb,1.0f);
//GUI.color = cumcolor;
//Widgets.DrawTextureFitted(wombRect, cum,1.0f);
GUI.DrawTexture(wombRect, womb, ScaleMode.ScaleToFit, true, 0, Color.white, 0, 0);
GUI.DrawTexture(wombRect, cum, ScaleMode.ScaleToFit, true, 0, cumcolor,0,0);
GUI.color = Color.white;
Rect cumlistTitle = new Rect(pawnRectWidth, 0, wombRectWidth - pawnRectWidth, fontheight);
GUI.Label(cumlistTitle,Translations.Dialog_WombInfo04);
Rect cumlistRect = new Rect(pawnRectWidth, fontheight, wombRectWidth - pawnRectWidth, mainRect.yMax - wombRectHeight - fontheight);
Listing_Standard cumlist = new Listing_Standard
{
maxOneColumn = true,
ColumnWidth = wombRectWidth - pawnRectWidth
};
cumlist.Begin(cumlistRect);
Listing_Standard cumlistsection = cumlist.BeginSection_NewTemp(mainRect.yMax - wombRectHeight - 2 * fontheight - 12f);
foreach(string s in comp.GetCumsInfo)
{
cumlistsection.Label(s);
}
cumlist.EndSection(cumlistsection);
cumlist.End();
Rect genitalRect = new Rect(24, pawnRectHeight + 2*fontheight, genitalRectWidth, genitalRectHeight + fontheight*2);
Rect genitalIconRect = new Rect(genitalRect.x,genitalRect.y + fontheight ,genitalRectWidth,genitalRectHeight);
Rect genitalVaginaLabelRect = new Rect(genitalRect.x,genitalRect.y,genitalRectWidth,fontheight);
Rect genitalAnusLabelRect = new Rect(genitalRect.x,genitalRect.y + fontheight +genitalRectHeight ,genitalRectWidth,fontheight);
vagina = Utility.GetGenitalIcon(pawn);
anal = Utility.GetAnalIcon(pawn);
GUI.color = new Color(1.00f, 0.47f, 0.47f, 1);
GUI.Box(genitalRect, "", boxstyle);
GUI.color = pawn.story.SkinColor;
//Widgets.DrawTextureFitted(genitalIconRect, anal, 1.0f);
//Widgets.DrawTextureFitted(genitalIconRect, vagina, 1.0f);
GUI.DrawTexture(genitalIconRect, anal, ScaleMode.ScaleToFit);
GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit);
GUI.color = Color.white;
GUI.Label(genitalVaginaLabelRect, Utility.GetVaginaLabel(pawn),fontstylecenter);
GUI.Label(genitalAnusLabelRect, Utility.GetAnusLabel(pawn),fontstylecenter);
}
}
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
namespace RJW_Menstruation
{
public class FertPillOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)) comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
}
}
}

View File

@ -1,104 +0,0 @@
using System;
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;
namespace RJW_Menstruation
{
[HarmonyPatch(typeof(Pawn), "GetGizmos")]
public class Pawn_GetGizmos
{
public static void Postfix(ref IEnumerable<Gizmo> __result, Pawn __instance)
{
List<Gizmo> gizmoList = __result.ToList();
bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony);
if (!isCreatureMine)
{
return;
}
if (Configurations.EnableWombIcon && __instance.gender == Gender.Female)
{
if (!__instance.IsAnimal())
{
AddWombGizmos(__instance, ref gizmoList);
}
else if (Configurations.EnableAnimalCycle)
{
AddWombGizmos(__instance, ref gizmoList);
}
}
__result = gizmoList;
}
private static void AddWombGizmos(Pawn __instance, ref List<Gizmo> gizmoList)
{
gizmoList.Add(CreateGizmo_WombStatus(__instance));
}
private static Gizmo CreateGizmo_WombStatus(Pawn pawn)
{
HediffComp_Menstruation comp = pawn.health.hediffSet.GetFirstHediffOfDef(Genital_Helper.average_vagina).TryGetComp<HediffComp_Menstruation>();
Texture2D icon,icon_overay;
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
string description = "";
if (Configurations.Debug) description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum;
else description += comp.GetCurStageLabel + "\n";
if (pawn.IsPregnant())
{
icon = Utility.GetPregnancyIcon(comp,hediff);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp);
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
}
else
{
icon = Utility.GetWombIcon(comp);
icon_overay = Utility.GetCumIcon(comp);
}
foreach (string s in comp.GetCumsInfo) description += s + "\n";
Color c = comp.GetCumMixtureColor;
Gizmo gizmo = new Gizmo_Womb
{
defaultLabel = pawn.LabelShort,
defaultDesc = description,
icon = icon,
icon_overay = icon_overay,
cumcolor = c,
order = 100,
action = delegate
{
SoundDefOf.InfoCard_Open.PlayOneShotOnCamera();
Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon));
}
};
return gizmo;
}
}
}

View File

@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;
using Verse.Sound;
namespace RJW_Menstruation
{
public class Gizmo_Womb : Command_Action
{
public Texture2D icon_overay;
public Color cumcolor;
protected override void DrawIcon(Rect rect, Material buttonMat = null)
{
Texture2D badTex = icon;
Texture2D overay = icon_overay;
Color color = cumcolor;
if (badTex == null)
{
badTex = BaseContent.BadTex;
}
if (overay == null)
{
overay = BaseContent.BadTex;
}
if (color == null) color = Color.white;
rect.position += new Vector2(iconOffset.x * rect.size.x, iconOffset.y * rect.size.y);
GUI.color = IconDrawColor;
Widgets.DrawTextureFitted(rect, badTex, this.iconDrawScale * 0.85f, this.iconProportions, this.iconTexCoords, this.iconAngle, buttonMat);
GUI.color = color;
Widgets.DrawTextureFitted(rect, overay, iconDrawScale * 0.85f, iconProportions, iconTexCoords, iconAngle, buttonMat);
GUI.color = Color.white;
}
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using HarmonyLib;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
[StaticConstructorOnStartup]
internal static class First
{
static First()
{
var har = new Harmony("LL");
har.PatchAll(Assembly.GetExecutingAssembly());
}
}
}

View File

@ -1,780 +0,0 @@
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;
namespace RJW_Menstruation
{
public class CompProperties_Menstruation : HediffCompProperties
{
public float maxCumCapacity; // ml
public float baseImplantationChanceFactor;
public float basefertilizationChanceFactor;
public float deviationFactor;
public int folicularIntervalDays = 14; //before ovulation including beginning of bleeding
public int lutealIntervalDays = 14; //after ovulation until bleeding
public int bleedingIntervalDays = 6; //must be less than folicularIntervalDays
public int recoveryIntervalDays = 10; //additional infertile days after gave birth
public int eggLifespanDays = 2; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public string wombTex = "Womb/Womb"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public CompProperties_Menstruation()
{
compClass = typeof(HediffComp_Menstruation);
}
}
public class HediffComp_Menstruation : HediffComp
{
const float minmakefilthvalue = 1.0f;
public static readonly int tickInterval = 2500; // an hour
public CompProperties_Menstruation Props;
public Stage curStage = Stage.Follicular;
public int curStageHrs = 0;
public enum Stage
{
Follicular,
Ovulatory,
Luteal,
Bleeding,
Fertilized,
Pregnant,
Recover
}
private List<Cum> cums;
private bool loaded = false;
private List<Egg> eggs;
private int follicularIntervalhours = -1;
private int lutealIntervalhours = -1;
private int bleedingIntervalhours = -1;
private int recoveryIntervalhours = -1;
private Action actionref;
public float TotalCum
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
res += cum.volume;
}
return res;
}
}
public float TotalFertCum
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
if (!cum.notcum) res += cum.fertvolume;
}
return res;
}
}
public float TotalCumPercent
{
get
{
float res = 0;
if (cums.NullOrEmpty()) return 0;
foreach (Cum cum in cums)
{
res += cum.volume;
}
return res/ Props.maxCumCapacity;
}
}
public float CumCapacity
{
get
{
float res = Props.maxCumCapacity;
if (curStage == Stage.Pregnant) res *= 0.2f;
return res;
}
}
public float CumInFactor
{
get
{
float res = 1.0f;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) res = 0.001f;
return res;
}
}
//make follicular interval into half and double egg lifespan
public float CycleFactor
{
get
{
if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f;
return 1.0f;
}
}
//effect on implant chance
public float ImplantFactor
{
get
{
float factor = 1.0f;
if (xxx.has_quirk(parent.pawn, "Breeder")) factor = 10.0f;
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;
}
}
public IEnumerable<string> GetCumsInfo
{
get
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (!cum.notcum) yield return String.Format(cum.pawn.Label + ": {0:0.##}ml", cum.volume);
else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume);
}
else yield return Translations.Info_noCum;
}
}
public Color GetCumMixtureColor
{
get
{
Color mixedcolor = Color.white;
if (!cums.NullOrEmpty())
{
float mixedsofar = 0;
foreach (Cum cum in cums)
{
mixedcolor = Color.LerpUnclamped(mixedcolor, cum.color, cum.volume/(mixedsofar + cum.volume));
mixedsofar += cum.volume;
}
}
return mixedcolor;
}
}
public string GetCurStageLabel
{
get
{
switch (curStage)
{
case Stage.Follicular:
return Translations.Stage_Follicular;
case Stage.Ovulatory:
return Translations.Stage_Ovulatory;
case Stage.Luteal:
return Translations.Stage_Luteal;
case Stage.Bleeding:
return Translations.Stage_Bleeding;
case Stage.Fertilized:
return Translations.Stage_Fertilized;
case Stage.Pregnant:
return Translations.Stage_Pregnant;
case Stage.Recover:
return Translations.Stage_Recover;
default:
return "";
}
}
}
public bool GetEggFertilizing
{
get
{
if (!eggs.NullOrEmpty())
{
if (!cums.NullOrEmpty()) foreach(Cum cum in cums)
{
if (cum.fertvolume > 0) return true;
}
return false;
}
else return false;
}
}
public bool GetFertilization
{
get
{
if (!eggs.NullOrEmpty()) foreach(Egg egg in eggs)
{
if (egg.fertilized) return true;
}
return false;
}
}
public bool GetEgg
{
get
{
return !eggs.NullOrEmpty();
}
}
public override void CompExposeData()
{
base.CompExposeData();
Scribe_Collections.Look(ref cums, saveDestroyedThings: true, label: "cums", lookMode: LookMode.Deep, ctorArgs: new object[0]);
Scribe_Collections.Look(ref eggs, saveDestroyedThings: true, label: "eggs", lookMode: LookMode.Deep, ctorArgs: new object[0]);
Scribe_Values.Look(ref curStage, "curStage", curStage, true);
Scribe_Values.Look(ref curStageHrs, "curStageHrs", curStageHrs, true);
Scribe_Values.Look(ref follicularIntervalhours, "follicularIntervalhours", follicularIntervalhours, true);
Scribe_Values.Look(ref lutealIntervalhours, "lutealIntervalhours", lutealIntervalhours, true);
Scribe_Values.Look(ref bleedingIntervalhours, "bleedingIntervalhours", bleedingIntervalhours, true);
Scribe_Values.Look(ref recoveryIntervalhours, "recoveryIntervalhours", recoveryIntervalhours, true);
}
public override void CompPostTick(ref float severityAdjustment)
{
if (!loaded)
{
Props = (CompProperties_Menstruation)props;
if (follicularIntervalhours < 0)
{
follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24,Props.deviationFactor);
curStage = RandomStage();
}
if (lutealIntervalhours < 0) lutealIntervalhours = PeriodRandomizer(Props.lutealIntervalDays*24, Props.deviationFactor);
if (bleedingIntervalhours < 0) bleedingIntervalhours = PeriodRandomizer(Props.bleedingIntervalDays*24, Props.deviationFactor);
if (recoveryIntervalhours < 0) recoveryIntervalhours = PeriodRandomizer(Props.recoveryIntervalDays * 24, Props.deviationFactor);
if (cums == null) cums = new List<Cum>();
if (eggs == null) eggs = new List<Egg>();
if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant;
if (Configurations.EnableAnimalCycle)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
}
else if (!parent.pawn.IsAnimal()) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
loaded = true;
}
}
public override void CompPostPostRemoved()
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref);
ModLog.Message(parent.pawn.Label + "tick scheduler removed");
base.CompPostPostRemoved();
}
public Cum GetNotCum(string notcumlabel)
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.notcumLabel.Equals(notcumlabel)) return cum;
}
return null;
}
public Cum GetCum(Pawn pawn)
{
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (!cum.notcum && cum.pawn.Equals(pawn)) return cum;
}
return null;
}
public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null)
{
float volume = injectedvolume * CumInFactor;
float tmp = TotalCum + volume;
if (tmp > Props.maxCumCapacity)
{
float cumoutrate = 1 - (Props.maxCumCapacity / tmp);
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
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));
}
else
{
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.pawn.Equals(pawn))
{
cum.volume += volume;
cum.fertvolume += volume;
cum.FilthDef = filthdef;
merged = true;
}
}
if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef));
}
}
public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null)
{
float tmp = TotalCum + volume;
if (tmp > Props.maxCumCapacity)
{
float cumoutrate = 1 - (Props.maxCumCapacity / tmp);
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel))
{
cum.volume += volume;
cum.decayresist = decayresist;
cum.fertvolume = 0;
cum.FilthDef = filthdef;
merged = true;
}
cum.volume *= 1 - cumoutrate;
cum.fertvolume *= 1 - cumoutrate;
}
if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel,decayresist, filthdef));
}
else
{
bool merged = false;
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
{
if (cum.notcum && cum.pawn.Equals(pawn) && cum.notcumLabel.Equals(notcumlabel))
{
cum.volume += volume;
cum.decayresist = decayresist;
cum.fertvolume = 0;
cum.FilthDef = filthdef;
merged = true;
}
}
if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef));
}
}
public void CumOut()
{
if (cums.NullOrEmpty()) return;
List<Cum> removecums = new List<Cum>();
foreach(Cum cum in cums)
{
float vd = cum.volume;
cum.volume *= Math.Max(0,(1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))));
cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum);
}
foreach(Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
}
public float CumOut(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
float outcum = 0;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
float vd = cum.volume;
if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist));
cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist)));
cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist))) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
if (vd-cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum);
}
foreach (Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
return outcum;
}
//ignores cum.decayresist
public float CumOutForce(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
float outcum = 0;
List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums)
{
float vd = cum.volume;
if (cum.Equals(targetcum)) outcum = cum.volume * (portion);
cum.volume *= 1 - (portion);
cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio));
if (vd - cum.volume > minmakefilthvalue) MakeCumFilth(cum);
if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.1f) removecums.Add(cum);
}
foreach (Cum cum in removecums)
{
cums.Remove(cum);
}
removecums.Clear();
return outcum;
}
public bool FertilizationCheck()
{
if (!eggs.NullOrEmpty())
{
bool onefertilized = false;
foreach (Egg egg in eggs)
{
if (!egg.fertilized) egg.fertilizer = Fertilize();
if (egg.fertilizer != null) {
egg.fertilized = true;
onefertilized = true;
}
}
return onefertilized;
}
else return false;
}
private Pawn Fertilize()
{
if (cums.NullOrEmpty()) return null;
foreach (Cum cum in cums)
{
float rand = Rand.Range(0.0f, 1.0f);
if (!cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor)
{
return cum.pawn;
}
}
return null;
}
//for now, only one egg can be implanted
private bool Implant()
{
if (!eggs.NullOrEmpty())
{
List<Egg> deadeggs = new List<Egg>();
bool pregnant = false;
foreach(Egg egg in eggs)
{
if (!egg.fertilized) continue;
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer);
pregnant = true;
break;
}
else deadeggs.Add(egg);
}
if (pregnant)
{
eggs.Clear();
deadeggs.Clear();
return true;
}
else if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
}
return false;
}
private void BleedOut()
{
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label);
CumIn(parent.pawn, Rand.Range(0f, 20f), Translations.Menstrual_Blood,-4.0f,ThingDefOf.Filth_Blood);
GetNotCum(Translations.Menstrual_Blood).color = Colors.blood;
}
private void MakeCumFilth(Cum cum)
{
FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
}
private void EggDecay()
{
List<Egg> deadeggs = new List<Egg>();
foreach (Egg egg in eggs)
{
egg.lifespanhrs--;
if (egg.lifespanhrs < 0) deadeggs.Add(egg);
}
if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
}
private Action PeriodSimulator(Enum targetstage)
{
Action action = null;
switch (targetstage)
{
case Stage.Follicular:
action = delegate
{
if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor)
{
GoNextStage(Stage.Ovulatory);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Ovulatory:
action = delegate
{
eggs.Add(new Egg(Props.eggLifespanDays * 24));
lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Luteal);
};
break;
case Stage.Luteal:
action = delegate
{
if (!eggs.NullOrEmpty())
{
if (FertilizationCheck())
{
GoNextStage(Stage.Fertilized);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
}
else if (curStageHrs <= lutealIntervalhours)
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
else
{
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Bleeding);
}
};
break;
case Stage.Bleeding:
action = delegate
{
if (curStageHrs >= bleedingIntervalhours)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
if (curStageHrs < bleedingIntervalhours / 6) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Fertilized:
action = delegate
{
if (curStageHrs >= 24)
{
if (Implant())
{
GoNextStage(Stage.Pregnant);
}
else
{
GoNextStageSetHour(Stage.Luteal, 96);
}
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
case Stage.Pregnant:
action = delegate
{
if (parent.pawn.IsPregnant()) StayCurrentStageConst(Stage.Pregnant);
else GoNextStage(Stage.Recover);
};
break;
case Stage.Recover:
action = delegate
{
if (curStageHrs >= recoveryIntervalhours)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
curStageHrs+=Configurations.CycleAcceleration;
StayCurrentStage();
}
};
break;
default:
curStage = Stage.Follicular;
curStageHrs = 0;
if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays*24, Props.deviationFactor);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false);
break;
}
action += () =>
{
CumOut();
if (!eggs.NullOrEmpty()) EggDecay();
};
actionref = action;
return action;
void GoNextStage(Stage nextstage, float factor = 1.0f)
{
curStageHrs = 0;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
}
void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f)
{
curStageHrs = hour;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
}
void StayCurrentStage(float factor = 1.0f)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false);
}
void StayCurrentStageConst(Stage curstage, float factor = 1.0f)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false);
}
}
private int PeriodRandomizer(int intervalhours, float deviation)
{
return intervalhours + (int)(intervalhours*Rand.Range(-deviation,deviation));
}
private float InterspeciesImplantFactor(Pawn fertilizer)
{
if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer);
else return RJWPregnancySettings.interspecies_impregnation_modifier;
}
private Stage RandomStage()
{
int rand = Rand.Range(0,2);
switch (rand)
{
case 0:
curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24);
return Stage.Follicular;
case 1:
curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24);
return Stage.Luteal;
case 2:
curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
return Stage.Bleeding;
default: return Stage.Follicular;
}
}
public class Egg : IExposable
{
public bool fertilized;
public int lifespanhrs;
public Pawn fertilizer;
public Egg()
{
fertilized = false;
lifespanhrs = 96;
fertilizer = null;
}
public Egg(int lifespanhrs)
{
fertilized = false;
this.lifespanhrs = lifespanhrs;
fertilizer = null;
}
public void ExposeData()
{
Scribe_References.Look(ref fertilizer, "fertilizer", true);
Scribe_Values.Look(ref fertilized, "fertilized", fertilized, true);
Scribe_Values.Look(ref lifespanhrs, "lifespanhrs", lifespanhrs, true);
}
}
}
}

View File

@ -1,350 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EED2F3B9-8C20-4194-919E-8D151B29F70B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>RJW_Menstruation</RootNamespace>
<AssemblyName>RJW_Menstruation</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>게시\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configurations.cs" />
<Compile Include="Cum.cs" />
<Compile Include="Dialog_WombStatus.cs" />
<Compile Include="DNADef.cs" />
<Compile Include="DrugOutcomDoers.cs" />
<Compile Include="GetGizmos.cs" />
<Compile Include="Gizmo_Womb.cs" />
<Compile Include="Harmony.cs" />
<Compile Include="HediffComp_Menstruation.cs" />
<Compile Include="RJW_Patch.cs" />
<Compile Include="Translations.cs" />
<Compile Include="Utility.cs" />
<Compile Include="VariousDefOf.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\..\..\RJW\1.1\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AccessibilityModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AndroidJNIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ARModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClothModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClusterInputModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ClusterRendererModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CrashReportingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.DirectorModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.DSPGraphModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.FileSystemHttpModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.GameCenterModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.GridModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.HotReloadModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.LocalizationModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PerformanceReportingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ProfilerModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ScreenCaptureModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SharedInternalsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteMaskModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteShapeModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.StreamingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SubstanceModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainPhysicsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextCoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TilemapModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TLSModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UmbraModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UNETModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityAnalyticsModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityConnectModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityTestProtocolModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestTextureModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VehiclesModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VFXModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VideoModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.VRModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.WindModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.XRModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2%28x86 및 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,88 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using rjw;
using Verse;
namespace RJW_Menstruation
{
[HarmonyPatch(typeof(PregnancyHelper), "impregnate")]
public static class impregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None)
{
if (sextype == xxx.rjwSextype.Vaginal)
{
var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn);
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR);
var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner);
var partnerparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR);
if (Genital_Helper.has_vagina(partner, partnerparts))
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner);
if (comp != null)
{
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{
PregnancyHelper.Doimpregnate(pawn, partner);
return false;
}
else comp.CumIn(pawn, Utility.GetCumVolume(pawn), 0);
}
}
else if (Genital_Helper.has_vagina(pawn, pawnparts))
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn);
if (comp != null)
{
if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype))
{
PregnancyHelper.Doimpregnate(partner, pawn);
return false;
}
else comp.CumIn(partner, Utility.GetCumVolume(partner), 0);
}
}
}
return true;
}
}
[HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")]
public static class Doimpregnate_Patch
{
public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina
{
HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner);
if (comp != null)
{
if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn))
{
comp.CumIn(pawn, Utility.GetCumVolume(pawn),0);
return false;
}
else comp.CumIn(pawn, Utility.GetCumVolume(pawn), pawn.health.capacities.GetLevel(xxx.reproduction));
return false;
}
ModLog.Message("used original rjw method: Comp missing");
return true;
}
}
}

View File

@ -1,60 +0,0 @@
using Verse;
namespace RJW_Menstruation
{
public static class Translations
{
public static readonly string Mod_Title = "Mod_Title".Translate();
public static readonly string Info_noCum = "Info_noCum".Translate();
public static readonly string Menstrual_Blood = "Menstrual_Blood".Translate();
public static readonly string Stage_Follicular = "Stage_Follicular".Translate();
public static readonly string Stage_Ovulatory = "Stage_Ovulatory".Translate();
public static readonly string Stage_Luteal = "Stage_Luteal".Translate();
public static readonly string Stage_Bleeding = "Stage_Bleeding".Translate();
public static readonly string Stage_Fertilized = "Stage_Fertilized".Translate();
public static readonly string Stage_Pregnant = "Stage_Pregnant".Translate();
public static readonly string Stage_Recover = "Stage_Recover".Translate();
public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate();
public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate();
public static readonly string Dialog_WombInfo03 = "Dialog_WombInfo03".Translate();
public static readonly string Dialog_WombInfo04 = "Dialog_WombInfo04".Translate();
public static readonly string Dialog_WombInfo05 = "Dialog_WombInfo05".Translate();
public static readonly string Dialog_WombInfo06 = "Dialog_WombInfo06".Translate();
public static readonly string Dialog_WombInfo07 = "Dialog_WombInfo07".Translate();
public static readonly string Dialog_WombInfo08 = "Dialog_WombInfo08".Translate();
public static readonly string Dialog_WombInfo09 = "Dialog_WombInfo09".Translate();
public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate();
public static readonly string Option1_Label = "Option1_Label".Translate();
public static readonly string Option1_Desc = "Option1_Desc".Translate();
public static readonly string Option2_Label = "Option2_Label".Translate();
public static readonly string Option2_Desc = "Option2_Desc".Translate();
public static readonly string Option3_Label = "Option3_Label".Translate();
public static readonly string Option3_Desc = "Option3_Desc".Translate();
public static readonly string Option4_Label = "Option4_Label".Translate();
public static readonly string Option4_Desc = "Option4_Desc".Translate();
public static readonly string Option5_Label = "Option5_Label".Translate();
public static readonly string Option5_Desc = "Option5_Desc".Translate();
public static readonly string Option6_Label = "Option6_Label".Translate();
public static readonly string Option6_Desc = "Option6_Desc".Translate();
public static readonly string Option7_Label = "Option7_Label".Translate();
public static readonly string Option7_Desc = "Option7_Desc".Translate();
public static readonly string Option8_Label = "Option8_Label".Translate();
public static readonly string Option8_Desc = "Option8_Desc".Translate();
public static readonly string Option9_Label = "Option9_Label".Translate();
public static readonly string Option9_Desc = "Option9_Desc".Translate();
public static readonly string Option10_Label = "Option10_Label".Translate();
public static readonly string Option10_Desc = "Option10_Desc".Translate();
public static readonly string Option11_Label = "Option11_Label".Translate();
public static readonly string Option11_Desc = "Option11_Desc".Translate();
public static readonly string Option12_Label = "Option12_Label".Translate();
public static readonly string Option12_Desc = "Option12_Desc".Translate();
public static readonly string Option13_Label = "Option13_Label".Translate();
public static readonly string Option13_Desc = "Option13_Desc".Translate();
}
}

View File

@ -1,223 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using rjw;
using RimWorld;
using UnityEngine;
namespace RJW_Menstruation
{
public static class Colors
{
public static Color blood = new Color(0.78f, 0, 0);
}
public static class Utility
{
public static float GetCumVolume(Pawn pawn)
{
CompHediffBodyPart part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("penis")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorf")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("ovipositorm")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
if (part == null) part = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff hed) => hed.def.defName.ToLower().Contains("tentacle")).InRandomOrder().FirstOrDefault().TryGetComp<rjw.CompHediffBodyPart>();
return part?.FluidAmmount * part.FluidModifier * Rand.Range(0.8f, 1.2f) ?? 0.0f;
}
public static HediffComp_Menstruation GetMenstruationComp(Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return null;
else
{
foreach (Hediff h in hedifflist)
{
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return result;
}
}
return null;
}
public static bool HasMenstruationComp(Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return false;
else
{
foreach (Hediff h in hedifflist)
{
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return true;
}
}
return false;
}
public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn)
{
return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding;
}
public static float GetPregnancyProgress(Pawn pawn)
{
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
return h.GestationProgress;
}
return -1;
}
public static Pawn GetFetus(Pawn pawn)
{
Hediff hediff = PregnancyHelper.GetPregnancy(pawn);
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
return h?.babies?.First() ?? null;
}
//else if (hediff is Hediff_HumanlikePregnancy)
//{
// Hediff_HumanlikePregnancy h = (Hediff_HumanlikePregnancy)hediff;
// return h?.babies?.First() ?? null;
//}
//else if (hediff is Hediff_BestialPregnancy)
//{
// Hediff_BestialPregnancy h = (Hediff_BestialPregnancy)hediff;
// return h?.babies?.First() ?? null;
//}
else if (hediff is Hediff_MechanoidPregnancy)
{
Hediff_MechanoidPregnancy h = (Hediff_MechanoidPregnancy)hediff;
return h?.babies?.First() ?? null;
}
return null;
}
public static Texture2D GetPregnancyIcon(HediffComp_Menstruation comp, Hediff hediff)
{
string icon = "";
if (hediff is Hediff_MechanoidPregnancy)
{
return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
}
else if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
string fetustex = DefDatabase<DNADef>.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default";
if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted";
else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00";
else if (h.GestationProgress < 0.4f) icon += fetustex + "00";
else if (h.GestationProgress < 0.5f) icon += fetustex + "01";
else if (h.GestationProgress < 0.6f) icon += fetustex + "02";
else if (h.GestationProgress < 0.7f) icon += fetustex + "03";
else if (h.GestationProgress < 0.8f) icon += fetustex + "04";
else icon += fetustex + "05";
}
else icon = "Fetus/Slime_Abomi02";
return ContentFinder<Texture2D>.Get((icon), true);
}
public static Texture2D GetCumIcon(HediffComp_Menstruation comp)
{
string icon = "Womb/";
float cumpercent = comp.TotalCumPercent;
if (cumpercent < 0.001f) icon += "Empty";
else if (cumpercent < 0.01f) icon += "Cum_00";
else if (cumpercent < 0.05f) icon += "Cum_01";
else if (cumpercent < 0.11f) icon += "Cum_02";
else if (cumpercent < 0.17f) icon += "Cum_03";
else if (cumpercent < 0.23f) icon += "Cum_04";
else if (cumpercent < 0.29f) icon += "Cum_05";
else if (cumpercent < 0.35f) icon += "Cum_06";
else if (cumpercent < 0.41f) icon += "Cum_07";
else if (cumpercent < 0.47f) icon += "Cum_08";
else if (cumpercent < 0.53f) icon += "Cum_09";
else if (cumpercent < 0.59f) icon += "Cum_10";
else if (cumpercent < 0.65f) icon += "Cum_11";
else if (cumpercent < 0.71f) icon += "Cum_12";
else if (cumpercent < 0.77f) icon += "Cum_13";
else if (cumpercent < 0.83f) icon += "Cum_14";
else if (cumpercent < 0.89f) icon += "Cum_15";
else if (cumpercent < 0.95f) icon += "Cum_16";
else icon += "Cum_17";
Texture2D cumtex = ContentFinder<Texture2D>.Get((icon), true);
return cumtex;
}
public static Texture2D GetWombIcon(HediffComp_Menstruation comp)
{
string icon = comp.Props.wombTex;
HediffComp_Menstruation.Stage stage = comp.curStage;
if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding";
Texture2D wombtex = ContentFinder<Texture2D>.Get((icon), true);
return wombtex;
}
public static Texture2D GetGenitalIcon(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
string icon = "Genitals/";
if (hediff.Severity < 0.20f) icon += "Vagina00"; //micro
else if (hediff.Severity < 0.30f) icon += "Vagina01"; //tight
else if (hediff.Severity < 0.40f) icon += "Vagina02"; //tight
else if (hediff.Severity < 0.47f) icon += "Vagina03"; //average
else if (hediff.Severity < 0.53f) icon += "Vagina04"; //average
else if (hediff.Severity < 0.60f) icon += "Vagina05"; //average
else if (hediff.Severity < 0.70f) icon += "Vagina06"; //accomodating
else if (hediff.Severity < 0.80f) icon += "Vagina07"; //accomodating
else if (hediff.Severity < 0.87f) icon += "Vagina08"; //cavernous
else if (hediff.Severity < 0.94f) icon += "Vagina09"; //cavernous
else if (hediff.Severity < 1.01f) icon += "Vagina10"; //cavernous
else icon += "Vagina11"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
}
public static Texture2D GetAnalIcon(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
string icon = "Genitals/";
if (hediff.Severity < 0.20f) icon += "Anal00"; //micro
else if (hediff.Severity < 0.40f) icon += "Anal01"; //tight
else if (hediff.Severity < 0.60f) icon += "Anal02"; //average
else if (hediff.Severity < 0.80f) icon += "Anal03"; //accomodating
else if (hediff.Severity < 1.01f) icon += "Anal04"; //cavernous
else icon += "Anal05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
}
public static string GetVaginaLabel(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
return hediff.LabelBase + "\n" + hediff.LabelInBrackets;
}
public static string GetAnusLabel(Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
return hediff.Label;
}
}
}

View File

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
namespace RJW_Menstruation
{
public static class VariousDefOf
{
public static readonly DNADef defaultDNA = new DNADef
{
fetusTexPath = "Fetus/Fetus_Default",
cumColor = new ColorInt(255, 255, 255, 255),
cumTickness = 0
};
public static readonly ThingDef CumFilth = DefDatabase<ThingDef>.GetNamed("FilthCum");
public static readonly HediffDef RJW_IUD = DefDatabase<HediffDef>.GetNamed("RJW_IUD");
}
}