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

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_MegaphoridLarva"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>0.05</MeleeDodgeChance>
			<MeleeCritChance>0.05</MeleeCritChance>
			<MeleeParryChance>0.05</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_MegaphoridLarva"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>proboscis</label>
					<capacities>
						<li>Bite</li>
					</capacities>
					<power>2</power>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>Mouth</linkedBodyPartsGroup>
					<armorPenetrationSharp>0.04</armorPenetrationSharp>
					<armorPenetrationBlunt>0.08</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
					<armorPenetrationBlunt>0.05</armorPenetrationBlunt>
					<chanceFactor>0.1</chanceFactor>
				</li>
			</tools>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="BMT_Megaphorid"]/statBases</xpath>
		<value>
			<MeleeDodgeChance>1.55</MeleeDodgeChance>
			<MeleeCritChance>0.45</MeleeCritChance>
			<MeleeParryChance>0.05</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="BMT_Megaphorid"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>stinger</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<extraMeleeDamages>
						<li>
							<def>BMT_PhoridSting</def>
							<amount>1</amount>
							<chance>1</chance>
						</li>
					</extraMeleeDamages>
					<power>1</power>
					<cooldownTime>1</cooldownTime>
					<linkedBodyPartsGroup>BMT_StingerGroup</linkedBodyPartsGroup>
					<armorPenetrationSharp>0.6</armorPenetrationSharp>
					<armorPenetrationBlunt>0.8</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

</Patch>