Compare commits
No commits in common. "master" and "v1.03" have entirely different histories.
53 changed files with 2580 additions and 6891 deletions
186
arcade_comm.cpp
186
arcade_comm.cpp
|
@ -1,186 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/arcade_comm.cpp $
|
||||
// $Revision:: 5 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 2/16/99 8:38p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source may not be distributed and/or modified without
|
||||
// expressly written permission by Ritual Entertainment, Inc.
|
||||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/arcade_comm.cpp $
|
||||
//
|
||||
// 5 2/16/99 8:38p Jimdose
|
||||
// moved sin arcade comm stuff to client
|
||||
//
|
||||
// 4 12/14/98 8:16p Aldie
|
||||
// Added a disablecom command
|
||||
//
|
||||
// 3 12/14/98 5:23p Aldie
|
||||
// Added generic COM ports
|
||||
//
|
||||
// 2 12/08/98 7:04p Aldie
|
||||
// First version of serial comm for arcade
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Sin Arcade Serial Communications
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
|
||||
#include "..\\client\\client.h"
|
||||
#include "arcade_comm.h"
|
||||
#include <windows.h>
|
||||
|
||||
static LPDCB lpDCB=NULL;
|
||||
static HANDLE COMHANDLE=NULL;
|
||||
static cvar_t *disable_com;
|
||||
|
||||
void ARCADE_ComError
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR)&lpMsgBuf,
|
||||
0,
|
||||
NULL );
|
||||
|
||||
// Display the string.
|
||||
Com_Error( ERR_FATAL, (const char *)lpMsgBuf );
|
||||
|
||||
// Free the buffer.
|
||||
LocalFree( lpMsgBuf );
|
||||
}
|
||||
|
||||
|
||||
qboolean ARCADE_ComWriteByte
|
||||
(
|
||||
byte b
|
||||
)
|
||||
|
||||
{
|
||||
DWORD bytesWritten;
|
||||
LPBYTE lpByte;
|
||||
BOOL retval;
|
||||
|
||||
if ( disable_com->value )
|
||||
return( true );
|
||||
|
||||
lpByte = (BYTE *)"UB";
|
||||
|
||||
if ( !lpDCB || !COMHANDLE )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
retval = WriteFile( COMHANDLE,
|
||||
lpByte,
|
||||
2,
|
||||
&bytesWritten,
|
||||
NULL );
|
||||
if (!retval)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 50 millisecond wait for the board
|
||||
Sleep( 50 );
|
||||
|
||||
// Byte command to send to the Universal Board
|
||||
lpByte = &b;
|
||||
|
||||
// Send over the byte command
|
||||
retval = WriteFile( COMHANDLE,
|
||||
lpByte,
|
||||
2,
|
||||
&bytesWritten,
|
||||
NULL );
|
||||
|
||||
if (!retval)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ARCADE_SetupCommunications
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
LPCTSTR lpDef;
|
||||
BOOL retval;
|
||||
cvar_t *comport;
|
||||
const char *comstring;
|
||||
|
||||
if ( lpDCB ) // Already setup
|
||||
return;
|
||||
|
||||
disable_com = Cvar_Get( "disablecom", "0", 0 );
|
||||
|
||||
if ( disable_com->value )
|
||||
return;
|
||||
|
||||
comport = Cvar_Get( "comport", "1", 0 );
|
||||
|
||||
if ( comport->value == 2 )
|
||||
{
|
||||
lpDef = "COM2: baud=9600 parity=N data=8 stop=1";
|
||||
comstring = "COM2";
|
||||
}
|
||||
else
|
||||
{
|
||||
lpDef = "COM1: baud=9600 parity=N data=8 stop=1";
|
||||
comstring = "COM1";
|
||||
}
|
||||
|
||||
lpDCB = new DCB;
|
||||
|
||||
retval = BuildCommDCB( lpDef, lpDCB );
|
||||
|
||||
if ( !retval )
|
||||
{
|
||||
// An error occurred creating the device
|
||||
ARCADE_ComError();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ( COMHANDLE = ( CreateFile( comstring,
|
||||
GENERIC_WRITE,
|
||||
0, // exclusive access
|
||||
NULL, // no security attrs
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
) ) ) == (HANDLE) -1 )
|
||||
{
|
||||
Com_Error( ERR_FATAL, "Could not create COM I/O file\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
PurgeComm( COMHANDLE, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ARCADE_CloseCommunications
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
CloseHandle( COMHANDLE );
|
||||
free( lpDCB );
|
||||
}
|
||||
#endif
|
|
@ -1,40 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/arcade_comm.h $
|
||||
// $Revision:: 3 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 2/16/99 8:38p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source may not be distributed and/or modified without
|
||||
// expressly written permission by Ritual Entertainment, Inc.
|
||||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/arcade_comm.h $
|
||||
//
|
||||
// 3 2/16/99 8:38p Jimdose
|
||||
// moved sin arcade comm stuff to client
|
||||
//
|
||||
// 2 12/14/98 5:55p Aldie
|
||||
// First version of arcade communications
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Arcade Communications Functions
|
||||
|
||||
#ifndef __ARCADE_COMM_H__
|
||||
#define __ARCADE_COMM_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void ARCADE_SetupCommunications( void );
|
||||
void ARCADE_CloseCommunications( void );
|
||||
qboolean ARCADE_ComWriteByte( byte b );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
188
bspline.cpp
188
bspline.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/bspline.cpp $
|
||||
// $Revision:: 14 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 8/07/99 1:53p $
|
||||
// $Revision:: 12 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 10/19/98 9:51p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,12 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/bspline.cpp $
|
||||
//
|
||||
// 14 8/07/99 1:53p Markd
|
||||
// Fixed a bunch of more code for version 1.06
|
||||
//
|
||||
// 13 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 12 10/19/98 9:51p Jimdose
|
||||
// fixed savegame bugs with bspline
|
||||
//
|
||||
|
@ -607,14 +601,10 @@ int BSpline::PickControlPoint
|
|||
CLASS_DECLARATION( Entity, SplinePath, "info_splinepath" );
|
||||
|
||||
Event EV_SplinePath_Create( "SplinePath_create" );
|
||||
Event EV_SplinePath_Loop( "loop", EV_CONSOLE );
|
||||
Event EV_SplinePath_Speed( "speed" );
|
||||
|
||||
ResponseDef SplinePath::Responses[] =
|
||||
{
|
||||
{ &EV_SplinePath_Create, ( Response )SplinePath::CreatePath },
|
||||
{ &EV_SplinePath_Loop, ( Response )SplinePath::SetLoop },
|
||||
{ &EV_SplinePath_Speed, ( Response )SplinePath::SetSpeed },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -623,9 +613,6 @@ SplinePath::SplinePath()
|
|||
owner = this;
|
||||
next = NULL;
|
||||
loop = NULL;
|
||||
doWatch = false;
|
||||
watchEnt = "";
|
||||
|
||||
loop_name = G_GetStringArg( "loop" );
|
||||
angles = G_GetVectorArg( "angles" );
|
||||
speed = G_GetFloatArg( "speed", 1 );
|
||||
|
@ -639,25 +626,6 @@ SplinePath::SplinePath()
|
|||
}
|
||||
}
|
||||
|
||||
SplinePath::~SplinePath()
|
||||
{
|
||||
// disconnect from the chain
|
||||
if ( owner != this )
|
||||
{
|
||||
owner->SetNext( next );
|
||||
owner = this;
|
||||
}
|
||||
else if ( next )
|
||||
{
|
||||
next->SetPrev( NULL );
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
assert( owner == this );
|
||||
assert( next == NULL );
|
||||
}
|
||||
|
||||
|
||||
void SplinePath::CreatePath
|
||||
(
|
||||
Event *ev
|
||||
|
@ -707,153 +675,3 @@ SplinePath *SplinePath::GetLoop
|
|||
{
|
||||
return loop;
|
||||
}
|
||||
|
||||
void SplinePath::SetLoop
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
loop_name = ev->GetString( 1 );
|
||||
}
|
||||
|
||||
void SplinePath::SetSpeed
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
speed = ev->GetFloat( 1 );
|
||||
}
|
||||
|
||||
SplinePath *SplinePath::GetPrev
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
if ( owner == this )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return owner;
|
||||
}
|
||||
|
||||
void SplinePath::SetNext
|
||||
(
|
||||
SplinePath *node
|
||||
)
|
||||
|
||||
{
|
||||
if ( next )
|
||||
{
|
||||
// remove ourselves from the chain
|
||||
next->owner = next;
|
||||
}
|
||||
|
||||
next = node;
|
||||
if ( next )
|
||||
{
|
||||
// disconnect next from it's previous node
|
||||
if ( next->owner != next )
|
||||
{
|
||||
next->owner->next = NULL;
|
||||
}
|
||||
next->owner = this;
|
||||
}
|
||||
}
|
||||
|
||||
void SplinePath::SetPrev
|
||||
(
|
||||
SplinePath *node
|
||||
)
|
||||
|
||||
{
|
||||
if ( owner != this )
|
||||
{
|
||||
owner->next = NULL;
|
||||
}
|
||||
|
||||
if ( node && ( node != this ) )
|
||||
{
|
||||
// safely remove the node from its chain
|
||||
if ( node->next )
|
||||
{
|
||||
node->next->owner = node->next;
|
||||
}
|
||||
node->next = this;
|
||||
owner = node;
|
||||
}
|
||||
else
|
||||
{
|
||||
owner = this;
|
||||
}
|
||||
}
|
||||
|
||||
void SplinePath::SetWatch
|
||||
(
|
||||
const char *name
|
||||
)
|
||||
|
||||
{
|
||||
doWatch = true;
|
||||
watchEnt = name;
|
||||
}
|
||||
|
||||
void SplinePath::NoWatch
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
doWatch = true;
|
||||
watchEnt = "";
|
||||
}
|
||||
|
||||
Entity *SplinePath::GetWatch
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
const char *name;
|
||||
int t;
|
||||
|
||||
name = watchEnt.c_str();
|
||||
if ( name[ 0 ] == '$' )
|
||||
{
|
||||
t = G_FindTarget( 0, &name[ 1 ] );
|
||||
if ( !t )
|
||||
{
|
||||
warning( "GetWatch", "Entity with targetname of '%s' not found", &name[ 1 ] );
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( name[ 0 ] != '*' )
|
||||
{
|
||||
warning( "GetWatch", "Expecting a '*'-prefixed entity number but found '%s'.", name );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( !IsNumeric( &name[ 1 ] ) )
|
||||
{
|
||||
warning( "GetWatch", "Expecting a numeric value but found '%s'.", &name[ 1 ] );
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
t = atoi( &name[ 1 ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( t < 0 ) || ( t > game.maxentities ) )
|
||||
{
|
||||
warning( "GetWatch", "%d out of valid range for entity.", t );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return G_GetEntity( t );
|
||||
}
|
||||
|
|
30
bspline.h
30
bspline.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/bspline.h $
|
||||
// $Revision:: 20 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 5/19/99 11:30a $
|
||||
// $Revision:: 19 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 10/25/98 11:52p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/bspline.h $
|
||||
//
|
||||
// 20 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 19 10/25/98 11:52p Jimdose
|
||||
// added EXPORT_TEMPLATE
|
||||
//
|
||||
|
@ -557,10 +554,6 @@ template class EXPORT_FROM_DLL SafePtr<SplinePath>;
|
|||
#endif
|
||||
typedef SafePtr<SplinePath> SplinePathPtr;
|
||||
|
||||
extern Event EV_SplinePath_Create;
|
||||
extern Event EV_SplinePath_Loop;
|
||||
extern Event EV_SplinePath_Speed;
|
||||
|
||||
class EXPORT_FROM_DLL SplinePath : public Entity
|
||||
{
|
||||
protected:
|
||||
|
@ -570,26 +563,15 @@ class EXPORT_FROM_DLL SplinePath : public Entity
|
|||
str loop_name;
|
||||
|
||||
void CreatePath( Event *ev );
|
||||
void SetLoop( Event *ev );
|
||||
void SetSpeed( Event *ev );
|
||||
|
||||
public:
|
||||
float speed;
|
||||
qboolean doWatch;
|
||||
str watchEnt;
|
||||
|
||||
CLASS_PROTOTYPE( SplinePath );
|
||||
|
||||
SplinePath();
|
||||
~SplinePath();
|
||||
SplinePath *GetNext( void );
|
||||
SplinePath *GetPrev( void );
|
||||
SplinePath *GetLoop( void );
|
||||
void SetWatch( const char *name );
|
||||
void NoWatch( void );
|
||||
Entity *GetWatch( void );
|
||||
void SetNext( SplinePath *node );
|
||||
void SetPrev( SplinePath *node );
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
};
|
||||
|
@ -607,8 +589,6 @@ inline EXPORT_FROM_DLL void SplinePath::Archive
|
|||
arc.WriteSafePointer( loop );
|
||||
arc.WriteString( loop_name );
|
||||
arc.WriteFloat( speed );
|
||||
arc.WriteBoolean( doWatch );
|
||||
arc.WriteString( watchEnt );
|
||||
}
|
||||
|
||||
inline EXPORT_FROM_DLL void SplinePath::Unarchive
|
||||
|
@ -624,10 +604,6 @@ inline EXPORT_FROM_DLL void SplinePath::Unarchive
|
|||
arc.ReadSafePointer( &loop );
|
||||
arc.ReadString( &loop_name );
|
||||
arc.ReadFloat( &speed );
|
||||
arc.ReadBoolean( &doWatch );
|
||||
arc.ReadString( &watchEnt );
|
||||
|
||||
CancelEventsOfType( EV_SplinePath_Create );
|
||||
}
|
||||
|
||||
#endif /* __BSPLINE_H__ */
|
||||
|
|
14
bullet.h
14
bullet.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/bullet.h $
|
||||
// $Revision:: 22 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 2/26/99 5:54p $
|
||||
// $Revision:: 21 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 8/06/98 10:53p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/bullet.h $
|
||||
//
|
||||
// 22 2/26/99 5:54p Markd
|
||||
// Re-arranged for better sub-classing
|
||||
//
|
||||
// 21 8/06/98 10:53p Aldie
|
||||
// Added weapon tweaks and kickback. Also modified blast radius damage and
|
||||
// rocket jumping.
|
||||
|
@ -92,14 +89,13 @@
|
|||
class EXPORT_FROM_DLL BulletWeapon : public Weapon
|
||||
{
|
||||
protected:
|
||||
BulletWeapon();
|
||||
virtual void TraceAttack( Vector start, Vector end, int damage, trace_t *trace, int numricochets, int kick, int dflags, int meansofdeath, qboolean server_effects );
|
||||
virtual void FireBullets( int numbullets, Vector spread, int mindamage, int maxdamage, int dflags, int meansofdeath, qboolean server_effects );
|
||||
virtual void FireTracer( void );
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( BulletWeapon );
|
||||
|
||||
BulletWeapon();
|
||||
virtual void FireBullets( int numbullets, Vector spread, int mindamage, int maxdamage, int dflags, int meansofdeath, qboolean server_effects );
|
||||
};
|
||||
|
||||
#endif /* BULLET.h */
|
||||
|
|
776
camera.cpp
776
camera.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/camera.cpp $
|
||||
// $Revision:: 52 $
|
||||
// $Revision:: 47 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 11/02/99 12:09p $
|
||||
// $Date:: 11/14/98 2:33a $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,21 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/camera.cpp $
|
||||
//
|
||||
// 52 11/02/99 12:09p Markd
|
||||
// Fixed CTF cheat bug
|
||||
//
|
||||
// 51 10/28/99 10:43a Markd
|
||||
// made a bunch of console commands cheat protected
|
||||
//
|
||||
// 50 5/19/99 4:57p Markd
|
||||
// fixed some errors
|
||||
//
|
||||
// 49 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 48 3/19/99 8:58p Aldie
|
||||
// Added SetCurrentDistance
|
||||
//
|
||||
// 47 11/14/98 2:33a Markd
|
||||
// put in some better jump cutting
|
||||
//
|
||||
|
@ -182,10 +167,6 @@
|
|||
#include "player.h"
|
||||
#include "camera.h"
|
||||
|
||||
#define CAMERA_PATHFILE_VERSION 1
|
||||
|
||||
CameraManager CameraMan;
|
||||
|
||||
cvar_t *sv_showcameras;
|
||||
|
||||
Event EV_Camera_FollowingPath( "followingpath" );
|
||||
|
@ -1023,15 +1004,6 @@ void Camera::SetDistance
|
|||
newstate.move.follow_dist = ev->GetFloat( 1 );
|
||||
}
|
||||
|
||||
void Camera::SetCurrentDistance
|
||||
(
|
||||
float dist
|
||||
)
|
||||
|
||||
{
|
||||
currentstate.move.follow_dist = dist;
|
||||
}
|
||||
|
||||
void Camera::SetHeight
|
||||
(
|
||||
Event *ev
|
||||
|
@ -1373,19 +1345,6 @@ str &Camera::Thread
|
|||
return thread;
|
||||
}
|
||||
|
||||
void Camera::Reset
|
||||
(
|
||||
Vector org,
|
||||
Vector ang
|
||||
)
|
||||
|
||||
{
|
||||
setOrigin( org );
|
||||
setAngles( ang );
|
||||
InitializeState( currentstate );
|
||||
InitializeState( newstate );
|
||||
}
|
||||
|
||||
CLASS_DECLARATION( Camera, SecurityCamera, "func_securitycamera" );
|
||||
|
||||
ResponseDef SecurityCamera::Responses[] =
|
||||
|
@ -1398,734 +1357,3 @@ SecurityCamera::SecurityCamera()
|
|||
setModel( "camera.def" );
|
||||
showModel();
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
Camera Manager
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
Event EV_CameraManager_NewPath( "new", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_SetPath( "setpath", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_SetTargetName( "settargetname", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_SetTarget( "settarget", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_AddPoint( "add", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_DeletePoint( "delete", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_MovePlayer( "moveplayer", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_ReplacePoint( "replace", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_NextPoint( "next", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_PreviousPoint( "prev", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_ShowPath( "show" );
|
||||
Event EV_CameraManager_HidePath( "hide" );
|
||||
Event EV_CameraManager_PlayPath( "play", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_LoopPath( "loop", EV_CONSOLE );
|
||||
Event EV_CameraManager_StopPlayback( "stop" );
|
||||
Event EV_CameraManager_Watch( "watch" );
|
||||
Event EV_CameraManager_NoWatch( "nowatch" );
|
||||
Event EV_CameraManager_Speed( "setspeed", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_Save( "save", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_Load( "load", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_CameraManager_SaveMap( "savemap", EV_CONSOLE | EV_CHEAT );
|
||||
|
||||
CLASS_DECLARATION( Listener, CameraManager, NULL );
|
||||
|
||||
ResponseDef CameraManager::Responses[] =
|
||||
{
|
||||
{ &EV_CameraManager_NewPath, ( Response )CameraManager::NewPath },
|
||||
{ &EV_CameraManager_SetPath, ( Response )CameraManager::SetPath },
|
||||
{ &EV_CameraManager_SetTargetName, ( Response )CameraManager::SetTargetName },
|
||||
{ &EV_CameraManager_SetTarget, ( Response )CameraManager::SetTarget },
|
||||
{ &EV_CameraManager_SetPath, ( Response )CameraManager::SetPath },
|
||||
{ &EV_CameraManager_AddPoint, ( Response )CameraManager::AddPoint },
|
||||
{ &EV_CameraManager_ReplacePoint, ( Response )CameraManager::ReplacePoint },
|
||||
{ &EV_CameraManager_DeletePoint, ( Response )CameraManager::DeletePoint },
|
||||
{ &EV_CameraManager_MovePlayer, ( Response )CameraManager::MovePlayer },
|
||||
{ &EV_CameraManager_NextPoint, ( Response )CameraManager::NextPoint },
|
||||
{ &EV_CameraManager_PreviousPoint, ( Response )CameraManager::PreviousPoint },
|
||||
{ &EV_CameraManager_ShowPath, ( Response )CameraManager::ShowPath },
|
||||
{ &EV_CameraManager_HidePath, ( Response )CameraManager::HidePath },
|
||||
{ &EV_CameraManager_PlayPath, ( Response )CameraManager::PlayPath },
|
||||
{ &EV_CameraManager_LoopPath, ( Response )CameraManager::LoopPath },
|
||||
{ &EV_CameraManager_StopPlayback, ( Response )CameraManager::StopPlayback },
|
||||
{ &EV_CameraManager_Watch, ( Response )CameraManager::Watch },
|
||||
{ &EV_CameraManager_NoWatch, ( Response )CameraManager::NoWatch },
|
||||
{ &EV_CameraManager_Speed, ( Response )CameraManager::Speed },
|
||||
{ &EV_CameraManager_Save, ( Response )CameraManager::Save },
|
||||
{ &EV_CameraManager_Load, ( Response )CameraManager::Load },
|
||||
{ &EV_CameraManager_SaveMap, ( Response )CameraManager::SaveMap },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
Player *CameraManager_GetPlayer
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
assert( g_edicts[ 1 ].entity && g_edicts[ 1 ].entity->isSubclassOf( Player ) );
|
||||
if ( !g_edicts[ 1 ].entity || !( g_edicts[ 1 ].entity->isSubclassOf( Player ) ) )
|
||||
{
|
||||
gi.printf( "No player found.\n" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ( Player * )g_edicts[ 1 ].entity;
|
||||
}
|
||||
|
||||
CameraManager::CameraManager()
|
||||
{
|
||||
path = NULL;
|
||||
current = NULL;
|
||||
speed = 1;
|
||||
watch = 0;
|
||||
cam = NULL;
|
||||
}
|
||||
|
||||
void CameraManager::NewPath
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( path )
|
||||
{
|
||||
path = NULL;
|
||||
current = NULL;
|
||||
}
|
||||
|
||||
ProcessEvent( EV_CameraManager_ShowPath );
|
||||
}
|
||||
|
||||
void CameraManager::SetPath
|
||||
(
|
||||
SplinePath *node
|
||||
)
|
||||
|
||||
{
|
||||
path = node;
|
||||
current = node;
|
||||
}
|
||||
|
||||
void CameraManager::SetPath
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Entity *ent;
|
||||
|
||||
if ( !ev->NumArgs() )
|
||||
{
|
||||
ev->Error( "Usage: cam setpath [pathname]" );
|
||||
return;
|
||||
}
|
||||
|
||||
ent = ev->GetEntity( 1 );
|
||||
if ( !ent )
|
||||
{
|
||||
ev->Error( "Could not find path named '%s'.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ent->isSubclassOf( SplinePath ) )
|
||||
{
|
||||
ev->Error( "'%s' is not a camera path.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
SetPath( ( SplinePath * )ent );
|
||||
}
|
||||
|
||||
void CameraManager::SetTargetName
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( ev->NumArgs() != 1 )
|
||||
{
|
||||
ev->Error( "Usage: cam targetname [name]" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !path )
|
||||
{
|
||||
ev->Error( "Camera path not set." );
|
||||
return;
|
||||
}
|
||||
|
||||
path->SetTargetName( ev->GetString( 1 ) );
|
||||
}
|
||||
|
||||
void CameraManager::SetTarget
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( ev->NumArgs() != 1 )
|
||||
{
|
||||
ev->Error( "Usage: cam target [name]" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !current )
|
||||
{
|
||||
ev->Error( "Camera path not set." );
|
||||
return;
|
||||
}
|
||||
|
||||
current->SetTarget( ev->GetString( 1 ) );
|
||||
}
|
||||
|
||||
void CameraManager::AddPoint
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Player *player;
|
||||
SplinePath *prev;
|
||||
SplinePath *next;
|
||||
Vector ang;
|
||||
Vector pos;
|
||||
|
||||
player = CameraManager_GetPlayer();
|
||||
if ( player )
|
||||
{
|
||||
prev = current;
|
||||
if ( current )
|
||||
{
|
||||
next = current->GetNext();
|
||||
}
|
||||
else
|
||||
{
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
player->GetPlayerView( &pos, &ang );
|
||||
|
||||
current = new SplinePath;
|
||||
current->setOrigin( pos );
|
||||
current->setAngles( ang );
|
||||
current->speed = speed;
|
||||
current->SetPrev( prev );
|
||||
current->SetNext( next );
|
||||
|
||||
if ( !path )
|
||||
{
|
||||
path = current;
|
||||
}
|
||||
|
||||
CancelEventsOfType( EV_CameraManager_ShowPath );
|
||||
ProcessEvent( EV_CameraManager_ShowPath );
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::ReplacePoint
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Player *player;
|
||||
Vector ang;
|
||||
Vector pos;
|
||||
|
||||
player = CameraManager_GetPlayer();
|
||||
if ( current && player )
|
||||
{
|
||||
player->GetPlayerView( &pos, &ang );
|
||||
|
||||
current->setOrigin( pos );
|
||||
current->setAngles( ang );
|
||||
current->speed = speed;
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::DeletePoint
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
SplinePath *node;
|
||||
|
||||
if ( current )
|
||||
{
|
||||
node = current->GetNext();
|
||||
if ( !node )
|
||||
{
|
||||
node = current->GetPrev();
|
||||
}
|
||||
|
||||
if ( path == current )
|
||||
{
|
||||
path = current->GetNext();
|
||||
}
|
||||
|
||||
delete current;
|
||||
current = node;
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::MovePlayer
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Player *player;
|
||||
Vector pos;
|
||||
|
||||
player = CameraManager_GetPlayer();
|
||||
if ( current && player )
|
||||
{
|
||||
player->GetPlayerView( &pos, NULL );
|
||||
|
||||
player->setOrigin( current->origin - pos + player->origin );
|
||||
player->setAngles( current->angles );
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::NextPoint
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
SplinePath *next;
|
||||
|
||||
if ( current )
|
||||
{
|
||||
next = current->GetNext();
|
||||
if ( next )
|
||||
{
|
||||
current = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::PreviousPoint
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
SplinePath *prev;
|
||||
|
||||
if ( current )
|
||||
{
|
||||
prev = current->GetPrev();
|
||||
if ( prev )
|
||||
{
|
||||
current = prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::ShowPath
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
SplinePath *node;
|
||||
SplinePath *prev;
|
||||
Vector mins( -8, -8, -8 );
|
||||
Vector maxs( 8, 8, 8 );
|
||||
|
||||
if ( ev->NumArgs() )
|
||||
{
|
||||
Entity *ent;
|
||||
|
||||
ent = ev->GetEntity( 1 );
|
||||
if ( !ent )
|
||||
{
|
||||
ev->Error( "Could not find path named '%s'.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ent->isSubclassOf( SplinePath ) )
|
||||
{
|
||||
ev->Error( "'%s' is not a camera path.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
SetPath( ( SplinePath * )ent );
|
||||
}
|
||||
|
||||
prev = NULL;
|
||||
for( node = path; node != NULL; node = node->GetNext() )
|
||||
{
|
||||
if ( prev )
|
||||
{
|
||||
//G_LineStipple( 4, ( unsigned short )( 0xF0F0F0F0 >> ( 7 - ( level.framenum & 7 ) ) ) );
|
||||
G_DebugLine( prev->origin, node->origin, 1, 1, 1, 1 );
|
||||
//G_LineStipple( 1, 0xffff );
|
||||
}
|
||||
|
||||
if ( current == node )
|
||||
{
|
||||
G_DrawDebugNumber( node->origin + Vector( 0, 0, 20 ), node->speed, 0.5, 0, 1, 0, 1 );
|
||||
G_DebugBBox( node->origin, mins, maxs, 1, 1, 0, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
G_DebugBBox( node->origin, mins, maxs, 1, 0, 0, 1 );
|
||||
}
|
||||
|
||||
//G_LineWidth( 3 );
|
||||
G_DebugLine( node->origin, node->origin + Vector( node->orientation[ 0 ] ) * 16, 1, 0, 0, 1 );
|
||||
G_DebugLine( node->origin, node->origin + Vector( node->orientation[ 1 ] ) * 16, 0, 1, 0, 1 );
|
||||
G_DebugLine( node->origin, node->origin + Vector( node->orientation[ 2 ] ) * 16, 0, 0, 1, 1 );
|
||||
//G_LineWidth( 1 );
|
||||
|
||||
prev = node;
|
||||
}
|
||||
PostEvent( EV_CameraManager_ShowPath, FRAMETIME );
|
||||
}
|
||||
|
||||
void CameraManager::HidePath
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
CancelEventsOfType( EV_CameraManager_ShowPath );
|
||||
}
|
||||
|
||||
void CameraManager::StopPlayback
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( cam )
|
||||
{
|
||||
cam->Stop();
|
||||
SetCamera( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::PlayPath
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( cam )
|
||||
{
|
||||
SetCamera( NULL );
|
||||
}
|
||||
|
||||
if ( ev->NumArgs() )
|
||||
{
|
||||
Entity *ent;
|
||||
|
||||
ent = ev->GetEntity( 1 );
|
||||
if ( !ent )
|
||||
{
|
||||
ev->Error( "Could not find path named '%s'.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ent->isSubclassOf( SplinePath ) )
|
||||
{
|
||||
ev->Error( "'%s' is not a camera path.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
SetPath( ( SplinePath * )ent );
|
||||
}
|
||||
|
||||
if ( path )
|
||||
{
|
||||
if ( !cam )
|
||||
{
|
||||
cam = new Camera;
|
||||
cam->SetTargetName( "_loadedcamera" );
|
||||
}
|
||||
|
||||
cam->Reset( path->origin, path->angles );
|
||||
cam->FollowPath( path, false, NULL );
|
||||
SetCamera( cam );
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::LoopPath
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( cam )
|
||||
{
|
||||
SetCamera( NULL );
|
||||
}
|
||||
|
||||
if ( ev->NumArgs() )
|
||||
{
|
||||
Entity *ent;
|
||||
|
||||
ent = ev->GetEntity( 1 );
|
||||
if ( !ent )
|
||||
{
|
||||
ev->Error( "Could not find path named '%s'.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ent->isSubclassOf( SplinePath ) )
|
||||
{
|
||||
ev->Error( "'%s' is not a camera path.", ev->GetString( 1 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
SetPath( ( SplinePath * )ent );
|
||||
}
|
||||
|
||||
if ( path )
|
||||
{
|
||||
if ( !cam )
|
||||
{
|
||||
cam = new Camera;
|
||||
cam->SetTargetName( "_loadedcamera" );
|
||||
}
|
||||
|
||||
cam->Reset( path->origin, path->angles );
|
||||
cam->FollowPath( path, true, NULL );
|
||||
SetCamera( cam );
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::Watch
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( current )
|
||||
{
|
||||
current->SetWatch( ev->GetString( 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::NoWatch
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( current )
|
||||
{
|
||||
current->NoWatch();
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::Speed
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
speed = ev->GetFloat( 1 );
|
||||
if ( current )
|
||||
{
|
||||
current->speed = speed;
|
||||
}
|
||||
}
|
||||
|
||||
void CameraManager::Save
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
SplinePath *node;
|
||||
Archiver arc;
|
||||
str filename;
|
||||
int num;
|
||||
|
||||
if ( ev->NumArgs() != 1 )
|
||||
{
|
||||
ev->Error( "Usage: cam save [filename]" );
|
||||
return;
|
||||
}
|
||||
|
||||
num = 0;
|
||||
for( node = path; node != NULL; node = node->GetNext() )
|
||||
{
|
||||
num++;
|
||||
}
|
||||
|
||||
if ( num == 0 )
|
||||
{
|
||||
ev->Error( "Can't save. No points in path." );
|
||||
return;
|
||||
}
|
||||
|
||||
filename = gi.GameDir();
|
||||
filename += "/cams/";
|
||||
filename += ev->GetString( 1 );
|
||||
filename += ".cam";
|
||||
|
||||
if ( !path->targetname.length() )
|
||||
{
|
||||
path->SetTargetName( ev->GetString( 1 ) );
|
||||
gi.printf( "Targetname set to '%s'\n", path->targetname.c_str() );
|
||||
}
|
||||
|
||||
gi.printf( "Saving camera path to '%s'...\n", filename.c_str() );
|
||||
|
||||
arc.Create( filename );
|
||||
arc.WriteInteger( CAMERA_PATHFILE_VERSION );
|
||||
|
||||
arc.WriteInteger( num );
|
||||
arc.WriteSafePointer( path );
|
||||
|
||||
for( node = path; node != NULL; node = node->GetNext() )
|
||||
{
|
||||
arc.WriteObject( node );
|
||||
}
|
||||
|
||||
arc.Close();
|
||||
|
||||
gi.printf( "done.\n" );
|
||||
}
|
||||
|
||||
void CameraManager::Load
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Archiver arc;
|
||||
str filename;
|
||||
int version;
|
||||
int i;
|
||||
int num;
|
||||
|
||||
if ( ev->NumArgs() != 1 )
|
||||
{
|
||||
ev->Error( "Usage: cam load [filename]" );
|
||||
return;
|
||||
}
|
||||
|
||||
filename = "cams/";
|
||||
filename += ev->GetString( 1 );
|
||||
filename += ".cam";
|
||||
|
||||
gi.printf( "Loading camera path from '%s'...\n", filename.c_str() );
|
||||
|
||||
arc.Read( filename );
|
||||
version = arc.ReadInteger();
|
||||
if ( version == CAMERA_PATHFILE_VERSION )
|
||||
{
|
||||
arc.ReadInteger( &num );
|
||||
|
||||
arc.ReadSafePointer( &path );
|
||||
|
||||
for( i = 0; i < num; i++ )
|
||||
{
|
||||
arc.ReadObject();
|
||||
}
|
||||
|
||||
arc.Close();
|
||||
current = path;
|
||||
|
||||
gi.printf( "done.\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
arc.Close();
|
||||
ev->Error( "Expecting version %d path file. Camera path file is version %d.", CAMERA_PATHFILE_VERSION, version );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CameraManager::SaveMap
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
SplinePath *node;
|
||||
str buf;
|
||||
char tempbuf[ 512 ];
|
||||
str filename;
|
||||
int num;
|
||||
int index;
|
||||
FILE * file;
|
||||
|
||||
if ( ev->NumArgs() != 1 )
|
||||
{
|
||||
ev->Error( "Usage: cam savemap [filename]" );
|
||||
return;
|
||||
}
|
||||
|
||||
num = 0;
|
||||
for( node = path; node != NULL; node = node->GetNext() )
|
||||
{
|
||||
num++;
|
||||
}
|
||||
|
||||
if ( num == 0 )
|
||||
{
|
||||
ev->Error( "Can't save. No points in path." );
|
||||
return;
|
||||
}
|
||||
|
||||
filename = "cams/";
|
||||
filename += ev->GetString( 1 );
|
||||
filename += ".map";
|
||||
|
||||
if ( !path->targetname.length() )
|
||||
{
|
||||
path->SetTargetName( ev->GetString( 1 ) );
|
||||
gi.printf( "Targetname set to '%s'\n", path->targetname.c_str() );
|
||||
}
|
||||
|
||||
gi.printf( "Saving camera path to map '%s'...\n", filename.c_str() );
|
||||
|
||||
buf = "";
|
||||
index = 0;
|
||||
for( node = path; node != NULL; node = node->GetNext() )
|
||||
{
|
||||
sprintf( tempbuf, "// pathnode %d\n", index );
|
||||
buf += str( tempbuf );
|
||||
buf += "{\n";
|
||||
sprintf( tempbuf, "\"classname\" \"info_splinepath\"\n" );
|
||||
buf += str( tempbuf );
|
||||
if ( index < ( num - 1 ) )
|
||||
{
|
||||
sprintf( tempbuf, "\"target\" \"camnode_%s_%d\"\n", ev->GetString( 1 ), index + 1 );
|
||||
buf += str( tempbuf );
|
||||
}
|
||||
if ( !index )
|
||||
{
|
||||
sprintf( tempbuf, "\"targetname\" \"%s\"\n", ev->GetString( 1 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( tempbuf, "\"targetname\" \"camnode_%s_%d\"\n", ev->GetString( 1 ), index );
|
||||
}
|
||||
buf += str( tempbuf );
|
||||
sprintf( tempbuf, "\"origin\" \"%d %d %d\"\n", ( int )node->origin.x, ( int )node->origin.y, ( int )node->origin.z );
|
||||
buf += str( tempbuf );
|
||||
sprintf( tempbuf, "\"angles\" \"%d %d %d\"\n", ( int )anglemod( node->angles.x ), ( int )anglemod( node->angles.y ), ( int )anglemod( node->angles.z ) );
|
||||
buf += str( tempbuf );
|
||||
sprintf( tempbuf, "\"speed\" \"%.3f\"\n", node->speed );
|
||||
buf += str( tempbuf );
|
||||
buf += "}\n";
|
||||
index++;
|
||||
}
|
||||
|
||||
gi.CreatePath( filename.c_str() );
|
||||
file = fopen( filename.c_str(), "wt" );
|
||||
fwrite( buf.c_str(), 1, buf.length() + 1, file );
|
||||
fclose( file );
|
||||
|
||||
gi.printf( "done.\n" );
|
||||
}
|
||||
|
||||
|
|
88
camera.h
88
camera.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/camera.h $
|
||||
// $Revision:: 27 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 5/19/99 11:30a $
|
||||
// $Revision:: 25 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 10/25/98 11:53p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,12 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/camera.h $
|
||||
//
|
||||
// 27 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 26 3/19/99 8:59p Aldie
|
||||
// Added SetCurrentDistance
|
||||
//
|
||||
// 25 10/25/98 11:53p Jimdose
|
||||
// added EXPORT_TEMPLATE
|
||||
//
|
||||
|
@ -422,9 +416,6 @@ class EXPORT_FROM_DLL Camera : public Entity
|
|||
str &NextCamera( void );
|
||||
str &Thread( void );
|
||||
str &Overlay( void );
|
||||
void SetCurrentDistance( float dist );
|
||||
|
||||
void Reset( Vector org, Vector ang );
|
||||
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
|
@ -519,77 +510,4 @@ class EXPORT_FROM_DLL SecurityCamera : public Camera
|
|||
SecurityCamera();
|
||||
};
|
||||
|
||||
|
||||
class CameraManager : public Listener
|
||||
{
|
||||
protected:
|
||||
SplinePathPtr path;
|
||||
SplinePathPtr current;
|
||||
float speed;
|
||||
int watch;
|
||||
CameraPtr cam;
|
||||
|
||||
void NewPath( Event *ev );
|
||||
void SetPath( Event *ev );
|
||||
void SetTargetName( Event *ev );
|
||||
void SetTarget( Event *ev );
|
||||
void AddPoint( Event *ev );
|
||||
void ReplacePoint( Event *ev );
|
||||
void DeletePoint( Event *ev );
|
||||
void MovePlayer( Event *ev );
|
||||
void NextPoint( Event *ev );
|
||||
void PreviousPoint( Event *ev );
|
||||
void ShowPath( Event *ev );
|
||||
void HidePath( Event *ev );
|
||||
void StopPlayback( Event *ev );
|
||||
void PlayPath( Event *ev );
|
||||
void LoopPath( Event *ev );
|
||||
void Watch( Event *ev );
|
||||
void NoWatch( Event *ev );
|
||||
void Speed( Event *ev );
|
||||
void Save( Event *ev );
|
||||
void Load( Event *ev );
|
||||
void SaveMap( Event *ev );
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( CameraManager );
|
||||
|
||||
CameraManager();
|
||||
void SetPath( SplinePath *node );
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
};
|
||||
|
||||
inline void CameraManager::Archive
|
||||
(
|
||||
Archiver &arc
|
||||
)
|
||||
|
||||
{
|
||||
Listener::Archive( arc );
|
||||
|
||||
arc.WriteSafePointer( path );
|
||||
arc.WriteSafePointer( current );
|
||||
arc.WriteFloat( speed );
|
||||
arc.WriteInteger( watch );
|
||||
arc.WriteSafePointer( cam );
|
||||
}
|
||||
|
||||
inline void CameraManager::Unarchive
|
||||
(
|
||||
Archiver &arc
|
||||
)
|
||||
|
||||
{
|
||||
Listener::Unarchive( arc );
|
||||
|
||||
arc.ReadSafePointer( &path );
|
||||
arc.ReadSafePointer( ¤t );
|
||||
arc.ReadFloat( &speed );
|
||||
arc.ReadInteger( &watch );
|
||||
arc.ReadSafePointer( &cam );
|
||||
}
|
||||
|
||||
extern CameraManager CameraMan;
|
||||
|
||||
#endif /* camera.h */
|
||||
|
|
54
chaingun.cpp
54
chaingun.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/chaingun.cpp $
|
||||
// $Revision:: 45 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/19/99 3:43p $
|
||||
// $Revision:: 43 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/18/98 6:11p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,16 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/chaingun.cpp $
|
||||
//
|
||||
// 45 3/19/99 3:43p Aldie
|
||||
// Changed check for ammo in chaingun
|
||||
//
|
||||
// 44 3/02/99 9:06p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:38p Aldie
|
||||
//
|
||||
// 43 11/18/98 6:11p Jimdose
|
||||
// fix problems with gravaxis
|
||||
//
|
||||
|
@ -299,10 +289,6 @@ EXPORT_FROM_DLL void Grenade::Setup
|
|||
|
||||
ev = new Event( EV_Grenade_Explode );
|
||||
ev->AddEntity( world );
|
||||
|
||||
if ( ctf->value )
|
||||
PostEvent( ev, 0.9 );
|
||||
else
|
||||
PostEvent( ev, 2.5 + G_Random(1.0) );
|
||||
|
||||
edict->s.effects |= EF_ROCKET;
|
||||
|
@ -345,11 +331,9 @@ ChainGun::ChainGun
|
|||
modelIndex( "sprites/hvblast.spr" );
|
||||
modelIndex( "sprites/tracer.spr" );
|
||||
modelIndex( "hvshell.def" );
|
||||
|
||||
if ( ctf->value )
|
||||
alternate_fire = true;
|
||||
}
|
||||
|
||||
|
||||
void ChainGun::Shoot
|
||||
(
|
||||
Event *ev
|
||||
|
@ -376,36 +360,6 @@ void ChainGun::Shoot
|
|||
grenade = new Grenade;
|
||||
grenade->Setup( owner, pos, forward, up, right );
|
||||
NextAttack( 0.8 );
|
||||
|
||||
if ( ctf->value )
|
||||
SetPrimaryMode();
|
||||
}
|
||||
}
|
||||
|
||||
qboolean ChainGun::HasAmmo
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
if ( !owner )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( UnlimitedAmmo() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( ( ammo_clip_size && ammo_in_clip >= ammorequired ) || AmmoAvailable() >= ammorequired )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if ( ( ammo_clip_size && ammo_in_clip >= secondary_ammorequired ) || AmmoAvailable() >= secondary_ammorequired )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
10
chaingun.h
10
chaingun.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/chaingun.h $
|
||||
// $Revision:: 10 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/19/99 3:43p $
|
||||
// $Revision:: 9 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/18/98 6:12p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/chaingun.h $
|
||||
//
|
||||
// 10 3/19/99 3:43p Aldie
|
||||
// Changed ammo check for chaingun
|
||||
//
|
||||
// 9 11/18/98 6:12p Jimdose
|
||||
// fix problems with gravaxis
|
||||
//
|
||||
|
@ -76,7 +73,6 @@ class EXPORT_FROM_DLL ChainGun : public BulletWeapon
|
|||
|
||||
ChainGun::ChainGun();
|
||||
virtual void Shoot( Event *ev );
|
||||
virtual qboolean HasAmmo( Event *ev );
|
||||
};
|
||||
|
||||
#endif /* ChainGun.h */
|
||||
|
|
263
ctf.h
263
ctf.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/ctf.h $
|
||||
// $Revision:: 11 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 5/18/99 7:07p $
|
||||
// $Revision:: 2 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 10/10/98 3:03a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,37 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/ctf.h $
|
||||
//
|
||||
// 11 5/18/99 7:07p Aldie
|
||||
// Fix for forcejoin
|
||||
//
|
||||
// 10 3/19/99 9:41p Aldie
|
||||
// Changed max_regen_health to 300 instead of 400
|
||||
//
|
||||
// 9 3/19/99 7:35p Aldie
|
||||
// Added CTF_DROPPED_FLAG_TIMEOUT
|
||||
//
|
||||
// 8 3/19/99 4:28p Aldie
|
||||
// externed ctfgame
|
||||
//
|
||||
// 7 3/19/99 4:19p Aldie
|
||||
// Added tech regen time, changed grapple speed and max health
|
||||
//
|
||||
// 6 3/12/99 10:19p Aldie
|
||||
// Change HALF to Shield
|
||||
//
|
||||
// 5 3/12/99 8:12p Aldie
|
||||
// Added deathquad
|
||||
//
|
||||
// 4 3/12/99 4:55p Aldie
|
||||
// Added CTF_CalcScores
|
||||
//
|
||||
// 3 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:38p Aldie
|
||||
//
|
||||
// 2 10/10/98 3:03a Jimdose
|
||||
// Created file
|
||||
//
|
||||
|
@ -65,32 +34,29 @@
|
|||
#define __CTF_H__
|
||||
|
||||
#include "g_local.h"
|
||||
#include "inventoryitem.h"
|
||||
#include "specialfx.h"
|
||||
#include "player.h"
|
||||
|
||||
#define CTF_VERSION 1.00
|
||||
#define CTF_VERSION 1.02
|
||||
#define CTF_VSTRING2(x) #x
|
||||
#define CTF_VSTRING(x) CTF_VSTRING2(x)
|
||||
#define CTF_STRING_VERSION CTF_VSTRING(CTF_VERSION)
|
||||
|
||||
#define STAT_CTF_TECH 7
|
||||
#define STAT_CTF_ID_VIEW 8
|
||||
#define STAT_CTF_TEAM1_PIC 11
|
||||
#define STAT_CTF_TEAM1_CAPS 12
|
||||
#define STAT_CTF_TEAM2_PIC 13
|
||||
#define STAT_CTF_TEAM2_CAPS 14
|
||||
#define STAT_CTF_FLAG_PIC 15
|
||||
#define STAT_CTF_JOINED_TEAM1_PIC 16
|
||||
#define STAT_CTF_JOINED_TEAM2_PIC 17
|
||||
#define STAT_CTF_TEAM1_HEADER 18
|
||||
#define STAT_CTF_TEAM2_HEADER 19
|
||||
#define STAT_CTF_TEAM1_PIC 17
|
||||
#define STAT_CTF_TEAM1_CAPS 18
|
||||
#define STAT_CTF_TEAM2_PIC 19
|
||||
#define STAT_CTF_TEAM2_CAPS 20
|
||||
#define STAT_CTF_FLAG_PIC 21
|
||||
#define STAT_CTF_JOINED_TEAM1_PIC 22
|
||||
#define STAT_CTF_JOINED_TEAM2_PIC 23
|
||||
#define STAT_CTF_TEAM1_HEADER 24
|
||||
#define STAT_CTF_TEAM2_HEADER 25
|
||||
#define STAT_CTF_TECH 26
|
||||
#define STAT_CTF_ID_VIEW 27
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CTF_NOTEAM,
|
||||
CTF_TEAM_HARDCORPS,
|
||||
CTF_TEAM_SINTEK
|
||||
CTF_TEAM1,
|
||||
CTF_TEAM2
|
||||
} ctfteam_t;
|
||||
|
||||
typedef enum
|
||||
|
@ -106,27 +72,14 @@ typedef enum
|
|||
CTF_GRAPPLE_STATE_HANG
|
||||
} ctfgrapplestate_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FIRE,
|
||||
DAMAGE
|
||||
} ctfsoundevent_t;
|
||||
|
||||
typedef struct ctfgame_s
|
||||
{
|
||||
int team_hardcorps;
|
||||
int team_sintek;
|
||||
int total_hardcorps, total_sintek; // these are only set when going into intermission!
|
||||
float last_flag_capture;
|
||||
int last_capture_team;
|
||||
} ctfgame_t;
|
||||
|
||||
extern ctfgame_t ctfgame;
|
||||
|
||||
extern cvar_t *ctf;
|
||||
extern cvar_t *ctf_hardcorps_skin;
|
||||
extern cvar_t *ctf_sintek_skin;
|
||||
extern cvar_t *ctf_forcejoin;
|
||||
|
||||
#define CTF_TEAM1_SKIN "ctf_r"
|
||||
#define CTF_TEAM2_SKIN "ctf_b"
|
||||
|
||||
#define DF_CTF_FORCEJOIN 131072
|
||||
#define DF_ARMOR_PROTECT 262144
|
||||
#define DF_CTF_NO_TECH 524288
|
||||
|
||||
#define CTF_CAPTURE_BONUS 15 // what you get for capture
|
||||
#define CTF_TEAM_BONUS 10 // what your team gets for capture
|
||||
|
@ -147,132 +100,68 @@ extern cvar_t *ctf_forcejoin;
|
|||
#define CTF_CARRIER_DANGER_PROTECT_TIMEOUT 8
|
||||
#define CTF_FRAG_CARRIER_ASSIST_TIMEOUT 10
|
||||
#define CTF_RETURN_FLAG_ASSIST_TIMEOUT 10
|
||||
|
||||
#define CTF_AUTO_FLAG_RETURN_TIMEOUT 30 // number of seconds before dropped flag auto-returns
|
||||
#define CTF_DROPPED_FLAG_RETURN_TIMEOUT 10 // number of seconds before dropped flag returns
|
||||
|
||||
#define CTF_TECH_TIMEOUT 60 // seconds before techs spawn again
|
||||
#define CTF_GRAPPLE_SPEED 1000 // speed of grapple in flight
|
||||
#define CTF_GRAPPLE_PULL_SPEED 700 // speed player is pulled at
|
||||
#define CTF_TECH_REGENERATION_HEALTH 300 // max health with regeneration
|
||||
#define CTF_TECH_REGENERATION_TIME 0.7 // time between regenerations
|
||||
|
||||
// FLAGS
|
||||
#define CTF_GRAPPLE_SPEED 650 // speed of grapple in flight
|
||||
#define CTF_GRAPPLE_PULL_SPEED 650 // speed player is pulled at
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Flag : public InventoryItem
|
||||
{
|
||||
protected:
|
||||
ctfteam_t ctf_team;
|
||||
#if 0
|
||||
void CTFInit(void);
|
||||
|
||||
virtual void PickupFlag( Event *ev );
|
||||
virtual void ResetFlag( Event *ev );
|
||||
void SP_info_player_team1(edict_t *self);
|
||||
void SP_info_player_team2(edict_t *self);
|
||||
|
||||
public:
|
||||
qboolean limp;
|
||||
char *CTFTeamName(int team);
|
||||
char *CTFOtherTeamName(int team);
|
||||
void CTFAssignSkin(edict_t *ent, char *s);
|
||||
void CTFAssignTeam(gclient_t *who);
|
||||
edict_t *SelectCTFSpawnPoint (edict_t *ent);
|
||||
qboolean CTFPickup_Flag(edict_t *ent, edict_t *other);
|
||||
qboolean CTFDrop_Flag(edict_t *ent, gitem_t *item);
|
||||
void CTFEffects(edict_t *player);
|
||||
void CTFCalcScores(void);
|
||||
void SetCTFStats(edict_t *ent);
|
||||
void CTFDeadDropFlag(edict_t *self);
|
||||
void CTFScoreboardMessage (edict_t *ent, edict_t *killer);
|
||||
void CTFTeam_f (edict_t *ent);
|
||||
void CTFID_f (edict_t *ent);
|
||||
void CTFSay_Team(edict_t *who, char *msg);
|
||||
void CTFFlagSetup (edict_t *ent);
|
||||
void CTFResetFlag(int ctf_team);
|
||||
void CTFFragBonuses(edict_t *targ, edict_t *inflictor, edict_t *attacker);
|
||||
void CTFCheckHurtCarrier(edict_t *targ, edict_t *attacker);
|
||||
|
||||
CLASS_PROTOTYPE( CTF_Flag );
|
||||
CTF_Flag();
|
||||
};
|
||||
// GRAPPLE
|
||||
void CTFWeapon_Grapple (edict_t *ent);
|
||||
void CTFPlayerResetGrapple(edict_t *ent);
|
||||
void CTFGrapplePull(edict_t *self);
|
||||
void CTFResetGrapple(edict_t *self);
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Flag_Hardcorps : public CTF_Flag
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Flag_Hardcorps );
|
||||
CTF_Flag_Hardcorps();
|
||||
};
|
||||
//TECH
|
||||
gitem_t *CTFWhat_Tech(edict_t *ent);
|
||||
qboolean CTFPickup_Tech (edict_t *ent, edict_t *other);
|
||||
void CTFDrop_Tech(edict_t *ent, gitem_t *item);
|
||||
void CTFDeadDropTech(edict_t *ent);
|
||||
void CTFSetupTechSpawn(void);
|
||||
int CTFApplyResistance(edict_t *ent, int dmg);
|
||||
int CTFApplyStrength(edict_t *ent, int dmg);
|
||||
qboolean CTFApplyStrengthSound(edict_t *ent);
|
||||
qboolean CTFApplyHaste(edict_t *ent);
|
||||
void CTFApplyHasteSound(edict_t *ent);
|
||||
void CTFApplyRegeneration(edict_t *ent);
|
||||
qboolean CTFHasRegeneration(edict_t *ent);
|
||||
void CTFRespawnTech(edict_t *ent);
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Flag_Sintek : public CTF_Flag
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Flag_Sintek );
|
||||
CTF_Flag_Sintek();
|
||||
};
|
||||
void CTFOpenJoinMenu(edict_t *ent);
|
||||
qboolean CTFStartClient(edict_t *ent);
|
||||
|
||||
// TECH
|
||||
qboolean CTFCheckRules(void);
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech : public InventoryItem
|
||||
{
|
||||
protected:
|
||||
Vector FindSpawnLocation( void );
|
||||
void Timeout( Event *ev );
|
||||
virtual void Pickup( Event *ev );
|
||||
virtual qboolean Pickupable( Entity *other );
|
||||
void HasTechMsg( edict_t *who );
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech );
|
||||
CTF_Tech();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_Regeneration : public CTF_Tech
|
||||
{
|
||||
protected:
|
||||
void Regenerate( Event *ev );
|
||||
float last_sound_event;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_Regeneration );
|
||||
CTF_Tech_Regeneration();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_Double : public CTF_Tech
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_Double );
|
||||
CTF_Tech_Double();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_Shield : public CTF_Tech
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_Shield );
|
||||
CTF_Tech_Shield();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_Aqua : public CTF_Tech
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_Aqua );
|
||||
CTF_Tech_Aqua();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_Jump : public CTF_Tech
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_Jump );
|
||||
CTF_Tech_Jump();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_Empathy : public CTF_Tech
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_Empathy );
|
||||
CTF_Tech_Empathy();
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Tech_DeathQuad : public CTF_Tech
|
||||
{
|
||||
private:
|
||||
float last_sound_event;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTF_Tech_DeathQuad );
|
||||
CTF_Tech_DeathQuad();
|
||||
void Damage( Event *ev );
|
||||
};
|
||||
|
||||
void CTF_Init(void);
|
||||
char *CTF_TeamName(int team);
|
||||
char *CTF_OtherTeamName(int team);
|
||||
int CTF_OtherTeam( int team );
|
||||
void CTF_UpdateStats( Player *player );
|
||||
void CTF_ScoreboardMessage( Entity *ent, Entity *killer );
|
||||
qboolean CTF_CheckRules( void );
|
||||
Entity *SelectCTFSpawnPoint (edict_t *ent);
|
||||
void CTF_InitFlags( void );
|
||||
void CTF_FragBonuses( Sentient *targ, Sentient *attacker );
|
||||
void CTF_CheckHurtCarrier( Entity *targ, Entity *attacker );
|
||||
void CTF_CalcScores( void );
|
||||
|
||||
extern Event EV_Flag_Reset;
|
||||
extern Event EV_Tech_Timeout;
|
||||
void SP_misc_ctf_banner (edict_t *ent);
|
||||
void SP_misc_ctf_small_banner (edict_t *ent);
|
||||
#endif
|
||||
|
||||
#endif /* ctf.h */
|
||||
|
|
93
ctf_player.h
Normal file
93
ctf_player.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/ctf_player.h $
|
||||
// $Revision:: 3 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 10/10/98 3:37a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source may not be distributed and/or modified without
|
||||
// expressly written permission by Ritual Entertainment, Inc.
|
||||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/ctf_player.h $
|
||||
//
|
||||
// 3 10/10/98 3:37a Jimdose
|
||||
// Began converting to Sin
|
||||
//
|
||||
// 2 10/10/98 3:03a Jimdose
|
||||
// Created file
|
||||
//
|
||||
// 1 10/10/98 3:02a Jimdose
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Player code for Threewave Capture the Flag.
|
||||
//
|
||||
// The original source for this code was graciously provided by Zoid and
|
||||
// Id Software. Many thanks!
|
||||
//
|
||||
// Original credits:
|
||||
//
|
||||
// Programming - Dave 'Zoid' Kirsch
|
||||
// Original CTF Art Design - Brian 'Whaleboy' Cozzens
|
||||
//
|
||||
|
||||
#ifndef __CTF_PLAYER_H__
|
||||
#define __CTF_PLAYER_H__
|
||||
|
||||
#include "player.h"
|
||||
#include "ctf.h"
|
||||
|
||||
class EXPORT_FROM_DLL CTF_Player : public Player
|
||||
{
|
||||
private:
|
||||
int team;
|
||||
|
||||
public:
|
||||
|
||||
CLASS_PROTOTYPE( CTF_Player );
|
||||
|
||||
CTF_Player();
|
||||
virtual ~CTF_Player();
|
||||
virtual void Init( void );
|
||||
|
||||
const char *TeamName( void );
|
||||
const char *OtherTeamName( void );
|
||||
int Team( void );
|
||||
int OtherTeam( void );
|
||||
|
||||
virtual void Respawn( Event *ev );
|
||||
virtual void Killed( Event *ev );
|
||||
virtual void GotKill( Event *ev );
|
||||
void ClientThink( Event *ev );
|
||||
virtual void EndFrame( Event *ev );
|
||||
|
||||
virtual void UpdateStats( void );
|
||||
|
||||
virtual void Prethink( void );
|
||||
virtual void Postthink( void );
|
||||
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
};
|
||||
|
||||
inline EXPORT_FROM_DLL void CTF_Player::Archive
|
||||
(
|
||||
Archiver &arc
|
||||
)
|
||||
|
||||
{
|
||||
Player::Archive( arc );
|
||||
}
|
||||
|
||||
inline EXPORT_FROM_DLL void CTF_Player::Unarchive
|
||||
(
|
||||
Archiver &arc
|
||||
)
|
||||
|
||||
{
|
||||
Player::Unarchive( arc );
|
||||
}
|
||||
|
||||
#endif /* ctf_player.h */
|
317
ctf_turret.cpp
317
ctf_turret.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/ctf_turret.cpp $
|
||||
// $Revision:: 14 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/19/99 5:50p $
|
||||
// $Revision:: 2 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 2/19/99 7:49p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,41 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/ctf_turret.cpp $
|
||||
//
|
||||
// 14 3/19/99 5:50p Aldie
|
||||
// Added MINLIGHT
|
||||
//
|
||||
// 13 3/19/99 5:49p Aldie
|
||||
// Added minlight
|
||||
//
|
||||
// 12 3/19/99 5:13p Aldie
|
||||
// Made turret non-droppable
|
||||
//
|
||||
// 11 3/17/99 3:55p Aldie
|
||||
// Incremental CTF update
|
||||
//
|
||||
// 10 3/12/99 6:14p Markd
|
||||
// added precaching and increased damages on heligun
|
||||
//
|
||||
// 9 3/11/99 1:46p Aldie
|
||||
// Fix movement of turrets
|
||||
//
|
||||
// 8 3/05/99 5:51p Markd
|
||||
// made vehicles respawn in CTF, fixed up turrets a bit more
|
||||
//
|
||||
// 7 3/05/99 5:10p Markd
|
||||
// Fixed turrets being able to shoot themselves
|
||||
//
|
||||
// 6 2/26/99 7:42p Markd
|
||||
// Fixed turrets some more
|
||||
//
|
||||
// 5 2/26/99 5:53p Markd
|
||||
// Fixed up turrets a lot more
|
||||
//
|
||||
// 4 2/23/99 5:56p Markd
|
||||
//
|
||||
// 3 2/22/99 5:45p Aldie
|
||||
// Removed stray ;
|
||||
//
|
||||
// 2 2/19/99 7:49p Markd
|
||||
// implemented turret for CTF
|
||||
//
|
||||
|
@ -61,10 +26,9 @@
|
|||
#include "vehicle.h"
|
||||
#include "ctf_turret.h"
|
||||
#include "heligun.h"
|
||||
#include "player.h"
|
||||
|
||||
|
||||
CLASS_DECLARATION( DrivableVehicle, CTFTurret, "ctf_turret" );
|
||||
CLASS_DECLARATION( Vehicle, CTFTurret, "ctf_turret" );
|
||||
|
||||
ResponseDef CTFTurret::Responses[] =
|
||||
{
|
||||
|
@ -76,13 +40,7 @@ CTFTurret::CTFTurret()
|
|||
{
|
||||
takedamage = DAMAGE_YES;
|
||||
setModel( "ctf_turret.def" );
|
||||
modelIndex( "ctf_turretgun.def" );
|
||||
modelIndex( "view_ctf_turretgun.def" );
|
||||
setOrigin( origin - Vector( "0 0 30") );
|
||||
drivable = false;
|
||||
setMoveType( MOVETYPE_NONE );
|
||||
setSize( "-24 -24 -64", "24 24 0" );
|
||||
edict->s.renderfx |= RF_MINLIGHT;
|
||||
}
|
||||
|
||||
void CTFTurret::DriverUse
|
||||
|
@ -94,23 +52,18 @@ void CTFTurret::DriverUse
|
|||
Entity * old_driver;
|
||||
|
||||
old_driver = driver;
|
||||
DrivableVehicle::DriverUse( ev );
|
||||
Vehicle::DriverUse( ev );
|
||||
if ( old_driver != driver )
|
||||
{
|
||||
if ( driver )
|
||||
{
|
||||
setSolidType( SOLID_NOT );
|
||||
takedamage = DAMAGE_NO;
|
||||
hideModel();
|
||||
}
|
||||
else
|
||||
{
|
||||
setSolidType( SOLID_BBOX );
|
||||
takedamage = DAMAGE_YES;
|
||||
showModel();
|
||||
}
|
||||
}
|
||||
setMoveType( MOVETYPE_NONE );
|
||||
}
|
||||
|
||||
#define MAX_PITCH 45
|
||||
|
@ -140,6 +93,7 @@ float CTFTurret::SetDriverPitch
|
|||
return pitch;
|
||||
}
|
||||
|
||||
|
||||
CLASS_DECLARATION( HeliGun, CTFTurretGun, "ctf_weapon_turretgun" );
|
||||
|
||||
ResponseDef CTFTurretGun::Responses[] =
|
||||
|
@ -161,264 +115,7 @@ void CTFTurretGun::Shoot
|
|||
)
|
||||
|
||||
{
|
||||
FireBullets( 1, "20 20 20", 48, 64, DAMAGE_BULLET, MOD_CTFTURRET, false );
|
||||
FireBullets( 1, "20 20 20", 16, 28, DAMAGE_BULLET, MOD_HELIGUN, false );
|
||||
NextAttack( 0 );
|
||||
}
|
||||
|
||||
qboolean CTFTurretGun::IsDroppable
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CTF turret which is lagged but has angle limits set on it.
|
||||
//
|
||||
CLASS_DECLARATION( DrivableVehicle, CTFDrivableTurret, "ctf_fixedturret" );
|
||||
|
||||
ResponseDef CTFDrivableTurret::Responses[] =
|
||||
{
|
||||
{ &EV_Use, ( Response )CTFDrivableTurret::DriverUse },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
CTFDrivableTurret::CTFDrivableTurret()
|
||||
{
|
||||
ClassDef *cls;
|
||||
|
||||
takedamage = DAMAGE_YES;
|
||||
setModel( "ctf_fixedturret.def" );
|
||||
setOrigin( origin - Vector( "0 0 30") );
|
||||
baseangles = angles;
|
||||
|
||||
shotdamage = G_GetFloatArg( "shotdamage", 48 );
|
||||
maxpitch = G_GetFloatArg( "maxpitch", 30 );
|
||||
maxyaw = G_GetFloatArg( "maxyaw", 75 );
|
||||
|
||||
cls = getClass( "Sentient" );
|
||||
if ( cls )
|
||||
{
|
||||
gunholder = ( Sentient * )cls->newInstance();
|
||||
gunholder->hideModel();
|
||||
}
|
||||
cls = getClass( "BulletWeapon" );
|
||||
if ( cls )
|
||||
{
|
||||
gun = ( BulletWeapon * )cls->newInstance();
|
||||
gun->SetModels( "ctf_fixedturret.def", "ctf_fixedturret.def" );
|
||||
gun->SetOwner( gunholder );
|
||||
gun->hideModel();
|
||||
}
|
||||
|
||||
setSize( "-24 -24 -64", "24 24 0" );
|
||||
lastbutton = -1;
|
||||
entertime = -1;
|
||||
exittime = -1;
|
||||
setMoveType( MOVETYPE_NONE );
|
||||
edict->s.renderfx |= RF_MINLIGHT;
|
||||
}
|
||||
|
||||
void CTFDrivableTurret::Postthink
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
Vector temp;
|
||||
Vector diff;
|
||||
|
||||
// make sure we don't move
|
||||
velocity = vec_zero;
|
||||
|
||||
if ( cmd_angles[ 0 ] > maxturnrate )
|
||||
{
|
||||
cmd_angles[ 0 ] = maxturnrate;
|
||||
}
|
||||
else if ( cmd_angles[ 0 ] < -maxturnrate )
|
||||
{
|
||||
cmd_angles[ 0 ] = -maxturnrate;
|
||||
}
|
||||
if ( cmd_angles[ 1 ] > maxturnrate )
|
||||
{
|
||||
cmd_angles[ 1 ] = maxturnrate;
|
||||
}
|
||||
else if ( cmd_angles[ 1 ] < -maxturnrate )
|
||||
{
|
||||
cmd_angles[ 1 ] = -maxturnrate;
|
||||
}
|
||||
|
||||
temp = angles + cmd_angles;
|
||||
|
||||
diff = temp - baseangles;
|
||||
diff.x = angledist( diff.x );
|
||||
diff.y = angledist( diff.y );
|
||||
gi.dprintf( "diff x%5.2f y%5.2f\n", diff.x, diff.y );
|
||||
|
||||
if ( diff.x > maxpitch )
|
||||
{
|
||||
temp.x = baseangles.x + maxpitch;
|
||||
}
|
||||
else if ( diff.x < -maxpitch )
|
||||
{
|
||||
temp.x = baseangles.x - maxpitch;
|
||||
}
|
||||
|
||||
if ( maxyaw < 180 )
|
||||
{
|
||||
if ( diff.y > maxyaw )
|
||||
{
|
||||
temp.y = baseangles.y + maxyaw;
|
||||
}
|
||||
else if ( diff.y < -maxyaw )
|
||||
{
|
||||
temp.y = baseangles.y - maxyaw;
|
||||
}
|
||||
}
|
||||
|
||||
setAngles( temp );
|
||||
|
||||
|
||||
if ( driver )
|
||||
{
|
||||
Vector i,j,k;
|
||||
Player * player;
|
||||
|
||||
i = Vector( orientation[ 0 ] );
|
||||
j = Vector( orientation[ 1 ] );
|
||||
k = Vector( orientation[ 2 ] );
|
||||
|
||||
player = ( Player * )( Sentient * )driver;
|
||||
player->setOrigin( worldorigin + i * driveroffset[0] + j * driveroffset[1] + k * driveroffset[2] );
|
||||
if ( drivable )
|
||||
{
|
||||
player->velocity = vec_zero;
|
||||
player->setAngles( angles );
|
||||
player->SetViewAngles( angles );
|
||||
player->SetDeltaAngles();
|
||||
}
|
||||
}
|
||||
|
||||
CheckWater();
|
||||
WorldEffects();
|
||||
|
||||
// save off last origin
|
||||
last_origin = worldorigin;
|
||||
|
||||
if ( !driver && !velocity.length() && groundentity && !( watertype & CONTENTS_LAVA ) )
|
||||
{
|
||||
flags &= ~FL_POSTTHINK;
|
||||
if ( drivable )
|
||||
setMoveType( MOVETYPE_NONE );
|
||||
}
|
||||
if ( driver )
|
||||
{
|
||||
if ( buttons & BUTTON_ATTACK )
|
||||
{
|
||||
if ( !lastbutton )
|
||||
{
|
||||
lastbutton = 1;
|
||||
RandomAnimate( "fire", NULL );
|
||||
}
|
||||
Fire();
|
||||
}
|
||||
else if ( buttons & BUTTON_USE )
|
||||
{
|
||||
Event * event;
|
||||
|
||||
if ( level.time > ( entertime + 0.5f ) )
|
||||
{
|
||||
event = new Event( EV_Use );
|
||||
event->AddEntity( driver );
|
||||
ProcessEvent( event );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( lastbutton )
|
||||
{
|
||||
lastbutton = 0;
|
||||
RandomAnimate( "idle", NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CTFDrivableTurret::Fire
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
setSolidType( SOLID_NOT );
|
||||
gunholder->setOrigin( origin );
|
||||
gunholder->setAngles( angles );
|
||||
gun->FireBullets( 1, "20 20 20", shotdamage, shotdamage * 1.5f, DAMAGE_BULLET, MOD_CTFTURRET, true );
|
||||
setSolidType( SOLID_BBOX );
|
||||
}
|
||||
|
||||
float CTFDrivableTurret::SetDriverPitch
|
||||
(
|
||||
float pitch
|
||||
)
|
||||
{
|
||||
return pitch;
|
||||
}
|
||||
|
||||
qboolean CTFDrivableTurret::Drive
|
||||
(
|
||||
usercmd_t *ucmd
|
||||
)
|
||||
|
||||
{
|
||||
if ( !driver || !driver->isClient() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
DrivableVehicle::Drive( ucmd );
|
||||
ucmd->buttons &= ~BUTTON_ATTACK;
|
||||
ucmd->buttons &= ~BUTTON_USE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void CTFDrivableTurret::DriverUse
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Entity * old_driver;
|
||||
|
||||
if ( !driver && ( level.time < ( exittime + 0.5f ) ) )
|
||||
return;
|
||||
|
||||
cmd_angles[ 0 ] = 0;
|
||||
cmd_angles[ 1 ] = 0;
|
||||
cmd_angles[ 2 ] = 0;
|
||||
buttons = 0;
|
||||
lastbutton = -1;
|
||||
setMoveType( MOVETYPE_NONE );
|
||||
RandomAnimate( "idle", NULL );
|
||||
|
||||
old_driver = driver;
|
||||
|
||||
DrivableVehicle::DriverUse( ev );
|
||||
|
||||
if ( old_driver != driver )
|
||||
{
|
||||
if ( driver )
|
||||
{
|
||||
entertime = level.time;
|
||||
}
|
||||
else
|
||||
{
|
||||
exittime = level.time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
49
ctf_turret.h
49
ctf_turret.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/ctf_turret.h $
|
||||
// $Revision:: 6 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/19/99 5:13p $
|
||||
// $Revision:: 2 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 2/19/99 7:49p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,18 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/ctf_turret.h $
|
||||
//
|
||||
// 6 3/19/99 5:13p Aldie
|
||||
// Made turret non-droppable
|
||||
//
|
||||
// 5 3/05/99 5:51p Markd
|
||||
// made vehicles respawn in CTF, fixed up turrets a bit more
|
||||
//
|
||||
// 4 2/26/99 7:42p Markd
|
||||
// Fixed turrets some more
|
||||
//
|
||||
// 3 2/26/99 5:53p Markd
|
||||
// Fixed up turrets a lot more
|
||||
//
|
||||
// 2 2/19/99 7:49p Markd
|
||||
// implemented turret for CTF
|
||||
//
|
||||
|
@ -52,11 +40,9 @@
|
|||
#include "g_local.h"
|
||||
#include "vehicle.h"
|
||||
#include "heligun.h"
|
||||
#include "bullet.h"
|
||||
#include "sentient.h"
|
||||
|
||||
|
||||
class EXPORT_FROM_DLL CTFTurret : public DrivableVehicle
|
||||
class EXPORT_FROM_DLL CTFTurret : public Vehicle
|
||||
{
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTFTurret );
|
||||
|
@ -74,32 +60,5 @@ class EXPORT_FROM_DLL CTFTurretGun : public HeliGun
|
|||
|
||||
CTFTurretGun();
|
||||
virtual void Shoot( Event *ev );
|
||||
qboolean IsDroppable( void );
|
||||
|
||||
};
|
||||
|
||||
class EXPORT_FROM_DLL CTFDrivableTurret : public DrivableVehicle
|
||||
{
|
||||
private:
|
||||
Vector baseangles;
|
||||
float maxpitch;
|
||||
float maxyaw;
|
||||
float entertime;
|
||||
float exittime;
|
||||
int lastbutton;
|
||||
float shotdamage;
|
||||
Sentient *gunholder;
|
||||
BulletWeapon *gun;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( CTFDrivableTurret );
|
||||
|
||||
CTFDrivableTurret ();
|
||||
virtual qboolean Drive( usercmd_t *ucmd );
|
||||
virtual void Postthink( void );
|
||||
virtual void Fire( void );
|
||||
virtual float SetDriverPitch( float pitch );
|
||||
virtual void DriverUse( Event *ev );
|
||||
};
|
||||
|
||||
#endif /* ctfturret.h */
|
||||
|
|
11
entity.cpp
11
entity.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/entity.cpp $
|
||||
// $Revision:: 297 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/18/99 6:44p $
|
||||
// $Revision:: 296 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/18/98 5:22a $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/entity.cpp $
|
||||
//
|
||||
// 297 3/18/99 6:44p Aldie
|
||||
// CancelPendingEvents when removiiung
|
||||
//
|
||||
// 296 11/18/98 5:22a Jimdose
|
||||
// CheckGround properly checks normal an alternate grav axis
|
||||
//
|
||||
|
@ -1471,8 +1468,6 @@ Entity::~Entity()
|
|||
{
|
||||
world->RemoveTargetEntity( targetname, this );
|
||||
}
|
||||
|
||||
this->CancelPendingEvents();
|
||||
G_FreeEdict( edict );
|
||||
}
|
||||
|
||||
|
|
68
entity.h
68
entity.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/entity.h $
|
||||
// $Revision:: 163 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/19/99 4:12p $
|
||||
// $Revision:: 157 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 11/15/98 11:33p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,24 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/entity.h $
|
||||
//
|
||||
// 163 3/19/99 4:12p Aldie
|
||||
// Moved MOD to client
|
||||
//
|
||||
// 162 3/17/99 3:55p Aldie
|
||||
// Incremental CTF update
|
||||
//
|
||||
// 161 3/12/99 8:12p Aldie
|
||||
// Added deathquad
|
||||
//
|
||||
// 160 3/11/99 3:48p Aldie
|
||||
// Add more meansofdeath
|
||||
//
|
||||
// 159 3/05/99 5:47p Aldie
|
||||
// Added mod_thrallball
|
||||
//
|
||||
// 158 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 157 11/15/98 11:33p Markd
|
||||
// added fat projectile flag
|
||||
//
|
||||
|
@ -607,6 +589,50 @@ typedef enum
|
|||
#define DAMAGE_NO_PROTECTION 0x00000020 // armor, shields, invulnerability, and godmode have no effect
|
||||
#define DAMAGE_NO_SKILL 0x00000040 // damage is not affected by skill level
|
||||
|
||||
// means of death flags
|
||||
|
||||
typedef enum {
|
||||
MOD_FISTS,
|
||||
MOD_MAGNUM,
|
||||
MOD_SHOTGUN,
|
||||
MOD_ASSRIFLE,
|
||||
MOD_CHAINGUN,
|
||||
MOD_GRENADE,
|
||||
MOD_ROCKET,
|
||||
MOD_ROCKETSPLASH,
|
||||
MOD_PULSE,
|
||||
MOD_PULSELASER,
|
||||
MOD_SPEARGUN,
|
||||
MOD_SNIPER,
|
||||
MOD_VEHICLE,
|
||||
MOD_CRUSH,
|
||||
MOD_SHOTROCKET,
|
||||
MOD_FALLING,
|
||||
MOD_DROWN,
|
||||
MOD_SUICIDE,
|
||||
MOD_EXPLODEWALL,
|
||||
MOD_ELECTRIC,
|
||||
MOD_TELEFRAG,
|
||||
MOD_GENBULLET,
|
||||
MOD_LASER,
|
||||
MOD_BETTYSPIKE,
|
||||
MOD_HELIGUN,
|
||||
MOD_DEBRIS,
|
||||
MOD_THROWNOBJECT,
|
||||
MOD_LAVA,
|
||||
MOD_SLIME,
|
||||
MOD_ADRENALINE,
|
||||
MOD_ION,
|
||||
MOD_ION_DESTRUCT,
|
||||
MOD_QUANTUM,
|
||||
MOD_BEAM,
|
||||
MOD_IMPACT,
|
||||
MOD_FRIENDLY_FIRE,
|
||||
MOD_SPIDERSPLASH,
|
||||
MOD_MUTANTHANDS,
|
||||
MOD_MUTANT_DRAIN
|
||||
} mod_type_t;
|
||||
|
||||
//
|
||||
// Sound travel distances
|
||||
//
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/explosion.cpp $
|
||||
// $Revision:: 51 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/30/99 4:51p $
|
||||
// $Revision:: 48 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 10/24/98 12:42a $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,14 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/explosion.cpp $
|
||||
//
|
||||
// 51 3/30/99 4:51p Aldie
|
||||
//
|
||||
// 50 3/11/99 3:45p Aldie
|
||||
// Added meansofdeath to explosion
|
||||
//
|
||||
// 49 3/11/99 2:03p Aldie
|
||||
// Added mod to explosion damage
|
||||
//
|
||||
// 48 10/24/98 12:42a Markd
|
||||
// changed origins to worldorigins where appropriate
|
||||
//
|
||||
|
@ -297,7 +289,6 @@ void CreateExplosion
|
|||
Entity *inflictor,
|
||||
Entity *attacker,
|
||||
Entity *ignore,
|
||||
int meansofdeath,
|
||||
float volume,
|
||||
float attenuation,
|
||||
float r,
|
||||
|
@ -333,8 +324,7 @@ void CreateExplosion
|
|||
inflictor->RandomPositionedSound( pos, "impact_bigexplosion", volume, CHAN_AUTO, attenuation );
|
||||
}
|
||||
|
||||
RadiusDamage( inflictor, attacker, damage, ignore, meansofdeath );
|
||||
if ( inflictor )
|
||||
RadiusDamage( inflictor, attacker, damage, ignore, MOD_ROCKETSPLASH );
|
||||
inflictor->ProcessEvent( EV_WeaponSound );
|
||||
|
||||
if ( bigexplosion )
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/explosion.h $
|
||||
// $Revision:: 15 $
|
||||
// $Revision:: 14 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/11/99 3:48p $
|
||||
// $Date:: 10/02/98 7:20p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/explosion.h $
|
||||
//
|
||||
// 15 3/11/99 3:48p Aldie
|
||||
// Added meansofdeath to explosion
|
||||
//
|
||||
// 14 10/02/98 7:20p Aldie
|
||||
// Added flashplayers to do blinding flashes
|
||||
//
|
||||
|
@ -172,7 +169,6 @@ void CreateExplosion
|
|||
Entity *inflictor = NULL,
|
||||
Entity *attacker = NULL,
|
||||
Entity *ignore = NULL,
|
||||
int meansofdeath = MOD_ROCKETSPLASH,
|
||||
float volume = 1.0f,
|
||||
float attenuation = ATTN_NORM,
|
||||
float r = 1.0f,
|
||||
|
|
19
g_local.h
19
g_local.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/g_local.h $
|
||||
// $Revision:: 100 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/12/99 8:12p $
|
||||
// $Revision:: 98 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/10/98 5:51p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,12 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/g_local.h $
|
||||
//
|
||||
// 100 3/12/99 8:12p Aldie
|
||||
// added idtime
|
||||
//
|
||||
// 99 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 98 11/10/98 5:51p Jimdose
|
||||
// disabled exporting symbols from the dll
|
||||
//
|
||||
|
@ -415,13 +409,6 @@ typedef struct
|
|||
int enterframe; // level.framenum the client entered the game
|
||||
int score; // frags, etc
|
||||
vec3_t cmd_angles; // angles sent over in the last command
|
||||
int ctf_team; // CTF team number
|
||||
int ctf_state; // CTF player state
|
||||
float ctf_lasttechmsg; // CTF Last time a tech message was sent
|
||||
float ctf_lastfraggedcarrier; // Last time a carrier was fragged
|
||||
float ctf_lasthurtcarrier; // List time carrier was hurt
|
||||
float ctf_lastreturnedflag; // Last time flag was returned
|
||||
float ctf_idtime; // Last time a player id was made
|
||||
} client_respawn_t;
|
||||
|
||||
// this structure is cleared on each PutClientInServer(),
|
||||
|
|
298
g_main.cpp
298
g_main.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/g_main.cpp $
|
||||
// $Revision:: 178 $
|
||||
// $Revision:: 170 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 8/03/99 7:09p $
|
||||
// $Date:: 2/16/99 8:37p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,33 +13,9 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/g_main.cpp $
|
||||
//
|
||||
// 178 8/03/99 7:09p Jimdose
|
||||
// changes for Sin Arcade
|
||||
//
|
||||
// 177 7/27/99 2:35p Markd
|
||||
// fixed potential text concatenation bug
|
||||
//
|
||||
// 176 7/26/99 7:05p Markd
|
||||
// Fixed the say_talk stuff
|
||||
//
|
||||
// 175 7/24/99 6:47p Markd
|
||||
// Added talk feature and added speech code
|
||||
//
|
||||
// 174 5/19/99 4:57p Markd
|
||||
// fixed some errors
|
||||
//
|
||||
// 173 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 172 3/12/99 4:54p Aldie
|
||||
// Added CTF_CalcScores
|
||||
//
|
||||
// 171 3/02/99 9:08p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:38p Aldie
|
||||
// 170 2/16/99 8:37p Jimdose
|
||||
// moved sin arcade comm stuff to client
|
||||
// made dmflags, timelimit, and fraglimit archived under SIN_ARCADE
|
||||
//
|
||||
// 169 1/22/99 8:00p Jimdose
|
||||
// added "showvar" command for inspecting script variables
|
||||
|
@ -593,7 +569,6 @@
|
|||
#define SAVEGAME_VERSION 13
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "limits.h"
|
||||
#include "g_local.h"
|
||||
#include "g_utils.h"
|
||||
#include "Entity.h"
|
||||
|
@ -606,7 +581,6 @@
|
|||
#include "surface.h"
|
||||
#include "gravpath.h"
|
||||
#include "deadbody.h"
|
||||
#include "ctf.h"
|
||||
|
||||
Vector vec_origin = "0 0 0";
|
||||
Vector vec_zero = "0 0 0";
|
||||
|
@ -714,11 +688,6 @@ void ( *ServerError )( const char *fmt, ... );
|
|||
char G_ErrorMessage[ 1024 ];
|
||||
jmp_buf G_AbortGame;
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
void G_CheckFirstPlace( void );
|
||||
void G_DrawFirstPlace( void );
|
||||
#endif
|
||||
|
||||
/*
|
||||
===============
|
||||
G_Error
|
||||
|
@ -844,8 +813,11 @@ void G_InitGame
|
|||
deathmatch = gi.cvar ("deathmatch", "0", CVAR_SERVERINFO|CVAR_LATCH);
|
||||
coop = gi.cvar ("coop", "0", CVAR_SERVERINFO|CVAR_LATCH);
|
||||
skill = gi.cvar ("skill", "1", CVAR_SERVERINFO|CVAR_LATCH);
|
||||
|
||||
#ifdef SIN
|
||||
maxclients = gi.cvar ("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE );
|
||||
#else
|
||||
maxclients = gi.cvar ("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
|
||||
#endif
|
||||
maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
|
||||
maxconsoles = gi.cvar ("maxconsoles", "32", CVAR_LATCH);
|
||||
maxsurfaces = gi.cvar ("maxsurfaces", "1024", CVAR_LATCH);
|
||||
|
@ -867,8 +839,6 @@ void G_InitGame
|
|||
fraglimit = gi.cvar ("fraglimit", "0", CVAR_SERVERINFO);
|
||||
timelimit = gi.cvar ("timelimit", "0", CVAR_SERVERINFO);
|
||||
#endif
|
||||
// CTF
|
||||
capturelimit = gi.cvar ("capturelimit", "0", CVAR_SERVERINFO);
|
||||
g_select_empty = gi.cvar ("g_select_empty", "0", CVAR_ARCHIVE);
|
||||
g_unlimited_ammo = gi.cvar ("g_unlimited_ammo", "0", CVAR_SERVERINFO);
|
||||
g_showmem = gi.cvar ("g_showmem", "0", 0 );
|
||||
|
@ -920,8 +890,6 @@ void G_InitGame
|
|||
|
||||
parentmode = gi.cvar ("parentmode", "0", CVAR_USERINFO|CVAR_SERVERINFO|CVAR_ARCHIVE);
|
||||
|
||||
CTF_Init();
|
||||
|
||||
G_InitEvents();
|
||||
sv_numtraces = 0;
|
||||
|
||||
|
@ -1539,10 +1507,6 @@ void G_EndDMLevel
|
|||
char *s, *t, *f;
|
||||
static const char *seps = " ,\n\r";
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
G_DrawFirstPlace();
|
||||
#endif
|
||||
|
||||
// stay on same level flag
|
||||
if ( DM_FLAG( DF_SAME_LEVEL ) )
|
||||
{
|
||||
|
@ -1637,17 +1601,6 @@ void G_CheckDMRules
|
|||
}
|
||||
}
|
||||
|
||||
// CTF
|
||||
if ( ctf->value )
|
||||
{
|
||||
if ( CTF_CheckRules() )
|
||||
{
|
||||
gi.bprintf( PRINT_HIGH, "Capturelimit hit.\n" );
|
||||
G_EndDMLevel ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( fraglimit->value )
|
||||
{
|
||||
for( i = 0; i < maxclients->value; i++ )
|
||||
|
@ -1732,9 +1685,6 @@ void G_BeginIntermission
|
|||
// find an intermission spot
|
||||
num = G_FindClass( 0, "info_player_intermission" );
|
||||
|
||||
if ( ctf->value )
|
||||
CTF_CalcScores();
|
||||
|
||||
// Only do the camera stuff if the node exists.
|
||||
if ( num )
|
||||
{
|
||||
|
@ -1798,8 +1748,6 @@ void G_ExitLevel
|
|||
level.exitintermission = 0;
|
||||
level.intermissiontime = 0;
|
||||
|
||||
CTF_Init();
|
||||
|
||||
G_SaveClientData();
|
||||
|
||||
// Tell all the client that the level is done
|
||||
|
@ -1990,10 +1938,6 @@ void G_RunFrame
|
|||
|
||||
// reset out count of the number of game traces
|
||||
sv_numtraces = 0;
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
G_CheckFirstPlace();
|
||||
#endif
|
||||
}
|
||||
|
||||
void G_ClientThink
|
||||
|
@ -2044,10 +1988,6 @@ void G_PutClientInServer
|
|||
if ( ent->entity && ent->entity->isSubclassOf( Player ) )
|
||||
{
|
||||
( ( Player * )ent->entity )->Init();
|
||||
|
||||
// Initialize the player to CTF
|
||||
if ( ctf->value )
|
||||
( ( Player * )ent->entity )->InitCTF();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2265,22 +2205,6 @@ void G_ClientUserinfoChanged
|
|||
player->ProcessEvent( ev );
|
||||
}
|
||||
|
||||
// CTF
|
||||
if ( ctf->value )
|
||||
{
|
||||
switch ( ent->client->resp.ctf_team )
|
||||
{
|
||||
case CTF_TEAM_HARDCORPS:
|
||||
strcpy( ent->client->pers.skin, ctf_hardcorps_skin->string );
|
||||
break;
|
||||
case CTF_TEAM_SINTEK:
|
||||
strcpy( ent->client->pers.skin, ctf_sintek_skin->string );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Player number
|
||||
playernum = ent - g_edicts - 1;
|
||||
|
||||
|
@ -2422,7 +2346,7 @@ void G_Say
|
|||
return;
|
||||
}
|
||||
|
||||
if ( !DM_FLAG( DF_MODELTEAMS | DF_SKINTEAMS ) && !ctf->value )
|
||||
if ( !DM_FLAG( DF_MODELTEAMS | DF_SKINTEAMS ) )
|
||||
{
|
||||
team = false;
|
||||
}
|
||||
|
@ -2478,129 +2402,19 @@ void G_Say
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( team )
|
||||
{
|
||||
if ( !OnSameTeam( ent->entity, other->entity ) )
|
||||
if ( !OnSameTeam( ent, other ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
gi.cprintf( other, PRINT_CHAT, "%s", text );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
G_Talk
|
||||
// send over a speech command
|
||||
==================
|
||||
*/
|
||||
void G_Talk
|
||||
(
|
||||
edict_t *ent
|
||||
)
|
||||
|
||||
{
|
||||
int j;
|
||||
edict_t *other;
|
||||
const char *p;
|
||||
char text[ 2048 ];
|
||||
|
||||
if ( gi.argc() < 2 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
p = gi.args();
|
||||
|
||||
if ( *p == '"' )
|
||||
{
|
||||
p++;
|
||||
strcpy( text, p );
|
||||
text[ strlen( text ) - 1 ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( text, p );
|
||||
}
|
||||
|
||||
// don't let text be too long for malicious reasons
|
||||
if ( strlen( text ) > 150 )
|
||||
{
|
||||
text[ 150 ] = 0;
|
||||
}
|
||||
|
||||
strcat( text, "\n" );
|
||||
|
||||
if ( dedicated->value )
|
||||
{
|
||||
gi.cprintf( NULL, PRINT_TALK, "speech %s", text );
|
||||
}
|
||||
|
||||
for( j = 1; j <= game.maxclients; j++ )
|
||||
{
|
||||
float len;
|
||||
vec3_t delta;
|
||||
|
||||
other = &g_edicts[ j ];
|
||||
if ( !other->inuse || !other->client )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// cull the talking based off of distance
|
||||
VectorSubtract (other->s.origin, ent->s.origin, delta);
|
||||
len = VectorLength (delta);
|
||||
if ( len > 2000 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
gi.cprintf( other, PRINT_TALK, "%d %s", ent->s.number, text );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G_CameraCommand
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
Event *ev;
|
||||
const char *cmd;
|
||||
int i;
|
||||
int n;
|
||||
|
||||
n = gi.argc();
|
||||
if ( !n )
|
||||
{
|
||||
gi.printf( "Usage: cam [command] [arg 1]...[arg n]\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
cmd = gi.argv( 1 );
|
||||
if ( Event::Exists( cmd ) )
|
||||
{
|
||||
ev = new Event( cmd );
|
||||
// this is a hack but necessary
|
||||
//ev->SetSource( EV_FROM_CONSOLE );
|
||||
ev->SetSource( EV_FROM_SCRIPT );
|
||||
ev->SetConsoleEdict( NULL );
|
||||
|
||||
for( i = 2; i < n; i++ )
|
||||
{
|
||||
ev->AddToken( gi.argv( i ) );
|
||||
}
|
||||
|
||||
CameraMan.ProcessEvent( ev );
|
||||
}
|
||||
else
|
||||
{
|
||||
gi.printf( "Unknown camera command '%s'.\n", cmd );
|
||||
}
|
||||
}
|
||||
|
||||
void ClientCommand
|
||||
(
|
||||
edict_t *ent
|
||||
|
@ -2629,16 +2443,6 @@ void ClientCommand
|
|||
G_Say( ent, false, false );
|
||||
return;
|
||||
}
|
||||
else if ( !Q_strcasecmp( cmd, "say_team" ) )
|
||||
{
|
||||
G_Say( ent, true, false );
|
||||
return;
|
||||
}
|
||||
else if ( !Q_strcasecmp( cmd, "say_talk" ) )
|
||||
{
|
||||
G_Talk( ent );
|
||||
return;
|
||||
}
|
||||
else if ( game.maxclients == 1 )
|
||||
{
|
||||
// only allow these commands when we only have one client (most likely only a local game)
|
||||
|
@ -2700,11 +2504,6 @@ void ClientCommand
|
|||
}
|
||||
return;
|
||||
}
|
||||
else if ( !Q_strcasecmp (cmd, "cam") )
|
||||
{
|
||||
G_CameraCommand();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
found = false;
|
||||
|
@ -2762,70 +2561,6 @@ void G_ClientCommand
|
|||
ClientCommand( ent );
|
||||
}
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
void G_CheckFirstPlace
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
int i;
|
||||
int maxscore;
|
||||
int maxplayer;
|
||||
int score;
|
||||
|
||||
// sort the clients by score
|
||||
maxscore = INT_MIN;
|
||||
maxplayer = -1;
|
||||
for( i = 0; i < game.maxclients; i++ )
|
||||
{
|
||||
game.clients[ i ].ps.stats[ STAT_FIRSTPLACE ] = 0;
|
||||
|
||||
if ( !g_edicts[ 1 + i ].inuse )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
score = game.clients[ i ].resp.score;
|
||||
if ( score > maxscore )
|
||||
{
|
||||
maxplayer = i;
|
||||
maxscore = score;
|
||||
}
|
||||
else if ( score == maxscore )
|
||||
{
|
||||
// if a tie, clear out the maxplayer
|
||||
maxplayer = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( maxplayer != -1 )
|
||||
{
|
||||
game.clients[ maxplayer ].ps.stats[ STAT_FIRSTPLACE ] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void G_DrawFirstPlace
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
int i;
|
||||
|
||||
// sort the clients by score
|
||||
for( i = 0; i < game.maxclients; i++ )
|
||||
{
|
||||
game.clients[ i ].ps.stats[ STAT_DRAWFIRSTPLACE ] = 0;
|
||||
if ( game.clients[ i ].ps.stats[ STAT_FIRSTPLACE ] )
|
||||
{
|
||||
game.clients[ i ].ps.stats[ STAT_DRAWFIRSTPLACE ] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
G_DeathmatchScoreboardMessage
|
||||
|
@ -2851,13 +2586,6 @@ void G_DeathmatchScoreboardMessage
|
|||
edict_t *cl_ent, *killeredict, *entedict;
|
||||
const char *tag;
|
||||
|
||||
// CTF
|
||||
if ( ctf->value )
|
||||
{
|
||||
CTF_ScoreboardMessage (ent, killer);
|
||||
return;
|
||||
}
|
||||
|
||||
killeredict = NULL;
|
||||
entedict = NULL;
|
||||
if ( killer )
|
||||
|
|
16
g_main.h
16
g_main.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/g_main.h $
|
||||
// $Revision:: 16 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 4/01/99 3:20p $
|
||||
// $Revision:: 14 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 11/13/98 2:35a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,12 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/g_main.h $
|
||||
//
|
||||
// 16 4/01/99 3:20p Markd
|
||||
// Added dedicated support to Means of Death.
|
||||
//
|
||||
// 15 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 14 11/13/98 2:35a Aldie
|
||||
// Declared fixbodiesforplayer
|
||||
//
|
||||
|
@ -102,8 +96,7 @@ extern cvar_t *dmflags;
|
|||
extern cvar_t *skill;
|
||||
extern cvar_t *fraglimit;
|
||||
extern cvar_t *timelimit;
|
||||
extern cvar_t *ctf;
|
||||
extern cvar_t *capturelimit;
|
||||
|
||||
extern cvar_t *filterban;
|
||||
|
||||
extern cvar_t *flood_msgs;
|
||||
|
@ -151,7 +144,6 @@ extern cvar_t *sv_drawtrace;
|
|||
extern int sv_numtraces;
|
||||
|
||||
extern cvar_t *parentmode;
|
||||
extern cvar_t *dedicated;
|
||||
|
||||
extern usercmd_t *current_ucmd;
|
||||
|
||||
|
|
204
g_utils.cpp
204
g_utils.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/g_utils.cpp $
|
||||
// $Revision:: 71 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 5/20/99 6:41p $
|
||||
// $Revision:: 68 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 12/15/98 6:17p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,19 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/g_utils.cpp $
|
||||
//
|
||||
// 71 5/20/99 6:41p Markd
|
||||
// Fixed debug number code
|
||||
//
|
||||
// 70 5/19/99 4:57p Markd
|
||||
// fixed some errors
|
||||
//
|
||||
// 69 3/02/99 9:14p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:38p Aldie
|
||||
//
|
||||
// 68 12/15/98 6:17p Jimdose
|
||||
// made SelectSpawnPoint handle progressive starts
|
||||
//
|
||||
|
@ -254,7 +241,6 @@
|
|||
#include "worldspawn.h"
|
||||
#include "scriptmaster.h"
|
||||
#include "windows.h"
|
||||
#include "ctf.h"
|
||||
|
||||
cvar_t *g_numdebuglines;
|
||||
|
||||
|
@ -752,7 +738,6 @@ Entity *SelectFarthestDeathmatchSpawnPoint
|
|||
return spot;
|
||||
}
|
||||
|
||||
|
||||
Entity *SelectDeathmatchSpawnPoint
|
||||
(
|
||||
void
|
||||
|
@ -810,7 +795,6 @@ void SelectSpawnPoint
|
|||
(
|
||||
Vector &origin,
|
||||
Vector &angles,
|
||||
edict_t *edict,
|
||||
int *gravaxis
|
||||
)
|
||||
|
||||
|
@ -839,10 +823,6 @@ void SelectSpawnPoint
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ( ctf->value )
|
||||
{
|
||||
spot = SelectCTFSpawnPoint( edict );
|
||||
}
|
||||
else if ( deathmatch->value || level.training == 1 )
|
||||
{
|
||||
spot = SelectDeathmatchSpawnPoint();
|
||||
|
@ -1607,144 +1587,6 @@ void G_DebugBBox
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// LED style digits
|
||||
//
|
||||
// ****1***
|
||||
// * * 8 == /
|
||||
// 6 *4
|
||||
// * * *
|
||||
// ****2***
|
||||
// * * *
|
||||
// 7 *--8 5 9
|
||||
// ** * **10
|
||||
// ****3*** 12**
|
||||
// 11
|
||||
|
||||
static int Numbers[ 12 ][ 8 ] =
|
||||
{
|
||||
{ 1, 3, 4, 5, 6, 7, 0, 0 }, // 0
|
||||
{ 4, 5, 0, 0, 0, 0, 0, 0 }, // 1
|
||||
{ 1, 4, 2, 7, 3, 0, 0, 0 }, // 2
|
||||
{ 1, 4, 2, 5, 3, 0, 0, 0 }, // 3
|
||||
{ 6, 4, 2, 5, 0, 0, 0, 0 }, // 4
|
||||
{ 1, 6, 2, 5, 3, 0, 0, 0 }, // 5
|
||||
{ 1, 6, 2, 5, 7, 3, 0, 0 }, // 6
|
||||
{ 1, 8, 0, 0, 0, 0, 0, 0 }, // 7
|
||||
{ 1, 2, 3, 4, 5, 6, 7, 0 }, // 8
|
||||
{ 1, 6, 4, 2, 5, 3, 0, 0 }, // 9
|
||||
{ 9, 10, 11, 12, 0, 0, 0, 0 }, // .
|
||||
{ 2, 0, 0, 0, 0, 0, 0, 0 }, // -
|
||||
};
|
||||
|
||||
static float Lines[ 13 ][ 4 ] =
|
||||
{
|
||||
{ 0, 0, 0, 0 }, // Unused
|
||||
{ -4, 8, 4, 8 }, // 1
|
||||
{ -4, 4, 4, 4 }, // 2
|
||||
{ -4, 0, 4, 0 }, // 3
|
||||
{ 4, 8, 4, 4 }, // 4
|
||||
{ 4, 4, 4, 0 }, // 5
|
||||
{ -4, 8, -4, 4 }, // 6
|
||||
{ -4, 4, -4, 0 }, // 7
|
||||
{ 4, 8, -4, 0 }, // 8
|
||||
|
||||
{ -1, 2, 1, 2 }, // 9
|
||||
{ 1, 2, 1, 0 }, // 10
|
||||
{ -1, 0, 1, 0 }, // 11
|
||||
{ -1, 0, -1, 2 }, // 12
|
||||
};
|
||||
|
||||
void G_DrawDebugNumber
|
||||
(
|
||||
Vector org,
|
||||
float number,
|
||||
float scale,
|
||||
float r,
|
||||
float g,
|
||||
float b,
|
||||
int precision
|
||||
)
|
||||
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int l;
|
||||
int num;
|
||||
Vector up;
|
||||
Vector right;
|
||||
Vector pos;
|
||||
Vector start;
|
||||
Vector ang;
|
||||
str text;
|
||||
Vector delta;
|
||||
char format[ 20 ];
|
||||
|
||||
// only draw entity numbers within a certain radius
|
||||
delta = Vector( g_edicts[ 1 ].s.origin ) - org;
|
||||
if ( ( delta * delta ) > ( 1000 * 1000 ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
G_Color4f( r, g, b, 1.0 );
|
||||
|
||||
ang = game.clients[ 0 ].ps.viewangles;
|
||||
ang.AngleVectors( NULL, &right, &up );
|
||||
|
||||
up *= scale;
|
||||
right *= scale;
|
||||
|
||||
if ( precision > 0 )
|
||||
{
|
||||
sprintf( format, "%%.%df", precision );
|
||||
text = va( format, number );
|
||||
}
|
||||
else
|
||||
{
|
||||
text = va( "%d", ( int )number );
|
||||
}
|
||||
|
||||
start = org - ( text.length() - 1 ) * 5 * right;
|
||||
|
||||
for( i = 0; i < text.length(); i++ )
|
||||
{
|
||||
if ( text[ i ] == '.' )
|
||||
{
|
||||
num = 10;
|
||||
}
|
||||
else if ( text[ i ] == '-' )
|
||||
{
|
||||
num = 11;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = text[ i ] - '0';
|
||||
}
|
||||
|
||||
for( j = 0; j < 8; j++ )
|
||||
{
|
||||
l = Numbers[ num ][ j ];
|
||||
if ( l == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
G_BeginLine();
|
||||
|
||||
pos = start + Lines[ l ][ 0 ] * right + Lines[ l ][ 1 ] * up;
|
||||
G_Vertex( pos );
|
||||
|
||||
pos = start + Lines[ l ][ 2 ] * right + Lines[ l ][ 3 ] * up;
|
||||
G_Vertex( pos );
|
||||
|
||||
G_EndLine();
|
||||
}
|
||||
|
||||
start += 10 * right;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
//
|
||||
// LED style digits
|
||||
//
|
||||
|
@ -1789,12 +1631,11 @@ static float Lines[ 9 ][ 4 ] =
|
|||
void G_DrawDebugNumber
|
||||
(
|
||||
Vector origin,
|
||||
float number,
|
||||
int number,
|
||||
float scale,
|
||||
float r,
|
||||
float g,
|
||||
float b,
|
||||
int precision
|
||||
float b
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -1809,7 +1650,6 @@ void G_DrawDebugNumber
|
|||
Vector ang;
|
||||
str text;
|
||||
Vector delta;
|
||||
char format[ 20 ];
|
||||
|
||||
// only draw entity numbers within a certain radius
|
||||
delta = Vector( g_edicts[ 1 ].s.origin ) - origin;
|
||||
|
@ -1826,16 +1666,7 @@ void G_DrawDebugNumber
|
|||
up *= scale;
|
||||
right *= scale;
|
||||
|
||||
if ( precision > 0 )
|
||||
{
|
||||
sprintf( format, "%%.%df", precision );
|
||||
text = va( format, number );
|
||||
}
|
||||
else
|
||||
{
|
||||
text = va( "%d", ( int )number );
|
||||
}
|
||||
|
||||
text = va( "%d", number );
|
||||
start = origin - ( text.length() - 1 ) * 5 * right;
|
||||
|
||||
for( i = 0; i < text.length(); i++ )
|
||||
|
@ -1848,10 +1679,6 @@ void G_DrawDebugNumber
|
|||
{
|
||||
break;
|
||||
}
|
||||
if ( ( l < 0 ) || ( l > 8 ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
G_BeginLine();
|
||||
|
||||
|
@ -1867,7 +1694,6 @@ void G_DrawDebugNumber
|
|||
start += 10 * right;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Vector G_CalculateImpulse
|
||||
(
|
||||
|
@ -1998,24 +1824,6 @@ qboolean OnSameTeam
|
|||
char ent1Team [512];
|
||||
char ent2Team [512];
|
||||
|
||||
// CTF check for same team
|
||||
if ( ctf->value )
|
||||
{
|
||||
if ( !ent1->client || !ent2->client )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ent1->client->resp.ctf_team == ent2->client->resp.ctf_team )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !DM_FLAG( DF_MODELTEAMS | DF_SKINTEAMS ) )
|
||||
return false;
|
||||
|
||||
|
|
18
g_utils.h
18
g_utils.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/g_utils.h $
|
||||
// $Revision:: 17 $
|
||||
// $Revision:: 15 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 5/19/99 4:57p $
|
||||
// $Date:: 10/26/98 3:50a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,16 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/g_utils.h $
|
||||
//
|
||||
// 17 5/19/99 4:57p Markd
|
||||
// fixed some errors
|
||||
//
|
||||
// 16 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:38p Aldie
|
||||
//
|
||||
// 15 10/26/98 3:50a Markd
|
||||
// put in prediction
|
||||
//
|
||||
|
@ -101,7 +91,7 @@ EXPORT_FROM_DLL trace_t G_Trace( vec3_t start, vec3_t mins, vec3_t maxs, vec3_t
|
|||
EXPORT_FROM_DLL trace_t G_FullTrace( Vector &start, Vector &mins, Vector &maxs, Vector &end, float radius, Entity *passent, int contentmask, const char *reason );
|
||||
EXPORT_FROM_DLL trace_t G_FullTrace( vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, float radius, edict_t *passent, int contentmask, const char *reason );
|
||||
|
||||
EXPORT_FROM_DLL void SelectSpawnPoint( Vector &origin, Vector &angles, edict_t *edcit, int *gravaxis = NULL );
|
||||
EXPORT_FROM_DLL void SelectSpawnPoint( Vector &origin, Vector &angles, int *gravaxis = NULL );
|
||||
|
||||
EXPORT_FROM_DLL int G_FindTarget( int entnum, const char *name );
|
||||
EXPORT_FROM_DLL Entity *G_NextEntity( Entity *ent );
|
||||
|
@ -129,7 +119,7 @@ EXPORT_FROM_DLL void G_BeginLine( void );
|
|||
EXPORT_FROM_DLL void G_Vertex( Vector v );
|
||||
EXPORT_FROM_DLL void G_EndLine( void );
|
||||
EXPORT_FROM_DLL void G_DebugBBox( Vector origin, Vector mins, Vector maxs, float r, float g, float b, float alpha );
|
||||
EXPORT_FROM_DLL void G_DrawDebugNumber( Vector org, float number, float scale, float r, float g, float b, int precision = 0 );
|
||||
EXPORT_FROM_DLL void G_DrawDebugNumber( Vector origin, int number, float scale, float r, float g, float b );
|
||||
|
||||
EXPORT_FROM_DLL void G_LoadAndExecScript( const char *filename, const char *label = NULL );
|
||||
EXPORT_FROM_DLL ScriptThread *ExecuteThread( str thread_name, qboolean start = true );
|
||||
|
|
69
game.dsp
69
game.dsp
|
@ -47,7 +47,7 @@ CFG=game - Win32 Debug Arcade
|
|||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\Release"
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
|
@ -65,8 +65,8 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /machine:I386 /out:"..\Release/gamex86.dll"
|
||||
# SUBTRACT LINK32 /incremental:yes /debug
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /machine:I386 /out:"Release/gamex86.dll"
|
||||
# SUBTRACT LINK32 /incremental:yes /map /debug
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug"
|
||||
|
||||
|
@ -77,7 +77,7 @@ LINK32=link.exe
|
|||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\Debug"
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
|
@ -95,7 +95,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"..\Debug/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/gamex86.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha"
|
||||
|
||||
|
@ -107,7 +107,7 @@ LINK32=link.exe
|
|||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\DebugAxp"
|
||||
# PROP Output_Dir ".\DebugAxp"
|
||||
# PROP Intermediate_Dir ".\DebugAxp"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
|
@ -125,7 +125,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:ALPHA
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:ALPHA /out:"..\DebugAxp/gameaxp.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:ALPHA /out:".\DebugAxp/gameaxp.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Release Alpha"
|
||||
|
||||
|
@ -137,7 +137,7 @@ LINK32=link.exe
|
|||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\ReleaseAXP"
|
||||
# PROP Output_Dir ".\ReleaseAXP"
|
||||
# PROP Intermediate_Dir ".\ReleaseAXP"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
|
@ -154,8 +154,8 @@ BSC32=bscmake.exe
|
|||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:ALPHA /out:"..\Release/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:ALPHA /out:"..\ReleaseAXP/gameaxp.dll"
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:ALPHA /out:"Release/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:ALPHA /out:".\ReleaseAXP/gameaxp.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug Demo"
|
||||
|
||||
|
@ -184,8 +184,8 @@ BSC32=bscmake.exe
|
|||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"..\Debug/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"../Demo_Debug/gamex86.dll"
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"Demo_Debug/gamex86.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Release Demo"
|
||||
|
||||
|
@ -214,9 +214,9 @@ BSC32=bscmake.exe
|
|||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:I386 /out:"..\Release/gamex86.dll"
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:I386 /out:"Release/gamex86.dll"
|
||||
# SUBTRACT BASE LINK32 /incremental:yes /debug
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /machine:I386 /out:"..\Demo_Release/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /machine:I386 /out:"Demo_Release/gamex86.dll"
|
||||
# SUBTRACT LINK32 /incremental:yes /debug
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug Arcade"
|
||||
|
@ -229,7 +229,7 @@ LINK32=link.exe
|
|||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../Arcade_Debug"
|
||||
# PROP Output_Dir "./Arcade_Debug"
|
||||
# PROP Intermediate_Dir "./Arcade_Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
|
@ -246,8 +246,8 @@ BSC32=bscmake.exe
|
|||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"..\Debug/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"..\Arcade_Debug/gamex86.dll"
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/gamex86.dll"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"Arcade_Debug/gamex86.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Release Arcade"
|
||||
|
||||
|
@ -259,7 +259,7 @@ LINK32=link.exe
|
|||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../Arcade_Release"
|
||||
# PROP Output_Dir "./Arcade_Release"
|
||||
# PROP Intermediate_Dir "./Arcade_Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
|
@ -276,10 +276,10 @@ BSC32=bscmake.exe
|
|||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /machine:I386 /out:"..\Release/gamex86.dll"
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /machine:I386 /out:"Release/gamex86.dll"
|
||||
# SUBTRACT BASE LINK32 /incremental:yes /map /debug
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /map /machine:I386 /out:"..\Arcade_Release/gamex86.dll"
|
||||
# SUBTRACT LINK32 /incremental:yes /debug
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /base:"0x11000000" /subsystem:windows /dll /machine:I386 /out:"Arcade_Release/gamex86.dll"
|
||||
# SUBTRACT LINK32 /incremental:yes /map /debug
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
@ -1126,29 +1126,6 @@ SOURCE=.\glowstick.cpp
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\grapple.cpp
|
||||
|
||||
!IF "$(CFG)" == "game - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug Alpha"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Release Alpha"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug Demo"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Release Demo"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Debug Arcade"
|
||||
|
||||
!ELSEIF "$(CFG)" == "game - Win32 Release Arcade"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gravpath.cpp
|
||||
|
||||
!IF "$(CFG)" == "game - Win32 Release"
|
||||
|
@ -2620,10 +2597,6 @@ SOURCE=.\gibs.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\grapple.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gravpath.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
29
game.dsw
29
game.dsw
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "game"=.\game.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
38
grapple.cpp
38
grapple.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/grapple.cpp $
|
||||
// $Revision:: 6 $
|
||||
// $Revision:: 1 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/25/99 6:29p $
|
||||
// $Date:: 2/17/99 8:03p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,21 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/grapple.cpp $
|
||||
//
|
||||
// 6 3/25/99 6:29p Aldie
|
||||
// Fixed grappling hook crash bug
|
||||
//
|
||||
// 5 3/14/99 1:53a Aldie
|
||||
// Fixed NULL surface flag check for hook
|
||||
//
|
||||
// 4 3/12/99 8:13p Aldie
|
||||
// Added hack for Richard's level
|
||||
//
|
||||
// 3 3/03/99 12:38p Aldie
|
||||
// Fixed hook for gravaxis
|
||||
//
|
||||
// 2 3/02/99 9:23p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 1 2/17/99 8:03p Aldie
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
|
@ -77,7 +62,6 @@ EXPORT_FROM_DLL void Hook::Touch
|
|||
|
||||
stopsound( CHAN_VOICE );
|
||||
setSolidType( SOLID_NOT );
|
||||
setMoveType( MOVETYPE_NONE );
|
||||
|
||||
if ( HitSky() || other->isSubclassOf( Teleporter ) )
|
||||
{
|
||||
|
@ -85,17 +69,6 @@ EXPORT_FROM_DLL void Hook::Touch
|
|||
return;
|
||||
}
|
||||
|
||||
// HACK for Richard's map
|
||||
if
|
||||
(
|
||||
( level.impact_trace.surface ) &&
|
||||
( level.impact_trace.surface->flags & SURF_DAMAGE )
|
||||
)
|
||||
{
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
damg = 10;
|
||||
|
||||
owner = G_GetEntity( this->owner );
|
||||
|
@ -105,9 +78,7 @@ EXPORT_FROM_DLL void Hook::Touch
|
|||
|
||||
if (other->takedamage)
|
||||
{
|
||||
player = (Player *)( Entity * )owner;
|
||||
player->ClearGrapplePull();
|
||||
other->Damage( this, owner, damg, worldorigin, velocity, level.impact_trace.plane.normal, 200, 0, MOD_GRAPPLE, -1, -1, 1.0f );
|
||||
other->Damage( this, owner, damg, worldorigin, velocity, level.impact_trace.plane.normal, 200, 0, MOD_ROCKET, -1, -1, 1.0f );
|
||||
PostEvent( EV_Remove, 0.1 );
|
||||
return;
|
||||
}
|
||||
|
@ -145,7 +116,6 @@ EXPORT_FROM_DLL void Hook::Setup
|
|||
setMoveType( MOVETYPE_FLYMISSILE );
|
||||
setSolidType( SOLID_BBOX );
|
||||
edict->clipmask = MASK_PROJECTILE;
|
||||
SetGravityAxis( owner->gravaxis );
|
||||
|
||||
angles = dir.toAngles();
|
||||
angles[ PITCH ] = - angles[ PITCH ];
|
||||
|
@ -160,7 +130,7 @@ EXPORT_FROM_DLL void Hook::Setup
|
|||
|
||||
takedamage = DAMAGE_NO;
|
||||
|
||||
setModel( "ctf_grap.def" );
|
||||
setModel( "hook.def" );
|
||||
gravity = 0;
|
||||
|
||||
setSize( "-1 -1 -1", "1 1 1" );
|
||||
|
|
91
grapple.h
91
grapple.h
|
@ -1,91 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/grapple.h $
|
||||
// $Revision:: 1 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:24p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source may not be distributed and/or modified without
|
||||
// expressly written permission by Ritual Entertainment, Inc.
|
||||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/grapple.h $
|
||||
//
|
||||
// 1 3/02/99 9:24p Aldie
|
||||
//
|
||||
// 2 2/16/99 4:08p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:38p Aldie
|
||||
//
|
||||
// 2 2/10/99 9:35p Aldie
|
||||
// First Version
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Grappling Hook
|
||||
|
||||
#ifndef __GRAPPLE_H__
|
||||
#define __GRAPPLE_H__
|
||||
|
||||
#include "g_local.h"
|
||||
#include "item.h"
|
||||
#include "weapon.h"
|
||||
#include "specialfx.h"
|
||||
|
||||
class EXPORT_FROM_DLL Hook : public Projectile
|
||||
{
|
||||
private:
|
||||
float speed;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( Hook );
|
||||
|
||||
void Setup( Entity *owner, Vector pos, Vector dir );
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
virtual void Touch( Event *ev );
|
||||
};
|
||||
|
||||
inline EXPORT_FROM_DLL void Hook::Archive
|
||||
(
|
||||
Archiver &arc
|
||||
)
|
||||
{
|
||||
Projectile::Archive( arc );
|
||||
|
||||
arc.WriteFloat( speed );
|
||||
}
|
||||
|
||||
inline EXPORT_FROM_DLL void Hook::Unarchive
|
||||
(
|
||||
Archiver &arc
|
||||
)
|
||||
{
|
||||
Projectile::Unarchive( arc );
|
||||
|
||||
arc.ReadFloat( &speed );
|
||||
}
|
||||
|
||||
typedef SafePtr<Hook> HookPtr;
|
||||
typedef SafePtr<Beam> BeamPtr;
|
||||
|
||||
class EXPORT_FROM_DLL Grapple : public Weapon
|
||||
{
|
||||
private:
|
||||
HookPtr hook;
|
||||
BeamPtr beam;
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( Grapple );
|
||||
|
||||
Grapple();
|
||||
~Grapple();
|
||||
virtual void Shoot( Event *ev );
|
||||
virtual qboolean HasAmmo( void );
|
||||
virtual void ReleaseFire( float t );
|
||||
virtual void UpdateBeam( Event *ev );
|
||||
};
|
||||
|
||||
|
||||
#endif /* grapple.h */
|
19
health.cpp
19
health.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/health.cpp $
|
||||
// $Revision:: 20 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/19/99 5:03p $
|
||||
// $Revision:: 19 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/17/98 6:08a $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/health.cpp $
|
||||
//
|
||||
// 20 3/19/99 5:03p Aldie
|
||||
// Added REGENERATION TECH support
|
||||
//
|
||||
// 19 11/17/98 6:08a Jimdose
|
||||
// made PickupHealth take health from player's inventory before checking if
|
||||
// they can pick it up. Fixes bug where player can't pickup health due to
|
||||
|
@ -84,7 +81,6 @@
|
|||
#include "item.h"
|
||||
#include "sentient.h"
|
||||
#include "health.h"
|
||||
#include "ctf.h"
|
||||
|
||||
CLASS_DECLARATION( Item, Health, "health_020" );
|
||||
|
||||
|
@ -143,14 +139,7 @@ void Health::PickupHealth
|
|||
}
|
||||
|
||||
sen->health += amount;
|
||||
if ( ctf->value && sen->HasItem( "CTF_Tech_Regeneration" ) )
|
||||
{
|
||||
if ( sen->health > CTF_TECH_REGENERATION_HEALTH )
|
||||
{
|
||||
sen->health = CTF_TECH_REGENERATION_HEALTH;
|
||||
}
|
||||
}
|
||||
else if ( sen->health > 200 )
|
||||
if ( sen->health > 200 )
|
||||
{
|
||||
sen->health = 200;
|
||||
}
|
||||
|
|
10
item.h
10
item.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/item.h $
|
||||
// $Revision:: 24 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:16p $
|
||||
// $Revision:: 23 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/08/98 10:52p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/item.h $
|
||||
//
|
||||
// 24 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 23 11/08/98 10:52p Jimdose
|
||||
// amountoverride wasn't archived
|
||||
// made icon_index and item_index be calculated in unarchive
|
||||
|
@ -165,7 +162,6 @@ class EXPORT_FROM_DLL Item : public Trigger
|
|||
virtual void RespawnSound( Event *ev );
|
||||
virtual void DialogNeeded( Event *ev );
|
||||
virtual str GetDialogNeeded( void );
|
||||
virtual void ClearOwner( void ){ owner = NULL; }
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
};
|
||||
|
|
18
listener.cpp
18
listener.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/listener.cpp $
|
||||
// $Revision:: 48 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/26/99 6:26p $
|
||||
// $Revision:: 45 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/10/98 5:48p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,15 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/listener.cpp $
|
||||
//
|
||||
// 48 3/26/99 6:26p Aldie
|
||||
// Fixed more CTF bugs, probably the last ones
|
||||
//
|
||||
// 47 3/18/99 6:44p Aldie
|
||||
// CancelPendingEvents when destructing
|
||||
//
|
||||
// 46 3/17/99 4:00p Aldie
|
||||
// CTF Update
|
||||
//
|
||||
// 45 11/10/98 5:48p Jimdose
|
||||
// Made SortEventList sort the list manually when TEMPLATE_EXPORT is not
|
||||
// defined
|
||||
|
@ -771,7 +762,7 @@ EXPORT_FROM_DLL void Event::AddEntity
|
|||
{
|
||||
char text[ 128 ];
|
||||
|
||||
//assert( ent );
|
||||
assert( ent );
|
||||
if ( !ent )
|
||||
{
|
||||
sprintf( text, "*0" );
|
||||
|
@ -1249,7 +1240,6 @@ EXPORT_FROM_DLL void Listener::Remove
|
|||
)
|
||||
|
||||
{
|
||||
this->CancelPendingEvents();
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
|
11
listener.h
11
listener.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/listener.h $
|
||||
// $Revision:: 31 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 5/19/99 11:30a $
|
||||
// $Revision:: 30 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 10/26/98 4:27p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/listener.h $
|
||||
//
|
||||
// 31 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 30 10/26/98 4:27p Jimdose
|
||||
// Sped up ValidEvent
|
||||
// Added FindEvent( const char * )
|
||||
|
@ -393,6 +390,8 @@ inline EXPORT_FROM_DLL void Event::SetConsoleEdict
|
|||
)
|
||||
|
||||
{
|
||||
assert( consoleedict );
|
||||
|
||||
// linenumber does double duty in the case of the console commands
|
||||
if ( consoleedict )
|
||||
{
|
||||
|
|
2564
player.cpp
2564
player.cpp
File diff suppressed because it is too large
Load diff
425
player.h
425
player.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/player.h $
|
||||
// $Revision:: 125 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 11/02/99 12:09p $
|
||||
// $Revision:: 119 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/16/98 8:26p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,26 +13,378 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/player.h $
|
||||
//
|
||||
// 125 11/02/99 12:09p Markd
|
||||
// Fixed CTF cheat bug
|
||||
// 119 11/16/98 8:26p Jimdose
|
||||
// Added CheckWater
|
||||
//
|
||||
// 124 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
// 118 11/14/98 2:53a Aldie
|
||||
// Added InitSkin for keeping the skin intact for savegames
|
||||
//
|
||||
// 123 3/19/99 8:59p Aldie
|
||||
// Added spectator_distance
|
||||
// 117 11/13/98 2:35a Aldie
|
||||
// Changed variable name
|
||||
//
|
||||
// 122 3/19/99 5:59p Aldie
|
||||
// Added dropweapon and droptech
|
||||
// 116 11/08/98 10:53p Jimdose
|
||||
// some variables weren't being archived. They were benign, but it helps
|
||||
// ensure that we don't miss important variables
|
||||
//
|
||||
// 121 3/03/99 12:39p Aldie
|
||||
// Remove the bot stuff
|
||||
// 115 11/07/98 10:15p Markd
|
||||
// Added forcemusic support
|
||||
//
|
||||
// 120 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
// 114 11/07/98 8:01p Markd
|
||||
// Added in damage_since_pain, fixed some camera stuff
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
// 113 11/06/98 9:38p Aldie
|
||||
// Moved waitforplayer stuff to think function
|
||||
//
|
||||
// 112 10/25/98 11:57p Jimdose
|
||||
// exported EV_Player_Respawn
|
||||
//
|
||||
// 111 10/24/98 5:44p Markd
|
||||
// Added killent, removent, killclass removeclass and added parameters to
|
||||
// whatis
|
||||
//
|
||||
// 110 10/21/98 5:29p Aldie
|
||||
// Added a setskin command
|
||||
//
|
||||
// 109 10/16/98 1:59a Jimdose
|
||||
// Added EV_Player_EndLevel and EndLevel
|
||||
// Made third person view work with savegames
|
||||
//
|
||||
// 108 10/14/98 1:36a Jimdose
|
||||
// Got cross-level persitant data working
|
||||
//
|
||||
// 107 10/12/98 8:45p Jimdose
|
||||
// Rewrote init function
|
||||
// started adding persistant functions
|
||||
//
|
||||
// 106 10/11/98 8:58p Aldie
|
||||
// Changed Restore to Human
|
||||
//
|
||||
// 105 10/11/98 7:41p Aldie
|
||||
// Mutate and restore commands for Richard
|
||||
//
|
||||
// 104 10/10/98 9:59p Aldie
|
||||
// Added trappedinquantum flag to archiver
|
||||
//
|
||||
// 103 10/10/98 5:58p Aldie
|
||||
// More quantumdestab fixes
|
||||
//
|
||||
// 102 10/09/98 9:01p Aldie
|
||||
// Moved GiveOxygen to player
|
||||
//
|
||||
// 101 10/07/98 11:54p Jimdose
|
||||
// Added old_pmove to Player
|
||||
// Added SetDeltaAngles
|
||||
// Moved PlayerFrozen to game
|
||||
//
|
||||
// 100 10/02/98 7:20p Aldie
|
||||
// Added flashcolor
|
||||
//
|
||||
// 99 9/30/98 5:39p Aldie
|
||||
// Added showinfo command
|
||||
//
|
||||
// 98 9/29/98 5:06p Aldie
|
||||
// Relocated gravity node functions
|
||||
//
|
||||
// 97 9/26/98 4:46p Aldie
|
||||
// Added mutant mode
|
||||
//
|
||||
// 96 9/22/98 3:27p Markd
|
||||
// Took out old variable
|
||||
//
|
||||
// 95 9/22/98 12:49p Markd
|
||||
// Put in archive and unarchive functions
|
||||
//
|
||||
// 94 9/21/98 1:35a Aldie
|
||||
// Moved some vars to sentient
|
||||
//
|
||||
// 93 9/19/98 4:47p Markd
|
||||
// fixed music stuff and added actionincrement to weapons
|
||||
//
|
||||
// 92 9/18/98 10:57p Jimdose
|
||||
// Added spawnactor and actorinfo
|
||||
//
|
||||
// 91 9/17/98 1:48p Markd
|
||||
// Fixed swimmin animations
|
||||
//
|
||||
// 90 9/16/98 8:58p Aldie
|
||||
// Added ability to do a hold down weapon charge
|
||||
//
|
||||
// 89 9/11/98 2:50p Aldie
|
||||
// Added release firing functionality
|
||||
//
|
||||
// 88 9/10/98 8:53p Markd
|
||||
// put in proper falling and landing animation thresholds.
|
||||
//
|
||||
// 87 9/09/98 5:06p Markd
|
||||
// Added savefov and restorefov, also added fov change when teleporting
|
||||
//
|
||||
// 86 8/31/98 7:16p Markd
|
||||
// Fixed player animation naming convention
|
||||
//
|
||||
// 85 8/31/98 5:45p Aldie
|
||||
// Powerup timer stuff
|
||||
//
|
||||
// 84 8/30/98 7:29p Markd
|
||||
// Put in auto-dead camera where after 10 seconds, player will follow the
|
||||
// endnode1 path
|
||||
//
|
||||
// 83 8/29/98 9:53p Jimdose
|
||||
// moved enums and #defines from g_local.h
|
||||
//
|
||||
// 82 8/29/98 5:27p Markd
|
||||
// added specialfx, replaced misc with specialfx where appropriate
|
||||
//
|
||||
// 81 8/28/98 7:54p Markd
|
||||
// Added TauntTime
|
||||
//
|
||||
// 80 8/27/98 4:50p Markd
|
||||
// Added fallsurface
|
||||
//
|
||||
// 79 8/25/98 7:52p Markd
|
||||
// Added crosshair to player again
|
||||
//
|
||||
// 78 8/25/98 4:11p Markd
|
||||
// Added taunt support
|
||||
//
|
||||
// 77 8/17/98 8:59p Jimdose
|
||||
// Added WhatIs
|
||||
//
|
||||
// 76 8/17/98 6:20p Markd
|
||||
// Changed SetCamera to a Player method
|
||||
//
|
||||
// 75 8/17/98 3:07p Aldie
|
||||
// Added the weaponuse command
|
||||
//
|
||||
// 74 8/12/98 6:04p Aldie
|
||||
// Added a shield timer
|
||||
//
|
||||
// 73 8/07/98 6:01p Aldie
|
||||
// Added frag credits for falling damage
|
||||
//
|
||||
// 72 7/31/98 8:10p Jimdose
|
||||
// Script commands now include flags to indicate cheats and console commands
|
||||
// Cheat function removed since events have cheat flags
|
||||
//
|
||||
// 71 7/31/98 4:20p Jimdose
|
||||
// Added GiveHealthCheat
|
||||
//
|
||||
// 70 7/26/98 12:35p Jimdose
|
||||
// Added GiveAllCheat
|
||||
//
|
||||
// 69 7/26/98 4:12a Aldie
|
||||
// Updated getVehicle
|
||||
//
|
||||
// 68 7/25/98 5:21p Markd
|
||||
// Added GotKill to player
|
||||
//
|
||||
// 67 7/24/98 7:37p Aldie
|
||||
// Changed hud event
|
||||
//
|
||||
// 66 7/23/98 9:56p Aldie
|
||||
// Added hud event
|
||||
//
|
||||
// 65 7/23/98 12:31p Markd
|
||||
// Added onladder variable
|
||||
//
|
||||
// 64 7/22/98 10:20p Markd
|
||||
// Added AnimPrefixForWeapon
|
||||
//
|
||||
// 63 7/21/98 9:07p Markd
|
||||
// Added UpdateMusic
|
||||
//
|
||||
// 62 7/21/98 1:10p Aldie
|
||||
// Added meansofdeath to obituaries
|
||||
//
|
||||
// 61 7/20/98 12:09p Markd
|
||||
// Added vehicleanim support
|
||||
//
|
||||
// 60 7/17/98 4:04p Markd
|
||||
// Added useWeapon
|
||||
//
|
||||
// 59 7/14/98 9:54p Markd
|
||||
// Fixed camera stuff
|
||||
//
|
||||
// 58 7/13/98 5:02p Aldie
|
||||
// Added dead player bodies with gibbing
|
||||
//
|
||||
// 57 7/11/98 8:58p Markd
|
||||
// Added testthread command
|
||||
//
|
||||
// 56 7/10/98 11:18p Jimdose
|
||||
// Removed third-person crosshair
|
||||
//
|
||||
// 55 7/08/98 3:12p Aldie
|
||||
// First try at spectator mode
|
||||
//
|
||||
// 54 7/07/98 8:06p Aldie
|
||||
// Spectator and dead stuff
|
||||
//
|
||||
// 53 7/02/98 2:34p Aldie
|
||||
// Mission computer
|
||||
//
|
||||
// 52 6/24/98 1:39p Aldie
|
||||
// Implementation of inventory system and picking stuff up
|
||||
//
|
||||
// 51 6/22/98 2:04p Jimdose
|
||||
// Added vehicles back in
|
||||
// Organized the control code a bit more. May want to make physics into a
|
||||
// class
|
||||
//
|
||||
// 50 6/19/98 6:39p Aldie
|
||||
// More inventory stuff
|
||||
//
|
||||
// 49 6/18/98 9:26p Aldie
|
||||
// Started inventory system
|
||||
//
|
||||
// 48 6/15/98 10:48p Jimdose
|
||||
// Added AddPathNode
|
||||
//
|
||||
// 47 6/13/98 8:20p Jimdose
|
||||
// removed optimize path stuff
|
||||
//
|
||||
// 46 6/10/98 2:10p Aldie
|
||||
// Updated damage function.
|
||||
//
|
||||
// 45 6/03/98 4:39p Markd
|
||||
// removed parameters from SetCameraEntity stuff
|
||||
//
|
||||
// 44 5/27/98 7:03a Markd
|
||||
// added action_level
|
||||
//
|
||||
// 43 5/26/98 7:56p Jimdose
|
||||
// added scripted cameras
|
||||
//
|
||||
// 42 5/26/98 4:46p Aldie
|
||||
// Added take (object) from player
|
||||
//
|
||||
// 41 5/26/98 4:38a Jimdose
|
||||
// Added tracking crosshair
|
||||
//
|
||||
// 40 5/25/98 6:47p Jimdose
|
||||
// Made animateframe, prethink and posthink into functions built into the base
|
||||
// entity class
|
||||
//
|
||||
// 39 5/24/98 8:46p Jimdose
|
||||
// Made a lot of functions more str-friendly.
|
||||
// Got rid of a lot of char * based strings
|
||||
// Cleaned up get spawn arg functions and sound functions
|
||||
// sound functions now use consistant syntax
|
||||
//
|
||||
// 38 5/13/98 4:49p Jimdose
|
||||
// Now use SafePtrs for keeping track of nodes and cameras
|
||||
//
|
||||
// 37 5/05/98 2:41p Jimdose
|
||||
// New interface for controlling the clients view
|
||||
// moved a lot of variables from gclient_t to be internal to player
|
||||
//
|
||||
// 36 5/03/98 4:37p Jimdose
|
||||
// Added camera
|
||||
//
|
||||
// 35 5/01/98 6:16p Jimdose
|
||||
// Made Respawn an event so that Trigger_Hurt wouldn't rekill a player after
|
||||
// respawn
|
||||
//
|
||||
// 34 4/27/98 5:27p Jimdose
|
||||
// Working on ai
|
||||
//
|
||||
// 33 4/21/98 2:25p Aldie
|
||||
// Added enterconsole and exitconsole events.
|
||||
//
|
||||
// 32 4/20/98 2:45p Jimdose
|
||||
// working on ai
|
||||
//
|
||||
// 31 4/18/98 3:02p Jimdose
|
||||
// Removed nodebeam
|
||||
//
|
||||
// 30 4/16/98 2:10p Jimdose
|
||||
// Working on ai.
|
||||
// Removed TESTPATH stuff
|
||||
//
|
||||
// 29 4/09/98 8:44p Jimdose
|
||||
// Added view blend effects
|
||||
// added drowing
|
||||
//
|
||||
// 28 4/07/98 3:49p Aldie
|
||||
// Added zooming crosshair
|
||||
//
|
||||
// 27 4/06/98 7:10p Aldie
|
||||
// Added zooming for SniperRifle
|
||||
//
|
||||
// 26 4/05/98 2:58a Jimdose
|
||||
// added respawn_time
|
||||
//
|
||||
// 25 4/04/98 6:13p Jimdose
|
||||
// Added events for syncing firing to animation
|
||||
//
|
||||
// 24 4/02/98 4:46p Jimdose
|
||||
// Added Obituary, Pain, and ShowScores
|
||||
//
|
||||
// 23 3/31/98 1:44p Jimdose
|
||||
// Removed footstep stuff
|
||||
//
|
||||
// 22 3/29/98 9:42p Jimdose
|
||||
// Moved animation stuff to sentient
|
||||
//
|
||||
// 21 3/29/98 5:57p Jimdose
|
||||
// Added SpawnEntity command
|
||||
//
|
||||
// 20 3/28/98 4:36p Jimdose
|
||||
// Added kill event
|
||||
//
|
||||
// 19 3/27/98 9:59p Jimdose
|
||||
// Changed CalcRoll to return a float
|
||||
//
|
||||
// 18 3/27/98 6:36p Jimdose
|
||||
// Added third person view
|
||||
//
|
||||
// 17 3/26/98 8:16p Jimdose
|
||||
// Added animation control functions
|
||||
// Added respawn and init functions for deathmatch
|
||||
//
|
||||
// 16 3/23/98 1:33p Jimdose
|
||||
// Revamped event and command system
|
||||
//
|
||||
// 15 3/18/98 7:21p Jimdose
|
||||
// Added CalcGunOffset
|
||||
//
|
||||
// 14 3/03/98 6:03p Aldie
|
||||
// First pass at footsteps.
|
||||
//
|
||||
// 13 3/02/98 8:49p Jimdose
|
||||
// Changed CLASS_PROTOTYPE to only take the classname
|
||||
//
|
||||
// 12 2/21/98 1:22p Jimdose
|
||||
// Removed A LOT of unused varables and code.
|
||||
//
|
||||
// 11 2/19/98 2:36p Jimdose
|
||||
// Added weapons back in
|
||||
//
|
||||
// 10 2/17/98 8:35p Jimdose
|
||||
// Removed useHeld
|
||||
//
|
||||
// 9 2/06/98 5:44p Jimdose
|
||||
// replaced use of think and touch functions with events
|
||||
// move client to Entity
|
||||
//
|
||||
// 8 2/03/98 10:59a Jimdose
|
||||
// Updated to work with Quake 2 engine
|
||||
// Moved initialization to constructor and removed Init function
|
||||
// This will probably be rewritten to be simpler. This first rewrite sucks.
|
||||
//
|
||||
// 6 12/05/97 4:08p Aldie
|
||||
// Added event to player for giving weapons.
|
||||
//
|
||||
// 5 11/12/97 5:12p Jimdose
|
||||
// Added event definitions
|
||||
//
|
||||
// 4 10/27/97 2:59p Jimdose
|
||||
// Removed dependency on quakedef.h
|
||||
//
|
||||
// 3 10/08/97 6:03p Jimdose
|
||||
// Began vehicle support.
|
||||
//
|
||||
// 2 9/26/97 6:47p Jimdose
|
||||
// Added standard Ritual headers
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Class definition of the player.
|
||||
|
@ -52,7 +404,6 @@
|
|||
#include "camera.h"
|
||||
#include "vehicle.h"
|
||||
#include "specialfx.h"
|
||||
#include "grapple.h"
|
||||
|
||||
extern Event EV_Player_EndLevel;
|
||||
extern Event EV_Player_PrevWeapon;
|
||||
|
@ -76,7 +427,6 @@ extern Event EV_Player_HideStats;
|
|||
extern Event EV_Player_SetFlashColor;
|
||||
extern Event EV_Player_ClearFlashColor;
|
||||
extern Event EV_Player_Respawn;
|
||||
extern Event EV_Player_CTF_SoundEvent;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -99,7 +449,7 @@ typedef enum
|
|||
|
||||
class EXPORT_FROM_DLL Player : public Sentient
|
||||
{
|
||||
protected:
|
||||
private:
|
||||
pmove_state_t old_pmove; // for detecting out-of-pmove changes
|
||||
|
||||
// bobbing
|
||||
|
@ -151,6 +501,7 @@ class EXPORT_FROM_DLL Player : public Sentient
|
|||
viewmode_t viewmode;
|
||||
viewmode_t defaultViewMode;
|
||||
zoom_mode_t zoom_mode;
|
||||
float respawn_time;
|
||||
|
||||
qboolean firing;
|
||||
qboolean in_console;
|
||||
|
@ -190,11 +541,6 @@ class EXPORT_FROM_DLL Player : public Sentient
|
|||
qboolean hidestats;
|
||||
qboolean drawoverlay;
|
||||
|
||||
qboolean grapple_pull;
|
||||
Vector grapple_org;
|
||||
float grapple_speed;
|
||||
float grapple_time;
|
||||
|
||||
// music mood stuff
|
||||
float action_level;
|
||||
int music_current_mood;
|
||||
|
@ -224,16 +570,10 @@ class EXPORT_FROM_DLL Player : public Sentient
|
|||
float last_damage_time;
|
||||
qboolean music_forced;
|
||||
|
||||
// CTF
|
||||
HookPtr hook;
|
||||
BeamPtr beam;
|
||||
float spectator_distance;
|
||||
|
||||
public:
|
||||
|
||||
CLASS_PROTOTYPE( Player );
|
||||
|
||||
float respawn_time;
|
||||
qboolean trappedInQuantum;
|
||||
|
||||
Player();
|
||||
|
@ -320,8 +660,7 @@ class EXPORT_FROM_DLL Player : public Sentient
|
|||
virtual void AddBlend( float r, float g, float b, float a );
|
||||
virtual void CalcBlend( void );
|
||||
virtual void DamageFeedback( void );
|
||||
void SetGrapplePull( Vector dir, float speed );
|
||||
void ClearGrapplePull( void );
|
||||
|
||||
virtual void ChooseAnim( void );
|
||||
|
||||
virtual qboolean CanMoveTo( Vector pos );
|
||||
|
@ -366,7 +705,6 @@ class EXPORT_FROM_DLL Player : public Sentient
|
|||
virtual viewmode_t ViewMode( void );
|
||||
virtual Camera *CurrentCamera( void );
|
||||
virtual void SetCamera( Entity * ent );
|
||||
void GetPlayerView( Vector *pos, Vector *angle );
|
||||
|
||||
void WhatIs( Event *ev );
|
||||
void ActorInfo( Event *ev );
|
||||
|
@ -393,27 +731,6 @@ class EXPORT_FROM_DLL Player : public Sentient
|
|||
void RemoveEnt( Event *ev );
|
||||
void KillClass( Event *ev );
|
||||
void RemoveClass( Event *ev );
|
||||
|
||||
// CTF
|
||||
void InitCTF( void );
|
||||
void CTF_JoinTeamHardcorps( Event *ev );
|
||||
void CTF_JoinTeamSintek( Event *ev );
|
||||
void CTF_JoinTeam( int desired_team );
|
||||
void CTF_Team( Event *ev );
|
||||
void CTF_ExtendGrapple( void );
|
||||
void CTF_ReleaseGrapple( void );
|
||||
void CTF_DeadDropFlag( void );
|
||||
void CTF_UpdateHookBeam( Event *ev );
|
||||
Vector CTF_GetGrapplePosition( void );
|
||||
void CTF_AssignTeam( void );
|
||||
void CTF_OpenJoinMenu( void );
|
||||
void CTF_UpdateNumberOfPlayers( void );
|
||||
void CTF_DeadDropTech( void );
|
||||
void CTF_DropTech( Event *ev );
|
||||
void CTF_SoundEvent( Event *ev );
|
||||
void SetViewAngles( Vector ang );
|
||||
void DropWeaponEvent( Event *ev );
|
||||
void CTF_DropFlag( Event *ev );
|
||||
};
|
||||
|
||||
inline EXPORT_FROM_DLL void Player::Archive
|
||||
|
|
56
powerups.cpp
56
powerups.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/powerups.cpp $
|
||||
// $Revision:: 24 $
|
||||
// $Revision:: 23 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/24/99 4:30p $
|
||||
// $Date:: 11/13/98 2:36a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/powerups.cpp $
|
||||
//
|
||||
// 24 3/24/99 4:30p Aldie
|
||||
// tried to bullet proof certain crash bugs
|
||||
//
|
||||
// 23 11/13/98 2:36a Aldie
|
||||
// Added a fixdeadbodies for mutagen
|
||||
//
|
||||
|
@ -136,7 +133,6 @@ void Adrenaline::Powerdown
|
|||
{
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
@ -147,9 +143,6 @@ void Adrenaline::Powerdown
|
|||
owner->edict->s.color_g = 0;
|
||||
owner->edict->s.color_b = 0;
|
||||
owner->edict->s.radius = 0;
|
||||
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
|
||||
void Adrenaline::Use
|
||||
|
@ -161,12 +154,7 @@ void Adrenaline::Use
|
|||
str realname;
|
||||
Event *event;
|
||||
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
assert( owner );
|
||||
|
||||
if ( owner->PowerupActive() )
|
||||
{
|
||||
|
@ -230,7 +218,6 @@ void Cloak::Powerdown
|
|||
{
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
@ -249,7 +236,6 @@ void Cloak::Powerdown
|
|||
owner->edict->s.color_b = 0;
|
||||
owner->edict->s.radius = 0;
|
||||
}
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
|
||||
|
@ -262,12 +248,7 @@ void Cloak::Use
|
|||
str realname;
|
||||
Event *event;
|
||||
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
assert( owner );
|
||||
|
||||
if ( owner->PowerupActive() )
|
||||
{
|
||||
|
@ -334,7 +315,6 @@ void Mutagen::Powerdown
|
|||
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
@ -363,7 +343,6 @@ void Mutagen::Powerdown
|
|||
}
|
||||
|
||||
owner->takeWeapon( "MutantHands" );
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
|
||||
|
@ -377,12 +356,7 @@ void Mutagen::Use
|
|||
Event *event;
|
||||
Weapon *mutanthands;
|
||||
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
assert( owner );
|
||||
|
||||
if ( owner->PowerupActive() )
|
||||
{
|
||||
|
@ -483,7 +457,7 @@ void Medkit::Use
|
|||
str realname;
|
||||
|
||||
other = ev->GetEntity( 1 );
|
||||
if ( other && other->health < other->max_health )
|
||||
if ( other->health < other->max_health )
|
||||
{
|
||||
other->health = other->max_health;
|
||||
realname = GetRandomAlias( "snd_activate" );
|
||||
|
@ -522,7 +496,6 @@ void Oxygen::Powerdown
|
|||
{
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
@ -536,7 +509,6 @@ void Oxygen::Powerdown
|
|||
if ( realname.length() )
|
||||
owner->sound( realname, 1, CHAN_ITEM, ATTN_NORM );
|
||||
}
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
|
||||
|
@ -552,12 +524,10 @@ void Oxygen::Pickup
|
|||
|
||||
other = ev->GetEntity( 1 );
|
||||
|
||||
assert( other );
|
||||
|
||||
if ( !other )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
sen = ( Sentient * )other;
|
||||
|
||||
|
@ -589,11 +559,8 @@ void Oxygen::Pickup
|
|||
|
||||
item = sen->FindItem( getClassname() );
|
||||
if ( item )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
item->PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
void Oxygen::Use
|
||||
(
|
||||
|
@ -604,12 +571,7 @@ void Oxygen::Use
|
|||
str realname;
|
||||
Event *event;
|
||||
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
assert( owner );
|
||||
|
||||
// Single player must have the scuba gear to use oxygen
|
||||
if ( !deathmatch->value && !owner->FindItem( "ScubaGear" ) )
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/pulserifle.cpp $
|
||||
// $Revision:: 69 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:14p $
|
||||
// $Revision:: 68 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/16/98 3:11a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/pulserifle.cpp $
|
||||
//
|
||||
// 69 3/02/99 9:14p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 68 11/16/98 3:11a Jimdose
|
||||
// pulse now takes gravity of owner
|
||||
//
|
||||
|
@ -625,9 +622,6 @@ void PulseRifle::Shoot
|
|||
angles = dir.toAngles();
|
||||
setAngles( angles );
|
||||
|
||||
if ( ctf->value )
|
||||
damg = 30;
|
||||
else
|
||||
damg = 15;
|
||||
TraceAttack( pos, trace.endpos, damg, &trace, 0, 0, 0 );
|
||||
NextAttack( 0 );
|
||||
|
|
|
@ -106,6 +106,8 @@
|
|||
// DESCRIPTION:
|
||||
//
|
||||
|
||||
#define SIN
|
||||
|
||||
#include "q_shared.h"
|
||||
#include "float.h"
|
||||
|
||||
|
|
88
q_shared.h
88
q_shared.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/q_shared.h $
|
||||
// $Revision:: 195 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 8/03/99 7:09p $
|
||||
// $Revision:: 189 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 1/27/99 10:02p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,28 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/q_shared.h $
|
||||
//
|
||||
// 195 8/03/99 7:09p Jimdose
|
||||
// changes for Sin Arcade
|
||||
//
|
||||
// 194 7/24/99 6:47p Markd
|
||||
// Added talk feature and added speech code
|
||||
//
|
||||
// 193 7/24/99 5:45p Markd
|
||||
// Added new NO_WEAPON_CHANGE DM Flag
|
||||
//
|
||||
// 192 5/18/99 7:08p Aldie
|
||||
// remove useless ctf flag
|
||||
//
|
||||
// 191 3/19/99 4:14p Aldie
|
||||
// Moved MOD to client
|
||||
//
|
||||
// 190 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:39p Aldie
|
||||
//
|
||||
// 189 1/27/99 10:02p Markd
|
||||
// Merged 2015 source into main code base
|
||||
//
|
||||
|
@ -721,7 +699,6 @@ typedef enum {false, true} qboolean;
|
|||
#define PRINT_MEDIUM 1 // death messages
|
||||
#define PRINT_HIGH 2 // critical messages
|
||||
#define PRINT_CHAT 3 // chat messages
|
||||
#define PRINT_TALK 4 // speech synthesis messages
|
||||
|
||||
|
||||
|
||||
|
@ -1317,8 +1294,7 @@ typedef enum
|
|||
PM_FREEZE,
|
||||
PM_MOVECAPTURED, // using a movement capturer
|
||||
PM_ONBIKE, // added for hoverbike
|
||||
PM_ATTACHVIEW, // added for guided missile
|
||||
PM_GRAPPLE_PULL,
|
||||
PM_ATTACHVIEW // added for guided missile
|
||||
#else
|
||||
PM_FREEZE
|
||||
#endif
|
||||
|
@ -2020,11 +1996,6 @@ typedef enum
|
|||
#define STAT_CPCOUNT 14 // number of checkpoints left to touch this lap
|
||||
#define STAT_NIGHTVISION 15 // set when player is in night vision mode
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
#define STAT_FIRSTPLACE 16 // set if the player is in first place
|
||||
#define STAT_DRAWFIRSTPLACE 17 // set if the player is in first place and we should show the icon
|
||||
#endif
|
||||
|
||||
#define P_SHIELDS 1
|
||||
#define P_ADRENALINE 2
|
||||
#define P_CLOAK 3
|
||||
|
@ -2096,7 +2067,6 @@ typedef enum
|
|||
#define DF_INFINITE_AMMO (1<<14)
|
||||
#define DF_FIXED_FOV (1<<15)
|
||||
#define DF_NO_DROP_WEAPONS (1<<16)
|
||||
#define DF_NO_WEAPON_CHANGE (1<<17)
|
||||
|
||||
// 2015 code
|
||||
#define DF_BBOX_BULLETS (1<<17)
|
||||
|
@ -2291,56 +2261,6 @@ typedef struct entity_state_s
|
|||
|
||||
|
||||
#ifdef SIN
|
||||
// means of death flags
|
||||
|
||||
typedef enum {
|
||||
MOD_FISTS,
|
||||
MOD_MAGNUM,
|
||||
MOD_SHOTGUN,
|
||||
MOD_ASSRIFLE,
|
||||
MOD_CHAINGUN,
|
||||
MOD_GRENADE,
|
||||
MOD_ROCKET,
|
||||
MOD_ROCKETSPLASH,
|
||||
MOD_PULSE,
|
||||
MOD_PULSELASER,
|
||||
MOD_SPEARGUN,
|
||||
MOD_SNIPER,
|
||||
MOD_VEHICLE,
|
||||
MOD_CRUSH,
|
||||
MOD_SHOTROCKET,
|
||||
MOD_FALLING,
|
||||
MOD_DROWN,
|
||||
MOD_SUICIDE,
|
||||
MOD_EXPLODEWALL,
|
||||
MOD_ELECTRIC,
|
||||
MOD_TELEFRAG,
|
||||
MOD_GENBULLET,
|
||||
MOD_LASER,
|
||||
MOD_BETTYSPIKE,
|
||||
MOD_HELIGUN,
|
||||
MOD_DEBRIS,
|
||||
MOD_THROWNOBJECT,
|
||||
MOD_LAVA,
|
||||
MOD_SLIME,
|
||||
MOD_ADRENALINE,
|
||||
MOD_ION,
|
||||
MOD_ION_DESTRUCT,
|
||||
MOD_QUANTUM,
|
||||
MOD_BEAM,
|
||||
MOD_IMPACT,
|
||||
MOD_FRIENDLY_FIRE,
|
||||
MOD_SPIDERSPLASH,
|
||||
MOD_MUTANTHANDS,
|
||||
MOD_MUTANT_DRAIN,
|
||||
MOD_GRAPPLE,
|
||||
MOD_EMPATHY,
|
||||
MOD_THRALLBALL,
|
||||
MOD_THRALLSPLASH,
|
||||
MOD_DEATHQUAD,
|
||||
MOD_CTFTURRET
|
||||
} mod_type_t;
|
||||
|
||||
// CONSOLE3D State
|
||||
#define MAIN_CONSOLE "maincon"
|
||||
#define GENERIC_CONSOLE "gencon"
|
||||
|
|
33
quantumd.cpp
33
quantumd.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/quantumd.cpp $
|
||||
// $Revision:: 50 $
|
||||
// $Revision:: 46 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 5/18/99 7:07p $
|
||||
// $Date:: 11/18/98 8:28p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,18 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/quantumd.cpp $
|
||||
//
|
||||
// 50 5/18/99 7:07p Aldie
|
||||
// remove qd overload from ctf
|
||||
//
|
||||
// 49 3/29/99 6:21p Aldie
|
||||
// Fixed sin again - Jack
|
||||
//
|
||||
// 48 3/29/99 6:14p Aldie
|
||||
// Fixed by Jack. :-)
|
||||
//
|
||||
// 47 3/18/99 6:45p Aldie
|
||||
// Only damage people with overload that you can damage
|
||||
//
|
||||
// 46 11/18/98 8:28p Aldie
|
||||
// Added NOION check for quantum overload
|
||||
//
|
||||
|
@ -716,22 +704,8 @@ void QuantumDestabilizer::Destruct
|
|||
{
|
||||
Entity *ent;
|
||||
|
||||
if ( ctf->value )
|
||||
{
|
||||
Event *event;
|
||||
event = new Event( EV_Sentient_ReleaseAttack );
|
||||
event->AddFloat( level.time - owner->firedowntime );
|
||||
owner->ProcessEvent( event );
|
||||
owner->firedown = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CancelEventsOfType( EV_Quantum_EatAmmo );
|
||||
|
||||
if ( !owner )
|
||||
return;
|
||||
|
||||
CreateExplosion( owner->centroid, 200, 1.0f, true, this, owner, owner );
|
||||
|
||||
ent = findradius( NULL, owner->centroid, 512 );
|
||||
|
@ -739,11 +713,8 @@ void QuantumDestabilizer::Destruct
|
|||
{
|
||||
if ( ( ent != owner ) && ( !ent->deadflag ) && ( ent->takedamage ) && !(ent->flags & FL_NOION ) )
|
||||
{
|
||||
if ( owner->CanDamage( ent ) )
|
||||
ent->Damage( this, owner, 10000+ent->health, ent->worldorigin, vec_zero, vec_zero, 0, DAMAGE_NO_ARMOR|DAMAGE_NO_SKILL, MOD_ION, -1, -1, 1.0f );
|
||||
}
|
||||
if ( !owner )
|
||||
return;
|
||||
ent = findradius( ent, owner->centroid, 512 );
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/reactiveshields.cpp $
|
||||
// $Revision:: 12 $
|
||||
// $Revision:: 11 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/24/99 4:30p $
|
||||
// $Date:: 10/13/98 2:30p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/reactiveshields.cpp $
|
||||
//
|
||||
// 12 3/24/99 4:30p Aldie
|
||||
// tried to bullet proof certain crash bugs
|
||||
//
|
||||
// 11 10/13/98 2:30p Aldie
|
||||
// Check for owner
|
||||
//
|
||||
|
@ -91,13 +88,7 @@ void ReactiveShields::Use
|
|||
{
|
||||
Event *event;
|
||||
str realname;
|
||||
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
assert( owner );
|
||||
|
||||
if ( owner->PowerupActive() )
|
||||
{
|
||||
|
@ -139,7 +130,6 @@ void ReactiveShields::PowerDown
|
|||
{
|
||||
if ( !owner )
|
||||
{
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
return;
|
||||
}
|
||||
|
@ -158,7 +148,6 @@ void ReactiveShields::PowerDown
|
|||
owner->edict->s.color_b = 0;
|
||||
owner->edict->s.radius = 0;
|
||||
}
|
||||
CancelPendingEvents();
|
||||
PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/rocketlauncher.cpp $
|
||||
// $Revision:: 84 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:14p $
|
||||
// $Revision:: 83 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 11/15/98 12:22a $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,13 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/rocketlauncher.cpp $
|
||||
//
|
||||
// 84 3/02/99 9:14p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:39p Aldie
|
||||
//
|
||||
// 83 11/15/98 12:22a Markd
|
||||
// Fixed pre-caching issues
|
||||
//
|
||||
|
@ -284,8 +277,6 @@
|
|||
#include "specialfx.h"
|
||||
#include "misc.h"
|
||||
#include "surface.h"
|
||||
#include "thrall.h"
|
||||
#include "ctf.h"
|
||||
|
||||
#define ROCKET_SPEED 1000
|
||||
#define ROCKET_RADIUS 150 // FIXME: max damage (90 +rand(20)) + 40 == 150... hard coded. gotta pass this in
|
||||
|
@ -436,15 +427,6 @@ RocketLauncher::RocketLauncher()
|
|||
|
||||
SetMinRange( ROCKET_RADIUS );
|
||||
SetProjectileSpeed( ROCKET_SPEED );
|
||||
|
||||
if ( ctf->value )
|
||||
{
|
||||
// CTF rocketlauncher has alternate fire mode
|
||||
modelIndex( "sprites/thrallpulse.spr" );
|
||||
SetSecondaryAmmo( "Rockets", 10, 0);
|
||||
dualmode = true;
|
||||
alternate_fire = true;
|
||||
}
|
||||
}
|
||||
|
||||
void RocketLauncher::Shoot
|
||||
|
@ -454,7 +436,6 @@ void RocketLauncher::Shoot
|
|||
|
||||
{
|
||||
Rocket *rocket;
|
||||
ThrallPulse *pulse;
|
||||
Vector pos;
|
||||
Vector dir;
|
||||
|
||||
|
@ -466,17 +447,7 @@ void RocketLauncher::Shoot
|
|||
|
||||
GetMuzzlePosition( &pos, &dir );
|
||||
|
||||
if ( weaponmode == PRIMARY )
|
||||
{
|
||||
rocket = new Rocket;
|
||||
rocket->Setup( owner, pos, dir );
|
||||
NextAttack( 1.0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
pulse = new ThrallPulse;
|
||||
pulse->Setup( owner, pos, dir );
|
||||
NextAttack( 1.0 );
|
||||
SetPrimaryMode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/scriptmaster.cpp $
|
||||
// $Revision:: 158 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 10/28/99 10:43a $
|
||||
// $Revision:: 156 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 2/16/99 8:38p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,12 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/scriptmaster.cpp $
|
||||
//
|
||||
// 158 10/28/99 10:43a Markd
|
||||
// made a bunch of console commands cheat protected
|
||||
//
|
||||
// 157 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 156 2/16/99 8:38p Jimdose
|
||||
// moved sin arcade comm stuff to client
|
||||
//
|
||||
|
@ -594,10 +588,10 @@ Event EV_ScriptThread_FreezePlayer( "freezeplayer" );
|
|||
Event EV_ScriptThread_ReleasePlayer( "releaseplayer" );
|
||||
Event EV_ScriptThread_Menu( "menu" );
|
||||
Event EV_ScriptThread_MissionFailed( "missionfailed" );
|
||||
Event EV_ScriptThread_KillEnt( "killent", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_ScriptThread_KillClass( "killclass", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_ScriptThread_RemoveEnt( "removeent", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_ScriptThread_RemoveClass( "removeclass", EV_CONSOLE | EV_CHEAT );
|
||||
Event EV_ScriptThread_KillEnt( "killent", EV_CONSOLE );
|
||||
Event EV_ScriptThread_KillClass( "killclass", EV_CONSOLE );
|
||||
Event EV_ScriptThread_RemoveEnt( "removeent", EV_CONSOLE );
|
||||
Event EV_ScriptThread_RemoveClass( "removeclass", EV_CONSOLE );
|
||||
|
||||
// client/server flow control
|
||||
Event EV_ScriptThread_ServerOnly( "server" );
|
||||
|
@ -635,7 +629,6 @@ Event EV_ScriptThread_ScreenPrintFile( "screenprintfile" );
|
|||
Event EV_ScriptThread_ClearScreenPrintFile( "clearscreenprintfile" );
|
||||
Event EV_ScriptThread_MapName( "mapname" );
|
||||
Event EV_ScriptThread_EndGame( "endgame" );
|
||||
Event EV_ScriptThread_CameraCommand( "cam" );
|
||||
|
||||
// music command
|
||||
Event EV_ScriptThread_MusicEvent( "music" );
|
||||
|
@ -1358,7 +1351,6 @@ ResponseDef ScriptThread::Responses[] =
|
|||
{ &EV_AI_RecalcPaths, ( Response )ScriptThread::PassToPathmanager },
|
||||
{ &EV_AI_CalcPath, ( Response )ScriptThread::PassToPathmanager },
|
||||
{ &EV_AI_DisconnectPath, ( Response )ScriptThread::PassToPathmanager },
|
||||
{ &EV_ScriptThread_CameraCommand, ( Response )ScriptThread::CameraCommand },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -3874,42 +3866,3 @@ void ScriptThread::EndGame
|
|||
gi.multicast( NULL, MULTICAST_ALL );
|
||||
#endif
|
||||
}
|
||||
|
||||
void ScriptThread::CameraCommand
|
||||
(
|
||||
Event * ev
|
||||
)
|
||||
|
||||
{
|
||||
Event *e;
|
||||
const char *cmd;
|
||||
int i;
|
||||
int n;
|
||||
|
||||
if ( !ev->NumArgs() )
|
||||
{
|
||||
ev->Error( "Usage: cam [command] [arg 1]...[arg n]" );
|
||||
return;
|
||||
}
|
||||
|
||||
cmd = ev->GetString( 1 );
|
||||
if ( Event::Exists( cmd ) )
|
||||
{
|
||||
e = new Event( cmd );
|
||||
e->SetSource( EV_FROM_SCRIPT );
|
||||
e->SetThread( this );
|
||||
e->SetLineNumber( linenumber );
|
||||
|
||||
n = ev->NumArgs();
|
||||
for( i = 2; i <= n; i++ )
|
||||
{
|
||||
e->AddToken( ev->GetToken( i ) );
|
||||
}
|
||||
|
||||
CameraMan.ProcessEvent( e );
|
||||
}
|
||||
else
|
||||
{
|
||||
ev->Error( "Unknown camera command '%s'.\n", cmd );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/scriptmaster.h $
|
||||
// $Revision:: 89 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 5/19/99 11:30a $
|
||||
// $Revision:: 88 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 12/16/98 12:42a $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/scriptmaster.h $
|
||||
//
|
||||
// 89 5/19/99 11:30a Markd
|
||||
// Added new camera support
|
||||
//
|
||||
// 88 12/16/98 12:42a Aldie
|
||||
// Added endgame command for Sin Arcade
|
||||
//
|
||||
|
@ -476,7 +473,6 @@ class EXPORT_FROM_DLL ScriptThread : public Listener
|
|||
void RemoveClass( Event *ev );
|
||||
void MapName( Event *ev );
|
||||
void EndGame( Event *ev );
|
||||
void CameraCommand( Event *ev );
|
||||
|
||||
public:
|
||||
CLASS_PROTOTYPE( ScriptThread );
|
||||
|
|
164
sentient.cpp
164
sentient.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/sentient.cpp $
|
||||
// $Revision:: 198 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 4/16/99 5:00p $
|
||||
// $Revision:: 189 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/17/98 6:56p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,38 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/sentient.cpp $
|
||||
//
|
||||
// 198 4/16/99 5:00p Aldie
|
||||
// Added higher rocket jump
|
||||
//
|
||||
// 197 3/26/99 6:26p Aldie
|
||||
// Fixed more CTF bugs, probably the last ones
|
||||
//
|
||||
// 196 3/18/99 6:45p Aldie
|
||||
// Empath shield damage is posted 0 time not FRAMETIME
|
||||
//
|
||||
// 195 3/17/99 4:00p Aldie
|
||||
// CTF Update
|
||||
//
|
||||
// 194 3/12/99 10:19p Aldie
|
||||
// Added MOD_DEATHQUAD
|
||||
//
|
||||
// 193 3/12/99 8:13p Aldie
|
||||
// Moved damage code around
|
||||
//
|
||||
// 192 3/11/99 8:49p Markd
|
||||
// Fixed minor weapon bugs with setting new weapon and new weapon being null
|
||||
// already.
|
||||
//
|
||||
// 191 3/11/99 3:47p Aldie
|
||||
// Added some damage changes
|
||||
//
|
||||
// 190 3/02/99 9:15p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:39p Aldie
|
||||
//
|
||||
// 189 11/17/98 6:56p Jimdose
|
||||
// made EventGiveHealth clear the damage skin on the player
|
||||
//
|
||||
|
@ -650,7 +618,6 @@
|
|||
#include "inventoryitem.h"
|
||||
#include "player.h"
|
||||
#include "actor.h"
|
||||
#include "ctf.h"
|
||||
|
||||
CLASS_DECLARATION( Entity, Sentient, NULL );
|
||||
|
||||
|
@ -1022,29 +989,6 @@ Item *Sentient::FindItem
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Item *Sentient::HasItemOfSuperclass
|
||||
(
|
||||
const char *superclassname
|
||||
)
|
||||
|
||||
{
|
||||
int num;
|
||||
int i;
|
||||
Item *item;
|
||||
|
||||
num = inventory.NumObjects();
|
||||
for( i = 1; i <= num; i++ )
|
||||
{
|
||||
item = ( Item * )G_GetEntity( inventory.ObjectAt( i ) );
|
||||
if ( !Q_stricmp( item->getSuperclass(), superclassname ) )
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Sentient::FreeInventory
|
||||
(
|
||||
void
|
||||
|
@ -1510,12 +1454,12 @@ void Sentient::DropWeapon
|
|||
{
|
||||
// can't drop it, probably because there's no worldmodel
|
||||
// since we're dead, just delete the weapon.
|
||||
weapon->PostEvent( EV_Remove, 0 );
|
||||
delete weapon;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon->PostEvent( EV_Remove, 0 );
|
||||
delete weapon;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1544,11 +1488,6 @@ void Sentient::takeWeapon
|
|||
return;
|
||||
}
|
||||
|
||||
if ( weapon == newWeapon )
|
||||
{
|
||||
newWeapon = NULL;
|
||||
}
|
||||
|
||||
if ( weapon == currentWeapon )
|
||||
{
|
||||
SetCurrentWeapon( BestWeapon( weapon ) );
|
||||
|
@ -1904,22 +1843,9 @@ void Sentient::WeaponPutAway
|
|||
Event *ev
|
||||
)
|
||||
|
||||
{
|
||||
Weapon *best;
|
||||
|
||||
if ( newWeapon )
|
||||
{
|
||||
SetCurrentWeapon( newWeapon );
|
||||
}
|
||||
else
|
||||
{
|
||||
best = BestWeapon();
|
||||
if ( best )
|
||||
{
|
||||
SetCurrentWeapon( best );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Sentient::WeaponReady
|
||||
(
|
||||
|
@ -2095,11 +2021,9 @@ qboolean Sentient::DoGib
|
|||
( meansofdeath == MOD_TELEFRAG ) ||
|
||||
( meansofdeath == MOD_MUTANTHANDS ) ||
|
||||
( meansofdeath == MOD_HELIGUN ) ||
|
||||
( meansofdeath == MOD_CTFTURRET ) ||
|
||||
( meansofdeath == MOD_LAVA ) ||
|
||||
( meansofdeath == MOD_SNIPER ) ||
|
||||
( ( meansofdeath == MOD_FISTS ) && ( inflictor->flags & FL_ADRENALINE ) ) ||
|
||||
( ( meansofdeath == MOD_SHOTGUN ) && ( G_Random() < 0.5 ) )
|
||||
( ( meansofdeath == MOD_SHOTGUN ) && ( G_Random() < 0.3 ) )
|
||||
)
|
||||
{
|
||||
return true;
|
||||
|
@ -2194,10 +2118,6 @@ void Sentient::ArmorDamage
|
|||
trinum = ev->GetInteger( 11 );
|
||||
damage_mult = ev->GetFloat ( 12 );
|
||||
|
||||
// Make sure attacker is there
|
||||
if ( !attacker )
|
||||
return;
|
||||
|
||||
// Forcefields make objects invulnerable
|
||||
if ( flags & FL_FORCEFIELD )
|
||||
{
|
||||
|
@ -2239,12 +2159,12 @@ void Sentient::ArmorDamage
|
|||
|
||||
// if enabled you can't hurt teammates (but you can hurt yourself)
|
||||
// knockback still occurs
|
||||
if ( ( attacker != this ) && ( DM_FLAG( DF_MODELTEAMS | DF_SKINTEAMS ) || ctf->value ) )
|
||||
if ( ( attacker != this ) && ( DM_FLAG( DF_MODELTEAMS | DF_SKINTEAMS ) ) )
|
||||
{
|
||||
if ( OnSameTeam ( this, attacker ) )
|
||||
{
|
||||
// check for friendly fire
|
||||
if ( DM_FLAG( DF_FRIENDLY_FIRE ) || ( dflags & DAMAGE_NO_PROTECTION ) )
|
||||
if ( DM_FLAG( DF_FRIENDLY_FIRE ) )
|
||||
meansofdeath = MOD_FRIENDLY_FIRE;
|
||||
else
|
||||
damage = 0;
|
||||
|
@ -2365,67 +2285,6 @@ void Sentient::ArmorDamage
|
|||
// Damage multiplier
|
||||
damage *= damage_mult;
|
||||
|
||||
if ( ctf->value )
|
||||
{
|
||||
// Check to see if the attacker had double
|
||||
if ( attacker->isClient() )
|
||||
{
|
||||
Player *pl_attacker;
|
||||
|
||||
pl_attacker = ( Player * )( Sentient * )attacker;
|
||||
if ( pl_attacker->HasItem( "CTF_Tech_Double" ) ) // DOUBLE
|
||||
damage *= 2;
|
||||
else if ( pl_attacker->HasItem( "CTF_Tech_DeathQuad" ) ) // QUAD
|
||||
damage *= 4;
|
||||
}
|
||||
|
||||
// Check to see if the client has the shield or empathy
|
||||
if ( this->isClient() )
|
||||
{
|
||||
Player *pl_defender;
|
||||
Event *ctfev;
|
||||
|
||||
pl_defender = ( Player * )this;
|
||||
|
||||
if ( pl_defender->HasItem( "CTF_Tech_Half" ) && !( dflags & DAMAGE_NO_ARMOR ) )
|
||||
{
|
||||
damage *= 0.3f;
|
||||
|
||||
ctfev = new Event( EV_Player_CTF_SoundEvent );
|
||||
ctfev->AddInteger( DAMAGE );
|
||||
pl_defender->ProcessEvent( ctfev );
|
||||
}
|
||||
else if ( pl_defender->HasItem( "CTF_Tech_Empathy" ) ) // EMPATHY
|
||||
{
|
||||
ctfev = new Event( EV_Player_CTF_SoundEvent );
|
||||
ctfev->AddInteger( DAMAGE );
|
||||
pl_defender->ProcessEvent( ctfev );
|
||||
|
||||
// Send the damage back to the attacker if it is a client
|
||||
if ( ( attacker != this ) && attacker->isClient() )
|
||||
{
|
||||
Event *ev2;
|
||||
|
||||
ev2 = new Event( EV_Damage );
|
||||
ev2->AddInteger( damage );
|
||||
ev2->AddEntity ( this );
|
||||
ev2->AddEntity ( this );
|
||||
ev2->AddVector ( vec_zero );
|
||||
ev2->AddVector ( vec_zero );
|
||||
ev2->AddVector ( vec_zero );
|
||||
ev2->AddInteger( 0 );
|
||||
ev2->AddInteger( DAMAGE_NO_ARMOR );
|
||||
ev2->AddInteger( MOD_EMPATHY );
|
||||
ev2->AddInteger( -1 );
|
||||
ev2->AddInteger( -1 );
|
||||
ev2->AddFloat ( 1 );
|
||||
attacker->PostEvent( ev2, 0 );
|
||||
//attacker->Damage( this, this, damage, vec_zero, vec_zero, vec_zero, 0, DAMAGE_NO_ARMOR, MOD_EMPATHY, -1, -1, 1.0f );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Damage skins if armor didn't absorb all damage
|
||||
if ( ( damage > 0 ) && ( groupnum != -1 ) && ( flags & FL_BLOOD ) )
|
||||
if ( !edict->s.groups[ groupnum ] )
|
||||
|
@ -2543,7 +2402,7 @@ void Sentient::ArmorDamage
|
|||
|
||||
direction.normalize();
|
||||
if ( isClient() && ( attacker == this ) && deathmatch->value )
|
||||
momentum = direction * ( 2100.0f * ( float )knockback / m ); // the rocket jump hack...
|
||||
momentum = direction * ( 1700.0f * ( float )knockback / m ); // the rocket jump hack...
|
||||
else
|
||||
momentum = direction * ( 500.0f * ( float )knockback / m );
|
||||
|
||||
|
@ -2566,9 +2425,6 @@ void Sentient::ArmorDamage
|
|||
// do the damage
|
||||
health -= damage;
|
||||
|
||||
if ( ctf->value )
|
||||
CTF_CheckHurtCarrier( this, attacker );
|
||||
|
||||
// He's dead jim, send out a bunch of events
|
||||
if ( health <= 0 )
|
||||
{
|
||||
|
@ -2651,7 +2507,7 @@ void Sentient::ArmorDamage
|
|||
}
|
||||
}
|
||||
|
||||
if ( ( meansofdeath == MOD_MUTANT_DRAIN ) || ( meansofdeath == MOD_DEATHQUAD ) )
|
||||
if ( meansofdeath == MOD_MUTANT_DRAIN )
|
||||
return;
|
||||
|
||||
// Send pain event
|
||||
|
|
17
sentient.h
17
sentient.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/sentient.h $
|
||||
// $Revision:: 71 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:16p $
|
||||
// $Revision:: 70 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 11/16/98 8:59p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,13 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/sentient.h $
|
||||
//
|
||||
// 71 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:39p Aldie
|
||||
//
|
||||
// 70 11/16/98 8:59p Markd
|
||||
// Added TakeItem event to header
|
||||
//
|
||||
|
@ -315,7 +308,6 @@ class EXPORT_FROM_DLL Sentient : public Entity
|
|||
// Weapon charging stuff
|
||||
float firedowntime;
|
||||
qboolean firedown;
|
||||
qboolean usedown;
|
||||
|
||||
str saveskin;
|
||||
str savemodel;
|
||||
|
@ -381,9 +373,6 @@ class EXPORT_FROM_DLL Sentient : public Entity
|
|||
virtual qboolean DoGib( int meansofdeath, Entity *inflictor );
|
||||
virtual void SetDropWeapon( Event *ev );
|
||||
virtual void DropWeaponNowEvent( Event *ev );
|
||||
|
||||
// CTF
|
||||
virtual Item *HasItemOfSuperclass( const char *superclassname );
|
||||
};
|
||||
|
||||
inline EXPORT_FROM_DLL void Sentient::setModel
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/sniperrifle.cpp $
|
||||
// $Revision:: 28 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 3/12/99 8:15p $
|
||||
// $Revision:: 26 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 11/13/98 3:30p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,16 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/sniperrifle.cpp $
|
||||
//
|
||||
// 28 3/12/99 8:15p Jimdose
|
||||
// made weapons fire 1/10th of a second sooner on clients
|
||||
//
|
||||
// 27 3/02/99 9:15p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:39p Aldie
|
||||
//
|
||||
// 26 11/13/98 3:30p Markd
|
||||
// put in more precaching on weapons
|
||||
//
|
||||
|
@ -133,18 +123,6 @@ SniperRifle::SniperRifle()
|
|||
SetType( WEAPON_2HANDED_HI );
|
||||
}
|
||||
|
||||
// CTF - Fire upon release of the weapon
|
||||
void SniperRifle::ReleaseFire
|
||||
(
|
||||
float holdfiretime
|
||||
)
|
||||
|
||||
{
|
||||
StopAnimating();
|
||||
RandomAnimate( "releasefire", EV_Weapon_DoneFiring );
|
||||
last_animation_time = ( level.framenum + 1 ) * FRAMETIME;
|
||||
}
|
||||
|
||||
void SniperRifle::Shoot
|
||||
(
|
||||
Event *ev
|
||||
|
@ -157,19 +135,10 @@ void SniperRifle::Shoot
|
|||
return;
|
||||
}
|
||||
|
||||
if ( ctf->value )
|
||||
{
|
||||
// CTF - kill the target
|
||||
FireBullets( 1, vec_zero, 10000, 10000, DAMAGE_BULLET|DAMAGE_NO_ARMOR, MOD_SNIPER, false );
|
||||
}
|
||||
else if ( deathmatch->value )
|
||||
{
|
||||
if ( deathmatch->value )
|
||||
FireBullets( 1, vec_zero, 105, 135, DAMAGE_BULLET|DAMAGE_NO_ARMOR, MOD_SNIPER, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
FireBullets( 1, vec_zero, 105, 135, DAMAGE_BULLET, MOD_SNIPER, false );
|
||||
}
|
||||
|
||||
NextAttack( 1.5 );
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/sniperrifle.h $
|
||||
// $Revision:: 11 $
|
||||
// $Revision:: 10 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:16p $
|
||||
// $Date:: 10/05/98 10:42p $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,13 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/sniperrifle.h $
|
||||
//
|
||||
// 11 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:39p Aldie
|
||||
//
|
||||
// 10 10/05/98 10:42p Aldie
|
||||
// Converted over to new silencer methods
|
||||
//
|
||||
|
@ -70,7 +63,6 @@ class EXPORT_FROM_DLL SniperRifle : public BulletWeapon
|
|||
virtual void SecondaryUse(Event *ev);
|
||||
virtual void DoneLowering(Event *ev);
|
||||
virtual qboolean AutoChange( void );
|
||||
virtual void ReleaseFire( float time );
|
||||
};
|
||||
|
||||
#endif /* sniperrifle.h */
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/spidermine.cpp $
|
||||
// $Revision:: 50 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 6/07/99 2:29p $
|
||||
// $Revision:: 49 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 11/18/98 1:27a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/spidermine.cpp $
|
||||
//
|
||||
// 50 6/07/99 2:29p Markd
|
||||
// fixed null pointer bug
|
||||
//
|
||||
// 49 11/18/98 1:27a Jimdose
|
||||
// Fixed sliding and orientation issues with gravaxis
|
||||
//
|
||||
|
@ -727,11 +724,6 @@ void Detonator::CycleCamera
|
|||
currentMine++;
|
||||
|
||||
mine = mineList.ObjectAt( ( currentMine % numMines ) + 1 );
|
||||
if ( !mine )
|
||||
{
|
||||
mineList.RemoveObjectAt( ( currentMine % numMines ) + 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
client = ( Player * )( Entity * ) owner;
|
||||
if ( client->edict->areanum == mine->edict->areanum )
|
||||
|
|
62
thrall.cpp
62
thrall.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/thrall.cpp $
|
||||
// $Revision:: 18 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 8/03/99 7:09p $
|
||||
// $Revision:: 12 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 11/09/98 12:58a $
|
||||
//
|
||||
// Copyright (C) 1998 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,24 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/thrall.cpp $
|
||||
//
|
||||
// 18 8/03/99 7:09p Jimdose
|
||||
// changes for Sin Arcade
|
||||
//
|
||||
// 17 3/19/99 7:44p Aldie
|
||||
// Put thrallball back
|
||||
//
|
||||
// 16 3/16/99 11:51a Aldie
|
||||
// Fix for ctf network bandwidth
|
||||
//
|
||||
// 15 3/11/99 3:47p Aldie
|
||||
// Added meansofdeath
|
||||
//
|
||||
// 14 3/05/99 5:48p Aldie
|
||||
// Added MOD_THRALLBALL
|
||||
//
|
||||
// 13 3/02/99 9:15p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 12 11/09/98 12:58a Aldie
|
||||
// Parentmode for death sequence
|
||||
//
|
||||
|
@ -364,17 +346,6 @@ void ThrallMaster::GibFest
|
|||
Vector pos;
|
||||
Gib *gib1, *gib2;
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
//HACK to make game over only be sent once.
|
||||
if ( max_health != 0 )
|
||||
{
|
||||
max_health = 0;
|
||||
gi.WriteByte( svc_stufftext );
|
||||
gi.WriteString( "gameover" );
|
||||
gi.multicast( NULL, MULTICAST_ALL );
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( sv_gibs->value && !parentmode->value )
|
||||
{
|
||||
GetBone( "chest", &pos, NULL, NULL, NULL );
|
||||
|
@ -539,7 +510,7 @@ EXPORT_FROM_DLL void DrunkMissile::Explode
|
|||
|
||||
damg = 40 + ( int )G_Random( 20 );
|
||||
|
||||
other->Damage( this, owner, damg, worldorigin, velocity, level.impact_trace.plane.normal, 200, 0, MOD_ROCKETSPLASH, -1, -1, 1.0f );
|
||||
other->Damage( this, owner, damg, worldorigin, velocity, level.impact_trace.plane.normal, 200, 0, MOD_ROCKET, -1, -1, 1.0f );
|
||||
|
||||
SpawnBlastDamage( &level.impact_trace, damg, owner );
|
||||
|
||||
|
@ -853,12 +824,9 @@ EXPORT_FROM_DLL void ThrallPulse::Explode
|
|||
return;
|
||||
}
|
||||
|
||||
if ( ctf->value )
|
||||
damg = 150;
|
||||
else
|
||||
damg = 160 + ( int )G_Random( 50 );
|
||||
|
||||
other->Damage( this, owner, damg, worldorigin, velocity, level.impact_trace.plane.normal, 320, 0, MOD_THRALLBALL, -1, -1, 1.0f );
|
||||
other->Damage( this, owner, damg, worldorigin, velocity, level.impact_trace.plane.normal, 320, 0, MOD_ROCKET, -1, -1, 1.0f );
|
||||
|
||||
SpawnBlastDamage( &level.impact_trace, damg, owner );
|
||||
|
||||
|
@ -868,33 +836,16 @@ EXPORT_FROM_DLL void ThrallPulse::Explode
|
|||
// don't do radius damage to the other, because all the damage
|
||||
// was done in the impact
|
||||
v = worldorigin - v * 36;
|
||||
CreateExplosion( v, damg, 0.7f, true, this, owner, other, MOD_THRALLSPLASH );
|
||||
CreateExplosion( v, damg, 0.7f, true, this, owner, other );
|
||||
PostEvent( EV_Remove, 0.1 );
|
||||
FlashPlayers( v, 1, 1, 1, 0.5, 768 );
|
||||
|
||||
#if 0
|
||||
if ( ctf->value )
|
||||
{
|
||||
Entity *stuff;
|
||||
|
||||
stuff = new Entity;
|
||||
stuff->setModel( "ctfpulse.def" );
|
||||
stuff->setOrigin( origin );
|
||||
stuff->showModel();
|
||||
stuff->worldorigin.copyTo( stuff->edict->s.old_origin );
|
||||
stuff->RandomAnimate( "explode", NULL );
|
||||
stuff->PostEvent( EV_Remove, FRAMETIME*2 );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
for( i = 1; i < 4; i++ )
|
||||
{
|
||||
debris = new ThrallPulseDebris;
|
||||
debris->Setup( owner, v, i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT_FROM_DLL void ThrallPulse::Setup
|
||||
(
|
||||
|
@ -925,7 +876,6 @@ EXPORT_FROM_DLL void ThrallPulse::Setup
|
|||
velocity = Vector( orientation[ 0 ] ) * 1400.0f;
|
||||
|
||||
setModel( "sprites/thrallpulse.spr" );
|
||||
|
||||
setSize( "-8 -8 -8", "8 8 8" );
|
||||
takedamage = DAMAGE_NO;
|
||||
setOrigin( pos );
|
||||
|
|
10
trigger.h
10
trigger.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/trigger.h $
|
||||
// $Revision:: 47 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/02/99 9:16p $
|
||||
// $Revision:: 46 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 12/10/98 1:45p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,9 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/trigger.h $
|
||||
//
|
||||
// 47 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 46 12/10/98 1:45p Jimdose
|
||||
// added TriggerBox
|
||||
//
|
||||
|
@ -212,7 +209,6 @@ class EXPORT_FROM_DLL Trigger : public Entity
|
|||
void EventSetKey( Event *ev );
|
||||
|
||||
void EventSetMessage( Event *ev );
|
||||
void SetTriggerTime( float t ){ trigger_time = t; }
|
||||
void SetMessage( const char *message );
|
||||
str &Message( void );
|
||||
|
||||
|
|
108
vehicle.cpp
108
vehicle.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/vehicle.cpp $
|
||||
// $Revision:: 56 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 3/17/99 4:00p $
|
||||
// $Revision:: 51 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 2/19/99 7:49p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,21 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/vehicle.cpp $
|
||||
//
|
||||
// 56 3/17/99 4:00p Aldie
|
||||
// CTF Update
|
||||
//
|
||||
// 55 3/11/99 9:24p Markd
|
||||
// don't let alternate gravaxis people enter vehicle
|
||||
//
|
||||
// 54 3/05/99 6:36p Markd
|
||||
// Fixed Tire issues
|
||||
//
|
||||
// 53 3/05/99 5:51p Markd
|
||||
// made vehicles respawn in CTF, fixed up turrets a bit more
|
||||
//
|
||||
// 52 2/26/99 5:53p Markd
|
||||
// fixed some stuff for turrets
|
||||
//
|
||||
// 51 2/19/99 7:49p Markd
|
||||
// implemented turret for CTF
|
||||
//
|
||||
|
@ -191,7 +176,6 @@
|
|||
#include "explosion.h"
|
||||
#include "earthquake.h"
|
||||
#include "gibs.h"
|
||||
#include "item.h"
|
||||
|
||||
Event EV_Vehicle_Start( "start" );
|
||||
Event EV_Vehicle_Enter( "enter" );
|
||||
|
@ -309,7 +293,7 @@ Vehicle::Vehicle()
|
|||
health = G_GetFloatArg( "health", 1000 );
|
||||
speed = G_GetFloatArg( "speed", 600 );
|
||||
maxturnrate = G_GetFloatArg( "maxturnrate", 40.0f );
|
||||
PostEvent( EV_Vehicle_Start, 0.2f );
|
||||
PostEvent( EV_Vehicle_Start, 0 );
|
||||
}
|
||||
|
||||
void Vehicle::VehicleStart
|
||||
|
@ -405,7 +389,6 @@ void Vehicle::VehicleStart
|
|||
}
|
||||
last_origin = worldorigin;
|
||||
setSize( drivemins, drivemaxs );
|
||||
startorigin = worldorigin;
|
||||
}
|
||||
|
||||
void Vehicle::Drivable
|
||||
|
@ -668,11 +651,6 @@ void Vehicle::DriverUse
|
|||
return;
|
||||
}
|
||||
|
||||
if ( other->gravaxis != gravaxis )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sent = ( Sentient * )other;
|
||||
if ( driver )
|
||||
{
|
||||
|
@ -720,15 +698,6 @@ void Vehicle::DriverUse
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we are in CTF choose a place by default
|
||||
if ( ctf->value )
|
||||
{
|
||||
pos = worldorigin;
|
||||
pos[ 2 ] += 192;
|
||||
driver->setOrigin( pos );
|
||||
goto foundpos;
|
||||
}
|
||||
return;
|
||||
|
||||
foundpos:
|
||||
|
@ -806,6 +775,8 @@ qboolean Vehicle::Drive
|
|||
)
|
||||
|
||||
{
|
||||
Vector i, j, k;
|
||||
|
||||
if ( !driver || !driver->isClient() )
|
||||
{
|
||||
return false;
|
||||
|
@ -828,14 +799,8 @@ qboolean Vehicle::Drive
|
|||
if ( ( jumpimpulse < 0 ) || ( !jumpable ) )
|
||||
jumpimpulse = 0;
|
||||
|
||||
buttons = ucmd->buttons;
|
||||
|
||||
turnimpulse += 2*angledist( SHORT2ANGLE( ucmd->angles[ 1 ] ) - driver->client->resp.cmd_angles[ 1 ] );
|
||||
|
||||
cmd_angles.x = 2*angledist( SHORT2ANGLE( ucmd->angles[ 0 ] ) - driver->client->resp.cmd_angles[ 0 ] );
|
||||
cmd_angles.y = 2*angledist( SHORT2ANGLE( ucmd->angles[ 1 ] ) - driver->client->resp.cmd_angles[ 1 ] );
|
||||
cmd_angles.z = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1163,7 +1128,7 @@ float Vehicle::SetDriverPitch
|
|||
float pitch
|
||||
)
|
||||
{
|
||||
return pitch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1173,7 +1138,6 @@ ResponseDef DrivableVehicle::Responses[] =
|
|||
{
|
||||
{ &EV_Damage, ( Response )Entity::DamageEvent },
|
||||
{ &EV_Killed, ( Response )DrivableVehicle::Killed },
|
||||
{ &EV_Item_Respawn, ( Response )DrivableVehicle::Respawn },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -1181,8 +1145,6 @@ DrivableVehicle::DrivableVehicle()
|
|||
{
|
||||
drivable = true;
|
||||
flags |= FL_SPARKS|FL_DIE_TESSELATE|FL_DIE_EXPLODE|FL_DARKEN;
|
||||
if ( ctf->value )
|
||||
respawntime = G_GetFloatArg( "respawntime", 60 );
|
||||
}
|
||||
|
||||
void DrivableVehicle::Killed(Event *ev)
|
||||
|
@ -1240,7 +1202,7 @@ void DrivableVehicle::Killed(Event *ev)
|
|||
|
||||
if (flags & FL_DIE_EXPLODE)
|
||||
{
|
||||
CreateExplosion( centroid, 150*edict->s.scale, edict->s.scale * 2, true, this, this, this );
|
||||
CreateExplosion( worldorigin, 150*edict->s.scale, edict->s.scale * 2, true, this, this, this );
|
||||
}
|
||||
|
||||
if (flags & FL_DIE_GIBS)
|
||||
|
@ -1253,25 +1215,12 @@ void DrivableVehicle::Killed(Event *ev)
|
|||
//
|
||||
// kill all my wheels
|
||||
//
|
||||
if ( ctf->value )
|
||||
{
|
||||
last = this;
|
||||
while( last->vlink )
|
||||
{
|
||||
last->vlink->hideModel();
|
||||
last = last->vlink;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
last = this;
|
||||
while( last->vlink )
|
||||
{
|
||||
last->vlink->PostEvent( EV_Remove, 0 );
|
||||
last = last->vlink;
|
||||
}
|
||||
vlink = NULL;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
@ -1319,46 +1268,5 @@ void DrivableVehicle::Killed(Event *ev)
|
|||
while ( 1 );
|
||||
}
|
||||
|
||||
if ( ctf->value )
|
||||
{
|
||||
hideModel();
|
||||
// cancel events of type remove
|
||||
CancelEventsOfType( EV_Remove );
|
||||
PostEvent( EV_Item_Respawn, respawntime );
|
||||
}
|
||||
else
|
||||
{
|
||||
PostEvent( EV_Remove, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
void DrivableVehicle::Respawn
|
||||
(
|
||||
Event *ev
|
||||
)
|
||||
{
|
||||
VehicleBase *last;
|
||||
|
||||
health = max_health;
|
||||
edict->s.lightofs = 0;
|
||||
|
||||
showModel();
|
||||
|
||||
last = this;
|
||||
while( last->vlink )
|
||||
{
|
||||
last->vlink->showModel();
|
||||
last = last->vlink;
|
||||
}
|
||||
|
||||
// allow it to be touched again
|
||||
setSolidType( SOLID_BBOX );
|
||||
takedamage = DAMAGE_YES;
|
||||
|
||||
// play respawn sound
|
||||
RandomGlobalSound( "snd_itemspawn" );
|
||||
|
||||
setOrigin( startorigin );
|
||||
KillBox( this );
|
||||
Postthink();
|
||||
};
|
||||
|
|
17
vehicle.h
17
vehicle.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/vehicle.h $
|
||||
// $Revision:: 31 $
|
||||
// $Revision:: 29 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 3/05/99 5:51p $
|
||||
// $Date:: 2/19/99 7:49p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,12 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/vehicle.h $
|
||||
//
|
||||
// 31 3/05/99 5:51p Markd
|
||||
// made vehicles respawn in CTF, fixed up turrets a bit more
|
||||
//
|
||||
// 30 2/26/99 5:54p Markd
|
||||
// Fixed some stuff for turrets
|
||||
//
|
||||
// 29 2/19/99 7:49p Markd
|
||||
// implemented turret for CTF
|
||||
//
|
||||
|
@ -191,8 +185,6 @@ class EXPORT_FROM_DLL Vehicle : public VehicleBase
|
|||
float speed;
|
||||
float conesize;
|
||||
float maxtracedist;
|
||||
int buttons;
|
||||
Vector cmd_angles;
|
||||
str weaponName;
|
||||
str driveranim;
|
||||
Vector last_origin;
|
||||
|
@ -208,9 +200,6 @@ class EXPORT_FROM_DLL Vehicle : public VehicleBase
|
|||
qboolean steerinplace;
|
||||
qboolean jumpable;
|
||||
|
||||
// CTF only stuff
|
||||
Vector startorigin;
|
||||
|
||||
virtual void WorldEffects( void );
|
||||
virtual void CheckWater( void );
|
||||
virtual void DriverUse( Event *ev );
|
||||
|
@ -327,14 +316,12 @@ inline EXPORT_FROM_DLL void Vehicle::Unarchive
|
|||
class EXPORT_FROM_DLL DrivableVehicle : public Vehicle
|
||||
{
|
||||
public:
|
||||
float respawntime;
|
||||
|
||||
CLASS_PROTOTYPE( DrivableVehicle );
|
||||
|
||||
DrivableVehicle();
|
||||
|
||||
virtual void Killed( Event *ev );
|
||||
virtual void Respawn( Event *ev );
|
||||
};
|
||||
|
||||
#ifdef EXPORT_TEMPLATE
|
||||
|
|
87
weapon.cpp
87
weapon.cpp
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/weapon.cpp $
|
||||
// $Revision:: 147 $
|
||||
// $Author:: Markd $
|
||||
// $Date:: 7/24/99 5:45p $
|
||||
// $Revision:: 143 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 12/16/98 5:43p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,22 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/weapon.cpp $
|
||||
//
|
||||
// 147 7/24/99 5:45p Markd
|
||||
// Added No Weapon Change Deathmatch bug
|
||||
//
|
||||
// 146 4/16/99 5:01p Aldie
|
||||
// Added takeallammo
|
||||
//
|
||||
// 145 3/12/99 7:49p Jimdose
|
||||
// made weapons fire 1/10th of a second sooner on clients
|
||||
//
|
||||
// 144 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:40p Aldie
|
||||
//
|
||||
// 143 12/16/98 5:43p Jimdose
|
||||
// infiniterockets no longer gives infinite mines
|
||||
//
|
||||
|
@ -505,8 +489,6 @@
|
|||
#include "sentient.h"
|
||||
#include "misc.h"
|
||||
#include "specialfx.h"
|
||||
#include "chaingun.h"
|
||||
#include "assaultrifle.h"
|
||||
|
||||
#ifdef SIN_ARCADE
|
||||
static ScriptVariablePtr sv_infinitebullets;
|
||||
|
@ -618,9 +600,6 @@ Weapon::Weapon()
|
|||
|
||||
// default action_level_increment
|
||||
action_level_increment = 2;
|
||||
|
||||
// default weapons don't have alt fire
|
||||
alternate_fire = false;
|
||||
}
|
||||
|
||||
Weapon::~Weapon()
|
||||
|
@ -1047,27 +1026,6 @@ void Weapon::SetOwner
|
|||
}
|
||||
}
|
||||
|
||||
void Weapon::TakeAllAmmo
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
Ammo *ammo;
|
||||
|
||||
if ( owner )
|
||||
{
|
||||
if ( ammotype.length() )
|
||||
{
|
||||
ammo = ( Ammo * )owner->FindItem( ammotype.c_str() );
|
||||
if ( ammo )
|
||||
{
|
||||
owner->takeItem( ammotype.c_str(), ammo->Amount() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Weapon::AmmoAvailable
|
||||
(
|
||||
void
|
||||
|
@ -1498,14 +1456,13 @@ qboolean Weapon::Drop
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Weapon::Fire
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
qboolean skipframefix;
|
||||
|
||||
if ( !ReadyToFire() )
|
||||
{
|
||||
return;
|
||||
|
@ -1528,13 +1485,6 @@ void Weapon::Fire
|
|||
// this is just a precaution that we can re-trigger
|
||||
NextAttack( 5 );
|
||||
|
||||
skipframefix = false;
|
||||
if ( owner && owner->isClient() && !isSubclassOf( ChainGun ) && !isSubclassOf( AssaultRifle ) )
|
||||
{
|
||||
skipframefix = true;
|
||||
StopAnimating();
|
||||
}
|
||||
|
||||
if ( dualmode )
|
||||
{
|
||||
if ( weaponmode == PRIMARY )
|
||||
|
@ -1554,11 +1504,6 @@ void Weapon::Fire
|
|||
RandomAnimate( "fire", EV_Weapon_DoneFiring );
|
||||
}
|
||||
|
||||
if ( skipframefix )
|
||||
{
|
||||
last_animation_time = ( level.framenum + 1 ) * FRAMETIME;
|
||||
}
|
||||
|
||||
last_attack_time = level.time;
|
||||
}
|
||||
|
||||
|
@ -1703,14 +1648,11 @@ void Weapon::PickupWeapon
|
|||
// Sentient should probably handle this when itempickup is called
|
||||
// Check if we should switch his weapon
|
||||
current = sen->CurrentWeapon();
|
||||
if ( !DM_FLAG( DF_NO_WEAPON_CHANGE ) )
|
||||
{
|
||||
if ( !hasweapon && current && ( current != weapon ) && ( current->AutoChange() ) &&
|
||||
( ( current->Rank() < weapon->Rank() ) || ( !current->HasAmmo() && weapon->HasAmmo() ) ) )
|
||||
{
|
||||
sen->ChangeWeapon( weapon );
|
||||
}
|
||||
}
|
||||
|
||||
// check if we should give him ammo
|
||||
if ( giveammo )
|
||||
|
@ -2393,24 +2335,3 @@ void Weapon::PutAwayAndRaise
|
|||
|
||||
RandomAnimate( "putaway", EV_Weapon_Raise );
|
||||
}
|
||||
|
||||
void Weapon::SetPrimaryMode
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
weaponmode = PRIMARY;
|
||||
ammotype = primary_ammo_type;
|
||||
}
|
||||
|
||||
void Weapon::SetSecondaryMode
|
||||
(
|
||||
void
|
||||
)
|
||||
|
||||
{
|
||||
weaponmode = SECONDARY;
|
||||
ammotype = secondary_ammo_type;
|
||||
}
|
||||
|
||||
|
|
26
weapon.h
26
weapon.h
|
@ -1,9 +1,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Quake 2 Engine/Sin/code/game/weapon.h $
|
||||
// $Revision:: 69 $
|
||||
// $Author:: Aldie $
|
||||
// $Date:: 4/16/99 5:03p $
|
||||
// $Revision:: 67 $
|
||||
// $Author:: Jimdose $
|
||||
// $Date:: 12/10/98 1:46p $
|
||||
//
|
||||
// Copyright (C) 1997 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
|
@ -13,16 +13,6 @@
|
|||
//
|
||||
// $Log:: /Quake 2 Engine/Sin/code/game/weapon.h $
|
||||
//
|
||||
// 69 4/16/99 5:03p Aldie
|
||||
// Added TakeAllAmmo
|
||||
//
|
||||
// 68 3/02/99 9:16p Aldie
|
||||
// Added CTF game code
|
||||
//
|
||||
// 2 2/16/99 4:09p Aldie
|
||||
//
|
||||
// 1 2/11/99 1:40p Aldie
|
||||
//
|
||||
// 67 12/10/98 1:46p Jimdose
|
||||
// Added UnlimitedAmmo
|
||||
//
|
||||
|
@ -325,9 +315,6 @@ class EXPORT_FROM_DLL Weapon : public Item
|
|||
int aimanim;
|
||||
int aimframe;
|
||||
|
||||
// CTF
|
||||
qboolean alternate_fire;
|
||||
|
||||
void SetMaxRangeEvent( Event *ev );
|
||||
void SetMinRangeEvent( Event *ev );
|
||||
void SetProjectileSpeedEvent( Event *ev );
|
||||
|
@ -350,7 +337,6 @@ class EXPORT_FROM_DLL Weapon : public Item
|
|||
virtual void SetAimAnim( Event *ev );
|
||||
|
||||
public:
|
||||
|
||||
CLASS_PROTOTYPE( Weapon );
|
||||
|
||||
Weapon();
|
||||
|
@ -434,12 +420,6 @@ class EXPORT_FROM_DLL Weapon : public Item
|
|||
|
||||
virtual void Archive( Archiver &arc );
|
||||
virtual void Unarchive( Archiver &arc );
|
||||
|
||||
// CTF
|
||||
void SetPrimaryMode( void );
|
||||
void SetSecondaryMode( void );
|
||||
virtual void TakeAllAmmo( void );
|
||||
qboolean AlternateFire( void ) { return alternate_fire; }
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue