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

	<!-- ========== Charge Sidearm =========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_ChargeSidearm</defName>
		<statBases>
			<WorkToMake>17500</WorkToMake>
			<SightsEfficiency>0.8</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>1.37</SwayFactor>
			<Bulk>2.60</Bulk>
			<Mass>1.50</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>30</Steel>
			<Plasteel>20</Plasteel>
			<ComponentIndustrial>8</ComponentIndustrial>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_6x18mmCharged</defaultProjectile>
			<warmupTime>0.5</warmupTime>
			<range>12</range>
			<soundCast>Shot_ChargeRifle</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>10</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_6x18mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_Sidearm</li>
			<li>CE_AI_Pistol</li>
			<li>CE_OneHandedWeapon</li>
			<li>AdvancedGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_ChargeSidearm"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>grip</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>1.54</cooldownTime>
					<chanceFactor>1.5</chanceFactor>
					<armorPenetrationBlunt>0.555</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Grip</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>muzzle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>2</power>
					<cooldownTime>1.54</cooldownTime>
					<armorPenetrationBlunt>0.555</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Longgun Melee Tools =========== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_ScatterCharger" or defName="Gun_ChargeDriver" or defName="Gun_EMPRifle" or defName="Gun_AssaultCharger" or defName="Gun_BurstCharger"]/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>

	<!-- ========== Scatter Charger	=========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_ScatterCharger</defName>
		<statBases>
			<WorkToMake>31000</WorkToMake>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.14</ShotSpread>
			<SwayFactor>1.46</SwayFactor>
			<Bulk>9.60</Bulk>
			<Mass>5.00</Mass>
			<RangedWeapon_Cooldown>0.99</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>60</Steel>
			<Plasteel>30</Plasteel>
			<ComponentIndustrial>6</ComponentIndustrial>
			<Chemfuel>5</Chemfuel>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_12GaugeCharged</defaultProjectile>
			<warmupTime>0.5</warmupTime>
			<range>16</range>
			<soundCast>Shot_ChargeRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>8</magazineSize>
			<reloadTime>0.85</reloadTime>
			<reloadOneAtATime>true</reloadOneAtATime>
			<ammoSet>AmmoSet_12GaugeCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_AssaultWeapon</li>
			<li>AdvancedGun</li>
		</weaponTags>
	</Operation>

	<!-- ========== Charge Driver	=========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_ChargeDriver</defName>
		<statBases>
			<WorkToMake>59000</WorkToMake>
			<SightsEfficiency>2.5</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>2.08</SwayFactor>
			<Bulk>12.00</Bulk>
			<Mass>8.00</Mass>
			<RangedWeapon_Cooldown>0.39</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>80</Steel>
			<Plasteel>35</Plasteel>
			<ComponentIndustrial>10</ComponentIndustrial>
			<Chemfuel>5</Chemfuel>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_12x72mmCharged</defaultProjectile>
			<warmupTime>2.8</warmupTime>
			<range>86</range>
			<soundCast>ChargeLance_Fire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>5</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_12x72mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_Rifle</li>
			<li>SniperRifle</li>
			<li>AdvancedGun</li>
			<li>Bipod_AMR</li>
		</weaponTags>
	</Operation>

	<!-- ========== EMP Rifle	=========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_EMPRifle</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.08</ShotSpread>
			<SwayFactor>1.32</SwayFactor>
			<Bulk>9.85</Bulk>
			<Mass>4.80</Mass>
			<RangedWeapon_Cooldown>0.40</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>1.44</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>EMP_Blast</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>40</range>
			<burstShotCount>4</burstShotCount>
			<ammoConsumedPerShotCount>5</ammoConsumedPerShotCount>
			<ticksBetweenBurstShots>9</ticksBetweenBurstShots>
			<soundCast>Shot_ChargeRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>4.5</reloadTime>
			<ammoSet>AmmoSet_LaserEMP_Rimsenal</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>2</aimedBurstShotCount>
			<aiUseBurstMode>True</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_Rifle</li>
			<li>AdvancedGun</li>
		</weaponTags>
	</Operation>

	<!-- ========== Assault Charger =========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_AssaultCharger</defName>
		<statBases>
			<WorkToMake>50500</WorkToMake>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.06</ShotSpread>
			<SwayFactor>1.18</SwayFactor>
			<Bulk>11.00</Bulk>
			<Mass>6.80</Mass>
			<RangedWeapon_Cooldown>0.56</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>75</Steel>
			<Plasteel>35</Plasteel>
			<ComponentIndustrial>10</ComponentIndustrial>
			<Chemfuel>5</Chemfuel>
		</costList>
		<Properties>
			<recoilAmount>1.18</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_6x24mmCharged</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>75</range>
			<burstShotCount>20</burstShotCount>
			<ticksBetweenBurstShots>4</ticksBetweenBurstShots>
			<soundCast>ChargeLance_Fire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>15</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>4.9</reloadTime>
			<ammoSet>AmmoSet_6x24mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>5</aimedBurstShotCount>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_MachineGun</li>
			<li>CE_AI_Suppressive</li>
			<li>AdvancedGun</li>
		</weaponTags>
	</Operation>

	<!-- ========== Burst Charger =========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_BurstCharger</defName>
		<statBases>
			<WorkToMake>60500</WorkToMake>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>1.49</SwayFactor>
			<Bulk>9.60</Bulk>
			<Mass>5.30</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>60</Steel>
			<Plasteel>30</Plasteel>
			<ComponentIndustrial>11</ComponentIndustrial>
			<Chemfuel>5</Chemfuel>
		</costList>
		<Properties>
			<recoilAmount>1.39</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_8x35mmCharged</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>55</range>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<soundCast>ChargeLance_Fire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>20</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_8x35mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>3</aimedBurstShotCount>
			<aiUseBurstMode>True</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_AssaultWeapon</li>
			<li>AdvancedGun</li>
		</weaponTags>
	</Operation>

	<!-- ========== Charge Longgun =========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_CFR</defName>
		<statBases>
			<WorkToMake>81000</WorkToMake>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>1.61</SwayFactor>
			<Bulk>11.45</Bulk>
			<Mass>4.60</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>60</Steel>
			<Plasteel>80</Plasteel>
			<ComponentIndustrial>14</ComponentIndustrial>
			<Chemfuel>10</Chemfuel>
			<ComponentSpacer>1</ComponentSpacer>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_8x50mmCharged</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>62</range>
			<soundCast>Shot_BoltActionRifle</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>15</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_8x50mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>AdvancedGun</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_CFR"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>stock</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<chanceFactor>0.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>
					<chanceFactor>0.5</chanceFactor>
					<armorPenetrationBlunt>1.630</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>bayonet</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>15</power>
					<cooldownTime>1.55</cooldownTime>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<armorPenetrationSharp>24.01</armorPenetrationSharp>
					<linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

</Patch>