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

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_40mmGrenade</defName>
		<label>40x46mm Grenades</label>
		<ammoTypes>
			<Ammo_40mmGrenade_UNSCHEDP>Bullet_40mmGrenade_UNSCHEDP</Ammo_40mmGrenade_UNSCHEDP>
			<Ammo_40x46mmGrenade_HE>Bullet_40x46mmGrenade_UNSCHE</Ammo_40x46mmGrenade_HE>
			<Ammo_40x46mmGrenade_EMP>Bullet_40x46mmGrenade_UNSCEMP</Ammo_40x46mmGrenade_EMP>
			<Ammo_40x46mmGrenade_Smoke>Bullet_40x46mmGrenade_UNSCSmoke</Ammo_40x46mmGrenade_Smoke>
		</ammoTypes>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="40mmGrenadeBase" ParentName="MediumAmmoBase" Abstract="True">
		<description>Medium velocity grenade fired from handheld grenade launchers. This one features a heat warhead.</description>
		<statBases>
			<Mass>0.2</Mass>
			<Bulk>0.36</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting_TableMachining</li>
		</tradeTags>
		<thingCategories>
			<li>Ammo40x46mmGrenades</li>
		</thingCategories>
		<stackLimit>500</stackLimit>
		<cookOffFlashScale>100</cookOffFlashScale>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="40mmGrenadeBase">
		<defName>Ammo_40mmGrenade_UNSCHEDP</defName>
		<label>40mm grenade UNSC (HEDP)</label>
		<graphicData>
			<texPath>Things/Ammo/GrenadeLauncher/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeHEDP</ammoClass>
		<detonateProjectile>Bullet_40x46mmGrenade_HE</detonateProjectile>
	</ThingDef>

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

	<ThingDef ParentName="Base40x46mmGrenadeBullet">
		<defName>Bullet_40mmGrenade_UNSCHEDP</defName>
		<label>40x46mm grenade (HEDP)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<damageAmountBase>48</damageAmountBase>
			<armorPenetrationSharp>50</armorPenetrationSharp>
			<armorPenetrationBlunt>31.584</armorPenetrationBlunt>
			<speed>33</speed>
			<secondaryDamage>
				<li>
					<def>EMP</def>
					<amount>12</amount>
				</li>
			</secondaryDamage>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>40</damageAmountBase>
				<explosiveDamageType>Bomb</explosiveDamageType>
				<explosiveRadius>1.5</explosiveRadius>
				<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			</li>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Small>14</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base40x46mmGrenadeBullet">
		<defName>Bullet_40x46mmGrenade_UNSCHE</defName>
		<label>40x46mm grenade (HE)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<explosionRadius>1.0</explosionRadius>
			<damageDef>Bomb</damageDef>
			<damageAmountBase>25</damageAmountBase>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			<speed>33</speed>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Small>19</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base40x46mmGrenadeBullet">
		<defName>Bullet_40x46mmGrenade_UNSCEMP</defName>
		<label>40x46mm grenade (EMP)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<explosionRadius>1.5</explosionRadius>
			<damageDef>EMP</damageDef>
			<damageAmountBase>25</damageAmountBase>
			<speed>33</speed>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base40x46mmGrenadeBullet">
		<defName>Bullet_40x46mmGrenade_UNSCSmoke</defName>
		<label>40x46mm grenade (Smoke)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<explosionRadius>2</explosionRadius>
			<damageDef>Smoke</damageDef>
			<suppressionFactor>0.0</suppressionFactor>
			<dangerFactor>0.0</dangerFactor>
			<postExplosionGasType>BlindSmoke</postExplosionGasType>
			<preExplosionSpawnChance>1</preExplosionSpawnChance>
			<speed>33</speed>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="UNAmmoRecipeBase">
		<defName>MakeAmmo_40mmGrenade_UNSCHEDP</defName>
		<label>make 40mm UNSC HEDP grenades x100</label>
		<description>Craft 100 40mm UNSC HEDP grenades.</description>
		<jobString>Making 40mm UNSC HEDP grenades.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>50</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>4</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>FSX</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_40mmGrenade_UNSCHEDP>100</Ammo_40mmGrenade_UNSCHEDP>
		</products>
		<workAmount>12000</workAmount>
	</RecipeDef>

</Defs>