diff --git a/src/game/server/tf/bot/tf_bot.h b/src/game/server/tf/bot/tf_bot.h index cce41e3a474..a0fa02f4815 100644 --- a/src/game/server/tf/bot/tf_bot.h +++ b/src/game/server/tf/bot/tf_bot.h @@ -268,6 +268,7 @@ class CTFBot: public NextBotPlayer< CTFPlayer >, public CGameEventListener FIRE_IMMUNE = 1<<25, // "" fire PARACHUTE = 1<<26, // demo/soldier parachute when falling PROJECTILE_SHIELD = 1<<27, // medic projectile shield + FORCE_DIFFICULTY_BASED_AIM = 1<<28, // force difficulty-based aim (for spy) }; void SetAttribute( int attributeFlag ); void ClearAttribute( int attributeFlag ); diff --git a/src/game/server/tf/bot/tf_bot_body.cpp b/src/game/server/tf/bot/tf_bot_body.cpp index b1b87c561db..4a30868b34d 100644 --- a/src/game/server/tf/bot/tf_bot_body.cpp +++ b/src/game/server/tf/bot/tf_bot_body.cpp @@ -18,7 +18,7 @@ float CTFBotBody::GetHeadAimTrackingInterval( void ) const CTFBot *me = (CTFBot *)GetBot(); // don't let Spies in MvM mode aim too precisely - if ( TFGameRules()->IsMannVsMachineMode() && me->IsPlayerClass( TF_CLASS_SPY ) ) + if ( TFGameRules()->IsMannVsMachineMode() && me->IsPlayerClass( TF_CLASS_SPY ) && !me->HasAttribute( CTFBot::FORCE_DIFFICULTY_BASED_AIM ) ) { return 0.25f; } diff --git a/src/game/server/tf/player_vs_environment/tf_populator_spawners.cpp b/src/game/server/tf/player_vs_environment/tf_populator_spawners.cpp index 635edd70a5b..50357a037fb 100644 --- a/src/game/server/tf/player_vs_environment/tf_populator_spawners.cpp +++ b/src/game/server/tf/player_vs_environment/tf_populator_spawners.cpp @@ -750,6 +750,10 @@ static bool ParseDynamicAttributes( CTFBot::EventChangeAttributes_t& event, KeyV { event.m_attributeFlags |= CTFBot::PROJECTILE_SHIELD; } + else if ( !Q_stricmp( value, "ForceDifficultyBasedAim" ) ) + { + event.m_attributeFlags |= CTFBot::FORCE_DIFFICULTY_BASED_AIM; + } else { Warning( "TFBotSpawner: Invalid attribute '%s'\n", value ); diff --git a/src/game/server/vscript_server.cpp b/src/game/server/vscript_server.cpp index 43ff4f530cd..e1130a3582e 100644 --- a/src/game/server/vscript_server.cpp +++ b/src/game/server/vscript_server.cpp @@ -2815,6 +2815,7 @@ DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "BLAST_IMMUNE", CTFBot::Attribu DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "FIRE_IMMUNE", CTFBot::AttributeType::FIRE_IMMUNE ) DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "PARACHUTE", CTFBot::AttributeType::PARACHUTE ) DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "PROJECTILE_SHIELD", CTFBot::AttributeType::PROJECTILE_SHIELD ) +DECLARE_SCRIPT_CONST_NAMED( FTFBotAttributeType, "FORCE_DIFFICULTY_BASED_AIM", CTFBot::AttributeType::FORCE_DIFFICULTY_BASED_AIM ) REGISTER_SCRIPT_CONST_TABLE( FTFBotAttributeType ) DECLARE_SCRIPT_CONST_TABLE( ETFBotDifficultyType )