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

	<!-- ========== Mini-turret ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/description</xpath>
		<value>
			<description>A portable automatic turret. Its dumb AI brain can't be directly controlled, so beware of friendly fire.</description>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

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

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/statBases/Mass</xpath>
		<value>
			<Mass>25</Mass>
			<Bulk>15</Bulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/comps/li[@Class="CompProperties_Explosive"]</xpath>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/fillPercent</xpath>
		<value>
			<fillPercent>0.85</fillPercent>
		</value>
	</Operation>

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

	<!-- Add trade tags -->

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/tradeTags</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]</xpath>
			<value>
				<tradeTags />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Turret_TacticalTurret"]/tradeTags</xpath>
		<value>
			<li>CE_Turret</li>
		</value>
	</Operation>

</Patch>