public static Quirk MakeTagBasedQuirk(string key, string localizationKey, RaceTag tag)
 {
     return(new Quirk(
                key,
                localizationKey,
                (pawn, partner) => partner.Has(tag),
                sexProps => sexProps.HasPartner && sexProps.Partner.Has(tag),
                null,
                tag));
 }
Exemple #2
0
 public static bool Has(this Pawn pawn, RaceTag tag)
 {
     if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef))
     {
         return(raceGroupDef.tags != null && raceGroupDef.tags.Contains(tag.Key));
     }
     else
     {
         return(tag.DefaultWhenNoRaceGroupDef(pawn));
     }
 }
 Quirk(
     string key,
     string localizationKey,
     Func <Pawn, Pawn, bool> pawnSatisfies = null,
     Func <SexProps, bool> sexSatisfies    = null,
     Action <Pawn> afterAdd = null,
     RaceTag raceTag        = null)
 {
     Key               = key;
     LocaliztionKey    = localizationKey;
     PawnSatisfiesFunc = pawnSatisfies;
     SexSatisfiesFunc  = sexSatisfies;
     AfterAddFunc      = afterAdd;
     RaceTag           = raceTag;
     All.Add(this);
 }