本文整理汇总了C++中C_BaseCombatWeapon::Classify方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseCombatWeapon::Classify方法的具体用法?C++ C_BaseCombatWeapon::Classify怎么用?C++ C_BaseCombatWeapon::Classify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseCombatWeapon
的用法示例。
在下文中一共展示了C_BaseCombatWeapon::Classify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBind
void CASWNightVisionSelfIllumProxy::OnBind( void *pC_BaseEntity )
{
Assert( m_pResult );
C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer();
if ( !pPlayer || !pC_BaseEntity )
{
SetFloatResult( 0.0f );
return;
}
C_ASW_Marine *pMarine = pPlayer->GetMarine();
if ( !pMarine )
{
SetFloatResult( 0.0f );
return;
}
if ( C_JaS_Alien_Controller::AutoList().Count() )
{
C_JaS_Alien_Controller *pAlienController = dynamic_cast<C_JaS_Alien_Controller *>( C_JaS_Alien_Controller::AutoList().Head()->GetEntity() );
if ( pAlienController->m_hBuzzerOverride )
{
SetFloatResult( 255.0f );
return;
}
}
C_BaseCombatWeapon* pExtraItem = pMarine->GetWeapon( 2 );
if ( pExtraItem && pExtraItem->Classify() == CLASS_ASW_NIGHT_VISION )
{
C_ASW_Weapon_Night_Vision *pVision = assert_cast<CASW_Weapon_Night_Vision*>( pExtraItem );
float flVisionAlpha = pVision->m_flVisionAlpha;
if ( flVisionAlpha != 0.0f )
{
SetFloatResult( flVisionAlpha / 255.0f * asw_night_vision_self_illum_multiplier.GetFloat() );
return;
}
}
if ( pPlayer->IsSniperScopeActive() && g_bRenderingGlows )
{
SetFloatResult( asw_sniper_scope_self_illum_multiplier.GetFloat() );
return;
}
SetFloatResult( 0.0f );
}
示例2: PerformNightVisionEffect
void CASWViewRender::PerformNightVisionEffect( const CViewSetup &view )
{
C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer();
if ( !pPlayer )
return;
C_ASW_Marine *pMarine = pPlayer->GetMarine();
if ( !pMarine )
return;
float flVisionAlpha = 0.0f;
float flFlashAlpha = 0.0f;
C_BaseCombatWeapon* pExtraItem = pMarine->GetWeapon( 2 );
if ( pExtraItem && pExtraItem->Classify() == CLASS_ASW_NIGHT_VISION )
{
C_ASW_Weapon_Night_Vision *pVision = assert_cast<CASW_Weapon_Night_Vision*>( pExtraItem );
flVisionAlpha = pVision->UpdateVisionAlpha();
flFlashAlpha = pVision->UpdateFlashAlpha();
}
if ( flVisionAlpha > 0 )
{
IMaterial *pMaterial = materials->FindMaterial( "effects/nightvision", TEXTURE_GROUP_CLIENT_EFFECTS, true );
if ( pMaterial )
{
byte overlaycolor[4] = { 0, 255, 0, 255 };
UpdateScreenEffectTexture( 0, view.x, view.y, view.width, view.height );
overlaycolor[3] = flVisionAlpha;
render->ViewDrawFade( overlaycolor, pMaterial );
CMatRenderContextPtr pRenderContext( materials );
pRenderContext->DrawScreenSpaceQuad( pMaterial );
render->ViewDrawFade( overlaycolor, pMaterial );
pRenderContext->DrawScreenSpaceQuad( pMaterial );
}
IMaterial *pNoiseMaterial = materials->FindMaterial( "effects/nightvision_noise", TEXTURE_GROUP_CLIENT_EFFECTS, true );
if ( pNoiseMaterial )
{
byte overlaycolor[4] = { 255, 255, 255, 255 };
overlaycolor[3] = MAX( flFlashAlpha, 16.0f );
CMatRenderContextPtr pRenderContext( materials );
render->ViewDrawFade( overlaycolor, pNoiseMaterial );
}
}
if ( flFlashAlpha > 0 )
{
IMaterial *pMaterial = materials->FindMaterial( "effects/nightvision_flash", TEXTURE_GROUP_CLIENT_EFFECTS, true );
if ( pMaterial )
{
byte overlaycolor[4] = { 255, 255, 255, 255 };
overlaycolor[3] = flFlashAlpha;
CMatRenderContextPtr pRenderContext( materials );
render->ViewDrawFade( overlaycolor, pMaterial );
}
}
}