VECTORZERO = HL2.Vector(0, 0, 0);

NODETYPE = {
	NODE_ANY = 0, 
	NODE_DELETED= 1,
	NODE_GROUND= 2,
	NODE_AIR= 3,
	NODE_CLIMB= 4,
	NODE_WATER= 5,
	};

MOVETYPE = {
	MOVETYPE_NONE = 0, 
	MOVETYPE_WALK = 2,
	MOVETYPE_STEP = 3,
	MOVETYPE_FLY= 4,
	MOVETYPE_FLYGRAVITY = 5,
	MOVETYPE_VPHYSICS = 6,
	MOVETYPE_NOCLIP = 8,
	};

DISPOSITION = {
	D_HT = 1,
	D_FR = 2,
	D_LI = 3,
	D_NU = 4,
};

CLASS = {
	CLASS_NONE =0,
	CLASS_PLAYER = 1,
	CLASS_PLAYER_ALLY = 2,
	CLASS_PLAYER_ALLY_VITAL = 3,
	CLASS_ANTLION = 4,
	CLASS_BARNACLE = 5,
	CLASS_BULLSEYE = 6,
	CLASS_CITIZEN_PASSIVE = 7,	
	CLASS_CITIZEN_REBEL = 8,
	CLASS_COMBINE=9,
	CLASS_COMBINE_GUNSHIP=10,
	CLASS_HEADCRAB=12,
	CLASS_MANHACK=13,
	CLASS_METROPOLICE=14,
	CLASS_MILITARY=15,
	CLASS_SCANNER=16,
	CLASS_STALKER=17,
	CLASS_VORTIGAUNT=18,
	CLASS_ZOMBIE=19,
	CLASS_PROTOSNIPER=20,
	CLASS_MISSILE=21,
	CLASS_FLARE=22,
	CLASS_EARTH_FAUNA=23
}

--battle settting defaults -- DO NOT CHANGE
		GAMEEND = false
		ENEMYCOUNT = 0
		KILLCOUNT = 0

--battle timers etc -- if changing, use caution		
		ROUNDTIME = 480 --8 mins
		SPAWNTIME = 4 --spawn new enemy every 4 seconds 		
		SPAWNTIME_HARD = 3 --spawn new enemy every 3 seconds on hard maps -- not used currently		
		GETTOUGHTIME = 210 --increase enemy speed etc at this time left
		SPAWNHARDENEMY = 120 --spawn harder enemies at this time left 	
		SPAWNHARDENEMY_WARNING = 120 --play warning sound at this time left 		
		TICKTOCKTIME = 10 --play tick sound at this time left	

		HARDENEMIES = true --spawn harder enemies when time = SPAWNHARDENEMY	
		KILLITEMS = true --give extra money for killing enemies with melee weapon
		
		REWARD1 = 40 --this money needed for reward1
		REWARD2 = 80 --this money needed for reward2
		REWARD3 = 120 --this money needed for reward3	
		REWARD4 = 160 --this money needed for reward4		
		
				
--universal battle functions

function IncreaseMoney(amount)
	local money = HL2.GetMoney()
	money = money + amount
	HL2.SetMoney(money)

--player rewards	
	if money == REWARD1 then
	    HL2.CallMapaddLabel("reward_8mins")
		HL2.ShowInfoMessage(1, 3, "WEAPON AWARDED!")		
	end
	
	if money == REWARD2 then
	    HL2.CallMapaddLabel("reward_6mins")
		HL2.ShowInfoMessage(1, 3, "WEAPON AWARDED!")		
	end

	if money == REWARD3 then
	    HL2.CallMapaddLabel("reward_4mins")
		HL2.ShowInfoMessage(1, 3, "WEAPON AWARDED!")		
	end

	if money == REWARD4 then
	    HL2.CallMapaddLabel("reward_2mins")
		HL2.ShowInfoMessage(1, 3, "FINAL WEAPON AWARDED!")		
	end	
end
		
function TimeCount()

	if GAMEEND == true then
		return 0
	end

	local timestr = HL2.TimeStr(ROUNDTIME)

	if ROUNDTIME == SPAWNHARDENEMY_WARNING then	
	    HL2.CallMapaddLabel("warning")
	end
	
	if ROUNDTIME >= SPAWNHARDENEMY then
		HL2.ShowInfoMessage(0,1,timestr)
	else
		HL2.ShowInfoMessage(1,1,timestr)
	end

--tick tock	
	if ROUNDTIME <= TICKTOCKTIME then
	    HL2.CallMapaddLabel("tick")	
	end
	
	ROUNDTIME = ROUNDTIME - 1

-- good end	
	if ROUNDTIME < 0 then
		HL2.HookKilledEvent()	
		GAMEEND = true	
		HL2.ShowInfoMessage(1, 15, "TIME! YOU KILLED " .. KILLCOUNT .. " ENEMIES.")
	    HL2.CallMapaddLabel("gameend")
	    return 0
	end

	return 1

end