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

Preset_Chao_Default : Base_Chao
{
	CName appearanceResourceName = "Preset_Chao_Default";
	CName[] visualTags = 
	[
		"Default"
	];
	fk< SlotItemPartPreset >[] slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_stdr";
		}, 
		"Items.HandgunAndRevolverScopesPartList", {
			slot = "AttachmentSlots.Smart_Handgun_WeaponMod1";
		} : Smart_Handgun_ModList_Slot1, 
		{
			slot = "AttachmentSlots.Smart_Handgun_WeaponMod2";
		} : Smart_Handgun_ModList_Slot2
	];
}

Preset_Chao_Pimp : Preset_Chao_Default
{
	CName[] visualTags = 
	[
		"Pimp"
	];
	tags += 
	[
		"Pimp"
	];
}

Preset_Chao_Neon : Preset_Chao_Default
{
	CName[] visualTags = 
	[
		"Neon"
	];
	tags += 
	[
		"Neon"
	];
}

Preset_Chao_Military : Preset_Chao_Default
{
	CName[] visualTags = 
	[
		"Military"
	];
	tags += 
	[
		"Military"
	];
}

[ notQueryable ]
Preset_Chao_Workspot : Preset_Chao_Default
{
	slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_stdr";
		}
	];
}

[ notQueryable ]
Preset_Chao_Default_Left_Hand : Preset_Chao_Default
{
	quality = "Quality.Common";
	tags += 
	[
		"Left_Hand", "HideInUI", "HideAtVendor", "DiscardOnEmpty", "IgnoreInventory"
	];
	statModifiers += 
	[
		"Quality.BrokenItem", {
			statType = "BaseStats.Weight";
			modifierType = "Multiplier";
			value = 0;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.NumShotsToFire";
			modifierType = "Additive";
			refStat = "BaseStats.MagazineCapacity";
			opSymbol = "*";
			value = 1.0f;
		} : CombinedStatModifier
	];
	npcRPGData = 
	{
		statModifierGroups += 
		[
			"Items.Base_Chao_Technical_Stats", "Items.Base_Chao_SmartGun_Projectile_Stats"
		];
	} : Broken_Smart_Handgun_NPC_Data;
	OnLooted = 
	[
		{
			effectors = 
			[
				{
					itemsToAdd = 
					[
						{
							item = "Items.Preset_Chao_Default_Retrofix";
						}
					];
				} : AddItemsEffector
			];
		}
	];
}

[ notQueryable ]
Preset_Chao_Pimp_Left_Hand : Preset_Chao_Default_Left_Hand
{
	CName[] visualTags = 
	[
		"Pimp"
	];
	tags += 
	[
		"Pimp"
	];
	OnLooted = 
	[
		{
			effectors = 
			[
				{
					itemsToAdd = 
					[
						{
							item = "Items.Preset_Chao_Pimp_Retrofix";
						}
					];
				} : AddItemsEffector
			];
		}
	];
}

[ notQueryable ]
Preset_Chao_Neon_Left_Hand : Preset_Chao_Default_Left_Hand
{
	CName[] visualTags = 
	[
		"Neon"
	];
	tags += 
	[
		"Neon"
	];
	OnLooted = 
	[
		{
			effectors = 
			[
				{
					itemsToAdd = 
					[
						{
							item = "Items.Preset_Chao_Neon_Retrofix";
						}
					];
				} : AddItemsEffector
			];
		}
	];
}

[ notQueryable ]
Preset_Chao_Military_Left_Hand : Preset_Chao_Default_Left_Hand
{
	CName[] visualTags = 
	[
		"Military"
	];
	tags += 
	[
		"Military"
	];
	OnLooted = 
	[
		{
			effectors = 
			[
				{
					itemsToAdd = 
					[
						{
							item = "Items.Preset_Chao_Military_Retrofix";
						}
					];
				} : AddItemsEffector
			];
		}
	];
}

[ notQueryable ]
Preset_Chao_Default_Retrofix : Preset_Chao_Default
{
	fk< ItemBlueprint > blueprint = "Items.Retrofix_Firearm_NoAttachments_Blueprint";
	tags += 
	[
		"SkipActivityLog", "Left_Hand_Retrofix"
	];
	bool scaleToPlayer = true;
	bool scaleToPlayerInStash = true;
	statModifiers += 
	[
		"Character.ScaleToPlayerLevel"
	];
	slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_stdr";
		}
	];
}

[ notQueryable ]
Preset_Chao_Pimp_Retrofix : Preset_Chao_Default_Retrofix
{
	CName[] visualTags = 
	[
		"Pimp"
	];
	tags += 
	[
		"Pimp"
	];
}

[ notQueryable ]
Preset_Chao_Neon_Retrofix : Preset_Chao_Default_Retrofix
{
	CName[] visualTags = 
	[
		"Neon"
	];
	tags += 
	[
		"Neon"
	];
}

[ notQueryable ]
Preset_Chao_Military_Retrofix : Preset_Chao_Default_Retrofix
{
	CName[] visualTags = 
	[
		"Military"
	];
	tags += 
	[
		"Military"
	];
}

[ notQueryable ]
Craftable_Common_Chao : Preset_Chao_Default
{
	quality = "Quality.Common";
	fk< SlotItemPartPreset >[] slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_stdr";
		}
	];
	CraftingData = "Items.Small_Common_Crafting_Materials_Weapon";
}

[ notQueryable ]
Craftable_Uncommon_Chao : Craftable_Common_Chao
{
	quality = "Quality.Uncommon";
	CraftingData = "Items.Small_Uncommon_Crafting_Materials_Weapon";
}

[ notQueryable ]
Craftable_Rare_Chao : Craftable_Uncommon_Chao
{
	quality = "Quality.Rare";
	CraftingData = "Items.Small_Rare_Crafting_Materials_Weapon";
}

[ notQueryable ]
Craftable_Epic_Chao : Craftable_Uncommon_Chao
{
	quality = "Quality.Epic";
	CraftingData = "Items.Small_Epic_Crafting_Materials_Weapon";
}

[ notQueryable ]
Craftable_Legendary_Chao : Craftable_Uncommon_Chao
{
	quality = "Quality.Legendary";
	CraftingData = "Items.Small_Legendary_Crafting_Materials_Weapon";
}

[ notQueryable ]
[ EP1 ]
Preset_Chao_VooDoo : Preset_Chao_Default
{
	OnLooted += 
	[
		{
			effectors = 
			[
				{
					fact = "chao_voodoo_owned";
					value = 1;
				} : SetFactEffector
			];
		}
	];
	fk< ItemBlueprint > blueprint = "Items.Iconic_Ranged_Weapon_NoAttachments_Blueprint";
	audioName = "wea_set_chao_voodoo";
	displayName = "LocKey#87361";
	localizedDescription = "LocKey#87373";
	CName[] visualTags = 
	[
		"VooDoo_Chao"
	];
	quality = "Quality.Random";
	tags += 
	[
		"IconicWeapon"
	];
	statModifiers += 
	[
		"Quality.IconicItem"
	];
	npcRPGData = 
	{
		statModifiers += 
		[
			"Quality.IconicItem"
		];
	} : Items.Base_Chao_NPC_Data;
	rangedAttacks = "Attacks.SmartBulletHighExplosivePackage";
	attacks += 
	[
		"Attacks.SmartBulletHighExplosive"
	];
	slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Receiver";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__rcv1";
		}, 
		{
			slot = "AttachmentSlots.Barrel";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__base1";
		}, 
		{
			slot = "AttachmentSlots.Magazine";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_std";
		}, 
		{
			slot = "AttachmentSlots.MagazineEmpty";
			fk< Item > itemPartPreset = "Items.w_handgun__kang_tao_chao__mag_stdr";
		}, 
		{
			slot = "AttachmentSlots.IconicWeaponModLegendary";
			itemPartPreset = "Items.ChaoVooDooWeaponMod";
		}
	];
	statModifierGroups = 
	[
		"Items.IconicQualityRandomization", "Items.Base_Chao_VooDoo_Technical_Stats", "Items.Base_Chao_Handling_Stats", "Items.Base_Chao_Recoil_Stats", "Items.Base_Chao_VooDoo_SmartGun_Stats", "Items.Base_Chao_SmartGun_VooDoo_SmartLink_Stats", "Items.Base_Chao_SmartGun_Projectile_Stats", "Items.Base_Chao_Flags", "Items.Base_Chao_Aim_Stats", "Items.Base_Chao_StatModifierGroup_SpreadStats", "Items.Base_Chao_VooDoo_Constant_Stats", "Items.Base_Chao_Damage_Stats", "Items.Base_Smart_Stats", "Items.Base_Smart_Handgun_Mult_Stats", "Items.Base_Smart_Handgun_No_Sway_Stats", "Items.Base_Handgun_RPG_Stats", "Items.Base_Handgun_Misc_Stats", "Items.Base_PlayerState_Spread_Stats", "Items.Base_Weapon_Damage_Type_Min_Max", "Items.Base_Weapon_Damage_Type_Physical"
	];
}

Base_Chao_VooDoo_Technical_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			value = 1.f;
		} : NumShotsToFireModifier, 
		{
			value = 2.5f;
		} : AccuracyModifier, 
		{
			value = 0.3f;
		} : CycleTimeModifier, 
		{
			value = 0.15f;
		} : CycleTime_BurstModifier, 
		{
			value = 2.f;
		} : NumShotsInBurstModifier, 
		{
			value = 18.f;
		} : MagazineCapacityModifier, 
		{
			value = 0.8f;
		} : RangeModifier, 
		{
			value = 1.f;
		} : ProjectilesPerShotModifier, 
		"BaseStats.ProjectilesPerShotCombinedModifier"
	];
}

Base_Chao_VooDoo_SmartGun_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			value = 1.f;
		} : SmartGunUseEvenDistributionTargetingModifier, 
		{
			value = 0.f;
		} : SmartGunTrackMultipleEntitiesInADSModifier, 
		{
			value = 0.25f;
		} : SmartGunEvenDistributionPeriodModifier, 
		{
			value = 0.0f;
		} : SmartGunHipLockingAnglePitchModifier, 
		{
			value = 0.0f;
		} : SmartGunHipLockingAngleYawModifier, 
		{
			value = 0.0f;
		} : SmartGunAdsLockingAnglePitchModifier, 
		{
			value = 0.0f;
		} : SmartGunAdsLockingAngleYawModifier, 
		{
			value = 0.0f;
		} : SmartGunHipTargetableAnglePitchModifier, 
		{
			value = 0.0f;
		} : SmartGunHipTargetableAngleYawModifier, 
		{
			value = 0.0f;
		} : SmartGunAdsTargetableAnglePitchModifier, 
		{
			value = 0.0f;
		} : SmartGunAdsTargetableAngleYawModifier, 
		{
			value = 3.f;
		} : SmartGunHipMaxLockedTargetsModifier, 
		{
			value = 1.f;
		} : SmartGunAdsMaxLockedTargetsModifier, 
		{
			value = 1.2f;
		} : SmartGunHipTimeToLockModifier, 
		{
			value = 1.2f;
		} : SmartGunAdsTimeToLockModifier, 
		{
			value = 0.f;
		} : SmartGunHipTimeToUnlockModifier, 
		{
			value = 0.f;
		} : SmartGunAdsTimeToUnlockModifier, 
		{
			value = 0.f;
		} : SmartGunTimeToRemoveOccludedTargetModifier, 
		{
			value = 1.f;
		} : SmartGunUseTimeBasedAccuracyModifier, 
		{
			value = 1.f;
		} : SmartGunTimeToMaxAccuracyModifier, 
		{
			value = 0.2f;
		} : SmartGunStartingAccuracyModifier, 
		{
			value = 5.0f;
		} : SmartGunSpreadMultiplierModifier, 
		{
			value = 50.f;
		} : SmartGunPlayerProjectileVelocityModifier, 
		{
			value = 0.80f;
		} : SmartGunHitProbabilityModifier
	];
}

Base_Chao_SmartGun_VooDoo_SmartLink_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			value = 6.0f;
			statType = "BaseStats.SmartGunHipLockingAnglePitch";
		} : SmartLinkDependentStatModifier, 
		{
			value = 10.0f;
			statType = "BaseStats.SmartGunHipLockingAngleYaw";
		} : SmartLinkDependentStatModifier, 
		{
			value = 6.0f;
			statType = "BaseStats.SmartGunAdsLockingAnglePitch";
		} : SmartLinkDependentStatModifier, 
		{
			value = 10.0f;
			statType = "BaseStats.SmartGunAdsLockingAngleYaw";
		} : SmartLinkDependentStatModifier, 
		{
			value = 6.0f;
			statType = "BaseStats.SmartGunHipTargetableAnglePitch";
		} : SmartLinkDependentStatModifier, 
		{
			value = 10.0f;
			statType = "BaseStats.SmartGunHipTargetableAngleYaw";
		} : SmartLinkDependentStatModifier, 
		{
			value = 6.0f;
			statType = "BaseStats.SmartGunAdsTargetableAnglePitch";
		} : SmartLinkDependentStatModifier, 
		{
			value = 10.0f;
			statType = "BaseStats.SmartGunAdsTargetableAngleYaw";
		} : SmartLinkDependentStatModifier, 
		{
			value = 0.f;
			statType = "BaseStats.SmartGunHipTimeToLock";
		} : SmartLinkDependentStatModifier, 
		{
			value = 0.f;
			statType = "BaseStats.SmartGunAdsTimeToLock";
		} : SmartLinkDependentStatModifier, 
		{
			value = 1.6f;
			statType = "BaseStats.SmartGunHipTimeToUnlock";
		} : SmartLinkDependentStatModifier, 
		{
			value = 1.6f;
			statType = "BaseStats.SmartGunAdsTimeToUnlock";
		} : SmartLinkDependentStatModifier, 
		{
			value = 1.6f;
			statType = "BaseStats.SmartGunTimeToRemoveOccludedTarget";
		} : SmartLinkDependentStatModifier, 
		{
			value = 0.20f;
			statType = "BaseStats.SmartGunHitProbability";
		} : SmartLinkDependentStatModifier, 
		{
			value = 50.f;
			statType = "BaseStats.SmartGunPlayerProjectileVelocity";
		} : SmartLinkDependentStatModifier
	];
}

Base_Chao_VooDoo_Constant_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			statType = "BaseStats.SpreadDefaultX";
			modifierType = "Additive";
			value = 2.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadAdsDefaultX";
			modifierType = "Additive";
			value = 0.7f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadMaxX";
			modifierType = "Additive";
			value = 2.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.SpreadAdsMaxX";
			modifierType = "Additive";
			value = 0.7f;
		} : 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.3f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.RecoilKickMax";
			modifierType = "Additive";
			value = 0.4f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.FirePower";
			modifierType = "Multiplier";
			value = 3.6f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.EffectiveRange";
			modifierType = "Multiplier";
			value = 0.6667;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.DamagePerHit";
			modifierType = "Multiplier";
			value = 1.55;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HeadshotDamageMultiplier";
			modifierType = "Additive";
			value = -0.35f;
		} : ConstantStatModifier, 
		"AttackModifier.WeaponArmorPenetrationLow"
	];
}

