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

	<ThingCategoryDef>
		<defName>Ammo20x138mmB</defName>
		<label>20x138mmB</label>
		<parent>AmmoHighCaliber</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberHighCaliber</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_20x138mmB</defName>
		<label>20x138mmB</label>
		<ammoTypes>
			<Ammo_20x138mmB_AP>Bullet_20x138mmB_AP</Ammo_20x138mmB_AP>
			<Ammo_20x138mmB_Incendiary>Bullet_20x138mmB_Incendiary</Ammo_20x138mmB_Incendiary>
			<Ammo_20x138mmB_HE>Bullet_20x138mmB_HE</Ammo_20x138mmB_HE>
			<Ammo_20x138mmB_Sabot>Bullet_20x138mmB_Sabot</Ammo_20x138mmB_Sabot>
		</ammoTypes>
		<similarTo>AmmoSet_Autocannon</similarTo>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="Ammo20x138mmBBase" ParentName="MediumAmmoBase" Abstract="True">
		<description>A medium caliber cartridge used by autocannons and a handful of anti-tank rifles.</description>
		<statBases>
			<Mass>0.3</Mass>
			<Bulk>0.26</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting</li>
		</tradeTags>
		<thingCategories>
			<li>Ammo20x138mmB</li>
		</thingCategories>
		<stackLimit>2000</stackLimit>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x138mmBBase">
		<defName>Ammo_20x138mmB_AP</defName>
		<label>20x138mmB (AP)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/AP</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>ArmorPiercing</ammoClass>
		<cookOffProjectile>Bullet_20x138mmB_AP</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x138mmBBase">
		<defName>Ammo_20x138mmB_Incendiary</defName>
		<label>20x138mmB (AP-I)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Incendiary</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>IncendiaryAP</ammoClass>
		<generateAllowChance>0.65</generateAllowChance> <!-- Make advanced ammo types less common. -->
		<cookOffProjectile>Bullet_20x138mmB_Incendiary</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x138mmBBase">
		<defName>Ammo_20x138mmB_HE</defName>
		<label>20x138mmB (AP-HE)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>ExplosiveAP</ammoClass>
		<generateAllowChance>0.65</generateAllowChance> <!-- Make advanced ammo types less common. -->
		<cookOffProjectile>Bullet_20x138mmB_HE</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x138mmBBase">
		<defName>Ammo_20x138mmB_Sabot</defName>
		<label>20x138mmB (Sabot)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Sabot</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>0.249</Mass>
		</statBases>
		<ammoClass>Sabot</ammoClass>
		<generateAllowChance>0.65</generateAllowChance> <!-- Make advanced ammo types less common. -->
		<cookOffProjectile>Bullet_20x138mmB_Sabot</cookOffProjectile>
	</ThingDef>

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

	<ThingDef Name="Base20x138mmBBullet" ParentName="BaseBulletCE" Abstract="true">
		<graphicData>
			<texPath>Things/Projectile/Bullet_Big</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<speed>165</speed>
			<dropsCasings>true</dropsCasings>
			<casingMoteDefname>Fleck_RifleAmmoCasings_HighCal</casingMoteDefname>
			<casingFilthDefname>Filth_RifleAmmoCasings_HighCal</casingFilthDefname>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x138mmBBullet">
		<defName>Bullet_20x138mmB_AP</defName>
		<label>20x138mmB bullet (AP)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>43</damageAmountBase>
			<armorPenetrationSharp>34</armorPenetrationSharp>
			<armorPenetrationBlunt>972</armorPenetrationBlunt>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x138mmBBullet">
		<defName>Bullet_20x138mmB_Incendiary</defName>
		<label>20x138mmB bullet (AP-I)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>43</damageAmountBase>
			<armorPenetrationSharp>34</armorPenetrationSharp>
			<armorPenetrationBlunt>972</armorPenetrationBlunt>
			<secondaryDamage>
				<li>
					<def>Flame_Secondary</def>
					<amount>26</amount>
				</li>
			</secondaryDamage>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x138mmBBullet">
		<defName>Bullet_20x138mmB_HE</defName>
		<label>20x138mmB bullet (AP-HE)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>68</damageAmountBase>
			<armorPenetrationSharp>17</armorPenetrationSharp>
			<armorPenetrationBlunt>972</armorPenetrationBlunt>
			<secondaryDamage>
				<li>
					<def>Bomb_Secondary</def>
					<amount>35</amount>
				</li>
			</secondaryDamage>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x138mmBBullet">
		<defName>Bullet_20x138mmB_Sabot</defName>
		<label>20x138mmB bullet (Sabot)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>223</speed>
			<damageAmountBase>36</damageAmountBase>
			<armorPenetrationSharp>60</armorPenetrationSharp>
			<armorPenetrationBlunt>1257.52</armorPenetrationBlunt>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeAmmo_20x138mmB_AP</defName>
		<label>make 20x138mmB (AP) cartridge x200</label>
		<description>Craft 200 20x138mmB (AP) cartridges.</description>
		<jobString>Making 20x138mmB (AP) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>120</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x138mmB_AP>200</Ammo_20x138mmB_AP>
		</products>
		<workAmount>14400</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x138mmB_Incendiary</defName>
		<label>make 20x138mmB (AP-I) cartridge x200</label>
		<description>Craft 200 20x138mmB (AP-I) cartridges.</description>
		<jobString>Making 20x138mmB (AP-I) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>120</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>12</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x138mmB_Incendiary>200</Ammo_20x138mmB_Incendiary>
		</products>
		<workAmount>16800</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x138mmB_HE</defName>
		<label>make 20x138mmB (AP-HE) cartridge x200</label>
		<description>Craft 200 20x138mmB (AP-HE) cartridges.</description>
		<jobString>Making 20x138mmB (AP-HE) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>120</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>23</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>FSX</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x138mmB_HE>200</Ammo_20x138mmB_HE>
		</products>
		<workAmount>21200</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x138mmB_Sabot</defName>
		<label>make 20x138mmB (Sabot) cartridge x200</label>
		<description>Craft 200 20x138mmB (Sabot) cartridges.</description>
		<jobString>Making 20x138mmB (Sabot) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>72</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Uranium</li>
					</thingDefs>
				</filter>
				<count>14</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Chemfuel</li>
					</thingDefs>
				</filter>
				<count>14</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Chemfuel</li>
				<li>Steel</li>
				<li>Uranium</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x138mmB_Sabot>200</Ammo_20x138mmB_Sabot>
		</products>
		<workAmount>15600</workAmount>
	</RecipeDef>

</Defs>