using Verse; using RimWorld; using rjw; using System.Collections.Generic; using rjw.Modules.Quirks; using System; namespace RJW_Genes { public class QuirkPatcher { public static void CountSatisfiedPostfix(ref int __result, SexProps props) { Pawn pawn = props.pawn; Pawn partner = props.partner; if(pawn!=null && partner != null) { if(!pawn.IsHuman()||!partner.IsHuman()) { return; } } int count = -1; List listquirk = new List(); string s; foreach (Gene g in partner.genes.GenesListForReading) { if (partner.genes.HasActiveGene(g.def)) { s = null; s = g.def?.GetModExtension()?.Satisfiedquirk; if (!string.IsNullOrEmpty(s)) { listquirk.Add(s); } } } foreach (Quirk q in Quirk.All) { if (pawn.Has(q)) { foreach (string s2 in listquirk) { if (!string.IsNullOrEmpty(s2)) if (q.LocaliztionKey==s2) { count++; Quirk.AddThought(pawn); } } } } if(count>0)__result = __result + count; return; } } }