<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!-- Arachnid Leg -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ArachnidLeg"]/statBases</xpath>
		<value>
			<Bulk>12</Bulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ArachnidLeg"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>point</label>
					<capacities>
						<li>Scratch</li>
						<li>Stab</li>
					</capacities>
					<power>20</power>
					<cooldownTime>2.6</cooldownTime>
					<armorPenetrationSharp>5</armorPenetrationSharp>
					<linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- Arachnid Carapace -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/statBases</xpath>
		<value>
			<Bulk>0.05</Bulk>
			<WornBulk>0.75</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/statBases/StuffPower_Armor_Sharp</xpath>
		<value>
			<StuffPower_Armor_Sharp>1.25</StuffPower_Armor_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/statBases/StuffPower_Armor_Blunt</xpath>
		<value>
			<StuffPower_Armor_Blunt>1.75</StuffPower_Armor_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/statBases/StuffPower_Armor_Heat</xpath>
		<value>
			<StuffPower_Armor_Heat>0.02</StuffPower_Armor_Heat>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/stuffProps</xpath>
		<value>
			<statOffsets>
				<Mass>0.5</Mass>
			</statOffsets>
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/statBases/SharpDamageMultiplier</xpath>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/statBases/BluntDamageMultiplier</xpath>
		<value>
			<BluntDamageMultiplier>1.25</BluntDamageMultiplier>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/stuffProps/categories</xpath>
		<value>
			<li>Metallic_Weapon</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ArachnidCarapace"]/stuffProps/statFactors</xpath>
		<value>
			<Mass>2.45</Mass>
			<MeleePenetrationFactor>1.2</MeleePenetrationFactor>
		</value>
	</Operation>

	<!-- Arachnid Leather, made a bit worse than thrumbofur -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/statBases</xpath>
		<value>
			<Bulk>0.05</Bulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/statBases/StuffPower_Armor_Sharp</xpath>
		<value>
			<StuffPower_Armor_Sharp>0.55</StuffPower_Armor_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/statBases/StuffPower_Armor_Blunt</xpath>
		<value>
			<StuffPower_Armor_Blunt>0.4</StuffPower_Armor_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/statBases/StuffPower_Armor_Heat</xpath>
		<value>
			<StuffPower_Armor_Heat>0.015</StuffPower_Armor_Heat>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/stuffProps/categories</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/stuffProps</xpath>
			<value>
				<categories>
					<li>SoftArmor</li>
				</categories>
			</value>
		</nomatch>
		<match Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Leather_Arachnids"]/stuffProps/categories</xpath>
			<value>
				<li>SoftArmor</li>
			</value>
		</match>
	</Operation>
</Patch>