Skip to content

DamageExtension

juanosarg edited this page Jun 3, 2026 · 1 revision

<- Back

DamageExtension is a def extension that adds a few custom behaviours for damages.

      public FloatRange pushBackDistance;
      public SoundDef soundOnDamage;
      public FleckDef fleckOnDamage;
      public float fleckRadius;
      public bool fleckOnInstigator;

For it to work, the damage class needs to be set to DamageWorker_PushBackAttackMelee

How do I use this code?

This Def Extension is added to the DamageDef of the damage you want to add it to.

If you aren't sure if the DamageDef ALREADY has an extension (for example, if you think another mod will add their own), always use XPATH (xml patching) to add an extension, as there is already a PatchOperationAddModExtension to ensure they don't collide.

You will also need to set the class of that damage def to:

	<workerClass>VEF.Weapons.DamageWorker_PushBackAttackMelee</workerClass>

For example, the gavity hammer in Vanilla Factions Expanded-Pirates:

<modExtensions>
	<li Class="VEF.Weapons.DamageExtension">
		<pushBackDistance>3</pushBackDistance>
		<soundOnDamage>DropPod_Open</soundOnDamage>
	</li>
</modExtensions>

Clone this wiki locally