Skip to content

Commit

Permalink
add mp_hevsuit_voice and notify if spawning with longjump
Browse files Browse the repository at this point in the history
mp_hevsuit_voice 1 = enable suit voice from hlsp.

On a few maps you get no indication that you have a longjump and so players fail jumps trying to do them the hard way. Also prevented multiple longjumps spawning on a player.
  • Loading branch information
wootguy committed Dec 23, 2024
1 parent bfc590f commit 26b3dca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dlls/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ cvar_t mp_damage_points ={"mp_damage_points", "0.01", FCVAR_SERVER, 0, 0 };
cvar_t mp_antiblock ={"mp_antiblock", "1", FCVAR_SERVER, 0, 0 };
cvar_t mp_antiblock_cooldown ={"mp_antiblock_cooldown", "3", FCVAR_SERVER, 0, 0 };
cvar_t mp_min_score_mult ={"mp_min_score_mult", "20", FCVAR_SERVER, 0, 0 };
cvar_t mp_hevsuit_voice ={"mp_hevsuit_voice", "0", FCVAR_SERVER, 0, 0 };

cvar_t soundvariety={"mp_soundvariety","0", FCVAR_SERVER, 0, 0 };
cvar_t mp_npcidletalk={"mp_npcidletalk","1", FCVAR_SERVER, 0, 0 };
Expand Down Expand Up @@ -412,6 +413,7 @@ void GameDLLInit( void )
CVAR_REGISTER (&mp_antiblock);
CVAR_REGISTER (&mp_antiblock_cooldown);
CVAR_REGISTER (&mp_min_score_mult);
CVAR_REGISTER (&mp_hevsuit_voice);

CVAR_REGISTER (&mp_chattime);

Expand Down
1 change: 1 addition & 0 deletions dlls/game/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ EXPORT extern cvar_t mp_damage_points; // score points given per point of damage
EXPORT extern cvar_t mp_antiblock; // enables player swapping with +use
EXPORT extern cvar_t mp_antiblock_cooldown; // how long a player needs to wait before swapping again after a "rude" swap
EXPORT extern cvar_t mp_min_score_mult; // minimum score multiplier for death penalties
EXPORT extern cvar_t mp_hevsuit_voice; // enable/disable the hev suit voice

// Enables classic func_pushable physics (which is horribly broken, but fun)
// The higher your FPS, the faster you can boost pushables. You also get boosted.
Expand Down
13 changes: 11 additions & 2 deletions dlls/player/CBasePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ void CBasePlayer::CheckSuitUpdate()
// if in range of radiation source, ping geiger counter
UpdateGeigerCounter();

if ( g_pGameRules->IsMultiplayer() )
if (!mp_hevsuit_voice.value)
{
// don't bother updating HEV voice in multiplayer.
return;
Expand Down Expand Up @@ -2898,7 +2898,7 @@ void CBasePlayer::SetSuitUpdate(const char *name, int fgroup, int iNoRepeatTime)
if ( !(pev->weapons & (1<<WEAPON_SUIT)) )
return;

if ( g_pGameRules->IsMultiplayer() )
if (!mp_hevsuit_voice.value)
{
// due to static channel design, etc. We don't play HEV sounds in multiplayer right now.
return;
Expand Down Expand Up @@ -4449,6 +4449,15 @@ void CBasePlayer :: UpdateClientData( void )
FireTargets( "game_playerspawn", this, this, USE_TOGGLE, 0 );

InitStatusBar();

if (m_fLongJump) {
MESSAGE_BEGIN(MSG_ONE, gmsgItemPickup, NULL, pev);
WRITE_STRING("item_longjump");
MESSAGE_END();

if (pev->weapons & (1 << WEAPON_SUIT))
EMIT_SOUND_SUIT(edict(), "!HEV_A1");
}
}

if ( m_iHideHUD != m_iClientHideHUD )
Expand Down
5 changes: 5 additions & 0 deletions dlls/triggers/CGamePlayerEquip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "CHandGrenade.h"
#include "CSqueak.h"
#include "skill.h"
#include "user_messages.h"

LINK_ENTITY_TO_CLASS(game_player_equip, CGamePlayerEquip)

Expand Down Expand Up @@ -170,6 +171,10 @@ void equipPlayerWithItem(CBasePlayer* pPlayer, const char* itemName, int count)
if (giveAmount > 0)
pPlayer->GiveAmmo(HANDGRENADE_DEFAULT_GIVE * giveAmount, "Hand Grenade", gSkillData.sk_ammo_max_grenades);
}
else if (!strcmp(itemName, "item_longjump")) {
pPlayer->m_fLongJump = TRUE;
g_engfuncs.pfnSetPhysicsKeyValue(pPlayer->edict(), "slj", "1");
}
else {
for (int j = 0; j < count; j++) {
if (!pPlayer->HasNamedPlayerItem(itemName))
Expand Down

0 comments on commit 26b3dca

Please sign in to comment.