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

	<ThingCategoryDef>
		<defName>AmmoFlamethrower</defName>
		<label>flamethrower fuel</label>
		<parent>AmmoAdvanced</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberFuel</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_Flamethrower</defName>
		<label>flamethrower fuel</label>
		<ammoTypes>
			<Ammo_Flamethrower_Napalm>Bullet_Flamethrower_Napalm</Ammo_Flamethrower_Napalm>
			<Ammo_Flamethrower_Prometheum>Bullet_Flamethrower_Prometheum</Ammo_Flamethrower_Prometheum>
			<Ammo_Flamethrower_Bioferrite MayRequire="Ludeon.Rimworld.Anomaly">Bullet_Flamethrower_Bioferrite</Ammo_Flamethrower_Bioferrite>
		</ammoTypes>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="FlamethrowerBase" ParentName="SpacerSmallAmmoBase" Abstract="True">
		<description>Fuel for a flamethrower.</description>
		<statBases>
			<MaxHitPoints>70</MaxHitPoints>
			<Flammability>1.0</Flammability>
			<Mass>0.05</Mass>
			<Bulk>0.1</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting_DrugLab</li>
			<li>CE_40K_HeavyAmmo</li>
		</tradeTags>
		<thingCategories>
			<li>AmmoFlamethrower</li>
		</thingCategories>
		<stackLimit>500</stackLimit>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="FlamethrowerBase">
		<defName>Ammo_Flamethrower_Napalm</defName>
		<label>jellied chemfuel</label>
		<graphicData>
			<texPath>Things/Ammo/FuelTank/Incendiary</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>NapalmFuel</ammoClass>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>2</damageAmountBase>
				<explosiveDamageType>Flame</explosiveDamageType>
				<explosiveRadius>1</explosiveRadius>
				<preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
			</li>
		</comps>
		<detonateProjectile>Bullet_Flamethrower_Napalm</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="FlamethrowerBase">
		<defName>Ammo_Flamethrower_Prometheum</defName>
		<label>jellied prometheum</label>
		<description>Fuel for a flamethrower.\n\nThis mixture applies a sticky coating of extremely flammable prometheum to target.</description>
		<graphicData>
			<texPath>Things/Ammo/FuelTank/Prometheum</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>JelliedPrometheumFuel</ammoClass>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>5</damageAmountBase>
				<explosiveDamageType>PrometheumFlame</explosiveDamageType>
				<explosiveRadius>1.2</explosiveRadius>
				<preExplosionSpawnThingDef>FilthPrometheum</preExplosionSpawnThingDef>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
			</li>
		</comps>
		<detonateProjectile>Bullet_Flamethrower_Prometheum</detonateProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="FlamethrowerBase" MayRequire="Ludeon.Rimworld.Anomaly">
		<defName>Ammo_Flamethrower_Bioferrite</defName>
		<label>infused chemfuel</label>
		<description>Fuel for a flamethrower that burns at incredibly high temperature, leaving behind no puddles of fuel.\n\nAn infusion of crystalline bioferrite attacks organic matter on a cellular level, disrupting regeneration and weakening tissue.</description>
		<graphicData>
			<texPath>Things/Ammo/FuelTank/Bioferrite</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<ammoClass>Bioferrite</ammoClass>
		<generateAllowChance>0.4</generateAllowChance>
		<comps>
			<li Class="CombatExtended.CompProperties_ExplosiveCE">
				<damageAmountBase>2</damageAmountBase>
				<explosiveDamageType>Flame</explosiveDamageType>
				<explosiveRadius>1</explosiveRadius>
				<preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
			</li>
		</comps>
		<detonateProjectile>Bullet_Flamethrower_Bioferrite</detonateProjectile>
	</ThingDef>

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

	<ThingDef Name="BaseFlamethrowerBullet" ParentName="BaseExplosiveBullet" Abstract="true">
		<graphicData>
			<texPath>Things/Mote/FireGlow</texPath>
			<shaderType>MoteGlow</shaderType>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>20</speed>
			<flyOverhead>false</flyOverhead>
			<castShadow>false</castShadow>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ProjectileFleck">
				<FleckDatas>
					<li>
						<fleck>Fleck_CEFlamethrowerTrail</fleck>
						<emissionsPerTick>2</emissionsPerTick>
						<flecksPerEmission>2</flecksPerEmission>
						<scale>1</scale>
						<startDelayTick>2</startDelayTick>
					</li>
					<li>
						<fleck>Fleck_CEFlamethrowerSmokeTrail</fleck>
						<emissionsPerTick>2</emissionsPerTick>
						<flecksPerEmission>1</flecksPerEmission>
						<scale>1</scale>
						<startDelayTick>2</startDelayTick>
					</li>
				</FleckDatas>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="BaseFlamethrowerBullet">
		<defName>Bullet_Flamethrower_Napalm</defName>
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<label>jellied chemfuel stream</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Flame</damageDef>
			<damageAmountBase>3</damageAmountBase>
			<preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef>
			<preExplosionSpawnChance>0.33</preExplosionSpawnChance>
			<soundExplode>CE_FlamethrowerExplosion</soundExplode>
			<explosionRadius>1.0</explosionRadius>
			<ai_IsIncendiary>true</ai_IsIncendiary>
			<screenShakeFactor>0</screenShakeFactor>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseFlamethrowerBullet">
		<defName>Bullet_Flamethrower_Prometheum</defName>
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<label>jellied prometheum stream</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>PrometheumFlame</damageDef>
			<damageAmountBase>5</damageAmountBase>
			<preExplosionSpawnThingDef>FilthPrometheum</preExplosionSpawnThingDef>
			<preExplosionSpawnChance>0.67</preExplosionSpawnChance>
			<soundExplode>CE_FlamethrowerExplosion</soundExplode>
			<explosionRadius>1.2</explosionRadius>
			<ai_IsIncendiary>true</ai_IsIncendiary>
			<screenShakeFactor>0</screenShakeFactor>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseFlamethrowerBullet" MayRequire="Ludeon.Rimworld.Anomaly">
		<defName>Bullet_Flamethrower_Bioferrite</defName>
		<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		<label>infused chemfuel stream</label>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>BioferriteFlame</damageDef>
			<damageAmountBase>5</damageAmountBase>
			<soundExplode>CE_FlamethrowerExplosion</soundExplode>
			<explosionRadius>1.2</explosionRadius>
			<ai_IsIncendiary>true</ai_IsIncendiary>
			<screenShakeFactor>0</screenShakeFactor>
		</projectile>
	</ThingDef>

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

	<RecipeDef Name="FlamethrowerAmmoRecipeBase" ParentName="AmmoRecipeBase" Abstract="true">
		<workSpeedStat>DrugSynthesisSpeed</workSpeedStat>
		<effectWorking>Cook</effectWorking>
		<soundWorking>Recipe_CookMeal</soundWorking>
		<workSkill>Intellectual</workSkill>
	</RecipeDef>

	<RecipeDef ParentName="FlamethrowerAmmoRecipeBase">
		<defName>MakeAmmo_Flamethrower_Napalm</defName>
		<label>make jellied chemfuel x100</label>
		<description>Craft 100 units of jellied chemfuel.</description>
		<jobString>Making jellied chemfuel.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Chemfuel</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Chemfuel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_Flamethrower_Napalm>100</Ammo_Flamethrower_Napalm>
		</products>
	</RecipeDef>

	<RecipeDef ParentName="FlamethrowerAmmoRecipeBase">
		<defName>MakeAmmo_Flamethrower_Prometheum</defName>
		<label>make jellied prometheum x100</label>
		<description>Craft 100 units of jellied prometheum.</description>
		<jobString>Making jellied prometheum.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Prometheum</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_Flamethrower_Prometheum>100</Ammo_Flamethrower_Prometheum>
		</products>
		<skillRequirements>
			<Crafting>4</Crafting>
		</skillRequirements>
	</RecipeDef>

	<RecipeDef ParentName="FlamethrowerAmmoRecipeBase" MayRequire="Ludeon.Rimworld.Anomaly">
		<defName>MakeAmmo_Flamethrower_Bioferrite</defName>
		<label>make bioferrite-infused chemfuel x100</label>
		<description>Craft 100 units of bioferrite-infused chemfuel.</description>
		<jobString>Making bioferrite-infused chemfuel.</jobString>
		<researchPrerequisite>BioferriteIgnition</researchPrerequisite>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Chemfuel</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Bioferrite</li>
					</thingDefs>
				</filter>
				<count>10</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Bioferrite</li>
				<li>Chemfuel</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_Flamethrower_Bioferrite>100</Ammo_Flamethrower_Bioferrite>
		</products>
	</RecipeDef>

</Defs>
