level patrol
{
	start
	{
		skybox SkyboxWorkspace0
		light_dir -1.0 0.0 0.0
		light_type directional
		light_power_scale 3.14
		light_diffuse_color 0.8 0.4 0.2 1.0
		light_specular_color 0.8 0.4 0.2 1.0
		ambient_light_upperhemi_lowerhemi_dir 0.3 0.5 0.7 0.1 0.6 0.45 0.3 0.1 -1.0 0.0 0.0
	//	play_cutscene sl_level_patrol_begin
	//	use_skybox_data_from_level 1
		player_ship_selection
		{
			team alien
			{
			}
			team human
			{
				cd raw
				//file loader_ship_human0.txt
				//file loader_ship_human1.txt
				name ship_human0
				name ship_human1
			}
		}
		obj PlayerShip
		{
			type player_ship
			position 0.0 0.0 350.0
			orientation 0.0 1.0 0.0 0.0
			ai 0
			invincible 1
		}
		obj CargoShip0
		{
			mesh ship_human_big0
			type cargo_ship
			position -500.0 0.0 -500.0
			orientation 0.0 1.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			friendly 0
			health 1000
		}
		
		obj Defender0
		{
			mesh ship_human1
			type fighter_ship
			position -500.0 0.0 300.0
			orientation 0.0 1.0 0.0 180.0
			speed 0.0 0.0 -0.0
			ai 0
			friendly 1
			behavior defensive
			health 100
		}
		obj Defender1
		{
			mesh ship_human1
			type fighter_ship
			position 0.0 0.0 -600.0
			orientation 0.0 1.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			friendly 1
			behavior defensive
			health 100
		}
		obj Asteroid0
		{
			mesh asteroid2
			type asteroid
			position 0.0 200.0 100.0
			orientation 0.0 0.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			health 50
		}
		obj Asteroid1
		{
			mesh asteroid3
			type asteroid
			position 0.0 -100.0 300.0
			orientation 0.0 0.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			health 50
		}
		obj Asteroid2
		{
			mesh asteroid2
			type asteroid
			position 50.0 0.0 250.0
			orientation 0.0 0.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			health 50
		}
		obj Asteroid3
		{
			mesh asteroid0
			type asteroid
			position -50.0 50.0 250.0
			orientation 0.0 0.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			health 50
		}
		obj Asteroid4
		{
			mesh asteroid3
			type asteroid
			position -100.0 150.0 250.0
			orientation 0.0 0.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			health 50
		}
		obj Asteroid5
		{
			mesh asteroid1
			type asteroid
			position 100.0 100.0 250.0
			orientation 0.0 0.0 0.0 0.0
			speed 0.0 0.0 0.0
			ai 0
			health 50
		}
	}
	
/*	event friendly_ship_exit
	{
		
		delay secs 5
		exit
		{
			objs 1 PlayerShip
		}
		
		end_cond ship_exit
		{
			type win
			{
				cond win_cond0
				{
					type exited_or_destroyed
					objs 1 PlayerShip
				}
			}
			type loss
			{
				cond loss_cond0
				{
					type time_elapsed
					secs 600
				}
			}
		}
	}*/
	
	event invasion0
	{
		previous_end_cond
		{
			none
		}
		delay secs 5
		spawn
		{
			obj Attacker0
			{
				mesh ship_alien4
				type fighter_ship
				position 0.0 -100.0 -600.0
				orientation 0.0 1.0 0.0 180.0
				speed 0.0 0.0 5.0
				ai 0
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
			obj Attacker1
			{
				mesh ship_alien4
				type fighter_ship
				position 0.0 50.0 -600.0
				orientation 0.0 1.0 0.0 180.0
				speed 0.0 0.0 0.0
				ai 0
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
			obj Attacker2
			{
				mesh ship_alien0
				type fighter_ship
				position 0.0 100.0 -600.0
				orientation 0.0 1.0 0.0 180.0
				speed 0.0 0.0 0.0
				ai 0
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
			obj CargoShip1
			{
				mesh ship_alien_big0
				type cargo_ship
				position 0.0 500.0 -600.0
				orientation 0.0 0.0 0.0 0.0
				speed 0.0 0.0 -5.0
				ai 1
				friendly 0
				health 1000
				destination 0.0 0.0 -8000.0
				reach_destination 1
				radius 50.0
			}
			obj CargoShip2
			{
				mesh ship_alien_big1
				type cargo_ship
				position 0.0 -500.0 -600.0
				orientation 0.0 0.0 0.0 0.0
				speed 0.0 0.0 -5.0
				ai 1
				friendly 0
				health 1000
				destination 0.0 0.0 -8000.0
				reach_destination 1
				radius 50.0
			}
		}
		end_cond invasion0_end
		{
			type win
			{
				cond win_cond
				{
					type destroyed
					objs 1 Attacker0 // Attacker1 Attacker2
				}
			}
			type loss
			{
				cond loss_cond0
				{
					type destroyed
					objs 1 CargoShip0
				}
				cond loss_cond1
				{
					type time_elapsed
					secs 6000
				}
				comparator ( or loss_cond0 loss_cond1 )
			}
		}
	}
	event invasion1
	{
		previous_end_cond
		{
			prev_conds 1 invasion0
		}
		delay secs 2500
		spawn
		{
			obj Attacker3
			{
				mesh ship_alien0
				type fighter_ship
				position -300.0 300.0 2300.0
				orientation 0.0 0.0 0.0 0.0
				speed 0.0 0.0 0.0
				ai 1
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
			obj Attacker4
			{
				mesh ship_alien0
				type fighter_ship
				position -300.0 400.0 2300.0
				orientation 0.0 0.0 0.0 0.0
				speed 0.0 0.0 0.0
				ai 1
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
			obj Attacker5
			{
				mesh ship_alien0
				type fighter_ship
				position -300.0 500.0 2300.0
				orientation 0.0 0.0 0.0 0.0
				speed 0.0 0.0 0.0
				ai 1
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
		}
		end_cond invasion1_end
		{
			type win
			{
				cond win_cond
				{
					type destroyed
					objs 3 Attacker3 Attacker4 Attacker5
				}
			}
			type loss
			{
				cond loss_cond0
				{
					type destroyed
					objs 1 CargoShip0
				}
				cond loss_cond1
				{
					type time_elapsed
					secs 600
				}
				comparator ( or loss_cond0 loss_cond1 )
			}
		}
	}
	event cargo_ship_exit
	{
	//	previous_end_cond
	//	{
	//		prev_conds 1 invasion0
	//	}
		delay secs 5000
		exit
		{
			objs 1 CargoShip0
		}
		end_cond ship_exit
		{
			type win
			{
				cond win_cond0
				{
					type exited
					objs 1 CargoShip0
				}
			}
		}
	}

	end
	{
		events 3 invasion0 invasion1 cargo_ship_exit
		comparator ( and invasion0 invasion1 cargo_ship_exit )
		
	}
	
}
