void CFuncTankMortar::FiringSequence( const Vector &barrelEnd, const Vector &forward, CBaseEntity *pAttacker ) { if ( m_fireLast != 0 ) { int bulletCount = (gpGlobals->curtime - m_fireLast) * m_fireRate; // Only create 1 explosion if ( bulletCount > 0 ) { // fire in "firedelay" seconds if ( m_fireStartSound != NULL_STRING ) { CPASAttenuationFilter filter( this ); EmitSound( filter, entindex(), CHAN_WEAPON, STRING(m_fireStartSound), 1.0, ATTN_NORM ); } if ( m_fireDelay != 0 ) { g_EventQueue.AddEvent( this, "ShootGun", m_fireDelay, pAttacker, this, 0 ); } else { ShootGun(); } m_fireLast = gpGlobals->curtime; } } else { m_fireLast = gpGlobals->curtime; } }
void CFuncTankMortar::FiringSequence( const Vector &barrelEnd, const Vector &forward, CBaseEntity *pAttacker ) { if ( m_fireLast != 0 ) { int bulletCount = (gpGlobals->curtime - m_fireLast) * m_fireRate; // Only create 1 explosion if ( bulletCount > 0 ) { // fire in "firedelay" seconds if ( m_fireStartSound != NULL_STRING ) { CPASAttenuationFilter filter( this ); EmitSound_t ep; ep.m_nChannel = CHAN_WEAPON; ep.m_pSoundName = (char*)STRING(m_fireStartSound); ep.m_flVolume = 1.0f; ep.m_SoundLevel = SNDLVL_NORM; EmitSound( filter, entindex(), ep ); } if ( m_fireDelay != 0 ) { g_EventQueue.AddEvent( this, "ShootGun", m_fireDelay, pAttacker, this, 0 ); } else { ShootGun(); } m_fireLast = gpGlobals->curtime; } } else { m_fireLast = gpGlobals->curtime; } }
//----------------------------------------------------------------------------- // Purpose: Input handler to make the tank shoot. //----------------------------------------------------------------------------- void CFuncTankMortar::InputShootGun( inputdata_t &inputdata ) { ShootGun(); }