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

	<!-- Remove refuelable property -->
	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="VFEP_ShipChunkGauntletTurret"]/comps/li[@Class="VFEPirates.CompProperties_Fueled"]</xpath>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VFEP_ShipChunkGauntletTurret"]</xpath>
		<value>
			<thingCategories/>
		</value>
	</Operation>

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

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

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

	<!-- Make turrets taller -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VFEP_ShipChunkGauntletTurret"]</xpath>
		<value>
			<fillPercent>0.95</fillPercent>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="VFEP_CrashedShip"]/fillPercent</xpath>
		<value>
			<fillPercent>0.95</fillPercent>
		</value>
	</Operation>

	<!-- Gauntlet Charge Cannnon -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VFEP_GauntletChargeCanon</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.5</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.09</ShotSpread>
			<SwayFactor>0.26</SwayFactor>
		</statBases>
		<Properties>
			<recoilAmount>1.08</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Bullet_12x72mmCharged</defaultProjectile>
			<warmupTime>2.3</warmupTime>
			<range>62</range>
			<minRange>13</minRange>
			<burstShotCount>10</burstShotCount>
			<ticksBetweenBurstShots>8</ticksBetweenBurstShots>
			<soundCast>VFEP_Shot_GauntletCannon</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>200</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_12x72mmCharged</ammoSet>
		</AmmoUser>
		<weaponTags Inherit="False">
			<li>TurretGun</li>
		</weaponTags>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
	</Operation>

	<!-- Make the crashed ships don't destroy each other upon crashing -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="VFEP_CrashedShip"]</xpath>
		<value>
			<damageMultipliers>
				<li>
					<damageDef>Bomb</damageDef>
					<multiplier>0.1</multiplier>
				</li>
			</damageMultipliers>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="VFEP_CrashedShip"]/building/turretGunDef</xpath>
		<value>
			<turretGunDef>VFEP_GauntletChargeCanon_CE</turretGunDef>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="VFEP_CrashedShip"]/building</xpath>
		<value>
			<turretBurstWarmupTime>2.3</turretBurstWarmupTime>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VFEP_Bullet_GauntletChargeCanon"]/projectile/damageAmountBase</xpath>
		<value>
			<damageAmountBase>20</damageAmountBase>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VFEP_Bullet_GauntletChargeCanon"]/projectile/armorPenetrationBase</xpath>
		<value>
			<armorPenetrationBase>25</armorPenetrationBase>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VFEP_Bullet_GauntletChargeCanon"]/projectile/speed</xpath>
		<value>
			<speed>144</speed>
		</value>
	</Operation>

</Patch>