From 40b262b9eea0b3d6afe51c198184540c24b213cc Mon Sep 17 00:00:00 2001 From: Ragnvald Maartmann-Moe IV Date: Sat, 8 Mar 2003 03:20:32 +0000 Subject: [PATCH] Stuff. Lots of stuff. Possibly buggy stuff. No shaking shamblers at it. --- fbxa/bot.qc | 512 ++++++++++++++++++++------------------- fbxa/bot_ai.qc | 345 +++++++++++++-------------- fbxa/bot_ed.qc | 455 ++++++++++++++++++----------------- fbxa/bot_fight.qc | 244 +++++++++---------- fbxa/bot_misc.qc | 592 ++++++++++++++++++++++++---------------------- fbxa/bot_move.qc | 206 ++++++++-------- fbxa/bot_phys.qc | 241 ++++++++++--------- fbxa/bot_qw.qc | 300 +++++++++++------------ fbxa/bot_way.qc | 166 ++++++------- fbxa/map_dm1.qc | 89 +++---- fbxa/map_dm2.qc | 175 +++++++------- fbxa/map_dm3.qc | 281 +++++++++++----------- fbxa/map_dm4.qc | 85 +++---- fbxa/map_dm5.qc | 95 ++++---- fbxa/map_dm6.qc | 125 +++++----- 15 files changed, 1978 insertions(+), 1933 deletions(-) diff --git a/fbxa/bot.qc b/fbxa/bot.qc index ece5a72..a1de7d3 100644 --- a/fbxa/bot.qc +++ b/fbxa/bot.qc @@ -95,18 +95,27 @@ void() bot_map_load = { // place your qc loaded waypoints here - if (mapname == "dm1") - map_dm1(); - else if (mapname == "dm2") - map_dm2(); - else if (mapname == "dm3") - map_dm3(); - else if (mapname == "dm4") - map_dm4(); - else if (mapname == "dm5") - map_dm5(); - else if (mapname == "dm6") - map_dm6(); + switch (mapname) { + case "dm1": + map_dm1 (); + break; + case "dm2": + map_dm2 (); + break; + case "dm3": + map_dm3 (); + break; + case "dm4": + map_dm4 (); + break; + case "dm5": + map_dm5 (); + break; + case "dm6": + map_dm6 (); + default: + break; + } }; /* @@ -182,7 +191,6 @@ float AI_ROUTE_FAILED = 2; float AI_WAIT = 4; float AI_DANGER = 8; - // addition masks float AI_POINT_TYPES = 29152; float AI_READAHEAD_TYPES = 36528; @@ -196,7 +204,6 @@ float WM_EDITOR = 4; float WM_EDITOR_DYNAMIC = 5; float WM_EDITOR_DYNLINK = 6; - float OPT_SAVEBOTS = 1; float OPT_NOCHAT = 2; @@ -271,13 +278,11 @@ float(float v) frik_anglemod; void() bot_chat; void(float tpic) bot_start_topic; - // editor stuffs void() bot_way_edit; void() bot_menu_display; - // ----------Commands--------- void(entity e, float chan, string samp, float vol, float atten) frik_sound = #8; void(entity client, string s) frik_stuffcmd = #21; @@ -316,13 +321,13 @@ direct messages to the bots, it crashes quake :-( void(entity client, string s) stuffcmd = { if (client.ishuman == 1) - frik_stuffcmd(client, s); + frik_stuffcmd (client, s); b_temp1 = player_head; - while(b_temp1) { + while (b_temp1) { if (b_temp1.classname == "botcam") { if ((b_temp1.enemy == client) && b_temp1.ishuman) - frik_stuffcmd(b_temp1, s); + frik_stuffcmd (b_temp1, s); } b_temp1 = b_temp1._next; } @@ -334,26 +339,26 @@ void(entity e) setspawnparms = frik_setspawnparms(e); else { b_temp1 = player_head; - while(b_temp1) { + while (b_temp1) { if (b_temp1.ishuman) { - frik_setspawnparms(b_temp1); + frik_setspawnparms (b_temp1); return; } b_temp1 = b_temp1._next; } - SetNewParms(); + SetNewParms (); } }; void(entity client, string s) sprint = { if (client.ishuman == 1) - frik_sprint(client, s); + frik_sprint (client, s); b_temp1 = player_head; - while(b_temp1) { + while (b_temp1) { if (b_temp1.classname == "botcam") { if ((b_temp1.enemy == client) && b_temp1.ishuman) - frik_sprint(b_temp1, s); + frik_sprint (b_temp1, s); } b_temp1 = b_temp1._next; } @@ -362,13 +367,13 @@ void(entity client, string s) sprint = void(entity client, string s) centerprint = { if (client.ishuman == 1) - frik_centerprint(client, s); + frik_centerprint (client, s); b_temp1 = player_head; - while(b_temp1) { + while (b_temp1) { if (b_temp1.classname == "botcam") { if ((b_temp1.enemy == client) && b_temp1.ishuman) - frik_centerprint(b_temp1, s); + frik_centerprint (b_temp1, s); } b_temp1 = b_temp1._next; } @@ -377,69 +382,77 @@ void(entity client, string s) centerprint = vector(entity e, float sped) aim = { e.missile_speed = sped; - return frik_aim(e, sped); + return frik_aim (e, sped); }; void(entity e, float chan, string samp, float vol, float atten) sound = { - frik_sound(e, chan, samp, vol, atten); + frik_sound (e, chan, samp, vol, atten); if (samp == "items/inv3.wav") return; else if (e.classname == "player") e.b_sound = time + 1; else if (other.classname == "player") other.b_sound = time + 1; - }; + void(float to, float f) WriteByte = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteByte(to, f); + frik_WriteByte (to, f); }; + void(float to, float f) WriteChar = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteChar(to, f); + frik_WriteChar (to, f); }; + void(float to, float f) WriteShort = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteShort(to, f); + frik_WriteShort (to, f); }; + void(float to, float f) WriteLong = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteLong(to, f); + frik_WriteLong (to, f); }; + void(float to, float f) WriteCoord = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteCoord(to, f); + frik_WriteCoord (to, f); }; + void(float to, float f) WriteAngle = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteAngle(to, f); + frik_WriteAngle (to, f); }; + void(float to, string s) WriteString = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteString(to, s); + frik_WriteString (to, s); }; + void(float to, entity s) WriteEntity = { if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) return; - frik_WriteEntity(to, s); + frik_WriteEntity (to, s); }; + /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -447,12 +460,12 @@ Bot Cam, see what the bot sees (or any other player) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - float() botcam = { if (self.classname != "botcam") return FALSE; - setorigin(self, self.enemy.origin); + + setorigin (self, self.enemy.origin); self.items = self.enemy.items; self.weapon = self.enemy.weapon; self.weaponmodel = self.enemy.weaponmodel; @@ -471,22 +484,20 @@ float() botcam = self.punchangle = self.enemy.punchangle; self.deadflag = self.enemy.deadflag; msg_entity = self; - WriteByte (MSG_ONE,5); + WriteByte (MSG_ONE, 5); WriteEntity (MSG_ONE, self.enemy); WriteByte (MSG_ONE, 10); - WriteAngle (MSG_ONE,self.enemy.v_angle_x); - WriteAngle (MSG_ONE,self.enemy.v_angle_y); - WriteAngle (MSG_ONE,self.enemy.v_angle_z); + WriteAngle (MSG_ONE, self.enemy.v_angle_x); + WriteAngle (MSG_ONE, self.enemy.v_angle_y); + WriteAngle (MSG_ONE, self.enemy.v_angle_z); self.modelindex = 0; self.impulse = 0; return TRUE; - }; void() botcam_u = { - // sloppy cycling code if (self.classname != "botcam") { self.enemy = player_head; @@ -506,26 +517,23 @@ void() botcam_u = self.movetype = MOVETYPE_NONE; self.takedamage = DAMAGE_NO; - if (!self.enemy) { - sprint(self, "No one left to track!\n"); + sprint (self, "No one left to track!\n"); msg_entity = self; WriteByte (MSG_ONE,5); WriteEntity (MSG_ONE, self); - PutClientInServer(); + PutClientInServer (); return; } if (!self.enemy.ishuman) { self.enemy.dmg_take = 0; self.enemy.dmg_save = 0; } - sprint(self, "Now tracking "); - sprint(self, self.enemy.netname); - sprint(self, "\n"); + sprint (self, "Now tracking "); + sprint (self, self.enemy.netname); + sprint (self, "\n"); }; - - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -538,8 +546,10 @@ it just links the bot into the mod void() ClientFixRankings = { local float cno; + if (self.switch_wallhug > time) return; + self.switch_wallhug = 0; b_temp2 = nextent(NIL); @@ -556,6 +566,7 @@ void() ClientFixRankings = void() ClientInRankings = { local float cno; + if (player_head) player_head._last = self; @@ -576,14 +587,13 @@ void() ClientInRankings = } cno = self.colormap - 1; BotInvalidClientNo (cno); - active_clients = active_clients | ClientBitFlag(cno); + active_clients |= ClientBitFlag (cno); self.b_clientno = cno; self.ishuman = TRUE; self.switch_wallhug = time + 1; }; - void() ClientDisconnected = { if (player_head == self) @@ -593,8 +603,9 @@ void() ClientDisconnected = if (self._last) self._last._next = self._next; - active_clients = active_clients - active_clients & ClientBitFlag(self.b_clientno); + active_clients &= ~(ClientBitFlag (self.b_clientno)); }; + /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -614,20 +625,19 @@ float () BotPreFrame = return TRUE; } if (self.b_frags != self.frags) { - if (self.b_frags > self.frags) { - if (pointcontents(self.origin) == CONTENT_LAVA) - bot_start_topic(10); + if (pointcontents (self.origin) == CONTENT_LAVA) + bot_start_topic (10); else - bot_start_topic(9); - } - else - bot_start_topic(2); + bot_start_topic (9); + } else + bot_start_topic (2); self.b_frags = self.frags; } - DynamicWaypoint(); + DynamicWaypoint (); return FALSE; }; + float () BotPostFrame = { if (self.b_clientno == -1) @@ -656,24 +666,26 @@ The rest of this code is in bot_misc.qc */ void(string h) BotSay = // simulate talking by composing a 'chat' message { - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, self.netname); - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 2); - WriteString(MSG_ALL, h); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 1); + WriteString (MSG_ALL, self.netname); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 2); + WriteString (MSG_ALL, h); }; + void() BotSayInit = { - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, self.netname); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 1); + WriteString (MSG_ALL, self.netname); }; + void(string h) BotSay2 = { - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 2); - WriteString(MSG_ALL, h); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 2); + WriteString (MSG_ALL, h); }; void(string h) BotSayTeam = { @@ -681,21 +693,22 @@ void(string h) BotSayTeam = if (!teamplay) return; t = player_head; - while(t) { + while (t) { if (t.team == self.team) { msg_entity = t; - WriteByte(MSG_ONE, 8); - WriteByte(MSG_ONE, 1); - WriteByte(MSG_ONE, 40); - WriteString(MSG_ONE, self.netname); - WriteByte(MSG_ONE, 8); - WriteByte(MSG_ONE, 2); - WriteByte(MSG_ONE, 41); - WriteString(MSG_ONE, h); + WriteByte (MSG_ONE, 8); + WriteByte (MSG_ONE, 1); + WriteByte (MSG_ONE, 40); + WriteString (MSG_ONE, self.netname); + WriteByte (MSG_ONE, 8); + WriteByte (MSG_ONE, 2); + WriteByte (MSG_ONE, 41); + WriteString (MSG_ONE, h); } t = t._next; } }; + /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -703,28 +716,25 @@ BotInit -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - - void() BotInit = { local entity ent, fisent; local float numents; // spawn entities for the physics - ent = nextent(NIL); + ent = nextent (NIL); max_clients = 0; - while(ent != NIL) { - max_clients = max_clients + 1; - ent = nextent(ent); + while (ent != NIL) { + max_clients++; + ent = nextent (ent); } if (max_clients > 16) max_clients = 16; - ent = nextent(NIL); + ent = nextent (NIL); fisent = NIL; while (numents < max_clients) { - phys_head = spawn(); if (fisent) fisent._next = phys_head; @@ -733,28 +743,27 @@ void() BotInit = ent.phys_obj = phys_head; phys_head.classname = "phys_obj"; phys_head.owner = ent; - numents = numents + 1; - ent = nextent(ent); + numents++; + ent = nextent (ent); } - precache_model("progs/s_light.spr"); - precache_model("progs/s_bubble.spr"); + precache_model ("progs/s_light.spr"); + precache_model ("progs/s_bubble.spr"); // the bots return! - b_options = cvar("saved1"); + b_options = cvar ("saved1"); if (coop || (b_options & OPT_SAVEBOTS)) { - saved_bots = cvar("scratch1"); - saved_skills1 = cvar("scratch2"); - saved_skills2 = cvar("scratch3"); + saved_bots = cvar ("scratch1"); + saved_skills1 = cvar ("scratch2"); + saved_skills2 = cvar ("scratch3"); } cvar_set ("saved4", "0"); if (max_clients > 1) { - localcmd("exec maps/"); - localcmd(mapname); - localcmd(".way\n"); + localcmd ("exec maps/"); + localcmd (mapname); + localcmd (".way\n"); waypoint_mode = WM_DYNAMIC; - bot_map_load(); + bot_map_load (); } else waypoint_mode = WM_LOADED; - }; /* @@ -768,7 +777,6 @@ signs on to the server. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void(entity who) UpdateClient = { WriteByte (MSG_ALL, SVC_UPDATENAME); @@ -785,39 +793,42 @@ void(entity who) UpdateClient = float(float clientno) ClientBitFlag = { // bigger, but faster - if (clientno == 0) + switch (clientno) { + case 0: return 1; - else if (clientno == 1) + case 1: return 2; - else if (clientno == 2) + case 2: return 4; - else if (clientno == 3) + case 3: return 8; - else if (clientno == 4) + case 4: return 16; - else if (clientno == 5) + case 5: return 32; - else if (clientno == 6) + case 6: return 64; - else if (clientno == 7) + case 7: return 128; - else if (clientno == 8) + case 8: return 256; - else if (clientno == 9) + case 9: return 512; - else if (clientno == 10) + case 10: return 1024; - else if (clientno == 11) + case 11: return 2048; - else if (clientno == 12) + case 12: return 4096; - else if (clientno == 13) + case 13: return 8192; - else if (clientno == 14) + case 14: return 16384; - else if (clientno == 15) + case 15: return 32768; - return 0; + default: + return 0; + } }; float() ClientNextAvailable = @@ -825,10 +836,10 @@ float() ClientNextAvailable = local float clientno; clientno = max_clients; - while(clientno > 0) { - clientno = clientno - 1; + while (clientno > 0) { + clientno--; - if(!(active_clients & ClientBitFlag(clientno))) + if (!(active_clients & ClientBitFlag (clientno))) return clientno; } @@ -862,19 +873,19 @@ Team finding code -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - float(float tcolor) FindAnotherColor = { local float bestbet, scolor, pcount, bestp; + bestbet = -1; bestp = 16; - while(scolor < 14) { + while (scolor < 14) { if (scolor != tcolor) { b_temp2 = player_head; pcount = 0; - while(b_temp2 != NIL) { + while (b_temp2 != NIL) { if (b_temp2.team == scolor + 1) - pcount = pcount + 1; + pcount++; b_temp2 = b_temp2._next; } if ((pcount < bestp) && pcount) { @@ -882,12 +893,12 @@ float(float tcolor) FindAnotherColor = bestp = pcount; } } - scolor = scolor + 1; + scolor++; } if (bestbet < 0) { bestbet = tcolor; while (bestbet == tcolor) { - bestbet = floor(random() * 13); + bestbet = floor (13 * random ()); } } return bestbet; @@ -904,10 +915,10 @@ entity(float num) GetClientEntity = { local entity upsy; upsy = NIL; - num = num + 1; + num++; while (num > 0) { - num = num - 1; - upsy = nextent(upsy); + num--; + upsy = nextent (upsy); } return upsy; }; @@ -918,27 +929,26 @@ void(float whichteam, float whatbot, float whatskill) BotConnect = local string h; local entity uself; - f = ClientNextAvailable(); + f = ClientNextAvailable (); uself = self; - if(f == -1) { + if (f == -1) { bprint("Unable to connect a bot, server is full.\n"); return; } // chat thing - active_clients = active_clients | ClientBitFlag(f); - bot_count = bot_count + 1; - self = GetClientEntity(f); + active_clients |= ClientBitFlag (f); + bot_count++; + self = GetClientEntity (f); if (!saved_bots) - bot_start_topic(1); + bot_start_topic (1); self.b_clientno = f; self.colormap = f + 1; if (whatbot) - self.netname = BotName(whatbot); + self.netname = BotName (whatbot); else - self.netname = PickARandomName(); - + self.netname = PickARandomName (); // players can set skill all weird, so leave these checks in whatskill = rint(whatskill); @@ -950,40 +960,40 @@ void(float whichteam, float whatbot, float whatskill) BotConnect = if (teamplay && !coop) { if (whichteam) - self.b_pants = FindAnotherColor(uself.team - 1); + self.b_pants = FindAnotherColor (uself.team - 1); else self.b_pants = uself.team - 1; self.b_shirt = self.b_pants; } self.team = self.b_pants + 1; - UpdateClient(self); - SetNewParms(); + UpdateClient (self); + SetNewParms (); self.ishuman = 2; - ClientConnect(); - PutClientInServer(); + ClientConnect (); + PutClientInServer (); // this is risky... could corrupt .way files if done wrong // If you're not the gambling type, comment this out - f = ClientBitFlag(self.b_num - 1); - current_bots = current_bots | f; + f = ClientBitFlag (self.b_num - 1); + current_bots |= f; +// FIXME: ugh if (self.b_num <= 8) saved_skills1 = (saved_skills1 & (65536 - (3 * f)) | (self.b_skill * f)); else { - f = ClientBitFlag(self.b_num - 9); + f = ClientBitFlag (self.b_num - 9); saved_skills2 = (saved_skills2 & (65536 - (3 * f)) | (self.b_skill * f)); } - h = ftos(current_bots); - cvar_set("scratch1", h); - h = ftos(saved_skills1); - cvar_set("scratch2", h); - h = ftos(saved_skills2); - cvar_set("scratch3", h); + h = ftos (current_bots); + cvar_set ("scratch1", h); + h = ftos (saved_skills1); + cvar_set ("scratch2", h); + h = ftos (saved_skills2); + cvar_set ("scratch3", h); self = uself; - }; void(entity bot) BotDisconnect = @@ -993,13 +1003,12 @@ void(entity bot) BotDisconnect = uself = self; self = bot; - bot_count = bot_count - 1; - current_bots = current_bots - (current_bots & ClientBitFlag(self.b_num - 1)); - h = ftos(current_bots); - cvar_set("scratch1", h); + bot_count--; + current_bots &= ~(ClientBitFlag (self.b_num - 1)); + h = ftos (current_bots); + cvar_set ("scratch1", h); - - ClientDisconnect(); + ClientDisconnect (); if (self.b_clientno != -1) { // the bot's client number is not in use by a real player so we @@ -1015,12 +1024,13 @@ void(entity bot) BotDisconnect = self.b_pants = 0; self.b_shirt = 0; self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = 0; - UpdateClient(self); - active_clients = active_clients - (active_clients & ClientBitFlag(self.b_clientno)); + UpdateClient (self); + active_clients &= ~(ClientBitFlag (self.b_clientno)); self.b_clientno = -1; } self = uself; }; + /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -1029,18 +1039,17 @@ kicks a bot if a player connects and takes the bot's space -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void(float clientno) BotInvalidClientNo = { local entity bot; bot = GetClientEntity(clientno); - if(bot.b_clientno > 0) { + if (bot.b_clientno > 0) { if (!bot.ishuman) { bot.b_clientno = -1; - BotDisconnect(bot); - active_clients = active_clients | ClientBitFlag(self.b_clientno); - BotConnect(0, bot.b_num, bot.b_skill); + BotDisconnect (bot); + active_clients |= ClientBitFlag (self.b_clientno); + BotConnect (0, bot.b_num, bot.b_skill); return; } } @@ -1058,19 +1067,20 @@ void() LoadWaypoint = local vector org; local entity tep; local float r; - org_x = cvar("saved1"); - org_y = cvar("saved2"); - org_z = cvar("saved3"); + + org_x = cvar ("saved1"); + org_y = cvar ("saved2"); + org_z = cvar ("saved3"); - tep = make_waypoint(org); + tep = make_waypoint (org); - r = cvar("saved4"); + r = cvar ("saved4"); - tep.b_aiflags = floor(r / 4); - tep.b_pants = cvar("scratch1"); - tep.b_skill = cvar("scratch2"); - tep.b_shirt = cvar("scratch3"); - tep.b_frags = cvar("scratch4"); + tep.b_aiflags = floor (r / 4); + tep.b_pants = cvar ("scratch1"); + tep.b_skill = cvar ("scratch2"); + tep.b_shirt = cvar ("scratch3"); + tep.b_frags = cvar ("scratch4"); }; void() bot_return = @@ -1079,28 +1089,43 @@ void() bot_return = if ((waypoint_mode == WM_DYNAMIC) || (waypoint_mode == WM_LOADED)) { // minor precaution - if (saved_bots & 1) BotConnect(0, 1, saved_skills1 & 3); - if (saved_bots & 2) BotConnect(0, 2, (saved_skills1 & 12) / 4); - if (saved_bots & 4) BotConnect(0, 3, (saved_skills1 & 48) / 16); - if (saved_bots & 8) BotConnect(0, 4, (saved_skills1 & 192) / 64); - if (saved_bots & 16) BotConnect(0, 5, (saved_skills1 & 768) / 256); - if (saved_bots & 32) BotConnect(0, 6, (saved_skills1 & 3072) / 1024); - if (saved_bots & 64) BotConnect(0, 7, (saved_skills1 & 12288) / 4096); - if (saved_bots & 128) BotConnect(0, 8, (saved_skills1 & 49152) / 16384); - if (saved_bots & 256) BotConnect(0, 9, saved_skills2 & 3); - if (saved_bots & 512) BotConnect(0, 10, (saved_skills2 & 12) / 4); - if (saved_bots & 1024) BotConnect(0, 11, (saved_skills2& 48) / 16); - if (saved_bots & 2048) BotConnect(0, 12, (saved_skills2 & 192) / 64); - if (saved_bots & 4096) BotConnect(0, 13, (saved_skills2 & 768) / 256); - if (saved_bots & 8192) BotConnect(0, 14, (saved_skills2 & 3072) / 1024); - if (saved_bots & 16384) BotConnect(0, 15, (saved_skills2 & 12288) / 4096); - if (saved_bots & 32768) BotConnect(0, 16, (saved_skills2 & 49152) / 16384); + if (saved_bots & 1) + BotConnect (0, 1, saved_skills1 & 3); + if (saved_bots & 2) + BotConnect (0, 2, (saved_skills1 & 12) / 4); + if (saved_bots & 4) + BotConnect (0, 3, (saved_skills1 & 48) / 16); + if (saved_bots & 8) + BotConnect (0, 4, (saved_skills1 & 192) / 64); + if (saved_bots & 16) + BotConnect (0, 5, (saved_skills1 & 768) / 256); + if (saved_bots & 32) + BotConnect (0, 6, (saved_skills1 & 3072) / 1024); + if (saved_bots & 64) + BotConnect (0, 7, (saved_skills1 & 12288) / 4096); + if (saved_bots & 128) + BotConnect (0, 8, (saved_skills1 & 49152) / 16384); + if (saved_bots & 256) + BotConnect (0, 9, saved_skills2 & 3); + if (saved_bots & 512) + BotConnect (0, 10, (saved_skills2 & 12) / 4); + if (saved_bots & 1024) + BotConnect (0, 11, (saved_skills2& 48) / 16); + if (saved_bots & 2048) + BotConnect (0, 12, (saved_skills2 & 192) / 64); + if (saved_bots & 4096) + BotConnect (0, 13, (saved_skills2 & 768) / 256); + if (saved_bots & 8192) + BotConnect (0, 14, (saved_skills2 & 3072) / 1024); + if (saved_bots & 16384) + BotConnect (0, 15, (saved_skills2 & 12288) / 4096); + if (saved_bots & 32768) + BotConnect (0, 16, (saved_skills2 & 49152) / 16384); saved_bots = 0; } } }; - void() WaypointWatch = { // Waypoint Baywatch @@ -1110,55 +1135,56 @@ void() WaypointWatch = if (max_clients < 2) return; if (waypoint_mode != WM_UNINIT) { - bigboobs = cvar("saved4"); + bigboobs = cvar ("saved4"); if (bigboobs != 0) { if ((bigboobs & 3) == 1) ClearAllWays(); else if ((bigboobs & 3) == 3) { - FixWaypoints(); - h = ftos(b_options); - cvar_set("saved1", h); - cvar_set("saved4", "0"); - cvar_set("scratch1", "0"); + FixWaypoints (); + h = ftos (b_options); + cvar_set ("saved1", h); + cvar_set ("saved4", "0"); + cvar_set ("scratch1", "0"); waypoint_mode = WM_LOADED; return; } - LoadWaypoint(); + LoadWaypoint (); waypoint_mode = WM_LOADING; - cvar_set("saved4", "0"); + cvar_set ("saved4", "0"); } } }; + void() BotFrame = { local float num; // for the sake of speed - sv_maxspeed = cvar("sv_maxspeed"); - sv_gravity = cvar("sv_gravity"); - sv_friction = cvar("sv_friction"); - sv_accelerate = cvar("sv_accelerate"); - sv_stopspeed = cvar("sv_stopspeed"); + sv_maxspeed = cvar ("sv_maxspeed"); + sv_gravity = cvar ("sv_gravity"); + sv_friction = cvar ("sv_friction"); + sv_accelerate = cvar ("sv_accelerate"); + sv_stopspeed = cvar ("sv_stopspeed"); real_frametime = frametime; // in NQ this is alright - - self = nextent(NIL); + + self = nextent (NIL); num = 0; while (num < max_clients) { if (self.ishuman == FALSE) { if (active_clients & ClientBitFlag(num)) { - frik_obstacles(); - CL_KeyMove(); - SV_ClientThink(); - SV_Physics_Client(); + frik_obstacles (); + CL_KeyMove (); + SV_ClientThink (); + SV_Physics_Client (); } } - self = nextent(self); - num = num + 1; + self = nextent (self); + num++; } - WaypointWatch(); + WaypointWatch (); if (saved_bots) - bot_return(); + bot_return (); }; /* @@ -1169,28 +1195,30 @@ related functions. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void() BotImpulses = { local float f; - if (self.impulse == 100) { - f = cvar("skill"); - BotConnect(0, 0, f); - } else if (self.impulse == 101) { - f = cvar("skill"); - BotConnect(1, 0, f); - } else if (self.impulse == 102) - KickABot(); - else if (self.impulse == 103) - botcam_u(); - else if (self.impulse == 104) + switch (self.impulse) { + case 100: + f = cvar ("skill"); + BotConnect (0, 0, f); + break; + case 101: + f = cvar ("skill"); + BotConnect (1, 0, f); + break; + case 102: + KickABot (); + break; + case 103: + botcam_u (); + break; + case 104: bot_way_edit(); - else + break; + default: return; - + } self.impulse = 0; }; - - - diff --git a/fbxa/bot_ai.qc b/fbxa/bot_ai.qc index df447b4..c7b7c94 100644 --- a/fbxa/bot_ai.qc +++ b/fbxa/bot_ai.qc @@ -53,7 +53,6 @@ checks to see if an entity is on the bot's stack -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - float(entity scot) target_onstack = { if (scot == NIL) @@ -80,13 +79,13 @@ LIFO stack, this will be the bot's new target1 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void(entity ent) target_add = { if (ent == NIL) return; - if (target_onstack(ent)) + if (target_onstack (ent)) return; + self.target4 = self.target3; self.target3 = self.target2; self.target2 = self.target1; @@ -94,7 +93,6 @@ void(entity ent) target_add = self.search_time = time + 5; }; - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -108,26 +106,29 @@ is gone too. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void(entity ent) target_drop = { - local float tg; - - tg = target_onstack(ent); - if (tg == 1) { + switch (target_onstack (ent)) { + case 1: self.target1 = self.target2; self.target2 = self.target3; self.target3 = self.target4; self.target4 = NIL; - } else if (tg == 2) { + break; + case 2: self.target1 = self.target3; self.target2 = self.target4; self.target3 = self.target4 = NIL; - } else if (tg == 3) { + break; + case 3: self.target1 = self.target4; self.target2 = self.target3 = self.target4 = NIL; - } else if (tg == 4) + break; + case 4: self.target1 = self.target2 = self.target3 = self.target4 = NIL; + default: + break; + } self.search_time = time + 5; }; @@ -140,7 +141,6 @@ Bot has lost its target. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void(entity targ, float success) bot_lost = { if (!targ) @@ -148,18 +148,18 @@ void(entity targ, float success) bot_lost = target_drop(targ); if (targ.classname == "waypoint") - targ.b_sound = targ.b_sound - (targ.b_sound & ClientBitFlag(self.b_clientno)); + targ.b_sound &= ~(ClientBitFlag (self.b_clientno)); // find a new route if (!success) { self.target1 = self.target2 = self.target3 = self.target4 = NIL; - self.last_way = FindWayPoint(self.current_way); - ClearMyRoute(); + self.last_way = FindWayPoint (self.current_way); + ClearMyRoute (); self.b_aiflags = 0; } else { if (targ.classname == "item_artifact_invisibility") if (self.items & 524288) - bot_start_topic(3); + bot_start_topic (3); if (targ.flags & FL_ITEM) { if (!targ.model) @@ -169,7 +169,6 @@ void(entity targ, float success) bot_lost = } } - if (targ.classname != "player") targ.search_time = time + 5; }; @@ -187,73 +186,73 @@ removed. void(entity targ) bot_check_lost = { local vector dist; - dist = realorigin(targ) - self.origin; + + dist = realorigin (targ) - self.origin; dist_z = 0; + if (targ == NIL) return; // waypoints and items are lost if you get close enough to them - - else if (targ.flags & FL_ITEM) { - if (vlen(targ.origin - self.origin) < 32) - bot_lost(targ, TRUE); + if (targ.flags & FL_ITEM) { + if (vlen (targ.origin - self.origin) < 32) + bot_lost (targ, TRUE); else if (!targ.model) - bot_lost(targ, TRUE); + bot_lost (targ, TRUE); } else if (targ.classname == "waypoint") { if (!(self.b_aiflags & (AI_SNIPER | AI_AMBUSH))) { if (self.b_aiflags & AI_RIDE_TRAIN) { - if (vlen(targ.origin - self.origin) < 48) - bot_lost(targ, TRUE); + if (vlen (targ.origin - self.origin) < 48) + bot_lost (targ, TRUE); } else if (self.b_aiflags & AI_PRECISION) { - if (vlen(targ.origin - self.origin) < 24) - bot_lost(targ, TRUE); - } else if (vlen(targ.origin - self.origin) < 32) - bot_lost(targ, TRUE); + if (vlen (targ.origin - self.origin) < 24) + bot_lost (targ, TRUE); + } else if (vlen (targ.origin - self.origin) < 32) + bot_lost (targ, TRUE); } } else if (targ.classname == "temp_waypoint") { - if (vlen(targ.origin - self.origin) < 32) - bot_lost(targ, TRUE); + if (vlen (targ.origin - self.origin) < 32) + bot_lost (targ, TRUE); } else if (targ.classname == "player") { if (targ.health <= 0) - bot_lost(targ, TRUE); + bot_lost (targ, TRUE); else if ((coop) || (teamplay && targ.team == self.team)) { if (targ.target1.classname == "player") { if (!targ.target1.ishuman) - bot_lost(targ, TRUE); + bot_lost (targ, TRUE); } else if (targ.teleport_time > time) { // try not to telefrag teammates - self.keys = self.keys & 960; - } else if (vlen(targ.origin - self.origin) < 128) { - if (vlen(targ.origin - self.origin) < 48) - frik_walkmove(self.origin - targ.origin); + self.keys &= 960; + } else if (vlen (targ.origin - self.origin) < 128) { + if (vlen (targ.origin - self.origin) < 48) + frik_walkmove (self.origin - targ.origin); else { - self.keys = self.keys & 960; - bot_start_topic(4); + self.keys &= 960; + bot_start_topic (4); } self.search_time = time + 5; // never time out } else if (!fisible(targ)) - bot_lost(targ, FALSE); + bot_lost (targ, FALSE); } else if (waypoint_mode > WM_LOADED) { - if (vlen(targ.origin - self.origin) < 128) { - bot_lost(targ, TRUE); + if (vlen (targ.origin - self.origin) < 128) { + bot_lost (targ, TRUE); } } } else if (targ.classname == "func_button") { // buttons are lost of their frame changes if (targ.frame) { - bot_lost(targ, TRUE); + bot_lost (targ, TRUE); if (self.enemy == targ) self.enemy = NIL; - //if (self.target1) - // bot_get_path(self.target1, TRUE); - +// if (self.target1) +// bot_get_path (self.target1, TRUE); } } else if ((targ.movetype == MOVETYPE_NONE) && (targ.solid == SOLID_TRIGGER)) { // trigger_multiple style triggers are lost if their thinktime changes if (targ.nextthink >= time) { - bot_lost(targ, TRUE); - //if (self.target1) - // bot_get_path(self.target1, TRUE); + bot_lost (targ, TRUE); +// if (self.target1) +// bot_get_path (self.target1, TRUE); } } // lose any target way above the bot's head @@ -261,20 +260,19 @@ void(entity targ) bot_check_lost = if ((targ.origin_z - self.origin_z) > 64) { dist = targ.origin - self.origin; dist_z = 0; - if (vlen(dist) < 32) + if (vlen (dist) < 32) if (self.flags & FL_ONGROUND) - if(!frik_recognize_plat(FALSE)) - bot_lost(targ, FALSE); + if (!frik_recognize_plat (FALSE)) + bot_lost (targ, FALSE); } else if (targ.classname == "train") { - if (frik_recognize_plat(FALSE)) - bot_lost(targ, TRUE); + if (frik_recognize_plat (FALSE)) + bot_lost (targ, TRUE); } // targets are lost if the bot's search time has expired if (time > self.search_time) - bot_lost(targ, FALSE); + bot_lost (targ, FALSE); }; - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -285,7 +283,6 @@ based b_aiflags. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void() bot_handle_ai = { local entity newt; @@ -297,36 +294,36 @@ void() bot_handle_ai = // wait is used by the ai to stop the bot until his search time expires / or route changes if (self.b_aiflags & AI_WAIT) - self.keys = self.keys & 960; + self.keys &= 960; if (self.b_aiflags & AI_DOORFLAG) { // was on a door when spawned b_temp3 = self; self = self.last_way; // if there is nothing there now - if (!frik_recognize_plat(FALSE)) { - newt = FindThing("door"); // this is likely the door responsible (crossfingers) + if (!frik_recognize_plat (FALSE)) { + newt = FindThing ("door"); // this is likely the door responsible (crossfingers) self = b_temp3; if (self.b_aiflags & AI_DOOR_NO_OPEN) { if (newt.nextthink) - self.keys = self.keys & 960; // wait until it closes + self.keys &= 960; // wait until it closes else { - bot_lost(self.last_way, FALSE); + bot_lost (self.last_way, FALSE); } } else { if (newt.targetname) { - newt = find(NIL, target, newt.targetname); + newt = find (NIL, target, newt.targetname); if (newt.health > 0) { self.enemy = newt; - bot_weapon_switch(1); + bot_weapon_switch (1); } else { - // target_drop(self.last_way); - target_add(newt); - // bot_get_path(newt, TRUE); + // target_drop (self.last_way); + target_add (newt); + // bot_get_path (newt, TRUE); } } - self.b_aiflags = self.b_aiflags - AI_DOORFLAG; + self.b_aiflags &= ~AI_DOORFLAG; } } else self = b_temp3; @@ -334,21 +331,20 @@ void() bot_handle_ai = if (self.b_aiflags & AI_JUMP) { if (self.flags & FL_ONGROUND) { - bot_jump(); - self.b_aiflags = self.b_aiflags - AI_JUMP; + bot_jump (); + self.b_aiflags &= ~AI_JUMP; } } else if (self.b_aiflags & AI_SUPER_JUMP) { if (self.weapon != 32) self.impulse = 7; else if (self.flags & FL_ONGROUND) { - self.b_aiflags = self.b_aiflags - AI_SUPER_JUMP; - if (bot_can_rj(self)) { - bot_jump(); + self.b_aiflags &= ~AI_SUPER_JUMP; + if (bot_can_rj (self)) { + bot_jump (); self.v_angle_x = self.b_angle_x = 80; self.button0 = TRUE; } else - bot_lost(self.target1, FALSE); - + bot_lost (self.target1, FALSE); } } if (self.b_aiflags & AI_SURFACE) { @@ -356,7 +352,7 @@ void() bot_handle_ai = self.keys = KEY_MOVEUP; self.button2 = TRUE; // swim! } else - self.b_aiflags = self.b_aiflags - AI_SURFACE; + self.b_aiflags &= ~AI_SURFACE; } if (self.b_aiflags & AI_RIDE_TRAIN) { // simple, but effective @@ -364,54 +360,53 @@ void() bot_handle_ai = // things, not just trains (door elevators come to mind) b_temp3 = self; self = self.last_way; - + if (!frik_recognize_plat(FALSE)) { // if there is nothing there now self = b_temp3; - self.keys = self.keys & 960; + self.keys &= 960; } else { self = b_temp3; - if (frik_recognize_plat(FALSE)) { - v = realorigin(trace_ent) + trace_ent.origin - self.origin; + if (frik_recognize_plat (FALSE)) { + v = realorigin (trace_ent) + trace_ent.origin - self.origin; v_z = 0; - if (vlen(v) < 24) - self.keys = self.keys & 960; + if (vlen (v) < 24) + self.keys &= 960; else { - self.b_aiflags = self.b_aiflags | AI_PRECISION; - self.keys = frik_KeysForDir(v); + self.b_aiflags |= AI_PRECISION; + self.keys = frik_KeysForDir (v); } } } } if (self.b_aiflags & AI_PLAT_BOTTOM) { - newt = FindThing("plat"); + newt = FindThing ("plat"); if (newt.state != 1) { - v = self.origin - realorigin(newt); + v = self.origin - realorigin (newt); v_z = 0; - if (vlen(v) > 96) - self.keys = self.keys & 960; + if (vlen (v) > 96) + self.keys &= 960; else - frik_walkmove(v); + frik_walkmove (v); } else - self.b_aiflags = self.b_aiflags - AI_PLAT_BOTTOM; + self.b_aiflags &= ~AI_PLAT_BOTTOM; } if (self.b_aiflags & AI_DIRECTIONAL) { - if ((normalize(self.last_way.origin - self.origin) * self.b_dir) > 0.4) { - self.b_aiflags = self.b_aiflags - AI_DIRECTIONAL; - bot_lost(self.target1, TRUE); + if ((normalize (self.last_way.origin - self.origin) * self.b_dir) > 0.4) { + self.b_aiflags &= ~AI_DIRECTIONAL; + bot_lost (self.target1, TRUE); } } if (self.b_aiflags & AI_SNIPER) { - self.b_aiflags = (self.b_aiflags | AI_WAIT | AI_PRECISION) - AI_SNIPER; + self.b_aiflags |= AI_WAIT | AI_PRECISION | AI_SNIPER; // FIXME: Add a switch to wep command // FIXME: increase delay? } if (self.b_aiflags & AI_AMBUSH) { - self.b_aiflags = (self.b_aiflags | AI_WAIT) - AI_AMBUSH; + self.b_aiflags |= AI_WAIT | AI_AMBUSH; // FIXME: Add a switch to wep command // FIXME: increase delay? } - }; /* @@ -432,21 +427,21 @@ void() bot_path = local entity jj, tele; - bot_check_lost(self.target1); + bot_check_lost (self.target1); if (!self.target1) { self.keys=0; return; } - if (target_onstack(self.last_way)) + if (target_onstack (self.last_way)) return; // old waypoint still being hunted - jj = FindRoute(self.last_way); + jj = FindRoute (self.last_way); if (!jj) { // this is an ugly hack if (self.target1.current_way != self.last_way) { if (self.target1.classname != "temp_waypoint") if (self.target1.classname != "player") - bot_lost(self.target1, FALSE); + bot_lost (self.target1, FALSE); } return; @@ -458,14 +453,14 @@ void() bot_path = // point types are AI flags that should be executed once reaching a waypoint self.b_aiflags = (jj.b_aiflags & AI_READAHEAD_TYPES) | (self.last_way.b_aiflags & AI_POINT_TYPES); - target_add(jj); + target_add (jj); if (self.last_way) { - if (CheckLinked(self.last_way, jj) == 2) { + if (CheckLinked (self.last_way, jj) == 2) { // waypoints are telelinked - tele = FindThing("trigger_teleport"); // this is probbly the teleport responsible - target_add(tele); + tele = FindThing ("trigger_teleport"); // this is probbly the teleport responsible + target_add (tele); } - traceline(self.last_way.origin, jj.origin, FALSE, self); // check for blockage + traceline (self.last_way.origin, jj.origin, FALSE, self); // check for blockage if (trace_fraction != 1) { if (trace_ent.classname == "door" && !(self.b_aiflags & AI_DOOR_NO_OPEN)) { // a door blocks the way @@ -474,35 +469,34 @@ void() bot_path = trace_ent = trace_ent.owner; if ((trace_ent.health > 0) && (self.enemy == NIL)) { self.enemy = trace_ent; - bot_weapon_switch(1); + bot_weapon_switch (1); self.b_aiflags = self.b_aiflags | AI_BLIND; // nick knack paddy hack } else if (trace_ent.targetname) { - tele = find(NIL, target, trace_ent.targetname); + tele = find (NIL, target, trace_ent.targetname); if (tele.health > 0) { self.enemy = tele; - bot_weapon_switch(1); + bot_weapon_switch (1); } else { - // target_drop(jj); - target_add(tele); - // bot_get_path(tele, TRUE); - self.b_aiflags = self.b_aiflags | AI_BLIND; // give a bot a bone +// target_drop (jj); + target_add (tele); +// bot_get_path (tele, TRUE); + self.b_aiflags |= AI_BLIND; // give a bot a bone return; } } } else if (trace_ent.classname == "func_wall") { // give up - bot_lost(self.target1, FALSE); + bot_lost (self.target1, FALSE); return; } } } // this is used for AI_DRIECTIONAL - self.b_dir = normalize(jj.origin - self.last_way.origin); + self.b_dir = normalize (jj.origin - self.last_way.origin); self.last_way = jj; }; - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -522,13 +516,13 @@ the bot finds things it wants to kill/grab. float(entity thing) priority_for_thing = { local float thisp; + thisp = 0; // This is the most executed function in the bot. Careful what you do here. - if ((thing.flags & FL_ITEM) && thing.model && thing.search_time < time) { // ugly hack - if (thing._last != self) - thisp = 20; + if (thing._last != self) + thisp = 20; if (thing.classname == "item_artifact_super_damage") thisp = 65; else if (thing.classname == "item_artifact_invulnerability") @@ -592,7 +586,7 @@ float(entity thing) priority_for_thing = else if (thing.b_aiflags & AI_AMBUSH) thisp = 30; } - if (pointcontents(thing.origin) < -3) + if (pointcontents (thing.origin) < -3) return 0; if (thisp) { if (thing.current_way) { @@ -600,8 +594,7 @@ float(entity thing) priority_for_thing = if (thing.current_way.items == -1) return 0; else - thisp = thisp + (13000 - thing.current_way.items) * 0.05; - + thisp += (13000 - thing.current_way.items) * 0.05; } } return thisp; @@ -613,36 +606,35 @@ void(float scope) bot_look_for_crap = local float thatp, bestp, dist; if (scope == 1) - foe = findradius(self.origin, 13000); + foe = findradius (self.origin, 13000); else - foe = findradius(self.origin, 500); + foe = findradius (self.origin, 500); bestp = 1; - while(foe) { - thatp = priority_for_thing(foe); + while (foe) { + thatp = priority_for_thing (foe); if (thatp) if (!scope) - if (!sisible(foe)) + if (!sisible (foe)) thatp = 0; if (thatp > bestp) { bestp = thatp; best = foe; - dist = vlen(self.origin - foe.origin); + dist = vlen (self.origin - foe.origin); } foe = foe.chain; } if (best == NIL) return; - if (!target_onstack(best)) { - target_add(best); + if (!target_onstack (best)) { + target_add (best); if (scope) { - bot_get_path(best, FALSE); - self.b_aiflags = self.b_aiflags | AI_WAIT; + bot_get_path (best, FALSE); + self.b_aiflags |= AI_WAIT; } } }; - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -654,7 +646,6 @@ generally making the bot look good. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - void() bot_angle_set = { local float h; @@ -662,38 +653,38 @@ void() bot_angle_set = if (self.enemy) { if (self.enemy.items & 524288) - if (random() > 0.2) + if (random () > 0.2) return; if (self.missile_speed == 0) self.missile_speed = 10000; if (self.enemy.solid == SOLID_BSP) { view = (((self.enemy.absmin + self.enemy.absmax) * 0.5) - self.origin); } else { - h = vlen(self.enemy.origin - self.origin) / self.missile_speed; + h = vlen (self.enemy.origin - self.origin) / self.missile_speed; if (self.enemy.flags & FL_ONGROUND) view = self.enemy.velocity * h; else view = (self.enemy.velocity - (sv_gravity * '0 0 1') * h) * h; view = self.enemy.origin + view; // FIXME: ? - traceline(self.enemy.origin, view, FALSE, self); + traceline (self.enemy.origin, view, FALSE, self); view = trace_endpos; if (self.weapon == 32) view = view - '0 0 22'; - view = normalize(view - self.origin); + view = normalize (view - self.origin); } - view = vectoangles(view); + view = vectoangles (view); view_x = view_x * -1; self.b_angle = view; } else if (self.target1) { - view = realorigin(self.target1); + view = realorigin (self.target1); if (self.target1.flags & FL_ITEM) view = view + '0 0 48'; - view = view - (self.origin + self.view_ofs); - view = vectoangles(view); - view_x = view_x * -1; + view -= (self.origin + self.view_ofs); + view = vectoangles (view); + view_x *= -1; self.b_angle = view; } else self.b_angle_x = 0; @@ -704,31 +695,30 @@ void() bot_angle_set = self.keys = self.keys & 63; self.v_angle = self.b_angle; while (self.v_angle_x < -180) - self.v_angle_x = self.v_angle_x + 360; + self.v_angle_x += 360; while (self.v_angle_x > 180) - self.v_angle_x = self.v_angle_x - 360; - + self.v_angle_x -= 360; } else if ((self.enemy == NIL || self.enemy.movetype == MOVETYPE_PUSH) && self.target1.classname != "player") { self.keys = self.keys & 63; self.v_angle = self.b_angle; while (self.v_angle_x < -180) - self.v_angle_x = self.v_angle_x + 360; + self.v_angle_x += 360; while (self.v_angle_x > 180) - self.v_angle_x = self.v_angle_x - 360; + self.v_angle_x -= 360; } else if (self.b_skill < 2) { // skill 2 handled in bot_phys if (self.b_angle_x > 180) - self.b_angle_x = self.b_angle_x - 360; + self.b_angle_x -= 360; self.keys = self.keys & 63; - if (angcomp(self.b_angle_y, self.v_angle_y) > 10) - self.keys = self.keys | KEY_LOOKLEFT; + if (angcomp (self.b_angle_y, self.v_angle_y) > 10) + self.keys = KEY_LOOKLEFT; else if (angcomp(self.b_angle_y, self.v_angle_y) < -10) - self.keys = self.keys | KEY_LOOKRIGHT; + self.keys |= KEY_LOOKRIGHT; if (angcomp(self.b_angle_x, self.v_angle_x) < -10) - self.keys = self.keys | KEY_LOOKUP; - else if (angcomp(self.b_angle_x, self.v_angle_x) > 10) - self.keys = self.keys | KEY_LOOKDOWN; + self.keys |= KEY_LOOKUP; + else if (angcomp (self.b_angle_x, self.v_angle_x) > 10) + self.keys |= KEY_LOOKDOWN; } }; @@ -751,11 +741,11 @@ void() BotAI = // status bars, and the mod probably already compensated for that if (self.health < 1) { - self.button0 = floor(random() * 2); + self.button0 = floor (random() * 2); self.button2 = 0; self.keys = 0; self.b_aiflags = 0; - ClearMyRoute(); + ClearMyRoute (); self.target1 = self.target2 = self.target3 = self.target4 = self.enemy = NIL; self.last_way = NIL; return; @@ -770,19 +760,17 @@ void() BotAI = self.ai_time = time + 0.05; if (bot_count > 0) { if ((time - stagger_think) < (0.1 / bot_count)) - self.ai_time = self.ai_time + 0.1 / (2 * bot_count); + self.ai_time += 0.1 / (2 * bot_count); } else return; } if (self.view_ofs == '0 0 0') - bot_start_topic(7); + bot_start_topic (7); stagger_think = time; // shut the bot's buttons off, various functions will turn them on by AI end - self.button2 = 0; self.button0 = 0; - // target1 is like goalentity in normal Quake monster AI. // it's the bot's most immediate target @@ -794,15 +782,15 @@ void() BotAI = self.b_aiflags = 0; self.keys = 0; } else if (self.target1) { - frik_movetogoal(); - bot_path(); + frik_movetogoal (); + bot_path (); } else { if (waypoint_mode < WM_EDITOR) { - if(self.route_failed) { + if (self.route_failed) { frik_bot_roam(); self.route_failed = 0; - } else if(!begin_route()) { - bot_look_for_crap(FALSE); + } else if (!begin_route()) { + bot_look_for_crap (FALSE); } self.keys = 0; } else { @@ -812,24 +800,23 @@ void() BotAI = } // bot_angle_set points the bot at it's goal (self.enemy or target1) + bot_angle_set (); - bot_angle_set(); - - // fight my enemy. Enemy is probably a field QC coders will most likely use a lot - // for their own needs, since it's unused on a normal player + // fight my enemy. Enemy is probably a field QC coders will most likely + // use a lot for their own needs, since it's unused on a normal player // FIXME if (self.enemy) - bot_fight_style(); - else if (random() < 0.2) - if (random() < 0.2) - bot_weapon_switch(-1); - bot_dodge_stuff(); + bot_fight_style (); + else if (random () < 0.2) + if (random () < 0.2) + bot_weapon_switch (-1); + bot_dodge_stuff (); // checks to see if bot needs to start going up for air if (self.waterlevel > 2) { if (time > (self.air_finished - 2)) { traceline (self.origin, self.origin + '0 0 6800', TRUE, self); - if (trace_inopen) { + if (trace_inopen) { self.keys = KEY_MOVEUP; self.button2 = TRUE; // swim! return; // skip ai flags for now - this is life or death @@ -838,10 +825,8 @@ void() BotAI = } // b_aiflags handling - - if (self.b_aiflags) - bot_handle_ai(); + bot_handle_ai (); else - bot_chat(); // don't want chat to screw him up if he's rjing or something + bot_chat (); // don't want chat to screw him up if he's rjing or something }; diff --git a/fbxa/bot_ed.qc b/fbxa/bot_ed.qc index ce4c6ee..5dd7a91 100644 --- a/fbxa/bot_ed.qc +++ b/fbxa/bot_ed.qc @@ -6,7 +6,6 @@ ***********************************************/ /* - This program is in the Public Domain. My crack legal team would like to add: @@ -39,7 +38,6 @@ with applicable reexport restrictions. Any reproduction of this software must contain this notice in its entirety. - */ #include "libfrikbot.h" @@ -63,9 +61,9 @@ float MENU_WAYLIST = 7; // 14 = Teleport to way // 15 = confirmation of delete point -void() BSPDumpWaypoints; -void() QCDumpWaypoints; -void() DumpWaypoints; +void () BSPDumpWaypoints; +void () QCDumpWaypoints; +void () DumpWaypoints; /* // source for the menu strings... @@ -157,58 +155,68 @@ void() DumpWaypoints; [8] [#] QC output \n [9] [#] BSP ents output \n [0] Main Menu \n - */ -void() bot_menu_display = +void () +bot_menu_display = { -// build options + // build options local string s1, s2, s3, s4, s5, s6, s7, h; local entity t; -// check impulses + // check impulses if (self.impulse > 0 && self.impulse < 11 && self.b_menu) { if (self.b_menu == MENU_MAIN) { - if (self.impulse == 1) { + switch (self.impulse) { + case 1: self.b_menu = MENU_WAYPOINTS; self.b_menu_time = time; + break; } else if (self.impulse == 2) { self.b_menu = MENU_LINKS; self.b_menu_time = time; + break; } else if (self.impulse == 3) { self.b_menu = MENU_FLAGS; self.b_menu_time = time; + break; } else if (self.impulse == 4) { self.b_menu = MENU_BOTS; self.b_menu_time = time; + break; } else if (self.impulse == 5) { self.b_menu = MENU_WAYLIST; self.b_menu_time = time; + break; } else if (self.impulse == 6) { if (self.movetype == MOVETYPE_NOCLIP) self.movetype = MOVETYPE_WALK; else self.movetype = MOVETYPE_NOCLIP; self.b_menu_time = time; - + break; } else if (self.impulse == 7) { if (self.flags & FL_GODMODE) - self.flags = self.flags - FL_GODMODE; + self.flags &= ~FL_GODMODE; else - self.flags = self.flags | FL_GODMODE; + self.flags |= FL_GODMODE; self.b_menu_time = time; - - } else if (self.impulse == 8) { + break; + case 8: if (self.b_aiflags & AI_HOLD_SELECT) - self.b_aiflags = self.b_aiflags - AI_HOLD_SELECT; + self.b_aiflags &= ~AI_HOLD_SELECT; else - self.b_aiflags = self.b_aiflags | AI_HOLD_SELECT; + self.b_aiflags |= AI_HOLD_SELECT; self.b_menu_time = time; - } else if (self.impulse == 9) { + break; + case 9: self.b_menu = 14; self.b_menu_time = time; - } else if (self.impulse == 10) - bot_way_edit(); + break; + case 10: + bot_way_edit (); + break; + } } else if (self.b_menu == MENU_WAYPOINTS) { if (self.impulse == 1) { if (self.current_way) @@ -219,75 +227,82 @@ void() bot_menu_display = self.b_menu_time = time; self.last_way = self.current_way; } - } else if (self.impulse == 3) { - make_waypoint(self.origin + self.view_ofs); - } else if (self.impulse == 4) { - t = make_waypoint(self.origin + self.view_ofs); - if (!LinkWays(self.current_way, t)) - sprint(self, "Unable to link them\n"); - } else if (self.impulse == 5) { - t = make_waypoint(self.origin + self.view_ofs); - if (!LinkWays(self.current_way, t)) - sprint(self, "Unable to link old to new\n"); - LinkWays(t, self.current_way); - } else if (self.impulse == 6) { - t = make_waypoint(self.origin + self.view_ofs); - if (!TeleLinkWays(self.current_way, t)) - sprint(self, "Unable to link them\n"); - } else if (self.impulse == 7) { + case 3: + make_waypoint (self.origin + self.view_ofs); + break; + case 4: + t = make_waypoint (self.origin + self.view_ofs); + if (!LinkWays (self.current_way, t)) + sprint (self, "Unable to link them\n"); + break; + case 5: + t = make_waypoint (self.origin + self.view_ofs); + if (!LinkWays (self.current_way, t)) + sprint (self, "Unable to link old to new\n"); + LinkWays (t, self.current_way); + break; + case 6: + t = make_waypoint (self.origin + self.view_ofs); + if (!TeleLinkWays (self.current_way, t)) + sprint (self, "Unable to link them\n"); + break; + case 7: if (self.current_way) { - sprint(self, "\nwaypoint info for waypoint #"); - h = ftos(self.current_way.count); - sprint(self, h); - sprint(self, "\nAI Flag value: "); - h = ftos(self.current_way.b_aiflags); - sprint(self, h); + sprint (self, "\nwaypoint info for waypoint #"); + h = ftos (self.current_way.count); + sprint (self, h); + sprint (self, "\nAI Flag value: "); + h = ftos (self.current_way.b_aiflags); + sprint (self, h); if (self.current_way.target1) { - h = ftos(self.current_way.target1.count); + h = ftos (self.current_way.target1.count); if (self.current_way.b_aiflags & AI_TELELINK_1) - sprint(self, "\nTelelink1 to:"); + sprint (self, "\nTelelink1 to:"); else - sprint(self, "\nLink1 to:"); - sprint(self, h); + sprint (self, "\nLink1 to:"); + sprint (self, h); } if (self.current_way.target2) { - h = ftos(self.current_way.target2.count); + h = ftos (self.current_way.target2.count); if (self.current_way.b_aiflags & AI_TELELINK_2) - sprint(self, "\nTelelink2 to:"); + sprint (self, "\nTelelink2 to:"); else - sprint(self, "\nLink2 to:"); - sprint(self, h); + sprint (self, "\nLink2 to:"); + sprint (self, h); } if (self.current_way.target3) { - h = ftos(self.current_way.target3.count); + h = ftos (self.current_way.target3.count); if (self.current_way.b_aiflags & AI_TELELINK_3) - sprint(self, "\nTelelink3 to:"); + sprint (self, "\nTelelink3 to:"); else - sprint(self, "\nLink3 to:"); - sprint(self, h); + sprint (self, "\nLink3 to:"); + sprint (self, h); } if (self.current_way.target4) { - h = ftos(self.current_way.target4.count); + h = ftos (self.current_way.target4.count); if (self.current_way.b_aiflags & AI_TELELINK_4) - sprint(self, "\nTelelink4 to:"); + sprint (self, "\nTelelink4 to:"); else - sprint(self, "\nLink4 to:"); - sprint(self, h); + sprint (self, "\nLink4 to:"); + sprint (self, h); } - sprint(self, "\n\n"); + sprint (self, "\n\n"); } - - } - if (self.impulse == 8) { + break; + case 8: self.b_menu = MENU_LINKS; self.b_menu_time = time; - } else if (self.impulse == 9) { + break; + case 9: self.b_menu = MENU_FLAGS; self.b_menu_time = time; - } else if (self.impulse == 10) { + break; + case 10: self.b_menu = MENU_MAIN; self.b_menu_time = time; + default: + break; } } else if (self.b_menu == MENU_LINKS) { if (self.impulse == 1) { @@ -762,19 +777,20 @@ void() bot_menu_display = } }; - // engage menu -void() bot_way_edit = +void () +bot_way_edit = { local entity t; local float f; + if (self.b_menu_value) { if (self.b_menu == 14) { - t = WaypointForNum(self.b_menu_value); + t = WaypointForNum (self.b_menu_value); if (t) - setorigin(self, t.origin - self.view_ofs); + setorigin (self, t.origin - self.view_ofs); else - sprint(self, "No waypoint with that number\n"); + sprint (self, "No waypoint with that number\n"); self.b_menu = MENU_MAIN; self.b_menu_time = time; @@ -786,40 +802,40 @@ void() bot_way_edit = self.b_menu = MENU_MAIN; waypoint_mode = WM_EDITOR; self.b_menu_time = 0; - cvar_set("saved2", "0"); - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n"); - localcmd("cmdline\n"); + cvar_set ("saved2", "0"); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 1); + WriteString (MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS " + "-CONDEBUG BEFORE PROCEEDING\n"); + localcmd ("cmdline\n"); t = way_head; while (t) { - setmodel(t, "progs/s_bubble.spr"); // show the waypoints + setmodel (t, "progs/s_bubble.spr"); // show the waypoints t = t._next; } if (self.current_way) - setmodel(self.current_way, "progs/s_light.spr"); + setmodel (self.current_way, "progs/s_light.spr"); } else { - saved2 = cvar("saved2"); + saved2 = cvar ("saved2"); if (saved2 != 0) { f = self.b_menu; - self.b_menu = floor(saved2/16); + self.b_menu = floor (saved2 / 16); self.impulse = saved2 & 15; - bot_menu_display(); + bot_menu_display (); self.b_menu = f; - cvar_set("saved2", "0"); + cvar_set ("saved2", "0"); return; } self.b_menu = 0; waypoint_mode = WM_LOADED; t = way_head; while (t) { - setmodel(t, string_null); // hide the waypoints + setmodel (t, string_null); // hide the waypoints t = t._next; } } }; - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -828,14 +844,14 @@ Waypoint Saving to file. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - // bytecount is really iffy // since there is no true way to determine the length of an ftos // it uses an approximate of 5 // various other things are guesses, but I don't cut it at the absolute // max so it should be okay -void() PrintWaypoint = +void () +PrintWaypoint = { local entity t; local float needcolon; @@ -846,136 +862,138 @@ void() PrintWaypoint = else t = self.enemy._next; if (bytecounter >= 8000) { - bprint("exec maps/"); - bprint(mapname); - bprint(".wa"); - h = ftos(filecount); - bprint(h); - filecount = filecount + 1; - bprint("\n// **** break here **** \n"); + bprint ("exec maps/"); + bprint (mapname); + bprint (".wa"); + h = ftos (filecount); + bprint (h); + filecount++; + bprint ("\n// **** break here **** \n"); bytecounter = 26; } if (t == NIL) { - remove(self); + remove (self); fixer = NIL; bprint("saved4 3\n// end waypoint dump\n"); - bytecounter = bytecounter + 27; + bytecounter += 27; return; } if ((t.origin_x != saved1) || (t.count == 1)) { - bprint("saved1 "); - h = ftos(t.origin_x); - bprint(h); + bprint ("saved1 "); + h = ftos (t.origin_x); + bprint (h); saved1 = t.origin_x; - bytecounter = bytecounter + 12; + bytecounter += 12; needcolon = TRUE; } if ((t.origin_y != saved2) || (t.count == 1)) { if (needcolon) { - bprint("; "); - bytecounter = bytecounter + 2; + bprint ("; "); + bytecounter += 2; } else needcolon = TRUE; - bprint("saved2 "); - h = ftos(t.origin_y); - bprint(h); - bytecounter = bytecounter + 12; + bprint ("saved2 "); + h = ftos (t.origin_y); + bprint (h); + bytecounter += 12; saved2 = t.origin_y; } if ((t.origin_z != saved3) || (t.count == 1)) { if (needcolon) { - bprint("; "); - bytecounter = bytecounter + 2; + bprint ("; "); + bytecounter += 2; } else needcolon = TRUE; - bprint("saved3 "); - h = ftos(t.origin_z); - bprint(h); - bytecounter = bytecounter + 12; + bprint ("saved3 "); + h = ftos (t.origin_z); + bprint (h); + bytecounter += 12; saved3 = t.origin_z; } - bytecounter = bytecounter + 1; - bprint("\n"); + bytecounter++; + bprint ("\n"); needcolon = FALSE; if ((scratch1 != t.target1.count) || t.count == 1) { needcolon = TRUE; - bprint("scratch1 "); - bytecounter = bytecounter + 14; - h = ftos(t.target1.count); - bprint(h); + bprint ("scratch1 "); + bytecounter += 14; + h = ftos (t.target1.count); + bprint (h); scratch1 = t.target1.count; } if ((scratch2 != t.target2.count) || t.count == 1) { if (needcolon) { - bprint("; "); - bytecounter = bytecounter + 2; + bprint ("; "); + bytecounter += 2; } else needcolon = TRUE; - bprint("scratch2 "); - bytecounter = bytecounter + 14; - h = ftos(t.target2.count); - bprint(h); + bprint ("scratch2 "); + bytecounter += 14; + h = ftos (t.target2.count); + bprint (h); scratch2 = t.target2.count; } if ((scratch3 != t.target3.count) || t.count == 1) { if (needcolon) { - bprint("; "); - bytecounter = bytecounter + 2; + bprint ("; "); + bytecounter += 2; } else needcolon = TRUE; - bprint("scratch3 "); - bytecounter = bytecounter + 14; - h = ftos(t.target3.count); - bprint(h); + bprint ("scratch3 "); + bytecounter += 14; + h = ftos (t.target3.count); + bprint (h); scratch3 = t.target3.count; } if ((scratch4 != t.target4.count) || t.count == 1) { if (needcolon) { - bprint("; "); + bprint ("; "); bytecounter = bytecounter + 2; } else needcolon = TRUE; - bprint("scratch4 "); + bprint ("scratch4 "); bytecounter = bytecounter + 14; - h = ftos(t.target4.count); - bprint(h); + h = ftos (t.target4.count); + bprint (h); scratch4 = t.target4.count; } - bprint("\nsaved4 "); - bytecounter = bytecounter + 19; + bprint ("\nsaved4 "); + bytecounter += 19; if (t.count != 1) - h = ftos(t.b_aiflags * 4 + 2); + h = ftos (t.b_aiflags * 4 + 2); else - h = ftos(t.b_aiflags * 4 + 1); - bprint(h); + h = ftos (t.b_aiflags * 4 + 1); + bprint (h); bprint ("; wait\n"); self.nextthink = time + 0.01; self.enemy = t; }; // to allow for 100+ waypoints, we need to trick the runaway loop counter -void() DumpWaypoints = +void () +DumpWaypoints = { bytecounter = 50; filecount = 1; - bprint("// "); - bprint(world.message); - bprint("- maps/"); - bprint(mapname); - bprint(".way\n"); - bprint("// Ways by "); - bprint(self.netname); - bprint("\n"); + bprint ("// "); + bprint (world.message); + bprint ("- maps/"); + bprint (mapname); + bprint (".way\n"); + bprint ("// Ways by "); + bprint (self.netname); + bprint ("\n"); if (!fixer) { - fixer = spawn(); + fixer = spawn (); fixer.nextthink = time + 0.01; fixer.think = PrintWaypoint; fixer.enemy = NIL; } }; -void() PrintQCWaypoint = +void () +PrintQCWaypoint = { local entity t; local string h; @@ -986,58 +1004,61 @@ void() PrintQCWaypoint = t = self.enemy._next; if (t == NIL) { - remove(self); + remove (self); fixer = NIL; - bprint("};\n\n// End dump\n"); + bprint ("};\n\n// End dump\n"); return; } - bprint(" make_way("); - h = vtos(t.origin); - bprint(h); - bprint(", '"); - h = ftos(t.target1.count); - bprint(h); - bprint(" "); - h = ftos(t.target2.count); - bprint(h); - bprint(" "); - h = ftos(t.target3.count); - bprint(h); - bprint("', "); - h = ftos(t.target4.count); - bprint(h); - bprint(", "); - h = ftos(t.b_aiflags); - bprint(h); - bprint(");\n"); + bprint (" make_way("); + h = vtos (t.origin); + bprint (h); + bprint (", '"); + h = ftos (t.target1.count); + bprint (h); + bprint (" "); + h = ftos (t.target2.count); + bprint (h); + bprint (" "); + h = ftos (t.target3.count); + bprint (h); + bprint ("', "); + h = ftos (t.target4.count); + bprint (h); + bprint (", "); + h = ftos (t.b_aiflags); + bprint (h); + bprint (");\n"); self.nextthink = time + 0.01; self.enemy = t; - }; -void() QCDumpWaypoints = + +void () +QCDumpWaypoints = { - bprint("/* QC Waypoint Dump - src/frikbot/map_"); + bprint ("/* QC Waypoint Dump - src/frikbot/map_"); - bprint(mapname); - bprint(".qc\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, float flargs) make_way;\n"); - bprint("// Ways by "); - bprint(self.netname); - bprint("\n\n"); - - bprint("void() map_"); - bprint(mapname); - bprint(" =\n{\n"); + bprint (mapname); + bprint (".qc\nFor instructions please read the\nreadme.html that comes " + "with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, " + "float flargs) make_way;\n"); + bprint ("// Ways by "); + bprint (self.netname); + bprint ("\n\n"); + bprint ("void() map_"); + bprint (mapname); + bprint (" =\n{\n"); if (!fixer) { - fixer = spawn(); + fixer = spawn (); fixer.nextthink = time + 0.01; fixer.think = PrintQCWaypoint; fixer.enemy = NIL; } }; -void() PrintBSPWaypoint = +void () +PrintBSPWaypoint = { local entity t; local string h; @@ -1048,59 +1069,61 @@ void() PrintBSPWaypoint = t = self.enemy._next; if (t == NIL) { - bprint("\n\n// End dump\n"); - remove(self); + bprint ("\n\n// End dump\n"); + remove (self); fixer = NIL; return; } - bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \""); - h = ftos(t.origin_x); - bprint(h); - bprint(" "); - h = ftos(t.origin_y); - bprint(h); - bprint(" "); - h = ftos(t.origin_z); - bprint(h); + bprint ("{\n\"classname\" \"waypoint\"\n\"origin\" \""); + h = ftos (t.origin_x); + bprint (h); + bprint (" "); + h = ftos (t.origin_y); + bprint (h); + bprint (" "); + h = ftos (t.origin_z); + bprint (h); if (t.target1.count) { - bprint("\"\n\"b_pants\" \""); - h = ftos(t.target1.count); - bprint(h); + bprint ("\"\n\"b_pants\" \""); + h = ftos (t.target1.count); + bprint (h); } if (t.target2.count) { - bprint("\"\n\"b_skill\" \""); - h = ftos(t.target2.count); - bprint(h); + bprint ("\"\n\"b_skill\" \""); + h = ftos (t.target2.count); + bprint (h); } if (t.target3.count) { - bprint("\"\n\"b_shirt\" \""); - h = ftos(t.target3.count); - bprint(h); + bprint ("\"\n\"b_shirt\" \""); + h = ftos (t.target3.count); + bprint (h); } if (t.target4.count) { - bprint("\"\n\"b_frags\" \""); - h = ftos(t.target4.count); - bprint(h); + bprint ("\"\n\"b_frags\" \""); + h = ftos (t.target4.count); + bprint (h); } if (t.b_aiflags) { - bprint("\"\n\"b_aiflags\" \""); - h = ftos(t.b_aiflags); - bprint(h); + bprint ("\"\n\"b_aiflags\" \""); + h = ftos (t.b_aiflags); + bprint (h); } - bprint("\"\n}\n"); + bprint ("\"\n}\n"); self.nextthink = time + 0.01; self.enemy = t; - }; -void() BSPDumpWaypoints = -{ - bprint("/* BSP entities Dump - maps/"); - bprint(mapname); - bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n\n"); +void () +BSPDumpWaypoints = +{ + bprint ("/* BSP entities Dump - maps/"); + + bprint (mapname); + bprint (".ent\nFor instructions please read the\nreadme.html that comes " + "with FrikBot */\n\n\n"); if (!fixer) { - fixer = spawn(); + fixer = spawn (); fixer.nextthink = time + 0.01; fixer.think = PrintBSPWaypoint; fixer.enemy = NIL; diff --git a/fbxa/bot_fight.qc b/fbxa/bot_fight.qc index 21b7c2d..3bda7ee 100644 --- a/fbxa/bot_fight.qc +++ b/fbxa/bot_fight.qc @@ -6,7 +6,6 @@ ***********************************************/ /* - This program is in the Public Domain. My crack legal team would like to add: @@ -39,79 +38,92 @@ with applicable reexport restrictions. Any reproduction of this software must contain this notice in its entirety. - */ #include "libfrikbot.h" .entity avoid; -float(entity e) bot_size_player = +float (entity e) +bot_size_player = { - local float sz; + local float sz; sz = e.health + e.armorvalue * e.armortype; - if (e.weapon == 32) - sz = sz + 60; - else if (e.weapon == 64) - sz = sz + 60; - else if (e.weapon == 16) - sz = sz + 50; - else if (e.weapon == 8) - sz = sz + 50; - else if (e.weapon == 4) - sz = sz + 40; - else if (e.weapon == 2) - sz = sz + 40; - else if (e.weapon == 1) - sz = sz + 10; - else if (e.weapon == 4096) - sz = sz - 50; + switch (e.weapon) { + case 4096: + sz -= 50; + break; + case 64: + sz += 60; + break; + case 32: + sz += 60; + break; + case 16: + sz += 50; + break; + case 8: + sz += 50; + break; + case 4: + sz += 40; + break; + case 2: + sz += 40; + break; + case 1: + sz += 10; + break; + default: + break; + } + if (e.items & 4194304) // Quad - sz = sz + 200; + sz += 200; if (e.items & 1048576) // Invul - sz = sz + 300; + sz += 300; if (e.items & 524288) // Invis - sz = sz + 250; + sz += 250; return sz; }; -void() bot_dodge_stuff = +void () +bot_dodge_stuff = { - local entity foe; - local float foedist, avdist, foesz, flen, tsz; - local vector v; + local entity foe; + local float foedist, avdist, foesz, flen, tsz; + local vector v; if (waypoint_mode > WM_LOADED) return; self.avoid = NIL; - if (self.enemy) { - v = self.origin - realorigin(self.enemy); - foedist = vlen(v); - foesz = bot_size_player(self.enemy); + v = self.origin - realorigin (self.enemy); + foedist = vlen (v); + foesz = bot_size_player (self.enemy); } else { foedist = 3000; foesz = 9999999; } avdist = 256; - foe = find(NIL, classname, "grenade"); - while(foe) { - flen = vlen(foe.origin - self.origin); + foe = find (NIL, classname, "grenade"); + while (foe) { + flen = vlen (foe.origin - self.origin); if (flen < avdist) { avdist = flen; self.avoid = foe; } - foe = find(foe, classname, "grenade"); + foe = find (foe, classname, "grenade"); } if (!self.avoid) { - foe = find(NIL, classname, "missile"); - while(foe) { + foe = find (NIL, classname, "missile"); + while (foe) { if (foe.owner != self) { - flen = vlen(foe.origin - self.origin); + flen = vlen (foe.origin - self.origin); if (flen < avdist) { avdist = flen; self.avoid = foe; @@ -121,7 +133,7 @@ void() bot_dodge_stuff = } if (!self.avoid) { foe = find(NIL, classname, "spike"); - while(foe) { + while (foe) { if (foe.owner != self) { flen = vlen(foe.origin - self.origin); if (flen < avdist) { @@ -129,21 +141,21 @@ void() bot_dodge_stuff = self.avoid = foe; } } - foe = find(foe, classname, "spike"); + foe = find (foe, classname, "spike"); } } } if (coop) { if (!self.enemy) { - foe = findradius(self.origin, foedist); - while(foe) { - if(foe.flags & FL_MONSTER) { - if(foe.health > 0) { - flen = vlen(foe.origin - self.origin); + foe = findradius (self.origin, foedist); + while (foe) { + if (foe.flags & FL_MONSTER) { + if (foe.health > 0) { + flen = vlen (foe.origin - self.origin); if (flen < foedist) { - tsz = bot_size_player(foe); + tsz = bot_size_player (foe); if (tsz < foesz) { - if (fisible(foe)) { + if (fisible (foe)) { self.enemy = foe; foedist = flen; foesz = tsz; @@ -164,14 +176,14 @@ void() bot_dodge_stuff = if (foe.modelindex != 0) { if (foe.health > 0) { if (!(teamplay && self.team == foe.team)) { - flen = vlen(foe.origin - self.origin); + flen = vlen (foe.origin - self.origin); if (flen < foedist) { tsz = bot_size_player(foe); if (tsz < foesz) { if (fov(foe) || foe.b_sound > time || self.b_skill == 3) { - if (fisible(foe)) { + if (fisible (foe)) { self.enemy = foe; - foedist = vlen(foe.origin - self.origin); + foedist = vlen (foe.origin - self.origin); } } } @@ -184,76 +196,71 @@ void() bot_dodge_stuff = } }; - - - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - weapon_range _x "sweet spot range" - try to maintain this range if possible _y minimum range bot can be to be effective (rl/gl) (move away) _z maximum range bot can be to be effective (lg/axe) (move in) --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -vector(float wep) weapon_range = +vector (float wep) +weapon_range = { - if (wep == 4096) // IT_AXE + switch (wep) { + case 4096: // IT_AXE return '48 0 64'; - else if (wep == 1) // IT_SHOTGUN + case 1: // IT_SHOTGUN return '128 0 99999'; - else if (wep == 2) // IT_SUPER_SHOTGUN + case 2: // IT_SUPER_SHOTGUN return '128 0 99999'; - else if (wep == 4) // IT_NAILGUN + case 4: // IT_NAILGUN return '180 0 3000'; - else if (wep == 8) // IT_SUPER_NAILGUN + case 8: // IT_SUPER_NAILGUN return '180 0 3000'; - else if (wep == 16) // IT_GRENADE_LAUNCHER + case 16: // IT_GRENADE_LAUNCHER return '180 48 3000'; - else if (wep == 32) // IT_ROCKET_LAUNCHER + case 32: // IT_ROCKET_LAUNCHER return '180 48 3000'; - else if (wep == 64) // IT_LIGHTNING + case 64: // IT_LIGHTNING return '350 0 512'; + default: + break; + } }; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +/* bot_weapon_switch Pick a weapon based on range / ammo - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void(float brange) bot_weapon_switch = +void (float brange) +bot_weapon_switch = { - local float it, flag = 0, pulse = 0; - local vector v; + local float it, flag = 0, pulse = 0; + local vector v; it = self.items & 127; - while(it) { + while (it) { if ((self.ammo_rockets >= 1) && (it & 32)) { flag = 32; pulse = 7; } else if (self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & 64)) { flag = 64; pulse = 8; - } else if(self.ammo_nails >= 2 && (it & 8)) { + } else if (self.ammo_nails >= 2 && (it & 8)) { flag = 8; pulse = 5; } else if ((self.ammo_rockets >= 1) && (it & 16)) { flag = 16; pulse = 6; - } else if(self.ammo_shells >= 2 && (it & 2)) { + } else if (self.ammo_shells >= 2 && (it & 2)) { flag = 2; pulse = 3; - } else if(self.ammo_nails >= 1 && (it & 4)) { + } else if (self.ammo_nails >= 1 && (it & 4)) { flag = 4; pulse = 4; - } else if(self.ammo_shells >= 1 && (it & 1)) { + } else if (self.ammo_shells >= 1 && (it & 1)) { flag = 1; pulse = 2; } else { @@ -268,7 +275,7 @@ void(float brange) bot_weapon_switch = return; } - v = weapon_range(flag); + v = weapon_range (flag); if (brange < v_y || brange > v_z) it = it - flag; else { @@ -279,35 +286,32 @@ void(float brange) bot_weapon_switch = } }; -void() bot_shoot = +void () +bot_shoot = { // quick little function to stop making him shoot the wrong way ! Argh local float g; - g = angcomp(self.v_angle_x, self.b_angle_x); - if (fabs(g) > 30) + + g = angcomp (self.v_angle_x, self.b_angle_x); + if (fabs (g) > 30) return; // argh, too far away - g = angcomp(self.v_angle_y, self.b_angle_y); - if (fabs(g) > 30) + g = angcomp (self.v_angle_y, self.b_angle_y); + if (fabs (g) > 30) return; // not again! self.button0 = TRUE; }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Bot_fight_style This is the core of the bot's thinking when attacking an enemy. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void() bot_fight_style = +void () +bot_fight_style = { - local vector v, v1 = '0 0 0', v2 = '0 0 0', org; - local float foedist, mysz, foesz; - + local float foedist, mysz, foesz; + local vector v, v1 = '0 0 0', v2 = '0 0 0', org; if (self.enemy.health <= 0) { self.enemy = NIL; @@ -315,42 +319,40 @@ void() bot_fight_style = } else if (!self.enemy.takedamage) { self.enemy = NIL; return; - } else if (!fisible(self.enemy)) { + } else if (!fisible (self.enemy)) { self.enemy = NIL; return; } - org = realorigin(self.enemy); - makevectors(self.v_angle); + org = realorigin (self.enemy); + makevectors (self.v_angle); // decide if I should shoot - - foedist = vlen(org - self.origin); - v = weapon_range(self.weapon); + foedist = vlen (org - self.origin); + v = weapon_range (self.weapon); if (foedist > v_y && foedist < v_z) { - traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * v_z, FALSE, self); + traceline (self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * v_z, FALSE, self); if (vlen(trace_endpos - (self.origin + self.view_ofs)) >= v_y) { // try to avoid shooting teammates if (trace_ent.classname == "player") if ((trace_ent.team == self.team && teamplay) || (coop)) return; - bot_shoot(); + bot_shoot (); } } else - bot_weapon_switch(foedist); + bot_weapon_switch (foedist); if (!(self.b_aiflags & (AI_PRECISION | AI_BLIND | AI_OBSTRUCTED))) { - foesz = bot_size_player(self.enemy); - mysz = bot_size_player(self) + 5; + foesz = bot_size_player (self.enemy); + mysz = bot_size_player (self) + 5; if (foesz > mysz) { if (teamplay) { - if (random() < 0.02) { - bot_start_topic(5); + if (random () < 0.02) { + bot_start_topic (5); self.b_chattime = 1; } } - return; } else if (mysz < 140) return; @@ -358,36 +360,34 @@ void() bot_fight_style = if (self.avoid.velocity) v = self.avoid.velocity; else - v = normalize(self.avoid.origin - self.origin); + v = normalize (self.avoid.origin - self.origin); v1_x = v_y; v1_y = v_y * -1; v2_x = v_y; v2_y = v_y * -1; - foedist = vlen(self.avoid.origin - (self.origin + v1)); - if (foedist < vlen(self.avoid.origin - (self.origin + v2))) - frik_walkmove(v2); + foedist = vlen (self.avoid.origin - (self.origin + v1)); + if (foedist < vlen (self.avoid.origin - (self.origin + v2))) + frik_walkmove (v2); else - frik_walkmove(v1); + frik_walkmove (v1); } else if (!(self.enemy.flags & FL_MONSTER)) { if (foedist + 32 < v_x) - frik_walkmove(self.origin - org); + frik_walkmove (self.origin - org); else if (foedist - 32 > v_x) - frik_walkmove(org - self.origin); + frik_walkmove (org - self.origin); else if (self.wallhug) - frik_walkmove(v_right); + frik_walkmove (v_right); else - frik_walkmove(v_right * -1); + frik_walkmove (v_right * -1); } } else { - foesz = bot_size_player(self.enemy); - mysz = bot_size_player(self) + 5; + foesz = bot_size_player (self.enemy); + mysz = bot_size_player (self) + 5; if (foesz > mysz) return; else if (mysz < 140) return; - self.keys = self.keys & 960; + self.keys &= 960; } }; - - diff --git a/fbxa/bot_misc.qc b/fbxa/bot_misc.qc index 84ed2c8..6e86895 100644 --- a/fbxa/bot_misc.qc +++ b/fbxa/bot_misc.qc @@ -38,90 +38,91 @@ with applicable reexport restrictions. Any reproduction of this software must contain this notice in its entirety. - */ #include "libfrikbot.h" /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - BotName Sets bot's name and colors - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -string(float r) BotName = +string (float r) +BotName = { self.b_num = r; - if (r == 1) { + switch (r) { + case 1: self.b_pants = 11; self.b_shirt = 0; return "Vincent"; - } else if (r == 2) { + case 2: self.b_pants = 1; self.b_shirt = 3; return "Bishop"; - } else if (r == 3) { + case 3: self.b_pants = 13; self.b_shirt = 2; return "Nomad"; - } else if (r == 4) { + case 4: self.b_pants = 7; self.b_shirt = 6; return "Hudson"; - } else if (r == 5) { + case 5: self.b_pants = 12; self.b_shirt = 6; return "Lore"; - } else if (r == 6) { + case 6: self.b_pants = 4; self.b_shirt = 4; return "Servo"; - } else if (r == 7) { + case 7: self.b_pants = 2; self.b_shirt = 5; return "Gort"; - } else if (r == 8) { + case 8: self.b_pants = 10; self.b_shirt = 3; return "Kryten"; - } else if (r == 9) { + case 9: self.b_pants = 9; self.b_shirt = 4; return "Pimp Bot"; - } else if (r == 10) { + case 10: self.b_pants = 4; self.b_shirt = 7; return "Max"; - } else if (r == 11) { + case 11: self.b_pants = 3; self.b_shirt = 11; return "Marvin"; - } else if (r == 12) { + case 12: self.b_pants = 13; self.b_shirt = 12; return "Erwin"; - } else if (r == 13) { + case 13: self.b_pants = 11; self.b_shirt = 2; return "FrikBot"; - } else if (r == 14) { + case 14: self.b_pants = 0; self.b_shirt = 2; return "Krosis"; - } else if (r == 15) { + case 15: self.b_pants = 8; self.b_shirt = 9; return "Gypsy"; - } else if (r == 16) { + case 16: self.b_pants = 5; self.b_shirt = 10; return "Hal"; + default: + break; } }; -string () PickARandomName = + +string () +PickARandomName = { if (bot_count > 16) return "player"; @@ -130,18 +131,16 @@ string () PickARandomName = local string h; local entity t; y = TRUE; - while(y) { - test = ceil(random() * 16); - h = BotName(test); - t = find(NIL, netname, h); + while (y) { + test = ceil (16 * random ()); + h = BotName (test); + t = find (NIL, netname, h); if (t == NIL) y = FALSE; } return h; }; - - // I didn't like the old code so this is very stripped down entity b_originator; @@ -163,10 +162,9 @@ b_originator == self 10 - ridicule lost frag (lava) 11 - lag b_originator == targ - - */ -void(float tpic) bot_start_topic = +void (float tpic) +bot_start_topic = { if (random() < 0.2) { b_topic = tpic; @@ -175,217 +173,293 @@ void(float tpic) bot_start_topic = b_topic = 0; }; -void() bot_chat = +void () +bot_chat = { local float r; + if (b_options & OPT_NOCHAT) return; - r = ceil (random() * 6); + + r = ceil (6 * random ()); if (self.b_chattime > time) { if (self.b_skill < 2) self.keys = self.button0 = self.button2 = 0; return; } else if (self.b_chattime) { - if (b_topic == 1) { + switch (b_topic) { + case 1: if (b_originator == self) { - if (r == 1) { - BotSay(": lo all\n"); - bot_start_topic(8); - } else if (r == 2) { - BotSay(": hey everyone\n"); - bot_start_topic(8); - } else if (r == 3) { - BotSay(": prepare to be fragged!\n"); - bot_start_topic(0); - } else if (r == 4) { - BotSay(": boy this is laggy\n"); - bot_start_topic(11); - } else if (r == 5) { - BotSay(": #mm getting some lag here\n"); - bot_start_topic(11); - } else { + switch (r) { + case 1: + BotSay (": lo all\n"); + bot_start_topic (8); + break; + case 2: + BotSay (": hey everyone\n"); + bot_start_topic (8); + break; + case 3: + BotSay (": prepare to be fragged!\n"); + bot_start_topic (0); + break; + case 4: + BotSay (": boy this is laggy\n"); + bot_start_topic (11); + break; + case 5: + BotSay (": #mm getting some lag here\n"); + bot_start_topic (11); + break; + default: BotSay(": hi everyone\n"); - bot_start_topic(8); + bot_start_topic (8); + break; } } - } else if (b_topic == 2) { + break; + case 2: if (b_originator == self) { - if (r == 1) - BotSay(": take that\n"); - else if (r == 2) - BotSay(": yehaww!\n"); - else if (r == 3) - BotSay(": wh00p\n"); - else if (r == 4) - BotSay(": j00_sawk();\n"); - else if (r == 5) - BotSay(": i rule\n"); - else - BotSay(": eat that\n"); - bot_start_topic(0); + switch (r) { + case 1: + BotSay (": take that\n"); + break; + case 2: + BotSay (": yehaww!\n"); + break; + case 3: + BotSay (": wh00p\n"); + break; + case 4: + BotSay (": j00_sawk();\n"); + break; + case 5: + BotSay (": i rule\n"); + break; + default: + BotSay (": eat that\n"); + break; + } + bot_start_topic (0); } - } else if (b_topic == 3) { + break; + case 3: if (b_originator == self) { if (r < 3) - BotSayTeam(": friendly eyes\n"); + BotSayTeam (": friendly eyes\n"); else - BotSayTeam(": team eyes\n"); - bot_start_topic(0); + BotSayTeam (": team eyes\n"); + bot_start_topic (0); } - } else if (b_topic == 4) { + break; + case 4: if (b_originator == self) { if (r < 3) - BotSayTeam(": on your back\n"); + BotSayTeam (": on your back\n"); else - BotSayTeam(": I'm with you\n"); - bot_start_topic(0); + BotSayTeam (": I'm with you\n"); + bot_start_topic (0); } - } else if (b_topic == 5) { + break; + case 5: if (b_originator == self) { if (r < 3) - BotSayTeam(": I need help\n"); + BotSayTeam (": I need help\n"); else - BotSayTeam(": need backup\n"); - bot_start_topic(0); + BotSayTeam (": need backup\n"); + bot_start_topic (0); } - } else if (b_topic == 6) { + break; + case 6: if (b_originator == self) { - if (r == 1) { - BotSay(": sun got in my eyes\n"); - bot_start_topic(0); - } else if (r == 2) { - BotSay(": mouse needs cleaning\n"); - bot_start_topic(0); - } else if (r == 3) { - BotSay(": i meant to do that\n"); - bot_start_topic(0); - } else if (r == 4) { - BotSay(": lag\n"); - bot_start_topic(11); - } else if (r == 5) { - BotSay(": killer lag\n"); - bot_start_topic(11); - } else { - BotSay(": 100% lag\n"); - bot_start_topic(11); + switch (r) { + case 1: + BotSay (": sun got in my eyes\n"); + bot_start_topic (0); + break; + case 2: + BotSay (": mouse needs cleaning\n"); + bot_start_topic (0); + break; + case 3: + BotSay (": i meant to do that\n"); + bot_start_topic (0); + break; + case 4: + BotSay (": lag\n"); + bot_start_topic (11); + break; + case 5: + BotSay (": killer lag\n"); + bot_start_topic (11); + break; + default: + BotSay (": 100% lag\n"); + bot_start_topic (11); + break; } } - } else if (b_topic == 7) { - if (r == 1) - BotSay(": gg\n"); - else if (r == 2) - BotSay(": gg all\n"); - else if (r == 3) - BotSay(": that was fun\n"); - else if (r == 4) - BotSay(": good game\n"); - else if (r == 5) - BotSay(": pah\n"); - else - BotSay(": hrm\n"); - bot_start_topic(0); - } else if (b_topic == 8) { + break; + case 7: + switch (r) { + case 1: + BotSay (": gg\n"); + break; + case 2: + BotSay (": gg all\n"); + break; + case 3: + BotSay (": that was fun\n"); + break; + case 4: + BotSay (": good game\n"); + break; + case 5: + BotSay (": pah\n"); + break; + default: + BotSay (": hrm\n"); + break; + } + bot_start_topic (0); + break; + case 8: if (b_originator != self) { - if (r == 1) { - BotSay(": heya\n"); - bot_start_topic(0); - } else if (r == 2) { - BotSay(": welcome\n"); - bot_start_topic(0); - } else if (r == 3) { - BotSayInit(); - BotSay2(": hi "); - BotSay2(b_originator.netname); - BotSay2("\n"); - bot_start_topic(0); - } else if (r == 4) { - BotSayInit(); - BotSay2(": hey "); - BotSay2(b_originator.netname); - BotSay2("\n"); - bot_start_topic(0); - } else if (r == 5) { - BotSay(": howdy\n"); - bot_start_topic(0); - } else { + switch (r) { + case 1: + BotSay (": heya\n"); + bot_start_topic (0); + break; + case 2: + BotSay (": welcome\n"); + bot_start_topic (0); + break; + case 3: + BotSayInit (); + BotSay2 (": hi "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + bot_start_topic (0); + break; + case 5: + BotSayInit (); + BotSay2 (": hey "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + bot_start_topic (0); + break; + case 5: + BotSay (": howdy\n"); + bot_start_topic (0); + break; + default: BotSay(": lo\n"); bot_start_topic(0); + break; } } - } else if (b_topic == 9) { + break; + case 9: if (b_originator != self) { - if (r == 1) - BotSay(": hah\n"); - else if (r == 2) - BotSay(": heheh\n"); - else if (r == 3) { - BotSayInit(); - BotSay2(": good work "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } else if (r == 4) { - BotSayInit(); - BotSay2(": nice1 "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } else if (r == 5) - BotSay(": lol\n"); - else - BotSay(": :)\n"); + switch (r) { + case 1: + BotSay (": hah\n"); + break; + case 2: + BotSay (": heheh\n"); + break; + case 3: + BotSayInit (); + BotSay2 (": good work "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + break; + case 4: + BotSayInit (); + BotSay2 (": nice1 "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + break; + case 5: + BotSay (": lol\n"); + break; + default: + BotSay (": :)\n"); + break; + } b_topic = 6; } - } else if (b_topic == 10) { + break; + case 10: if (b_originator != self) { - if (r == 1) - BotSay(": have a nice dip?\n"); - else if (r == 2) - BotSay(": bah I hate levels with lava\n"); - else if (r == 3) { + switch (r) { + case 1: + BotSay (": have a nice dip?\n"); + break; + case 2: + BotSay (": bah I hate levels with lava\n"); + break; + case 3: BotSayInit(); - BotSay2(": good job "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } else if (r == 4) { - BotSayInit(); - BotSay2(": nice backflip "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } else if (r == 5) - BotSay(": watch your step\n"); - else - BotSay(": hehe\n"); + BotSay2 (": good job "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + break; + case 4: + BotSayInit (); + BotSay2 (": nice backflip "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + break; + case 5: + BotSay (": watch your step\n"); + break; + default: + BotSay (": hehe\n"); + break; + } b_topic = 6; } - } else if (b_topic == 11) { + break; + case 11: if (b_originator != self) { - if (r == 1) { - BotSayInit(); - BotSay2(": yeah right "); - BotSay2(b_originator.netname); - BotSay2("\n"); - bot_start_topic(0); - } else if (r == 2) { - BotSay(": ping\n"); - bot_start_topic(0); - } else if (r == 3) { - BotSay(": shuddup, you're an lpb\n"); - bot_start_topic(0); - } else if (r == 4) { - BotSay(": lag my eye\n"); - bot_start_topic(0); - } else if (r == 5) { - BotSay(": yeah\n"); - bot_start_topic(11); - } else { - BotSay(": totally\n"); - bot_start_topic(11); + switch (r) { + case 1: + BotSayInit (); + BotSay2 (": yeah right "); + BotSay2 (b_originator.netname); + BotSay2 ("\n"); + bot_start_topic (0); + break; + case 2: + BotSay (": ping\n"); + bot_start_topic (0); + break; + case 3: + BotSay (": shuddup, you're an lpb\n"); + bot_start_topic (0); + break; + case 4: + BotSay (": lag my eye\n"); + bot_start_topic (0); + break; + case 5: + BotSay (": yeah\n"); + bot_start_topic (11); + break; + default: + BotSay (": totally\n"); + bot_start_topic (11); + break; } } + default: + break; } self.b_chattime = 0; } else if (b_topic) { - if (random() < 0.5) { + if (random () < 0.5) { if (self == b_originator) { if (b_topic <= 7) self.b_chattime = time + 2; @@ -397,64 +471,47 @@ void() bot_chat = } }; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Kick A Bot. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() KickABot = +void () +KickABot = { local entity ty; - ty = find(NIL, classname, "player"); + + ty = find (NIL, classname, "player"); while (ty != NIL) { if (!(ty.ishuman)) { - - BotDisconnect(ty); + BotDisconnect (ty); ty.ishuman = TRUE; ty = NIL; } else - ty = find(ty, classname, "player"); + ty = find (ty, classname, "player"); } - }; - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Simplified origin checking. God, I wish I had inline - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -vector(entity ent) realorigin = +vector (entity ent) +realorigin = { -// even more simplified... + // even more simplified... return (ent.absmin + ent.absmax) * 0.5; }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - fisible a version of visible that checks for corners of the bounding boxes - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -float (entity targ) fisible = +float (entity targ) +fisible = { + local float thruwater = 0, pc1 = 0, pc2 = 0; local vector spot1, org; - local float thruwater = 0, pc1 = 0, pc2 = 0; - - org = realorigin(targ); + + org = realorigin (targ); spot1 = self.origin + self.view_ofs; if (targ.solid == SOLID_BSP) { @@ -465,8 +522,8 @@ float (entity targ) fisible = return TRUE; return FALSE; } else { - pc1 = pointcontents(org); - pc2 = pointcontents(spot1); + pc1 = pointcontents (org); + pc2 = pointcontents (spot1); if (targ.classname == "player") thruwater = FALSE; else if (pc1 == CONTENT_LAVA) @@ -523,26 +580,21 @@ float (entity targ) fisible = return FALSE; }; - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Wisible goes through movable brushes/entities, used for waypoints - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - // this is used for waypoint stuff.... -float (entity targ1, entity targ2) wisible = +float (entity targ1, entity targ2) +wisible = { + local entity ignore; local vector spot1, spot2; - local entity ignore; spot1 = targ1.origin; - spot2 = realorigin(targ2); + spot2 = realorigin (targ2); ignore = self; do { @@ -556,19 +608,14 @@ float (entity targ1, entity targ2) wisible = return FALSE; }; - /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - sisible Now this is getting ridiculous. Simple visible, used when we need just a simple traceline nothing else - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -float (entity targ) sisible = +float (entity targ) +sisible = { traceline (self.origin, targ.origin, TRUE, self); if (trace_ent == targ) @@ -576,65 +623,54 @@ float (entity targ) sisible = else if (trace_fraction == 1) return TRUE; }; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +/* angcomp subtracts one angle from another - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -float (float y1, float y2) angcomp = +float (float y1, float y2) +angcomp = { - y1 = frik_anglemod(y1); - y2 = frik_anglemod(y2); - local float answer; + + y1 = frik_anglemod (y1); + y2 = frik_anglemod (y2); + answer = y1 - y2; if (answer > 180) - answer = (360 - answer) * -1; + answer -= 360; else if (answer < -180) - answer = answer + 360; + answer += 360; return answer; }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - fov is the entity in the bot's field of view - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -float (entity targ) fov = +float (entity targ) +fov = { - local vector yawn; - local float g; - yawn = realorigin(targ); + local float g; + local vector yawn; + + yawn = realorigin (targ); yawn = (yawn + targ.view_ofs) - (self.origin + self.view_ofs); - yawn = normalize(yawn); - yawn = vectoangles(yawn); - g = angcomp(self.v_angle_x, yawn_x); - if (fabs(g) > 45) + yawn = normalize (yawn); + yawn = vectoangles (yawn); + g = angcomp (self.v_angle_x, yawn_x); + if (fabs (g) > 45) return FALSE; - g = angcomp(self.v_angle_y, yawn_y); - if (fabs(g) > 60) + g = angcomp (self.v_angle_y, yawn_y); + if (fabs (g) > 60) return FALSE; - return TRUE; }; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -frik_anglemod - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -float(float v) frik_anglemod = +float (float v) +frik_anglemod = { - return v - floor(v/360) * 360; + return v - floor (v / 360) * 360; }; diff --git a/fbxa/bot_move.qc b/fbxa/bot_move.qc index 8f181d9..071917b 100644 --- a/fbxa/bot_move.qc +++ b/fbxa/bot_move.qc @@ -6,7 +6,6 @@ ***********************************************/ /* - This program is in the Public Domain. My crack legal team would like to add: @@ -39,18 +38,19 @@ with applicable reexport restrictions. Any reproduction of this software must contain this notice in its entirety. - */ #include "libfrikbot.h" -void() bot_jump = +void () +bot_jump = { // TODO check for precision, etc. self.button2 = TRUE; }; -float(entity e) bot_can_rj = +float (entity e) +bot_can_rj = { // this returns true of the bot can rocket/superjump/hook // if your mod doesn't have an RL you can just return FALSE all the time @@ -79,20 +79,21 @@ float(entity e) bot_can_rj = return FALSE; }; -float(float flag) frik_recognize_plat = +float (float flag) +frik_recognize_plat = { if ((self.classname != "waypoint") && !(self.flags & FL_ONGROUND)) return FALSE; - traceline(self.origin, self.origin - '0 0 64', TRUE, self); + traceline (self.origin, self.origin - '0 0 64', TRUE, self); if (trace_ent != NIL) { if (flag) { // afect bot movement too if (self.keys & KEY_MOVEUP) { if (trace_ent.velocity_z > 0) - self.keys = self.keys & 960; // 960 is all view keys + self.keys &= 960; // 960 is all view keys } else if (self.keys & KEY_MOVEDOWN) { if (trace_ent.velocity_z < 0) - self.keys = self.keys & 960; + self.keys &= 960; } } return TRUE; @@ -100,60 +101,56 @@ float(float flag) frik_recognize_plat = return FALSE; }; -float(vector sdir) frik_KeysForDir = +float (vector sdir) +frik_KeysForDir = { - - local vector keydir; local float outkeys, tang; + local vector keydir; + outkeys = 0; if (sdir_x || sdir_y) { - // Everything is tested against 60 degrees, - // this allows the bot to overlap the keys - // 30 degrees on each diagonal 45 degrees - // might look more realistic + // Everything is tested against 60 degrees, this allows the bot to + // overlap the keys 30 degrees on each diagonal 45 degrees might look + // more realistic - keydir = vectoangles(sdir); - tang = angcomp(keydir_y, self.v_angle_y); + keydir = vectoangles (sdir); + tang = angcomp (keydir_y, self.v_angle_y); if ((tang <= 150) && (tang >= 30)) - outkeys = outkeys + KEY_MOVELEFT; + outkeys |= KEY_MOVELEFT; else if ((tang >= -150) && (tang <= -30)) - outkeys = outkeys + KEY_MOVERIGHT; + outkeys |= KEY_MOVERIGHT; if (fabs(tang) <= 60) - outkeys = outkeys + KEY_MOVEFORWARD; + outkeys |= KEY_MOVEFORWARD; else if (fabs(tang) >= 120) - outkeys = outkeys + KEY_MOVEBACK; + outkeys |= KEY_MOVEBACK; } if (sdir_z > 0.7) - outkeys = outkeys + KEY_MOVEUP; + outkeys |= KEY_MOVEUP; else if (sdir_z < 0.7) - outkeys = outkeys + KEY_MOVEDOWN; + outkeys |= KEY_MOVEDOWN; return outkeys; - }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - frik_obstructed Bot has hit a ledge or wall that he should manuever around. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void(vector whichway, float danger) frik_obstructed = +void (vector whichway, float danger) +frik_obstructed = { local float dist; local vector disway, org; + // TODO: something if (self.b_aiflags & AI_BLIND) return; org = realorigin(self.target1); if (danger) { - self.b_aiflags = self.b_aiflags | AI_DANGER; - self.keys = frik_KeysForDir('0 0 0' - whichway); + self.b_aiflags |= AI_DANGER; + self.keys = frik_KeysForDir ('0 0 0' - whichway); } if (self.b_aiflags & AI_PRECISION) return; @@ -162,7 +159,7 @@ void(vector whichway, float danger) frik_obstructed = if (self.target1) { if (self.b_aiflags & AI_OBSTRUCTED) { if (!(self.b_aiflags & AI_DANGER)) { - self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + self.b_aiflags &= ~AI_OBSTRUCTED; return; } else if (!danger) return; @@ -171,40 +168,35 @@ void(vector whichway, float danger) frik_obstructed = disway_x = whichway_y * -1; disway_y = whichway_x; disway_z = 0; - dist = vlen(org - (self.origin + disway)); + dist = vlen (org - (self.origin + disway)); disway_x = whichway_y; disway_y = whichway_x * -1; - self.wallhug = (vlen(org - (self.origin + disway)) > dist) ? 1.0 : 0.0; - self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; + self.wallhug = (vlen (org - (self.origin + disway)) > dist) ? 1.0 : 0.0; + self.b_aiflags |= AI_OBSTRUCTED; } else { disway_x = whichway_y * -1; disway_y = whichway_x; disway_z = 0; - dist = vlen(disway - self.obs_dir); + dist = vlen (disway - self.obs_dir); disway_x = whichway_y; disway_y = whichway_x * -1; - self.wallhug = (vlen(disway - self.obs_dir) < dist) ? 1.0 : 0.0; + self.wallhug = (vlen (disway - self.obs_dir) < dist) ? 1.0 : 0.0; self.obs_dir = whichway; - self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; + self.b_aiflags |= AI_OBSTRUCTED; } }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - frik_obstacles Detects small bumps the bot needs to jump over or ledges the bot should avoid falling in. - Also responsible for jumping gaps. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void() frik_obstacles = +void () +frik_obstacles = { local vector start, stop, ang; local float test, conts, dist, hgt; @@ -220,7 +212,7 @@ void() frik_obstacles = start_z = self.origin_z + self.maxs_z; stop = start; stop_z = self.origin_z + self.mins_z; - traceline(start, stop - '0 0 256', TRUE, self); + traceline (start, stop - '0 0 256', TRUE, self); if (trace_allsolid || trace_startsolid) return; hgt = trace_endpos_z - stop_z; @@ -232,27 +224,27 @@ void() frik_obstacles = if (hgt >= 0) return; - conts = pointcontents(trace_endpos + '0 0 4'); + conts = pointcontents (trace_endpos + '0 0 4'); start = stop - '0 0 8'; stop = start + ang * 256; - traceline(start, stop, TRUE, self); + traceline (start, stop, TRUE, self); test = vlen(trace_endpos - start); if (test <= 20) return; // it's a walkable gap, do nothing ang_x = self.velocity_y * -1; ang_y = self.velocity_x; - ang = normalize(ang); - traceline(start - (ang * 10), start + (ang * 10), TRUE, self); + ang = normalize (ang); + traceline (start - (ang * 10), start + (ang * 10), TRUE, self); if ((trace_fraction != 1) || trace_startsolid) return; // gap is only 20 wide, walkable ang = self.velocity; ang_z = 0; - dist = ((540 / sv_gravity) * vlen(ang))/* + 32*/; + dist = ((540 / sv_gravity) * vlen (ang))/* + 32*/; if (test > dist) { // I can't make it if (conts < -3) { // bad stuff down dare - frik_obstructed(ang, TRUE); + frik_obstructed (ang, TRUE); return; } else { if (self.target1) { @@ -260,13 +252,13 @@ void() frik_obstacles = if ((stop_z - self.origin_z) < -32) return; // safe to fall } - frik_obstructed(ang, FALSE); + frik_obstructed (ang, FALSE); return; } } else { ang = normalize(ang); //look for a ledge - traceline(self.origin, self.origin + (ang * (test + 20)), TRUE, self); + traceline (self.origin, self.origin + (ang * (test + 20)), TRUE, self); if (trace_fraction != 1) { if (conts < -3) { // bad stuff down dare @@ -278,21 +270,21 @@ void() frik_obstacles = if ((stop_z - self.origin_z) < -32) return; // safe to fall } - frik_obstructed(ang, FALSE); + frik_obstructed (ang, FALSE); return; } } if (self.target1) { // getting furter away from my target? - test = vlen(self.target1.origin - (ang + self.origin)); - if (test > vlen(self.target1.origin - self.origin)) { + test = vlen (self.target1.origin - (ang + self.origin)); + if (test > vlen (self.target1.origin - self.origin)) { if (conts < -3) { // bad stuff down dare - frik_obstructed(ang, TRUE); + frik_obstructed (ang, TRUE); return; } else { - frik_obstructed(ang, FALSE); + frik_obstructed (ang, FALSE); return; } } @@ -300,36 +292,33 @@ void() frik_obstacles = } if (hgt < -18) { if (self.target1) { - stop = realorigin(self.target1); + stop = realorigin (self.target1); if ((stop_z - self.origin_z) < -32) return; // safe to fall } - bot_jump(); + bot_jump (); } // go for it }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -After frik_obstructed, the bot uses the +After frik_obstructed, the bot uses the following funtion to move "around" the obstacle I have no idea how well it will work - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void() frik_dodge_obstruction = +void () +frik_dodge_obstruction = { local vector way, org; local float oflags, yaw; if (!(self.b_aiflags & AI_OBSTRUCTED)) return; - if ((self.b_aiflags & (AI_BLIND | AI_PRECISION)) || !(self.flags & FL_ONGROUND)) { - self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + if ((self.b_aiflags & (AI_BLIND | AI_PRECISION)) + || !(self.flags & FL_ONGROUND)) { + self.b_aiflags &= ~AI_OBSTRUCTED; return; } @@ -340,9 +329,9 @@ void() frik_dodge_obstruction = oflags = self.flags; org = self.origin; - yaw = vectoyaw(self.obs_dir); - if (walkmove(yaw, 32)) - self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; + yaw = vectoyaw (self.obs_dir); + if (walkmove (yaw, 32)) + self.b_aiflags &= ~AI_OBSTRUCTED; else { if (self.b_aiflags & AI_DANGER) { way = '0 0 0' - self.obs_dir; @@ -354,26 +343,22 @@ void() frik_dodge_obstruction = way_y = self.obs_dir_x * -1; } way_z = 0; - self.keys = self.keys & 960 + frik_KeysForDir(way); + self.keys &= 960; + self.keys |= frik_KeysForDir (way); } // fix the bot - self.origin = org; self.flags = oflags; }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - movetogoal and walkmove replacements blah - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void() frik_movetogoal = +void () +frik_movetogoal = { local vector way; local float g; @@ -389,40 +374,41 @@ void() frik_movetogoal = return; } - way = normalize(way); - self.keys = self.keys & 960 + frik_KeysForDir(way); + way = normalize (way); + self.keys &= 960; + self.keys |= frik_KeysForDir (way); - frik_dodge_obstruction(); - frik_recognize_plat(TRUE); + frik_dodge_obstruction (); + frik_recognize_plat (TRUE); if (self.b_aiflags & AI_PRECISION) { - g = angcomp(self.v_angle_x, self.b_angle_x); + g = angcomp (self.v_angle_x, self.b_angle_x); + if (fabs (g) > 10) + self.keys &= 960; + g = angcomp (self.v_angle_y, self.b_angle_y); if (fabs(g) > 10) - self.keys = self.keys & 960; - g = angcomp(self.v_angle_y, self.b_angle_y); - if (fabs(g) > 10) - self.keys = self.keys & 960; + self.keys &= 960; } }; -float(vector weird) frik_walkmove = +float (vector weird) +frik_walkmove = { // okay so it's not walkmove // sue me - self.keys = self.keys & 960 + frik_KeysForDir(weird); + self.keys &= 960; + self.keys |= frik_KeysForDir (weird); - frik_dodge_obstruction(); - frik_recognize_plat(TRUE); + frik_dodge_obstruction (); + frik_recognize_plat (TRUE); if (self.b_aiflags & AI_OBSTRUCTED) return FALSE; else return TRUE; }; - /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - The "hook" method of navigation. This nav system is copyrighted 1999 by Ryan "Frika C" Smith, keep that in mind when you steal it. @@ -430,39 +416,39 @@ Smith, keep that in mind when you steal it. I brought this back because normal roaming won't work - the bot gets distracted by it's own waypoints. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -void() frik_bot_roam = +void () +frik_bot_roam = { - local vector org, ang, org1; local float loopcount, flag, dist; + local vector org, ang, org1; loopcount = 26; flag = FALSE; - while((loopcount > 0) && !flag) { - loopcount = loopcount - 1; + while ((loopcount > 0) && !flag) { + loopcount--; org = self.origin + self.view_ofs; ang = self.angles; - ang_y = frik_anglemod(ang_y - 90 + (random() * 180)); + ang_y = frik_anglemod (ang_y - 90 + (180 * random ())); ang_x = 0; // avoid upward sloping - makevectors(ang); - traceline(org, org + v_forward * 2300, TRUE, self); + makevectors (ang); + traceline (org, org + v_forward * 2300, TRUE, self); if (trace_fraction != 1) { org1 = trace_endpos; - ang = normalize(trace_plane_normal); + ang = normalize (trace_plane_normal); ang_z = 0; // avoid upward sloping - traceline(org1, org1 + (ang * 2300), TRUE, self); + traceline (org1, org1 + (ang * 2300), TRUE, self); if ((trace_fraction != 1) && (vlen(trace_endpos - org1) >= 64)) { org = trace_endpos; - traceline(org, self.origin + self.view_ofs, TRUE, self); + traceline (org, self.origin + self.view_ofs, TRUE, self); if (trace_fraction != 1) { - dist = vlen(org1 - org) /2; + dist = vlen (org1 - org) /2; org = org1 + (ang * dist); traceline(org, org - '0 0 48', TRUE, self); if (trace_fraction != 1) { - SpawnTempWaypoint(org); + SpawnTempWaypoint (org); flag = TRUE; } } diff --git a/fbxa/bot_phys.qc b/fbxa/bot_phys.qc index b7a7ac3..7b1d8e9 100644 --- a/fbxa/bot_phys.qc +++ b/fbxa/bot_phys.qc @@ -68,17 +68,17 @@ void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles if (self.keys != self.oldkeys) { self.movevect = '0 0 0'; - self.movevect_y = self.movevect_y + (350 * CL_KeyState(KEY_MOVERIGHT)); + self.movevect_y = self.movevect_y + (350 * CL_KeyState (KEY_MOVERIGHT)); // 350 is the default cl_sidespeed - self.movevect_y = self.movevect_y - (350 * CL_KeyState(KEY_MOVELEFT)); + self.movevect_y = self.movevect_y - (350 * CL_KeyState (KEY_MOVELEFT)); // 350 is the default cl_sidespeed - self.movevect_x = self.movevect_x + (200 * CL_KeyState(KEY_MOVEFORWARD)); + self.movevect_x = self.movevect_x + (200 * CL_KeyState (KEY_MOVEFORWARD)); // 200 is the default cl_forwardspeed - self.movevect_x = self.movevect_x - (200 * CL_KeyState(KEY_MOVEBACK)); + self.movevect_x = self.movevect_x - (200 * CL_KeyState (KEY_MOVEBACK)); // 200 is the default cl_backspeed - self.movevect_z = self.movevect_z + (200 * CL_KeyState(KEY_MOVEUP)); + self.movevect_z = self.movevect_z + (200 * CL_KeyState (KEY_MOVEUP)); // 200 is the default cl_upspeed - self.movevect_z = self.movevect_z - (200 * CL_KeyState(KEY_MOVEDOWN)); + self.movevect_z = self.movevect_z - (200 * CL_KeyState (KEY_MOVEDOWN)); // 200 is the default cl_upspeed if (!(self.b_aiflags & AI_PRECISION)) self.movevect = self.movevect * 2; @@ -88,27 +88,27 @@ void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles if (self.b_skill != 2) { // use mouse emulation - anglespeed = 1.5 * real_frametime; + anglespeed = 1.5 * real_frametime; // 1.5 is the default cl_anglespeedkey & bot always has +speed - self.v_angle_y = self.v_angle_y + anglespeed * CL_KeyState(KEY_LOOKLEFT) * 140; + self.v_angle_y = self.v_angle_y + anglespeed * CL_KeyState (KEY_LOOKLEFT) * 140; // 140 is default cl_yawspeed - self.v_angle_y = self.v_angle_y - anglespeed * CL_KeyState(KEY_LOOKRIGHT) * 140; + self.v_angle_y = self.v_angle_y - anglespeed * CL_KeyState (KEY_LOOKRIGHT) * 140; // 140 is default cl_yawspeed - self.v_angle_x = self.v_angle_x - anglespeed * CL_KeyState(KEY_LOOKUP) * 150; + self.v_angle_x = self.v_angle_x - anglespeed * CL_KeyState (KEY_LOOKUP) * 150; // 150 is default cl_pitchspeed - self.v_angle_x = self.v_angle_x + anglespeed * CL_KeyState(KEY_LOOKDOWN) * 150; + self.v_angle_x = self.v_angle_x + anglespeed * CL_KeyState (KEY_LOOKDOWN) * 150; // 150 is default cl_pitchspeed } else { - view_x = angcomp(self.b_angle_x, self.v_angle_x); - view_y = angcomp(self.b_angle_y, self.v_angle_y); + view_x = angcomp (self.b_angle_x, self.v_angle_x); + view_y = angcomp (self.b_angle_y, self.v_angle_y); view_z = 0; - if (vlen(view) > 30) { + if (vlen (view) > 30) { self.mouse_emu = self.mouse_emu + (view * 30); if (vlen(self.mouse_emu) > 180) - self.mouse_emu = normalize(self.mouse_emu) * 180; - } else + self.mouse_emu = normalize (self.mouse_emu) * 180; + } else self.mouse_emu = view * (1 / real_frametime); - self.v_angle = self.v_angle + self.mouse_emu * real_frametime; + self.v_angle += self.mouse_emu * real_frametime; } @@ -121,7 +121,7 @@ void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles self.v_angle_z = 50; else if (self.v_angle_z < -50) self.v_angle_z = -50; - self.v_angle_y = frik_anglemod(self.v_angle_y); + self.v_angle_y = frik_anglemod (self.v_angle_y); }; @@ -139,7 +139,7 @@ void() SV_UserFriction = vel = self.velocity; vel_z =0; - sped = vlen(vel); + sped = vlen (vel); vel = self.velocity; if (!sped) @@ -152,7 +152,7 @@ void() SV_UserFriction = start_z = self.origin_z + self.mins_z; stop_z = start_z - 34; - traceline(start, stop, TRUE, self); + traceline (start, stop, TRUE, self); if (trace_fraction == 1) friction = sv_friction * 2; // 2 is default edgefriction, removed for QW compatability @@ -174,7 +174,7 @@ void() SV_UserFriction = void() SV_WaterJump = { if (time > self.teleport_time || !self.waterlevel) { - self.flags = self.flags - (self.flags & FL_WATERJUMP); + self.flags &= ~FL_WATERJUMP; self.teleport_time = 0; } self.velocity_x = self.movedir_x; @@ -185,20 +185,20 @@ void() DropPunchAngle = { local float len; - len = vlen(self.punchangle); - self.punchangle = normalize(self.punchangle); - len = len - 10 * real_frametime; + len = vlen (self.punchangle); + self.punchangle = normalize (self.punchangle); + len -= 10 * real_frametime; if (len < 0) len = 0; - self.punchangle = self.punchangle * len; + self.punchangle *= len; }; void(vector wishvel) SV_AirAccelerate = { local float addspeed, wishspd, accelspeed, currentspeed; - wishspd = vlen(wishvel); - wishvel = normalize(wishvel); + wishspd = vlen (wishvel); + wishvel = normalize (wishvel); if (wishspd > 30) wishspd = 30; currentspeed = self.velocity * wishvel; @@ -209,15 +209,15 @@ void(vector wishvel) SV_AirAccelerate = if (accelspeed > addspeed) accelspeed = addspeed; - self.velocity = self.velocity + accelspeed * wishvel; + self.velocity += accelspeed * wishvel; }; void(vector wishvel) SV_Accelerate = { local float addspeed, wishspd, accelspeed, currentspeed; - wishspd = vlen(wishvel); - wishvel = normalize(wishvel); + wishspd = vlen (wishvel); + wishvel = normalize (wishvel); currentspeed = self.velocity * wishvel; addspeed = wishspd - currentspeed; @@ -227,7 +227,7 @@ void(vector wishvel) SV_Accelerate = if (accelspeed > addspeed) accelspeed = addspeed; - self.velocity = self.velocity + accelspeed * wishvel; + self.velocity += accelspeed * wishvel; }; void() SV_WaterMove = @@ -235,13 +235,13 @@ void() SV_WaterMove = local vector wishvel; local float wishspeed, addspeed, cspeed, newspeed; - makevectors(self.v_angle); + makevectors (self.v_angle); wishvel = v_right * self.movevect_y + v_forward * self.movevect_x; if (self.movevect == '0 0 0') - wishvel_z = wishvel_z - 60; + wishvel_z -= 60; else - wishvel_z = wishvel_z + self.movevect_z; + wishvel_z += self.movevect_z; wishspeed = vlen(wishvel); if (wishspeed > sv_maxspeed) { @@ -249,12 +249,12 @@ void() SV_WaterMove = wishspeed = sv_maxspeed; } wishspeed = wishspeed * 0.7; - cspeed = vlen(self.velocity); + cspeed = vlen (self.velocity); if (cspeed) { newspeed = cspeed - (real_frametime * cspeed * sv_friction); if (newspeed < 0) newspeed = 0; - self.velocity = self.velocity * (newspeed / cspeed); + self.velocity *= (newspeed / cspeed); } else newspeed = 0; @@ -268,7 +268,7 @@ void() SV_WaterMove = cspeed = sv_accelerate * wishspeed * real_frametime; if (cspeed > addspeed) cspeed = addspeed; - self.velocity = self.velocity + cspeed * wishvel; + self.velocity += cspeed * wishvel; }; void() SV_AirMove = @@ -277,7 +277,7 @@ void() SV_AirMove = vangle = self.v_angle; vangle_x = vangle_z = 0; - makevectors(vangle); + makevectors (vangle); if (time < self.teleport_time && (self.movevect_x < 0)) self.movevect_x = 0; wishvel = v_right * self.movevect_y + v_forward * self.movevect_x; @@ -287,13 +287,13 @@ void() SV_AirMove = wishvel_z = self.movevect_z; else wishvel_z = 0; - if (vlen(wishvel) > sv_maxspeed) - wishvel = normalize(wishvel) * sv_maxspeed; + if (vlen (wishvel) > sv_maxspeed) + wishvel = normalize (wishvel) * sv_maxspeed; if (self.movetype == MOVETYPE_NOCLIP) self.velocity = wishvel; else if (self.flags & FL_ONGROUND) { - SV_UserFriction(); - SV_Accelerate(wishvel); + SV_UserFriction (); + SV_Accelerate (wishvel); } else SV_AirAccelerate (wishvel); }; @@ -308,7 +308,7 @@ void() SV_ClientThink = if (self.health <= 0) return; self.v_angle_z = 0; // V_CalcRoll removed, sucks - self.angles_z = self.v_angle_z * 4; + self.angles_z *= 4; vangle = self.v_angle + self.punchangle; if (!self.fixangle) { self.angles_x = (vangle_x / -3); @@ -318,14 +318,14 @@ void() SV_ClientThink = self.fixangle = 0; } if (self.flags & FL_WATERJUMP) { - SV_WaterJump(); + SV_WaterJump (); return; } if ((self.waterlevel >= 2) && (self.movetype != MOVETYPE_NOCLIP)) { - SV_WaterMove(); + SV_WaterMove (); return; } - SV_AirMove(); + SV_AirMove (); }; @@ -350,7 +350,7 @@ float() SV_RunThink = self.nextthink = 0; time = thinktime; other = NIL; - makevectors(self.v_angle); // hack + makevectors (self.v_angle); // hack self.think(); time = bkuptime; return TRUE; @@ -358,7 +358,7 @@ float() SV_RunThink = void(float scale) SV_AddGravity = { - self.velocity_z = self.velocity_z - (scale * sv_gravity * real_frametime); + self.velocity_z -= (scale * sv_gravity * real_frametime); }; float() SV_CheckWater = @@ -371,16 +371,16 @@ float() SV_CheckWater = self.waterlevel = 0; self.watertype = CONTENT_EMPTY; point_z = self.origin_z + self.mins_z + 1; - cont = pointcontents(point); + cont = pointcontents (point); if (cont <= CONTENT_WATER) { self.watertype = cont; self.waterlevel = 1; point_z = self.origin_z + (self.mins_z + self.maxs_z) * 0.5; - cont = pointcontents(point); + cont = pointcontents (point); if (cont <= CONTENT_WATER) { self.waterlevel = 2; point_z = self.origin_z + self.view_ofs_z; - cont = pointcontents(point); + cont = pointcontents (point); if (cont <= CONTENT_WATER) self.waterlevel = 3; } @@ -395,13 +395,13 @@ void() RemoveThud = // well sometimes if (other == NIL) { if (self.flags & FL_ONGROUND) { - self.flags = self.flags - FL_ONGROUND; + self.flags &= ~FL_ONGROUND; } } else { if (other.solid == SOLID_BSP && (self.flags & FL_ONGROUND)) { // RM: Does this break anything? // If not, then some more thuds have been removed. - self.flags = self.flags - FL_ONGROUND; + self.flags &= ~FL_ONGROUND; } if (other == self.owner) return; @@ -412,7 +412,7 @@ void() RemoveThud = // well sometimes self = oself; if (self.solid == SOLID_BSP) if (self.touch) - self.touch(); + self.touch (); } }; @@ -424,8 +424,8 @@ void() SV_CheckOnGround = org = self.origin; currentflags = self.flags; - self.flags = self.flags | FL_ONGROUND | FL_PARTIALGROUND; - walkmove(0,0); // perform C touch function + self.flags |= FL_ONGROUND | FL_PARTIALGROUND; + walkmove (0,0); // perform C touch function self.flags = currentflags | FL_ONGROUND; if ((org_x != self.origin_x) || (org_y != self.origin_y)) org = self.origin; @@ -435,15 +435,15 @@ void() SV_CheckOnGround = v_z = self.maxs_z + org_z + 1; traceline (org, v, TRUE, self); if ((self.waterlevel == 3) && (self.movetype == MOVETYPE_WALK)) - self.flags = self.flags - FL_ONGROUND; + self.flags &= ~FL_ONGROUND; else if ((trace_plane_normal_z <= 0.7) && (trace_fraction != 1)) - self.flags = self.flags - FL_ONGROUND; + self.flags &= ~FL_ONGROUND; else if (!droptofloor ()) - self.flags = self.flags - FL_ONGROUND; + self.flags &= ~FL_ONGROUND; else if (org_z - self.origin_z < 2) - self.flags = self.flags | FL_ONGROUND; + self.flags |= FL_ONGROUND; else - self.flags = self.flags - FL_ONGROUND; + self.flags &= ~FL_ONGROUND; setorigin(self, org); }; @@ -457,23 +457,23 @@ float(vector dir) botCheckForStep = currentorigin = self.origin; currentflags = self.flags; self.flags = FL_ONGROUND | FL_PARTIALGROUND; - dir = normalize(dir); + dir = normalize (dir); dir_z = 0; - yaw = vectoyaw(dir); - if(walkmove(yaw, 3)) { - if(droptofloor ()) { + yaw = vectoyaw (dir); + if (walkmove (yaw, 3)) { + if (droptofloor ()) { stepdistance = self.origin_z - currentorigin_z; v = self.origin - currentorigin; v_z = 0; - movedistance = vlen(v); - if((stepdistance > 0 && stepdistance <= 16) && movedistance != 0) { + movedistance = vlen (v); + if ((stepdistance > 0 && stepdistance <= 16) && movedistance != 0) { self.flags = currentflags | FL_PARTIALGROUND; return 1; } } } self.flags = currentflags; - setorigin(self, currentorigin); + setorigin (self, currentorigin); return 0; }; @@ -485,31 +485,31 @@ void(vector dir) BruteForceStep = currentorigin = self.origin; currentflags = self.flags; - len = vlen(dir); + len = vlen (dir); if (len > 16) - dir = normalize(dir) * 16; + dir = normalize (dir) * 16; - setorigin(self, currentorigin + dir); + setorigin (self, currentorigin + dir); - while(i < 18 && !walkmove(0, 0)) { + while(i < 18 && !walkmove (0, 0)) { self.origin_z = currentorigin_z + i; - i = i + 2; + i += 2; } self.flags = currentflags; - if (i >=18) - setorigin(self, currentorigin); + if (i >= 18) + setorigin (self, currentorigin); }; void() PostPhysics = { local vector obstr, org; - local float back, dst,cflags; + local float back, dst, cflags; self = self.owner; - self.velocity = self.velocity - self.phys_obj.dest1 + self.phys_obj.velocity; + self.velocity += self.phys_obj.velocity - self.phys_obj.dest1; if (self.phys_obj.dest2 == self.origin) { - setorigin(self, self.phys_obj.origin); + setorigin (self, self.phys_obj.origin); // might've been moved during other person's physics // (teleporters / plats) @@ -519,29 +519,29 @@ void() PostPhysics = if ((self.flags & FL_ONGROUND) || (self.waterlevel <= 2)) { obstr = self.phys_obj.movedir - self.origin; obstr_z = 0; - if (vlen(obstr) > 0.1) { - dst = vlen(obstr); - back = vectoyaw(obstr); + if (vlen (obstr) > 0.1) { + dst = vlen (obstr); + back = vectoyaw (obstr); cflags = self.flags; - self.flags = self.flags | FL_PARTIALGROUND; - if(walkmove(back, dst)) { + self.flags |= FL_PARTIALGROUND; + if (walkmove (back, dst)) { self.flags = cflags; self.phys_obj.dest1_z = 0; - self.velocity = self.velocity + self.phys_obj.dest1 - self.phys_obj.velocity; + self.velocity += self.phys_obj.dest1 - self.phys_obj.velocity; } else { if (dst > 1) - frik_obstructed(obstr, FALSE); + frik_obstructed (obstr, FALSE); org = self.origin; self.flags = cflags; obstr = self.phys_obj.dest1; obstr_x = 0; - if (!botCheckForStep(obstr)) { + if (!botCheckForStep (obstr)) { obstr = self.phys_obj.dest1; obstr_y = 0; - if (!botCheckForStep(obstr)) { + if (!botCheckForStep (obstr)) { // if no steps were found, bot is really obstucted - BruteForceStep(self.phys_obj.dest1); + BruteForceStep (self.phys_obj.dest1); } } } @@ -551,10 +551,10 @@ void() PostPhysics = } } - SV_CheckOnGround(); + SV_CheckOnGround (); - PlayerPostThink(); - BotAI(); + PlayerPostThink (); + BotAI (); self.dmg_take = self.dmg_save = 0; }; @@ -566,11 +566,12 @@ void() SV_FlyMove = // This is nothing like the Quake function. if (self.phys_obj == NIL) { - self.phys_obj = find(NIL,classname,"phys_obj"); + self.phys_obj = find(NIL, classname, "phys_obj"); while (self.phys_obj.owner != self) { - self.phys_obj = find(self.phys_obj,classname,"phys_obj"); + self.phys_obj = find (self.phys_obj, classname, "phys_obj"); if (self.phys_obj == NIL) { - error("No physics entity spawned!\nMake sure BotInit was called\n"); + error ("No physics entity spawned!\nMake sure BotInit was " + "called\n"); } } } @@ -580,12 +581,12 @@ void() SV_FlyMove = self.phys_obj.solid = SOLID_TRIGGER; self.phys_obj.touch = RemoveThud; - setsize(self.phys_obj, self.mins, self.maxs); + setsize (self.phys_obj, self.mins, self.maxs); self.phys_obj.dest2 = self.phys_obj.origin = self.origin; self.phys_obj.watertype = 0; self.phys_obj.movedir = self.origin + real_frametime * self.velocity; self.phys_obj.dest1 = self.phys_obj.velocity = self.velocity; - self.phys_obj.velocity_z = self.phys_obj.velocity_z + sv_gravity * real_frametime; + self.phys_obj.velocity_z += sv_gravity * real_frametime; self.phys_obj.flags = 0; self.phys_obj.think = PostPhysics; self.phys_obj.nextthink = time; @@ -593,59 +594,55 @@ void() SV_FlyMove = void() SV_Physics_Toss = { - if (!SV_RunThink()) + if (!SV_RunThink ()) return; if (self.flags & FL_ONGROUND) { self.velocity = '0 0 0'; - BotAI(); + BotAI (); return; } if (self.movetype != MOVETYPE_FLY) - SV_AddGravity(1); - self.angles = self.angles + real_frametime * self.avelocity; - SV_FlyMove(); + SV_AddGravity (1); + self.angles += real_frametime * self.avelocity; + SV_FlyMove (); }; -void() SV_Physics_Client = +void () +SV_Physics_Client = { - PlayerPreThink(); - + PlayerPreThink (); switch (self.movetype) { case MOVETYPE_NONE: - if (!SV_RunThink()) + if (!SV_RunThink ()) return; - PlayerPostThink(); - BotAI(); + PlayerPostThink (); + BotAI (); break; - case MOVETYPE_WALK: case MOVETYPE_STEP: - if (!SV_RunThink()) + if (!SV_RunThink ()) return; - if (!(SV_CheckWater()) && (!(self.flags & FL_WATERJUMP))) - SV_AddGravity(1); - SV_FlyMove(); + if (!(SV_CheckWater ()) && (!(self.flags & FL_WATERJUMP))) + SV_AddGravity (1); + SV_FlyMove (); break; - case MOVETYPE_TOSS: case MOVETYPE_BOUNCE: - SV_Physics_Toss(); + SV_Physics_Toss (); break; - case MOVETYPE_FLY: - if (!SV_RunThink()) + if (!SV_RunThink ()) return; - SV_FlyMove(); + SV_FlyMove (); break; - case MOVETYPE_NOCLIP: - if (!SV_RunThink()) + if (!SV_RunThink ()) return; - self.origin = self.origin + real_frametime * self.velocity; + self.origin += real_frametime * self.velocity; - PlayerPostThink(); - BotAI(); + PlayerPostThink (); + BotAI (); break; default: error ("SV_Physics_Client: Bad Movetype (BOT)"); diff --git a/fbxa/bot_qw.qc b/fbxa/bot_qw.qc index 05ef194..ec6b6f2 100644 --- a/fbxa/bot_qw.qc +++ b/fbxa/bot_qw.qc @@ -1,4 +1,3 @@ - /* ====================================== FrikBot X (Version 0.10.0) QW @@ -37,7 +36,6 @@ with applicable reexport restrictions. Any reproduction of this software must contain this notice in its entirety. - ====================================== These installation instructions only apply to QuakeWorld (as does this entire file). For Normal Quake, please refer to bot.qc @@ -77,32 +75,36 @@ ClientFixRankings(); // FrikBot #include "libfrikbot.h" -void() bot_map_load = +void () +bot_map_load = { // place your qc loaded waypoints here - - if (mapname == "dm1") - map_dm1(); - else if (mapname == "dm2") - map_dm2(); - else if (mapname == "dm3") - map_dm3(); - else if (mapname == "dm4") - map_dm4(); - else if (mapname == "dm5") - map_dm5(); - else if (mapname == "dm6") - map_dm6(); + switch (mapname) { + case "dm1": + map_dm1 (); + break; + case "dm2": + map_dm2 (); + break; + case "dm3": + map_dm3 (); + break; + case "dm4": + map_dm4 (); + break; + case "dm5": + map_dm5 (); + break; + case "dm6": + map_dm6 (); }; /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Variables and shtuff bot.qc has become pretty much a header file for all variable in the bot... - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ @@ -131,7 +133,6 @@ entity [32] phys_objects; .vector dyn_dest; .vector punchangle; // HACK - Don't want to screw with bot_phys - // -------globals----- integer max_clients; float real_frametime; @@ -161,8 +162,7 @@ void (entity e, integer ping) SV_SetPing = #0; /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Function redclarations. These allow function +Function redeclarations. These allow function designed to work for clients (sprint, so forth) to mainly not complain when working with a bot @@ -170,26 +170,28 @@ Although these shouldn't be needed anymore, as the bots truly are clients now, if you don't stop the SZ_ buffer from filling up by disabling direct messages to the bots, it crashes quake :-( - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -void(entity e) setspawnparms = +void (entity e) +setspawnparms = { if (e.ishuman) - frik_setspawnparms(e); + frik_setspawnparms (e); else - SetNewParms(); + SetNewParms (); }; -vector(entity e, float sped) aim = +vector (entity e, float sped) +aim = { e.missile_speed = sped; - return frik_aim(e, sped); + return frik_aim (e, sped); }; -void(entity e, float chan, string samp, float vol, float atten) sound = +void (entity e, float chan, string samp, float vol, float atten) +sound = { - frik_sound(e, chan, samp, vol, atten); + frik_sound (e, chan, samp, vol, atten); if (samp == "items/inv3.wav") return; else if (e.classname == "player") @@ -200,34 +202,34 @@ void(entity e, float chan, string samp, float vol, float atten) sound = /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Stuff mentioned up top it just links the bot into the mod - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -void() ClientFixRankings = +void () +ClientFixRankings = { local integer cno; if (self.switch_wallhug > time) return; self.switch_wallhug = 0; - b_temp2 = nextent(NIL); + b_temp2 = nextent (NIL); cno = 0; while (cno < max_clients) { if (!b_temp2.ishuman) { if (players[cno]) - UpdateClient(b_temp2); + UpdateClient (b_temp2); } cno++; - b_temp2 = nextent(b_temp2); + b_temp2 = nextent (b_temp2); } }; -void() ClientInRankings = +void () +ClientInRankings = { local float cno; local integer cl_no = ClientNumber (self); @@ -248,12 +250,13 @@ void() ClientInRankings = self.switch_wallhug = time + 1; }; - -void() ClientDisconnected = +void () +ClientDisconnected = { local integer cl_no = ClientNumber (self); players[cl_no] = NIL; }; + /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -262,39 +265,42 @@ bot easier to install -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -float () BotPreFrame = +float () +BotPreFrame = { if (self.b_clientno == -1) return TRUE; if (self.ishuman) if (self.switch_wallhug) - ClientFixRankings(); + ClientFixRankings (); if (self.b_frags != self.frags) { if (self.b_frags > self.frags) { - if (pointcontents(self.origin) == CONTENT_LAVA) - bot_start_topic(10); + if (pointcontents (self.origin) == CONTENT_LAVA) + bot_start_topic (10); else - bot_start_topic(9); + bot_start_topic (9); } else - bot_start_topic(2); + bot_start_topic (2); self.b_frags = self.frags; if (!self.ishuman) { - WriteByte(2, 14); - WriteByte(2, (float)self.b_clientno); - WriteShort(2, self.frags); + WriteByte (2, 14); + WriteByte (2, (float)self.b_clientno); + WriteShort (2, self.frags); } } DynamicWaypoint(); return FALSE; }; -float () BotPostFrame = +float () +BotPostFrame = { if (self.b_clientno == -1) return TRUE; if (self.ishuman) - BotImpulses(); + BotImpulses (); return FALSE; }; + /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -304,87 +310,87 @@ The rest of this code is in bot_rank.qc -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ -void(string h) BotSay = // simulate talking by composing a 'chat' message +void (string h) +BotSay = // simulate talking by composing a 'chat' message { - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 3); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, self.netname); - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 3); - WriteByte(MSG_ALL, 2); - WriteString(MSG_ALL, h); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 1); + WriteString (MSG_ALL, self.netname); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 2); + WriteString (MSG_ALL, h); }; -void() BotSayInit = + +void () +BotSayInit = { - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 3); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, self.netname); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 1); + WriteString (MSG_ALL, self.netname); }; -void(string h) BotSay2 = +void (string h) +BotSay2 = { - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 3); - WriteByte(MSG_ALL, 2); - WriteString(MSG_ALL, h); + WriteByte (MSG_ALL, 8); + WriteByte (MSG_ALL, 3); + WriteByte (MSG_ALL, 2); + WriteString (MSG_ALL, h); }; -void(string h) BotSayTeam = +void (string h) +BotSayTeam = { // FBX QW doesn't support teamplay...yet }; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BotInit +// BotInit ==================================================================== --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -void() BotInit = +void () +BotInit = { local entity ent; local integer numents = 0; // spawn entities for the physics - ent = nextent(NIL); + ent = nextent (NIL); max_clients = 0; - while(ent != NIL) { - max_clients = max_clients + 1; - ent = nextent(ent); + while (ent != NIL) { + max_clients++; + ent = nextent (ent); } - ent = nextent(NIL); + ent = nextent (NIL); while (numents < max_clients) { - phys_objects[numents] = spawn(); + phys_objects[numents] = spawn (); phys_objects[numents].classname = "phys_obj"; phys_objects[numents].owner = ent; numents++; - ent = nextent(ent); + ent = nextent (ent); } - bot_map_load(); + bot_map_load (); }; /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Rankings 'utilities'. Written by Alan Kivlin, this code just fools clients by sending precisely the same network messages as when a real player signs on to the server. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void(entity who) UpdateClient = +void (entity who) +UpdateClient = { local string bottomcolor = ftos (who.b_pants); local string topcolor = ftos (who.b_shirt); -dprint (who.netname); dprint ("\n"); + + dprint (who.netname); + dprint ("\n"); SV_SetPing (who, 100 * (3 - who.b_skill)); SV_SetUserinfo (who, "\\bottomcolor\\" + bottomcolor + "\\topcolor\\" + topcolor @@ -392,54 +398,55 @@ dprint (who.netname); dprint ("\n"); // FIXME: do teams properly }; -float(integer clientno) ClientBitFlag = +float (integer clientno) +ClientBitFlag = { local float bitflag; + bitflag = 1; - while(clientno > 0) { - bitflag = bitflag * 2; - clientno = clientno - 1; + while (clientno > 0) { + bitflag *= 2; + clientno--; } return bitflag; }; -integer() ClientNextAvailable = +integer () +ClientNextAvailable = { local integer clientno; + // I want to do this top down, but QW won't let me clientno = 0; - while(clientno < max_clients) { - clientno = clientno + 1; + while (clientno < max_clients) { + clientno++; - //FIXME if(!ClientIsActive(clientno)) + //FIXME if (!ClientIsActive (clientno)) return clientno; } return -1; }; - void(entity e1, entity e2, float flag) DeveloperLightning = {}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +// BotConnect and related functions. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BotConnect and related functions. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -entity(float num) GetClientEntity = +entity (float num) +GetClientEntity = { local entity upsy; + upsy = NIL; - num = num + 1; + num++; while (num > 0) { - num = num - 1; - upsy = nextent(upsy); + num--; + upsy = nextent (upsy); } return upsy; }; -integer (entity cl) ClientNumber = +integer (entity cl) +ClientNumber = { local entity e = NIL; local integer f = -1; @@ -451,7 +458,8 @@ integer (entity cl) ClientNumber = return f; }; -void(float whatbot, integer whatskill) BotConnect = +void (float whatbot, integer whatskill) +BotConnect = { local integer f; local entity uself; @@ -460,19 +468,19 @@ void(float whatbot, integer whatskill) BotConnect = uself = self; self = SV_AllocClient (); if (!self) { - bprint(PRINT_HIGH, "Unable to connect a bot, server is full.\n"); + bprint (PRINT_HIGH, "Unable to connect a bot, server is full.\n"); self = uself; return; } bot_count++; - bot_start_topic(1); + bot_start_topic (1); f = ClientNumber (self) + 1; self.b_clientno = f; self.colormap = (float) f; if (whatbot) - self.netname = BotName(whatbot); + self.netname = BotName (whatbot); else - self.netname = PickARandomName(); + self.netname = PickARandomName (); // players can set skill all weird, so leave these checks in if (whatskill > 3) @@ -482,55 +490,58 @@ void(float whatbot, integer whatskill) BotConnect = self.b_skill = whatskill; self.b_entertime = time; self.team = self.b_pants + 1; - UpdateClient(self); - SetNewParms(); + UpdateClient (self); + SetNewParms (); self.ishuman = 2; - ClientConnect(); - PutClientInServer(); + ClientConnect (); + PutClientInServer (); self = uself; }; -void(entity bot) BotDisconnect = +void (entity bot) +BotDisconnect = { local entity uself; + uself = self; self = bot; - bot_count = bot_count - 1; + bot_count--; - ClientDisconnect(); + ClientDisconnect (); setmodel (self.phys_obj, ""); SV_FreeClient (self); self = uself; }; -void() BotFrame = +void () +BotFrame = { local integer num; local string h; - h = infokey(NIL, "bot_options"); - b_options = stof(h); + h = infokey (NIL, "bot_options"); + b_options = stof (h); // for the sake of speed - sv_maxspeed = cvar("sv_maxspeed"); - sv_gravity = cvar("sv_gravity"); - sv_friction = cvar("sv_friction"); - sv_accelerate = cvar("sv_accelerate"); - sv_stopspeed = cvar("sv_stopspeed"); + sv_maxspeed = cvar ("sv_maxspeed"); + sv_gravity = cvar ("sv_gravity"); + sv_friction = cvar ("sv_friction"); + sv_accelerate = cvar ("sv_accelerate"); + sv_stopspeed = cvar ("sv_stopspeed"); real_frametime = time - lasttime; // in QW frametime is fuxx0red lasttime = time; - self = nextent(NIL); + self = nextent (NIL); num = 0; while (num < max_clients) { if (self.ishuman == FALSE) { if (self.b_clientno > 0) { - frik_obstacles(); - CL_KeyMove(); - SV_ClientThink(); - SV_Physics_Client(); + frik_obstacles (); + CL_KeyMove (); + SV_ClientThink (); + SV_Physics_Client (); // this is sickening if (self.phys_obj) { if (self.phys_obj.modelindex != self.modelindex) { @@ -544,31 +555,26 @@ void() BotFrame = } } } - self = nextent(self); - num = num + 1; + self = nextent (self); + num++; } }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Bot Impulses. Allows the player to perform bot related functions. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void() BotImpulses = +void () BotImpulses = { local integer f; local string h; if (self.impulse == 100) { - h = infokey(NIL, "skill"); - f = (integer) stof(h); - BotConnect(0, f); + h = infokey (NIL, "skill"); + f = (integer) stof (h); + BotConnect (0, f); } else if (self.impulse == 102) - KickABot(); + KickABot (); else return; self.impulse = 0; diff --git a/fbxa/bot_way.qc b/fbxa/bot_way.qc index b48f3b6..4e7fca3 100644 --- a/fbxa/bot_way.qc +++ b/fbxa/bot_way.qc @@ -44,22 +44,15 @@ this notice in its entirety. #include "libfrikbot.h" +// Waypoint Linking code ====================================================== - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Linking code - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -float (entity e1, entity e2) CheckLinked = +float (entity e1, entity e2) +CheckLinked = { if ((e1 == e2) || (e2 == NIL) || (e1 == NIL)) return FALSE; - else if (e1.target1 == e2) { + + if (e1.target1 == e2) { if (e1.b_aiflags & AI_TELELINK_1) return 2; else @@ -83,12 +76,12 @@ float (entity e1, entity e2) CheckLinked = return FALSE; }; - -float (entity e1, entity e2) LinkWays = +float (entity e1, entity e2) +LinkWays = { if ((e1 == e2) || (e2 == NIL) || (e1 == NIL)) return FALSE; - else if (CheckLinked(e1, e2)) + else if (CheckLinked (e1, e2)) return FALSE; // already linked!!! if (e1.target1 == NIL) { @@ -103,42 +96,40 @@ float (entity e1, entity e2) LinkWays = } else if (e1.target4 == NIL) { e1.target4 = e2; return TRUE; - } - else return FALSE; - + } else return FALSE; }; -// Link Ways part 2, used only for teleporters -float (entity e1, entity e2) TeleLinkWays = +// Link Ways part 2, used only for teleporters +float (entity e1, entity e2) +TeleLinkWays = { if ((e1 == e2) || (e2 == NIL) || (e1 == NIL)) return FALSE; - else if (CheckLinked(e1, e2)) + else if (CheckLinked (e1, e2)) return FALSE; // already linked!!! if (e1.target1 == NIL) { e1.target1 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_1; + e1.b_aiflags |= AI_TELELINK_1; return TRUE; } else if (e1.target2 == NIL) { e1.target2 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_2; + e1.b_aiflags |= AI_TELELINK_2; return TRUE; } else if (e1.target3 == NIL) { e1.target3 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_3; + e1.b_aiflags |= AI_TELELINK_3; return TRUE; } else if (e1.target4 == NIL) { e1.target4 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_4; + e1.b_aiflags |= AI_TELELINK_4; return TRUE; - } - else + } else return FALSE; - }; -void (entity e1, entity e2) UnlinkWays = +void (entity e1, entity e2) +UnlinkWays = { if ((e1 == e2) || (e2 == NIL) || (e1 == NIL)) return; @@ -146,62 +137,56 @@ void (entity e1, entity e2) UnlinkWays = return; if (e1.target1 == e2) { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_1); + e1.b_aiflags &= ~AI_TELELINK_1; e1.target1 = NIL; } if (e1.target2 == e2) { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_2); + e1.b_aiflags &= ~AI_TELELINK_2; e1.target2 = NIL; } if (e1.target3 == e2) { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_3); + e1.b_aiflags &= ~AI_TELELINK_3; e1.target3 = NIL; } if (e1.target4 == e2) { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_4); + e1.b_aiflags &= ~AI_TELELINK_4; e1.target4 = NIL; } - }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - FindWaypoint This is used quite a bit, by many different functions big lag causer Finds the closest, fisible, waypoint to e - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -entity(entity start) FindWayPoint = +entity (entity start) +FindWayPoint = { - local entity t; - local vector org; + local entity best, t; local float dst, tdst; - local entity best; + local vector org; - org = realorigin(self); + org = realorigin (self); - t = way_head; + t = way_head; if (start != NIL) { - dst = vlen(start.origin - org); + dst = vlen (start.origin - org); best = start; } else { dst = 100000; best = NIL; } - while(t) { + while (t) { // real players cut through ignore types if (dst < 20) return best; if (!(t.b_aiflags & AI_IGNORE_TYPES) || self.ishuman) { - tdst = vlen(t.origin - org); + tdst = vlen (t.origin - org); if (tdst < dst) { - if (sisible(t)) { + if (sisible (t)) { dst = tdst; best = t; } @@ -212,29 +197,25 @@ entity(entity start) FindWayPoint = return best; }; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Spawning Code - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ +// Waypoint Spawning Code ===================================================== entity way_foot; // Ugh. Do I need a foot for this or not? -entity(vector org) make_waypoint = +entity (vector org) +make_waypoint = { local entity point; - point = spawn(); + + point = spawn (); point.classname = "waypoint"; point.search_time = time; // don't double back for me; point.solid = SOLID_TRIGGER; point.movetype = MOVETYPE_NONE; point.items = -1; - setorigin(point, org); + setorigin (point, org); - setsize(point, VEC_HULL_MIN, VEC_HULL_MAX); - waypoints = waypoints + 1; + setsize (point, VEC_HULL_MIN, VEC_HULL_MAX); + waypoints++; if (!way_head) { way_head = point; way_foot = point; @@ -246,20 +227,16 @@ entity(vector org) make_waypoint = point.count = waypoints; if (waypoint_mode > WM_LOADED) // editor modes - setmodel(point, "progs/s_bubble.spr"); + setmodel (point, "progs/s_bubble.spr"); return point; }; /* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Dynamic Waypoint spawning and linking. Not very good all things considered. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ - -void() DynamicWaypoint = +void () +DynamicWaypoint = { local entity t; local float dist, dynlink = 0, dynpoint = 0, editor = 0; @@ -268,17 +245,16 @@ void() DynamicWaypoint = if (!(self.flags & FL_WATERJUMP)) { self.dyn_flags = 2; if (!self.ishuman) { - bot_lost(self.target1, TRUE); + bot_lost (self.target1, TRUE); self.enemy = NIL; } } self.portal_time = self.teleport_time; } -// stacking everything on waypoint_mode might've been good for the editor, -// but it sucks to beat hell for this code. + // stacking everything on waypoint_mode might've been good for the editor, + // but it sucks to beat hell for this code. - -// convert waypoint_mode to something more usable.. + // convert waypoint_mode to something more usable.. if (waypoint_mode > WM_LOADED) { if (self.ishuman) { if (waypoint_mode == WM_EDITOR_DYNLINK) @@ -290,28 +266,27 @@ void() DynamicWaypoint = } else if (waypoint_mode == WM_DYNAMIC) dynlink = dynpoint = 1; -// if there's nothing for dynamic to do.. + // if there's nothing for dynamic to do.. if (!dynpoint) { if (!editor) return; } -// for speed sake, I won't have bots dynamic waypoint in coop + // for speed sake, I won't have bots dynamic waypoint in coop if (!self.ishuman) if (coop) return; - -// don't waypoint in single player + // don't waypoint in single player if (max_clients < 2) return; -// if you're dead + // if you're dead else if (self.health <= 0) { if (dynpoint) { if (self.current_way) { if (pointcontents(self.origin) < -4) { if (self.current_way.b_aiflags & AI_BLIND) - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; + self.current_way.b_aiflags |= AI_PRECISION; else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; + self.current_way.b_aiflags |= AI_BLIND; } } } @@ -321,7 +296,7 @@ void() DynamicWaypoint = return; } -// you shouldn't be making waypoints mid air + // you shouldn't be making waypoints mid air if (dynpoint) { if (!((self.flags & FL_ONGROUND) || self.waterlevel == 3)) { if (self.dyn_flags != 2) { @@ -330,42 +305,45 @@ void() DynamicWaypoint = return; } } -// keep from doing the rest of this every frame + // keep from doing the rest of this every frame if (self.dyn_time > time) return; self.dyn_time = time + 0.2; -// display the links for editor mode + // display the links for editor mode if (editor) { if (self.current_way) { if (self.current_way.target1) - DeveloperLightning(self.current_way, self.current_way.target1, self.current_way.b_aiflags & AI_TELELINK_1); + DeveloperLightning (self.current_way, self.current_way.target1, + self.current_way.b_aiflags & AI_TELELINK_1); if (self.current_way.target2) - DeveloperLightning(self.current_way, self.current_way.target2, self.current_way.b_aiflags & AI_TELELINK_2); + DeveloperLightning (self.current_way, self.current_way.target2, + self.current_way.b_aiflags & AI_TELELINK_2); if (self.current_way.target3) - DeveloperLightning(self.current_way, self.current_way.target3, self.current_way.b_aiflags & AI_TELELINK_3); + DeveloperLightning (self.current_way, self.current_way.target3, + self.current_way.b_aiflags & AI_TELELINK_3); if (self.current_way.target4) - DeveloperLightning(self.current_way, self.current_way.target4, self.current_way.b_aiflags & AI_TELELINK_4); + DeveloperLightning (self.current_way, self.current_way.target4, + self.current_way.b_aiflags & AI_TELELINK_4); } if (self.b_aiflags & AI_HOLD_SELECT) return; } - t = FindWayPoint(self.current_way); + t = FindWayPoint (self.current_way); if (t) { - dist = vlen(self.origin - t.origin); + dist = vlen (self.origin - t.origin); if (dist < 192) { if (dist < 64) { - if (t != self.current_way) { if (dynlink) { if (!self.dyn_flags) { - if (wisible(t, self.current_way)) - LinkWays(t, self.current_way); + if (wisible (t, self.current_way)) + LinkWays (t, self.current_way); } if (self.dyn_flags == 2) - TeleLinkWays(self.current_way, t); - else if (wisible(t, self.current_way)) + TeleLinkWays (self.current_way, t); + else if (wisible (t, self.current_way)) LinkWays(self.current_way, t); } if (editor) { diff --git a/fbxa/map_dm1.qc b/fbxa/map_dm1.qc index b068bbd..fc6d61e 100644 --- a/fbxa/map_dm1.qc +++ b/fbxa/map_dm1.qc @@ -5,49 +5,50 @@ readme.html that comes with FrikBot */ #include "libfrikbot.h" // Ways by Electro -void() map_dm1 = +void () +map_dm1 = { - make_way('639.9 716.3 46.0', '2 22 0', 0, 0); - make_way('1040.1 749.3 94.0', '1 3 0', 0, 0); - make_way('1053.5 1321.0 94.0', '2 4 0', 0, 0); - make_way('782.5 1313.2 46.0', '6 41 0', 0, 0); - make_way('584.6 882.9 46.0', '4 6 41', 0, 0); - make_way('934.2 1048.0 46.0', '4 5 41', 0, 0); - make_way('447.8 1313.4 42.0', '41 31 8', 0, 0); - make_way('435.8 1562.0 46.0', '7 9 0', 0, 0); - make_way('238.3 1592.6 46.0', '8 10 19', 0, 0); - make_way('-122.1 1582.6 -98.0', '9 11 0', 0, 0); - make_way('-127.2 1414.0 -98.0', '10 12 0', 0, 0); - make_way('113.2 1416.1 -98.0', '11 13 0', 0, 0); - make_way('108.8 1286.5 -98.0', '12 14 15', 35, 0); - make_way('417.0 1258.0 -98.0', '13 39 35', 0, 0); - make_way('152.0 951.8 -98.0', '13 16 35', 0, 0); - make_way('168.6 776.6 -98.0', '15 17 0', 0, 0); - make_way('-283.5 879.9 -98.0', '16 42 0', 0, 0); - make_way('396.7 1594.7 -98.0', '39 7 0', 0, 2); - make_way('253.6 1416.7 46.0', '9 20 0', 0, 128); - make_way('-126.0 1418.0 50.8', '19 21 0', 0, 32784); - make_way('-359.5 1398.6 46.0', '40 0 0', 0, 0); - make_way('596.8 603.6 46.0', '1 23 0', 0, 0); - make_way('484.9 598.6 46.0', '22 24 38', 0, 0); - make_way('77.0 614.3 46.0', '23 25 0', 0, 0); - make_way('56.8 738.3 46.0', '24 26 15', 42, 0); - make_way('-501.1 769.8 46.0', '25 27 0', 0, 0); - make_way('-534.0 988.3 46.0', '26 28 0', 0, 0); - make_way('-654.8 991.8 46.0', '27 29 0', 0, 0); - make_way('-650.7 1227.0 46.0', '28 30 36', 0, 0); - make_way('-523.7 1591.5 46.0', '29 10 43', 0, 128); - make_way('443.3 1145.0 46.0', '7 32 33', 0, 0); - make_way('220.2 1235.6 46.0', '31 34 0', 0, 0); - make_way('177.9 1026.7 46.0', '31 34 0', 0, 0); - make_way('28.2 1157.3 46.0', '33 32 35', 0, 128); - make_way('178.2 1111.7 -98.0', '13 15 42', 14, 0); - make_way('-307.0 1218.6 94.0', '29 37 43', 0, 0); - make_way('-292.1 1100.2 94.0', '36 17 42', 0, 0); - make_way('463.9 816.7 46.0', '23 16 15', 0, 128); - make_way('434.7 1451.0 -98.0', '18 0 0', 0, 128); - make_way('-314.2 1410.9 46.0', '11 0 0', 0, 256); - make_way('599.9 1309.0 46.0', '4 5 7', 6, 0); - make_way('-321.9 1006.5 -98.0', '17 35 0', 0, 0); - make_way('-542.5 1222.3 46.0', '30 36 0', 0, 0); + make_way ('639.9 716.3 46.0', '2 22 0', 0, 0); + make_way ('1040.1 749.3 94.0', '1 3 0', 0, 0); + make_way ('1053.5 1321.0 94.0', '2 4 0', 0, 0); + make_way ('782.5 1313.2 46.0', '6 41 0', 0, 0); + make_way ('584.6 882.9 46.0', '4 6 41', 0, 0); + make_way ('934.2 1048.0 46.0', '4 5 41', 0, 0); + make_way ('447.8 1313.4 42.0', '41 31 8', 0, 0); + make_way ('435.8 1562.0 46.0', '7 9 0', 0, 0); + make_way ('238.3 1592.6 46.0', '8 10 19', 0, 0); + make_way ('-122.1 1582.6 -98.0', '9 11 0', 0, 0); + make_way ('-127.2 1414.0 -98.0', '10 12 0', 0, 0); + make_way ('113.2 1416.1 -98.0', '11 13 0', 0, 0); + make_way ('108.8 1286.5 -98.0', '12 14 15', 35, 0); + make_way ('417.0 1258.0 -98.0', '13 39 35', 0, 0); + make_way ('152.0 951.8 -98.0', '13 16 35', 0, 0); + make_way ('168.6 776.6 -98.0', '15 17 0', 0, 0); + make_way ('-283.5 879.9 -98.0', '16 42 0', 0, 0); + make_way ('396.7 1594.7 -98.0', '39 7 0', 0, 2); + make_way ('253.6 1416.7 46.0', '9 20 0', 0, 128); + make_way ('-126.0 1418.0 50.8', '19 21 0', 0, 32784); + make_way ('-359.5 1398.6 46.0', '40 0 0', 0, 0); + make_way ('596.8 603.6 46.0', '1 23 0', 0, 0); + make_way ('484.9 598.6 46.0', '22 24 38', 0, 0); + make_way ('77.0 614.3 46.0', '23 25 0', 0, 0); + make_way ('56.8 738.3 46.0', '24 26 15', 42, 0); + make_way ('-501.1 769.8 46.0', '25 27 0', 0, 0); + make_way ('-534.0 988.3 46.0', '26 28 0', 0, 0); + make_way ('-654.8 991.8 46.0', '27 29 0', 0, 0); + make_way ('-650.7 1227.0 46.0', '28 30 36', 0, 0); + make_way ('-523.7 1591.5 46.0', '29 10 43', 0, 128); + make_way ('443.3 1145.0 46.0', '7 32 33', 0, 0); + make_way ('220.2 1235.6 46.0', '31 34 0', 0, 0); + make_way ('177.9 1026.7 46.0', '31 34 0', 0, 0); + make_way ('28.2 1157.3 46.0', '33 32 35', 0, 128); + make_way ('178.2 1111.7 -98.0', '13 15 42', 14, 0); + make_way ('-307.0 1218.6 94.0', '29 37 43', 0, 0); + make_way ('-292.1 1100.2 94.0', '36 17 42', 0, 0); + make_way ('463.9 816.7 46.0', '23 16 15', 0, 128); + make_way ('434.7 1451.0 -98.0', '18 0 0', 0, 128); + make_way ('-314.2 1410.9 46.0', '11 0 0', 0, 256); + make_way ('599.9 1309.0 46.0', '4 5 7', 6, 0); + make_way ('-321.9 1006.5 -98.0', '17 35 0', 0, 0); + make_way ('-542.5 1222.3 46.0', '30 36 0', 0, 0); }; diff --git a/fbxa/map_dm2.qc b/fbxa/map_dm2.qc index 282c891..ba4028b 100644 --- a/fbxa/map_dm2.qc +++ b/fbxa/map_dm2.qc @@ -5,94 +5,95 @@ readme.html that comes with FrikBot */ #include "libfrikbot.h" // Ways by Frika C -void() map_dm2 = +void () +map_dm2 = { - make_way('2441.0 -189.1 46.0', '2 72 0', 0, 0); - make_way('2036.7 -141.6 46.0', '26 1 41', 46, 0); - make_way('2126.7 238.6 46.0', '0 43 41', 0, 0); - make_way('2615.4 -7.7 142.0', '68 41 0', 0, 0); - make_way('2614.6 -781.7 142.0', '73 6 62', 0, 0); - make_way('2455.8 -830.3 142.0', '5 7 48', 62, 0); - make_way('2511.8 -1395.2 46.0', '8 11 62', 0, 0); - make_way('2481.5 -1681.3 46.0', '28 9 7', 0, 0); - make_way('2391.6 -1861.9 46.0', '10 8 0', 0, 0); - make_way('2184.0 -1867.0 46.0', '53 9 0', 0, 0); - make_way('2741.6 -1424.7 46.0', '7 12 0', 0, 0); - make_way('2735.0 -1693.3 142.0', '11 47 0', 0, 0); - make_way('2927.9 -1852.4 142.0', '47 14 0', 0, 16); - make_way('2946.4 -1993.7 142.0', '13 37 0', 0, 16); - make_way('2254.5 -185.3 -114.0', '16 0 0', 0, 0); - make_way('2249.8 -27.2 -114.0', '15 17 0', 0, 0); - make_way('2611.8 -8.2 -50.0', '44 16 45', 0, 0); - make_way('1347.5 -1024.0 366.0', '59 58 0', 0, 0); - make_way('2002.3 -1024.0 366.0', '35 0 0', 0, 0); - make_way('1330.1 -714.6 366.0', '18 0 59', 0, 1024); - make_way('1323.0 -381.6 206.0', '22 24 0', 0, 0); - make_way('1328.2 -487.0 206.0', '21 20 61', 0, 0); - make_way('1559.7 -654.4 206.0', '0 60 0', 0, 0); - make_way('1837.4 -363.6 206.0', '21 25 0', 0, 0); - make_way('1877.0 -652.0 206.0', '24 26 0', 0, 0); - make_way('2038.3 -473.0 126.0', '2 27 50', 0, 0); - make_way('1683.4 -506.8 46.0', '26 64 63', 71, 0); - make_way('1699.3 -1694.6 46.0', '65 8 0', 0, 65536); - make_way('1697.9 -1336.4 42.0', '35 31 30', 65, 32784); - make_way('2058.4 -1354.2 158.0', '29 33 0', 0, 0); - make_way('1307.4 -1338.4 166.0', '29 32 0', 0, 0); - make_way('1315.8 -1034.8 222.0', '31 36 0', 0, 0); - make_way('2043.6 -1030.7 222.0', '30 34 0', 0, 0); - make_way('2043.6 -904.3 54.0', '35 0 0', 0, 1); - make_way('1696.0 -1037.4 42.0', '64 29 55', 56, 32784); - make_way('1307.4 -872.6 54.0', '35 0 0', 0, 1); - make_way('2733.5 -2008.2 142.0', '38 0 0', 0, 0); - make_way('2731.0 -2283.1 142.0', '37 39 0', 0, 0); - make_way('2425.1 -2305.7 142.0', '38 40 0', 0, 0); - make_way('2423.1 -2444.5 142.0', '39 67 31', 0, 4); - make_way('2175.6 -55.9 46.0', '4 2 0', 3, 0); - make_way('2181.9 -2388.8 222.0', '67 70 0', 0, 0); - make_way('2347.3 317.0 30.0', '3 74 0', 0, 0); - make_way('2644.7 235.2 -50.0', '74 17 0', 0, 0); - make_way('2806.9 -27.3 -50.0', '18 0 0', 0, 1); - make_way('2408.5 -401.3 30.0', '2 0 0', 0, 0); - make_way('2742.7 -1857.6 142.0', '12 13 0', 0, 0); - make_way('2352.0 -858.9 78.0', '49 0 0', 0, 0); - make_way('2375.9 -685.3 78.0', '48 46 0', 0, 0); - make_way('1971.3 -556.1 126.0', '25 0 0', 0, 4096); - make_way('2429.1 -1968.0 142.0', '52 66 0', 0, 128); - make_way('2280.0 -1968.0 142.0', '51 53 0', 0, 160); - make_way('2170.1 -1977.8 94.0', '10 69 0', 0, 160); - make_way('2189.7 -2258.8 106.0', '42 0 0', 0, 4096); - make_way('1424.0 -944.4 42.0', '35 0 0', 0, 32768); - make_way('1908.5 -928.4 42.0', '35 0 0', 0, 32768); - make_way('1825.4 -1029.8 366.0', '19 0 0', 0, 2048); - make_way('1512.9 -1015.2 366.0', '18 57 0', 0, 2048); - make_way('1264.0 -721.5 366.0', '20 22 18', 0, 0); - make_way('1440.6 -673.6 206.0', '23 61 0', 0, 32); - make_way('1449.1 -566.9 206.0', '60 22 63', 0, 32); - make_way('2525.9 -867.2 142.0', '6 0 5', 0, 1024); - make_way('1545.7 -488.4 46.0', '27 0 0', 0, 128); - make_way('1687.9 -744.0 42.0', '27 35 0', 0, 32784); - make_way('1700.6 -1513.2 46.0', '29 28 0', 0, 0); - make_way('2553.9 -1971.9 142.0', '51 0 0', 0, 160); - make_way('2160.2 -2469.1 222.0', '42 40 0', 0, 0); - make_way('2601.2 -176.0 142.0', '4 73 0', 0, 0); - make_way('2178.2 -2134.2 106.0', '53 54 70', 0, 0); - make_way('2172.0 -2347.6 110.0', '69 75 0', 0, 0); - make_way('1622.4 -528.7 46.0', '61 0 0', 0, 4096); - make_way('2576.0 -192.1 54.0', '1 0 0', 0, 0); - make_way('2611.3 -441.3 142.0', '5 68 0', 0, 0); - make_way('2456.5 297.3 -34.0', '43 44 0', 0, 0); - make_way('2168.4 -2336.3 110.0', '76 0 0', 0, 16); - make_way('2165.7 -1808.0 46.0', '77 0 0', 0, 0); - make_way('2529.4 -1844.5 46.0', '78 0 0', 0, 0); - make_way('2585.1 -1394.2 46.0', '79 0 0', 0, 0); - make_way('2752.6 -1389.0 46.0', '80 0 0', 0, 0); - make_way('2734.7 -1822.2 142.0', '81 0 0', 0, 0); - make_way('2980.3 -1832.3 142.0', '82 0 0', 0, 16); - make_way('2957.0 -2032.2 142.0', '83 0 0', 0, 16); - make_way('2720.9 -2057.8 150.0', '84 0 0', 0, 0); - make_way('2693.6 -2275.7 142.0', '85 0 0', 0, 0); - make_way('2429.9 -2295.8 142.0', '86 0 0', 0, 0); - make_way('2431.5 -2115.8 142.0', '51 0 0', 0, 32784); + make_way ('2441.0 -189.1 46.0', '2 72 0', 0, 0); + make_way ('2036.7 -141.6 46.0', '26 1 41', 46, 0); + make_way ('2126.7 238.6 46.0', '0 43 41', 0, 0); + make_way ('2615.4 -7.7 142.0', '68 41 0', 0, 0); + make_way ('2614.6 -781.7 142.0', '73 6 62', 0, 0); + make_way ('2455.8 -830.3 142.0', '5 7 48', 62, 0); + make_way ('2511.8 -1395.2 46.0', '8 11 62', 0, 0); + make_way ('2481.5 -1681.3 46.0', '28 9 7', 0, 0); + make_way ('2391.6 -1861.9 46.0', '10 8 0', 0, 0); + make_way ('2184.0 -1867.0 46.0', '53 9 0', 0, 0); + make_way ('2741.6 -1424.7 46.0', '7 12 0', 0, 0); + make_way ('2735.0 -1693.3 142.0', '11 47 0', 0, 0); + make_way ('2927.9 -1852.4 142.0', '47 14 0', 0, 16); + make_way ('2946.4 -1993.7 142.0', '13 37 0', 0, 16); + make_way ('2254.5 -185.3 -114.0', '16 0 0', 0, 0); + make_way ('2249.8 -27.2 -114.0', '15 17 0', 0, 0); + make_way ('2611.8 -8.2 -50.0', '44 16 45', 0, 0); + make_way ('1347.5 -1024.0 366.0', '59 58 0', 0, 0); + make_way ('2002.3 -1024.0 366.0', '35 0 0', 0, 0); + make_way ('1330.1 -714.6 366.0', '18 0 59', 0, 1024); + make_way ('1323.0 -381.6 206.0', '22 24 0', 0, 0); + make_way ('1328.2 -487.0 206.0', '21 20 61', 0, 0); + make_way ('1559.7 -654.4 206.0', '0 60 0', 0, 0); + make_way ('1837.4 -363.6 206.0', '21 25 0', 0, 0); + make_way ('1877.0 -652.0 206.0', '24 26 0', 0, 0); + make_way ('2038.3 -473.0 126.0', '2 27 50', 0, 0); + make_way ('1683.4 -506.8 46.0', '26 64 63', 71, 0); + make_way ('1699.3 -1694.6 46.0', '65 8 0', 0, 65536); + make_way ('1697.9 -1336.4 42.0', '35 31 30', 65, 32784); + make_way ('2058.4 -1354.2 158.0', '29 33 0', 0, 0); + make_way ('1307.4 -1338.4 166.0', '29 32 0', 0, 0); + make_way ('1315.8 -1034.8 222.0', '31 36 0', 0, 0); + make_way ('2043.6 -1030.7 222.0', '30 34 0', 0, 0); + make_way ('2043.6 -904.3 54.0', '35 0 0', 0, 1); + make_way ('1696.0 -1037.4 42.0', '64 29 55', 56, 32784); + make_way ('1307.4 -872.6 54.0', '35 0 0', 0, 1); + make_way ('2733.5 -2008.2 142.0', '38 0 0', 0, 0); + make_way ('2731.0 -2283.1 142.0', '37 39 0', 0, 0); + make_way ('2425.1 -2305.7 142.0', '38 40 0', 0, 0); + make_way ('2423.1 -2444.5 142.0', '39 67 31', 0, 4); + make_way ('2175.6 -55.9 46.0', '4 2 0', 3, 0); + make_way ('2181.9 -2388.8 222.0', '67 70 0', 0, 0); + make_way ('2347.3 317.0 30.0', '3 74 0', 0, 0); + make_way ('2644.7 235.2 -50.0', '74 17 0', 0, 0); + make_way ('2806.9 -27.3 -50.0', '18 0 0', 0, 1); + make_way ('2408.5 -401.3 30.0', '2 0 0', 0, 0); + make_way ('2742.7 -1857.6 142.0', '12 13 0', 0, 0); + make_way ('2352.0 -858.9 78.0', '49 0 0', 0, 0); + make_way ('2375.9 -685.3 78.0', '48 46 0', 0, 0); + make_way ('1971.3 -556.1 126.0', '25 0 0', 0, 4096); + make_way ('2429.1 -1968.0 142.0', '52 66 0', 0, 128); + make_way ('2280.0 -1968.0 142.0', '51 53 0', 0, 160); + make_way ('2170.1 -1977.8 94.0', '10 69 0', 0, 160); + make_way ('2189.7 -2258.8 106.0', '42 0 0', 0, 4096); + make_way ('1424.0 -944.4 42.0', '35 0 0', 0, 32768); + make_way ('1908.5 -928.4 42.0', '35 0 0', 0, 32768); + make_way ('1825.4 -1029.8 366.0', '19 0 0', 0, 2048); + make_way ('1512.9 -1015.2 366.0', '18 57 0', 0, 2048); + make_way ('1264.0 -721.5 366.0', '20 22 18', 0, 0); + make_way ('1440.6 -673.6 206.0', '23 61 0', 0, 32); + make_way ('1449.1 -566.9 206.0', '60 22 63', 0, 32); + make_way ('2525.9 -867.2 142.0', '6 0 5', 0, 1024); + make_way ('1545.7 -488.4 46.0', '27 0 0', 0, 128); + make_way ('1687.9 -744.0 42.0', '27 35 0', 0, 32784); + make_way ('1700.6 -1513.2 46.0', '29 28 0', 0, 0); + make_way ('2553.9 -1971.9 142.0', '51 0 0', 0, 160); + make_way ('2160.2 -2469.1 222.0', '42 40 0', 0, 0); + make_way ('2601.2 -176.0 142.0', '4 73 0', 0, 0); + make_way ('2178.2 -2134.2 106.0', '53 54 70', 0, 0); + make_way ('2172.0 -2347.6 110.0', '69 75 0', 0, 0); + make_way ('1622.4 -528.7 46.0', '61 0 0', 0, 4096); + make_way ('2576.0 -192.1 54.0', '1 0 0', 0, 0); + make_way ('2611.3 -441.3 142.0', '5 68 0', 0, 0); + make_way ('2456.5 297.3 -34.0', '43 44 0', 0, 0); + make_way ('2168.4 -2336.3 110.0', '76 0 0', 0, 16); + make_way ('2165.7 -1808.0 46.0', '77 0 0', 0, 0); + make_way ('2529.4 -1844.5 46.0', '78 0 0', 0, 0); + make_way ('2585.1 -1394.2 46.0', '79 0 0', 0, 0); + make_way ('2752.6 -1389.0 46.0', '80 0 0', 0, 0); + make_way ('2734.7 -1822.2 142.0', '81 0 0', 0, 0); + make_way ('2980.3 -1832.3 142.0', '82 0 0', 0, 16); + make_way ('2957.0 -2032.2 142.0', '83 0 0', 0, 16); + make_way ('2720.9 -2057.8 150.0', '84 0 0', 0, 0); + make_way ('2693.6 -2275.7 142.0', '85 0 0', 0, 0); + make_way ('2429.9 -2295.8 142.0', '86 0 0', 0, 0); + make_way ('2431.5 -2115.8 142.0', '51 0 0', 0, 32784); }; // End dump diff --git a/fbxa/map_dm3.qc b/fbxa/map_dm3.qc index f78c3ce..06fee7e 100644 --- a/fbxa/map_dm3.qc +++ b/fbxa/map_dm3.qc @@ -5,145 +5,146 @@ wayedit.txt that comes with FrikBot */ #include "libfrikbot.h" // Ways by Frika C -void() map_dm3 = +void () +map_dm3 = { - make_way('-888.8 -71.0 6.0', '44 3 2', 0, 0); - make_way('-937.4 19.2 6.0', '3 1 45', 0, 0); - make_way('-827.2 26.1 6.0', '1 2 4', 0, 0); - make_way('-801.5 366.8 6.0', '3 5 0', 0, 0); - make_way('-783.8 774.2 6.0', '4 6 0', 0, 0); - make_way('-550.2 759.6 6.0', '5 7 0', 0, 0); - make_way('-574.0 368.0 6.0', '6 8 0', 0, 0); - make_way('-430.2 378.3 6.0', '7 9 0', 0, 0); - make_way('-406.9 784.0 6.0', '8 10 0', 0, 0); - make_way('-259.9 772.3 6.0', '9 11 12', 0, 0); - make_way('-243.7 250.5 14.0', '10 12 0', 0, 0); - make_way('-35.8 581.6 62.0', '10 11 13', 14, 0); - make_way(' 29.5 647.5 62.0', '12 15 49', 0, 0); - make_way('521.9 603.4 78.0', '12 15 0', 0, 0); - make_way('507.6 514.3 78.0', '14 13 16', 0, 0); - make_way('504.3 308.4 78.0', '15 20 17', 0, 0); - make_way('175.2 -34.7 78.0', '16 19 20', 18, 0); - make_way('485.8 -387.2 78.0', '17 21 19', 0, 0); - make_way('368.0 -201.7 78.0', '17 18 51', 0, 0); - make_way('397.0 124.9 78.0', '16 17 51', 0, 0); - make_way('496.0 -558.1 78.0', '18 22 58', 31, 0); - make_way('147.5 -528.0 174.0', '21 23 0', 0, 128); - make_way('-213.3 -528.0 174.0', '22 24 0', 0, 128); - make_way('-229.6 -865.0 174.0', '23 25 0', 0, 128); - make_way('339.0 -873.6 286.0', '24 26 0', 0, 128); - make_way('341.2 -538.2 286.0', '25 27 0', 0, 128); - make_way('-143.0 -535.0 350.0', '26 28 0', 0, 128); - make_way('-143.3 -696.6 350.0', '27 29 0', 0, 128); - make_way('283.6 -703.7 350.0', '28 30 0', 0, 128); - make_way('371.0 -699.8 286.0', '31 0 0', 0, 128); - make_way('416.0 -691.3 6.0', '33 32 0', 0, 0); - make_way('253.9 -794.9 6.0', '31 57 34', 0, 0); - make_way('253.7 -610.4 6.0', '57 31 0', 0, 0); - make_way('-64.0 -727.5 6.0', '32 35 36', 37, 0); - make_way('-40.6 -874.3 6.0', '34 37 58', 0, 128); - make_way(' 43.7 -535.1 6.0', '37 57 34', 56, 0); - make_way('-172.1 -560.9 6.0', '38 36 35', 34, 0); - make_way('-298.6 -563.7 6.0', '39 37 0', 0, 0); - make_way('-318.6 -710.5 6.0', '38 40 0', 0, 0); - make_way('-629.4 -683.2 6.0', '39 41 0', 0, 0); - make_way('-626.9 -449.0 6.0', '40 42 43', 0, 0); - make_way('-565.7 -449.0 6.0', '41 19 0', 0, 2); - make_way('-654.9 -271.1 6.0', '41 44 0', 0, 0); - make_way('-873.3 -247.0 6.0', '43 1 0', 0, 0); - make_way('-939.9 347.7 142.0', '46 2 0', 0, 0); - make_way('-912.7 821.5 142.0', '47 45 5', 0, 0); - make_way('-577.0 859.7 142.0', '50 46 48', 0, 0); - make_way('-556.0 784.6 142.0', '47 6 59', 0, 256); - make_way('-98.5 799.3 142.0', '13 50 0', 0, 0); - make_way('-198.8 861.0 142.0', '49 47 10', 0, 0); - make_way('584.5 -30.1 -146.0', '52 69 71', 0, 0); - make_way('288.5 -27.4 -154.0', '53 51 0', 0, 0); - make_way('126.7 -188.8 -154.0', '54 52 0', 0, 0); - make_way('-164.4 -210.3 -154.0', '55 53 0', 0, 0); - make_way('-177.9 -425.6 -90.0', '56 54 0', 0, 0); - make_way(' 52.6 -443.0 -10.0', '36 55 0', 0, 0); - make_way(' 71.4 -634.1 6.0', '36 33 32', 0, 0); - make_way('496.0 -880.0 78.0', '35 21 31', 0, 128); - make_way('-528.0 664.4 142.0', '60 6 0', 0, 65536); - make_way('-496.8 461.0 142.0', '59 8 7', 61, 65792); - make_way('-466.9 320.2 142.0', '62 11 7', 60, 65824); - make_way('-459.7 277.2 166.0', '63 0 0', 0, 65824); - make_way('-467.3 208.0 198.0', '11 64 0', 0, 65536); - make_way('-719.9 208.0 206.0', '63 68 0', 0, 65664); - make_way('-825.0 251.2 206.0', '68 66 3', 0, 65792); - make_way('-799.7 108.2 206.0', '67 2 0', 0, 65568); - make_way('-688.0 99.6 206.0', '66 0 0', 0, 65536); - make_way('-797.7 318.5 206.0', '65 64 45', 0, 65664); - make_way('822.8 -265.4 -162.0', '51 70 0', 0, 0); - make_way('1000.0 -29.9 -162.0', '71 69 122', 0, 0); - make_way('827.2 198.1 -162.0', '51 70 0', 0, 0); - make_way('1970.0 -31.5 -146.0', '123 78 73', 0, 0); - make_way('1982.6 197.3 -66.0', '72 74 0', 0, 0); - make_way('1964.1 437.3 -66.0', '73 75 76', 0, 0); - make_way('1544.8 491.8 -66.0', '74 76 0', 0, 0); - make_way('1693.0 400.0 -66.0', '75 74 77', 0, 256); - make_way('1695.4 362.0 -42.0', '132 131 0', 0, 0); - make_way('1963.1 -436.8 -2.0', '72 79 0', 0, 0); - make_way('1380.4 -427.4 -2.0', '78 102 80', 0, 0); - make_way('1186.5 -681.2 -2.0', '81 79 121', 0, 0); - make_way('1322.4 -745.5 -2.0', '82 80 0', 0, 0); - make_way('1461.8 -756.2 -2.0', '85 83 81', 0, 0); - make_way('1432.7 -944.0 -2.0', '82 84 0', 0, 0); - make_way('1248.5 -926.6 -2.0', '83 101 0', 0, 2); - make_way('1707.9 -715.7 -2.0', '86 82 0', 0, 0); - make_way('1821.0 -850.6 -2.0', '87 85 0', 0, 0); - make_way('1531.5 -899.7 110.0', '88 86 82', 85, 0); - make_way('1125.5 -896.2 110.0', '89 87 0', 0, 0); - make_way('986.5 -799.6 110.0', '90 88 80', 121, 0); - make_way('811.1 -657.7 110.0', '91 89 0', 0, 0); - make_way('658.1 -638.4 110.0', '92 90 0', 0, 0); - make_way('656.0 -356.4 78.0', '93 91 0', 0, 0); - make_way('824.9 -256.7 78.0', '94 92 51', 0, 0); - make_way('952.1 -32.8 78.0', '95 93 0', 0, 0); - make_way('817.3 175.9 78.0', '96 94 51', 0, 0); - make_way('633.2 323.0 78.0', '97 95 0', 0, 0); - make_way('631.7 415.3 78.0', '98 96 0', 0, 0); - make_way('822.9 444.2 78.0', '99 101 97', 0, 0); - make_way('1111.5 624.0 78.0', '101 100 98', 0, 256); - make_way('1114.6 651.3 102.0', '111 0 0', 0, 768); - make_way('1338.2 383.4 78.0', '102 99 98', 0, 0); - make_way('1366.0 -48.8 -2.0', '79 101 123', 122, 0); - make_way('1355.8 65.9 -370.0', '128 125 132', 104, 65600); - make_way('1362.6 635.0 -334.0', '103 135 0', 0, 65792); - make_way('1366.7 875.6 -274.0', '135 111 0', 0, 0); - make_way('841.8 1105.2 -242.0', '111 112 107', 0, 0); - make_way('1439.7 1113.7 -213.0', '106 108 0', 0, 0); - make_way('1871.4 990.6 -191.0', '107 109 0', 0, 0); - make_way('1851.0 655.5 -158.0', '108 110 0', 0, 0); - make_way('1542.3 802.5 -274.0', '105 104 0', 0, 0); - make_way('1074.9 805.1 -274.0', '105 112 106', 135, 0); - make_way('703.5 681.7 -242.0', '111 106 113', 0, 1024); - make_way('608.0 681.2 -82.0', '114 0 0', 0, 0); - make_way('612.4 789.1 -82.0', '115 111 0', 0, 1024); - make_way('614.1 858.3 46.0', '116 0 0', 0, 0); - make_way('618.9 1020.4 46.0', '115 117 0', 0, 0); - make_way('539.7 1025.0 62.0', '116 118 0', 0, 0); - make_way('516.6 923.8 62.0', '117 119 0', 0, 1024); - make_way('511.4 848.0 238.0', '120 0 0', 0, 0); - make_way('504.8 654.8 238.0', '119 14 0', 0, 0); - make_way('1112.4 -706.8 -2.0', '89 80 0', 0, 4096); - make_way('1124.4 -31.4 -146.0', '138 70 124', 126, 0); - make_way('1654.0 -38.6 -146.0', '137 72 131', 129, 0); - make_way('1160.0 78.5 -147.2', '125 122 0', 0, 512); - make_way('1137.3 45.9 -370.0', '124 103 127', 0, 65536); - make_way('1161.1 -144.4 -148.3', '122 127 0', 0, 66048); - make_way('1159.7 -167.3 -370.0', '126 125 128', 134, 65536); - make_way('1468.4 -211.2 -370.0', '129 103 133', 130, 65536); - make_way('1654.8 -127.0 -162.2', '123 128 134', 0, 65600); - make_way('1798.0 -355.0 -370.0', '128 133 0', 0, 65536); - make_way('1660.2 51.5 -152.0', '132 123 0', 0, 64); - make_way('1657.1 71.4 -370.0', '103 131 133', 0, 65536); - make_way('1621.6 -110.8 -370.0', '128 132 130', 0, 65536); - make_way('1344.8 -141.7 -370.0', '127 103 128', 129, 65536); - make_way('1368.7 785.3 -271.1', '105 104 0', 0, 0); - make_way('1365.6 -34.1 -146.0', '138 137 0', 0, 0); - make_way('1536.2 -35.6 -146.0', '136 123 0', 0, 0); - make_way('1197.9 -32.8 -146.0', '122 136 0', 0, 0); - make_way('1537.0 8.8 -146.0', '123 102 0', 0, 4096); + make_way ('-888.8 -71.0 6.0', '44 3 2', 0, 0); + make_way ('-937.4 19.2 6.0', '3 1 45', 0, 0); + make_way ('-827.2 26.1 6.0', '1 2 4', 0, 0); + make_way ('-801.5 366.8 6.0', '3 5 0', 0, 0); + make_way ('-783.8 774.2 6.0', '4 6 0', 0, 0); + make_way ('-550.2 759.6 6.0', '5 7 0', 0, 0); + make_way ('-574.0 368.0 6.0', '6 8 0', 0, 0); + make_way ('-430.2 378.3 6.0', '7 9 0', 0, 0); + make_way ('-406.9 784.0 6.0', '8 10 0', 0, 0); + make_way ('-259.9 772.3 6.0', '9 11 12', 0, 0); + make_way ('-243.7 250.5 14.0', '10 12 0', 0, 0); + make_way ('-35.8 581.6 62.0', '10 11 13', 14, 0); + make_way (' 29.5 647.5 62.0', '12 15 49', 0, 0); + make_way ('521.9 603.4 78.0', '12 15 0', 0, 0); + make_way ('507.6 514.3 78.0', '14 13 16', 0, 0); + make_way ('504.3 308.4 78.0', '15 20 17', 0, 0); + make_way ('175.2 -34.7 78.0', '16 19 20', 18, 0); + make_way ('485.8 -387.2 78.0', '17 21 19', 0, 0); + make_way ('368.0 -201.7 78.0', '17 18 51', 0, 0); + make_way ('397.0 124.9 78.0', '16 17 51', 0, 0); + make_way ('496.0 -558.1 78.0', '18 22 58', 31, 0); + make_way ('147.5 -528.0 174.0', '21 23 0', 0, 128); + make_way ('-213.3 -528.0 174.0', '22 24 0', 0, 128); + make_way ('-229.6 -865.0 174.0', '23 25 0', 0, 128); + make_way ('339.0 -873.6 286.0', '24 26 0', 0, 128); + make_way ('341.2 -538.2 286.0', '25 27 0', 0, 128); + make_way ('-143.0 -535.0 350.0', '26 28 0', 0, 128); + make_way ('-143.3 -696.6 350.0', '27 29 0', 0, 128); + make_way ('283.6 -703.7 350.0', '28 30 0', 0, 128); + make_way ('371.0 -699.8 286.0', '31 0 0', 0, 128); + make_way ('416.0 -691.3 6.0', '33 32 0', 0, 0); + make_way ('253.9 -794.9 6.0', '31 57 34', 0, 0); + make_way ('253.7 -610.4 6.0', '57 31 0', 0, 0); + make_way ('-64.0 -727.5 6.0', '32 35 36', 37, 0); + make_way ('-40.6 -874.3 6.0', '34 37 58', 0, 128); + make_way (' 43.7 -535.1 6.0', '37 57 34', 56, 0); + make_way ('-172.1 -560.9 6.0', '38 36 35', 34, 0); + make_way ('-298.6 -563.7 6.0', '39 37 0', 0, 0); + make_way ('-318.6 -710.5 6.0', '38 40 0', 0, 0); + make_way ('-629.4 -683.2 6.0', '39 41 0', 0, 0); + make_way ('-626.9 -449.0 6.0', '40 42 43', 0, 0); + make_way ('-565.7 -449.0 6.0', '41 19 0', 0, 2); + make_way ('-654.9 -271.1 6.0', '41 44 0', 0, 0); + make_way ('-873.3 -247.0 6.0', '43 1 0', 0, 0); + make_way ('-939.9 347.7 142.0', '46 2 0', 0, 0); + make_way ('-912.7 821.5 142.0', '47 45 5', 0, 0); + make_way ('-577.0 859.7 142.0', '50 46 48', 0, 0); + make_way ('-556.0 784.6 142.0', '47 6 59', 0, 256); + make_way ('-98.5 799.3 142.0', '13 50 0', 0, 0); + make_way ('-198.8 861.0 142.0', '49 47 10', 0, 0); + make_way ('584.5 -30.1 -146.0', '52 69 71', 0, 0); + make_way ('288.5 -27.4 -154.0', '53 51 0', 0, 0); + make_way ('126.7 -188.8 -154.0', '54 52 0', 0, 0); + make_way ('-164.4 -210.3 -154.0', '55 53 0', 0, 0); + make_way ('-177.9 -425.6 -90.0', '56 54 0', 0, 0); + make_way (' 52.6 -443.0 -10.0', '36 55 0', 0, 0); + make_way (' 71.4 -634.1 6.0', '36 33 32', 0, 0); + make_way ('496.0 -880.0 78.0', '35 21 31', 0, 128); + make_way ('-528.0 664.4 142.0', '60 6 0', 0, 65536); + make_way ('-496.8 461.0 142.0', '59 8 7', 61, 65792); + make_way ('-466.9 320.2 142.0', '62 11 7', 60, 65824); + make_way ('-459.7 277.2 166.0', '63 0 0', 0, 65824); + make_way ('-467.3 208.0 198.0', '11 64 0', 0, 65536); + make_way ('-719.9 208.0 206.0', '63 68 0', 0, 65664); + make_way ('-825.0 251.2 206.0', '68 66 3', 0, 65792); + make_way ('-799.7 108.2 206.0', '67 2 0', 0, 65568); + make_way ('-688.0 99.6 206.0', '66 0 0', 0, 65536); + make_way ('-797.7 318.5 206.0', '65 64 45', 0, 65664); + make_way ('822.8 -265.4 -162.0', '51 70 0', 0, 0); + make_way ('1000.0 -29.9 -162.0', '71 69 122', 0, 0); + make_way ('827.2 198.1 -162.0', '51 70 0', 0, 0); + make_way ('1970.0 -31.5 -146.0', '123 78 73', 0, 0); + make_way ('1982.6 197.3 -66.0', '72 74 0', 0, 0); + make_way ('1964.1 437.3 -66.0', '73 75 76', 0, 0); + make_way ('1544.8 491.8 -66.0', '74 76 0', 0, 0); + make_way ('1693.0 400.0 -66.0', '75 74 77', 0, 256); + make_way ('1695.4 362.0 -42.0', '132 131 0', 0, 0); + make_way ('1963.1 -436.8 -2.0', '72 79 0', 0, 0); + make_way ('1380.4 -427.4 -2.0', '78 102 80', 0, 0); + make_way ('1186.5 -681.2 -2.0', '81 79 121', 0, 0); + make_way ('1322.4 -745.5 -2.0', '82 80 0', 0, 0); + make_way ('1461.8 -756.2 -2.0', '85 83 81', 0, 0); + make_way ('1432.7 -944.0 -2.0', '82 84 0', 0, 0); + make_way ('1248.5 -926.6 -2.0', '83 101 0', 0, 2); + make_way ('1707.9 -715.7 -2.0', '86 82 0', 0, 0); + make_way ('1821.0 -850.6 -2.0', '87 85 0', 0, 0); + make_way ('1531.5 -899.7 110.0', '88 86 82', 85, 0); + make_way ('1125.5 -896.2 110.0', '89 87 0', 0, 0); + make_way ('986.5 -799.6 110.0', '90 88 80', 121, 0); + make_way ('811.1 -657.7 110.0', '91 89 0', 0, 0); + make_way ('658.1 -638.4 110.0', '92 90 0', 0, 0); + make_way ('656.0 -356.4 78.0', '93 91 0', 0, 0); + make_way ('824.9 -256.7 78.0', '94 92 51', 0, 0); + make_way ('952.1 -32.8 78.0', '95 93 0', 0, 0); + make_way ('817.3 175.9 78.0', '96 94 51', 0, 0); + make_way ('633.2 323.0 78.0', '97 95 0', 0, 0); + make_way ('631.7 415.3 78.0', '98 96 0', 0, 0); + make_way ('822.9 444.2 78.0', '99 101 97', 0, 0); + make_way ('1111.5 624.0 78.0', '101 100 98', 0, 256); + make_way ('1114.6 651.3 102.0', '111 0 0', 0, 768); + make_way ('1338.2 383.4 78.0', '102 99 98', 0, 0); + make_way ('1366.0 -48.8 -2.0', '79 101 123', 122, 0); + make_way ('1355.8 65.9 -370.0', '128 125 132', 104, 65600); + make_way ('1362.6 635.0 -334.0', '103 135 0', 0, 65792); + make_way ('1366.7 875.6 -274.0', '135 111 0', 0, 0); + make_way ('841.8 1105.2 -242.0', '111 112 107', 0, 0); + make_way ('1439.7 1113.7 -213.0', '106 108 0', 0, 0); + make_way ('1871.4 990.6 -191.0', '107 109 0', 0, 0); + make_way ('1851.0 655.5 -158.0', '108 110 0', 0, 0); + make_way ('1542.3 802.5 -274.0', '105 104 0', 0, 0); + make_way ('1074.9 805.1 -274.0', '105 112 106', 135, 0); + make_way ('703.5 681.7 -242.0', '111 106 113', 0, 1024); + make_way ('608.0 681.2 -82.0', '114 0 0', 0, 0); + make_way ('612.4 789.1 -82.0', '115 111 0', 0, 1024); + make_way ('614.1 858.3 46.0', '116 0 0', 0, 0); + make_way ('618.9 1020.4 46.0', '115 117 0', 0, 0); + make_way ('539.7 1025.0 62.0', '116 118 0', 0, 0); + make_way ('516.6 923.8 62.0', '117 119 0', 0, 1024); + make_way ('511.4 848.0 238.0', '120 0 0', 0, 0); + make_way ('504.8 654.8 238.0', '119 14 0', 0, 0); + make_way ('1112.4 -706.8 -2.0', '89 80 0', 0, 4096); + make_way ('1124.4 -31.4 -146.0', '138 70 124', 126, 0); + make_way ('1654.0 -38.6 -146.0', '137 72 131', 129, 0); + make_way ('1160.0 78.5 -147.2', '125 122 0', 0, 512); + make_way ('1137.3 45.9 -370.0', '124 103 127', 0, 65536); + make_way ('1161.1 -144.4 -148.3', '122 127 0', 0, 66048); + make_way ('1159.7 -167.3 -370.0', '126 125 128', 134, 65536); + make_way ('1468.4 -211.2 -370.0', '129 103 133', 130, 65536); + make_way ('1654.8 -127.0 -162.2', '123 128 134', 0, 65600); + make_way ('1798.0 -355.0 -370.0', '128 133 0', 0, 65536); + make_way ('1660.2 51.5 -152.0', '132 123 0', 0, 64); + make_way ('1657.1 71.4 -370.0', '103 131 133', 0, 65536); + make_way ('1621.6 -110.8 -370.0', '128 132 130', 0, 65536); + make_way ('1344.8 -141.7 -370.0', '127 103 128', 129, 65536); + make_way ('1368.7 785.3 -271.1', '105 104 0', 0, 0); + make_way ('1365.6 -34.1 -146.0', '138 137 0', 0, 0); + make_way ('1536.2 -35.6 -146.0', '136 123 0', 0, 0); + make_way ('1197.9 -32.8 -146.0', '122 136 0', 0, 0); + make_way ('1537.0 8.8 -146.0', '123 102 0', 0, 4096); }; diff --git a/fbxa/map_dm4.qc b/fbxa/map_dm4.qc index e53dd0d..eba6429 100644 --- a/fbxa/map_dm4.qc +++ b/fbxa/map_dm4.qc @@ -4,47 +4,48 @@ wayedit.txt that comes with FrikBot */ #include "libfrikbot.h" -void() map_dm4 = +void () +map_dm4 = { - make_way('-114.0 529.9 -274.0', '0 38 0', 0, 128); - make_way('-21.9 -216.6 -274.0', '0 33 37', 0, 128); - make_way('344.2 -524.5 -82.0', '4 15 14', 36, 128); - make_way('220.5 -432.0 -82.0', '3 0 0', 0, 160); - make_way('362.8 -237.4 -274.0', '0 6 7', 37, 128); - make_way('362.8 -4.9 -274.0', '5 0 0', 0, 128); - make_way('605.3 -238.8 -274.0', '8 5 0', 0, 128); - make_way('614.0 49.8 -274.0', '9 7 0', 0, 1); - make_way('312.0 -923.0 46.0', '10 16 0', 0, 0); - make_way('326.1 -1067.7 46.0', '11 9 0', 0, 0); - make_way('329.8 -1219.7 -2.0', '12 10 13', 0, 0); - make_way('113.8 -1191.1 -82.0', '13 11 14', 0, 0); - make_way(' 89.9 -980.1 -82.0', '14 12 36', 0, 0); - make_way('326.0 -896.1 -82.0', '3 13 12', 36, 0); - make_way('553.1 -287.3 -82.0', '30 32 41', 3, 128); - make_way('355.7 -527.4 46.0', '17 26 9', 0, 128); - make_way('518.1 -475.3 46.0', '18 16 41', 0, 128); - make_way('603.5 -188.0 46.0', '19 17 32', 0, 128); - make_way('847.2 -182.0 46.0', '20 18 0', 0, 0); - make_way('855.5 -554.8 46.0', '21 22 19', 0, 0); - make_way('1092.6 -573.4 46.0', '20 0 0', 0, 0); - make_way('1007.5 -432.0 -82.0', '23 39 0', 0, 0); - make_way('777.1 -458.1 -82.0', '24 0 0', 0, 0); - make_way('772.6 -642.4 -138.7', '25 23 0', 0, 0); - make_way('773.9 -853.5 -210.0', '6 24 0', 0, 1); - make_way('112.0 -486.9 46.0', '27 16 0', 0, 128); - make_way('136.7 -272.5 -34.0', '40 28 26', 0, 128); - make_way('-106.0 -235.8 -50.0', '29 27 0', 0, 0); - make_way('-124.8 -568.3 -50.0', '19 28 0', 0, 1); - make_way('627.7 -426.3 -98.0', '7 15 32', 0, 1); - make_way('224.0 81.0 -82.0', '37 0 0', 0, 0); - make_way('506.2 -96.8 -82.0', '15 30 6', 0, 128); - make_way('-70.0 78.4 -274.0', '34 2 0', 38, 128); - make_way(' 88.6 71.9 -274.0', '33 0 0', 0, 160); - make_way('112.0 -176.0 -415.1', '0 0 0', 0, 0); - make_way('337.6 -687.8 -82.0', '14 3 13', 0, 0); - make_way('159.2 -250.3 -274.0', '5 2 0', 0, 128); - make_way('-77.0 287.6 -274.0', '33 1 0', 0, 160); - make_way('964.6 -623.9 -82.0', '0 24 22', 0, 0); - make_way('150.1 -191.5 -50.0', '31 0 0', 0, 384); - make_way('502.7 -271.1 -82.0', '15 0 0', 0, 0); + make_way ('-114.0 529.9 -274.0', '0 38 0', 0, 128); + make_way ('-21.9 -216.6 -274.0', '0 33 37', 0, 128); + make_way ('344.2 -524.5 -82.0', '4 15 14', 36, 128); + make_way ('220.5 -432.0 -82.0', '3 0 0', 0, 160); + make_way ('362.8 -237.4 -274.0', '0 6 7', 37, 128); + make_way ('362.8 -4.9 -274.0', '5 0 0', 0, 128); + make_way ('605.3 -238.8 -274.0', '8 5 0', 0, 128); + make_way ('614.0 49.8 -274.0', '9 7 0', 0, 1); + make_way ('312.0 -923.0 46.0', '10 16 0', 0, 0); + make_way ('326.1 -1067.7 46.0', '11 9 0', 0, 0); + make_way ('329.8 -1219.7 -2.0', '12 10 13', 0, 0); + make_way ('113.8 -1191.1 -82.0', '13 11 14', 0, 0); + make_way (' 89.9 -980.1 -82.0', '14 12 36', 0, 0); + make_way ('326.0 -896.1 -82.0', '3 13 12', 36, 0); + make_way ('553.1 -287.3 -82.0', '30 32 41', 3, 128); + make_way ('355.7 -527.4 46.0', '17 26 9', 0, 128); + make_way ('518.1 -475.3 46.0', '18 16 41', 0, 128); + make_way ('603.5 -188.0 46.0', '19 17 32', 0, 128); + make_way ('847.2 -182.0 46.0', '20 18 0', 0, 0); + make_way ('855.5 -554.8 46.0', '21 22 19', 0, 0); + make_way ('1092.6 -573.4 46.0', '20 0 0', 0, 0); + make_way ('1007.5 -432.0 -82.0', '23 39 0', 0, 0); + make_way ('777.1 -458.1 -82.0', '24 0 0', 0, 0); + make_way ('772.6 -642.4 -138.7', '25 23 0', 0, 0); + make_way ('773.9 -853.5 -210.0', '6 24 0', 0, 1); + make_way ('112.0 -486.9 46.0', '27 16 0', 0, 128); + make_way ('136.7 -272.5 -34.0', '40 28 26', 0, 128); + make_way ('-106.0 -235.8 -50.0', '29 27 0', 0, 0); + make_way ('-124.8 -568.3 -50.0', '19 28 0', 0, 1); + make_way ('627.7 -426.3 -98.0', '7 15 32', 0, 1); + make_way ('224.0 81.0 -82.0', '37 0 0', 0, 0); + make_way ('506.2 -96.8 -82.0', '15 30 6', 0, 128); + make_way ('-70.0 78.4 -274.0', '34 2 0', 38, 128); + make_way (' 88.6 71.9 -274.0', '33 0 0', 0, 160); + make_way ('112.0 -176.0 -415.1', '0 0 0', 0, 0); + make_way ('337.6 -687.8 -82.0', '14 3 13', 0, 0); + make_way ('159.2 -250.3 -274.0', '5 2 0', 0, 128); + make_way ('-77.0 287.6 -274.0', '33 1 0', 0, 160); + make_way ('964.6 -623.9 -82.0', '0 24 22', 0, 0); + make_way ('150.1 -191.5 -50.0', '31 0 0', 0, 384); + make_way ('502.7 -271.1 -82.0', '15 0 0', 0, 0); }; diff --git a/fbxa/map_dm5.qc b/fbxa/map_dm5.qc index c5378d8..fc05163 100644 --- a/fbxa/map_dm5.qc +++ b/fbxa/map_dm5.qc @@ -5,52 +5,53 @@ readme.html that comes with FrikBot */ #include "libfrikbot.h" // Ways by Electro -void() map_dm5 = +void () +map_dm5 = { - make_way('90.2 -380.0 62.0', '2 11 0', 0, 0); - make_way('-88.5 -373.4 62.0', '3 1 28', 0, 0); - make_way('-71.1 321.2 62.0', '12 0 2', 37, 0); - make_way('288.7 451.8 14.0', '3 5 6', 37, 0); - make_way('500.1 370.9 14.0', '4 0 0', 0, 0); - make_way('287.3 374.0 -10.0', '4 7 0', 0, 0); - make_way('296.2 -97.3 -90.0', '6 8 0', 0, 0); - make_way('657.0 -24.1 14.0', '7 45 0', 0, 0); - make_way('280.9 -314.6 -90.0', '7 45 0', 0, 0); - make_way('265.3 -582.0 -90.0', '9 43 0', 0, 0); - make_way('90.5 -582.4 -90.0', '10 0 0', 0, 0); - make_way('-72.3 511.6 62.0', '13 3 0', 0, 0); - make_way('106.7 693.8 142.0', '14 12 0', 0, 0); - make_way('286.6 704.6 142.0', '17 13 15', 16, 0); - make_way('286.5 208.0 142.0', '14 36 0', 0, 32768); - make_way('259.1 938.8 142.0', '0 39 0', 0, 0); - make_way('450.5 686.4 142.0', '18 14 0', 0, 0); - make_way('694.2 466.0 238.0', '19 17 0', 0, 0); - make_way('729.0 367.2 238.0', '27 18 20', 0, 1); - make_way('305.5 371.9 238.0', '19 21 15', 36, 0); - make_way('-85.4 351.2 238.0', '20 22 34', 12, 0); - make_way('-98.1 -226.8 238.0', '21 33 32', 23, 0); - make_way('-96.1 -776.4 238.0', '24 22 38', 11, 0); - make_way('362.9 -768.2 238.0', '23 46 35', 0, 0); - make_way('611.0 -762.8 238.0', '26 46 0', 0, 0); - make_way('893.3 -768.3 238.0', '31 25 27', 0, 0); - make_way('1048.0 -769.1 238.0', '19 26 0', 0, 1); - make_way('-105.7 -761.0 62.0', '2 29 0', 0, 0); - make_way('309.1 -759.3 142.0', '35 28 30', 0, 0); - make_way('338.1 -388.8 142.0', '35 9 29', 42, 0); - make_way('889.2 -228.7 238.0', '32 26 0', 0, 0); - make_way('320.6 -223.8 238.0', '22 31 30', 0, 0); - make_way('-180.2 -200.8 189.9', '2 0 0', 0, 0); - make_way('-178.1 376.2 185.4', '3 0 0', 0, 0); - make_way('399.5 -577.5 174.0', '42 29 30', 0, 0); - make_way('286.3 475.6 142.0', '5 37 14', 0, 0); - make_way('96.3 482.8 14.0', '4 3 6', 0, 0); - make_way('-168.6 -824.8 187.8', '28 0 0', 0, 0); - make_way('288.1 1006.5 142.0', '16 14 0', 0, 32768); - make_way('615.7 -451.0 158.0', '41 25 42', 0, 0); - make_way('662.5 -326.1 142.0', '40 0 0', 0, 0); - make_way('479.8 -463.0 158.0', '35 30 40', 0, 0); - make_way('407.3 -392.4 -90.0', '44 10 0', 0, 0); - make_way('547.8 -309.4 -90.0', '45 43 0', 0, 0); - make_way('544.3 -52.9 -90.0', '9 8 44', 0, 0); - make_way('488.5 -769.3 238.0', '25 24 0', 0, 0); + make_way ('90.2 -380.0 62.0', '2 11 0', 0, 0); + make_way ('-88.5 -373.4 62.0', '3 1 28', 0, 0); + make_way ('-71.1 321.2 62.0', '12 0 2', 37, 0); + make_way ('288.7 451.8 14.0', '3 5 6', 37, 0); + make_way ('500.1 370.9 14.0', '4 0 0', 0, 0); + make_way ('287.3 374.0 -10.0', '4 7 0', 0, 0); + make_way ('296.2 -97.3 -90.0', '6 8 0', 0, 0); + make_way ('657.0 -24.1 14.0', '7 45 0', 0, 0); + make_way ('280.9 -314.6 -90.0', '7 45 0', 0, 0); + make_way ('265.3 -582.0 -90.0', '9 43 0', 0, 0); + make_way ('90.5 -582.4 -90.0', '10 0 0', 0, 0); + make_way ('-72.3 511.6 62.0', '13 3 0', 0, 0); + make_way ('106.7 693.8 142.0', '14 12 0', 0, 0); + make_way ('286.6 704.6 142.0', '17 13 15', 16, 0); + make_way ('286.5 208.0 142.0', '14 36 0', 0, 32768); + make_way ('259.1 938.8 142.0', '0 39 0', 0, 0); + make_way ('450.5 686.4 142.0', '18 14 0', 0, 0); + make_way ('694.2 466.0 238.0', '19 17 0', 0, 0); + make_way ('729.0 367.2 238.0', '27 18 20', 0, 1); + make_way ('305.5 371.9 238.0', '19 21 15', 36, 0); + make_way ('-85.4 351.2 238.0', '20 22 34', 12, 0); + make_way ('-98.1 -226.8 238.0', '21 33 32', 23, 0); + make_way ('-96.1 -776.4 238.0', '24 22 38', 11, 0); + make_way ('362.9 -768.2 238.0', '23 46 35', 0, 0); + make_way ('611.0 -762.8 238.0', '26 46 0', 0, 0); + make_way ('893.3 -768.3 238.0', '31 25 27', 0, 0); + make_way ('1048.0 -769.1 238.0', '19 26 0', 0, 1); + make_way ('-105.7 -761.0 62.0', '2 29 0', 0, 0); + make_way ('309.1 -759.3 142.0', '35 28 30', 0, 0); + make_way ('338.1 -388.8 142.0', '35 9 29', 42, 0); + make_way ('889.2 -228.7 238.0', '32 26 0', 0, 0); + make_way ('320.6 -223.8 238.0', '22 31 30', 0, 0); + make_way ('-180.2 -200.8 189.9', '2 0 0', 0, 0); + make_way ('-178.1 376.2 185.4', '3 0 0', 0, 0); + make_way ('399.5 -577.5 174.0', '42 29 30', 0, 0); + make_way ('286.3 475.6 142.0', '5 37 14', 0, 0); + make_way ('96.3 482.8 14.0', '4 3 6', 0, 0); + make_way ('-168.6 -824.8 187.8', '28 0 0', 0, 0); + make_way ('288.1 1006.5 142.0', '16 14 0', 0, 32768); + make_way ('615.7 -451.0 158.0', '41 25 42', 0, 0); + make_way ('662.5 -326.1 142.0', '40 0 0', 0, 0); + make_way ('479.8 -463.0 158.0', '35 30 40', 0, 0); + make_way ('407.3 -392.4 -90.0', '44 10 0', 0, 0); + make_way ('547.8 -309.4 -90.0', '45 43 0', 0, 0); + make_way ('544.3 -52.9 -90.0', '9 8 44', 0, 0); + make_way ('488.5 -769.3 238.0', '25 24 0', 0, 0); }; diff --git a/fbxa/map_dm6.qc b/fbxa/map_dm6.qc index c7c343c..35ecaf2 100644 --- a/fbxa/map_dm6.qc +++ b/fbxa/map_dm6.qc @@ -5,67 +5,68 @@ readme.html that comes with FrikBot */ #include "libfrikbot.h" // Ways by Electro -void() map_dm6 = +void () +map_dm6 = { - make_way('760.0 -1080.0 278.0', '2 8 51', 0, 0); - make_way('830.4 -879.6 278.0', '1 3 0', 0, 0); - make_way('994.1 -851.7 278.0', '2 4 0', 0, 0); - make_way('1212.9 -877.9 278.0', '3 5 0', 0, 0); - make_way('1301.3 -1089.0 278.0', '4 6 0', 10, 0); - make_way('1199.4 -1302.0 278.0', '5 7 0', 0, 0); - make_way('1040.4 -1348.9 278.0', '6 8 0', 0, 0); - make_way('855.7 -1312.7 278.0', '7 1 0', 0, 0); - make_way('1033.2 -1465.7 278.0', '7 0 0', 0, 0); - make_way('1519.3 -1087.3 231.4', '11 5 0', 0, 0); - make_way('1758.3 -1065.6 190.0', '10 12 0', 0, 0); - make_way('1763.4 -907.5 190.0', '11 13 58', 0, 0); - make_way('1763.9 -706.4 190.0', '12 14 57', 0, 0); - make_way('1765.6 -418.0 190.0', '13 18 15', 23, 0); - make_way('1882.8 -419.8 190.0', '14 16 0', 0, 0); - make_way('1890.5 -157.4 190.0', '15 17 0', 0, 0); - make_way('1628.3 -158.2 190.0', '16 18 0', 0, 0); - make_way('1629.0 -277.9 190.0', '17 19 14', 23, 0); - make_way('1317.8 -318.6 190.0', '18 21 23', 0, 0); - make_way('87.4 -1522.2 62.0', '43 0 0', 0, 0); - make_way('1293.0 -554.7 190.0', '19 22 0', 0, 0); - make_way('1670.4 -535.4 62.0', '23 32 21', 0, 0); - make_way('1555.7 -437.5 62.0', '22 24 56', 0, 0); - make_way('1380.5 -428.9 62.0', '23 25 0', 0, 0); - make_way('1032.9 -439.3 62.0', '24 26 0', 0, 0); - make_way('1021.2 -928.0 -2.0', '27 33 25', 0, 0); - make_way('852.4 -1085.0 -22.0', '28 34 61', 26, 4); - make_way('831.8 -1085.0 -258.0', '29 0 0', 0, 0); - make_way('512.6 -1091.4 -258.0', '28 33 0', 0, 2); - make_way('1379.5 -1096.0 14.0', '33 31 0', 0, 0); - make_way('1699.0 -1086.0 62.0', '30 32 0', 0, 0); - make_way('1720.4 -824.1 62.0', '31 22 0', 0, 0); - make_way('1158.1 -1096.0 -18.0', '30 34 26', 37, 8); - make_way('1019.9 -1256.6 -2.0', '33 35 27', 0, 0); - make_way('1020.0 -1664.8 62.0', '34 36 0', 0, 0); - make_way('684.6 -1661.8 62.0', '35 37 0', 0, 0); - make_way('505.0 -1663.7 62.0', '52 61 42', 36, 0); - make_way('275.2 -1087.1 134.0', '59 41 0', 0, 4); - make_way('422.0 -1086.3 150.0', '38 40 0', 0, 0); - make_way('682.5 -1090.1 89.9', '27 39 34', 26, 0); - make_way('195.9 -961.6 150.0', '38 37 59', 0, 2); - make_way('246.5 -1653.8 62.0', '37 43 61', 60, 0); - make_way('87.1 -1612.3 62.0', '42 44 60', 0, 0); - make_way('64.8 -1782.9 62.0', '60 43 45', 55, 0); - make_way('66.4 -1997.2 110.0', '44 46 0', 0, 0); - make_way('261.6 -1998.1 142.0', '45 47 0', 0, 0); - make_way('446.0 -1999.7 190.0', '46 48 0', 0, 0); - make_way('452.0 -1681.0 254.0', '47 49 42', 61, 0); - make_way('450.4 -1576.2 278.0', '48 50 0', 0, 0); - make_way('446.6 -1364.6 278.0', '49 51 0', 0, 0); - make_way('456.1 -1092.5 278.0', '50 1 0', 0, 0); - make_way('512.0 -1901.4 62.0', '37 53 55', 0, 0); - make_way('506.6 -2037.3 62.0', '52 54 0', 0, 0); - make_way('354.8 -2040.3 62.0', '53 55 61', 0, 0); - make_way('216.7 -1863.2 78.0', '44 54 52', 0, 0); - make_way('1613.3 -426.0 62.0', '14 18 0', 0, 4096); - make_way('1648.0 -701.8 136.9', '32 22 0', 0, 0); - make_way('1648.0 -911.3 128.4', '31 32 0', 0, 0); - make_way('194.1 -1234.7 134.0', '38 41 0', 0, 0); - make_way('150.9 -1784.8 70.0', '44 43 55', 41, 8); - make_way('323.0 -1785.1 78.0', '42 54 37', 41, 8); + make_way ('760.0 -1080.0 278.0', '2 8 51', 0, 0); + make_way ('830.4 -879.6 278.0', '1 3 0', 0, 0); + make_way ('994.1 -851.7 278.0', '2 4 0', 0, 0); + make_way ('1212.9 -877.9 278.0', '3 5 0', 0, 0); + make_way ('1301.3 -1089.0 278.0', '4 6 0', 10, 0); + make_way ('1199.4 -1302.0 278.0', '5 7 0', 0, 0); + make_way ('1040.4 -1348.9 278.0', '6 8 0', 0, 0); + make_way ('855.7 -1312.7 278.0', '7 1 0', 0, 0); + make_way ('1033.2 -1465.7 278.0', '7 0 0', 0, 0); + make_way ('1519.3 -1087.3 231.4', '11 5 0', 0, 0); + make_way ('1758.3 -1065.6 190.0', '10 12 0', 0, 0); + make_way ('1763.4 -907.5 190.0', '11 13 58', 0, 0); + make_way ('1763.9 -706.4 190.0', '12 14 57', 0, 0); + make_way ('1765.6 -418.0 190.0', '13 18 15', 23, 0); + make_way ('1882.8 -419.8 190.0', '14 16 0', 0, 0); + make_way ('1890.5 -157.4 190.0', '15 17 0', 0, 0); + make_way ('1628.3 -158.2 190.0', '16 18 0', 0, 0); + make_way ('1629.0 -277.9 190.0', '17 19 14', 23, 0); + make_way ('1317.8 -318.6 190.0', '18 21 23', 0, 0); + make_way ('87.4 -1522.2 62.0', '43 0 0', 0, 0); + make_way ('1293.0 -554.7 190.0', '19 22 0', 0, 0); + make_way ('1670.4 -535.4 62.0', '23 32 21', 0, 0); + make_way ('1555.7 -437.5 62.0', '22 24 56', 0, 0); + make_way ('1380.5 -428.9 62.0', '23 25 0', 0, 0); + make_way ('1032.9 -439.3 62.0', '24 26 0', 0, 0); + make_way ('1021.2 -928.0 -2.0', '27 33 25', 0, 0); + make_way ('852.4 -1085.0 -22.0', '28 34 61', 26, 4); + make_way ('831.8 -1085.0 -258.0', '29 0 0', 0, 0); + make_way ('512.6 -1091.4 -258.0', '28 33 0', 0, 2); + make_way ('1379.5 -1096.0 14.0', '33 31 0', 0, 0); + make_way ('1699.0 -1086.0 62.0', '30 32 0', 0, 0); + make_way ('1720.4 -824.1 62.0', '31 22 0', 0, 0); + make_way ('1158.1 -1096.0 -18.0', '30 34 26', 37, 8); + make_way ('1019.9 -1256.6 -2.0', '33 35 27', 0, 0); + make_way ('1020.0 -1664.8 62.0', '34 36 0', 0, 0); + make_way ('684.6 -1661.8 62.0', '35 37 0', 0, 0); + make_way ('505.0 -1663.7 62.0', '52 61 42', 36, 0); + make_way ('275.2 -1087.1 134.0', '59 41 0', 0, 4); + make_way ('422.0 -1086.3 150.0', '38 40 0', 0, 0); + make_way ('682.5 -1090.1 89.9', '27 39 34', 26, 0); + make_way ('195.9 -961.6 150.0', '38 37 59', 0, 2); + make_way ('246.5 -1653.8 62.0', '37 43 61', 60, 0); + make_way ('87.1 -1612.3 62.0', '42 44 60', 0, 0); + make_way ('64.8 -1782.9 62.0', '60 43 45', 55, 0); + make_way ('66.4 -1997.2 110.0', '44 46 0', 0, 0); + make_way ('261.6 -1998.1 142.0', '45 47 0', 0, 0); + make_way ('446.0 -1999.7 190.0', '46 48 0', 0, 0); + make_way ('452.0 -1681.0 254.0', '47 49 42', 61, 0); + make_way ('450.4 -1576.2 278.0', '48 50 0', 0, 0); + make_way ('446.6 -1364.6 278.0', '49 51 0', 0, 0); + make_way ('456.1 -1092.5 278.0', '50 1 0', 0, 0); + make_way ('512.0 -1901.4 62.0', '37 53 55', 0, 0); + make_way ('506.6 -2037.3 62.0', '52 54 0', 0, 0); + make_way ('354.8 -2040.3 62.0', '53 55 61', 0, 0); + make_way ('216.7 -1863.2 78.0', '44 54 52', 0, 0); + make_way ('1613.3 -426.0 62.0', '14 18 0', 0, 4096); + make_way ('1648.0 -701.8 136.9', '32 22 0', 0, 0); + make_way ('1648.0 -911.3 128.4', '31 32 0', 0, 0); + make_way ('194.1 -1234.7 134.0', '38 41 0', 0, 0); + make_way ('150.9 -1784.8 70.0', '44 43 55', 41, 8); + make_way ('323.0 -1785.1 78.0', '42 54 37', 41, 8); };