diff --git a/About/Manifest.xml b/About/Manifest.xml index fd88c01..eec7f8f 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.1.8 + 1.0.1.9 diff --git a/Assemblies/RJW_Menstruation.dll b/Assemblies/RJW_Menstruation.dll index 90f8c98..02efc9e 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 b758bc8..eb9c0db 100644 --- a/Defs/HediffDef/Hediffs_Menstruation.xml +++ b/Defs/HediffDef/Hediffs_Menstruation.xml @@ -6,7 +6,6 @@ in period in period - {1} in period (0.70,0.00,0.00) true false @@ -67,12 +66,12 @@ menopause reached menopause - {1} reached menopause + {0} reached menopause (0.70,0.70,0.00) false false false - false + true 1 0.1 @@ -102,12 +101,11 @@ climacteric climacteric - {1} climacteric (0.70,0.70,0.00) false false false - true + false 1 0.1 @@ -175,5 +173,67 @@ + + HediffWithComps + Hediff_Estrus + + estrus + estrus + (1.00,0.60,0.75) + false + false + false + false + 10000 + 1.0 + + true + + +
  • + + 5.0 + 1.5 + +
  • +
    + +
  • + -1.0 +
  • +
    +
    + + + HediffWithComps + Hediff_Estrus_Consealed + + estrus + estrus + (1.00,0.60,0.75) + false + false + false + false + 10000 + 1.0 + + true + + +
  • + false + + 1.10 + 1.05 + +
  • +
    + +
  • + -1.0 +
  • +
    +
    \ No newline at end of file diff --git a/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml b/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml index 335c22f..33f0660 100644 --- a/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml +++ b/Languages/Korean/DefInjected/HediffDef/RJWMenstruation.xml @@ -14,6 +14,10 @@ 폐경 폐경 임신할수 없습니다. + 발정기 + 발정기입니다. + 발정기(숨김) + 발정기입니다. diff --git a/Patches/Hediffs_PrivateParts.xml b/Patches/Hediffs_PrivateParts.xml index 27acf24..ea20df0 100644 --- a/Patches/Hediffs_PrivateParts.xml +++ b/Patches/Hediffs_PrivateParts.xml @@ -20,11 +20,12 @@ 14 14 6 - 10 + 30 3 Womb/Womb Genitals/Vagina 420 + true @@ -62,8 +63,8 @@ 0.05 14 14 - 6 - 10 + 0 + 30 3 Womb/Womb Genitals/Vagina @@ -106,8 +107,8 @@
  • 10 - 1.0 - 1.0 + 2.0 + 2.0 0.05 14 14 @@ -116,6 +117,7 @@ 3 Womb/Womb Genitals/Vagina + true
  • diff --git a/changelogs.txt b/changelogs.txt index 21aa9aa..cbcb78b 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,11 @@ +Version 1.0.1.9 + - add estrus effects + - estrus increases pawn's sex drive greatly + - add consealedEstrus attribute to CompProperties_Menstruation + - if consealedEstrus set as true, the pawn will get less effective estrus + - hyperfertility pills induce esturs + - now initial ovarypower is affected by pawn's life expectancy and litter size + Version 1.0.1.8 - fixed problems with animal status window - fixed RMB menu crash diff --git a/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs b/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs index 4558277..80a4f64 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/DrugOutcomDoers.cs @@ -19,6 +19,7 @@ namespace RJW_Menstruation || comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal) )) { + comp.SetEstrus(comp.Props.eggLifespanDays); comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; comp.ovarypower--; } diff --git a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs index cf569d7..710c707 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/HediffComp_Menstruation.cs @@ -26,6 +26,7 @@ namespace RJW_Menstruation public string vagTex = "Genitals/Vagina"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday public bool infertile = false; public int ovaryPower = 600000000; // default: almost unlimited ovulation + public bool consealedEstrus = false; public CompProperties_Menstruation() { @@ -54,7 +55,7 @@ namespace RJW_Menstruation public class HediffComp_Menstruation : HediffComp { const float minmakefilthvalue = 1.0f; - const int ovarypowerthreshold = 72; + //const int ovarypowerthreshold = 72; public static readonly int tickInterval = 2500; // an hour public CompProperties_Menstruation Props; @@ -92,6 +93,25 @@ namespace RJW_Menstruation private Need sexNeed = null; private string customwombtex = null; private string customvagtex = null; + private bool estrusflag = false; + private int opcache = -1; + + public int ovarypowerthreshold + { + get + { + if (opcache < 0) opcache = (int)(72f * ThingDefOf.Human.race.lifeExpectancy / parent.pawn.def.race.lifeExpectancy); + return opcache; + } + } + + public int FollicularIntervalHours + { + get + { + return (int)((follicularIntervalhours - bleedingIntervalhours) * CycleFactor); + } + } public float TotalCum { @@ -383,6 +403,7 @@ namespace RJW_Menstruation Scribe_Values.Look(ref crampPain, "crampPain", crampPain, true); Scribe_Values.Look(ref ovarypower, "ovarypower", ovarypower, true); Scribe_Values.Look(ref eggstack, "eggstack", eggstack, true); + Scribe_Values.Look(ref estrusflag, "estrusflag", estrusflag, true); } @@ -863,19 +884,33 @@ namespace RJW_Menstruation } else if (ovarypower < -50000) { - ovarypower = (int)(Props.ovaryPower * Rand.Range(0.7f, 1.3f)) - (Math.Max(0, parent.pawn.ageTracker.AgeBiologicalYears - 15)) * (60 / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration); - if (ovarypower < 1) + if (Props.ovaryPower > 10000000) ovarypower = Props.ovaryPower; + else { - Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); - hediff.Severity = 0.2f; - parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); - curStage = Stage.Young; - } - else if (ovarypower < ovarypowerthreshold) - { - Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); - hediff.Severity = 0.008f * (ovarypowerthreshold - ovarypower); - parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); + float avglittersize; + try + { + avglittersize = Rand.ByCurveAverage(parent.pawn.def.race.litterSizeCurve); + } + catch (NullReferenceException) + { + avglittersize = 1; + } + ovarypower = (int)(((Props.ovaryPower * Rand.Range(0.7f, 1.3f) * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy) + - (Math.Max(0, parent.pawn.ageTracker.AgeBiologicalYears - 15)) * (60 / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration)) * avglittersize); + if (ovarypower < 1) + { + Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); + hediff.Severity = 0.2f; + parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); + curStage = Stage.Young; + } + else if (ovarypower < ovarypowerthreshold) + { + Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); + hediff.Severity = 0.008f * (ovarypowerthreshold - ovarypower); + parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); + } } } @@ -916,6 +951,25 @@ namespace RJW_Menstruation } } + public void SetEstrus(int days) + { + HediffDef estrusdef; + if (Props.consealedEstrus) estrusdef = VariousDefOf.Hediff_Estrus_Consealed; + else estrusdef = VariousDefOf.Hediff_Estrus; + + HediffWithComps hediff = (HediffWithComps)parent.pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef); + if (hediff != null) + { + hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f; + } + else + { + hediff = (HediffWithComps)HediffMaker.MakeHediff(estrusdef, parent.pawn); + hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f; + parent.pawn.health.AddHediff(hediff); + } + } + private Pawn Fertilize() { @@ -1103,13 +1157,18 @@ namespace RJW_Menstruation case Stage.Follicular: action = delegate { - if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) + if (curStageHrs >= FollicularIntervalHours) { GoNextStage(Stage.Ovulatory); } else { curStageHrs+=Configurations.CycleAcceleration; + if (!estrusflag && curStageHrs > FollicularIntervalHours - 72) + { + estrusflag = true; + SetEstrus(Props.eggLifespanDays + 3); + } StayCurrentStage(); } }; @@ -1117,6 +1176,7 @@ namespace RJW_Menstruation case Stage.Ovulatory: action = delegate { + estrusflag = false; int i = 0; do { diff --git a/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs b/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs index 419da37..7899c06 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs @@ -37,7 +37,7 @@ namespace RJW_Menstruation foreach (LocalTargetInfo t in selftargets) { - if (Utility.HasMenstruationComp(pawn)) opts.AddDistinct(MakeSelfMenu(pawn, t)); + if (pawn.HasMenstruationComp()) opts.AddDistinct(MakeSelfMenu(pawn, t)); break; } diff --git a/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs index 96984af..a24a58a 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -20,6 +20,8 @@ namespace RJW_Menstruation public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase.GetNamed("Hediff_MenstrualCramp"); public static readonly HediffDef Hediff_Climacteric = DefDatabase.GetNamed("Hediff_Climacteric"); public static readonly HediffDef Hediff_Menopause = DefDatabase.GetNamed("Hediff_Menopause"); + public static readonly HediffDef Hediff_Estrus = DefDatabase.GetNamed("Hediff_Estrus"); + public static readonly HediffDef Hediff_Estrus_Consealed = DefDatabase.GetNamed("Hediff_Estrus_Consealed"); 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");