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

	<!-- ========== Patch mech raid delay and Centipede spawn weight ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/FactionDef[defName="Mechanoid"]/earliestRaidDays</xpath>
		<value>
			<earliestRaidDays>60</earliestRaidDays>
		</value>
	</Operation>

	<!-- ========== Allow mechanoid faction to use ImmediateAttackSmart ========== -->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/FactionDef[defName="Mechanoid"]/canUseAvoidGrid</xpath>
		<value>
			<canUseAvoidGrid>true</canUseAvoidGrid>
		</value>
	</Operation>

	<!-- ========== Remove Smoke grenadiers ========== -->

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/FactionDef[defName="OutlanderFactionBase" or defName="Pirate"]/pawnGroupMakers/li/*/Grenadier_Smoke</xpath>
	</Operation>

	<!-- ========== Add tribal grenadies ========== -->

	<Operation Class="PatchOperationAdd"><!-- Combat -->
		<xpath>Defs/FactionDef[@Name="TribeBase"]/pawnGroupMakers/li[1]/options</xpath>
		<value>
			<CE_Tribal_Grenadier>10</CE_Tribal_Grenadier>
			<CE_Tribal_Gunner>5</CE_Tribal_Gunner>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd"><!-- Combat -->
		<xpath>Defs/FactionDef[@Name="TribeBase"]/pawnGroupMakers/li[2]/options</xpath>
		<value>
			<CE_Tribal_Grenadier>5</CE_Tribal_Grenadier>
			<CE_Tribal_Gunner>10</CE_Tribal_Gunner>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd"><!-- Breach -->
		<xpath>Defs/FactionDef[@Name="TribeBase"]/pawnGroupMakers/li[4]/options</xpath>
		<value>
			<CE_Tribal_Grenadier>10</CE_Tribal_Grenadier>
			<CE_Tribal_Gunner>10</CE_Tribal_Gunner>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd"><!-- Peaceful -->
		<xpath>Defs/FactionDef[@Name="TribeBase"]/pawnGroupMakers/li[5]/options</xpath>
		<value>
			<CE_Tribal_Grenadier>10</CE_Tribal_Grenadier>
			<CE_Tribal_Gunner>5</CE_Tribal_Gunner>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd"><!-- Trader -->
		<xpath>Defs/FactionDef[@Name="TribeBase"]/pawnGroupMakers/li[6]/guards</xpath>
		<value>
			<CE_Tribal_Grenadier>5</CE_Tribal_Grenadier>
			<CE_Tribal_Gunner>15</CE_Tribal_Gunner>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd"><!-- Settlement -->
		<xpath>Defs/FactionDef[@Name="TribeBase"]/pawnGroupMakers/li[7]/options</xpath>
		<value>
			<CE_Tribal_Grenadier>10</CE_Tribal_Grenadier>
			<CE_Tribal_Gunner>10</CE_Tribal_Gunner>
		</value>
	</Operation>

</Patch>