#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\_audio;

main()
{
	maps\mp\mp_detroit_precache::main();
	maps\createart\mp_detroit_art::main();
	maps\mp\mp_detroit_fx::main();
	
	maps\mp\_load::main();
	maps\mp\mp_detroit_lighting::main();
	maps\mp\mp_detroit_aud::main();
	
	maps\mp\_compass::setupMiniMap( "compass_map_mp_detroit" );
	
	game["attackers"] = "allies";
	game["defenders"] = "axis";
	
	//water
	//level.allow_swimming = true;
	maps\mp\_water::SetShallowWaterWeapon( "iw5_underwater_mp" );
	maps\mp\_water::init();
	
	//visionsets for killstreaks//
	
	level.ospvisionset = "(mp_detroit_osp)";
	level.osplightset = "(mp_detroit_osp)";
	level.droneVisionSet = "(mp_detroit_drone)";
	level.droneLightSet = "(mp_detroit_drone)";
	level.warbirdVisionSet = "(mp_detroit_warbird)";
	level.warbirdLightSet = "(mp_detroit_warbird)";
	
	//////////////////////////////
	
	level.aerial_pathnode_offset = 425;
	level thread maps\mp\mp_detroit_events::trams();
	
	level.mapCustomKillstreakFunc = ::detroitCustomKillstreakFunc;
	level.orbitalSupportOverrideFunc = ::detroitPaladinOverrides;
	
	level thread detroitStrikeHeightOverrides();
	
	thread set_lighting_values(); // after maps\mp\_load::main();
}
detroitStrikeHeightOverrides()
{
	if(!isdefined(level.airstrikeoverrides))
	{
		level.airstrikeoverrides = SpawnStruct();
	}
	level.airstrikeoverrides.spawnHeight = 2500;
}
detroitPaladinOverrides()
{
	level.orbitalsupportoverrides.spawnAngleMin = 220;
	level.orbitalsupportoverrides.spawnAngleMax = 260;
		
	if(level.currentgen)
	{
		level.orbitalsupportoverrides.leftArc		= 15;	//leftArc	= 25;
		level.orbitalsupportoverrides.rightArc		= 15;	//rightArc	= 25;
		level.orbitalsupportoverrides.topArc		= -35;	//topArc	= -25;
		level.orbitalsupportoverrides.bottomArc		= 55;	//bottomArc	= 60;
	}
	
}
detroitCustomKillstreakFunc()
{
	level thread maps\mp\killstreaks\streak_mp_detroit::init();
}
	
set_lighting_values()
{
    if ( IsUsingHDR() )
    {     
    	while (true)
        {
            level waittill("connected", player);               // we need to set the dvars for each player as he connects.
            player SetClientDvars(
                "r_tonemap", "1",
                //"r_tonemapkey", "0"              
			 	"r_tonemapLockAutoExposureAdjust", "0",
				"r_tonemapAutoExposureAdjust", "0"
           );
            /*
            player SetClientDvars(
                "r_tonemap", "1",
                "r_tonemapadaptspeed", ".07",
                "r_tonemapkey", "0",
                "r_veil", "1",
                "r_veilstrength", ".087",
                "r_tonemapexposure", "-10" 
                
              );
            
            //For setting the max exposure so we can get contrast back into the map without blowing everything out
            setdvar ("r_tonemapmaxexposure", "-10");
            
            //Controling how much SSAO there is in the scene
//            setdvar ("r_ssaoPower", "3.5");
//            setdvar ("r_ssaoBlurRadius", "1.5");

		setDvar("r_ssaoPower", "12.0");
		setDvar("r_ssaoStrength", "0.45");
		setDvar("r_ssaominstrengthdepth", "25.0");
		setDvar("r_ssaomaxstrengthdepth", "40.0");
            
            
//        setdvar("r_tonemapkey", .029, 3.0 );
        setDvar("r_tonemapkeydark", .001, 1.0 );
  		setDvar("r_tonemapkeydarklum", 3, 1.0);
  		setDvar("r_tonemapkeylight", .05, 1.0);
  		setDvar("r_tonemapkeylightlum", 20, 1.0);
  		*/
            
        }
    }
}
