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

	<!-- Airwire & Array Headset  -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Apparel_AirwireHeadset" or defName="Apparel_ArrayHeadset"]/statBases</xpath>
		<value>
			<Bulk>1</Bulk>
			<WornBulk>1</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_AirwireHeadset" or defName="Apparel_ArrayHeadset"]/apparel/layers</xpath>
		<value>
			<layers>
				<li>StrappedHead</li>
			</layers>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_IntegratorHeadset"]/equippedStatOffsets</xpath>
		<value>
			<equippedStatOffsets Inherit="False">
				<MechBandwidth>9</MechBandwidth>
				<VacuumResistance MayRequire="Ludeon.RimWorld.Odyssey">0</VacuumResistance>
			</equippedStatOffsets>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Apparel_IntegratorHeadset"]/apparel</xpath>
		<value>
			<layers Inherit="False">
				<li>StrappedHead</li>
			</layers>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Apparel_AirwireHeadset" or defName="Apparel_ArrayHeadset" or defName="Apparel_IntegratorHeadset"]</xpath>
		<value>
			<li Class="CombatExtended.ApparelDefExtension">
				<isRadioPack>true</isRadioPack>
			</li>
		</value>
	</Operation>

	<!-- Mechanitor Helmet Base -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="ApparelArmorHelmetMechanitorBase"]</xpath>
		<value>
			<statBases Inherit="False">
				<WorkToMake>15750</WorkToMake>
				<MaxHitPoints>120</MaxHitPoints>
				<Mass>1</Mass>
				<Bulk>4</Bulk>
				<WornBulk>1</WornBulk>
				<EquipDelay>2</EquipDelay>
			</statBases>
		</value>
	</Operation>

	<!-- Mech Commander Helmet  -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_ArmorHelmetMechCommander"]/statBases/MaxHitPoints</xpath>
		<value>
			<MaxHitPoints>210</MaxHitPoints>
			<Mass>3.0</Mass>
			<Flammability>0.25</Flammability>
		</value>
	</Operation>

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

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

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Apparel_ArmorHelmetMechCommander"]</xpath>
		<value>
			<li Class="CombatExtended.ApparelDefExtension">
				<isRadioPack>true</isRadioPack>
			</li>
		</value>
	</Operation>

	<!-- Mech Lord Helmet  -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_ArmorHelmetMechlordHelmet"]/statBases/MaxHitPoints</xpath>
		<value>
			<MaxHitPoints>270</MaxHitPoints>
			<Mass>3.0</Mass>
			<ArmorRating_Sharp>12</ArmorRating_Sharp>
			<ArmorRating_Blunt>26</ArmorRating_Blunt>
			<Flammability>0.25</Flammability>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_ArmorHelmetMechlordHelmet"]/equippedStatOffsets/ShootingAccuracyPawn</xpath>
		<value>
			<ToxicEnvironmentResistance>0.50</ToxicEnvironmentResistance>
			<SmokeSensitivity>-1</SmokeSensitivity>
			<AimingAccuracy>-0.25</AimingAccuracy>
			<ShootingAccuracyPawn>-1.25</ShootingAccuracyPawn>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_ArmorHelmetMechlordHelmet"]/costList/Plasteel</xpath>
		<value>
			<Plasteel>150</Plasteel>
			<DevilstrandCloth>15</DevilstrandCloth>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Apparel_ArmorHelmetMechlordHelmet"]</xpath>
		<value>
			<li Class="CombatExtended.ApparelDefExtension">
				<isRadioPack>true</isRadioPack>
			</li>
		</value>
	</Operation>

	<!-- Gas Mask  -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_GasMask"]/statBases</xpath>
		<value>
			<statBases>
				<WorkToMake>8000</WorkToMake>
				<MaxHitPoints>100</MaxHitPoints>
				<Mass>0.5</Mass>
				<Bulk>3</Bulk>
				<WornBulk>1</WornBulk>
				<EquipDelay>0.5</EquipDelay>
				<ArmorRating_Sharp>0.01</ArmorRating_Sharp> <!-- A little bit of armor to prevent triggering a warning when shot. -->
				<ArmorRating_Blunt>0.01</ArmorRating_Blunt>						
			</statBases>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Apparel_GasMask"]/equippedStatOffsets</xpath>
		<value>
			<SmokeSensitivity>-1</SmokeSensitivity>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Apparel_GasMask"]</xpath>
		<value>
			<li Class="CombatExtended.ApparelHediffExtension">
				<hediff>WearingGasMask</hediff>
			</li>
			<li Class="CombatExtended.ApparelDefExtension">
				<isSoftArmor>true</isSoftArmor>
			</li>
			<li Class="CombatExtended.ApperalRenderingExtension">
				<HideHair>false</HideHair>
				<HideBeard>true</HideBeard>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_GasMask"]/apparel/layers</xpath>
		<value>
			<layers>
				<li>StrappedHead</li>
			</layers>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_GasMask"]/apparel/tags</xpath>
			<value>
				<tags>
					<li>IndustrialMilitaryBasic</li>
					<li>GasMask</li>
				</tags>
		</value>
	</Operation>

	<!-- Cloth Mask  -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Apparel_ClothMask"]/statBases</xpath>
		<value>
			<Bulk>0.25</Bulk>
			<WornBulk>0</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Apparel_ClothMask"]/equippedStatOffsets</xpath>
		<value>
			<SmokeSensitivity>-0.4</SmokeSensitivity>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_ClothMask"]/statBases/StuffEffectMultiplierArmor</xpath>
		<value>
			<StuffEffectMultiplierArmor>1.5</StuffEffectMultiplierArmor>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_ClothMask"]/apparel/layers</xpath>
		<value>
			<layers>
				<li>StrappedHead</li>
			</layers>
		</value>
	</Operation>

</Patch>