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 ); 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; return ret;
} }

View File

@ -12,7 +12,6 @@
// $NoKeywords: $ // $NoKeywords: $
//=============================================================================// //=============================================================================//
#include "ai_condition.h"
#include "cbase.h" #include "cbase.h"
#include "beam_shared.h" #include "beam_shared.h"
#include "ai_default.h" #include "ai_default.h"
@ -237,7 +236,7 @@ void CNPC_HGrunt::Spawn()
m_bloodColor = BLOOD_COLOR_RED; m_bloodColor = BLOOD_COLOR_RED;
ClearEffects(); ClearEffects();
m_iHealth = sk_hgrunt_health.GetFloat(); 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_NPCState = NPC_STATE_NONE;
m_flNextGrenadeCheck = gpGlobals->curtime + 1; m_flNextGrenadeCheck = gpGlobals->curtime + 1;
m_flNextPainTime = gpGlobals->curtime; m_flNextPainTime = gpGlobals->curtime;
@ -446,7 +445,9 @@ void CNPC_HGrunt::PrescheduleThink ( void )
if ( gpGlobals->curtime - pSquadLeader->m_flLastEnemySightTime > 5.0f ) if ( gpGlobals->curtime - pSquadLeader->m_flLastEnemySightTime > 5.0f )
{ {
// been a while since we've seen the enemy // been a while since we've seen the enemy
pSquadLeader->GetEnemies()->MarkAsEluded( GetEnemy() ); 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. // kick nonclients, but don't shoot at them.
return COND_NONE; return COND_NONE;
} }
if (GetEnemy())
{
return COND_CAN_RANGE_ATTACK1;
}
Vector vecSrc; Vector vecSrc;
QAngle angAngles; QAngle angAngles;
@ -791,7 +788,7 @@ int CNPC_HGrunt::GetGrenadeConditions( float flDot, float flDist )
m_vecTossVelocity = vecToss; m_vecTossVelocity = vecToss;
// don't check again for a while. // 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; 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. //as the ragdoll only covers the top portion of the tentacle.
if ( pOther->m_takedamage ) 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(); Vector vDamageForce = pOther->GetAbsOrigin() - GetAbsOrigin();
VectorNormalize( vDamageForce ); VectorNormalize( vDamageForce );
CalculateMeleeDamageForce( &info, vDamageForce, pOther->GetAbsOrigin()); CalculateMeleeDamageForce( &info, vDamageForce, pOther->GetAbsOrigin() );
pOther->TakeDamage( info );
m_flHitTime = gpGlobals->curtime + 0.5; m_flHitTime = gpGlobals->curtime + 0.5;
} }

View File

@ -7,7 +7,6 @@
#include "cbase.h" #include "cbase.h"
#include "hl1mp_basecombatweapon_shared.h" #include "hl1mp_basecombatweapon_shared.h"
#include "weapon_parse.h"
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
#include "c_baseplayer.h" #include "c_baseplayer.h"
@ -23,7 +22,6 @@
#include "mathlib/mathlib.h" #include "mathlib/mathlib.h"
#include "in_buttons.h" #include "in_buttons.h"
#include "vstdlib/random.h" #include "vstdlib/random.h"
extern ConVar sk_plr_dmg_crowbar; extern ConVar sk_plr_dmg_crowbar;
@ -47,7 +45,7 @@ class CWeaponCrowbar : public CBaseHL1MPCombatWeapon
public: public:
DECLARE_NETWORKCLASS(); DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE(); DECLARE_PREDICTABLE();
#ifndef CLIENT_DLL #ifndef CLIENT_DLLhl1_crowbar_tile_vol
DECLARE_DATADESC(); DECLARE_DATADESC();
#endif #endif
@ -65,7 +63,7 @@ private:
virtual void Swing( void ); virtual void Swing( void );
virtual void Hit( void ); virtual void Hit( void );
virtual void ImpactEffect( 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 ); virtual Activity ChooseIntersectionPointAndActivity( trace_t &hitTrace, const Vector &mins, const Vector &maxs, CBasePlayer *pOwner );
public: public:
@ -97,7 +95,7 @@ BEGIN_DATADESC( CWeaponCrowbar )
// Function Pointers // Function Pointers
DEFINE_FUNCTION( Hit ), DEFINE_FUNCTION( Hit ),
END_DATADESC() END_DATADESC()
#endif #endif
@ -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 ); TraceAttackToTriggers( CTakeDamageInfo( GetOwner(), GetOwner(), sk_plr_dmg_crowbar.GetFloat(), DMG_CLUB ), m_traceHit.startpos, m_traceHit.endpos, hitDirection );
//Play an impact sound //Play an impact sound
ImpactSound( pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE, m_traceHit , pHitEntity ); ImpactSound( pHitEntity , m_traceHit );
} }
#endif #endif
//Apply an impact effect //Apply an impact effect
@ -200,31 +197,31 @@ void CWeaponCrowbar::Hit( void )
// Input : pHitEntity - entity that we hit // Input : pHitEntity - entity that we hit
// assumes pHitEntity is not null // 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 #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 #endif
if( isWorld ) if (bIsWorld)
{ {
switch (random->RandomInt(0, 1)) switch (random->RandomInt(0, 1))
{ {
case 0: 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; break;
case 1: 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; break;
} }
} }
else else
{ {
WeaponSound( MELEE_MISS ); WeaponSound(MELEE_HIT);
} }
} }

View File

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

View File

@ -133,4 +133,4 @@ void COptionsSubModification::OnCommand(const char *command)
{ {
BaseClass::OnCommand(command); // Make sure to call the base class for any other commands BaseClass::OnCommand(command); // Make sure to call the base class for any other commands
} }
} }

View File

@ -62,4 +62,4 @@ private:
CCvarSlider *m_pAspectRatioSlider; CCvarSlider *m_pAspectRatioSlider;
}; };
#endif // OPTIONS_SUB_MODIFICATION_H #endif // OPTIONS_SUB_MODIFICATION_H