update this

This commit is contained in:
ineed bots 2023-06-20 13:40:20 -06:00
parent a209af39b8
commit a906e6f34e

View File

@ -18,9 +18,7 @@ init()
level thread spitOutTime(); level thread spitOutTime();
if ( getDvar( "killtest_bot_debug" ) == "" ) if ( getDvar( "killtest_bot_debug" ) == "" )
setDvar( "killtest_bot_debug", 1 ); setDvar( "killtest_bot_debug", 0 );
setDvar( "bots_skill", 7 );
level thread addBot(); level thread addBot();
@ -90,16 +88,24 @@ spitOutTime()
} }
} }
/* botMoveTo( to ) botMoveTo( to )
{ {
self.moveTo = to; self.moveTo = to;
} }
walk_to_player() walk_to_player()
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "zombified" ); self endon( "zombified" );
bot_allowed_negotiation_links = [];
bot_allowed_negotiation_links[ bot_allowed_negotiation_links.size ] = "zombie_jump_down_72";
bot_allowed_negotiation_links[ bot_allowed_negotiation_links.size ] = "zombie_jump_down_96";
bot_allowed_negotiation_links[ bot_allowed_negotiation_links.size ] = "zombie_jump_down_120";
bot_allowed_negotiation_links[ bot_allowed_negotiation_links.size ] = "zombie_jump_down_127";
bot_allowed_negotiation_links[ bot_allowed_negotiation_links.size ] = "zombie_jump_down_184";
bot_allowed_negotiation_links[ bot_allowed_negotiation_links.size ] = "zombie_jump_down_190";
for ( ;; ) for ( ;; )
{ {
wait 0.05; wait 0.05;
@ -121,28 +127,23 @@ spitOutTime()
non_bot_player = player; non_bot_player = player;
} }
if ( !isdefined( non_bot_player ) ) goal = ( 0, 0, 50 );
continue;
if ( isdefined( non_bot_player ) )
{
goal = non_bot_player.origin;
}
// generate a path to the player // generate a path to the player
goal = non_bot_player.origin; path = generatePath( self.origin, goal, self.team, bot_allowed_negotiation_links );
path = generatePath( self.origin, goal, "free", false );
if ( !isdefined( path ) ) if ( !isdefined( path ) || !path.size )
continue; continue;
// traverse each node in the path // traverse each node in the path
for ( i = path.size - 1; i >= 0; i-- ) for ( i = 0; i < path.size; i++ )
{ {
path_num = path[i]; path_node = path[i];
if ( path_num <= -1 )
continue;
path_node = getNodeByNumber( path_num );
if ( !isDefined( path_node ) )
continue;
while ( distance2d( self.origin, path_node.origin ) >= 7 ) while ( distance2d( self.origin, path_node.origin ) >= 7 )
{ {
@ -162,10 +163,10 @@ spitOutTime()
// done // done
} }
} }
do_move() do_move()
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "zombified" ); self endon( "zombified" );
@ -200,7 +201,7 @@ spitOutTime()
self botMovement( int( dir[0] ), int( dir[1] ) ); self botMovement( int( dir[0] ), int( dir[1] ) );
} }
}*/ }
addBot() addBot()
{ {
@ -224,15 +225,14 @@ addBot()
if ( !isDefined( guy ) ) if ( !isDefined( guy ) )
return; return;
// guy.killingAll = true; guy.killingAll = true;
weapon = "ray_gun"; weapon = "ray_gun";
guy giveWeapon( weapon ); // ptrs41_zombie zombie_doublebarrel guy giveWeapon( weapon ); // ptrs41_zombie zombie_doublebarrel
guy switchToWeapon( weapon ); // colt_dirty_harry guy switchToWeapon( weapon ); // colt_dirty_harry
//guy thread walk_to_player(); guy thread walk_to_player();
//guy thread do_move(); guy thread do_move();
/*
while ( isDefined( guy ) ) while ( isDefined( guy ) )
{ {
if ( isDefined( level.isPlayerDead ) && [[level.isPlayerDead]]( guy ) ) if ( isDefined( level.isPlayerDead ) && [[level.isPlayerDead]]( guy ) )
@ -246,7 +246,6 @@ addBot()
wait 0.05; wait 0.05;
} }
*/
} }
onPlayerConnect() onPlayerConnect()
@ -355,17 +354,18 @@ do_magic_bullets()
if ( isDefined( zombie ) ) if ( isDefined( zombie ) )
{ {
/* if ( getDvarInt( "killtest_overflow_health_test" ) )
if ( zombie.maxhealth != 2147483647 ) {
{ if ( zombie.maxhealth != 2147483647 )
zombie.maxhealth = 2147483647; {
zombie.health = zombie.maxhealth; zombie.maxhealth = 2147483647;
} zombie.health = zombie.maxhealth;
else }
{ else
zombie DoDamage( zombie.health + 666, zombie.origin, self, 0, "headshot" ); {
} zombie DoDamage( zombie.health + 666, zombie.origin, self, 0, "headshot" );
*/ }
}
hit_loc = undefined; hit_loc = undefined;