Skip to content

Commit 8470095

Browse files
committed
fix stun on taunt kills, make pyro bots deflect most projectiles
1 parent de02d27 commit 8470095

File tree

5 files changed

+90
-2
lines changed

5 files changed

+90
-2
lines changed

game/quiver/info_changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ Details:
117117
- In MvM, the Gas Passer's explosion damage was decreased from 350 to 150.
118118
- In PvP, the Gas Passer's explosion damage was decreased from 350 to 75.
119119
- Implemented NeoDement's Missing Killicons Pack.
120+
- Pyro bots can now reflect most projectiles.
121+
- Re-enabled stun for taunt kills.
120122

121123
Quiver Private Alpha 1.1.0:
122124
Whitelists:

src/game/server/tf/bot/tf_bot.cpp

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#include "tf_weapon_medigun.h"
2929
#include "func_respawnroom.h"
3030
#include "soundenvelope.h"
31+
#ifdef BDSBASE
32+
#include "tf_projectile_energy_ball.h"
33+
#endif
3134

3235
#include "econ_entity_creation.h"
3336

@@ -42,7 +45,9 @@ ConVar tf_bot_force_class( "tf_bot_force_class", "", FCVAR_GAMEDLL, "If set to a
4245
ConVar tf_bot_notice_gunfire_range( "tf_bot_notice_gunfire_range", "3000", FCVAR_GAMEDLL );
4346
ConVar tf_bot_notice_quiet_gunfire_range( "tf_bot_notice_quiet_gunfire_range", "500", FCVAR_GAMEDLL );
4447
ConVar tf_bot_sniper_personal_space_range( "tf_bot_sniper_personal_space_range", "1000", FCVAR_CHEAT, "Enemies beyond this range don't worry the Sniper" );
48+
#ifndef BDSBASE
4549
ConVar tf_bot_pyro_deflect_tolerance( "tf_bot_pyro_deflect_tolerance", "0.5", FCVAR_CHEAT );
50+
#endif
4651
ConVar tf_bot_keep_class_after_death( "tf_bot_keep_class_after_death", "0", FCVAR_GAMEDLL );
4752
ConVar tf_bot_prefix_name_with_difficulty( "tf_bot_prefix_name_with_difficulty", "0", FCVAR_GAMEDLL, "Append the skill level of the bot to the bot's name" );
4853
ConVar tf_bot_near_point_travel_distance( "tf_bot_near_point_travel_distance", "750", FCVAR_CHEAT, "If within this travel distance to the current point, bot is 'near' it" );
@@ -4424,6 +4429,77 @@ bool CTFBot::ShouldFireCompressionBlast( void )
44244429
if ( pObject->IsPlayer() )
44254430
continue;
44264431

4432+
#ifdef BDSBASE
4433+
bool bSeesProjectile = false;
4434+
4435+
CTFBaseRocket* pBaseRocket = dynamic_cast<CTFBaseRocket*>(pObject);
4436+
if (pBaseRocket)
4437+
{
4438+
// is this something I want to deflect?
4439+
if (pBaseRocket->IsDeflectable())
4440+
{
4441+
bSeesProjectile = true;
4442+
}
4443+
}
4444+
4445+
if (!bSeesProjectile)
4446+
{
4447+
CTFGrenadePipebombProjectile* pBaseGrenade = dynamic_cast<CTFGrenadePipebombProjectile*>(pObject);
4448+
if (pBaseGrenade)
4449+
{
4450+
// is this something I want to deflect?
4451+
if (pBaseGrenade->IsDeflectable())
4452+
{
4453+
bSeesProjectile = true;
4454+
}
4455+
}
4456+
}
4457+
4458+
// we can't deflect it.
4459+
if (!bSeesProjectile)
4460+
continue;
4461+
4462+
if (bSeesProjectile)
4463+
{
4464+
// on hard or expert, we're not restricted to what projectiles we should reflect.
4465+
// on lower difficulties, only deflect rockets or energy balls.
4466+
if (!IsDifficulty(CTFBot::HARD) && !IsDifficulty(CTFBot::EXPERT))
4467+
{
4468+
bool bCanReflectThisProj = false;
4469+
4470+
CTFProjectile_Rocket* pRocket = dynamic_cast<CTFProjectile_Rocket*>(pObject);
4471+
if (pRocket)
4472+
{
4473+
bCanReflectThisProj = true;
4474+
}
4475+
else
4476+
{
4477+
CTFProjectile_EnergyBall* pBall = dynamic_cast<CTFProjectile_EnergyBall*>(pObject);
4478+
if (pBall)
4479+
{
4480+
bCanReflectThisProj = true;
4481+
}
4482+
}
4483+
4484+
if (!bCanReflectThisProj)
4485+
continue;
4486+
}
4487+
4488+
// is it headed right for me?
4489+
Vector vecThemUnitVel = pObject->GetAbsVelocity();
4490+
vecThemUnitVel.z = 0.0f;
4491+
vecThemUnitVel.NormalizeInPlace();
4492+
4493+
Vector horzForward(vecForward.x, vecForward.y, 0.0f);
4494+
horzForward.NormalizeInPlace();
4495+
4496+
if (DotProduct(horzForward, vecThemUnitVel) > 0)
4497+
continue;
4498+
4499+
// bounce it!
4500+
return true;
4501+
}
4502+
#else
44274503
// is this something I want to deflect?
44284504
if ( !pObject->IsDeflectable() )
44294505
continue;
@@ -4448,6 +4524,7 @@ bool CTFBot::ShouldFireCompressionBlast( void )
44484524

44494525
// bounce it!
44504526
return true;
4527+
#endif
44514528
}
44524529

44534530
return false;

src/game/server/tf/tf_player.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,9 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
843843

844844
void ClearTauntAttack();
845845
float GetTauntAttackTime() const { return m_flTauntAttackTime; }
846+
#ifdef BDSBASE
847+
bool IsPerformingTauntAttack() const { return (m_iTauntAttack != TAUNTATK_NONE); }
848+
#endif
846849

847850
void SetRPSResult( int iRPSResult ) { m_iTauntRPSResult = iRPSResult; }
848851

src/game/server/tf/tf_projectile_flare.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,13 @@ void CTFProjectile_Flare::Explode( trace_t *pTrace, CBaseEntity *pOther )
255255
VectorNormalize( vecToTarget );
256256
vecToTarget.z = 1.0;
257257

258+
#if !defined(QUIVER_DLL)
258259
// apply airblast - Apply stun if they are effectively grounded so we can knock them up
259260
if ( !pTFVictim->m_Shared.InCond( TF_COND_KNOCKED_INTO_AIR ) )
260261
{
261262
pTFVictim->m_Shared.StunPlayer( 0.5, 1.f, TF_STUN_MOVEMENT, ToTFPlayer( pAttacker ) );
262263
}
264+
#endif
263265

264266
float flForce = bIsBurningVictim ? 400.0f : 100.0f;
265267
pTFVictim->ApplyGenericPushbackImpulse( vecToTarget * flForce, ToTFPlayer( pAttacker ) );

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10199,8 +10199,12 @@ bool CTFPlayerShared::AddToSpyCloakMeter( float val, bool bForce )
1019910199
void CTFPlayerShared::StunPlayer(float flTime, float flReductionAmount, int iStunFlags, CTFPlayer* pAttacker)
1020010200
{
1020110201
#if defined(QUIVER_DLL)
10202-
// in quiver, disable most instances of stun unless we're in MvM.
10203-
if (!qf_allow_stun.GetBool() && (TFGameRules() && !TFGameRules()->IsMannVsMachineMode()))
10202+
// in quiver, disable most instances of stun unless we're in MvM or taunt killing.
10203+
#ifdef GAME_DLL
10204+
if (!qf_allow_stun.GetBool() && ((TFGameRules() && !TFGameRules()->IsMannVsMachineMode()) && (pAttacker && !pAttacker->IsTaunting() && !pAttacker->IsPerformingTauntAttack()) ))
10205+
#else
10206+
if (!qf_allow_stun.GetBool() && ((TFGameRules() && !TFGameRules()->IsMannVsMachineMode()) && (pAttacker && !pAttacker->IsTaunting())))
10207+
#endif
1020410208
return;
1020510209
#endif
1020610210

0 commit comments

Comments
 (0)