本文整理汇总了C++中CBaseMonster::entindex方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseMonster::entindex方法的具体用法?C++ CBaseMonster::entindex怎么用?C++ CBaseMonster::entindex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseMonster
的用法示例。
在下文中一共展示了CBaseMonster::entindex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeGrunt
CBaseMonster *COsprey :: MakeGrunt( Vector vecSrc )
{
CBaseEntity *pEntity;
CBaseMonster *pGrunt;
TraceResult tr;
UTIL_TraceLine( vecSrc, vecSrc + Vector( 0, 0, -4096.0), dont_ignore_monsters, ENT(pev), &tr);
if ( tr.pHit && Instance( tr.pHit )->pev->solid != SOLID_BSP)
return NULL;
for (int i = 0; i < m_iUnits; i++)
{
if (m_hGrunt[i] == NULL || !m_hGrunt[i]->IsAlive())
{
if (m_hGrunt[i] != NULL && m_hGrunt[i]->pev->rendermode == kRenderNormal)
{
m_hGrunt[i]->SUB_StartFadeOut( );
}
pEntity = Create( "monster_human_grunt", vecSrc, GetAbsAngles() );
pGrunt = pEntity->MyMonsterPointer( );
pGrunt->pev->movetype = MOVETYPE_FLY;
pGrunt->SetAbsVelocity( Vector( 0, 0, RANDOM_FLOAT( -196, -128 ) ));
pGrunt->SetActivity( ACT_GLIDE );
CBeam *pBeam = CBeam::BeamCreate( "sprites/rope.spr", 10 );
pBeam->PointEntInit( vecSrc + Vector(0,0,112), pGrunt->entindex() );
pBeam->SetFlags( BEAM_FSOLID );
pBeam->SetColor( 255, 255, 255 );
pBeam->SetThink( SUB_Remove );
pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->GetAbsVelocity().z + 0.5;
// ALERT( at_console, "%d at %.0f %.0f %.0f\n", i, m_vecOrigin[i].x, m_vecOrigin[i].y, m_vecOrigin[i].z );
pGrunt->m_vecLastPosition = m_vecOrigin[i];
m_hGrunt[i] = pGrunt;
return pGrunt;
}
}
// ALERT( at_console, "none dead\n");
return NULL;
}