@@ -106,6 +106,7 @@ PRECACHE_WEAPON_REGISTER( tf_projectile_stun_ball );
106106#if defined( GAME_DLL )
107107ConVar tf_scout_stunball_base_duration ( " tf_scout_stunball_base_duration" , " 6.0" , FCVAR_DEVELOPMENTONLY );
108108ConVar tf_scout_stunball_base_speed ( " tf_scout_stunball_base_speed" , " 3000" , FCVAR_DEVELOPMENTONLY );
109+ ConVar tf_scout_stunball_old_stun ( " tf_scout_stunball_old_stun" , " 0" , FCVAR_DEVELOPMENTONLY );
109110ConVar sv_proj_stunball_damage ( " sv_proj_stunball_damage" , " 15" , FCVAR_DEVELOPMENTONLY );
110111#endif
111112// -- TFStunBall
@@ -725,34 +726,46 @@ void CTFStunBall::ApplyBallImpactEffectOnVictim( CBaseEntity *pOther )
725726 // We have a more intense stun based on our travel time.
726727 float flLifeTime = MIN ( gpGlobals->curtime - m_flCreationTime, FLIGHT_TIME_TO_MAX_STUN );
727728 float flLifeTimeRatio = flLifeTime / FLIGHT_TIME_TO_MAX_STUN;
729+ float flDamage = GetDamage ();
728730 if ( flLifeTimeRatio > 0 .1f )
729731 {
730-
731732 float flStun = 0 .5f ;
732733 float flStunDuration = tf_scout_stunball_base_duration.GetFloat () * flLifeTimeRatio;
733734 if ( IsCritical () )
734735 flStunDuration += 2.0 ; // Extra two seconds of effect time if we're a critical hit.
735- int iStunFlags = TF_STUN_LOSER_STATE | TF_STUN_MOVEMENT;
736- if ( flLifeTimeRatio >= 1 .f )
736+ int iStunFlags = TF_STUN_MOVEMENT;
737+
738+ if ( tf_scout_stunball_old_stun.GetBool () )
737739 {
738- flStunDuration += 1.0 ;
739- iStunFlags = TF_STUN_CONTROLS;
740- iStunFlags |= TF_STUN_SPECIAL_SOUND;
741- CTF_GameStats.Event_PlayerStunBall ( pOwner, true );
740+ if ( flLifeTimeRatio >= 1 .f )
741+ {
742+ flStunDuration += 1.0 ;
743+ iStunFlags = TF_STUN_CONTROLS;
744+ iStunFlags |= TF_STUN_SPECIAL_SOUND;
745+ CTF_GameStats.Event_PlayerStunBall ( pOwner, true );
746+ }
747+ else
748+ {
749+ iStunFlags |= TF_STUN_LOSER_STATE;
750+ CTF_GameStats.Event_PlayerStunBall ( pOwner, false );
751+ }
752+
753+ // Adjust stun amount and flags if we're hitting a boss or scaled enemy
754+ if ( TFGameRules () && TFGameRules ()->GameModeUsesMiniBosses () && ( pPlayer->IsMiniBoss () || pPlayer->GetModelScale () > 1 .0f ) )
755+ {
756+ // If max range, freeze them in place - otherwise adjust it based on distance
757+ flStun = flLifeTimeRatio >= 1 .f ? 1 .f : RemapValClamped ( flLifeTimeRatio, 0 .1f , 0 .99f , 0 .5f , 0.75 );
758+ iStunFlags = flLifeTimeRatio >= 1 .f ? ( TF_STUN_SPECIAL_SOUND | TF_STUN_MOVEMENT ) : TF_STUN_MOVEMENT;
759+ }
742760 }
743- else
761+ else if ( flLifeTimeRatio >= 0 . 8f )
744762 {
763+ flDamage *= 1.5 ;
764+ flStunDuration += 1.0 ;
765+ iStunFlags |= TF_STUN_SPECIAL_SOUND;
745766 CTF_GameStats.Event_PlayerStunBall ( pOwner, false );
746767 }
747768
748- // Adjust stun amount and flags if we're hitting a boss or scaled enemy
749- if ( TFGameRules () && TFGameRules ()->GameModeUsesMiniBosses () && ( pPlayer->IsMiniBoss () || pPlayer->GetModelScale () > 1 .0f ) )
750- {
751- // If max range, freeze them in place - otherwise adjust it based on distance
752- flStun = flLifeTimeRatio >= 1 .f ? 1 .f : RemapValClamped ( flLifeTimeRatio, 0 .1f , 0 .99f , 0 .5f , 0.75 );
753- iStunFlags = flLifeTimeRatio >= 1 .f ? ( TF_STUN_SPECIAL_SOUND | TF_STUN_MOVEMENT ) : TF_STUN_MOVEMENT;
754- }
755-
756769 if ( pPlayer->GetWaterLevel () != WL_Eyes )
757770 {
758771 pPlayer->m_Shared .StunPlayer ( flStunDuration, flStun, iStunFlags, pOwner );
@@ -777,7 +790,7 @@ void CTFStunBall::ApplyBallImpactEffectOnVictim( CBaseEntity *pOther )
777790 info.SetAttacker ( GetOwnerEntity () );
778791 info.SetInflictor ( pInflictor );
779792 info.SetWeapon ( pInflictor );
780- info.SetDamage ( GetDamage () );
793+ info.SetDamage ( flDamage );
781794 info.SetDamageCustom ( TF_DMG_CUSTOM_BASEBALL );
782795 info.SetDamageForce ( GetDamageForce () );
783796 info.SetDamagePosition ( GetAbsOrigin () );
0 commit comments