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

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RNGun_Type56_Rifle</defName>
		<statBases>
			<Mass>3.47</Mass>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.09</ShotSpread>
			<SwayFactor>1.23</SwayFactor>
			<Bulk>8.80</Bulk>
			<WorkToMake>27000</WorkToMake>
		</statBases>
		<costList>
			<WoodLog>10</WoodLog>
			<Steel>45</Steel>
			<ComponentIndustrial>5</ComponentIndustrial>
		</costList>
		<Properties>
			<recoilAmount>1.82</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x39mmSoviet_FMJ</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>44</range>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<soundCast>RNShot_AK47Rifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Regular</recoilPattern>
		</Properties>

		<AmmoUser>
			<magazineSize>30</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_762x39mmSoviet</ammoSet>
		</AmmoUser>

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

		<weaponTags>
			<li>CE_AI_Rifle</li>
		</weaponTags>
	</Operation>

	<!-- ========== AK-47 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RNGun_AK47_Rifle</defName>
		<statBases>
			<Mass>3.47</Mass>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.09</ShotSpread>
			<SwayFactor>1.23</SwayFactor>
			<Bulk>8.80</Bulk>
			<WorkToMake>27000</WorkToMake>
		</statBases>
		<costList>
			<WoodLog>10</WoodLog>
			<Steel>45</Steel>
			<ComponentIndustrial>5</ComponentIndustrial>
		</costList>
		<Properties>
			<recoilAmount>1.82</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x39mmSoviet_FMJ</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>44</range>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<soundCast>RNShot_AK47Rifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Regular</recoilPattern>
		</Properties>

		<AmmoUser>
			<magazineSize>30</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_762x39mmSoviet</ammoSet>
		</AmmoUser>

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

		<weaponTags>
			<li>CE_AI_Rifle</li>
		</weaponTags>
	</Operation>

	<!-- ========== AK-74 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RNGun_AK74_Rifle</defName>
		<statBases>
			<Mass>3.07</Mass>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.08</ShotSpread>
			<SwayFactor>1.25</SwayFactor>
			<Bulk>9.43</Bulk>
			<WorkToMake>27500</WorkToMake>
		</statBases>
		<costList>
			<WoodLog>10</WoodLog>
			<Steel>50</Steel>
			<ComponentIndustrial>5</ComponentIndustrial>
		</costList>
		<Properties>
			<recoilAmount>1.43</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_545x39mmSoviet_FMJ</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>55</range>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<soundCast>RNShotAK74USMG</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Regular</recoilPattern>
		</Properties>

		<AmmoUser>
			<magazineSize>30</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_545x39mmSoviet</ammoSet>
		</AmmoUser>

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

		<weaponTags>
			<li>CE_AI_Rifle</li>
		</weaponTags>
	</Operation>

	<!-- ========== AK-103 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RNGun_AK103_Rifle</defName>
		<statBases>
			<Mass>3.60</Mass>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>2.06</SightsEfficiency>
			<ShotSpread>0.08</ShotSpread>
			<SwayFactor>1.23</SwayFactor>
			<Bulk>9.43</Bulk>
			<WorkToMake>32000</WorkToMake>
		</statBases>
		<costList>
			<Chemfuel>10</Chemfuel>
			<Steel>45</Steel>
			<ComponentIndustrial>5</ComponentIndustrial>
		</costList>
		<Properties>
			<recoilAmount>1.64</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x39mmSoviet_FMJ</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>44</range>
			<burstShotCount>6</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<soundCast>RNShot_AK47Rifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Regular</recoilPattern>
		</Properties>

		<AmmoUser>
			<magazineSize>30</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_762x39mmSoviet</ammoSet>
		</AmmoUser>

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

		<weaponTags>
			<li>CE_AI_Rifle</li>
		</weaponTags>
	</Operation>

	<!-- AS Val -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RNGun_ASVAL_Rifle</defName>
		<statBases>
			<Mass>2.50</Mass>
			<RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.14</ShotSpread>
			<SwayFactor>1.17</SwayFactor>
			<Bulk>6.15</Bulk>
			<WorkToMake>37500</WorkToMake>
		</statBases>
		<costList>
			<Chemfuel>10</Chemfuel>
			<Steel>45</Steel>
			<ComponentIndustrial>6</ComponentIndustrial>
		</costList>
		<Properties>
			<recoilAmount>1.94</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_9x39mmSoviet_FMJ</defaultProjectile>
			<warmupTime>1.0</warmupTime>
			<range>31</range>
			<burstShotCount>5</burstShotCount>
			<ticksBetweenBurstShots>4</ticksBetweenBurstShots>
			<soundCast>RNShotVSSVintorez</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>1</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>20</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_9x39mmSoviet</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>TRUE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>3</aimedBurstShotCount>
		</FireModes>
		<weaponTags>
			<li>CE_AI_AssaultWeapon</li>
			<li>IndustrialGunAdvanced</li>
		</weaponTags>
		<researchPrerequisite>PrecisionRifling</researchPrerequisite>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="RNGun_AK47_Rifle" or
			defName="RNGun_AK74_Rifle" or
			defName="RNGun_AK103_Rifle" or
			defName="RNGun_ASVAL_Rifle" or
			defName="RNGun_Type56_Rifle"
			]/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>
</Patch>