package Items
using RTDB, BaseStats, Perks, Prereqs

[ notQueryable ]
KiroshiOpticsBaseFragment : Fragment
{
	buyPrice += 
	[
		"Price.OpticsFragment"
	];
	sellPrice += 
	[
		"Price.OpticsFragment"
	];
	fk< ParentAttachmentType > parentAttachmentType = "ParentAttachmentType.Slot";
	iconPath = "eye_kiroshi_optics";
	placementSlots = 
	[
		"AttachmentSlots.KiroshiOpticsSlot1", "AttachmentSlots.KiroshiOpticsSlot2", "AttachmentSlots.KiroshiOpticsSlot3"
	];
	CName[] tags += 
	[
		"itemPart", "DummyPart", "SkipActivityLog", "HideInBackpackUI", "HideInUI", "HideAtVendor"
	];
	bool isSingleInstance = false;
	bool isPart = true;
}

[ notQueryable ]
KiroshiOpticsFragment1 : KiroshiOpticsBaseFragment
{
	displayName = "LocKey#40884";
	localizedDescription = "LocKey#40885";
	quality = "Quality.Rare";
	iconPath = "cwf_kiroshioptics1";
	statModifiers += 
	[
		{
			statType = "BaseStats.ItemRequiresSmartLink";
			modifierType = "Additive";
			value = 1;
		} : ConstantStatModifier
	];
	OnEquip = 
	[
		{
			effectors = 
			[
				{
					prereqRecord = "Prereqs.SmartWeaponHeldPrereq";
					statGroup = 
					{
						statModifiers = 
						[
							{
								statType = "BaseStats.HeadshotDamageMultiplier";
								modifierType = "Multiplier";
								value = 0f;
							} : ConstantStatModifier, 
							{
								modifierType = "Multiplier";
								value = 3f;
							} : SmartGunTrackLegComponentsModifier, 
							{
								modifierType = "Multiplier";
								value = 2f;
							} : SmartGunTrackChestComponentsModifier
						];
					};
				} : ApplyStatGroupOnWeapon, 
				{
					prereqRecord = "Prereqs.SmartWeaponHeldPrereq";
					statGroup = 
					{
						statModifiers = 
						[
							{
								statType = "BaseStats.HasKiroshiOpticsFragment";
								modifierType = "Additive";
								value = 1f;
							} : ConstantStatModifier
						];
					};
				} : ApplyStatGroupOnPlayer, 
				{
					prereqRecord = "Prereqs.PreProcessHitTriggered";
					hitFlag = "Nonlethal";
				} : AddHitFlagToAttackEffector
			];
			UIData = 
			{
				localizedDescription = "LocKey#40886";
			};
		}
	];
	fk< CraftingPackage > CraftingData = 
	{
		fk< RecipeElement >[] craftingRecipe += 
		[
			{
				ingredient = "Items.UncommonMaterial1";
				amount = 20;
			}, 
			{
				ingredient = "Items.RareMaterial1";
				amount = 15;
			}
		];
	};
}

[ notQueryable ]
KiroshiOpticsFragment2 : KiroshiOpticsBaseFragment
{
	displayName = "LocKey#40887";
	localizedDescription = "LocKey#40888";
	quality = "Quality.Uncommon";
	iconPath = "cwf_kiroshioptics2";
	fk< CraftingPackage > CraftingData = 
	{
		fk< RecipeElement >[] craftingRecipe += 
		[
			{
				ingredient = "Items.CommonMaterial1";
				amount = 20;
			}, 
			{
				ingredient = "Items.UncommonMaterial1";
				amount = 15;
			}
		];
	};
	OnEquip = 
	[
		{
			stats = 
			[
				{
					statType = "BaseStats.CanSeeGrenadeRadius";
					modifierType = "Additive";
					value = 1f;
				} : ConstantStatModifier
			];
			UIData = 
			{
				localizedDescription = "LocKey#40889";
			};
		}
	];
}

[ notQueryable ]
KiroshiOpticsFragment3 : KiroshiOpticsFragment1
{
}

[ notQueryable ]
KiroshiOpticsFragment4 : KiroshiOpticsBaseFragment
{
	displayName = "LocKey#43403";
	localizedDescription = "LocKey#40891";
	quality = "Quality.Rare";
	iconPath = "cwf_kiroshioptics4";
	OnEquip = 
	[
		{
			stats = 
			[
				{
					statType = "BaseStats.HasAutomaticTagging";
					modifierType = "Additive";
					value = 1f;
				} : ConstantStatModifier
			];
			UIData = 
			{
				localizedDescription = "LocKey#43407";
			};
		}
	];
	fk< CraftingPackage > CraftingData = 
	{
		fk< RecipeElement >[] craftingRecipe += 
		[
			{
				ingredient = "Items.UncommonMaterial1";
				amount = 20;
			}, 
			{
				ingredient = "Items.RareMaterial1";
				amount = 15;
			}
		];
	};
}

[ notQueryable ]
KiroshiOpticsFragment5 : KiroshiOpticsBaseFragment
{
	displayName = "LocKey#43406";
	localizedDescription = "LocKey#43404";
	quality = "Quality.Legendary";
	iconPath = "cwf_kiroshioptics5";
	OnEquip = 
	[
		{
			stackable = true;
			effectors = 
			[
				{
					prereqRecord = "Prereqs.RangedWeaponHeldPrereq";
					statGroup = 
					{
						statModifiers = 
						[
							{
								statType = "BaseStats.HeadshotDamageMultiplier";
								modifierType = "Additive";
								value = 0.25f;
							} : ConstantStatModifier
						];
					};
				} : ApplyStatGroupOnWeapon
			];
			UIData = 
			{
				localizedDescription = "LocKey#43405";
				intValues = 
				[
					25
				];
			};
		}
	];
	fk< CraftingPackage > CraftingData = 
	{
		fk< RecipeElement >[] craftingRecipe += 
		[
			{
				ingredient = "Items.RareMaterial1";
				amount = 20;
			}, 
			{
				ingredient = "Items.EpicMaterial1";
				amount = 15;
			}, 
			{
				ingredient = "Items.LegendaryMaterial1";
				amount = 5;
			}
		];
	};
}

[ notQueryable ]
KiroshiOpticsFragment6 : KiroshiOpticsBaseFragment
{
	displayName = "LocKey#43408";
	localizedDescription = "LocKey#43409";
	quality = "Quality.Uncommon";
	iconPath = "cwf_kiroshioptics6";
	OnEquip = 
	[
		{
			stackable = true;
			stats = 
			[
				{
					statType = "BaseStats.CritChance";
					modifierType = "Additive";
					value = 2f;
				} : ConstantStatModifier
			];
			UIData = 
			{
				localizedDescription = "LocKey#43410";
				intValues = 
				[
					2
				];
			};
		}
	];
	fk< CraftingPackage > CraftingData = 
	{
		fk< RecipeElement >[] craftingRecipe += 
		[
			{
				ingredient = "Items.CommonMaterial1";
				amount = 20;
			}, 
			{
				ingredient = "Items.UncommonMaterial1";
				amount = 15;
			}
		];
	};
}

[ notQueryable ]
KiroshiOpticsFragment7 : KiroshiOpticsBaseFragment
{
	fk< ItemType > itemType = "ItemType.Prt_HandgunMod";
	displayName = "LocKey#89192";
	iconPath = "Mod_Pyro";
	quality = "Quality.Rare";
	tags += 
	[
		"DummyPart", "HideInBackpackUI", "HideAtVendor", "SkipActivityLog"
	];
	OnLooted = 
	[
		{
			items = 
			[
				{
					item = "Items.HGMod2_Rare";
				}
			];
		}
	];
	statModifiers += 
	[
		{
			statType = "BaseStats.HGMod2_CritChance";
			modifierType = "Additive";
			id = "weapon_mods";
			column = "hgmod2_critchance";
			refStat = "BaseStats.Quality";
		} : CurveStatModifier, 
		{
			statType = "BaseStats.HGMod2_Spread";
			modifierType = "Additive";
			id = "weapon_mods";
			column = "hgmod2_spread";
			refStat = "BaseStats.Quality";
		} : CurveStatModifier, 
		{
			statType = "BaseStats.HGMod2_Swap";
			modifierType = "Additive";
			id = "weapon_mods";
			column = "hgmod2_swap";
			refStat = "BaseStats.Quality";
		} : CurveStatModifier
	];
	OnAttach = 
	[
		{
			UIData = 
			{
				localizedDescription = "LocKey#89213";
				stats = 
				[
					"BaseStats.HGMod2_CritChance", "BaseStats.HGMod2_Spread", "BaseStats.HGMod2_Swap"
				];
				floatValues = 
				[
					5
				];
			};
		}
	];
}

