diff --git a/1.5/Assemblies/RJW_Menstruation.dll b/1.5/Assemblies/RJW_Menstruation.dll index d1e6a52..10ddb96 100644 Binary files a/1.5/Assemblies/RJW_Menstruation.dll and b/1.5/Assemblies/RJW_Menstruation.dll differ diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Compatibility/HARCompatibility.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Compatibility/HARCompatibility.cs index cf14a3a..1100c71 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Compatibility/HARCompatibility.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Compatibility/HARCompatibility.cs @@ -16,8 +16,19 @@ namespace RJW_Menstruation public static void CopyHARProperties(Pawn baby, Pawn original) { - if (!baby.HasComp() || !original.HasComp()) return; - AlienPartGenerator.AlienComp.CopyAlienData(original, baby); + AlienPartGenerator.AlienComp babyHARComp = baby?.TryGetComp(); + AlienPartGenerator.AlienComp originalHARComp = original?.TryGetComp(); + if (babyHARComp == null || originalHARComp == null) return; + + babyHARComp.addonVariants = new List(originalHARComp.addonVariants); + foreach (KeyValuePair> channel in originalHARComp.ColorChannels) + { + babyHARComp.OverwriteColorChannel(channel.Key, channel.Value.first, channel.Value.second); + } + babyHARComp.headVariant = originalHARComp.headVariant; + babyHARComp.bodyVariant = originalHARComp.bodyVariant; + babyHARComp.headMaskVariant = originalHARComp.headMaskVariant; + babyHARComp.bodyMaskVariant = originalHARComp.bodyMaskVariant; } } } diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 86b1330..d70909d 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1517,7 +1517,7 @@ namespace RJW_Menstruation { // ~1.5 per hour times acceleration float bledAmount = Utility.VariationRange(0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * HoursBetweenSimulations, 0.5f); - CumIn(Pawn, bledAmount, Translations.Menstrual_Blood, -5.0f, Utility.BloodDef(Pawn)); + CumIn(Pawn, bledAmount, Translations.Menstrual_Blood, -5.0f, Pawn.RaceProps?.BloodDef ?? ThingDefOf.Filth_Blood); Cum blood = GetNotCum(Translations.Menstrual_Blood); if (blood != null) blood.Color = BloodColor; } diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 3202a92..87401eb 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -457,7 +457,6 @@ namespace RJW_Menstruation return Color.white; } } - public static ThingDef BloodDef(Pawn pawn) { if (pawn == null) return ThingDefOf.Filth_Blood; diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs index 997db3c..2f386f8 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -1,6 +1,5 @@ using RimWorld; using rjw; -using System; using System.Collections.Generic; using System.Linq; using Verse; @@ -75,27 +74,26 @@ namespace RJW_Menstruation return allkinds; } } - private static HashSet GetCompHashSet(Type type) - { - HashSet set = new HashSet(); - foreach (HediffDef hediffDef in DefDatabase.AllDefsListForReading) - { - if (hediffDef.comps.NullOrEmpty()) continue; - foreach (HediffCompProperties comp in hediffDef.comps) - if (comp.compClass == type || (comp.compClass?.IsSubclassOf(type) ?? false)) - { - set.Add(hediffDef); - break; - } - } - return set; - } public static HashSet AllVaginas { get { if (allvaginas != null) return allvaginas; - allvaginas = GetCompHashSet(typeof(HediffComp_Menstruation)); + allvaginas = new HashSet(); + + foreach(HediffDef hediffDef in DefDatabase.AllDefsListForReading) + { + if (hediffDef.comps.NullOrEmpty()) continue; + foreach (HediffCompProperties comp in hediffDef.comps) + { + if (comp.compClass == typeof(HediffComp_Menstruation) || (comp.compClass?.IsSubclassOf(typeof(HediffComp_Menstruation)) ?? false)) + { + allvaginas.Add(hediffDef); + break; + } + } + } + return allvaginas; } } @@ -104,7 +102,21 @@ namespace RJW_Menstruation get { if (allanuses != null) return allanuses; - allanuses = GetCompHashSet(typeof(HediffComp_Anus)); + allanuses = new HashSet(); + + foreach (HediffDef hediffDef in DefDatabase.AllDefsListForReading) + { + if (hediffDef.comps.NullOrEmpty()) continue; + foreach (HediffCompProperties comp in hediffDef.comps) + { + if (comp.compClass == typeof(HediffComp_Anus) || (comp.compClass?.IsSubclassOf(typeof(HediffComp_Anus)) ?? false)) + { + allanuses.Add(hediffDef); + break; + } + } + } + return allanuses; } } @@ -113,7 +125,21 @@ namespace RJW_Menstruation get { if (allbreasts != null) return allbreasts; - allbreasts = GetCompHashSet(typeof(HediffComp_Breast)); + allbreasts = new HashSet(); + + foreach(HediffDef hediffDef in DefDatabase.AllDefsListForReading) + { + if (hediffDef.comps.NullOrEmpty()) continue; + foreach(HediffCompProperties comp in hediffDef.comps) + { + if (comp.compClass == typeof(HediffComp_Breast) || (comp.compClass?.IsSubclassOf(typeof(HediffComp_Breast)) ?? false)) + { + allbreasts.Add(hediffDef); + break; + } + } + } + return allbreasts; } }