X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fbot.qh;h=a28c94b7f729a8744241489008dc324caae6f51d;hb=d271f27a5ac351a3a7b39636932f6d661492be1d;hp=ac89f06a7382dc91aec1d68427af2b4b0a6269c1;hpb=6e12e42c14caa13f188ad12ce1fce1358428bee4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/bot.qh b/qcsrc/server/bot/bot.qh index ac89f06a7..a28c94b7f 100644 --- a/qcsrc/server/bot/bot.qh +++ b/qcsrc/server/bot/bot.qh @@ -1,21 +1,20 @@ -#ifndef BOT_H -#define BOT_H +#pragma once /* * Globals and Fields */ -const int AI_STATUS_ROAMING = 1; // Bot is just crawling the map. No enemies at sight -const int AI_STATUS_ATTACKING = 2; // There are enemies at sight -const int AI_STATUS_RUNNING = 4; // Bot is bunny hopping -const int AI_STATUS_DANGER_AHEAD = 8; // There is lava/slime/trigger_hurt ahead -const int AI_STATUS_OUT_JUMPPAD = 16; // Trying to get out of a "vertical" jump pad -const int AI_STATUS_OUT_WATER = 32; // Trying to get out of water -const int AI_STATUS_WAYPOINT_PERSONAL_LINKING = 64; // Waiting for the personal waypoint to be linked -const int AI_STATUS_WAYPOINT_PERSONAL_GOING = 128; // Going to a personal waypoint -const int AI_STATUS_WAYPOINT_PERSONAL_REACHED = 256; // Personal waypoint reached -const int AI_STATUS_JETPACK_FLYING = 512; -const int AI_STATUS_JETPACK_LANDING = 1024; -const int AI_STATUS_STUCK = 2048; // Cannot reach any goal +const int AI_STATUS_ROAMING = BIT(0); // Bot is just crawling the map. No enemies at sight +const int AI_STATUS_ATTACKING = BIT(1); // There are enemies at sight +const int AI_STATUS_RUNNING = BIT(2); // Bot is bunny hopping +const int AI_STATUS_DANGER_AHEAD = BIT(3); // There is lava/slime/trigger_hurt ahead +const int AI_STATUS_OUT_JUMPPAD = BIT(4); // Trying to get out of a "vertical" jump pad +const int AI_STATUS_OUT_WATER = BIT(5); // Trying to get out of water +const int AI_STATUS_WAYPOINT_PERSONAL_LINKING = BIT(6); // Waiting for the personal waypoint to be linked +const int AI_STATUS_WAYPOINT_PERSONAL_GOING = BIT(7); // Going to a personal waypoint +const int AI_STATUS_WAYPOINT_PERSONAL_REACHED = BIT(8); // Personal waypoint reached +const int AI_STATUS_JETPACK_FLYING = BIT(9); +const int AI_STATUS_JETPACK_LANDING = BIT(10); +const int AI_STATUS_STUCK = BIT(11); // Cannot reach any goal .float isbot; // true if this client is actually a bot .int aistatus; @@ -48,9 +47,9 @@ float bot_custom_weapon; float bot_distance_far; float bot_distance_close; -float bot_weapons_far[WEP_MAXCOUNT]; -float bot_weapons_mid[WEP_MAXCOUNT]; -float bot_weapons_close[WEP_MAXCOUNT]; +float bot_weapons_far[Weapons_MAX]; +float bot_weapons_mid[Weapons_MAX]; +float bot_weapons_close[Weapons_MAX]; entity bot_list; entity player_list; @@ -93,30 +92,25 @@ float bot_ignore_bots; // let bots not attack other bots (only works in non-team entity bot_spawn(); float bot_fixcount(); -void bot_think(); -void bot_setnameandstuff(); +void bot_think(entity this); +void bot_setnameandstuff(entity this); void bot_custom_weapon_priority_setup(); void bot_endgame(); void bot_relinkplayerlist(); -void bot_clientdisconnect(); -void bot_clientconnect(); +void bot_clientdisconnect(entity this); +void bot_clientconnect(entity this); void bot_removefromlargestteam(); void bot_removenewest(); void autoskill(float factor); void bot_serverframe(); -.void() bot_ai; +.void(entity this) bot_ai; .float(entity player, entity item) bot_pickupevalfunc; /* * Imports */ -void() havocbot_setupbot; +void(entity this) havocbot_setupbot; -//float c1, c2, c3, c4; -void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other); -float JoinBestTeam(entity pl, float only_return_best, float forcebestteam); - -void bot_calculate_stepheightvec(void); -#endif +void bot_calculate_stepheightvec();