
game_manager
{
	spawn
	{
		remapshaderflush

		wm_axis_respawntime		20
		wm_allied_respawntime		20
		wm_set_round_timelimit		15

		wm_number_of_objectives		2
		wm_set_main_objective		1	0
		wm_set_main_objective		2	1
		
		wm_objective_status		1	0	0
		wm_objective_status		1	1	0
		wm_objective_status		2	0	0
		wm_objective_status		2	1	0
	
		accum 1 set 0
		accum 2 set 0

		wait 2000

		setautospawn	"Axis Castle Spawn"	0
		setautospawn	"Allies Castle Spawn"	1

	
		// setstate eastbunker_wobj invisible
	
 	}
 	
  	trigger objective1 // Allies Scores
 	{
 		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of objective #1
	 	wm_objective_status		1	0	1

		// UI pop-up to alert players
	      	//wm_announce					"The Allies have transmitted the War Documents"

		//turn on sirens
	      	accum 1 abort_if_not_equal 0
		//alertentity sirens
		accum 1 set 1
	      	
	      	// After goal is reached wait #millisecond
	      	wait 100

		// Check who has won
	    	trigger game_manager checkgame1
 	}
 	
    	trigger allied_object_stolen
 	{
		wm_objective_status	1	0	1
		wm_objective_status	1	1	2
 	}
 	
	trigger allied_object_returned
 	{
		wm_objective_status	1	0	0
		wm_objective_status	1	1	0
 	}
 	
    	trigger checkgame1
 	{
 		// Check who has won
		accum 1 abort_if_not_equal 1

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 1

		// End Game
		wm_endround
 	}
	

  	trigger objective2 // Axis Scores
 	{
 		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of objective #2
	 	wm_objective_status		2	1	1

		// UI pop-up to alert players
	      	//wm_announce					"The Axis have transmitted the War Documents"

		//turn on sirens
	      	accum 2 abort_if_not_equal 0
		//alertentity sirens
		accum 2 set 1
	      	
	      	// After goal is reached wait #millisecond
	      	wait 100

		// Check who has won
	    	trigger game_manager checkgame2
 	}
 	
    	trigger axis_object_stolen
 	{
 	 	// Who owns the Objective when stolen
		wm_objective_status		2	0	1
		wm_objective_status		2	1	2
 	}
 	
	trigger axis_object_returned
 	{
 		// Who owns the Objective when returned
		wm_objective_status		2	0	0
		wm_objective_status		2	1	0
 	}
 	
    	trigger checkgame2
 	{
 		// Check who has won
		accum 2 abort_if_not_equal 1

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 0

		// End Game
		wm_endround
 	}
}



// --- objectives 1 & 2 ----------------------------------------------

	allied_obj1
	{
		spawn
		{
		}

		death
		{
			trigger game_manager objective1
		}
		
	}

	axis_obj1
	{
		spawn
		{
		}

		death
		{
			trigger game_manager objective2
		}
	}


	cm_wall1
	{
		spawn
		{
		wait 200
		constructible_class 3
		}

		death
		{
		wm_announce "Allies secret entrance wall destroyed!"
		// wm_objective_status 		3 0 2
		// wm_objective_status 		3 1 1

		// wm_set_main_objective	1 0
		// wm_set_main_objective	1 1

		remove

		}
		
	}

	cm_wall2
	{
		spawn
		{
		wait 200
		constructible_class 3
		}

		death
		{
		wm_announce "Axis secret entrance wall destroyed!"
		// wm_objective_status 		3 0 2
		// wm_objective_status 		3 1 1

		// wm_set_main_objective	1 0
		// wm_set_main_objective	1 1

		remove

		}
		
	}

