<?xml version="1.0" encoding="utf-8" ?>
<Defs>
    <ThingDef Name="40mmShellBase" ParentName="ResourceBase" Abstract="True">
    <soundInteract>Metal_Drop</soundInteract>
    <soundDrop>Standard_Drop</soundDrop>
    <tickerType>Normal</tickerType>
    <stackLimit>10</stackLimit>
    <techLevel>Industrial</techLevel>
    <statBases>
      <MaxHitPoints>70</MaxHitPoints>
      <MarketValue>10</MarketValue>
      <Mass>10.0</Mass>
      <Flammability>1.0</Flammability>
      <DeteriorationRate>1.5</DeteriorationRate>
    </statBases>
    <thingCategories>
      <li>AAA_40mmShells</li>
    </thingCategories>
    <tradeTags>
      <li>AAA_40mmShells</li>
    </tradeTags>
  </ThingDef>
<ThingDef Name="Makeable40mmShellBase" ParentName="40mmShellBase" Abstract="True">
    <recipeMaker>
      <workSpeedStat>SmithingSpeed</workSpeedStat>
      <effectWorking>Cook</effectWorking>
      <soundWorking>Recipe_Machining</soundWorking>
      <workAmount>200</workAmount>
      <targetCountAdjustment>5</targetCountAdjustment>
      <workSkill>Crafting</workSkill>
      <recipeUsers>
        <li>TableMachining</li>
      </recipeUsers>
	    <researchPrerequisite>AAA_Autocannon</researchPrerequisite>
    </recipeMaker>
  </ThingDef>

  <!-- High-explosive -->

  <ThingDef ParentName="Makeable40mmShellBase">
    <defName>40mm_Shell_HighExplosive</defName>
    <label>40mm HE round clip</label>
    <description>A shell filled with high explosives. Explodes when damaged.</description>
    <graphicData>
      <texPath>AAA/shell/40mmHE</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <comps>
      <li Class="CompProperties_Explosive">
        <explosiveRadius>2.0</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <explosiveExpandPerStackcount>0.4</explosiveExpandPerStackcount>
        <startWickHitPointsPercent>0.333</startWickHitPointsPercent>
        <wickTicks>
          <min>10</min>
          <max>30</max>
        </wickTicks>
      </li>
    </comps>
    <projectileWhenLoaded>Bullet_40mm_HighExplosive</projectileWhenLoaded>
    <costList>
      <Steel>45</Steel>
      <Chemfuel>35</Chemfuel>
    </costList>

  </ThingDef>

	<ThingDef ParentName="AAA_BaseProjectileCustom">
    <defName>Bullet_40mm_HighExplosive</defName>
    <label>40mm HE round clip</label>
    <graphicData>
      <texPath>AAA/projectile/ShellSmallBomb</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>TransparentPostLight</shaderType>
    </graphicData>
    <!--thingClass>Projectile_Explosive</thingClass-->
	<comps>
	  <li Class="AAA.CompProperties_ProjectileMultiple">
			<pellets>2</pellets>
	  		<scatterRadiusAt10tilesAway>0.50</scatterRadiusAt10tilesAway>
	 </li>

	  <li Class="AAA.CompProperties_ProjectileExtraDamage">
        <damageAmountBase>60</damageAmountBase>
        <damageDef>Bullet</damageDef>
		</li>
    </comps>
    <projectile>
      <damageDef>Bomb</damageDef>
      <damageAmountBase>15</damageAmountBase>
      <speed>91</speed>
      <explosionRadius>1.9</explosionRadius>
      <flyOverhead>false</flyOverhead>
      <soundExplode>MortarBomb_Explode</soundExplode>
      <soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
      <soundAmbient>MortarRound_Ambient</soundAmbient>
    </projectile>

  </ThingDef>


	<!-- Armor piercing -->

  <!--ThingDef ParentName="Makeable40mmShellBase">
    <defName>40mm_Shell_ArmorPiercing</defName>
    <label>40mm AP round</label>
    <description>A shell filled with high explosives.Contains enough ammo to burst fire several times. Explodes when damaged.</description>
    <graphicData>
      <texPath>AAA/shell/40mmHE</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <comps>
      <li Class="CompProperties_Explosive">
        <explosiveRadius>2.0</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <explosiveExpandPerStackcount>0.4</explosiveExpandPerStackcount>
        <startWickHitPointsPercent>0.333</startWickHitPointsPercent>
        <wickTicks>
          <min>10</min>
          <max>30</max>
        </wickTicks>
      </li>
    </comps>
    <projectileWhenLoaded>Bullet_40mm_ArmorPiercing</projectileWhenLoaded>
    <costList>
      <Steel>80</Steel>
      <Chemfuel>30</Chemfuel>
    </costList>
	  <researchPrerequisites>
      <li>AAA_Autocannon</li>
    </researchPrerequisites>
  </ThingDef>

	<ThingDef ParentName="AAA_BaseProjectileCustom">
    <defName>Bullet_40mm_ArmorPiercing</defName>
    <label>40mm AP round</label>
    <graphicData>
      <texPath>AAA/projectile/ShellSmallBomb</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>TransparentPostLight</shaderType>
    </graphicData>
	<comps>
	  <li Class="AAA.CompProperties_ProjectileMultiple">
			<pellets>2</pellets>
			<scatterRadiusAt10tilesAway>0.0</scatterRadiusAt10tilesAway>
	  </li>
    </comps>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>50</damageAmountBase>
      <speed>91</speed>
       <flyOverhead>false</flyOverhead>
       <soundAmbient>MortarRound_Ambient</soundAmbient>
    </projectile>
  </ThingDef-->

	 <ThingDef ParentName="Makeable40mmShellBase">
    <defName>40mm_Shell_Incendiary</defName>
    <label>40mm Incendiary round clip</label>
    <description>A 40mm shell filled with Incendiary. Explodes when damaged.</description>
    <graphicData>
      <texPath>AAA/shell/40mmIncendiary</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <comps>
      <li Class="CompProperties_Explosive">
        <explosiveRadius>2.0</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <explosiveExpandPerStackcount>0.4</explosiveExpandPerStackcount>
        <startWickHitPointsPercent>0.333</startWickHitPointsPercent>
        <wickTicks>
          <min>10</min>
          <max>30</max>
        </wickTicks>
      </li>
    </comps>
    <projectileWhenLoaded>Bullet_40mm_Incendiary</projectileWhenLoaded>
    <costList>
      <Steel>30</Steel>
      <Chemfuel>50</Chemfuel>
    </costList>

  </ThingDef>

	<ThingDef ParentName="AAA_BaseProjectileCustom">
    <defName>Bullet_40mm_Incendiary</defName>
    <label>40mm Incendiary round clip</label>
    <graphicData>
      <texPath>AAA/projectile/ShellIncendiarySmall</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>TransparentPostLight</shaderType>
    </graphicData>
	<comps>
	  <li Class="AAA.CompProperties_ProjectileMultiple">
			<pellets>2</pellets>
	 		<scatterRadiusAt10tilesAway>0.50</scatterRadiusAt10tilesAway>
	  </li>
	    <li Class="AAA.CompProperties_ProjectileExtraDamage">
        <damageAmountBase>60</damageAmountBase>
        <damageDef>Bullet</damageDef>
		</li>
    </comps>
  	<projectile>
			<damageDef>Flame</damageDef>
			<damageAmountBase>8</damageAmountBase>
			<speed>81</speed>
			<explosionRadius>1.9</explosionRadius >
			<preExplosionSpawnThingDef>FilthFuel</preExplosionSpawnThingDef>
			<preExplosionSpawnChance>0.27</preExplosionSpawnChance>
      <ai_IsIncendiary>true</ai_IsIncendiary>
		</projectile>
  </ThingDef>
</Defs>
