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

	<!-- ========== Adjust combatPower ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/PawnKindDef[defName="Mech_Legionary" or defName="Mech_Tesseron"]/combatPower</xpath>
		<value>
			<combatPower>200</combatPower>
		</value>
	</Operation>

	<!-- ========== Loadouts ========== -->

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/PawnKindDef[defName="Mech_Legionary"]</xpath>
		<value>
			<li Class="CombatExtended.LoadoutPropertiesExtension">
				<primaryMagazineCount>
					<min>3</min>
					<max>4</max>
				</primaryMagazineCount>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/PawnKindDef[defName="Mech_Scorcher"]</xpath>
		<value>
			<li Class="CombatExtended.LoadoutPropertiesExtension">
				<primaryMagazineCount>
					<min>3</min>
					<max>4</max>
				</primaryMagazineCount>
			</li>
		</value>
	</Operation>

	<!-- ========== Legionary & Tesseron ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/PawnKindDef[defName="Mech_Legionary"]/weaponTags</xpath>
		<value>
			<weaponTags>
				<li>MechanoidGunIndirect</li>
			</weaponTags>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Mech_Legionary" or defName="Mech_Tesseron"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Mech_Legionary"]/statBases</xpath>
		<value>
			<CarryWeight>75</CarryWeight>
			<CarryBulk>60</CarryBulk>
			<MeleeDodgeChance>0.12</MeleeDodgeChance>
			<MeleeCritChance>0.11</MeleeCritChance>
			<MeleeParryChance>0.09</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Mech_Tesseron"]/statBases</xpath>
		<value>
			<ArmorRating_Heat>0.25</ArmorRating_Heat>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Mech_Legionary"]/statBases/EnergyShieldRechargeRate</xpath>
		<value>
			<EnergyShieldRechargeRate>0.375</EnergyShieldRechargeRate>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Mech_Legionary"]/statBases/EnergyShieldEnergyMax</xpath>
		<value>
			<EnergyShieldEnergyMax>2.25</EnergyShieldEnergyMax>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Mech_Legionary"]/comps/li[@Class="CompProperties_ProjectileInterceptor"]/hitPoints</xpath>
		<value>
			<hitPoints>300</hitPoints>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Mech_Legionary" or defName="Mech_Tesseron"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Mech_Legionary" or defName="Mech_Tesseron"]</xpath>
			<value>
				<comps />
			</value>
		</nomatch>
	</Operation>

	<!-- ========== Scorcher ========== -->

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Mech_Scorcher"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Mech_Scorcher"]/statBases</xpath>
		<value>
			<ArmorRating_Heat>0.5</ArmorRating_Heat>
			<CarryBulk>30</CarryBulk>
			<MeleeDodgeChance>0.13</MeleeDodgeChance>
			<MeleeCritChance>0.12</MeleeCritChance>
			<MeleeParryChance>0.09</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Mech_Scorcher"]/race/baseHealthScale</xpath>
		<value>
			<baseHealthScale>1.0</baseHealthScale>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Mech_Scorcher"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>front left leg</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>7</power>
					<cooldownTime>1.11</cooldownTime>
					<linkedBodyPartsGroup>FrontLeftLeg</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.75</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>front right leg</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>7</power>
					<cooldownTime>1.11</cooldownTime>
					<linkedBodyPartsGroup>FrontRightLeg</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.75</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>6</power>
					<cooldownTime>1.85</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.7</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[defName="Mech_Scorcher"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[defName="Mech_Scorcher"]</xpath>
			<value>
				<comps />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Mech_Scorcher"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_ArmorDurability">
				<Durability>1000</Durability>
				<Regenerates>true</Regenerates>
				<RegenInterval>1250</RegenInterval>
				<RegenValue>5</RegenValue>
				<Repairable>true</Repairable>
				<RepairIngredients>
					<Steel>5</Steel>
					<Plasteel>5</Plasteel>
				</RepairIngredients>
				<RepairTime>300</RepairTime>
				<RepairValue>200</RepairValue>
				<MinArmorPct>0.5</MinArmorPct>
			</li>
		</value>
	</Operation>

</Patch>