Exemplo n.º 1
0
void TE_BreakModel( IRecipientFilter& filter, float delay, KeyValues *pKeyValues )
{
	Vector vecOrigin, vecSize, vecVel;
	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" );
	vecSize.x = pKeyValues->GetFloat( "sizex" );
	vecSize.y = pKeyValues->GetFloat( "sizey" );
	vecSize.z = pKeyValues->GetFloat( "sizez" );
	vecVel.x = pKeyValues->GetFloat( "velx" );
	vecVel.y = pKeyValues->GetFloat( "vely" );
	vecVel.z = pKeyValues->GetFloat( "velz" );
	Color c = pKeyValues->GetColor( "color" );
	const char *pModelName = pKeyValues->GetString( "model" );
	int nModelIndex = pModelName[0] ? modelinfo->GetModelIndex( pModelName ) : 0;
	int nRandomization = pKeyValues->GetInt( "randomization" );
	int nCount = pKeyValues->GetInt( "count" );
	float flDuration = pKeyValues->GetFloat( "duration" );
	int nFlags = pKeyValues->GetInt( "flags" );
	TE_BreakModel( filter, 0.0f, vecOrigin, angles, vecSize, vecVel,
		nModelIndex, nRandomization, nCount, flDuration, nFlags );
}
Exemplo n.º 2
0
	virtual void BreakModel( IRecipientFilter& filter, float delay,
		const Vector& pos, const QAngle &angle, const Vector& size, const Vector& vel, 
		int modelindex, int randomization, int count, float time, int flags )
	{
		if ( !SuppressTE( filter ) )
		{
			TE_BreakModel( filter, delay, pos, angle, size, vel, modelindex, randomization, count, time, flags );
		}
	}
Exemplo n.º 3
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 );
	}