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

	<ThingCategoryDef>
		<defName>Ammo82mmMortarShells</defName>
		<label>82mm mortar shell</label>
		<parent>AmmoShells</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberMortar</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_82mmMortarShell</defName>
		<label>82mm mortar shells</label>
		<ammoTypes>
			<!-- Overrides vanilla artillery shell -->
			<Shell_82mmMortar_HE>Bullet_82mmMortarShell_HE</Shell_82mmMortar_HE>
			<Shell_82mmMortar_Incendiary>Bullet_82mmMortarShell_Incendiary</Shell_82mmMortar_Incendiary>
			<Shell_82mmMortar_EMP>Bullet_82mmMortarShell_EMP</Shell_82mmMortar_EMP>
			<Shell_82mmMortar_Firefoam>Bullet_82mmMortarShell_Firefoam</Shell_82mmMortar_Firefoam>
			<Shell_82mmMortar_Smoke>Bullet_82mmMortarShell_82mmMortar_Smoke</Shell_82mmMortar_Smoke>
		</ammoTypes>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="82mmMortarShellBase" ParentName="HeavyAmmoBase" Abstract="True">
		<description>Low-velocity shell designed to be fired from a mortar.</description>
		<graphicData>
			<drawSize>0.80</drawSize>
		</graphicData>
		<statBases>
			<MaxHitPoints>200</MaxHitPoints>
			<Mass>5.27</Mass>
			<Bulk>8.17</Bulk>
		</statBases>
		<thingCategories>
			<li>Ammo82mmMortarShells</li>
		</thingCategories>
		<stackLimit>25</stackLimit>
		<cookOffFlashScale>30</cookOffFlashScale>
		<cookOffSound>MortarBomb_Explode</cookOffSound>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" Name="82mmMortarShellBaseCraftableBase" ParentName="82mmMortarShellBase" Abstract="True">
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting_TableMachining</li>
		</tradeTags>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="82mmMortarShellBaseCraftableBase">
		<defName>Shell_82mmMortar_HE</defName>
		<label>82mm mortar shell (HE)</label>
		<graphicData>
			<texPath>Things/Ammo/Mortar/HE</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<ammoClass>GrenadeHE</ammoClass>
		<detonateProjectile>Bullet_82mmMortarShell_HE</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="82mmMortarShellBaseCraftableBase">
		<defName>Shell_82mmMortar_Incendiary</defName>
		<label>82mm mortar shell (Incendiary)</label>
		<graphicData>
			<texPath>Things/Ammo/Mortar/Incendiary</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>4.1</Mass>
			<Bulk>10.01</Bulk>
		</statBases>
		<ammoClass>GrenadeIncendiary</ammoClass>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>11</damageAmountBase>
				<explosiveDamageType>PrometheumFlame</explosiveDamageType>
				<explosiveRadius>5</explosiveRadius>
				<preExplosionSpawnThingDef>FilthPrometheum</preExplosionSpawnThingDef>
				<preExplosionSpawnChance>0.5</preExplosionSpawnChance>
				<explosionSound>MortarIncendiary_Explode</explosionSound>
				<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			</li>
		</comps>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="82mmMortarShellBaseCraftableBase">
		<defName>Shell_82mmMortar_EMP</defName>
		<label>82mm mortar shell (EMP)</label>
		<graphicData>
			<texPath>Things/Ammo/Mortar/EMP</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>5.27</Mass>
			<Bulk>8.17</Bulk>
		</statBases>
		<ammoClass>GrenadeEMP</ammoClass>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>34</damageAmountBase>
				<explosiveDamageType>Bomb</explosiveDamageType>
				<explosiveRadius>5.5</explosiveRadius>
			</li>
		</comps>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="82mmMortarShellBaseCraftableBase">
		<defName>Shell_82mmMortar_Firefoam</defName>
		<label>82mm mortar shell (Foam)</label>
		<generateAllowChance>0</generateAllowChance>
		<graphicData>
			<texPath>Things/Ammo/Mortar/Firefoam</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>4.1</Mass>
			<Bulk>10.01</Bulk>
		</statBases>
		<ammoClass>FoamFuel</ammoClass>
		<detonateProjectile>Bullet_82mmMortarShell_Firefoam</detonateProjectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>7</damageAmountBase>
				<explosiveDamageType>Extinguish</explosiveDamageType>
				<postExplosionSpawnThingDef>Filth_FireFoam</postExplosionSpawnThingDef>
				<postExplosionSpawnChance>1</postExplosionSpawnChance>
				<postExplosionSpawnThingCount>3</postExplosionSpawnThingCount>
				<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			</li>
		</comps>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="82mmMortarShellBaseCraftableBase">
		<defName>Shell_82mmMortar_Smoke</defName>
		<label>82mm mortar shell (Smoke)</label>
		<generateAllowChance>0</generateAllowChance>
		<graphicData>
			<texPath>Things/Ammo/Mortar/Smoke</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>4.1</Mass>
			<Bulk>10.01</Bulk>
		</statBases>
		<ammoClass>Smoke</ammoClass>
		<detonateProjectile>Bullet_82mmMortarShell_82mmMortar_Smoke</detonateProjectile>
		<comps>
			<!-- Vanilla values -->
			<li Class="CompProperties_Explosive">
				<explosiveRadius>6</explosiveRadius>
				<explosiveDamageType>Smoke</explosiveDamageType>
				<startWickHitPointsPercent>0.7</startWickHitPointsPercent>
				<postExplosionGasType>BlindSmoke</postExplosionGasType>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
				<explodeOnKilled>True</explodeOnKilled>
				<wickTicks>30~82</wickTicks>
			</li>
		</comps>
	</ThingDef>

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

	<ThingDef Name="Base82mmMortarShell" ParentName="BaseExplosiveBullet" Abstract="true">
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<graphicData>
			<shaderType>TransparentPostLight</shaderType>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>0</speed>
			<soundHitThickRoof>Artillery_HitThickRoof</soundHitThickRoof>
			<soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
			<soundAmbient>MortarRound_Ambient</soundAmbient>
			<flyOverhead>true</flyOverhead>
			<dropsCasings>false</dropsCasings>
			<gravityFactor>5</gravityFactor>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base82mmMortarShell">
		<defName>Bullet_82mmMortarShell_HE</defName>
		<label>82mm mortar shell (HE)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/HE</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bomb</damageDef>
			<damageAmountBase>156</damageAmountBase>
			<armorPenetrationSharp>0</armorPenetrationSharp>
			<armorPenetrationBlunt>0</armorPenetrationBlunt>
			<explosionRadius>2.5</explosionRadius>
			<flyOverhead>true</flyOverhead>
			<soundExplode>MortarBomb_Explode</soundExplode>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			<ai_IsIncendiary>true</ai_IsIncendiary>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Large>16</Fragment_Large>
					<Fragment_Small>100</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base82mmMortarShell">
		<defName>Bullet_82mmMortarShell_Incendiary</defName>
		<label>82mm mortar shell (Incendiary)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/Incendiary</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>PrometheumFlame</damageDef>
			<damageAmountBase>11</damageAmountBase>
			<explosionRadius>6.5</explosionRadius>
			<flyOverhead>true</flyOverhead>
			<preExplosionSpawnThingDef>FilthPrometheum</preExplosionSpawnThingDef>
			<preExplosionSpawnChance>0.15</preExplosionSpawnChance>
			<soundExplode>MortarIncendiary_Explode</soundExplode>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base82mmMortarShell">
		<defName>Bullet_82mmMortarShell_EMP</defName>
		<label>82mm mortar shell (EMP)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/EMP</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>EMP</damageDef>
			<damageAmountBase>156</damageAmountBase>
			<armorPenetrationSharp>0</armorPenetrationSharp>
			<armorPenetrationBlunt>0</armorPenetrationBlunt>
			<flyOverhead>true</flyOverhead>
			<explosionRadius>5.5</explosionRadius>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base82mmMortarShell">
		<defName>Bullet_82mmMortarShell_Firefoam</defName>
		<label>82mm mortar shell (Foam)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/Firefoam</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Extinguish</damageDef>
			<suppressionFactor>0.0</suppressionFactor>
			<dangerFactor>0.0</dangerFactor>
			<armorPenetrationSharp>0</armorPenetrationSharp>
			<armorPenetrationBlunt>0</armorPenetrationBlunt>
			<explosionRadius>4.75</explosionRadius>
			<flyOverhead>true</flyOverhead>
			<soundHitThickRoof>Artillery_HitThickRoof</soundHitThickRoof>
			<soundExplode>Explosion_EMP</soundExplode>
			<soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
			<soundAmbient>MortarRound_Ambient</soundAmbient>
			<postExplosionSpawnThingDef>Filth_FireFoam</postExplosionSpawnThingDef>
			<postExplosionSpawnChance>1</postExplosionSpawnChance>
			<postExplosionSpawnThingCount>3</postExplosionSpawnThingCount>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			<explosionEffect>ExtinguisherExplosion</explosionEffect>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base82mmMortarShell">
		<defName>Bullet_82mmMortarShell_82mmMortar_Smoke</defName>
		<label>82mm mortar shell (Smoke)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/Smoke</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Smoke</damageDef>
			<suppressionFactor>0.0</suppressionFactor>
			<dangerFactor>0.0</dangerFactor>
			<armorPenetrationSharp>0</armorPenetrationSharp>
			<armorPenetrationBlunt>0</armorPenetrationBlunt>
			<explosionRadius>6</explosionRadius>
			<flyOverhead>true</flyOverhead>
			<soundHitThickRoof>Artillery_HitThickRoof</soundHitThickRoof>
			<soundExplode>Explosion_EMP</soundExplode>
			<soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
			<soundAmbient>MortarRound_Ambient</soundAmbient>
			<postExplosionGasType>BlindSmoke</postExplosionGasType>
			<preExplosionSpawnChance>1</preExplosionSpawnChance>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			<explosionEffect>ExtinguisherExplosion</explosionEffect>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeShell_82mmMortar_HE</defName>
		<label>make 82mm HE mortar shells x5</label>
		<description>Craft 5 82mm HE mortar shells.</description>
		<jobString>Making 82mm HE mortar shells.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>54</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>10</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>
			<Shell_82mmMortar_HE>5</Shell_82mmMortar_HE>
		</products>
		<workAmount>10600</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeShell_82mmMortar_Incendiary</defName>
		<label>make 82mm incendiary mortar shells x5</label>
		<description>Craft 5 82mm incendiary mortar shells.</description>
		<jobString>Making 82mm incendiary mortar shells.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>58</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>5</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>
			<Shell_82mmMortar_Incendiary>5</Shell_82mmMortar_Incendiary>
		</products>
		<workAmount>9000</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeShell_82mmMortar_EMP</defName>
		<label>make 82mm EMP mortar shells x5</label>
		<description>Craft 5 82mm EMP mortar shells.</description>
		<jobString>Making 82mm EMP mortar shells.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>54</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>14</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Shell_82mmMortar_EMP>5</Shell_82mmMortar_EMP>
		</products>
		<workAmount>13800</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeShell_82mmMortar_Firefoam</defName>
		<label>make 82mm firefoam mortar shells x5</label>
		<description>Craft 5 82mm firefoam mortar shells.</description>
		<jobString>Making 82mm firefoam mortar shells.</jobString>
		<researchPrerequisite>Firefoam</researchPrerequisite>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>42</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
			<li>
				<filter>
					<categories>
						<li>MeatRaw</li>
					</categories>
				</filter>
				<count>17</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
			<categories>
				<li>MeatRaw</li>
			</categories>
		</fixedIngredientFilter>
		<products>
			<Shell_82mmMortar_Firefoam>5</Shell_82mmMortar_Firefoam>
		</products>
		<workAmount>8800</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeShell_82mmMortar_Smoke</defName>
		<label>make 82mm smoke mortar shells x5</label>
		<description>Craft 5 82mm smoke mortar shells.</description>
		<jobString>Making 82mm smoke mortar shells.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>42</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Shell_82mmMortar_Smoke>5</Shell_82mmMortar_Smoke>
		</products>
		<workAmount>6600</workAmount>
	</RecipeDef>

</Defs>