diff --git a/About/Manifest.xml b/About/Manifest.xml index 9ac72b8..cfb218b 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.0.5 + 1.0.0.6 diff --git a/Assemblies/RJW_Menstruation.dll b/Assemblies/RJW_Menstruation.dll index a8752b9..230f51d 100644 Binary files a/Assemblies/RJW_Menstruation.dll and b/Assemblies/RJW_Menstruation.dll differ diff --git a/Languages/English/Keyed/RJW_Menstruation.xml b/Languages/English/Keyed/RJW_Menstruation.xml index 701b244..54afe75 100644 --- a/Languages/English/Keyed/RJW_Menstruation.xml +++ b/Languages/English/Keyed/RJW_Menstruation.xml @@ -42,8 +42,12 @@ draw womb icon in status window vagina status draw vagina and anus icon in status window - - - + Fetus information level + Show all informations about fetus + Show all informations about fetus after noticed pregnancy + Do not show informations about fetus, but display image of fetus after noticed pregnancy + Do not show fetus image and informations + + \ No newline at end of file diff --git a/Languages/Korean/Keyed/RJW_Menstruation.xml b/Languages/Korean/Keyed/RJW_Menstruation.xml index 2b4a2ec..52ed322 100644 --- a/Languages/Korean/Keyed/RJW_Menstruation.xml +++ b/Languages/Korean/Keyed/RJW_Menstruation.xml @@ -42,8 +42,13 @@ 상태창에 자궁그림을 표시합니다. 보지 그림 상태창에 보지와 항문그림을 표시합니다. - - + 태아 정보 + 태아에 대한 모든 정보를 표시합니다. + 임신을 발견한 이후에 태아에 대한 모든 정보를 표시합니다. + 태아에 대한 정보를 표시하지 않지만, 임신한 이후 태아이미지를 표시합니다. + 태아에 대한 어떠한 정보도 표시하지 않습니다. + + \ No newline at end of file diff --git a/changelogs.txt b/changelogs.txt index 369bce4..6eae988 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,7 @@ +Version 1.0.0.6 + - if pawn is fertility stat is 0, stage is fixed at none. + - added option for fetus information level. + - depend on information level, pregnant stage display as luteal stage Version 1.0.0.5 - womb cum capacity is affected by pawn's bodysize - changed cum volume calculate method. @@ -7,22 +11,18 @@ Version 1.0.0.5 - cum textures are dependent on womb texture Version 1.0.0.4 - - fixed errors when runtimeGC removed pawns in cum list. - added menstrual cramp - now pawns will get mood debuff during in period - merged some stages into one stage Version 1.0.0.3 - - fixed sometimes hediffcomp stops working. - changed initializing method - added patches for generic vagina and dragon vagina Version 1.0.0.2 - - add options for turn on/off vagina/womb image in status window Version 1.0.0.1 - - supports for other type of vagina - custom images support for vagina&anus diff --git a/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs index 52cdab6..cc36bbb 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -20,6 +20,7 @@ namespace RJW_Menstruation 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; @@ -34,6 +35,36 @@ namespace RJW_Menstruation public static bool DrawWombStatus = true; public static bool DrawVaginaStatus = true; public static bool Debug = false; + public static DetailLevel InfoDetail = DetailLevel.All; + + + public enum DetailLevel + { + All, + OnReveal, + HideFetusInfo, + Hide + } + + public static string LevelString(DetailLevel level) + { + switch (level) + { + case DetailLevel.All: + return "All"; + case DetailLevel.OnReveal: + return "On reveal"; + case DetailLevel.HideFetusInfo: + return "Hide fetus info"; + case DetailLevel.Hide: + return "Hide"; + default: + return ""; + + } + + + } public override void ExposeData() { @@ -50,6 +81,7 @@ namespace RJW_Menstruation Scribe_Values.Look(ref DrawWombStatus, "DrawWombStatus", DrawWombStatus, true); Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", DrawVaginaStatus, true); Scribe_Values.Look(ref Debug, "Debug", Debug, true); + Scribe_Values.Look(ref InfoDetail, "InfoDetail", InfoDetail, true); base.ExposeData(); } @@ -81,9 +113,29 @@ namespace RJW_Menstruation listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); if (Configurations.EnableWombIcon) { - Listing_Standard wombsection = listmain.BeginSection_NewTemp(50); + Listing_Standard wombsection = listmain.BeginSection_NewTemp(111); wombsection.CheckboxLabeled(Translations.Option9_Label, ref Configurations.DrawWombStatus, Translations.Option9_Desc); wombsection.CheckboxLabeled(Translations.Option10_Label, ref Configurations.DrawVaginaStatus, Translations.Option10_Desc); + if (wombsection.ButtonText(Translations.Option11_Label + ": " + Configurations.LevelString(Configurations.InfoDetail))) + { + if (Configurations.InfoDetail == Configurations.DetailLevel.Hide) Configurations.InfoDetail = Configurations.DetailLevel.All; + else Configurations.InfoDetail++; + } + switch (Configurations.InfoDetail) + { + case Configurations.DetailLevel.All: + wombsection.Label(Translations.Option11_Desc_1); + break; + case Configurations.DetailLevel.OnReveal: + wombsection.Label(Translations.Option11_Desc_2); + break; + case Configurations.DetailLevel.HideFetusInfo: + wombsection.Label(Translations.Option11_Desc_3); + break; + case Configurations.DetailLevel.Hide: + wombsection.Label(Translations.Option11_Desc_4); + break; + } listmain.EndSection(wombsection); } diff --git a/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs b/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs index f4fb223..c60f947 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Dialog_WombStatus.cs @@ -36,6 +36,9 @@ namespace RJW_Menstruation private GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea); private GUIStyle buttonstyle = new GUIStyle(GUI.skin.button); + + + public override Vector2 InitialSize { get @@ -95,7 +98,7 @@ namespace RJW_Menstruation float preginfoheight = 0f; Hediff hediff = PregnancyHelper.GetPregnancy(pawn); - if (pawn.IsPregnant()) + if (pawn.IsPregnant() && Utility.ShowFetusImage((Hediff_BasePregnancy)hediff)) { womb = Utility.GetPregnancyIcon(comp, hediff); if (hediff is Hediff_BasePregnancy) @@ -104,10 +107,10 @@ namespace RJW_Menstruation 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) + if (fetus != null && Utility.ShowFetusInfo()) { + preginfoheight = fontheight; + Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); fontstyleright.normal.textColor = Color.white; buttonstyle.alignment = TextAnchor.MiddleLeft; GUI.Box(preginfo, h.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); diff --git a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs index 771fbc7..f12e64d 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs @@ -67,10 +67,11 @@ namespace RJW_Menstruation Ovulatory, Luteal, Bleeding, - Fertilized, + Fertilized, //Obsoleted Pregnant, Recover, - None + None, + Young } private List cums; @@ -207,10 +208,12 @@ namespace RJW_Menstruation case Stage.Fertilized: return Translations.Stage_Fertilized; case Stage.Pregnant: - return Translations.Stage_Pregnant; + if (Configurations.InfoDetail == Configurations.DetailLevel.All || (PregnancyHelper.GetPregnancy(parent.pawn)?.Visible ?? false)) return Translations.Stage_Pregnant; + else return Translations.Stage_Luteal; case Stage.Recover: return Translations.Stage_Recover; case Stage.None: + case Stage.Young: return Translations.Stage_None; default: return ""; @@ -298,7 +301,11 @@ namespace RJW_Menstruation - + /// + /// Get fluid in womb that not a cum + /// + /// + /// public Cum GetNotCum(string notcumlabel) { if (!cums.NullOrEmpty()) foreach (Cum cum in cums) @@ -308,6 +315,11 @@ namespace RJW_Menstruation return null; } + /// + /// Get pawn's cum in womb + /// + /// + /// public Cum GetCum(Pawn pawn) { if (!cums.NullOrEmpty()) foreach (Cum cum in cums) @@ -317,7 +329,13 @@ namespace RJW_Menstruation return null; } - + /// + /// Inject pawn's cum into womb + /// + /// + /// + /// + /// public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null) { float volume = injectedvolume * CumInFactor; @@ -358,6 +376,14 @@ namespace RJW_Menstruation } } + /// + /// Inject pawn's fluid into womb + /// + /// + /// + /// + /// + /// public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null) { float tmp = TotalCum + volume; @@ -399,7 +425,9 @@ namespace RJW_Menstruation } } - + /// + /// Excrete cums in womb naturally + /// public void CumOut() { if (cums.NullOrEmpty()) return; @@ -420,6 +448,12 @@ namespace RJW_Menstruation removecums.Clear(); } + /// + /// Excrete cums in womb and get excreted amount of specific cum + /// + /// + /// + /// public float CumOut(Cum targetcum, float portion = 0.1f) { if (cums.NullOrEmpty()) return 0; @@ -443,7 +477,12 @@ namespace RJW_Menstruation return outcum; } - //ignores cum.decayresist + /// + /// Ignores cum's decayratio and get excreted amount of specific cum + /// + /// + /// + /// public float CumOutForce(Cum targetcum, float portion = 0.1f) { if (cums.NullOrEmpty()) return 0; @@ -467,7 +506,10 @@ namespace RJW_Menstruation return outcum; } - + /// + /// Fertilize eggs and return the result + /// + /// public bool FertilizationCheck() { if (!eggs.NullOrEmpty()) @@ -505,11 +547,19 @@ namespace RJW_Menstruation if (cums == null) cums = new List(); if (eggs == null) eggs = new List(); if (parent.pawn.IsPregnant()) curStage = Stage.Pregnant; - if (Configurations.EnableAnimalCycle) + if (parent.pawn.IsAnimal()) { - HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + if (Configurations.EnableAnimalCycle) + { + HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false); + } + } + else + { + + if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Young), tickInterval, parent.pawn, false); + else 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); } else { @@ -521,6 +571,7 @@ namespace RJW_Menstruation loaded = true; } + private Pawn Fertilize() { if (cums.NullOrEmpty()) return null; @@ -535,7 +586,6 @@ namespace RJW_Menstruation return null; } - //for now, only one egg can be implanted private bool Implant() { @@ -630,7 +680,7 @@ namespace RJW_Menstruation case Stage.Ovulatory: action = delegate { - eggs.Add(new Egg(Props.eggLifespanDays * 24)); + eggs.Add(new Egg((int)(Props.eggLifespanDays * 24 / CycleFactor))); lutealIntervalhours = PeriodRandomizer(lutealIntervalhours, Props.deviationFactor); GoNextStage(Stage.Luteal); }; @@ -742,6 +792,13 @@ namespace RJW_Menstruation StayCurrentStageConst(Stage.None); }; break; + case Stage.Young: + action = delegate + { + if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) StayCurrentStageConst(Stage.Young); + else GoNextStage(Stage.Follicular); + }; + break; default: curStage = Stage.Follicular; curStageHrs = 0; @@ -751,6 +808,7 @@ namespace RJW_Menstruation } action += () => { + if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; CumOut(); }; @@ -771,11 +829,13 @@ namespace RJW_Menstruation HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); } + //stage can be interrupted in other reasons void StayCurrentStage(float factor = 1.0f) { HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false); } + //stage never changes void StayCurrentStageConst(Stage curstage, float factor = 1.0f) { HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false); diff --git a/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs b/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs index bd8c18b..5fbe0a9 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs @@ -60,14 +60,22 @@ namespace RJW_Menstruation if (pawn.IsPregnant()) { Hediff hediff = PregnancyHelper.GetPregnancy(pawn); - icon = Utility.GetPregnancyIcon(comp,hediff); - if (hediff is Hediff_BasePregnancy) + if (Utility.ShowFetusImage((Hediff_BasePregnancy)hediff)) { - Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; - if (h.GestationProgress < 0.2f) icon_overay = Utility.GetCumIcon(comp); + icon = Utility.GetPregnancyIcon(comp, hediff); + if (hediff is Hediff_BasePregnancy && Utility.ShowFetusImage((Hediff_BasePregnancy)hediff)) + { + 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_overay = ContentFinder.Get(("Womb/Empty"), true); + else + { + icon = Utility.GetWombIcon(comp); + icon_overay = Utility.GetCumIcon(comp); + } } else { diff --git a/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/source/RJW_Menstruation/RJW_Menstruation/Translations.cs index c6ace03..f108354 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Translations.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -49,7 +49,10 @@ namespace RJW_Menstruation 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 Option11_Desc_1 = "Option11_Desc_1".Translate(); + public static readonly string Option11_Desc_2 = "Option11_Desc_2".Translate(); + public static readonly string Option11_Desc_3 = "Option11_Desc_3".Translate(); + public static readonly string Option11_Desc_4 = "Option11_Desc_4".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(); diff --git a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 41154ec..ce81a77 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -64,7 +64,6 @@ namespace RJW_Menstruation return false; } - public static HediffComp_Menstruation.Stage GetCurStage(Pawn pawn) { return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding; @@ -226,7 +225,19 @@ namespace RJW_Menstruation return hediff.LabelBase + "\n(" + hediff.LabelInBrackets + ")"; } + public static bool ShowFetusImage(Hediff_BasePregnancy hediff) + { + if (Configurations.InfoDetail == Configurations.DetailLevel.All) return true; + else if (Configurations.InfoDetail == Configurations.DetailLevel.Hide) return false; + else if (hediff.Visible) return true; + else return false; + } + public static bool ShowFetusInfo() + { + if (Configurations.InfoDetail == Configurations.DetailLevel.All || Configurations.InfoDetail == Configurations.DetailLevel.OnReveal) return true; + else return false; + } }