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

	<!-- ========== PawnKind Patches ========== -->

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

	<!-- ========== Base Mechanoid ========== -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="Gha_MediumMechanoid"]/statBases</xpath>
		<value>
			<CarryWeight>50</CarryWeight>
			<CarryBulk>20</CarryBulk>
			<AimingAccuracy>1.3</AimingAccuracy>
			<ShootingAccuracyPawn>1.25</ShootingAccuracyPawn>
			<MeleeDodgeChance>0.09</MeleeDodgeChance>
			<MeleeCritChance>0.08</MeleeCritChance>
			<MeleeParryChance>0.07</MeleeParryChance>
			<MaxHitPoints>150</MaxHitPoints>
			<NightVisionEfficiency>0.4</NightVisionEfficiency>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Gha_MediumMechanoid"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>3</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Gha_MediumMechanoid"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>2</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="Gha_MediumMechanoid"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>4</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ========== Laborers ========== -->

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Gha_Corpse_Laborer"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.12</MeleeDodgeChance>
			<MeleeCritChance>0.12</MeleeCritChance>
			<MeleeParryChance>0.07</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gha_Corpse_Laborer"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>front left leg</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>13</power>
					<cooldownTime>2.67</cooldownTime>
					<linkedBodyPartsGroup>FrontLeftLeg</linkedBodyPartsGroup>
					<armorPenetrationBlunt>5</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>front right leg</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>13</power>
					<cooldownTime>2.67</cooldownTime>
					<linkedBodyPartsGroup>FrontRightLeg</linkedBodyPartsGroup>
					<armorPenetrationBlunt>5</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>15</power>
					<cooldownTime>3.51</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<armorPenetrationBlunt>12</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
					<chanceFactor>0.2</chanceFactor>
				</li>
			</tools>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Gha_Corpse_Laborer"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_ArmorDurability">
				<Durability>700</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>

	<!-- Combat Laborers -->

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Gha_Combat_Laborer"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<canParry>true</canParry>
				<maxParry>3</maxParry>
			</li>
		</value>
	</Operation>

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

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

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

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Gha_Assassin_Laborer"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<canParry>true</canParry>
				<maxParry>5</maxParry>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Gha_Assassin_Laborer"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.17</MeleeDodgeChance>
			<MeleeCritChance>0.17</MeleeCritChance>
			<MeleeParryChance>0.09</MeleeParryChance>
		</value>
	</Operation>

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

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

</Patch>