<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[@Name="BaseAIPawn_MiscMAI"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="BaseAIPawn_MiscMAI"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.26</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.250</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.26</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.250</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>4.49</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.625</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="AIPawn" or defName="AIPawnE"]/statBases</xpath>
		<value>
			<Suppressability>0</Suppressability>
			<SmokeSensitivity>0</SmokeSensitivity>
			<CarryBulk>50</CarryBulk>
		</value>
	</Operation>

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

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

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

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

	<!-- ========== Add loadout update behavior ========== -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThinkTreeDef[defName="AIPawn"]/thinkRoot/subNodes/li[@Class="ThinkNode_ConditionalColonist"]/subNodes</xpath>
		<value>
			<li Class="CombatExtended.JobGiver_UpdateLoadout"/>
			<li Class="CombatExtended.JobGiver_CheckReload"/>
		</value>
	</Operation>

	<!-- ========== Add additional inventory behavior ========== -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThinkTreeDef[defName="AIPawnConstant"]/thinkRoot/subNodes/li[@Class="ThinkNode_ConditionalCanDoConstantThinkTreeJobNow"]/subNodes</xpath>
		<value>
			<li Class="CombatExtended.JobGiver_TakeAndEquip"/>
		</value>
	</Operation>
</Patch>