<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>


	<ThingDef Name="BaseGun" Abstract="True">
		<category>Item</category>
		<eType>Equipment</eType>
		<thingClass>Equipment</thingClass>
		<label>Gun</label>
		<equipmentType>Primary</equipmentType>
		<isGun>True</isGun>
		<pathCost>10</pathCost>
		<useStandardHealth>True</useStandardHealth>
		<selectable>True</selectable>
		<maxHealth>100</maxHealth>
		<altitudeLayer>Item</altitudeLayer>
		<alwaysHaulable>True</alwaysHaulable>
		<tickerType>Never</tickerType>
		<techLevel>Midworld</techLevel>
		<storeCategories>
			<li>Weapons</li>
		</storeCategories>
		<weaponTags>
			<li>Gun</li>
		</weaponTags>
		<comps>
			<li>
				<compClass>CompForbiddable</compClass>
			</li>
		</comps>
		<verb>
      <category>Nonnative</category>
			<verbClass>Verb_Shoot</verbClass>
			<cooldownTicks>40</cooldownTicks>
			<label>VerbGun</label>
			<description>Fire a bullet.</description>
			<hasStandardCommand>true</hasStandardCommand>
			<targetParams>
				<canTargetPawns>true</canTargetPawns>
				<canTargetBuildings>true</canTargetBuildings>
				<worldObjectTargetsMustBeAutoAttackable>true</worldObjectTargetsMustBeAutoAttackable>
			</targetParams>
			<canMiss>true</canMiss>
		</verb>
	</ThingDef>

	<ThingDef Name="BaseBullet" Abstract="True">
		<category>Projectile</category>
		<tickerType>Normal</tickerType>
		<altitudeLayer>Projectile</altitudeLayer>
		<thingClass>Bullet</thingClass>
		<label>Bullet</label>
		<useStandardHealth>False</useStandardHealth>
		<neverMultiSelect>True</neverMultiSelect>
		<baseMaterialType>Transparent</baseMaterialType>
	</ThingDef>

	<!-- ============================================================== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_Pistol</defName>
		<label>Pistol bullet</label>
		<texturePath>Things/Projectile/Bullet_Small</texturePath>
		<projectile>
			<flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
			<DamageAmountBase>10</DamageAmountBase>
			<Speed>55</Speed>
		</projectile>
	</ThingDef>


	<ThingDef ParentName="BaseGun">
		<defName>Gun_Pistol</defName>
		<label>Pistol</label>
		<description>Ancient pattern automatic pistol. Weak and short range, but quick.</description>
		<texturePath>Things/Item/Equipment/Pistol</texturePath>
		<soundInteract>InteractPistol</soundInteract>
		<tradersCarry>True</tradersCarry>
		<basePrice>60</basePrice>
		<verb>
			<projectileDef>Bullet_Pistol</projectileDef>
      <accuracyTouch>0.91</accuracyTouch>
      <accuracyShort>0.71</accuracyShort>
      <accuracyMedium>0.50</accuracyMedium>
      <accuracyLong>0.32</accuracyLong>
			<warmupTicks>68</warmupTicks>
			<range>24</range>
			<fireSound>ShotPistol</fireSound>
		</verb>
	</ThingDef>

	<!-- ============================================================== -->


	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_PumpShotgun</defName>
		<label>Shotgun blast</label>
		<texturePath>Things/Projectile/Bullet_Shotgun</texturePath>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>20</damageAmountBase>
			<speed>55</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_PumpShotgun</defName>
		<label>Pump Shotgun</label>
		<description>Ancient design. Deadly, but short range.</description>
		<texturePath>Things/Item/Equipment/Shotgun</texturePath>
		<soundInteract>InteractShotgun</soundInteract>
		<tradersCarry>true</tradersCarry>
		<basePrice>175</basePrice>
		<verb>
			<projectileDef>Bullet_PumpShotgun</projectileDef>
			<warmupTicks>108</warmupTicks>
			<range>16</range>
      <accuracyTouch>0.96</accuracyTouch>
      <accuracyShort>0.87</accuracyShort>
      <accuracyMedium>0.77</accuracyMedium>
      <accuracyLong>0.64</accuracyLong>
			<fireSound>ShotShotgun</fireSound>
		</verb>
	</ThingDef>



	<!-- ============================================== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_LeeEnfield</defName>
		<label>Rifle bullet</label>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>18</damageAmountBase>
			<speed>70</speed>
		</projectile>
		<texturePath>Things/Projectile/Bullet_big</texturePath>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_LeeEnfield</defName>
		<label>Lee-Enfield</label>
		<description>Ancient bolt-action rifle. Probably pulled from a basement somewhere. Good range, Good power, low rate of fire.</description>
		<texturePath>Things/Item/Equipment/LeeEnfield</texturePath>
		<soundInteract>InteractRifle</soundInteract>
		<tradersCarry>true</tradersCarry>
		<basePrice>190</basePrice>
		<verb>
			<projectileDef>Bullet_LeeEnfield</projectileDef>
			<warmupTicks>182</warmupTicks>
			<range>37</range>
      <accuracyTouch>0.96</accuracyTouch>
      <accuracyShort>0.96</accuracyShort>
      <accuracyMedium>0.92</accuracyMedium>
      <accuracyLong>0.88</accuracyLong>
			<fireSound>ShotBoltActionRifle</fireSound>
		</verb>
	</ThingDef>

	<!-- ============================================== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_M16Rifle</defName>
		<label>M-16 bullet</label>
		<texturePath>Things/Projectile/Bullet_Small</texturePath>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>7</damageAmountBase>
			<speed>70</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_M16Rifle</defName>
		<label>M-16</label>
		<description>Ancient pattern military weapon. Three-round burst. Good range, low power, high rate of fire.</description>
		<texturePath>Things/Item/Equipment/M-16</texturePath>
		<soundInteract>InteractRifle</soundInteract>
		<tradersCarry>true</tradersCarry>
		<basePrice>325</basePrice>
		<verb>
			<projectileDef>Bullet_M16Rifle</projectileDef>
			<warmupTicks>108</warmupTicks>
			<range>32</range>
      <accuracyTouch>0.96</accuracyTouch>
      <accuracyShort>0.87</accuracyShort>
      <accuracyMedium>0.77</accuracyMedium>
      <accuracyLong>0.64</accuracyLong>
			<burstShotCount>3</burstShotCount>
			<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
			<fireSound>ShotM16Rifle</fireSound>
		</verb>
	</ThingDef>

	<!-- ============================================== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_M24Rifle</defName>
		<label>M-24 bullet</label>
		<texturePath>Things/Projectile/Bullet_Big</texturePath>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>40</damageAmountBase>
			<speed>100</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_M24Rifle</defName>
		<label>M-24</label>
		<description>Ancient pattern military sniper rifle. Bolt action. Long range, great accuracy and power.</description>
		<texturePath>Things/Item/Equipment/M-24</texturePath>
		<soundInteract>InteractRifle</soundInteract>
		<tradersCarry>true</tradersCarry>
		<basePrice>370</basePrice>
		<verb>
			<projectileDef>Bullet_M24Rifle</projectileDef>
			<warmupTicks>260</warmupTicks>
			<cooldownTicks>135</cooldownTicks>
			<range>45</range>
      <accuracyTouch>0.50</accuracyTouch>
      <accuracyShort>0.86</accuracyShort>
      <accuracyMedium>0.86</accuracyMedium>
      <accuracyLong>0.88</accuracyLong>
			<fireSound>ShotM24Rifle</fireSound>
		</verb>
		<weaponTags>
			<li>SniperRifle</li>
		</weaponTags>
	</ThingDef>

	<!-- ============================================== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_Uzi</defName>
		<label>Uzi bullet</label>
		<texturePath>Things/Projectile/Bullet_Small</texturePath>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>5</damageAmountBase>
			<speed>55</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_Uzi</defName>
		<label>Uzi</label>
		<description>Ancient pattern submachine gun. Short range, low power, high rate of fire.</description>
		<texturePath>Things/Item/Equipment/Uzi</texturePath>
		<soundInteract>InteractSMG</soundInteract>
		<tradersCarry>true</tradersCarry>
		<basePrice>200</basePrice>
		<verb>
			<projectileDef>Bullet_Uzi</projectileDef>
			<warmupTicks>108</warmupTicks>
			<range>24</range>
      <accuracyTouch>0.89</accuracyTouch>
      <accuracyShort>0.64</accuracyShort>
      <accuracyMedium>0.41</accuracyMedium>
      <accuracyLong>0.22</accuracyLong>
			<burstShotCount>4</burstShotCount>
			<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
			<fireSound>ShotUzi</fireSound>
		</verb>
	</ThingDef>

	<!-- ==================== T-9 incendiary launcher ========================== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_T9IncendiaryLauncher</defName>
		<label>T-9 Incendiary bolt</label>
		<texturePath>Things/Projectile/Charge_Small</texturePath>
		<thingClass>BulletIncendiary</thingClass>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>4</damageAmountBase>
			<speed>40</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_T9IncendiaryLauncher</defName>
		<label>T-9 incendiary launcher</label>
		<description>Incendiary bolt launcher. Starts fires.</description>
		<texturePath>Things/Item/Equipment/T-9</texturePath>
		<soundInteract>InteractRifle</soundInteract>
		<tradersCarry>true</tradersCarry>
		<basePrice>370</basePrice>
		<verb>
			<projectileDef>Bullet_T9IncendiaryLauncher</projectileDef>
      <ai_IsIncendiary>true</ai_IsIncendiary>
			<warmupTicks>182</warmupTicks>
			<range>24</range>
      <accuracyTouch>0.79</accuracyTouch>
      <accuracyShort>0.42</accuracyShort>
      <accuracyMedium>0.18</accuracyMedium>
      <accuracyLong>0.06</accuracyLong>
			<burstShotCount>1</burstShotCount>
			<fireSound>ShotT9Launcher</fireSound>
  </verb>
	</ThingDef>


	<!-- ===================== L-15 LMG ========================= -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_L15LMG</defName>
		<label>L-15 bullet</label>
		<texturePath>Things/Projectile/Bullet_Small</texturePath>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>7</damageAmountBase>
			<speed>40</speed>
		</projectile>
	</ThingDef>
	<ThingDef ParentName="BaseGun">
		<defName>Gun_L15LMG</defName>
		<label>L-15 LMG</label>
		<description>A light machine gun.</description>
		<texturePath>Things/Item/Equipment/L-15</texturePath>
		<soundInteract>InteractRifle</soundInteract>
		<basePrice>350</basePrice>
		<tradersCarry>true</tradersCarry>
		<verb>
			<projectileDef>Bullet_L15LMG</projectileDef>
			<warmupTicks>108</warmupTicks>
			<range>25.9</range>
      <accuracyTouch>0.89</accuracyTouch>
      <accuracyShort>0.64</accuracyShort>
      <accuracyMedium>0.41</accuracyMedium>
      <accuracyLong>0.22</accuracyLong>
			<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
			<burstShotCount>5</burstShotCount>
			<fireSound>ShotMinigun</fireSound>
		</verb>
	</ThingDef>


  <!-- ===================== R-4 charge rifle ========================= -->

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_R4ChargeRifle</defName>
    <label>Charge shot</label>
    <texturePath>Things/Projectile/Charge_Small</texturePath>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>14</damageAmountBase>
      <speed>70</speed>
    </projectile>
  </ThingDef>

  <ThingDef ParentName="BaseGun">
    <defName>Gun_R4ChargeRifle</defName>
    <label>R-4 charge rifle</label>
    <description>Charged-shot energy/projectile rifle.</description>
    <texturePath>Things/Item/Equipment/R-4</texturePath>
    <soundInteract>InteractChargeRifle</soundInteract>
    <tradersCarry>true</tradersCarry>
    <basePrice>500</basePrice>
    <techLevel>Spacer</techLevel>
    <verb>
      <projectileDef>Bullet_R4ChargeRifle</projectileDef>
      <warmupTicks>108</warmupTicks>
      <range>24</range>
      <accuracyTouch>0.95</accuracyTouch>
      <accuracyShort>0.83</accuracyShort>
      <accuracyMedium>0.68</accuracyMedium>
      <accuracyLong>0.53</accuracyLong>
      <ticksBetweenBurstShots>12</ticksBetweenBurstShots>
      <burstShotCount>3</burstShotCount>
      <fireSound>ShotChargeRifle</fireSound>
    </verb>
  </ThingDef>






  <!-- ================ Improvised turret gun ============== -->

	<ThingDef ParentName="BaseBullet">
		<defName>Bullet_TurretImprovised</defName>
		<label>Improvised turret bullet</label>
		<texturePath>Things/Projectile/Bullet_Small</texturePath>
		<projectile>
      <damageDef>Bullet</damageDef>
			<damageAmountBase>7</damageAmountBase>
			<speed>70</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseGun">
		<defName>Gun_TurretImprovised</defName>
		<label>Improvised turret gun</label>
		<menuHidden>true</menuHidden>
		<description>Jury-rigged gun attached to a turret.</description>
		<texturePath>Things/Item/Equipment/Default</texturePath>
		<soundInteract>InteractRifle</soundInteract>
		<canBeSpawningInventory>false</canBeSpawningInventory>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
		<verb>
			<projectileDef>Bullet_TurretImprovised</projectileDef>
			<warmupTicks>108</warmupTicks>
			<range>25.9</range>
      <accuracyTouch>0.89</accuracyTouch>
      <accuracyShort>0.64</accuracyShort>
      <accuracyMedium>0.41</accuracyMedium>
      <accuracyLong>0.22</accuracyLong>
			<ticksBetweenBurstShots>8</ticksBetweenBurstShots>
			<burstShotCount>3</burstShotCount>
			<fireSound>GunShotA</fireSound>
		</verb>
	</ThingDef>


  <!-- ======================= Mechanoid minigun ======================= -->

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_Minigun</defName>
    <label>Minigun bullet</label>
    <texturePath>Things/Projectile/Bullet_Small</texturePath>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>8</damageAmountBase>
      <speed>70</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseGun">
    <defName>Gun_Minigun</defName>
    <label>Minigun</label>
    <description>A multi-barrel machine gun with an extremely high rate of fire. Mechanoid-built.</description>
    <texturePath>Things/Item/Equipment/Minigun</texturePath>
    <soundInteract>InteractRifle</soundInteract>
    <basePrice>600</basePrice>
    <techLevel>Spacer</techLevel>
    <weaponTags>
      <li>MechanoidGunHeavy</li>
    </weaponTags>
    <verb>
      <projectileDef>Bullet_Minigun</projectileDef>
      <forcedMissRadius>2.4</forcedMissRadius>
      <warmupTicks>250</warmupTicks>
      <range>32</range>
      <accuracyTouch>0.79</accuracyTouch>
      <accuracyShort>0.42</accuracyShort>
      <accuracyMedium>0.18</accuracyMedium>
      <accuracyLong>0.06</accuracyLong>
      <burstShotCount>30</burstShotCount>
      <ticksBetweenBurstShots>4</ticksBetweenBurstShots>
      <fireSound>ShotMinigun</fireSound>
    </verb>
  </ThingDef>



  <!-- ================= Mechanoid heavy charge blaster ================= -->

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_ChargeBlasterHeavy</defName>
    <label>Charge blaster shot</label>
    <texturePath>Things/Projectile/Charge_Small</texturePath>
    <baseMaterialType>MotePostLight</baseMaterialType>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>18</damageAmountBase>
      <speed>90</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseGun">
    <defName>Gun_ChargeBlasterHeavy</defName>
    <label>Heavy charge blaster</label>
    <description>Charged-shot blaster for area suppressive fire. Mechanoid-built.</description>
    <texturePath>Things/Item/Equipment/ChargeBlasterHeavy</texturePath>
    <basePrice>800</basePrice>
    <techLevel>Spacer</techLevel>
    <destroyOnDrop>True</destroyOnDrop>
    <menuHidden>True</menuHidden>
    <weaponTags>
      <li>MechanoidGunHeavy</li>
    </weaponTags>
    <verb>
      <projectileDef>Bullet_ChargeBlasterHeavy</projectileDef>
      <forcedMissRadius>2.9</forcedMissRadius>
      <warmupTicks>200</warmupTicks>
      <cooldownTicks>270</cooldownTicks>
      <range>27</range>
      <accuracyTouch>0.93</accuracyTouch>
      <accuracyShort>0.77</accuracyShort>
      <accuracyMedium>0.59</accuracyMedium>
      <accuracyLong>0.42</accuracyLong>
      <ticksBetweenBurstShots>5</ticksBetweenBurstShots>
      <burstShotCount>24</burstShotCount>
      <fireSound>ShotChargeBlaster</fireSound>
    </verb>
  </ThingDef>

  <!-- ================= Mechanoid inferno cannon ================= -->

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_InfernoCannon</defName>
    <label>Inferno cannon shell</label>
    <texturePath>Things/Projectile/InfernoCannonShot</texturePath>
    <thingClass>Projectile_Explosive</thingClass>
    <projectile>
      <damageDef>Flame</damageDef>
      <damageAmountBase>50</damageAmountBase>
      <speed>45</speed>
      <explosionRadius >2.4</explosionRadius >
      <postExplosionSpawnThingDef>Puddle_Fuel</postExplosionSpawnThingDef>
      <explosionSpawnChance>0.3</explosionSpawnChance>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseGun">
    <defName>Gun_InfernoCannon</defName>
    <label>Inferno cannon</label>
    <description>Incendiary-shot mini-artillery device. Mechanoid-built.</description>
    <texturePath>Things/Item/Equipment/InfernoCannon</texturePath>
    <basePrice>900</basePrice>
    <techLevel>Spacer</techLevel>
    <destroyOnDrop>True</destroyOnDrop>
    <menuHidden>True</menuHidden>
    <weaponTags>
      <li>MechanoidGunHeavy</li>
    </weaponTags>
    <verb>
      <projectileDef>Bullet_InfernoCannon</projectileDef>
      <forcedMissRadius>3.5</forcedMissRadius>
      <ai_IsIncendiary>true</ai_IsIncendiary>
      <warmupTicks>100</warmupTicks>
      <cooldownTicks>270</cooldownTicks>
      <range>35</range>
      <accuracyTouch>0.79</accuracyTouch>
      <accuracyShort>0.42</accuracyShort>
      <accuracyMedium>0.18</accuracyMedium>
      <accuracyLong>0.06</accuracyLong>
      <burstShotCount>1</burstShotCount>
      <fireSound>InfernoCannon_Fire</fireSound>
    </verb>
  </ThingDef>

  
  
  <!-- ================= Mechanoid charge lance ================= -->

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_ChargeLance</defName>
    <label>Charge lance shot</label>
    <texturePath>Things/Projectile/ChargeLanceShot</texturePath>
    <baseMaterialType>MotePostLight</baseMaterialType>
    <overdraw>true</overdraw>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>27</damageAmountBase>
      <speed>120</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseGun">
    <defName>Gun_ChargeLance</defName>
    <label>Charge lance</label>
    <description>Charged-shot rail-assisted lance weapon. Fires a single charged shot at high velocity.</description>
    <texturePath>Things/Item/Equipment/ChargeLance</texturePath>
    <basePrice>500</basePrice>
    <techLevel>Spacer</techLevel>
    <destroyOnDrop>True</destroyOnDrop>
    <menuHidden>True</menuHidden>
    <weaponTags>
      <li>MechanoidGunMedium</li>
    </weaponTags>
    <verb>
      <projectileDef>Bullet_ChargeLance</projectileDef>
      <warmupTicks>120</warmupTicks>
      <cooldownTicks>170</cooldownTicks>
      <range>37</range>
      <accuracyTouch>0.6</accuracyTouch>
      <accuracyShort>0.8</accuracyShort>
      <accuracyMedium>0.92</accuracyMedium>
      <accuracyLong>0.88</accuracyLong>
      <burstShotCount>1</burstShotCount>
      <fireSound>ChargeLance_Fire</fireSound>
    </verb>
  </ThingDef>
  
  
  
</ThingDefs>