Compare commits

..

1 Commits

Author SHA1 Message Date
I#Oleg
5576e512de
Merge ad58f94edc into 29985681a1 2025-01-16 15:55:45 +00:00
7 changed files with 24 additions and 43 deletions

View File

@ -367,19 +367,7 @@ int CNPC_Barney::OnTakeDamage_Alive( const CTakeDamageInfo &inputInfo )
{
Speak( BA_SHOT );
}
}
if (gpGlobals->curtime >= m_flPainTime)
{
m_flPainTime = gpGlobals->curtime + random->RandomFloat(0.5, 0.75);
CPASAttenuationFilter filter(this);
EmitSound(filter, entindex(), "Barney.Pain");
}
return ret;
}

View File

@ -12,7 +12,6 @@
// $NoKeywords: $
//=============================================================================//
#include "ai_condition.h"
#include "cbase.h"
#include "beam_shared.h"
#include "ai_default.h"
@ -237,7 +236,7 @@ void CNPC_HGrunt::Spawn()
m_bloodColor = BLOOD_COLOR_RED;
ClearEffects();
m_iHealth = sk_hgrunt_health.GetFloat();
m_flFieldOfView = 0.4;// indicates the width of this monster's forward view cone ( as a dotproduct result )
m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result )
m_NPCState = NPC_STATE_NONE;
m_flNextGrenadeCheck = gpGlobals->curtime + 1;
m_flNextPainTime = gpGlobals->curtime;
@ -446,7 +445,9 @@ void CNPC_HGrunt::PrescheduleThink ( void )
if ( gpGlobals->curtime - pSquadLeader->m_flLastEnemySightTime > 5.0f )
{
// been a while since we've seen the enemy
if(GetEnemy() != NULL && GetEnemies() != NULL){
pSquadLeader->GetEnemies()->MarkAsEluded( GetEnemy() );
}
}
}
@ -643,10 +644,6 @@ int CNPC_HGrunt::RangeAttack1Conditions ( float flDot, float flDist )
// kick nonclients, but don't shoot at them.
return COND_NONE;
}
if (GetEnemy())
{
return COND_CAN_RANGE_ATTACK1;
}
Vector vecSrc;
QAngle angAngles;
@ -791,7 +788,7 @@ int CNPC_HGrunt::GetGrenadeConditions( float flDot, float flDist )
m_vecTossVelocity = vecToss;
// don't check again for a while.
m_flNextGrenadeCheck = gpGlobals->curtime + 0.1; // 1/3 second.
m_flNextGrenadeCheck = gpGlobals->curtime + 0.3; // 1/3 second.
return COND_CAN_RANGE_ATTACK2;
}

View File

@ -936,13 +936,13 @@ void CNPC_Tentacle::HitTouch( CBaseEntity *pOther )
//as the ragdoll only covers the top portion of the tentacle.
if ( pOther->m_takedamage )
{
CTakeDamageInfo info( this, this, m_iHitDmg, DMG_CLUB | DMG_ALWAYSGIB );
CTakeDamageInfo info( this, this, m_iHitDmg, DMG_CLUB );
Vector vDamageForce = pOther->GetAbsOrigin() - GetAbsOrigin();
VectorNormalize( vDamageForce );
CalculateMeleeDamageForce( &info, vDamageForce, pOther->GetAbsOrigin() );
pOther->TakeDamage( info );
m_flHitTime = gpGlobals->curtime + 0.5;
}

View File

@ -7,7 +7,6 @@
#include "cbase.h"
#include "hl1mp_basecombatweapon_shared.h"
#include "weapon_parse.h"
#ifdef CLIENT_DLL
#include "c_baseplayer.h"
@ -23,7 +22,6 @@
#include "mathlib/mathlib.h"
#include "in_buttons.h"
#include "vstdlib/random.h"
extern ConVar sk_plr_dmg_crowbar;
@ -47,7 +45,7 @@ class CWeaponCrowbar : public CBaseHL1MPCombatWeapon
public:
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
#ifndef CLIENT_DLL
#ifndef CLIENT_DLLhl1_crowbar_tile_vol
DECLARE_DATADESC();
#endif
@ -65,7 +63,7 @@ private:
virtual void Swing( void );
virtual void Hit( void );
virtual void ImpactEffect( void );
void ImpactSound( bool isWorld , trace_t &hitTrace , CBaseEntity *pHitEntity);
void ImpactSound( CBaseEntity *pHitEntity , trace_t &hitTrace );
virtual Activity ChooseIntersectionPointAndActivity( trace_t &hitTrace, const Vector &mins, const Vector &maxs, CBasePlayer *pOwner );
public:
@ -186,9 +184,8 @@ void CWeaponCrowbar::Hit( void )
TraceAttackToTriggers( CTakeDamageInfo( GetOwner(), GetOwner(), sk_plr_dmg_crowbar.GetFloat(), DMG_CLUB ), m_traceHit.startpos, m_traceHit.endpos, hitDirection );
//Play an impact sound
ImpactSound( pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE, m_traceHit , pHitEntity );
ImpactSound( pHitEntity , m_traceHit );
}
#endif
//Apply an impact effect
@ -200,31 +197,31 @@ void CWeaponCrowbar::Hit( void )
// Input : pHitEntity - entity that we hit
// assumes pHitEntity is not null
//-----------------------------------------------------------------------------
void CWeaponCrowbar::ImpactSound( bool isWorld , trace_t &hitTrace , CBaseEntity *pHitEntity )
void CWeaponCrowbar::ImpactSound( CBaseEntity *pHitEntity , trace_t &hitTrace )
{
bool IsWorld = ( pHitEntity->entindex() );
bool bIsWorld = ( pHitEntity->entindex() == 0 );
#ifndef CLIENT_DLL
if ( !isWorld )
if ( !bIsWorld )
{
isWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
bIsWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
}
#endif
if( isWorld )
if (bIsWorld)
{
switch (random->RandomInt(0, 1))
{
case 0:
WeaponSound( MELEE_HIT_WORLD );
UTIL_EmitAmbientSound(GetOwner()->entindex(), GetOwner()->GetAbsOrigin(), "weapons/cbar_hit1.wav", 0.5, SNDLVL_GUNFIRE, 0, 98 + random->RandomInt(0, 3));
break;
case 1:
WeaponSound( MELEE_HIT );
UTIL_EmitAmbientSound(GetOwner()->entindex(), GetOwner()->GetAbsOrigin(), "weapons/cbar_hit2.wav", 0.5, SNDLVL_GUNFIRE, 0, 98 + random->RandomInt(0, 3));
break;
}
}
else
{
WeaponSound( MELEE_MISS );
WeaponSound(MELEE_HIT);
}
}

View File

@ -67,7 +67,6 @@ void COptionsSubDifficulty::OnApplyChanges()
{
var.SetValue( 2 );
}
}