From 45877378b99de244b58fbed927df7ae29c3c5145 Mon Sep 17 00:00:00 2001 From: moreoreganostodump Date: Mon, 1 Feb 2021 20:41:24 +0900 Subject: [PATCH] remove useless files --- .../RJW_Menstruation/RJW_Menstruation.sln | 25 - .../RJW_Menstruation/App.config | 6 - .../RJW_Menstruation/Configurations.cs | 124 --- .../RJW_Menstruation/RJW_Menstruation/Cum.cs | 141 ---- .../RJW_Menstruation/DNADef.cs | 27 - .../RJW_Menstruation/Dialog_WombStatus.cs | 204 ----- .../RJW_Menstruation/DrugOutcomDoers.cs | 21 - .../RJW_Menstruation/GetGizmos.cs | 104 --- .../RJW_Menstruation/Gizmo_Womb.cs | 45 - .../RJW_Menstruation/Harmony.cs | 27 - .../HediffComp_Menstruation.cs | 780 ------------------ .../RJW_Menstruation/RJW_Menstruation.csproj | 350 -------- .../RJW_Menstruation/RJW_Patch.cs | 88 -- .../RJW_Menstruation/Translations.cs | 60 -- .../RJW_Menstruation/Utility.cs | 223 ----- .../RJW_Menstruation/VariousDefOf.cs | 25 - .../RJW_Menstruation/App.config | 6 - .../RJW_Menstruation/Configurations.cs | 124 --- .../RJW Menstruation/RJW_Menstruation/Cum.cs | 141 ---- .../RJW_Menstruation/DNADef.cs | 27 - .../RJW_Menstruation/Dialog_WombStatus.cs | 204 ----- .../RJW_Menstruation/DrugOutcomDoers.cs | 21 - .../RJW_Menstruation/GetGizmos.cs | 104 --- .../RJW_Menstruation/Gizmo_Womb.cs | 45 - .../RJW_Menstruation/Harmony.cs | 27 - .../HediffComp_Menstruation.cs | 780 ------------------ .../RJW_Menstruation/RJW_Menstruation.csproj | 350 -------- .../RJW_Menstruation/RJW_Patch.cs | 88 -- .../RJW_Menstruation/Translations.cs | 60 -- .../RJW_Menstruation/Utility.cs | 223 ----- .../RJW_Menstruation/VariousDefOf.cs | 25 - source/RJW_Menstruation3/RJW_Menstruation.sln | 25 - .../RJW_Menstruation/App.config | 6 - .../RJW_Menstruation/Configurations.cs | 124 --- .../RJW_Menstruation3/RJW_Menstruation/Cum.cs | 141 ---- .../RJW_Menstruation/DNADef.cs | 27 - .../RJW_Menstruation/Dialog_WombStatus.cs | 204 ----- .../RJW_Menstruation/DrugOutcomDoers.cs | 21 - .../RJW_Menstruation/GetGizmos.cs | 104 --- .../RJW_Menstruation/Gizmo_Womb.cs | 45 - .../RJW_Menstruation/Harmony.cs | 27 - .../HediffComp_Menstruation.cs | 780 ------------------ .../RJW_Menstruation/RJW_Menstruation.csproj | 350 -------- .../RJW_Menstruation/RJW_Patch.cs | 88 -- .../RJW_Menstruation/Translations.cs | 60 -- .../RJW_Menstruation/Utility.cs | 223 ----- .../RJW_Menstruation/VariousDefOf.cs | 25 - 47 files changed, 6725 deletions(-) delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation.sln delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs delete mode 100644 source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/App.config delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Configurations.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Cum.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/DNADef.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Harmony.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj delete mode 100644 source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Translations.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/Utility.cs delete mode 100644 source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation.sln delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/App.config delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Cum.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Translations.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/Utility.cs delete mode 100644 source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation.sln b/source - 복사본/RJW_Menstruation/RJW_Menstruation.sln deleted file mode 100644 index 99c2de2..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation.sln +++ /dev/null @@ -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 diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config b/source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs deleted file mode 100644 index c765e78..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ /dev/null @@ -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(); - - } - - 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(); - - - } - - - } - - - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs deleted file mode 100644 index 3fbb33f..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Cum.cs +++ /dev/null @@ -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.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); - - } - } - - - - - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs deleted file mode 100644 index 5f19368..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/DNADef.cs +++ /dev/null @@ -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; - - } - - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs deleted file mode 100644 index 6ed4294..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs +++ /dev/null @@ -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.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.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); - - } - - - - - } -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs deleted file mode 100644 index 5f5e314..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs +++ /dev/null @@ -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; - } - } - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs deleted file mode 100644 index cc884c7..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/GetGizmos.cs +++ /dev/null @@ -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 __result, Pawn __instance) - { - List 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 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(); - 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.Get(("Womb/Empty"), true); - } - else icon_overay = ContentFinder.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; - } - } - - - - - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs deleted file mode 100644 index e91f20f..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Gizmo_Womb.cs +++ /dev/null @@ -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; - } - - - - - } -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs deleted file mode 100644 index 6e3171c..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Harmony.cs +++ /dev/null @@ -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()); - } - } - - - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs deleted file mode 100644 index 4737ac4..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs +++ /dev/null @@ -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 cums; - private bool loaded = false; - private List 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 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(); - if (eggs == null) eggs = new List(); - 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 removecums = new List(); - 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 removecums = new List(); - 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 removecums = new List(); - 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 deadeggs = new List(); - 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 deadeggs = new List(); - 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); - } - } - - - } -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj deleted file mode 100644 index 22b1d26..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj +++ /dev/null @@ -1,350 +0,0 @@ - - - - - Debug - AnyCPU - {EED2F3B9-8C20-4194-919E-8D151B29F70B} - Library - RJW_Menstruation - RJW_Menstruation - v4.7.2 - 512 - true - true - 게시\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - ..\..\..\Assemblies\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - False - - - ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll - False - - - ..\..\..\..\RJW\1.1\Assemblies\RJW.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll - False - - - - - False - Microsoft .NET Framework 4.7.2%28x86 및 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs deleted file mode 100644 index 894f3ae..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/RJW_Patch.cs +++ /dev/null @@ -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; - } - } - - - - - - - - - -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs deleted file mode 100644 index 6e524ba..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Translations.cs +++ /dev/null @@ -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(); - - - - } -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs deleted file mode 100644 index 3723868..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ /dev/null @@ -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(); - 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(); - 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(); - 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(); - - 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(); - 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(); - 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.Get(("Womb/Mechanoid_Fluid"), true); - } - else if (hediff is Hediff_BasePregnancy) - { - Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; - string fetustex = DefDatabase.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.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.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.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.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.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; - } - - - - - } -} diff --git a/source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs deleted file mode 100644 index e84a4da..0000000 --- a/source - 복사본/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ /dev/null @@ -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.GetNamed("FilthCum"); - public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); - - } -} diff --git a/source/RJW Menstruation/RJW_Menstruation/App.config b/source/RJW Menstruation/RJW_Menstruation/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/source/RJW Menstruation/RJW_Menstruation/Configurations.cs b/source/RJW Menstruation/RJW_Menstruation/Configurations.cs deleted file mode 100644 index c765e78..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Configurations.cs +++ /dev/null @@ -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(); - - } - - 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(); - - - } - - - } - - - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/Cum.cs b/source/RJW Menstruation/RJW_Menstruation/Cum.cs deleted file mode 100644 index 3fbb33f..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Cum.cs +++ /dev/null @@ -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.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); - - } - } - - - - - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/DNADef.cs b/source/RJW Menstruation/RJW_Menstruation/DNADef.cs deleted file mode 100644 index 5f19368..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/DNADef.cs +++ /dev/null @@ -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; - - } - - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs b/source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs deleted file mode 100644 index 6ed4294..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Dialog_WombStatus.cs +++ /dev/null @@ -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.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.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); - - } - - - - - } -} diff --git a/source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs b/source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs deleted file mode 100644 index 5f5e314..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/DrugOutcomDoers.cs +++ /dev/null @@ -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; - } - } - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs b/source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs deleted file mode 100644 index cc884c7..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/GetGizmos.cs +++ /dev/null @@ -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 __result, Pawn __instance) - { - List 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 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(); - 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.Get(("Womb/Empty"), true); - } - else icon_overay = ContentFinder.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; - } - } - - - - - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs b/source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs deleted file mode 100644 index e91f20f..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Gizmo_Womb.cs +++ /dev/null @@ -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; - } - - - - - } -} diff --git a/source/RJW Menstruation/RJW_Menstruation/Harmony.cs b/source/RJW Menstruation/RJW_Menstruation/Harmony.cs deleted file mode 100644 index 6e3171c..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Harmony.cs +++ /dev/null @@ -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()); - } - } - - - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs deleted file mode 100644 index 4737ac4..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs +++ /dev/null @@ -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 cums; - private bool loaded = false; - private List 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 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(); - if (eggs == null) eggs = new List(); - 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 removecums = new List(); - 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 removecums = new List(); - 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 removecums = new List(); - 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 deadeggs = new List(); - 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 deadeggs = new List(); - 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); - } - } - - - } -} diff --git a/source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj deleted file mode 100644 index 22b1d26..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/RJW_Menstruation.csproj +++ /dev/null @@ -1,350 +0,0 @@ - - - - - Debug - AnyCPU - {EED2F3B9-8C20-4194-919E-8D151B29F70B} - Library - RJW_Menstruation - RJW_Menstruation - v4.7.2 - 512 - true - true - 게시\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - ..\..\..\Assemblies\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - False - - - ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll - False - - - ..\..\..\..\RJW\1.1\Assemblies\RJW.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll - False - - - - - False - Microsoft .NET Framework 4.7.2%28x86 및 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file diff --git a/source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs b/source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs deleted file mode 100644 index 894f3ae..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/RJW_Patch.cs +++ /dev/null @@ -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; - } - } - - - - - - - - - -} diff --git a/source/RJW Menstruation/RJW_Menstruation/Translations.cs b/source/RJW Menstruation/RJW_Menstruation/Translations.cs deleted file mode 100644 index 6e524ba..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Translations.cs +++ /dev/null @@ -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(); - - - - } -} diff --git a/source/RJW Menstruation/RJW_Menstruation/Utility.cs b/source/RJW Menstruation/RJW_Menstruation/Utility.cs deleted file mode 100644 index 3723868..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/Utility.cs +++ /dev/null @@ -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(); - 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(); - 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(); - 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(); - - 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(); - 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(); - 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.Get(("Womb/Mechanoid_Fluid"), true); - } - else if (hediff is Hediff_BasePregnancy) - { - Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; - string fetustex = DefDatabase.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.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.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.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.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.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; - } - - - - - } -} diff --git a/source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs b/source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs deleted file mode 100644 index e84a4da..0000000 --- a/source/RJW Menstruation/RJW_Menstruation/VariousDefOf.cs +++ /dev/null @@ -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.GetNamed("FilthCum"); - public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); - - } -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation.sln b/source/RJW_Menstruation3/RJW_Menstruation.sln deleted file mode 100644 index 5f8b9e6..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation.sln +++ /dev/null @@ -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 diff --git a/source/RJW_Menstruation3/RJW_Menstruation/App.config b/source/RJW_Menstruation3/RJW_Menstruation/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs b/source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs deleted file mode 100644 index c765e78..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Configurations.cs +++ /dev/null @@ -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(); - - } - - 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(); - - - } - - - } - - - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Cum.cs b/source/RJW_Menstruation3/RJW_Menstruation/Cum.cs deleted file mode 100644 index 3fbb33f..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Cum.cs +++ /dev/null @@ -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.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); - - } - } - - - - - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs b/source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs deleted file mode 100644 index 5f19368..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/DNADef.cs +++ /dev/null @@ -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; - - } - - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs b/source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs deleted file mode 100644 index 6ed4294..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Dialog_WombStatus.cs +++ /dev/null @@ -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.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.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); - - } - - - - - } -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs b/source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs deleted file mode 100644 index 5f5e314..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/DrugOutcomDoers.cs +++ /dev/null @@ -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; - } - } - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs b/source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs deleted file mode 100644 index cc884c7..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/GetGizmos.cs +++ /dev/null @@ -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 __result, Pawn __instance) - { - List 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 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(); - 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.Get(("Womb/Empty"), true); - } - else icon_overay = ContentFinder.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; - } - } - - - - - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs b/source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs deleted file mode 100644 index e91f20f..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Gizmo_Womb.cs +++ /dev/null @@ -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; - } - - - - - } -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs b/source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs deleted file mode 100644 index 6e3171c..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Harmony.cs +++ /dev/null @@ -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()); - } - } - - - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs deleted file mode 100644 index 4737ac4..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/HediffComp_Menstruation.cs +++ /dev/null @@ -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 cums; - private bool loaded = false; - private List 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 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(); - if (eggs == null) eggs = new List(); - 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 removecums = new List(); - 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 removecums = new List(); - 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 removecums = new List(); - 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 deadeggs = new List(); - 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 deadeggs = new List(); - 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); - } - } - - - } -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj b/source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj deleted file mode 100644 index 22b1d26..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/RJW_Menstruation.csproj +++ /dev/null @@ -1,350 +0,0 @@ - - - - - Debug - AnyCPU - {EED2F3B9-8C20-4194-919E-8D151B29F70B} - Library - RJW_Menstruation - RJW_Menstruation - v4.7.2 - 512 - true - true - 게시\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - ..\..\..\Assemblies\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - D:\잉어\Lib\Harmony.2.0.4.0\net472\0Harmony.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - False - - - ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll - False - - - ..\..\..\..\RJW\1.1\Assemblies\RJW.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\Unity.TextMeshPro.dll - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AccessibilityModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AndroidJNIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AnimationModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ARModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AssetBundleModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.AudioModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClothModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterInputModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ClusterRendererModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CrashReportingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DirectorModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.DSPGraphModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.FileSystemHttpModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GameCenterModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.GridModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.HotReloadModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ImageConversionModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputLegacyModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.InputModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.JSONSerializeModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.LocalizationModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ParticleSystemModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PerformanceReportingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.Physics2DModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.PhysicsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ProfilerModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.ScreenCaptureModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SharedInternalsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteMaskModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SpriteShapeModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.StreamingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.SubstanceModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextCoreModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TilemapModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TLSModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UI.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIElementsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UmbraModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UNETModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityConnectModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VehiclesModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VFXModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VideoModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.VRModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.WindModule.dll - False - - - ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.XRModule.dll - False - - - - - False - Microsoft .NET Framework 4.7.2%28x86 및 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file diff --git a/source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs b/source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs deleted file mode 100644 index 894f3ae..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/RJW_Patch.cs +++ /dev/null @@ -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; - } - } - - - - - - - - - -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Translations.cs b/source/RJW_Menstruation3/RJW_Menstruation/Translations.cs deleted file mode 100644 index 6e524ba..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Translations.cs +++ /dev/null @@ -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(); - - - - } -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation3/RJW_Menstruation/Utility.cs deleted file mode 100644 index 3723868..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/Utility.cs +++ /dev/null @@ -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(); - 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(); - 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(); - 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(); - - 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(); - 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(); - 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.Get(("Womb/Mechanoid_Fluid"), true); - } - else if (hediff is Hediff_BasePregnancy) - { - Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; - string fetustex = DefDatabase.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.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.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.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.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.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; - } - - - - - } -} diff --git a/source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs b/source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs deleted file mode 100644 index e84a4da..0000000 --- a/source/RJW_Menstruation3/RJW_Menstruation/VariousDefOf.cs +++ /dev/null @@ -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.GetNamed("FilthCum"); - public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); - - } -}