本文整理汇总了C++中CBaseGrenade::SetSolid方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseGrenade::SetSolid方法的具体用法?C++ CBaseGrenade::SetSolid怎么用?C++ CBaseGrenade::SetSolid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseGrenade
的用法示例。
在下文中一共展示了CBaseGrenade::SetSolid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAnimEvent
void CNPC_Zombine::HandleAnimEvent( animevent_t *pEvent )
{
if ( pEvent->event == AE_ZOMBINE_PULLPIN )
{
Vector vecStart;
QAngle angles;
GetAttachment( "grenade_attachment", vecStart, angles );
CBaseGrenade *pGrenade = Fraggrenade_Create( vecStart, vec3_angle, vec3_origin, AngularImpulse( 0, 0, 0 ), this, 3.5f, true );
if ( pGrenade )
{
// Move physobject to shadow
IPhysicsObject *pPhysicsObject = pGrenade->VPhysicsGetObject();
if ( pPhysicsObject )
{
pGrenade->VPhysicsDestroyObject();
int iAttachment = LookupAttachment( "grenade_attachment");
pGrenade->SetMoveType( MOVETYPE_NONE );
pGrenade->SetSolid( SOLID_NONE );
pGrenade->SetCollisionGroup( COLLISION_GROUP_DEBRIS );
pGrenade->SetAbsOrigin( vecStart );
pGrenade->SetAbsAngles( angles );
pGrenade->SetParent( this, iAttachment );
pGrenade->SetDamage( 200.0f );
m_hGrenade = pGrenade;
EmitSound( "Zombine.ReadyGrenade" );
// Tell player allies nearby to regard me!
CAI_BaseNPC **ppAIs = g_AI_Manager.AccessAIs();
CAI_BaseNPC *pNPC;
for ( int i = 0; i < g_AI_Manager.NumAIs(); i++ )
{
pNPC = ppAIs[i];
if( pNPC->Classify() == CLASS_PLAYER_ALLY || pNPC->Classify() == CLASS_PLAYER_ALLY_VITAL && pNPC->FVisible(this) )
{
int priority;
Disposition_t disposition;
priority = pNPC->IRelationPriority(this);
disposition = pNPC->IRelationType(this);
pNPC->AddEntityRelationship( this, disposition, priority + 1 );
}
}
}
m_iGrenadeCount--;
}
return;
}
if ( pEvent->event == AE_NPC_ATTACK_BROADCAST )
{
if ( HasGrenade() )
return;
}
BaseClass::HandleAnimEvent( pEvent );
}