<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!--Test for comps-->

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid"]</xpath>
			<value>
				<comps/>
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjDroid"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjDroid"]</xpath>
			<value>
				<comps/>
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]</xpath>
			<value>
				<comps/>
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid" or
			defName="ChjDroid" or
			defName="ChjBattleDroid"
			] </xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid" or
			defName="ChjDroid" or
			defName="ChjBattleDroid"
			]/comps </xpath>
		<value>
			<li>
				<compClass>CombatExtended.CompPawnGizmo</compClass>
			</li>
		</value>
	</Operation>

	<!--These androids are pretty much printed humans functionally-->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_Suppressable"/>
		</value>
	</Operation>

	<!--Android-->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>1</MeleeDodgeChance>
			<MeleeCritChance>1</MeleeCritChance>
			<MeleeParryChance>1</MeleeParryChance>
			<Suppressability>1</Suppressability>
			<SmokeSensitivity>0.5</SmokeSensitivity>
		</value>
	</Operation>

	<!--Slighly lighter weight attacks-->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjAndroid"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.19</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.2</armorPenetrationBlunt>
				</li>

				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.19</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.2</armorPenetrationBlunt>
				</li>

				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>4.24</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Leather_ChJAndroid"]/statBases/StuffPower_Armor_Sharp</xpath>
		<value>
			<StuffPower_Armor_Sharp>0.02</StuffPower_Armor_Sharp>
		</value>
	</Operation>

	<!--Worker Droid-->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjDroid"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.95</MeleeDodgeChance>
			<MeleeCritChance>0.95</MeleeCritChance>
			<MeleeParryChance>0.95</MeleeParryChance>
			<SmokeSensitivity>0</SmokeSensitivity>
		</value>
	</Operation>
	<!--2mm Steel-->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjDroid"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>2</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjDroid"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>3</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjDroid"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.58</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.16</armorPenetrationBlunt>
				</li>

				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.58</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.16</armorPenetrationBlunt>
				</li>

				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>4.49</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<armorPenetrationBlunt>0.4</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<!--Battledroid-->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]/statBases</xpath>
		<value>
			<MeleeCritChance>1</MeleeCritChance>
			<MeleeParryChance>1</MeleeParryChance>
			<SmokeSensitivity>0</SmokeSensitivity>
		</value>
	</Operation>
	<!--8mm Steel-->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>8</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]/statBases/ArmorRating_Blunt</xpath>
		<value>
			<ArmorRating_Blunt>12</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left bladed fist</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>9</power>
					<cooldownTime>1.49</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.44</armorPenetrationBlunt>
					<armorPenetrationSharp>0.32</armorPenetrationSharp>
				</li>

				<li Class="CombatExtended.ToolCE">
					<label>right bladed fist</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>9</power>
					<cooldownTime>1.49</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.44</armorPenetrationBlunt>
					<armorPenetrationSharp>0.32</armorPenetrationSharp>
				</li>

				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>4</power>
					<cooldownTime>5.05</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ChjBattleDroid"]/alienRace/raceRestriction/whiteApparelList</xpath>
		<value>
			<li>CE_Apparel_TacVest</li>
			<li>CE_Apparel_Backpack</li>
			<li>CE_Apparel_TribalBackpack</li>
			<li>CE_Apparel_BallisticShield</li>
			<li>CE_Apparel_MeleeShield</li>
		</value>
	</Operation>
</Patch>