Explode on x - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

This comprises four different classes: HediffComp_ExplodeOnDamage, HediffComp_ExplodeOnDowned, HediffComp_ExplodeOnFire and HediffComp_Exploder (on death)

HediffComp_ExplodeOnDamage:

        public int minDamageToExplode;

        public DamageDef damageType;
        public int damageAmount = -1;
        public float radius;
        public SoundDef sound = null;
        public ThingDef spawnThingDef = null;
        public float spawnThingChance = 0f;

HediffComp_ExplodeOnDowned:

    No parameters needed

HediffComp_ExplodeOnFire:

        public int minFireToExplode;

        public DamageDef damageType;
        public int damageAmount = -1;
        public float radius;
        public int ticksToRecheck;

HediffComp_Exploder:

        public float explosionForce = 5.9f;
        public DamageDef damageDef = null;

How do I use this code?

These are all comp classes, so you just add it in XML in the <comps> tag of the hediff you want to have this behaviour. For example, this is the hediff added by the "Chemfuel nodules" gene in Alpha Genes

<comps>
	<li Class="VEF.AnimalBehaviours.HediffCompProperties_Exploder">
		<explosionForce>2</explosionForce>
		<damageDef>Flame</damageDef>
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️