//----------------------------------------------------------------------------- // Purpose: Make a tracer effect using the old, non-particle system, tracer effects. //----------------------------------------------------------------------------- void UTIL_Tracer( const Vector &vecStart, const Vector &vecEnd, int iEntIndex, int iAttachment, float flVelocity, bool bWhiz, const char *pCustomTracerName, int iParticleID ) { CEffectData data; data.m_vStart = vecStart; data.m_vOrigin = vecEnd; #ifdef CLIENT_DLL data.m_hEntity = ClientEntityList().EntIndexToHandle( iEntIndex ); #else data.m_nEntIndex = iEntIndex; #endif data.m_flScale = flVelocity; data.m_nHitBox = iParticleID; // Flags if ( bWhiz ) { data.m_fFlags |= TRACER_FLAG_WHIZ; } if ( iAttachment != TRACER_DONT_USE_ATTACHMENT ) { data.m_fFlags |= TRACER_FLAG_USEATTACHMENT; data.m_nAttachmentIndex = iAttachment; } // Fire it off if ( pCustomTracerName ) { DispatchEffect( pCustomTracerName, data ); } else { DispatchEffect( "Tracer", data ); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void DispatchParticleEffect( const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity, int iAttachmentPoint, bool bResetAllParticlesOnEntity ) { CEffectData data; data.m_nHitBox = GetParticleSystemIndex( pszParticleName ); if ( pEntity ) { #ifdef CLIENT_DLL data.m_hEntity = pEntity; #else data.m_nEntIndex = pEntity->entindex(); #endif data.m_fFlags |= PARTICLE_DISPATCH_FROM_ENTITY; data.m_vOrigin = pEntity->GetAbsOrigin(); } data.m_nDamageType = iAttachType; data.m_nAttachmentIndex = iAttachmentPoint; if ( bResetAllParticlesOnEntity ) { data.m_fFlags |= PARTICLE_DISPATCH_RESET_PARTICLES; } #ifdef GAME_DLL if ( ( data.m_fFlags & PARTICLE_DISPATCH_FROM_ENTITY ) != 0 && ( iAttachType == PATTACH_ABSORIGIN_FOLLOW || iAttachType == PATTACH_POINT_FOLLOW || iAttachType == PATTACH_ROOTBONE_FOLLOW ) ) { CBroadcastRecipientFilter filter; DispatchEffect( "ParticleEffect", data, filter ); } else #endif { DispatchEffect( "ParticleEffect", data ); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void DispatchParticleEffect( int iEffectIndex, Vector vecOrigin, Vector vecStart, QAngle vecAngles, CBaseEntity *pEntity ) { CEffectData data; data.m_nHitBox = iEffectIndex; data.m_vOrigin = vecOrigin; data.m_vStart = vecStart; data.m_vAngles = vecAngles; if ( pEntity ) { #ifdef CLIENT_DLL data.m_hEntity = pEntity; #else data.m_nEntIndex = pEntity->entindex(); #endif data.m_fFlags |= PARTICLE_DISPATCH_FROM_ENTITY; data.m_nDamageType = PATTACH_CUSTOMORIGIN; #if defined(TF_CLASSIC_CLIENT) if (TFGameRules() && TFGameRules()->IsDeathmatch()) { C_TFPlayer *pPlayer = ToTFPlayer(pEntity); if (pPlayer && pPlayer->m_Shared.InCond(TF_COND_POWERUP_CRITDAMAGE)) { data.m_bCustomColors = true; C_TF_PlayerResource *pResource = dynamic_cast<C_TF_PlayerResource *>(g_PR); data.m_CustomColors.m_vecColor1 = Vector( pResource->GetPlayerColor(pPlayer->entindex()).r() / 255.0f, pResource->GetPlayerColor(pPlayer->entindex()).g() / 255.0f, pResource->GetPlayerColor(pPlayer->entindex()).b() / 255.0f ); } } #endif } else { #ifdef CLIENT_DLL data.m_hEntity = NULL; #else data.m_nEntIndex = 0; #endif } DispatchEffect( "ParticleEffect", data ); }
//----------------------------------------------------------------------------- // Purpose: // Input : &traceHit - //----------------------------------------------------------------------------- bool CBaseSDKBludgeonWeapon::ImpactWater( const Vector &start, const Vector &end ) { //FIXME: This doesn't handle the case of trying to splash while being underwater, but that's not going to look good // right now anyway... #ifndef SWARM_DLL // reep: Alien Swarm does things a bit diffrently. // We must start outside the water if ( UTIL_PointContents( start ) & (CONTENTS_WATER|CONTENTS_SLIME)) return false; // We must end inside of water if ( !(UTIL_PointContents( end ) & (CONTENTS_WATER|CONTENTS_SLIME))) return false; #else // We must start outside the water if ( UTIL_PointContents( start, NULL ) & (CONTENTS_WATER|CONTENTS_SLIME)) return false; // We must end inside of water if ( !(UTIL_PointContents( end, NULL ) & (CONTENTS_WATER|CONTENTS_SLIME))) return false; #endif trace_t waterTrace; UTIL_TraceLine( start, end, (CONTENTS_WATER|CONTENTS_SLIME), GetOwner(), COLLISION_GROUP_NONE, &waterTrace ); if ( waterTrace.fraction < 1.0f ) { CEffectData data; data.m_fFlags = 0; data.m_vOrigin = waterTrace.endpos; data.m_vNormal = waterTrace.plane.normal; data.m_flScale = 8.0f; // See if we hit slime if ( waterTrace.contents & CONTENTS_SLIME ) { data.m_fFlags |= FX_WATER_IN_SLIME; } DispatchEffect( "watersplash", data ); } return true; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponStunStick::ImpactEffect( trace_t &traceHit ) { //#ifndef CLIENT_DLL CEffectData data; data.m_vNormal = traceHit.plane.normal; data.m_vOrigin = traceHit.endpos + ( data.m_vNormal * 4.0f ); DispatchEffect( "StunstickImpact", data ); //#endif //FIXME: need new decals UTIL_ImpactTrace( &traceHit, DMG_CLUB ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CASW_PropJeep::CreateRipple( const Vector &vecPosition ) { // Ripple data. CEffectData data; data.m_fFlags = 0; data.m_vOrigin = vecPosition; data.m_vNormal.Init( 0.0f, 0.0f, 1.0f ); VectorAngles( data.m_vNormal, data.m_vAngles ); data.m_flScale = 10.0f + random->RandomFloat( 0, 2 ); if ( GetWaterType() & CONTENTS_SLIME ) { data.m_fFlags |= FX_WATER_IN_SLIME; } // Create the ripple. DispatchEffect( "waterripple", data ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponCrossbow::DoLoadEffect( void ) { SetSkin( BOLT_SKIN_GLOW ); CBasePlayer *pOwner = ToBasePlayer( GetOwner() ); if ( pOwner == NULL ) return; //Tony; change this up a bit; on the server, dispatch an effect but don't send it to the client who fires //on the client, create an effect either in the view model, or on the world model if first person. CEffectData data; data.m_nAttachmentIndex = 1; data.m_vOrigin = pOwner->GetAbsOrigin(); CPASFilter filter( data.m_vOrigin ); #ifdef GAME_DLL filter.RemoveRecipient( pOwner ); data.m_nEntIndex = entindex(); #else CBaseViewModel *pViewModel = pOwner->GetViewModel(); if ( ShouldDrawUsingViewModel() && pViewModel != NULL ) data.m_hEntity = pViewModel->GetRefEHandle(); else data.m_hEntity = GetRefEHandle(); #endif DispatchEffect( "CrossbowLoad", data, filter ); #ifndef CLIENT_DLL CSprite *pBlast = CSprite::SpriteCreate( CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false ); if ( pBlast ) { pBlast->SetAttachment( this, 1 ); pBlast->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone ); pBlast->SetBrightness( 128 ); pBlast->SetScale( 0.2f ); pBlast->FadeOutFromSpawn(); } #endif }
void CASW_Weapon_Chainsaw::UpdateEffect( const Vector &startPoint, const Vector &endPoint ) { //if ( !m_hBeam ) //{ //CreateEffect(); //} //if ( m_hBeam ) //{ //m_hBeam->SetStartPos( endPoint ); //} CASW_Marine* pOwner = GetMarine(); if (!pOwner) return; // make sparks come out at end point Vector vecNormal = startPoint - endPoint; vecNormal.NormalizeInPlace(); #ifndef CLIENT_DLL CEffectData data; data.m_vOrigin = endPoint; data.m_vNormal = vecNormal; CPASFilter filter( data.m_vOrigin ); filter.SetIgnorePredictionCull(true); if (gpGlobals->maxClients > 1 && pOwner->IsInhabited() && pOwner->GetCommander()) { // multiplayer game, where this marine is currently being controlled by a client, who will spawn his own effect // so just make the beam effect for all other clients filter.RemoveRecipient(pOwner->GetCommander()); } DispatchEffect( filter, 0.0, "ASWWelderSparks", data ); #else FX_Sparks( endPoint, 1, 2, vecNormal, 5, 32, 160 ); #endif if ( m_hNoise ) { m_hNoise->SetStartPos( endPoint ); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeapon357::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator ) { switch( pEvent->event ) { case EVENT_WEAPON_PISTOL_FIRE: { Vector vecShootOrigin, vecShootDir; vecShootOrigin = pOperator->Weapon_ShootPosition(); CAI_BaseNPC *npc = pOperator->MyNPCPointer(); ASSERT(npc != NULL); vecShootDir = npc->GetActualShootTrajectory(vecShootOrigin); CSoundEnt::InsertSound(SOUND_COMBAT | SOUND_CONTEXT_GUNFIRE, pOperator->GetAbsOrigin(), SOUNDENT_VOLUME_PISTOL, 0.2, pOperator, SOUNDENT_CHANNEL_WEAPON, pOperator->GetEnemy()); WeaponSound(SINGLE_NPC); pOperator->FireBullets(1, vecShootOrigin, vecShootDir, VECTOR_CONE_PRECALCULATED, MAX_TRACE_LENGTH, m_iPrimaryAmmoType, 2); pOperator->DoMuzzleFlash(); m_iClip1 = m_iClip1 - 1; } case EVENT_WEAPON_RELOAD: { CBasePlayer *pOwner = ToBasePlayer(GetOwner()); CEffectData data; // Emit six spent shells for (int i = 0; i < 6; i++) { data.m_vOrigin = pOwner->WorldSpaceCenter() + RandomVector(-4, 4); data.m_vAngles = QAngle(90, random->RandomInt(0, 360), 0); data.m_nEntIndex = entindex(); DispatchEffect("ShellEject", data); } } break; default: BaseClass::Operator_HandleAnimEvent(pEvent, pOperator); break; } }
void CASW_Harvester::NPCThink() { BaseClass::NPCThink(); if (m_fGibTime != 0 && gpGlobals->curtime > m_fGibTime) { CEffectData data; data.m_vOrigin = WorldSpaceCenter(); data.m_vNormal = Vector(0,0,1); data.m_flScale = RemapVal( m_iHealth, 0, -500, 1, 3 ); data.m_flScale = clamp( data.m_flScale, 1, 3 ); data.m_nColor = 1; data.m_fFlags = IsOnFire() ? ASW_GIBFLAG_ON_FIRE : 0; DispatchEffect( "HarvesterGib", data ); UTIL_Remove( this ); SetThink( NULL ); } }
bool CWeaponElite::OnFireEvent( C_BaseViewModel *pViewModel, const Vector& origin, const QAngle& angles, int event, const char *options ) { if( event == 5001 ) { C_CSPlayer *pPlayer = ToCSPlayer( GetOwner() ); if( pPlayer && pPlayer->GetFOV() < pPlayer->GetDefaultFOV() && HideViewModelWhenZoomed() ) return true; CEffectData data; data.m_fFlags = 0; data.m_hEntity = pViewModel->GetRefEHandle(); data.m_nAttachmentIndex = m_bFireRight?2:1; // toggle muzzle flash data.m_flScale = GetCSWpnData().m_flMuzzleScale; DispatchEffect( "CS_MuzzleFlash", data ); return true; } return BaseClass::OnFireEvent( pViewModel, origin, angles, event, options ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponGrapple::DoLoadEffect(void) { SetSkin(BOLT_SKIN_GLOW); CBasePlayer *pOwner = ToBasePlayer(GetOwner()); if (pOwner == NULL) return; CBaseViewModel *pViewModel = pOwner->GetViewModel(); if (pViewModel == NULL) return; CEffectData data; #ifdef CLIENT_DLL data.m_hEntity = pViewModel->GetRefEHandle(); #else data.m_nEntIndex = pViewModel->entindex(); #endif data.m_nAttachmentIndex = 1; DispatchEffect("CrossbowLoad", data); #ifndef CLIENT_DLL CSprite *pBlast = CSprite::SpriteCreate(CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false); if (pBlast) { pBlast->SetAttachment(pOwner->GetViewModel(), 1); pBlast->SetTransparency(kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone); pBlast->SetBrightness(128); pBlast->SetScale(0.2f); pBlast->FadeOutFromSpawn(); } #endif }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CNPC_AntlionGrub::Squash( CBaseEntity *pOther ) { SpawnSquashedGrub(); AddEffects( EF_NODRAW ); AddSolidFlags( FSOLID_NOT_SOLID ); EmitSound( "NPC_AntlionGrub.Squash" ); BroadcastAlert(); Vector vecUp; AngleVectors( GetAbsAngles(), NULL, NULL, &vecUp ); trace_t tr; for ( int i = 0; i < 4; i++ ) { tr.endpos = WorldSpaceCenter(); tr.endpos[0] += random->RandomFloat( -16.0f, 16.0f ); tr.endpos[1] += random->RandomFloat( -16.0f, 16.0f ); tr.endpos += vecUp * 8.0f; MakeDamageBloodDecal( 2, 0.8f, &tr, -vecUp ); } SetTouch( NULL ); m_bSquashed = true; // Temp squash effect CEffectData data; data.m_fFlags = 0; data.m_vOrigin = WorldSpaceCenter(); data.m_vNormal = vecUp; VectorAngles( vecUp, data.m_vAngles ); data.m_flScale = random->RandomFloat( 5, 7 ); data.m_fFlags |= FX_WATER_IN_SLIME; DispatchEffect( "watersplash", data ); }
// Эффект пыли для шагов крематора (аналогично шагам страйдера или охотника, но в меньших масштабах void CNPC_Cremator::FootstepEffect( const Vector &origin ) { trace_t tr; AI_TraceLine( origin, origin - Vector(0,0,0), MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr ); float yaw = random->RandomInt(0,0); for ( int i = 0; i < 2; i++ ) { if ( UTIL_PointContents( tr.endpos + Vector( 0, 0, 1 ) ) & MASK_WATER ) { float flWaterZ = UTIL_FindWaterSurface( tr.endpos, tr.endpos.z, tr.endpos.z + 100.0f ); CEffectData data; data.m_fFlags = 0; data.m_vOrigin = tr.endpos; data.m_vOrigin.z = flWaterZ; data.m_vNormal = Vector( 0, 0, 1 ); data.m_flScale = random->RandomFloat( 10.0, 14.0 ); // Если крематор идет по неглубокой воде, образуются всплески. DispatchEffect( "watersplash", data ); } else { Vector dir = UTIL_YawToVector( yaw + i*180 ) * 10; VectorNormalize( dir ); dir.z = 0.25; VectorNormalize( dir ); g_pEffects->Dust( tr.endpos, dir, 12, 50 ); /*g_pEffects->FootprintDecal( tr.endpos, dir, 12, 50 ); virtual void FootprintDecal( IRecipientFilter& filer, float delay, const Vector *origin, const Vector* right, int entity, int index, unsigned char materialType ) = 0; virtual void Dust( IRecipientFilter& filer, float delay, const Vector &pos, const Vector &dir, float size, float speed ) = 0;*/ } } }
//----------------------------------------------------------------------------- // Purpose: // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CHL1NPCTalker::CorpseGib( const CTakeDamageInfo &info ) { CEffectData data; data.m_vOrigin = WorldSpaceCenter(); data.m_vNormal = data.m_vOrigin - info.GetDamagePosition(); VectorNormalize( data.m_vNormal ); data.m_flScale = RemapVal( m_iHealth, 0, -500, 1, 3 ); data.m_flScale = clamp( data.m_flScale, 1, 3 ); data.m_nMaterial = 1; data.m_nHitBox = -m_iHealth; data.m_nColor = BloodColor(); DispatchEffect( "HL1Gib", data ); CSoundEnt::InsertSound( SOUND_MEAT, GetAbsOrigin(), 256, 0.5f, this ); return true; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void DispatchParticleEffect( const char *pszParticleName, Vector vecOrigin, QAngle vecAngles, Vector vecColor1, Vector vecColor2, bool bUseColors, CBaseEntity *pEntity, int iAttachType ) { int iEffectIndex = GetParticleSystemIndex( pszParticleName ); CEffectData data; data.m_nHitBox = iEffectIndex; data.m_vOrigin = vecOrigin; data.m_vAngles = vecAngles; if ( pEntity ) { #ifdef CLIENT_DLL data.m_hEntity = pEntity; #else data.m_nEntIndex = pEntity->entindex(); #endif data.m_fFlags |= PARTICLE_DISPATCH_FROM_ENTITY; data.m_nDamageType = PATTACH_CUSTOMORIGIN; } else { #ifdef CLIENT_DLL data.m_hEntity = NULL; #else data.m_nEntIndex = 0; #endif } if ( bUseColors ) { data.m_bCustomColors = true; data.m_CustomColors.m_vecColor1 = vecColor1; data.m_CustomColors.m_vecColor2 = vecColor2; } DispatchEffect( "ParticleEffect", data ); }
void CPropThumper::Thump ( void ) { if ( m_iHammerAttachment != -1 ) { Vector vOrigin; GetAttachment( m_iHammerAttachment, vOrigin ); CEffectData data; data.m_nEntIndex = entindex(); data.m_vOrigin = vOrigin; data.m_flScale = m_iDustScale * m_flPlaybackRate; DispatchEffect( "ThumperDust", data ); UTIL_ScreenShake( vOrigin, 10.0 * m_flPlaybackRate, m_flPlaybackRate, m_flPlaybackRate / 2, THUMPER_RADIUS * m_flPlaybackRate, SHAKE_START, false ); } EmitSound( "coast.thumper_dust" ); CSoundEnt::InsertSound ( SOUND_THUMPER, GetAbsOrigin(), THUMPER_RADIUS * m_flPlaybackRate, THUMPER_SOUND_DURATION, this ); if ( thumper_show_radius.GetBool() ) { NDebugOverlay::Box( GetAbsOrigin(), Vector(-THUMPER_RADIUS, -THUMPER_RADIUS, -THUMPER_RADIUS), Vector(THUMPER_RADIUS, THUMPER_RADIUS, THUMPER_RADIUS), 255, 64, 64, 255, THUMPER_SOUND_DURATION ); } if ( m_flPlaybackRate < 0.7f ) return; if( m_iDustScale == THUMPER_MIN_SCALE ) EmitSound( "coast.thumper_hit" ); else EmitSound( "coast.thumper_large_hit" ); // Signal that we've thumped m_OnThumped.FireOutput( this, this ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void DispatchParticleEffect( const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity, int iAttachmentPoint, bool bResetAllParticlesOnEntity ) { CEffectData data; data.m_nHitBox = GetParticleSystemIndex( pszParticleName ); if ( pEntity ) { #ifdef CLIENT_DLL data.m_hEntity = pEntity; #else data.m_nEntIndex = pEntity->entindex(); #endif data.m_fFlags |= PARTICLE_DISPATCH_FROM_ENTITY; } data.m_nDamageType = iAttachType; data.m_nAttachmentIndex = iAttachmentPoint; if ( bResetAllParticlesOnEntity ) { data.m_fFlags |= PARTICLE_DISPATCH_RESET_PARTICLES; } DispatchEffect( "ParticleEffect", data ); }
//----------------------------------------------------------------------------- // Zap! //----------------------------------------------------------------------------- void CRagdollBoogie::ZapThink() { if ( !GetMoveParent() ) return; CBaseAnimating *pRagdoll = GetMoveParent()->GetBaseAnimating(); if ( !pRagdoll ) return; // Make electricity on the client CStudioHdr *pStudioHdr = pRagdoll->GetModelPtr( ); if (!pStudioHdr) return; mstudiohitboxset_t *set = pStudioHdr->pHitboxSet( pRagdoll->GetHitboxSet() ); if ( set->numhitboxes == 0 ) return; if ( m_nSuppressionCount == 0 ) { CEffectData data; data.m_nEntIndex = GetMoveParent()->entindex(); data.m_flMagnitude = 4; data.m_flScale = HasSpawnFlags(SF_RAGDOLL_BOOGIE_ELECTRICAL_NARROW_BEAM) ? 1.0f : 2.0f; DispatchEffect( "TeslaHitboxes", data ); } #ifdef HL2_EPISODIC EmitSound( "RagdollBoogie.Zap" ); #endif SetContextThink( &CRagdollBoogie::ZapThink, gpGlobals->curtime + random->RandomFloat( 0.1f, 0.3f ), s_pZapContext ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeapon357::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator ) { CBasePlayer *pOwner = ToBasePlayer( GetOwner() ); switch( pEvent->event ) { case EVENT_WEAPON_RELOAD: { CEffectData data; // Emit six spent shells for ( int i = 0; i < 6; i++ ) { data.m_vOrigin = pOwner->WorldSpaceCenter() + RandomVector( -4, 4 ); data.m_vAngles = QAngle( 90, random->RandomInt( 0, 360 ), 0 ); data.m_nEntIndex = entindex(); DispatchEffect( "ShellEject", data ); } break; } } }
void CNPC_Portal_GroundTurret::Shoot() { FireBulletsInfo_t info; Vector vecSrc = EyePosition(); Vector vecDir; GetVectors( &vecDir, NULL, NULL ); for( int i = 0 ; i < 1 ; i++ ) { info.m_vecSrc = vecSrc; if( i > 0 || !GetEnemy()->IsPlayer() ) { // Subsequent shots or shots at non-players random GetVectors( &info.m_vecDirShooting, NULL, NULL ); info.m_vecSpread = m_vecSpread; } else { // First shot is at the enemy. info.m_vecDirShooting = GetActualShootTrajectory( vecSrc ); info.m_vecSpread = VECTOR_CONE_PRECALCULATED; } info.m_iTracerFreq = 1; info.m_iShots = 1; info.m_pAttacker = this; info.m_flDistance = MAX_COORD_RANGE; info.m_iAmmoType = m_iAmmoType; FireBullets( info ); trace_t tr; CTraceFilterSkipTwoEntities traceFilter( this, info.m_pAdditionalIgnoreEnt, COLLISION_GROUP_NONE ); Vector vecEnd = info.m_vecSrc + vecDir * info.m_flDistance; AI_TraceLine( info.m_vecSrc, vecEnd, MASK_SHOT, &traceFilter, &tr ); if ( tr.m_pEnt && !tr.m_pEnt->IsPlayer() && ( vecDir * info.m_flDistance * tr.fraction ).Length() < 16.0f ) { CTakeDamageInfo damageInfo; damageInfo.SetAttacker( this ); damageInfo.SetDamageType( DMG_BULLET ); damageInfo.SetDamage( 20.0f ); TakeDamage( damageInfo ); EmitSound( "NPC_FloorTurret.DryFire" ); } } // Do the AR2 muzzle flash CEffectData data; data.m_nEntIndex = entindex(); data.m_nAttachmentIndex = LookupAttachment( "eyes" ); data.m_flScale = 1.0f; data.m_fFlags = MUZZLEFLASH_COMBINE; DispatchEffect( "MuzzleFlash", data ); EmitSound( "NPC_FloorTurret.ShotSounds" ); m_flTimeNextShoot = gpGlobals->curtime + 0.09; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void DispatchEffect( const char *pName, const CEffectData &data ) { CPASFilter filter( data.m_vOrigin ); DispatchEffect( pName, data, filter ); }
void CDAViewModel::FireObsoleteEvent( const Vector& origin, const QAngle& angles, int event, const char *options ) { CSDKPlayer* pOwner = ToSDKPlayer(GetOwner()); if (!pOwner) return; Vector attachOrigin; QAngle attachAngles; switch( event ) { // Obsolete. Use the AE_CL_CREATE_PARTICLE_EFFECT event instead, which uses the artist driven particle system & editor. case AE_CLIENT_EFFECT_ATTACH: { int iAttachment = -1; int iParam = 0; char token[128]; char effectFunc[128]; const char *p = options; p = nexttoken(token, p, ' '); if( token ) Q_strncpy( effectFunc, token, sizeof(effectFunc) ); p = nexttoken(token, p, ' '); bool bResult = false; if( token ) { if (pOwner->IsInThirdPerson() && pOwner->GetActiveSDKWeapon()) { iAttachment = pOwner->GetActiveSDKWeapon()->LookupAttachment(token); bResult = pOwner->GetActiveSDKWeapon()->GetAttachment( iAttachment, attachOrigin, attachAngles ); } else { iAttachment = LookupAttachment(token); bResult = GetAttachment( iAttachment, attachOrigin, attachAngles ); } } p = nexttoken(token, p, ' '); if( token ) iParam = atoi(token); if (bResult) { // Fill out the generic data CEffectData data; data.m_vOrigin = attachOrigin; data.m_vAngles = attachAngles; AngleVectors( attachAngles, &data.m_vNormal ); data.m_hEntity = GetRefEHandle(); data.m_nAttachmentIndex = iAttachment + 1; data.m_fFlags = iParam; DispatchEffect( effectFunc, data ); } } break; } }
void C_PhysPropClientside::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName ) { VPROF( "C_PhysPropClientside::ImpactTrace" ); IPhysicsObject *pPhysicsObject = VPhysicsGetObject(); if( !pPhysicsObject ) return; Vector dir = pTrace->endpos - pTrace->startpos; int iDamage = 0; if ( iDamageType == DMG_BLAST ) { iDamage = VectorLength( dir ); dir *= 500; // adjust impact strenght // apply force at object mass center pPhysicsObject->ApplyForceCenter( dir ); } else { Vector hitpos; VectorMA( pTrace->startpos, pTrace->fraction, dir, hitpos ); VectorNormalize( dir ); // guess avg damage if ( iDamageType == DMG_BULLET ) { iDamage = 30; } else { iDamage = 50; } dir *= 4000; // adjust impact strenght // apply force where we hit it pPhysicsObject->ApplyForceOffset( dir, hitpos ); // Build the impact data CEffectData data; data.m_vOrigin = pTrace->endpos; data.m_vStart = pTrace->startpos; data.m_nSurfaceProp = pTrace->surface.surfaceProps; data.m_nDamageType = iDamageType; data.m_nHitBox = pTrace->hitbox; data.m_hEntity = GetRefEHandle(); // Send it on its way if ( !pCustomImpactName ) { DispatchEffect( "Impact", data ); } else { DispatchEffect( pCustomImpactName, data ); } } // Clone( dir ); // debug code OnTakeDamage( iDamage ); }
void CSDKPlayer::FireBullet( Vector vecSrc, // shooting postion const QAngle &shootAngles, //shooting angle float vecSpread, // spread vector int iDamage, // base damage int iBulletType, // ammo type CBaseEntity *pevAttacker, // shooter bool bDoEffects, // create impact effect ? float x, // spread x factor float y // spread y factor ) { float fCurrentDamage = iDamage; // damage of the bullet at it's current trajectory float flCurrentDistance = 0.0; //distance that the bullet has traveled so far Vector vecDirShooting, vecRight, vecUp; AngleVectors( shootAngles, &vecDirShooting, &vecRight, &vecUp ); if ( !pevAttacker ) pevAttacker = this; // the default attacker is ourselves // add the spray Vector vecDir = vecDirShooting + x * vecSpread * vecRight + y * vecSpread * vecUp; VectorNormalize( vecDir ); float flMaxRange = 8000; Vector vecEnd = vecSrc + vecDir * flMaxRange; // max bullet range is 10000 units trace_t tr; // main enter bullet trace UTIL_TraceLine( vecSrc, vecEnd, MASK_SOLID|CONTENTS_DEBRIS|CONTENTS_HITBOX, this, COLLISION_GROUP_NONE, &tr ); if ( tr.fraction == 1.0f ) return; // we didn't hit anything, stop tracing shoot if ( sv_showimpacts.GetBool() ) { #ifdef CLIENT_DLL // draw red client impact markers debugoverlay->AddBoxOverlay( tr.endpos, Vector(-2,-2,-2), Vector(2,2,2), QAngle( 0, 0, 0), 255,0,0,127, 4 ); if ( tr.m_pEnt && tr.m_pEnt->IsPlayer() ) { C_BasePlayer *player = ToBasePlayer( tr.m_pEnt ); player->DrawClientHitboxes( 4, true ); } #else // draw blue server impact markers NDebugOverlay::Box( tr.endpos, Vector(-2,-2,-2), Vector(2,2,2), 0,0,255,127, 4 ); if ( tr.m_pEnt && tr.m_pEnt->IsPlayer() ) { CBasePlayer *player = ToBasePlayer( tr.m_pEnt ); player->DrawServerHitboxes( 4, true ); } #endif } //calculate the damage based on the distance the bullet travelled. flCurrentDistance += tr.fraction * flMaxRange; // damage get weaker of distance fCurrentDamage *= pow ( 0.85f, (flCurrentDistance / 500)); int iDamageType = DMG_BULLET | DMG_NEVERGIB; if( bDoEffects ) { // See if the bullet ended up underwater + started out of the water if ( enginetrace->GetPointContents( tr.endpos ) & (CONTENTS_WATER|CONTENTS_SLIME) ) { trace_t waterTrace; UTIL_TraceLine( vecSrc, tr.endpos, (MASK_SHOT|CONTENTS_WATER|CONTENTS_SLIME), this, COLLISION_GROUP_NONE, &waterTrace ); if( waterTrace.allsolid != 1 ) { CEffectData data; data.m_vOrigin = waterTrace.endpos; data.m_vNormal = waterTrace.plane.normal; data.m_flScale = random->RandomFloat( 8, 12 ); if ( waterTrace.contents & CONTENTS_SLIME ) { data.m_fFlags |= FX_WATER_IN_SLIME; } DispatchEffect( "gunshotsplash", data ); } } else { //Do Regular hit effects // Don't decal nodraw surfaces if ( !( tr.surface.flags & (SURF_SKY|SURF_NODRAW|SURF_HINT|SURF_SKIP) ) ) { CBaseEntity *pEntity = tr.m_pEnt; if ( !( !friendlyfire.GetBool() && pEntity && pEntity->IsPlayer() && pEntity->GetTeamNumber() == GetTeamNumber() ) ) { UTIL_ImpactTrace( &tr, iDamageType ); } } } } // bDoEffects // add damage to entity that we hit #ifdef GAME_DLL ClearMultiDamage(); CTakeDamageInfo info( pevAttacker, pevAttacker, fCurrentDamage, iDamageType ); CalculateBulletDamageForce( &info, iBulletType, vecDir, tr.endpos ); tr.m_pEnt->DispatchTraceAttack( info, vecDir, &tr ); TraceAttackToTriggers( info, tr.startpos, tr.endpos, vecDir ); ApplyMultiDamage(); #endif }
void C_TEHL2MPFireBullets::CreateEffects( void ) { CAmmoDef* pAmmoDef = GetAmmoDef(); if ( pAmmoDef == NULL ) return; C_BaseEntity *pEnt = ClientEntityList().GetEnt( m_iPlayer ); if ( pEnt ) { C_BasePlayer *pPlayer = dynamic_cast<C_BasePlayer *>(pEnt); if ( pPlayer && pPlayer->GetActiveWeapon() ) { C_BaseCombatWeapon *pWpn = dynamic_cast<C_BaseCombatWeapon *>( pPlayer->GetActiveWeapon() ); if ( pWpn ) { int iSeed = m_iSeed; CShotManipulator Manipulator( m_vecDir ); for (int iShot = 0; iShot < m_iShots; iShot++) { RandomSeed( iSeed ); // init random system with this seed // Don't run the biasing code for the player at the moment. Vector vecDir = Manipulator.ApplySpread( Vector( m_flSpread, m_flSpread, m_flSpread ) ); Vector vecEnd = m_vecOrigin + vecDir * MAX_TRACE_LENGTH; trace_t tr; CTraceFilterSkipPlayerAndViewModelOnly traceFilter; if( m_iShots > 1 && iShot % 2 ) { // Half of the shotgun pellets are hulls that make it easier to hit targets with the shotgun. UTIL_TraceHull( m_vecOrigin, vecEnd, Vector( -3, -3, -3 ), Vector( 3, 3, 3 ), MASK_SHOT, &traceFilter, &tr ); } else { UTIL_TraceLine( m_vecOrigin, vecEnd, MASK_SHOT, &traceFilter, &tr); } if ( m_bDoTracers ) { const char *pTracerName = pWpn->GetTracerType(); CEffectData data; data.m_vStart = tr.startpos; data.m_vOrigin = tr.endpos; data.m_hEntity = pWpn->GetRefEHandle(); data.m_flScale = 0.0f; data.m_fFlags |= TRACER_FLAG_USEATTACHMENT; // Stomp the start, since it's not going to be used anyway data.m_nAttachmentIndex = 1; if ( pTracerName ) { DispatchEffect( pTracerName, data ); } else { DispatchEffect( "Tracer", data ); } } if ( m_bDoImpacts ) { pWpn->DoImpactEffect( tr, pAmmoDef->DamageType( m_iAmmoID ) ); } iSeed++; } } } } }
//----------------------------------------------------------------------------- // Purpose: Allows firing as fast as button is pressed //----------------------------------------------------------------------------- void CWeaponPistol::ItemPostFrame( void ) { BaseClass::ItemPostFrame(); CBasePlayer *pOwner = ToBasePlayer( GetOwner() ); if ( pOwner == NULL ) return; if ( m_bInReload ) { // If initial ejection is done, remain in the "NOCLIP" state until next phase is activated if ( m_NextReloadActivity == ACT_VM_RELOAD_NOCLIP && LastReloadActivityDone() ) { if ( m_iClip1 <= 0 ) SendWeaponAnim(ACT_VM_RELOAD_NOCLIP_EMPTY); else SendWeaponAnim(ACT_VM_RELOAD_NOCLIP); if ( ShouldInsertClip() ) { if ( m_iClip1 <= 0 ) SendWeaponAnim( ACT_VM_RELOAD_INSERT_EMPTY ); else SendWeaponAnim( ACT_VM_RELOAD_INSERT ); SetNextReloadActivity(ACT_VM_RELOAD); //using } } else if ( m_NextReloadActivity == ACT_VM_RELOAD_NOCLIP && !m_bClipEjected && gpGlobals->curtime >= m_fLastReloadActivityDone - .15 ) // should be equivalent behavior.... { // Release the clip timed within last 10th of a sec of release animation CEffectData data; data.m_nEntIndex = entindex(); DispatchEffect( "PistolClipEject", data ); m_bClipEjected = true; } else if ( m_NextReloadActivity == ACT_VM_RELOAD && LastReloadActivityDone() ) // we're done reloading here... { m_flTimeWeaponIdle = gpGlobals->curtime; m_flNextPrimaryAttack = gpGlobals->curtime; m_bInReload = false; m_bClipEjected = false; SendWeaponAnim( ACT_VM_IDLE ); // Play the player's reload animation if ( pOwner->IsPlayer() ) { ( ( CBasePlayer * )pOwner)->SetAnimation( PLAYER_RELOAD ); } FinishReload(); WeaponIdle(); } return; } if ( m_iClip1 <= 0 && GetActivity() != ACT_VM_LASTFIRE ) { SendWeaponAnim(ACT_VM_IDLE_EMPTY); } //Allow a refire as fast as the player can click if ( ( ( pOwner->m_nButtons & IN_ATTACK ) == false ) && ( m_flSoonestPrimaryAttack < gpGlobals->curtime ) ) { m_flNextPrimaryAttack = gpGlobals->curtime - 0.1f; } else if ( ( pOwner->m_nButtons & IN_ATTACK ) && ( m_flNextPrimaryAttack < gpGlobals->curtime ) && ( m_iClip1 <= 0 ) ) { DryFire(); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CPropCannon::Think( void ) { SetNextThink( gpGlobals->curtime + 0.1 ); if ( GetDriver() ) { BaseClass::Think(); } if ( GetDriver() ) { BaseClass::Think(); // play enter animation StudioFrameAdvance(); // If the enter or exit animation has finished, tell the server vehicle if ( IsSequenceFinished() && (m_bExitAnimOn || m_bEnterAnimOn) ) { if ( m_bEnterAnimOn ) { // Finished entering, display the hint for using the crane //UTIL_HudHintText( m_hPlayer, "#Valve_Hint_CraneKeys" ); } GetServerVehicle()->HandleEntryExitFinish( m_bExitAnimOn, true ); } } else { // Run the crane's movement // RunCraneMovement( 0.1 ); } // Update follower bones m_BoneFollowerManager.UpdateBoneFollowers(this); if ( m_flFlyTime > 0.0f ) { if ( m_flFlyTime - 1.0f <= gpGlobals->curtime && m_flFlyTime - 0.8f > gpGlobals->curtime) { CPASAttenuationFilter filter( this ); EmitSound_t ep; ep.m_nChannel = CHAN_STATIC; ep.m_pSoundName = "Weapon_Mortar.Incomming"; ep.m_flVolume = 255; ep.m_SoundLevel = SNDLVL_180dB; EmitSound( filter, entindex(), ep ); } if ( m_flFlyTime <= gpGlobals->curtime ) { if ( m_vCrashPoint != vec3_origin ) { ProjectileExplosion(); } CEffectData data; data.m_vOrigin = m_vCrashPoint; data.m_flScale = 512; DispatchEffect( "ThumperDust", data ); m_flFlyTime = 0.0f; } } }
//----------------------------------------------------------------------------- // Fire on our target //----------------------------------------------------------------------------- bool CObjectSentrygun::Fire() { //NDebugOverlay::Cross3D( m_hEnemy->WorldSpaceCenter(), 10, 255, 0, 0, false, 0.1 ); Vector vecAimDir; // Level 3 Turrets fire rockets every 3 seconds if ( m_iUpgradeLevel == 3 && m_iAmmoRockets > 0 && m_flNextRocketAttack < gpGlobals->curtime ) { Vector vecSrc; QAngle vecAng; // alternate between the 2 rocket launcher ports. if ( m_iAmmoRockets & 1 ) { GetAttachment( m_iAttachments[SENTRYGUN_ATTACHMENT_ROCKET_L], vecSrc, vecAng ); } else { GetAttachment( m_iAttachments[SENTRYGUN_ATTACHMENT_ROCKET_R], vecSrc, vecAng ); } vecAimDir = m_hEnemy->WorldSpaceCenter() - vecSrc; vecAimDir.NormalizeInPlace(); // NOTE: vecAng is not actually set by GetAttachment!!! QAngle angDir; VectorAngles( vecAimDir, angDir ); EmitSound( "Building_Sentrygun.FireRocket" ); AddGesture( ACT_RANGE_ATTACK2 ); QAngle angAimDir; VectorAngles( vecAimDir, angAimDir ); CTFProjectile_SentryRocket *pProjectile = CTFProjectile_SentryRocket::Create( vecSrc, angAimDir, this, GetBuilder() ); if ( pProjectile ) { pProjectile->SetDamage( 100 ); } // Setup next rocket shot m_flNextRocketAttack = gpGlobals->curtime + 3; if ( !tf_sentrygun_ammocheat.GetBool() && !HasSpawnFlags( SF_SENTRY_INFINITE_AMMO ) ) { m_iAmmoRockets--; } if (m_iAmmoRockets == 10) ClientPrint( GetBuilder(), HUD_PRINTNOTIFY, "#Sentry_rocketslow"); if (m_iAmmoRockets == 0) ClientPrint( GetBuilder(), HUD_PRINTNOTIFY, "#Sentry_rocketsout"); } // All turrets fire shells if ( m_iAmmoShells > 0) { if ( !IsPlayingGesture( ACT_RANGE_ATTACK1 ) ) { RemoveGesture( ACT_RANGE_ATTACK1_LOW ); AddGesture( ACT_RANGE_ATTACK1 ); } Vector vecSrc; QAngle vecAng; int iAttachment; if ( m_iUpgradeLevel > 1 && (m_iAmmoShells & 1) ) { // level 2 and 3 turrets alternate muzzles each time they fizzy fizzy fire. iAttachment = m_iAttachments[SENTRYGUN_ATTACHMENT_MUZZLE_ALT]; } else { iAttachment = m_iAttachments[SENTRYGUN_ATTACHMENT_MUZZLE]; } GetAttachment( iAttachment, vecSrc, vecAng ); Vector vecMidEnemy = m_hEnemy->WorldSpaceCenter(); // If we cannot see their WorldSpaceCenter ( possible, as we do our target finding based // on the eye position of the target ) then fire at the eye position trace_t tr; UTIL_TraceLine( vecSrc, vecMidEnemy, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr); if ( !tr.m_pEnt || tr.m_pEnt->IsWorld() ) { // Hack it lower a little bit.. // The eye position is not always within the hitboxes for a standing TF Player vecMidEnemy = m_hEnemy->EyePosition() + Vector(0,0,-5); } vecAimDir = vecMidEnemy - vecSrc; float flDistToTarget = vecAimDir.Length(); vecAimDir.NormalizeInPlace(); //NDebugOverlay::Cross3D( vecSrc, 10, 255, 0, 0, false, 0.1 ); FireBulletsInfo_t info; info.m_vecSrc = vecSrc; info.m_vecDirShooting = vecAimDir; info.m_iTracerFreq = 1; info.m_iShots = 1; info.m_pAttacker = GetBuilder(); info.m_vecSpread = vec3_origin; info.m_flDistance = flDistToTarget + 100; info.m_iAmmoType = m_iAmmoType; info.m_flDamage = tf_sentrygun_damage.GetFloat(); FireBullets( info ); //NDebugOverlay::Line( vecSrc, vecSrc + vecAimDir * 1000, 255, 0, 0, false, 0.1 ); CEffectData data; data.m_nEntIndex = entindex(); data.m_nAttachmentIndex = iAttachment; data.m_fFlags = m_iUpgradeLevel; data.m_vOrigin = vecSrc; DispatchEffect( "TF_3rdPersonMuzzleFlash_SentryGun", data ); switch( m_iUpgradeLevel ) { case 1: default: EmitSound( "Building_Sentrygun.Fire" ); break; case 2: EmitSound( "Building_Sentrygun.Fire2" ); break; case 3: EmitSound( "Building_Sentrygun.Fire3" ); break; } if ( !tf_sentrygun_ammocheat.GetBool() && !HasSpawnFlags( SF_SENTRY_INFINITE_AMMO ) ) { m_iAmmoShells--; } } else { if ( m_iUpgradeLevel > 1 ) { if ( !IsPlayingGesture( ACT_RANGE_ATTACK1_LOW ) ) { RemoveGesture( ACT_RANGE_ATTACK1 ); AddGesture( ACT_RANGE_ATTACK1_LOW ); } } // Out of ammo, play a click EmitSound( "Building_Sentrygun.Empty" ); m_flNextAttack = gpGlobals->curtime + 0.2; } return true; }
// 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 ); }