diff --git a/Assemblies/AlienRace.dll b/Assemblies/AlienRace.dll index 5bf74b41..424f1190 100644 Binary files a/Assemblies/AlienRace.dll and b/Assemblies/AlienRace.dll differ diff --git a/Source/AlienRace/AlienRace/HarmonyPatches.cs b/Source/AlienRace/AlienRace/HarmonyPatches.cs index a79d8256..4c114f4f 100644 --- a/Source/AlienRace/AlienRace/HarmonyPatches.cs +++ b/Source/AlienRace/AlienRace/HarmonyPatches.cs @@ -1809,24 +1809,17 @@ public static bool GenerateRandomOldAgeInjuriesPrefix(Pawn pawn) return true; } + public static bool FillBackstoryInSlotShuffledPrefix(Pawn pawn, BackstorySlot slot, ref Backstory backstory) { bioReference = null; if (slot == BackstorySlot.Adulthood && DefDatabase.GetNamedSilentFail(defName: pawn.story.childhood.identifier)?.linkedBackstory is string id && BackstoryDatabase.TryGetWithIdentifier(identifier: id, bs: out backstory)) return false; - + /* if ((pawn.def is ThingDef_AlienRace alienProps && alienProps.alienRace.generalSettings.pawnsSpecificBackstories || - (pawn.kindDef.GetModExtension()?.usePawnKindBackstories ?? false)) && !pawn.kindDef.backstoryCategory.NullOrEmpty()) + (pawn.kindDef.GetModExtension()?.usePawnKindBackstories ?? false)) && !pawn.kindDef.backstoryCategories.NullOrEmpty()) { - /* - Log.Message(pawn.def.defName); -re - Log.Message(string.Join("\n", BackstoryDatabase.allBackstories.Where(kvp => kvp.Value.shuffleable && kvp.Value.spawnCategories.Contains(pawn.kindDef.backstoryCategory) && - kvp.Value.slot == slot && (slot == BackstorySlot.Childhood || - !kvp.Value.requiredWorkTags.OverlapsWithOnAnyWorkType(pawn.story.childhood?.workDisables ?? WorkTags.None)) && - (DefDatabase.GetNamedSilentFail(kvp.Value.identifier)?.commonalityApproved(pawn.gender) ?? true)).Select(kvp => kvp.Value.identifier).ToArray())); - */ if (BackstoryDatabase.allBackstories.Where(predicate: kvp => kvp.Value.shuffleable && kvp.Value.spawnCategories.Contains(item: pawn.kindDef.backstoryCategory) && kvp.Value.slot == slot && (slot == BackstorySlot.Childhood || !kvp.Value.requiredWorkTags.OverlapsWithOnAnyWorkType( @@ -1841,12 +1834,13 @@ public static bool FillBackstoryInSlotShuffledPrefix(Pawn pawn, BackstorySlot sl Log.Message( text: - $"FAILED: {pawn.def.defName} {pawn.kindDef.defName} {pawn.kindDef.backstoryCategory} {BackstoryDatabase.allBackstories.Values.Count(predicate: bs => bs.spawnCategories.Contains(item: pawn.kindDef.backstoryCategory))}"); + $"FAILED: {pawn.def.defName} {pawn.kindDef.defName} {pawn.kindDef.backstoryCategories} {BackstoryDatabase.allBackstories.Values.Count(predicate: bs => bs.spawnCategories.Contains(item: pawn.kindDef.backstoryCategory))}"); } + */ return true; } - + private static PawnBioDef bioReference; // ReSharper disable once RedundantAssignment diff --git a/Source/AlienRace/AlienRace/ThingDef_AlienRace.cs b/Source/AlienRace/AlienRace/ThingDef_AlienRace.cs index 4efb9284..d33e3b8a 100644 --- a/Source/AlienRace/AlienRace/ThingDef_AlienRace.cs +++ b/Source/AlienRace/AlienRace/ThingDef_AlienRace.cs @@ -55,7 +55,6 @@ public class AlienSettings public class GeneralSettings { public float maleGenderProbability = 0.5f; - public bool pawnsSpecificBackstories = false; public bool immuneToAge = false; public bool canLayDown = true;