// sample animation script
//
//
// commands:
//	Animate <panel name> <variable> <target value> <interpolator> <start time> <duration>
//		variables:
//			FgColor
//			BgColor
//			Position
//			Size
//			Blur		(hud panels only)
//			TextColor	(hud panels only)
//			Ammo2Color	(hud panels only)
//			Alpha		(hud weapon selection only)
//			SelectionAlpha  (hud weapon selection only)
//			TextScan	(hud weapon selection only)
//
//		interpolator:
//			Linear
//			Accel - starts moving slow, ends fast
//			Deaccel - starts moving fast, ends slow
//			Spline - simple ease in/out curve
//			Pulse - < freq > over the duration, the value is pulsed (cosine) freq times ending at the dest value (assuming freq is integral)
//			Flicker - < randomness factor 0.0 to 1.0 > over duration, each frame if random # is less than factor, use end value, otherwise use prev value
//
//	RunEvent <event name> <start time>
//		starts another even running at the specified time
//
//	StopEvent <event name> <start time>
//		stops another event that is current running at the specified time
//
//	StopAnimation <panel name> <variable> <start time>
//		stops all animations refering to the specified variable in the specified panel
//
//	StopPanelAnimations <panel name> <start time>
//		stops all active animations operating on the specified panel
//
//  SetFont <panel name> <fontparameter> <fontname from scheme> <set time> 
//
//	SetTexture <panel name> <textureidname> <texturefilename> <set time>
//
//  SetString <panel name> <string varname> <stringvalue> <set time>

//===========================================

// HP Bonus
event HudHealthBonusPulse
{
	Animate PlayerStatusHealthValue		FgColor		"HPAmmoBonus"			Linear 0.0 0.2
        Animate PlayerStatusHealthValue		FgColor		"HPAmmoBonusPulse"		Linear 0.2 0.4
	Animate PlayerStatusHealthIndicator	FgColor		"255 255 255 75"		Linear 0.0 0.075
        Animate PlayerStatusHealthIndicator	FgColor		"255 255 255 100"		Linear 0.125 0.075

	RunEvent HudHealthBonusPulseLoop	0.6
}

//===========================================

// HP Bonus
event HudHealthBonusPulseLoop
{
	RunEvent HudHealthBonusPulse 		0.0
}

event HudHealthBonusPulseStop
{
	StopEvent HudHealthBonusPulse 		0.0
	StopEvent HudHealthBonusPulseLoop 	0.0
	Animate PlayerStatusHealthValue 	Alpha 		255 		Linear 	0.0 0.0
	Animate PlayerStatusHealthValue 	FgColor 	"White" 	Accel 	0.0 0.0
	Animate PlayerStatusHealthIndicator	Alpha		255		Linear	0.0 0.0
	Animate PlayerStatusHealthIndicator	FgColor		"0 0 0 0"	Linear	0.0 0.0
}

//===========================================

// Low HP
event HudHealthDyingPulse
{
	Animate PlayerStatusHealthValue         FgColor		"HPAmmoDanger"		Linear 0.0 0.075
        Animate PlayerStatusHealthValue         FgColor		"HPAmmoDangerPulse"	Linear 0.125 0.075
	Animate PlayerStatusHealthIndicator	FgColor		"HPAmmoDanger"		Linear 0.0 0.075
        Animate PlayerStatusHealthIndicator	FgColor		"HPAmmoDangerPulse"	Linear 0.125 0.075
	
	RunEvent HudHealthDyingPulseLoop	0.25
}

// call to loop HudHealthDyingPulse
event HudHealthDyingPulseLoop
{
	RunEvent HudHealthDyingPulse 		0.0
}

event HudHealthDyingPulseStop
{
	StopEvent HudHealthDyingPulse 		0.0
	StopEvent HudHealthDyingPulseLoop 	0.0
	Animate PlayerStatusHealthValue 	Alpha 		255 			Linear 	0.0 0.0
	Animate PlayerStatusHealthValue 	FgColor 	"White" 		Accel 	0.0 0.0
	Animate PlayerStatusHealthIndicator	Alpha 		255 			Linear 	0.0 0.0
	Animate PlayerStatusHealthIndicator	FgColor 	"255 255 255 0" 	Accel 	0.0 0.0
}

//===========================================

event HudLowAmmoPulse
{
	Animate AmmoInClip		FgColor		"HPAmmoDanger"			Linear 0.0 0.075
        Animate AmmoInClip		FgColor		"HPAmmoDangerPulse"		Linear 0.125 0.075
	
        Animate AmmoInReserve		FgColor		"HPAmmoDangerPulse"		Linear 0.0 0.075
        Animate AmmoInReserve		FgColor		"HPAmmoDanger"			Linear 0.125 0.075
	
        Animate AmmoNoClip		FgColor		"HPAmmoDanger"			Linear 0.0 0.075
        Animate AmmoNoClip		FgColor		"HPAmmoDangerPulse"		Linear 0.125 0.075

        RunEvent HudLowAmmoPulseLoop	0.25
}

// call to loop HudLowAmmoPulse
event HudLowAmmoPulseLoop
{
	RunEvent HudLowAmmoPulse 0.0
}

event HudLowAmmoPulseStop
{
	StopEvent HudLowAmmoPulse 0.0
	StopEvent HudLowAmmoPulseLoop 0.0

	Animate AmmoInClip alpha 255 linear 0.0 0.0
	Animate AmmoInClip fgcolor "White" accel 0.0 0.0

	Animate AmmoInReserve alpha 255 linear 0.0 0.0
	Animate AmmoInReserve fgcolor "White" accel 0.0 0.0

	Animate AmmoNoClip alpha 255 linear 0.0 0.0
	Animate AmmoNoClip fgcolor "White" accel 0.0 0.0
}

//===========================================

// Tournament Setup
event HudTournamentSetupPanelOpen
{
	Animate HudTournamentSetup	Position	"c-65 -70"	Linear 0.0 0.001
	Animate HudTournamentSetup	Position	"c-65 13"	Spline 0.001 0.2
}

event HudTournamentSetupPanelClose
{
	Animate HudTournamentSetup	Position	"c-65 13"	Linear 0.0 0.001
	Animate HudTournamentSetup	Position	"c-65 -70"	Spline 0.001 0.2
}

//===========================================

// Medic Uber

event HudMedicCharged
{
	Animate	ChargeLabel 	FgColor		"HPAmmoBonus"			Linear 0.0 0.1
	Animate	ChargeLabel 	FgColor		"HPAmmoBonusPulse"		Linear 0.3 0.4
	Animate	ChargeLabel2 	FgColor		"HPAmmoBonus"			Linear 0.0 0.0001
	Animate	ChargeLabel2 	FgColor		"HPAmmoBonusPulse"		Linear 0.3 0.4
	
	Animate	ChargeMeter 	FgColor		"HPAmmoBonus"			Linear 0.0 0.1
	Animate	ChargeMeter 	FgColor		"HPAmmoBonusPulse"		Linear 0.3 0.4

	RunEvent HudMedicChargedLoop	0.6
}
event HudMedicChargedLoop
{
	RunEvent HudMedicCharged 	0.0
}

event HudMedicChargedStop
{
	StopEvent HudMedicCharged 	0.0
	StopEvent HudMedicChargedLoop 	0.0
	
	Animate	ChargeLabel 	FgColor		"White"		Linear 0.0 0.0001
	Animate	ChargeLabel2 	FgColor		"White"		Linear 0.0 0.0001
	Animate	ChargeMeter 	FgColor		"White"		Linear 0.0 0.0001
}

