本文整理汇总了C++中LookupSequence函数的典型用法代码示例。如果您正苦于以下问题:C++ LookupSequence函数的具体用法?C++ LookupSequence怎么用?C++ LookupSequence使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LookupSequence函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StudioFrameAdvance
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Dota_Resupply::CrateThink( void )
{
StudioFrameAdvance();
DispatchAnimEvents( this );
SetNextThink( gpGlobals->curtime + 0.1f );
// Start closing if we're not already
if ( GetSequence() != LookupSequence( "Close" ) )
{
// Not ready to close?
if ( m_flCloseTime <= gpGlobals->curtime )
{
//m_hActivator = NULL;
ResetSequence( LookupSequence( "Close" ) );
}
}
else
{
// See if we're fully closed
if ( IsSequenceFinished() )
{
// Stop thinking
SetThink( NULL );
CPASAttenuationFilter sndFilter( this, "AmmoCrate.Close" );
EmitSound( sndFilter, entindex(), "AmmoCrate.Close" );
// FIXME: We're resetting the sequence here
// but setting Think to NULL will cause this to never have
// StudioFrameAdvance called. What are the consequences of that?
ResetSequence( LookupSequence( "Idle" ) );
SetBodygroup( 1, true );
m_hActivator->SetCanShop( false );
m_hActivator = NULL;
}
}
}
示例2: RunTask
//=========================================================
// RunTask
//=========================================================
void CHAssassin :: RunTask ( Task_t *pTask )
{
switch ( pTask->iTask )
{
case TASK_ASSASSIN_FALL_TO_GROUND:
MakeIdealYaw( m_vecEnemyLKP );
ChangeYaw( pev->yaw_speed );
if (m_fSequenceFinished)
{
if (pev->velocity.z > 0)
{
pev->sequence = LookupSequence( "fly_up" );
}
else if (HasConditions ( bits_COND_SEE_ENEMY ))
{
pev->sequence = LookupSequence( "fly_attack" );
pev->frame = 0;
}
else
{
pev->sequence = LookupSequence( "fly_down" );
pev->frame = 0;
}
ResetSequenceInfo( );
SetYawSpeed();
}
if (pev->flags & FL_ONGROUND)
{
// ALERT( at_console, "on ground\n");
TaskComplete( );
}
break;
default:
CBaseMonster :: RunTask ( pTask );
break;
}
}
示例3: EmitSound
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNewWallHealth::Recharge(void)
{
EmitSound( "WallHealth.Recharge" );
m_flJuice = m_iJuice = sk_healthcharger.GetInt();
m_nState = 0;
ResetSequence( LookupSequence( "idle" ) );
StudioFrameAdvance();
m_iReactivate = 0;
SetThink( NULL );
}
示例4: PRECACHE_MODEL
//=========================================================
// ********** DeadHGrunt SPAWN **********
//=========================================================
void CDeadHGrunt::Spawn( void )
{
PRECACHE_MODEL( "models/hgrunt.mdl" );
SetModel( "models/hgrunt.mdl" );
pev->effects = 0;
pev->yaw_speed = 8;
pev->sequence = 0;
m_bloodColor = BLOOD_COLOR_RED;
pev->sequence = LookupSequence( m_szPoses[ m_iPose ] );
if( pev->sequence == -1 )
{
ALERT( at_console, "Dead hgrunt with bad pose\n" );
}
// Corpses have less health
pev->health = 8;
// map old bodies onto new bodies
switch( pev->body )
{
case 0: // Grunt with Gun
pev->body = 0;
pev->skin = 0;
SetBodygroup( HEAD_GROUP, HEAD_GRUNT );
SetBodygroup( GUN_GROUP, GUN_MP5 );
break;
case 1: // Commander with Gun
pev->body = 0;
pev->skin = 0;
SetBodygroup( HEAD_GROUP, HEAD_COMMANDER );
SetBodygroup( GUN_GROUP, GUN_MP5 );
break;
case 2: // Grunt no Gun
pev->body = 0;
pev->skin = 0;
SetBodygroup( HEAD_GROUP, HEAD_GRUNT );
SetBodygroup( GUN_GROUP, GUN_NONE );
break;
case 3: // Commander no Gun
pev->body = 0;
pev->skin = 0;
SetBodygroup( HEAD_GROUP, HEAD_COMMANDER );
SetBodygroup( GUN_GROUP, GUN_NONE );
break;
}
MonsterInitDead();
}
示例5: LookupSequence
//-----------------------------------------------------------------------------
// Purpose: Input that sets the sequence of the entity
//-----------------------------------------------------------------------------
void CEnvEffectsScript::InputSetSequence( inputdata_t &inputdata )
{
if ( inputdata.value.StringID() != NULL_STRING )
{
int nSequence = LookupSequence( STRING( inputdata.value.StringID() ) );
if ( nSequence != ACT_INVALID )
{
SetSequence( nSequence );
ResetSequenceInfo();
SetCycle( 0.0f );
m_flPlaybackRate = 1.0f;
}
}
}
示例6: ResetSequence
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CCycler_TF2Commando::Think( void )
{
// Change sequence
if ( IsSequenceFinished() )
{
// Raising our shield?
if ( m_bShieldActive )
{
ResetSequence( LookupSequence( "ShieldUpIdle" ) );
}
else if ( GetSequence() == LookupSequence( "ShieldDown" ) )
{
ResetSequence( LookupSequence( "Idle" ) );
}
}
SetNextThink( gpGlobals->curtime + 0.1f );
if (m_animate)
{
StudioFrameAdvance ( );
}
}
示例7: UpdateSkin
//-----------------------------------------------------------------------------
// Purpose: Retire the turret until enabled again
//-----------------------------------------------------------------------------
void CNPC_RocketTurret::Disable( void )
{
if ( !m_bEnabled )
return;
UpdateSkin( ROCKET_SKIN_IDLE );
m_bEnabled = false;
ResetSequence(LookupSequence("close"));
SetThink( &CNPC_RocketTurret::ClosingThink );
SetNextThink( gpGlobals->curtime + 0.05 );
SetEnemy( NULL );
}
示例8: EmitSound
void CNewRecharge::Recharge(void)
{
EmitSound( "SuitRecharge.Start" );
ResetSequence( LookupSequence( "idle" ) );
UpdateJuice( MaxJuice() );
m_nState = 0;
m_flJuice = m_iJuice;
m_iReactivate = 0;
StudioFrameAdvance();
SetThink( &CNewRecharge::SUB_DoNothing );
}
示例9: SetSequence
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_RocketTurret::SearchThink()
{
if ( PreThink() || GetEnemy() == NULL )
return;
SetSequence ( LookupSequence( "idle" ) );
UpdateAimPoint();
//Update our think time
SetNextThink( gpGlobals->curtime + ROCKET_TURRET_THINK_RATE );
// Still can't see enemy, zip around frantically
if ( !m_bHasSightOfEnemy )
{
if ( m_flTimeSpentPaused >= m_flPauseLength )
{
float flOffsetX = RandomFloat( -5.0f, 5.0f );
float flOffsetY = RandomFloat( -5.0f, 5.0f );
if ( fabs(m_flTotalDivergenceX) <= MAX_DIVERGENCE_X ||
SignDiffers( m_flTotalDivergenceX, flOffsetX ) )
{
m_flTotalDivergenceX += flOffsetX;
m_vecGoalAngles.x += flOffsetX;
}
if ( fabs(m_flTotalDivergenceY) <= MAX_DIVERGENCE_Y ||
SignDiffers( m_flTotalDivergenceY, flOffsetY ) )
{
m_flTotalDivergenceY += flOffsetY;
m_vecGoalAngles.y += flOffsetY;
}
// Reset pause timer
m_flTimeSpentPaused = 0.0f;
m_flPauseLength = RandomFloat( 0.3f, 2.5f );
}
m_flTimeSpentPaused += ROCKET_TURRET_THINK_RATE;
}
else
{
// Found target, go back to following it
SetThink( &CNPC_RocketTurret::FollowThink );
SetNextThink( gpGlobals->curtime + ROCKET_TURRET_THINK_RATE );
}
// Move beam towards goal angles
UpdateFacing();
}
示例10: ResetSequence
//-----------------------------------------------------------------------------
// Canister finished opening
//-----------------------------------------------------------------------------
void CEnvHeadcrabCanister::CanisterFinishedOpening( void )
{
ResetSequence( LookupSequence( "idle_open" ) );
m_OnOpened.FireOutput( this, this, 0 );
m_bOpened = true;
SetContextThink( NULL, gpGlobals->curtime, s_pOpenThinkContext );
if ( !HasSpawnFlags( SF_START_IMPACTED ) )
{
if ( !HasSpawnFlags( SF_WAIT_FOR_INPUT_TO_SPAWN_HEADCRABS ) )
{
StartSpawningHeadcrabs( 3.0f );
}
}
}
示例11: StartTalking
//-----------------------------------------------------------------------------
// Purpose: Cores play a special animation when picked up and dropped
// Input : pPhysGunUser - player picking up object
// reason - type of pickup
//-----------------------------------------------------------------------------
void CPropGladosCore::OnPhysGunPickup( CBasePlayer* pPhysGunUser, PhysGunPickup_t reason )
{
if ( m_bFirstPickup )
{
float flTalkingDelay = (CORETYPE_CURIOUS == m_iCoreType) ? (2.0f) : (0.0f);
StartTalking ( flTalkingDelay );
}
m_bFirstPickup = false;
ResetSequence(LookupSequence("turn"));
// +use always enables motion on these props
EnableMotion();
BaseClass::OnPhysGunPickup ( pPhysGunUser, reason );
}
示例12: ToBasePlayer
//-----------------------------------------------------------------------------
// Purpose:
// Input : *pActivator -
// *pCaller -
// useType -
// value -
//-----------------------------------------------------------------------------
void CItem_AmmoCrate::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
CBasePlayer *pPlayer = ToBasePlayer( pActivator );
if ( pPlayer == NULL )
return;
m_OnUsed.FireOutput( pActivator, this );
int iSequence = LookupSequence( "Open" );
// See if we're not opening already
if ( GetSequence() != iSequence )
{
Vector mins, maxs;
trace_t tr;
CollisionProp()->WorldSpaceAABB( &mins, &maxs );
Vector vOrigin = GetAbsOrigin();
vOrigin.z += ( maxs.z - mins.z );
mins = (mins - GetAbsOrigin()) * 0.2f;
maxs = (maxs - GetAbsOrigin()) * 0.2f;
mins.z = ( GetAbsOrigin().z - vOrigin.z );
UTIL_TraceHull( vOrigin, vOrigin, mins, maxs, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );
if ( tr.startsolid || tr.allsolid )
return;
m_hActivator = pPlayer;
// Animate!
ResetSequence( iSequence );
// Make sound
CPASAttenuationFilter sndFilter( this, "AmmoCrate.Open" );
EmitSound( sndFilter, entindex(), "AmmoCrate.Open" );
// Start thinking to make it return
SetThink( &CItem_AmmoCrate::CrateThink );
SetNextThink( gpGlobals->curtime + 0.1f );
}
// Don't close again for two seconds
m_flCloseTime = gpGlobals->curtime + AMMO_CRATE_CLOSE_DELAY;
}
示例13: Spawn
// ********** Dead Zombie Soldier SPAWN **********
void CDeadZombieSoldier :: Spawn( )
{
Precache();
SET_MODEL(ENT(pev), "models/zombie_soldier.mdl");
pev->effects = 0;
pev->sequence = 0;
pev->health = 8;
m_bloodColor = BLOOD_COLOR_GREEN;
pev->sequence = LookupSequence( m_szPoses[m_iPose] );
if (pev->sequence == -1)
ALERT ( at_console, "Dead scientist with bad pose\n" );
MonsterInitDead();
}
示例14: SetupVOList
void CPropGladosCore::Spawn( void )
{
SetupVOList();
Precache();
KeyValue( "model", GLADOS_CORE_MODEL_NAME );
BaseClass::Spawn();
//Default to 'dropped' animation
ResetSequence(LookupSequence("drop"));
SetCycle( 1.0f );
DisableAutoFade();
m_iEyeballAttachment = LookupAttachment( "eyeball" );
SetContextThink( &CPropGladosCore::AnimateThink, gpGlobals->curtime + 0.1f, s_pAnimateThinkContext );
}
示例15: Spawn
//
// ********** Scientist SPAWN **********
//
void CSittingScientist :: Spawn( )
{
if (pev->model)
PRECACHE_MODEL((char*)STRING(pev->model)); //LRC
else
PRECACHE_MODEL("models/scientist.mdl");
if (pev->model)
SET_MODEL(ENT(pev), STRING(pev->model)); //LRC
else
SET_MODEL(ENT(pev), "models/scientist.mdl");
Precache();
InitBoneControllers();
UTIL_SetSize(pev, Vector(-14, -14, 0), Vector(14, 14, 36));
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_STEP;
pev->effects = 0;
pev->health = 50;
m_bloodColor = BLOOD_COLOR_RED;
m_flFieldOfView = VIEW_FIELD_WIDE; // indicates the width of this monster's forward view cone ( as a dotproduct result )
m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD;
if (!FBitSet(pev->spawnflags, SF_SITTINGSCI_POSTDISASTER)) //LRC- allow a sitter to be postdisaster.
SetBits(pev->spawnflags, SF_MONSTER_PREDISASTER); // predisaster only!
if ( pev->body == -1 )
{// -1 chooses a random head
pev->body = RANDOM_LONG(0, NUM_SCIENTIST_HEADS-1);// pick a head, any head
}
// Luther is black, make his hands black
if ( pev->body == HEAD_LUTHER )
pev->skin = 1;
m_baseSequence = LookupSequence( "sitlookleft" );
pev->sequence = m_baseSequence + RANDOM_LONG(0,4);
ResetSequenceInfo( );
SetThink(&CSittingScientist ::SittingThink);
SetNextThink( 0.1 );
DROP_TO_FLOOR ( ENT(pev) );
}