#include "point_checkpoint"

#include "func_vehicle_custom"
#include "th_ae_stavation_fatigue"
#include "armor_system"
#include "th_ae_food_material_tod"
#include "th_ae_spawn_item"
#include "th_ae_enclave"
#include "th_ae_spawn_enemy"
#include "th_weapons/weapon_teslagun_ae"

void MapInit()
{	
	// Map support is enabled here by default.
	// So you don't have to add "mp_survival_supported 1" to the map config
	 g_SurvivalMode.EnableMapSupport();

         VehicleMapInit( true, true );

         if(ENABLE_STARVATION == 1)
           {
             @INTERVAL = g_Scheduler.SetInterval("StarvationInterval", 1, -1);
           }

          if(ENABLE_RES == 1)
           {
             @RES_INTERVAL = g_Scheduler.SetInterval("Display_Res_Info", 1, -1);
           }



           //g_Hooks.RegisterHook( Hooks::Player::PlayerTakeDamage, PlayerTakeDamage );
           g_Hooks.RegisterHook( Hooks::Player::PlayerTakeDamage, PlayerTakeDamageInfection );
           g_Hooks.RegisterHook( Hooks::Player::PlayerRevived, give_infection_on_revived );
           g_Hooks.RegisterHook( Hooks::Player::PlayerSpawn, give_infection_on_respawned );



          g_CustomEntityFuncs.RegisterCustomEntity( "info_target_monster_spawn", "info_target_monster_spawn" );
          g_CustomEntityFuncs.RegisterCustomEntity( "info_target_human_spawn", "info_target_human_spawn" );
	  THWeaponTeslagun::Register();


  
}





void ActivateSurvival( CBaseEntity@ pActivator, CBaseEntity@ pCaller,
	USE_TYPE useType, float flValue )
{
	g_SurvivalMode.Activate();
}

void DisableSurvival( CBaseEntity@ pActivator, CBaseEntity@ pCaller, 
	USE_TYPE useType, float flValue )
{
    g_SurvivalMode.Disable();
}




/////Test Code


void abc(CBaseEntity@ activator, CBaseEntity@ pcaller, USE_TYPE usetype, float flValue)
{
     
     CBaseEntity@ mapcommand = null;
     @mapcommand = g_EntityFuncs.FindEntityByTargetname(mapcommand, "targ_command");

     g_EntityFuncs.FireTargets("light_gen", mapcommand, mapcommand, USE_SET);
     g_PlayerFuncs.ShowMessageAll(11111111);

}



void make_bot(CBaseEntity@ activator, CBaseEntity@ pcaller, USE_TYPE usetype, float flValue)
{
     
     ///CBasePlayer@ CreateBot()
     g_PlayerFuncs.CreateBot("testbot");
     g_PlayerFuncs.ShowMessageAll(11111111);
     
}















