Compare commits

...

10 commits

Author SHA1 Message Date
Akiyami Solo
07c5d0344f Merge branch 'dev' into 'dev'
Breast fullness is not displayed and the "milk yourself" action is not invoked on a pawn when the rjw-mc-biotech mod is present

See merge request lutepickle/rjw_menstruation!6
2024-05-30 00:19:09 +00:00
lutepickle
2dd86964d4 Apply VE Genetics and Anomaly blood colors to bleeding 2024-05-29 16:04:28 -07:00
lutepickle
4febc97c73 Erase unborn babies upon miscarriage. 2024-05-26 08:22:12 -07:00
Акиями Соло
cdfe9b44b8 reduction of unnecessary inspections 2024-01-11 20:55:26 +03:00
Акиями Соло
b21fc85a29 fix JobDef link for mod rjw-mc-biotech mod 2024-01-11 20:39:07 +03:00
Акиями Соло
48f020d832 fix display of breast fullness in gui for rjw-mc-biotech mod 2024-01-11 20:38:38 +03:00
lutepickle
23ae342722 Merge branch 'dev' 2024-01-08 13:55:51 -08:00
lutepickle
509eeabddc Merge branch 'dev' 2023-07-28 17:29:32 -07:00
lutepickle
6fabfd6aaf Revert "Initialize womb when displaying gizmo if needed."
This reverts commit ebbbf8ee7f.
2023-07-03 09:08:52 -07:00
lutepickle
ebbbf8ee7f Initialize womb when displaying gizmo if needed. 2023-07-03 08:54:19 -07:00
12 changed files with 65 additions and 7 deletions

View file

@ -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

View file

@ -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.

View file

@ -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;
}
}
}

View file

@ -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");
}

View file

@ -554,8 +554,7 @@ namespace RJW_Menstruation
{
try
{
Color c = Pawn.RaceProps.BloodDef.graphicData.color;
return c;
return Utility.BloodDef(Pawn).graphicData.color;
}
catch
{

View file

@ -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))]

View file

@ -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();
}

View file

@ -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;
}
}

View file

@ -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">

View file

@ -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;
}
}
}

View file

@ -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