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

	<!-- ========== Tools ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="LightMechanoidGun"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>6</power>
					<cooldownTime>2.0</cooldownTime>
					<armorPenetrationBlunt>3.0</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_Slugthrower"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>6</power>
					<cooldownTime>2.0</cooldownTime>
					<armorPenetrationBlunt>3.0</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Mini-shotgun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MiniShotgun</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.6</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>0.53</SwayFactor>
			<Bulk>7.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>2.42</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_410Bore_Buck</defaultProjectile>
			<warmupTime>0.8</warmupTime>
			<range>14</range>
			<soundCast>Shot_Shotgun_NoRack</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>6</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>6</magazineSize>
			<reloadTime>4.9</reloadTime>
			<ammoSet>AmmoSet_410Bore</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_BROOM</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<!-- ========== Slugthrower ========== --><!-- Obsolete: Kept for back-compat and modding -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_Slugthrower</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>0.53</SwayFactor>
			<Bulk>6.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.66</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_556x45mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>35</range>
			<soundCast>Shot_Slugthrower</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>10</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_556x45mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_AR</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<!-- ========== Spiner ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_Spiner</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.16</ShotSpread>
			<SwayFactor>0.33</SwayFactor>
			<Bulk>2.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.42</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_5x16mmCharged</defaultProjectile>
			<warmupTime>1.1</warmupTime><!-- Intentionally increased from 0.8 due to balance reasons-->
			<range>15</range>
			<soundCast>Shot_Spiner</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_BROOM</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<!-- ========== Mini-flameblaster ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MiniFlameblaster</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>1.0</SightsEfficiency>
			<ShotSpread>3.0</ShotSpread>
			<SwayFactor>0.53</SwayFactor>
			<Bulk>6.00</Bulk>
		</statBases>
		<AmmoUser>
			<magazineSize>30</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_Flamethrower</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>SuppressFire</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_AOE</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_MiniFlameblaster"]/verbs</xpath>
		<value>
			<verbs>
				<li Class="CombatExtended.VerbPropertiesCE">
					<recoilAmount>0.35</recoilAmount>
					<verbClass>CombatExtended.Verb_ShootCE</verbClass>
					<hasStandardCommand>true</hasStandardCommand>
					<defaultProjectile>Bullet_Flamethrower_Prometheum</defaultProjectile>
					<targetParams>
						<canTargetLocations>true</canTargetLocations>
					</targetParams>
					<warmupTime>1.1</warmupTime>
					<range>10</range>
					<minRange>1.9</minRange>
					<ai_AvoidFriendlyFireRadius>2</ai_AvoidFriendlyFireRadius>
					<burstShotCount>5</burstShotCount>
					<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
					<soundCast>Shot_MiniFlameblaster</soundCast>
					<muzzleFlashScale>9</muzzleFlashScale>
				</li>
			</verbs>
		</value>
	</Operation>

</Patch>