示例#1
0
 public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(
     Pawn pawn,
     RecipeDef recipe) => MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, (Func <BodyPartRecord, bool>)(record => pawn.health.hediffSet.GetNotMissingParts().Contains <BodyPartRecord>(record) && !pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(record) && !pawn.health.hediffSet.hediffs.Any <Hediff>((Predicate <Hediff>)(x =>
 {
     if (x.Part != record)
     {
         return(false);
     }
     return(x.def == recipe.addsHediff);
 }))));
示例#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;
     }));
 }
示例#3
0
 public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
 {
     return(MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, delegate(BodyPartRecord record)
     {
         IEnumerable <Hediff> source = pawn.health.hediffSet.hediffs.Where((Hediff x) => x.Part == record);
         if (source.Count() == 1 && source.First().def == recipe.addsHediff)
         {
             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;
     }));
 }
示例#4
0
 public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
 {
     return(MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn, delegate(BodyPartRecord record)
     {
         IEnumerable <Hediff> alreadyPresent = from x in pawn.health.hediffSet.hediffs
                                               where x.Part == record
                                               where x.def == recipe.addsHediff
                                               select x;
         return // hediff not already present
         !alreadyPresent.Any()
         // has something to attach to
         && (record.parent == null || pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null).Contains(record.parent))
         // is compatible with parent
         && !recipe.HasRestrictionsForPart(record, pawn.health.hediffSet)
         // part shouldn't be ignored
         && !pawn.health.hediffSet.PartShouldBeIgnored(record);
     }));
 }
示例#5
0
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            // don't add natural parts to prosthetics

            return
                (MedicalRecipesUtility.GetFixedPartsToApplyOn(recipe, pawn,
                                                              ( BodyPartRecord record ) =>
                                                              // part has some hediff
                                                              pawn.health.hediffSet.hediffs.Any(( Hediff x ) => x.Part == record)
                                                              // parent is not missing
                                                              && (record.parent == null || pawn.health.hediffSet.GetNotMissingParts().Contains(record.parent))
                                                              // parent is not an added part or is not solid (mainly for mutant arms and legs)
                                                              && (record.parent == null || !pawn.health.hediffSet.HasDirectlyAddedPartFor(record.parent) || !record.parent.def.IsSolid(record.parent, pawn.health.hediffSet.hediffs))
                                                              // is compatible with parent
                                                              && !recipe.HasRestrictionsForPart(record, pawn.health.hediffSet)
                                                              // part shouldn't be ignored
                                                              && !pawn.health.hediffSet.PartShouldBeIgnored(record)));
        }
示例#6
0
 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 && this.Operable(x, recipe))));
 }