Add the option to start new biotech pregnancies
This commit is contained in:
parent
2f10a9cc3d
commit
d8ce861448
Binary file not shown.
|
@ -121,6 +121,9 @@
|
|||
<EstimatedCumLifespan>Estimated sperm lifespan</EstimatedCumLifespan>
|
||||
<EstimatedEggLifespan>Estimated egg lifespan</EstimatedEggLifespan>
|
||||
<FertilityDesc>Implantation chance of fertilized eggs. Chance of fertilization this hour: {0}%</FertilityDesc>
|
||||
<Option_PregnancyFromBaseRJW_Label>Use basic RJW pregnancy</Option_PregnancyFromBaseRJW_Label>
|
||||
<Option_PregnancyFromMultiplePregnancy_Label>Use menstruation multiple pregnancy</Option_PregnancyFromMultiplePregnancy_Label>
|
||||
<Option_PregnancyFromBiotech_Label>Use Biotech pregnancy</Option_PregnancyFromBiotech_Label>
|
||||
<Button_ResetToDefault>Reset to default</Button_ResetToDefault>
|
||||
|
||||
<Gizmo_GatherCum>Gather cum</Gizmo_GatherCum>
|
||||
|
|
|
@ -53,7 +53,8 @@ namespace RJW_Menstruation
|
|||
public static float EstrusFuckabilityToHookup = RJWHookupSettings.MinimumFuckabilityToHookup;
|
||||
public static float EstrusAttractivenessToHookup = RJWHookupSettings.MinimumAttractivenessToHookup;
|
||||
public static float EstrusRelationshipToHookup = RJWHookupSettings.MinimumRelationshipToHookup;
|
||||
public static bool UseMultiplePregnancy = true;
|
||||
// public static bool UseMultiplePregnancy = true;
|
||||
public static PregnancyType PregnancySource = PregnancyType.MultiplePregnancy;
|
||||
public static bool EnableHeteroOvularTwins = true;
|
||||
public static bool EnableEnzygoticTwins = true;
|
||||
public static float EnzygoticTwinsChance = EnzygoticTwinsChanceDefault;
|
||||
|
@ -89,7 +90,8 @@ namespace RJW_Menstruation
|
|||
EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault;
|
||||
EnableEnzygoticTwins = true;
|
||||
EnableHeteroOvularTwins = true;
|
||||
UseMultiplePregnancy = true;
|
||||
// UseMultiplePregnancy = true;
|
||||
PregnancySource = PregnancyType.MultiplePregnancy;
|
||||
MaxEnzygoticTwins = MaxEnzygoticTwinsDefault;
|
||||
BleedingAmount = BleedingAmountDefault;
|
||||
MotherFirst = false;
|
||||
|
@ -166,6 +168,13 @@ namespace RJW_Menstruation
|
|||
Hostile = 16
|
||||
}
|
||||
|
||||
public enum PregnancyType
|
||||
{
|
||||
BaseRJW,
|
||||
MultiplePregnancy,
|
||||
Biotech
|
||||
}
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true);
|
||||
|
@ -189,7 +198,8 @@ namespace RJW_Menstruation
|
|||
Scribe_Values.Look(ref EstrusFuckabilityToHookup, "EstrusFuckabilityToHookup", EstrusFuckabilityToHookup, true);
|
||||
Scribe_Values.Look(ref EstrusAttractivenessToHookup, "EstrusAttractivenessToHookup", EstrusAttractivenessToHookup, true);
|
||||
Scribe_Values.Look(ref EstrusRelationshipToHookup, "EstrusRelationshipToHookup", EstrusRelationshipToHookup, true);
|
||||
Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true);
|
||||
//Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true);
|
||||
Scribe_Values.Look(ref PregnancySource, "PregnancySource", PregnancySource, true);
|
||||
Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true);
|
||||
Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", EnableEnzygoticTwins, true);
|
||||
Scribe_Values.Look(ref EnzygoticTwinsChance, "EnzygoticTwinsChance", EnzygoticTwinsChance, true);
|
||||
|
@ -245,6 +255,8 @@ namespace RJW_Menstruation
|
|||
public RJW_Menstruation(ModContentPack content) : base(content)
|
||||
{
|
||||
GetSettings<Configurations>();
|
||||
if (!ModsConfig.BiotechActive && Configurations.PregnancySource == Configurations.PregnancyType.Biotech)
|
||||
Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy;
|
||||
Configurations.HARActivated = ModsConfig.IsActive("erdelf.HumanoidAlienRaces");
|
||||
Configurations.AnimalGeneticsActivated = ModsConfig.IsActive("Mlie.AnimalGenetics");
|
||||
}
|
||||
|
@ -262,7 +274,8 @@ namespace RJW_Menstruation
|
|||
float mainRectHeight = -3f +
|
||||
(Configurations.EnableWombIcon || Configurations.EnableButtonInHT ? 400f : 0f) +
|
||||
(Configurations.EstrusOverridesHookupSettings ? 144f : 0f) +
|
||||
(Configurations.UseMultiplePregnancy ? (Configurations.EnableEnzygoticTwins ? 175f : 75f) : 0f) +
|
||||
// TODO: Also for modified Biotech pregnancies
|
||||
(Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy ? (Configurations.EnableEnzygoticTwins ? 175f : 75f) : 0f) +
|
||||
(Configurations.EnableBirthVaginaMorph ? 48f : 0f);
|
||||
Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, Math.Max(inRect.height + mainRectHeight, 1f));
|
||||
int Adjust;
|
||||
|
@ -415,8 +428,15 @@ namespace RJW_Menstruation
|
|||
Configurations.EstrusRelationshipToHookup = listmain.Slider((int)Configurations.EstrusRelationshipToHookup, -100f, 100f);
|
||||
}
|
||||
|
||||
listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc);
|
||||
if (Configurations.UseMultiplePregnancy)
|
||||
// listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc);
|
||||
if (listmain.RadioButton(Translations.Option_PregnancyFromBaseRJW_Label, Configurations.PregnancySource == Configurations.PregnancyType.BaseRJW))
|
||||
Configurations.PregnancySource = Configurations.PregnancyType.BaseRJW;
|
||||
if (listmain.RadioButton(Translations.Option_PregnancyFromMultiplePregnancy_Label, Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy))
|
||||
Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy;
|
||||
if (ModsConfig.BiotechActive && listmain.RadioButton(Translations.Option_PregnancyFromBiotech_Label, Configurations.PregnancySource == Configurations.PregnancyType.Biotech))
|
||||
Configurations.PregnancySource = Configurations.PregnancyType.Biotech;
|
||||
// TODO: Also for modified Biotech pregnancy
|
||||
if (Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy)
|
||||
{
|
||||
float sectionheight = 75f;
|
||||
if (Configurations.EnableEnzygoticTwins) sectionheight += 100;
|
||||
|
|
|
@ -1234,7 +1234,8 @@ namespace RJW_Menstruation
|
|||
if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn} into {parent}, father {egg.fertilizer}");
|
||||
if (pregnancy != null)
|
||||
{
|
||||
if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins)
|
||||
// TODO: Modified Biotech pregnancy
|
||||
if (Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy && Configurations.EnableHeteroOvularTwins)
|
||||
{
|
||||
if (pregnancy is Hediff_MultiplePregnancy h)
|
||||
{
|
||||
|
@ -1252,30 +1253,41 @@ namespace RJW_Menstruation
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!Configurations.UseMultiplePregnancy)
|
||||
Configurations.PregnancyType usePregnancy = xxx.is_human(Pawn) ? Configurations.PregnancySource : Configurations.PregnancyType.MultiplePregnancy;
|
||||
switch (usePregnancy)
|
||||
{
|
||||
if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy");
|
||||
PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
|
||||
// I hate having to do this, but it gets the newest pregnancy
|
||||
List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
|
||||
Pawn.health.hediffSet.GetHediffs(ref pregnancies);
|
||||
pregnancy = pregnancies.MaxBy(hediff => hediff.loadID);
|
||||
pregnant = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy");
|
||||
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer);
|
||||
pregnant = true;
|
||||
deadeggs.Add(egg);
|
||||
case Configurations.PregnancyType.BaseRJW:
|
||||
|
||||
if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy");
|
||||
PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
|
||||
// I hate having to do this, but it gets the newest pregnancy
|
||||
List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
|
||||
Pawn.health.hediffSet.GetHediffs(ref pregnancies);
|
||||
pregnancy = pregnancies.MaxBy(hediff => hediff.loadID);
|
||||
pregnant = true;
|
||||
break;
|
||||
|
||||
case Configurations.PregnancyType.MultiplePregnancy:
|
||||
if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy");
|
||||
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer);
|
||||
pregnant = true;
|
||||
deadeggs.Add(egg);
|
||||
break;
|
||||
|
||||
case Configurations.PregnancyType.Biotech:
|
||||
if (Configurations.Debug) Log.Message($"Creating new biotech pregnancy");
|
||||
pregnancy = HediffMaker.MakeHediff(HediffDefOf.PregnantHuman, Pawn);
|
||||
((Hediff_Pregnant)pregnancy).SetParents(Pawn, egg.fertilizer, PregnancyUtility.GetInheritedGeneSet(egg.fertilizer, Pawn));
|
||||
Pawn.health.AddHediff(pregnancy);
|
||||
break;
|
||||
}
|
||||
if (pregnancy is Hediff_BasePregnancy rjw_preg)
|
||||
{
|
||||
// TODO: advance biotech pregnancy
|
||||
rjw_preg.p_start_tick -= egg.fertstage / Configurations.CycleAcceleration * GenDate.TicksPerHour;
|
||||
rjw_preg.p_end_tick -= egg.fertstage / Configurations.CycleAcceleration * GenDate.TicksPerHour;
|
||||
}
|
||||
// TODO: advance biotech pregnancy
|
||||
if (!(pregnancy is Hediff_MultiplePregnancy)) break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1286,7 +1298,7 @@ namespace RJW_Menstruation
|
|||
}
|
||||
}
|
||||
|
||||
if (pregnant && (!Configurations.UseMultiplePregnancy || !Configurations.EnableHeteroOvularTwins))
|
||||
if (pregnant && (Configurations.PregnancySource != Configurations.PregnancyType.MultiplePregnancy || !Configurations.EnableHeteroOvularTwins))
|
||||
{
|
||||
eggs.Clear();
|
||||
return true;
|
||||
|
|
|
@ -122,6 +122,9 @@ namespace RJW_Menstruation
|
|||
public static readonly string Option_EstrusFuckability_Label = "Option_EstrusFuckability_Label".Translate();
|
||||
public static readonly string Option_EstrusAttractability_Label = "Option_EstrusAttractability_Label".Translate();
|
||||
public static readonly string Option_EstrusRelationship_Label = "Option_EstrusRelationship_Label".Translate();
|
||||
public static readonly string Option_PregnancyFromBaseRJW_Label = "Option_PregnancyFromBaseRJW_Label".Translate();
|
||||
public static readonly string Option_PregnancyFromMultiplePregnancy_Label = "Option_PregnancyFromMultiplePregnancy_Label".Translate();
|
||||
public static readonly string Option_PregnancyFromBiotech_Label = "Option_PregnancyFromBiotech_Label".Translate();
|
||||
|
||||
public static readonly string Button_ResetToDefault = "Button_ResetToDefault".Translate();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<Manifest>
|
||||
<identifier>RJW Menstruation</identifier>
|
||||
<version>1.0.8.0</version>
|
||||
<version>1.0.8.1</version>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
<incompatibleWith />
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
Version 1.0.8.1
|
||||
- Added the option for humans to start Biotech pregnancies if the DLC is enabled. If set, non-humans will use the old multiple pregnancy instead.
|
||||
|
||||
Version 1.0.8.0
|
||||
- Support for RimWorld 1.4. All future changes to Menstruation will only be for Rimworld 1.4.
|
||||
- Existing Biotech pregnancies will appear in a womb, but no support yet for starting a Biotech pregnancy.
|
||||
|
|
Loading…
Reference in New Issue