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

	<!-- ========== RPG18 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG18D</defName>
		<statBases>
			<Mass>2.60</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.2</ShotSpread>
			<SwayFactor>1.24</SwayFactor>
			<Bulk>7.05</Bulk>
			<WorkToMake>12000</WorkToMake>
		</statBases>
		<costList>
			<Steel>50</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
			<FSX>3</FSX>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG18_HEAT</defaultProjectile>
			<warmupTime>1.9</warmupTime>
			<range>31</range>
			<minRange>2</minRange>
			<soundCast>LauncherFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>15</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== RPG22 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG22D</defName>
		<statBases>
			<Mass>2.80</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.2</ShotSpread>
			<SwayFactor>1.24</SwayFactor>
			<Bulk>7.85</Bulk>
			<WorkToMake>12000</WorkToMake>
		</statBases>
		<costList>
			<Steel>50</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
			<FSX>3</FSX>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG22_HEAT</defaultProjectile>
			<warmupTime>1.9</warmupTime>
			<range>32</range>
			<minRange>2</minRange>
			<soundCast>LauncherFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>15</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== RPG26 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG26D</defName>
		<statBases>
			<Mass>2.90</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.2</ShotSpread>
			<SwayFactor>1.24</SwayFactor>
			<Bulk>7.70</Bulk>
			<WorkToMake>12000</WorkToMake>
		</statBases>
		<costList>
			<Steel>50</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
			<FSX>3</FSX>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG26_HEAT</defaultProjectile>
			<warmupTime>1.9</warmupTime>
			<range>32</range>
			<minRange>2</minRange>
			<soundCast>RPGHeavyFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>15</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== RPG27 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG27D</defName>
		<statBases>
			<Mass>7.60</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.2</ShotSpread>
			<SwayFactor>1.57</SwayFactor>
			<Bulk>11.55</Bulk>
			<WorkToMake>12000</WorkToMake>
		</statBases>
		<costList>
			<Steel>50</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
			<FSX>4</FSX>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG27_HEAT</defaultProjectile>
			<warmupTime>2.05</warmupTime>
			<range>31</range>
			<minRange>2</minRange>
			<soundCast>LauncherFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>19</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== RPG-7 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG7v</defName>
		<statBases>
			<Mass>7.00</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>2.16</SightsEfficiency>
			<ShotSpread>0.2</ShotSpread>
			<SwayFactor>1.68</SwayFactor>
			<Bulk>10.50</Bulk>
			<WorkToMake>25500</WorkToMake>
		</statBases>
		<costList>
			<WoodLog>5</WoodLog>
			<Steel>70</Steel>
			<ComponentIndustrial>4</ComponentIndustrial>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG7Grenade_HEAT</defaultProjectile>
			<warmupTime>2.035</warmupTime>
			<range>40</range>
			<minRange>3</minRange>
			<soundCast>RPGFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>15</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>

		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>5.6</reloadTime>
			<ammoSet>AmmoSet_RPG7Grenade</ammoSet>
		</AmmoUser>

		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== RPG-16 ========== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG16v</defName>
		<statBases>
			<Mass>9.40</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>2.16</SightsEfficiency>
			<ShotSpread>0.13</ShotSpread>
			<SwayFactor>1.43</SwayFactor>
			<Bulk>10.50</Bulk>
			<WorkToMake>27500</WorkToMake>
		</statBases>
		<costList>
			<WoodLog>10</WoodLog>
			<Steel>75</Steel>
			<ComponentIndustrial>4</ComponentIndustrial>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG16Grenade_HEAT</defaultProjectile>
			<warmupTime>2</warmupTime>
			<ai_AvoidFriendlyFireRadius>2</ai_AvoidFriendlyFireRadius>
			<range>46</range>
			<minRange>3</minRange>
			<soundCast>RPGFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>15</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>

		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>5.6</reloadTime>
			<ammoSet>AmmoSet_RPG16Grenade</ammoSet>
		</AmmoUser>

		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== RPG-29 ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RPG29v</defName>
		<statBases>
			<Mass>12.10</Mass>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>2.16</SightsEfficiency>
			<ShotSpread>0.1</ShotSpread>
			<SwayFactor>1.68</SwayFactor>
			<Bulk>10.50</Bulk>
			<WorkToMake>35000</WorkToMake>
		</statBases>
		<costList>
			<Chemfuel>10</Chemfuel>
			<Steel>120</Steel>
			<ComponentIndustrial>4</ComponentIndustrial>
		</costList>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_RPG29_HEAT</defaultProjectile>
			<warmupTime>3</warmupTime>
			<ai_AvoidFriendlyFireRadius>2</ai_AvoidFriendlyFireRadius>
			<range>52</range>
			<minRange>3</minRange>
			<soundCast>RPGALTFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<onlyManualCast>true</onlyManualCast>
			<stopBurstWithoutLos>false</stopBurstWithoutLos>
			<muzzleFlashScale>20</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>

		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>5.9</reloadTime>
			<ammoSet>AmmoSet_RPG29</ammoSet>
		</AmmoUser>

		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<!-- No additional CE weaponTags needed -->
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Gun_RPG18D" or
			defName="Gun_RPG16v" or
			defName="Gun_RPG22D" or
			defName="Gun_RPG26D" or
			defName="Gun_RPG27D" or
			defName="Gun_RPG16v" or
			defName="Gun_RPG29v"]/recipeMaker </xpath>
		<value>
			<researchPrerequisite>CE_Launchers</researchPrerequisite>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_RPG18D" or
			defName="Gun_RPG16v" or
			defName="Gun_RPG22D" or
			defName="Gun_RPG26D" or
			defName="Gun_RPG27D" or
			defName="Gun_RPG16v" or
			defName="Gun_RPG29v"]/weaponTags </xpath>
		<value>
			<weaponTags>
				<li>GunHeavy</li>
				<li>CE_AI_AOE</li>
			</weaponTags>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="Gun_RPG18D" or
			defName="Gun_RPG16v" or
			defName="Gun_RPG22D" or
			defName="Gun_RPG26D" or
			defName="Gun_RPG27D" or
			defName="Gun_RPG16v" or
			defName="Gun_RPG29v"
			]/tools </xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>10</power>
					<cooldownTime>2.44</cooldownTime>
					<armorPenetrationBlunt>3.5</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

</Patch>