local PLUGIN = PLUGIN

SWEP.Base = "exp_tacrp_m4"
SWEP.Spawnable = false -- deprecated by ST AR-15

AddCSLuaFile()

-- names and stuff
SWEP.PrintName = "Colt Canada AR-15"
SWEP.AbbrevName = "AR-15"
SWEP.Category = "Tactical RP"

SWEP.SubCatTier = "3Security"
SWEP.SubCatType = "5Sporter Carbine"

SWEP.Description = "Semi-automatic model of an ubiquitous American rifle.\nUses reduced capacity magazines."

SWEP.ViewModel = "models/weapons/tacint/v_m4.mdl"
SWEP.WorldModel = "models/weapons/tacint/w_m4.mdl"

SWEP.Slot = 2


SWEP.BalanceStats = {
	[PLUGIN.BALANCE_SBOX] = {
		Description = "Semi-automatic model of an ubiquitous American rifle. Fine tuned for precision shooting.",

		Damage_Max = 22,
		Damage_Min = 15,
		Recoil_Kick = 1.5,
		Spread = 0.001,
	},
	[PLUGIN.BALANCE_TTT] = {
		Description = "Semi-automatic model of an ubiquitous American rifle. Fine tuned for precision shooting.",

		Damage_Max = 17,
		Damage_Min = 14,
		Range_Min = 600,
		Range_Max = 2500,
		RPM = 420,

		Recoil_Kick = 1.5,
		Spread = 0.001,

		RecoilDissipationRate = 12,
		RecoilSpreadPenalty = 0.002,

		BodyDamageMultipliers = {
			[HITGROUP_HEAD] = 4,
			[HITGROUP_CHEST] = 1.25,
			[HITGROUP_STOMACH] = 1,
			[HITGROUP_LEFTARM] = 0.9,
			[HITGROUP_RIGHTARM] = 0.9,
			[HITGROUP_LEFTLEG] = 0.75,
			[HITGROUP_RIGHTLEG] = 0.75,
			[HITGROUP_GEAR] = 0.9
		},
	},
}

SWEP.RPM = 650

SWEP.Firemode = 1
SWEP.Firemodes = false

SWEP.ClipSize = 15

SWEP.Attachments = {
	[1] = {
		PrintName = "Optic",
		Category = { "optic_cqb", "optic_medium" },
		InstalledElements = { "sights" },
		Bone = "ValveBiped.m4_rootbone",
		WMBone = "Box01",
		AttachSound = "TacRP/weapons/optic_on.wav",
		DetachSound = "TacRP/weapons/optic_off.wav",
		VMScale = 1,
		Pos_VM = Vector(-5.35, -0.05, 7),
		Pos_WM = Vector(0.75, 5, 1.15),
		Ang_VM = Angle(90, 0, 0),
		Ang_WM = Angle(0, -90 + 3.5, 0),
	},
	[2] = {
		PrintName = "Muzzle",
		Category = "silencer",
		Bone = "ValveBiped.m4_rootbone",
		WMBone = "Box01",
		AttachSound = "TacRP/weapons/silencer_on.wav",
		DetachSound = "TacRP/weapons/silencer_off.wav",
		Pos_VM = Vector(-3.95, 0, 23),
		Pos_WM = Vector(1.4, 21, -0.5),
		Ang_VM = Angle(90, 0, 0),
		Ang_WM = Angle(0, -90 + 3.5, 0),
	},
	[3] = {
		PrintName = "Tactical",
		Category = "tactical",
		Bone = "ValveBiped.m4_rootbone",
		WMBone = "Box01",
		AttachSound = "TacRP/weapons/flashlight_on.wav",
		DetachSound = "TacRP/weapons/flashlight_off.wav",
		Pos_VM = Vector(-3.9, -1.2, 13.5),
		Pos_WM = Vector(2, 13, -0.5),
		Ang_VM = Angle(90, 0, -90),
		Ang_WM = Angle(-90, -90 + 3.5, 0),
	},
	[4] = {
		PrintName = "Accessory",
		Category = { "acc", "acc_foldstock2", "acc_sling", "acc_duffle", "perk_extendedmag" },
		AttachSound = "tacrp/weapons/flashlight_on.wav",
		DetachSound = "tacrp/weapons/flashlight_off.wav",
	},
	[5] = {
		PrintName = "Bolt",
		Category = { "bolt_automatic" },
		AttachSound = "TacRP/weapons/flashlight_on.wav",
		DetachSound = "TacRP/weapons/flashlight_off.wav",
	},
	[6] = {
		PrintName = "Trigger",
		Category = { "trigger_semi" },
		AttachSound = "TacRP/weapons/flashlight_on.wav",
		DetachSound = "TacRP/weapons/flashlight_off.wav",
	},
	[7] = {
		PrintName = "Ammo",
		Category = { "ammo_rifle" },
		AttachSound = "TacRP/weapons/flashlight_on.wav",
		DetachSound = "TacRP/weapons/flashlight_off.wav",
	},
	[8] = {
		PrintName = "Perk",
		Category = { "perk", "perk_melee", "perk_shooting", "perk_reload" },
		AttachSound = "tacrp/weapons/flashlight_on.wav",
		DetachSound = "tacrp/weapons/flashlight_off.wav",
	},
}
