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

	<!-- === All Armor === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="BMT_Apparel_ChitinMediumArmor" or
			defName="BMT_Apparel_ChitinHeavyArmor" or
			defName="BMT_Apparel_ChitinFullArmor"]/apparel/layers </xpath>
		<value>
			<layers>
				<li>Shell</li>
			</layers>
		</value>
	</Operation>

	<!-- === Light Armor === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinLightArmor"]/statBases/Mass</xpath>
		<value>
			<Bulk>6.0</Bulk>
			<WornBulk>3.0</WornBulk>
			<Mass>3.0</Mass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinLightArmor"]/statBases/StuffEffectMultiplierArmor</xpath>
		<value>
			<StuffEffectMultiplierArmor>3</StuffEffectMultiplierArmor>
			<ArmorRating_Sharp>0.6</ArmorRating_Sharp>
			<ArmorRating_Blunt>1.2</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- === Medium Armor === -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinMediumArmor"]/statBases</xpath>
		<value>
			<Bulk>40</Bulk>
			<WornBulk>8</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinMediumArmor"]/statBases/StuffEffectMultiplierArmor</xpath>
		<value>
			<StuffEffectMultiplierArmor>3.5</StuffEffectMultiplierArmor>
			<ArmorRating_Sharp>1.2</ArmorRating_Sharp>
			<ArmorRating_Blunt>2.4</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- === Heavy Armor === -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinHeavyArmor"]/statBases</xpath>
		<value>
			<Bulk>100</Bulk>
			<WornBulk>10</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinHeavyArmor"]/statBases/StuffEffectMultiplierArmor</xpath>
		<value>
			<StuffEffectMultiplierArmor>4.5</StuffEffectMultiplierArmor>
			<ArmorRating_Sharp>2.4</ArmorRating_Sharp>
			<ArmorRating_Blunt>4.8</ArmorRating_Blunt>			
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinHeavyArmor"]/equippedStatOffsets/MoveSpeed</xpath>
		<value>
			<MeleeDodgeChance>-0.15</MeleeDodgeChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinHeavyArmor"]/apparel/bodyPartGroups</xpath>
		<value>
			<li>Hands</li>
			<li>Feet</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinHeavyArmor"]</xpath>
		<value>
			<li Class="CombatExtended.PartialArmorExt">
				<stats>
					<li>
						<ArmorRating_Sharp>0.70</ArmorRating_Sharp>
						<parts>
							<li>Neck</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.70</ArmorRating_Blunt>
						<parts>
							<li>Neck</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Sharp>0.80</ArmorRating_Sharp>
						<parts>
							<li>Leg</li>
							<li>Arm</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.80</ArmorRating_Blunt>
						<parts>
							<li>Leg</li>
							<li>Arm</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Sharp>0.60</ArmorRating_Sharp>
						<parts>
							<li>Hand</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.60</ArmorRating_Blunt>
						<parts>
							<li>Hand</li>
						</parts>
					</li>
				</stats>
			</li>
		</value>
	</Operation>

	<!-- === Heavy Armor === -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinFullArmor"]/statBases</xpath>
		<value>
			<Bulk>100</Bulk>
			<WornBulk>14</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinFullArmor"]/statBases/StuffEffectMultiplierArmor</xpath>
		<value>
			<StuffEffectMultiplierArmor>5</StuffEffectMultiplierArmor>
			<ArmorRating_Sharp>2.8</ArmorRating_Sharp>
			<ArmorRating_Blunt>5.2</ArmorRating_Blunt>	
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinFullArmor"]/equippedStatOffsets/MoveSpeed</xpath>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinFullArmor"]/equippedStatOffsets/MeleeDodgeChance</xpath>
		<value>
			<MeleeDodgeChance>-0.2</MeleeDodgeChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinFullArmor"]/apparel/bodyPartGroups</xpath>
		<value>
			<li>Hands</li>
			<li>Feet</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="BMT_Apparel_ChitinFullArmor"]</xpath>
		<value>
			<li Class="CombatExtended.PartialArmorExt">
				<stats>
					<li>
						<ArmorRating_Sharp>0.80</ArmorRating_Sharp>
						<parts>
							<li>Neck</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.80</ArmorRating_Blunt>
						<parts>
							<li>Neck</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Sharp>0.90</ArmorRating_Sharp>
						<parts>
							<li>Leg</li>
							<li>Arm</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.90</ArmorRating_Blunt>
						<parts>
							<li>Leg</li>
							<li>Arm</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Sharp>0.70</ArmorRating_Sharp>
						<parts>
							<li>Hand</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.70</ArmorRating_Blunt>
						<parts>
							<li>Hand</li>
						</parts>
					</li>
				</stats>
			</li>
		</value>
	</Operation>

	<!-- === Helmets === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[
			defName="BMT_Apparel_ChitinFullHelmet" or
			defName="BMT_Apparel_ChitinBeetleHelmet" or
			defName="BMT_Apparel_ChitinSpiderHelmet"]/statBases/StuffEffectMultiplierArmor </xpath>
		<value>
			<StuffEffectMultiplierArmor>3.5</StuffEffectMultiplierArmor>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[
			defName="BMT_Apparel_ChitinFullHelmet" or
			defName="BMT_Apparel_ChitinBeetleHelmet" or
			defName="BMT_Apparel_ChitinSpiderHelmet"] </xpath>
		<value>
			<li Class="CombatExtended.PartialArmorExt">
				<stats>
					<li>
						<ArmorRating_Sharp>0.80</ArmorRating_Sharp>
						<parts>
							<li>Eye</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.80</ArmorRating_Blunt>
						<parts>
							<li>Eye</li>
						</parts>
					</li>
				</stats>
			</li>
		</value>
	</Operation>

</Patch>