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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ERN_Auraeyl_Axe"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>shaft</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>7</power>
					<cooldownTime>1.35</cooldownTime>
					<armorPenetrationBlunt>3</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Shaft</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>32</power>
					<cooldownTime>2.64</cooldownTime>
					<armorPenetrationBlunt>5.41</armorPenetrationBlunt>
					<armorPenetrationSharp>2.12</armorPenetrationSharp>
					<linkedBodyPartsGroup>Edge</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ERN_Auraeyl_Axe"]/statBases</xpath>
		<value>
			<Bulk>5</Bulk>
			<MeleeCounterParryBonus>0.32</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ERN_Auraeyl_Axe"]</xpath>
		<value>
			<equippedStatOffsets>
				<MeleeCritChance>0.2</MeleeCritChance>
				<MeleeParryChance>0.2</MeleeParryChance>
				<MeleeDodgeChance>0.15</MeleeDodgeChance>
			</equippedStatOffsets>
		</value>
	</Operation>

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

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

	<!-- ========== Bomblance =========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>ERN_Bomblance</defName>
		<statBases>
			<SightsEfficiency>1.2</SightsEfficiency>
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>1.79</SwayFactor>
			<Bulk>10.03</Bulk>
			<RangedWeapon_Cooldown>0.96</RangedWeapon_Cooldown>
		</statBases>
		<costList>
			<Steel>75</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
			<Chemfuel>15</Chemfuel>
		</costList>
		<Properties>
			<recoilAmount>3.28</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_30x29mmGrenade_HE</defaultProjectile>
			<ai_IsBuildingDestroyer>true</ai_IsBuildingDestroyer>
			<warmupTime>1.5</warmupTime>
			<range>50</range>
			<minRange>5</minRange>
			<soundCast>Shot_IncendiaryLauncher</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>14</muzzleFlashScale>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<AmmoUser>
			<magazineSize>4</magazineSize>
			<reloadTime>7.5</reloadTime>
			<ammoSet>AmmoSet_30x29mmGrenade</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiUseBurstMode>FALSE</aiUseBurstMode>
			<aiAimMode>SuppressFire</aiAimMode>
		</FireModes>
	</Operation>

	<!-- ========== Harpoon =========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>ERN_Harpoon</defName>
		<statBases>
			<SightsEfficiency>2</SightsEfficiency>
			<ShotSpread>0.07</ShotSpread>
			<SwayFactor>1.79</SwayFactor>
			<Bulk>12.03</Bulk>
			<RangedWeapon_Cooldown>1.2</RangedWeapon_Cooldown>
			<MarketValue>270</MarketValue>
		</statBases>
		<costList>
			<Steel>75</Steel>
			<ComponentIndustrial>3</ComponentIndustrial>
			<Chemfuel>15</Chemfuel>
		</costList>
		<Properties>
			<recoilAmount>4</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Pilum_Fired</defaultProjectile>
			<warmupTime>1.5</warmupTime>
			<range>55</range>
			<soundCast>Shot_BoltActionRifle</soundCast>
			<soundCastTail>GunTail_Heavy</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<magazineSize>1</magazineSize>
			<AmmoGenPerMagOverride>5</AmmoGenPerMagOverride>
			<reloadTime>3</reloadTime>
			<ammoSet>AmmoSet_Javelins</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
	</Operation>

	<!-- ========== Lightbow =========== -->

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>ERN_Lightbow</defName>
		<statBases>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.5</ShotSpread>
			<SwayFactor>1</SwayFactor>
			<Bulk>4.00</Bulk>
			<RangedWeapon_Cooldown>0.5</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Projectile_LightbowArrow_Stone</defaultProjectile>
			<warmupTime>1.2</warmupTime>
			<range>34</range>
			<soundCast>Bow_Recurve</soundCast>
			<muzzleFlashScale>1</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<ammoSet>AmmoSet_LightbowArrows</ammoSet>
			<AmmoGenPerMagOverride>5</AmmoGenPerMagOverride>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>CE_Bow</li>
		</weaponTags>
		<AllowWithRunAndGun>false</AllowWithRunAndGun>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ERN_Lightbow"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>7</power>
					<cooldownTime>1.6</cooldownTime>
					<armorPenetrationBlunt>0.65</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="ERN_Lightbow"]/equippedAngleOffset</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="ERN_Lightbow"]</xpath>
			<value>
				<equippedAngleOffset>-45</equippedAngleOffset>
			</value>
		</nomatch>
	</Operation>

</Patch>