2424#include " halloween/merasmus/merasmus_trick_or_treat_prop.h"
2525#include " tf_robot_destruction_robot.h"
2626#include " tf_generic_bomb.h"
27+ #include " tf_gamerules.h"
2728#endif
2829
2930#define ENERGY_RING_DISPATCH_EFFECT " ClientProjectile_EnergyRing"
@@ -64,12 +65,8 @@ void PrecacheRing(void *pUser)
6465PRECACHE_REGISTER_FN (PrecacheRing);
6566
6667#ifdef GAME_DLL
67- #if defined(MCOMS_BALANCE_PACK)
68- ConVar tf_bison_tick_time ( " tf_bison_tick_time" , " 0.05" , FCVAR_CHEAT );
69- ConVar tf_bison_in_enemy_slow (" tf_bison_in_enemy_slow" , " 0.25" , FCVAR_CHEAT);
70- #else
71- ConVar tf_bison_tick_time (" tf_bison_tick_time" , " 0.025" , FCVAR_CHEAT);
72- #endif
68+ ConVar tf_bison_tick_time ( " tf_bison_tick_time" , " 0.025" , FCVAR_CHEAT );
69+ ConVar tf_bison_in_enemy_slow ( " tf_bison_in_enemy_slow" , " 0.25" , FCVAR_CHEAT );
7370#endif
7471
7572
@@ -180,6 +177,20 @@ CTFProjectile_EnergyRing *CTFProjectile_EnergyRing::Create( CTFWeaponBaseGun *pL
180177 return pRing;
181178}
182179
180+ #ifdef GAME_DLL
181+ // -----------------------------------------------------------------------------
182+ // Purpose:
183+ // -----------------------------------------------------------------------------
184+ float CTFProjectile_EnergyRing::GetTickTime ()
185+ {
186+ const float flTickTime = tf_bison_tick_time.GetFloat ();
187+ if ( TFGameRules ()->IsBetaActive () )
188+ {
189+ return flTickTime * 2 .0f ;
190+ }
191+ return flTickTime;
192+ }
193+ #endif
183194
184195// -----------------------------------------------------------------------------
185196// Purpose:
@@ -194,14 +205,12 @@ void CTFProjectile_EnergyRing::Spawn()
194205 SetSolidFlags ( FSOLID_TRIGGER | FSOLID_NOT_SOLID );
195206 SetCollisionGroup ( TFCOLLISION_GROUP_ROCKETS );
196207
197- #if defined(MCOMS_BALANCE_PACK)
198208#ifdef GAME_DLL
199- if (ShouldPenetrate ())
209+ if ( ShouldPenetrate () && TFGameRules ()-> IsBetaActive () )
200210 {
201- SetContextThink (&CTFProjectile_EnergyRing::BisonThink, gpGlobals->curtime + tf_bison_tick_time. GetFloat (), " BisonThink" );
211+ SetContextThink (&CTFProjectile_EnergyRing::BisonThink, gpGlobals->curtime + GetTickTime (), " BisonThink" );
202212 }
203213#endif
204- #endif
205214}
206215
207216// -----------------------------------------------------------------------------
@@ -274,7 +283,7 @@ void CTFProjectile_EnergyRing::ProjectileTouch( CBaseEntity *pOther )
274283 bool bSkipCollide;
275284 if ( ShouldPenetrate () )
276285 {
277- bSkipCollide = ( pOther->InSameTeam ( this ) || ( gpGlobals->curtime - m_flLastHitTime ) < tf_bison_tick_time. GetFloat () );
286+ bSkipCollide = ( pOther->InSameTeam ( this ) || ( gpGlobals->curtime - m_flLastHitTime ) < GetTickTime () );
278287 }
279288 else
280289 {
@@ -310,13 +319,11 @@ void CTFProjectile_EnergyRing::ProjectileTouch( CBaseEntity *pOther )
310319
311320 PlayImpactEffects ( vecNewPos, pOther->IsPlayer () );
312321
313- if ( ShouldPenetrate () )
322+ if ( ShouldPenetrate () && TFGameRules ()-> IsBetaActive () )
314323 {
315- #if defined(MCOMS_BALANCE_PACK)
316324 Vector dir;
317325 AngleVectors (GetAbsAngles (), &dir);
318326 SetAbsVelocity (dir * GetInitialVelocity () * tf_bison_in_enemy_slow.GetFloat ());
319- #endif
320327 return ;
321328 }
322329
@@ -341,14 +348,14 @@ void CTFProjectile_EnergyRing::ProjectileTouch( CBaseEntity *pOther )
341348// -----------------------------------------------------------------------------
342349void CTFProjectile_EnergyRing::BisonThink ()
343350{
344- if (gpGlobals->curtime - m_flLastHitTime > tf_bison_tick_time. GetFloat ())
351+ if (gpGlobals->curtime - m_flLastHitTime > GetTickTime ())
345352 {
346353 Vector dir;
347354 AngleVectors (GetAbsAngles (), &dir);
348355 SetAbsVelocity (dir * GetInitialVelocity ());
349356 }
350357
351- SetContextThink (&CTFProjectile_EnergyRing::BisonThink, gpGlobals->curtime + tf_bison_tick_time. GetFloat (), " BisonThink" );
358+ SetContextThink (&CTFProjectile_EnergyRing::BisonThink, gpGlobals->curtime + GetTickTime (), " BisonThink" );
352359}
353360
354361
0 commit comments