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

	<!-- ===== Add Bodypart Groups and Layers ===== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="ApparelMBHelmetBase"]/apparel/layers</xpath>
		<value>
			<li>OnHead</li>
			<li>StrappedHead</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="ApparelMBBase"]/apparel/bodyPartGroups</xpath>
		<value>
			<li>Hands</li>
			<li>Feet</li>
		</value>
	</Operation>

	<!-- ===== Add Costlist ===== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="ApparelMBHelmetBase"]/costList</xpath>
		<value>
			<DevilstrandCloth>40</DevilstrandCloth>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="ApparelMBBase"]/costList</xpath>
		<value>
			<DevilstrandCloth>100</DevilstrandCloth>
		</value>
	</Operation>

	<!-- ===== Mecha Heavy Helmet ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyHelmet"]/statBases/MaxHitPoints</xpath>
		<value>
			<Bulk>6</Bulk>
			<WornBulk>1.5</WornBulk>
			<MaxHitPoints>350</MaxHitPoints>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyHelmet"]/apparel/immuneToToxGasExposure</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyHelmet"]/apparel</xpath>
			<value>
				<immuneToToxGasExposure>true</immuneToToxGasExposure>
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyHelmet"]/equippedStatOffsets/MoveSpeed</xpath>
		<value>
			<AimingAccuracy>0.15</AimingAccuracy>
			<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
			<SmokeSensitivity>-1</SmokeSensitivity>
			<NightVisionEfficiency_Apparel>0.6</NightVisionEfficiency_Apparel>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyHelmet"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>22</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyHelmet"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>48</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- ===== Mecha Heavy Armor ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyArmor"]/statBases/MaxHitPoints</xpath>
		<value>
			<Bulk>115</Bulk>
			<WornBulk>16</WornBulk>
			<MaxHitPoints>1300</MaxHitPoints>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyArmor"]/equippedStatOffsets/MoveSpeed</xpath>
		<value>
			<CarryWeight>95</CarryWeight>
			<CarryBulk>12.2</CarryBulk>
			<ShootingAccuracyPawn>0.10</ShootingAccuracyPawn>
			<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyArmor"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>28</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaHeavyArmor"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>60</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- ===== Mecha Combat Helmet ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatHelmet"]/statBases/MaxHitPoints</xpath>
		<value>
			<Bulk>5</Bulk>
			<WornBulk>1</WornBulk>
			<MaxHitPoints>280</MaxHitPoints>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatHelmet"]/apparel/immuneToToxGasExposure</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Apparel_MechaCombatHelmet"]/apparel</xpath>
			<value>
				<immuneToToxGasExposure>true</immuneToToxGasExposure>
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatHelmet"]/equippedStatOffsets/MeleeDodgeChance</xpath>
		<value>
			<AimingAccuracy>0.20</AimingAccuracy>
			<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
			<SmokeSensitivity>-1</SmokeSensitivity>
			<NightVisionEfficiency_Apparel>0.6</NightVisionEfficiency_Apparel>
			<MeleeDodgeChance>0.15</MeleeDodgeChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatHelmet"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>18</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatHelmet"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>38</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- ===== Mecha Combat Armor ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatArmor"]/statBases/MaxHitPoints</xpath>
		<value>
			<Bulk>100</Bulk>
			<WornBulk>15</WornBulk>
			<MaxHitPoints>1000</MaxHitPoints>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatArmor"]/equippedStatOffsets</xpath>
		<nomatch Class="PatchOperationSequence">
			<operations>
				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[defName="Apparel_MechaCombatArmor"]</xpath>
					<value>
						<equippedStatOffsets />
					</value>
				</li>
				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[defName="Apparel_MechaCombatArmor"]/equippedStatOffsets</xpath>
					<value>
						<CarryWeight>90</CarryWeight>
						<CarryBulk>13.5</CarryBulk>
						<ShootingAccuracyPawn>0.15</ShootingAccuracyPawn>
						<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
						<MoveSpeed>0.1</MoveSpeed>
					</value>
				</li>
			</operations>
		</nomatch>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatArmor"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>22</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaCombatArmor"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>50</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- ===== Mecha Sniper Helmet ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperHelmet"]/statBases/MaxHitPoints</xpath>
		<value>
			<Bulk>5</Bulk>
			<WornBulk>1</WornBulk>
			<MaxHitPoints>280</MaxHitPoints>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperHelmet"]/apparel/immuneToToxGasExposure</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Apparel_MechaSniperHelmet"]/apparel</xpath>
			<value>
				<immuneToToxGasExposure>true</immuneToToxGasExposure>
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperHelmet"]/equippedStatOffsets/AimingDelayFactor</xpath>
		<value>
			<AimingAccuracy>0.25</AimingAccuracy>
			<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
			<SmokeSensitivity>-1</SmokeSensitivity>
			<NightVisionEfficiency_Apparel>0.8</NightVisionEfficiency_Apparel>
			<AimingDelayFactor>-0.1</AimingDelayFactor>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperHelmet"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>16</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperHelmet"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>36</ArmorRating_Blunt>
		</value>
	</Operation>

	<!-- ===== Mecha Sniper Armor ===== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperArmor"]/statBases/MaxHitPoints</xpath>
		<value>
			<Bulk>95</Bulk>
			<WornBulk>14</WornBulk>
			<MaxHitPoints>800</MaxHitPoints>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperArmor"]/equippedStatOffsets/ShootingAccuracyPawn</xpath>
		<value>
			<CarryWeight>85</CarryWeight>
			<CarryBulk>12.5</CarryBulk>
			<ShootingAccuracyPawn>0.4</ShootingAccuracyPawn>
			<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
			<ReloadSpeed>0.2</ReloadSpeed>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperArmor"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>20</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MechaSniperArmor"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>48</ArmorRating_Blunt>
		</value>
	</Operation>

</Patch>