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

	<!--Backpack-->

<Operation Class="PatchOperationAdd">
	<xpath>Defs/PawnKindDef[
		defName="RB_Wanderer" or
		defName="RB_SubOfficer" or
		defName="RB_EliteOfficer" or
		defName="RB_FSniper" or
		defName="RB_FMachinegunner"
		]/apparelRequired </xpath>
	<value>
		<li>CE_Apparel_Backpack</li>
	</value>
</Operation>

<!--Regular-->

<Operation Class="PatchOperationAddModExtension">
	<xpath>Defs/PawnKindDef[defName="RB_EnergySupply" or
		defName="RB_Technician" or
		defName="RB_Worker" or
		defName="RB_Wanderer" or
		defName="RB_SubOfficer" or
		defName="RB_EliteOfficer"
		] </xpath>
	<value>
		<li Class="CombatExtended.LoadoutPropertiesExtension">
			<primaryMagazineCount>
				<min>2</min>
				<max>3</max>
			</primaryMagazineCount>
			<sidearms>
				<li>
					<generateChance>0.2</generateChance>
					<sidearmMoney>
						<min>20</min>
						<max>120</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm_Melee</li>
					</weaponTags>
				</li>
			</sidearms>
		</li>
	</value>
</Operation>

<!--Military-->

<Operation Class="PatchOperationAddModExtension">
	<xpath>Defs/PawnKindDef[defName="RB_FRifle"]</xpath>
	<value>
		<li Class="CombatExtended.LoadoutPropertiesExtension">
			<primaryMagazineCount>
				<min>6</min>
				<max>8</max>
			</primaryMagazineCount>
			<sidearms>
				<li>
					<generateChance>1</generateChance>
					<sidearmMoney>
						<min>50</min>
						<max>200</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm_Melee</li>
					</weaponTags>
				</li>
			</sidearms>
		</li>
	</value>
</Operation>

<Operation Class="PatchOperationAddModExtension">
	<xpath>Defs/PawnKindDef[defName="RB_FSniper"]</xpath>
	<value>
		<li Class="CombatExtended.LoadoutPropertiesExtension">
			<primaryMagazineCount>
				<min>3</min>
				<max>5</max>
			</primaryMagazineCount>
			<sidearms>
				<li>
					<generateChance>1</generateChance>
					<sidearmMoney>
						<min>60</min>
						<max>150</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm_Melee</li>
					</weaponTags>
				</li>
				<li>
					<generateChance>0.5</generateChance>
					<sidearmMoney>
						<min>50</min>
						<max>250</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm</li>
					</weaponTags>
				</li>
			</sidearms>
		</li>
	</value>
</Operation>

<Operation Class="PatchOperationAddModExtension">
	<xpath>Defs/PawnKindDef[defName="RB_FMachinegunner"]</xpath>
	<value>
		<li Class="CombatExtended.LoadoutPropertiesExtension">
			<primaryMagazineCount>
				<min>4</min>
				<max>6</max>
			</primaryMagazineCount>
			<sidearms>
				<li>
					<generateChance>1</generateChance>
					<sidearmMoney>
						<min>50</min>
						<max>200</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm_Melee</li>
					</weaponTags>
				</li>
			</sidearms>
		</li>
	</value>
</Operation>

<!--Replace minigun with MG Catergory-->

<Operation Class="PatchOperationReplace">
	<xpath>Defs/PawnKindDef[defName="RB_FMachinegunner"]/weaponTags</xpath>
	<value>
		<weaponTags>
			<li>CE_MachineGun</li>
		</weaponTags>
	</value>
</Operation>

<Operation Class="PatchOperationReplace">
	<xpath>Defs/PawnKindDef[defName="RB_FMachinegunner"]/weaponMoney</xpath>
	<value>
		<weaponMoney>
			<min>500</min>
			<max>600</max>
		</weaponMoney>
	</value>
</Operation>

<Operation Class="PatchOperationAddModExtension">
	<xpath>Defs/PawnKindDef[defName="RB_FSapper"]</xpath>
	<value>
		<li Class="CombatExtended.LoadoutPropertiesExtension">
			<primaryMagazineCount>
				<min>10</min>
				<max>30</max>
			</primaryMagazineCount>
			<shieldMoney>
				<min>200</min>
				<max>600</max>
			</shieldMoney>
			<shieldTags>
				<li>OutlanderShield</li>
			</shieldTags>
			<shieldChance>0.5</shieldChance>
			<forcedSidearm>
				<sidearmMoney>
					<min>150</min>
					<max>350</max>
				</sidearmMoney>
				<weaponTags>
					<li>CE_Sidearm</li>
				</weaponTags>
				<magazineCount>
					<min>0</min>
					<max>1</max>
				</magazineCount>
			</forcedSidearm>
		</li>
	</value>
</Operation>

<!--Advanced-->

<Operation Class="PatchOperationAddModExtension">
	<xpath>Defs/PawnKindDef[defName="RB_RGunner"]</xpath>
	<value>
		<li Class="CombatExtended.LoadoutPropertiesExtension">
			<primaryMagazineCount>
				<min>6</min>
				<max>8</max>
			</primaryMagazineCount>
			<sidearms>
				<li>
					<generateChance>0.5</generateChance>
					<sidearmMoney>
						<min>120</min>
						<max>500</max>
					</sidearmMoney>
					<weaponTags>
						<li>CE_Sidearm_Melee</li>
					</weaponTags>
				</li>
			</sidearms>
		</li>
	</value>
</Operation>

</Patch>