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

	<!--Test for comps-->
	<Operation Class="PatchOperationConditional">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior"]</xpath>
			<value>
				<comps/>
			</value>
		</nomatch>
	</Operation>

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

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

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

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

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior" or
			defName="ATM_Mark2Bishop" or
			defName="ATM_Mark3Paladin" or
			defName="ATM_Mark4Jellyman" or
			defName="ATM_Mark5Titan"
			] </xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior" or
			defName="ATM_Mark2Bishop" or
			defName="ATM_Mark3Paladin" or
			defName="ATM_Mark4Jellyman" or
			defName="ATM_Mark5Titan"
			]/comps </xpath>
		<value>
			<li>
				<compClass>CombatExtended.CompPawnGizmo</compClass>
			</li>
			<li>
				<compClass>CombatExtended.CompAmmoGiver</compClass>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[
			defName="ATM_Mark3Paladin" or
			defName="ATM_Mark4Jellyman"
			]/comps </xpath>
		<value>
			<li Class="CombatExtended.CompProperties_Suppressable"/>
		</value>
	</Operation>

	<!-- MK1 -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.8</MeleeDodgeChance>
			<MeleeCritChance>0.8</MeleeCritChance>
			<MeleeParryChance>0.8</MeleeParryChance>
			<SmokeSensitivity>0.5</SmokeSensitivity>
			<AimingAccuracy>1.0</AimingAccuracy>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>5</ArmorRating_Sharp>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior"]/race/baseBodySize</xpath>
		<value>
			<baseBodySize>0.85</baseBodySize>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark1Warrior"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.14</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.75</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.14</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.75</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>body</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>6</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>2.0</armorPenetrationBlunt>
					<chanceFactor>0.2</chanceFactor>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- MK2 -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark2Bishop"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.9</MeleeDodgeChance>
			<MeleeCritChance>0.9</MeleeCritChance>
			<MeleeParryChance>0.9</MeleeParryChance>
			<AimingAccuracy>1.0</AimingAccuracy>
			<SmokeSensitivity>0.25</SmokeSensitivity>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark2Bishop"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>5</ArmorRating_Sharp>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark2Bishop"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>manipulator</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>3</power>
					<cooldownTime>0.75</cooldownTime>
					<linkedBodyPartsGroup>Hands</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.0</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>manipulator</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>3</power>
					<cooldownTime>1.0</cooldownTime>
					<linkedBodyPartsGroup>Hands</linkedBodyPartsGroup>
					<armorPenetrationSharp>1.0</armorPenetrationSharp>
					<chanceFactor>0.75</chanceFactor>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>bodyslam</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>6</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>2.5</armorPenetrationBlunt>
					<chanceFactor>0.2</chanceFactor>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- MK3 -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark3Paladin"]/statBases</xpath>
		<value>
			<NightVisionEfficiency>0.25</NightVisionEfficiency>
			<MeleeDodgeChance>1</MeleeDodgeChance>
			<MeleeCritChance>1</MeleeCritChance>
			<MeleeParryChance>1</MeleeParryChance>
			<Suppressability>0.2</Suppressability>
			<SmokeSensitivity>0</SmokeSensitivity>
			<ArmorRating_Blunt>1</ArmorRating_Blunt>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark3Paladin"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>1</ArmorRating_Sharp>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark3Paladin"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left hand</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.0</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.75</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right hand</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>1.0</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.75</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>manipulator</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>4</power>
					<cooldownTime>0.75</cooldownTime>
					<linkedBodyPartsGroup>Hands</linkedBodyPartsGroup>
					<armorPenetrationBlunt>1.0</armorPenetrationBlunt>
					<chanceFactor>0.75</chanceFactor>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>manipulator</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>4</power>
					<cooldownTime>1.0</cooldownTime>
					<linkedBodyPartsGroup>Hands</linkedBodyPartsGroup>
					<armorPenetrationSharp>1.0</armorPenetrationSharp>
					<chanceFactor>0.75</chanceFactor>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>bodyslam</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>8</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>3</armorPenetrationBlunt>
					<chanceFactor>0.2</chanceFactor>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- MK4 -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark4Jellyman"]/statBases</xpath>
		<value>
			<NightVisionEfficiency>0.4</NightVisionEfficiency>
			<AimingAccuracy>1.1</AimingAccuracy>
			<MeleeDodgeChance>1.2</MeleeDodgeChance>
			<MeleeCritChance>1.2</MeleeCritChance>
			<MeleeParryChance>1.2</MeleeParryChance>
			<Suppressability>0.33</Suppressability>
			<SmokeSensitivity>0</SmokeSensitivity>
			<CarryWeight>50</CarryWeight>
			<CarryBulk>25</CarryBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark4Jellyman"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>10</ArmorRating_Sharp>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark4Jellyman"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>bodyslam</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>15</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>5</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- MK5 -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark5Titan"]/statBases/ArmorRating_Sharp</xpath>
		<value>
			<ArmorRating_Sharp>30</ArmorRating_Sharp>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark5Titan"]/statBases/ArmorRating_Heat</xpath>
		<value>
			<ArmorRating_Heat>0</ArmorRating_Heat>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark5Titan"]/statBases</xpath>
		<value>
			<NightVisionEfficiency>0.4</NightVisionEfficiency>
			<MeleeDodgeChance>1.0</MeleeDodgeChance>
			<MeleeCritChance>1.0</MeleeCritChance>
			<MeleeParryChance>1.0</MeleeParryChance>
			<SmokeSensitivity>0</SmokeSensitivity>
			<CarryWeight>200</CarryWeight>
			<CarryBulk>100</CarryBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/AlienRace.ThingDef_AlienRace[defName="ATM_Mark5Titan"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Demolish</li>
					</capacities>
					<power>80</power>
					<cooldownTime>3.07</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>48.25</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Demolish</li>
					</capacities>
					<power>80</power>
					<cooldownTime>3.07</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationBlunt>48.25</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/PawnKindDef[defName="ATM_M5TitanColony"]</xpath>
		<value>
			<li Class="CombatExtended.LoadoutPropertiesExtension">
				<primaryMagazineCount>
					<min>8</min>
					<max>10</max>
				</primaryMagazineCount>
				<forcedSidearm>
					<sidearmMoney>
						<min>0</min>
						<max>10000</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm_M7Mech</li>
					</weaponTags>
					<magazineCount>
						<min>4</min>
						<max>5</max>
					</magazineCount>
				</forcedSidearm>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ATM_OrbitalTargeterMechFall"]</xpath>
		<value>
			<statBases>
				<Bulk>1</Bulk>
			</statBases>
		</value>
	</Operation>

</Patch>