#using scripts\codescripts\struct;

#using scripts\shared\clientfield_shared;
#using scripts\shared\spawner_shared;
#using scripts\shared\system_shared;

#using scripts\mp\gametypes\_globallogic;
#using scripts\mp\gametypes\_globallogic_player;
#using scripts\mp\gametypes\_globallogic_utils;


    	   	                                                                                                                                         	                                	                                                                                                                                                                                                                                                                                                                                                                    	        	     	              	    	   	               	                                              	                                                           	                               	                     	                                                                                                           	                                                                 	                                                              	                                                                                                                                             	                            	                                     	                                       	                                                                                                              	   	                  	       	                                                    	                   	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	                                                                                                 	                                    	                                                                                        	           	                        	                                            	                                             	                                                   	                                                             	                                                         	                                                                    	                                                                                                                                                                                                                                	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	    	         	                                                              	                                                          	                                   	                                   	                                                    	                                       	                                           	     	                                                                                                                                                                                                                                                      	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         	                                                               	        	                                                                                                                              	                                                                                                                     	                               	                                                      	                          
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         	   	                                                                                                                                                                                                                                  	                                                                                                                                                                                                                                                                                                                                                                                                                                                   

#namespace classicmode;

function autoexec __init__sytem__() {     system::register("classicmode",&__init__,undefined,undefined);    }
	
function __init__()
{
	//clientfield::register( "world", "classicmode", VERSION_SHIP, 1, "int" );
	level.classicMode = GetGametypeSetting( "classicMode" );
	if( level.classicMode )
	{
		EnableClassicMode();
	}
}

function EnableClassicMode()
{
	//if ( GetDvarint( "tu11_enableClassicMode") == 1 )
	{
		//level clientfield::set( "classicmode", 1 );
		
		// KEEP THESE IN SYNCE WITH CLASSMODE.CSC
		
		// Melee
		SetDvar( "bg_t7BlockMeleeUsageTime", 100 );

		// Double Jump
		SetDvar( "doublejump_enabled", 0 );
	
		// Wall Run
		SetDvar( "wallRun_enabled", 0 );
	
		// Slide
		SetDvar( "slide_maxTime", 550 );
		SetDvar( "playerEnergy_slideEnergyEnabled", 0 );

		//TRM
		SetDvar( "trm_maxSideMantleHeight", 0 );
		SetDvar( "trm_maxBackMantleHeight", 0 );
		
		// Swimming
		SetDvar( "player_swimming_enabled", 0 );
		SetDvar( "player_swimHeightRatio", 0.9 );
		
		// Sprint
		SetDvar( "player_sprintSpeedScale", 1.5 );
		SetDvar( "jump_slowdownEnable", 1 );
		SetDvar( "player_sprintUnlimited", 0 );
		SetDvar( "sprint_allowRestore", 0 );
		SetDvar( "sprint_allowReload", 0 );
		SetDvar( "sprint_allowRechamber", 0 );
		
		// Blur Time
		SetDvar( "cg_blur_time", 500 );
		
		SetDvar( "tu11_enableClassicMode", 1 );
	}
}