本文整理汇总了C++中CBaseEntity::GetDelay方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::GetDelay方法的具体用法?C++ CBaseEntity::GetDelay怎么用?C++ CBaseEntity::GetDelay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseEntity
的用法示例。
在下文中一共展示了CBaseEntity::GetDelay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Wait
void CGunTarget::Wait( void )
{
CBaseEntity *pTarget = m_hTargetEnt;
if ( !pTarget )
{
Stop();
return;
}
variant_t emptyVariant;
pTarget->AcceptInput( "InPass", this, this, emptyVariant, 0 );
m_flWait = pTarget->GetDelay();
m_target = pTarget->m_target;
SetMoveDone( &CGunTarget::Next );
if (m_flWait != 0)
{// -1 wait will wait forever!
SetMoveDoneTime( m_flWait );
}
else
{
Next();// do it RIGHT now!
}
}
示例2: Wait
void CGunTarget::Wait( void )
{
CBaseEntity *pTarget = m_hTargetEnt;
if( !pTarget )
{
Stop();
return;
}
// Fire the pass target if there is one
if( pTarget->pev->message )
{
FireTargets( STRING( pTarget->pev->message ), this, this, USE_TOGGLE, 0 );
if( FBitSet( pTarget->pev->spawnflags, SF_CORNER_FIREONCE ) )
pTarget->pev->message = 0;
}
m_flWait = pTarget->GetDelay();
pev->target = pTarget->pev->target;
SetThink( &CGunTarget::Next );
if( m_flWait != 0 )
{// -1 wait will wait forever!
pev->nextthink = pev->ltime + m_flWait;
}
else
{
Next();// do it RIGHT now!
}
}
示例3: Next
//
// Train next - path corner needs to change to next target
//
void CFuncTrain::Next( void )
{
CBaseEntity *pTarg;
// now find our next target
//TODO: this entity is supposed to work with path_corner only. Other entities will work, but will probably misbehave. - Solokiller
//Check for classname and ignore others?
pTarg = GetNextTarget();
if( !pTarg )
{
if( pev->noiseMovement )
STOP_SOUND( this, CHAN_STATIC, ( char* ) STRING( pev->noiseMovement ) );
// Play stop sound
if( pev->noiseStopMoving )
EMIT_SOUND( this, CHAN_VOICE, ( char* ) STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM );
return;
}
// Save last target in case we need to find it again
pev->message = pev->target;
pev->target = pTarg->pev->target;
m_flWait = pTarg->GetDelay();
if( m_pevCurrentTarget && m_pevCurrentTarget->speed != 0 )
{// don't copy speed from target if it is 0 (uninitialized)
pev->speed = m_pevCurrentTarget->speed;
ALERT( at_aiconsole, "Train %s speed to %4.2f\n", GetTargetname(), pev->speed );
}
m_pevCurrentTarget = pTarg->pev;// keep track of this since path corners change our target for us.
pev->enemy = pTarg->edict();//hack
if( FBitSet( m_pevCurrentTarget->spawnflags, SF_CORNER_TELEPORT ) )
{
// Path corner has indicated a teleport to the next corner.
SetBits( pev->effects, EF_NOINTERP );
SetAbsOrigin( pTarg->GetAbsOrigin() - ( pev->mins + pev->maxs )* 0.5 );
Wait(); // Get on with doing the next path corner.
}
else
{
// Normal linear move.
// CHANGED this from CHAN_VOICE to CHAN_STATIC around OEM beta time because trains should
// use CHAN_STATIC for their movement sounds to prevent sound field problems.
// this is not a hack or temporary fix, this is how things should be. (sjb).
if( pev->noiseMovement )
{
STOP_SOUND( this, CHAN_STATIC, ( char* ) STRING( pev->noiseMovement ) );
EMIT_SOUND( this, CHAN_STATIC, ( char* ) STRING( pev->noiseMovement ), m_volume, ATTN_NORM );
}
ClearBits( pev->effects, EF_NOINTERP );
SetMoveDone( &CFuncTrain::Wait );
LinearMove( pTarg->GetAbsOrigin() - ( pev->mins + pev->maxs )* 0.5, pev->speed );
}
}