예제 #1
0
        public static void Add(Pawn pawn, Quirk quirk)
        {
            if (!pawn.Has(quirk))
            {
                var hasFertility = pawn.RaceHasFertility();
                if (quirk == Quirk.Fertile && (!hasFertility || CompRJW.Comp(pawn).quirks.ToString().Contains(Quirk.Infertile.Key)))
                {
                    return;
                }
                if (quirk == Quirk.Infertile && (!hasFertility || CompRJW.Comp(pawn).quirks.ToString().Contains(Quirk.Fertile.Key)))
                {
                    return;
                }
                // No fair having a fetish for your own race.
                // But tags don't conflict so having a fetish for robot plant dragons is fine.
                if (quirk.RaceTag != null && pawn.Has(quirk.RaceTag))
                {
                    return;
                }
                if (quirk == Quirk.Fertile)
                {
                    var fertility = HediffDef.Named("IncreasedFertility");
                    if (fertility != null)
                    {
                        pawn.health.AddHediff(fertility);
                    }
                }
                if (quirk == Quirk.Infertile)
                {
                    var infertility = HediffDef.Named("DecreasedFertility");
                    if (infertility != null)
                    {
                        pawn.health.AddHediff(infertility);
                    }
                }

                CompRJW.Comp(pawn).quirks.AppendWithComma(quirk.Key);
                CompRJW.Comp(pawn).quirksave = CompRJW.Comp(pawn).quirks.ToString();
                quirk.DoAfterAdd(pawn);
            }
        }
예제 #2
0
 public static void Add(this Pawn pawn, Quirk quirk)
 {
     QuirkAdder.Add(pawn, quirk);
 }
예제 #3
0
 public static bool Has(this Pawn pawn, Quirk quirk)
 {
     return(xxx.has_quirk(pawn, quirk.Key));
 }