Exemplo n.º 1
0
	virtual void MuzzleFlash( IRecipientFilter& filter, float delay,
		const Vector &start, const QAngle &angles, float scale, int type )
	{
		if ( !SuppressTE( filter ) )
		{
			TE_MuzzleFlash( filter, delay,
				start, angles, scale, type );
		}
	}
Exemplo n.º 2
0
	// For playback from external tools
	virtual void TriggerTempEntity( KeyValues *pKeyValues )
	{
		g_pEffects->SuppressEffectsSounds( true );
		SuppressParticleEffects( true );

		// While playing back, suppress recording
		bool bIsRecording = clienttools->IsInRecordingMode();
		clienttools->EnableRecordingMode( false );

		CBroadcastRecipientFilter filter;

		TERecordingType_t type = (TERecordingType_t)pKeyValues->GetInt( "te" );
		switch( type )
		{
		case TE_DYNAMIC_LIGHT:
			TE_DynamicLight( filter, 0.0f, pKeyValues );
			break;

		case TE_WORLD_DECAL:
			TE_WorldDecal( filter, 0.0f, pKeyValues );
			break;

		case TE_DISPATCH_EFFECT:
			DispatchEffect( filter, 0.0f, pKeyValues );
			break;

		case TE_MUZZLE_FLASH:
			{
				Vector vecOrigin;
				QAngle angles;
				vecOrigin.x = pKeyValues->GetFloat( "originx" );
				vecOrigin.y = pKeyValues->GetFloat( "originy" );
				vecOrigin.z = pKeyValues->GetFloat( "originz" );
				angles.x = pKeyValues->GetFloat( "anglesx" );
				angles.y = pKeyValues->GetFloat( "anglesy" );
				angles.z = pKeyValues->GetFloat( "anglesz" );
				float flScale = pKeyValues->GetFloat( "scale" );
				int nType = pKeyValues->GetInt( "type" ); 

				TE_MuzzleFlash( filter, 0.0f, vecOrigin, angles, flScale, nType );
			}
			break;

		case TE_ARMOR_RICOCHET:
			{
				Vector vecOrigin, vecDirection;
				vecOrigin.x = pKeyValues->GetFloat( "originx" );
				vecOrigin.y = pKeyValues->GetFloat( "originy" );
				vecOrigin.z = pKeyValues->GetFloat( "originz" );
				vecDirection.x = pKeyValues->GetFloat( "directionx" );
				vecDirection.y = pKeyValues->GetFloat( "directiony" );
				vecDirection.z = pKeyValues->GetFloat( "directionz" );

				TE_ArmorRicochet( filter, 0.0f, &vecOrigin, &vecDirection );
			}
			break;

		case TE_METAL_SPARKS:
			{
				Vector vecOrigin, vecDirection;
				vecOrigin.x = pKeyValues->GetFloat( "originx" );
				vecOrigin.y = pKeyValues->GetFloat( "originy" );
				vecOrigin.z = pKeyValues->GetFloat( "originz" );
				vecDirection.x = pKeyValues->GetFloat( "directionx" );
				vecDirection.y = pKeyValues->GetFloat( "directiony" );
				vecDirection.z = pKeyValues->GetFloat( "directionz" );

				TE_MetalSparks( filter, 0.0f, &vecOrigin, &vecDirection );
			}
			break;

		case TE_SMOKE:
			{
				Vector vecOrigin, vecDirection;
				vecOrigin.x = pKeyValues->GetFloat( "originx" );
				vecOrigin.y = pKeyValues->GetFloat( "originy" );
				vecOrigin.z = pKeyValues->GetFloat( "originz" );
				float flScale = pKeyValues->GetFloat( "scale" );
				int nFrameRate = pKeyValues->GetInt( "framerate" );
				TE_Smoke( filter, 0.0f, &vecOrigin, 0, flScale, nFrameRate );
			}
			break;

		case TE_SPARKS:
			{
				Vector vecOrigin, vecDirection;
				vecOrigin.x = pKeyValues->GetFloat( "originx" );
				vecOrigin.y = pKeyValues->GetFloat( "originy" );
				vecOrigin.z = pKeyValues->GetFloat( "originz" );
				vecDirection.x = pKeyValues->GetFloat( "directionx" );
				vecDirection.y = pKeyValues->GetFloat( "directiony" );
				vecDirection.z = pKeyValues->GetFloat( "directionz" );
				int nMagnitude = pKeyValues->GetInt( "magnitude" );
				int nTrailLength = pKeyValues->GetInt( "traillength" );
				TE_Sparks( filter, 0.0f, &vecOrigin, nMagnitude, nTrailLength, &vecDirection );
			}
			break;

		case TE_BLOOD_STREAM:
			TE_BloodStream( filter, 0.0f, pKeyValues );
			break;

		case TE_BLOOD_SPRITE:
			TE_BloodSprite( filter, 0.0f, pKeyValues );
			break;

		case TE_BREAK_MODEL:
			TE_BreakModel( filter, 0.0f, pKeyValues );
			break;

		case TE_GLOW_SPRITE:
			TE_GlowSprite( filter, 0.0f, pKeyValues );
			break;

		case TE_PHYSICS_PROP:
			TE_PhysicsProp( filter, 0.0f, pKeyValues );
			break;

		case TE_SPRITE_SINGLE:
			TE_Sprite( filter, 0.0f, pKeyValues );
			break;

		case TE_SPRITE_SPRAY:
			TE_SpriteSpray( filter, 0.0f, pKeyValues );
			break;

		case TE_SHATTER_SURFACE:
			TE_ShatterSurface( filter, 0.0f, pKeyValues );
			break;

		case TE_DECAL:
			TE_Decal( filter, 0.0f, pKeyValues );
			break;

		case TE_PROJECT_DECAL:
			TE_ProjectDecal( filter, 0.0f, pKeyValues );
			break;

		case TE_EXPLOSION:
			TE_Explosion( filter, 0.0f, pKeyValues );
			break;

#ifdef HL2_DLL
		case TE_CONCUSSIVE_EXPLOSION:
			TE_ConcussiveExplosion( filter, 0.0f, pKeyValues );
			break;
#endif
		}

		SuppressParticleEffects( false );
		g_pEffects->SuppressEffectsSounds( false );
		clienttools->EnableRecordingMode( bIsRecording );
	}