diff --git a/About/Manifest.xml b/About/Manifest.xml index 3f57084..2b37343 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.1.1 + 1.0.1.2 diff --git a/Assemblies/RJW_Menstruation.dll b/Assemblies/RJW_Menstruation.dll index df68f49..e176b9c 100644 Binary files a/Assemblies/RJW_Menstruation.dll and b/Assemblies/RJW_Menstruation.dll differ diff --git a/Defs/HediffDef/Hediffs_Menstruation.xml b/Defs/HediffDef/Hediffs_Menstruation.xml index 9fc150c..b758bc8 100644 --- a/Defs/HediffDef/Hediffs_Menstruation.xml +++ b/Defs/HediffDef/Hediffs_Menstruation.xml @@ -21,7 +21,7 @@
  • - 0.90 + 0.50 0.95 0.05 @@ -30,8 +30,8 @@ 0.2 - 0.70 - 0.90 + 0.40 + 0.95 0.1
  • @@ -39,8 +39,8 @@ 0.4 - 0.50 - 0.70 + 0.20 + 0.95 0.2 @@ -49,7 +49,7 @@ 0.0 - 0.50 + 0.95 0.4 @@ -81,8 +81,8 @@
  • - 0.20 - 0.25 + 0.01 + 0.50
  • @@ -117,7 +117,7 @@
  • - 0.75 + 0.50 0.8 @@ -131,8 +131,8 @@ 0.2 - 0.50 - 0.6 + 0.25 + 0.7
  • @@ -145,8 +145,8 @@ 0.4 - 0.40 - 0.4 + 0.10 + 0.6
  • @@ -159,8 +159,8 @@ 0.6 - 0.25 - 0.25 + 0.05 + 0.5
  • diff --git a/Defs/JobDefs/Jobs_CleanSelf.xml b/Defs/JobDefs/Jobs_CleanSelf.xml new file mode 100644 index 0000000..cbd6794 --- /dev/null +++ b/Defs/JobDefs/Jobs_CleanSelf.xml @@ -0,0 +1,10 @@ + + + + + VaginaWashing + RJW_Menstruation.JobDriver_VaginaWashing + wasing vagina + true + + \ No newline at end of file diff --git a/Defs/ThingDefs/Apparel_Absorbers.xml b/Defs/ThingDefs/Apparel_Absorbers.xml index 89b1ac0..8378937 100644 --- a/Defs/ThingDefs/Apparel_Absorbers.xml +++ b/Defs/ThingDefs/Apparel_Absorbers.xml @@ -74,7 +74,7 @@ An wet used tampon RJW_Menstruation.Absorber_Tampon - Things/Item/Tampon_Dirty + Things/Item/Tampon Graphic_Single Never @@ -133,7 +133,7 @@ Never false - 20 + 40 0.02 1000 1.0 @@ -192,13 +192,13 @@ An wet used pad RJW_Menstruation.Absorber - Things/Item/Pad_Dirty + Things/Item/Pad Graphic_Single Never false - 20 + 40 0.10 0 1000 diff --git a/Languages/English/Keyed/RJW_Menstruation.xml b/Languages/English/Keyed/RJW_Menstruation.xml index 52c29f9..6eaec1e 100644 --- a/Languages/English/Keyed/RJW_Menstruation.xml +++ b/Languages/English/Keyed/RJW_Menstruation.xml @@ -61,4 +61,6 @@ max enzygotic twins set max number of twins + Vaginal washing + \ No newline at end of file diff --git a/Languages/Korean/DefInjected/JobDef/RJWMenstruation.xml b/Languages/Korean/DefInjected/JobDef/RJWMenstruation.xml new file mode 100644 index 0000000..67ae283 --- /dev/null +++ b/Languages/Korean/DefInjected/JobDef/RJWMenstruation.xml @@ -0,0 +1,7 @@ + + + 질세척 하는중 + + + + \ No newline at end of file diff --git a/Languages/Korean/Keyed/RJW_Menstruation.xml b/Languages/Korean/Keyed/RJW_Menstruation.xml index 19a655a..0ffe4c9 100644 --- a/Languages/Korean/Keyed/RJW_Menstruation.xml +++ b/Languages/Korean/Keyed/RJW_Menstruation.xml @@ -61,5 +61,6 @@ 최대 일란성 쌍둥이 수 일란성 쌍둥이의 수를 제한합니다. + 질세척 \ No newline at end of file diff --git a/Textures/Things/Item/Pad_Dirty.png b/Textures/Things/Item/Pad_Dirty.png deleted file mode 100644 index 1fa5083..0000000 Binary files a/Textures/Things/Item/Pad_Dirty.png and /dev/null differ diff --git a/Textures/Things/Item/Tampon_Dirty.png b/Textures/Things/Item/Tampon_Dirty.png deleted file mode 100644 index 7b39d93..0000000 Binary files a/Textures/Things/Item/Tampon_Dirty.png and /dev/null differ diff --git a/changelogs.txt b/changelogs.txt index 555e3a5..4117b79 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,9 +1,15 @@ +Version 1.0.1.2 + - reduced sex satisfaction debuffs + - if pawn is climacteric or menopause sex need recover to 50%. + - added vaginal washing + - fixed bugs absorber does not work properly + - used absorbers are colored fluid's color Version 1.0.1.1 - requires RJW 4.6.1 or later - added superovulation inducing agent - cumflations (no effects yet) - added tampon and sanitary pad can absorb fluids. - - tampon blocks fluids completly. however, keep wearing dirty tampon can cause infection. + - tampon blocks fluids completely. however, keep wearing dirty tampon can cause infection. - pad blocks fluids for a while, but if exceed over the absorbable, fluids leak again. - fixed erros when male pawn take hyperfertility pills. diff --git a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs index 9f5aee5..7e92489 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs @@ -89,6 +89,8 @@ namespace RJW_Menstruation private int bleedingIntervalhours = -1; private int recoveryIntervalhours = -1; private float crampPain= -1; + private Need sexNeed = null; + private string customwombtex = null; public float TotalCum { @@ -236,6 +238,19 @@ namespace RJW_Menstruation } + public string wombTex + { + get + { + if (customwombtex == null) return Props.wombTex; + else return customwombtex; + } + set + { + customwombtex = value; + } + } + public string GetFertilizingInfo { get @@ -555,7 +570,7 @@ namespace RJW_Menstruation /// /// /// - public float CumOutForce(Cum targetcum, float portion = 0.1f) + public float CumOutForce(Cum targetcum = null, float portion = 0.1f) { if (cums.NullOrEmpty()) return 0; float outcum = 0; @@ -674,6 +689,19 @@ namespace RJW_Menstruation loaded = true; } + public void AfterSimulator() + { + if (ovarypower < ovarypowerthreshold) + { + if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed); + else + { + if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.02f; + } + } + + } + private Pawn Fertilize() { @@ -765,7 +793,7 @@ namespace RJW_Menstruation private void BleedOut() { //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); - CumIn(parent.pawn, Rand.Range(0f, 5f), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood); + CumIn(parent.pawn, Rand.Range(1f, 2f), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood); GetNotCum(Translations.Menstrual_Blood).color = Colors.blood; } @@ -777,9 +805,11 @@ namespace RJW_Menstruation if (!absorber.dirty) { absorber.absorbedfluids += amount; - if (absorber.absorbedfluids < 10) + if (absorber.absorbedfluids > absorber.GetStatValue(VariousDefOf.MaxAbsorbable)) { absorber.def = absorber.DirtyDef; + //absorber.fluidColor = GetCumMixtureColor; + absorber.SetColor(GetCumMixtureColor); absorber.dirty = true; } } @@ -814,7 +844,7 @@ namespace RJW_Menstruation } - private Action PeriodSimulator(Enum targetstage) + private Action PeriodSimulator(Stage targetstage) { Action action = null; switch (targetstage) @@ -930,22 +960,24 @@ namespace RJW_Menstruation case Stage.Fertilized: //Obsoleted stage. merged in luteal stage action = delegate { - if (curStageHrs >= 24) - { - if (Implant()) - { - GoNextStage(Stage.Pregnant); - } - else - { - GoNextStageSetHour(Stage.Luteal, 96); - } - } - else - { - curStageHrs+=Configurations.CycleAcceleration; - StayCurrentStage(); - } + ModLog.Message("Obsoleted stage. skipping..."); + GoNextStage(Stage.Luteal); + //if (curStageHrs >= 24) + //{ + // if (Implant()) + // { + // GoNextStage(Stage.Pregnant); + // } + // else + // { + // GoNextStageSetHour(Stage.Luteal, 96); + // } + //} + //else + //{ + // curStageHrs+=Configurations.CycleAcceleration; + // StayCurrentStage(); + //} }; break; case Stage.Pregnant: @@ -1095,6 +1127,7 @@ namespace RJW_Menstruation { if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; CumOut(); + AfterSimulator(); }; actionref = action; @@ -1107,6 +1140,7 @@ namespace RJW_Menstruation HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); } + void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f) { curStageHrs = hour; diff --git a/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs b/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs new file mode 100644 index 0000000..c2781c4 --- /dev/null +++ b/source/RJW_Menstruation/RJW_Menstruation/JobDrivers.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using Verse.AI; + +namespace RJW_Menstruation +{ + public class JobDriver_VaginaWashing : JobDriver + { + const int excretingTime = 300;//ticks - 120 = 2 real seconds, 3 in-game minutes + + public override bool TryMakePreToilReservations(bool errorOnFailed) + { + return pawn.Reserve(pawn, job, 1, -1, null, errorOnFailed); + } + + protected override IEnumerable MakeNewToils() + { + + HediffComp_Menstruation Comp = Utility.GetMenstruationComp(pawn); + this.FailOn(delegate + { + return !(Comp.TotalCumPercent > 0.01); + }); + Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of + + excreting.WithProgressBarToilDelay(TargetIndex.A); + yield return excreting; + yield return new Toil() + { + initAction = delegate () + { + Comp.CumOutForce(null, 0.5f); + if (Comp.TotalCumPercent > 0.01) this.JumpToToil(excreting); + } + }; + //yield return excreting; + + } + } +} diff --git a/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs b/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs index 54e0e43..94812dd 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using UnityEngine; using RimWorld; using Verse; using HarmonyLib; using HugsLib; - +using rjw; namespace RJW_Menstruation { @@ -25,8 +26,47 @@ namespace RJW_Menstruation comp.Initialize(); } } + } + + [HarmonyPatch(typeof(FloatMenuMakerMap), "AddHumanlikeOrders")] + public class HumanlikeOrder_Patch + { + public static void Postfix(Vector3 clickPos, Pawn pawn, List opts) + { + var selftargets = GenUI.TargetsAt_NewTemp(clickPos, TargetingParameters.ForSelf(pawn)); + + foreach (LocalTargetInfo t in selftargets) + { + opts.AddDistinct(MakeSelfMenu(pawn, t)); + } + + + + + } + + public static FloatMenuOption MakeSelfMenu(Pawn pawn, LocalTargetInfo target) + { + FloatMenuOption option = null; + if (Utility.HasMenstruationComp(pawn)) + { + option = FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(Translations.FloatMenu_CleanSelf, delegate () + { + pawn.jobs.TryTakeOrderedJob_NewTemp(new Verse.AI.Job(VariousDefOf.VaginaWashing, null, null, target.Cell)); + }, MenuOptionPriority.Low), pawn, target); + } + + + return option; + } } + + + + + + } diff --git a/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj index 6b40912..c9fb7b2 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj +++ b/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -61,6 +61,7 @@ + diff --git a/source/RJW_Menstruation/RJW_Menstruation/Things.cs b/source/RJW_Menstruation/RJW_Menstruation/Things.cs index bfb4e45..c17a413 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Things.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Things.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using RimWorld; using Verse; using rjw; +using UnityEngine; namespace RJW_Menstruation { @@ -29,7 +30,9 @@ namespace RJW_Menstruation public virtual ThingDef DirtyDef => def.GetModExtension().dirtyDef; public virtual int MinHrstoDirtyEffect => def.GetModExtension().minHourstoDirtyEffect; + public Color fluidColor = Color.white; + public virtual void DirtyEffect() {} @@ -38,12 +41,15 @@ namespace RJW_Menstruation wearhours++; } + public override Color DrawColorTwo => fluidColor; + public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref absorbedfluids, "absorbedfluids", absorbedfluids, true); Scribe_Values.Look(ref dirty, "dirty", dirty, true); Scribe_Values.Look(ref wearhours, "wearhours", wearhours, true); + Scribe_Values.Look(ref fluidColor, "fluidColor", fluidColor, true); } } diff --git a/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/source/RJW_Menstruation/RJW_Menstruation/Translations.cs index 89b5e84..616c63a 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Translations.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -67,7 +67,7 @@ namespace RJW_Menstruation public static readonly string Option17_Label = "Option17_Label".Translate(); public static readonly string Option17_Desc = "Option17_Desc".Translate(); - + public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate(); } } diff --git a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index ba248ee..c7204ff 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -122,7 +122,7 @@ namespace RJW_Menstruation { 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"; + if (h.GestationProgress < 0.2f) icon = comp.wombTex + "_Implanted"; else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; @@ -137,7 +137,7 @@ namespace RJW_Menstruation public static Texture2D GetCumIcon(HediffComp_Menstruation comp) { - string icon = comp.Props.wombTex; + string icon = comp.wombTex; float cumpercent = comp.TotalCumPercent; if (cumpercent < 0.001f) icon = "Womb/Empty"; else if (cumpercent < 0.01f) icon += "_Cum_00"; @@ -164,7 +164,7 @@ namespace RJW_Menstruation public static Texture2D GetWombIcon(HediffComp_Menstruation comp) { - string icon = comp.Props.wombTex; + string icon = comp.wombTex; HediffComp_Menstruation.Stage stage = comp.curStage; if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding"; diff --git a/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs index 9c1c469..d9f234a 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -29,8 +29,8 @@ namespace RJW_Menstruation public static readonly StatDef MaxAbsorbable = DefDatabase.GetNamed("MaxAbsorbable"); public static readonly PawnRelationDef Relation_birthgiver = DefDatabase.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire"); public static readonly PawnRelationDef Relation_spawn = DefDatabase.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup"); - - + public static readonly NeedDef SexNeed = DefDatabase.GetNamed("Sex"); + public static readonly JobDef VaginaWashing = DefDatabase.GetNamed("VaginaWashing"); } }