mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
cl.items in nq is now cl.stats[ITEMS] as per qw
This commit is contained in:
parent
9c9e22f253
commit
40cbc5ed3c
9 changed files with 53 additions and 53 deletions
|
@ -158,7 +158,6 @@ typedef struct
|
|||
|
||||
// information for local display
|
||||
int stats[MAX_CL_STATS]; // health, etc
|
||||
int items; // inventory bit flags
|
||||
float item_gettime[32]; // cl.time of aquiring item, for blinking
|
||||
float faceanimtime; // use anim frame if cl.time < this
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
#define STAT_TOTALMONSTERS 12
|
||||
#define STAT_SECRETS 13 // bumped on client side by svc_foundsecret
|
||||
#define STAT_MONSTERS 14 // bumped by svc_killedmonster
|
||||
#define STAT_ITEMS 15
|
||||
|
||||
// stock defines
|
||||
|
||||
|
|
|
@ -527,12 +527,12 @@ CL_ParseClientdata (int bits)
|
|||
// [always sent] if (bits & SU_ITEMS)
|
||||
i = MSG_ReadLong (net_message);
|
||||
|
||||
if (cl.items != i) { // set flash times
|
||||
if (cl.stats[STAT_ITEMS] != i) { // set flash times
|
||||
Sbar_Changed ();
|
||||
for (j = 0; j < 32; j++)
|
||||
if ((i & (1 << j)) && !(cl.items & (1 << j)))
|
||||
if ((i & (1 << j)) && !(cl.stats[STAT_ITEMS] & (1 << j)))
|
||||
cl.item_gettime[j] = cl.time;
|
||||
cl.items = i;
|
||||
cl.stats[STAT_ITEMS] = i;
|
||||
}
|
||||
|
||||
cl.onground = (bits & SU_ONGROUND) != 0;
|
||||
|
|
|
@ -857,7 +857,7 @@ R_DrawViewModel (void)
|
|||
if (!r_drawviewmodel->int_val || chase_active->int_val
|
||||
|| envmap
|
||||
|| !r_drawentities->int_val
|
||||
|| (cl.items & IT_INVISIBILITY)
|
||||
|| (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|
||||
|| cl.stats[STAT_HEALTH] <= 0 || !currententity->model)
|
||||
return;
|
||||
|
||||
|
|
|
@ -126,32 +126,32 @@ V_CalcPowerupCshift (void)
|
|||
|
||||
if ((gl_dlight_polyblend->int_val ||
|
||||
!(gl_dlight_lightmap->int_val && gl_dlight_polyblend->int_val)) &&
|
||||
(cl.items & IT_INVULNERABILITY ||
|
||||
cl.items & IT_QUAD))
|
||||
(cl.stats[STAT_ITEMS] & IT_INVULNERABILITY ||
|
||||
cl.stats[STAT_ITEMS] & IT_QUAD))
|
||||
{
|
||||
if (cl.items & IT_INVULNERABILITY &&
|
||||
cl.items & IT_QUAD) {
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY &&
|
||||
cl.stats[STAT_ITEMS] & IT_QUAD) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||
} else if (cl.items & IT_QUAD) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_QUAD) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||
} else if (cl.items & IT_INVULNERABILITY) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||
}
|
||||
} else if (cl.items & IT_SUIT) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_SUIT) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 20;
|
||||
} else if (cl.items & IT_INVISIBILITY) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100;
|
||||
|
|
|
@ -423,7 +423,7 @@ Sbar_DrawInventory (void)
|
|||
|
||||
// weapons
|
||||
for (i = 0; i < 7; i++) {
|
||||
if (cl.items & (IT_SHOTGUN << i)) {
|
||||
if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << i)) {
|
||||
time = cl.item_gettime[i];
|
||||
flashon = (int) ((cl.time - time) * 10);
|
||||
flashon = max (0, flashon);
|
||||
|
@ -457,7 +457,7 @@ Sbar_DrawInventory (void)
|
|||
// int grenadeflashing = 0;
|
||||
//
|
||||
// for (i = 0; i < 4; i++) {
|
||||
// if (cl.items & (1 << hipweapons[i])) {
|
||||
// if (cl.stats[STAT_ITEMS] & (1 << hipweapons[i])) {
|
||||
// time = cl.item_gettime[hipweapons[i]];
|
||||
// flashon = (int) ((cl.time - time) * 10);
|
||||
// flashon = max (0, flashon);
|
||||
|
@ -474,7 +474,7 @@ Sbar_DrawInventory (void)
|
|||
// // check grenade launcher
|
||||
// switch (i) {
|
||||
// case 2:
|
||||
// if (cl.items & HIT_PROXIMITY_GUN) {
|
||||
// if (cl.stats[STAT_ITEMS] & HIT_PROXIMITY_GUN) {
|
||||
// if (flashon) {
|
||||
// grenadeflashing = 1;
|
||||
// Sbar_DrawPic (96, -16, hsb_weapons[flashon][2]);
|
||||
|
@ -482,7 +482,7 @@ Sbar_DrawInventory (void)
|
|||
// }
|
||||
// break;
|
||||
// case 3:
|
||||
// if (cl.items & (IT_SHOTGUN << 4)) {
|
||||
// if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << 4)) {
|
||||
// if (flashon && !grenadeflashing) {
|
||||
// Sbar_DrawPic (96, -16, hsb_weapons[flashon][3]);
|
||||
// } else if (!grenadeflashing) {
|
||||
|
@ -549,7 +549,7 @@ Sbar_DrawInventory (void)
|
|||
|
||||
// items
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (cl.items & (1 << (17 + i))) {
|
||||
if (cl.stats[STAT_ITEMS] & (1 << (17 + i))) {
|
||||
time = cl.item_gettime[17 + i];
|
||||
if (time && time > (cl.time - 2) && flashon) { // Flash frame
|
||||
sb_updates = 0;
|
||||
|
@ -568,7 +568,7 @@ Sbar_DrawInventory (void)
|
|||
// // hipnotic items
|
||||
// if (hipnotic) {
|
||||
// for (i = 0; i < 2; i++) {
|
||||
// if (cl.items & (1 << (24 + i))) {
|
||||
// if (cl.stats[STAT_ITEMS] & (1 << (24 + i))) {
|
||||
// time = cl.item_gettime[24 + i];
|
||||
// if (time && time > cl.time - 2 && flashon) { // flash
|
||||
// // frame
|
||||
|
@ -585,7 +585,7 @@ Sbar_DrawInventory (void)
|
|||
// FIXME: MISSIONHUD
|
||||
// if (rogue) { // new rogue items
|
||||
// for (i = 0; i < 2; i++) {
|
||||
// if (cl.items & (1 << (29 + i))) {
|
||||
// if (cl.stats[STAT_ITEMS] & (1 << (29 + i))) {
|
||||
// time = cl.item_gettime[29 + i];
|
||||
//
|
||||
// if (time && time > (cl.time - 2) && flashon) { // flash
|
||||
|
@ -602,7 +602,7 @@ Sbar_DrawInventory (void)
|
|||
// } else {
|
||||
// sigils
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (cl.items & (1 << (28 + i))) {
|
||||
if (cl.stats[STAT_ITEMS] & (1 << (28 + i))) {
|
||||
time = cl.item_gettime[28 + i];
|
||||
if (time && time > cl.time - 2 && flashon) { // flash
|
||||
// frame
|
||||
|
@ -728,23 +728,23 @@ Sbar_DrawFace (void)
|
|||
// }
|
||||
// PGM 01/19/97 - team color drawing
|
||||
|
||||
if ((cl.items & (IT_INVISIBILITY | IT_INVULNERABILITY))
|
||||
if ((cl.stats[STAT_ITEMS] & (IT_INVISIBILITY | IT_INVULNERABILITY))
|
||||
== (IT_INVISIBILITY | IT_INVULNERABILITY)) {
|
||||
Sbar_DrawPic (112, 0, sb_face_invis_invuln);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cl.items & IT_QUAD) {
|
||||
if (cl.stats[STAT_ITEMS] & IT_QUAD) {
|
||||
Sbar_DrawPic (112, 0, sb_face_quad);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cl.items & IT_INVISIBILITY) {
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
|
||||
Sbar_DrawPic (112, 0, sb_face_invis);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cl.items & IT_INVULNERABILITY) {
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
|
||||
Sbar_DrawPic (112, 0, sb_face_invuln);
|
||||
return;
|
||||
}
|
||||
|
@ -772,13 +772,13 @@ Sbar_DrawNormal (void)
|
|||
|
||||
// FIXME: MISSIONHUD
|
||||
// if (hipnotic) {
|
||||
// if (cl.items & IT_KEY1)
|
||||
// if (cl.stats[STAT_ITEMS] & IT_KEY1)
|
||||
// Sbar_DrawPic (209, 3, sb_items[0]);
|
||||
// if (cl.items & IT_KEY2)
|
||||
// if (cl.stats[STAT_ITEMS] & IT_KEY2)
|
||||
// Sbar_DrawPic (209, 12, sb_items[1]);
|
||||
// }
|
||||
// armor
|
||||
if (cl.items & IT_INVULNERABILITY) {
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
|
||||
Sbar_DrawNum (24, 0, 666, 3, 1);
|
||||
Sbar_DrawPic (0, 0, draw_disc);
|
||||
} else {
|
||||
|
@ -786,20 +786,20 @@ Sbar_DrawNormal (void)
|
|||
// if (rogue) {
|
||||
// Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3,
|
||||
// cl.stats[STAT_ARMOR] <= 25);
|
||||
// if (cl.items & RIT_ARMOR3)
|
||||
// if (cl.stats[STAT_ITEMS] & RIT_ARMOR3)
|
||||
// Sbar_DrawPic (0, 0, sb_armor[2]);
|
||||
// else if (cl.items & RIT_ARMOR2)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_ARMOR2)
|
||||
// Sbar_DrawPic (0, 0, sb_armor[1]);
|
||||
// else if (cl.items & RIT_ARMOR1)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_ARMOR1)
|
||||
// Sbar_DrawPic (0, 0, sb_armor[0]);
|
||||
// } else {
|
||||
Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3,
|
||||
cl.stats[STAT_ARMOR] <= 25);
|
||||
if (cl.items & IT_ARMOR3)
|
||||
if (cl.stats[STAT_ITEMS] & IT_ARMOR3)
|
||||
Sbar_DrawPic (0, 0, sb_armor[2]);
|
||||
else if (cl.items & IT_ARMOR2)
|
||||
else if (cl.stats[STAT_ITEMS] & IT_ARMOR2)
|
||||
Sbar_DrawPic (0, 0, sb_armor[1]);
|
||||
else if (cl.items & IT_ARMOR1)
|
||||
else if (cl.stats[STAT_ITEMS] & IT_ARMOR1)
|
||||
Sbar_DrawPic (0, 0, sb_armor[0]);
|
||||
// }
|
||||
}
|
||||
|
@ -814,28 +814,28 @@ Sbar_DrawNormal (void)
|
|||
// FIXME: MISSIONHUD
|
||||
// // ammo icon
|
||||
// if (rogue) {
|
||||
// if (cl.items & RIT_SHELLS)
|
||||
// if (cl.stats[STAT_ITEMS] & RIT_SHELLS)
|
||||
// Sbar_DrawPic (224, 0, sb_ammo[0]);
|
||||
// else if (cl.items & RIT_NAILS)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_NAILS)
|
||||
// Sbar_DrawPic (224, 0, sb_ammo[1]);
|
||||
// else if (cl.items & RIT_ROCKETS)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_ROCKETS)
|
||||
// Sbar_DrawPic (224, 0, sb_ammo[2]);
|
||||
// else if (cl.items & RIT_CELLS)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_CELLS)
|
||||
// Sbar_DrawPic (224, 0, sb_ammo[3]);
|
||||
// else if (cl.items & RIT_LAVA_NAILS)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_LAVA_NAILS)
|
||||
// Sbar_DrawPic (224, 0, rsb_ammo[0]);
|
||||
// else if (cl.items & RIT_PLASMA_AMMO)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_PLASMA_AMMO)
|
||||
// Sbar_DrawPic (224, 0, rsb_ammo[1]);
|
||||
// else if (cl.items & RIT_MULTI_ROCKETS)
|
||||
// else if (cl.stats[STAT_ITEMS] & RIT_MULTI_ROCKETS)
|
||||
// Sbar_DrawPic (224, 0, rsb_ammo[2]);
|
||||
// } else {
|
||||
if (cl.items & IT_SHELLS)
|
||||
if (cl.stats[STAT_ITEMS] & IT_SHELLS)
|
||||
Sbar_DrawPic (224, 0, sb_ammo[0]);
|
||||
else if (cl.items & IT_NAILS)
|
||||
else if (cl.stats[STAT_ITEMS] & IT_NAILS)
|
||||
Sbar_DrawPic (224, 0, sb_ammo[1]);
|
||||
else if (cl.items & IT_ROCKETS)
|
||||
else if (cl.stats[STAT_ITEMS] & IT_ROCKETS)
|
||||
Sbar_DrawPic (224, 0, sb_ammo[2]);
|
||||
else if (cl.items & IT_CELLS)
|
||||
else if (cl.stats[STAT_ITEMS] & IT_CELLS)
|
||||
Sbar_DrawPic (224, 0, sb_ammo[3]);
|
||||
// }
|
||||
Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
|
||||
|
|
|
@ -636,7 +636,7 @@ R_DrawViewModel (void)
|
|||
if (chase_active->int_val)
|
||||
return;
|
||||
|
||||
if (cl.items & IT_INVISIBILITY)
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|
||||
return;
|
||||
|
||||
if (cl.stats[STAT_HEALTH] <= 0)
|
||||
|
|
|
@ -49,28 +49,28 @@ V_CalcPowerupCshift (void)
|
|||
if (!cl_cshift_powerup->int_val)
|
||||
return;
|
||||
|
||||
if (cl.items & IT_QUAD
|
||||
&& cl.items & IT_INVULNERABILITY) {
|
||||
if (cl.stats[STAT_ITEMS] & IT_QUAD
|
||||
&& cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||
} else if (cl.items & IT_QUAD) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_QUAD) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 30;
|
||||
} else if (cl.items & IT_SUIT) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_SUIT) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 20;
|
||||
} else if (cl.items & IT_INVISIBILITY) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100;
|
||||
cl.cshifts[CSHIFT_POWERUP].percent = 100;
|
||||
} else if (cl.items & IT_INVULNERABILITY) {
|
||||
} else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
|
||||
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
|
||||
|
|
Loading…
Reference in a new issue