$modelname "weapons/tfa_pd2/ass/m16/c_m16.mdl"

$scale 40

$bodygroup "Upper Reciever"
{
	studio "g_upper_lod0.smd"
	blank
}

$bodygroup "Barrel"
{
	studio "g_barrel.smd"
	blank
}

$bodygroup "Bolt"
{
	studio "g_bolt.smd"
	blank
}

$bodygroup "Bullets"
{
	studio "g_bullet_m_2.smd"
	studio "g_bullet_m_1.smd"
	blank
}

$bodygroup "Drag Handle"
{
	studio "g_draghandle.smd"
	blank
}

$bodygroup "Foregrip"
{
	studio "g_standard.smd"
	blank
	studio "g_railed.smd"
	studio "g_vietnam.smd"
	studio "g_g.smd"
}

$bodygroup "Rail"
{
	studio "g_handlesight.smd"
    blank
}

$bodygroup "Front Sight"
{
	studio "g_frontsight.smd"
    blank
}

$bodygroup "Lower Reciever"
{
	studio "g_lower_reciever.smd"
	blank
}

$bodygroup "Mag"
{
	studio "g_straight_mag_lod0.smd"
	blank
}

$bodygroup "Grip"
{
	studio "g_wpn_fps_upg_m4_g_standard.smd"
	blank
}

$bodygroup "Stock Adapter Add"
{
	blank
	studio "g_wpn_fps_upg_m4_s_adapter.smd"
}

$bodygroup "Stock"
{
	studio "g_solid.smd"
	blank
}

$surfaceprop "default"

$contents "solid"

$illumposition 0 0 0

$cdmaterials "models/weapons/tfa_pd2/ass/m16/"
$cdmaterials "models/weapons/tfa_pd2/ass/m4/"
$cdmaterials "models/weapons/tfa_pd2/shared/"

$attachment "camera" "eyeAim" 0 0 0 rotate 0 90 0
$attachment "muzzle" "muzzlePoint" 0 0 0 rotate -90 -0 -0
$attachment "shell" "ejectPoint" 0 0 0 rotate -45 145 90
$attachment "laser" "laserPoint" 0 0 0 rotate -90 180 90
$attachment "flash" "flashPoint" 0 0 0 rotate -90 180 90

$cbox 0 0 0 0 0 0

// DefineBones goes here

$bonemerge "LeftHandThumb1"
$bonemerge "LeftHandThumb2"
$bonemerge "LeftHandThumb3"
$bonemerge "LeftHandIndex1"
$bonemerge "LeftHandIndex2"
$bonemerge "LeftHandIndex3"
$bonemerge "LeftHandMiddle1"
$bonemerge "LeftHandMiddle2"
$bonemerge "LeftHandMiddle3"
$bonemerge "LeftHandRing1"
$bonemerge "LeftHandRing2"
$bonemerge "LeftHandRing3"
$bonemerge "LeftHandPinky1"
$bonemerge "LeftHandPinky2"
$bonemerge "LeftHandPinky3"
$bonemerge "LeftForeArm"
$bonemerge "LeftHand"
$bonemerge "LeftArm"
$bonemerge "RightHandThumb1"
$bonemerge "RightHandThumb2"
$bonemerge "RightHandThumb3"
$bonemerge "RightHandIndex1"
$bonemerge "RightHandIndex2"
$bonemerge "RightHandIndex3"
$bonemerge "RightHandMiddle1"
$bonemerge "RightHandMiddle2"
$bonemerge "RightHandMiddle3"
$bonemerge "RightHandRing1"
$bonemerge "RightHandRing2"
$bonemerge "RightHandRing3"
$bonemerge "RightHandPinky1"
$bonemerge "RightHandPinky2"
$bonemerge "RightHandPinky3"
$bonemerge "RightForeArm"
$bonemerge "RightHand"
$bonemerge "RightArm"

$bonemerge "aim"
$bonemerge "ejectPoint"
$bonemerge "muzzlePoint"
$bonemerge "laserPoint"
$bonemerge "flashPoint"
$bonemerge "a_o"
$bonemerge "a_ns"
$bonemerge "a_fl"
$bonemerge "a_r"
$bonemerge "a_g"
$bonemerge "a_s"
$bonemerge "a_m"
$bonemerge "a_b"
$bonemerge "a_fg"
$bonemerge "a_body"
$bonemerge "a_dh"
$bonemerge "a_os"

// Base

$sequence "a_root" {
	"anims/a_root.smd"
	fps 30
	loop
}

$sequence "m4_idle_delta" { "anims/m4_idle.smd" }

$sequence "delta_empty" {
    "anims/m4_idle_empty.smd"
	"anims/m4_idle.smd"
	blendwidth 2
    blend PM_Empty 1 0
    delta
    subtract "m4_idle_delta" 0
}

// Anims
$sequence "m4_idle" {
    "anims/m4_idle.smd"
    activity "ACT_VM_IDLE" 1
	fps 30
	loop
	addlayer "delta_empty"
}



$sequence "m4_recoil_delta" { "anims/m4_recoil.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_recoil" {
    "anims/m4_recoil_base.smd"
    activity "ACT_VM_PRIMARYATTACK" 1
    fadein 0.2
    fadeout 0.2
    snap
    fps 30
	addlayer "m4_recoil_delta"
}



$sequence "m4_recoil_last_delta" { "anims/m4_recoil_last.smd" hidden delta subtract "m4_idle_delta" 0 }
$sequence "m4_recoil_last" {
    "anims/m4_recoil_last_base.smd"
    activity "ACT_VM_PRIMARYATTACK_EMPTY" 1
    fadein 0.2
    fadeout 0.2
    snap
    fps 30
	addlayer "m4_recoil_last_delta"
}



$sequence "m4_recoil_enter_delta" { "anims/m4_recoil_enter.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_recoil_enter" {
    "anims/m4_recoil_enter_base.smd"
    fadein 0.2
    fadeout 0.2
    snap
    fps 30
	addlayer "m4_recoil_enter_delta"
}



$sequence "m4_recoil_loop_delta" { "anims/m4_recoil_loop.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_recoil_loop" {
    "anims/m4_recoil_loop_base.smd"
    fadein 0.2
    fadeout 0.2
    loop
    fps 30
	addlayer "m4_recoil_loop_delta"
}



$sequence "m4_recoil_exit_delta" { "anims/m4_recoil_exit.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_recoil_exit" {
    "anims/m4_recoil_exit_base.smd"
    fadein 0.04
    fadeout 0.1
    fps 30
	addlayer "m4_recoil_exit_delta"
}



$sequence "m4_equip_delta" { "anims/m4_equip.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_equip" {
    "anims/m4_equip_base.smd"
    activity "ACT_VM_DRAW" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_equip_delta"
	addlayer "delta_empty"
}



$sequence "m4_unequip_delta" { "anims/m4_unequip.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_unequip" {
    "anims/m4_unequip_base.smd"
    activity "ACT_VM_HOLSTER" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_unequip_delta"
	addlayer "delta_empty"
}



$sequence "m4_sprint_enter_delta" { "anims/m4_sprint_enter.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_sprint_enter" {
    "anims/m4_sprint_enter_base.smd"
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_sprint_enter_delta"
	addlayer "delta_empty"
}



$sequence "m4_sprint_delta" { "anims/m4_sprint.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_sprint" {
    "anims/m4_sprint_base.smd"
    fadein 0.2
    fadeout 0.2
    fps 30
	loop
	addlayer "m4_sprint_delta"
	addlayer "delta_empty"
}



$sequence "m4_sprint_exit_delta" { "anims/m4_sprint_exit.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_sprint_exit" {
    "anims/m4_sprint_exit_base.smd"
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_sprint_exit_delta"
	addlayer "delta_empty"
}



$sequence "m4_inspect_delta" { "anims/m4_inspect.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_inspect" {
    "anims/m4_inspect_base.smd"
    activity "ACT_VM_FIDGET" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_inspect_delta"
	addlayer "delta_empty"
}


$sequence "m4_melee_delta" { "anims/m4_melee.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_melee" {
    "anims/m4_melee_base.smd"
    activity "ACT_VM_HITCENTER" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_melee_delta"
	addlayer "delta_empty"
}



$sequence "m4_melee_miss_delta" { "anims/m4_melee_miss.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m4_melee_miss" {
    "anims/m4_melee_miss_base.smd"
    activity "ACT_VM_MISSCENTER" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m4_melee_miss_delta"
	addlayer "delta_empty"
}



$sequence "m16_reload_not_empty_delta" { "anims/m16_reload_not_empty.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m16_reload_not_empty" {
    "anims/m16_reload_not_empty_base.smd"
    activity "ACT_VM_RELOAD" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m16_reload_not_empty_delta"
}



$sequence "m16_reload_delta" { "anims/m16_reload.smd" hidden delta subtract "m4_idle" 0 }
$sequence "m16_reload" {
    "anims/m16_reload_base.smd"
    activity "ACT_VM_RELOAD_EMPTY" 1
    fadein 0.2
    fadeout 0.2
    fps 30
	addlayer "m16_reload_delta"
}