Пример #1
0
 public static void intialChest(Pawn pawn)
 {
     if (!HasChestPart(pawn))
     {
         pawn.health.AddHediff(HediffDefOf.LifeStages_NormalChest, BodyCache.Chest(pawn));
     }
 }
Пример #2
0
        private static void MoreChest(Pawn pawn, HediffDef chestThing)
        {
            if (pawn.health.hediffSet.HasHediff(chestThing))
            {
                return;
            }

            pawn.health.AddHediff(chestThing, BodyCache.Chest(pawn));

            var hediff = PawnHelper.GetHediff(pawn, chestThing, BodyCache.Chest(pawn), false);

            if (hediff == null)
            {
                hediff          = pawn.health.AddHediff(chestThing, BodyCache.Chest(pawn));
                hediff.Severity = 0.05f;
            }
            else
            {
                hediff.Severity = Math.Min(hediff.Severity + 0.1f * Rand.Value, 1f);
            }

            IEnumerable <Hediff> enumerable = pawn.health.hediffSet.hediffs.Where(x =>
                                                                                  x.def == HediffDefOf.LifeStages_NormalChest).ToList();

            foreach (var removeMe in enumerable)
            {
                pawn.health.RemoveHediff(removeMe);
            }
        }
Пример #3
0
 public static BodyPartRecord Where(this Pawn pawn, BodyPartDef where)
 {
     if (where == BodyPartDefOf.Chest)
     {
         return(BodyCache.Chest(pawn));
     }
     else if (where == BodyPartDefOf.Groin)
     {
         return(BodyCache.Groin(pawn));
     }
     else if (where == BodyPartDefOf.LifeStages_ReproductiveOrgans)
     {
         return(BodyCache.LifeStages_ReproductiveOrgans(pawn));
     }
     else
     {
         return(BodyHairHelper.WhatPart(pawn));
     }
 }
        public static BodyPartRecord WhatPart(Pawn pawn)
        {
            var validParts = BodyCache.ValidFurryParts(pawn);

            return(validParts.OrderByDescending(x => Rand.Value).First());
        }