Skip to content

Commit d49067a

Browse files
authored
implement post-JI sandman changes
1 parent 3ade451 commit d49067a

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

game/shared/tf/tf_weapon_bat.cpp

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ PRECACHE_WEAPON_REGISTER( tf_projectile_stun_ball );
106106
#if defined( GAME_DLL )
107107
ConVar tf_scout_stunball_base_duration( "tf_scout_stunball_base_duration", "6.0", FCVAR_DEVELOPMENTONLY );
108108
ConVar 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 );
109110
ConVar sv_proj_stunball_damage( "sv_proj_stunball_damage", "15", FCVAR_DEVELOPMENTONLY );
110111
#endif
111112
// -- TFStunBall
@@ -725,34 +726,47 @@ 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+
bool bOldStun = tf_scout_stunball_old_stun.GetBool();
739+
if ( bOldStun )
737740
{
738-
flStunDuration += 1.0;
739-
iStunFlags = TF_STUN_CONTROLS;
740-
iStunFlags |= TF_STUN_SPECIAL_SOUND;
741-
CTF_GameStats.Event_PlayerStunBall( pOwner, true );
741+
if ( flLifeTimeRatio >= 1.f )
742+
{
743+
flStunDuration += 1.0;
744+
iStunFlags = TF_STUN_CONTROLS;
745+
iStunFlags |= TF_STUN_SPECIAL_SOUND;
746+
CTF_GameStats.Event_PlayerStunBall( pOwner, true );
747+
}
748+
else
749+
{
750+
iStunFlags |= TF_STUN_LOSER_STATE;
751+
CTF_GameStats.Event_PlayerStunBall( pOwner, false );
752+
}
753+
754+
// Adjust stun amount and flags if we're hitting a boss or scaled enemy
755+
if ( TFGameRules() && TFGameRules()->GameModeUsesMiniBosses() && ( pPlayer->IsMiniBoss() || pPlayer->GetModelScale() > 1.0f ) )
756+
{
757+
// If max range, freeze them in place - otherwise adjust it based on distance
758+
flStun = flLifeTimeRatio >= 1.f ? 1.f : RemapValClamped( flLifeTimeRatio, 0.1f, 0.99f, 0.5f, 0.75 );
759+
iStunFlags = flLifeTimeRatio >= 1.f ? ( TF_STUN_SPECIAL_SOUND | TF_STUN_MOVEMENT ) : TF_STUN_MOVEMENT;
760+
}
742761
}
743-
else
762+
else if ( flLifeTimeRatio >= 0.8f )
744763
{
764+
flDamage *= 2;
765+
flStunDuration += 1.0;
766+
iStunFlags |= TF_STUN_SPECIAL_SOUND;
745767
CTF_GameStats.Event_PlayerStunBall( pOwner, false );
746768
}
747769

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-
756770
if ( pPlayer->GetWaterLevel() != WL_Eyes )
757771
{
758772
pPlayer->m_Shared.StunPlayer( flStunDuration, flStun, iStunFlags, pOwner );
@@ -777,7 +791,7 @@ void CTFStunBall::ApplyBallImpactEffectOnVictim( CBaseEntity *pOther )
777791
info.SetAttacker( GetOwnerEntity() );
778792
info.SetInflictor( pInflictor );
779793
info.SetWeapon( pInflictor );
780-
info.SetDamage( GetDamage() );
794+
info.SetDamage( flDamage );
781795
info.SetDamageCustom( TF_DMG_CUSTOM_BASEBALL );
782796
info.SetDamageForce( GetDamageForce() );
783797
info.SetDamagePosition( GetAbsOrigin() );

game/shared/tf/tf_weapon_bat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class CTFBat_Wood : public CTFBat
8888
virtual void LaunchBall( void );
8989
void LaunchBallThink( void );
9090

91-
virtual float InternalGetEffectBarRechargeTime( void ) { return 15.0; }
91+
virtual float InternalGetEffectBarRechargeTime( void ) { return 10.0; }
9292
virtual int GetEffectBarAmmo( void ) { return TF_AMMO_GRENADES1; }
9393

9494
#ifdef GAME_DLL

0 commit comments

Comments
 (0)