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

	<Operation Class="PatchOperationReplace">
		<xpath>
			Defs/ThingDef[
			defName="VQE_Gun_Stubgun" or
			defName="VQE_Gun_DroneTurret" or
			defName="VQE_Gun_Rattlegun" or
			defName="VQE_Gun_Lance" or
			defName="VQE_Gun_StingrayCannon"
			]/tools
		</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>2.02</cooldownTime>
					<armorPenetrationBlunt>1.630</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>muzzle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Stubgun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VQE_Gun_Stubgun</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.6</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>0.53</SwayFactor>
			<Bulk>7.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>2.42</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_410Bore_Buck</defaultProjectile>
			<warmupTime>0.8</warmupTime>
			<range>14</range>
			<soundCast>Shot_Shotgun_NoRack</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>6</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>6</magazineSize>
			<reloadTime>4.9</reloadTime>
			<ammoSet>AmmoSet_410Bore</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_BROOM</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<!-- ========== Drone turret ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VQE_Gun_DroneTurret</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1.05</SightsEfficiency>	<!-- a little better than vanilla mini turret -->
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>0.67</SwayFactor>
			<Mass>4</Mass>
		</statBases>
		<Properties>
			<recoilAmount>1.02</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_556x45mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>50</range>	<!-- a little better than vanilla mini turret -->
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>GunShotA</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>6</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>100</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_556x45mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>5</aimedBurstShotCount>
			<noSingleShot>true</noSingleShot>
		</FireModes>
		<weaponTags>
			<li>CE_MachineGun</li>
			<li>CE_AI_LMG</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<!-- ========== Stingray cannon ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VQE_Gun_StingrayCannon</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.43</RangedWeapon_Cooldown>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>1.8</SwayFactor>
			<Bulk>10</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>3.87</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_30x64mmFuel_Incendiary</defaultProjectile>
			<warmupTime>1.0</warmupTime>
			<range>40</range>
			<soundCast>Shot_IncendiaryLauncher</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<reloadTime>3.2</reloadTime>
			<ammoSet>AmmoSet_30x64mmFuel</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_AOE</li>
			<li>NoSwitch</li>
		</weaponTags>
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== Rattlegun (LMG clone) ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VQE_Gun_Rattlegun</defName>
		<statBases>
			<Mass>8.7</Mass>
			<RangedWeapon_Cooldown>0.56</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>1.37</SwayFactor>
			<Bulk>12.9</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>1.38</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>54</range>
			<ticksBetweenBurstShots>7</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>Shot_CE_BattleRifle</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>50</magazineSize>
			<reloadTime>6</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>5</aimedBurstShotCount>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_MachineGun</li>
			<li>CE_AI_LMG</li>
			<li>NoSwitch</li>
		</weaponTags>
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<!-- ========== Lance (upgrade BoltAction) ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VQE_Gun_Lance</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>0.88</SwayFactor>
			<Bulk>13.00</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>0.92</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.1</warmupTime>
			<range>62</range>
			<soundCast>Shot_SniperRifle</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>10</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_762x51mmNATO</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_Rifle</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

	<!-- ========== Immobilized Mobile Turret (Worse mini-turret) ========== -->

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

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VQE_ImmobilizedTurret_Gun</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.48</RangedWeapon_Cooldown>
			<SightsEfficiency>0.9</SightsEfficiency>
			<ShotSpread>0.1</ShotSpread>
			<SwayFactor>0.9</SwayFactor>
			<Mass>4</Mass>
		</statBases>
		<Properties>
			<recoilAmount>1.18</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_556x45mmNATO_FMJ</defaultProjectile>
			<warmupTime>1.3</warmupTime>
			<range>48</range>
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<burstShotCount>10</burstShotCount>
			<soundCast>GunShotA</soundCast>
			<soundCastTail>GunTail_Light</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
	</Operation>

</Patch>