//////////////////////////////
////Script made by RoeltjE////
////modified by Skorpio   ////
//////////////////////////////

game_manager
{
	spawn
	{
		wm_axis_respawntime 5
		wm_allied_respawntime 5
		wm_set_round_timelimit 15
		
		wait 1500
		wm_announce "^8Orange^72^8Map"
		wait 1500
		wm_announce "by ^8'^0StoerFaktoR"
		wait 1500
		wm_announce "^1mail ^0:^7mini@chris-s.de"
		wait 1500
		wm_announce "^8http://stoerfaktor.site50.net/"
		
		
		wm_setwinner -1

		globalaccum 0 set 0 //axis score
		globalaccum 1 set 0 //allied score
		globalaccum 2 set 0 //difference

		wait 200
		
		
		remapshader "sprites/objective.tga" "textures/fata_morgana/obj.tga"
		remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/allied_score.tga
		remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/axis_score.tga
		remapshaderflush
	


	}
	trigger allies_score
	{
	globalaccum 1 inc 1
	globalaccum 2 inc 1
	trigger axis_flag findwinner
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr1.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 2
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr2.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 3
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr3.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 4
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr4.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 5
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr5.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 6
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr6.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 7
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr7.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 8
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr8.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 9
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr9.tga
	remapshaderflush
	globalaccum 1 abort_if_less_than 10
	remapshader textures/fata_morgana/allied_score.tga textures/fata_morgana/nr10.tga
	remapshaderflush

	wm_announce "^4The Allies win!!"
	wm_teamvoiceannounce 0 "blue_team_is_the_winner"
	wm_teamvoiceannounce 1 "blue_team_is_the_winner"
	wm_setwinner 1
	wait 5000
	wm_endround
	}

	trigger axis_score
	{
	globalaccum 0 inc 1
	globalaccum 2 inc -1
	trigger axis_flag findwinner
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr1.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 2
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr2.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 3
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr3.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 4
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr4.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 5
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr5.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 6
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr6.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 7
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr7.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 8
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr8.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 9
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr9.tga
	remapshaderflush
	globalaccum 0 abort_if_less_than 10
	remapshader textures/fata_morgana/axis_score.tga textures/fata_morgana/nr10.tga
	remapshaderflush

	wm_announce "^1The Axis win!!"
	wm_teamvoiceannounce 0 "red_team_is_the_winner"
	wm_teamvoiceannounce 1 "red_team_is_the_winner"
	wm_setwinner 0
	wait 5000
	wm_endround
	}

	trigger timelimit_hit
	{
		trigger axis_flag didaxiswin
		trigger allied_flag didallieswin
	}

}

axis_flag
{
trigger stolen
{
	wm_teamvoiceannounce 0 "a_red_flag_taken"
	wm_teamvoiceannounce 1 "a_red_flag_taken"
}
trigger dropped
{
	wm_announce "^1Axis flag dropped!!"
	wm_teamvoiceannounce 0 "a_red_flag_dropped"
	wm_teamvoiceannounce 1 "a_red_flag_dropped"
}
trigger returned
{
	wm_teamvoiceannounce 0 "a_red_flag_returned"
	wm_teamvoiceannounce 1 "a_red_flag_returned"
}
trigger captured
{
	wm_announce "^4The Allies score!!"
	wm_teamvoiceannounce 0 "blue_team_scores"
	wm_teamvoiceannounce 1 "blue_team_scores"
	trigger game_manager allies_score
}
trigger findwinner
{
		wm_setwinner -1
		globalaccum 2 abort_if_equal 0
		wm_setwinner 1
		globalaccum 2 abort_if_greater_than -1
		wm_setwinner 0
}
trigger didaxiswin
{
		globalaccum 2 abort_if_greater_than 0
		wm_announce "^1The Axis win!!"
		wm_teamvoiceannounce 0 "red_team_is_the_winner"
		wm_teamvoiceannounce 1 "red_team_is_the_winner"
}
}

allied_flag
{
trigger stolen
{
	wm_teamvoiceannounce 0 "a_blue_flag_taken"
	wm_teamvoiceannounce 1 "a_blue_flag_taken"
}
trigger dropped
{
	wm_announce "^4Allied flag dropped!!"
	wm_teamvoiceannounce 0 "a_blue_flag_dropped"
	wm_teamvoiceannounce 1 "a_blue_flag_dropped"
}
trigger returned
{
	wm_teamvoiceannounce 0 "a_blue_flag_returned"
	wm_teamvoiceannounce 1 "a_blue_flag_returned"
}
trigger captured
{
	wm_announce "^1The Axis score!!"
	wm_teamvoiceannounce 0 "red_team_scores"
	wm_teamvoiceannounce 1 "red_team_scores"
	trigger game_manager axis_score
}
trigger didallieswin
{
	globalaccum 2 abort_if_less_than 0
	wm_announce "^4The Allies win!!"
	wm_teamvoiceannounce 0 "blue_team_is_the_winner"
	wm_teamvoiceannounce 1 "blue_team_is_the_winner"
}
}


