Skip to content

Commit d29463d

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

2 files changed

Lines changed: 40 additions & 36 deletions

File tree

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,7 +3568,7 @@ void CTFPlayerShared::OnRemovePhase( void )
35683568
// Apply slow based on how much damage we took while active
35693569
float flSlowDuration = 5.f; //RemapValClamped( m_iPhaseDamage, 10.f, 1000.f, 2.f, 6.f );
35703570
float flSlowAmount = RemapValClamped( m_iPhaseDamage, 10.f, 200.f, 0.25f, 0.5f );
3571-
StunPlayer( flSlowDuration, flSlowAmount, TF_STUN_MOVEMENT | TF_STUN_SOUND, m_pOuter );
3571+
StunPlayer( flSlowDuration, flSlowAmount, TF_STUN_MOVEMENT | TF_STUN_DODGE_COOLDOWN, m_pOuter );
35723572
}
35733573

35743574
m_iPhaseDamage = 0;
@@ -7340,41 +7340,41 @@ void CTFPlayerShared::OnAddOverhealed( void )
73407340
//-----------------------------------------------------------------------------
73417341
void CTFPlayerShared::OnAddStunned( void )
73427342
{
7343-
if ( IsControlStunned() || IsLoserStateStunned() )
7343+
if ( GetActiveStunInfo() )
73447344
{
73457345
#ifdef CLIENT_DLL
7346-
if ( GetActiveStunInfo() )
7346+
int iStunFlags = GetStunFlags();
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_SOUND ) )
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

@@ -9857,8 +9857,10 @@ void CTFPlayerShared::StunPlayer( float flTime, float flReductionAmount, int iSt
98579857
}
98589858

98599859
#ifdef GAME_DLL
9860+
int iActiveStunFlags = GetActiveStunInfo()->iStunFlags;
9861+
98609862
// Add in extra time when TF_STUN_CONTROLS
9861-
if ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS )
9863+
if ( iActiveStunFlags & TF_STUN_CONTROLS )
98629864
{
98639865
if ( !InCond( TF_COND_HALLOWEEN_KART ) )
98649866
{
@@ -9871,22 +9873,23 @@ void CTFPlayerShared::StunPlayer( float flTime, float flReductionAmount, int iSt
98719873
// Update old system for networking
98729874
UpdateLegacyStunSystem();
98739875

9874-
if ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS || GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE )
9876+
if ( iActiveStunFlags & ( TF_STUN_CONTROLS | TF_STUN_LOSER_STATE ) )
98759877
{
98769878
m_pOuter->m_angTauntCamera = m_pOuter->EyeAngles();
9879+
}
9880+
9881+
if ( iActiveStunFlags & ( TF_STUN_CONTROLS | TF_STUN_LOSER_STATE | TF_STUN_SOUND ) )
9882+
{
98779883
m_pOuter->SpeakConceptIfAllowed( MP_CONCEPT_STUNNED );
98789884
if ( pAttacker )
98799885
{
98809886
pAttacker->SpeakConceptIfAllowed( MP_CONCEPT_STUNNED_TARGET );
98819887
}
98829888
}
98839889

9884-
if ( ( GetActiveStunInfo()->iStunFlags & TF_STUN_SOUND ) ||
9885-
( GetActiveStunInfo()->iStunFlags & TF_STUN_SPECIAL_SOUND ) ||
9886-
( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS ) ||
9887-
( GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE ) )
9890+
if ( iActiveStunFlags & ( TF_STUN_CONTROLS | TF_STUN_SPECIAL_SOUND | TF_STUN_DODGE_COOLDOWN | TF_STUN_LOSER_STATE | TF_STUN_SOUND ) )
98889891
{
9889-
m_pOuter->StunSound( pAttacker, GetActiveStunInfo()->iStunFlags, iOldStunFlags );
9892+
m_pOuter->StunSound( pAttacker, iActiveStunFlags, iOldStunFlags );
98909893
}
98919894

98929895
// Event for achievements.
@@ -9899,12 +9902,12 @@ void CTFPlayerShared::StunPlayer( float flTime, float flReductionAmount, int iSt
98999902
}
99009903
event->SetInt( "victim", m_pOuter->GetUserID() );
99019904
event->SetBool( "victim_capping", m_pOuter->IsCapturingPoint() );
9902-
event->SetBool( "big_stun", ( GetActiveStunInfo()->iStunFlags & TF_STUN_SPECIAL_SOUND ) != 0 );
9905+
event->SetBool( "big_stun", ( iActiveStunFlags & TF_STUN_SPECIAL_SOUND ) != 0 );
99039906
gameeventmanager->FireEvent( event );
99049907
}
99059908

99069909
// Clear off all taunts, expressions, and scenes.
9907-
if ( ( GetActiveStunInfo()->iStunFlags & TF_STUN_CONTROLS) == TF_STUN_CONTROLS || ( GetActiveStunInfo()->iStunFlags & TF_STUN_LOSER_STATE) == TF_STUN_LOSER_STATE )
9910+
if ( iActiveStunFlags & ( TF_STUN_CONTROLS | TF_STUN_LOSER_STATE ) )
99089911
{
99099912
m_pOuter->StopTaunt();
99109913
m_pOuter->ClearExpression();

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;
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)