protected void ResetDisabledImplantRecipes(CustomPawn pawn) { disabledImplantRecipes.Clear(); OptionsHealth healthOptions = PrepareCarefully.Instance.Providers.Health.GetOptions(pawn); foreach (RecipeDef recipeDef in healthOptions.ImplantRecipes) { if (recipeDef.appliedOnFixedBodyParts != null) { if (recipeDef.appliedOnFixedBodyParts.Count == 1) { foreach (var uniquePart in healthOptions.FindBodyPartsForDef(recipeDef.appliedOnFixedBodyParts[0])) { if (pawn.HasSameImplant(uniquePart.Record, recipeDef)) { disabledImplantRecipes.Add(recipeDef); break; } if (pawn.HasPartBeenReplaced(uniquePart.Record)) { disabledImplantRecipes.Add(recipeDef); break; } } } } } }
protected void ResetDisabledBodyParts(IEnumerable <BodyPartRecord> parts, CustomPawn pawn) { disabledBodyParts.Clear(); OptionsHealth healthOptions = PrepareCarefully.Instance.Providers.Health.GetOptions(pawn); foreach (var part in parts) { UniqueBodyPart uniquePart = healthOptions.FindBodyPartsForRecord(part); if (pawn.HasPartBeenReplaced(part) || pawn.HasAtLeastOnePartBeenReplaced(uniquePart.Ancestors.Select((UniqueBodyPart p) => { return(p.Record); }))) { disabledBodyParts.Add(part); } } }