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

	<!-- ========== Light Workers ========== -->

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechLight"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>5</ArmorRating_Sharp>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechLight"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>7.5</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechLight"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.16</MeleeDodgeChance>
			<MeleeCritChance>0.08</MeleeCritChance>
			<MeleeParryChance>0.06</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechLight"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[@Name="CGM_WorkerMechLight"]</xpath>
			<value>
				<comps />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechLight"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_ArmorDurability">
				<Durability>275</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>

	<!-- ========== Light Combat ========== -->

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechLight"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>6</ArmorRating_Sharp>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechLight"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>8</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechLight"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.15</MeleeDodgeChance>
			<MeleeCritChance>0.10</MeleeCritChance>
			<MeleeParryChance>0.08</MeleeParryChance>
			<CarryBulk>30</CarryBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechLight"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[@Name="CGM_CombatMechLight"]</xpath>
			<value>
				<comps />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechLight"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_ArmorDurability">
				<Durability>275</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>

	<!-- ========== Medium Mechs ========== -->

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium" or @Name="CGM_CombatMechMedium"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium" or @Name="CGM_CombatMechMedium"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>8</ArmorRating_Sharp>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>12</ArmorRating_Blunt>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechMedium"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>15</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium" or @Name="CGM_CombatMechMedium"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.11</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.688</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.11</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.688</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.85</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.625</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium"]</xpath>
			<value>
				<comps />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="CGM_WorkerMechMedium"]/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>
	
	<Operation Class="PatchOperationConditional">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechMedium"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/ThingDef[@Name="CGM_CombatMechMedium"]</xpath>
			<value>
				<comps />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="CGM_CombatMechMedium"]/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>
	
	<!-- ========== Anomaly Mech Base ========== -->
	
	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>Anomaly</li>
		</mods>
		<match Class="PatchOperationSequence">
			<operations>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[@Name="CGM_AnomalyMech"]/statBases/ArmorRating_Sharp</xpath>
				<value>
					<ArmorRating_Sharp>8</ArmorRating_Sharp>
				</value>
			</li>
			
			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[@Name="CGM_AnomalyMech"]/statBases/ArmorRating_Blunt</xpath>
				<value>
					<ArmorRating_Blunt>12</ArmorRating_Blunt>
				</value>
			</li>
			
			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[@Name="CGM_AnomalyMech"]/statBases/ArmorRating_Heat</xpath>
				<value>
					<ArmorRating_Heat>0</ArmorRating_Heat>
				</value>
			</li>

			<li Class="PatchOperationReplace">
				<xpath>Defs/ThingDef[@Name="CGM_AnomalyMech"]/tools</xpath>
				<value>
					<tools>
						<li Class="CombatExtended.ToolCE">
							<label>left blade</label>
							<capacities>
								<li>Cut</li>
							</capacities>
							<power>30</power>
							<cooldownTime>2.07</cooldownTime>
							<linkedBodyPartsGroup>LeftBlade</linkedBodyPartsGroup>
							<armorPenetrationSharp>2.16</armorPenetrationSharp>
							<armorPenetrationBlunt>5.4</armorPenetrationBlunt>
							<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
						</li>
						<li Class="CombatExtended.ToolCE">
							<label>right blade</label>
							<capacities>
								<li>Cut</li>
							</capacities>
							<power>30</power>
							<cooldownTime>2.07</cooldownTime>
							<linkedBodyPartsGroup>RightBlade</linkedBodyPartsGroup>
							<armorPenetrationSharp>2.16</armorPenetrationSharp>
							<armorPenetrationBlunt>5.4</armorPenetrationBlunt>
							<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
						</li>
						<li Class="CombatExtended.ToolCE">
							<label>head</label>
							<capacities>
								<li>Blunt</li>
							</capacities>
							<power>6</power>
							<cooldownTime>5.9</cooldownTime>
							<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
							<chanceFactor>0.2</chanceFactor>
							<armorPenetrationBlunt>1.875</armorPenetrationBlunt>
						</li>
					</tools>
				</value>
			</li>

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

	<!-- ========== Anomaly Mech ========== -->
	
	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>Anomaly</li>
		</mods>
		<match Class="PatchOperationSequence">
			<operations>

				<li Class="PatchOperationAddModExtension">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]</xpath>
					<value>
						<li Class="CombatExtended.RacePropertiesExtensionCE">
							<bodyShape>Humanoid</bodyShape>
							<canParry>true</canParry>
							<maxParry>8</maxParry>
						</li>
					</value>
				</li>
				
				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]/statBases</xpath>
					<value>
						<MeleeCritChance>0.48</MeleeCritChance>
						<MeleeParryChance>0.52</MeleeParryChance>
						<CarryBulk>30</CarryBulk>
						<MaxHitPoints>500</MaxHitPoints>
					</value>
				</li>
				
				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]/statBases/ArmorRating_Sharp</xpath>
					<value>
						<ArmorRating_Sharp>28</ArmorRating_Sharp>
					</value>
				</li>
				
				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]/statBases/ArmorRating_Blunt</xpath>
					<value>
						<ArmorRating_Blunt>70</ArmorRating_Blunt>
					</value>
				</li>
				
				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]/statBases/EnergyShieldEnergyMax</xpath>
					<value>
						<EnergyShieldEnergyMax>7.5</EnergyShieldEnergyMax>
					</value>
				</li>

				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]/tools</xpath>
					<value>
						<tools>
							<li Class="CombatExtended.ToolCE">
								<label>left claw</label>
								<capacities>
									<li>Cut</li>
								</capacities>
								<power>61</power>
								<cooldownTime>1.65</cooldownTime>
								<linkedBodyPartsGroup>LeftBlade</linkedBodyPartsGroup>
								<armorPenetrationSharp>11.25</armorPenetrationSharp>
								<armorPenetrationBlunt>8.44</armorPenetrationBlunt>
								<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
							</li>
							<li Class="CombatExtended.ToolCE">
								<label>right claw</label>
								<capacities>
									<li>Cut</li>
								</capacities>
								<power>61</power>
								<cooldownTime>1.65</cooldownTime>
								<linkedBodyPartsGroup>RightBlade</linkedBodyPartsGroup>
								<armorPenetrationSharp>11.25</armorPenetrationSharp>
								<armorPenetrationBlunt>8.44</armorPenetrationBlunt>
								<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
							</li>
							<li Class="CombatExtended.ToolCE">
								<label>left claw</label>
								<capacities>
									<li>Stab</li>
								</capacities>
								<power>44</power>
								<cooldownTime>1.48</cooldownTime>
								<linkedBodyPartsGroup>LeftBlade</linkedBodyPartsGroup>
								<armorPenetrationSharp>40.50</armorPenetrationSharp>
								<armorPenetrationBlunt>16.2</armorPenetrationBlunt>
								<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
							</li>
							<li Class="CombatExtended.ToolCE">
								<label>right claw</label>
								<capacities>
									<li>Stab</li>
								</capacities>
								<power>44</power>
								<cooldownTime>1.48</cooldownTime>
								<linkedBodyPartsGroup>RightBlade</linkedBodyPartsGroup>
								<armorPenetrationSharp>40.50</armorPenetrationSharp>
								<armorPenetrationBlunt>16.2</armorPenetrationBlunt>
								<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
							</li>
							<li Class="CombatExtended.ToolCE">
								<label>toxic bite</label>
								<capacities>
									<li>ToxicBite</li>
								</capacities>
								<power>41</power>
								<cooldownTime>1.48</cooldownTime>
								<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
								<armorPenetrationSharp>40.50</armorPenetrationSharp>
								<armorPenetrationBlunt>16.2</armorPenetrationBlunt>
							</li>
						</tools>
					</value>
				</li>

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

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[defName="CGM_MechMaidZombie"]/comps</xpath>
					<value>
						<li Class="CombatExtended.CompProperties_ArmorDurability">
							<Durability>2500</Durability>
							<Regenerates>true</Regenerates>
							<RegenInterval>1250</RegenInterval>
							<RegenValue>250</RegenValue>
							<Repairable>true</Repairable>
							<RepairIngredients>
								<Steel>5</Steel>
								<Bioferrite>5</Bioferrite>
							</RepairIngredients>
							<RepairTime>300</RepairTime>
							<RepairValue>500</RepairValue>
							<MinArmorPct>0.5</MinArmorPct>
						</li>
					</value>
				</li>

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

</Patch>