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

	<!-- ========== Tools ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_BeamRepeater"]/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>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_Scattergun"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
						<li>Poke</li>
					</capacities>
					<power>5</power>
					<cooldownTime>2.02</cooldownTime>
					<armorPenetrationBlunt>1.630</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Beam Repeater ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_BeamRepeater</defName>
		<statBases>
			<Mass>10.00</Mass>
			<Bulk>9.50</Bulk>
			<SwayFactor>1.95</SwayFactor>
			<ShotSpread>0.10</ShotSpread>
			<SightsEfficiency>1.10</SightsEfficiency>
			<RangedWeapon_Cooldown>0.10</RangedWeapon_Cooldown>
			<WorkToMake>80500</WorkToMake>
		</statBases>
		<costList>
			<Steel>80</Steel>
			<Plasteel>80</Plasteel>
			<ComponentSpacer>3</ComponentSpacer>
		</costList>
		<Properties>
			<recoilAmount>0.01</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Bullet_Laser_BeamRepeater</defaultProjectile>
			<warmupTime>2.0</warmupTime>
			<range>40</range>
			<burstShotCount>25</burstShotCount>
			<ticksBetweenBurstShots>4</ticksBetweenBurstShots>
			<soundCast>Shot_BeamRepeater</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
			<aimingChargeMote>Mote_BeamRepeater_Charge</aimingChargeMote>
			<aimingChargeMoteOffset>1.07</aimingChargeMoteOffset>
		</Properties>
		<AmmoUser>
			<magazineSize>300</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_BeamRepeater</ammoSet>
			<AmmoGenPerMagOverride>100</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aimedBurstShotCount>10</aimedBurstShotCount>
		</FireModes>
	</Operation>

	<!-- ========== Scattergun ========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_Scattergun</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.15</ShotSpread>
			<SwayFactor>0.53</SwayFactor>
			<Bulk>7.00</Bulk>
			<RangedWeapon_Cooldown>1.99</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.01</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_Laser_Shotgun</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>10</range>
			<soundCast>Shot_BeamRepeater</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>6</muzzleFlashScale>
		</Properties>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_AI_BROOM</li>
			<li>NoSwitch</li>
		</weaponTags>
	</Operation>

</Patch>