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

	<!-- === Trooper Helmet === -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet"]/statBases</xpath>
		<value>
			<Bulk>4</Bulk><!-- Changed bulk to 4 since advanced helmet is 4 bulk and recon power armor helmet is 4 bulk. -->
			<WornBulk>0.5</WornBulk>
			<NightVisionEfficiency_Apparel>0.6</NightVisionEfficiency_Apparel>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet" or defName="VAE_Headgear_RoyalTrooperHelmet"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>10.5</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet" or defName="VAE_Headgear_RoyalTrooperHelmet"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>20</ArmorRating_Blunt><!-- Blunt armor is based off it being 9mm RHA worth of sharp armor. -->
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet" or defName="VAE_Headgear_RoyalTrooperHelmet"]/statBases/Flammability</xpath>
		<value>
			<Flammability>0.25</Flammability>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet" or defName="VAE_Headgear_RoyalTrooperHelmet"]/statBases/MaxHitPoints</xpath>
		<value>
			<MaxHitPoints>190</MaxHitPoints><!-- Same health as recon power armor helmet. -->
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet"]/equippedStatOffsets/MentalBreakThreshold</xpath>
		<value>
			<PsychicSensitivity>-0.1</PsychicSensitivity>
			<AimingAccuracy>0.1</AimingAccuracy>
			<ToxicEnvironmentResistance>0.10</ToxicEnvironmentResistance>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet" or defName="VAE_Headgear_RoyalTrooperHelmet"]/costList</xpath>
		<value>
			<DevilstrandCloth>10</DevilstrandCloth>
		</value>
	</Operation>

	<!-- It has no visor... -->
	<!--<li Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_TrooperHelmet"]/apparel/bodyPartGroups</xpath>
		<value>
			<li>Eyes</li>
		</value>
	</li>-->

	<!-- === Trooper Armor === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/statBases/Mass</xpath>
		<value>
			<Bulk>40</Bulk><!-- It's supposed to be just small enough to be able to wear something on the shell layer, I think dropping it to this is good enough. -->
			<WornBulk>6</WornBulk>
			<Mass>20</Mass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>14</ArmorRating_Sharp><!-- Just a bit better than a plasteel armor vest, enough to deflect 7.62mm NATO and 7.62mmR. -->
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>28</ArmorRating_Blunt><!-- Blunt armor is based off it being 12mm RHA worth of sharp armor. -->
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/statBases/Flammability</xpath>
		<value>
			<Flammability>0.25</Flammability>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/statBases/MaxHitPoints</xpath>
		<value>
			<MaxHitPoints>400</MaxHitPoints><!-- Same health as recon power armor. -->
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/equippedStatOffsets/MoveSpeed</xpath>
		<value>
			<MoveSpeed>0.50</MoveSpeed>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/equippedStatOffsets/MentalBreakThreshold</xpath>
		<value>
			<CarryWeight>25</CarryWeight>
			<CarryBulk>7.5</CarryBulk>
			<ShootingAccuracyPawn>0.05</ShootingAccuracyPawn>
			<ToxicEnvironmentResistance>0.3</ToxicEnvironmentResistance>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_TrooperArmor" or defName="VAE_Apparel_RoyalTrooperArmor"]/costList</xpath>
		<value>
			<DevilstrandCloth>30</DevilstrandCloth>
		</value>
	</Operation>

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

	<!-- === Siegebreaker Helmet === -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet"]/statBases</xpath>
		<value>
			<Bulk>6</Bulk>
			<WornBulk>2</WornBulk>
			<NightVisionEfficiency_Apparel>0.75</NightVisionEfficiency_Apparel>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet" or defName="VAE_Headgear_RoyalSiegeHelmet"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>20.4</ArmorRating_Sharp>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet" or defName="VAE_Headgear_RoyalSiegeHelmet"]/statBases/MaxHitPoints</xpath>
		<value>
			<MaxHitPoints>260</MaxHitPoints>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet" or defName="VAE_Headgear_RoyalSiegeHelmet"]/statBases/Flammability</xpath>
		<value>
			<Flammability>0</Flammability>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet"]/equippedStatOffsets</xpath>
		<value>
			<AimingAccuracy>0.15</AimingAccuracy>
			<ToxicEnvironmentResistance>0.5</ToxicEnvironmentResistance>
			<SmokeSensitivity>-1</SmokeSensitivity>
			<MeleeDodgeChance>-0.15</MeleeDodgeChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet"]/costList</xpath>
		<value>
			<costList>
				<Plasteel>40</Plasteel>
				<DevilstrandCloth>25</DevilstrandCloth>
				<Hyperweave>5</Hyperweave>
				<ComponentSpacer>2</ComponentSpacer>
			</costList>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VAE_Headgear_HeavyMarineHelmet" or defName="VAE_Headgear_RoyalSiegeHelmet"]/apparel/layers</xpath>
		<value>
			<li>OnHead</li>
			<li>StrappedHead</li>
		</value>
	</Operation>

	<!-- === Siegebreaker Armor === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/Mass</xpath>
		<value>
			<Bulk>100</Bulk>
			<WornBulk>20</WornBulk>
			<Mass>80</Mass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>26</ArmorRating_Sharp>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/MaxHitPoints</xpath>
		<value>
			<MaxHitPoints>600</MaxHitPoints>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/Flammability</xpath>
		<value>
			<Flammability>0</Flammability>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor"]/equippedStatOffsets/MoveSpeed</xpath>
		<value>
			<CarryWeight>100</CarryWeight>
			<CarryBulk>20</CarryBulk>
			<ShootingAccuracyPawn>0.15</ShootingAccuracyPawn>
			<ToxicEnvironmentResistance>0.5</ToxicEnvironmentResistance>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor"]/costList</xpath>
		<value>
			<costList>
				<Plasteel>140</Plasteel>
				<DevilstrandCloth>50</DevilstrandCloth>
				<Hyperweave>10</Hyperweave>
				<Uranium>100</Uranium>
				<ComponentSpacer>8</ComponentSpacer>
			</costList>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]</xpath>
		<value>
			<li Class="CombatExtended.PartialArmorExt">
				<stats>
					<li>
						<ArmorRating_Sharp>0.80</ArmorRating_Sharp>
						<parts>
							<li>Hand</li>
						</parts>
					</li>
					<li>
						<ArmorRating_Blunt>0.80</ArmorRating_Blunt>
						<parts>
							<li>Hand</li>
						</parts>
					</li>
				</stats>
			</li>
		</value>
	</Operation>

	<!-- === Energy shields === -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/EnergyShieldRechargeRate</xpath>
		<value>
			<EnergyShieldRechargeRate>0.03</EnergyShieldRechargeRate>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VAE_Apparel_HeavyMarineArmor" or defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/EnergyShieldEnergyMax</xpath>
		<value>
			<EnergyShieldEnergyMax>0.6</EnergyShieldEnergyMax>
		</value>
	</Operation>

	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>Royalty</li>
		</mods>
		<match Class="PatchOperationSequence">
			<operations>

			<li Class="PatchOperationAdd">
				<xpath>Defs/ThingDef[defName="VAE_Headgear_RoyalTrooperHelmet"]/statBases</xpath>
				<value>
					<Bulk>4</Bulk>
					<WornBulk>0.5</WornBulk>
					<NightVisionEfficiency_Apparel>0.7</NightVisionEfficiency_Apparel>
				</value>
			</li>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[defName="VAE_Headgear_RoyalTrooperHelmet"]/equippedStatOffsets/MentalBreakThreshold</xpath>
				<value>
					<AimingAccuracy>0.1</AimingAccuracy>
					<ToxicEnvironmentResistance>0.10</ToxicEnvironmentResistance>
				</value>
			</li>

			<li Class="PatchOperationAdd">
				<xpath>Defs/ThingDef[defName="VAE_Headgear_RoyalSiegeHelmet"]/statBases</xpath>
				<value>
					<Bulk>6</Bulk>
					<WornBulk>2</WornBulk>
					<NightVisionEfficiency_Apparel>0.75</NightVisionEfficiency_Apparel>
				</value>
			</li>

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

			<li Class="PatchOperationAdd">
				<xpath>Defs/ThingDef[defName="VAE_Headgear_RoyalSiegeHelmet"]/equippedStatOffsets</xpath>
				<value>
					<AimingAccuracy>0.15</AimingAccuracy>
					<ToxicEnvironmentResistance>0.5</ToxicEnvironmentResistance>
					<SmokeSensitivity>-1</SmokeSensitivity>
					<MeleeDodgeChance>-0.15</MeleeDodgeChance>
				</value>
			</li>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[defName="VAE_Headgear_RoyalSiegeHelmet"]/costList</xpath>
				<value>
					<costList>
						<Plasteel>60</Plasteel>
						<DevilstrandCloth>25</DevilstrandCloth>
						<Hyperweave>5</Hyperweave>
						<ComponentSpacer>2</ComponentSpacer>
						<Gold>10</Gold>
					</costList>
				</value>
			</li>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[defName="VAE_Apparel_RoyalSiegeArmor"]/equippedStatOffsets/MoveSpeed</xpath>
				<value>
					<CarryWeight>100</CarryWeight>
					<CarryBulk>20</CarryBulk>
					<ShootingAccuracyPawn>0.15</ShootingAccuracyPawn>
					<ToxicEnvironmentResistance>0.5</ToxicEnvironmentResistance>
				</value>
			</li>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[defName="VAE_Apparel_RoyalSiegeArmor"]/costList</xpath>
				<value>
					<costList>
						<Plasteel>180</Plasteel>
						<DevilstrandCloth>50</DevilstrandCloth>
						<Hyperweave>10</Hyperweave>
						<Uranium>100</Uranium>
						<ComponentSpacer>8</ComponentSpacer>
						<Gold>18</Gold>
					</costList>
				</value>
			</li>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[defName="VAE_Apparel_RoyalSiegeArmor"]/statBases/EnergyShieldRechargeRate</xpath>
				<value>
					<EnergyShieldRechargeRate>0.3</EnergyShieldRechargeRate>
				</value>
			</li>

			</operations>
		</match>
	</Operation>

</Patch>