<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!-- ========== Mounted M60 Gun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RN2Gun_M60Mounted_GPMG</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>1.19</SwayFactor>
			<Bulk>13.70</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.11</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>65</range>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>RNShotM60LMG</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>6.8</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>5</aimedBurstShotCount>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_M60Mounted_MG"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>66</specialDisplayRadius>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_M60Mounted_MG"]/statBases</xpath>
		<value>
			<statBases>
				<Mass>12</Mass>
				<MaxHitPoints>120</MaxHitPoints>
				<Flammability>0.5</Flammability>
				<WorkToBuild>40000</WorkToBuild>
				<Beauty>-20</Beauty>
			</statBases>
		</value>
	</Operation>

	<!-- ========== Mounted M2HB Gun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RN2Gun_M2Browning</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>1.59</SwayFactor>
			<Bulk>18.54</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.25</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_50BMG_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>75</range>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>RNShot_M2Browning</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>14</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>200</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_50BMG</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>5</aimedBurstShotCount>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_M2Browning_MG"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>75</specialDisplayRadius>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_M2Browning_MG"]/statBases</xpath>
		<value>
			<statBases>
				<Mass>58</Mass>
				<MaxHitPoints>150</MaxHitPoints>
				<Flammability>0.5</Flammability>
				<WorkToBuild>60000</WorkToBuild>
				<Beauty>-30</Beauty>
			</statBases>
		</value>
	</Operation>

	<!-- ========== Mounted M134 Gun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RN2Gun_M134Minigun</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.06</ShotSpread>
			<SwayFactor>1.23</SwayFactor>
			<Bulk>8.02</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>0.58</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.6</warmupTime>
			<range>75</range>
			<ticksBetweenBurstShots>1</ticksBetweenBurstShots>
			<burstShotCount>300</burstShotCount>
			<soundCast>Shot_Minigun</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>10</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>1500</magazineSize>
			<reloadTime>9.2</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>150</aimedBurstShotCount>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_M134Minigun_MG"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>75</specialDisplayRadius>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_M134Minigun_MG"]/statBases</xpath>
		<value>
			<statBases>
				<Mass>39</Mass>
				<MaxHitPoints>150</MaxHitPoints>
				<Flammability>0.5</Flammability>
				<WorkToBuild>65000</WorkToBuild>
				<Beauty>-30</Beauty>
			</statBases>
		</value>
	</Operation>

	<!-- ========== Mounted Mk 19 Turret ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RN2Gun_MK19_GrenadeLauncher</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.09</ShotSpread>
			<SwayFactor>1.49</SwayFactor>
			<Bulk>12.90</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.67</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_40x53mmGrenade_HE</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>75</range>
			<minRange>6</minRange>
			<ticksBetweenBurstShots>9</ticksBetweenBurstShots>
			<burstShotCount>6</burstShotCount>
			<soundCast>RNShot_MK19GrenadeLauncher</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>16</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>48</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_40x53mmGrenade</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>3</aimedBurstShotCount>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_MK19_GL"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>75</specialDisplayRadius>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_MK19_GL"]/statBases</xpath>
		<value>
			<statBases>
				<Mass>35.2</Mass>
				<MaxHitPoints>150</MaxHitPoints>
				<Flammability>0.5</Flammability>
				<WorkToBuild>62000</WorkToBuild>
				<Beauty>-30</Beauty>
			</statBases>
		</value>
	</Operation>

	<!-- ========== TOW launcher ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RN2Gun_TOW_MissileLauncher</defName>
		<statBases>
			<RangedWeapon_Cooldown>2.5</RangedWeapon_Cooldown>
			<SightsEfficiency>4.50</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>2.0</SwayFactor>
			<Bulk>12.90</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_BGM71_HEAT</defaultProjectile>
			<warmupTime>4.0</warmupTime>
			<ai_AvoidFriendlyFireRadius>3</ai_AvoidFriendlyFireRadius>
			<range>120</range>
			<minRange>6</minRange>
			<soundCast>RNShot_TOWLauncher</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>16</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>9.9</reloadTime>
			<ammoSet>AmmoSet_BGM71</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_TOW_Launcher"]/statBases</xpath>
		<value>
			<statBases>
				<Mass>41</Mass>
				<MaxHitPoints>150</MaxHitPoints>
				<Flammability>0.5</Flammability>
				<WorkToBuild>60000</WorkToBuild>
				<Beauty>-20</Beauty>
			</statBases>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_TOW_Launcher"]/costList</xpath>
		<value>
			<costList>
				<Steel>150</Steel>
				<ComponentIndustrial>10</ComponentIndustrial>
			</costList>
		</value>
	</Operation>

	<!-- ========== M134 Sentry Gun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>RN2Gun_SentryGun</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.06</ShotSpread>
			<SwayFactor>1.31</SwayFactor>
			<Bulk>8.02</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>0.59</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>2.1</warmupTime>
			<range>65</range>
			<ticksBetweenBurstShots>1</ticksBetweenBurstShots>
			<burstShotCount>300</burstShotCount>
			<soundCast>Shot_Minigun</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>10</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>1500</magazineSize>
			<reloadTime>9.2</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="RN2Turret_SentryGun"]</xpath>
		<value>
			<specialDisplayRadius>65</specialDisplayRadius>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Turret_SentryGun"]/statBases</xpath>
		<value>
			<statBases>
				<MaxHitPoints>150</MaxHitPoints>
				<Flammability>0.7</Flammability>
				<WorkToBuild>75500</WorkToBuild>
				<Mass>50</Mass>
				<Beauty>-20</Beauty>
				<AimingAccuracy>0.30</AimingAccuracy>
				<ShootingAccuracyTurret>0.6</ShootingAccuracyTurret>
			</statBases>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Turret_SentryGun"]/comps/li[@Class="CompProperties_Power"]</xpath>
		<value>
			<li Class="CompProperties_Power">
				<compClass>CompPowerTrader</compClass>
				<basePowerConsumption>900</basePowerConsumption>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Turret_SentryGun"]/building/turretBurstCooldownTime</xpath>
		<value>
			<turretBurstCooldownTime>0.56</turretBurstCooldownTime>
		</value>
	</Operation>

	<!-- == Shared patches == -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Turret_SentryGun" or
			defName="RN2Gun_M60Mounted_MG" or
			defName="RN2Gun_M134Minigun_MG" or
			defName="RN2Gun_MK19_GL" or
			defName="RN2Gun_TOW_Launcher" or
			defName="RN2Gun_M2Browning_MG"]/fillPercent </xpath>
		<value>
			<fillPercent>0.85</fillPercent>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="RN2Gun_M60Mounted_MG"
			or defName="RN2Gun_M2Browning_MG"
			or defName="RN2Gun_M134Minigun_MG"
			or defName="RN2Gun_MK19_GL"
			or defName="RN2Gun_TOW_Launcher"]/statBases </xpath>
		<value>
			<ShootingAccuracyTurret>2.0</ShootingAccuracyTurret>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Turret_SentryGun"
			or defName="RN2Gun_M60Mounted_MG"
			or defName="RN2Gun_M2Browning_MG"
			or defName="RN2Gun_M134Minigun_MG"
			or defName="RN2Gun_MK19_GL"
			or defName="RN2Gun_TOW_Launcher"]/thingClass </xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[
			defName="RN2Turret_SentryGun" or
			defName="RN2Gun_M60Mounted_MG" or
			defName="RN2Gun_M2Browning_MG" or
			defName="RN2Gun_M134Minigun_MG" or
			defName="RN2Gun_MK19_GL" or
			defName="RN2Gun_TOW_Launcher"
			]/comps/li[@Class="CompProperties_Refuelable"] </xpath>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="RN2Gun_M2Browning_MG" or
			defName="RN2Gun_M134Minigun_MG" or
			defName="RN2Gun_MK19_GL"
			]/researchPrerequisites </xpath>
		<value>
			<researchPrerequisites>
				<li>CE_TurretHeavyWeapons</li>
			</researchPrerequisites>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RN2Gun_TOW_Launcher"]/researchPrerequisites</xpath>
		<value>
			<researchPrerequisites>
				<li>CE_TurretHeavyWeapons</li>
				<li>CE_Launchers</li>
			</researchPrerequisites>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="RN2Turret_SentryGun"
			]/researchPrerequisites </xpath>
		<value>
			<researchPrerequisites>
				<li>CE_TurretHeavyWeapons</li>
				<li>CE_HeavyTurret</li>
			</researchPrerequisites>
		</value>
	</Operation>
</Patch>