mirror of
https://github.com/ENSL/NS.git
synced 2024-11-23 13:02:12 +00:00
04c334c94b
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@15 67975925-1194-0748-b3d5-c16f83f1a3a1
104 lines
No EOL
3 KiB
C++
104 lines
No EOL
3 KiB
C++
#ifndef CBASE_DOOR_H
|
|
#define CBASE_DOOR_H
|
|
|
|
#include "extdll.h"
|
|
#include "util.h"
|
|
#include "cbase.h"
|
|
#include "doors.h"
|
|
|
|
class CBaseDoor : public CBaseToggle
|
|
{
|
|
public:
|
|
void Spawn( void );
|
|
void Precache( void );
|
|
virtual void KeyValue( KeyValueData *pkvd );
|
|
virtual void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
|
virtual void Blocked( CBaseEntity *pOther );
|
|
|
|
|
|
virtual int ObjectCaps( void )
|
|
{
|
|
if (pev->spawnflags & SF_ITEM_USE_ONLY)
|
|
return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_IMPULSE_USE;
|
|
else
|
|
return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
|
|
};
|
|
virtual int Save( CSave &save );
|
|
virtual int Restore( CRestore &restore );
|
|
|
|
static TYPEDESCRIPTION m_SaveData[];
|
|
|
|
virtual void ResetEntity();
|
|
virtual void SetToggleState( int state );
|
|
|
|
// used to selectivly override defaults
|
|
void EXPORT DoorTouch( CBaseEntity *pOther );
|
|
|
|
// local functions
|
|
int DoorActivate( );
|
|
void EXPORT DoorGoUp( void );
|
|
void EXPORT DoorGoDown( void );
|
|
void EXPORT DoorHitTop( void );
|
|
void EXPORT DoorHitBottom( void );
|
|
|
|
BYTE m_bHealthValue;// some doors are medi-kit doors, they give players health
|
|
|
|
BYTE m_bMoveSnd; // sound a door makes while moving
|
|
BYTE m_bStopSnd; // sound a door makes when it stops
|
|
|
|
locksound_t m_ls; // door lock sounds
|
|
|
|
BYTE m_bLockedSound; // ordinals from entity selection
|
|
BYTE m_bLockedSentence;
|
|
BYTE m_bUnlockedSound;
|
|
BYTE m_bUnlockedSentence;
|
|
|
|
};
|
|
|
|
/*QUAKED FuncRotDoorSpawn (0 .5 .8) ? START_OPEN REVERSE
|
|
DOOR_DONT_LINK TOGGLE X_AXIS Y_AXIS
|
|
if two doors touch, they are assumed to be connected and operate as
|
|
a unit.
|
|
|
|
TOGGLE causes the door to wait in both the start and end states for
|
|
a trigger event.
|
|
|
|
START_OPEN causes the door to move to its destination when spawned,
|
|
and operate in reverse. It is used to temporarily or permanently
|
|
close off an area when triggered (not usefull for touch or
|
|
takedamage doors).
|
|
|
|
You need to have an origin brush as part of this entity. The
|
|
center of that brush will be
|
|
the point around which it is rotated. It will rotate around the Z
|
|
axis by default. You can
|
|
check either the X_AXIS or Y_AXIS box to change that.
|
|
|
|
"distance" is how many degrees the door will be rotated.
|
|
"speed" determines how fast the door moves; default value is 100.
|
|
|
|
REVERSE will cause the door to rotate in the opposite direction.
|
|
|
|
"angle" determines the opening direction
|
|
"targetname" if set, no touch field will be spawned and a remote
|
|
button or trigger field activates the door.
|
|
"health" if set, door must be shot open
|
|
"speed" movement speed (100 default)
|
|
"wait" wait before returning (3 default, -1 = never return)
|
|
"dmg" damage to inflict when blocked (2 default)
|
|
"sounds"
|
|
0) no sound
|
|
1) stone
|
|
2) base
|
|
3) stone chain
|
|
4) screechy metal
|
|
*/
|
|
class CRotDoor : public CBaseDoor
|
|
{
|
|
public:
|
|
void Spawn( void );
|
|
virtual void SetToggleState( int state );
|
|
};
|
|
|
|
|
|
#endif |