本文整理汇总了C++中CBaseMonster::IsAlive方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseMonster::IsAlive方法的具体用法?C++ CBaseMonster::IsAlive怎么用?C++ CBaseMonster::IsAlive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseMonster
的用法示例。
在下文中一共展示了CBaseMonster::IsAlive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FormFlock
//=========================================================
// Leader boid calls this to form a flock from surrounding boids
//=========================================================
void CFlockingFlyer :: FormFlock( void )
{
if ( !InSquad() )
{
// I am my own leader
m_pSquadLeader = this;
m_pSquadNext = NULL;
int squadCount = 1;
CBaseEntity *pEntity = NULL;
while ((pEntity = UTIL_FindEntityInSphere( pEntity, pev->origin, AFLOCK_MAX_RECRUIT_RADIUS )) != NULL)
{
CBaseMonster *pRecruit = pEntity->MyMonsterPointer( );
if ( pRecruit && pRecruit != this && pRecruit->IsAlive() && !pRecruit->m_pCine )
{
// Can we recruit this guy?
if ( FClassnameIs ( pRecruit->pev, "monster_flyer" ) )
{
squadCount++;
SquadAdd( (CFlockingFlyer *)pRecruit );
}
}
}
}
SetThink( &CFlockingFlyer::IdleThink );// now that flock is formed, go to idle and wait for a player to come along.
pev->nextthink = gpGlobals->time;
}
示例2: AlertFriends
void CTalkMonster::AlertFriends( void )
{
CBaseEntity *pFriend = NULL;
int i;
// for each friend in this bsp...
for ( i = 0; i < TLK_CFRIENDS; i++ )
{
while( ( pFriend = EnumFriends( pFriend, i, true ) ) != nullptr )
{
CBaseMonster *pMonster = pFriend->MyMonsterPointer();
if ( pMonster->IsAlive() )
{
// don't provoke a friend that's playing a death animation. They're a goner
pMonster->m_afMemory |= bits_MEMORY_PROVOKED;
}
}
}
}