mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
No commits in common. "7bf9f80742afb7cf85ab71c0d6c5656b30811fa1" and "045e9548f6fd0e79fe0657c1dc81867eabf5a141" have entirely different histories.
7bf9f80742
...
045e9548f6
4 changed files with 6 additions and 15 deletions
|
@ -75,14 +75,14 @@ namespace RJW_Menstruation
|
||||||
base.PregnantAction();
|
base.PregnantAction();
|
||||||
if (curStage != Stage.Pregnant)
|
if (curStage != Stage.Pregnant)
|
||||||
// Go halfway into the cycle
|
// Go halfway into the cycle
|
||||||
hoursToNextCycle = (int)(averageCycleIntervalHours * (1 + Rand.Range(-cycleVariability, cycleVariability))) / 2;
|
hoursToNextCycle = (int)(averageCycleIntervalHours * Rand.Range(-cycleVariability, cycleVariability)) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AnestrusAction()
|
protected override void AnestrusAction()
|
||||||
{
|
{
|
||||||
if (hoursToNextCycle <= 0)
|
if (hoursToNextCycle <= 0)
|
||||||
{
|
{
|
||||||
hoursToNextCycle = (int)(averageCycleIntervalHours * (1 + Rand.Range(-cycleVariability, cycleVariability)));
|
hoursToNextCycle = (int)(averageCycleIntervalHours * Rand.Range(-cycleVariability, cycleVariability));
|
||||||
if (IsBreedingSeason()) GoNextStage(Stage.Follicular);
|
if (IsBreedingSeason()) GoNextStage(Stage.Follicular);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ namespace RJW_Menstruation
|
||||||
// But it is possible that there is no new hediff (be it a birth, miscarrage, or dev edit)
|
// But it is possible that there is no new hediff (be it a birth, miscarrage, or dev edit)
|
||||||
base.CompPostPostRemoved();
|
base.CompPostPostRemoved();
|
||||||
|
|
||||||
// Send the babies from this comp to the new one
|
|
||||||
switch (parent)
|
switch (parent)
|
||||||
{
|
{
|
||||||
case Hediff_Pregnant hediff_Pregnant:
|
case Hediff_Pregnant hediff_Pregnant:
|
||||||
|
@ -71,7 +70,7 @@ namespace RJW_Menstruation
|
||||||
public void AddNewBaby(Pawn mother, Pawn father)
|
public void AddNewBaby(Pawn mother, Pawn father)
|
||||||
{
|
{
|
||||||
if (babies == null) babies = new List<Pawn>();
|
if (babies == null) babies = new List<Pawn>();
|
||||||
PawnKindDef babyPawnKind = PregnancyCommon.BabyPawnKindDecider(mother, father, true);
|
PawnKindDef babyPawnKind = PregnancyCommon.BabyPawnKindDecider(mother, father);
|
||||||
PawnGenerationRequest request = new PawnGenerationRequest
|
PawnGenerationRequest request = new PawnGenerationRequest
|
||||||
(
|
(
|
||||||
kind: babyPawnKind,
|
kind: babyPawnKind,
|
||||||
|
@ -116,7 +115,7 @@ namespace RJW_Menstruation
|
||||||
baby.story.furDef = firstbaby.story.furDef;
|
baby.story.furDef = firstbaby.story.furDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baby.genes != null)
|
if (baby.genes != null && ModsConfig.BiotechActive)
|
||||||
{
|
{
|
||||||
baby.genes.SetXenotypeDirect(firstbaby.genes.Xenotype);
|
baby.genes.SetXenotypeDirect(firstbaby.genes.Xenotype);
|
||||||
baby.genes.xenotypeName = firstbaby.genes.xenotypeName;
|
baby.genes.xenotypeName = firstbaby.genes.xenotypeName;
|
||||||
|
|
|
@ -313,7 +313,7 @@ namespace RJW_Menstruation
|
||||||
allowAddictions: false,
|
allowAddictions: false,
|
||||||
relationWithExtraPawnChanceFactor: 0,
|
relationWithExtraPawnChanceFactor: 0,
|
||||||
fixedLastName: lastname,
|
fixedLastName: lastname,
|
||||||
kind: PregnancyCommon.BabyPawnKindDecider(mother, father, false),
|
kind: PregnancyCommon.BabyPawnKindDecider(mother, father),
|
||||||
//fixedIdeo: mother.Ideo,
|
//fixedIdeo: mother.Ideo,
|
||||||
forbidAnyTitle: true,
|
forbidAnyTitle: true,
|
||||||
forceNoBackstory: true,
|
forceNoBackstory: true,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
using rjw;
|
using rjw;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -62,8 +61,7 @@ namespace RJW_Menstruation
|
||||||
/// <param name="father"></param>
|
/// <param name="father"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
||||||
/// <param name="noAnimalsFromHumanlikes"></param>
|
public static PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father)
|
||||||
public static PawnKindDef BabyPawnKindDecider(Pawn mother, Pawn father, bool noAnimalsFromHumanlikes)
|
|
||||||
{
|
{
|
||||||
PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother);
|
PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother);
|
||||||
PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father);
|
PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father);
|
||||||
|
@ -179,12 +177,6 @@ namespace RJW_Menstruation
|
||||||
if (!spawn_kind_def_list.NullOrEmpty()) spawn_kind_def = spawn_kind_def_list.RandomElement();
|
if (!spawn_kind_def_list.NullOrEmpty()) spawn_kind_def = spawn_kind_def_list.RandomElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If both parents are humanlike, Biotech will attempt to assign genes to the child
|
|
||||||
// Normally not a problem, but with the hybrid system, two humanlikes might produce an animal
|
|
||||||
// So override it and force the child to be human
|
|
||||||
if (noAnimalsFromHumanlikes && mother.genes != null && father?.genes != null && !spawn_kind_def.race.race.Humanlike)
|
|
||||||
spawn_kind_def = Rand.Chance(RJWPregnancySettings.humanlike_DNA_from_mother) ? motherKindDef : fatherKindDef;
|
|
||||||
|
|
||||||
return spawn_kind_def;
|
return spawn_kind_def;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue