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

	<ThingCategoryDef>
		<defName>Ammo20x42mmCartridges</defName>
		<label>20x42mm Cartridge</label>
		<parent>AmmoHighCaliber</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberHighCaliber</iconPath>
	</ThingCategoryDef>

	<ThingCategoryDef>
		<defName>Ammo20x42mmGrenades</defName>
		<label>20x42mm Grenade</label>
		<parent>AmmoGrenades</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberGrenade</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_20x42mmGrenade</defName>
		<label>20x42mm Grenades</label>
		<ammoTypes>
			<Ammo_20x42mm_AP>Bullet_20x42mm_AP</Ammo_20x42mm_AP>
			<Ammo_20x42mm_Incendiary>Bullet_20x42mm_Incendiary</Ammo_20x42mm_Incendiary>
			<Ammo_20x42mm_APHE>Bullet_20x42mm_APHE</Ammo_20x42mm_APHE>
			<Ammo_20x42mmGrenade_HE>Bullet_20x42mmGrenade_HE</Ammo_20x42mmGrenade_HE>
			<Ammo_20x42mmGrenade_EMP>Bullet_20x42mmGrenade_EMP</Ammo_20x42mmGrenade_EMP>
			<Ammo_20x42mmGrenade_Smoke>Bullet_20x42mmGrenade_Smoke</Ammo_20x42mmGrenade_Smoke>
		</ammoTypes>
		<similarTo>AmmoSet_LauncherGrenade</similarTo>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="20x42mmCartridgeBase" ParentName="MediumAmmoBase" Abstract="True">
		<description>Specialized cartridge developed for use in shoulder-fired grenade launchers.</description>
		<statBases>
			<Mass>0.162</Mass>
			<Bulk>0.1</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting</li>
		</tradeTags>
		<thingCategories>
			<li>Ammo20x42mmCartridges</li>
		</thingCategories>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" Name="20x42mmGrenadeBase" ParentName="MediumAmmoBase" Abstract="True">
		<description>Specialized grenade developed for use in shoulder-fired grenade launchers.</description>
		<statBases>
			<Mass>0.162</Mass>
			<Bulk>0.1</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting</li>
		</tradeTags>
		<thingCategories>
			<li>Ammo20x42mmGrenades</li>
		</thingCategories>
		<cookOffFlashScale>20</cookOffFlashScale>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="20x42mmCartridgeBase">
		<defName>Ammo_20x42mm_AP</defName>
		<label>20x42mm (AP)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/AP</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>ArmorPiercing</ammoClass>
		<detonateProjectile>Bullet_20x42mm_AP</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="20x42mmCartridgeBase">
		<defName>Ammo_20x42mm_Incendiary</defName>
		<label>20x42mm (AP-I)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Incendiary</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>IncendiaryAP</ammoClass>
		<detonateProjectile>Bullet_20x42mm_Incendiary</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="20x42mmCartridgeBase">
		<defName>Ammo_20x42mm_APHE</defName>
		<label>20x42mm (AP-HE)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>ExplosiveAP</ammoClass>
		<detonateProjectile>Bullet_20x42mm_APHE</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="20x42mmGrenadeBase">
		<defName>Ammo_20x42mmGrenade_HE</defName>
		<label>20x42mm grenade (HE)</label>
		<graphicData>
			<texPath>Things/Ammo/GrenadeLauncher/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeHE</ammoClass>
		<detonateProjectile>Bullet_20x42mmGrenade_HE</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="20x42mmGrenadeBase">
		<defName>Ammo_20x42mmGrenade_EMP</defName>
		<label>20x42mm grenade (EMP)</label>
		<graphicData>
			<texPath>Things/Ammo/GrenadeLauncher/EMP</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeEMP</ammoClass>
		<generateAllowChance>0.5</generateAllowChance>
		<detonateProjectile>Bullet_20x42mmGrenade_EMP</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="20x42mmGrenadeBase">
		<defName>Ammo_20x42mmGrenade_Smoke</defName>
		<label>20x42mm grenade (Smoke)</label>
		<graphicData>
			<texPath>Things/Ammo/GrenadeLauncher/SMK</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>Smoke</ammoClass>
		<generateAllowChance>0</generateAllowChance>
		<detonateProjectile>Bullet_20x42mmGrenade_Smoke</detonateProjectile>
	</ThingDef>

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

	<ThingDef Name="Base20x42mmGrenadeBullet" ParentName="BaseExplosiveBullet" Abstract="true">
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<graphicData>
			<texPath>Things/Projectile/Bullet_Big</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>74</speed>
		</projectile>
	</ThingDef>

	<ThingDef Name="Base20x42mmBullet" ParentName="BaseBulletCE" Abstract="true">
		<graphicData>
			<texPath>Things/Projectile/Bullet_Big</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<speed>74</speed>
			<dropsCasings>true</dropsCasings>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x42mmBullet">
		<defName>Bullet_20x42mm_AP</defName>
		<label>20x42mm bullet (AP)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>20</damageAmountBase>
			<armorPenetrationSharp>12</armorPenetrationSharp>
			<armorPenetrationBlunt>105.72</armorPenetrationBlunt>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x42mmBullet">
		<defName>Bullet_20x42mm_Incendiary</defName>
		<label>20x42mm bullet (AP-I)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>20</damageAmountBase>
			<armorPenetrationSharp>12</armorPenetrationSharp>
			<armorPenetrationBlunt>105.72</armorPenetrationBlunt>
			<secondaryDamage>
				<li>
					<def>Flame_Secondary</def>
					<amount>24</amount>
				</li>
			</secondaryDamage>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x42mmBullet">
		<defName>Bullet_20x42mm_APHE</defName>
		<label>20x42mm bullet (AP-HE)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageAmountBase>32</damageAmountBase>
			<armorPenetrationSharp>6</armorPenetrationSharp>
			<armorPenetrationBlunt>105.72</armorPenetrationBlunt>
			<secondaryDamage>
				<li>
					<def>Bomb_Secondary</def>
					<amount>33</amount>
				</li>
			</secondaryDamage>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x42mmGrenadeBullet">
		<defName>Bullet_20x42mmGrenade_HE</defName>
		<label>20mm grenade (HE)</label>
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bomb</damageDef>
			<damageAmountBase>18</damageAmountBase>
			<explosionRadius>1.0</explosionRadius>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Small>12</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base20x42mmGrenadeBullet">
		<defName>Bullet_20x42mmGrenade_EMP</defName>
		<label>20mm grenade (EMP)</label>
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>EMP</damageDef>
			<damageAmountBase>18</damageAmountBase>
			<explosionRadius>1.5</explosionRadius>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base20x42mmGrenadeBullet">
		<defName>Bullet_20x42mmGrenade_Smoke</defName>
		<label>20mm grenade (Smoke)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Smoke</damageDef>
			<explosionRadius>2</explosionRadius>
			<suppressionFactor>0.0</suppressionFactor>
			<dangerFactor>0.0</dangerFactor>
			<postExplosionGasType>BlindSmoke</postExplosionGasType>
			<preExplosionSpawnChance>1</preExplosionSpawnChance>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeAmmo_20x42mm_AP</defName>
		<label>make 20x42mm (AP) cartridge x100</label>
		<description>Craft 100 20x42mm (AP) cartridges.</description>
		<jobString>Making 20x42mm (AP) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>34</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x42mm_AP>100</Ammo_20x42mm_AP>
		</products>
		<workAmount>4080</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x42mm_Incendiary</defName>
		<label>make 20x42mm (AP-I) cartridge x100</label>
		<description>Craft 100 20x42mm (AP-I) cartridges.</description>
		<jobString>Making 20x42mm (AP-I) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>34</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>6</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x42mm_Incendiary>100</Ammo_20x42mm_Incendiary>
		</products>
		<workAmount>5800</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AdvancedAmmoRecipeBase">
		<defName>MakeAmmo_20x42mm_APHE</defName>
		<label>make 20x42mm (AP-HE) cartridge x100</label>
		<description>Craft 100 20x42mm (AP-HE) cartridges.</description>
		<jobString>Making 20x42mm (AP-HE) cartridges.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>34</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>11</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>FSX</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x42mm_APHE>100</Ammo_20x42mm_APHE>
		</products>
		<workAmount>7800</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="LauncherAmmoRecipeBase">
		<defName>MakeAmmo_20x42mmGrenade_HE</defName>
		<label>make 20x42mm HE grenades x100</label>
		<description>Craft 100 20x42mm HE grenades.</description>
		<jobString>Making 20x42mm HE grenades.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>34</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>6</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>FSX</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x42mmGrenade_HE>100</Ammo_20x42mmGrenade_HE>
		</products>
		<workAmount>7000</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="LauncherAmmoRecipeBase">
		<defName>MakeAmmo_20x42mmGrenade_EMP</defName>
		<label>make 20x42mm EMP grenades x100</label>
		<description>Craft 100 20x42mm EMP grenades.</description>
		<jobString>Making 20x42mm EMP grenades.</jobString>
		<researchPrerequisites>
			<li>MicroelectronicsBasics</li>
			<li>CE_Launchers</li>
		</researchPrerequisites>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>34</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>9</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x42mmGrenade_EMP>100</Ammo_20x42mmGrenade_EMP>
		</products>
		<workAmount>8800</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="LauncherAmmoRecipeBase">
		<defName>MakeAmmo_20x42mmGrenade_Smoke</defName>
		<label>make 20x42mm smoke grenades x100</label>
		<description>Craft 100 20x42mm smoke grenades.</description>
		<jobString>Making 20x42mm smoke grenades.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>34</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_20x42mmGrenade_Smoke>100</Ammo_20x42mmGrenade_Smoke>
		</products>
		<workAmount>5400</workAmount>
	</RecipeDef>

</Defs>