game-source/fbxa/libfrikbot.h

298 lines
6.8 KiB
C
Raw Normal View History

#include "Entity.h"
2003-07-24 08:25:04 +00:00
@class Bot;
2003-07-24 18:25:46 +00:00
@class Waypoint;
2003-07-24 08:25:04 +00:00
@interface Target: Entity
{
}
-(vector)realorigin;
-(integer)canSee:(Target)targ ignoring:(entity)ignore;
@end
2003-07-24 18:25:46 +00:00
@interface Waypoint: Target
2003-07-24 08:25:04 +00:00
{
@public
2003-07-24 18:25:46 +00:00
Waypoint [4] targets;
2003-07-24 08:25:04 +00:00
integer flags;
vector origin;
integer b_pants, b_skill, b_shirt, b_frags, b_sound;
integer keys;
float items;
2003-07-24 18:25:46 +00:00
Waypoint enemy;
2003-07-24 08:25:04 +00:00
float search_time;
}
+(void)clearAll;
2003-07-24 18:25:46 +00:00
+(Waypoint)waypointForNum:(integer)num;
2003-07-24 08:25:04 +00:00
+(void)fixWaypoints;
+(void)clearRouteTable;
+(void)clearMyRoute:(Bot) bot;
-(void)fix;
-(id)init;
2003-07-24 08:25:04 +00:00
-(id)initAt:(vector)org;
-(id)initFromEntity:(entity)ent;
2003-07-24 18:25:46 +00:00
-(integer)isLinkedTo:(Waypoint)way;
-(integer)linkWay:(Waypoint)way;
-(integer)teleLinkWay:(Waypoint)way;
-(void)unlinkWay:(Waypoint)way;
2003-07-24 08:25:04 +00:00
2003-07-24 18:25:46 +00:00
-(void)followLink:(Waypoint)e2 :(integer)b_bit;
2003-07-24 08:25:04 +00:00
-(void)waypointThink;
-(void)clearRoute;
-(void)clearRouteForBot:(Bot)bot;
-(id)queueForThink;
2003-07-24 08:25:04 +00:00
@end
@interface Bot: Target
{
2003-07-24 08:25:04 +00:00
@public
2003-03-13 03:31:10 +00:00
//model modelindex
//frame angles colormap effects
//owner
//movetype solid touch <size> watertype flags think nextthink
integer keys, oldkeys;
2003-03-12 22:39:21 +00:00
integer buttons, impulse;
vector v_angle, b_angle;
vector mouse_emu;
integer wallhug;
integer ishuman;
float b_frags;
integer b_clientno;
float b_shirt, b_pants;
float ai_time;
float b_sound;
float missile_speed;
float portal_time;
integer b_skill;
float switch_wallhug;
integer b_aiflags;
integer b_num;
float b_chattime;
float b_entertime;
float b_menu, b_menu_time, b_menu_value;
integer route_failed;
2003-07-24 08:25:04 +00:00
integer dyn_flags, dyn_plat;
float dyn_time;
2003-07-24 18:25:46 +00:00
Waypoint temp_way, last_way, current_way;
2003-07-23 22:44:15 +00:00
entity [4] targets;
entity avoid;
vector obs_dir;
vector b_dir;
vector dyn_dest;
vector punchangle;
2003-07-24 08:25:04 +00:00
float teleport_time, portal_time;
}
- (id) init;
- (id) initWithEntity: (entity) e;
- (id) initFromPlayer: (entity) e;
- (integer) preFrame;
- (integer) postFrame;
- (void) frame;
- (void) disconnect;
@end
@interface Bot (Misc)
-(string)name:(integer)r;
-(string)randomName;
-(void)start_topic:(integer)topic;
-(void)chat;
-(integer)fov:(entity)targ;
+(void)kick;
@end
2003-03-12 22:39:21 +00:00
@interface Bot (Physics)
- (void)sendMove;
@end
@interface Bot (Move)
- (void)jump;
- (integer)can_rj;
- (integer)recognize_plat: (integer) flag;
- (integer)keysForDir: (vector) sdir;
- (void)obstructed: (vector) whichway : (integer) danger;
- (void)obstacles;
- (void)dodge_obstruction;
- (void)movetogoal;
- (integer)walkmove: (vector) weird;
- (void)roam;
@end
@interface Bot (AI)
2003-07-23 22:44:15 +00:00
-(integer)target_onstack:(entity)scot;
-(void)target_add:(entity)e;
-(void)target_drop:(entity)e;
2003-07-24 18:25:46 +00:00
-(void)lost:(Waypoint)targ :(integer)success;
-(void)check_lost:(Waypoint)targ;
2003-07-23 22:44:15 +00:00
-(void)handle_ai;
-(void)path;
-(float)priority_for_thing:(entity)thing;
-(void)look_for_crap:(integer)scope;
-(void)angle_set;
-(void)AI;
@end
@interface Bot (Fight)
-(float)size_player:(entity)e;
-(void)dodge_stuff;
-(void)weapon_switch:(float)brange;
-(void)shoot;
-(void)fight_style;
@end
2003-07-24 08:25:04 +00:00
@interface Bot (Way)
2003-07-24 18:25:46 +00:00
-(Waypoint)findWaypoint:(Waypoint)start;
-(void)deleteWaypoint:(Waypoint)what;
2003-07-24 08:25:04 +00:00
-(entity)findThing:(string)s;
2003-07-24 18:25:46 +00:00
-(Waypoint)findRoute:(Waypoint)lastone;
2003-07-24 08:25:04 +00:00
-(void)mark_path:(entity)this;
2003-07-24 18:25:46 +00:00
-(void)get_path:(Waypoint)this :(integer)direct;
2003-07-24 08:25:04 +00:00
-(integer)begin_route;
-(void)spawnTempWaypoint:(vector)org;
-(void)dynamicWaypoint;
-(integer)canSee:(Target)targ;
2003-07-24 08:25:04 +00:00
@end
#define FALSE 0
#define TRUE 1
/* punchangle
* bot fake kick?
*/
@extern .vector punchangle; // HACK - Don't want to screw with bot_phys
// --------defines-----
#define SVC_UPDATENAME 13
#define SVC_UPDATEFRAGS 14
#define SVC_UPDATECOLORS 17
// used for the physics & movement AI
#define KEY_MOVEUP 1
#define KEY_MOVEDOWN 2
#define KEY_MOVELEFT 4
#define KEY_MOVERIGHT 8
#define KEY_MOVEFORWARD 16
#define KEY_MOVEBACK 32
#define KEY_LOOKUP 64
#define KEY_LOOKDOWN 128
#define KEY_LOOKLEFT 256
#define KEY_LOOKRIGHT 512
// these are aiflags for waypoints
// some overlap to the bot
#define AI_TELELINK_1 1 // link type
#define AI_TELELINK_2 2 // link type
#define AI_TELELINK_3 4 // link type
#define AI_TELELINK_4 8 // link type
#define AI_DOORFLAG 16 // read ahead
#define AI_PRECISION 32 // read ahead + point
#define AI_SURFACE 64 // point
#define AI_BLIND 128 // read ahead + point
#define AI_JUMP 256 // point + ignore
#define AI_DIRECTIONAL 512 // read ahead + ignore
#define AI_PLAT_BOTTOM 1024 // read ahead
#define AI_RIDE_TRAIN 2048 // read ahead
#define AI_SUPER_JUMP 4096 // point + ignore + route test
#define AI_SNIPER 8192 // point type
#define AI_AMBUSH 16384 // point type
#define AI_DOOR_NO_OPEN 32768 // read ahead
#define AI_DIFFICULT 65536 // route test
#define AI_TRACE_TEST 131072 // route test
// these are flags for bots/players (dynamic/editor flags)
#define AI_OBSTRUCTED 1
#define AI_HOLD_SELECT 2
#define AI_ROUTE_FAILED 2
#define AI_WAIT 4
#define AI_DANGER 8
// addition masks
#define AI_POINT_TYPES 29152
#define AI_READAHEAD_TYPES 36528
#define AI_IGNORE_TYPES 4864
#define WM_UNINIT 0
#define WM_DYNAMIC 1
#define WM_LOADING 2
#define WM_LOADED 3
// editor modes aren't available in QW, but we retain support of them
// since the editor is still built into the AI in places
#define WM_EDITOR 4
#define WM_EDITOR_DYNAMIC 5
#define WM_EDITOR_DYNLINK 6
#define OPT_NOCHAT 2
// -------globals-----
@extern Bot [32] players;
@extern float real_frametime;
2003-07-24 23:16:43 +00:00
@extern float bot_count, b_options;
@extern float lasttime;
@extern float waypoint_mode;
@extern float dump_mode;
@extern float direct_route;
@extern float sv_friction, sv_gravity;
@extern float sv_accelerate, sv_maxspeed, sv_stopspeed;
2003-07-24 08:25:04 +00:00
@extern Bot route_table;
2003-07-24 23:16:43 +00:00
@extern integer busy_waypoints;
@extern float coop;
// -------ProtoTypes------
// external
@extern void() ClientConnect;
@extern void() ClientDisconnect;
@extern void() SetNewParms;
// rankings
@extern integer (entity e) ClientNumber;
2003-07-24 08:25:04 +00:00
@extern integer(integer clientno) ClientBitFlag;
@extern void(entity who) UpdateClient;
2003-07-24 08:25:04 +00:00
@extern void(vector org, vector bit1, integer bit4, integer flargs) make_way;
@extern void () map_dm1;
@extern void () map_dm2;
@extern void () map_dm3;
@extern void () map_dm4;
@extern void () map_dm5;
@extern void () map_dm6;
// physics & movement
@extern void() SV_Physics_Client;
@extern void() SV_ClientThink;
@extern void() CL_KeyMove;
// ai & misc
@extern float(float y1, float y2) angcomp;
@extern float(entity ent, entity targ) sisible;
@extern vector(entity ent) realorigin;
@extern float(float v) frik_anglemod;
@extern void() bot_chat;
@extern void(float tpic) bot_start_topic;
@extern void(string h) BotSay;
@extern void() BotSayInit;
@extern void(string h) BotSay2;
@extern void(string h) BotSayTeam;
2003-07-24 18:25:46 +00:00
@extern void(Waypoint e1, Waypoint e2, integer flag) DeveloperLightning;
2003-03-10 23:54:41 +00:00
/*
angles is pitch yaw roll
move is forward right up
*/
@extern void (entity cl, float sec, vector angles, vector move, integer buttons, integer impulse) SV_UserCmd;
#include "defs.h"