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

	<!-- === Tear Gas Grenade === -->
	<!-- == Projectile == -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VWENL_Projectile_TearGasGrenade"]</xpath>
		<value>
			<thingClass>CombatExtended.ProjectileCE_Explosive</thingClass>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="VWENL_Projectile_TearGasGrenade"]/projectile</xpath>
		<value>
			<projectile Class="CombatExtended.ProjectilePropertiesCE">
				<damageDef>Smoke</damageDef>
				<explosionRadius>3.9</explosionRadius>
				<explosionDelay>100</explosionDelay>
				<dropsCasings>true</dropsCasings>
				<flyOverhead>false</flyOverhead>
				<soundExplode>DispensePaste</soundExplode>
				<postExplosionSpawnThingDef>VWENL_TearGasCloud</postExplosionSpawnThingDef>
				<postExplosionSpawnChance>1</postExplosionSpawnChance>
				<postExplosionSpawnThingCount>1</postExplosionSpawnThingCount>
				<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
				<casingMoteDefname>Fleck_GrenadePin</casingMoteDefname>
				<casingFilthDefname>Filth_GrenadeAmmoCasings</casingFilthDefname>
			</projectile>
		</value>
	</Operation>

	<!-- == Grenade == -->
	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="VWE_TearGasGrenade"]</xpath>
		<value>
			<thingClass>CombatExtended.AmmoThing</thingClass>
			<stackLimit>75</stackLimit>
			<resourceReadoutPriority>First</resourceReadoutPriority>
		</value>
	</Operation>

	<Operation Class="PatchOperationAttributeSet">
		<xpath>Defs/ThingDef[defName="VWE_TearGasGrenade"]</xpath>
		<attribute>Class</attribute>
		<value>CombatExtended.AmmoDef</value>
	</Operation>

	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>VWE_TearGasGrenade</defName>
		<statBases>
			<Mass>1</Mass>
			<SightsEfficiency>1</SightsEfficiency>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
		</statBases>
		<Properties>
			<label>throw tear gas</label>
			<verbClass>CombatExtended.Verb_ShootCEOneUse</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>VWENL_Projectile_TearGasGrenade</defaultProjectile>
			<range>12</range>
			<warmupTime>1.8</warmupTime>
			<soundCast>ThrowGrenade</soundCast>
			<noiseRadius>4</noiseRadius>
			<ai_IsBuildingDestroyer>false</ai_IsBuildingDestroyer>
			<onlyManualCast>true</onlyManualCast>
			<ignorePartialLoSBlocker>true</ignorePartialLoSBlocker>
			<targetParams>
				<canTargetLocations>true</canTargetLocations>
			</targetParams>
		</Properties>
		<weaponTags>
			<li>CE_OneHandedWeapon</li>
		</weaponTags>
	</Operation>

</Patch>