mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 03:24:52 +00:00
Allow set_scattergun_has_knockback attribute to take on values greater than 1
This commit is contained in:
parent
a62efecf62
commit
b06211955c
5 changed files with 16 additions and 12 deletions
|
@ -2959,7 +2959,7 @@ void CTFGameMovement::SetGroundEntity( trace_t *pm )
|
|||
}
|
||||
#endif // GAME_DLL
|
||||
m_pTFPlayer->m_Shared.SetWeaponKnockbackID( -1 );
|
||||
m_pTFPlayer->m_Shared.m_bScattergunJump = false;
|
||||
m_pTFPlayer->m_Shared.m_iScattergunJump = 0;
|
||||
m_pTFPlayer->m_Shared.SetAirDash( 0 );
|
||||
m_pTFPlayer->m_Shared.SetAirDucked( 0 );
|
||||
|
||||
|
|
|
@ -475,7 +475,7 @@ BEGIN_PREDICTION_DATA_NO_BASE( CTFPlayerShared )
|
|||
DEFINE_PRED_FIELD( m_flHolsterAnimTime, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ),
|
||||
DEFINE_PRED_ARRAY( m_flItemChargeMeter, FIELD_FLOAT, LAST_LOADOUT_SLOT_WITH_CHARGE_METER, FTYPEDESC_INSENDTABLE ),
|
||||
DEFINE_PRED_FIELD( m_iStunIndex, FIELD_INTEGER, FTYPEDESC_INSENDTABLE ),
|
||||
DEFINE_PRED_FIELD( m_bScattergunJump, FIELD_BOOLEAN, 0 ),
|
||||
DEFINE_PRED_FIELD( m_iScattergunJump, FIELD_INTEGER, 0 ),
|
||||
END_PREDICTION_DATA()
|
||||
|
||||
// Server specific.
|
||||
|
@ -788,7 +788,7 @@ CTFPlayerShared::CTFPlayerShared()
|
|||
m_flPrevInvisibility = 0.f;
|
||||
m_flTmpDamageBonusAmount = 1.0f;
|
||||
|
||||
m_bScattergunJump = false;
|
||||
m_iScattergunJump = 0;
|
||||
|
||||
m_bFeignDeathReady = false;
|
||||
|
||||
|
|
|
@ -1216,7 +1216,7 @@ private:
|
|||
#endif
|
||||
|
||||
public:
|
||||
bool m_bScattergunJump;
|
||||
int m_iScattergunJump;
|
||||
|
||||
float m_flStunFade;
|
||||
float m_flStunEnd;
|
||||
|
|
|
@ -1144,7 +1144,7 @@ protected:
|
|||
|
||||
int nNumJumps = pNonConstPlayer->GetGroundEntity() == NULL ? 1 : 0;
|
||||
nNumJumps += pPlayer->m_Shared.GetAirDash();
|
||||
nNumJumps += pPlayer->m_Shared.m_bScattergunJump;
|
||||
nNumJumps += pPlayer->m_Shared.m_iScattergunJump;
|
||||
|
||||
if ( m_eJumpingState == JUMPING_STATE_IS_NOT_JUMPING )
|
||||
{
|
||||
|
@ -3027,7 +3027,7 @@ bool CTFJumpStateQuestModifier::BPassesModifier( const CTFPlayer *pOwner, Invali
|
|||
#else
|
||||
int nNumJumps = const_cast< CTFPlayer* >( pOwner )->GetGroundEntity() == NULL ? 1 : 0;
|
||||
nNumJumps += pOwner->m_Shared.GetAirDash();
|
||||
nNumJumps += pOwner->m_Shared.m_bScattergunJump;
|
||||
nNumJumps += pOwner->m_Shared.m_iScattergunJump;
|
||||
|
||||
// If we want them on the ground, make sure they're on the ground
|
||||
if ( m_nJumpCount == 0 )
|
||||
|
|
|
@ -316,7 +316,11 @@ extern float AirBurstDamageForce( const Vector &size, float damage, float scale
|
|||
//-----------------------------------------------------------------------------
|
||||
void CTFScatterGun::FireBullet( CTFPlayer *pPlayer )
|
||||
{
|
||||
if ( HasKnockback() )
|
||||
// see CTFScatterGun::HasKnockback
|
||||
int iKnockbackCount = 0;
|
||||
CALL_ATTRIB_HOOK_INT( iKnockbackCount, set_scattergun_has_knockback );
|
||||
|
||||
if ( iKnockbackCount > 0 )
|
||||
{
|
||||
// Perform some knock back.
|
||||
CTFPlayer *pOwner = ToTFPlayer( GetPlayerOwner() );
|
||||
|
@ -328,9 +332,9 @@ void CTFScatterGun::FireBullet( CTFPlayer *pPlayer )
|
|||
return;
|
||||
|
||||
// Knock the firer back!
|
||||
if ( !(pOwner->GetFlags() & FL_ONGROUND) && !pPlayer->m_Shared.m_bScattergunJump )
|
||||
if ( !(pOwner->GetFlags() & FL_ONGROUND) && pPlayer->m_Shared.m_iScattergunJump < iKnockbackCount )
|
||||
{
|
||||
pPlayer->m_Shared.m_bScattergunJump = true;
|
||||
pPlayer->m_Shared.m_iScattergunJump += 1;
|
||||
|
||||
pOwner->m_Shared.StunPlayer( 0.3f, 1.f, TF_STUN_MOVEMENT | TF_STUN_MOVEMENT_FORWARD_ONLY );
|
||||
|
||||
|
@ -432,9 +436,9 @@ void CTFScatterGun::FinishReload( void )
|
|||
//-----------------------------------------------------------------------------
|
||||
bool CTFScatterGun::HasKnockback( void )
|
||||
{
|
||||
int iWeaponMod = 0;
|
||||
CALL_ATTRIB_HOOK_INT( iWeaponMod, set_scattergun_has_knockback );
|
||||
if ( iWeaponMod == 1 )
|
||||
int iKnockbackCount = 0;
|
||||
CALL_ATTRIB_HOOK_INT( iKnockbackCount, set_scattergun_has_knockback );
|
||||
if ( iKnockbackCount > 0 )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue