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

	<!-- ========== Mounted DShK Gun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Sov_Gun_DShK</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>1.57</SwayFactor>
			<Bulk>18.54</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.33</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_127x108mm_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>75</range>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>DSHKshoot</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>18</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>50</magazineSize>
			<reloadTime>5.8</reloadTime>
			<ammoSet>AmmoSet_127x108mm</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="Sov_Turret_DShK"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>75</specialDisplayRadius>
		</value>
	</Operation>

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

	<!-- ========== Mounted NSV Gun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Sov_Gun_NSV</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1.00</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>1.41</SwayFactor>
			<Bulk>18.54</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.0</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_127x108mm_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>75</range>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>NSVshoot</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>14</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_127x108mm</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="Sov_Turret_NSV"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>75</specialDisplayRadius>
		</value>
	</Operation>

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

	<!-- ========== Mounted AGS-17 Turret ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Sov_Gun_AGS</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.57</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_30x29mmGrenade_HE</defaultProjectile>
			<warmupTime>1.35</warmupTime>
			<range>62</range>
			<minRange>6</minRange>
			<ticksBetweenBurstShots>9</ticksBetweenBurstShots>
			<burstShotCount>6</burstShotCount>
			<soundCast>AGSshoot</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>16</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>29</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_30x29mmGrenade</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="RD_Turret_AGS"]/specialDisplayRadius</xpath>
		<value>
			<specialDisplayRadius>62</specialDisplayRadius>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="RD_Turret_AGS"]/statBases</xpath>
		<value>
			<statBases>
				<MaxHitPoints>150</MaxHitPoints>
				<WorkToBuild>41000</WorkToBuild>
				<Mass>31</Mass>
				<Beauty>-20</Beauty>
			</statBases>
		</value>
	</Operation>

	<!-- ========== Konkur launcher ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Artillery_KonkursGun</defName>
		<statBases>
			<RangedWeapon_Cooldown>2.5</RangedWeapon_Cooldown>
			<SightsEfficiency>4.0</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>1.87</SwayFactor>
			<Bulk>12.90</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_9M113_HEAT</defaultProjectile>
			<warmupTime>2.80</warmupTime>
			<ai_AvoidFriendlyFireRadius>3</ai_AvoidFriendlyFireRadius>
			<range>100</range>
			<minRange>6</minRange>
			<soundCast>KonkursFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>16</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>8.9</reloadTime>
			<ammoSet>AmmoSet_Konkur</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Turret_KonkursATGM"]</xpath>
		<value>
			<statBases>
				<MaxHitPoints>120</MaxHitPoints>
				<WorkToBuild>55000</WorkToBuild>
				<Mass>22.5</Mass>
				<Beauty>-20</Beauty>
			</statBases>
		</value>
	</Operation>

	<!-- ========== SPG ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Artillery_SPG9Gun</defName>
		<statBases>
			<RangedWeapon_Cooldown>1.50</RangedWeapon_Cooldown>
			<SightsEfficiency>2.50</SightsEfficiency>
			<ShotSpread>0.06</ShotSpread>
			<SwayFactor>1.68</SwayFactor>
			<Bulk>12.90</Bulk>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_SPG9Grenade_HEAT</defaultProjectile>
			<warmupTime>3.0</warmupTime>
			<ai_AvoidFriendlyFireRadius>3</ai_AvoidFriendlyFireRadius>
			<range>100</range>
			<minRange>4.9</minRange>
			<soundCast>SPGFire</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<muzzleFlashScale>18</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>7.9</reloadTime>
			<ammoSet>AmmoSet_SPG9Grenade</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Base_SPG9AT"]/statBases</xpath>
		<value>
			<statBases>
				<MaxHitPoints>175</MaxHitPoints>
				<Flammability>0.4</Flammability>
				<WorkToBuild>32000</WorkToBuild>
				<Mass>59.5</Mass>
				<Beauty>-10</Beauty>
			</statBases>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Base_SPG9AT"]/costList</xpath>
		<value>
			<costList>
				<Steel>200</Steel>
				<ComponentIndustrial>4</ComponentIndustrial>
			</costList>
		</value>
	</Operation>

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

	<!-- === Remove Shells === -->
	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Shell_SACLOS_HE" or defName="Shell_SPG_HE"]</xpath>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Sov_Turret_DShK"
			or defName="Sov_Turret_NSV"
			or defName="RD_Turret_AGS"
			or defName="Turret_KonkursATGM"
			or defName="Turret_SPG9AT"]/statBases </xpath>
		<value>
			<ShootingAccuracyTurret>2.0</ShootingAccuracyTurret>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Sov_Turret_DShK"
			or defName="Sov_Turret_NSV"
			or defName="RD_Turret_AGS"
			or @Name="Base_KonkursAT"
			or @Name="Base_SPG9AT"]/thingClass </xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Sov_Turret_DShK"
			or defName="Sov_Turret_NSV"
			or defName="RD_Turret_AGS"
			]/comps/li[@Class="CompProperties_Refuelable"] </xpath>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Sov_Turret_DShK"
			or defName="Sov_Turret_NSV"
			or defName="RD_Turret_AGS"]/researchPrerequisites </xpath>
		<value>
			<researchPrerequisites>
				<li>CE_TurretHeavyWeapons</li>
			</researchPrerequisites>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Base_KonkursAT"]/researchPrerequisites</xpath>
		<value>
			<researchPrerequisites>
				<li>CE_TurretHeavyWeapons</li>
				<li>CE_Launchers</li>
			</researchPrerequisites>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Base_SPG9AT"]/researchPrerequisites</xpath>
		<value>
			<researchPrerequisites>
				<li>CE_TurretHeavyWeapons</li>
				<li>CE_Launchers</li>
			</researchPrerequisites>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Sov_Gun_DShK"
			or defName="Sov_Gun_NSV"
			or defName="Sov_Gun_AGS"
			or @Name="Base_KonkursAT_Weapon"
			or @Name="Base_PodnosMortar_Weapon"
			or @Name="Base_SPG9AT_Weapon"]/menuHidden </xpath>
		<value>
			<modExtensions>
				<li Class="CombatExtended.ThingDefExtensionCE">
					<MenuHidden>True</MenuHidden>
				</li>
			</modExtensions>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Base_KonkursAT"
			or @Name="Base_SPG9AT"]/fillPercent </xpath>
		<value>
			<fillPercent>0.85</fillPercent>
		</value>
	</Operation>

</Patch>