<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!-- Mod Support for Combat Extended -->
	<!-- Remove Explosive comp -->
	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[
			defName="MPC_MechanoidBlasterTurret" or
			defName="MPC_MechanoidLaserTurret" or
			defName="MPC_MechanoidShockwaveTurret" or
			defName="MPC_MechanoidDevastatorTurret" or
			defName="MPC_MechanoidMultiTurret" or
			defName="MPC_MechanoidTrinityTurret"
			]/comps/li[@Class="CompProperties_Explosive"] </xpath>
	</Operation>

	<!-- Replace vanilla thingClass -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="MPC_MechanoidBlasterTurret" or
			defName="MPC_MechanoidLaserTurret" or
			defName="MPC_MechanoidShockwaveTurret" or
			defName="MPC_MechanoidDevastatorTurret" or
			defName="MPC_MechanoidMultiTurret" or
			defName="MPC_MechanoidTrinityTurret"
			]/thingClass </xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="MPC_MechanoidBlasterTurret" or
			defName="MPC_MechanoidLaserTurret" or
			defName="MPC_MechanoidShockwaveTurret" or
			defName="MPC_MechanoidDevastatorTurret" or
			defName="MPC_MechanoidMultiTurret" or
			defName="MPC_MechanoidTrinityTurret"
			]/statBases/ShootingAccuracyTurret </xpath>
		<value>
			<ShootingAccuracyTurret>1</ShootingAccuracyTurret>
		</value>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MechanoidBlasterTurret</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>0.5</SwayFactor>
			<RangedWeapon_Cooldown>0.1</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.69</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_30x64mmFuel_Incendiary</defaultProjectile>
			<warmupTime>0.5</warmupTime>
			<range>52.4</range>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<burstShotCount>12</burstShotCount>
			<soundCast>MechanoidPoweredNitroRound</soundCast>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>false</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
			<ai_IsBuildingDestroyer>false</ai_IsBuildingDestroyer>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_30x64mmFuel</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>10</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MechanoidLaserTurret</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>0.35</SwayFactor>
			<RangedWeapon_Cooldown>1.2</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.69</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_30x64mmFuel_Thermobaric</defaultProjectile>
			<warmupTime>1.5</warmupTime>
			<range>52.4</range>
			<ticksBetweenBurstShots>2</ticksBetweenBurstShots>
			<burstShotCount>6</burstShotCount>
			<soundCast>MechanoidLaserPulse</soundCast>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>false</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
			<ai_IsBuildingDestroyer>false</ai_IsBuildingDestroyer>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_30x64mmFuel</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>3</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MechanoidShockwaveTurret</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>0.75</SwayFactor>
			<RangedWeapon_Cooldown>0.1</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.39</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_60x225mmGamma_Standard</defaultProjectile>
			<warmupTime>0.1</warmupTime>
			<range>52.4</range>
			<ticksBetweenBurstShots>1</ticksBetweenBurstShots>
			<burstShotCount>2</burstShotCount>
			<soundCast>MechanoidEnergizedShot</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
			<ignorePartialLoSBlocker>true</ignorePartialLoSBlocker>
			<ai_IsBuildingDestroyer>false</ai_IsBuildingDestroyer>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_60x225mmGamma</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>1</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MechanoidDevastatorTurret</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.17</ShotSpread>
			<SwayFactor>0.73</SwayFactor>
			<RangedWeapon_Cooldown>2</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.25</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_8x35mmCharged</defaultProjectile>
			<warmupTime>1.8</warmupTime>
			<range>55</range>
			<ticksBetweenBurstShots>2</ticksBetweenBurstShots>
			<burstShotCount>4</burstShotCount>
			<soundCast>MechanoidBlizzard</soundCast>
			<soundCastTail>MechanoidThermal</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_8x35mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>true</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>1</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MechanoidMultiTurret</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>0.23</SwayFactor>
			<RangedWeapon_Cooldown>0.9</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.25</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.6</warmupTime>
			<range>55</range>
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<burstShotCount>30</burstShotCount>
			<soundCast>MechanoidPhaserBeam</soundCast>
			<soundCastTail>MechanoidShredder</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>180</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>true</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>24</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MechanoidTrinityTurret</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>0.43</SwayFactor>
			<RangedWeapon_Cooldown>1.8</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.45</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_12x64mmCharged</defaultProjectile>
			<warmupTime>1.6</warmupTime>
			<range>75</range>
			<ticksBetweenBurstShots>1</ticksBetweenBurstShots>
			<burstShotCount>25</burstShotCount>
			<soundCast>MechanoidShredder</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>2</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>150</magazineSize>
			<reloadTime>8.8</reloadTime>
			<ammoSet>AmmoSet_12x64mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>true</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
			<aimedBurstShotCount>15</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>TurretGun</li>
		</weaponTags>
	</Operation>
</Patch>