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

	<!-- Add Body Shapes -->
	<Operation Class="PatchOperationAddModExtension">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_One" or defName="DankPyon_Ghoul_Stage_Two" or defName="DankPyon_Ghoul_Stage_Three"]</xpath>
		<value>
			<li Class="CombatExtended.RacePropertiesExtensionCE">
				<bodyShape>Humanoid</bodyShape>
			</li>
		</value>
	</Operation>

	<!-- Ghoul Stage One -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_One"]/statBases/MoveSpeed</xpath>
		<value>
			<MoveSpeed>5</MoveSpeed>
			<MeleeDodgeChance>0.22</MeleeDodgeChance>
			<MeleeCritChance>0.03</MeleeCritChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_One"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left claw</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>5</power>
					<surpriseAttack>
					<extraMeleeDamages>
						<li>
							<def>Stun</def>
							<amount>14</amount>
						</li>
					</extraMeleeDamages>
				</surpriseAttack>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationSharp>1</armorPenetrationSharp>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right claw</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>5</power>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>14</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationSharp>1</armorPenetrationSharp>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>teeth</label>
					<capacities>
						<li>Bite</li>
					</capacities>
					<power>9</power>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>14</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<cooldownTime>1.5</cooldownTime>
					<linkedBodyPartsGroup>Mouth</linkedBodyPartsGroup>
					<armorPenetrationSharp>0.24</armorPenetrationSharp>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.26</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.250</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

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

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

	<!-- Ghoul Stage Two -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_Two"]/statBases/MoveSpeed</xpath>
		<value>
			<MoveSpeed>5</MoveSpeed>
			<MeleeDodgeChance>0.22</MeleeDodgeChance>
			<MeleeCritChance>0.03</MeleeCritChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_Two"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left claw</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>8</power>
					<surpriseAttack>
					<extraMeleeDamages>
						<li>
							<def>Stun</def>
							<amount>14</amount>
						</li>
					</extraMeleeDamages>
				</surpriseAttack>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationSharp>1</armorPenetrationSharp>
					<armorPenetrationBlunt>1</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right claw</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>8</power>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>14</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationSharp>1</armorPenetrationSharp>
					<armorPenetrationBlunt>1</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>teeth</label>
					<capacities>
						<li>Bite</li>
					</capacities>
					<power>15</power>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>14</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<cooldownTime>1.5</cooldownTime>
					<linkedBodyPartsGroup>Mouth</linkedBodyPartsGroup>
					<armorPenetrationSharp>2</armorPenetrationSharp>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.26</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.250</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

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

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

	<!-- Ghoul Stage Three -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_Three"]/statBases/MoveSpeed</xpath>
		<value>
			<MoveSpeed>5</MoveSpeed>
			<MeleeDodgeChance>0.22</MeleeDodgeChance>
			<MeleeCritChance>0.03</MeleeCritChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Ghoul_Stage_Three"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left claw</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>18</power>
					<surpriseAttack>
					<extraMeleeDamages>
						<li>
							<def>Stun</def>
							<amount>14</amount>
						</li>
					</extraMeleeDamages>
				</surpriseAttack>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<armorPenetrationSharp>1.5</armorPenetrationSharp>
					<armorPenetrationBlunt>2</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right claw</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>18</power>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>14</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<cooldownTime>2</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<armorPenetrationSharp>1.5</armorPenetrationSharp>
					<armorPenetrationBlunt>2</armorPenetrationBlunt>
					<alwaysTreatAsWeapon>true</alwaysTreatAsWeapon>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>teeth</label>
					<capacities>
						<li>Bite</li>
					</capacities>
					<power>24</power>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>14</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<cooldownTime>1.5</cooldownTime>
					<linkedBodyPartsGroup>Mouth</linkedBodyPartsGroup>
					<armorPenetrationSharp>3.5</armorPenetrationSharp>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>head</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.26</cooldownTime>
					<linkedBodyPartsGroup>HeadAttackTool</linkedBodyPartsGroup>
					<chanceFactor>0.2</chanceFactor>
					<armorPenetrationBlunt>0.250</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

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

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

</Patch>