Browse Source

Implement "Scientist-o-matic".

visitors
Night Owl 7 years ago
parent
commit
792c824052
  1. 3
      dlls/client.cpp
  2. 22
      dlls/player.cpp
  3. 34
      dlls/scientist.cpp
  4. 4
      dlls/visitors/kevlar.cpp

3
dlls/client.cpp

@ -931,7 +931,10 @@ void ClientPrecache( void ) @@ -931,7 +931,10 @@ void ClientPrecache( void )
PRECACHE_SOUND( "player/ear_ringing.wav" );
if( giPrecacheGrunt )
{
UTIL_PrecacheOther( "monster_human_grunt" );
UTIL_PrecacheOther( "monster_scientist" );
}
}
/*

22
dlls/player.cpp

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
Y/***
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
@ -3437,6 +3437,20 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) @@ -3437,6 +3437,20 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse )
Create( "monster_human_grunt", pev->origin + gpGlobals->v_forward * 128, pev->angles );
}
break;
case 77:
if( !giPrecacheGrunt )
{
giPrecacheGrunt = 1;
ALERT( at_console, "You must now restart to use Scientist-o-matic.\n" );
}
else
{
UTIL_MakeVectors( Vector( 0, pev->v_angle.y, 0 ) );
CBaseEntity *pEntity = Create( "monster_scientist", pev->origin + gpGlobals->v_forward * 128, pev->angles );
pEntity->pev->body = -1;
pEntity->Spawn();
}
break;
case 101:
gEvilImpulse101 = TRUE;
// GiveNamedItem( "item_suit" );
@ -3910,14 +3924,14 @@ void CBasePlayer::UpdateClientData( void ) @@ -3910,14 +3924,14 @@ void CBasePlayer::UpdateClientData( void )
|| FStrEq( STRING( gpGlobals->mapname ), "vis06" )
|| FStrEq( STRING( gpGlobals->mapname ), "vis_credits" ) )
{
SetBits( m_iHideHUD, HIDEHUD_WEAPONS | HIDEHUD_HEALTH | HIDEHUD_FLASHLIGHT | HIDEHUD_SUIT )
SetBits( m_iHideHUD, HIDEHUD_WEAPONS | HIDEHUD_HEALTH | HIDEHUD_FLASHLIGHT | HIDEHUD_SUIT );
}
else
{
ClearBits( m_iHideHUD, HIDEHUD_WEAPONS | HIDEHUD_HEALTH | HIDEHUD_FLASHLIGHT | HIDEHUD_SUIT )
ClearBits( m_iHideHUD, HIDEHUD_WEAPONS | HIDEHUD_HEALTH | HIDEHUD_FLASHLIGHT | HIDEHUD_SUIT );
if( !( pev->weapons & ( 1 << WEAPON_SUIT ) ) || pev->armorvalue == 0 )
{
SetBits( m_iHideHUD, HIDEHUD_SUIT )
SetBits( m_iHideHUD, HIDEHUD_SUIT );
}
}

34
dlls/scientist.cpp

@ -643,23 +643,6 @@ void CScientist::Spawn( void ) @@ -643,23 +643,6 @@ void CScientist::Spawn( void )
const char *pszModel;
Precache();
UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_STEP;
m_bloodColor = BLOOD_COLOR_RED;
pev->health = gSkillData.scientistHealth;
pev->view_ofs = Vector( 0, 0, 50 );// position of the eyes relative to monster's origin.
m_flFieldOfView = VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so scientists will notice player and say hello
m_MonsterState = MONSTERSTATE_NONE;
//m_flDistTooFar = 256.0;
m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_OPEN_DOORS | bits_CAP_AUTO_DOORS | bits_CAP_USE;
// White hands
pev->skin = 0;
if( pev->body == -1 )
{
// -1 chooses a random head
@ -679,10 +662,27 @@ void CScientist::Spawn( void ) @@ -679,10 +662,27 @@ void CScientist::Spawn( void )
SET_MODEL( ENT( pev ), pszModel );
// White hands
pev->skin = 0;
// Luther is black, make his hands black
if( pev->body == HEAD_LUTHER || pev->body == HEAD_NEW_BLACK )
pev->skin = 1;
UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_STEP;
m_bloodColor = BLOOD_COLOR_RED;
pev->health = gSkillData.scientistHealth;
pev->view_ofs = Vector( 0, 0, 50 );// position of the eyes relative to monster's origin.
m_flFieldOfView = VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so scientists will notice player and say hello
m_MonsterState = MONSTERSTATE_NONE;
//m_flDistTooFar = 256.0;
m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_OPEN_DOORS | bits_CAP_AUTO_DOORS | bits_CAP_USE;
MonsterInit();
SetUse( &CTalkMonster::FollowerUse );
}

4
dlls/visitors/kevlar.cpp

@ -43,11 +43,11 @@ class CItemKevlar : public CItem @@ -43,11 +43,11 @@ class CItemKevlar : public CItem
return FALSE;
if( !( pPlayer->pev->weapons & ( 1 << WEAPON_SUIT ) ) )
pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT )
pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT );
pPlayer->pev->armorvalue = MAX_NORMAL_BATTERY;
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "player/kevlar_zipper.wav", 1, ATTN_NORM, 0, RANDOM_LONG( 100, 150 ) );
EMIT_SOUND_DYN( ENT( pPlayer->pev ), CHAN_ITEM, "player/kevlar_zipper.wav", 1, ATTN_NORM, 0, RANDOM_LONG( 100, 150 ) );
MESSAGE_BEGIN( MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev );
WRITE_STRING( STRING( pev->classname ) );

Loading…
Cancel
Save