mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-30 16:44:29 +00:00
mp_coop cvar with some coop features
This commit is contained in:
parent
65871ac312
commit
1443818300
@ -602,6 +602,10 @@ void CBaseMonster::Killed( entvars_t *pevAttacker, int iGib )
|
||||
|
||||
Remember( bits_MEMORY_KILLED );
|
||||
|
||||
CBaseEntity *activator = CBaseEntity::Instance( pevAttacker );
|
||||
if( activator && activator->IsPlayer() )
|
||||
activator->AddPoints( 1, true );
|
||||
|
||||
// clear the deceased's sound channels.(may have been firing or reloading when killed)
|
||||
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "common/null.wav", 1, ATTN_NORM );
|
||||
m_IdealMonsterState = MONSTERSTATE_DEAD;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "decals.h"
|
||||
#include "func_break.h"
|
||||
#include "shake.h"
|
||||
#include "game.h"
|
||||
|
||||
#define SF_GIBSHOOTER_REPEATABLE 1 // allows a gibshooter to be refired
|
||||
|
||||
@ -1943,8 +1944,14 @@ void CFade::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType
|
||||
if( pev->spawnflags & SF_FADE_MODULATE )
|
||||
fadeFlags |= FFADE_MODULATE;
|
||||
|
||||
if( pev->spawnflags & SF_FADE_ONLYONE )
|
||||
if( mp_coop.value || pev->spawnflags & SF_FADE_ONLYONE )
|
||||
{
|
||||
if( !pActivator || pActivator->IsNetClient() )
|
||||
{
|
||||
if( !pCaller )
|
||||
return;
|
||||
pActivator = pCaller;
|
||||
}
|
||||
if( pActivator->IsNetClient() )
|
||||
{
|
||||
UTIL_ScreenFade( pActivator, pev->rendercolor, Duration(), HoldTime(), pev->renderamt, fadeFlags );
|
||||
|
@ -49,6 +49,8 @@ cvar_t cvar_gibtime = { "mp_gibtime","250", FCVAR_SERVER };
|
||||
cvar_t cvar_hgibcount = { "mp_hgibcount","12", FCVAR_SERVER };
|
||||
cvar_t cvar_agibcount = { "mp_agibcount","8", FCVAR_SERVER };
|
||||
cvar_t mp_chattime = { "mp_chattime","10", FCVAR_SERVER };
|
||||
cvar_t mp_gravgun_players = { "mp_gravgun_players", "0", FCVAR_SERVER };
|
||||
cvar_t mp_coop = { "mp_coop", "0", FCVAR_SERVER };
|
||||
|
||||
// Engine Cvars
|
||||
cvar_t *g_psv_gravity = NULL;
|
||||
@ -490,6 +492,9 @@ void GameDLLInit( void )
|
||||
CVAR_REGISTER( &cvar_gibtime );
|
||||
CVAR_REGISTER( &cvar_hgibcount );
|
||||
CVAR_REGISTER( &cvar_agibcount );
|
||||
CVAR_REGISTER( &mp_gravgun_players );
|
||||
CVAR_REGISTER( &mp_coop );
|
||||
|
||||
|
||||
CVAR_REGISTER( &mp_chattime );
|
||||
|
||||
|
@ -47,6 +47,8 @@ extern cvar_t cvar_gibtime;
|
||||
extern cvar_t cvar_hgibcount;
|
||||
extern cvar_t cvar_agibcount;
|
||||
|
||||
extern cvar_t mp_gravgun_players;
|
||||
extern cvar_t mp_coop;
|
||||
// Engine Cvars
|
||||
extern cvar_t *g_psv_gravity;
|
||||
extern cvar_t *g_psv_aim;
|
||||
|
@ -640,8 +640,11 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller,
|
||||
}
|
||||
else if( ktmp && ktmp->IsPlayer() )
|
||||
{
|
||||
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
||||
pKiller->frags += IPointsForKill( peKiller, pVictim );
|
||||
if( mp_coop.value )
|
||||
pKiller->frags -= 10;
|
||||
else
|
||||
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
||||
pKiller->frags += IPointsForKill( peKiller, pVictim );
|
||||
|
||||
FireTargets( "game_playerkill", ktmp, ktmp, USE_TOGGLE, 0 );
|
||||
}
|
||||
|
@ -3738,6 +3738,17 @@ void CBasePlayer::SendAmmoUpdate( void )
|
||||
}
|
||||
}
|
||||
|
||||
float CBasePlayer::TouchGravGun( CBaseEntity *attacker, int stage )
|
||||
{
|
||||
if( stage == 3 )
|
||||
return 200;
|
||||
if( mp_gravgun_players.value )
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
=========================================================
|
||||
UpdateClientData
|
||||
|
@ -309,12 +309,7 @@ public:
|
||||
|
||||
float m_flNextChatTime;
|
||||
|
||||
virtual float TouchGravGun( CBaseEntity *attacker, int stage )
|
||||
{
|
||||
if( stage == 3 )
|
||||
return 200;
|
||||
return 0;
|
||||
}
|
||||
virtual float TouchGravGun( CBaseEntity *attacker, int stage );
|
||||
};
|
||||
|
||||
#define AUTOAIM_2DEGREES 0.0348994967025
|
||||
|
Loading…
x
Reference in New Issue
Block a user