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

	<!-- Replace vanilla thingClass -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Rangedform" or defName="Flood_Spitter"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<!-- Make turrets taller -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Rangedform" or defName="Flood_Spitter"]/fillPercent</xpath>
		<value>
			<fillPercent>0.85</fillPercent>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Rangedform" or defName="Flood_Spitter"]/statBases</xpath>
		<value>
			<AimingAccuracy>0.25</AimingAccuracy>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="Rangedform" or defName="Flood_Spitter"]/statBases/ShootingAccuracyTurret </xpath>
		<value>
			<ShootingAccuracyTurret>0.5</ShootingAccuracyTurret>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Rangedform" or defName="Flood_Spitter" ]/building/turretBurstCooldownTime</xpath>
		<value>
			<turretBurstCooldownTime>1.25</turretBurstCooldownTime>
		</value>
	</Operation>

	<!-- Make the Turret usable -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Spitterbulb</defName>
		<statBases>
			<Mass>10.00</Mass>
			<RangedWeapon_Cooldown>0.45</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.08</ShotSpread>
			<SwayFactor>1.33</SwayFactor>
			<Bulk>1.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.37</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>FloodSpitfire_CE</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>44</range>
			<ticksBetweenBurstShots>10</ticksBetweenBurstShots>
			<burstShotCount>2</burstShotCount>
			<minRange>1.5</minRange>
			<soundCast>BulletImpact_Flesh</soundCast>
			<muzzleFlashScale>0</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>2</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Rangedtop</defName>
		<statBases>
			<Mass>10.00</Mass>
			<RangedWeapon_Cooldown>0.45</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.08</ShotSpread>
			<SwayFactor>1.33</SwayFactor>
			<Bulk>1.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.27</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>FloodRangedfire_CE</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>50</range>
			<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
			<burstShotCount>6</burstShotCount>
			<minRange>1.5</minRange>
			<soundCast>BulletImpact_Flesh</soundCast>
			<muzzleFlashScale>0</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>6</aimedBurstShotCount>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
	</Operation>

</Patch>