public void TryHealRandomDermalWound() { if (base.Pawn.health.hediffSet.hediffs.Where((Hediff hd) => hd.IsPermanent() || hd.def.chronic).TryRandomElement(out Hediff result)) { if (Props.excludeChronic == true) { if (result.def.chronic) { return; } } foreach (BodyPartDef bodyPart in Props.exclusionList) { if (result.Part.def == bodyPart) { return; } } HealthUtility.Cure(result); if (PawnUtility.ShouldSendNotificationAbout(base.Pawn)) { Messages.Message("MessagePermanentWoundHealed".Translate(parent.LabelCap, base.Pawn.LabelShort, result.Label, base.Pawn.Named("PAWN")), base.Pawn, MessageTypeDefOf.PositiveEvent); } } }
private void FullyRepair(Pawn currentRobo) { FleckMaker.ThrowDustPuffThick(currentRobo.Position.ToVector3(), currentRobo.Map, Rand.Range(1.5f, 3f), new UnityEngine.Color(1f, 1f, 1f, 2.5f)); foreach (var hediff in currentRobo.health.hediffSet.hediffs.Reverse <Hediff>()) { if (hediff is Hediff_Injury || hediff is Hediff_MissingPart) { HealthUtility.Cure(hediff); } } }