Hediff after health loss - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

CompHediffAfterHealthLoss is a comp class that makes an animal get a health condition (hediff) after losing an amount of health

        //A comp class that applies a hediff to the pawn after losing a precent of it health

        public int healthPercent = 50;
        public int tickInterval = 1000;
        public HediffDef hediff;
        public float severity = 1;
        public BodyPartDef bodyPart = null;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. For example, this code makes the Durapods in VFE - Insectoids 2 lose their armor after their health is depleted

<comps>
	<li Class="VEF.AnimalBehaviours.CompProperties_HediffAfterHealthLoss">
		<healthPercent>80</healthPercent>
		<tickInterval>60</tickInterval>
		<hediff>VFEI2_ArmorDegradation</hediff>
		<severity>0.1</severity>
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️