本文整理汇总了C++中CASW_Marine_Resource::UsedWeapon方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine_Resource::UsedWeapon方法的具体用法?C++ CASW_Marine_Resource::UsedWeapon怎么用?C++ CASW_Marine_Resource::UsedWeapon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine_Resource
的用法示例。
在下文中一共展示了CASW_Marine_Resource::UsedWeapon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Detonate
void CASW_Grenade_PRifle::Detonate()
{
if ( !ASWGameResource() )
return;
m_takedamage = DAMAGE_NO;
CPASFilter filter( GetAbsOrigin() );
Vector vecForward = GetAbsVelocity();
VectorNormalize(vecForward);
trace_t tr;
Vector vecDir = -vecForward;
//te->GaussExplosion( filter, 0.0,
//GetAbsOrigin(), vecDir, 0 );
CEffectData data;
data.m_vOrigin = GetAbsOrigin();
DispatchEffect( "aswstunexplo", data );
EmitSound("ASW_Weapon_PRifle.StunGrenadeExplosion");
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward, MASK_SHOT,
this, COLLISION_GROUP_NONE, &tr);
if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
{
// non-world needs smaller decals
if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
{
UTIL_DecalTrace( &tr, "SmallScorch" );
}
}
else
{
UTIL_DecalTrace( &tr, "Scorch" );
}
UTIL_ASW_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START );
int nPreviousStunnedAliens = ASWGameResource()->m_iElectroStunnedAliens;
// do just 1 damage...
CTakeDamageInfo info( this, GetOwnerEntity(), 1, DMG_SHOCK );
info.SetWeapon( m_hCreatorWeapon );
RadiusDamage ( info , GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );
// count as a shot fired
CASW_Marine *pMarine = dynamic_cast<CASW_Marine*>(GetOwnerEntity());
if ( pMarine && pMarine->GetMarineResource() )
{
CASW_Marine_Resource *pMR = pMarine->GetMarineResource();
pMR->UsedWeapon(NULL, 1);
int nAliensStunned = ASWGameResource()->m_iElectroStunnedAliens - nPreviousStunnedAliens;
if ( nAliensStunned >= 6 && pMR->IsInhabited() && pMR->GetCommander() )
{
pMR->GetCommander()->AwardAchievement( ACHIEVEMENT_ASW_STUN_GRENADE );
pMR->m_bStunGrenadeMedal = true;
}
}
UTIL_Remove( this );
}