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

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_RailgunMKI</defName>
		<statBases>
			<SightsEfficiency>3.50</SightsEfficiency>
			<ShotSpread>0.01</ShotSpread>
			<SwayFactor>1.95</SwayFactor>
			<Bulk>12</Bulk>
			<Mass>6.25</Mass>
			<RangedWeapon_Cooldown>1.20</RangedWeapon_Cooldown>
		</statBases>

		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_8mmRailgun_Sabot</defaultProjectile>
			<warmupTime>2.1</warmupTime>
			<range>86</range>
			<soundCast>ChargeLance_Fire</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>

		<AmmoUser>
			<magazineSize>5</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_8mmRailgun</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
	</Operation>

	<!-- ========== Melee Attacks =========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_RailgunMKI"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>stock</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<chanceFactor>1.5</chanceFactor>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
				</li>
				<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>
</Patch>