diff --git a/fbxa/bot_ai.qc b/fbxa/bot_ai.qc index cd328c3..698a582 100644 --- a/fbxa/bot_ai.qc +++ b/fbxa/bot_ai.qc @@ -161,7 +161,7 @@ Bot has lost its target. b_aiflags = 0; } else { if (targ.ent.classname == "item_artifact_invisibility") - if (ent.items & 524288) // IT_INVISIBILITY + if (ent.items & IT_INVISIBILITY) [self start_topic:3]; if (targ.ent.flags & FL_ITEM) { @@ -539,22 +539,22 @@ the bot finds things it wants to kill/grab. thisp = thisp + 25; } } else if (thing.classname == "weapon_supershotgun") { - if (!(ent.items & 2)) // IT_SUPER_SHOTGUN + if (!(ent.items & IT_SUPER_SHOTGUN)) thisp = 25; } else if (thing.classname == "weapon_nailgun") { - if (!(ent.items & 4)) // IT_NAILGUN + if (!(ent.items & IT_NAILGUN)) thisp = 30; } else if (thing.classname == "weapon_supernailgun") { - if (!(ent.items & 8)) // IT_SUPER_NAILGUN + if (!(ent.items & IT_SUPER_NAILGUN)) thisp = 35; } else if (thing.classname == "weapon_grenadelauncher") { - if (!(ent.items & 16)) // IT_GRENADE_LAUNCHER + if (!(ent.items & IT_GRENADE_LAUNCHER)) thisp = 45; } else if (thing.classname == "weapon_rocketlauncher") { - if (!(ent.items & 32)) // IT_ROCKET_LAUNCHER + if (!(ent.items & IT_ROCKET_LAUNCHER)) thisp = 60; } else if (thing.classname == "weapon_lightning") { - if (!(ent.items & 64)) // IT_LIGHTNING + if (!(ent.items & IT_LIGHTNING)) thisp = 50; } } else if ((thing.flags & FL_MONSTER) && thing.health > 0) @@ -653,7 +653,7 @@ generally making the bot look good. local vector view; if (ent.enemy) { - if (ent.enemy.items & 524288) + if (ent.enemy.items & IT_INVISIBILITY) if (random () > 0.2) return; if (missile_speed == 0) diff --git a/fbxa/bot_fight.qc b/fbxa/bot_fight.qc index 9fc0eb8..e0a9800 100644 --- a/fbxa/bot_fight.qc +++ b/fbxa/bot_fight.qc @@ -53,21 +53,21 @@ vector (float wep) weapon_range = { switch (wep) { - case 4096: // IT_AXE + case IT_AXE: return '48 0 64'; - case 1: // IT_SHOTGUN + case IT_SHOTGUN: return '128 0 99999'; - case 2: // IT_SUPER_SHOTGUN + case IT_SUPER_SHOTGUN: return '128 0 99999'; - case 4: // IT_NAILGUN + case IT_NAILGUN: return '180 0 3000'; - case 8: // IT_SUPER_NAILGUN + case IT_SUPER_NAILGUN: return '180 0 3000'; - case 16: // IT_GRENADE_LAUNCHER + case IT_GRENADE_LAUNCHER: return '180 48 3000'; - case 32: // IT_ROCKET_LAUNCHER + case IT_ROCKET_LAUNCHER: return '180 48 3000'; - case 64: // IT_LIGHTNING + case IT_LIGHTNING: return '350 0 512'; default: break; @@ -81,39 +81,39 @@ weapon_range = sz = e.health + e.armorvalue * e.armortype; switch (e.weapon) { - case 4096: + case IT_AXE: sz -= 50; break; - case 64: + case IT_LIGHTNING: sz += 60; break; - case 32: + case IT_ROCKET_LAUNCHER: sz += 60; break; - case 16: + case IT_GRENADE_LAUNCHER: sz += 50; break; - case 8: + case IT_SUPER_NAILGUN: sz += 50; break; - case 4: + case IT_NAILGUN: sz += 40; break; - case 2: + case IT_SUPER_SHOTGUN: sz += 40; break; - case 1: + case IT_SHOTGUN: sz += 10; break; default: break; } - if (e.items & 4194304) // Quad + if (e.items & IT_QUAD) sz += 200; - if (e.items & 1048576) // Invul + if (e.items & IT_INVULNERABILITY) sz += 300; - if (e.items & 524288) // Invis + if (e.items & IT_INVISIBILITY) sz += 250; return sz; } diff --git a/fbxa/bot_move.qc b/fbxa/bot_move.qc index 50866e7..f8863a0 100644 --- a/fbxa/bot_move.qc +++ b/fbxa/bot_move.qc @@ -61,15 +61,15 @@ this notice in its entirety. return FALSE; // quad = bad - if (ent.items & 4194304) + if (ent.items & IT_QUAD) return FALSE; // do I have rockets & RL? - if (!((ent.items & 32) && (ent.ammo_rockets > 0))) + if (!((ent.items & IT_ROCKET_LAUNCHER) && (ent.ammo_rockets > 0))) return FALSE; // do I have pent? - if (ent.items & 1048576) + if (ent.items & IT_INVULNERABILITY) return TRUE; if (ent.health > 50) diff --git a/fbxa/defs.h b/fbxa/defs.h index 75e0330..71c2a25 100644 --- a/fbxa/defs.h +++ b/fbxa/defs.h @@ -279,33 +279,33 @@ @extern float DAMAGE_AIM; // items -@extern float IT_AXE; -@extern float IT_SHOTGUN; -@extern float IT_SUPER_SHOTGUN; -@extern float IT_NAILGUN; -@extern float IT_SUPER_NAILGUN; -@extern float IT_GRENADE_LAUNCHER; -@extern float IT_ROCKET_LAUNCHER; -@extern float IT_LIGHTNING; -@extern float IT_EXTRA_WEAPON; +#define IT_AXE 0x001000 +#define IT_SHOTGUN 0x000001 +#define IT_SUPER_SHOTGUN 0x000002 +#define IT_NAILGUN 0x000004 +#define IT_SUPER_NAILGUN 0x000008 +#define IT_GRENADE_LAUNCHER 0x000010 +#define IT_ROCKET_LAUNCHER 0x000020 +#define IT_LIGHTNING 0x000040 +#define IT_EXTRA_WEAPON 0x000080 -@extern float IT_SHELLS; -@extern float IT_NAILS; -@extern float IT_ROCKETS; -@extern float IT_CELLS; +#define IT_SHELLS 0x000100 +#define IT_NAILS 0x000200 +#define IT_ROCKETS 0x000400 +#define IT_CELLS 0x000800 -@extern float IT_ARMOR1; -@extern float IT_ARMOR2; -@extern float IT_ARMOR3; -@extern float IT_SUPERHEALTH; +#define IT_ARMOR1 0x002000 +#define IT_ARMOR2 0x004000 +#define IT_ARMOR3 0x008000 +#define IT_SUPERHEALTH 0x010000 -@extern float IT_KEY1; -@extern float IT_KEY2; +#define IT_KEY1 0x020000 +#define IT_KEY2 0x040000 -@extern float IT_INVISIBILITY; -@extern float IT_INVULNERABILITY; -@extern float IT_SUIT; -@extern float IT_QUAD; +#define IT_INVISIBILITY 0x080000 +#define IT_INVULNERABILITY 0x100000 +#define IT_SUIT 0x200000 +#define IT_QUAD 0x400000 // point content values