private static void GiveShuffledBioTo(Pawn pawn, FactionDef factionType, string requiredLastName, List <BackstoryCategoryFilter> backstoryCategories) { AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.FillBackstorySlotShuffled(pawn, BackstorySlot.Childhood, ref pawn.story.childhood, pawn.story.adulthood, backstoryCategories, factionType); if (pawn.ageTracker.AgeBiologicalYearsFloat >= pawn.RaceProps.lifeStageAges.First(x => x.def.reproductive).minAge) { AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.FillBackstorySlotShuffled(pawn, BackstorySlot.Adulthood, ref pawn.story.adulthood, pawn.story.childhood, backstoryCategories, factionType); } pawn.Name = PawnBioAndNameGenerator.GeneratePawnName(pawn, NameStyle.Full, requiredLastName); }
public static void Notify_EquipmentAddedPostfix(Pawn_AgeTracker __instance) { Traverse traverse = Traverse.Create(__instance); Pawn pawn = (Pawn)AM_Pawn_AgeTracker_AgeTick_ActivatableEffect_Patch.pawn.GetValue(__instance); if (pawn != null) { if (pawn.story != null) { if (pawn.story.adulthood == null) { if (pawn.isAdult()) { List <BackstoryCategoryFilter> backstoryCategoryFiltersFor = AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.GetBackstoryCategoryFiltersFor(pawn, pawn.Faction.def); AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.FillBackstorySlotShuffled(pawn, BackstorySlot.Adulthood, ref pawn.story.adulthood, pawn.story.childhood, backstoryCategoryFiltersFor, pawn.Faction.def); } } } } }