flag1
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis captured Flag 1!"

		setautospawn "Flag 1"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "N00BS!!! CHEATER !!!"

		setautospawn "Flag 1"	1	// Set Allies to forward spawn
	}
}


flag2
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis captured Flag 2!"

		setautospawn "Flag 2"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "N00BS!!! CHEATER !!!"

		setautospawn "Flag 2"	1	// Set Allies to forward spawn
	}
}


flag3
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis captured Flag 3!"

		setautospawn "Flag 3"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "N00BS!!! CHEATER !!!"

		setautospawn "Flag 3"	1	// Set Allies to forward spawn
	}
}


flag4
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis captured Flag 4!"

		setautospawn "Flag 4"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "N00BS!!! CHEATER !!!"

		setautospawn "Flag 4"	1	// Set Allies to forward spawn
	}
}

flag5
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis captured Flag 5!"

		setautospawn "Flag 5"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "N00BS!!! CHEATER !!!"

		setautospawn "Flag 5"	1	// Set Allies to forward spawn
	}
}

flag6
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis captured Flag 6!"

		setautospawn "Flag 6"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "N00BS!!! CHEATER !!!"

		setautospawn "Flag 6"	1	// Set Allies to forward spawn
	}
}

end
{
	trigger allied_capture
	{
		wm_announce "DAMN CHEATER!"
		wait 5000
		wm_setwinner 1
		wm_endround
	}

	trigger axis_capture
	{
		wm_announce "Axis won the game! Thanks for playing ral5"
		wait 5000
		wm_setwinner 0
		wm_endround
	}
}



destroy_tri
{
	trigger destroy
	{
		wait 50
		setstate destroy_bridge invisible
		wm_announce "They destroyed the old Wood bridge!"
		setstate destroyed_tunnel invisible
		setstate laser invisible
	}
}



construct_tri
{
	trigger construct
	{
		setstate destroy_bridge default
		wm_announce "Axis constructed the bridge!"
		wait 600
		wm_announce "Now they can go to next stage!"
	}
}


wall
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	death
	{
		wm_announce "The wall has been destroyed"
		setstate wall invisible
	}
}




boom_wall_tri
{
	trigger boom_wall
	{
		wait 50
		setstate destroy_wall invisible
		wm_announce "They destroyed the first old wall!"
	}
}



2nd_explosion_tri
{
	trigger 2nd_explosion
	{
		wait 50
		setstate destroy_bridge2 invisible
		wm_announce "They destroyed the second bridge!"
	}
}


3nd_explosion_tri
{
	trigger 3nd_explosion
	{
		wait 50
		setstate destroy_block invisible
		wm_announce "They destroyed the old block!"
		wait 300
		wm_announce "Now you can enter the old tunnel!"
	}
}


tunnel_explode_tri
{
	trigger tunnel_explode
	{
		setstate destroyed_tunnel default
		wm_announce "They destroyed the Tunnel"
	}
}


tunnel_explode2_tri
{
	trigger tunnel_explode2
	{
		wait 100
		setstate water1 invisible
		wm_announce "They destroyed the half tunnel path"
		setstate water2 invisible
		setstate water3 invisible
	}
}


visible_laser_tri
{
	trigger visible_laser
	{
		setstate laser default
		wm_announce "The Lasers are now visible"
	}
}



ladder
{
	spawn
	{
		wait 200
		constructible_class 2
	}
	built final
	{

		setstate ladder default
		setstate construction_toi_ladder invisible
		wm_announce "A ladder has been constructed."
	}
}