game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	1
		wm_allied_respawntime	1
		wm_set_round_timelimit	60
		wm_setwinner -1

		// accums
		globalaccum 0 set 0		// what is the highest flag number taken

	}
}

// FLAG 1
//
flag1
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Axis own the pole
		wm_announce	"Axis capture the 1st flag!"
		alertentity flagspawn1
		alertentity flagblob1

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 1
		wait 500
		setautospawn "Flag 1" 0
		setautospawn "Flag 1" 1
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Allies own the pole
		wm_announce	"Allies capture the 1st flag!"
		alertentity flagspawn1
		alertentity flagblob1

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 1
		wait 500
		setautospawn "Flag 1" 0
		setautospawn "Flag 1" 1
	}

	trigger kill
	{
		remove
	}
}

// FLAG 2
//
flag2
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Axis own the pole
		wm_announce	"Axis capture the 2nd flag!"
		alertentity flagspawn2
		alertentity flagblob2

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 2
		wait 500
		setautospawn "Flag 2" 0
		setautospawn "Flag 2" 1
		trigger flag1 kill
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Allies own the pole
		wm_announce	"Allies capture the 2nd flag!"
		alertentity flagspawn2
		alertentity flagblob2

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 2
		wait 500
		setautospawn "Flag 2" 0
		setautospawn "Flag 2" 1
	}

	trigger kill
	{
		remove
	}
}

// FLAG 3
//
flag3
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Axis own the pole
		wm_announce	"Axis capture the 3rd flag!"
		alertentity flagspawn3
		alertentity flagblob3

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 3
		wait 500
		setautospawn "Flag 3" 0
		setautospawn "Flag 3" 1
		trigger flag2 kill
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Allies own the pole
		wm_announce	"Allies capture the 3rd flag!"
		alertentity flagspawn3
		alertentity flagblob3

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 3
		wait 500
		setautospawn "Flag 3" 0
		setautospawn "Flag 3" 1
	}

	trigger kill
	{
		remove
	}
}

// FLAG 4
//
flag4
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Axis own the pole
		wm_announce	"Axis capture the 4th flag!"
		alertentity flagspawn4
		alertentity flagblob4

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 4
		wait 500
		setautospawn "Flag 4" 0
		setautospawn "Flag 4" 1
		trigger flag3 kill
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Allies own the pole
		wm_announce	"Allies capture the 4th flag!"
		alertentity flagspawn4
		alertentity flagblob4

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 4
		wait 500
		setautospawn "Flag 4" 0
		setautospawn "Flag 4" 1
	}

	trigger kill
	{
		remove
	}
}

// FLAG 5
//
flag5
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Axis own the pole
		wm_announce	"Axis capture the 5th flag!"
		alertentity flagspawn5
		alertentity flagblob5

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 5
		wait 500
		setautospawn "Flag 5" 0
		setautospawn "Flag 5" 1
		trigger flag4 kill
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Allies own the pole
		wm_announce	"Allies capture the 5th flag!"
		alertentity flagspawn5
		alertentity flagblob5

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 5
		wait 500
		setautospawn "Flag 5" 0
		setautospawn "Flag 5" 1
	}

	trigger kill
	{
		remove
	}
}

// FLAG 6
//
flag6
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Axis own the pole
		wm_announce	"Axis capture the 6th flag!"
		alertentity flagspawn6
		alertentity flagblob6

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 6
		wait 500
		setautospawn "Flag 6" 0
		setautospawn "Flag 6" 1
		trigger flag5 kill
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Allies own the pole
		wm_announce	"Allies capture the 6th flag!"
		alertentity flagspawn6
		alertentity flagblob6

		//globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 6
		wait 500
		setautospawn "Flag 6" 0
		setautospawn "Flag 6" 1
	}


}
flag
{

trigger allied_capture
	{
	wait 1000
	wm_announce "^qYou are cheater"
	wm_teamvoiceannounce 0 "allies_hq_objective_captured"
	wm_teamvoiceannounce 1 "allies_hq_objective_captured"
	wait 5000
	wm_setwinner 1
	wm_endround
	}

trigger axis_capture
	{
	wait 1000
	wm_announce "^qYou have finish map"
	wm_teamvoiceannounce 0 "axis_hq_objective_captured"
	wm_teamvoiceannounce 1 "axis_hq_objective_captured"
	wait 5000
	wm_setwinner 0
	wm_endround
	}
}
