$modelname "v_models\v_huntingrifle.mdl"

$cdmaterials models\v_models\Weapons\sniper
$cdmaterials models\w_models\tac_light

$include "QCIs/definebones.qci"
$include "QCIs/bonemerge.qci"

$opaque

$attachment shell "ValveBiped.weapon_bone" 0 0 0 rotate 0 0 0 RIGID

$model huntingrifle "DMX/v_hunting_rifle_model.dmx"


// animation
$animblocksize 32


// Model (+)Right -- (-)Left		(+)Forward -- (-)Backward		(+)Down -- (-)Up
$origin		-4.6									1.0						65.0

$pushd "DMX/animation"


$ikchain lhand "ValveBiped.Bip01_L_Hand"
$ikchain rhand "ValveBiped.Bip01_R_Hand"

$attachment "fowardnode" "ValveBiped.weapon_bone" 0 0 0 RIGID

$weightlist VIEWARMS "Valvebiped.Bip01" 1.0
$weightlist Sniper_ARM "Valvebiped.Bip01" 1.0

$animation anim_Sniper_neutral "v_Sniper_NamVet_Idle" frame 0 0 weightlist Sniper_ARM

// IDLE
$animation a_sniper_pose_neutral "v_Sniper_NamVet_Pose" frames 0 0
$animation a_sniper_arms_trans_down "v_Sniper_NamVet_Pose" frame 2 2 subtract a_sniper_pose_neutral 0 weightlist VIEWARMS
$animation a_sniper_arms_trans "v_Sniper_NamVet_Pose" frame 0 0 subtract a_sniper_pose_neutral 0 weightlist VIEWARMS
$animation a_sniper_arms_trans_up "v_Sniper_NamVet_Pose" frame 1 1 subtract a_sniper_pose_neutral 0 weightlist VIEWARMS
$sequence a_sniper_arms_vaims {
	a_sniper_arms_trans_down a_sniper_arms_trans a_sniper_arms_trans_up
	blend ver_aims  1 -1
	delta hidden
	}
$animation ta_sniper_run_trans_idle "v_Sniper_NamVet_idle_02" ikrule lhand touch "ValveBiped.weapon_bone"  ikrule rhand touch "ValveBiped.weapon_bone"
$animation ta_sniper_run_trans_run "v_Sniper_NamVet_run" ikrule lhand touch "ValveBiped.weapon_bone"  ikrule rhand touch "ValveBiped.weapon_bone"
$sequence sniper_idle {
	ta_sniper_run_trans_run ta_sniper_run_trans_idle  ta_sniper_run_trans_run
	blend move_x 1 -1 loop
	addlayer a_sniper_arms_vaims
	activity ACT_VM_IDLE_SNIPER 1
	}

// --------------  BEGIN PICKUP SET -----------------------------------------------------------------
// PICKUP
$sequence sniper_pickup {
	"v_Sniper_NamVet_pickup" frame 0 131 fps 32
	{ event AE_PICKUP_CLIPIN 40 }
	activity ACT_VM_PICKUP_SNIPER 1
}
		// layers
$animation anim_Sniper_pickup "v_Sniper_NamVet_pickup" frame 0 145 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_pickup_layer {
	anim_Sniper_pickup FPS 32 delta weightlist Sniper_ARM
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 20 "HuntingRifle.ClipIn" }
	{ event 5004 38 "HuntingRifle.ClipLocked" }
	{ event 5004 71 "HuntingRifle.BoltBack" }
	{ event 5004 82 "HuntingRifle.BoltForward" }
	{ event 5004 115 "HuntingRifle.PushButton"  }
	{ event AE_PICKUP_CLIPIN 40 }
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	activity ACT_VM_PICKUP_SNIPER_LAYER 1
}


// PICKUP PARTIAL
$sequence sniper_pickup_partial {
	"v_Sniper_NamVet_pickup_partial" frame 0 93 fps 32
	{ event AE_PICKUP_CHARGING 40 }
	activity ACT_VM_PICKUP_CLIPIN_SNIPER 1
}
		// layer
$animation anim_Sniper_pickup_partial "v_Sniper_NamVet_pickup_partial" frame 0 105 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_pickup_partial_layer {
	anim_Sniper_pickup_partial FPS 32 weightlist Sniper_ARM delta fadein 0.0 fadeout 0.2
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 31 "HuntingRifle.BoltBack" }
	{ event 5004 42 "HuntingRifle.BoltForward" }
	{ event 5004 75 "HuntingRifle.PushButton"  }
	{ event AE_PICKUP_CHARGING 40 }
	activity ACT_VM_PICKUP_CLIPIN_SNIPER_LAYER 1
}

	// PICKUP PARTIAL 2
$sequence sniper_pickup_partial2 {
	"v_Sniper_NamVet_pickup_partial2" frame 0 38 fps 32
	activity ACT_VM_PICKUP_CHARGING_SNIPER 1
}
		// layer
$animation anim_Sniper_pickup_partial2 "v_Sniper_NamVet_pickup_partial2" frame 0 50 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_pickup_partial2_layer {
	anim_Sniper_pickup_partial2 FPS 32 weightlist Sniper_ARM delta fadein 0.0 fadeout 0.2
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 20 "HuntingRifle.PushButton"  }
	activity ACT_VM_PICKUP_CHARGING_SNIPER_LAYER 1
}

// --------------  END PICKUP SET -----------------------------------------------------------------

// --------------  BEGIN RELOAD SET -----------------------------------------------------------------
// RELOAD
$sequence sniper_reload1 {
	"v_Sniper_NamVet_reload" frame 0 100 fps 32
	{ event AE_RELOAD_CLIPOUT 27 }
	activity ACT_VM_RELOAD_SNIPER 1
}
		// layer
$animation anim_Sniper_reload "v_Sniper_NamVet_reload" frame 0 120 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_reload_layer {
	anim_Sniper_reload FPS 32 delta weightlist Sniper_ARM
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 18 "HuntingRifle.ClipOut" }
	{ event 5004 61 "HuntingRifle.ClipIn" }
	{ event 5004 80 "HuntingRifle.ClipLocked" }
	{ event AE_RELOAD_CLIPOUT 27 }
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	activity ACT_VM_RELOAD_SNIPER_LAYER 1
}

// RELOAD CLIPOUT
$sequence sniper_reload_clipout {
	"v_Sniper_NamVet_reload_clipout" frame 0 60 fps 32
	activity ACT_VM_RELOAD_CLIPOUT_SNIPER 1
}
		// layer
$animation anim_Sniper_reload_clipout "v_Sniper_NamVet_reload_clipout" frame 0 80 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_reload_clipout_layer {
	anim_Sniper_reload_clipout FPS 32 delta weightlist Sniper_ARM
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 21 "HuntingRifle.ClipIn" }
	{ event 5004 38 "HuntingRifle.ClipLocked" }
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	activity ACT_VM_RELOAD_CLIPOUT_SNIPER_LAYER 1
}

// --------------  END RELOAD SET -----------------------------------------------------------------


// --------------  BEGIN RELOAD EMPTY SET -----------------------------------------------------------------
// RELOAD EMPTY
$sequence sniper_reload_empty {
	"v_Sniper_NamVet_reload_empty" frame 0 121 fps 32
	{ event AE_RELOAD_EMPTY_CLIPOUT 27 }
	{ event AE_RELOAD_EMPTY_CLIPIN 80 }
	activity ACT_VM_RELOAD_EMPTY_SNIPER 1
}
		// layer
$animation anim_Sniper_reload_empty "v_Sniper_NamVet_reload_empty" frame 0 130 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_reload_empty_layer {
	anim_Sniper_reload_empty FPS 32 delta weightlist Sniper_ARM
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 19 "HuntingRifle.ClipOut" }
	{ event 5004 61 "HuntingRifle.ClipIn" }
	{ event 5004 78 "HuntingRifle.ClipLocked" }
	{ event 5004 107 "HuntingRifle.PushButton"  }
	{ event AE_RELOAD_EMPTY_CLIPOUT 27 }
	{ event AE_RELOAD_EMPTY_CLIPIN 80 }
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	activity ACT_VM_RELOAD_EMPTY_SNIPER_LAYER 1
}

// RELOAD EMPTY CLIPOUT
$sequence sniper_reload_empty_clipout {
	"v_Sniper_NamVet_reload_empty_clipout" frame 0 81 fps 32
	{ event AE_RELOAD_EMPTY_CLIPIN 40 }
	activity ACT_VM_RELOAD_EMPTY_CLIPOUT_SNIPER 1
}
		// layer
$animation anim_Sniper_reload_empty_clipout "v_Sniper_NamVet_reload_empty_clipout" frame 0 90 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_reload_empty_clipout_layer {
	anim_Sniper_reload_empty_clipout FPS 32 delta weightlist Sniper_ARM
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 20 "HuntingRifle.ClipIn" }
	{ event 5004 39 "HuntingRifle.ClipLocked" }
	{ event 5004 67 "HuntingRifle.PushButton"  }
	{ event AE_RELOAD_EMPTY_CLIPIN 40 }
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	activity ACT_VM_RELOAD_EMPTY_CLIPOUT_SNIPER_LAYER 1
}

// RELOAD PARTIAL
$sequence sniper_reload_empty_partial {
	"v_Sniper_NamVet_reload_empty_partial" frame 0 65 fps 32
	activity ACT_VM_RELOAD_EMPTY_CLIPIN_SNIPER 1
}
		// layer
$animation anim_Sniper_reload_empty_partial "v_Sniper_NamVet_reload_empty_partial" frame 0 90 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_reload_empty_partial_layer {
	anim_Sniper_reload_empty_partial FPS 32 weightlist Sniper_ARM delta fadein 0.0 fadeout 0.2
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 20 "HuntingRifle.PushButton"  }
	activity ACT_VM_RELOAD_EMPTY_CLIPIN_SNIPER_LAYER 1
}

// --------------  END RELOAD EMPTY SET -----------------------------------------------------------------

//DEPLOY
$sequence sniper_draw "v_Sniper_NamVet_deploy" frame 0 30 fps 30 snap activity ACT_VM_DEPLOY_SNIPER 1 { event 5004 13 "HuntingRifle.Deploy" }
	// layer
$animation anim_Sniper_deploy "v_Sniper_NamVet_deploy" frame 0 55 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_deploy_layer {
	anim_Sniper_deploy FPS 30 delta weightlist Sniper_ARM fadein 0.0 fadeout 0.2
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 1 "HuntingRifle.Deploy" }
	activity ACT_VM_DEPLOY_SNIPER_LAYER 1
}


// SHOOT
$sequence sniper_shoot1 {
	"v_Sniper_NamVet_Shoot" frame 0 30 fps 30 snap
	ikrule lhand touch "ValveBiped.weapon_bone" ikrule rhand touch "ValveBiped.weapon_bone"
	activity ACT_VM_PRIMARYATTACK_SNIPER 1  { event AE_MUZZLEFLASH 0 "1" }
}
	// layer
$animation anim_Sniper_shoot "v_Sniper_NamVet_Shoot" frame 0 30 subtract anim_Sniper_neutral 0 weightlist Sniper_ARM
$sequence Sniper_shoot_layer {
	anim_Sniper_shoot FPS 30 weightlist Sniper_ARM delta fadein 0.1 fadeout 0.2
	activity ACT_VM_SHOOT_SNIPER_LAYER 1  { event AE_CL_CREATE_PARTICLE_BRASS 2 "weapon_shell_casing_rifle" } { event AE_MUZZLEFLASH 0 "1" }
}


// MELEE
$sequence sniper_melee "v_Sniper_NamVet_melee" frame 0 35 fps 40 snap activity ACT_VM_MELEE_SNIPER 1
	// layer
$sequence Sniper_melee_layer {
	"v_Sniper_NamVet_melee" frame 0 35 FPS 40 weightlist Sniper_ARM fadein 0.0 fadeout 0.2
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	activity ACT_VM_MELEE_SNIPER_LAYER 1
}


 // ITEM PICKUP


// ----------- IDLE -----------------------
$sequence sniper_ItemPickup_idle "v_sniper_NamVet_ItemPickup" frame 30 90 snap loop FPS 30 activity ACT_VM_ITEMPICKUP_LOOP_SNIPER 1
	// ------layer-----
$sequence sniper_ItemPickup_idle_layer {
	"v_sniper_NamVet_ItemPickup" frame 30 90 loop snap FPS 30 fixuploop -3 3 weightlist VIEWARMS
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	activity  ACT_VM_ITEMPICKUP_LOOP_SNIPER_LAYER 1
}

// ----------- EXTEND -----------------------
$sequence sniper_ItemPickup_extend "v_sniper_NamVet_ItemPickup" frame 0 30 snap FPS 80  activity  ACT_VM_ITEMPICKUP_EXTEND_SNIPER 1
	// ------layer-----
$sequence sniper_ItemPickup_extend_layer {
	"v_sniper_NamVet_ItemPickup" frame 0 50 snap FPS 80 weightlist VIEWARMS
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 1 "HuntingRifle.ItemPickupExtend"  }
	activity ACT_VM_ITEMPICKUP_EXTEND_SNIPER_LAYER 1
}

// ----------- RETRACT -----------------------
$sequence sniper_ItemPickup_retract "v_sniper_NamVet_ItemPickup" frame 90 120 snap FPS 80  activity  ACT_VM_ITEMPICKUP_RETRACT_SNIPER 1
	// ------layer-----
$sequence sniper_ItemPickup_retract_layer {
	"v_sniper_NamVet_ItemPickup" frame 90 140 fadein 0.0 fadeout 0.4 FPS 80 weightlist VIEWARMS
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 1 "HuntingRifle.ItemPickupRetract"  }
	activity ACT_VM_ITEMPICKUP_RETRACT_SNIPER_LAYER 1
}

 // HELPING HAND


// ----------- IDLE -----------------------
$sequence sniper_HelpingHand_idle "v_sniper_NamVet_HelpingHand" frame 30 90 snap loop FPS 30 activity ACT_VM_HELPINGHAND_LOOP_SNIPER 1
	// ------layer-----
$sequence sniper_HelpingHand_idle_layer {
	"v_sniper_NamVet_HelpingHand" frame 30 90 loop snap FPS 30 fixuploop -3 3 weightlist VIEWARMS
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	activity  ACT_VM_HELPINGHAND_LOOP_SNIPER_LAYER 1
}

// ----------- EXTEND -----------------------
$sequence sniper_HelpingHand_extend "v_sniper_NamVet_HelpingHand" frame 0 30 snap FPS 80  activity  ACT_VM_HELPINGHAND_EXTEND_SNIPER 1
	// ------layer-----
$sequence sniper_HelpingHand_extend_layer {
	"v_sniper_NamVet_HelpingHand" frame 0 60 snap FPS 80 weightlist VIEWARMS
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 1 "HuntingRifle.HelpingHandExtend"  }
	activity ACT_VM_HELPINGHAND_EXTEND_SNIPER_LAYER 1
}

// ----------- RETRACT -----------------------
$sequence sniper_HelpingHand_retract "v_sniper_NamVet_HelpingHand" frame 90 120 snap FPS 80  activity  ACT_VM_HELPINGHAND_RETRACT_SNIPER 1
	// ------layer-----
$sequence sniper_HelpingHand_retract_layer {
	"v_sniper_NamVet_HelpingHand" frame 90 140 fadein 0.0 fadeout 0.4 FPS 80 weightlist VIEWARMS
	ikrule rhand touch "ValveBiped.weapon_bone" usesource
	ikrule lhand touch "ValveBiped.weapon_bone" usesource
	{ event 5004 1 "HuntingRifle.HelpingHandRetract"  }
	activity ACT_VM_HELPINGHAND_RETRACT_SNIPER_LAYER 1
}

$popd


