Browse Source

game: fix satchel/tripmine damage and damage radius cvars (hrgve/hl2dm-bugfix@d2aa89fc0fbe732396be37cd65144dd3a9a943c3)

pull/112/head
SanyaSho 2 years ago
parent
commit
9a03faec58
  1. 13
      game/server/hl2mp/grenade_satchel.cpp
  2. 14
      game/server/hl2mp/grenade_tripmine.cpp

13
game/server/hl2mp/grenade_satchel.cpp

@ -19,9 +19,9 @@
#define SLAM_SPRITE "sprites/redglow1.vmt" #define SLAM_SPRITE "sprites/redglow1.vmt"
ConVar sk_plr_dmg_satchel ( "sk_plr_dmg_satchel","0"); ConVar sk_plr_dmg_satchel ( "sk_plr_dmg_satchel","150"); // commented lines in hl2/skill.cfg
ConVar sk_npc_dmg_satchel ( "sk_npc_dmg_satchel","0"); ConVar sk_npc_dmg_satchel ( "sk_npc_dmg_satchel","75");
ConVar sk_satchel_radius ( "sk_satchel_radius","0"); ConVar sk_satchel_radius ( "sk_satchel_radius","150");
BEGIN_DATADESC( CSatchelCharge ) BEGIN_DATADESC( CSatchelCharge )
@ -73,15 +73,14 @@ void CSatchelCharge::Spawn( void )
SetThink( &CSatchelCharge::SatchelThink ); SetThink( &CSatchelCharge::SatchelThink );
SetNextThink( gpGlobals->curtime + 0.1f ); SetNextThink( gpGlobals->curtime + 0.1f );
m_flDamage = sk_plr_dmg_satchel.GetFloat();
m_DmgRadius = sk_satchel_radius.GetFloat();
m_takedamage = DAMAGE_YES; m_takedamage = DAMAGE_YES;
m_iHealth = 1; m_iHealth = 1;
SetGravity( UTIL_ScaleForGravity( 560 ) ); // slightly lower gravity SetGravity( UTIL_ScaleForGravity( 560 ) ); // slightly lower gravity
SetFriction( 1.0 ); SetFriction( 1.0 );
SetSequence( 1 ); SetSequence( 1 );
SetDamage( 150 ); SetDamage( sk_plr_dmg_satchel.GetFloat() );
SetDamageRadius( sk_satchel_radius.GetFloat() );
m_bIsAttached = false; m_bIsAttached = false;
m_bInAir = true; m_bInAir = true;
@ -118,7 +117,7 @@ void CSatchelCharge::CreateEffects( void )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CSatchelCharge::InputExplode( inputdata_t &inputdata ) void CSatchelCharge::InputExplode( inputdata_t &inputdata )
{ {
ExplosionCreate( GetAbsOrigin() + Vector( 0, 0, 16 ), GetAbsAngles(), GetThrower(), GetDamage(), 200, ExplosionCreate( GetAbsOrigin() + Vector( 0, 0, 16 ), GetAbsAngles(), GetThrower(), GetDamage(), GetDamageRadius(),
SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this); SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this);
UTIL_Remove( this ); UTIL_Remove( this );

14
game/server/hl2mp/grenade_tripmine.cpp

@ -18,9 +18,9 @@
extern const char* g_pModelNameLaser; extern const char* g_pModelNameLaser;
ConVar sk_plr_dmg_tripmine ( "sk_plr_dmg_tripmine","0"); ConVar sk_plr_dmg_tripmine ( "sk_plr_dmg_tripmine","150"); // commented values in hl2/skill.cfg
ConVar sk_npc_dmg_tripmine ( "sk_npc_dmg_tripmine","0"); ConVar sk_npc_dmg_tripmine ( "sk_npc_dmg_tripmine","125");
ConVar sk_tripmine_radius ( "sk_tripmine_radius","0"); ConVar sk_tripmine_radius ( "sk_tripmine_radius","200");
LINK_ENTITY_TO_CLASS( npc_tripmine, CTripmineGrenade ); LINK_ENTITY_TO_CLASS( npc_tripmine, CTripmineGrenade );
@ -65,9 +65,6 @@ void CTripmineGrenade::Spawn( void )
SetCycle( 0.0f ); SetCycle( 0.0f );
m_nBody = 3; m_nBody = 3;
m_flDamage = sk_plr_dmg_tripmine.GetFloat();
m_DmgRadius = sk_tripmine_radius.GetFloat();
ResetSequenceInfo( ); ResetSequenceInfo( );
m_flPlaybackRate = 0; m_flPlaybackRate = 0;
@ -83,7 +80,8 @@ void CTripmineGrenade::Spawn( void )
m_iHealth = 1; m_iHealth = 1;
EmitSound( "TripmineGrenade.Place" ); EmitSound( "TripmineGrenade.Place" );
SetDamage ( 200 ); SetDamage( sk_plr_dmg_tripmine.GetFloat() );
SetDamageRadius( sk_tripmine_radius.GetFloat() );
// Tripmine sits at 90 on wall so rotate back to get m_vecDir // Tripmine sits at 90 on wall so rotate back to get m_vecDir
QAngle angles = GetAbsAngles(); QAngle angles = GetAbsAngles();
@ -268,7 +266,7 @@ void CTripmineGrenade::DelayDeathThink( void )
UTIL_TraceLine ( GetAbsOrigin() + m_vecDir * 8, GetAbsOrigin() - m_vecDir * 64, MASK_SOLID, this, COLLISION_GROUP_NONE, & tr); UTIL_TraceLine ( GetAbsOrigin() + m_vecDir * 8, GetAbsOrigin() - m_vecDir * 64, MASK_SOLID, this, COLLISION_GROUP_NONE, & tr);
UTIL_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START ); UTIL_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START );
ExplosionCreate( GetAbsOrigin() + m_vecDir * 8, GetAbsAngles(), m_hOwner, GetDamage(), 200, ExplosionCreate( GetAbsOrigin() + m_vecDir * 8, GetAbsAngles(), m_hOwner, GetDamage(), GetDamageRadius(),
SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this); SF_ENVEXPLOSION_NOSPARKS | SF_ENVEXPLOSION_NODLIGHTS | SF_ENVEXPLOSION_NOSMOKE, 0.0f, this);
UTIL_Remove( this ); UTIL_Remove( this );

Loading…
Cancel
Save