<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!-- Mod Support for Combat Extended -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Ad_Artillery_Mortar"]</xpath>
		<value>
			<statBases>
				<SightsEfficiency>0.7</SightsEfficiency>
			</statBases>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Ad_Artillery_Mortar"]/comps</xpath>
		<value>
			<li Class="CombatExtended.CompProperties_Charges">
				<chargeSpeeds>
					<li>30</li>
					<li>50</li>
					<li>70</li>
					<li>90</li>
				</chargeSpeeds>
			</li>
			<li Class="CombatExtended.CompProperties_AmmoUser">
				<magazineSize>3</magazineSize>
				<reloadTime>5</reloadTime>
				<ammoSet>AmmoSet_81mmMortarShell</ammoSet>
			</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Ad_Artillery_Mortar"]/weaponTags</xpath>
		<value>
			<li>TurretGun</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Ad_Artillery_Mortar"]/verbs</xpath>
		<value>
			<verbs>
				<li Class="CombatExtended.VerbPropertiesCE">
					<verbClass>CombatExtended.Verb_ShootMortarCE</verbClass>
					<forceNormalTimeSpeed>false</forceNormalTimeSpeed>
					<hasStandardCommand>true</hasStandardCommand>
					<defaultProjectile>Bullet_81mmMortarShell_HE</defaultProjectile>
					<warmupTime>4.0</warmupTime>
					<minRange>32</minRange>
					<range>800</range>
					<burstShotCount>3</burstShotCount>
					<soundCast>Mortar_LaunchA</soundCast>
					<muzzleFlashScale>16</muzzleFlashScale>
					<circularError>1</circularError>
					<indirectFirePenalty>0.2</indirectFirePenalty>
					<targetParams>
						<canTargetLocations>true</canTargetLocations>
					</targetParams>
				</li>
			</verbs>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Ad_Artillery_Mortar"]/label</xpath>
		<value>
			<label>81mm improved mortar</label>
		</value>
	</Operation>

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/ThingDef[defName="Ad_Turret_Mortar"]/comps</xpath>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Ad_Turret_Mortar"]/tradeTags</xpath>
		<value>
			<li>CE_Turret</li>
		</value>
	</Operation>
</Patch>