#include "../beast/info_itemswap"
#include "../player_sentry" // Importing this interferes with nightvision hooks?

#include "env_rain"
#include "../beast/replace_weapon_sprites"

// Weapon behaviour/mode
// Like the singleplayer/multiplayer differences in vanilla HL/OF
bool IsMultiplayer = true;

void MapInit()
{	
    PLAYER_SENTRY::strDisplayName = "Blaster 3000";
    PLAYER_SENTRY::flSentryAttackRange = 2000.0f;
    PLAYER_SENTRY::Setup( "models/txas/npc/dgf_alien_sentry.mdl" );
	
	// !-HACK-!: level lighting is dim, setting custom lightstyle should boost
	g_EngineFuncs.LightStyle( 0, "zzzzzzzzzzzzzzzzzzzzzzzzzz" );
	
	//Rainfall
	Rain_MapInit();

		//OUTERBEAST ITEM REPLACER
	//Ammo replace disabled because the guns use default ammo
    dictionary dictArmas = {
		{ "weapon_crowbar",      "weapon_ofknife" },
        { "weapon_eagle",       "weapon_ofeagle" },  
        { "weapon_m16",  "weapon_hlmp5" },
        { "weapon_m249",        "weapon_ofm249" }
    };

    ItemSwap( dictArmas );
		
	REPLACE_WEAPON_SPRITES::SetReplacements ( 
	"txas/wpn",  "640hud3hug;640hud6hug;640hud7hug;640hudm0;640hudm2s;640hudm3s;640hudm7;640hudm20;640hudm30;640hudms;crosshairs;crosshairs_avp;kezammo_v2;kezcrosshairs;kweps_v2_off;kweps_v2_on;kweps_vanil;kweps_vanil_slct;railcross",  "weapon_9mmAR;weapon_9mmhandgun;weapon_357;weapon_crossbow;weapon_crowbar;weapon_displacer;weapon_eagle;weapon_egon;weapon_gauss;weapon_grapple;weapon_handgrenade;weapon_hornetgun;weapon_m16;weapon_m249;weapon_medkit;weapon_pipewrench;weapon_rpg;weapon_satchel;weapon_shotgun;weapon_snark;weapon_sniperrifle;weapon_sporelauncher;weapon_tripmine;weapon_uzi;weapon_uziakimbo" );
}

void MapActivate()
{
	Rain_MapActivate();
}

HookReturnCode ClientJoin(CBasePlayer@ plr)
{
	Rain_ClientJoin(plr);
	return HOOK_CONTINUE;
}

HookReturnCode ClientLeave(CBasePlayer@ leaver)
{
	Rain_ClientLeave(leaver);
	return HOOK_CONTINUE;
}