From 82caa0047b699321e077732239401678eaa99bf4 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sun, 4 Sep 2016 08:50:57 +0000 Subject: [PATCH] Snark gravgun tweaks --- dlls/squeakgrenade.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index 22200b74..b219cb9b 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -54,6 +54,15 @@ class CSqueakGrenade : public CGrenade void Killed( entvars_t *pevAttacker, int iGib ); void GibMonster( void ); + float TouchGravGun( CBaseEntity *attacker, int stage ) + { + if( stage == 2 ) + pev->sequence = WSQUEAK_IDLE1; + m_flDie = gpGlobals->time + 30; + m_hOwner = attacker; + return 700; + } + virtual int Save( CSave &save ); virtual int Restore( CRestore &restore ); @@ -267,8 +276,8 @@ void CSqueakGrenade::HuntThink( void ) // higher pitch as squeeker gets closer to detonation time float flpitch = 155.0 - 60.0 * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); - if( flpitch < 80 ) - flpitch = 80; + if( flpitch < 100 ) + flpitch = 100; if( m_hEnemy != NULL ) { @@ -339,6 +348,9 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) // higher pitch as squeeker gets closer to detonation time flpitch = 155.0 - 60.0 * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); + if( flpitch < 100 ) + flpitch = 100; + if( pOther->pev->takedamage && m_flNextAttack < gpGlobals->time ) { // attack!