Examples - AndroidQuazar/VanillaExpandedFramework GitHub Wiki

Race Verb

Here is an example patch operation that adds two verbs to every animal:

<Operation Class="PatchOperationAdd">
	<xpath>/Defs/ThingDef[@Name = "AnimalThingBase"]</xpath>
	<value>
		<verbs>
			<li>
				<verbClass>Verb_Shoot</verbClass>
				<accuracyTouch>1</accuracyTouch>
				<accuracyShort>1</accuracyShort>
				<accuracyMedium>0</accuracyMedium>
				<accuracyLong>0</accuracyLong>
				<hasStandardCommand>true</hasStandardCommand>
				<defaultProjectile>Bullet_PurgeRifle</defaultProjectile>
				<warmupTime>1</warmupTime>
				<burstShotCount>1</burstShotCount>
				<minRange>1</minRange>
				<range>20</range>
				<label>short range</label>
				<muzzleFlashScale>0</muzzleFlashScale>
			</li>
			<li>
				<verbClass>Verb_Shoot</verbClass>
				<accuracyTouch>0</accuracyTouch>
				<accuracyShort>0</accuracyShort>
				<accuracyMedium>1</accuracyMedium>
				<accuracyLong>1</accuracyLong>
				<hasStandardCommand>true</hasStandardCommand>
				<defaultProjectile>Bullet_PurgeRailgun</defaultProjectile>
				<warmupTime>1</warmupTime>
				<burstShotCount>1</burstShotCount>
				<minRange>20</minRange>
				<range>30</range>
				<label>long range</label>
				<muzzleFlashScale>0</muzzleFlashScale>
			</li>
		</verbs>
	</value>
</Operation>

Hediff Verb and Drawing and Independent Fire

Here is an example of a hediff that adds an independently firing and rendered minigun to the pawn.

<HediffDef ParentName="ImplantHediffBase">
  <defName>TorsoMinigun</defName>
  <label>mounted minigun</label>
  <labelNoun>a mounted minigun</labelNoun>
  <description>A minigun mounted to the torso.</description>
  <comps>
    <li Class="MVCF.Comps.HediffCompProperties_ExtendedVerbGiver">
      <verbs>
        <li>
          <verbClass>Verb_Shoot</verbClass>
          <label>minigun</label>
          <hasStandardCommand>true</hasStandardCommand>
          <defaultProjectile>Bullet_Minigun</defaultProjectile>
          <warmupTime>2.5</warmupTime>
          <range>30.9</range>
          <burstShotCount>25</burstShotCount>
          <ticksBetweenBurstShots>5</ticksBetweenBurstShots>
          <soundCast>Shot_Minigun</soundCast>
          <soundCastTail>GunTail_Medium</soundCastTail>
          <muzzleFlashScale>9</muzzleFlashScale>
          <commandIcon>Things/Item/Equipment/WeaponRanged/Minigun</commandIcon>
        </li>
      </verbs>
      <verbProps>
        <li>
          <label>minigun</label>
          <draw>true</draw>
          <canBeToggled>true</canBeToggled>
          <graphic>
            <texPath>Things/Item/Equipment/WeaponRanged/Minigun</texPath>
            <graphicClass>Graphic_Single</graphicClass>
          </graphic>
          <canFireIndependently>true</canFireIndependently>
        </li>
      </verbProps>
    </li>
  </comps>
</HediffDef>

Equipment

Here is an example of a weapon with multiple verbs, where one has its own texture and fires independently:

<ThingDef ParentName="BaseHumanMakeableGun">
  <defName>MVCF_Gun_SuperChargeRifle</defName>
  <label>super charge rifle</label>
  <description>A charged-shot assault rifle. Pulse-charge technology charges each shot with unstable energy as it leaves the barrel. Released on impact, the charged energy greatly increases the damage done.</description>
  <techLevel>Spacer</techLevel>
  <graphicData>
    <texPath>Things/Item/Equipment/WeaponRanged/ChargeRifle</texPath>
    <graphicClass>Graphic_Single</graphicClass>
  </graphicData>
  <soundInteract>Interact_ChargeRifle</soundInteract>
  <statBases>
    <Mass>4.6</Mass>
    <AccuracyTouch>0.55</AccuracyTouch>
    <AccuracyShort>0.64</AccuracyShort>
    <AccuracyMedium>0.55</AccuracyMedium>
    <AccuracyLong>0.45</AccuracyLong>
    <RangedWeapon_Cooldown>2.00</RangedWeapon_Cooldown>
  </statBases>
  <verbs>
    <li>
      <verbClass>Verb_Shoot</verbClass>
      <hasStandardCommand>true</hasStandardCommand>
      <defaultProjectile>Bullet_ChargeRifle</defaultProjectile>
      <warmupTime>1.0</warmupTime>
      <range>25.9</range>
      <ticksBetweenBurstShots>12</ticksBetweenBurstShots>
      <burstShotCount>3</burstShotCount>
      <soundCast>Shot_ChargeRifle</soundCast>
      <soundCastTail>GunTail_Medium</soundCastTail>
      <muzzleFlashScale>9</muzzleFlashScale>
      <label>primary</label>
    </li>
    <li>
      <verbClass>Verb_Shoot</verbClass>
      <hasStandardCommand>true</hasStandardCommand>
      <defaultProjectile>Bullet_ChargeLance</defaultProjectile>
      <warmupTime>1.7</warmupTime>
      <range>29.9</range>
      <soundCast>ChargeLance_Fire</soundCast>
      <soundCastTail>GunTail_Heavy</soundCastTail>
      <muzzleFlashScale>9</muzzleFlashScale>
      <label>secondary</label>
    </li>
  </verbs>
  <comps Inherit="False">
    <li Class="MVCF.Comps.CompProperties_VerbProps">
      <compClass>CompEquippable</compClass>
      <verbProps>
        <li>
          <canFireIndependently>true</canFireIndependently>
          <graphic>
            <texPath>Things/Item/Equipment/WeaponRanged/ChargeLance</texPath>
            <graphicClass>Graphic_Single</graphicClass>
          </graphic>
          <draw>true</draw>
          <label>secondary</label>
          <canBeToggled>true</canBeToggled>
        </li>
        <li>
          <label>primary</label>
          <canBeToggled>true</canBeToggled>
        </li>
      </verbProps>
    </li>
  </comps>
</ThingDef>

Apparel

Here is an example of a piece of armor with an attack: (Credit to Fraudecon)

<ThingDef ParentName="ApparelArmorReconBase">
	<defName>Test_SteamArmor</defName>
	<label>steam armor</label>
	<description>A suit of armor with an onboard steam generator that steadily creates steam pressure. This steam can be used to power additional steam devices including accessories, apparel, and weapons. It also comes with an internal steam repeater.</description>
	<apparel>
		<tags>
			<li>SpacerMilitary</li>
		</tags>
	</apparel>
	<verbs>
		<li>
			<verbClass>Verb_Shoot</verbClass>
			<label>steamshot</label>
			<defaultProjectile>Bullet_AutocannonTurret</defaultProjectile>
			<warmupTime>0</warmupTime>
			<minRange>8.9</minRange>
			<range>32.9</range>
			<ticksBetweenBurstShots>17</ticksBetweenBurstShots>
			<burstShotCount>3</burstShotCount>
			<soundCast>Shot_Autocannon</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>12</muzzleFlashScale>
		</li>
	</verbs>
	<tickerType>Normal</tickerType>
	<comps>
		<li Class="MVCF.Comps.CompProperties_VerbGiver">
			<verbProps>
				<li>
					<label>steamshot</label>
					<visualLabel>steam autocannon</visualLabel>
					<canBeToggled>true</canBeToggled>
					<description>A mounted steam-based autocannon</description>
				</li>
			</verbProps>
		</li>
	</comps>
</ThingDef>
⚠️ **GitHub.com Fallback** ⚠️