This commit is contained in:
ineed bots 2024-01-04 16:04:01 -06:00
parent 74152453bf
commit 6cf75a728d
9 changed files with 2904 additions and 2898 deletions

View File

@ -1,21 +1,27 @@
# try to mimic the original gsc provided
# mode=ghc
mode=c
style=allman
indent=tab
indent=force-tab=2
lineend=windows
pad-oper
pad-paren-in
pad-header
# delete-empty-lines
# pad-brackets-in
fill-empty-lines
squeeze-lines=2
squeeze-ws
break-one-line-headers
add-braces
remove-comment-prefix
break-blocks
# remove-braces
indent-switches
indent-cases
indent-after-parens
indent-col1-comments
remove-comment-prefix

View File

@ -4,7 +4,7 @@ root = true
indent_style = tab
indent_size = 2
charset = latin1
trim_trailing_whitespace = true
trim_trailing_whitespace = false
insert_final_newline = true
[*.md]

View File

@ -31,77 +31,77 @@ init()
if ( getdvar( "bots_main_GUIDs" ) == "" )
{
setdvar( "bots_main_GUIDs", "" ); // guids of players who will be given host powers, comma seperated
setdvar( "bots_main_GUIDs", "" ); // guids of players who will be given host powers, comma seperated
}
if ( getdvar( "bots_main_firstIsHost" ) == "" )
{
setdvar( "bots_main_firstIsHost", true ); // first player to connect is a host
setdvar( "bots_main_firstIsHost", true ); // first player to connect is a host
}
if ( getdvar( "bots_main_waitForHostTime" ) == "" )
{
setdvar( "bots_main_waitForHostTime", 10.0 ); // how long to wait to wait for the host player
setdvar( "bots_main_waitForHostTime", 10.0 ); // how long to wait to wait for the host player
}
if ( getdvar( "bots_main_kickBotsAtEnd" ) == "" )
{
setdvar( "bots_main_kickBotsAtEnd", false ); // kicks the bots at game end
setdvar( "bots_main_kickBotsAtEnd", false ); // kicks the bots at game end
}
if ( getdvar( "bots_manage_add" ) == "" )
{
setdvar( "bots_manage_add", 0 ); // amount of bots to add to the game
setdvar( "bots_manage_add", 0 ); // amount of bots to add to the game
}
if ( getdvar( "bots_manage_fill" ) == "" )
{
setdvar( "bots_manage_fill", 0 ); // amount of bots to maintain
setdvar( "bots_manage_fill", 0 ); // amount of bots to maintain
}
if ( getdvar( "bots_manage_fill_spec" ) == "" )
{
setdvar( "bots_manage_fill_spec", true ); // to count for fill if player is on spec team
setdvar( "bots_manage_fill_spec", true ); // to count for fill if player is on spec team
}
if ( getdvar( "bots_manage_fill_mode" ) == "" )
{
setdvar( "bots_manage_fill_mode", 0 ); // fill mode, 0 adds everyone, 1 just bots, 2 maintains at maps, 3 is 2 with 1
setdvar( "bots_manage_fill_mode", 0 ); // fill mode, 0 adds everyone, 1 just bots, 2 maintains at maps, 3 is 2 with 1
}
if ( getdvar( "bots_manage_fill_kick" ) == "" )
{
setdvar( "bots_manage_fill_kick", false ); // kick bots if too many
setdvar( "bots_manage_fill_kick", false ); // kick bots if too many
}
if ( getdvar( "bots_team" ) == "" )
{
setdvar( "bots_team", "autoassign" ); // which team for bots to join
setdvar( "bots_team", "autoassign" ); // which team for bots to join
}
if ( getdvar( "bots_team_amount" ) == "" )
{
setdvar( "bots_team_amount", 0 ); // amount of bots on axis team
setdvar( "bots_team_amount", 0 ); // amount of bots on axis team
}
if ( getdvar( "bots_team_force" ) == "" )
{
setdvar( "bots_team_force", false ); // force bots on team
setdvar( "bots_team_force", false ); // force bots on team
}
if ( getdvar( "bots_team_mode" ) == "" )
{
setdvar( "bots_team_mode", 0 ); // counts just bots when 1
setdvar( "bots_team_mode", 0 ); // counts just bots when 1
}
if ( getdvar( "bots_skill" ) == "" )
{
setdvar( "bots_skill", 0 ); // 0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
setdvar( "bots_skill", 0 ); // 0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
}
if ( getdvar( "bots_skill_axis_hard" ) == "" )
{
setdvar( "bots_skill_axis_hard", 0 ); // amount of hard bots on axis team
setdvar( "bots_skill_axis_hard", 0 ); // amount of hard bots on axis team
}
if ( getdvar( "bots_skill_axis_med" ) == "" )

View File

@ -958,7 +958,7 @@ bot_chat_killed_watch( victim )
break;
case 5:
message = ( "^" + ( randomint( 6 ) + 1 ) + "LOL " + victim.name + ", l2play" );
message = ( "^" + ( randomint( 6 ) + 1 ) + "LOL " + victim.name + ", l2play" );
break;
case 6:
@ -1140,7 +1140,7 @@ bot_chat_death_watch( killer, last_ks )
break;
case 3:
message = ( "^" + ( randomint( 6 ) + 1 ) + "How the?? How did you do that " + killer.name + "?" );
message = ( "^" + ( randomint( 6 ) + 1 ) + "How the?? How did you do that " + killer.name + "?" );
break;
case 4:

View File

@ -242,8 +242,8 @@ doBotMovement_loop( data )
// rotate our direction according to our angles
dir = ( dir[ 0 ] * cosa - dir[ 1 ] * sina,
dir[ 0 ] * sina + dir[ 1 ] * cosa,
0 );
dir[ 0 ] * sina + dir[ 1 ] * cosa,
0 );
// make the length 127
dir = vectornormalize( dir ) * 127;
@ -968,8 +968,8 @@ updateAimOffset( obj )
if ( diffAimAmount > 0 )
{
obj.aim_offset_base = ( randomfloatrange( 0 - diffAimAmount, diffAimAmount ),
randomfloatrange( 0 - diffAimAmount, diffAimAmount ),
randomfloatrange( 0 - diffAimAmount, diffAimAmount ) );
randomfloatrange( 0 - diffAimAmount, diffAimAmount ),
randomfloatrange( 0 - diffAimAmount, diffAimAmount ) );
}
else
{
@ -1158,18 +1158,18 @@ target_loop()
traceAnkleRight = bullettrace( myEye, targetAnkleRight, false, undefined );
canTargetPlayer = ( ( sighttracepassed( myEye, targetHead, false, undefined ) ||
sighttracepassed( myEye, targetAnkleLeft, false, undefined ) ||
sighttracepassed( myEye, targetAnkleRight, false, undefined ) )
sighttracepassed( myEye, targetAnkleLeft, false, undefined ) ||
sighttracepassed( myEye, targetAnkleRight, false, undefined ) )
&& ( ( traceHead[ "fraction" ] >= 1.0 || traceHead[ "surfacetype" ] == "glass" ) ||
( traceAnkleLeft[ "fraction" ] >= 1.0 || traceAnkleLeft[ "surfacetype" ] == "glass" ) ||
( traceAnkleRight[ "fraction" ] >= 1.0 || traceAnkleRight[ "surfacetype" ] == "glass" ) )
&& ( ( traceHead[ "fraction" ] >= 1.0 || traceHead[ "surfacetype" ] == "glass" ) ||
( traceAnkleLeft[ "fraction" ] >= 1.0 || traceAnkleLeft[ "surfacetype" ] == "glass" ) ||
( traceAnkleRight[ "fraction" ] >= 1.0 || traceAnkleRight[ "surfacetype" ] == "glass" ) )
&& ( SmokeTrace( myEye, player.origin, level.smokeradius ) ||
daDist < level.bots_maxknifedistance * 4 )
&& ( SmokeTrace( myEye, player.origin, level.smokeradius ) ||
daDist < level.bots_maxknifedistance * 4 )
&& ( getConeDot( player.origin, self.origin, myAngles ) >= myFov ||
( isObjDef && obj.trace_time ) ) );
&& ( getConeDot( player.origin, self.origin, myAngles ) >= myFov ||
( isObjDef && obj.trace_time ) ) );
if ( isdefined( self.bot.target_this_frame ) && self.bot.target_this_frame == player )
{

View File

@ -332,7 +332,7 @@ teamWatch()
for ( ;; )
{
while ( !isdefined( self.pers[ "team" ] ) || !allowTeamChoice() )
while ( !isdefined( self.pers[ "team" ] ) || !allowTeamChoice() )
{
wait .05;
}

View File

@ -2769,7 +2769,7 @@ AStarSearch( start, goal, team, greedy_path )
if ( isdefined( level.waypointusage[ team ][ child + "" ] ) )
{
temppen = level.waypointusage[ team ][ child + "" ]; // consider how many bots are taking this path
temppen = level.waypointusage[ team ][ child + "" ]; // consider how many bots are taking this path
}
if ( temppen > 1 )