<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<Operation Class="PatchOperationInsert">
		<xpath>Defs/ThingCategoryDef[defName="AmmoGreatArrows"]</xpath>
		<value>
			<!-- ==== Ammo ==== -->
			<ThingCategoryDef>
				<defName>AmmoBlackWidowArrows</defName>
				<label>black widow arrows</label>
				<parent>AmmoNeolithic</parent>
				<iconPath>UI/Icons/ThingCategories/CaliberArrow</iconPath>
			</ThingCategoryDef>
			<!-- ==================== AmmoSet ========================== -->
			<CombatExtended.AmmoSetDef>
				<defName>AmmoSet_BlackWidowArrow</defName>
				<label>black widow arrows</label>
				<ammoTypes>
					<Ammo_BlackWidowArrow_Steel>Projectile_BlackWidowArrow_Steel</Ammo_BlackWidowArrow_Steel>
					<Ammo_BlackWidowArrow_Plasteel>Projectile_BlackWidowArrow_Plasteel</Ammo_BlackWidowArrow_Plasteel>
				</ammoTypes>
			</CombatExtended.AmmoSetDef>
			<!-- ==================== Ammo ========================== -->
			<ThingDef Class="CombatExtended.AmmoDef" Name="AmmoBlackWidowArrowBase" ParentName="NeolithicAmmoBase" Abstract="True">
				<description>Special arrow designed by black widows for use in their bow.</description>
				<statBases>
					<Mass>0.2</Mass>
					<Bulk>0.2</Bulk>
					<Flammability>0.8</Flammability>
				</statBases>
				<thingCategories>
					<li>AmmoBlackWidowArrows</li>
				</thingCategories>
				<stackLimit>200</stackLimit>
				<tradeTags>
					<li>CE_AutoEnableTrade</li>
					<li>CE_AutoEnableCrafting_FueledSmithy</li>
					<li>CE_AutoEnableCrafting_ElectricSmithy</li>
				</tradeTags>
			</ThingDef>
			<ThingDef Class="CombatExtended.AmmoDef" ParentName="AmmoBlackWidowArrowBase">
				<defName>Ammo_BlackWidowArrow_Steel</defName>
				<label>black widow arrow (steel)</label>
				<graphicData>
					<texPath>Things/Ammo/Medieval/Bolt/Steel</texPath>
					<graphicClass>Graphic_StackCount</graphicClass>
				</graphicData>
				<ammoClass>SteelArrow</ammoClass>
			</ThingDef>
			<ThingDef Class="CombatExtended.AmmoDef" ParentName="AmmoBlackWidowArrowBase">
				<defName>Ammo_BlackWidowArrow_Plasteel</defName>
				<label>black widow arrow (plasteel)</label>
				<graphicData>
					<texPath>Things/Ammo/Medieval/Bolt/Plasteel</texPath>
					<graphicClass>Graphic_StackCount</graphicClass>
				</graphicData>
				<ammoClass>PlasteelArrow</ammoClass>
				<generateAllowChance>0.5</generateAllowChance>
			</ThingDef>
			<!-- ================== Projectiles ================== -->
			<ThingDef Class="CombatExtended.AmmoDef" Name="BaseBlackWidowArrowProjectile" ParentName="BaseBulletCE" Abstract="true">
				<graphicData>
					<texPath>Things/Projectile/Arrow_Small</texPath>
					<graphicClass>Graphic_Single</graphicClass>
				</graphicData>
				<projectile Class="CombatExtended.ProjectilePropertiesCE">
					<damageDef>Arrow</damageDef>
					<speed>30</speed>
				</projectile>
			</ThingDef>

			<ThingDef Class="CombatExtended.AmmoDef" ParentName="BaseBlackWidowArrowProjectile">
				<defName>Projectile_BlackWidowArrow_Steel</defName>
				<label>black widow arrow (steel)</label>
				<graphicData>
					<texPath>Things/Projectile/Arrows/Arrow_Steel</texPath>
					<graphicClass>Graphic_Single</graphicClass>
				</graphicData>
				<projectile Class="CombatExtended.ProjectilePropertiesCE">
					<damageAmountBase>20</damageAmountBase>
					<armorPenetrationBlunt>6.686</armorPenetrationBlunt>
					<armorPenetrationSharp>5.714</armorPenetrationSharp>
					<preExplosionSpawnChance>0.8</preExplosionSpawnChance>
					<preExplosionSpawnThingDef>Ammo_BlackWidowArrow_Steel</preExplosionSpawnThingDef>
				</projectile>
				<modExtensions>
					<li Class="ProjectileImpactFX.EffectProjectileExtension">
						<AutoAssign>false</AutoAssign>
						<CreateTerrainEffects>true</CreateTerrainEffects>
						<StuckProjectileFleckDef>Fleck_CELandedArrow_Steel</StuckProjectileFleckDef>
						<StuckProjectileFleckSize>0.65</StuckProjectileFleckSize>
					</li>
				</modExtensions>
			</ThingDef>

			<ThingDef Class="CombatExtended.AmmoDef" ParentName="BaseBlackWidowArrowProjectile">
				<defName>Projectile_BlackWidowArrow_Plasteel</defName>
				<label>black widow arrow (plasteel)</label>
				<graphicData>
					<texPath>Things/Projectile/Arrows/Arrow_Plasteel</texPath>
					<graphicClass>Graphic_Single</graphicClass>
				</graphicData>
				<projectile Class="CombatExtended.ProjectilePropertiesCE">
					<damageAmountBase>24</damageAmountBase>
					<armorPenetrationBlunt>8.56</armorPenetrationBlunt>
					<armorPenetrationSharp>12</armorPenetrationSharp>
					<preExplosionSpawnChance>0.9</preExplosionSpawnChance>
					<preExplosionSpawnThingDef>Ammo_BlackWidowArrow_Plasteel</preExplosionSpawnThingDef>
				</projectile>
				<modExtensions>
					<li Class="ProjectileImpactFX.EffectProjectileExtension">
						<AutoAssign>false</AutoAssign>
						<CreateTerrainEffects>true</CreateTerrainEffects>
						<StuckProjectileFleckDef>Fleck_CELandedArrow_Plasteel</StuckProjectileFleckDef>
						<StuckProjectileFleckSize>0.65</StuckProjectileFleckSize>
					</li>
				</modExtensions>
			</ThingDef>
			
			<!-- ==================== Recipes ========================== -->
			<RecipeDef ParentName="AmmoRecipeNeolithicBase">
				<defName>MakeAmmo_BlackWidowArrow_Steel</defName>
				<label>make steel black widow arrows x10</label>
				<description>Craft 10 steel black widow arrows.</description>
				<jobString>Making steel black widow arrows.</jobString>
				<ingredients>
					<li>
						<filter>
							<thingDefs>
								<li>WoodLog</li>
							</thingDefs>
						</filter>
						<count>4</count>
					</li>
					<li>
						<filter>
							<thingDefs>
								<li>Steel</li>
							</thingDefs>
						</filter>
						<count>3</count>
					</li>
				</ingredients>
				<fixedIngredientFilter>
					<thingDefs>
						<li>WoodLog</li>
						<li>Steel</li>
					</thingDefs>
				</fixedIngredientFilter>
				<products>
					<Ammo_BlackWidowArrow_Steel>10</Ammo_BlackWidowArrow_Steel>
				</products>
			</RecipeDef>
			<RecipeDef ParentName="AmmoRecipeNeolithicBase">
				<defName>MakeAmmo_BlackWidowArrow_Plasteel</defName>
				<label>make plasteel black widow arrows x10</label>
				<description>Craft 10 plasteel black widow arrows.</description>
				<jobString>Making plasteel black widow arrows.</jobString>
				<ingredients>
					<li>
						<filter>
							<thingDefs>
								<li>WoodLog</li>
							</thingDefs>
						</filter>
						<count>4</count>
					</li>
					<li>
						<filter>
							<thingDefs>
								<li>Plasteel</li>
							</thingDefs>
						</filter>
						<count>4</count>
					</li>
				</ingredients>
				<fixedIngredientFilter>
					<thingDefs>
						<li>WoodLog</li>
						<li>Plasteel</li>
					</thingDefs>
				</fixedIngredientFilter>
				<products>
					<Ammo_BlackWidowArrow_Plasteel>10</Ammo_BlackWidowArrow_Plasteel>
				</products>
			</RecipeDef>
		</value>
	</Operation>

	<!-- ==== Black Widow Rifle. ==== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Gun_BWRifle</defName>
		<statBases>
			<Mass>10</Mass>
			<RangedWeapon_Cooldown>0.35</RangedWeapon_Cooldown>
			<SightsEfficiency>1.1</SightsEfficiency>
			<ShotSpread>0.05</ShotSpread>
			<SwayFactor>2</SwayFactor>
			<Bulk>10</Bulk>
		</statBases>
		<Properties>
			<recoilAmount>0.73</recoilAmount>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Bullet_5x35mmCharged</defaultProjectile>
			<warmupTime>1</warmupTime>
			<range>59</range>
			<soundCast>ChargeLance_Fire</soundCast>
			<soundCastTail>GunTail_Medium</soundCastTail>
			<burstShotCount>5</burstShotCount>
			<ticksBetweenBurstShots>5</ticksBetweenBurstShots>
			<muzzleFlashScale>9</muzzleFlashScale>
		</Properties>
		<AmmoUser>
			<reloadTime>4</reloadTime><!-- ep... -->
			<magazineSize>20</magazineSize><!-- ...ic -->
			<ammoSet>AmmoSet_6x24mmCharged</ammoSet>
		</AmmoUser>
		<FireModes>
			<aimedBurstShotCount>3</aimedBurstShotCount>
			<aiUseBurstMode>TRUE</aiUseBurstMode>
			<aiAimMode>AimedShot</aiAimMode>
		</FireModes>
		<weaponTags>
			<li>BWRifle</li>
			<li>BlackWidowRanged</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Gun_BWRifle"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>stock</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<chanceFactor>1.5</chanceFactor>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>5</power>
					<cooldownTime>2.02</cooldownTime>
					<armorPenetrationBlunt>1.63</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>barrel</label>
					<capacities>
						<li>Poke</li>
					</capacities>
					<power>8</power>
					<cooldownTime>1.55</cooldownTime>
					<armorPenetrationBlunt>2.755</armorPenetrationBlunt>
					<linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ==== Black Widow Bow. ==== -->
	<Operation Class="CombatExtended.PatchOperationMakeGunCECompatible">
		<defName>Bow_BWBow</defName>
		<statBases>
			<Mass>8</Mass>
			<RangedWeapon_Cooldown>1</RangedWeapon_Cooldown>
			<SightsEfficiency>0.8</SightsEfficiency>
			<ShotSpread>0.8</ShotSpread>
			<SwayFactor>3</SwayFactor>
			<Bulk>7.5</Bulk>
		</statBases>
		<Properties>
			<verbClass>CombatExtended.Verb_ShootCE</verbClass>
			<hasStandardCommand>true</hasStandardCommand>
			<defaultProjectile>Projectile_BlackWidowArrow_Steel</defaultProjectile>
			<warmupTime>8.5</warmupTime>
			<range>54</range>
			<soundCast>Bow_Large</soundCast>
		</Properties>
		<AmmoUser>
			<ammoSet>AmmoSet_BlackWidowArrow</ammoSet>
			<AmmoGenPerMagOverride>5</AmmoGenPerMagOverride>
		</AmmoUser>
		<weaponTags>
			<li>BWBow</li>
			<li>BlackWidowRanged</li>
		</weaponTags>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="Bow_BWBow"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>upper blade</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>23</power>
					<cooldownTime>1.43</cooldownTime>
					<armorPenetrationSharp>0.16</armorPenetrationSharp>
					<armorPenetrationBlunt>1.563</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>lower blade</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>23</power>
					<cooldownTime>1.43</cooldownTime>
					<armorPenetrationSharp>0.16</armorPenetrationSharp>
					<armorPenetrationBlunt>1.563</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<!-- ==== Black Widow Scythe ==== -->
	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="MeleeWeapon_bwscythe"]/tools</xpath>
		<value>
			<tools>
				<li Class="CombatExtended.ToolCE">
					<label>hand guard</label>
					<capacities>
						<li>Blunt</li>
					</capacities>
					<power>1</power>
					<cooldownTime>1.26</cooldownTime>
					<armorPenetrationBlunt>0.25</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>hook</label>
					<capacities>
						<li>Stab</li>
					</capacities>
					<power>14</power>
					<cooldownTime>1.11</cooldownTime>
					<armorPenetrationSharp>2.82</armorPenetrationSharp>
					<armorPenetrationBlunt>1.688</armorPenetrationBlunt>
				</li>
				<li Class="CombatExtended.ToolCE">
					<label>edge</label>
					<capacities>
						<li>Cut</li>
					</capacities>
					<power>35</power>
					<cooldownTime>1.32</cooldownTime>
					<armorPenetrationSharp>1.5</armorPenetrationSharp>
					<armorPenetrationBlunt>3.375</armorPenetrationBlunt>
				</li>
			</tools>
		</value>
	</Operation>

	<Operation Class="PatchOperationAdd">
		<xpath>Defs/ThingDef[defName="MeleeWeapon_bwscythe"]/equippedStatOffsets</xpath>
		<value>
			<MeleeCritChance>0.25</MeleeCritChance>
			<MeleeParryChance>0.5</MeleeParryChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="MeleeWeapon_bwscythe"]/equippedStatOffsets/MeleeDodgeChance</xpath>
		<value>
			<MeleeDodgeChance>0.6</MeleeDodgeChance>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="MeleeWeapon_bwscythe"]/statBases/Mass</xpath>
		<value>
			<Mass>4</Mass>
			<Bulk>8</Bulk>
			<MeleeCounterParryBonus>0.54</MeleeCounterParryBonus>
		</value>
	</Operation>

	<Operation Class="PatchOperationReplace">
		<xpath>Defs/ThingDef[defName="MeleeWeapon_bwscythe" or defName="Bow_BWBow"]/stuffCategories</xpath>
		<value>
			<stuffCategories>
				<li>Metallic_Weapon</li>
			</stuffCategories>
		</value>
	</Operation>
</Patch>