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

	<ThingCategoryDef>
		<defName>Ammo57x438mmBofors</defName>
		<label>57x438mm Bofors</label>
		<parent>AmmoShells</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberAutocannonLarge</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_57x438mmBofors</defName>
		<label>57x438mm Bofors</label>
		<ammoTypes>
			<Ammo_57x438mmBofors_AP>Bullet_57x438mmBofors_AP</Ammo_57x438mmBofors_AP>
			<Ammo_57x438mmBofors_HE>Bullet_57x438mmBofors_HE</Ammo_57x438mmBofors_HE>
			<Ammo_57x438mmBofors_HE_TFuzed>Bullet_57x438mmBofors_HE_TFuzed</Ammo_57x438mmBofors_HE_TFuzed>
			<Ammo_57x438mmBofors_Sabot>Bullet_57x438mmBofors_Sabot</Ammo_57x438mmBofors_Sabot>
		</ammoTypes>
		<similarTo>AmmoSet_LightCannon</similarTo>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="Ammo57x438mmBoforsBase" ParentName="HeavyAmmoBase" Abstract="True">
		<description>Large caliber cartridge used by naval artillery cannons.</description>
		<thingCategories>
			<li>Ammo57x438mmBofors</li>
		</thingCategories>
		<stackLimit>25</stackLimit>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting_TableMachining</li>
		</tradeTags>
		<statBases>
			<Mass>6.1</Mass>
			<Bulk>10.56</Bulk>
		</statBases>
		<cookOffFlashScale>20</cookOffFlashScale>
		<cookOffSound>MortarBomb_Explode</cookOffSound>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo57x438mmBoforsBase">
		<defName>Ammo_57x438mmBofors_AP</defName>
		<label>57x438mm Bofors cartridge (AP)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Bofors/AP</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>ArmorPiercing</ammoClass>
		<cookOffProjectile>Bullet_57x438mmBofors_AP</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo57x438mmBoforsBase">
		<defName>Ammo_57x438mmBofors_HE</defName>
		<label>57x438mm Bofors cartridge (HE)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Bofors/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeHE</ammoClass>
		<detonateProjectile>Bullet_57x438mmBofors_HE</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo57x438mmBoforsBase">
		<defName>Ammo_57x438mmBofors_HE_TFuzed</defName>
		<label>57x438mm Bofors cartridge (HE Time-Fuzed)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Bofors/HE</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>GrenadeHETF</ammoClass>
		<cookOffProjectile>Bullet_57x438mmBofors_HE</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="Ammo57x438mmBoforsBase">
		<defName>Ammo_57x438mmBofors_Sabot</defName>
		<label>57x438mm Bofors cartridge (Sabot)</label>
		<graphicData>
			<texPath>Things/Ammo/HighCaliber/Bofors/Sabot</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>5.071</Mass>
		</statBases>
		<ammoClass>Sabot</ammoClass>
		<cookOffProjectile>Bullet_57x438mmBofors_Sabot</cookOffProjectile>
	</ThingDef>

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

	<ThingDef Name="Base57x438mmBoforsBullet" ParentName="BaseExplosiveBullet" Abstract="true">
		<graphicData>
			<texPath>Things/Projectile/Bullet_Big</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>183</speed>
			<flyOverhead>false</flyOverhead>
			<dropsCasings>true</dropsCasings>
			<casingMoteDefname>Fleck_BigShell</casingMoteDefname>
			<casingFilthDefname>Filth_CannonAmmoCasings</casingFilthDefname>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base57x438mmBoforsBullet">
		<defName>Bullet_57x438mmBofors_AP</defName>
		<label>57x438mm Bofors bullet (AP)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<damageAmountBase>192</damageAmountBase>
			<armorPenetrationSharp>120</armorPenetrationSharp>
			<armorPenetrationBlunt>25709.4</armorPenetrationBlunt>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="Base57x438mmBoforsBullet">
		<defName>Bullet_57x438mmBofors_HE</defName>
		<label>57x438mm Bofors bullet (HE)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bomb</damageDef>
			<damageAmountBase>108</damageAmountBase>
			<explosionRadius>2</explosionRadius>
			<soundExplode>MortarBomb_Explode</soundExplode>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Large>7</Fragment_Large>
					<Fragment_Small>14</Fragment_Small>
				</fragments>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base57x438mmBoforsBullet">
		<defName>Bullet_57x438mmBofors_HE_TFuzed</defName>
		<label>57x438mm Bofors bullet (HE Time-Fuzed)</label>
		<thingClass>CombatExtended.ProjectileCE_Bursting</thingClass>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bomb</damageDef>
			<damageAmountBase>108</damageAmountBase>
			<explosionRadius>2</explosionRadius>
			<soundExplode>MortarBomb_Explode</soundExplode>
			<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
			<aimHeightOffset>2</aimHeightOffset>
			<armingDelay>2</armingDelay>
			<airburstDistanceOffset>-3</airburstDistanceOffset>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_Fragments">
				<fragments>
					<Fragment_Large>7</Fragment_Large>
					<Fragment_Small>14</Fragment_Small>
				</fragments>
				<fragAngleRange>-60~-2</fragAngleRange>
				<fragXZAngleRange>-45~45</fragXZAngleRange>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="Base57x438mmBoforsBullet">
		<defName>Bullet_57x438mmBofors_Sabot</defName>
		<label>57x438mm Bofors bullet (Sabot)</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Bullet</damageDef>
			<damageAmountBase>183</damageAmountBase>
			<armorPenetrationSharp>210</armorPenetrationSharp>
			<armorPenetrationBlunt>33023.34</armorPenetrationBlunt>
			<speed>248</speed>
		</projectile>
	</ThingDef>

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

	<RecipeDef ParentName="CannonAmmoRecipeBase">
		<defName>MakeAmmo_57x438mmBofors_AP</defName>
		<label>make 57x438mm Bofors (AP) cartridge x10</label>
		<description>Craft 10 57x438mm Bofors (AP) cartridges.</description>
		<jobString>Making 57x438mm Bofors (AP) cartridges.</jobString>
		<workAmount>14640</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>122</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_57x438mmBofors_AP>10</Ammo_57x438mmBofors_AP>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="CannonAmmoRecipeBase">
		<defName>MakeAmmo_57x438mmBofors_HE</defName>
		<label>make 57x438mm Bofors (HE) cartridge x10</label>
		<description>Craft 10 57x438mm Bofors (HE) cartridges.</description>
		<jobString>Making 57x438mm Bofors (HE) cartridges.</jobString>
		<workAmount>17800</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>122</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>2</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>11</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>ComponentIndustrial</li>
				<li>FSX</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_57x438mmBofors_HE>10</Ammo_57x438mmBofors_HE>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="CannonAmmoRecipeBase">
		<defName>MakeAmmo_57x438mmBofors_HE_TFuzed</defName>
		<label>make 57x438mm Bofors (Time-Fuzed) cartridge x10</label>
		<description>Craft 10 57x438mm Bofors (Time-Fuzed) cartridges.</description>
		<jobString>Making 57x438mm Bofors (Time-Fuzed) cartridges.</jobString>
		<researchPrerequisite Inherit="False" />
		<researchPrerequisites>
			<li>CE_TurretHeavyWeapons</li>
			<li>CE_AdvancedLaunchers</li>
		</researchPrerequisites>
		<workAmount>19600</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>122</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>ComponentIndustrial</li>
					</thingDefs>
				</filter>
				<count>5</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>FSX</li>
					</thingDefs>
				</filter>
				<count>11</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>ComponentIndustrial</li>
				<li>FSX</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_57x438mmBofors_HE_TFuzed>10</Ammo_57x438mmBofors_HE_TFuzed>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="CannonAmmoRecipeBase">
		<defName>MakeAmmo_57x438mmBofors_Sabot</defName>
		<label>make 57x438mm Bofors (Sabot) cartridge x10</label>
		<description>Craft 10 57x438mm Bofors (Sabot) cartridges.</description>
		<jobString>Making 57x438mm Bofors (Sabot) cartridges.</jobString>
		<researchPrerequisite Inherit="False" />
		<researchPrerequisites>
			<li>CE_TurretHeavyWeapons</li>
			<li>CE_AdvancedAmmo</li>
		</researchPrerequisites>
		<workAmount>15800</workAmount>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>74</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Uranium</li>
					</thingDefs>
				</filter>
				<count>14</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Chemfuel</li>
					</thingDefs>
				</filter>
				<count>14</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Uranium</li>
				<li>Chemfuel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_57x438mmBofors_Sabot>10</Ammo_57x438mmBofors_Sabot>
		</products>
	</RecipeDef>

</Defs>