Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions src/game/shared/tf/tf_player_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7340,41 +7340,41 @@ void CTFPlayerShared::OnAddOverhealed( void )
//-----------------------------------------------------------------------------
void CTFPlayerShared::OnAddStunned( void )
{
if ( IsControlStunned() || IsLoserStateStunned() )
if ( GetActiveStunInfo() )
{
#ifdef CLIENT_DLL
if ( GetActiveStunInfo() )
int iStunFlags = GetStunFlags();
if ( !m_pOuter->m_pStunnedEffect && !( iStunFlags & TF_STUN_NO_EFFECTS ) )
{
if ( !m_pOuter->m_pStunnedEffect && !( GetActiveStunInfo()->iStunFlags & TF_STUN_NO_EFFECTS ) )
if ( ( iStunFlags & TF_STUN_BY_TRIGGER ) || InCond( TF_COND_HALLOWEEN_BOMB_HEAD ) )
{
if ( ( GetActiveStunInfo()->iStunFlags & TF_STUN_BY_TRIGGER ) || InCond( TF_COND_HALLOWEEN_BOMB_HEAD ) )
{
const char* pEffectName = "yikes_fx";
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
}
else
{
const char* pEffectName = "conc_stars";
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
}
const char* pEffectName = "yikes_fx";
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
}
else if ( iStunFlags & ( TF_STUN_CONTROLS | TF_STUN_LOSER_STATE | TF_STUN_STUNBALL ) )
{
const char* pEffectName = "conc_stars";
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
}
}
#endif

// Notify our weapon that we have been stunned.
CTFWeaponBase* pWpn = m_pOuter->GetActiveTFWeapon();
if ( pWpn )
if ( IsControlStunned() || IsLoserStateStunned() )
{
pWpn->OnControlStunned();
}
// Notify our weapon that we have been stunned.
CTFWeaponBase* pWpn = m_pOuter->GetActiveTFWeapon();
if ( pWpn )
{
pWpn->OnControlStunned();
}

if ( InCond( TF_COND_SHIELD_CHARGE ) )
{
SetDemomanChargeMeter( 0 );
RemoveCond( TF_COND_SHIELD_CHARGE );
}
if ( InCond( TF_COND_SHIELD_CHARGE ) )
{
SetDemomanChargeMeter( 0 );
RemoveCond( TF_COND_SHIELD_CHARGE );
}

m_pOuter->TeamFortress_SetSpeed();
m_pOuter->TeamFortress_SetSpeed();
}
}
}

Expand Down Expand Up @@ -9874,6 +9874,12 @@ void CTFPlayerShared::StunPlayer( float flTime, float flReductionAmount, int iSt
if ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS || GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE )
{
m_pOuter->m_angTauntCamera = m_pOuter->EyeAngles();
}

if ( ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS ) ||
( GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE ) ||
( GetActiveStunInfo()->iStunFlags & TF_STUN_STUNBALL ) )
{
m_pOuter->SpeakConceptIfAllowed( MP_CONCEPT_STUNNED );
if ( pAttacker )
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/tf/tf_shareddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ enum
#define TF_STUN_BY_TRIGGER (1<<7)
#define TF_STUN_BOTH TF_STUN_MOVEMENT | TF_STUN_CONTROLS
#define TF_STUN_SOUND (1<<8)

#define TF_STUN_STUNBALL (1<<9)

//-----------------
// TF Objects Info
Expand Down
3 changes: 2 additions & 1 deletion src/game/shared/tf/tf_weapon_bat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,13 @@ void CTFStunBall::ApplyBallImpactEffectOnVictim( CBaseEntity *pOther )
if ( flLifeTimeRatio > 0.1f )
{
bool bMax = flLifeTimeRatio >= 1.f;
int iStunFlags = ( bMax ) ? TF_STUN_SPECIAL_SOUND | TF_STUN_MOVEMENT : TF_STUN_SOUND | TF_STUN_MOVEMENT;
int iStunFlags = TF_STUN_MOVEMENT | TF_STUN_SOUND | TF_STUN_STUNBALL;
float flStunAmount = 0.5f;
float flStunDuration = Max( 2.f, tf_scout_stunball_base_duration.GetFloat() * flLifeTimeRatio );
if ( bMax )
{
flStunDuration += 1.0;
iStunFlags |= TF_STUN_SPECIAL_SOUND;
}

// MvM bots
Expand Down