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

	<!--Light-->
	
	<!--Pack-->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Apparel_MAU_PackTurret"]/statBases</xpath>
		<value>
			<Bulk>10</Bulk>
			<WornBulk>2</WornBulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Apparel_MAU_PackTurret"]/verbs</xpath>
		<value>
			<verbs>
				<li Class="CombatExtended.VerbPropertiesCE">
					<label>deploy turret</label>
					<verbClass>CombatExtended.Verb_ShootCEOneUseStatic</verbClass>
					<hasStandardCommand>true</hasStandardCommand>
					<onlyManualCast>True</onlyManualCast>
					<warmupTime>1</warmupTime>
					<range>25</range>
					<soundCast>ThrowGrenade</soundCast>
					<targetParams>
						<canTargetPawns>false</canTargetPawns>
						<canTargetBuildings>false</canTargetBuildings>
						<canTargetLocations>true</canTargetLocations>
					</targetParams>
					<defaultProjectile>Grenade_MAU_TurretPack</defaultProjectile>
					<rangedFireRulepack>Combat_RangedFire_Thrown</rangedFireRulepack>
				</li>
			</verbs>
		</value>
	</Operation>
	
	<!--Projectile-->

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Grenade_MAU_TurretPack"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.ProjectileCE_SpawnsThing</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Grenade_MAU_TurretPack"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<dropsCasings>false</dropsCasings>
				<dangerFactor>0</dangerFactor>
				<airborneSuppressionFactor>0</airborneSuppressionFactor>
				<speed>12</speed>
				<spawnsThingDef>Turret_MAU_TacticalTurret</spawnsThingDef>
			</projectile>
		</value>
	</Operation>
	
	<!--Building-->
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_MAU_TacticalTurret"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Turret_MAU_TacticalTurret"]/statBases</xpath>
		<value>
			<AimingAccuracy>0.25</AimingAccuracy>
			<NightVisionEfficiency>0.5</NightVisionEfficiency>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_MAU_TacticalTurret"]/statBases/Mass</xpath>
		<value>
			<Mass>25</Mass>
			<Bulk>15</Bulk>
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Turret_MAU_TacticalTurret"]/comps/li[@Class="CompProperties_Explosive"]</xpath>
	</Operation>

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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Turret_MAU_TacticalTurret"]/building/turretBurstCooldownTime</xpath>
		<value>
			<turretBurstCooldownTime>1.0</turretBurstCooldownTime>
		</value>
	</Operation>
	
	<!--Gun-->
	
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_MAU_TacticalTurret</defName>
		<statBases>
			<RangedWeapon_Cooldown>0.36</RangedWeapon_Cooldown>
			<SightsEfficiency>1</SightsEfficiency>
			<ShotSpread>0.11</ShotSpread>
			<SwayFactor>0.75</SwayFactor>
		</statBases>
		<Properties>
			<recoilAmount>1.39</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_6x24mmCharged</defaultProjectile>
			<warmupTime>0.8</warmupTime>
			<range>31</range>
			<ticksBetweenBurstShots>4</ticksBetweenBurstShots>
			<burstShotCount>6</burstShotCount>
			<soundCast>MU_Shot_CTL</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<muzzleFlashScale>9</muzzleFlashScale>
			<recoilPattern>Mounted</recoilPattern>
		</Properties>
		<AmmoUser>
			<magazineSize>60</magazineSize>
			<reloadTime>7.8</reloadTime>
			<ammoSet>AmmoSet_6x24mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aiAimMode>AimedShot</aiAimMode>
			<noSnapshot>true</noSnapshot>
			<noSingleShot>true</noSingleShot>
		</FireModes>
	</Operation>
	
</Patch>

