Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.5 KiB

7 years ago
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#if !defined( OEM_BUILD )
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "weapons.h"
#include "nodes.h"
#include "player.h"
#include "gamerules.h"
#ifndef CLIENT_DLL
LINK_ENTITY_TO_CLASS( laser_spot, CLaserSpot )
7 years ago
//=========================================================
//=========================================================
CLaserSpot *CLaserSpot::CreateSpot( void )
{
CLaserSpot *pSpot = GetClassPtr( (CLaserSpot *)NULL );
pSpot->Spawn();
8 years ago
pSpot->pev->classname = MAKE_STRING( "laser_spot" );
7 years ago
return pSpot;
}
//=========================================================
//=========================================================
CLaserSpot *CLaserSpot::CreateSpot( const char* spritename )
{
CLaserSpot *pSpot = CreateSpot();
SET_MODEL(ENT(pSpot->pev), spritename);
return pSpot;
}
//=========================================================
//=========================================================
void CLaserSpot::Spawn( void )
{
8 years ago
Precache();
7 years ago
pev->movetype = MOVETYPE_NONE;
pev->solid = SOLID_NOT;
pev->rendermode = kRenderGlow;
pev->renderfx = kRenderFxNoDissipation;
pev->renderamt = 255;
8 years ago
SET_MODEL( ENT( pev ), "sprites/laserdot.spr" );
7 years ago
UTIL_SetOrigin( this, pev->origin );
};
//=========================================================
// Suspend- make the laser sight invisible.
//=========================================================
void CLaserSpot::Suspend( float flSuspendTime )
{
pev->effects |= EF_NODRAW;
8 years ago
7 years ago
//LRC: -1 means suspend indefinitely
if (flSuspendTime == -1)
{
SetThink( NULL );
}
else
{
9 years ago
SetThink( &CLaserSpot::Revive );
7 years ago
SetNextThink( flSuspendTime );
}
}
//=========================================================
// Revive - bring a suspended laser sight back.
//=========================================================
void CLaserSpot::Revive( void )
{
pev->effects &= ~EF_NODRAW;
SetThink( NULL );
}
void CLaserSpot::Precache( void )
{
8 years ago
PRECACHE_MODEL( "sprites/laserdot.spr" );
}
7 years ago
#endif
#endif