Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/game/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,11 @@ target_sources_grouped(
neo/bot/behavior/neo_bot_ctg_enemy.h
neo/bot/behavior/neo_bot_ctg_escort.h
neo/bot/behavior/neo_bot_ctg_lone_wolf.h
neo/bot/behavior/neo_bot_ctg_lone_wolf_ambush.cpp
neo/bot/behavior/neo_bot_ctg_lone_wolf_ambush.h
neo/bot/behavior/neo_bot_ctg_lone_wolf_seek.cpp
neo/bot/behavior/neo_bot_ctg_lone_wolf_seek.h
neo/bot/behavior/neo_bot_ctg_seek.cpp
neo/bot/behavior/neo_bot_ctg_seek.h
neo/bot/behavior/neo_bot_dead.h
neo/bot/behavior/neo_bot_grenade_dispatch.h
Expand Down
1 change: 1 addition & 0 deletions src/game/server/neo/bot/behavior/neo_bot_ctg_capture.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "cbase.h"
#include "bot/behavior/neo_bot_ctg_capture.h"
#include "bot/behavior/neo_bot_ctg_lone_wolf_seek.h"
#include "bot/behavior/neo_bot_seek_weapon.h"
#include "bot/neo_bot_path_compute.h"
#include "weapon_ghost.h"
Expand Down
20 changes: 19 additions & 1 deletion src/game/server/neo/bot/behavior/neo_bot_ctg_carrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "bot/behavior/neo_bot_ctg_carrier.h"
#include "bot/behavior/neo_bot_ctg_lone_wolf.h"
#include "bot/neo_bot_path_compute.h"
#include "nav_mesh.h"
#include "neo_gamerules.h"
#include "neo_ghost_cap_point.h"
#include "debugoverlay_shared.h"
Expand Down Expand Up @@ -384,9 +385,26 @@ ActionResult< CNEOBot > CNEOBotCtgCarrier::Update( CNEOBot *me, float interval )
m_teammates.RemoveAll();
CollectPlayers( me, &m_teammates );

// Check if bot should transition into lone wolf behavior
if ( m_teammates.Count() == 0 )
{
return SuspendFor( new CNEOBotCtgLoneWolf, "I'm the last one!" );
const CKnownEntity *threat = me->GetVisionInterface()->GetPrimaryKnownThreat( true );
if ( threat && threat->GetEntity() && threat->GetEntity()->IsAlive() )
{
CNavArea *destArea = TheNavMesh->GetNearestNavArea( m_closestCapturePoint );
CNavArea *myArea = me->GetLastKnownArea();

if ( !destArea || !myArea || !destArea->IsPotentiallyVisible( myArea ) )
{
return SuspendFor( new CNEOBotCtgLoneWolf, "Last one standing and blocked from capturing!" );
}
}

// Lone wolf will drop the ghost and go into enemy seeking behavior
if ( m_closestCapturePoint == CNEO_Player::VECTOR_INVALID_WAYPOINT )
{
return SuspendFor( new CNEOBotCtgLoneWolf, "Looking for enemy since there is no capture point" );
}
}

UpdateFollowPath( me, m_teammates );
Expand Down
Loading