This commit is contained in:
moreoreganostodump 2021-02-25 18:09:24 +09:00
parent 69fd540562
commit 9e41472468
10 changed files with 163 additions and 26 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest> <Manifest>
<identifier>RJW Menstruation</identifier> <identifier>RJW Menstruation</identifier>
<version>1.0.1.8</version> <version>1.0.1.9</version>
<dependencies> <dependencies>
</dependencies> </dependencies>
<incompatibleWith /> <incompatibleWith />

Binary file not shown.

View File

@ -6,7 +6,6 @@
<label>In period</label> <label>In period</label>
<labelNoun>in period</labelNoun> <labelNoun>in period</labelNoun>
<description>in period</description> <description>in period</description>
<labelNounPretty>{1} in period</labelNounPretty>
<defaultLabelColor>(0.70,0.00,0.00)</defaultLabelColor> <defaultLabelColor>(0.70,0.00,0.00)</defaultLabelColor>
<isBad>true</isBad> <isBad>true</isBad>
<tendable>false</tendable> <tendable>false</tendable>
@ -67,12 +66,12 @@
<label>Menopause</label> <label>Menopause</label>
<labelNoun>menopause</labelNoun> <labelNoun>menopause</labelNoun>
<description>reached menopause</description> <description>reached menopause</description>
<labelNounPretty>{1} reached menopause</labelNounPretty> <labelNounPretty>{0} reached menopause</labelNounPretty>
<defaultLabelColor>(0.70,0.70,0.00)</defaultLabelColor> <defaultLabelColor>(0.70,0.70,0.00)</defaultLabelColor>
<isBad>false</isBad> <isBad>false</isBad>
<tendable>false</tendable> <tendable>false</tendable>
<makesSickThought>false</makesSickThought> <makesSickThought>false</makesSickThought>
<makesAlert>false</makesAlert> <makesAlert>true</makesAlert>
<maxSeverity>1</maxSeverity> <maxSeverity>1</maxSeverity>
<initialSeverity>0.1</initialSeverity> <initialSeverity>0.1</initialSeverity>
<injuryProps> <injuryProps>
@ -102,12 +101,11 @@
<label>Climacteric</label> <label>Climacteric</label>
<labelNoun>climacteric</labelNoun> <labelNoun>climacteric</labelNoun>
<description>climacteric</description> <description>climacteric</description>
<labelNounPretty>{1} climacteric</labelNounPretty>
<defaultLabelColor>(0.70,0.70,0.00)</defaultLabelColor> <defaultLabelColor>(0.70,0.70,0.00)</defaultLabelColor>
<isBad>false</isBad> <isBad>false</isBad>
<tendable>false</tendable> <tendable>false</tendable>
<makesSickThought>false</makesSickThought> <makesSickThought>false</makesSickThought>
<makesAlert>true</makesAlert> <makesAlert>false</makesAlert>
<maxSeverity>1</maxSeverity> <maxSeverity>1</maxSeverity>
<initialSeverity>0.1</initialSeverity> <initialSeverity>0.1</initialSeverity>
<injuryProps> <injuryProps>
@ -175,5 +173,67 @@
</HediffDef> </HediffDef>
<HediffDef Name="Hediff_Estrus">
<hediffClass>HediffWithComps</hediffClass>
<defName>Hediff_Estrus</defName>
<label>Estrus</label>
<labelNoun>estrus</labelNoun>
<description>estrus</description>
<defaultLabelColor>(1.00,0.60,0.75)</defaultLabelColor>
<isBad>false</isBad>
<tendable>false</tendable>
<makesSickThought>false</makesSickThought>
<makesAlert>false</makesAlert>
<maxSeverity>10000</maxSeverity>
<initialSeverity>1.0</initialSeverity>
<injuryProps>
<canMerge>true</canMerge>
</injuryProps>
<stages>
<li>
<statFactors>
<SexFrequency>5.0</SexFrequency>
<SexSatisfaction>1.5</SexSatisfaction>
</statFactors>
</li>
</stages>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-1.0</severityPerDay>
</li>
</comps>
</HediffDef>
<HediffDef Name="Hediff_Estrus_Consealed">
<hediffClass>HediffWithComps</hediffClass>
<defName>Hediff_Estrus_Consealed</defName>
<label>Estrus(consealed)</label>
<labelNoun>estrus</labelNoun>
<description>estrus</description>
<defaultLabelColor>(1.00,0.60,0.75)</defaultLabelColor>
<isBad>false</isBad>
<tendable>false</tendable>
<makesSickThought>false</makesSickThought>
<makesAlert>false</makesAlert>
<maxSeverity>10000</maxSeverity>
<initialSeverity>1.0</initialSeverity>
<injuryProps>
<canMerge>true</canMerge>
</injuryProps>
<stages>
<li>
<becomeVisible>false</becomeVisible>
<statFactors>
<SexFrequency>1.10</SexFrequency>
<SexSatisfaction>1.05</SexSatisfaction>
</statFactors>
</li>
</stages>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-1.0</severityPerDay>
</li>
</comps>
</HediffDef>
</Defs> </Defs>

View File

@ -14,6 +14,10 @@
<Hediff_Climacteric.stages.3.label>폐경</Hediff_Climacteric.stages.3.label> <Hediff_Climacteric.stages.3.label>폐경</Hediff_Climacteric.stages.3.label>
<Hediff_Menopause.label>폐경</Hediff_Menopause.label> <Hediff_Menopause.label>폐경</Hediff_Menopause.label>
<Hediff_Menopause.description>임신할수 없습니다.</Hediff_Menopause.description> <Hediff_Menopause.description>임신할수 없습니다.</Hediff_Menopause.description>
<Hediff_Estrus.label>발정기</Hediff_Estrus.label>
<Hediff_Estrus.description>발정기입니다.</Hediff_Estrus.description>
<Hediff_Estrus_Consealed.label>발정기(숨김)</Hediff_Estrus_Consealed.label>
<Hediff_Estrus_Consealed.description>발정기입니다.</Hediff_Estrus_Consealed.description>

View File

@ -20,11 +20,12 @@
<folicularIntervalDays>14</folicularIntervalDays> <folicularIntervalDays>14</folicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays> <lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>6</bleedingIntervalDays> <bleedingIntervalDays>6</bleedingIntervalDays>
<recoveryIntervalDays>10</recoveryIntervalDays> <recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>3</eggLifespanDays> <eggLifespanDays>3</eggLifespanDays>
<wombTex>Womb/Womb</wombTex> <wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex> <vagTex>Genitals/Vagina</vagTex>
<ovaryPower>420</ovaryPower> <ovaryPower>420</ovaryPower>
<consealedEstrus>true</consealedEstrus>
</li> </li>
</comps> </comps>
</value> </value>
@ -62,8 +63,8 @@
<deviationFactor>0.05</deviationFactor> <deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>14</folicularIntervalDays> <folicularIntervalDays>14</folicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays> <lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>6</bleedingIntervalDays> <bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>10</recoveryIntervalDays> <recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>3</eggLifespanDays> <eggLifespanDays>3</eggLifespanDays>
<wombTex>Womb/Womb</wombTex> <wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex> <vagTex>Genitals/Vagina</vagTex>
@ -106,8 +107,8 @@
<comps> <comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation"> <li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity> <maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor> <baseImplantationChanceFactor>2.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor> <basefertilizationChanceFactor>2.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor> <deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>14</folicularIntervalDays> <folicularIntervalDays>14</folicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays> <lutealIntervalDays>14</lutealIntervalDays>
@ -116,6 +117,7 @@
<eggLifespanDays>3</eggLifespanDays> <eggLifespanDays>3</eggLifespanDays>
<wombTex>Womb/Womb</wombTex> <wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex> <vagTex>Genitals/Vagina</vagTex>
<consealedEstrus>true</consealedEstrus>
</li> </li>
</comps> </comps>
</value> </value>

View File

@ -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 Version 1.0.1.8
- fixed problems with animal status window - fixed problems with animal status window
- fixed RMB menu crash - fixed RMB menu crash

View File

@ -19,6 +19,7 @@ namespace RJW_Menstruation
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal) || comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal)
)) ))
{ {
comp.SetEstrus(comp.Props.eggLifespanDays);
comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; comp.curStage = HediffComp_Menstruation.Stage.Ovulatory;
comp.ovarypower--; comp.ovarypower--;
} }

View File

@ -26,6 +26,7 @@ namespace RJW_Menstruation
public string vagTex = "Genitals/Vagina"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday public string vagTex = "Genitals/Vagina"; //fertiledays = ovaluationday - spermlifespan ~ ovaluationday + egglifespanday
public bool infertile = false; public bool infertile = false;
public int ovaryPower = 600000000; // default: almost unlimited ovulation public int ovaryPower = 600000000; // default: almost unlimited ovulation
public bool consealedEstrus = false;
public CompProperties_Menstruation() public CompProperties_Menstruation()
{ {
@ -54,7 +55,7 @@ namespace RJW_Menstruation
public class HediffComp_Menstruation : HediffComp public class HediffComp_Menstruation : HediffComp
{ {
const float minmakefilthvalue = 1.0f; const float minmakefilthvalue = 1.0f;
const int ovarypowerthreshold = 72; //const int ovarypowerthreshold = 72;
public static readonly int tickInterval = 2500; // an hour public static readonly int tickInterval = 2500; // an hour
public CompProperties_Menstruation Props; public CompProperties_Menstruation Props;
@ -92,6 +93,25 @@ namespace RJW_Menstruation
private Need sexNeed = null; private Need sexNeed = null;
private string customwombtex = null; private string customwombtex = null;
private string customvagtex = 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 public float TotalCum
{ {
@ -383,6 +403,7 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref crampPain, "crampPain", crampPain, true); Scribe_Values.Look(ref crampPain, "crampPain", crampPain, true);
Scribe_Values.Look(ref ovarypower, "ovarypower", ovarypower, true); Scribe_Values.Look(ref ovarypower, "ovarypower", ovarypower, true);
Scribe_Values.Look(ref eggstack, "eggstack", eggstack, 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) 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 (Props.ovaryPower > 10000000) ovarypower = Props.ovaryPower;
if (ovarypower < 1) else
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); float avglittersize;
hediff.Severity = 0.2f; try
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); {
curStage = Stage.Young; avglittersize = Rand.ByCurveAverage(parent.pawn.def.race.litterSizeCurve);
} }
else if (ovarypower < ovarypowerthreshold) catch (NullReferenceException)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); avglittersize = 1;
hediff.Severity = 0.008f * (ovarypowerthreshold - ovarypower); }
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); 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() private Pawn Fertilize()
{ {
@ -1103,13 +1157,18 @@ namespace RJW_Menstruation
case Stage.Follicular: case Stage.Follicular:
action = delegate action = delegate
{ {
if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) if (curStageHrs >= FollicularIntervalHours)
{ {
GoNextStage(Stage.Ovulatory); GoNextStage(Stage.Ovulatory);
} }
else else
{ {
curStageHrs+=Configurations.CycleAcceleration; curStageHrs+=Configurations.CycleAcceleration;
if (!estrusflag && curStageHrs > FollicularIntervalHours - 72)
{
estrusflag = true;
SetEstrus(Props.eggLifespanDays + 3);
}
StayCurrentStage(); StayCurrentStage();
} }
}; };
@ -1117,6 +1176,7 @@ namespace RJW_Menstruation
case Stage.Ovulatory: case Stage.Ovulatory:
action = delegate action = delegate
{ {
estrusflag = false;
int i = 0; int i = 0;
do do
{ {

View File

@ -37,7 +37,7 @@ namespace RJW_Menstruation
foreach (LocalTargetInfo t in selftargets) foreach (LocalTargetInfo t in selftargets)
{ {
if (Utility.HasMenstruationComp(pawn)) opts.AddDistinct(MakeSelfMenu(pawn, t)); if (pawn.HasMenstruationComp()) opts.AddDistinct(MakeSelfMenu(pawn, t));
break; break;
} }

View File

@ -20,6 +20,8 @@ namespace RJW_Menstruation
public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase<HediffDef>.GetNamed("Hediff_MenstrualCramp"); public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase<HediffDef>.GetNamed("Hediff_MenstrualCramp");
public static readonly HediffDef Hediff_Climacteric = DefDatabase<HediffDef>.GetNamed("Hediff_Climacteric"); public static readonly HediffDef Hediff_Climacteric = DefDatabase<HediffDef>.GetNamed("Hediff_Climacteric");
public static readonly HediffDef Hediff_Menopause = DefDatabase<HediffDef>.GetNamed("Hediff_Menopause"); public static readonly HediffDef Hediff_Menopause = DefDatabase<HediffDef>.GetNamed("Hediff_Menopause");
public static readonly HediffDef Hediff_Estrus = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus");
public static readonly HediffDef Hediff_Estrus_Consealed = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus_Consealed");
public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable"); public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable");
public static readonly PawnRelationDef Relation_birthgiver = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire"); public static readonly PawnRelationDef Relation_birthgiver = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire");
public static readonly PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup"); public static readonly PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup");