Skip to content

Commit 6e68bb4

Browse files
committed
Re-add stun effects for The Sandman (BONK! icon, conc stars, voicelines)
1 parent 3300848 commit 6e68bb4

3 files changed

Lines changed: 34 additions & 27 deletions

File tree

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7340,41 +7340,41 @@ void CTFPlayerShared::OnAddOverhealed( void )
73407340
//-----------------------------------------------------------------------------
73417341
void CTFPlayerShared::OnAddStunned( void )
73427342
{
7343-
if ( IsControlStunned() || IsLoserStateStunned() )
7343+
if ( GetActiveStunInfo() )
73447344
{
7345+
int iStunFlags = GetStunFlags();
73457346
#ifdef CLIENT_DLL
7346-
if ( GetActiveStunInfo() )
7347+
if ( !m_pOuter->m_pStunnedEffect && !( iStunFlags & TF_STUN_NO_EFFECTS ) )
73477348
{
7348-
if ( !m_pOuter->m_pStunnedEffect && !( GetActiveStunInfo()->iStunFlags & TF_STUN_NO_EFFECTS ) )
7349+
if ( ( iStunFlags & TF_STUN_BY_TRIGGER ) || InCond( TF_COND_HALLOWEEN_BOMB_HEAD ) )
73497350
{
7350-
if ( ( GetActiveStunInfo()->iStunFlags & TF_STUN_BY_TRIGGER ) || InCond( TF_COND_HALLOWEEN_BOMB_HEAD ) )
7351-
{
7352-
const char* pEffectName = "yikes_fx";
7353-
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
7354-
}
7355-
else
7356-
{
7357-
const char* pEffectName = "conc_stars";
7358-
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
7359-
}
7351+
const char* pEffectName = "yikes_fx";
7352+
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
7353+
}
7354+
else if ( iStunFlags & ( TF_STUN_CONTROLS | TF_STUN_LOSER_STATE | TF_STUN_STUNBALL ) )
7355+
{
7356+
const char* pEffectName = "conc_stars";
7357+
m_pOuter->m_pStunnedEffect = m_pOuter->ParticleProp()->Create( pEffectName, PATTACH_POINT_FOLLOW, "head" );
73607358
}
73617359
}
73627360
#endif
7363-
7364-
// Notify our weapon that we have been stunned.
7365-
CTFWeaponBase* pWpn = m_pOuter->GetActiveTFWeapon();
7366-
if ( pWpn )
7361+
if ( IsControlStunned() || IsLoserStateStunned() )
73677362
{
7368-
pWpn->OnControlStunned();
7369-
}
7363+
// Notify our weapon that we have been stunned.
7364+
CTFWeaponBase* pWpn = m_pOuter->GetActiveTFWeapon();
7365+
if ( pWpn )
7366+
{
7367+
pWpn->OnControlStunned();
7368+
}
73707369

7371-
if ( InCond( TF_COND_SHIELD_CHARGE ) )
7372-
{
7373-
SetDemomanChargeMeter( 0 );
7374-
RemoveCond( TF_COND_SHIELD_CHARGE );
7375-
}
7370+
if ( InCond( TF_COND_SHIELD_CHARGE ) )
7371+
{
7372+
SetDemomanChargeMeter( 0 );
7373+
RemoveCond( TF_COND_SHIELD_CHARGE );
7374+
}
73767375

7377-
m_pOuter->TeamFortress_SetSpeed();
7376+
m_pOuter->TeamFortress_SetSpeed();
7377+
}
73787378
}
73797379
}
73807380

@@ -9874,6 +9874,12 @@ void CTFPlayerShared::StunPlayer( float flTime, float flReductionAmount, int iSt
98749874
if ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS || GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE )
98759875
{
98769876
m_pOuter->m_angTauntCamera = m_pOuter->EyeAngles();
9877+
}
9878+
9879+
if ( ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS ) ||
9880+
( GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE ) ||
9881+
( GetActiveStunInfo()->iStunFlags & TF_STUN_STUNBALL ) )
9882+
{
98779883
m_pOuter->SpeakConceptIfAllowed( MP_CONCEPT_STUNNED );
98789884
if ( pAttacker )
98799885
{

src/game/shared/tf/tf_shareddefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ enum
13401340
#define TF_STUN_BY_TRIGGER (1<<7)
13411341
#define TF_STUN_BOTH TF_STUN_MOVEMENT | TF_STUN_CONTROLS
13421342
#define TF_STUN_SOUND (1<<8)
1343-
1343+
#define TF_STUN_STUNBALL (1<<9)
13441344

13451345
//-----------------
13461346
// TF Objects Info

src/game/shared/tf/tf_weapon_bat.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,12 +732,13 @@ void CTFStunBall::ApplyBallImpactEffectOnVictim( CBaseEntity *pOther )
732732
if ( flLifeTimeRatio > 0.1f )
733733
{
734734
bool bMax = flLifeTimeRatio >= 1.f;
735-
int iStunFlags = ( bMax ) ? TF_STUN_SPECIAL_SOUND | TF_STUN_MOVEMENT : TF_STUN_SOUND | TF_STUN_MOVEMENT;
735+
int iStunFlags = TF_STUN_MOVEMENT | TF_STUN_SOUND | TF_STUN_STUNBALL;
736736
float flStunAmount = 0.5f;
737737
float flStunDuration = Max( 2.f, tf_scout_stunball_base_duration.GetFloat() * flLifeTimeRatio );
738738
if ( bMax )
739739
{
740740
flStunDuration += 1.0;
741+
iStunFlags |= TF_STUN_SPECIAL_SOUND;
741742
}
742743

743744
// MvM bots

0 commit comments

Comments
 (0)