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

	<!-- === Tools === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HUA_Gun_AdvancedMagnum"]/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>

	<Operation Class="PatchOperationReplace">
		<xpath>
			Defs/ThingDef[
			defName="HUA_Gun_AdvancedAssaultRifle" or
			defName="HUA_Gun_AdvancedBattleRifle" or
			defName="HUA_Gun_AdvancedDMR" or
			defName="HUA_Gun_AdvancedShotgun" or
			defName="HUA_Gun_AdvancedSniperRifle" or
			defName="HUA_Gun_HeavyChargeRifle" or
			defName="HUA_Gun_ChargeStanchion"
			]/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>

	<!-- === Industrial === -->

	<!-- == Advanced Pistol == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_AdvancedMagnum</defName>
		<statBases>
			<WorkToMake>9000</WorkToMake>
			<SightsEfficiency>0.7</SightsEfficiency>
			<ShotSpread>0.5</ShotSpread>
			<SwayFactor>1.10</SwayFactor>
			<Bulk>2.10</Bulk>
			<Mass>1.05</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_500SWMagnum_FMJ</defaultProjectile>
			<warmupTime>0.7</warmupTime>
			<range>12</range>
			<burstShotCount>3</burstShotCount>
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<soundCast>Shot_Revolver</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>8</magazineSize>
			<reloadTime>1.90</reloadTime>
			<ammoSet>AmmoSet_500SWMagnum</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>1</aimedBurstShotCount>
		</FireModes>
		<weaponTags>
			<li>SimpleGun</li>
			<li>HUA_Gun</li>
			<li>CE_OneHandedWeapon</li>
			<li>CE_Sidearm</li>
		</weaponTags>
	</Operation>

	<!-- == Advanced Assault Rifle == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_AdvancedAssaultRifle</defName>
		<statBases>
			<WorkToMake>48000</WorkToMake>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.10</ShotSpread>
			<SwayFactor>1.30</SwayFactor>
			<Bulk>7</Bulk>
			<Mass>4.32</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>1.51</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<warmupTime>1.0</warmupTime>
			<range>48</range>
			<soundCast>Shot_AssaultRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>32</magazineSize>
			<reloadTime>4.5</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>3</aimedBurstShotCount>
			<aiUseBurstMode>true</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
	</Operation>

	<!-- == Advanced Battle Rifle == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_AdvancedBattleRifle</defName>
		<statBases>
			<WorkToMake>44000</WorkToMake>
			<SightsEfficiency>1.2</SightsEfficiency>
			<ShotSpread>0.06</ShotSpread>
			<SwayFactor>1.23</SwayFactor>
			<Bulk>6</Bulk>
			<Mass>5</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>1.35</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_95x40mmUNSC_FMJ</defaultProjectile>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<warmupTime>1</warmupTime>
			<range>55</range>
			<soundCast>Shot_AssaultRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>36</magazineSize>
			<reloadTime>4.00</reloadTime>
			<ammoSet>AmmoSet_95x40mmUNSC</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>true</aiUseBurstMode>
			<aimedBurstShotCount>3</aimedBurstShotCount>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
	</Operation>

	<!-- == Advanced Marksman Rifle == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_AdvancedDMR</defName>
		<statBases>
			<WorkToMake>42000</WorkToMake>
			<SightsEfficiency>1.5</SightsEfficiency>
			<ShotSpread>0.10</ShotSpread>
			<SwayFactor>1.40</SwayFactor>
			<Bulk>11.9</Bulk>
			<Mass>4.75</Mass>
			<RangedWeapon_Cooldown>0.48</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>62</range>
			<soundCast>Shot_AssaultRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>14</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>SniperRifle</li>
		</weaponTags>
	</Operation>

	<!-- == Advanced Shotgun == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_AdvancedShotgun</defName>
		<statBases>
			<WorkToMake>44000</WorkToMake>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.5</ShotSpread>
			<SwayFactor>1.9</SwayFactor>
			<Bulk>9.0</Bulk>
			<Mass>4.0</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_12Gauge_Buck</defaultProjectile>
			<warmupTime>0.7</warmupTime>
			<range>18</range>
			<soundCast>Shot_Shotgun</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>6</magazineSize>
			<reloadTime>1.7</reloadTime>
			<reloadOneAtATime>True</reloadOneAtATime>
			<ammoSet>AmmoSet_12Gauge</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
	</Operation>

	<!-- == Advanced Sniper Rifle == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_AdvancedSniperRifle</defName>
		<statBases>
			<WorkToMake>48000</WorkToMake>
			<SightsEfficiency>3.5</SightsEfficiency>
			<ShotSpread>0.5</ShotSpread>
			<SwayFactor>1.9</SwayFactor>
			<Bulk>16</Bulk>
			<Mass>9</Mass>
			<RangedWeapon_Cooldown>1.28</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>60</Steel>
			<Plasteel>40</Plasteel>
			<ComponentIndustrial>8</ComponentIndustrial>
			<Chemfuel>10</Chemfuel>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_145x114mm_FMJ</defaultProjectile>
			<warmupTime>3</warmupTime>
			<range>96</range>
			<soundCast>Shot_SniperRifle</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>11</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>4</magazineSize>
			<reloadTime>5.6</reloadTime>
			<ammoSet>AmmoSet_145x114mm</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags Inherit="False">
			<li>SniperRifle</li>
			<li>HUA_Gun</li>
		</weaponTags>
	</Operation>

	<!-- === Spacer === -->

	<!-- == Heavy Charge Rifle == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_HeavyChargeRifle</defName>
		<statBases>
			<WorkToMake>50000</WorkToMake>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.06</ShotSpread>
			<SwayFactor>1.52</SwayFactor>
			<Bulk>11.6</Bulk>
			<Mass>8</Mass>
			<RangedWeapon_Cooldown>0.56</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>1.43</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_8x35mmCharged</defaultProjectile>
			<burstShotCount>2</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<warmupTime>1.3</warmupTime>
			<range>62</range>
			<soundCast>Shot_ChargeRifle</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>11</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>20</magazineSize>
			<reloadTime>5.5</reloadTime>
			<ammoSet>AmmoSet_8x35mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>true</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>SpacerGun</li>
		</weaponTags>
	</Operation>

	<!-- == Stanchion Sniper Rifle == -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>HUA_Gun_ChargeStanchion</defName>
		<statBases>
			<WorkToMake>50000</WorkToMake>
			<SightsEfficiency>4</SightsEfficiency>
			<ShotSpread>0.5</ShotSpread>
			<SwayFactor>1.9</SwayFactor>
			<Bulk>17</Bulk>
			<Mass>9</Mass>
			<RangedWeapon_Cooldown>1.56</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>40</Steel>
			<Plasteel>50</Plasteel>
			<ComponentSpacer>5</ComponentSpacer>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_6mmRailgun_Sabot</defaultProjectile>
			<warmupTime>4</warmupTime>
			<range>100</range>
			<soundCast>Shot_ChargeRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>10</magazineSize>
			<reloadTime>5.6</reloadTime>
			<ammoSet>AmmoSet_6mmRailgun</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags Inherit="False">
			<li>SpacerGun</li>
		</weaponTags>
	</Operation>

</Patch>