Support displaying Double-Tap 1.0 icon

This commit is contained in:
cypress 2023-11-28 11:53:52 -05:00
parent 6560bf5632
commit e964dcb309
4 changed files with 47 additions and 2 deletions

View file

@ -31,6 +31,7 @@ qpic_t *jugpic;
qpic_t *floppic;
qpic_t *staminpic;
qpic_t *doublepic;
qpic_t *doublepic2;
qpic_t *speedpic;
qpic_t *deadpic;
qpic_t *mulepic;
@ -60,6 +61,7 @@ qpic_t *fx_blood_rd;
qboolean sb_showscores;
qboolean domaxammo;
qboolean doubletap_has_damage_buff;
int x_value, y_value;
@ -123,6 +125,7 @@ void HUD_Init (void)
floppic = Draw_CachePic ("gfx/hud/flopper");
staminpic = Draw_CachePic ("gfx/hud/stamin");
doublepic = Draw_CachePic ("gfx/hud/double");
doublepic2 = Draw_CachePic ("gfx/hud/double2");
speedpic = Draw_CachePic ("gfx/hud/speed");
deadpic = Draw_CachePic ("gfx/hud/dead");
mulepic = Draw_CachePic ("gfx/hud/mule");
@ -1101,12 +1104,19 @@ void HUD_Perks (void)
y = 2;
scale = 22;
// Double-Tap 2.0 specialty icon
qpic_t* double_tap_icon;
if (doubletap_has_damage_buff)
double_tap_icon = doublepic2;
else
double_tap_icon = doublepic;
// Draw second column first -- these need to be
// overlayed below the first column.
for (int i = 4; i < 8; i++) {
if (perk_order[i]) {
if (perk_order[i] == P_JUG) {Draw_StretchPic(x, y, jugpic, scale, scale);}
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, doublepic, scale, scale);}
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, double_tap_icon, scale, scale);}
if (perk_order[i] == P_SPEED) {Draw_StretchPic(x, y, speedpic, scale, scale);}
if (perk_order[i] == P_REVIVE) {Draw_StretchPic(x, y, revivepic, scale, scale);}
if (perk_order[i] == P_FLOP) {Draw_StretchPic(x, y, floppic, scale, scale);}
@ -1124,7 +1134,7 @@ void HUD_Perks (void)
for (int i = 0; i < 4; i++) {
if (perk_order[i]) {
if (perk_order[i] == P_JUG) {Draw_StretchPic(x, y, jugpic, scale, scale);}
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, doublepic, scale, scale);}
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, double_tap_icon, scale, scale);}
if (perk_order[i] == P_SPEED) {Draw_StretchPic(x, y, speedpic, scale, scale);}
if (perk_order[i] == P_REVIVE) {Draw_StretchPic(x, y, revivepic, scale, scale);}
if (perk_order[i] == P_FLOP) {Draw_StretchPic(x, y, floppic, scale, scale);}

View file

@ -1022,6 +1022,7 @@ void CL_ParseLimbUpdate (void)
#define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
extern double bettyprompt_time;
extern qboolean doubletap_has_damage_buff;
void CL_ParseServerMessage (void)
{
int cmd;
@ -1115,6 +1116,10 @@ void CL_ParseServerMessage (void)
crosshair_pulse_grenade = true;
break;
case svc_doubletap:
doubletap_has_damage_buff = MSG_ReadByte();
break;
case svc_bettyprompt:
bettyprompt_time = sv.time + 4;
break;

View file

@ -3275,6 +3275,34 @@ void PF_GrenadePulse(void)
MSG_WriteByte (&client->message,svc_pulse);
}
/*
=================
PF_SetDoubleTapVersion
Server tells client which HUD icon
to draw for Double-Tap (damage buff
v.s. just rate of fire enhancement).
nzp_setdoubletapver()
=================
*/
void PF_SetDoubleTapVersion(void)
{
client_t *client;
int entnum;
int state;
entnum = G_EDICTNUM(OFS_PARM0);
state = G_FLOAT(OFS_PARM1);
if (entnum < 1 || entnum > svs.maxclients)
return;
client = &svs.clients[entnum-1];
MSG_WriteByte (&client->message, svc_doubletap);
MSG_WriteByte (&client->message, state);
}
/*
=================
PF_BettyPrompt
@ -3948,6 +3976,7 @@ PF_GrenadePulse, // #502
PF_MaxZombies, // #503
PF_BettyPrompt, // #504
PF_SetPlayerName, // #505
PF_SetDoubleTapVersion, // #506
PF_Fixme,
};

View file

@ -153,6 +153,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define svc_pulse 46
#define svc_bettyprompt 47
#define svc_playername 48
#define svc_doubletap 49
//
// client to server