<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!-- ============== Changing Projectile's thingClass to CE ones ================ -->

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Bast_ScireFireBall" or
			defName="Bast_Web" or
			defName="Bast_AlluviumGoo" or
			defName="Bast_CritterSpike" or
			defName="Bast_BlisteringWind" or
			defName="Bast_LightningBolt" or
			defName="Bast_SnippingSnailAcid"] </xpath>
		<value>
			<thingClass>CombatExtended.BulletCE</thingClass>
		</value>
	</Operation>

	<!-- ============== Adding 'Standard' AimingAccuracy node to creatures' that use ranged attack statBases. =============== -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Bast_Scire" or
			defName="Bast_Alluvium" or defName="Bast_Snipping_Snail" or defName="Bast_Soul_Eater" or defName="Bast_LightningBolt"]/statBases </xpath>
		<value>
			<AimingAccuracy>0.7</AimingAccuracy>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Bast_Critter" or defName="Bast_Gray_Terror"]/statBases</xpath>
		<value>
			<AimingAccuracy>0.3</AimingAccuracy>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="Bast_Steves Animals" or defName="Bast_Blazing_Felidae" or defName="Bast_Svarog"]/statBases</xpath>
		<value>
			<ShootingAccuracyPawn>2</ShootingAccuracyPawn>
			<AimingAccuracy>1</AimingAccuracy>
		</value>
	</Operation>

	<!-- =============== Now defining Projectiles in CE Procedure ============= -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bast_LightningBolt"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<flyOverhead>false</flyOverhead>
				<damageDef>Bast_Electric</damageDef>
				<damageAmountBase>8</damageAmountBase>
				<stoppingPower>0.5</stoppingPower>
				<speed>30</speed>
				<armorPenetrationSharp>50</armorPenetrationSharp>
				<armorPenetrationBlunt>0.01</armorPenetrationBlunt>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bast_SnippingSnailAcid"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<flyOverhead>false</flyOverhead>
				<damageDef>Bast_AcidStream</damageDef>
				<damageAmountBase>3</damageAmountBase>
				<speed>12</speed>
				<armorPenetrationSharp>2</armorPenetrationSharp>
				<armorPenetrationBlunt>0.25</armorPenetrationBlunt>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bast_CritterSpike"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<flyOverhead>false</flyOverhead>
				<damageDef>Cut</damageDef>
				<damageAmountBase>6</damageAmountBase>
				<speed>14</speed>
				<armorPenetrationSharp>0.4</armorPenetrationSharp>
				<armorPenetrationBlunt>0.2</armorPenetrationBlunt>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bast_AlluviumGoo"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<flyOverhead>false</flyOverhead>
				<damageDef>Blunt</damageDef>
				<damageAmountBase>2</damageAmountBase>
				<speed>8</speed>
				<armorPenetrationBlunt>6</armorPenetrationBlunt>
				<secondaryDamage>
					<li>
						<def>Stun</def>
						<amount>10</amount>
					</li>
				</secondaryDamage>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bast_ScireFireBall"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<flyOverhead>false</flyOverhead>
				<damageDef>Flame</damageDef>
				<damageAmountBase>1</damageAmountBase>
				<armorPenetrationSharp>3</armorPenetrationSharp>
				<speed>16</speed>
			</projectile>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bast_Web"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<flyOverhead>false</flyOverhead>
				<damageDef>Blunt</damageDef>
				<damageAmountBase>2</damageAmountBase>
				<speed>14</speed>
				<armorPenetrationBlunt>4</armorPenetrationBlunt>
				<secondaryDamage>
					<li>
						<def>Stun</def>
						<amount>8</amount>
					</li>
				</secondaryDamage>
			</projectile>
		</value>
	</Operation>
</Patch>