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


// Active Timer BG Pulse
event ActiveTimerBGPulse
{
	Animate	ActiveTimerBG 					Alpha		"0"					Linear 0.1 0.1
	Animate	ActiveTimerBG 					Alpha		"255"				Linear 0.3 0.1
	
	Animate	ActiveTimerBG 					Alpha		"0"					Linear 0.5 0.1
	Animate	ActiveTimerBG 					Alpha		"255"				Linear 0.7 0.1
	
	Animate	ActiveTimerBG 					Alpha		"0"					Linear 0.9 0.1
	Animate	ActiveTimerBG 					Alpha		"255"				Linear 1.1 0.1
	
}

event ActiveTimerHighlight
{
	Animate TimePanelValue					FgColor		"245 245 245 235"	Linear 0.0 0.1
	
	
}

event ActiveTimerDim
{
	// Slow fade out
	Animate TimePanelValue 					FgColor		"245 245 245 110"	Linear 0.0 0.2
	
}



//Health Bonus Pulse
event HudHealthBonusPulse
{
	Animate	PlayerStatusHealthBonusImage 	Alpha		"0"					Linear 0.0 0.075
	Animate	PlayerStatusHealthBonusImage 	Alpha		"0"					Linear 0.125 0.075
	Animate	HPReal 							FgColor		"47 185 123 240"	Linear 0.0 0.0
	Animate	PlayerStatusHealthValueMain 	FgColor		"43 195 123 255"	Linear 0.0 0.0
	Animate	BuffBG 							Alpha		"255"				Linear 0.0 0.0
	Animate	BuffBG2							Alpha		"200"				Linear 0.0 0.0

	RunEvent HudHealthBonusPulseLoop		0.25
}

// call to loop HudHealthBonusPulse
event HudHealthBonusPulseLoop
{
	RunEvent HudHealthBonusPulse 			0.0
}

event HudHealthBonusPulseStop
{
	StopEvent HudHealthBonusPulse 			0.0
	StopEvent HudHealthBonusPulseLoop 		0.0
	Animate	BuffBG 							Alpha		"0"					Linear 0.0 0.0
	Animate	BuffBG2 						Alpha		"0"					Linear 0.0 0.0
	Animate	HPReal 							FgColor		"220 220 220 250"	Linear 0.0 0.0
	Animate	PlayerStatusHealthValueMain 	FgColor		"menutext"			Linear 0.0 0.0
}

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

//Health Dying Pulse
event HudHealthDyingPulse
{
	Animate	PlayerStatusHealthValueTourn2 	FgColor		"softred"			Linear 0.0 0.0
	Animate	PlayerStatusHealthValueMain 	FgColor		"softred"			Linear 0.0 0.0
	Animate	PlayerStatusHealthBonusImage 	Alpha		"255"				Linear 0.0 0.0
	Animate	HurtBG 							Alpha		"255"				Linear 0.0 0.0

	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	HurtBG 							Alpha		"0"					Linear 0.0 0.0
	Animate	PlayerStatusHealthBonusImage 	Alpha		"0"					Linear 0.0 0.0
	Animate	PlayerStatusHealthValueMain 	FgColor		"menutext"			Linear 0.0 0.0
	Animate	PlayerStatusHealthValueTourn2 	FgColor		"menutext"			Linear 0.0 0.0

}

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

event HudLowAmmoPulse
{
	Animate	HudWeaponLowAmmoImage			Alpha		"80"				Linear 0.0 0.075
	Animate	HudWeaponLowAmmoImage			Alpha		"255"				Linear 0.125 0.075
	Animate	AmmoInReserve					FgColor		"softred"			Linear 0.0 0.0
	Animate	AmmoInClip						FgColor		"softred"			Linear 0.0 0.0
	Animate	AmmoNoClip						FgColor		"softred"			Linear 0.0 0.0

	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	HudWeaponAmmoBGLow				Alpha		"0"					Linear 0.0 0.0
	Animate	AmmoInReserve					FgColor		"43 195 123 255"	Linear 0.0 0.0
	Animate	AmmoInClip						FgColor		"menutext"			Linear 0.0 0.0
	Animate	AmmoNoClip						FgColor		"menutext"			Linear 0.0 0.0
}


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

// Flash the medic charge hud when we have full charge

event HudMedicCharged
{
	Animate	ChargeLabel 					FgColor		"43 195 123 255"	Linear 0.0 0.0
	Animate	ChargeMeter 					FgColor		"softgreen"			Linear 0.0 0.0

	RunEvent HudMedicChargedLoop			0.6
}

// call to loop HudHealthBonusPulse
event HudMedicChargedLoop
{
	RunEvent HudMedicCharged 				0.0
}

event HudMedicChargedStop
{
	StopEvent HudMedicCharged 				0.0
	StopEvent HudMedicChargedLoop 			0.0

	Animate	ChargeLabel 					FgColor		"216 216 216 255"	Linear 0.0 0.0001
	Animate	ChargeMeter 					FgColor		"216 216 216 255"	Linear 0.0 0.0001
}

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


event MenuOpen
{
	StopEvent	MenuClose 0.2

	// fade in
	Animate HudMenu							Alpha 			"255"			Accel 0.0 0.2
	Animate HudMenu 						SelectionAlpha 	"255"			Accel 0.0 0.2
	Animate HudMenu 						FgColor			"tanlight"		Accel 0.0 0.2
	Animate HudMenu 						BgColor			"tanlight"		Accel 0.0 0.2
	Animate HudMenu 						MenuColor		"tanlight"		Accel 0.0 0.2
	Animate HudMenu 						ItemColor		"0 0 0 100"		Accel 0.0 0.0
	Animate HudMenu 						TextScan		"0"				Accel 0.0 0.0

	// Undo any blur
	Animate HudMenu							Blur			"1"				Linear	0	0
	RunEvent LevelInitAny 					0.2
}

event MenuClose
{
	// Hide it
	Animate HudMenu 						Alpha 			"0" 			Accel 0.0 0.4
	Animate HudMenu 						SelectionAlpha 	"0" 			Accel 0.0 0.4
	Animate HudMenu 						FgColor			"tanlight" 		Accel 0.0 0.4
	Animate HudMenu 						MenuColor		"tanlight" 		Accel 0.0 0.4
	Animate HudMenu 						ItemColor		"tanlight" 		Accel 0.0 0.4
	RunEvent LevelInitAny 					0.2
}


event TeamStatus_PlayerDead
{
	SetVisible DeathPanel  0 0
	SetVisible SkullPanel  0 0
	SetVisible respawntime  1 0

	Animate DeathPanel ypos 0 Accel 0 0.2
	Animate SkullPanel ypos 0 Accel 0 0.2
	Animate respawntime ypos 0 Accel 0 0.2
}

event TeamStatus_PlayerAlive
{
	Animate DeathPanel ypos 0 Accel 0 0.2
	Animate SkullPanel ypos 0 Accel 0 0.2
	Animate respawntime ypos 0 Accel 0 0.2

	SetVisible DeathPanel  0 0.2
	SetVisible SkullPanel  0 0.2
	SetVisible respawntime 0 0.2
}
