示例#1
0
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            IEnumerable <BodyPartRecord> parts = pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null);

            using (IEnumerator <BodyPartRecord> enumerator = parts.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BodyPartRecord part = enumerator.Current;
                    if (pawn.health.hediffSet.HasDirectlyAddedPartFor(part))
                    {
                        yield return(part);
                    }
                    else if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part))
                    {
                        yield return(part);
                    }
                    else if (part != pawn.RaceProps.body.corePart && part.def.canSuggestAmputation && pawn.health.hediffSet.hediffs.Any((Hediff d) => !(d is Hediff_Injury) && d.def.isBad && d.Visible && d.Part == part))
                    {
                        yield return(part);
                    }
                }
            }
            yield break;
        }
示例#2
0
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            IEnumerable <BodyPartRecord> parts = pawn.health.hediffSet.GetNotMissingParts();

            using (IEnumerator <BodyPartRecord> enumerator = parts.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    _003CGetPartsToApplyOn_003Ec__Iterator0 _003CGetPartsToApplyOn_003Ec__Iterator = (_003CGetPartsToApplyOn_003Ec__Iterator0) /*Error near IL_0088: stateMachine*/;
                    BodyPartRecord part = enumerator.Current;
                    if (pawn.health.hediffSet.HasDirectlyAddedPartFor(part))
                    {
                        yield return(part);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                    if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part))
                    {
                        yield return(part);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                    if (part != pawn.RaceProps.body.corePart && part.def.canSuggestAmputation && pawn.health.hediffSet.hediffs.Any((Hediff d) => !(d is Hediff_Injury) && d.def.isBad && d.Visible && d.Part == part))
                    {
                        yield return(part);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            yield break;
IL_020b:
            /*Error near IL_020c: Unexpected return in MoveNext()*/;
        }
 public static Thing SpawnNaturalPartIfClean(Pawn pawn, BodyPartRecord part, IntVec3 pos, Map map)
 {
     if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part))
     {
         return(GenSpawn.Spawn(part.def.spawnThingOnRemoved, pos, map));
     }
     return(null);
 }
示例#4
0
        public static Thing SpawnNaturalPartIfClean(Pawn pawn, BodyPartRecord part, IntVec3 pos, Map map)
        {
            Thing result;

            if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part))
            {
                result = GenSpawn.Spawn(part.def.spawnThingOnRemoved, pos, map, WipeMode.Vanish);
            }
            else
            {
                result = null;
            }
            return(result);
        }
示例#5
0
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            IEnumerable <BodyPartRecord> notMissingParts = pawn.health.hediffSet.GetNotMissingParts();

            foreach (BodyPartRecord part in notMissingParts)
            {
                if (pawn.health.hediffSet.HasDirectlyAddedPartFor(part))
                {
                    yield return(part);
                }
                else if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part))
                {
                    yield return(part);
                }
                else if (part != pawn.RaceProps.body.corePart && part.def.canSuggestAmputation && pawn.health.hediffSet.hediffs.Any((Hediff d) => !(d is Hediff_Injury) && d.def.isBad && d.Visible && d.Part == part))
                {
                    yield return(part);
                }
            }
        }