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

	<!-- ==================== Toughspike ==================== -->

	<!-- ========== Add groups entry if it doesn't exist already ========== -->

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/parts/li[def="FleshbeastHead"]/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/parts/li[def="FleshbeastHead"]</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/parts/li[def="FleshbeastHead"]/parts/li[def="Jaw"]/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/parts/li[def="FleshbeastHead"]/parts/li[def="Jaw"]</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Shoulder"]/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Shoulder"]</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Shoulder"]/parts/li[def="FleshbeastSpike"]/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Shoulder"]/parts/li[def="FleshbeastSpike"]</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="FleshbeastLeg"]/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="FleshbeastLeg"]</xpath>
			<value>
				<groups />
			</value>
		</nomatch>
	</Operation>

	<!-- ========== Add armor coverage ========== -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/parts/li[def="FleshbeastHead"]/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Neck"]/parts/li[def="FleshbeastHead"]/parts/li[def="Jaw"]/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Shoulder"]/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="Shoulder"]/parts/li[def="FleshbeastSpike"]/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/BodyDef[defName="Toughspike"]/corePart/parts/li[def="FleshbeastLeg"]/groups</xpath>
		<value>
			<li>CoveredByNaturalArmor</li>
		</value>
	</Operation>

</Patch>