|
|
@ -56,22 +56,25 @@ respawn_t bot_respawn[32] = { |
|
|
|
{FALSE, BOT_IDLE, "", "", "", NULL}, {FALSE, BOT_IDLE, "", "", "", NULL}, |
|
|
|
{FALSE, BOT_IDLE, "", "", "", NULL}, {FALSE, BOT_IDLE, "", "", "", NULL}, |
|
|
|
{FALSE, BOT_IDLE, "", "", "", NULL}, {FALSE, BOT_IDLE, "", "", "", NULL}}; |
|
|
|
{FALSE, BOT_IDLE, "", "", "", NULL}, {FALSE, BOT_IDLE, "", "", "", NULL}}; |
|
|
|
|
|
|
|
|
|
|
|
#define MAX_SKINS 10 |
|
|
|
#define MAX_SKINS 11 |
|
|
|
|
|
|
|
|
|
|
|
// indicate which models are currently used for random model allocation
|
|
|
|
// indicate which models are currently used for random model allocation
|
|
|
|
BOOL skin_used[MAX_SKINS] = { |
|
|
|
BOOL skin_used[MAX_SKINS] = { |
|
|
|
FALSE, FALSE, FALSE, FALSE, FALSE, |
|
|
|
FALSE, FALSE, FALSE, FALSE, FALSE, |
|
|
|
FALSE, FALSE, FALSE, FALSE, FALSE}; |
|
|
|
FALSE, FALSE, FALSE, FALSE, FALSE, |
|
|
|
|
|
|
|
FALSE}; |
|
|
|
|
|
|
|
|
|
|
|
// store the names of the models...
|
|
|
|
// store the names of the models...
|
|
|
|
const char *bot_skins[MAX_SKINS] = { |
|
|
|
const char *bot_skins[MAX_SKINS] = { |
|
|
|
"barney", "gina", "gman", "gordon", "helmet", |
|
|
|
"barney", "gina", "gman", "gordon", "helmet", |
|
|
|
"hgrunt", "recon", "robo", "scientist", "zombie"}; |
|
|
|
"hgrunt", "recon", "robo", "scientist", "zombie", |
|
|
|
|
|
|
|
"putin"}; |
|
|
|
|
|
|
|
|
|
|
|
// store the player names for each of the models...
|
|
|
|
// store the player names for each of the models...
|
|
|
|
const char *bot_names[MAX_SKINS] = { |
|
|
|
const char *bot_names[MAX_SKINS] = { |
|
|
|
"Barney", "Gina", "G-Man", "Gordon", "Helmet", |
|
|
|
"Barney", "Gina", "G-Man", "Gordon", "Helmet", |
|
|
|
"H-Grunt", "Recon", "Robo", "Scientist", "Zombie"}; |
|
|
|
"H-Grunt", "Recon", "Robo", "Scientist", "Zombie", |
|
|
|
|
|
|
|
"Putin"}; |
|
|
|
|
|
|
|
|
|
|
|
// how often (out of 1000 times) the bot will pause, based on bot skill
|
|
|
|
// how often (out of 1000 times) the bot will pause, based on bot skill
|
|
|
|
float pause_frequency[5] = {4, 7, 10, 15, 20}; |
|
|
|
float pause_frequency[5] = {4, 7, 10, 15, 20}; |
|
|
@ -228,9 +231,9 @@ void BotCreate(const char *skin, const char *name, const char *skill) |
|
|
|
if (IS_DEDICATED_SERVER()) |
|
|
|
if (IS_DEDICATED_SERVER()) |
|
|
|
printf("use barney, gina, gman, gordon, helmet, hgrunt,\n"); |
|
|
|
printf("use barney, gina, gman, gordon, helmet, hgrunt,\n"); |
|
|
|
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, |
|
|
|
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, |
|
|
|
" recon, robo, scientist, or zombie\n"); |
|
|
|
" recon, robo, scientist, zombie or putin\n"); |
|
|
|
if (IS_DEDICATED_SERVER()) |
|
|
|
if (IS_DEDICATED_SERVER()) |
|
|
|
printf(" recon, robo, scientist, or zombie\n"); |
|
|
|
printf(" recon, robo, scientist, zombie or putin\n"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -251,7 +254,7 @@ void BotCreate(const char *skin, const char *name, const char *skill) |
|
|
|
for (j = i; j < length; j++) // shuffle chars left (and null)
|
|
|
|
for (j = i; j < length; j++) // shuffle chars left (and null)
|
|
|
|
c_name[j] = c_name[j+1]; |
|
|
|
c_name[j] = c_name[j+1]; |
|
|
|
length--; |
|
|
|
length--; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
skill_level = 0; |
|
|
|
skill_level = 0; |
|
|
@ -577,7 +580,7 @@ float CBot::BotChangeYaw( float speed ) |
|
|
|
|
|
|
|
|
|
|
|
// turn from the current v_angle yaw to the ideal_yaw by selecting
|
|
|
|
// turn from the current v_angle yaw to the ideal_yaw by selecting
|
|
|
|
// the quickest way to turn to face that direction
|
|
|
|
// the quickest way to turn to face that direction
|
|
|
|
|
|
|
|
|
|
|
|
current = pev->v_angle.y; |
|
|
|
current = pev->v_angle.y; |
|
|
|
ideal = pev->ideal_yaw; |
|
|
|
ideal = pev->ideal_yaw; |
|
|
|
|
|
|
|
|
|
|
@ -1985,7 +1988,7 @@ void CBot::BotThink( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// if there was a wall on the left over 1/2 a second ago then
|
|
|
|
// if there was a wall on the left over 1/2 a second ago then
|
|
|
|
// 20% of the time randomly turn between 45 and 60 degrees
|
|
|
|
// 20% of the time randomly turn between 45 and 60 degrees
|
|
|
|
|
|
|
|
|
|
|
|
if ((f_wall_on_left != 0) && |
|
|
|
if ((f_wall_on_left != 0) && |
|
|
|
(f_wall_on_left <= gpGlobals->time - 0.5) && |
|
|
|
(f_wall_on_left <= gpGlobals->time - 0.5) && |
|
|
|
(RANDOM_LONG(1, 100) <= 20)) |
|
|
|
(RANDOM_LONG(1, 100) <= 20)) |
|
|
@ -2045,7 +2048,7 @@ void CBot::BotThink( void ) |
|
|
|
else if ((moved_distance <= 1) && (!bot_was_paused)) |
|
|
|
else if ((moved_distance <= 1) && (!bot_was_paused)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// the bot must be stuck!
|
|
|
|
// the bot must be stuck!
|
|
|
|
|
|
|
|
|
|
|
|
if (BotCanJumpUp( )) // can the bot jump onto something?
|
|
|
|
if (BotCanJumpUp( )) // can the bot jump onto something?
|
|
|
|
{ |
|
|
|
{ |
|
|
|
pev->button |= IN_JUMP; // jump up and move forward
|
|
|
|
pev->button |= IN_JUMP; // jump up and move forward
|
|
|
@ -2106,4 +2109,3 @@ void CBot::BotThink( void ) |
|
|
|
gpGlobals->frametime * 1000 ); |
|
|
|
gpGlobals->frametime * 1000 ); |
|
|
|
// TheFatal - END
|
|
|
|
// TheFatal - END
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|