本文整理汇总了C++中CASW_Marine_Resource::GetIntensity方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine_Resource::GetIntensity方法的具体用法?C++ CASW_Marine_Resource::GetIntensity怎么用?C++ CASW_Marine_Resource::GetIntensity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine_Resource
的用法示例。
在下文中一共展示了CASW_Marine_Resource::GetIntensity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMarineStartedHack
void CASW_Director::OnMarineStartedHack( CASW_Marine *pMarine, CBaseEntity *pComputer )
{
CASW_Game_Resource *pGameResource = ASWGameResource();
if ( !pGameResource )
return;
//Msg( " Marine started hack!\n" );
// reset intensity so we can have a big fight without relaxing immediately
for ( int i=0;i<pGameResource->GetMaxMarineResources();i++ )
{
CASW_Marine_Resource *pMR = pGameResource->GetMarineResource(i);
if ( !pMR )
continue;
pMR->GetIntensity()->Reset();
}
float flQuickStart = RandomFloat( 2.0f, 5.0f );
if ( m_HordeTimer.GetRemainingTime() > flQuickStart )
{
m_HordeTimer.Start( flQuickStart );
}
// TODO: Instead have some kind of 'is in a big fight' state?
}
示例2: Event_AlienKilled
// increase intensity as aliens are killed (particularly if they're close to the marines)
void CASW_Director::Event_AlienKilled( CBaseEntity *pAlien, const CTakeDamageInfo &info )
{
if ( !pAlien )
return;
CASW_Game_Resource *pGameResource = ASWGameResource();
if ( !pGameResource )
return;
bool bDangerous = pAlien->Classify() == CLASS_ASW_SHIELDBUG; // shieldbug
bool bVeryDangerous = pAlien->Classify() == CLASS_ASW_QUEEN; // queen
for ( int i=0;i<pGameResource->GetMaxMarineResources();i++ )
{
CASW_Marine_Resource *pMR = pGameResource->GetMarineResource(i);
if ( !pMR )
continue;
CASW_Marine *pMarine = pMR->GetMarineEntity();
if ( !pMarine || pMarine->GetHealth() <= 0 )
continue;
CASW_Intensity::IntensityType stress = CASW_Intensity::MILD;
if ( bVeryDangerous )
{
stress = CASW_Intensity::EXTREME;
}
else if ( bDangerous )
{
stress = CASW_Intensity::HIGH;
}
else
{
float distance = pMarine->GetAbsOrigin().DistTo( pAlien->GetAbsOrigin() );
if ( distance > asw_intensity_far_range.GetFloat() )
{
stress = CASW_Intensity::MILD;
}
else
{
stress = CASW_Intensity::MODERATE;
}
}
pMR->GetIntensity()->Increase( stress );
}
ASWArena()->Event_AlienKilled( pAlien, info );
}