package Perks
using RTDB, Prereqs, Effectors

PlayerIsAiming : IPrereq
{
	prereqClassName = "UpperBodyPSMPrereq";
	string stateName = "Aim";
	bool isInState = true;
}

PlayerIsNotAiming : IPrereq
{
	prereqClassName = "UpperBodyPSMPrereq";
	string stateName = "Aim";
	bool isInState = false;
}

PlayerIsReloading : IPrereq
{
	prereqClassName = "RangedWeaponPSMPrereq";
	string stateName = "Reload";
	bool isInState = true;
}

PlayerNotReloading : IPrereq
{
	prereqClassName = "RangedWeaponPSMPrereq";
	string stateName = "Reload";
	bool isInState = false;
}

PlayerIsShooting : IPrereq
{
	prereqClassName = "RangedWeaponPSMPrereq";
	string stateName = "Shoot";
	bool isInState = true;
}

IsMemoryBelowHalf : StatPoolPrereq
{
	prereqClassName = "ConstantStatPoolPrereq";
	valueToCheck = 
	[
		{
			statType = "BaseStats.Memory";
			modifierType = "Additive";
			value = 50.0f;
		} : ConstantStatModifier
	];
	statPoolType = "Memory";
	comparisonType = "LessOrEqual";
}

IsPlayerAboveFatigue : StatPoolPrereq
{
	prereqClassName = "ConstantStatPoolPrereq";
	valueToCheck = 
	[
		{
			statType = "BaseStats.Stamina";
			modifierType = "Additive";
			value = 50.0f;
		} : ConstantStatModifier
	];
	statPoolType = "Stamina";
	CName comparisonType = "Greater";
}

IsPlayerAboveExhaustion : StatPoolPrereq
{
	prereqClassName = "ConstantStatPoolPrereq";
	valueToCheck = 
	[
		{
			statType = "BaseStats.Stamina";
			modifierType = "Additive";
			value = 0.0f;
		} : ConstantStatModifier
	];
	statPoolType = "Stamina";
	comparisonType = "Greater";
}

IsPlayerSliding : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "OR";
	fk< IPrereq >[] nestedPrereqs = 
	[
		{
			stateName = "Slide";
		} : Prereqs.DetailedLocomotionPSMPrereq, 
		{
			stateName = "SlideFall";
		} : Prereqs.DetailedLocomotionPSMPrereq
	];
}

IsPlayerVaulting : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "Vault";
	bool isInState = true;
}

IsPlayerClimbingLadder : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "Ladder";
	bool isInState = true;
}

IsPlayerGrappling : IPrereq
{
	prereqClassName = "TakedownPSMPrereq";
	string stateName = "Grapple";
	bool isInState = true;
}

IsPlayerStatic : IPrereq
{
	prereqClassName = "IsPlayerMovingPrereq";
	bool isMoving = false;
}

IsPlayerInMotion : IPrereq
{
	prereqClassName = "IsPlayerMovingPrereq";
	bool isMoving = true;
}

IsPlayerSprinting : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "Sprint";
	bool isInState = true;
}

IsPlayerJumping : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "Jump";
	bool isInState = true;
}

IsPlayerNotSprinting : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "Sprint";
	bool isInState = false;
}

IsPlayerCrouching : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "Crouch";
	bool isInState = true;
}

IsPlayerCrouchSprinting : IPrereq
{
	prereqClassName = "DetailedLocomotionPSMPrereq";
	string stateName = "CrouchSprint";
	bool isInState = true;
}

IsPlayerOnGround : IPrereq
{
	prereqClassName = "IsPlayerOnGroundPrereq";
	bool invert = false;
}

IsPlayerInAir : IPrereq
{
	prereqClassName = "IsPlayerOnGroundPrereq";
	bool invert = true;
}

IsPlayerInAirDashElevation : IPrereq
{
	prereqClassName = "PlayerElevationPrereq";
	float elevationThreshold = 0.25f;
}

ShouldModifyMaxSpeedInCombat : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "AND";
	fk< IPrereq >[] nestedPrereqs = 
	[
		{
			statType = "Reflexes";
			valueToCheck = 8;
			comparisonType = "LessOrEqual";
		} : StatPrereq, 
		{
			stateName = "InCombat";
			isInState = true;
		} : Prereqs.CombatPSMPrereq
	];
}

ShouldModifyMaxSpeedInCombatIgnoreSprint : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "AND";
	fk< IPrereq >[] nestedPrereqs = 
	[
		{
			statType = "Reflexes";
			valueToCheck = 8;
			comparisonType = "Greater";
		} : StatPrereq, 
		{
			stateName = "InCombat";
			isInState = true;
		} : Prereqs.CombatPSMPrereq, 
		"Perks.IsPlayerNotSprinting"
	];
}

IsPlayerDodging : ORPrereq
{
	fk< IPrereq >[] nestedPrereqs = 
	[
		{
			stateName = "Dodge";
		} : Prereqs.DetailedLocomotionPSMPrereq, 
		{
			stateName = "DodgeAir";
		} : Prereqs.DetailedLocomotionPSMPrereq
	];
}

IsPlayerAirDashing : StatusEffectPrereq
{
	statusEffect = "BaseStatusEffect.PlayerJustAirDashed";
}

IsPlayerMeleeAttacking : IPrereq
{
	prereqClassName = "MeleePSMPrereq";
	string stateName = "Attack";
	bool isInState = true;
}

IsPlayerBlocking : IPrereq
{
	prereqClassName = "MeleePSMPrereq";
	string stateName = "Block";
	bool isInState = true;
}

HitIsTheSameTarget : ProcessHitTriggered
{
	conditions = 
	[
		"Prereqs.SameTargetHitPrereqCondition"
	];
}

HitIsBodyPartLimb : ProcessHitTriggered
{
	conditions = 
	[
		{
			bodyPart = "Limb";
		} : BodyPartHitPrereqCondition
	];
}

HitIsBodyPartHead : ProcessHitTriggered
{
	conditions = 
	[
		{
			bodyPart = "Head";
		} : BodyPartHitPrereqCondition
	];
}

HitIsBodyPartTorso : ProcessHitTriggered
{
	conditions = 
	[
		{
			bodyPart = "Torso";
		} : BodyPartHitPrereqCondition
	];
}

IsHitTargetAlive : ProcessHitTriggered
{
	conditions = 
	[
		{
			statusEffect = "Defeated";
			checkType = "CheckType.Type";
			invert = true;
		} : StatusEffectPresentHitPrereqCondition, 
		{
			statusEffect = "Unconscious";
			checkType = "CheckType.Type";
			invert = true;
		} : StatusEffectPresentHitPrereqCondition, 
		{
			float valueToCheck = 0f;
			CName objectToCheck = "Target";
			string statPoolToCompare = "Health";
			string comparisonType = "NotEqual";
		} : StatPoolHitPrereqCondition
	];
}

IsHitTargetAliveAllowProjection : IsHitTargetAlive
{
	string pipelineType = "All";
}

IsReadyToExplodeCW : ProcessHitTriggered
{
	conditions = 
	[
		{
			statusEffect = "CyberwareMalfunction7Stacks";
			checkType = "CheckType.Record";
			invert = false;
		} : StatusEffectPresentHitPrereqCondition
	];
}

BatonMurphyPrereq : IsHitTargetAlive
{
	conditions += 
	[
		{
			weaponType = "Melee";
		} : WeaponTypeHitPrereqCondition
	];
}

BatMalinaPrereq : IsHitTargetAlive
{
	conditions += 
	[
		{
			weaponType = "Melee";
		} : WeaponTypeHitPrereqCondition
	];
}

OvertureDodgerPrereq : IsHitTargetAlive
{
	conditions += 
	[
		{
			weaponType = "Ranged";
		} : WeaponTypeHitPrereqCondition
	];
}

IsHitACritical : PostProcessHitTriggered
{
	conditions = 
	[
		{
			hitFlag = "CriticalHit";
		} : HitFlagHitPrereqCondition
	];
}

IsTargetKilled : PostProcessHitTriggered
{
	isSynchronous = false;
	conditions = 
	[
		"Prereqs.TargetKilledHitPrereqCondition"
	];
}

IsTargetDismembered : PostProcessHitTriggered
{
	isSynchronous = false;
	conditions = 
	[
		"Prereqs.DismembermentTriggeredCondition"
	];
}

IsNonCivilianTargetKilled : PostProcessHitTriggered
{
	isSynchronous = false;
	conditions = 
	[
		{
			invert = true;
			reactionPreset = "Civilian";
		} : ReactionPresetHitPrereqCondition, 
		"Prereqs.TargetKilledHitPrereqCondition"
	];
}

IsWeaponRanged : ProcessHitTriggered
{
	conditions = 
	[
		{
			weaponType = "Ranged";
		} : WeaponTypeHitPrereqCondition
	];
}

IsWeaponRangedAllowProjection : IsWeaponRanged
{
	string pipelineType = "All";
}

IsWeaponMelee : ProcessHitTriggered
{
	conditions = 
	[
		{
			weaponType = "Melee";
		} : WeaponTypeHitPrereqCondition
	];
}

IsWeaponMeleeAllowProjection : IsWeaponMelee
{
	string pipelineType = "All";
}

IsAttackRanged : ProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "Ranged";
		} : AttackTypeHitPrereqCondition
	];
}

IsAttackRangedAllowProjection : IsAttackRanged
{
	string pipelineType = "All";
}

IsAttackEffect : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "Effect";
		} : AttackTypeHitPrereqCondition
	];
}

IsPlayerHitWithMelee : IsWeaponMelee
{
	conditions += 
	[
		{
			instigatorType = "Player";
		} : InstigatorTypeHitPrereqCondition
	];
}

IsPlayerHitWithRanged : IsWeaponRanged
{
	conditions += 
	[
		{
			instigatorType = "Player";
		} : InstigatorTypeHitPrereqCondition
	];
}

WasAttackRanged : PostProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "Ranged";
		} : AttackTypeHitPrereqCondition
	];
}

IsHitFastAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "Melee";
		} : AttackTypeHitPrereqCondition
	];
}

IsHitStrongAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "StrongMelee";
		} : AttackTypeHitPrereqCondition, 
		{
			attackSubtype = "BodySlamAttack";
			invert = true;
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitQuickMelee : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "QuickMelee";
		} : AttackTypeHitPrereqCondition
	];
}

WasHitQuickMelee : PostProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "QuickMelee";
		} : AttackTypeHitPrereqCondition
	];
}

IsHitDeflectAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "DeflectAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitSprintAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "SprintAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitEquipAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "EquipAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitFinalAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "FinalAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitComboAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "ComboAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitCrouchAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "CrouchAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitBlockAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "BlockAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsHitJumpAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackSubtype = "JumpAttack";
		} : AttackSubtypeHitPrereqCondition
	];
}

IsAttackThrownType : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "Thrown";
		} : AttackTypeHitPrereqCondition
	];
}

IsExplosionTypeAttack : PreProcessHitTriggered
{
	conditions = 
	[
		{
			attackType = "Explosion";
		} : AttackTypeHitPrereqCondition
	];
}

HitReceivedIsSourceGrenade : PreProcessHitReceived
{
	conditions = 
	[
		{
			source = "Grenade";
		} : SourceTypeHitPrereqCondition
	];
}

IsReceivedAttackExplosion : ProcessHitReceived
{
	conditions = 
	[
		{
			attackType = "Explosion";
		} : AttackTypeHitPrereqCondition
	];
}

HitIsTargetHuman : ProcessHitTriggered
{
	conditions = 
	[
		{
			npcType = "Human";
		} : TargetNPCTypeHitPrereqCondition
	];
}

HitIsTargetMechanical : ProcessHitTriggered
{
	conditions = 
	[
		{
			invert = true;
			npcType = "Human";
		} : TargetNPCTypeHitPrereqCondition
	];
}

PostHitIsTargetMechanical : PostProcessHitTriggered
{
	conditions = 
	[
		{
			invert = true;
			npcType = "Human";
		} : TargetNPCTypeHitPrereqCondition
	];
}

IsHitTargetBoss : ProcessHitTriggered
{
	conditions = 
	[
		{
			rarity = "Boss";
		} : TargetNPCRarityHitPrereqCondition
	];
}

IsHitTargetNotBoss : ProcessHitTriggered
{
	conditions = 
	[
		{
			invert = true;
			rarity = "Boss";
		} : TargetNPCRarityHitPrereqCondition
	];
}

IsPlayer : IPrereq
{
	prereqClassName = "IsPlayerPrereq";
	bool invert = false;
}

IsHuman : IPrereq
{
	prereqClassName = "IsHumanPrereq";
	bool invert = false;
}

IsMechanical : IPrereq
{
	prereqClassName = "IsHumanPrereq";
	bool invert = true;
}

IsTargetMoving : ProcessHitTriggered
{
	conditions = 
	[
		{
			isMoving = true;
			object = "Target";
		} : AgentMovingHitPrereqCondition
	];
}

IsInstigatorMoving : ProcessHitTriggered
{
	conditions = 
	[
		{
			isMoving = true;
			object = "Instigator";
		} : AgentMovingHitPrereqCondition
	];
}

IsTargetStatic : ProcessHitTriggered
{
	conditions = 
	[
		{
			isMoving = false;
			object = "Target";
		} : AgentMovingHitPrereqCondition
	];
}

IsTargetPlayer : ProcessHitTriggered
{
	conditions = 
	[
		{
			targetType = "Player";
		} : TargetTypeHitPrereqCondition
	];
}

IsTargetNotPlayer : ProcessHitTriggered
{
	conditions = 
	[
		{
			targetType = "Player";
			invert = true;
		} : TargetTypeHitPrereqCondition
	];
}

IsTargetNotPlayerAllowProjection : IsTargetNotPlayer
{
	string pipelineType = "All";
}

IsInstigatorStatic : ProcessHitTriggered
{
	conditions = 
	[
		{
			isMoving = false;
			object = "Instigator";
		} : AgentMovingHitPrereqCondition
	];
}

TargetHasMoreHealthThanInstigator : HitTriggeredPrereq
{
	conditions = 
	[
		{
			CName comparisonSource = "Target";
			CName comparisonTarget = "Instigator";
			string statPoolToCompare = "Health";
			string comparisonType = "Greater";
		} : StatPoolComparisonHitPrereqCondition
	];
}

TargetHasLessHealthThanInstigator : HitTriggeredPrereq
{
	conditions = 
	[
		{
			CName comparisonSource = "Target";
			CName comparisonTarget = "Instigator";
			string statPoolToCompare = "Health";
			string comparisonType = "Less";
		} : StatPoolComparisonHitPrereqCondition
	];
}

TargetHasFullHealth : HitTriggeredPrereq
{
	conditions = 
	[
		{
			valueToCheck = 90.f;
			objectToCheck = "Target";
			string statPoolToCompare = "Health";
			string comparisonType = "GreaterOrEqual";
		} : StatPoolHitPrereqCondition
	];
}

QuickHackUploaded : StatusEffectPrereq
{
	statusEffect = "BaseStatusEffect.QuickHackUploaded";
}

WasQuickHacked : StatusEffectPrereq
{
	statusEffect = "BaseStatusEffect.WasQuickHacked";
}

BeingHacked : StatusEffectPrereq
{
	statusEffect = "AIQuickHackStatusEffect.BeingHacked";
}

BeingHackedWithTraceableHack : StatusEffectPrereq
{
	statusEffect = "AIQuickHackStatusEffect.BeingHackedWithTraceableHack";
}

PlayerBeingHacked : StatusEffectPrereq
{
	objectToCheck = "Player";
	statusEffect = "AIQuickHackStatusEffect.BeingHacked";
}

NotPlayerBeingHacked : PlayerBeingHacked
{
	invert = true;
}

ApplyStatGroupOnPlayer : ApplyStatGroupEffector
{
}

ApplyStatGroupOnWeapon : ApplyStatGroupEffector
{
	applicationTarget = "Weapon";
	bool reapplyOnWeaponChange = false;
}

ApplyStatGroupOnVehicle : ApplyStatGroupEffector
{
	applicationTarget = "Vehicle";
}

ApplyEffectorOnPlayer : ApplyEffectorEffector
{
}

ApplyEffectorOnWeapon : ApplyEffectorEffector
{
	applicationTarget = "Weapon";
}

ApplyStatusEffectOnPlayer : ApplyStatusEffectEffector
{
	CName effectorClassName = "ApplyStatusEffectEffector";
	bool removeWithEffector = false;
	CName applicationTarget = "Player";
}

ApplyStatusEffectOnWeapon : ApplyStatusEffectEffector
{
	CName effectorClassName = "ApplyStatusEffectEffector";
	applicationTarget = "Weapon";
	bool removeWithEffector = false;
}

MultiplyDamage : ModifyDamageEffector
{
	operationType = "Multiply";
	value = 1f;
}

MultiplyDamageWithVelocity : Effector
{
	effectorClassName = "ModifyDamageWithVelocity";
	float percentMult = 0f;
	float unitThreshold = 0f;
	string operationType = "Multiply";
}

ModifyDamageWithDistance : Effector
{
	effectorClassName = "ModifyDamageWithDistance";
	string operationType = "Multiply";
	float percentMult = 1.0f;
	float minDistance = 0f;
	float maxDistance = 0f;
	bool improveWithDistance = true;
}

ModifyCritWithDistance : Effector
{
	effectorClassName = "ModifyCritWithDistance";
	float critChanceBonus = 0f;
	float minDistance = 0f;
	float maxDistance = 0f;
	bool improveWithDistance = true;
}

ModifyDamageWithLeapedDistance : Effector
{
	effectorClassName = "ModifyDamageWithLeapedDistance";
	string operationType = "Multiply";
	float maxPercentMult = 1f;
	float minDistance = 0f;
	float maxDistance = 0f;
}

AddDamage : ModifyDamageEffector
{
	operationType = "Add";
	value = 1f;
}

ReloadWeapon : Effector
{
	CName effectorClassName = "ReloadWeaponEffector";
}

StatPoolBasedStatusEffectEffector : Effector
{
	CName effectorClassName = "StatPoolBasedStatusEffectEffector";
	fk< StatPool > statPool = "";
	fk< StatusEffect > statusEffect = "";
	float statPoolStep = 0f;
	bool stepUsesPercent = false;
	float startingThreshold = 0f;
	bool thresholdUsesPercent = false;
	int minStacks = 0;
	int maxStacks = 0;
	bool inverted = false;
	bool roundUpwards = false;
	bool dontRemoveStacks = false;
	string targetOfStatPoolCheck = "";
}

DetectionMeterEffector : Effector
{
	CName effectorClassName = "DetectionMeterEffector";
	fk< StatusEffect > statusEffect = "";
	float detectionStep = 0f;
	int maxStacks = 0;
	bool onlyHostileDetection = false;
	bool dontRemoveStacks = false;
}

MakeDetectorRushAvailable : ApplyStatusEffectEffector
{
	prereqRecord = "Perks.CanEnableDetectorRush";
	statusEffect = "BaseStatusEffect.DetectorRushAvailableStatusEffect";
}

CanEnableSynapticAccelerator : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "AND";
	fk< IPrereq >[] nestedPrereqs = 
	[
		"Perks.IsPlayerInExploration", "Perks.IsPlayerNotInVehicle", "Perks.IsPlayerOutOfCombatOrInStealthPSMState", {
			checkType = "CheckType.Tag";
			tagToCheck = "SynapticAcceleratorBuff";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "BaseStatusEffect.SynapticAcceleratorCooldown";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "GameplayRestriction.PhoneCall";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "GameplayRestriction.NoDangerousCyberware";
		} : Prereqs.StatusEffectAbsentPrereq
	];
}

CanEnableSecondChancePerk : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "AND";
	fk< IPrereq >[] nestedPrereqs = 
	[
		"Perks.IsPlayerNotInVehicle", {
			statusEffect = "BaseStatusEffect.SecondChancePerkCooldown";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "GameplayRestriction.PhoneCall";
		} : Prereqs.StatusEffectAbsentPrereq
	];
}

CanActivateReflexRecorder : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "AND";
	fk< IPrereq >[] nestedPrereqs = 
	[
		"Perks.IsPlayerInCombatState", "Perks.IsPlayerInCritHealth", {
			statusEffect = "BaseStatusEffect.ReflexRecorderCooldown";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "BaseStatusEffect.ReflexRecorderListener";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			checkType = "CheckType.Tag";
			tagToCheck = "ReflexRecorderBuff";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "GameplayRestriction.PhoneCall";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "GameplayRestriction.NoDangerousCyberware";
		} : Prereqs.StatusEffectAbsentPrereq
	];
}

CanEnableDetectorRush : MultiPrereq
{
	CName prereqClassName = "gameMultiPrereq";
	CName aggregationType = "AND";
	fk< IPrereq >[] nestedPrereqs = 
	[
		"Perks.IsPlayerOutOfCombatOrInStealthPSMState", {
			checkType = "CheckType.Tag";
			tagToCheck = "DetectorRushBuff";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			statusEffect = "BaseStatusEffect.DetectorRushCooldown";
		} : Prereqs.StatusEffectAbsentPrereq
	];
}

CanUseDetectorRush : ANDPrereq
{
	fk< IPrereq >[] nestedPrereqs = 
	[
		{
			statusEffect = "BaseStatusEffect.DetectorRushAvailableStatusEffect";
		} : RTDB.StatusEffectPrereq, 
		"Perks.IsPlayerInExploration", "Perks.IsPlayerNotInVehicle", "Perks.IsPlayerInCombatState"
	];
}

CanEnableTroubleFinder : ANDPrereq
{
	fk< IPrereq >[] nestedPrereqs = 
	[
		"Perks.IsPlayerInExploration", "Perks.IsPlayerNotInVehicle", "Perks.IsPlayerOutOfCombatOrInStealthPSMState"
	];
}

IsPlayerInVehicle : IPrereq
{
	prereqClassName = "VehiclePSMPrereq";
	string stateName = "Default";
	bool isInState = false;
}

IsPlayerNotInVehicle : IPrereq
{
	prereqClassName = "VehiclePSMPrereq";
	string stateName = "Default";
	bool isInState = true;
}

IsPlayerDrivingOrInTransition : MultiPrereq
{
	aggregationType = "OR";
	nestedPrereqs = 
	[
		{
			stateName = "Transition";
		} : VehiclePSMPrereq, 
		{
			stateName = "Driving";
		} : VehiclePSMPrereq, 
		{
			stateName = "DriverCombat";
		} : VehiclePSMPrereq
	];
}

IsPlayerInExploration : IPrereq
{
	prereqClassName = "HighLevelPSMPrereq";
	string stateName = "SceneTier1";
	bool isInState = true;
}

IsPlayerInCritHealth : StatPoolPrereq
{
	valueToCheck = 
	[
		{
			statType = "BaseStats.Health";
			modifierType = "Additive";
			value = 25.0f;
		} : ConstantStatModifier
	];
	statPoolType = "Health";
	comparisonType = "LessOrEqual";
}

IsPlayerInLowHealth : StatPoolPrereq
{
	valueToCheck = 
	[
		{
			statType = "BaseStats.Health";
			modifierType = "Additive";
			value = 40.0f;
		} : ConstantStatModifier
	];
	CName statPoolType = "Health";
	CName comparisonType = "LessOrEqual";
}

IsPlayerInHighHealth : StatPoolPrereq
{
	valueToCheck = 
	[
		{
			statType = "BaseStats.Health";
			modifierType = "Additive";
			value = 75.0f;
		} : ConstantStatModifier
	];
	CName statPoolType = "Health";
	CName comparisonType = "GreaterOrEqual";
}

IsPlayerOutOfCombatOrInStealthPSMState : CombatPSMPrereq
{
	stateName = "InCombat";
	isInState = false;
}

IsPlayerInCombatState : CombatPSMPrereq
{
	stateName = "InCombat";
}

IsPlayerInStealthState : CombatPSMPrereq
{
	stateName = "Stealth";
}

PerfectDischargePrereq : StatPoolPrereq
{
	prereqClassName = "PerfectDischargePrereq";
	float perfectDischargeWindow = 0;
	statPoolType = "WeaponCharge";
	objectToCheck = "Weapon";
	bool invert = false;
}

PerfectChargeWindowInverted : PerfectDischargePrereq
{
	invert = true;
}

PrePerfectChargeIndication : ANDPrereq
{
	nestedPrereqs = 
	[
		{
			string stateName = "Charging";
		} : Prereqs.RangedWeaponPSMPrereq, 
		{
			statusEffect = "BaseStatusEffect.Tech_Right_Milestone_3_Block";
		} : Prereqs.StatusEffectAbsentPrereq, 
		"Perks.PerfectDischargePrereq"
	];
}

IsPerfectChargePossible : ANDPrereq
{
	nestedPrereqs = 
	[
		{
			string stateName = "Charging";
		} : Prereqs.RangedWeaponPSMPrereq, 
		{
			statusEffect = "BaseStatusEffect.Tech_Right_Milestone_3_Block";
		} : Prereqs.StatusEffectAbsentPrereq, 
		"Perks.PerfectDischargePrereq"
	];
}

IsPerfectChargeAchieved : ANDPrereq
{
	nestedPrereqs = 
	[
		{
			string stateName = "Shoot";
		} : Prereqs.RangedWeaponPSMPrereq, 
		{
			statusEffect = "BaseStatusEffect.Tech_Right_Milestone_3_Block";
		} : Prereqs.StatusEffectAbsentPrereq, 
		"Perks.PerfectDischargePrereq"
	];
}

PerfectChargeOvercharged : StatPoolPrereq
{
	statPoolType = "WeaponCharge";
	valueToCheck = 
	[
		{
			statType = "BaseStats.Charge";
			modifierType = "Additive";
			value = 49.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.Charge";
			modifierType = "Additive";
			refObject = "Player";
			refStat = "BaseStats.CanFullyChargeWeapon";
			opSymbol = "*";
			value = 25.0f;
		} : CombinedStatModifier, 
		{
			statType = "BaseStats.Charge";
			modifierType = "Additive";
			refObject = "Player";
			refStat = "BaseStats.CanOverchargeWeapon";
			opSymbol = "*";
			value = 25.0f;
		} : CombinedStatModifier
	];
	comparisonType = "Greater";
	objectToCheck = "Weapon";
}

CanControlFullyChargedWeaponPrereq : StatPrereq
{
	statType = "CanControlFullyChargedWeapon";
	valueToCheck = 1;
	comparisonType = "Equal";
}

CannotControlFullyChargedWeaponPrereq : CanControlFullyChargedWeaponPrereq
{
	comparisonType = "NotEqual";
}

PerfectChargeUndercharged : ANDPrereq
{
	nestedPrereqs = 
	[
		{
			string stateName = "Shoot";
		} : Prereqs.RangedWeaponPSMPrereq, 
		{
			statusEffect = "BaseStatusEffect.Tech_Right_Milestone_3_Buff";
		} : Prereqs.StatusEffectAbsentPrereq, 
		{
			invert = true;
		} : PerfectDischargePrereq
	];
}

