public static void GiveShuffledBioTo_AdultAge_Postfix(Pawn pawn, FactionDef factionType, string requiredLastName, List <string> backstoryCategories) { // MethodInfo dynMethod = typeof(PawnBioAndNameGenerator).GetMethod("FillBackstorySlotShuffled", BindingFlags.NonPublic | BindingFlags.Instance); pawn.Name = PawnBioAndNameGenerator.GeneratePawnName(pawn, NameStyle.Full, requiredLastName); AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.FillBackstorySlotShuffled(pawn, BackstorySlot.Childhood, ref pawn.story.childhood, backstoryCategories, factionType); // dynMethod.Invoke(typeof(PawnBioAndNameGenerator), new object[] { pawn, BackstorySlot.Childhood, pawn.story.childhood, backstoryCategories, factionType }); if (pawn.RaceProps.lifeStageAges.First(x => x.def.reproductive) != null) { // Log.Message(string.Format("Pawn: {0}, Comes of age at: {1}, Adult: {2}", pawn.LabelShortCap, pawn.RaceProps.lifeStageAges.First(x => x.def.reproductive).minAge, pawn.ageTracker.AgeBiologicalYearsFloat)); if (pawn.ageTracker.AgeBiologicalYearsFloat >= pawn.RaceProps.lifeStageAges.First(x => x.def.reproductive).minAge) { // Log.Message(string.Format("Adult")); AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.FillBackstorySlotShuffled(pawn, BackstorySlot.Adulthood, ref pawn.story.adulthood, backstoryCategories, factionType); // dynMethod.Invoke(typeof(PawnBioAndNameGenerator), new object[] { pawn, BackstorySlot.Adulthood, pawn.story.adulthood, backstoryCategories, factionType }); } } }
// Token: 0x06001504 RID: 5380 RVA: 0x000A3BA2 File Offset: 0x000A1FA2 private static float BioSelectionWeight(PawnBio bio) { return(AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.SelectionWeightFactorFromWorkTagsDisabled(bio.adulthood.workDisables | bio.childhood.workDisables)); }
// Token: 0x06001503 RID: 5379 RVA: 0x000A3B95 File Offset: 0x000A1F95 private static float BackstorySelectionWeight(Backstory bs) { return(AM_PawnBioAndNameGenerator_GiveShuffledBioTo_AdultAge_Patch.SelectionWeightFactorFromWorkTagsDisabled(bs.workDisables)); }