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

	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>Rimsenal - Core</li>
			<li>Rimsenal: Murder diversified</li>
		</mods>
		<match Class="PatchOperationSequence">
			<operations>
				<!-- ==========  GD CQC Gun =========== -->
				
				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="GD_Amarok"]/tools</xpath>
					<value>
						<tools>
							<li Class="CombatExtended.ToolCE">
								<label>stock</label>
								<capacities>
									<li>Blunt</li>
								</capacities>
								<power>8</power>
								<cooldownTime>1.55</cooldownTime>
								<chanceFactor>1.5</chanceFactor>
								<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
								<linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
							</li>
							<li Class="CombatExtended.ToolCE">
								<label>barrel</label>
								<capacities>
									<li>Blunt</li>
								</capacities>
								<power>5</power>
								<cooldownTime>2.02</cooldownTime>
								<armorPenetrationBlunt>1.630</armorPenetrationBlunt>
								<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
							</li>
							<li Class="CombatExtended.ToolCE">
								<label>muzzle</label>
								<capacities>
									<li>Poke</li>
								</capacities>
								<power>8</power>
								<cooldownTime>1.55</cooldownTime>
								<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
								<linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
							</li>
						</tools>
					</value>
				</li>

				<li Class="CombatExtended.PatchOperationMakeGunCECompatible">
					<defName>GD_Amarok</defName>
					<statBases>
						<SightsEfficiency>1.1</SightsEfficiency>
						<ShotSpread>0.2</ShotSpread>
						<SwayFactor>1.57</SwayFactor>
						<Bulk>10.75</Bulk>
						<Mass>5.00</Mass>
						<RangedWeapon_Cooldown>0.39</RangedWeapon_Cooldown>
					</statBases>
					<Properties>
						<recoilAmount>2.99</recoilAmount>
						<verbClass>CombatExtended.Verb_ShootCE</verbClass>
						<hasStandardCommand>true</hasStandardCommand>
						<defaultProjectile>Bullet_132Greydale_FMJ</defaultProjectile>
						<warmupTime>1</warmupTime>
						<burstShotCount>5</burstShotCount>
						<ticksBetweenBurstShots>12</ticksBetweenBurstShots>
						<range>31</range>
						<soundCast>GunShotA</soundCast>
						<soundCastTail>GunTail_Heavy</soundCastTail>
						<muzzleFlashScale>0</muzzleFlashScale>
					</Properties>					
					<AmmoUser>
						<magazineSize>18</magazineSize>
						<reloadTime>4</reloadTime>
						<ammoSet>AmmoSet_132Greydale</ammoSet>
					</AmmoUser>
					<FireModes>
						<aimedBurstShotCount>3</aimedBurstShotCount>
						<aiAimMode>Snapshot</aiAimMode>
					</FireModes>
					<weaponTags>
						<li>CE_AI_AR</li>
					</weaponTags>
				</li>
				
				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="GD_Amarok"]/comps/li[@Class="CompProperties_EquippableAbilityReloadable"]/ammoDef</xpath>
					<value>
						<ammoDef>MSSKit</ammoDef>
					</value>
				</li>
				
				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="Grenade_MicroTurret"]/thingClass</xpath>
					<value>
						<thingClass>CombatExtended.ProjectileCE_SpawnsThing</thingClass>
					</value>
				</li>

				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="Grenade_MicroTurret"]/projectile</xpath>
					<value>
						<projectile Class="CombatExtended.ProjectilePropertiesCE">
							<dropsCasings>false</dropsCasings>
							<dangerFactor>0</dangerFactor>
							<airborneSuppressionFactor>0</airborneSuppressionFactor>
							<speed>12</speed>
							<spawnsThingDef>Turret_MicroTurret</spawnsThingDef>
						</projectile>
					</value>
				</li>
				
				<!-- ========== Micro-Turret ========== -->

				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="Turret_MicroTurret"]/thingClass</xpath>
					<value>
						<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
					</value>
				</li>

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[defName="Turret_MicroTurret"]/statBases</xpath>
					<value>
						<AimingAccuracy>0.25</AimingAccuracy>
					</value>
				</li>

				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="Turret_MicroTurret"]/statBases/ShootingAccuracyTurret</xpath>
					<value>
						<ShootingAccuracyTurret>0.5</ShootingAccuracyTurret>
					</value>
				</li>

				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="Turret_MicroTurret"]/fillPercent</xpath>
					<value>
						<fillPercent>0.85</fillPercent>
					</value>
				</li>

				<li Class="PatchOperationReplace">
					<xpath>Defs/ThingDef[defName="Turret_MicroTurret"]/building/turretBurstCooldownTime</xpath>
					<value>
						<turretBurstCooldownTime>0.38</turretBurstCooldownTime>
					</value>
				</li>
				
				<li Class="CombatExtended.PatchOperationMakeGunCECompatible">
					<defName>Gun_MicroTurret</defName>
					<statBases>
						<SightsEfficiency>1.0</SightsEfficiency>
						<ShotSpread>0.16</ShotSpread>
						<SwayFactor>0.40</SwayFactor>
						<Bulk>3.00</Bulk>
						<Mass>1.25</Mass>
						<RangedWeapon_Cooldown>0.39</RangedWeapon_Cooldown>
					</statBases>
					<Properties>
						<recoilAmount>2.26</recoilAmount>
						<verbClass>CombatExtended.Verb_ShootCE</verbClass>
						<hasStandardCommand>true</hasStandardCommand>
						<defaultProjectile>Bullet_66Greydale_FMJ_Pistol</defaultProjectile>
						<warmupTime>0.6</warmupTime>
						<burstShotCount>1</burstShotCount>
						<ticksBetweenBurstShots>1</ticksBetweenBurstShots>
						<range>18</range>
						<soundCast>GunShotA</soundCast>
						<soundCastTail>GunTail_Light</soundCastTail>
						<muzzleFlashScale>9</muzzleFlashScale>
						<recoilPattern>Mounted</recoilPattern>
					</Properties>
					<AmmoUser>
						<magazineSize>36</magazineSize>
						<reloadTime>4</reloadTime>
						<ammoSet>AmmoSet_66Greydale_Pistol</ammoSet>
					</AmmoUser>
					<FireModes>
						<aiAimMode>AimedShot</aiAimMode>
						<noSnapshot>true</noSnapshot>
					</FireModes>
				</li>

			</operations>
		</match>
	</Operation>
</Patch>
