Skip to content

Commit b520169

Browse files
committed
1 parent b3bd914 commit b520169

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

game/quiver/info_changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Added the following Source SDK Pull Requests:
7676
- #1516: Fix not being able to toggle off the orthographic camera
7777
- #1517: Implement tf_stats_bogus covnvars to allow High stat tracking in modes with Increased Stats. I.E MvM
7878
- #1518: Fix the B.A.S.E. Jumper's parachute not using half of its animations
79+
- #1520: Add ForceDifficultyBasedAim CTFBot flag to allow MvM missions to let Spies aim better
7980

8081
Details:
8182
- Fixed a bug where the mini-crit damage effect doesn't show up when your shield breaks.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ class CTFBot: public NextBotPlayer< CTFPlayer >, public CGameEventListener
277277
FIRE_IMMUNE = 1<<25, // "" fire
278278
PARACHUTE = 1<<26, // demo/soldier parachute when falling
279279
PROJECTILE_SHIELD = 1<<27, // medic projectile shield
280+
#ifdef BDSBASE
281+
FORCE_DIFFICULTY_BASED_AIM = 1 << 28, // force difficulty-based aim (for spy)
282+
#endif
280283
};
281284
void SetAttribute( int attributeFlag );
282285
void ClearAttribute( int attributeFlag );

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ float CTFBotBody::GetHeadAimTrackingInterval( void ) const
1818
CTFBot *me = (CTFBot *)GetBot();
1919

2020
// don't let Spies in MvM mode aim too precisely
21+
#ifdef BDSBASE
22+
if (TFGameRules()->IsMannVsMachineMode() && me->IsPlayerClass(TF_CLASS_SPY) && !me->HasAttribute(CTFBot::FORCE_DIFFICULTY_BASED_AIM))
23+
#else
2124
if ( TFGameRules()->IsMannVsMachineMode() && me->IsPlayerClass( TF_CLASS_SPY ) )
25+
#endif
2226
{
2327
return 0.25f;
2428
}

src/game/server/tf/player_vs_environment/tf_populator_spawners.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,12 @@ static bool ParseDynamicAttributes( CTFBot::EventChangeAttributes_t& event, KeyV
750750
{
751751
event.m_attributeFlags |= CTFBot::PROJECTILE_SHIELD;
752752
}
753+
#ifdef BDSBASE
754+
else if (!Q_stricmp(value, "ForceDifficultyBasedAim"))
755+
{
756+
event.m_attributeFlags |= CTFBot::FORCE_DIFFICULTY_BASED_AIM;
757+
}
758+
#endif
753759
else
754760
{
755761
Warning( "TFBotSpawner: Invalid attribute '%s'\n", value );

src/game/server/vscript_server.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,9 @@ DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "BLAST_IMMUNE", CTFBot::Attribu
32893289
DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "FIRE_IMMUNE", CTFBot::AttributeType::FIRE_IMMUNE )
32903290
DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "PARACHUTE", CTFBot::AttributeType::PARACHUTE )
32913291
DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "PROJECTILE_SHIELD", CTFBot::AttributeType::PROJECTILE_SHIELD )
3292+
#ifdef BDSBASE
3293+
DECLARE_SCRIPT_CONST_NAMED(FTFBotAttributeType, "FORCE_DIFFICULTY_BASED_AIM", CTFBot::AttributeType::FORCE_DIFFICULTY_BASED_AIM)
3294+
#endif
32923295
REGISTER_SCRIPT_CONST_TABLE( FTFBotAttributeType )
32933296

32943297

0 commit comments

Comments
 (0)