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

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/DamageDef[defName="DV_Laser"]</xpath>
		<value>
			<li Class="CombatExtended.DamageDefExtensionCE">
				<harmOnlyOutsideLayers>true</harmOnlyOutsideLayers>
				<isAmbientDamage>true</isAmbientDamage>
			</li>
		</value>
	</Operation>

	<!-- === Tools === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Laser_Saber"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>handle</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<chanceFactor>0.33</chanceFactor>
					<cooldownTime>1.52</cooldownTime>
					<armorPenetrationBlunt>0.500</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Handle</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>point</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>18</power>
					<cooldownTime>1.24</cooldownTime>
					<armorPenetrationBlunt>8</armorPenetrationBlunt>
					<armorPenetrationSharp>42</armorPenetrationSharp>
					<linkedBodyPartsGroup>Point</linkedBodyPartsGroup>
					<extraMeleeDamages>
						<li>
							<def>DV_Laser</def>
							<amount>10</amount>
							<chance>0.5</chance>
						</li>
					</extraMeleeDamages>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>36</power>
					<cooldownTime>1.14</cooldownTime>
					<armorPenetrationBlunt>12</armorPenetrationBlunt>
					<armorPenetrationSharp>20</armorPenetrationSharp>
					<linkedBodyPartsGroup>Edge</linkedBodyPartsGroup>
					<extraMeleeDamages>
						<li>
							<def>DV_Laser</def>
							<amount>10</amount>
							<chance>0.5</chance>
						</li>
					</extraMeleeDamages>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Laser_Saber"]/statBases</xpath>
		<value>
			<Bulk>2</Bulk>
			<MeleeCounterParryBonus>0.5</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Laser_Saber"]/equippedAngleOffset</xpath>
		<value>
			<equippedAngleOffset>-45</equippedAngleOffset>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Laser_Saber"]</xpath>
		<value>
			<equippedStatOffsets>
				<MeleeCritChance>0.63</MeleeCritChance>
				<MeleeParryChance>0.75</MeleeParryChance>
				<MeleeDodgeChance>0.4</MeleeDodgeChance>
			</equippedStatOffsets>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Laser_Saber"]/weaponTags</xpath>
		<value>
			<li>CE_OneHandedWeapon</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Laser_Handcannon"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>grip</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>1.54</cooldownTime>
					<chanceFactor>1.5</chanceFactor>
					<armorPenetrationBlunt>0.555</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Grip</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>muzzle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>2</power>
					<cooldownTime>1.54</cooldownTime>
					<armorPenetrationBlunt>0.555</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Laser_Carbine" or defName="Laser_Scatterer"]/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>

	<!-- === Remove Shotgun Gizmo === -->
	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Laser_Scatterer"]/verbs</xpath>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Laser_Scatterer"]/modExtensions/li[@Class="AthenaFramework.AngularShotgunExtension"]</xpath>
	</Operation>

	<!-- === Laser Handcannon === -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Laser_Handcannon</defName>
		<statBases>
			<Mass>1.20</Mass>
			<Bulk>2.30</Bulk>
			<SwayFactor>1.17</SwayFactor>
			<ShotSpread>0.06</ShotSpread>
			<SightsEfficiency>0.8</SightsEfficiency>
			<RangedWeapon_Cooldown>0.55</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Bullet_Laser_Laser_Handcannon</defaultProjectile>
			<warmupTime>0.5</warmupTime>
			<range>22</range>
			<soundCast>Laser_Woop</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>7</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>10</magazineSize>
			<reloadTime>2.5</reloadTime>
			<ammoSet>AmmoSet_Laser_Handcannon</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>Snapshot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>SpacerGun</li>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

	<!-- === Laser Rifle === -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Laser_Carbine</defName>
		<statBases>
			<Mass>3.50</Mass>
			<Bulk>10.00</Bulk>
			<SwayFactor>1.35</SwayFactor>
			<ShotSpread>0.06</ShotSpread>
			<SightsEfficiency>1.10</SightsEfficiency>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.01</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Bullet_Laser_Laser_Carbine</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>62</range>
			<burstShotCount>5</burstShotCount>
			<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
			<soundCast>Laser_Woop</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>7</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>40</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_Laser_Carbine</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aiUseBurstMode>True</aiUseBurstMode>
			<aimedBurstShotCount>3</aimedBurstShotCount>
		</FireModes>
	</Operation>

	<!-- === Laser Shotgun === -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Laser_Scatterer</defName>
		<statBases>
			<Mass>3.40</Mass>
			<Bulk>9.00</Bulk>
			<SwayFactor>1.24</SwayFactor>
			<ShotSpread>0.06</ShotSpread>
			<SightsEfficiency>1.10</SightsEfficiency>
			<RangedWeapon_Cooldown>0.38</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<recoilAmount>0.01</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>True</hasStandardCommand>
			<defaultProjectile>Bullet_Laser_Laser_Scatterer</defaultProjectile>
			<warmupTime>0.5</warmupTime>
			<range>22</range>
			<soundCast>Laser_Woop</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>20</magazineSize>
			<reloadTime>4</reloadTime>
			<ammoSet>AmmoSet_Laser_Scatterer</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<aiUseBurstMode>True</aiUseBurstMode>
		</FireModes>

	</Operation>

</Patch>