Skip to content

HeavyWeapon

juanosarg edited this page Jun 4, 2026 · 2 revisions

<- Back

HeavyWeapon is a def extension that turns a weapon into a heavy weapon from Vanilla Weapons Expanded - Heavy weapons

      public List<string> supportedTraits;
      public List<string> supportedArmors;
      public List<string> supportedGenes;
      public string disableOptionLabelKey;
      public int weaponHitPointsDeductionOnShot;
      public bool isHeavy;

The verb used by the weapon will need to use the VEF.Weapons.Verb_Shoot verbClass

<verbClass>VEF.Weapons.Verb_Shoot</verbClass>

How do I use this code?

This Def Extension is added to the ThingDef of the weapon you want to add it to.

If you aren't sure if the ThingDef 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.

For example, the autocannon in Vanilla Weapons Expanded - Heavy weapons:

<modExtensions>
	<li Class="VEF.Weapons.HeavyWeapon">
		<weaponHitPointsDeductionOnShot>1</weaponHitPointsDeductionOnShot>
		<isHeavy>true</isHeavy>
		<supportedArmors>
			<li>VWE_Apparel_Exoframe</li>
		</supportedArmors>
		<supportedTraits>
			<li>Tough</li>
		</supportedTraits>
		<disableOptionLabelKey>VWE.CannotEquipHeavy</disableOptionLabelKey>
	</li>
</modExtensions>

The verb used by the weapon:

<verbs>
	<li>
		<verbClass>VEF.Weapons.Verb_Shoot</verbClass>
		<defaultProjectile>Bullet_AutocannonTurret</defaultProjectile>
		<hasStandardCommand>true</hasStandardCommand>
		<warmupTime>0</warmupTime>
		<minRange>5.9</minRange>
		<range>32.9</range>
		<ticksBetweenBurstShots>17</ticksBetweenBurstShots>
		<burstShotCount>7</burstShotCount>
		<soundCast>Shot_Autocannon</soundCast>
		<soundCastTail>GunTail_Heavy</soundCastTail>
		<muzzleFlashScale>12</muzzleFlashScale>
	</li>
</verbs>

Clone this wiki locally