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

	<!-- ===== Zombies ===== -->

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

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Zombie"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>left fist</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>2</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>LeftHand</linkedBodyPartsGroup>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>22</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<armorPenetrationSharp>0.05</armorPenetrationSharp>
					<armorPenetrationBlunt>0.25</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>right fist</label>
					<capacities>
						<li>Scratch</li>
					</capacities>
					<power>2</power>
					<cooldownTime>2.0</cooldownTime>
					<linkedBodyPartsGroup>RightHand</linkedBodyPartsGroup>
					<surpriseAttack>
						<extraMeleeDamages>
							<li>
								<def>Stun</def>
								<amount>22</amount>
							</li>
						</extraMeleeDamages>
					</surpriseAttack>
					<armorPenetrationSharp>0.05</armorPenetrationSharp>
					<armorPenetrationBlunt>0.25</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>teeth</label>
					<capacities>
						<li>ZombieBite</li>
					</capacities>
					<power>4</power>
					<cooldownTime>4</cooldownTime>
					<linkedBodyPartsGroup>Teeth</linkedBodyPartsGroup>
					<armorPenetrationSharp>0.25</armorPenetrationSharp>
					<armorPenetrationBlunt>0.5</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ===== Zombie Spitter ===== -->

	<Operation Class="PatchOperationConditional">
		<xpath>Defs/BodyDef[defName="ZombieSpitterBody"]/corePart/groups</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="ZombieSpitterBody"]/corePart</xpath>
			<value>
				<groups>
					<li>CoveredByNaturalArmor</li>
				</groups>
			</value>
		</nomatch>
		<match Class="PatchOperationAdd">
			<xpath>Defs/BodyDef[defName="ZombieSpitterBody"]/corePart/groups</xpath>
			<value>
				<li>CoveredByNaturalArmor</li>
			</value>
		</match>
	</Operation>

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

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

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

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

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

	<!-- ===== Misc Stuff ===== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Chainsaw"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>blade</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>4</power>
					<cooldownTime>0.25</cooldownTime>
					<armorPenetrationSharp>0.5</armorPenetrationSharp>
				</li>
			</tools>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="ElectricalField"]</xpath>
		<value>
			<statBases>
				<Bulk>0</Bulk>
				<Mass>0</Mass>
			</statBases>
		</value>
	</Operation>

</Patch>