本文整理汇总了C++中CBaseCombatWeapon::entindex方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatWeapon::entindex方法的具体用法?C++ CBaseCombatWeapon::entindex怎么用?C++ CBaseCombatWeapon::entindex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatWeapon
的用法示例。
在下文中一共展示了CBaseCombatWeapon::entindex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CBaseCombatWeapon___tostring
static int CBaseCombatWeapon___tostring (lua_State *L) {
CBaseCombatWeapon *pWeapon = lua_toweapon(L, 1);
if (pWeapon == NULL)
lua_pushstring(L, "NULL");
else
lua_pushfstring(L, "CBaseCombatWeapon: %d %s", pWeapon->entindex(), pWeapon->GetClassname());
return 1;
}
示例2: DissolveThink
//-----------------------------------------------------------------------------
// Purpose: Dissolve all weapons within our volume
//-----------------------------------------------------------------------------
void CTriggerWeaponDissolve::DissolveThink( void )
{
int numWeapons = m_pWeapons.Count();
// Dissolve all the items within the volume
for ( int i = 0; i < numWeapons; i++ )
{
CBaseCombatWeapon *pWeapon = m_pWeapons[i];
Vector vecConduit = GetConduitPoint( pWeapon );
// The physcannon upgrades when this happens
if ( FClassnameIs( pWeapon, "weapon_physcannon" ) )
{
// This must be the last weapon for us to care
if ( numWeapons > 1 )
continue;
//FIXME: Make them do this on a stagger!
// All conduits send power to the weapon
for ( int i = 0; i < m_pConduitPoints.Count(); i++ )
{
CreateBeam( m_pConduitPoints[i]->GetAbsOrigin(), pWeapon, 4.0f );
}
PhysCannonBeginUpgrade( pWeapon );
m_OnChargingPhyscannon.FireOutput( this, this );
EmitSound( "WeaponDissolve.Beam" );
// We're done
m_pWeapons.Purge();
m_pConduitPoints.Purge();
SetContextThink( NULL, 0, s_pDissolveThinkContext );
return;
}
// Randomly dissolve them all
float flLifetime = random->RandomFloat( 2.5f, 4.0f );
CreateBeam( vecConduit, pWeapon, flLifetime );
pWeapon->Dissolve( NULL, gpGlobals->curtime + ( 3.0f - flLifetime ), false );
m_OnDissolveWeapon.FireOutput( this, this );
CPASAttenuationFilter filter( pWeapon );
EmitSound( filter, pWeapon->entindex(), "WeaponDissolve.Dissolve" );
// Beam looping sound
EmitSound( "WeaponDissolve.Beam" );
m_pWeapons.Remove( i );
SetContextThink( &CTriggerWeaponDissolve::DissolveThink, gpGlobals->curtime + random->RandomFloat( 0.5f, 1.5f ), s_pDissolveThinkContext );
return;
}
SetContextThink( &CTriggerWeaponDissolve::DissolveThink, gpGlobals->curtime + 0.1f, s_pDissolveThinkContext );
}