mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-01-21 09:01:42 +00:00
Customizable color for the loading screen text. Bot stuff
This commit is contained in:
parent
e2e032c21a
commit
46b4488e28
4 changed files with 69 additions and 27 deletions
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.19 2002/05/02 12:44:58 makro
|
||||||
|
// Customizable color for the loading screen text. Bot stuff
|
||||||
|
//
|
||||||
// Revision 1.18 2002/05/02 00:12:22 makro
|
// Revision 1.18 2002/05/02 00:12:22 makro
|
||||||
// Improved reloading and ammo handling for akimbo/hc
|
// Improved reloading and ammo handling for akimbo/hc
|
||||||
//
|
//
|
||||||
|
@ -1413,20 +1416,12 @@ int AINode_Stand(bot_state_t *bs) {
|
||||||
bs->standfindenemy_time = FloatTime() + BotChatTime(bs) + 0.1;
|
bs->standfindenemy_time = FloatTime() + BotChatTime(bs) + 0.1;
|
||||||
bs->stand_time = FloatTime() + BotChatTime(bs) + 0.1;
|
bs->stand_time = FloatTime() + BotChatTime(bs) + 0.1;
|
||||||
}
|
}
|
||||||
//Makro - if bot isn't bandaging already
|
|
||||||
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
if (RQ3_Bot_CheckBandage(bs)) {
|
||||||
//Makro - bot should bandage
|
//Makro - if not bandaging already
|
||||||
if (bs->inventory[INVENTORY_HEALTH] > 60) {
|
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
||||||
willBandage = (random() < 0.3);
|
|
||||||
} else if (bs->inventory[INVENTORY_HEALTH] > 40) {
|
|
||||||
willBandage = (random() < 0.5);
|
|
||||||
} else if (bs->inventory[INVENTORY_HEALTH] > 20) {
|
|
||||||
willBandage = (random() < 0.7);
|
|
||||||
} else {
|
|
||||||
willBandage = qtrue;
|
|
||||||
}
|
|
||||||
if (willBandage) {
|
|
||||||
Cmd_Bandage( &g_entities[bs->entitynum] );
|
Cmd_Bandage( &g_entities[bs->entitynum] );
|
||||||
|
//Not 100% sure this will work, but oh well...
|
||||||
AIEnter_Battle_Retreat(bs, "stand: bandaging");
|
AIEnter_Battle_Retreat(bs, "stand: bandaging");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.23 2002/05/02 12:44:58 makro
|
||||||
|
// Customizable color for the loading screen text. Bot stuff
|
||||||
|
//
|
||||||
// Revision 1.22 2002/05/02 00:12:22 makro
|
// Revision 1.22 2002/05/02 00:12:22 makro
|
||||||
// Improved reloading and ammo handling for akimbo/hc
|
// Improved reloading and ammo handling for akimbo/hc
|
||||||
//
|
//
|
||||||
|
@ -310,6 +313,19 @@ void BotMoveTowardsEnt(bot_state_t *bs, vec3_t dest, int dist) {
|
||||||
BotMoveTo(bs, dir);
|
BotMoveTo(bs, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==================
|
||||||
|
RQ3_Bot_GetWeaponInfo
|
||||||
|
|
||||||
|
Added by Makro
|
||||||
|
==================
|
||||||
|
*/
|
||||||
|
void RQ3_Bot_GetWeaponInfo(bot_state_t *bs, int weaponstate, int weapon, void *weaponinfo) {
|
||||||
|
trap_BotGetWeaponInfo(weaponstate, weapon, weaponinfo);
|
||||||
|
//TODO: - set spreads here depending on what the player is doing - crouching, running etc.
|
||||||
|
// - set grenade range
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
BotSetUserInfo
|
BotSetUserInfo
|
||||||
|
@ -1566,6 +1582,7 @@ void BotRQ3TPSeekGoals( bot_state_t *bs ) {
|
||||||
//no arrive message
|
//no arrive message
|
||||||
//bs->arrive_time = 0;
|
//bs->arrive_time = 0;
|
||||||
//
|
//
|
||||||
|
bs->ctfroam_time = FloatTime() + CTF_ROAM_TIME;
|
||||||
BotVoiceChat(bs, bs->teammate, VOICECHAT_ONFOLLOW);
|
BotVoiceChat(bs, bs->teammate, VOICECHAT_ONFOLLOW);
|
||||||
//get the team goal time
|
//get the team goal time
|
||||||
bs->teamgoal_time = FloatTime() + TEAM_ACCOMPANY_TIME;
|
bs->teamgoal_time = FloatTime() + TEAM_ACCOMPANY_TIME;
|
||||||
|
@ -2030,7 +2047,7 @@ void BotUpdateInventory(bot_state_t *bs) {
|
||||||
bs->inventory[INVENTORY_HANDCANNONAMMO] = amt;
|
bs->inventory[INVENTORY_HANDCANNONAMMO] = amt;
|
||||||
//Blaze: Same ammo for Pistol and Akimbo Pistols
|
//Blaze: Same ammo for Pistol and Akimbo Pistols
|
||||||
//bs->inventory[INVENTORY_PISTOLAMMO] = bs->cur_ps.ammo[WP_AKIMBO];
|
//bs->inventory[INVENTORY_PISTOLAMMO] = bs->cur_ps.ammo[WP_AKIMBO];
|
||||||
//Makro - same hack for akimbos
|
//Makro - same hack for akimbo
|
||||||
amt = bs->cur_ps.ammo[WP_AKIMBO] + ent->client->numClips[WP_AKIMBO] * RQ3_PISTOL_CLIP;
|
amt = bs->cur_ps.ammo[WP_AKIMBO] + ent->client->numClips[WP_AKIMBO] * RQ3_PISTOL_CLIP;
|
||||||
if (amt < 2)
|
if (amt < 2)
|
||||||
amt = 0;
|
amt = 0;
|
||||||
|
@ -2349,6 +2366,9 @@ Added by Makro
|
||||||
qboolean RQ3_Bot_CheckBandage( bot_state_t *bs ) {
|
qboolean RQ3_Bot_CheckBandage( bot_state_t *bs ) {
|
||||||
qboolean doBandage = qfalse;
|
qboolean doBandage = qfalse;
|
||||||
|
|
||||||
|
if ( (bs->flags & BFL_FIGHTSUICIDAL) == BFL_FIGHTSUICIDAL)
|
||||||
|
return qfalse;
|
||||||
|
|
||||||
if (bs->inventory[INVENTORY_HEALTH] > 20)
|
if (bs->inventory[INVENTORY_HEALTH] > 20)
|
||||||
doBandage = (random() > (float) bs->inventory[INVENTORY_HEALTH] / 100.0f);
|
doBandage = (random() > (float) bs->inventory[INVENTORY_HEALTH] / 100.0f);
|
||||||
else
|
else
|
||||||
|
@ -2367,13 +2387,14 @@ void BotBattleUseItems(bot_state_t *bs) {
|
||||||
if ( bs->lastframe_health > bs->inventory[INVENTORY_HEALTH] ) {
|
if ( bs->lastframe_health > bs->inventory[INVENTORY_HEALTH] ) {
|
||||||
if (RQ3_Bot_CheckBandage(bs))
|
if (RQ3_Bot_CheckBandage(bs))
|
||||||
//Makro - if not bandaging already
|
//Makro - if not bandaging already
|
||||||
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING)
|
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
||||||
Cmd_Bandage( &g_entities[bs->entitynum] );
|
Cmd_Bandage( &g_entities[bs->entitynum] );
|
||||||
/*
|
/*
|
||||||
if (bot_developer.integer == 2) {
|
if (bot_developer.integer == 2) {
|
||||||
G_Printf(va("^5BOT CODE: ^7Bandaging with %i health\n", bs->inventory[INVENTORY_HEALTH]));
|
G_Printf(va("^5BOT CODE: ^7Bandaging with %i health\n", bs->inventory[INVENTORY_HEALTH]));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bs->inventory[INVENTORY_HEALTH] < 40) {
|
if (bs->inventory[INVENTORY_HEALTH] < 40) {
|
||||||
|
@ -2867,7 +2888,8 @@ int BotWantsToCamp(bot_state_t *bs) {
|
||||||
if (BotAggression(bs) < 50) return qfalse;
|
if (BotAggression(bs) < 50) return qfalse;
|
||||||
//the bot should have at least have the rocket launcher, the railgun or the bfg10k with some ammo
|
//the bot should have at least have the rocket launcher, the railgun or the bfg10k with some ammo
|
||||||
// Elder: changed a few of the numbers
|
// Elder: changed a few of the numbers
|
||||||
if ((bs->inventory[INVENTORY_HANDCANNON] <= 0 || bs->inventory[INVENTORY_M3AMMO < 5]) &&
|
//Makro - fixed a typo - bs->inventory[INVENTORY_M3AMMO < 5]
|
||||||
|
if ((bs->inventory[INVENTORY_HANDCANNON] <= 0 || bs->inventory[INVENTORY_M3AMMO] < 5) &&
|
||||||
(bs->inventory[INVENTORY_M4] <= 0 || bs->inventory[INVENTORY_M4AMMO] < 10) &&
|
(bs->inventory[INVENTORY_M4] <= 0 || bs->inventory[INVENTORY_M4AMMO] < 10) &&
|
||||||
(bs->inventory[INVENTORY_SSG3000] <= 0 || bs->inventory[INVENTORY_SSG3000AMMO] < 6)) {
|
(bs->inventory[INVENTORY_SSG3000] <= 0 || bs->inventory[INVENTORY_SSG3000AMMO] < 6)) {
|
||||||
return qfalse;
|
return qfalse;
|
||||||
|
@ -3672,7 +3694,9 @@ void BotAimAtEnemy(bot_state_t *bs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the weapon information
|
//get the weapon information
|
||||||
trap_BotGetWeaponInfo(bs->ws, bs->weaponnum, &wi);
|
//trap_BotGetWeaponInfo(bs->ws, bs->weaponnum, &wi);
|
||||||
|
//Makro - new function
|
||||||
|
RQ3_Bot_GetWeaponInfo(bs, bs->ws, bs->weaponnum, &wi);
|
||||||
//get the weapon specific aim accuracy and or aim skill
|
//get the weapon specific aim accuracy and or aim skill
|
||||||
|
|
||||||
//Blaze: just gonna set the Characteristic aim to machinegun for all of these, but I am still doing the if's so we can edit it later for bot support
|
//Blaze: just gonna set the Characteristic aim to machinegun for all of these, but I am still doing the if's so we can edit it later for bot support
|
||||||
|
@ -3697,20 +3721,23 @@ void BotAimAtEnemy(bot_state_t *bs) {
|
||||||
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
||||||
}
|
}
|
||||||
//Blaze: Reaction HandCannon
|
//Blaze: Reaction HandCannon
|
||||||
|
//Makro - using shotgun accuracy for now
|
||||||
if (wi.number == WP_HANDCANNON) {
|
if (wi.number == WP_HANDCANNON) {
|
||||||
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_SHOTGUN, 0, 1);
|
||||||
}
|
}
|
||||||
//Blaze: Reaction Shotgun
|
//Blaze: Reaction Shotgun
|
||||||
|
//Makro - using shotgun accuracy for now
|
||||||
if (wi.number == WP_M3) {
|
if (wi.number == WP_M3) {
|
||||||
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_SHOTGUN, 0, 1);
|
||||||
}
|
}
|
||||||
//Blaze: Reaction Akimbo
|
//Blaze: Reaction Akimbo
|
||||||
if (wi.number == WP_AKIMBO) {
|
if (wi.number == WP_AKIMBO) {
|
||||||
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
||||||
}
|
}
|
||||||
//Blaze: Reaction Grenade
|
//Blaze: Reaction Grenade
|
||||||
|
//Makro - changed to grenade launcher accuracy
|
||||||
if (wi.number == WP_GRENADE) {
|
if (wi.number == WP_GRENADE) {
|
||||||
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN, 0, 1);
|
aim_accuracy = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER, 0, 1);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (aim_accuracy <= 0) aim_accuracy = 0.0001f;
|
if (aim_accuracy <= 0) aim_accuracy = 0.0001f;
|
||||||
|
@ -3962,7 +3989,9 @@ void BotCheckAttack(bot_state_t *bs) {
|
||||||
//
|
//
|
||||||
//Makro - we need the weapon info sooner
|
//Makro - we need the weapon info sooner
|
||||||
//get the weapon info
|
//get the weapon info
|
||||||
trap_BotGetWeaponInfo(bs->ws, bs->weaponnum, &wi);
|
//trap_BotGetWeaponInfo(bs->ws, bs->weaponnum, &wi);
|
||||||
|
//Makro - new function
|
||||||
|
RQ3_Bot_GetWeaponInfo(bs, bs->ws, bs->weaponnum, &wi);
|
||||||
reactiontime = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_REACTIONTIME, 0, 1);
|
reactiontime = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_REACTIONTIME, 0, 1);
|
||||||
if (bs->enemysight_time > FloatTime() - reactiontime) return;
|
if (bs->enemysight_time > FloatTime() - reactiontime) return;
|
||||||
if (bs->teleport_time > FloatTime() - reactiontime) return;
|
if (bs->teleport_time > FloatTime() - reactiontime) return;
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.60 2002/05/02 12:44:58 makro
|
||||||
|
// Customizable color for the loading screen text. Bot stuff
|
||||||
|
//
|
||||||
// Revision 1.59 2002/04/30 11:54:37 makro
|
// Revision 1.59 2002/04/30 11:54:37 makro
|
||||||
// Bots rule ! Also, added clips to give all. Maybe some other things
|
// Bots rule ! Also, added clips to give all. Maybe some other things
|
||||||
//
|
//
|
||||||
|
@ -416,7 +419,10 @@ extern radio_msg_t female_radio_msgs[];
|
||||||
#define CS_SHADERSTATE 24
|
#define CS_SHADERSTATE 24
|
||||||
#define CS_BOTINFO 25
|
#define CS_BOTINFO 25
|
||||||
|
|
||||||
#define CS_ITEMS 27 // string of 0's and 1's that tell which items are present
|
#define CS_ITEMS 27 // string of 0's and 1's that tell which items are present
|
||||||
|
|
||||||
|
//Makro - color for the loading screen text
|
||||||
|
#define CS_LOADINGSCREEN 29
|
||||||
|
|
||||||
#define CS_MODELS 32
|
#define CS_MODELS 32
|
||||||
#define CS_SOUNDS (CS_MODELS+MAX_MODELS)
|
#define CS_SOUNDS (CS_MODELS+MAX_MODELS)
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.20 2002/05/02 12:44:58 makro
|
||||||
|
// Customizable color for the loading screen text. Bot stuff
|
||||||
|
//
|
||||||
// Revision 1.19 2002/04/30 12:23:35 jbravo
|
// Revision 1.19 2002/04/30 12:23:35 jbravo
|
||||||
// Warningfix
|
// Warningfix
|
||||||
//
|
//
|
||||||
|
@ -702,6 +705,8 @@ Every map should have exactly one worldspawn.
|
||||||
*/
|
*/
|
||||||
void SP_worldspawn( void ) {
|
void SP_worldspawn( void ) {
|
||||||
char *s;
|
char *s;
|
||||||
|
vec3_t color;
|
||||||
|
char info[MAX_INFO_STRING];
|
||||||
|
|
||||||
G_SpawnString( "classname", "", &s );
|
G_SpawnString( "classname", "", &s );
|
||||||
if ( Q_stricmp( s, "worldspawn" ) ) {
|
if ( Q_stricmp( s, "worldspawn" ) ) {
|
||||||
|
@ -719,6 +724,13 @@ void SP_worldspawn( void ) {
|
||||||
G_SpawnString( "message", "", &s );
|
G_SpawnString( "message", "", &s );
|
||||||
trap_SetConfigstring( CS_MESSAGE, s ); // map specific message
|
trap_SetConfigstring( CS_MESSAGE, s ); // map specific message
|
||||||
|
|
||||||
|
//Makro - color for the loading screen text
|
||||||
|
G_SpawnVector( "_color", "1 1 1", color );
|
||||||
|
Info_SetValueForKey(info, "red", va("%f", color[0]));
|
||||||
|
Info_SetValueForKey(info, "green", va("%f", color[1]));
|
||||||
|
Info_SetValueForKey(info, "blue", va("%f", color[2]));
|
||||||
|
trap_SetConfigstring( CS_LOADINGSCREEN, info );
|
||||||
|
|
||||||
trap_SetConfigstring( CS_MOTD, g_motd.string ); // message of the day
|
trap_SetConfigstring( CS_MOTD, g_motd.string ); // message of the day
|
||||||
|
|
||||||
G_SpawnString( "gravity", "800", &s );
|
G_SpawnString( "gravity", "800", &s );
|
||||||
|
|
Loading…
Reference in a new issue