コード例 #1
0
ファイル: npc_zombie.cpp プロジェクト: Orygin/BisounoursParty
void CZombie::Ignite( float flFlameLifetime, bool bNPCOnly, float flSize, bool bCalledByLevelDesigner )
{
	if( !IsOnFire() && IsAlive() )
	{
		BaseClass::Ignite( flFlameLifetime, bNPCOnly, flSize, bCalledByLevelDesigner );

		RemoveSpawnFlags( SF_NPC_GAG );

		MoanSound( envZombieMoanIgnited, ARRAYSIZE( envZombieMoanIgnited ) );

		if ( m_pMoanSound )
		{
			ENVELOPE_CONTROLLER.SoundChangePitch( m_pMoanSound, 120, 1.0 );
			ENVELOPE_CONTROLLER.SoundChangeVolume( m_pMoanSound, 1, 1.0 );
		}
	}
}
コード例 #2
0
//-----------------------------------------------------------------------------
// Purpose: Sound of a footstep
//-----------------------------------------------------------------------------
void CNPC_PoisonZombie::FootstepSound( bool fRightFoot )
{
	if( fRightFoot )
	{
		EmitSound( "NPC_PoisonZombie.FootstepRight" );
	}
	else
	{
		EmitSound( "NPC_PoisonZombie.FootstepLeft" );
	}

	if( ShouldPlayFootstepMoan() )
	{
		m_flNextMoanSound = gpGlobals->curtime;
		MoanSound( envPoisonZombieMoanVolumeFast, ARRAYSIZE( envPoisonZombieMoanVolumeFast ) );
	}
}
コード例 #3
0
ファイル: asw_zombie.cpp プロジェクト: Cre3per/hl2sdk-csgo
void CASW_Zombie::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity *pAttacker, CBaseEntity *pDamagingWeapon /*= NULL */ )
{
	if (AllowedToIgnite())
	{
		if( IsOnFire() )
			return;

		m_bOnFire = true;
		if (ASWBurning())
			ASWBurning()->BurnEntity(this, pAttacker, flFlameLifetime, 0.4f, 5.0f * 0.4f);	// 5 dps, applied every 0.4 seconds

		/*
		CEntityFlame *pFlame = CEntityFlame::Create( this );
		if (pFlame)
		{
			if (pAttacker)
				pFlame->SetOwnerEntity(pAttacker);
			pFlame->SetLifetime( flFlameLifetime );
			AddFlag( FL_ONFIRE );

			SetEffectEntity( pFlame );

			if ( flSize > 0.0f )
			{
				pFlame->SetSize( flSize );
			}
		}
		*/

		m_OnIgnite.FireOutput( this, this );

		RemoveSpawnFlags( SF_NPC_GAG );
		
		MoanSound( envASWZombieMoanIgnited, ARRAYSIZE( envASWZombieMoanIgnited ) );

		if( m_pMoanSound )
		{
			ENVELOPE_CONTROLLER.SoundChangePitch( m_pMoanSound, 120, 1.0 );
			ENVELOPE_CONTROLLER.SoundChangeVolume( m_pMoanSound, 1, 1.0 );
		}
	}
}
コード例 #4
0
//-----------------------------------------------------------------------------
// Purpose: Startup all of the sound patches that the fast zombie uses.
//
//
//-----------------------------------------------------------------------------
void CFastZombie::SoundInit( void )
{
    if( !m_pMoanSound )
    {
        // !!!HACKHACK - kickstart the moan sound. (sjb)
        MoanSound( envFastZombieMoanVolume, ARRAYSIZE( envFastZombieMoanVolume ) );

        // Clear the commands that the base class gave the moaning sound channel.
        ENVELOPE_CONTROLLER.CommandClear( m_pMoanSound );
    }

    CPASAttenuationFilter filter( this );

    if( !m_pLayer2 )
    {
        // Set up layer2
        m_pLayer2 = ENVELOPE_CONTROLLER.SoundCreate( filter, entindex(), CHAN_VOICE, FASTZOMBIE_GURGLE_SOUND, ATTN_NORM );

        // Start silent.
        ENVELOPE_CONTROLLER.Play( m_pLayer2, 0.0, 100 );
    }

    SetIdleSoundState();
}