mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Apply VE Genetics and Anomaly blood colors to bleeding
This commit is contained in:
parent
4febc97c73
commit
2dd86964d4
9 changed files with 50 additions and 15 deletions
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 HARActivated = false;
|
||||||
|
public static bool VEFActivated = false;
|
||||||
public static bool AnimalGeneticsActivated = false;
|
public static bool AnimalGeneticsActivated = false;
|
||||||
|
|
||||||
public enum DetailLevel
|
public enum DetailLevel
|
||||||
|
@ -277,6 +278,7 @@ namespace RJW_Menstruation
|
||||||
if (!ModsConfig.BiotechActive && Configurations.PregnancySource == Configurations.PregnancyType.Biotech)
|
if (!ModsConfig.BiotechActive && Configurations.PregnancySource == Configurations.PregnancyType.Biotech)
|
||||||
Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy;
|
Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy;
|
||||||
Configurations.HARActivated = ModsConfig.IsActive("erdelf.HumanoidAlienRaces");
|
Configurations.HARActivated = ModsConfig.IsActive("erdelf.HumanoidAlienRaces");
|
||||||
|
Configurations.VEFActivated = ModsConfig.IsActive("oskarpotocki.vanillafactionsexpanded.core");
|
||||||
Configurations.AnimalGeneticsActivated = ModsConfig.IsActive("Mlie.AnimalGenetics");
|
Configurations.AnimalGeneticsActivated = ModsConfig.IsActive("Mlie.AnimalGenetics");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -554,8 +554,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Color c = Pawn.RaceProps.BloodDef.graphicData.color;
|
return Utility.BloodDef(Pawn).graphicData.color;
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -340,14 +340,4 @@ namespace RJW_Menstruation
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(Hediff_Pregnant), nameof(Hediff_Pregnant.Miscarry))]
|
|
||||||
public static class Miscarry_Patch
|
|
||||||
{
|
|
||||||
public static void Postfix(Hediff_Pregnant __instance)
|
|
||||||
{
|
|
||||||
HediffComp_PregeneratedBabies comp = __instance.TryGetComp<HediffComp_PregeneratedBabies>();
|
|
||||||
if (comp != null) comp.Miscarried();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,11 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
public static void Postfix(Hediff_Pregnant __instance)
|
public static void Postfix(Hediff_Pregnant __instance)
|
||||||
{
|
{
|
||||||
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
|
HediffComp_PregeneratedBabies babiesComp = __instance.TryGetComp<HediffComp_PregeneratedBabies>();
|
||||||
if (comp == null) return;
|
if (babiesComp != null) babiesComp.Miscarried();
|
||||||
comp.Pregnancy = null;
|
|
||||||
|
HediffComp_Menstruation menstruationComp = __instance.GetMenstruationCompFromPregnancy();
|
||||||
|
if (menstruationComp != null) menstruationComp.Pregnancy = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Compatibility\AnimalGeneticsCompatibility.cs" />
|
<Compile Include="Compatibility\AnimalGeneticsCompatibility.cs" />
|
||||||
<Compile Include="Compatibility\HARCompatibility.cs" />
|
<Compile Include="Compatibility\HARCompatibility.cs" />
|
||||||
|
<Compile Include="Compatibility\VECompatibility.cs" />
|
||||||
<Compile Include="CompBiosculpterPod_EggRestorationCycle.cs" />
|
<Compile Include="CompBiosculpterPod_EggRestorationCycle.cs" />
|
||||||
<Compile Include="Configurations.cs" />
|
<Compile Include="Configurations.cs" />
|
||||||
<Compile Include="Cum.cs" />
|
<Compile Include="Cum.cs" />
|
||||||
|
@ -159,6 +160,10 @@
|
||||||
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="VFECore">
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2023507013\1.5\Assemblies\VFECore.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||||
|
|
|
@ -457,5 +457,21 @@ namespace RJW_Menstruation
|
||||||
return Color.white;
|
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.
|
- Updated Traditional Chinese translation by Hydrogen.
|
||||||
- Added Russian translation by Angra Mainyu.
|
- Added Russian translation by Angra Mainyu.
|
||||||
- Inactive genes will no longer be applied to wombs.
|
- 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.
|
- Fix babies becoming the wrong pawnkind in some scenarios.
|
||||||
|
|
||||||
Version 1.0.9.4
|
Version 1.0.9.4
|
||||||
|
|
Loading…
Reference in a new issue