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

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[@Name="DankPyon_BaseTrebuchetBuilding"]/thingClass</xpath>
		<value>
			<thingClass>CombatExtended.Building_TurretGunCE</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Turret_Trebuchet"]/building</xpath>
		<value>
			<spawnedConceptLearnOpportunity>CE_MortarDirectFire</spawnedConceptLearnOpportunity>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[@Name="DankPyon_BaseTrebuchetBuilding"]/statBases</xpath>
		<value>
			<SightsEfficiency>0.5</SightsEfficiency>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="DankPyon_Artillery_Trebuchet"]/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>1</magazineSize>
				<reloadTime>14</reloadTime>
				<ammoSet>AmmoSet_Trebuchet</ammoSet>
			</li>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Artillery_Trebuchet"]/building/fixedStorageSettings/filter/categories/li</xpath>
		<value>
			<li>AmmoCatapult</li>
		</value>
	</Operation>
	
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Artillery_Trebuchet"]/building/defaultStorageSettings/filter/categories/li</xpath>
		<value>
			<li>AmmoCatapult</li>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="DankPyon_Artillery_Trebuchet"]/verbs</xpath>
		<value>
			<verbs>
				<li Class="CombatExtended.VerbPropertiesCE">
					<verbClass>CombatExtended.Verb_ShootMortarCE</verbClass>
					<forceNormalTimeSpeed>false</forceNormalTimeSpeed>
					<hasStandardCommand>true</hasStandardCommand>
					<defaultProjectile>Projectile_CatapultBullet_Boulder</defaultProjectile>
					<warmupTime>4</warmupTime>
					<minRange>30</minRange>
					<range>500</range>
					<burstShotCount>1</burstShotCount>
					<soundCast>Bow_Recurve</soundCast>
					<muzzleFlashScale>0</muzzleFlashScale>
					<indirectFirePenalty>0.2</indirectFirePenalty>
					<targetParams>
						<canTargetLocations>true</canTargetLocations>
					</targetParams>
				</li>
			</verbs>
		</value>
	</Operation>

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

	<Operation Class="PatchOperationRemove">
		<xpath>Defs/RecipeDef[defName="DankPyon_MakeBullet_StoneBoulder" or defName="DankPyon_MakeBullet_StoneBoulderBulk" or defName="DankPyon_MakeBullet_StoneBoulderTarred" or defName="DankPyon_MakeBullet_StoneBoulderTarredBulk"]</xpath>
	</Operation>

</Patch>