fix rogue's item code

This commit is contained in:
Bill Currie 2003-05-10 02:54:17 +00:00
parent b5a960c57b
commit 23e47863c4

View file

@ -694,10 +694,9 @@ draw_health (view_t *view)
cl.stats[STAT_HEALTH] <= 25); cl.stats[STAT_HEALTH] <= 25);
} }
static inline int static inline void
draw_ammo (view_t *view) draw_ammo (view_t *view)
{ {
int ret = 1;
if (cl.stats[STAT_ITEMS] & IT_SHELLS) if (cl.stats[STAT_ITEMS] & IT_SHELLS)
draw_pic (view, 224, 0, sb_ammo[0]); draw_pic (view, 224, 0, sb_ammo[0]);
else if (cl.stats[STAT_ITEMS] & IT_NAILS) else if (cl.stats[STAT_ITEMS] & IT_NAILS)
@ -706,10 +705,8 @@ draw_ammo (view_t *view)
draw_pic (view, 224, 0, sb_ammo[2]); draw_pic (view, 224, 0, sb_ammo[2]);
else if (cl.stats[STAT_ITEMS] & IT_CELLS) else if (cl.stats[STAT_ITEMS] & IT_CELLS)
draw_pic (view, 224, 0, sb_ammo[3]); draw_pic (view, 224, 0, sb_ammo[3]);
else
ret = 0;
draw_num (view, 248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10); draw_num (view, 248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
return ret;
} }
static void static void
@ -746,22 +743,26 @@ draw_rogue_weapons_sbar (view_t *view)
static void static void
draw_rogue_weapons_hud (view_t *view) draw_rogue_weapons_hud (view_t *view)
{ {
int flashon, i; int flashon, i, j;
qpic_t *pic;
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << i)) { if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << i)) {
flashon = calc_flashon (cl.item_gettime[i], IT_SHOTGUN << i); flashon = calc_flashon (cl.item_gettime[i], IT_SHOTGUN << i);
draw_subpic (view, 0, i * 16, sb_weapons[flashon][i], 0, 0, 24, 16); if (i >= 2) {
j = i - 2;
if (cl.stats[STAT_ACTIVEWEAPON] == (RIT_LAVA_NAILGUN << j))
pic = rsb_weapons[j];
else
pic = sb_weapons[flashon][i];
} else {
pic = sb_weapons[flashon][i];
}
draw_subpic (view, 0, i * 16, pic, 0, 0, 24, 16);
if (flashon > 1) if (flashon > 1)
sb_updates = 0; // force update to remove flash sb_updates = 0; // force update to remove flash
} }
} }
for (i = 0; i < 5; i++) {
//if (cl.stats[STAT_ACTIVEWEAPON] == (RIT_LAVA_NAILGUN << i)) {
if (cl.stats[STAT_ITEMS] & (RIT_LAVA_NAILGUN << i)) {
draw_pic (view, 0, i * 16 + 112, rsb_weapons[i]);
}
}
} }
static void static void
@ -841,21 +842,38 @@ draw_rogue_status (view_t *view)
return; return;
} }
draw_armor (view); draw_num (view, 24, 0, cl.stats[STAT_ARMOR], 3,
cl.stats[STAT_ARMOR] <= 25);
if (cl.stats[STAT_ITEMS] & RIT_ARMOR3)
draw_pic (view, 0, 0, sb_armor[2]);
else if (cl.stats[STAT_ITEMS] & RIT_ARMOR2)
draw_pic (view, 0, 0, sb_armor[1]);
else if (cl.stats[STAT_ITEMS] & RIT_ARMOR1)
draw_pic (view, 0, 0, sb_armor[0]);
// PGM 03/02/97 - fixed so color swatch only appears in CTF modes // PGM 03/02/97 - fixed so color swatch only appears in CTF modes
if (cl.maxclients != 1 && teamplay->int_val > 3 && teamplay->int_val < 7) if (cl.maxclients != 1 && teamplay->int_val > 3 && teamplay->int_val < 7)
draw_rogue_face (view); draw_rogue_face (view);
else else
draw_face (view); draw_face (view);
draw_health (view); draw_health (view);
if (!draw_ammo (view)) {
if (cl.stats[STAT_ITEMS] & RIT_LAVA_NAILS) if (cl.stats[STAT_ITEMS] & RIT_SHELLS)
draw_pic (view, 224, 0, sb_ammo[0]);
else if (cl.stats[STAT_ITEMS] & RIT_NAILS)
draw_pic (view, 224, 0, sb_ammo[1]);
else if (cl.stats[STAT_ITEMS] & RIT_ROCKETS)
draw_pic (view, 224, 0, sb_ammo[2]);
else if (cl.stats[STAT_ITEMS] & RIT_CELLS)
draw_pic (view, 224, 0, sb_ammo[3]);
else if (cl.stats[STAT_ITEMS] & RIT_LAVA_NAILS)
draw_pic (view, 224, 0, rsb_ammo[0]); draw_pic (view, 224, 0, rsb_ammo[0]);
else if (cl.stats[STAT_ITEMS] & RIT_PLASMA_AMMO) else if (cl.stats[STAT_ITEMS] & RIT_PLASMA_AMMO)
draw_pic (view, 224, 0, rsb_ammo[1]); draw_pic (view, 224, 0, rsb_ammo[1]);
else if (cl.stats[STAT_ITEMS] & RIT_MULTI_ROCKETS) else if (cl.stats[STAT_ITEMS] & RIT_MULTI_ROCKETS)
draw_pic (view, 224, 0, rsb_ammo[2]); draw_pic (view, 224, 0, rsb_ammo[2]);
} draw_num (view, 248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
} }
static void static void
@ -1488,14 +1506,9 @@ init_rogue_hud_views (void)
hud_view->resize_y = 1; hud_view->resize_y = 1;
if (vid.conheight < 284) { hud_armament_view = view_new (0, 48, 42, 156, grav_southeast);
hud_armament_view = view_new (0, min (vid.conheight - 192, 48),
66, 192, grav_southeast);
} else {
hud_armament_view = view_new (0, 48, 42, 236, grav_southeast);
}
view = view_new (0, 0, 24, 192, grav_northeast); view = view_new (0, 0, 24, 112, grav_northeast);
view->draw = draw_rogue_weapons_hud; view->draw = draw_rogue_weapons_hud;
view_add (hud_armament_view, view); view_add (hud_armament_view, view);