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

	<!-- ===== Tools ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Crossbow" or defName="DankPyon_CrossbowHeavy"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>7</power>
					<cooldownTime>1.6</cooldownTime>
					<armorPenetrationBlunt>0.65</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bow_War" or defName="DankPyon_Bow_Hunting"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>7</power>
					<cooldownTime>1.6</cooldownTime>
					<armorPenetrationBlunt>0.65</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Handgonne"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>stock</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<chanceFactor>1.5</chanceFactor>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>2.02</cooldownTime>
					<armorPenetrationBlunt>1.630</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>muzzle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ===== Crossbow ===== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Crossbow</defName>
		<statBases>
			<Bulk>6</Bulk>
			<SwayFactor>1.2</SwayFactor>
			<ShotSpread>0.25</ShotSpread>
			<SightsEfficiency>1</SightsEfficiency>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<WoodLog>70</WoodLog>
			<DankPyon_ComponentBasic>2</DankPyon_ComponentBasic>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Projectile_DankPyonCrossbowBolt_Steel</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>23</range>
			<soundCast>Bow_Large</soundCast>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>3.5</reloadTime>
			<ammoSet>AmmoSet_DankPyonCrossbowBolt</ammoSet>
			<AmmoGenPerMagOverride>4</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_XBow</li>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- ===== Heavy Crossbow ===== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_CrossbowHeavy</defName>
		<statBases>
			<Bulk>6</Bulk>
			<SwayFactor>1.0</SwayFactor>
			<ShotSpread>0.20</ShotSpread>
			<SightsEfficiency>1</SightsEfficiency>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<WoodLog>60</WoodLog>
			<Steel>25</Steel>
			<DankPyon_ComponentBasic>3</DankPyon_ComponentBasic>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Projectile_DankPyonArbalestBolt_Steel</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>26</range>
			<soundCast>Bow_Large</soundCast>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>5.5</reloadTime>
			<ammoSet>AmmoSet_DankPyonArbalestBolt</ammoSet>
			<AmmoGenPerMagOverride>4</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_XBow</li>
		</weaponTags>
	</Operation>

	<!-- ===== Hunting bow ===== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Bow_Hunting</defName>
		<statBases>
			<SightsEfficiency>0.8</SightsEfficiency>
			<ShotSpread>1</ShotSpread>
			<SwayFactor>2</SwayFactor>
			<Bulk>4.00</Bulk>
			<RangedWeapon_Cooldown>0.5</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<WoodLog>15</WoodLog>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Projectile_HuntingArrow_Stone</defaultProjectile>
			<warmupTime>1.2</warmupTime>
			<range>16</range>
			<soundCast>Bow_Recurve</soundCast>
		</Properties>
		<AmmoUser>
			<ammoSet>AmmoSet_HuntingArrow</ammoSet>
			<AmmoGenPerMagOverride>5</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes/>
		<weaponTags>
			<li>CE_Bow</li>
		</weaponTags>
		<researchPrerequisite>DankPyon_HuntingBow</researchPrerequisite>
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ===== War Bow ===== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Bow_War</defName>
		<statBases>
			<SightsEfficiency>0.8</SightsEfficiency>
			<ShotSpread>1</ShotSpread>
			<SwayFactor>2</SwayFactor>
			<Bulk>5.00</Bulk>
			<RangedWeapon_Cooldown>0.7</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<WoodLog>20</WoodLog>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Projectile_WarArrow_Stone</defaultProjectile>
			<warmupTime>1.5</warmupTime>
			<range>32</range>
			<soundCast>Bow_Large</soundCast>
		</Properties>
		<AmmoUser>
			<ammoSet>AmmoSet_WarArrow</ammoSet>
			<AmmoGenPerMagOverride>5</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes/>
		<weaponTags>
			<li>CE_Bow</li>
		</weaponTags>
		<researchPrerequisite>DankPyon_WarBow</researchPrerequisite>
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ===== Handgonne ===== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>DankPyon_Handgonne</defName>
		<statBases>
			<Bulk>7</Bulk>
			<SwayFactor>1.22</SwayFactor>
			<ShotSpread>0.36</ShotSpread>
			<SightsEfficiency>0.85</SightsEfficiency>
			<RangedWeapon_Cooldown>0.85</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Bullet_Handgonne_Ball</defaultProjectile>
			<warmupTime>1.66</warmupTime>
			<range>12</range>
			<soundCast>Shot_Shotgun_NoRack</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<ammoConsumedPerShotCount>4</ammoConsumedPerShotCount>
		</Properties>
		<AmmoUser>
			<magazineSize>4</magazineSize>
			<reloadTime>5.1</reloadTime>
			<ammoSet>AmmoSet_HandgonneShot</ammoSet>
			<AmmoGenPerMagOverride>4</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>NeolithicRangedHeavy</li>
			<li>NeolithicRangedChief</li>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

</Patch>