level dm0
{
	start
	{
		skybox SkyboxWorkspace0
		light_dir -1.0 0.0 0.0
		light_type directional
		light_power_scale 1.0
		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 1.0 1.0 1.0 0.075 1.0 1.0 1.0 0.04875 -1.0 0.0 0.0
		player_ship_selection
		{
			team alien
			{
				name ship_alien0
				name ship_alien1
				name ship_alien2
			}
			team human
			{
				cd raw
				//file loader_ship_human0.txt
				//file loader_ship_human1.txt
				name ship_human0
				name ship_human1
				name ship_human2
			}
		}
		spawn_points
		{
			spawn_point 0
			{
				type human
				position 0.0 0.0 350.0
				orientation 0.0 1.0 0.0 0.0
			}
			spawn_point 1
			{
				type human
				position -100.0 -200.0 350.0
				orientation 0.0 1.0 0.0 0.0
			}
			spawn_point 2
			{
				type alien
				position -100.0 100.0 350.0
				orientation 0.0 1.0 0.0 0.0
			}
			spawn_point 3
			{
				type alien
				position -100.0 200.0 350.0
				orientation 0.0 1.0 0.0 0.0
			}
		}
		obj CargoShip0
		{
			mesh ship_human_big0
			type cargo_ship
			position -200.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 100.0 0.0 -300.0
			orientation 0.0 1.0 0.0 180.0
			speed 0.0 0.0 -0.0
			ai 1
			friendly 1
			behavior defensive
			health 100
		}
		obj Defender1
		{
			mesh ship_human1
			type fighter_ship
			position 300.0 0.0 -300.0
			orientation 0.0 1.0 0.0 -90.0
			speed 0.0 0.0 -50.0
			ai 1
			friendly 1
			behavior defensive
			health 100
		}*/
		obj Asteroid0
		{
			mesh asteroid2
			type asteroid
			position 0.0 0.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 invasion0
	{
		previous_end_cond
		{
			none
		}
		delay secs 5
		spawn
		{
			obj Attacker0
			{
				mesh ship_alien0
				type fighter_ship
				position 0.0 -100.0 -3000.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 Attacker1
			{
				mesh ship_alien0
				type fighter_ship
				position 0.0 50.0 -3000.0
				orientation 0.0 1.0 0.0 180.0
				speed 0.0 0.0 0.0
				ai 1
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}
			obj Attacker2
			{
				mesh ship_alien0
				type fighter_ship
				position 0.0 100.0 -3000.0
				orientation 0.0 1.0 0.0 180.0
				speed 0.0 0.0 0.0
				ai 1
				friendly 0
				behavior aggresive
				health 100
				prioritize 1 cargo_ship
			}*/
		}
		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 600
				}
				comparator ( or loss_cond0 loss_cond1 )
			}
		}
	}
	event invasion1
	{
		previous_end_cond
		{
			prev_conds 1 invasion0
		}
		delay secs 25
		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
		{
			none //prev_conds 2 invasion0 invasion1
		}
		exit
		{
			objs 1 CargoShip0
		}
		delay secs 3000
		end_cond ship_exit
		{
			type win
			{
				cond win_cond0
				{
					type exited
					objs 1 CargoShip0
				}
			}
		}
	}

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