mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
10 commits
ad0033f249
...
07c5d0344f
Author | SHA1 | Date | |
---|---|---|---|
|
07c5d0344f | ||
|
2dd86964d4 | ||
|
4febc97c73 | ||
|
cdfe9b44b8 | ||
|
b21fc85a29 | ||
|
48f020d832 | ||
|
23ae342722 | ||
|
509eeabddc | ||
|
6fabfd6aaf | ||
|
ebbbf8ee7f |
12 changed files with 65 additions and 7 deletions
|
@ -276,7 +276,10 @@ namespace RJW_Menstruation
|
|||
float res = 0;
|
||||
if (VariousDefOf.Hediff_Heavy_Lactating_Permanent != null)
|
||||
{
|
||||
if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent)) milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("hypermilkable"));
|
||||
if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent)
|
||||
|| pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Lactating_Permanent)
|
||||
|| pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Lactating_Natural)
|
||||
|| pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Lactating_Drug)) milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("milkablehuman"));
|
||||
else milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("milkable"));
|
||||
}
|
||||
else
|
||||
|
|
|
@ -158,7 +158,7 @@ namespace RJW_Menstruation
|
|||
public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Natural");
|
||||
public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Permanent");
|
||||
public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Heavy_Lactating_Permanent");
|
||||
public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamedSilentFail("LactateSelf_MC");
|
||||
public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamedSilentFail("MilkSelf");
|
||||
|
||||
// Defs from Sexperience Ideology
|
||||
public static readonly PreceptDef Pregnancy_Elevated = DefDatabase<PreceptDef>.GetNamedSilentFail("Pregnancy_Elevated");
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,20 @@
|
|||
using System.Linq;
|
||||
using VanillaGenesExpanded;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Menstruation
|
||||
{
|
||||
public static class VECompatibility
|
||||
{
|
||||
public static ThingDef VEGeneBloodDef(Pawn pawn)
|
||||
{
|
||||
if (!ModsConfig.BiotechActive) return null;
|
||||
foreach(Gene gene in pawn.genes.GenesListForReading.Where(gene => gene.Active))
|
||||
{
|
||||
ThingDef bloodDef = gene.def.GetModExtension<GeneExtension>()?.customBloodThingDef;
|
||||
if (bloodDef != null) return bloodDef;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -122,6 +122,7 @@ namespace RJW_Menstruation
|
|||
|
||||
|
||||
public static bool HARActivated = false;
|
||||
public static bool VEFActivated = false;
|
||||
public static bool AnimalGeneticsActivated = false;
|
||||
|
||||
public enum DetailLevel
|
||||
|
@ -277,6 +278,7 @@ namespace RJW_Menstruation
|
|||
if (!ModsConfig.BiotechActive && Configurations.PregnancySource == Configurations.PregnancyType.Biotech)
|
||||
Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy;
|
||||
Configurations.HARActivated = ModsConfig.IsActive("erdelf.HumanoidAlienRaces");
|
||||
Configurations.VEFActivated = ModsConfig.IsActive("oskarpotocki.vanillafactionsexpanded.core");
|
||||
Configurations.AnimalGeneticsActivated = ModsConfig.IsActive("Mlie.AnimalGenetics");
|
||||
}
|
||||
|
||||
|
|
|
@ -554,8 +554,7 @@ namespace RJW_Menstruation
|
|||
{
|
||||
try
|
||||
{
|
||||
Color c = Pawn.RaceProps.BloodDef.graphicData.color;
|
||||
return c;
|
||||
return Utility.BloodDef(Pawn).graphicData.color;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -161,6 +161,13 @@ namespace RJW_Menstruation
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Miscarried()
|
||||
{
|
||||
if (babies == null) return;
|
||||
foreach (Pawn baby in babies)
|
||||
baby.Destroy(DestroyMode.Vanish);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(PregnancyUtility), nameof(PregnancyUtility.ApplyBirthOutcome_NewTemp))]
|
||||
|
|
|
@ -38,6 +38,9 @@ namespace RJW_Menstruation
|
|||
public override void Miscarry()
|
||||
{
|
||||
this.GetMenstruationCompFromPregnancy().Pregnancy = null;
|
||||
if (babies != null)
|
||||
foreach (var baby in babies)
|
||||
baby.Destroy(DestroyMode.Vanish);
|
||||
base.Miscarry();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,11 @@ namespace RJW_Menstruation
|
|||
{
|
||||
public static void Postfix(Hediff_Pregnant __instance)
|
||||
{
|
||||
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
|
||||
if (comp == null) return;
|
||||
comp.Pregnancy = null;
|
||||
HediffComp_PregeneratedBabies babiesComp = __instance.TryGetComp<HediffComp_PregeneratedBabies>();
|
||||
if (babiesComp != null) babiesComp.Miscarried();
|
||||
|
||||
HediffComp_Menstruation menstruationComp = __instance.GetMenstruationCompFromPregnancy();
|
||||
if (menstruationComp != null) menstruationComp.Pregnancy = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="Compatibility\AnimalGeneticsCompatibility.cs" />
|
||||
<Compile Include="Compatibility\HARCompatibility.cs" />
|
||||
<Compile Include="Compatibility\VECompatibility.cs" />
|
||||
<Compile Include="CompBiosculpterPod_EggRestorationCycle.cs" />
|
||||
<Compile Include="Configurations.cs" />
|
||||
<Compile Include="Cum.cs" />
|
||||
|
@ -159,6 +160,10 @@
|
|||
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VFECore">
|
||||
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2023507013\1.5\Assemblies\VFECore.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||
|
|
|
@ -457,5 +457,21 @@ namespace RJW_Menstruation
|
|||
return Color.white;
|
||||
}
|
||||
}
|
||||
public static ThingDef BloodDef(Pawn pawn)
|
||||
{
|
||||
if (pawn == null) return ThingDefOf.Filth_Blood;
|
||||
ThingDef bloodDef = null;
|
||||
if (Configurations.VEFActivated) bloodDef = VECompatibility.VEGeneBloodDef(pawn);
|
||||
if (bloodDef != null) return bloodDef;
|
||||
if (pawn.Dead && pawn.IsShambler) return MutantDefOf.Shambler.bloodDef;
|
||||
if (pawn.IsMutant)
|
||||
{
|
||||
ThingDef mutantBloodDef = pawn.mutant.Def.bloodDef;
|
||||
if (mutantBloodDef != null) return mutantBloodDef;
|
||||
}
|
||||
bloodDef = pawn.RaceProps?.BloodDef;
|
||||
if (bloodDef != null) return bloodDef;
|
||||
return ThingDefOf.Filth_Blood;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ Version 1.5.0.0
|
|||
- Updated Traditional Chinese translation by Hydrogen.
|
||||
- Added Russian translation by Angra Mainyu.
|
||||
- Inactive genes will no longer be applied to wombs.
|
||||
- Menstrual blood will now use blood colors from Vanilla Expanded Genes.
|
||||
- Fix babies becoming the wrong pawnkind in some scenarios.
|
||||
|
||||
Version 1.0.9.4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue