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

	<ThingCategoryDef>
		<defName>Ammo20x102mmNATO</defName>
		<label>20x102mm NATO</label>
		<parent>AmmoHighCaliber</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberHighCaliber</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_20x102mmNATO</defName>
		<label>20x102mm NATO</label>
		<ammoTypes>
			<Ammo_20x102mmNATO_AP>Bullet_20x102mmNATO_AP</Ammo_20x102mmNATO_AP>
			<Ammo_20x102mmNATO_Incendiary>Bullet_20x102mmNATO_Incendiary</Ammo_20x102mmNATO_Incendiary>
			<Ammo_20x102mmNATO_HE>Bullet_20x102mmNATO_HE</Ammo_20x102mmNATO_HE>
			<Ammo_20x102mmNATO_Sabot>Bullet_20x102mmNATO_Sabot</Ammo_20x102mmNATO_Sabot>
		</ammoTypes>
		<similarTo>AmmoSet_Autocannon</similarTo>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="Ammo20x102mmNATOBase" ParentName="MediumAmmoBase" Abstract="True">
		<description>Large caliber cartridge used by autocannons.</description>
		<statBases>
			<Mass>0.254</Mass>
			<Bulk>0.34</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting</li>
			<li>CE_40K_HeavyAmmo</li>
		</tradeTags>
		<thingCategories>
			<li>Ammo20x102mmNATO</li>
		</thingCategories>
		<stackLimit>1000</stackLimit>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x102mmNATOBase">
		<defName>Ammo_20x102mmNATO_AP</defName>
		<label>20x102mm NATO (AP)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/AP</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>ArmorPiercing</ammoClass>
		<cookOffProjectile>Bullet_20x102mmNATO_AP</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x102mmNATOBase">
		<defName>Ammo_20x102mmNATO_Incendiary</defName>
		<label>20x102mm NATO (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_20x102mmNATO_Incendiary</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x102mmNATOBase">
		<defName>Ammo_20x102mmNATO_HE</defName>
		<label>20x102mm NATO (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_20x102mmNATO_HE</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo20x102mmNATOBase">
		<defName>Ammo_20x102mmNATO_Sabot</defName>
		<label>20x102mm NATO (Sabot)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Sabot</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>0.213</Mass>
		</statBases>
		<ammoClass>Sabot</ammoClass>
		<generateAllowChance>0.65</generateAllowChance> <!-- Make advanced ammo types less common. -->
		<cookOffProjectile>Bullet_20x102mmNATO_Sabot</cookOffProjectile>
	</ThingDef>

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

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

	<ThingDef ParentName="Base20x102mmNATOBullet">
		<defName>Bullet_20x102mmNATO_AP</defName>
		<label>20x102mm NATO bullet (AP)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>44</damageAmountBase>
			<armorPenetrationSharp>30</armorPenetrationSharp>
			<armorPenetrationBlunt>1029.080</armorPenetrationBlunt>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x102mmNATOBullet">
		<defName>Bullet_20x102mmNATO_Incendiary</defName>
		<label>20x102mm NATO bullet (AP-I)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>44</damageAmountBase>
			<armorPenetrationSharp>30</armorPenetrationSharp>
			<armorPenetrationBlunt>1029.080</armorPenetrationBlunt>
			<secondaryDamage>
				<li>
					<def>Flame_Secondary</def>
					<amount>22</amount>
				</li>
			</secondaryDamage>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x102mmNATOBullet">
		<defName>Bullet_20x102mmNATO_HE</defName>
		<label>20x102mm NATO bullet (AP-HE)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>70</damageAmountBase>
			<armorPenetrationSharp>15</armorPenetrationSharp>
			<armorPenetrationBlunt>1029.080</armorPenetrationBlunt>
			<secondaryDamage>
				<li>
					<def>Bomb_Secondary</def>
					<amount>31</amount>
				</li>
			</secondaryDamage>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x102mmNATOBullet">
		<defName>Bullet_20x102mmNATO_Sabot</defName>
		<label>20x102mm NATO bullet (Sabot)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>37</damageAmountBase>
			<armorPenetrationSharp>53</armorPenetrationSharp>
			<armorPenetrationBlunt>1320.02</armorPenetrationBlunt>
			<speed>247</speed>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeAmmo_20x102mmNATO_AP</defName>
		<label>make 20x102mm NATO (AP) cartridge x200</label>
		<description>Craft 200 20x102mm NATO (AP) cartridges.</description>
		<jobString>Making 20x102mm NATO (AP) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>104</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x102mmNATO_AP>200</Ammo_20x102mmNATO_AP>
		</products>
		<workAmount>12480</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x102mmNATO_Incendiary</defName>
		<label>make 20x102mm NATO (AP-I) cartridge x200</label>
		<description>Craft 200 20x102mm NATO (AP-I) cartridges.</description>
		<jobString>Making 20x102mm NATO (AP-I) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>104</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x102mmNATO_Incendiary>200</Ammo_20x102mmNATO_Incendiary>
		</products>
		<workAmount>14400</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x102mmNATO_HE</defName>
		<label>make 20x102mm NATO (AP-HE) cartridge x200</label>
		<description>Craft 200 20x102mm NATO (AP-HE) cartridges.</description>
		<jobString>Making 20x102mm NATO (AP-HE) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>104</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>19</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>FSX</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x102mmNATO_HE>200</Ammo_20x102mmNATO_HE>
		</products>
		<workAmount>18000</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x102mmNATO_Sabot</defName>
		<label>make 20x102mm NATO (Sabot) cartridge x200</label>
		<description>Craft 200 20x102mm NATO (Sabot) cartridges.</description>
		<jobString>Making 20x102mm NATO (Sabot) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>64</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Uranium</li>
					</thingDefs>
				</filter>
				<count>12</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Chemfuel</li>
					</thingDefs>
				</filter>
				<count>12</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Uranium</li>
				<li>Chemfuel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x102mmNATO_Sabot>200</Ammo_20x102mmNATO_Sabot>
		</products>
		<workAmount>13600</workAmount>
	</RecipeDef>

</Defs>
