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

	<!-- ========== Grenade Base ========== -->

	<Operation Class="PatchOperationAttributeSet">
		<xpath>Defs/ThingDef[@Name="DankPyon_Medieval_MakeableGrenade"]</xpath>
		<attribute>ParentName</attribute>
		<value>BaseWeapon</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[@Name="DankPyon_Medieval_MakeableGrenade"]/recipeMaker</xpath>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="DankPyon_Medieval_MakeableGrenade"]</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>Body</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>1.75</cooldownTime>
					<armorPenetrationBlunt>1.0</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Base</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Fire Bomb ========== -->

	<!-- Projectile -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_PotFire"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<explosionRadius>0.5</explosionRadius>
				<damageDef>Flame</damageDef>
				<damageAmountBase>10</damageAmountBase>
				<preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
				<speed>10</speed>
				<ai_IsIncendiary>true</ai_IsIncendiary>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_PotFire"]</xpath>
		<value>
			<thingClass>CombatExtended.Projectile_FireTrail</thingClass>
		</value>
	</Operation>

	<!-- Grenade -->

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFire"]/costList</xpath>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFire"]</xpath>
		<value>
			<thingClass>CombatExtended.AmmoThing</thingClass>
			<stackLimit>50</stackLimit>
			<resourceReadoutPriority>First</resourceReadoutPriority>
		</value>
	</Operation>

	<Operation Class="PatchOperationAttributeSet">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFire"]</xpath>
		<attribute>Class</attribute>
		<value>CombatExtended.AmmoDef</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFire"]/comps</xpath>
		<value>
			<li Class="CompProperties_Explosive">
				<explosiveDamageType>Flame</explosiveDamageType>
				<explosiveRadius>0.5</explosiveRadius>
				<preExplosionSpawnThingDef>Filth_Fuel</preExplosionSpawnThingDef>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
				<startWickHitPointsPercent>0.7</startWickHitPointsPercent>
				<explodeOnKilled>True</explodeOnKilled>
				<wickTicks>60~80</wickTicks>
			</li>
		</value>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Weapon_PotFire</defName>
		<statBases>
			<Mass>0.6</Mass>
			<Bulk>1.8</Bulk>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
			<SightsEfficiency>1.0</SightsEfficiency>
		</statBases>
		<Properties>
			<label>throw fire pot</label>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<range>10</range>
			<minRange>3</minRange>
			<warmupTime>1.8</warmupTime>
			<noiseRadius>4</noiseRadius>
			<ai_IsBuildingDestroyer>true</ai_IsBuildingDestroyer>
			<soundCast>ThrowMolotovCocktail</soundCast>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<defaultProjectile>DankPyon_Proj_PotFire</defaultProjectile>
			<ignorePartialLoSBlocker>true</ignorePartialLoSBlocker>
		</Properties>
		<weaponTags>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- ========== Flash Bomb ========== -->

	<!-- Projectile -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_PotFlash"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<explosionRadius>2.5</explosionRadius>
				<damageDef>Stun</damageDef>
				<explosionDelay>100</explosionDelay>
				<speed>10</speed>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_PotFlash"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Projectile_FireTrail</thingClass>
		</value>
	</Operation>

	<!-- Grenade -->

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlash"]/costList</xpath>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlash"]</xpath>
		<value>
			<thingClass>CombatExtended.AmmoThing</thingClass>
			<stackLimit>50</stackLimit>
			<resourceReadoutPriority>First</resourceReadoutPriority>
		</value>
	</Operation>

	<Operation Class="PatchOperationAttributeSet">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlash"]</xpath>
		<attribute>Class</attribute>
		<value>CombatExtended.AmmoDef</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlash"]/comps</xpath>
		<value>
			<li Class="CompProperties_Explosive">
				<explosiveRadius>2.5</explosiveRadius>
				<explosiveDamageType>Stun</explosiveDamageType>
				<startWickHitPointsPercent>0.7</startWickHitPointsPercent>
				<explodeOnKilled>True</explodeOnKilled>
				<wickTicks>60~100</wickTicks>
			</li>
		</value>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Weapon_PotFlash</defName>
		<statBases>
			<Mass>0.6</Mass>
			<Bulk>1.8</Bulk>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
			<SightsEfficiency>1.0</SightsEfficiency>
		</statBases>
		<Properties>
			<label>throw flash pot</label>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<range>10</range>
			<minRange>3</minRange>
			<warmupTime>1.8</warmupTime>
			<noiseRadius>4</noiseRadius>
			<ai_IsBuildingDestroyer>true</ai_IsBuildingDestroyer>
			<soundCast>ThrowMolotovCocktail</soundCast>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<defaultProjectile>DankPyon_Proj_PotFlash</defaultProjectile>
			<ignorePartialLoSBlocker>true</ignorePartialLoSBlocker>
		</Properties>
		<weaponTags>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- ========== Smoke Bomb ========== -->

	<!-- Projectile -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_PotSmoke"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<explosionRadius>3</explosionRadius>
				<damageDef>Smoke</damageDef>
				<suppressionFactor>0.0</suppressionFactor>
				<dangerFactor>0.0</dangerFactor>
				<explosionDelay>100</explosionDelay>
				<postExplosionGasType>BlindSmoke</postExplosionGasType>
				<postExplosionSpawnChance>1</postExplosionSpawnChance>
				<speed>10</speed>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_PotSmoke"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Projectile_FireTrail</thingClass>
		</value>
	</Operation>

	<!-- Grenade -->

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlashSmoke"]/costList</xpath>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlashSmoke"]</xpath>
		<value>
			<thingClass>CombatExtended.AmmoThing</thingClass>
			<stackLimit>50</stackLimit>
			<resourceReadoutPriority>First</resourceReadoutPriority>
		</value>
	</Operation>

	<Operation Class="PatchOperationAttributeSet">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlashSmoke"]</xpath>
		<attribute>Class</attribute>
		<value>CombatExtended.AmmoDef</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_PotFlashSmoke"]/comps</xpath>
		<value>
			<li Class="CompProperties_Explosive">
				<explosiveRadius>2.5</explosiveRadius>
				<explosiveDamageType>Stun</explosiveDamageType>
				<startWickHitPointsPercent>0.7</startWickHitPointsPercent>
				<postExplosionGasType>BlindSmoke</postExplosionGasType>
				<preExplosionSpawnChance>1</preExplosionSpawnChance>
				<explodeOnKilled>True</explodeOnKilled>
				<wickTicks>60~100</wickTicks>
			</li>
		</value>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Weapon_PotFlashSmoke</defName>
		<statBases>
			<Mass>0.6</Mass>
			<Bulk>1.8</Bulk>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
			<SightsEfficiency>1.0</SightsEfficiency>
		</statBases>
		<Properties>
			<label>throw smoke pot</label>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<range>10</range>
			<minRange>3</minRange>
			<warmupTime>1.8</warmupTime>
			<noiseRadius>4</noiseRadius>
			<ai_IsBuildingDestroyer>true</ai_IsBuildingDestroyer>
			<soundCast>ThrowMolotovCocktail</soundCast>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<defaultProjectile>DankPyon_Proj_PotSmoke</defaultProjectile>
			<ignorePartialLoSBlocker>true</ignorePartialLoSBlocker>
		</Properties>
		<weaponTags>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>
	
	<!-- ========== Acidflask Bomb ========== -->

	<!-- Projectile -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Proj_AcidFlask"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<explosionRadius>2.5</explosionRadius>
				<damageDef>DankPyon_LindwurmAcidBurn</damageDef>
				<explosionDelay>100</explosionDelay>
				<speed>10</speed>
			</projectile>
		</value>
	</Operation>

	<!-- Grenade -->

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_AcidFlask"]/costList</xpath>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_AcidFlask"]</xpath>
		<value>
			<thingClass>CombatExtended.AmmoThing</thingClass>
			<resourceReadoutPriority>First</resourceReadoutPriority>
		</value>
	</Operation>

	<Operation Class="PatchOperationAttributeSet">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_AcidFlask"]</xpath>
		<attribute>Class</attribute>
		<value>CombatExtended.AmmoDef</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Weapon_AcidFlask"]/comps</xpath>
		<value>
			<li Class="CompProperties_Explosive">
				<explosiveRadius>2.5</explosiveRadius>
				<explosiveDamageType>Stun</explosiveDamageType>
				<startWickHitPointsPercent>0.7</startWickHitPointsPercent>
				<explodeOnKilled>True</explodeOnKilled>
				<wickTicks>60~100</wickTicks>
			</li>
		</value>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Weapon_AcidFlask</defName>
		<statBases>
			<Mass>0.6</Mass>
			<Bulk>1.8</Bulk>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
			<SightsEfficiency>1.0</SightsEfficiency>
		</statBases>
		<Properties>
			<label>throw flash pot</label>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<range>10</range>
			<minRange>3</minRange>
			<warmupTime>1.8</warmupTime>
			<noiseRadius>4</noiseRadius>
			<ai_IsBuildingDestroyer>true</ai_IsBuildingDestroyer>
			<soundCast>ThrowMolotovCocktail</soundCast>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<defaultProjectile>DankPyon_Proj_AcidFlask</defaultProjectile>
			<ignorePartialLoSBlocker>true</ignorePartialLoSBlocker>
		</Properties>
		<weaponTags>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

</Patch>