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

	<!-- Larva -->

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="Larva"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Serpentine</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Larva"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.00</MeleeDodgeChance>
			<MeleeCritChance>0.01</MeleeCritChance>
			<MeleeParryChance>0.01</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Larva"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>mandibles</label>
					<capacities>
						<li>Bite</li>
					</capacities>
					<power>3</power>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>Mouth</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationSharp>0.1</armorPenetrationSharp>
					<armorPenetrationBlunt>0.25</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>0.35</armorPenetrationBlunt>
				</li>				
			</tools>
		</value>
	</Operation>

	<!-- Queen -->

	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="HiveQueen"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Birdlike</bodyShape>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HiveQueen"]/statBases/MoveSpeed</xpath>
		<value>
			<MoveSpeed>2.6</MoveSpeed>
			<PainShockThreshold>0.95</PainShockThreshold>
			<MeleeDodgeChance>0.03</MeleeDodgeChance>
			<MeleeCritChance>0.30</MeleeCritChance>
			<MeleeParryChance>0.57</MeleeParryChance>
		</value>
	</Operation>

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

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="HiveQueen"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>head claw</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>65</power>
					<cooldownTime>1.65</cooldownTime>
					<linkedBodyPartsGroup>HeadClaw</linkedBodyPartsGroup>
					<armorPenetrationSharp>3.38</armorPenetrationSharp>
					<armorPenetrationBlunt>8.438</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>34</power>
					<cooldownTime>2.64</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>14.4</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="HiveQueen"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_ArmorDurability">
				<Durability>3575</Durability>
				<Regenerates>true</Regenerates>
				<RegenInterval>600</RegenInterval>
				<RegenValue>5</RegenValue>
				<MinArmorPct>0.25</MinArmorPct>
			</li>
		</value>
	</Operation>

	<!-- ========== Locust ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Locust"]/statBases/MoveSpeed</xpath>
		<value>
			<MoveSpeed>3.6</MoveSpeed>
			<MeleeDodgeChance>0.1</MeleeDodgeChance>
			<MeleeCritChance>0.03</MeleeCritChance>
			<MeleeParryChance>0.04</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Locust"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>mandibles</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>17</power>
					<cooldownTime>1.74</cooldownTime>
					<linkedBodyPartsGroup>Mouth</linkedBodyPartsGroup>
					<armorPenetrationSharp>0.26</armorPenetrationSharp>
					<armorPenetrationBlunt>0.9</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>2</power>
					<cooldownTime>1.42</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.4</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

</Patch>