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

	<!-- Remove refuelable property -->
	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[@Name="CaslteDefendsBase"]/comps/li[@Class="CompProperties_Refuelable"]</xpath>
	</Operation>

	<!-- Replace vanilla thingClass -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CaslteDefendsBase"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CaslteDefendsBase"]/statBases/ShootingAccuracyTurret</xpath>
		<value>
			<ShootingAccuracyTurret>1</ShootingAccuracyTurret>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CaslteDefendsBase"]/building/turretBurstCooldownTime</xpath>
		<value>
			<turretBurstCooldownTime>5</turretBurstCooldownTime>
		</value>
	</Operation>

	<!-- Tower Turret -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Defend_Tower_GreatBow</defName>
		<statBases>
			<SightsEfficiency>0.8</SightsEfficiency>
			<ShotSpread>1</ShotSpread>
			<SwayFactor>2</SwayFactor>
			<Bulk>5.00</Bulk>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Projectile_GreatArrow_Stone</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>34</range>
			<soundCast>Bow_Large</soundCast>
		</Properties>
		<AmmoUser>
			<magazineSize>25</magazineSize>
			<reloadTime>10</reloadTime>
			<ammoSet>AmmoSet_GreatArrow</ammoSet>
		</AmmoUser>
		<weaponTags Inherit="False">
			<li>TurretGun</li>
		</weaponTags>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
	</Operation>

</Patch>