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

	<!-- ========== General ========== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="HS_ClanforgedKatana" or
			defName="HS_ClanforgedNaginata" or
			defName="HS_ClanforgedYari" or
			defName="HS_ClanforgedOdachi" or
			defName="HS_ClanForgedNagamaki"
			]/stuffCategories/li[.="Metallic"]</xpath>
		<value>
			<li>Metallic_Weapon</li>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[
			defName="HS_ClanforgedKatana" or
			defName="HS_ClanforgedNaginata" or
			defName="HS_ClanforgedYari" or
			defName="HS_ClanforgedOdachi" or
			defName="HS_ClanForgedNagamaki"
			]/equippedStatOffsets</xpath>
	</Operation>

	<!-- ========== Katana ========== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedKatana"]/statBases</xpath>
		<value>
			<Bulk>5</Bulk>
			<MeleeCounterParryBonus>1.25</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedKatana"]/statBases/Mass</xpath>
		<value>
			<Mass>1.15</Mass>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedKatana"]</xpath>
		<value>
			<equippedStatOffsets>
				<MeleeCritChance>0.75</MeleeCritChance>
				<MeleeParryChance>0.85</MeleeParryChance>
				<MeleeDodgeChance>0.5</MeleeDodgeChance>
			</equippedStatOffsets>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedKatana"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>handle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>4</power>
					<cooldownTime>1.45</cooldownTime>
					<chanceFactor>0.10</chanceFactor>
					<armorPenetrationBlunt>0.9</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Handle</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>point</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>21</power>
					<cooldownTime>1.45</cooldownTime>
					<chanceFactor>0.40</chanceFactor>
					<armorPenetrationBlunt>0.9</armorPenetrationBlunt>
					<armorPenetrationSharp>1.45</armorPenetrationSharp>
					<linkedBodyPartsGroup>Point</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>35</power>
					<cooldownTime>1.45</cooldownTime>
					<chanceFactor>0.50</chanceFactor>
					<armorPenetrationBlunt>2.75</armorPenetrationBlunt>
					<armorPenetrationSharp>0.75</armorPenetrationSharp>
					<linkedBodyPartsGroup>Edge</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Nagamaki ========== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanForgedNagamaki"]/statBases</xpath>
		<value>
			<Bulk>7</Bulk>
			<MeleeCounterParryBonus>1.5</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanForgedNagamaki"]/statBases/Mass</xpath>
		<value>
			<Mass>1.35</Mass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanForgedNagamaki"]/recipeMaker/researchPrerequisite</xpath>
		<value>
			<researchPrerequisite>HS_Clanforged_Weapons</researchPrerequisite>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanForgedNagamaki"]</xpath>
		<value>
			<equippedStatOffsets>
				<MeleeCritChance>0.75</MeleeCritChance>
				<MeleeParryChance>1.15</MeleeParryChance>
				<MeleeDodgeChance>0.85</MeleeDodgeChance>
			</equippedStatOffsets>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanForgedNagamaki"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>handle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>4</power>
					<cooldownTime>1.75</cooldownTime>
					<chanceFactor>0.10</chanceFactor>
					<armorPenetrationBlunt>0.9</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Handle</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>point</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>21</power>
					<cooldownTime>1.75</cooldownTime>
					<chanceFactor>0.40</chanceFactor>
					<armorPenetrationBlunt>0.9</armorPenetrationBlunt>
					<armorPenetrationSharp>1.45</armorPenetrationSharp>
					<linkedBodyPartsGroup>Point</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>35</power>
					<cooldownTime>1.75</cooldownTime>
					<chanceFactor>0.50</chanceFactor>
					<armorPenetrationBlunt>2.75</armorPenetrationBlunt>
					<armorPenetrationSharp>0.75</armorPenetrationSharp>
					<linkedBodyPartsGroup>Edge</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Odachi ========== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedOdachi"]/statBases</xpath>
		<value>
			<Bulk>10</Bulk>
			<MeleeCounterParryBonus>0.75</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedOdachi"]/statBases/Mass</xpath>
		<value>
			<Mass>3</Mass>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedOdachi"]</xpath>
		<value>
			<equippedStatOffsets>
				<MeleeCritChance>0.25</MeleeCritChance>
				<MeleeParryChance>0.65</MeleeParryChance>
				<MeleeDodgeChance>0.6</MeleeDodgeChance>
			</equippedStatOffsets>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedOdachi"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>handle</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>6</power>
					<chanceFactor>0.33</chanceFactor>
					<cooldownTime>1.8</cooldownTime>
					<armorPenetrationBlunt>1.7</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Handle</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>point</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>38</power>
					<chanceFactor>0.5</chanceFactor>
					<cooldownTime>1.8</cooldownTime>
					<armorPenetrationBlunt>2</armorPenetrationBlunt>
					<armorPenetrationSharp>3.6</armorPenetrationSharp>
					<linkedBodyPartsGroup>Point</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>58</power>
					<chanceFactor>1.5</chanceFactor>
					<cooldownTime>2.12</cooldownTime>
					<armorPenetrationBlunt>6.84</armorPenetrationBlunt>
					<armorPenetrationSharp>1.32</armorPenetrationSharp>
					<linkedBodyPartsGroup>Edge</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Naginata ========== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedNaginata"]/statBases</xpath>
		<value>
			<Bulk>10</Bulk>
			<MeleeCounterParryBonus>1.39</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedNaginata"]</xpath>
		<value>
			<equippedStatOffsets>
				<MeleeCritChance>0.12</MeleeCritChance>
				<MeleeParryChance>1.1</MeleeParryChance>
				<MeleeDodgeChance>1.35</MeleeDodgeChance>
			</equippedStatOffsets>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedNaginata"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>shaft</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>9</power>
					<cooldownTime>1.3</cooldownTime>
					<chanceFactor>0.05</chanceFactor>
					<armorPenetrationBlunt>6</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Shaft</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>20</power>
					<cooldownTime>1.7</cooldownTime>
					<chanceFactor>0.20</chanceFactor>
					<armorPenetrationBlunt>3.75</armorPenetrationBlunt>
					<armorPenetrationSharp>1.75</armorPenetrationSharp>
					<linkedBodyPartsGroup>Point</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>32</power>
					<cooldownTime>2.2</cooldownTime>
					<chanceFactor>0.75</chanceFactor>
					<armorPenetrationBlunt>4.8</armorPenetrationBlunt>
					<armorPenetrationSharp>0.85</armorPenetrationSharp>
					<linkedBodyPartsGroup>Edge</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Yari ========== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedYari"]/statBases</xpath>
		<value>
			<Bulk>10</Bulk>
			<MeleeCounterParryBonus>1.75</MeleeCounterParryBonus>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HS_ClanforgedYari"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>shaft</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>8</power>
					<cooldownTime>2.1</cooldownTime>
					<chanceFactor>0.15</chanceFactor>
					<armorPenetrationBlunt>2.35</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Shaft</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>shaft</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.79</cooldownTime>
					<chanceFactor>0.05</chanceFactor>
					<armorPenetrationBlunt>1</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Point</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>29</power>
					<cooldownTime>1.7</cooldownTime>
					<chanceFactor>0.90</chanceFactor>
					<armorPenetrationBlunt>5.15</armorPenetrationBlunt>
					<armorPenetrationSharp>2.75</armorPenetrationSharp>
					<linkedBodyPartsGroup>Head</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

</Patch>