Example #1
0
 public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
 {
     return(MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, delegate(BodyPartRecord record)
     {
         if (!pawn.health.hediffSet.hediffs.Any((Hediff x) => x.Part == record))
         {
             return false;
         }
         if (record.parent != null && !pawn.health.hediffSet.GetNotMissingParts().Contains(record.parent))
         {
             return false;
         }
         return (!pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(record) || pawn.health.hediffSet.HasDirectlyAddedPartFor(record)) ? true : false;
     }));
 }
Example #2
0
 public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
 {
     return(MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, delegate(BodyPartRecord record)
     {
         if (!pawn.health.hediffSet.GetNotMissingParts().Contains(record))
         {
             return false;
         }
         if (pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(record))
         {
             return false;
         }
         return (!pawn.health.hediffSet.hediffs.Any((Hediff x) => x.Part == record && (x.def == recipe.addsHediff || !recipe.CompatibleWithHediff(x.def)))) ? true : false;
     }));
 }
 public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
 {
     return(MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, (BodyPartRecord record) => pawn.health.hediffSet.hediffs.Any((Hediff x) => x.Part == record && Operable(x, recipe)) ? true : false));
 }