#include "point_checkpoint"
#include "anti_rush"

#include "opfor/nvision"
#include "opfor/weapon_knife"

const bool blAntiRushEnabled = false; // You can change this to have AntiRush mode enabled or disabled
const bool blDoorCrush = true; // Set to false if you wan't want doors to crush players

void MapInit()
{
	// Enable SC PointCheckPoint Support
	RegisterPointCheckPointEntity();
	// Enable custom entities for Anti-Rush
	ANTI_RUSH::EntityRegister( blAntiRushEnabled );
	// Enable Nightvision Support
	NightVision::Enable();
	// Register original Opposing Force knife weapon
	RegisterKnife();
	// Global CVars
	g_EngineFuncs.CVarSetFloat( "mp_hevsuit_voice", 0 );
}

void MapStart()
{
	ANTI_RUSH::AREntityRemove( "models/cubemath/*;beam_digit*;countdown_*" );
	// I can't be assed to go through each bsp and adding damage manually to every func_door just to prevent trolling- Outerbeast
	if( blDoorCrush )
	{
		CBaseEntity@ pEntity;
		
		while( ( @pEntity = g_EntityFuncs.FindEntityByClassname( pEntity, "func_door" ) ) !is null )
		{
			if( pEntity.pev.dmg == 0.0f )
				pEntity.pev.dmg = 50000.0f;
		}
	}

	g_EngineFuncs.ServerPrint( "Shephard's Adventures Version 1.1 - Download this map at scmapdb.com\n" );
}
