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

		<!--Melee Attacks for Guns-->
		<Operation Class="PatchOperationReplace">
			<xpath>Defs/ThingDef[
				defName="GW_HOI_Gun_Kantraeldefender" or
				defName="GW_HOI_Gun_BoltPistol" or
				defName="GW_HOI_PlasmaPistol" or
				defName="GW_HOI_InfernoPistol"]/tools
			</xpath>
			<value>
				<tools>
					<li Class="CombatExtended.ToolCE">
						<label>barrel</label>
						<capacities>
							<li>Blunt</li>
						</capacities>
						<power>5</power>
						<cooldownTime>2.02</cooldownTime>
						<armorPenetrationBlunt>1.63</armorPenetrationBlunt>
						<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
					</li>
					<li Class="CombatExtended.ToolCE">
						<label>grip</label>
						<capacities>
							<li>Blunt</li>
						</capacities>
						<power>8</power>
						<cooldownTime>1.55</cooldownTime>
						<chanceFactor>1.5</chanceFactor>
						<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
						<linkedBodyPartsGroup>Grip</linkedBodyPartsGroup>
					</li>
				</tools>
			</value>
	</Operation>

	<!--===== Pistols ======-->

	<!-- ============ Kantrael Defender ============ -->
	
	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="GW_HOI_Gun_Kantraeldefender"]/weaponTags</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="GW_HOI_Gun_Kantraeldefender"]</xpath>
			<value>
				<weaponTags />
			</value>
		</nomatch>
	</Operation>
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>GW_HOI_Gun_Kantraeldefender</defName>
		<statBases>
			<Mass>1.6</Mass>
			<RangedWeapon_Cooldown>0.32</RangedWeapon_Cooldown>
			<SightsEfficiency>1.05</SightsEfficiency>
			<ShotSpread>0.18</ShotSpread>
			<SwayFactor>1.14</SwayFactor>
			<Bulk>2</Bulk>
			<WorkToMake>14000</WorkToMake>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_Lasgun_Pistol</defaultProjectile>
			<warmupTime>0.6</warmupTime>
			<range>12</range>
			<burstShotCount>6</burstShotCount>
			<soundCast>GW_AM_Gun_Kantraeldefender</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilAmount>2.7</recoilAmount>
		</Properties>
		<AmmoUser>
			<magazineSize>36</magazineSize>
			<reloadTime>3.5</reloadTime>
			<ammoSet>AmmoSet_Lasgun_Pistol</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>3</aimedBurstShotCount>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_OneHandedWeapon</li>
			<li>CE_Sidearm</li>
			<li>AdvancedGun</li>
			<li>Autopistol</li>
		</weaponTags>
	</Operation>
	
	<!--===== Bolt Pistol =====-->
	
	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="GW_HOI_Gun_BoltPistol"]/weaponTags</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="GW_HOI_Gun_BoltPistol"]</xpath>
			<value>
				<weaponTags />
			</value>
		</nomatch>
	</Operation>
	
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>GW_HOI_Gun_BoltPistol</defName>
		<statBases>
			<Mass>3.5</Mass>
			<RangedWeapon_Cooldown>1.2</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.14</ShotSpread>
			<SwayFactor>1.2</SwayFactor>
			<Bulk>4</Bulk>
			<WorkToMake>14000</WorkToMake>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_Bolter50_Standard</defaultProjectile>
			<warmupTime>0.6</warmupTime>
			<range>24</range>
			<burstShotCount>4</burstShotCount>
			<soundCast>GW_Heavy_Bolt_Gun_Sound</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilAmount>2.7</recoilAmount>
		</Properties>
		<AmmoUser>
			<magazineSize>8</magazineSize>
			<reloadTime>3.2</reloadTime>
			<ammoSet>AmmoSet_Bolter50</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>2</aimedBurstShotCount>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_Pistol</li>
			<li>ShortShots</li>
		</weaponTags>
	</Operation>
	
	<!--===== AM Plasma Pistol =====-->
	
	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="GW_HOI_PlasmaPistol"]/weaponTags</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="GW_HOI_PlasmaPistol"]</xpath>
			<value>
				<weaponTags />
			</value>
		</nomatch>
	</Operation>
	
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>GW_HOI_PlasmaPistol</defName>
		<statBases>
			<Mass>8.6</Mass>
			<RangedWeapon_Cooldown>0.98</RangedWeapon_Cooldown>
			<SightsEfficiency>1.5</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>2.1</SwayFactor>
			<Bulk>6.8</Bulk>
			<WorkToMake>32000</WorkToMake>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_PlasmaPistol</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>27</range>
			<burstShotCount>1</burstShotCount>
			<soundCast>HP_AM_Plasma_Gun_Sound</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>12</muzzleFlashScale>
			<recoilAmount>0.8</recoilAmount>
			<ticksBetweenBurstShots>12</ticksBetweenBurstShots>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<AmmoUser>
			<magazineSize>4</magazineSize>
			<reloadTime>2.4</reloadTime>
			<ammoSet>AmmoSet_PlasmaCanister_Pistol</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>AdvancedGun</li>
			<li>CE_AI_Rifle</li>
		</weaponTags>
	</Operation>
	
	<!--===== AM Inferno Pistol =====-->
	
	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="GW_HOI_InfernoPistol"]/weaponTags</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="GW_HOI_InfernoPistol"]</xpath>
			<value>
				<weaponTags />
			</value>
		</nomatch>
	</Operation>
	
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>GW_HOI_InfernoPistol</defName>
		<statBases>
			<Mass>8.8</Mass>
			<RangedWeapon_Cooldown>1.78</RangedWeapon_Cooldown>
			<SightsEfficiency>1.5</SightsEfficiency>
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>2.1</SwayFactor>
			<Bulk>7.0</Bulk>
			<WorkToMake>36000</WorkToMake>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_Laser_MeltaCharge</defaultProjectile>
			<warmupTime>0.6</warmupTime>
			<range>10</range>
			<burstShotCount>0</burstShotCount>
			<soundCast>HP_AM_Melta_Gun_Sound</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>12</muzzleFlashScale>
			<recoilAmount>2.7</recoilAmount>
			<ticksBetweenBurstShots>8</ticksBetweenBurstShots>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<AmmoUser>
			<magazineSize>2</magazineSize>
			<reloadTime>2.6</reloadTime>
			<ammoSet>AmmoSet_MeltaCharge</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>AdvancedGun</li>
			<li>CE_AI_BROOM</li>
		</weaponTags>
	</Operation>
</Patch>
