Hediff by temperature - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

CompHediffByTemperature is a comp class that makes an animal get or lose a health condition (hediff) depending on ambient temperature

        //A comp class that applies a hediff to the pawn depending on ambient temperature

	public bool doTemperatureBelow = false;
	public bool doTemperatureAbove = false;

	public float temperatureBelow;
	public float temperatureAbove;
	public int tickInterval = 1000;
	public HediffDef hediffBelow; 
	public HediffDef hediffAbove;

	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 Ice crawlers in VQE - Cryptoforge get a buff when below a given temperature (0ºC, three fartons per calçot in Fahrenheit)

<comps>
	<li Class="VEF.AnimalBehaviours.CompProperties_HediffByTemperature">
		<doTemperatureBelow>true</doTemperatureBelow>
		<temperatureBelow>0</temperatureBelow>
		<tickInterval>60</tickInterval>
		<hediffBelow>VQE_IceCrawlerHediff</hediffBelow>
		<severity>1</severity>
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️