mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
6 commits
a3e0c4eb79
...
eaa28a2232
Author | SHA1 | Date | |
---|---|---|---|
|
eaa28a2232 | ||
|
36c88d2752 | ||
|
3d9b22776e | ||
|
80611882c9 | ||
|
f70c2ad585 | ||
|
b5705ccbd9 |
7 changed files with 101 additions and 7 deletions
|
@ -91,6 +91,48 @@
|
||||||
</comps>
|
</comps>
|
||||||
</ThingDef>
|
</ThingDef>
|
||||||
|
|
||||||
|
<ThingDef ParentName="MakeableDrugPillBase">
|
||||||
|
<defName>Doublex</defName>
|
||||||
|
<label>doublex</label>
|
||||||
|
<description>Glittertech drug that causes fertilized eggs to produce enzygotic twins.</description>
|
||||||
|
<graphicData>
|
||||||
|
<texPath>Things/Item/SIA</texPath>
|
||||||
|
<graphicClass>Graphic_StackCount</graphicClass>
|
||||||
|
</graphicData>
|
||||||
|
<rotatable>false</rotatable>
|
||||||
|
<statBases>
|
||||||
|
<WorkToMake>800</WorkToMake>
|
||||||
|
<MarketValue>250</MarketValue>
|
||||||
|
<Mass>0.01</Mass>
|
||||||
|
</statBases>
|
||||||
|
<techLevel>Ultra</techLevel>
|
||||||
|
<ingestible>
|
||||||
|
<drugCategory>Medical</drugCategory>
|
||||||
|
<outcomeDoers>
|
||||||
|
<li Class="IngestionOutcomeDoer_GiveHediff">
|
||||||
|
<hediffDef>Hediff_Doublex</hediffDef>
|
||||||
|
<severity>1.0</severity>
|
||||||
|
</li>
|
||||||
|
</outcomeDoers>
|
||||||
|
</ingestible>
|
||||||
|
<recipeMaker>
|
||||||
|
<researchPrerequisite>DrugProduction</researchPrerequisite>
|
||||||
|
<recipeUsers>
|
||||||
|
<li>DrugLab</li>
|
||||||
|
</recipeUsers>
|
||||||
|
</recipeMaker>
|
||||||
|
<costList>
|
||||||
|
<MedicineUltratech>3</MedicineUltratech>
|
||||||
|
<Neutroamine>2</Neutroamine>
|
||||||
|
</costList>
|
||||||
|
<comps>
|
||||||
|
<li Class="CompProperties_Drug">
|
||||||
|
<addictiveness>0</addictiveness>
|
||||||
|
<listOrder>1000</listOrder>
|
||||||
|
</li>
|
||||||
|
</comps>
|
||||||
|
</ThingDef>
|
||||||
|
|
||||||
<ThingDef ParentName="MakeableDrugPillBase">
|
<ThingDef ParentName="MakeableDrugPillBase">
|
||||||
<defName>PainReliever</defName>
|
<defName>PainReliever</defName>
|
||||||
<label>Pain reliever</label>
|
<label>Pain reliever</label>
|
||||||
|
|
|
@ -165,6 +165,32 @@
|
||||||
</HediffDef>
|
</HediffDef>
|
||||||
|
|
||||||
|
|
||||||
|
<HediffDef Name="Hediff_Doublex">
|
||||||
|
<hediffClass>HediffWithComps</hediffClass>
|
||||||
|
<defName>Hediff_Doublex</defName>
|
||||||
|
<label>Doublex</label>
|
||||||
|
<labelNoun>doublex</labelNoun>
|
||||||
|
<description>Ultratech drug that causes fertilized eggs to split resulting in identical twins.</description>
|
||||||
|
<defaultLabelColor>(0.75,0.75,1.0)</defaultLabelColor>
|
||||||
|
<isBad>false</isBad>
|
||||||
|
<tendable>false</tendable>
|
||||||
|
<makesSickThought>false</makesSickThought>
|
||||||
|
<makesAlert>false</makesAlert>
|
||||||
|
<maxSeverity>5</maxSeverity>
|
||||||
|
<initialSeverity>1.0</initialSeverity>
|
||||||
|
<stages>
|
||||||
|
<li>
|
||||||
|
<becomeVisible>true</becomeVisible>
|
||||||
|
</li>
|
||||||
|
</stages>
|
||||||
|
<comps>
|
||||||
|
<li Class="HediffCompProperties_SeverityPerDay">
|
||||||
|
<severityPerDay>-0.5</severityPerDay>
|
||||||
|
</li>
|
||||||
|
</comps>
|
||||||
|
</HediffDef>
|
||||||
|
|
||||||
|
|
||||||
<HediffDef Name="Hediff_PainReliever">
|
<HediffDef Name="Hediff_PainReliever">
|
||||||
<hediffClass>HediffWithComps</hediffClass>
|
<hediffClass>HediffWithComps</hediffClass>
|
||||||
<defName>Hediff_PainReliever</defName>
|
<defName>Hediff_PainReliever</defName>
|
||||||
|
|
|
@ -639,10 +639,14 @@ namespace RJW_Menstruation
|
||||||
if (Scribe.mode == LoadSaveMode.PostLoadInit)
|
if (Scribe.mode == LoadSaveMode.PostLoadInit)
|
||||||
{
|
{
|
||||||
Initialize();
|
Initialize();
|
||||||
if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father) // Fix mother == father issue
|
// Biotech labor errors if the mother is also the father, so don't let that happen
|
||||||
|
if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father && vanillaPreg.Mother != null)
|
||||||
|
{
|
||||||
|
Log.Warning($"Pregnancy of {Pawn} has same mother and father, setting father to null");
|
||||||
vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet);
|
vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void CompPostPostAdd(DamageInfo? dinfo)
|
public override void CompPostPostAdd(DamageInfo? dinfo)
|
||||||
|
@ -790,7 +794,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Pawn.Dead) return null;
|
if (Pawn.Dead || !Pawn.ShouldCycle()) return null;
|
||||||
StringBuilder tip = new StringBuilder();
|
StringBuilder tip = new StringBuilder();
|
||||||
tip.Append(Translations.Dialog_WombInfo01);
|
tip.Append(Translations.Dialog_WombInfo01);
|
||||||
tip.Append(": ");
|
tip.Append(": ");
|
||||||
|
@ -812,7 +816,11 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
public override string CompDebugString()
|
public override string CompDebugString()
|
||||||
{
|
{
|
||||||
if (Pawn.Dead || curStage == Stage.None || curStage == Stage.Infertile || curStage == Stage.Pregnant) return null;
|
if (Pawn.Dead ||
|
||||||
|
!Pawn.ShouldCycle() ||
|
||||||
|
curStage == Stage.None ||
|
||||||
|
curStage == Stage.Infertile ||
|
||||||
|
curStage == Stage.Pregnant) return null;
|
||||||
StringBuilder debugString = new StringBuilder();
|
StringBuilder debugString = new StringBuilder();
|
||||||
debugString.Append($"Time to next state: ");
|
debugString.Append($"Time to next state: ");
|
||||||
debugString.Append(GenDate.ToStringTicksToPeriod(TicksToNextStage()));
|
debugString.Append(GenDate.ToStringTicksToPeriod(TicksToNextStage()));
|
||||||
|
|
|
@ -242,7 +242,7 @@ namespace RJW_Menstruation
|
||||||
bool isInduced = comp is HediffComp_InducedOvulator;
|
bool isInduced = comp is HediffComp_InducedOvulator;
|
||||||
if (comp.curStage == HediffComp_Menstruation.Stage.Follicular &&
|
if (comp.curStage == HediffComp_Menstruation.Stage.Follicular &&
|
||||||
isInduced &&
|
isInduced &&
|
||||||
comp.Pawn.jobs.curDriver is JobDriver_Sex job &&
|
comp.Pawn.jobs?.curDriver is JobDriver_Sex job &&
|
||||||
job.Sexprops != null &&
|
job.Sexprops != null &&
|
||||||
!UsingCondom(comp.Pawn, job.Partner) &&
|
!UsingCondom(comp.Pawn, job.Partner) &&
|
||||||
(job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))
|
(job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))
|
||||||
|
|
|
@ -320,7 +320,20 @@ namespace RJW_Menstruation
|
||||||
Pawn firstbaby = null;
|
Pawn firstbaby = null;
|
||||||
int traitSeed = Rand.Int;
|
int traitSeed = Rand.Int;
|
||||||
List<Trait> parentTraits = GetInheritableTraits(mother, father);
|
List<Trait> parentTraits = GetInheritableTraits(mother, father);
|
||||||
while (Rand.Chance(Configurations.EnzygoticTwinsChance) && division < Configurations.MaxEnzygoticTwins) division++;
|
|
||||||
|
//TODO: turn this into a proper function that can handle genes, fertility boosts, genital type effects etc.
|
||||||
|
float eTwinChance = Configurations.EnzygoticTwinsChance;
|
||||||
|
//Log.Message($"RJW_Menstration :: Configurations.EnzygoticTwinsChance = {Configurations.EnzygoticTwinsChance}");
|
||||||
|
if (mother.health.hediffSet.HasHediff(VariousDefOf.Hediff_Doublex))
|
||||||
|
{
|
||||||
|
division++;
|
||||||
|
eTwinChance = eTwinChance + (1 - eTwinChance) / 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Log.Message($"RJW_Menstration :: TwinChance = {eTwinChance}");
|
||||||
|
while (Rand.Chance(eTwinChance) && division < Configurations.MaxEnzygoticTwins) division++;
|
||||||
|
//Log.Message($"RJW_Menstration :: division = {division}");
|
||||||
|
|
||||||
for (int i = 0; i < division; i++)
|
for (int i = 0; i < division; i++)
|
||||||
{
|
{
|
||||||
Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed);
|
Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed);
|
||||||
|
|
|
@ -33,10 +33,14 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
foreach (LocalTargetInfo t in selftargets)
|
foreach (LocalTargetInfo t in selftargets)
|
||||||
{
|
{
|
||||||
if (t.Pawn == pawn && pawn.HasMenstruationComp()) opts.AddDistinct(MakeSelfMenu(pawn, t));
|
if (t.Pawn == pawn)
|
||||||
|
{
|
||||||
|
if (pawn.HasMenstruationComp() && pawn.ShouldCycle())
|
||||||
|
opts.AddDistinct(MakeSelfMenu(pawn, t));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static FloatMenuOption MakeSelfMenu(Pawn pawn, LocalTargetInfo target)
|
public static FloatMenuOption MakeSelfMenu(Pawn pawn, LocalTargetInfo target)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace RJW_Menstruation
|
||||||
public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus_Concealed");
|
public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus_Concealed");
|
||||||
public static readonly HediffDef Hediff_AffectedByPheromones = DefDatabase<HediffDef>.GetNamed("Hediff_AffectedByPheromones");
|
public static readonly HediffDef Hediff_AffectedByPheromones = DefDatabase<HediffDef>.GetNamed("Hediff_AffectedByPheromones");
|
||||||
public static readonly HediffDef Hediff_ASA = DefDatabase<HediffDef>.GetNamed("Hediff_ASA");
|
public static readonly HediffDef Hediff_ASA = DefDatabase<HediffDef>.GetNamed("Hediff_ASA");
|
||||||
|
public static readonly HediffDef Hediff_Doublex = DefDatabase<HediffDef>.GetNamed("Hediff_Doublex");
|
||||||
public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable");
|
public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable");
|
||||||
public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex");
|
public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex");
|
||||||
public static readonly JobDef VaginaWashing = DefDatabase<JobDef>.GetNamed("VaginaWashing");
|
public static readonly JobDef VaginaWashing = DefDatabase<JobDef>.GetNamed("VaginaWashing");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue