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

	<!-- ==================== ThingCategoryDef ========================== -->

	<ThingCategoryDef>
		<defName>AmmoFlare</defName>
		<label>flare</label>
		<parent>AmmoShotguns</parent>
		<iconPath>UI/Icons/ThingCategories/CaliberFlare</iconPath>
	</ThingCategoryDef>

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

	<CombatExtended.AmmoSetDef>
		<defName>AmmoSet_Flare</defName>
		<label>flare shell</label>
		<ammoTypes>
			<Ammo_Flare>Bullet_Flare</Ammo_Flare>
			<Ammo_FlareBioferrite MayRequire="Ludeon.RimWorld.Anomaly">Bullet_FlareBioferrite</Ammo_FlareBioferrite>
		</ammoTypes>
	</CombatExtended.AmmoSetDef>

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

	<ThingDef Class="CombatExtended.AmmoDef" Name="FlareBase" ParentName="SmallAmmoBase" Abstract="True">
		<description>A flare round for illumination.</description>
		<statBases>
			<Mass>0.023</Mass>
			<Bulk>0.06</Bulk>
		</statBases>
		<tradeTags>
			<li>CE_AutoEnableTrade</li>
			<li>CE_AutoEnableCrafting</li>
		</tradeTags>
		<thingCategories>
			<li>AmmoFlare</li>
		</thingCategories>
		<stackLimit>2000</stackLimit>
	</ThingDef>

	<ThingDef>
		<defName>Flare</defName>
		<label>Flare</label>
		<thingClass>CombatExtended.Flare</thingClass>
		<tickerType>Normal</tickerType>
		<drawerType>RealtimeOnly</drawerType>
		<drawOffscreen>true</drawOffscreen>
		<altitudeLayer>MoteOverheadLow</altitudeLayer>
		<comps>
			<li Class="CompProperties_Glower">
				<glowRadius>17</glowRadius>
				<glowColor>(255, 204, 128)</glowColor>
			</li>
			<li Class="CompProperties_HeatPusher">
				<compClass>CompHeatPusherPowered</compClass>
				<heatPerSecond>30</heatPerSecond>
				<heatPushMaxTemperature>100</heatPushMaxTemperature>
			</li>
		</comps>
		<graphicData>
			<graphicClass>Graphic_Single</graphicClass>
			<texPath>Things/Mote/BrightFlash</texPath>
			<shaderType>MoteGlow</shaderType>
			<color>(255, 204, 0)</color>
		</graphicData>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="FlareBase">
		<defName>Ammo_Flare</defName>
		<label>flare round</label>
		<graphicData>
			<texPath>Things/Ammo/Flare/Chemfuel</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>0.048</Mass>
		</statBases>
		<ammoClass>Flare</ammoClass>
		<cookOffProjectile>Bullet_Flare</cookOffProjectile>
	</ThingDef>

	<ThingDef Class="CombatExtended.AmmoDef" ParentName="FlareBase" MayRequire="Ludeon.RimWorld.Anomaly">
		<defName>Ammo_FlareBioferrite</defName>
		<label>bioferrite flare round</label>
		<graphicData>
			<texPath>Things/Ammo/Flare/Bioferrite</texPath>
			<graphicClass>Graphic_StackCount</graphicClass>
		</graphicData>
		<statBases>
			<Mass>0.048</Mass>
		</statBases>
		<ammoClass>DisruptorFlare</ammoClass>
		<generateAllowChance>0.15</generateAllowChance>
		<cookOffProjectile>Bullet_FlareBioferrite</cookOffProjectile>
	</ThingDef>

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

	<ThingDef Name="BaseFlareBullet" ParentName="BaseBulletCE" Abstract="true">
		<thingClass>CombatExtended.ProjectileCE_Flare</thingClass>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<speed>0</speed>
			<flyOverhead>true</flyOverhead>
			<dropsCasings>false</dropsCasings>
			<gravityFactor>5</gravityFactor>
		</projectile>
	</ThingDef>

	<ThingDef ParentName="BaseFlareBullet">
		<defName>Bullet_Flare</defName>
		<label>flare</label>
		<graphicData>
			<texPath>Things/Projectile/Bullet_big</texPath>
			<graphicClass>Graphic_Single</graphicClass>
			<color>(254, 161, 74)</color>
			<shaderType>MoteGlow</shaderType>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Smoke</damageDef>
			<suppressionFactor>0.0</suppressionFactor>
			<dangerFactor>0.0</dangerFactor>
			<armorPenetrationSharp>0</armorPenetrationSharp>
			<armorPenetrationBlunt>0</armorPenetrationBlunt>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ProjectileFleck">
				<FleckDatas>
					<li>
						<fleck>Fleck_CERocketFlame</fleck>
						<emissionsPerTick>4</emissionsPerTick>
						<flecksPerEmission>2</flecksPerEmission>
						<scale>1.3</scale>
						<originOffset>-0.5</originOffset>
					</li>
					<li>
						<fleck>Fleck_CERocketSmokeTrail</fleck>
						<emissionsPerTick>3</emissionsPerTick>
						<rotation>0~360</rotation>
						<scale>0.6</scale>
						<flecksPerEmission>1</flecksPerEmission>
					</li>
				</FleckDatas>
			</li>
		</comps>
	</ThingDef>

	<ThingDef MayRequire="Ludeon.RimWorld.Anomaly">
		<defName>CE_DisruptorFlareSmall</defName>
		<label>disruptor flare</label>
		<graphicData>
			<graphicClass>Graphic_Single</graphicClass>
			<texPath>Things/Mote/SparkFlash</texPath>
			<drawSize>2</drawSize>
			<color>(1, 0.4, 0.4)</color>
			<shaderType>TransparentPostLight</shaderType>
			<onGroundRandomRotateAngle>360</onGroundRandomRotateAngle>
		</graphicData>
		<selectable>false</selectable>
		<tickerType>Normal</tickerType>
		<thingClass>ThingWithComps</thingClass>
		<useHitPoints>false</useHitPoints>
		<rotatable>false</rotatable>
		<comps>
			<li Class="CompProperties_DisruptorFlare">
				<radius>1.5</radius>
				<effecterDef>DisruptorFlareAttached</effecterDef>
				<destroyWarningEffecterDef>DisruptorDestroyWarning</destroyWarningEffecterDef>
			</li>
			<li Class="CompProperties_DestroyAfterDelay">
				<delayTicks>2100</delayTicks>
				<displayCountdownOnLabel>true</displayCountdownOnLabel>
			</li>
			<li Class="CompProperties_Glower">
				<glowRadius>2.5</glowRadius>
				<glowColor>(255,117,108,0)</glowColor>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="BaseFlareBullet" MayRequire="Ludeon.RimWorld.Anomaly">
		<defName>Bullet_FlareBioferrite</defName>
		<thingClass>CombatExtended.ProjectileCE_SpawnsThing</thingClass>
		<label>bioferrite flare</label>
		<graphicData>
			<texPath>Things/Projectile/Bullet_big</texPath>
			<graphicClass>Graphic_Single</graphicClass>
			<color>(255, 95, 83)</color>
			<shaderType>MoteGlow</shaderType>
		</graphicData>
		<projectile Class="CombatExtended.ProjectilePropertiesCE">
			<damageDef>Smoke</damageDef>
			<suppressionFactor>1.0</suppressionFactor>
			<flyOverhead>false</flyOverhead>
			<dangerFactor>0.0</dangerFactor>
			<armorPenetrationSharp>0</armorPenetrationSharp>
			<armorPenetrationBlunt>0</armorPenetrationBlunt>
			<landedEffecter>DisruptorFlareLanded</landedEffecter>
			<spawnsThingDef>CE_DisruptorFlareSmall</spawnsThingDef>
		</projectile>
		<comps>
			<li Class="CombatExtended.CompProperties_ProjectileFleck">
				<FleckDatas>
					<li>
						<fleck>Fleck_CE_BioferriteGlow</fleck>
						<emissionsPerTick>6</emissionsPerTick>
						<rotation>0~360</rotation>
						<scale>2.5</scale>
						<flecksPerEmission>1</flecksPerEmission>
						<originOffset>-0.5</originOffset>
					</li>
				</FleckDatas>
			</li>
		</comps>
	</ThingDef>

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

	<RecipeDef ParentName="AmmoRecipeBase">
		<defName>MakeAmmo_Flare</defName>
		<label>make flare x200</label>
		<description>Craft 200 flare shells.</description>
		<jobString>Making flare shells.</jobString>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>20</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Prometheum</li>
					</thingDefs>
				</filter>
				<count>3</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Prometheum</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_Flare>200</Ammo_Flare>
		</products>
		<workAmount>2000</workAmount>
	</RecipeDef>

	<RecipeDef ParentName="AmmoRecipeBase" MayRequire="Ludeon.RimWorld.Anomaly">
		<defName>MakeAmmo_FlareBioferrite</defName>
		<label>make bioferrite flare x200</label>
		<description>Craft 200 bioferrite flare shells.</description>
		<jobString>Making bioferrite flare shells.</jobString>
		<researchPrerequisite>DisruptorFlares</researchPrerequisite>
		<ingredients>
			<li>
				<filter>
					<thingDefs>
						<li>Steel</li>
					</thingDefs>
				</filter>
				<count>20</count>
			</li>
			<li>
				<filter>
					<thingDefs>
						<li>Bioferrite</li>
					</thingDefs>
				</filter>
				<count>3</count>
			</li>
		</ingredients>
		<fixedIngredientFilter>
			<thingDefs>
				<li>Steel</li>
				<li>Bioferrite</li>
			</thingDefs>
		</fixedIngredientFilter>
		<products>
			<Ammo_FlareBioferrite>200</Ammo_FlareBioferrite>
		</products>
		<workAmount>2000</workAmount>
	</RecipeDef>

</Defs>