本文整理汇总了C++中CBaseCombatCharacter::Classify方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatCharacter::Classify方法的具体用法?C++ CBaseCombatCharacter::Classify怎么用?C++ CBaseCombatCharacter::Classify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatCharacter
的用法示例。
在下文中一共展示了CBaseCombatCharacter::Classify方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAttackDamageScale
float CNPC_Portal_GroundTurret::GetAttackDamageScale( CBaseEntity *pVictim )
{
CBaseCombatCharacter *pBCC = pVictim->MyCombatCharacterPointer();
// Do extra damage to antlions & combine
if ( pBCC )
{
if ( pBCC->Classify() == CLASS_PLAYER )
return turret_ground_damage_multiplier.GetFloat();
}
return BaseClass::GetAttackDamageScale( pVictim );
}
示例2: GetAttackDamageScale
float CNPC_Portal_FloorTurret::GetAttackDamageScale( CBaseEntity *pVictim )
{
CBaseCombatCharacter *pBCC = pVictim->MyCombatCharacterPointer();
// Do extra damage to antlions & combine
if ( pBCC )
{
if ( pBCC->Classify() == CLASS_PLAYER )
{
// Does normal damage when thrashing
if ( OnSide() )
return 1.0f;
return TURRET_FLOOR_DAMAGE_MULTIPLIER;
}
}
return BaseClass::GetAttackDamageScale( pVictim );
}
示例3: DrawAttackBeam
//------------------------------------------------------------------------------
// Purpose : Draw attack beam and do damage / decals
// Input :
// Output :
//------------------------------------------------------------------------------
void CNPC_Stalker::DrawAttackBeam(void)
{
if (!m_pBeam)
return;
// ---------------------------------------------
// Get beam end point
// ---------------------------------------------
Vector vecSrc = LaserStartPosition(GetAbsOrigin());
trace_t tr;
AI_TraceLine( vecSrc, vecSrc + m_vLaserDir * MAX_STALKER_FIRE_RANGE, MASK_SHOT, this, COLLISION_GROUP_NONE, &tr);
CalcBeamPosition();
bool bInWater = (UTIL_PointContents ( tr.endpos, MASK_WATER ) & MASK_WATER)?true:false;
// ---------------------------------------------
// Update the beam position
// ---------------------------------------------
m_pBeam->SetStartPos( tr.endpos );
m_pBeam->RelinkBeam();
Vector vAttachPos;
GetAttachment(STALKER_LASER_ATTACHMENT,vAttachPos);
Vector vecAimDir = tr.endpos - vAttachPos;
VectorNormalize( vecAimDir );
SetAim( vecAimDir );
// --------------------------------------------
// Play burn sounds
// --------------------------------------------
CBaseCombatCharacter *pBCC = ToBaseCombatCharacter( tr.m_pEnt );
if (pBCC)
{
if (gpGlobals->curtime > m_fNextDamageTime)
{
ClearMultiDamage();
float damage = 0.0;
switch (m_eBeamPower)
{
case STALKER_BEAM_LOW:
damage = 1;
break;
case STALKER_BEAM_MED:
damage = 3;
break;
case STALKER_BEAM_HIGH:
damage = 10;
break;
}
CTakeDamageInfo info( this, this, damage, DMG_SHOCK );
CalculateMeleeDamageForce( &info, m_vLaserDir, tr.endpos );
pBCC->DispatchTraceAttack( info, m_vLaserDir, &tr );
ApplyMultiDamage();
m_fNextDamageTime = gpGlobals->curtime + 0.1;
}
if (pBCC->Classify()!=CLASS_BULLSEYE)
{
if (!m_bPlayingHitFlesh)
{
CPASAttenuationFilter filter( m_pBeam,"NPC_Stalker.BurnFlesh" );
filter.MakeReliable();
EmitSound( filter, m_pBeam->entindex(),"NPC_Stalker.BurnFlesh" );
m_bPlayingHitFlesh = true;
}
if (m_bPlayingHitWall)
{
StopSound( m_pBeam->entindex(), "NPC_Stalker.BurnWall" );
m_bPlayingHitWall = false;
}
tr.endpos.z -= 24.0f;
if (!bInWater)
{
DoSmokeEffect(tr.endpos + tr.plane.normal * 8);
}
}
}
if (!pBCC || pBCC->Classify()==CLASS_BULLSEYE)
{
if (!m_bPlayingHitWall)
{
CPASAttenuationFilter filter( m_pBeam, "NPC_Stalker.BurnWall" );
filter.MakeReliable();
EmitSound( filter, m_pBeam->entindex(), "NPC_Stalker.BurnWall" );
m_bPlayingHitWall = true;
}
if (m_bPlayingHitFlesh)
{
//.........这里部分代码省略.........