本文整理汇总了C++中CASW_Marine_Resource::IsInhabited方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine_Resource::IsInhabited方法的具体用法?C++ CASW_Marine_Resource::IsInhabited怎么用?C++ CASW_Marine_Resource::IsInhabited使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine_Resource
的用法示例。
在下文中一共展示了CASW_Marine_Resource::IsInhabited方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnThink
void StatsReport::OnThink()
{
int nMarine = 0;
m_pObjectiveMap->ClearBlips();
C_ASW_Game_Resource *pGameResource = ASWGameResource();
for ( int i = 0; i < pGameResource->GetMaxMarineResources() && nMarine < ASW_STATS_REPORT_MAX_PLAYERS; i++ )
{
CASW_Marine_Resource *pMR = pGameResource->GetMarineResource( i );
if ( pMR )
{
Vector vPos;
vPos.x = pMR->m_TimelinePosX.GetValueAtInterp( m_pStatGraphPlayer->m_fTimeInterp );
vPos.y = pMR->m_TimelinePosY.GetValueAtInterp( m_pStatGraphPlayer->m_fTimeInterp );
vPos.z = 0.0f;
bool bDead = ( pMR->m_TimelineHealth.GetValueAtInterp( m_pStatGraphPlayer->m_fTimeInterp ) <= 0.0f );
m_pObjectiveMap->AddBlip( MapBlip_t( vPos, bDead ? Color( 255, 255, 255, 255 ) : getColorPerIndex(pMR->GetCommanderIndex()), bDead ? MAP_BLIP_TEXTURE_DEATH : MAP_BLIP_TEXTURE_NORMAL ) );
if ( m_pReadyCheckImages[ nMarine ]->IsVisible() )
{
C_ASW_Player *pPlayer = pMR->GetCommander();
if ( pPlayer )
{
if ( !pMR->IsInhabited() || ASWGameResource()->IsPlayerReady( pPlayer ) )
{
m_pReadyCheckImages[ i ]->SetImage( "swarm/HUD/TickBoxTicked" );
}
else if ( pPlayer == ASWGameResource()->GetLeader() )
{
m_pReadyCheckImages[ i ]->SetImage( "swarm/PlayerList/LeaderIcon" );
}
else
{
m_pReadyCheckImages[ i ]->SetImage( "swarm/HUD/TickBoxEmpty" );
}
}
}
nMarine++;
}
}
for ( int i = 0; i < ASW_STATS_REPORT_MAX_PLAYERS; i++ )
{
}
}
示例2: Detonate
void CASW_Grenade_PRifle::Detonate()
{
if ( !ASWGameResource() )
return;
m_takedamage = DAMAGE_NO;
CPASFilter filter( GetAbsOrigin() );
Vector vecForward = GetAbsVelocity();
VectorNormalize(vecForward);
trace_t tr;
Vector vecDir = -vecForward;
//te->GaussExplosion( filter, 0.0,
//GetAbsOrigin(), vecDir, 0 );
CEffectData data;
data.m_vOrigin = GetAbsOrigin();
DispatchEffect( "aswstunexplo", data );
EmitSound("ASW_Weapon_PRifle.StunGrenadeExplosion");
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward, MASK_SHOT,
this, COLLISION_GROUP_NONE, &tr);
if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
{
// non-world needs smaller decals
if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
{
UTIL_DecalTrace( &tr, "SmallScorch" );
}
}
else
{
UTIL_DecalTrace( &tr, "Scorch" );
}
UTIL_ASW_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START );
int nPreviousStunnedAliens = ASWGameResource()->m_iElectroStunnedAliens;
// do just 1 damage...
CTakeDamageInfo info( this, GetOwnerEntity(), 1, DMG_SHOCK );
info.SetWeapon( m_hCreatorWeapon );
RadiusDamage ( info , GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );
// count as a shot fired
CASW_Marine *pMarine = dynamic_cast<CASW_Marine*>(GetOwnerEntity());
if ( pMarine && pMarine->GetMarineResource() )
{
CASW_Marine_Resource *pMR = pMarine->GetMarineResource();
pMR->UsedWeapon(NULL, 1);
int nAliensStunned = ASWGameResource()->m_iElectroStunnedAliens - nPreviousStunnedAliens;
if ( nAliensStunned >= 6 && pMR->IsInhabited() && pMR->GetCommander() )
{
pMR->GetCommander()->AwardAchievement( ACHIEVEMENT_ASW_STUN_GRENADE );
pMR->m_bStunGrenadeMedal = true;
}
}
UTIL_Remove( this );
}