game: restore combine elite soldiers ability to use alt-fire of SMG1
This commit is contained in:
parent
5caf8adbd7
commit
d628a7ae80
@ -378,7 +378,7 @@ void CNPC_Combine::PostNPCInit()
|
||||
// an AR2.
|
||||
if( !GetActiveWeapon() || !FClassnameIs( GetActiveWeapon(), "weapon_ar2" ) )
|
||||
{
|
||||
DevWarning("**Combine Elite Soldier MUST be equipped with AR2\n");
|
||||
// DevWarning("**Combine Elite Soldier MUST be equipped with AR2\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2319,8 +2319,19 @@ void CNPC_Combine::HandleAnimEvent( animevent_t *pEvent )
|
||||
if (pEvent->type & AE_TYPE_NEWEVENTSYSTEM)
|
||||
{
|
||||
if ( pEvent->event == COMBINE_AE_BEGIN_ALTFIRE )
|
||||
{
|
||||
if( FClassnameIs( GetActiveWeapon(), "weapon_ar2" ) )
|
||||
{
|
||||
EmitSound( "Weapon_CombineGuard.Special1" );
|
||||
}
|
||||
else if( FClassnameIs( GetActiveWeapon(), "weapon_smg1" ) )
|
||||
{
|
||||
EmitSound( "Weapon_SMG1.Double" );
|
||||
}
|
||||
else
|
||||
{
|
||||
EmitSound( "Weapon_CombineGuard.Special1" );
|
||||
}
|
||||
handledEvent = true;
|
||||
}
|
||||
else if ( pEvent->event == COMBINE_AE_ALTFIRE )
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
float GetFireRate( void ) { return 0.075f; } // 13.3hz
|
||||
int CapabilitiesGet( void ) { return bits_CAP_WEAPON_RANGE_ATTACK1; }
|
||||
int WeaponRangeAttack2Condition( float flDot, float flDist );
|
||||
int WeaponRangeAttack2Condition(/* float flDot, float flDist */);
|
||||
Activity GetPrimaryAttackActivity( void );
|
||||
|
||||
virtual const Vector& GetBulletSpread( void )
|
||||
@ -228,32 +228,50 @@ void CWeaponSMG1::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatChar
|
||||
}
|
||||
break;
|
||||
|
||||
/*//FIXME: Re-enable
|
||||
case EVENT_WEAPON_AR2_GRENADE:
|
||||
case EVENT_WEAPON_AR2_ALTFIRE:
|
||||
{
|
||||
CAI_BaseNPC *npc = pOperator->MyNPCPointer();
|
||||
|
||||
Vector vecShootOrigin, vecShootDir;
|
||||
vecShootOrigin = pOperator->Weapon_ShootPosition();
|
||||
vecShootDir = npc->GetShootEnemyDir( vecShootOrigin );
|
||||
//vecShootDir = npc->GetShootEnemyDir( vecShootOrigin );
|
||||
|
||||
//Checks if it can fire the grenade
|
||||
WeaponRangeAttack2Condition();
|
||||
|
||||
Vector vecThrow = m_vecTossVelocity;
|
||||
|
||||
CGrenadeAR2 *pGrenade = (CGrenadeAR2*)Create( "grenade_ar2", vecShootOrigin, vec3_angle, npc );
|
||||
pGrenade->SetAbsVelocity( vecThrow );
|
||||
pGrenade->SetLocalAngularVelocity( QAngle( 0, 400, 0 ) );
|
||||
pGrenade->SetMoveType( MOVETYPE_FLYGRAVITY );
|
||||
pGrenade->m_hOwner = npc;
|
||||
pGrenade->m_pMyWeaponAR2 = this;
|
||||
pGrenade->SetDamage(sk_npc_dmg_ar2_grenade.GetFloat());
|
||||
//If on the rare case the vector is 0 0 0, cancel for avoid launching the grenade without speed
|
||||
//This should be on WeaponRangeAttack2Condition(), but for some unknown reason return CASE_NONE
|
||||
//doesn't stop the launch
|
||||
if( vecThrow == Vector(0, 0, 0) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// FIXME: arrgg ,this is hard coded into the weapon???
|
||||
CGrenadeAR2 *pGrenade = (CGrenadeAR2*)Create("grenade_ar2", vecShootOrigin, vec3_angle, npc);
|
||||
pGrenade->SetAbsVelocity( vecThrow );
|
||||
pGrenade->SetLocalAngularVelocity(RandomAngle(-400, 400)); //tumble in air
|
||||
pGrenade->SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );
|
||||
|
||||
pGrenade->SetThrower(GetOwner());
|
||||
|
||||
pGrenade->SetGravity(0.5); // lower gravity since grenade is aerodynamic and engine doesn't know it.
|
||||
|
||||
pGrenade->SetDamage( sk_plr_dmg_smg1_grenade.GetFloat() );
|
||||
|
||||
if( g_pGameRules->IsSkillLevel( SKILL_HARD ) )
|
||||
{
|
||||
m_flNextGrenadeCheck = gpGlobals->curtime + RandomFloat(2, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_flNextGrenadeCheck = gpGlobals->curtime + 6;// wait six seconds before even looking again to see if a grenade can be thrown.
|
||||
}
|
||||
|
||||
m_iClip2--;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
|
||||
default:
|
||||
BaseClass::Operator_HandleAnimEvent( pEvent, pOperator );
|
||||
@ -394,11 +412,11 @@ void CWeaponSMG1::SecondaryAttack( void )
|
||||
// flDist -
|
||||
// Output : int
|
||||
//-----------------------------------------------------------------------------
|
||||
int CWeaponSMG1::WeaponRangeAttack2Condition( float flDot, float flDist )
|
||||
int CWeaponSMG1::WeaponRangeAttack2Condition(/* float flDot, float flDist */)
|
||||
{
|
||||
CAI_BaseNPC *npcOwner = GetOwner()->MyNPCPointer();
|
||||
|
||||
return COND_NONE;
|
||||
// return COND_NONE;
|
||||
|
||||
/*
|
||||
// --------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user