mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-04-20 18:07:26 +00:00
add new fixes:crowbar and new CheckButton
This commit is contained in:
parent
ad58f94edc
commit
8fba5a9979
@ -367,7 +367,19 @@ 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;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
// $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"
|
||||||
@ -236,7 +237,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.2;// indicates the width of this monster's forward view cone ( as a dotproduct result )
|
m_flFieldOfView = 0.4;// 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;
|
||||||
@ -445,9 +446,7 @@ 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
|
||||||
if(GetEnemy() != NULL && GetEnemies() != NULL){
|
|
||||||
pSquadLeader->GetEnemies()->MarkAsEluded( GetEnemy() );
|
pSquadLeader->GetEnemies()->MarkAsEluded( GetEnemy() );
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -644,6 +643,10 @@ 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;
|
||||||
@ -788,7 +791,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.3; // 1/3 second.
|
m_flNextGrenadeCheck = gpGlobals->curtime + 0.1; // 1/3 second.
|
||||||
|
|
||||||
return COND_CAN_RANGE_ATTACK2;
|
return COND_CAN_RANGE_ATTACK2;
|
||||||
}
|
}
|
||||||
|
@ -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 );
|
CTakeDamageInfo info( this, this, m_iHitDmg, DMG_CLUB | DMG_ALWAYSGIB );
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#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"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
#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;
|
||||||
@ -45,7 +47,7 @@ class CWeaponCrowbar : public CBaseHL1MPCombatWeapon
|
|||||||
public:
|
public:
|
||||||
DECLARE_NETWORKCLASS();
|
DECLARE_NETWORKCLASS();
|
||||||
DECLARE_PREDICTABLE();
|
DECLARE_PREDICTABLE();
|
||||||
#ifndef CLIENT_DLLhl1_crowbar_tile_vol
|
#ifndef CLIENT_DLL
|
||||||
DECLARE_DATADESC();
|
DECLARE_DATADESC();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -63,7 +65,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( CBaseEntity *pHitEntity , trace_t &hitTrace );
|
void ImpactSound( bool isWorld , trace_t &hitTrace , CBaseEntity *pHitEntity);
|
||||||
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:
|
||||||
@ -184,8 +186,9 @@ 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 , m_traceHit );
|
ImpactSound( pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE, m_traceHit , pHitEntity );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Apply an impact effect
|
//Apply an impact effect
|
||||||
@ -197,31 +200,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( CBaseEntity *pHitEntity , trace_t &hitTrace )
|
void CWeaponCrowbar::ImpactSound( bool isWorld , trace_t &hitTrace , CBaseEntity *pHitEntity )
|
||||||
{
|
{
|
||||||
bool bIsWorld = ( pHitEntity->entindex() == 0 );
|
bool IsWorld = ( pHitEntity->entindex() );
|
||||||
#ifndef CLIENT_DLL
|
#ifndef CLIENT_DLL
|
||||||
if ( !bIsWorld )
|
if ( !isWorld )
|
||||||
{
|
{
|
||||||
bIsWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
|
isWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bIsWorld)
|
if( isWorld )
|
||||||
{
|
{
|
||||||
switch (random->RandomInt(0, 1))
|
switch (random->RandomInt(0, 1))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
UTIL_EmitAmbientSound(GetOwner()->entindex(), GetOwner()->GetAbsOrigin(), "weapons/cbar_hit1.wav", 0.5, SNDLVL_GUNFIRE, 0, 98 + random->RandomInt(0, 3));
|
WeaponSound( MELEE_HIT_WORLD );
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
UTIL_EmitAmbientSound(GetOwner()->entindex(), GetOwner()->GetAbsOrigin(), "weapons/cbar_hit2.wav", 0.5, SNDLVL_GUNFIRE, 0, 98 + random->RandomInt(0, 3));
|
WeaponSound( MELEE_HIT );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WeaponSound(MELEE_HIT);
|
WeaponSound( MELEE_MISS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ void COptionsSubDifficulty::OnApplyChanges()
|
|||||||
{
|
{
|
||||||
var.SetValue( 2 );
|
var.SetValue( 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user