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

	<ThingCategoryDef>
		<defName>Ammo50mmType89MortarShells</defName>
		<label>50mm type 89 mortar shell</label>
		<parent>AmmoShells</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberMortar</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_50mmType89MortarShell</defName>
		<label>50mm type 89 mortar shells</label>
		<ammoTypes>
			<Ammo_50mmType89MortarShell_HE>Bullet_50mmType89MortarShell_HE</Ammo_50mmType89MortarShell_HE>
			<Ammo_50mmType89MortarShell_Incendiary>Bullet_50mmType89MortarShell_Incendiary</Ammo_50mmType89MortarShell_Incendiary>
			<Ammo_50mmType89MortarShell_EMP>Bullet_50mmType89MortarShell_EMP</Ammo_50mmType89MortarShell_EMP>
			<Ammo_50mmType89MortarShell_Smoke>Bullet_50mmType89MortarShell_Smoke</Ammo_50mmType89MortarShell_Smoke>
		</ammoTypes>
		<isMortarAmmoSet>true</isMortarAmmoSet>
		<similarTo>AmmoSet_81mmMortarShell</similarTo>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="50mmType89MortarShellBase" ParentName="HeavyAmmoBase" Abstract="True">
		<description>Low-velocity shell designed to be fired from a mortar.</description>
		<thingCategories>
			<li>Ammo50mmType89MortarShells</li>
		</thingCategories>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting_TableMachining</li>
		</tradeTags>
		<statBases>
			<Mass>0.9</Mass>
			<Bulk>0.87</Bulk>
		</statBases>
		<stackLimit>25</stackLimit>
		<cookOffFlashScale>20</cookOffFlashScale>
		<cookOffSound>MortarBomb_Explode</cookOffSound>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="50mmType89MortarShellBase">
		<defName>Ammo_50mmType89MortarShell_HE</defName>
		<label>50mm type 89 mortar shell (HE)</label>
		<graphicData>
			<texPath>Things/Ammo/GrenadeLauncher/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeHE</ammoClass>
		<detonateProjectile>Bullet_50mmType89MortarShell_HE</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="50mmType89MortarShellBase">
		<defName>Ammo_50mmType89MortarShell_Incendiary</defName>
		<label>50mm type 89 mortar shell (Incendiary)</label>
		<graphicData>
			<texPath>Things/Ammo/Mortar/Incendiary</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeIncendiary</ammoClass>
		<detonateProjectile>Bullet_50mmType89MortarShell_Incendiary</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="50mmType89MortarShellBase">
		<defName>Ammo_50mmType89MortarShell_EMP</defName>
		<label>50mm type 89 mortar shell (EMP)</label>
		<graphicData>
			<texPath>Things/Ammo/Mortar/EMP</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeEMP</ammoClass>
		<detonateProjectile>Bullet_50mmType89MortarShell_EMP</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="50mmType89MortarShellBase">
		<defName>Ammo_50mmType89MortarShell_Smoke</defName>
		<label>50mm type 89 mortar shell (Smoke)</label>
		<generateAllowChance>0</generateAllowChance>
		<graphicData>
			<texPath>Things/Ammo/Mortar/Smoke</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>Smoke</ammoClass>
		<detonateProjectile>Bullet_50mmType89MortarShell_Smoke</detonateProjectile>
	</ThingDef>

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

	<ThingDef Name="Base50mmType89MortarShell" 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>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base50mmType89MortarShell">
		<defName>Bullet_50mmType89MortarShell_HE</defName>
		<label>50mm type 89 mortar shell (HE)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/HE</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bomb</damageDef>
			<damageAmountBase>42</damageAmountBase>
			<explosionRadius>1.5</explosionRadius>
			<soundExplode>MortarBomb_Explode</soundExplode>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			<ai_IsIncendiary>true</ai_IsIncendiary>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Large>3</Fragment_Large>
					<Fragment_Small>3</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base50mmType89MortarShell">
		<defName>Bullet_50mmType89MortarShell_Incendiary</defName>
		<label>50mm type 89 mortar shell (Incendiary)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/Incendiary</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>PrometheumFlame</damageDef>
			<damageAmountBase>6</damageAmountBase>
			<explosionRadius>4.5</explosionRadius>
			<flyOverhead>true</flyOverhead>
			<preExplosionSpawnThingDef>FilthPrometheum</preExplosionSpawnThingDef>
			<preExplosionSpawnChance>0.15</preExplosionSpawnChance>
			<soundExplode>MortarIncendiary_Explode</soundExplode>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base50mmType89MortarShell">
		<defName>Bullet_50mmType89MortarShell_EMP</defName>
		<label>50mm type 89 mortar shell (EMP)</label>
		<graphicData>
			<texPath>Things/Projectile/Mortar/EMP</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>EMP</damageDef>
			<damageAmountBase>42</damageAmountBase>
			<flyOverhead>true</flyOverhead>
			<explosionRadius>2.5</explosionRadius>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base50mmType89MortarShell">
		<defName>Bullet_50mmType89MortarShell_Smoke</defName>
		<label>50mm type 89 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>
			<explosionRadius>3</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="ArtilleryAmmoRecipeBase">
		<defName>MakeAmmo_50mmType89MortarShell_HE</defName>
		<label>make 50mm type 89 (HE) mortar shells x5</label>
		<description>Craft 5 50mm type 89 (HE) mortar shells.</description>
		<jobString>Making 50mm type 89 (HE) mortar shells.</jobString>
		<workAmount>3000</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</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>FSX</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_50mmType89MortarShell_HE>5</Ammo_50mmType89MortarShell_HE>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="ArtilleryAmmoRecipeBase">
		<defName>MakeAmmo_50mmType89MortarShell_Incendiary</defName>
		<label>make 50mm type 89 (Incendiary) mortar shells x5</label>
		<description>Craft 5 50mm type 89 (Incendiary) mortar shells.</description>
		<jobString>Making 50mm type 89 (Incendiary) mortar shells.</jobString>
		<workAmount>3000</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>10</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_50mmType89MortarShell_Incendiary>5</Ammo_50mmType89MortarShell_Incendiary>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="ArtilleryAmmoRecipeBase">
		<defName>MakeAmmo_50mmType89MortarShell_EMP</defName>
		<label>make 50mm type 89 (EMP) mortar shells x5</label>
		<description>Craft 5 50mm type 89 (EMP) mortar shells.</description>
		<jobString>Making 50mm type 89 (EMP) mortar shells.</jobString>
		<researchPrerequisite Inherit="False" />
		<researchPrerequisites>
			<li>Mortars</li>
			<li>MicroelectronicsBasics</li>
		</researchPrerequisites>
		<workAmount>3400</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</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>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_50mmType89MortarShell_EMP>5</Ammo_50mmType89MortarShell_EMP>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="ArtilleryAmmoRecipeBase">
		<defName>MakeAmmo_50mmType89MortarShell_Smoke</defName>
		<label>make 50mm type 89 (Smoke) mortar shells x5</label>
		<description>Craft 5 50mm type 89 (Smoke) mortar shells.</description>
		<jobString>Making 50mm type 89 (Smoke) mortar shells.</jobString>
		<workAmount>2600</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>1</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_50mmType89MortarShell_Smoke>5</Ammo_50mmType89MortarShell_Smoke>
		</products>
	</RecipeDef>

</Defs>