本文整理匯總了C++中EMIT_SOUND_DYN函數的典型用法代碼示例。如果您正苦於以下問題:C++ EMIT_SOUND_DYN函數的具體用法?C++ EMIT_SOUND_DYN怎麽用?C++ EMIT_SOUND_DYN使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EMIT_SOUND_DYN函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: StudioFrameAdvance
void CBaseTurret::Retire(void)
{
// make the turret level
m_vecGoalAngles.x = 0;
m_vecGoalAngles.y = m_flStartYaw;
pev->nextthink = gpGlobals->time + 0.1;
StudioFrameAdvance( );
EyeOff( );
if (!MoveTurret())
{
if (m_iSpin)
{
SpinDownCall();
}
else if (pev->sequence != TURRET_ANIM_RETIRE)
{
SetTurretAnim(TURRET_ANIM_RETIRE);
EMIT_SOUND_DYN(ENT(pev), CHAN_BODY, this->GetDeploySound(), TURRET_MACHINE_VOLUME, ATTN_NORM, 0, 120);
SUB_UseTargets( this, USE_OFF, 0 );
}
else if (m_fSequenceFinished)
{
m_iOn = 0;
m_flLastSight = 0;
SetTurretAnim(TURRET_ANIM_NONE);
pev->maxs.z = m_iRetractHeight;
pev->mins.z = -m_iRetractHeight;
UTIL_SetSize(pev, pev->mins, pev->maxs);
if (m_iAutoStart)
{
SetThink(&CBaseTurret::AutoSearchThink);
pev->nextthink = gpGlobals->time + .1;
}
else
SetThink(&CBaseTurret::SUB_DoNothing);
}
}
else
{
SetTurretAnim(TURRET_ANIM_SPIN);
}
}
示例2: EMIT_SOUND_DYN
//=========================================================
// Materialize - make a CBasePlayerItem visible and tangible
//=========================================================
void CBasePlayerItem::Materialize( void )
{
if ( pev->effects & EF_NODRAW )
{
// changing from invisible state to visible.
EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, "items/suitchargeok1.wav", 1, ATTN_NORM, 0, 150 );
pev->effects &= ~EF_NODRAW;
pev->effects |= EF_MUZZLEFLASH;
}
pev->solid = SOLID_TRIGGER;
UTIL_SetOrigin( this, pev->origin );// link into world.
SetTouch(&CBasePlayerItem::DefaultTouch);
SetThink (NULL);
}
示例3: RANDOM_FLOAT
BOOL CSqueak::Deploy( )
{
// play hunt sound
float flRndSound = RANDOM_FLOAT ( 0 , 1 );
#ifndef CLIENT_DLL
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, gameplayMods::snarkPenguins.isActive() ? RANDOM_SOUND_ARRAY( pPinguHuntSounds ) : RANDOM_SOUND_ARRAY_PAYNED_PAIN_MONSTER( pHuntSounds ), 1, ATTN_NORM, 0, 100 );
#endif // !CLIENT_DLL
m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;
if ( gameplayMods::snarkPenguins.isActive() ) {
return DefaultDeploy( "models/v_pingu.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" );
} else {
return DefaultDeploy( "models/v_squeak.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" );
}
}
示例4: EMIT_SOUND_DYN
BOOL CPython::Deploy( )
{
#ifdef CLIENT_DLL
if ( bIsMultiplayer() )
#else
if ( g_pGameRules->IsMultiplayer() )
#endif
{
// enable laser sight geometry.
pev->body = 1;
}
else
{
pev->body = 0;
}
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/weapon_deploy.wav", RANDOM_FLOAT(0.95, 1.0), ATTN_NORM, 0, 93 + RANDOM_LONG(0,0xF));
return DefaultDeploy( "models/weapons/357/v_357.mdl", "models/weapons/357/p_357.mdl", PYTHON_DRAW, "python", UseDecrement(), pev->body );
}
示例5: SetTurretAnim
void CTurret::SpinDownCall(void)
{
if (m_iSpin)
{
SetTurretAnim( TURRET_ANIM_SPIN );
if (pev->framerate == 1.0)
{
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, "turret/tu_active2.wav", 0, 0, SND_STOP, 100);
EMIT_SOUND(ENT(pev), CHAN_ITEM, "turret/tu_spindown.wav", TURRET_MACHINE_VOLUME, ATTN_NORM);
}
pev->framerate -= 0.02;
if (pev->framerate <= 0)
{
pev->framerate = 0;
m_iSpin = 0;
}
}
}
示例6: switch
void CAWP::SecondaryAttack()
{
switch( m_pPlayer->m_iFOV )
{
case 90 : m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 40;
case 40 : m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 10;
case 10 : m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 90;
}
/*! @todo: Implements this :
if( TheBots )
TheBots->OnEvent( EVENT_WEAPON_ZOOMED, m_pPlayer->pev, NULL ); */
m_pPlayer->ResetMaxSpeed();
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/zoom.wav", VOL_NORM, 2.4, 0, ATTN_NORM );
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3;
}
示例7: UTIL_MakeVectors
void CMGargantua::StompAttack( void )
{
TraceResult trace;
UTIL_MakeVectors( pev->angles );
Vector vecStart = pev->origin + Vector(0,0,60) + 35 * gpGlobals->v_forward;
Vector vecAim = ShootAtEnemy( vecStart );
Vector vecEnd = (vecAim * 1024) + vecStart;
UTIL_TraceLine( vecStart, vecEnd, ignore_monsters, edict(), &trace );
CStomp::StompCreate( vecStart, trace.vecEndPos, 0 );
UTIL_ScreenShake( pev->origin, 12.0, 100.0, 2.0, 1000 );
EMIT_SOUND_DYN ( edict(), CHAN_WEAPON, pStompSounds[ RANDOM_LONG(0,ARRAYSIZE(pStompSounds)-1) ], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG(-10,10) );
UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,20), ignore_monsters, edict(), &trace );
if ( trace.flFraction < 1.0 )
UTIL_DecalTrace( &trace, DECAL_GARGSTOMP1 );
}
示例8: RampPitchVol
void CFuncRotating :: RampPitchVol( void )
{
// calc volume and pitch as % of maximum vol and pitch.
float fpct = fabs( GetLocalAvelocity().Length() ) / m_flMaxSpeed;
float fvol = bound( 0.0f, m_flVolume * fpct, 1.0f ); // slowdown volume ramps down to 0
float fpitch = FANPITCHMIN + ( FANPITCHMAX - FANPITCHMIN ) * fpct;
int pitch = bound( 0, fpitch, 255 );
if( pitch == PITCH_NORM )
{
pitch = PITCH_NORM - 1;
}
// change the fan's vol and pitch
EMIT_SOUND_DYN( edict(), CHAN_STATIC, STRING( pev->noise3 ), fvol, m_flAttenuation, SND_CHANGE_PITCH|SND_CHANGE_VOL, pitch );
}
示例9: abs
/* <1e8f9> ../cstrike/dlls/bmodels.cpp:540 */
void CFuncRotating::RampPitchVol(int fUp)
{
Vector vecAVel = pev->avelocity;
float_precision vecCur;
float_precision vecFinal;
float_precision fpct;
float fvol;
float fpitch;
int pitch;
// get current angular velocity
vecCur = abs((int)(vecAVel.x != 0 ? vecAVel.x : (vecAVel.y != 0 ? vecAVel.y : vecAVel.z)));
// get target angular velocity
vecFinal = (pev->movedir.x != 0 ? pev->movedir.x : (pev->movedir.y != 0 ? pev->movedir.y : pev->movedir.z));
vecFinal *= pev->speed;
vecFinal = abs((int)vecFinal);
// calc volume and pitch as % of final vol and pitch
fpct = vecCur / vecFinal;
//if (fUp)
//{
// // spinup volume ramps up from 50% max vol
// fvol = m_flVolume * (0.5 + fpct/2.0);
//}
//else
{
// slowdown volume ramps down to 0
fvol = m_flVolume * fpct;
}
fpitch = FANPITCHMIN + (FANPITCHMAX - FANPITCHMIN) * fpct;
pitch = (int)fpitch;
if (pitch == PITCH_NORM)
{
pitch = PITCH_NORM - 1;
}
// change the fan's vol and pitch
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), fvol, m_flAttenuation, (SND_CHANGE_PITCH | SND_CHANGE_VOL), pitch);
}
示例10: EMIT_SOUND_DYN
void CDisplacer::PrimaryAttack()
{
int flags;
flags = 0;
if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < DISPLACER_PRIMARY_USAGE)
{
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "buttons/button11.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
return;
}
m_iSecondaryMode = TRUE;
pev->nextthink = gpGlobals->time + 1.05;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.05;
SetThink( &CDisplacer::FireThink );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.20;
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSpinDisplacer, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, m_iBeam, 0, m_iSecondaryMode);
}
示例11: StartTask
void CHeadCrab :: StartTask ( Task_t *pTask )
{
m_iTaskStatus = TASKSTATUS_RUNNING;
switch ( pTask->iTask )
{
case TASK_RANGE_ATTACK1:
{
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackSounds[0], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() );
m_IdealActivity = ACT_RANGE_ATTACK1;
SetTouch ( LeapTouch );
break;
}
default:
{
CBaseMonster :: StartTask( pTask );
}
}
}
示例12: UTIL_PointContents
void CShockBeam::Explode()
{
const Contents contents = UTIL_PointContents( GetAbsOrigin() );
if( m_pSprite )
{
UTIL_Remove( m_pSprite );
m_pSprite = nullptr;
}
if( m_pBeam1 )
{
UTIL_Remove( m_pBeam1 );
m_pBeam1 = nullptr;
}
if( m_pBeam2 )
{
UTIL_Remove( m_pBeam2 );
m_pBeam2 = nullptr;
}
SetDamage( 40 );
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, GetAbsOrigin() );
WRITE_BYTE( TE_DLIGHT );
WRITE_COORD_VECTOR( GetAbsOrigin() );
WRITE_BYTE( 8 );
WRITE_BYTE( 0 );
WRITE_BYTE( 253 );
WRITE_BYTE( 253 );
WRITE_BYTE( 5 );
WRITE_BYTE( 10 );
MESSAGE_END();
SetOwner( nullptr );
EMIT_SOUND_DYN(
this, CHAN_WEAPON,
"weapons/shock_impact.wav",
UTIL_RandomFloat( 0.8, 0.9 ), ATTN_NORM, 0, PITCH_NORM );
}
示例13: EMIT_SOUND_DYN
BOOL CUsas::Deploy( )
{
#ifdef CLIENT_DLL
if ( bIsMultiplayer() )
#else
if ( g_pGameRules->IsMultiplayer() )
#endif
{
// enable laser sight geometry.
pev->body = 3;
}
else
{
pev->body = 0;
}
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/weapon_deploy.wav", RANDOM_FLOAT(0.95, 1.0), ATTN_NORM, 0, 93 + RANDOM_LONG(0,0xF));
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.1;
return DefaultDeploy( "models/weapons/USAS/v_USAS.mdl", "models/weapons/USAS/p_USAS.mdl", USAS_DEPLOY, "xm4", UseDecrement(), pev->body );
}
示例14: SetTouch
void CDiscwarPowerup::PowerupTouch(CBaseEntity *pOther)
{
if(!pOther->IsPlayer())
return;
CBasePlayer *pPlayer = (CBasePlayer *)pOther;
// Give the powerup to the player
pPlayer->GivePowerup(m_iPowerupType);
m_hPlayerIGaveTo = pPlayer;
SetTouch(NULL);
pev->effects |= EF_NODRAW;
// Choose another powerup soon
SetThink(&CDiscwarPowerup::ChoosePowerupThink);
pev->nextthink = gpGlobals->time + DISC_POWERUP_RESPAWN_TIME;
// Play the powerup sound
EMIT_SOUND_DYN(pOther->edict(), CHAN_STATIC, "powerup.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0, 3));
}
示例15: ResetEmptySound
void CM3::WeaponIdle( void )
{
ResetEmptySound( );
m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES );
if ( m_flPumpTime && m_flPumpTime < gpGlobals->time )
{
// play pumping sound
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG(0,0x1f));
m_flPumpTime = 0;
}
if (m_flTimeWeaponIdle < UTIL_WeaponTimeBase() )
{
if (m_iClip == 0 && m_fInSpecialReload == 0 && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
Reload( );
}
else if (m_fInSpecialReload != 0)
{
if (m_iClip != 8 && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
Reload( );
}
else
{
// reload debounce has timed out
SendWeaponAnim( M3_AFTER_RELOAD );
m_fInSpecialReload = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5;
}
}
else
{
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + (60.0/12.0);
SendWeaponAnim( M3_IDLE1 );
}
}
}