Skip to content

Commit c094a1a

Browse files
committed
restore more changes to beta
1 parent 88e96b7 commit c094a1a

7 files changed

Lines changed: 110 additions & 78 deletions

File tree

src/game/server/tf/tf_obj.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,12 +718,16 @@ bool CBaseObject::EstimateValidBuildPos( void )
718718
}
719719
}
720720

721-
#if defined(MCOMS_BALANCE_PACK)
722-
// BLU can build in setup time
723-
bool bCanBuildInRespawnRoom = ( GetTeamNumber() == TF_TEAM_BLUE && TFGameRules()->InSetup() ) || g_pServerBenchmark->IsBenchmarkRunning();
724-
#else
725-
bool bCanBuildInRespawnRoom = g_pServerBenchmark->IsBenchmarkRunning();
726-
#endif
721+
bool bCanBuildInRespawnRoom;
722+
if ( TFGameRules()->IsBetaActive() )
723+
{
724+
// BLU can build in setup time
725+
bCanBuildInRespawnRoom = ( GetTeamNumber() == TF_TEAM_BLUE && TFGameRules()->InSetup() ) || g_pServerBenchmark->IsBenchmarkRunning();
726+
}
727+
else
728+
{
729+
bCanBuildInRespawnRoom = g_pServerBenchmark->IsBenchmarkRunning();
730+
}
727731
if ( !bCanBuildInRespawnRoom )
728732
{
729733
if ( PointInRespawnRoom( NULL, m_vecBuildOrigin ) )

src/game/server/tf/tf_obj_sentrygun.cpp

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,15 @@ void CObjectSentrygun::SentryThink( void )
319319

320320
SetContextThink( &CObjectSentrygun::SentryThink, gpGlobals->curtime + SENTRY_THINK_DELAY, SENTRYGUN_CONTEXT );
321321

322-
#if defined(MCOMS_BALANCE_PACK)
323-
// shield after disabling
324-
const float flTimeTillFade = m_flShieldFadeTime - gpGlobals->curtime;
325-
if ( m_nShieldLevel == 0 && flTimeTillFade > 0.001f && !m_bPlayerControlled && !IsCarried() )
322+
if ( TFGameRules()->IsBetaActive() )
326323
{
327-
m_nShieldLevel.Set( SHIELD_NORMAL );
324+
// shield after disabling
325+
const float flTimeTillFade = m_flShieldFadeTime - gpGlobals->curtime;
326+
if ( m_nShieldLevel == 0 && flTimeTillFade > 0.001f && !m_bPlayerControlled && !IsCarried() )
327+
{
328+
m_nShieldLevel.Set( SHIELD_NORMAL );
329+
}
328330
}
329-
#endif
330331
if ( m_nShieldLevel > 0 && (gpGlobals->curtime > m_flShieldFadeTime) )
331332
{
332333
m_nShieldLevel.Set( SHIELD_NONE );
@@ -899,12 +900,16 @@ bool CObjectSentrygun::FindTarget()
899900
if ( pPointer && pPointer->HasLaserDot() && !IsDisposableBuilding() )
900901
{
901902
m_bPlayerControlled = true;
902-
#if defined(MCOMS_BALANCE_PACK)
903-
// no shield
904-
m_nShieldLevel.Set(SHIELD_NONE);
905-
#else
906-
m_nShieldLevel.Set( SHIELD_NORMAL );
907-
#endif
903+
904+
if ( TFGameRules()->IsBetaActive() )
905+
{
906+
// no shield
907+
m_nShieldLevel.Set( SHIELD_NONE );
908+
}
909+
else
910+
{
911+
m_nShieldLevel.Set( SHIELD_NORMAL );
912+
}
908913
m_flShieldFadeTime = gpGlobals->curtime + WRANGLER_DISABLE_TIME;
909914

910915
// If not target dummy, use laserdot, otherwise targetdummy overrides
@@ -1381,11 +1386,15 @@ bool CObjectSentrygun::FireRocket()
13811386
// Setup next rocket shot
13821387
if ( m_bPlayerControlled )
13831388
{
1384-
#if defined(MCOMS_BALANCE_PACK)
1385-
float flPlayerRocketTime = flRocketTime / 2.0f;
1386-
#else
1387-
float flPlayerRocketTime = 2.25f;
1388-
#endif
1389+
float flPlayerRocketTime;
1390+
if ( TFGameRules()->IsBetaActive() )
1391+
{
1392+
flPlayerRocketTime = flRocketTime / 2.0f;
1393+
}
1394+
else
1395+
{
1396+
flPlayerRocketTime = 2.25f;
1397+
}
13891398
AddGesture( ACT_RANGE_ATTACK2, flPlayerRocketTime, true );
13901399
m_flNextRocketAttack = gpGlobals->curtime + flPlayerRocketTime;
13911400
}
@@ -1849,22 +1858,25 @@ void CObjectSentrygun::CalcFireRate( void )
18491858
// This is different for each type because of how the boost worked before the firing speed fix.
18501859
if ( m_bPlayerControlled )
18511860
{
1852-
#if defined(MCOMS_BALANCE_PACK)
1853-
vecFireRateBoosts.push_back( 0.5f );
1854-
#else
1855-
if ( IsMiniBuilding() )
1861+
if ( TFGameRules()->IsBetaActive() )
18561862
{
18571863
vecFireRateBoosts.push_back( 0.5f );
18581864
}
1859-
else if (m_iUpgradeLevel == 1)
1860-
{
1861-
vecFireRateBoosts.push_back( 0.6f );
1862-
}
18631865
else
18641866
{
1865-
vecFireRateBoosts.push_back( 2.0f / 3.0f );
1867+
if ( IsMiniBuilding() )
1868+
{
1869+
vecFireRateBoosts.push_back( 0.5f );
1870+
}
1871+
else if (m_iUpgradeLevel == 1)
1872+
{
1873+
vecFireRateBoosts.push_back( 0.6f );
1874+
}
1875+
else
1876+
{
1877+
vecFireRateBoosts.push_back( 2.0f / 3.0f );
1878+
}
18661879
}
1867-
#endif
18681880
}
18691881

18701882
// Crit canteen 2x boost

src/game/server/tf/tf_player.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10606,21 +10606,22 @@ int CTFPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo )
1060610606
HandleRageGain( pTFAttacker, this, kRageBuffFlag_OnBurnDamageDealt, info.GetDamage() * flRageScale, flInverseRageGainScale );
1060710607
}
1060810608

10609-
#if defined(MCOMS_BALANCE_PACK)
10610-
if ( pTFAttacker && info.GetDamageCustom() == TF_DMG_CUSTOM_BLEEDING )
10609+
if ( TFGameRules()->IsBetaActive() )
1061110610
{
10612-
CTFWeaponBase* pGiftWrapBat = pTFAttacker->Weapon_OwnsThisID(TF_WEAPON_BAT_GIFTWRAP);
10613-
if ( pGiftWrapBat )
10611+
if ( pTFAttacker && info.GetDamageCustom() == TF_DMG_CUSTOM_BLEEDING )
1061410612
{
10615-
// 0.0625 seconds per damage of bleed.
10616-
// -> 0.125 seconds per 4 damage (bleed tick)
10617-
// -> 0.25 seconds per 2 bleed ticks (1 second)
10618-
// -> 0.5 second per default duration (2 seconds)
10619-
// -> 1 second per max duration (4 seconds)
10620-
pGiftWrapBat->DecrementBarRegenTime(info.GetDamage() * 0.0625f);
10613+
CTFWeaponBase* pGiftWrapBat = pTFAttacker->Weapon_OwnsThisID( TF_WEAPON_BAT_GIFTWRAP );
10614+
if ( pGiftWrapBat )
10615+
{
10616+
// 0.0625 seconds per damage of bleed.
10617+
// -> 0.125 seconds per 4 damage (bleed tick)
10618+
// -> 0.25 seconds per 2 bleed ticks (1 second)
10619+
// -> 0.5 second per default duration (2 seconds)
10620+
// -> 1 second per max duration (4 seconds)
10621+
pGiftWrapBat->DecrementBarRegenTime( info.GetDamage() * 0.0625f );
10622+
}
1062110623
}
1062210624
}
10623-
#endif
1062410625
}
1062510626

1062610627
if ( pWeapon && ( ( pWeapon->GetWeaponID() == TF_WEAPON_BAT_FISH ) || ( pWeapon->GetWeaponID() == TF_WEAPON_SLAP ) ) )

src/game/shared/tf/tf_gamerules.cpp

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6274,21 +6274,31 @@ int CTFRadiusDamageInfo::ApplyToEntity( CBaseEntity *pEntity )
62746274
{
62756275
if ( pWeapon )
62766276
{
6277-
switch ( pWeapon->GetWeaponID() )
6277+
if ( TFGameRules()->IsBetaActive() )
62786278
{
6279-
case TF_WEAPON_PIPEBOMBLAUNCHER:
6280-
case TF_WEAPON_GRENADELAUNCHER:
6281-
case TF_WEAPON_CANNON:
6282-
#if !defined(MCOMS_BALANCE_PACK)
6283-
case TF_WEAPON_STICKBOMB:
6284-
#endif
6285-
flAdjustedDamage *= 0.75f;
6286-
break;
6287-
#if defined(MCOMS_BALANCE_PACK)
6288-
case TF_WEAPON_STICKBOMB:
6289-
flAdjustedDamage *= 25.0f; // caber does lethal damage to ourselves
6290-
break;
6291-
#endif
6279+
switch ( pWeapon->GetWeaponID() )
6280+
{
6281+
case TF_WEAPON_PIPEBOMBLAUNCHER:
6282+
case TF_WEAPON_GRENADELAUNCHER:
6283+
case TF_WEAPON_CANNON:
6284+
flAdjustedDamage *= 0.75f;
6285+
break;
6286+
case TF_WEAPON_STICKBOMB:
6287+
flAdjustedDamage *= 25.0f; // caber does lethal damage to ourselves
6288+
break;
6289+
}
6290+
}
6291+
else
6292+
{
6293+
switch ( pWeapon->GetWeaponID() )
6294+
{
6295+
case TF_WEAPON_PIPEBOMBLAUNCHER:
6296+
case TF_WEAPON_GRENADELAUNCHER:
6297+
case TF_WEAPON_CANNON:
6298+
case TF_WEAPON_STICKBOMB:
6299+
flAdjustedDamage *= 0.75f;
6300+
break;
6301+
}
62926302
}
62936303
}
62946304

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12566,11 +12566,8 @@ bool CTFPlayer::CanAttack( int iCanAttackFlags )
1256612566
return false;
1256712567
}
1256812568

12569-
#if defined(TF2_OG) || defined(MCOMS_BALANCE_PACK)
12569+
// TODO(mcoms): det while taunting?
1257012570
const bool bCanAttackWhileTaunting = iCanAttackFlags & TF_CAN_ATTACK_FLAG_PIPEBOMBLAUNCHER_SECONDARY;
12571-
#else
12572-
const bool bCanAttackWhileTaunting = false;
12573-
#endif
1257412571
if ( IsTaunting() && !bCanAttackWhileTaunting )
1257512572
return false;
1257612573

src/game/shared/tf/tf_projectile_energy_ring.cpp

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
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)
6465
PRECACHE_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
//-----------------------------------------------------------------------------
342349
void 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

src/game/shared/tf/tf_projectile_energy_ring.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class CTFProjectile_EnergyRing : public CTFBaseProjectile
4545
virtual void ResolveFlyCollisionCustom( trace_t &trace, Vector &vecVelocity ) OVERRIDE;
4646
virtual bool CanCollideWithTeammates() const OVERRIDE { return false; }
4747
virtual void BisonThink();
48+
float GetTickTime();
4849
#else
4950
virtual void OnDataChanged( DataUpdateType_t updateType ) OVERRIDE;
5051
#endif

0 commit comments

Comments
 (0)