Active Terrain Give Hediffs - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

TerrainCompProperties_HediffGiver allows the terrain to give hediffs to pawns crossing it. Since humanlikes and animal hediffs can be very different, we separated them into different lists

    public List<HediffData> hediffsForHumanlike;
    public List<HediffData> hediffsForAnimals;

HediffData is a container class:

public class HediffData
{
    public HediffDef hediff;
    public int hediffLimit;
    public bool randomBodyParts = false;
}

How do I use this code?

It is a comp class, so you just add it in XML in the <terrainComps> tag of the ActiveTerrain.

<terrainComps>
	<li Class="VEF.Maps.TerrainCompProperties_HediffGiver">
		<hediffsForHumanlike>
			<li MayRequire="Ludeon.RimWorld.Anomaly">
				<hediff MayRequire="Ludeon.RimWorld.Anomaly">Tentacle</hediff>
				<hediffLimit>2</hediffLimit>
			</li>
			<li>
				<hediff>AB_MalevolentEye</hediff>
				<hediffLimit>7</hediffLimit>
				<randomBodyParts>true</randomBodyParts>
			</li>
		</hediffsForHumanlike>
		<hediffsForAnimals>
			<li MayRequire="Ludeon.RimWorld.Anomaly">
				<hediff MayRequire="Ludeon.RimWorld.Anomaly">AB_AnimalTentacle</hediff>
				<hediffLimit>4</hediffLimit>
			</li>
			<li>
				<hediff>AB_MalevolentEye</hediff>
				<hediffLimit>7</hediffLimit>
				<randomBodyParts>true</randomBodyParts>
			</li>
		</hediffsForAnimals>
	</li>	
</terrainComps>
⚠️ **GitHub.com Fallback** ⚠️