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

	<ThingCategoryDef>
		<defName>Ammo90mmRecoilless</defName>
		<label>90mm recoilless rockets</label>
		<parent>AmmoRockets</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberRocket</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_90mmRecoilless</defName>
		<label>90mm Recoilless Rockets</label>
		<ammoTypes>
			<Ammo_90mmRCR_HEAT>Bullet_90mmRCR_HEAT</Ammo_90mmRCR_HEAT>
			<Ammo_90mmRCR_CAN>Bullet_90mmRCR_CAN</Ammo_90mmRCR_CAN>
		</ammoTypes>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="Base90mmRecoillessAmmo" ParentName="MediumAmmoBase" Abstract="True">
		<description>Rocket-propelled ammunition desinged for use with the M67 recoilless rifle</description>
		<statBases>
			<MaxHitPoints>150</MaxHitPoints>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting_TableMachining</li>
		</tradeTags>
		<thingCategories>
			<li>Ammo90mmRecoilless</li>
		</thingCategories>
		<stackLimit>25</stackLimit>
		<cookOffFlashScale>40</cookOffFlashScale>
		<cookOffSound>MortarBomb_Explode</cookOffSound>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Base90mmRecoillessAmmo">
		<defName>Ammo_90mmRCR_HEAT</defName>
		<label>90mm recoilless cartridge (HEAT)</label>
		<graphicData>
			<texPath>Things/Ammo/Rocket/90mmHEAT</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>4.196</Mass>
			<Bulk>13.63</Bulk>
		</statBases>
		<ammoClass>RocketHEAT</ammoClass>
		<detonateProjectile>Bullet_90mmRCR_HEAT</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Base90mmRecoillessAmmo">
		<defName>Ammo_90mmRCR_CAN</defName>
		<label>90mm recoilless cartridge (CAN)</label>
		<graphicData>
			<texPath>Things/Ammo/Rocket/90mmCanister</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>2.78</Mass>
			<Bulk>9.3</Bulk>
		</statBases>
		<ammoClass>BuckShot</ammoClass>
		<comps>
			<li Class="CompProperties_Explosive">
				<damageAmountBase>25</damageAmountBase>
				<explosiveRadius>1.0</explosiveRadius>
				<explosiveDamageType>Bomb</explosiveDamageType>
				<explosiveExpandPerStackcount>1.0</explosiveExpandPerStackcount>
				<startWickOnDamageTaken>
					<li>Bomb</li>
				</startWickOnDamageTaken>
				<startWickHitPointsPercent>0.5</startWickHitPointsPercent>
				<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
				<explodeOnKilled>True</explodeOnKilled>
				<wickTicks>90~120</wickTicks>
			</li>
		</comps>
	</ThingDef>

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

	<ThingDef Name="Base90mmRecoillessBullet" ParentName="BaseExplosiveBullet" Abstract="true">
		<graphicData>
			<shaderType>TransparentPostLight</shaderType>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>56</speed>
			<soundAmbient>RocketPropelledLoop_Small</soundAmbient>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ProjectileFleck">
				<FleckDatas>
					<li>
						<fleck>Fleck_CERocketFlame</fleck>
						<emissionsPerTick>7</emissionsPerTick>
						<flecksPerEmission>3</flecksPerEmission>
						<scale>1</scale>
						<cutoffTickRange>25~30</cutoffTickRange>
						<originOffset>0.4</originOffset>
					</li>
					<li>
						<fleck>Fleck_CERocketSmokeTrail</fleck>
						<emissionsPerTick>2</emissionsPerTick>
						<rotation>0~360</rotation>
						<flecksPerEmission>1</flecksPerEmission>
					</li>
					<li>
						<fleck>Fleck_CERocketSmoke</fleck>
						<emissionsPerTick>2</emissionsPerTick>
						<rotation>0~360</rotation>
						<flecksPerEmission>2</flecksPerEmission>
						<cutoffTickRange>25~60</cutoffTickRange>
					</li>
				</FleckDatas>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base90mmRecoillessBullet">
		<defName>Bullet_90mmRCR_HEAT</defName>
		<label>90mm recoilless rocket (HEAT)</label>
		<graphicData>
			<texPath>Things/Projectile/RPG/HEAT</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<damageAmountBase>239</damageAmountBase>
			<armorPenetrationSharp>350</armorPenetrationSharp>
			<armorPenetrationBlunt>31.885</armorPenetrationBlunt>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>106</damageAmountBase>
				<explosiveDamageType>Bomb</explosiveDamageType>
				<explosiveRadius>1</explosiveRadius>
				<explosionSound>MortarBomb_Explode</explosionSound>
				<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			</li>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Large>5</Fragment_Large>
					<Fragment_Small>7</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="BaseBulletCE">
		<defName>Bullet_90mmRCR_CAN</defName>
		<label>Flechette</label>
		<graphicData>
			<texPath>Things/Projectile/Bullet_Small</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<speed>87</speed>
			<damageAmountBase>31</damageAmountBase>
			<pelletCount>60</pelletCount>
			<!-- Originally 2400 flechettes are present, changed to 60 buffed projectile -->
			<armorPenetrationSharp>5</armorPenetrationSharp>
			<armorPenetrationBlunt>21.78</armorPenetrationBlunt>
			<spreadMult>26.7</spreadMult>
			<!-- x3 the normal spread -->
			<shieldDamageMultiplier>0.25</shieldDamageMultiplier>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="LauncherAmmoRecipeBase">
		<defName>MakeAmmo_90mmRCR_HEAT</defName>
		<label>make 90mm recoilless (HEAT) rockets x5</label>
		<description>Craft 5 90mm recoilless (HEAT) rockets.</description>
		<jobString>Making 90mm recoilless (HEAT) rockets.</jobString>
		<workAmount>9200</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>44</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>6</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_90mmRCR_HEAT>5</Ammo_90mmRCR_HEAT>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="LauncherAmmoRecipeBase">
		<defName>MakeAmmo_90mmRCR_CAN</defName>
		<label>Make 90mm recoilless (Canister) shells x5</label>
		<description>Craft 90mm recoilless (Canister) shells.</description>
		<jobString>Making 90mm recoilless (Canister) shells.</jobString>
		<workAmount>4200</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>30</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>ComponentIndustrial</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_90mmRCR_CAN>5</Ammo_90mmRCR_CAN>
		</products>
	</RecipeDef>

</Defs>