<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!-- ========== Makarov (PM) ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MakarovPistol</defName>
		<statBases>
			<Mass>0.73</Mass>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
			<SightsEfficiency>0.70</SightsEfficiency>
			<ShotSpread>0.18</ShotSpread>
			<SwayFactor>0.78</SwayFactor>
			<Bulk>1.62</Bulk>
			<WorkToMake>7000</WorkToMake>
		</statBases>
		<costList>
			<Steel>25</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_9x18mmMakarov_FMJ</defaultProjectile>
			<warmupTime>0.6</warmupTime>
			<range>12</range>
			<soundCast>Makarov</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>

		<AmmoUser>
			<magazineSize>8</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_9x18mmMakarov</ammoSet>
		</AmmoUser>

		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
		</FireModes>

		<weaponTags>
			<li>CE_AI_Pistol</li>
			<li>CE_Sidearm</li>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- ========== Steckin ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_APSPistol</defName>
		<statBases>
			<Mass>1.22</Mass>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
			<SightsEfficiency>0.90</SightsEfficiency>
			<ShotSpread>0.13</ShotSpread>
			<SwayFactor>0.78</SwayFactor>
			<Bulk>2.25</Bulk>
			<WorkToMake>20000</WorkToMake>
		</statBases>
		<costList>
			<Steel>30</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
		</costList>
		<Properties>
			<recoilAmount>1.41</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_9x18mmMakarov_FMJ</defaultProjectile>
			<warmupTime>0.6</warmupTime>
			<range>20</range>
			<burstShotCount>5</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<soundCast>Makarov</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>

		<AmmoUser>
			<magazineSize>20</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_9x18mmMakarov</ammoSet>
		</AmmoUser>

		<FireModes>
			<aiUseBurstMode>TRUE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>3</aimedBurstShotCount>
		</FireModes>

		<weaponTags>
			<li>CE_AI_Pistol</li>
			<li>CE_Sidearm</li>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- ========== TT-33 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_TokarevPistol</defName>
		<statBases>
			<Mass>0.85</Mass>
			<RangedWeapon_Cooldown>0.39</RangedWeapon_Cooldown>
			<SightsEfficiency>0.70</SightsEfficiency>
			<ShotSpread>0.17</ShotSpread>
			<SwayFactor>0.93</SwayFactor>
			<Bulk>1.94</Bulk>
			<WorkToMake>7000</WorkToMake>
		</statBases>
		<costList>
			<Steel>25</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x25mmTokarev_FMJ</defaultProjectile>
			<warmupTime>0.6</warmupTime>
			<range>12</range>
			<soundCast>Makarov</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>

		<AmmoUser>
			<magazineSize>8</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_762x25mmTokarev</ammoSet>
		</AmmoUser>

		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>

		<weaponTags>
			<li>CE_AI_Pistol</li>
			<li>CE_Sidearm</li>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- == Shared patches for firearm melee tools == -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="Gun_MakarovPistol" or
			defName="Gun_APSPistol" or
			defName="Gun_TokarevPistol"
			]/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>
</Patch>