本文整理汇总了C++中CSatchelCharge::GetThrower方法的典型用法代码示例。如果您正苦于以下问题:C++ CSatchelCharge::GetThrower方法的具体用法?C++ CSatchelCharge::GetThrower怎么用?C++ CSatchelCharge::GetThrower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSatchelCharge
的用法示例。
在下文中一共展示了CSatchelCharge::GetThrower方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnyUndetonatedCharges
//-----------------------------------------------------------------------------
// Purpose: Returns true if there are any undetonated charges in the world
// that belong to this player
// Input :
// Output :
//-----------------------------------------------------------------------------
bool CWeapon_SLAM::AnyUndetonatedCharges(void)
{
CBaseEntity *pEntity = NULL;
while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL)
{
CSatchelCharge* pSatchel = dynamic_cast<CSatchelCharge *>(pEntity);
if (pSatchel->m_bIsLive && pSatchel->GetThrower() && pSatchel->GetThrower() == GetOwner())
{
return true;
}
}
return false;
}
示例2: SatchelDetonate
//-----------------------------------------------------------------------------
// Purpose:
// Input :
// Output :
//-----------------------------------------------------------------------------
void CWeapon_SLAM::SatchelDetonate()
{
CBaseEntity *pEntity = NULL;
while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL)
{
CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity);
if (pSatchel->m_bIsLive && pSatchel->GetThrower() && GetOwner() && pSatchel->GetThrower() == GetOwner())
{
pSatchel->Use( GetOwner(), GetOwner(), USE_ON, 0 );
}
}
// Play sound for pressing the detonator
EmitSound( "Weapon_SLAM.SatchelDetonate" );
m_bDetonatorArmed = false;
}
示例3: SatchelDetonate
//-----------------------------------------------------------------------------
// Purpose:
// Input :
// Output :
//-----------------------------------------------------------------------------
void CWeapon_SLAM::SatchelDetonate()
{
#ifndef CLIENT_DLL
CBaseEntity *pEntity = NULL;
while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL)
{
CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity);
if (pSatchel->m_bIsLive && pSatchel->GetThrower() && GetOwner() && pSatchel->GetThrower() == GetOwner())
{
//pSatchel->Use( GetOwner(), GetOwner(), USE_ON, 0 );
//variant_t emptyVariant;
//pSatchel->AcceptInput( "Explode", NULL, NULL, emptyVariant, 5 );
g_EventQueue.AddEvent( pSatchel, "Explode", 0.20, GetOwner(), GetOwner() );
}
}
#endif
// Play sound for pressing the detonator
EmitSound( "Weapon_SLAM.SatchelDetonate" );
m_bDetonatorArmed = false;
}
示例4:
void CHL2MP_Player::DetonateTripmines( void )
{
CBaseEntity *pEntity = NULL;
while ((pEntity = gEntList.FindEntityByClassname( pEntity, "npc_satchel" )) != NULL)
{
CSatchelCharge *pSatchel = dynamic_cast<CSatchelCharge *>(pEntity);
if (pSatchel->m_bIsLive && pSatchel->GetThrower() == this )
{
g_EventQueue.AddEvent( pSatchel, "Explode", 0.20, this, this );
}
}
// Play sound for pressing the detonator
EmitSound( "Weapon_SLAM.SatchelDetonate" );
}