package NewPerks
using RTDB, Prereqs, Effectors, Attacks, Perks

Espionage_Left_Milestone_Perk : NewPerk
{
	enumName = "Espionage_Left_Milestone_Perk";
	enumComment = "Exit combat on activating Optical Camo";
	loc_name_key = "LocKey#88048";
	loc_desc_key = "LocKey#88039";
	binkPath = "base\movies\tutorials\700x394\perk_relic_camo.bk2";
	perkIcon = "UIIcon.Espionage_Left_Milestone_Perk";
	category = "NewPerks.MilestoneNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_2";
	requiresPerks = [];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanPlayerExitCombatWithOpticalCamo";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
			};
		} : NewPerkLevelData
	];
}

Espionage_Left_Perk_1_2 : NewPerk
{
	enumName = "Espionage_Left_Perk_1_2";
	enumComment = "Avoid Combat on dodge";
	loc_name_key = "LocKey#88047";
	loc_desc_key = "LocKey#88038";
	binkPath = "base\movies\tutorials\700x394\perk_relic_avoidcombat_v1.bk2";
	uiData = 
	{
		floatValues = 
		[
			120f
		];
	};
	perkIcon = "UIIcon.Espionage_Left_Perk_1_2";
	category = "NewPerks.SimpleNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_2_Side_1";
	requiresPerks = 
	[
		"NewPerks.Espionage_Left_Milestone_Perk"
	];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanPlayerDodgeOnDetection";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
			};
		} : NewPerkLevelData
	];
}

Espionage_Central_Milestone_1 : NewPerk
{
	enumName = "Espionage_Central_Milestone_1";
	enumComment = "New arms CW ability unlocked";
	loc_name_key = "LocKey#88049";
	loc_desc_key = "LocKey#88040";
	perkIcon = "UIIcon.Espionage_Central_Milestone_1";
	category = "NewPerks.MilestoneNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_1";
	requiresPerks = [];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanUseNewMeleewareAttackSpyTree";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
				effectors = 
				[
					{
						prereqRecord = "Prereqs.StrongArmsHeldPrereq";
						effectorToApply = 
						{
							prereqRecord = 
							{
								conditions += 
								[
									{
										weaponType = "Melee";
									} : WeaponTypeHitPrereqCondition, 
									{
										npcType = "Any";
										invert = true;
									} : TargetNPCTypeHitPrereqCondition
								];
							} : IsHitTargetAlive;
							CName applicationTarget = "Weapon";
							statPoolUpdates = 
							[
								{
									statPoolType = "BaseStatPools.WeaponCharge";
									statPoolValue = 30;
								} : StatPoolUpdate
							];
						} : ModifyStatPoolValueEffector;
					} : ApplyEffectorOnPlayer, 
					{
						prereqRecord = 
						{
							conditions += 
							[
								{
									hitFlag = "RelicGoldenNumbers";
								} : HitFlagHitPrereqCondition
							];
						} : PreProcessHitTriggered;
						hitFlag = "Special";
					} : AddHitFlagToAttackEffector
				];
			};
		} : NewPerkLevelData
	];
}

Espionage_Central_Milestone_MantisBlades : NewPerk
{
	loc_name_key = "LocKey#3717";
	loc_desc_key = "LocKey#88058";
	uiData = 
	{
		floatValues = 
		[
			30f
		];
	};
	binkPath = "base\movies\tutorials\700x394\perk_relic_mantis.bk2";
}

Espionage_Central_Milestone_GorillaArms : NewPerk
{
	loc_name_key = "LocKey#3718";
	loc_desc_key = "LocKey#88059";
	binkPath = "base\movies\tutorials\700x394\perk_relic_gorilla.bk2";
}

Espionage_Central_Milestone_ProjectileLauncher : NewPerk
{
	loc_name_key = "LocKey#3722";
	loc_desc_key = "Lockey#88060";
	uiData = 
	{
		floatValues = 
		[
			5f
		];
	};
	binkPath = "base\movies\tutorials\700x394\perk_relic_rl.bk2";
}

Espionage_Central_Milestone_Monowire : NewPerk
{
	loc_name_key = "LocKey#3720";
	loc_desc_key = "Lockey#88061";
	binkPath = "base\movies\tutorials\700x394\perk_relic_monowire_central.bk2";
}

Espionage_Central_Perk_1_1 : NewPerk
{
	enumName = "Espionage_Central_Perk_1_1";
	enumComment = " Adds one more charge to the Projectile Launcher.";
	loc_name_key = "LocKey#88051";
	loc_desc_key = "LocKey#88041";
	uiData = 
	{
		floatValues = 
		[
			1f
		];
	};
	perkIcon = "UIIcon.Espionage_Central_Perk_1_1";
	category = "NewPerks.SimpleNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_1_Side_4";
	requiresPerks = 
	[
		"NewPerks.Espionage_Central_Milestone_1"
	];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.ProjectileLauncherMaxCharges";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
			};
		} : NewPerkLevelData
	];
}

Espionage_Central_Perk_1_2 : NewPerk
{
	enumName = "Espionage_Central_Perk_1_2";
	enumComment = "The new charged attack from Gorilla Arms now knocks down enemies on the inpact.";
	loc_name_key = "Lockey#88053";
	loc_desc_key = "LocKey#88042";
	perkIcon = "UIIcon.Espionage_Central_Perk_1_2";
	category = "NewPerks.SimpleNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_1_Side_3";
	requiresPerks = 
	[
		"NewPerks.Espionage_Central_Milestone_1"
	];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanOnePunchWithGorillaArms";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
				effectors = 
				[
					{
						prereqRecord = "Prereqs.StrongArmsHeldPrereq";
						fk< Effector > effectorToApply = 
						{
							prereqRecord = 
							{
								conditions += 
								[
									{
										attackSubtype = "SpyTreeMeleewareAttack";
									} : AttackSubtypeHitPrereqCondition
								];
							} : Prereqs.ProcessHitTriggered;
							bool isRandom = false;
							fk< StatusEffect > statusEffect = "BaseStatusEffect.Knockdown";
						} : AddStatusEffectToAttackEffector;
					} : ApplyEffectorOnPlayer
				];
			};
		} : NewPerkLevelData
	];
}

Espionage_Central_Perk_1_3 : NewPerk
{
	enumName = "Espionage_Central_Perk_1_3";
	enumComment = "Monowire ability power-up";
	loc_name_key = "LocKey#88054";
	loc_desc_key = "LocKey#88043";
	binkPath = "base\movies\tutorials\700x394\perk_relic_monowire_powerup.bk2";
	perkIcon = "UIIcon.Espionage_Central_Perk_1_3";
	category = "NewPerks.SimpleNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_1_Side_2";
	requiresPerks = 
	[
		"NewPerks.Espionage_Central_Milestone_1"
	];
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanSpreadMonoWireQuickhack";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
			};
		} : NewPerkLevelData
	];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
}

Espionage_Central_Perk_1_4 : NewPerk
{
	enumName = "Espionage_Central_Perk_1_4";
	enumComment = "All leaping attacks now cripple enemies and apply a debuff on them that raises the dismemberment chance against them for the next {float_0} seconds.";
	loc_name_key = "LocKey#88055";
	loc_desc_key = "LocKey#88044";
	uiData = 
	{
		floatValues = 
		[
			10f
		];
	};
	perkIcon = "UIIcon.Espionage_Central_Perk_1_4";
	category = "NewPerks.SimpleNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_1_Side_1";
	requiresPerks = 
	[
		"NewPerks.Espionage_Central_Milestone_1"
	];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanDoGrandFinaleWithMantisBlades";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
			};
		} : NewPerkLevelData
	];
}

Espionage_Right_Milestone_1 : NewPerk
{
	enumName = "Espionage_Right_Milestone_1";
	enumComment = "While in combat you can now analyze enemy's internal tech vulnerabilities - Cyberware Breaches. Hits to the Breaches always deal crit damage and penetrate armour. Upon receiving enough damage Breaches blow up, creating an EMP explosion that deals damage to everyone in a radius of 3m.";
	loc_name_key = "LocKey#88056";
	loc_desc_key = "LocKey#88045";
	uiData = 
	{
		floatValues = 
		[
			100f, 25f, 3f
		];
	};
	perkIcon = "UIIcon.Espionage_Right_Milestone_1";
	binkPath = "base\movies\tutorials\700x394\perk_relic_breach.bk2";
	category = "NewPerks.MilestoneNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_3";
	requiresPerks = [];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
			dataPackage = 
			{
				stats = 
				[
					{
						statType = "BaseStats.CanSeeCyberwareBreaches";
						modifierType = "Additive";
						value = 1f;
					} : ConstantStatModifier
				];
				effectors = 
				[
					{
						prereqRecord = "NewPerks.CyberwareBreachGoldDamagePrereq";
						hitFlag = "Special";
					} : AddHitFlagToAttackEffector
				];
			};
		} : NewPerkLevelData
	];
}

CyberwareBreachGoldDamagePrereq : ORPrereq
{
	nestedPrereqs = 
	[
		{
			conditions = 
			[
				{
					hitFlag = "BreachExplosion";
				} : HitFlagHitPrereqCondition
			];
		} : PreProcessHitTriggered, 
		{
			conditions = 
			[
				{
					hitFlag = "BreachHit";
				} : HitFlagHitPrereqCondition, 
				"Prereqs.TargetCanGetKilledByDamageHitPrereqCondition"
			];
		} : ProcessHitReactionHitTriggered, 
		{
			conditions = 
			[
				{
					hitFlag = "BreachHit";
				} : HitFlagHitPrereqCondition, 
				"Prereqs.TargetBreachCanGetKilledByDamageHitPrereqCondition"
			];
		} : ProcessHitReactionHitTriggered
	];
}

CyberwareBreachParams
{
	float newBreachHealthPercentageTrash = 50.f;
	float newBreachHealthPercentageWeak = 37.5f;
	float newBreachHealthPercentageNormal = 30.f;
	float newBreachHealthPercentageRare = 30.f;
	float newBreachHealthPercentageElite = 15.f;
	float newBreachHealthPercentageBoss = 6.5f;
	float explosionDamageHealthPercentage = 110.f;
	float explosionDamageHealthPercentageBoss = 81.5f;
	int maxBreachCountTrash = 1;
	int maxBreachCountWeak = 1;
	int maxBreachCountNormal = 1;
	int maxBreachCountRare = 1;
	int maxBreachCountElite = 2;
	int maxBreachCountBoss = 3;
	float newBreachMaxRangeBase = 22.f;
	float newBreachExtraWeaponRange = 7.f;
	float outOfCombatBreachWithoutAimingDistance = 2.5f;
	float breachLookatMaxScreenSpaceX = 0.3f;
	float breachLookatMaxScreenSpaceY = 0.5f;
	bool breachLookatStopsDisappearanceInADS = false;
	float breachDurationMin = 4.f;
	float breachDurationMax = 5.f;
	float breachDurationIncreasePerStreak = 0.f;
	float breachDurationIncreaseForAnyStreak = 2.f;
	float breachDurationIncreaseOnFirstLookat = 3.f;
	float breachDurationIncreaseOnFirstHit = 3.f;
	float breachCooldownMin = 7.f;
	float breachCooldownMax = 15.f;
	float breachCooldownDecreasePerStreak = 10.f;
	float rangedRadiusMultiplier = 1.f;
	float meleeRadiusMultiplier = 0.7f;
	float piercingHitLineMagnitude = 1.5f;
	float meleeHitLineMagnitude = 0.6f;
	float meleeSliceForwardLineMagnitude = 0.2f;
	float meleeSliceBackLineMagnitude = 0.4f;
}

Espionage_Right_Perk_1_1 : NewPerk
{
	enumName = "Espionage_Right_Perk_1_1";
	enumComment = "Destroying breaches now grants a stacking bonus making them appear {int_0}% more often and increasing all critical damage by {int_1}. Reaching the maximum number of stacks {int_2} doubles the effects. Lasts {float_3}";
	loc_name_key = "LocKey#88057";
	loc_desc_key = "LocKey#88046";
	uiData = 
	{
		floatValues = 
		[
			10f, 5f, 5f, 25f
		];
	};
	perkIcon = "UIIcon.Espionage_Right_Perk_1_1";
	category = "NewPerks.SimpleNewPerkCategory";
	slot = "NewPerks.Espionage_Main_Perk_3_Side_1";
	requiresPerks = 
	[
		"NewPerks.Espionage_Right_Milestone_1"
	];
	tier = "NewPerks.EspionageNewPerkTier";
	attribute = "NewPerks.EspionageAttributeData";
	levels = 
	[
		{
		} : NewPerkLevelData
	];
}

