Browse Source

Merge original "ThreeWave" source code.

dmc
Night Owl 7 years ago
parent
commit
0535fe0ae4
  1. 256
      cl_dll/3wave/CTF_FlagStatus.cpp
  2. 195
      cl_dll/3wave/CTF_HudMessage.cpp
  3. 195
      cl_dll/ev_hldm.cpp
  4. 10
      cl_dll/quake/quake_events.cpp
  5. 3269
      dlls/3wave/threewave_gamerules.cpp
  6. 232
      dlls/3wave/threewave_gamerules.h
  7. 3
      dlls/CMakeLists.txt
  8. 58
      dlls/client.cpp
  9. 69
      dlls/dmc/quake_weapons_all.cpp
  10. 54
      dlls/multiplay_gamerules.cpp
  11. 39
      dlls/player.h

256
cl_dll/3wave/CTF_FlagStatus.cpp

@ -0,0 +1,256 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#include "hud.h"
#include "cl_util.h"
#include "parsemsg.h"
#include "const.h"
#include "entity_state.h"
#include "cl_entity.h"
#include "entity_types.h"
#include "usercmd.h"
#include "pm_defs.h"
#include "pm_materials.h"
#include "ref_params.h"
#include <string.h>
#include "vgui_viewport.h"
#include "vgui_ScorePanel.h"
#define RED_FLAG_STOLE 1
#define BLUE_FLAG_STOLE 2
#define RED_FLAG_LOST 3
#define BLUE_FLAG_LOST 4
#define RED_FLAG_ATBASE 5
#define BLUE_FLAG_ATBASE 6
#define ITEM_RUNE1_FLAG 1
#define ITEM_RUNE2_FLAG 2
#define ITEM_RUNE3_FLAG 3
#define ITEM_RUNE4_FLAG 4
DECLARE_MESSAGE(m_FlagStat, FlagStat)
DECLARE_MESSAGE(m_FlagStat, RuneStat)
DECLARE_MESSAGE(m_FlagStat, FlagCarrier)
int CHudFlagStatus::Init(void)
{
HOOK_MESSAGE( FlagStat );
HOOK_MESSAGE( RuneStat );
HOOK_MESSAGE( FlagCarrier );
m_iFlags |= HUD_ACTIVE;
gHUD.AddHudElem(this);
Reset();
return 1;
};
int CHudFlagStatus::VidInit(void)
{
m_iBlueAtBaseIndex = gHUD.GetSpriteIndex( "blue_atbase" );
m_iBlueLostIndex = gHUD.GetSpriteIndex( "blue_lost" );
m_iBlueStolenIndex = gHUD.GetSpriteIndex( "blue_stolen" );
m_iRedAtBaseIndex = gHUD.GetSpriteIndex( "red_atbase" );
m_iRedLostIndex = gHUD.GetSpriteIndex( "red_lost" );
m_iRedStolenIndex = gHUD.GetSpriteIndex( "red_stolen" );
m_iRune1Index = gHUD.GetSpriteIndex( "rune1" );
m_iRune2Index = gHUD.GetSpriteIndex( "rune2" );
m_iRune3Index = gHUD.GetSpriteIndex( "rune3" );
m_iRune4Index = gHUD.GetSpriteIndex( "rune4" );
m_hBlueAtBase = gHUD.GetSprite( m_iBlueAtBaseIndex );
m_hBlueLost = gHUD.GetSprite( m_iBlueLostIndex );
m_hBlueStolen = gHUD.GetSprite( m_iBlueStolenIndex );
m_hRedAtBase = gHUD.GetSprite( m_iRedAtBaseIndex );
m_hRedLost = gHUD.GetSprite( m_iRedLostIndex );
m_hRedStolen = gHUD.GetSprite( m_iRedStolenIndex );
m_hRune1 = gHUD.GetSprite( m_iRune1Index );
m_hRune2 = gHUD.GetSprite( m_iRune2Index );
m_hRune3 = gHUD.GetSprite( m_iRune3Index );
m_hRune4 = gHUD.GetSprite( m_iRune4Index );
// Load sprites here
m_iBlueFlagIndex = gHUD.GetSpriteIndex( "b_flag_c" );
m_iRedFlagIndex = gHUD.GetSpriteIndex( "r_flag_c" );
m_hBlueFlag = gHUD.GetSprite( m_iBlueFlagIndex );
m_hRedFlag = gHUD.GetSprite( m_iRedFlagIndex );
return 1;
}
void CHudFlagStatus :: Reset( void )
{
return;
}
int CHudFlagStatus ::Draw(float flTime )
{
if ( !iDrawStatus )
return 1;
int x, y;
int r,g,b;
r = g = b = 255;
x = 20;
y = ( ScreenHeight - gHUD.m_iFontHeight ) - ( gHUD.m_iFontHeight / 2 ) - 40;
switch ( iBlueFlagStatus )
{
case BLUE_FLAG_STOLE:
SPR_Set( m_hBlueStolen, r, g, b );
SPR_DrawHoles( 1, x, y, NULL );
break;
case BLUE_FLAG_LOST:
SPR_Set( m_hBlueLost, r, g, b );
SPR_DrawHoles( 1, x, y, NULL );
break;
case BLUE_FLAG_ATBASE:
SPR_Set( m_hBlueAtBase, r, g, b );
SPR_DrawHoles( 1, x, y, NULL );
break;
}
x = 50;
if ( iBlueTeamScore < 10)
{
x += 3;
gHUD.DrawHudNumber( x, y + 4, DHN_DRAWZERO, iBlueTeamScore, 255, 255, 255 );
}
else if ( iBlueTeamScore >= 10 && iBlueTeamScore < 100 )
gHUD.DrawHudNumber( x, y + 4, DHN_2DIGITS | DHN_DRAWZERO, iBlueTeamScore, 255, 255, 255 );
x = 20;
y = ( ScreenHeight - gHUD.m_iFontHeight ) - ( gHUD.m_iFontHeight / 2 ) - 75;
switch ( iRedFlagStatus )
{
case RED_FLAG_STOLE:
SPR_Set( m_hRedStolen, r, g, b );
SPR_DrawHoles( 1, x, y, NULL );
break;
case RED_FLAG_LOST:
SPR_Set( m_hRedLost, r, g, b );
SPR_DrawHoles( 1, x, y, NULL );
break;
case RED_FLAG_ATBASE:
SPR_Set( m_hRedAtBase, r, g, b );
SPR_DrawHoles( 1, x, y, NULL );
break;
}
x = 50;
if ( iRedTeamScore < 10)
{
x += 3;
gHUD.DrawHudNumber( x, y + 4, DHN_DRAWZERO, iRedTeamScore, 255, 255, 255 );
}
else if ( iBlueTeamScore >= 10 && iBlueTeamScore < 100 )
gHUD.DrawHudNumber( x, y + 4, DHN_2DIGITS | DHN_DRAWZERO, iRedTeamScore, 255, 255, 255 );
x = 20;
y = ( ScreenHeight - gHUD.m_iFontHeight ) - ( gHUD.m_iFontHeight / 2 ) - 110;
switch ( m_iRuneStat )
{
case ITEM_RUNE1_FLAG:
SPR_Set( m_hRune1, r, g, b );
SPR_Draw( 1, x, y, NULL );
break;
case ITEM_RUNE2_FLAG:
SPR_Set( m_hRune2, r, g, b );
SPR_Draw( 1, x, y, NULL );
break;
case ITEM_RUNE3_FLAG:
SPR_Set( m_hRune3, r, g, b );
SPR_Draw( 1, x, y, NULL );
break;
case ITEM_RUNE4_FLAG:
SPR_Set( m_hRune4, r, g, b );
SPR_Draw( 1, x, y, NULL );
break;
}
return 1;
}
int CHudFlagStatus::MsgFunc_FlagStat(const char *pszName, int iSize, void *pbuf)
{
BEGIN_READ( pbuf, iSize );
iDrawStatus = READ_BYTE();
iRedFlagStatus = READ_BYTE();
iBlueFlagStatus = READ_BYTE();
iRedTeamScore = READ_BYTE();
iBlueTeamScore = READ_BYTE();
return 1;
}
int CHudFlagStatus::MsgFunc_RuneStat(const char *pszName, int iSize, void *pbuf)
{
BEGIN_READ( pbuf, iSize );
m_iRuneStat = READ_BYTE();
return 1;
}
int CHudFlagStatus::MsgFunc_FlagCarrier(const char *pszName, int iSize, void *pbuf)
{
BEGIN_READ( pbuf, iSize );
int index = READ_BYTE();
bool bRedFlag = false;
bool bBlueFlag = false;
g_PlayerExtraInfo[ index ].iHasFlag = READ_BYTE();
for ( int i = 1; i < MAX_PLAYERS + 1; i++ )
{
if ( g_PlayerExtraInfo[ i ].iHasFlag )
{
if ( g_PlayerExtraInfo[ i ].teamnumber == 1 )
bRedFlag = true;
else if ( g_PlayerExtraInfo[ i ].teamnumber == 2 )
bBlueFlag = true;
}
}
if ( !bRedFlag )
gViewPort->m_pScoreBoard->m_pImages[ 5 ]->setVisible( false );
if ( !bBlueFlag )
gViewPort->m_pScoreBoard->m_pImages[ 4 ]->setVisible( false );
return 1;
}

195
cl_dll/3wave/CTF_HudMessage.cpp

@ -0,0 +1,195 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#include "hud.h"
#include "cl_util.h"
#include "parsemsg.h"
#include "const.h"
#include "entity_state.h"
#include "cl_entity.h"
#include "entity_types.h"
#include "usercmd.h"
#include "pm_defs.h"
#include "pm_materials.h"
#include "ref_params.h"
#include <string.h>
#define MAX_BONUS 10
#define RED_FLAG_STOLEN 1
#define BLUE_FLAG_STOLEN 2
#define RED_FLAG_CAPTURED 3
#define BLUE_FLAG_CAPTURED 4
#define RED_FLAG_RETURNED_PLAYER 5
#define BLUE_FLAG_RETURNED_PLAYER 6
#define RED_FLAG_RETURNED 7
#define BLUE_FLAG_RETURNED 8
#define RED_FLAG_LOST_HUD 9
#define BLUE_FLAG_LOST_HUD 10
char *sBonusStrings[] =
{
"",
"\\w stole the \\rRED\\w Flag!",
"\\w stole the \\bBLUE\\w Flag!",
"\\w captured the \\rRED\\w Flag",
"\\w captured the \\bBLUE\\w Flag",
"\\w returned the \\rRED\\w Flag",
"\\w returned the \\bBLUE\\w Flag",
"\\wThe \\rRED\\w Flag has Returned",
"\\wThe \\bBLUE\\w Flag has Returned",
"\\w lost the \\rRED\\w Flag!",
"\\w lost the \\bBLUE\\w Flag!",
};
DECLARE_MESSAGE(m_Bonus, Bonus)
struct bonus_info_t
{
int iSlot;
int iType;
bool bActive;
float flBonusTime;
char sPlayerName[64];
};
bonus_info_t g_PlayerBonus[MAX_BONUS+1];
int CHudBonus::Init(void)
{
HOOK_MESSAGE( Bonus );
m_iFlags |= HUD_ACTIVE;
gHUD.AddHudElem(this);
Reset();
return 1;
};
int CHudBonus::VidInit(void)
{
return 1;
}
void CHudBonus :: Reset( void )
{
m_iFlags |= HUD_ACTIVE;
for ( int reset = 0; reset < MAX_BONUS; reset++)
{
g_PlayerBonus[ reset ].flBonusTime = 0.0;
g_PlayerBonus[ reset ].iSlot = 0;
g_PlayerBonus[ reset ].iType = 0;
g_PlayerBonus[ reset ].bActive = false;
m_bUsedSlot[ reset ] = false;
strcpy ( g_PlayerBonus[ reset ].sPlayerName, "" );
}
}
int CHudBonus ::Draw(float flTime )
{
for (int index = 1; index < MAX_BONUS + 1; index++)
{
//Just activated
if ( g_PlayerBonus[ index ].bActive && !g_PlayerBonus[ index ].flBonusTime )
{
g_PlayerBonus[ index ].flBonusTime = flTime + 5.0;
for ( int i = 1; i < MAX_BONUS + 1; i++ )
{
if ( m_bUsedSlot[ i ] == false ) //found one thats not used
{
m_bUsedSlot[ i ] = true; //use it!
g_PlayerBonus[ index ].iSlot = i;
break;
}
}
}
if ( g_PlayerBonus[ index ].flBonusTime > flTime )
{
int YPos;
int iMod = gHUD.ReturnStringPixelLength( "\\w\\r\\w" );
YPos = ( ( ScreenHeight - gHUD.m_iFontHeight ) - ( gHUD.m_iFontHeight / 2 ) + 3 ) - ( 30 * g_PlayerBonus[ index ].iSlot );
int XPos = 75;
char szText[256];
strcpy ( szText, g_PlayerBonus[ index ].sPlayerName );
strcat ( szText, sBonusStrings[ g_PlayerBonus[ index ].iType ] );
if ( gHUD.m_FlagStat.iBlueTeamScore >= 10 )
gHUD.DrawHudStringCTF( XPos + 20, YPos, 640, szText, 255, 255, 255 );
else
gHUD.DrawHudStringCTF( XPos , YPos, 320, szText, 255, 255, 255 );
}
if ( g_PlayerBonus[ index ].flBonusTime < flTime )
{
g_PlayerBonus[ index ].bActive = false;
m_bUsedSlot[ g_PlayerBonus[ index ].iSlot ] = false;
g_PlayerBonus[ index ].iSlot = 0;
strcpy ( g_PlayerBonus[ index ].sPlayerName, "" );
}
}
return 1;
}
int CHudBonus::MsgFunc_Bonus(const char *pszName, int iSize, void *pbuf)
{
BEGIN_READ( pbuf, iSize );
for ( int index = 1; index < MAX_BONUS + 1; index++)
{
//Find wich one is not used
if ( g_PlayerBonus[ index ].bActive == false )
break; //Not using this one?, then we shall use this.
}
g_PlayerBonus[ index ].bActive = true;
g_PlayerBonus[ index ].flBonusTime = 0.0;
g_PlayerBonus[ index ].iType = READ_BYTE();
strcpy ( g_PlayerBonus[ index ].sPlayerName, READ_STRING() );
switch ( g_PlayerBonus[ index ].iType )
{
case RED_FLAG_STOLEN:
case BLUE_FLAG_STOLEN:
PlaySound( "ctf/flagtk.wav", 1 );
break;
case RED_FLAG_CAPTURED:
case BLUE_FLAG_CAPTURED:
PlaySound( "ctf/flagcap.wav", 1 );
break;
case RED_FLAG_RETURNED_PLAYER:
case BLUE_FLAG_RETURNED_PLAYER:
case RED_FLAG_RETURNED:
case BLUE_FLAG_RETURNED:
PlaySound( "ctf/flagret.wav", 1 );
break;
}
return 1;
}

195
cl_dll/ev_hldm.cpp

@ -60,6 +60,11 @@ void EV_DMC_DoorGoDown( struct event_args_s *args );
void EV_DMC_DoorHitTop( struct event_args_s *args ); void EV_DMC_DoorHitTop( struct event_args_s *args );
void EV_DMC_DoorHitBottom( struct event_args_s *args ); void EV_DMC_DoorHitBottom( struct event_args_s *args );
void EV_Hook( event_args_t *args );
void EV_Cable( struct event_args_s *args );
void EV_FollowCarrier( struct event_args_s *args );
void EV_FlagSpawn( struct event_args_s *args );
void EV_TrainPitchAdjust( struct event_args_s *args ); void EV_TrainPitchAdjust( struct event_args_s *args );
} }
@ -644,6 +649,196 @@ void EV_FireAxeSwing( event_args_t *args )
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/ax1.wav", 1.0, ATTN_NORM, 0, 100 ); gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/ax1.wav", 1.0, ATTN_NORM, 0, 100 );
} }
void EV_Hook( event_args_t *args )
{
return;
}
void EV_Cable( event_args_t *args )
{
int idx, attached, team, modelIndex;
float r, g, b;
idx = args->entindex;
attached = args->iparam1;
team = args->iparam2;
modelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( "sprites/smoke.spr" );
if( !modelIndex )
return;
if( team == 1 )
{
r = 500;
g = 0;
b = 0;
}
else if( team == 2 )
{
r = 0;
g = 0;
b = 500;
}
if( args->bparam1 == 1 )
gEngfuncs.pEfxAPI->R_BeamKill( attached );
else
gEngfuncs.pEfxAPI->R_BeamEnts( idx, attached, modelIndex, 9999, 1, 0.001, 0.8, 0.0, 0.0, 0.0, r, g, b );
}
void EV_GenericParticleCallback( struct particle_s *particle, float frametime )
{
int i;
for( i = 0; i < 3; i++ )
{
particle->org[i] += particle->vel[i] * frametime;
}
}
void EV_TrailCallback( struct tempent_s *ent, float frametime, float currenttime )
{
// If the Player is not on our PVS, then go back
if( !CheckPVS( ent->clientIndex ) )
return;
dlight_t *dl = gEngfuncs.pEfxAPI->CL_AllocDlight( 0 );
cl_entity_t *player = gEngfuncs.GetEntityByIndex( ent->clientIndex );
if( !player )
return;
VectorCopy( player->origin, dl->origin );
dl->radius = 240;
dl->die = gEngfuncs.GetClientTime() + 0.001; // Kill it right away
if( ent->entity.baseline.movetype == 2 )
{
dl->color.r = 240;
dl->color.g = 25;
dl->color.b = 25;
}
else
{
dl->color.r = 25;
dl->color.g = 25;
dl->color.b = 240;
}
// I know what you are thinking and yes, this was the only place I could find on where to put the timer
// Hacky; Yes, Works; Yes!.
if( ent->entity.baseline.animtime > gEngfuncs.GetClientTime() )
return;
for( int i = 0; i < 4; i++ )
{
particle_t *bPart = gEngfuncs.pEfxAPI->R_AllocParticle( EV_GenericParticleCallback );
if( bPart )
{
VectorCopy( ent->entity.origin, bPart->org );
bPart->org[0] += gEngfuncs.pfnRandomFloat( -2, 2 );
bPart->org[1] += gEngfuncs.pfnRandomFloat( -2, 2 );
bPart->org[2] += gEngfuncs.pfnRandomFloat( -2, 2 );
bPart->vel[0] = gEngfuncs.pfnRandomFloat( -50, 50 );
bPart->vel[1] = gEngfuncs.pfnRandomFloat( -50, 50 );
bPart->vel[2] = gEngfuncs.pfnRandomFloat( 75, 80 );
//Check team and color the particle correctly
if( ent->entity.baseline.movetype == 2 )
bPart->color = 70;
else
bPart->color = 43;
bPart->type = pt_slowgrav;
bPart->die = gEngfuncs.GetClientTime() + 0.5;
}
}
ent->entity.baseline.animtime = gEngfuncs.GetClientTime() + 0.3;
}
void EV_FollowCarrier( event_args_t *args )
{
int iEntIndex = args->iparam1;
int iTeam = args->iparam2;
float r, g, b;
int modelIndex;
const char *model = "sprites/smoke.spr";
modelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( model );
if( iTeam == 2 )
{
r = 500;
g = 0;
b = 0;
}
else if( iTeam == 1 )
{
r = 0;
g = 0;
b = 500;
}
if( args->bparam1 == 1 )
gEngfuncs.pEfxAPI->R_KillAttachedTents( iEntIndex );
else
{
TEMPENTITY *pTrailSpawner = NULL;
pTrailSpawner = gEngfuncs.pEfxAPI->R_TempModel( args->origin, args->velocity, args->angles, 9999, modelIndex, TE_BOUNCE_NULL );
if( pTrailSpawner != NULL )
{
pTrailSpawner->flags |= ( FTENT_PLYRATTACHMENT | FTENT_PERSIST | FTENT_NOMODEL | FTENT_CLIENTCUSTOM );
pTrailSpawner->clientIndex = iEntIndex;
pTrailSpawner->entity.baseline.movetype = iTeam; // Hack to store the team number on this temp ent.
pTrailSpawner->entity.baseline.animtime = gEngfuncs.GetClientTime() + 0.3;
pTrailSpawner->callback = EV_TrailCallback;
}
}
}
void EV_FlagSpawn( event_args_t *args )
{
vec3_t origin;
VectorCopy( args->origin, origin );
gEngfuncs.pEfxAPI->R_Implosion( origin, 50, 20, 0.5 );
for( int i = 0; i < 20; i++ )
{
particle_t *bPart = gEngfuncs.pEfxAPI->R_AllocParticle( EV_GenericParticleCallback );
if( bPart )
{
VectorCopy ( args->origin, bPart->org);
bPart->org[0] += gEngfuncs.pfnRandomFloat( -4, 4 );
bPart->org[1] += gEngfuncs.pfnRandomFloat( -4, 4 );
bPart->org[2] += gEngfuncs.pfnRandomFloat( -4, 4 );
bPart->vel[0] = gEngfuncs.pfnRandomFloat( -50, 50 );
bPart->vel[1] = gEngfuncs.pfnRandomFloat( -50, 50 );
bPart->vel[2] = gEngfuncs.pfnRandomFloat( 250, 350 );
//Check team and color the particle correctly
if( args->iparam1 == 1 )
bPart->color = 70;
else
bPart->color = 43;
bPart->type = pt_grav;
bPart->die = gEngfuncs.GetClientTime() + 3;
}
}
}
void EV_PowerupCallback( struct tempent_s *ent, float frametime, float currenttime ) void EV_PowerupCallback( struct tempent_s *ent, float frametime, float currenttime )
{ {
//If the Player is not on our PVS, then go back //If the Player is not on our PVS, then go back

10
cl_dll/quake/quake_events.cpp

@ -39,6 +39,11 @@ void EV_DMC_DoorGoDown( struct event_args_s *args );
void EV_DMC_DoorHitTop( struct event_args_s *args ); void EV_DMC_DoorHitTop( struct event_args_s *args );
void EV_DMC_DoorHitBottom( struct event_args_s *args ); void EV_DMC_DoorHitBottom( struct event_args_s *args );
void EV_Hook( event_args_t *args );
void EV_Cable( struct event_args_s *args );
void EV_FollowCarrier( struct event_args_s *args );
void EV_FlagSpawn( struct event_args_s *args );
// HLDM // HLDM
void EV_TrainPitchAdjust( struct event_args_s *args ); void EV_TrainPitchAdjust( struct event_args_s *args );
} }
@ -79,5 +84,10 @@ void Game_HookEvents( void )
gEngfuncs.pfnHookEvent( "events/door/doorhittop.sc", EV_DMC_DoorHitTop ); gEngfuncs.pfnHookEvent( "events/door/doorhittop.sc", EV_DMC_DoorHitTop );
gEngfuncs.pfnHookEvent( "events/door/doorhitbottom.sc", EV_DMC_DoorHitBottom ); gEngfuncs.pfnHookEvent( "events/door/doorhitbottom.sc", EV_DMC_DoorHitBottom );
gEngfuncs.pfnHookEvent( "events/hook.sc", EV_Hook );
gEngfuncs.pfnHookEvent( "events/cable.sc", EV_Cable );
gEngfuncs.pfnHookEvent( "events/follow.sc", EV_FollowCarrier );
gEngfuncs.pfnHookEvent( "events/flagspawn.sc", EV_FlagSpawn );
gEngfuncs.pfnHookEvent( "events/train.sc", EV_TrainPitchAdjust ); gEngfuncs.pfnHookEvent( "events/train.sc", EV_TrainPitchAdjust );
} }

3269
dlls/3wave/threewave_gamerules.cpp

File diff suppressed because it is too large Load Diff

232
dlls/3wave/threewave_gamerules.h

@ -0,0 +1,232 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#define BLUE 2
#define RED 1
#include "voice_gamemgr.h"
//=========================================================
// Flags
//=========================================================
class CItemFlag : public CBaseEntity
{
public:
void Spawn( void );
BOOL Dropped;
float m_flDroppedTime;
void EXPORT FlagThink( void );
private:
void Precache ( void );
void Capture(CBasePlayer *pPlayer, int iTeam );
void ResetFlag( int iTeam );
void Materialize( void );
void EXPORT FlagTouch( CBaseEntity *pOther );
// BOOL MyTouch( CBasePlayer *pPlayer );
};
class CCarriedFlag : public CBaseEntity
{
public:
void Spawn( void );
CBasePlayer *Owner;
int m_iOwnerOldVel;
private:
void Precache ( void );
void EXPORT FlagThink( void );
};
class CResistRune : public CBaseEntity
{
private:
void EXPORT RuneRespawn ( void );
public:
void EXPORT RuneTouch ( CBaseEntity *pOther );
void Spawn( void );
void EXPORT MakeTouchable ( void );
int m_iRuneFlag;
bool m_bTouchable;
bool dropped;
};
class CStrengthRune : public CBaseEntity
{
private:
void EXPORT RuneRespawn ( void );
public:
void EXPORT RuneTouch ( CBaseEntity *pOther );
void Spawn( void );
void EXPORT MakeTouchable ( void );
int m_iRuneFlag;
bool m_bTouchable;
bool dropped;
};
class CHasteRune : public CBaseEntity
{
private:
void EXPORT RuneRespawn ( void );
public:
void EXPORT RuneTouch ( CBaseEntity *pOther );
void EXPORT MakeTouchable ( void );
void Spawn( void );
int m_iRuneFlag;
bool m_bTouchable;
bool dropped;
};
class CRegenRune : public CBaseEntity
{
private:
void EXPORT RuneRespawn ( void );
public:
void EXPORT RuneTouch ( CBaseEntity *pOther );
void Spawn( void );
void EXPORT MakeTouchable ( void );
int m_iRuneFlag;
bool m_bTouchable;
bool dropped;
};
class CGrapple : public CBaseEntity
{
public:
//Yes, I have no imagination so I use standard touch, spawn and think function names.
//Sue me! =P.
void Spawn ( void );
void EXPORT OnAirThink ( void );
void EXPORT GrappleTouch ( CBaseEntity *pOther );
void Reset_Grapple ( void );
void EXPORT Grapple_Track ( void );
float m_flNextIdleTime;
};
#define STEAL_SOUND 1
#define CAPTURE_SOUND 2
#define RETURN_SOUND 3
#define RED_FLAG_STOLEN 1
#define BLUE_FLAG_STOLEN 2
#define RED_FLAG_CAPTURED 3
#define BLUE_FLAG_CAPTURED 4
#define RED_FLAG_RETURNED_PLAYER 5
#define BLUE_FLAG_RETURNED_PLAYER 6
#define RED_FLAG_RETURNED 7
#define BLUE_FLAG_RETURNED 8
#define RED_FLAG_LOST 9
#define BLUE_FLAG_LOST 10
#define RED_FLAG_STOLEN 1
#define BLUE_FLAG_STOLEN 2
#define RED_FLAG_DROPPED 3
#define BLUE_FLAG_DROPPED 4
#define RED_FLAG_ATBASE 5
#define BLUE_FLAG_ATBASE 6
#define MAX_TEAMNAME_LENGTH 16
#define MAX_TEAMS 32
#define TEAMPLAY_TEAMLISTLENGTH MAX_TEAMS*MAX_TEAMNAME_LENGTH
class CThreeWave : public CHalfLifeMultiplay
{
public:
CThreeWave();
virtual BOOL ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
virtual BOOL ClientCommand( CBasePlayer *pPlayer, const char *pcmd );
virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer );
virtual BOOL IsTeamplay( void );
virtual BOOL FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker );
virtual int PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget );
virtual const char *GetTeamID( CBaseEntity *pEntity );
virtual BOOL ShouldAutoAim( CBasePlayer *pPlayer, edict_t *target );
virtual int IPointsForKill( CBasePlayer *pAttacker, CBasePlayer *pKilled );
virtual void InitHUD( CBasePlayer *pl );
virtual void DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor );
virtual const char *GetGameDescription( void ) { return "3Wave CTF"; } // this is the game name that gets seen in the server browser
virtual void UpdateGameMode( CBasePlayer *pPlayer ); // the client needs to be informed of the current game mode
virtual void PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor );
virtual void Think ( void );
virtual int GetTeamIndex( const char *pTeamName );
virtual const char *GetIndexedTeamName( int teamIndex );
virtual BOOL IsValidTeam( const char *pTeamName );
virtual void ChangePlayerTeam( CBasePlayer *pPlayer, int iTeam );
virtual void PlayerSpawn( CBasePlayer *pPlayer );
void JoinTeam ( CBasePlayer *pPlayer, int iTeam );
int TeamWithFewestPlayers ( void );
virtual void ClientDisconnected( edict_t *pClient );
void GetFlagStatus( CBasePlayer *pPlayer );
virtual edict_t *GetPlayerSpawnSpot( CBasePlayer *pPlayer );
virtual void PlayerThink( CBasePlayer *pPlayer );
void PlayerTakeDamage( CBasePlayer *pPlayer , CBaseEntity *pAttacker );
int iBlueFlagStatus;
int iRedFlagStatus;
int iBlueTeamScore;
int iRedTeamScore;
float m_flFlagStatusTime;
private:
void RecountTeams( void );
BOOL m_DisableDeathMessages;
BOOL m_DisableDeathPenalty;
BOOL m_teamLimit; // This means the server set only some teams as valid
char m_szTeamList[TEAMPLAY_TEAMLISTLENGTH];
};

3
dlls/CMakeLists.txt

@ -37,6 +37,7 @@ else()
endif() endif()
set (SVDLL_SOURCES set (SVDLL_SOURCES
3wave/threewave_gamerules.cpp
aghl/agarena.cpp aghl/agarena.cpp
aghl/agglobal.cpp aghl/agglobal.cpp
aghl/aglms.cpp aghl/aglms.cpp
@ -151,7 +152,7 @@ set (SVDLL_SOURCES
../pm_shared/pm_shared.c ../pm_shared/pm_shared.c
) )
include_directories (. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public dmc aghl .. ) include_directories (. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public dmc aghl 3wave .. )
if(USE_VOICEMGR) if(USE_VOICEMGR)
set(SVDLL_SOURCES set(SVDLL_SOURCES

58
dlls/client.cpp

@ -50,6 +50,8 @@ extern DLL_GLOBAL BOOL g_fGameOver;
extern DLL_GLOBAL int g_iSkillLevel; extern DLL_GLOBAL int g_iSkillLevel;
extern DLL_GLOBAL ULONG g_ulFrameCount; extern DLL_GLOBAL ULONG g_ulFrameCount;
const char* GetTeamName( int team );
extern bool g_bHaveMOTD; extern bool g_bHaveMOTD;
extern void CopyToBodyQue( entvars_t* pev ); extern void CopyToBodyQue( entvars_t* pev );
@ -65,6 +67,11 @@ extern unsigned short g_sTrail;
extern unsigned short g_sExplosion; extern unsigned short g_sExplosion;
extern unsigned short g_usPowerUp; extern unsigned short g_usPowerUp;
extern unsigned short g_usHook;
extern unsigned short g_usCable;
extern unsigned short g_usCarried;
extern unsigned short g_usFlagSpawn;
extern int g_teamplay; extern int g_teamplay;
extern cvar_t bhopcap; extern cvar_t bhopcap;
@ -217,6 +224,8 @@ void ClientPutInServer( edict_t *pEntity )
pPlayer->pev->iuser2 = 0; pPlayer->pev->iuser2 = 0;
} }
#include "threewave_gamerules.h"
#ifndef NO_VOICEGAMEMGR #ifndef NO_VOICEGAMEMGR
#include "voice_gamemgr.h" #include "voice_gamemgr.h"
extern CVoiceGameMgr g_VoiceGameMgr; extern CVoiceGameMgr g_VoiceGameMgr;
@ -444,7 +453,14 @@ void Host_Say( edict_t *pEntity, int teamonly )
temp = "say"; temp = "say";
// team match? // team match?
if( g_teamplay ) UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n",
STRING( pEntity->v.netname ),
GETPLAYERUSERID( pEntity ),
GETPLAYERAUTHID( pEntity ),
GetTeamName( pEntity->v.team ),
temp,
p );
/*if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n",
STRING( pEntity->v.netname ), STRING( pEntity->v.netname ),
@ -463,7 +479,7 @@ void Host_Say( edict_t *pEntity, int teamonly )
GETPLAYERUSERID( pEntity ), GETPLAYERUSERID( pEntity ),
temp, temp,
p ); p );
} }*/
} }
/* /*
@ -548,7 +564,7 @@ void ClientCommand( edict_t *pEntity )
//-- Martin Webrant //-- Martin Webrant
pPlayer->m_bHadFirstSpawn = true; pPlayer->m_bHadFirstSpawn = true;
pPlayer->Spawn(); // pPlayer->Spawn();
} }
} }
else if( FStrEq( pcmd, "lastinv" ) ) else if( FStrEq( pcmd, "lastinv" ) )
@ -819,6 +835,13 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
} }
// team match? // team match?
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" changed name to \"%s\"\n",
STRING( pEntity->v.netname ),
GETPLAYERUSERID( pEntity ),
GETPLAYERAUTHID( pEntity ),
GetTeamName( pEntity->v.team ),
g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) );
/*
if( g_teamplay ) if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" changed name to \"%s\"\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" changed name to \"%s\"\n",
@ -836,7 +859,7 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
GETPLAYERAUTHID( pEntity ), GETPLAYERAUTHID( pEntity ),
GETPLAYERUSERID( pEntity ), GETPLAYERUSERID( pEntity ),
g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) );
} }*/
} }
// QUAKECLASSIC // QUAKECLASSIC
@ -1105,6 +1128,32 @@ void ClientPrecache( void )
PRECACHE_SOUND( "player/plyrjmp8.wav" ); PRECACHE_SOUND( "player/plyrjmp8.wav" );
PRECACHE_MODEL( "models/rune_resist.mdl" );
PRECACHE_MODEL( "models/rune_haste.mdl" );
PRECACHE_MODEL( "models/rune_regen.mdl" );
PRECACHE_MODEL( "models/rune_strength.mdl" );
PRECACHE_SOUND( "rune/rune1.wav" );
PRECACHE_SOUND( "rune/rune2.wav" );
PRECACHE_SOUND( "rune/rune22.wav" ); // Quad + Strength Rune.
PRECACHE_SOUND( "rune/rune3.wav" );
PRECACHE_SOUND( "rune/rune4.wav" );
PRECACHE_MODEL( "models/hook.mdl" );
PRECACHE_MODEL( "sprites/rope.spr" );
PRECACHE_SOUND( "weapons/grfire.wav" );
PRECACHE_SOUND( "weapons/grhang.wav" );
PRECACHE_SOUND( "weapons/grhit.wav" );
PRECACHE_SOUND( "weapons/grpull.wav" );
PRECACHE_SOUND( "weapons/grreset.wav" );
g_usHook = PRECACHE_EVENT( 1, "events/hook.sc" );
g_usCable = PRECACHE_EVENT( 1, "events/cable.sc" );
g_usCarried = PRECACHE_EVENT( 1, "events/follow.sc" );
g_usFlagSpawn = PRECACHE_EVENT( 1, "events/flagspawn.sc" );
ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_crowbar.mdl" ); ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_crowbar.mdl" );
ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_light.mdl" ); ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_light.mdl" );
ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_nail.mdl" ); ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_nail.mdl" );
@ -1994,6 +2043,7 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client
cd->fuser1 = (float)pl->m_iQuakeWeapon; cd->fuser1 = (float)pl->m_iQuakeWeapon;
cd->iuser4 = gpGlobals->deathmatch; cd->iuser4 = gpGlobals->deathmatch;
cd->fuser2 = pl->m_iNailOffset > 0 ? 1.0 : 0.0; cd->fuser2 = pl->m_iNailOffset > 0 ? 1.0 : 0.0;
cd->fuser3 = (float)pl->m_iRuneStatus;
cd->iuser3 = pl->m_iQuakeItems; cd->iuser3 = pl->m_iQuakeItems;

69
dlls/dmc/quake_weapons_all.cpp

@ -31,6 +31,10 @@
char gszQ_DeathType[128]; char gszQ_DeathType[128];
DLL_GLOBAL short g_sModelIndexNail; DLL_GLOBAL short g_sModelIndexNail;
extern unsigned short g_usHook;
extern unsigned short g_usCable;
extern unsigned short g_usCarried;
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
#include "cl_entity.h" #include "cl_entity.h"
struct cl_entity_s *GetViewEntity( void ); struct cl_entity_s *GetViewEntity( void );
@ -105,6 +109,8 @@ void QuakeClassicPrecache( void )
PRECACHE_SOUND("weapons/pkup.wav"); PRECACHE_SOUND("weapons/pkup.wav");
PRECACHE_SOUND("items/itembk2.wav"); PRECACHE_SOUND("items/itembk2.wav");
PRECACHE_MODEL("models/backpack.mdl"); PRECACHE_MODEL("models/backpack.mdl");
PRECACHE_MODEL("models/v_grapple.mdl");
} }
//================================================================================================ //================================================================================================
@ -208,6 +214,13 @@ void CBasePlayer::W_SetCurrentAmmo( int sendanim /* = 1 */ )
m_iQuakeItems |= IT_CELLS; m_iQuakeItems |= IT_CELLS;
szAnimExt = "gauss"; szAnimExt = "gauss";
} }
else if( m_iQuakeWeapon == IT_EXTRA_WEAPON )
{
m_pCurrentAmmo = NULL;
viewmodel = "models/v_grapple.mdl";
iszViewModel = MAKE_STRING( viewmodel );
szAnimExt = "crowbar";
}
else else
{ {
m_pCurrentAmmo = NULL; m_pCurrentAmmo = NULL;
@ -298,6 +311,9 @@ BOOL CBasePlayer::W_CheckNoAmmo()
if ( m_iQuakeWeapon == IT_AXE ) if ( m_iQuakeWeapon == IT_AXE )
return TRUE; return TRUE;
if( m_iQuakeWeapon == IT_EXTRA_WEAPON )
return TRUE;
if ( m_iQuakeWeapon == IT_LIGHTNING ) if ( m_iQuakeWeapon == IT_LIGHTNING )
{ {
PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usLightning, 0, (float *)&pev->origin, (float *)&pev->angles, 0.0, 0.0, 0, 1, 0, 0 ); PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usLightning, 0, (float *)&pev->origin, (float *)&pev->angles, 0.0, 0.0, 0, 1, 0, 0 );
@ -372,6 +388,10 @@ void CBasePlayer::W_ChangeWeapon( int iWeaponNumber )
if (m_iAmmoCells < 1) if (m_iAmmoCells < 1)
bHaveAmmo = FALSE; bHaveAmmo = FALSE;
} }
else if (iWeaponNumber == 9)
{
iWeapon = IT_EXTRA_WEAPON;
}
// Have the weapon? // Have the weapon?
if ( !(m_iQuakeItems & iWeapon) ) if ( !(m_iQuakeItems & iWeapon) )
@ -745,6 +765,23 @@ void CBasePlayer::W_FireShotgun( int iQuadSound )
Q_FireBullets(6, vecDir, Vector(0.04, 0.04, 0) ); Q_FireBullets(6, vecDir, Vector(0.04, 0.04, 0) );
} }
void CBasePlayer::W_FireHook( void )
{
PLAYBACK_EVENT_FULL( FEV_NOTHOST | FEV_GLOBAL, edict(), g_usHook, 0, (float *)&pev->origin, (float *)&pev->angles, 0.0, 0.0, 0, 0, 0, 0 );
Throw_Grapple();
}
#ifdef CLIENT_DLL
unsigned short g_usCable;
unsigned short g_usHook;
unsigned short g_usCarried;
void CBasePlayer::Throw_Grapple( void )
{
}
#endif
// Double barrel shotgun // Double barrel shotgun
void CBasePlayer::W_FireSuperShotgun( int iQuadSound ) void CBasePlayer::W_FireSuperShotgun( int iQuadSound )
{ {
@ -935,7 +972,10 @@ void CBasePlayer::W_Attack( int iQuadSound )
if (m_iQuakeWeapon == IT_AXE) if (m_iQuakeWeapon == IT_AXE)
{ {
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usAxeSwing, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, 0, 0 ); PLAYBACK_EVENT_FULL( FEV_NOTHOST, edict(), m_usAxeSwing, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, iQuadSound, 0, 0, 0 );
@ -947,13 +987,19 @@ void CBasePlayer::W_Attack( int iQuadSound )
} }
else if (m_iQuakeWeapon == IT_SHOTGUN) else if (m_iQuakeWeapon == IT_SHOTGUN)
{ {
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
W_FireShotgun( iQuadSound ); W_FireShotgun( iQuadSound );
} }
else if (m_iQuakeWeapon == IT_SUPER_SHOTGUN) else if (m_iQuakeWeapon == IT_SUPER_SHOTGUN)
{ {
m_flNextAttack = UTIL_WeaponTimeBase() + 0.7; if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.4;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.7;
W_FireSuperShotgun( iQuadSound ); W_FireSuperShotgun( iQuadSound );
} }
@ -970,13 +1016,19 @@ void CBasePlayer::W_Attack( int iQuadSound )
} }
else if (m_iQuakeWeapon == IT_GRENADE_LAUNCHER) else if (m_iQuakeWeapon == IT_GRENADE_LAUNCHER)
{ {
m_flNextAttack = UTIL_WeaponTimeBase() + 0.6; if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.3;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.6;
W_FireGrenade( iQuadSound ); W_FireGrenade( iQuadSound );
} }
else if (m_iQuakeWeapon == IT_ROCKET_LAUNCHER) else if (m_iQuakeWeapon == IT_ROCKET_LAUNCHER)
{ {
m_flNextAttack = UTIL_WeaponTimeBase() + 0.8; if( m_iRuneStatus == ITEM_RUNE3_FLAG )
m_flNextAttack = UTIL_WeaponTimeBase() + 0.4;
else
m_flNextAttack = UTIL_WeaponTimeBase() + 0.8;
W_FireRocket( iQuadSound ); W_FireRocket( iQuadSound );
} }
@ -990,6 +1042,13 @@ void CBasePlayer::W_Attack( int iQuadSound )
W_FireLightning( iQuadSound ); W_FireLightning( iQuadSound );
} }
else if( m_iQuakeWeapon == IT_EXTRA_WEAPON )
{
if( !m_bHook_Out )
W_FireHook();
m_flNextAttack = UTIL_WeaponTimeBase() + 0.1;
}
// Make player attack // Make player attack
if ( pev->health >= 0 ) if ( pev->health >= 0 )

54
dlls/multiplay_gamerules.cpp

@ -42,6 +42,8 @@ extern int g_teamplay;
bool g_bHaveMOTD; bool g_bHaveMOTD;
const char *GetTeamName( int team );
#define INTERMISSION_TIME 60 #define INTERMISSION_TIME 60
#define ITEM_RESPAWN_TIME 30 #define ITEM_RESPAWN_TIME 30
#define WEAPON_RESPAWN_TIME 20 #define WEAPON_RESPAWN_TIME 20
@ -467,6 +469,12 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl )
( pl->pev->netname && ( STRING( pl->pev->netname ) )[0] != 0 ) ? STRING( pl->pev->netname ) : "unconnected" ) ); ( pl->pev->netname && ( STRING( pl->pev->netname ) )[0] != 0 ) ? STRING( pl->pev->netname ) : "unconnected" ) );
// team match? // team match?
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" entered the game\n",
STRING( pl->pev->netname ),
GETPLAYERUSERID( pl->edict() ),
GETPLAYERAUTHID( pl->edict() ),
GetTeamName( pl->pev->team ) );
/*
if( g_teamplay ) if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" entered the game\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" entered the game\n",
@ -482,7 +490,7 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl )
GETPLAYERUSERID( pl->edict() ), GETPLAYERUSERID( pl->edict() ),
GETPLAYERAUTHID( pl->edict() ), GETPLAYERAUTHID( pl->edict() ),
GETPLAYERUSERID( pl->edict() ) ); GETPLAYERUSERID( pl->edict() ) );
} }*/
UpdateGameMode( pl ); UpdateGameMode( pl );
@ -543,7 +551,13 @@ void CHalfLifeMultiplay::ClientDisconnected( edict_t *pClient )
FireTargets( "game_playerleave", pPlayer, pPlayer, USE_TOGGLE, 0 ); FireTargets( "game_playerleave", pPlayer, pPlayer, USE_TOGGLE, 0 );
// team match? // team match?
if( g_teamplay ) UTIL_LogPrintf( "\"%s<%i><%s><%s>\" disconnected\n",
STRING( pPlayer->pev->netname ),
GETPLAYERUSERID( pPlayer->edict() ),
GETPLAYERAUTHID( pPlayer->edict() ),
GetTeamName( pPlayer->pev->team ) );
/*if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" disconnected\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" disconnected\n",
STRING( pPlayer->pev->netname ), STRING( pPlayer->pev->netname ),
@ -558,7 +572,7 @@ void CHalfLifeMultiplay::ClientDisconnected( edict_t *pClient )
GETPLAYERUSERID( pPlayer->edict() ), GETPLAYERUSERID( pPlayer->edict() ),
GETPLAYERAUTHID( pPlayer->edict() ), GETPLAYERAUTHID( pPlayer->edict() ),
GETPLAYERUSERID( pPlayer->edict() ) ); GETPLAYERUSERID( pPlayer->edict() ) );
} }*/
pPlayer->RemoveAllItems( TRUE );// destroy all of the players weapons and items pPlayer->RemoveAllItems( TRUE );// destroy all of the players weapons and items
} }
@ -856,6 +870,13 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
// killed self // killed self
// team match? // team match?
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n",
STRING( pVictim->pev->netname ),
GETPLAYERUSERID( pVictim->edict() ),
GETPLAYERAUTHID( pVictim->edict() ),
GetTeamName( pVictim->pev->team ),
killer_weapon_name );
/*
if( g_teamplay ) if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n",
@ -873,12 +894,22 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
GETPLAYERAUTHID( pVictim->edict() ), GETPLAYERAUTHID( pVictim->edict() ),
GETPLAYERUSERID( pVictim->edict() ), GETPLAYERUSERID( pVictim->edict() ),
killer_weapon_name ); killer_weapon_name );
} }*/
} }
else if( pKiller->flags & FL_CLIENT ) else if( pKiller->flags & FL_CLIENT )
{ {
// team match? // team match?
if( g_teamplay ) UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n",
STRING( pKiller->netname ),
GETPLAYERUSERID( ENT(pKiller) ),
GETPLAYERAUTHID( ENT(pKiller) ),
GetTeamName( pKiller->team ),
STRING( pVictim->pev->netname ),
GETPLAYERUSERID( pVictim->edict() ),
GETPLAYERAUTHID( pVictim->edict() ),
GetTeamName( pVictim->pev->team ),
killer_weapon_name );
/*if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n",
STRING( pKiller->netname ), STRING( pKiller->netname ),
@ -903,14 +934,21 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
GETPLAYERAUTHID( pVictim->edict() ), GETPLAYERAUTHID( pVictim->edict() ),
GETPLAYERUSERID( pVictim->edict() ), GETPLAYERUSERID( pVictim->edict() ),
killer_weapon_name ); killer_weapon_name );
} }*/
} }
else else
{ {
// killed by the world // killed by the world
// team match? // team match?
if( g_teamplay ) UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n",
STRING( pVictim->pev->netname ),
GETPLAYERUSERID( pVictim->edict() ),
GETPLAYERAUTHID( pVictim->edict() ),
GetTeamName( pVictim->pev->team ),
killer_weapon_name );
/*if( g_teamplay )
{ {
UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n", UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n",
STRING( pVictim->pev->netname ), STRING( pVictim->pev->netname ),
@ -927,7 +965,7 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
GETPLAYERAUTHID( pVictim->edict() ), GETPLAYERAUTHID( pVictim->edict() ),
GETPLAYERUSERID( pVictim->edict() ), GETPLAYERUSERID( pVictim->edict() ),
killer_weapon_name ); killer_weapon_name );
} }*/
} }
MESSAGE_BEGIN( MSG_SPEC, SVC_DIRECTOR ); MESSAGE_BEGIN( MSG_SPEC, SVC_DIRECTOR );

39
dlls/player.h

@ -71,6 +71,11 @@ typedef enum
PLAYER_ATTACK1 PLAYER_ATTACK1
} PLAYER_ANIM; } PLAYER_ANIM;
enum Player_Menu {
Team_Menu,
Team_Menu_IG
};
#define MAX_ID_RANGE 2048 #define MAX_ID_RANGE 2048
#define SBAR_STRING_SIZE 128 #define SBAR_STRING_SIZE 128
@ -441,6 +446,35 @@ public:
bool Spectate_HLTV(); bool Spectate_HLTV();
bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message. bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message.
//-- Martin Webrant //-- Martin Webrant
int m_bHasFlag;
void ShowMenu( int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText );
int m_iMenu;
float m_flNextTeamChange;
CBasePlayer *pFlagCarrierKiller;
CBasePlayer *pFlagReturner;
CBasePlayer *pCarrierHurter;
float m_flCarrierHurtTime;
float m_flCarrierPickupTime;
float m_flFlagCarrierKillTime;
float m_flFlagReturnTime;
float m_flFlagStatusTime;
float m_flRegenTime;
int m_iRuneStatus;
void W_FireHook();
void Throw_Grapple();
bool m_bHook_Out;
bool m_bOn_Hook;
CBaseEntity *m_ppHook;
void Service_Grapple();
}; };
//++ BulliT //++ BulliT
@ -513,6 +547,11 @@ inline bool CBasePlayer::IsProxy()
#define IT_SUIT (1 << 21) #define IT_SUIT (1 << 21)
#define IT_QUAD (1 << 22) #define IT_QUAD (1 << 22)
#define ITEM_RUNE1_FLAG 1
#define ITEM_RUNE2_FLAG 2
#define ITEM_RUNE3_FLAG 3
#define ITEM_RUNE4_FLAG 4
#define AUTOAIM_2DEGREES 0.0348994967025 #define AUTOAIM_2DEGREES 0.0348994967025
#define AUTOAIM_5DEGREES 0.08715574274766 #define AUTOAIM_5DEGREES 0.08715574274766
#define AUTOAIM_8DEGREES 0.1391731009601 #define AUTOAIM_8DEGREES 0.1391731009601

Loading…
Cancel
Save