package Items
using RTDB, BaseStats, WeaponFxPackage, Prereqs, Perks, Effectors

Preset_Grit_Default : Base_Grit
{
	CName appearanceResourceName = "Preset_Grit_Default";
	CName[] visualTags = 
	[
		"Default"
	];
	fk< SlotItemPartPreset >[] slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__mag_stdr";
		}, 
		{
			slot = "AttachmentSlots.Tech_Handgun_WeaponMod1";
		} : Tech_Handgun_ModList_Slot1, 
		{
			slot = "AttachmentSlots.Tech_Handgun_WeaponMod2";
		} : Tech_Handgun_ModList_Slot2
	];
}

Preset_Grit_Pimp : Preset_Grit_Default
{
	visualTags = 
	[
		"Pimp"
	];
	tags += 
	[
		"Pimp"
	];
}

Preset_Grit_Neon : Preset_Grit_Default
{
	visualTags = 
	[
		"Neon"
	];
	tags += 
	[
		"Neon"
	];
}

Preset_Grit_Military : Preset_Grit_Default
{
	visualTags = 
	[
		"Military"
	];
	tags += 
	[
		"Military"
	];
}

[ notQueryable ]
Preset_Grit_Legendary : Preset_Grit_Default
{
	CName[] visualTags = 
	[
		"Legendary"
	];
	tags += 
	[
		"Legendary"
	];
}

[ notQueryable ]
Preset_Grit_Prevention : Preset_Grit_Default
{
	CName[] visualTags = 
	[
		"Default"
	];
	statModifierGroups = 
	[
		"Items.QualityRandomization", "Items.ItemPlusRandomizer_MaxQuality", "Items.ItemPlusRandomizer_Below_MaxQuality", "Items.WeaponModsWeights_On_Tier2Plus", "Items.WeaponModsWeights_On_Tier3Plus", "Items.WeaponModsWeights_On_Tier4Plus", "Items.WeaponModsWeights_On_Tier5Plus", "Items.WeaponModsWeights_On_Tier5PlusPlus", "Items.Base_Grit_Krausser_Technical_Stats", "Items.Base_Grit_Handling_Stats", "Items.Base_Grit_Krausser_Recoil_Stats", "Items.Base_Grit_Spread_Stats", "Items.Base_Grit_Aim_Stats", "Items.Base_Grit_Krausser_Constant_Stats", "Items.KrausserBonusStats", "Items.Base_Grit_Damage_Stats", "Items.Base_Tech_Stats", "Items.Base_Tech_Handgun_Mult_Stats", "Items.Base_Handgun_RPG_Stats", "Items.Base_Handgun_Misc_Stats", "Items.Base_Handgun_Sway_Stats", "Items.Base_Handgun_DeadReckoning_Stats", "Items.Base_PlayerState_Spread_Stats", "Items.Base_Weapon_Damage_Type_Min_Max", "Items.Base_Weapon_Damage_Type_Physical"
	];
}

Preset_Grit_Krausser : Preset_Grit_Prevention
{
	CName[] visualTags = 
	[
		"Krausser"
	];
	tags += 
	[
		"Krausser", "PowerOfThePack", "IllegalItem"
	];
}

Base_Grit_Krausser_Technical_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			value = 1.f;
		} : NumShotsToFireModifier, 
		{
			value = 0.2f;
		} : CycleTimeModifier, 
		{
			value = 36.f;
		} : MagazineCapacityModifier, 
		{
			value = 1.f;
		} : ProjectilesPerShotModifier, 
		"BaseStats.ProjectilesPerShotCombinedModifier", {
			value = 0.1143f;
		} : CycleTime_BurstMaxChargeModifier, 
		{
			value = 1.f;
		} : NumShotsInBurstMaxChargeModifier, 
		{
			value = 1.5f;
		} : ChargeDischargeTimeModifier, 
		{
			value = 0.0f;
		} : ChargeMaxTimeInChargedStateModifier, 
		{
			value = 0.5f;
		} : ChargeReadyPercentageModifier, 
		{
			value = 2.0f;
		} : ChargeTimeModifier, 
		{
			value = 100.f;
		} : ChargeModifier, 
		{
			statType = "BaseStats.TechPierceEnabled";
			modifierType = "Additive";
			value = 1f;
		} : ConstantStatModifier, 
		{
			value = 0.2f;
		} : TechPierceChargeLevelModifier, 
		{
			statType = "BaseStats.TechPierceDamageFactor";
			modifierType = "Additive";
			value = -0.25f;
		} : ConstantStatModifier
	];
}

Base_Grit_Krausser_Recoil_Stats : StatModifierGroup
{
	fk< StatModifier >[] statModifiers = 
	[
		{
			float value = 0.f;
		} : RecoilDirModifier, 
		{
			float value = 60.f;
		} : RecoilAngleModifier, 
		{
			float value = 0.03f;
		} : RecoilHoldDurationModifier, 
		{
			float value = 0.03f;
		} : RecoilTimeModifier, 
		{
			float value = 0.6f;
		} : RecoilRecoveryTimeModifier, 
		{
			float value = 1.f;
		} : RecoilEnableLinearXModifier, 
		{
			float value = 1.f;
		} : RecoilEnableLinearYModifier, 
		{
			float value = 1.f;
		} : RecoilEnableLinearXADSModifier, 
		{
			float value = 1.f;
		} : RecoilEnableLinearYADSModifier, 
		{
			value = -0.33f;
		} : RecoilFullChargeMultModifier
	];
}

Base_Grit_Krausser_Constant_Stats : StatModifierGroup
{
	fk< StatModifier >[] statModifiers = 
	[
		{
			statType = "BaseStats.SpreadDefaultX";
			modifierType = "Additive";
			value = 1.2f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadAdsDefaultX";
			modifierType = "Additive";
			value = 0.25f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadMaxX";
			modifierType = "Additive";
			value = 4.8f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadAdsMaxX";
			modifierType = "Additive";
			value = 1.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadChangePerShot";
			modifierType = "Additive";
			value = 0.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadAdsChangePerShot";
			modifierType = "Additive";
			value = 0.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.RecoilKickMin";
			modifierType = "Additive";
			value = 0.8f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.RecoilKickMax";
			modifierType = "Additive";
			value = 1.2f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.FullAutoOnFullCharge";
			modifierType = "Additive";
			value = 1.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.EffectiveRange";
			modifierType = "Multiplier";
			value = 0.6666;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.DamagePerHit";
			modifierType = "Multiplier";
			value = 1.1287;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HeadshotDamageMultiplier";
			modifierType = "Additive";
			value = -0.25f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.ChargeMultiplier";
			modifierType = "Additive";
			value = 0.15f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.FirePower";
			modifierType = "Multiplier";
			value = 1.4353f;
		} : ConstantStatModifier, 
		"AttackModifier.WeaponArmorPenetrationMedium"
	];
}

[ notQueryable ]
Craftable_Common_Grit : Preset_Grit_Default
{
	quality = "Quality.Common";
	slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__mag_stdr";
		}
	];
	CraftingData = 
	{
		craftingRecipe += 
		[
			{
				ingredient = "Items.Preset_Base_Slaughtomatic";
				amount = 1;
			}
		];
	} : Small_Common_Crafting_Materials_Weapon;
}

[ notQueryable ]
Craftable_Uncommon_Grit : Craftable_Common_Grit
{
	quality = "Quality.Uncommon";
	CraftingData = 
	{
		craftingRecipe += 
		[
			{
				ingredient = "Items.Preset_Base_Slaughtomatic";
				amount = 1;
			}
		];
	} : Small_Uncommon_Crafting_Materials_Weapon;
}

[ notQueryable ]
Craftable_Rare_Grit : Craftable_Uncommon_Grit
{
	quality = "Quality.Rare";
	CraftingData = 
	{
		craftingRecipe += 
		[
			{
				ingredient = "Items.Preset_Base_Slaughtomatic";
				amount = 1;
			}
		];
	} : Small_Rare_Crafting_Materials_Weapon;
}

[ notQueryable ]
Craftable_Epic_Grit : Craftable_Uncommon_Grit
{
	quality = "Quality.Epic";
	CraftingData = 
	{
		craftingRecipe += 
		[
			{
				ingredient = "Items.Preset_Base_Slaughtomatic";
				amount = 1;
			}
		];
	} : Small_Epic_Crafting_Materials_Weapon;
}

[ notQueryable ]
Craftable_Legendary_Grit : Craftable_Uncommon_Grit
{
	quality = "Quality.Legendary";
	CraftingData = 
	{
		craftingRecipe += 
		[
			{
				ingredient = "Items.Preset_Base_Slaughtomatic";
				amount = 1;
			}
		];
	} : Small_Legendary_Crafting_Materials_Weapon;
}

[ notQueryable ]
Preset_Grit_Amazon : Preset_Grit_Default
{
	displayName = "LocKey#94458";
	fk< ItemBlueprint > blueprint = "Items.Iconic_Ranged_Weapon_NoAttachments_Blueprint";
	localizedDescription = "LocKey#94463";
	visualTags = 
	[
		"Amazon"
	];
	quality = "Quality.Random";
	tags += 
	[
		"IconicWeapon", "PowerOfThePack", "StashScaling_Iconic", "IllegalItem"
	];
	statModifiers += 
	[
		"Quality.IconicItem", "Character.ScaleToPlayerLevel"
	];
	npcRPGData = 
	{
		statModifiers += 
		[
			"Quality.IconicItem"
		];
	} : Items.Base_Grit_NPC_Data;
	slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__krausser_grit__mag_stdr";
		}, 
		{
			slot = "AttachmentSlots.IconicWeaponModLegendary";
			itemPartPreset = "Items.PowerOfThePackMod";
		}
	];
	bool scaleToPlayer = true;
	bool scaleToPlayerInStash = true;
	enableNpcRPGData = false;
	OnLooted += 
	[
		{
			effectors = 
			[
				{
					fact = "grit_amazon_owned";
					value = 1;
				} : SetFactEffector, 
				{
					prereqRecord = 
					{
						statusEffect = "BaseStatusEffect.JustLootedAmazonIconicFromAirdrop";
					} : StatusEffectPrereq;
					fact = "grit_amazon_airdropped";
					value = 1;
				} : SetFactEffector
			];
		}
	];
	statModifierGroups = 
	[
		"Items.IconicQualityRandomization", "Items.Base_Grit_Krausser_Technical_Stats", "Items.Base_Grit_Handling_Stats", "Items.Base_Grit_Krausser_Recoil_Stats", "Items.Base_Grit_Spread_Stats", "Items.Base_Grit_Aim_Stats", "Items.Base_Grit_Krausser_Constant_Stats", "Items.KrausserBonusStats", "Items.Base_Grit_Damage_Stats", "Items.Base_Tech_Stats", "Items.Base_Tech_Handgun_Mult_Stats", "Items.Base_Handgun_RPG_Stats", "Items.Base_Handgun_Misc_Stats", "Items.Base_Handgun_Sway_Stats", "Items.Base_Handgun_DeadReckoning_Stats", "Items.Base_PlayerState_Spread_Stats", "Items.Base_Weapon_Damage_Type_Min_Max", "Items.Base_Weapon_Damage_Type_Physical"
	];
}

