// Script by Snake
// Made for SnakeJumps2
game_manager
{
	spawn
	{
		wm_axis_respawntime 1 
		wm_allied_respawntime 1
	}
}

// Moving path 1
mover1
{
	spawn
	{
	wait 50
	trigger mover1 move
	wait 300
	}
	trigger move
	{
	playsound sound/movers/motors/motor_loop_02.wav looping volume 250
	gotomarker mover1path1 500 wait
	stopsound
	wait 2000
	playsound sound/movers/motors/motor_loop_02.wav looping volume 250
	gotomarker mover1path2 500 wait
	stopsound
	wait 2000
	trigger mover1 move
	}
}

// Elevator
elevator_start
{
	trigger elevator_up
	{
		trigger elevator move_up
	}
	trigger elevator_down
	{
		trigger elevator move_down
	}
}

elevator
{
	spawn
	{
		wait 100

		accum 1 set 1

		trigger top_left_elevator_door close
		trigger top_right_elevator_door close

		trigger bottom_left_elevator_door close
		trigger bottom_right_elevator_door close
	}
	trigger move_up
	{
		accum 1 abort_if_not_equal 1

		setstate trigger_elevator invisible
		wait 1000

		trigger bottom_left_elevator_door close
		trigger bottom_right_elevator_door close

		wait 1000

		playsound sound/movers/misc/garage_door_start_01.wav
		playsound sound/movers/misc/big_gate2.wav looping volume 500		
	
		gotomarker path_corner_elevator_up 50 wait

		stopsound
		playsound sound/movers/misc/garage_door_end_01.wav

		trigger top_left_elevator_door open
		trigger top_right_elevator_door open

		accum 1 set 0

		wait 1000
		setstate trigger_elevator2 default
	}
	trigger move_down
	{
		accum 1 abort_if_not_equal 0

		setstate trigger_elevator2 invisible
		wait 1000

		trigger top_left_elevator_door close
		trigger top_right_elevator_door close

		wait 3000

		playsound sound/movers/misc/garage_door_start_01.wav
		playsound sound/movers/misc/big_gate2.wav looping volume 500		
	
		gotomarker path_corner_elevator_down 50 wait

		stopsound
		playsound sound/movers/misc/garage_door_end_01.wav

		accum 1 set 1

		wait 1000
		setstate trigger_elevator default
		setstate trigger_opendoors default
	}
}

top_left_elevator_door
{
	spawn
	{
	wait 100
	}
	trigger open
	{
		faceangles 0 270 0 1000 30
	}
	trigger close
	{
		faceangles 0 0 0 1000 30
	}
}

top_right_elevator_door
{
	spawn
	{
	wait 100
	}
	trigger open
	{
		faceangles 0 90 0 1000 30
	}
	trigger close
	{
		faceangles 0 0 0 1000 30
	}
}

bottom_left_elevator_door
{
	spawn
	{
	wait 100
	}
	trigger open
	{
		playsound sound/movers/motors/motor_loop_02.wav looping volume 250
		faceangles 0 270 0 1000 30
		stopsound
	}
	trigger close
	{
		playsound sound/movers/motors/motor_loop_02.wav looping volume 250
		faceangles 0 0 0 1000 30
		stopsound
	}
}

bottom_right_elevator_door
{
	spawn
	{
	wait 100
	}
	trigger open
	{
		playsound sound/movers/motors/motor_loop_02.wav looping volume 250
		faceangles 0 90 0 1000 30
		stopsound
	}
	trigger close
	{
		playsound sound/movers/motors/motor_loop_02.wav looping volume 250
		faceangles 0 0 0 1000 30
		stopsound
	}
}

doors_open
{
	spawn
	{
		wait 100
	}
	trigger bottom_doors_open
	{
		setstate trigger_opendoors invisible
		trigger bottom_left_elevator_door open
		trigger bottom_right_elevator_door open
	}
}
		
doors_closed
{
	spawn
	{
		wait 100
	}
	trigger bottom_doors_closed
	{
		wait 1000
		setstate trigger_opendoors default
		trigger bottom_left_elevator_door close
		trigger bottom_right_elevator_door close
	}
}	

// Flags
flag1
{
	spawn
	{
		accum 0 set 1			
	}

	trigger axis_capture				
	{
		accum 0 abort_if_equal 0 		

		accum 0 set 0 			
		wm_announce "^1Axis ^7captured Gamma I"

		setautospawn "Flag 1"	0	
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1 		

		accum 0 set 1 			
		wm_announce "NoClipper"


		setautospawn "Flag 1"	1	
	}
}

flag2
{
	spawn
	{
		accum 0 set 1			
	}

	trigger axis_capture				
	{
		accum 0 abort_if_equal 0 		

		accum 0 set 0 			
		wm_announce "^1Axis ^7captured Gamma II"

		setautospawn "Flag 2"	0	
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1 	

		accum 0 set 1 			
		wm_announce "NoClipper"


		setautospawn "Flag 2"	1	
	}
}

flag3
{
	spawn
	{
		accum 0 set 1			
	}

	trigger axis_capture			
	{
		accum 0 abort_if_equal 0 	

		accum 0 set 0 			
		wm_announce "^1Axis ^7captured Gamma III"

		setautospawn "Flag 3"	0	
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1 		

		accum 0 set 1 			
		wm_announce "NoClipper"


		setautospawn "Flag 3"	1	
	}
}

flag4
{
	spawn
	{
		accum 0 set 1			
	}

	trigger axis_capture				
	{
		accum 0 abort_if_equal 0 		

		accum 0 set 0 			
		wm_announce "^1Axis ^7captured Gamma IV"

		setautospawn "Flag 4"	0	
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1 		

		accum 0 set 1 			
		wm_announce "NoClipper"


		setautospawn "Flag 4"	1
	}
}

flag5
{
	spawn
	{
		accum 0 set 0			
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1		

		accum 0 set 1			
		wm_announce "^4Allies ^7captured Gamma I"

		setautospawn "Flag 5"	1	
	}
}


flag6
{
	spawn
	{
		accum 0 set 0			
	}

	trigger allied_capture			
	{
		accum 0 abort_if_equal 1		

		accum 0 set 1			
		wm_announce "^4Allies ^7captured Gamma II"

		setautospawn "Flag 6"	1
	}
}

flag7
{
	spawn
	{
		accum 0 set 0			
	}

	trigger allied_capture			
	{
		accum 0 abort_if_equal 1		

		accum 0 set 1			
		wm_announce "^4Allies ^7captured Gamma III"

		setautospawn "Flag 7"	1
	}
}

flag8
{
	spawn
	{
		accum 0 set 1			
	}

	trigger axis_capture				
	{
		accum 0 abort_if_equal 0 		

		accum 0 set 0 			
		wm_announce "^1Axis ^7captured Gamma V"

		setautospawn "Flag 8"	0	
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1 		

		accum 0 set 1 			
		wm_announce "NoClipper"


		setautospawn "Flag 8"	1
	}
}

flag9
{
	spawn
	{
		accum 0 set 0			
	}

	trigger allied_capture			
	{
		accum 0 abort_if_equal 1		

		accum 0 set 1			
		wm_announce "^4Allies ^7captured Gamma IV"

		setautospawn "Flag 9"	1
	}
}

flag10
{
	spawn
	{
		accum 0 set 0			
	}

	trigger allied_capture			
	{
		accum 0 abort_if_equal 1		

		accum 0 set 1			
		wm_announce "^4Allies ^7captured Gamma V"

		setautospawn "Flag 10"	1
	}
}

flag11
{
	spawn
	{
		accum 0 set 1			
	}

	trigger axis_capture				
	{
		accum 0 abort_if_equal 0 		

		accum 0 set 0 			
		wm_announce "^1Axis ^7captured Gamma VI"

		setautospawn "Flag 11"	0	
	}

	trigger allied_capture				
	{
		accum 0 abort_if_equal 1 		

		accum 0 set 1 			
		wm_announce "NoClipper"


		setautospawn "Flag 11"	1
	}
}

// End
end
{
	spawn
	{
	}
	trigger fire1
	{
		wm_announce "^1-"
		wm_announce "^1-^7-"
		wm_announce "^1-^7-^1-"
		wm_announce "^1!!! ^7END ^1!!!"
		wm_announce "^1-^7-"
		wm_announce "^1-"
	}
}