package Items
using RTDB, BaseStats, Prereqs, Perks

[ notQueryable ]
Base_Chainsword : Base_Blade
{
	tags += 
	[
		"ChainswordFinisher", "FinisherFront", "FinisherBack", "DriverCombatBikeWeapon"
	];
	fk< ItemType > itemType = "ItemType.Wea_Chainsword";
	triggerEffectName = "te_wea_melee_swing_mid";
	string friendlyName = "w_melee_one_hand_blunt";
	fk< ConstantStatModifier > price = 
	{
		statType = "BaseStats.Price";
		modifierType = "Additive";
		value = 2;
	} : ConstantStatModifier;
	fk< AttachmentSlot >[] placementSlots += 
	[
		"AttachmentSlots.ItemSlotSMG"
	];
	fk< SlotItemPartPreset >[] slotPartListPreset = 
	[
		{
			slot = "AttachmentSlots.Grip";
			fk< Item > itemPartPreset = "Items.w_chainsword_common_grip";
		}
	];
	fk< WeaponFxPackage > fxPackage = "WeaponFxPackage.ChainswordFxPackage";
	statPools = 
	[
		"BaseStatPools.TechMeleeCharge"
	];
	fk< StatModifierGroup >[] statModifierGroups += 
	[
		"Items.Base_Melee_Tech_Stats", "Items.Base_Chainsword_RPG_Stats", "Items.Base_Chainsword_Handling_Stats", "Items.Base_Chainsword_Misc_Stats", "Items.Base_Melee_Weapon_Damage_Type_Physical", "Items.Base_Melee_Weapon_Damage_Type_Physical_Min_Max", "Items.Chainsword_Damage_Stats"
	];
	fk< Attack >[] attacks += 
	[
		"ChainswordAttacks.ChainswordComboAttack1", "ChainswordAttacks.ChainswordComboAttack2", "ChainswordAttacks.ChainswordComboAttack3", "ChainswordAttacks.ChainswordComboAttack4", "ChainswordAttacks.ChainswordMountedComboAttack1", "ChainswordAttacks.ChainswordMountedComboAttack2", "ChainswordAttacks.ChainswordMountedComboAttack3", "ChainswordAttacks.ChainswordMountedComboAttack4", "ChainswordAttacks.ChainswordFinalAttack1", "ChainswordAttacks.ChainswordFinalAttack2", "ChainswordAttacks.ChainswordFinalAttack3", "ChainswordAttacks.ChainswordMountedFinalAttack1", "ChainswordAttacks.ChainswordMountedFinalAttack2", "ChainswordAttacks.ChainswordMountedFinalAttack3", "ChainswordAttacks.ChainswordStrongAttack1", "ChainswordAttacks.ChainswordStrongAttack2", "ChainswordAttacks.ChainswordStrongAttack3", "ChainswordAttacks.ChainswordMountedStrongAttack1", "ChainswordAttacks.ChainswordMountedStrongAttack2", "ChainswordAttacks.ChainswordMountedStrongAttack3", "ChainswordAttacks.ChainswordJumpAttack", "ChainswordAttacks.ChainswordCrouchAttack", "ChainswordAttacks.ChainswordSprintAttack", "ChainswordAttacks.ChainswordSafeAttack", "ChainswordAttacks.ChainswordBlockAttack", "ChainswordAttacks.ChainswordDeflectAttack"
	];
	audioWeaponConfiguration = "audio_melee_metadata_cutomatic";
	enableNpcRPGData = true;
	npcRPGData = 
	{
		statModifierGroups += 
		[
		];
	} : Base_Chainsword_NPC_Data;
	OnAttach += 
	[
		{
			effectors = 
			[
				"Items.ChainswordBuzzEffector", "Items.ChainswordFXEffector", "Effectors.WeaponChargeRatioCalculatorEffector"
			];
		}
	];
}

Base_Chainsword_NPC_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			statType = "BaseStats.Range";
			modifierType = "Additive";
			value = 1.5f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.CanBlock";
			modifierType = "Multiplier";
			value = 0;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HitReactionFactor";
			modifierType = "Additive";
			value = 2.f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HitWoundsFactor";
			modifierType = "Additive";
			value = 1;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HitDismembermentFactor";
			modifierType = "Multiplier";
			value = 5.f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HitDismembermentFactor";
			modifierType = "Additive";
			value = 1;
		} : ConstantStatModifier, 
		{
			float value = 15.f;
		} : KnockdownImpulseModifier, 
		{
			float value = 15.f;
		} : BaseKnockdownImpulseModifier, 
		{
			float value = 15.f;
		} : BaseEvadeImpulseModifier, 
		{
			float value = 8.f;
		} : PhysicalImpulseModifier, 
		{
			value = 0.4f;
		} : EquipItemTime_GangModifier, 
		{
			value = 1.167f;
		} : EquipAnimationDuration_GangModifier, 
		{
			value = 1.9f;
		} : EquipActionDuration_GangModifier, 
		{
			value = 0.933f;
		} : UnequipItemTime_GangModifier, 
		{
			value = 1.067f;
		} : UnequipAnimationDuration_GangModifier, 
		{
			value = 1.4f;
		} : UnequipDuration_GangModifier, 
		{
			value = 0.4f;
		} : EquipItemTime_CorpoModifier, 
		{
			value = 1.167f;
		} : EquipAnimationDuration_CorpoModifier, 
		{
			value = 1.9f;
		} : EquipActionDuration_CorpoModifier, 
		{
			value = 0.933f;
		} : UnequipItemTime_CorpoModifier, 
		{
			value = 1.067f;
		} : UnequipAnimationDuration_CorpoModifier, 
		{
			value = 1.4f;
		} : UnequipDuration_CorpoModifier
	];
}

Base_Chainsword_NPC_Data : Base_Blade_NPC_RPG_Data
{
	statModifierGroups += 
	[
		"Items.Base_Chainsword_NPC_Stats", "Items.Chainsword_NPC_Damage_Stats"
	];
}

Base_Chainsword_RPG_Stats : StatModifierGroup
{
	statModifiers = 
	[
		{
			statType = "BaseStats.Weight";
			modifierType = "Additive";
			value = 5.4f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HitWoundsFactor";
			modifierType = "Multiplier";
			value = 3.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.HitDismembermentFactor";
			modifierType = "Multiplier";
			value = 6.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.DurationBonusBleeding";
			modifierType = "Additive";
			value = 2.0f;
		} : ConstantStatModifier, 
		"AttackModifier.WeaponArmorPenetrationMedium", {
			value = 100.f;
		} : ChargeModifier, 
		{
			value = 1.2f;
		} : ChargeTimeModifier, 
		{
			statType = "BaseStats.BleedingApplicationRate";
			modifierType = "Additive";
			refObject = "Player";
			refStat = "BaseStats.SEApplicationRateBasedOnWeaponCharge";
			opSymbol = "*";
			value = 1.0f;
		} : CombinedStatModifier, 
		{
			statType = "BaseStats.BlockFactor";
			modifierType = "Additive";
			value = 4f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.VehicleMinHealthPercentWhenDamaged";
			modifierType = "Multiplier";
			value = 0f;
		} : ConstantStatModifier
	];
}

Chainsword_Damage_Stats : StatModifierGroup
{
	fk< StatModifier >[] statModifiers = 
	[
		{
			statType = "BaseStats.DPS";
			modifierType = "Additive";
			value = 76f;
		} : ConstantStatModifier
	];
}

Chainsword_NPC_Damage_Stats : StatModifierGroup
{
	fk< StatModifier >[] statModifiers = 
	[
		{
			statType = "BaseStats.DPS";
			modifierType = "Additive";
			value = 67f;
		} : ConstantStatModifier
	];
}

Base_Chainsword_Handling_Stats : StatModifierGroup
{
	fk< StatModifier >[] statModifiers = 
	[
		{
			statType = "BaseStats.Range";
			modifierType = "Additive";
			value = 2.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.AttacksNumber";
			modifierType = "Additive";
			value = 3;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.MeleeAttackDuration";
			modifierType = "Additive";
			value = 0.5f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.MeleeAttackComboDuration";
			modifierType = "Additive";
			value = 0.586f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.AttackSpeed";
			modifierType = "Multiplier";
			value = 0.8f;
		} : ConstantStatModifier, 
		{
			float value = 30.f;
		} : KnockdownImpulseModifier, 
		{
			float value = 30.f;
		} : BaseKnockdownImpulseModifier, 
		{
			float value = 30.f;
		} : BaseEvadeImpulseModifier, 
		{
			float value = 15.f;
		} : PhysicalImpulseModifier, 
		{
			statType = "BaseStats.StaminaCostToBlock";
			modifierType = "Multiplier";
			value = 1.212f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.BaseMeleeAttackStaminaCost";
			modifierType = "Additive";
			value = 12f;
		} : ConstantStatModifier
	];
}

Base_Chainsword_Misc_Stats : StatModifierGroup
{
	fk< StatModifier >[] statModifiers = 
	[
		{
			float value = 0.4f;
		} : EquipDurationModifier, 
		"BaseStats.UnequipDurationModifier", {
			statType = "BaseStats.ZoomLevel";
			modifierType = "Additive";
			value = 0.0f;
		} : ConstantStatModifier, 
		{
			statType = "BaseStats.EquipDuration_First";
			modifierType = "Additive";
			value = 5f;
		} : ConstantStatModifier
	];
}

ChainswordBuzzEffector : BroadcastStimEffector
{
	fk< StimType > type = "StimTypes.Alarm";
	float radius = 13.f;
}

ChainswordIdleFX : StatusEffect
{
	fk< StatModifierGroup > duration = "BaseStats.InfiniteDuration";
	fk< StatusEffectFX >[] VFX = 
	[
		{
			name = "fx_chainsword_idle";
		}
	];
}

ChainswordFXEffector : ApplyStatusEffectOnWeapon
{
	prereqRecord = 
	{
		bool isInState = false;
		string stateName = "NotReady";
	} : MeleeWeaponPSMPrereq;
	statusEffect = "Items.ChainswordIdleFX";
	bool removeWithEffector = true;
}

w_chainsword_common_grip : ItemWeaponRoot
{
	string friendlyName = "w_chainsword_common_grip";
	CName appearanceResourceName = "w_chainsword_common_grip";
}

