* cv_powerupdisplay. Never, First-person only (default), Always.
* New monitor stuff.
* Fixed hitmessages.
* Some CTF stuff.
* Aaaaugh it's a lot I hate myself I need to work on my coursework.
* I'll figure out what I did here in the merge request when that's done.
This commit is contained in:
toasterbabe 2018-03-26 23:53:09 +01:00
parent 33afd94252
commit 98601dc757
15 changed files with 415 additions and 297 deletions

View file

@ -309,9 +309,12 @@ consvar_t cv_overtime = {"overtime", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL,
consvar_t cv_rollingdemos = {"rollingdemos", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t timetic_cons_t[] = {{0, "Normal"}, {1, "Tics"}, {2, "Centiseconds"}, {3, "Mania"}, {0, NULL}};
static CV_PossibleValue_t timetic_cons_t[] = {{0, "Normal"}, {1, "Centiseconds"}, {2, "Mania"}, {3, "Tics"}, {0, NULL}};
consvar_t cv_timetic = {"timerres", "Normal", CV_SAVE, timetic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
static CV_PossibleValue_t powerupdisplay_cons_t[] = {{0, "Never"}, {1, "First-person only"}, {2, "Always"}, {0, NULL}};
consvar_t cv_powerupdisplay = {"powerupdisplay", "First-person only", CV_SAVE, powerupdisplay_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t pointlimit_cons_t[] = {{0, "MIN"}, {999999990, "MAX"}, {0, NULL}};
@ -670,6 +673,7 @@ void D_RegisterClientCommands(void)
// HUD
CV_RegisterVar(&cv_timetic);
CV_RegisterVar(&cv_powerupdisplay);
CV_RegisterVar(&cv_itemfinder);
CV_RegisterVar(&cv_showinputjoy);

View file

@ -4521,6 +4521,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_BOXSPARKLE1",
"S_BOXSPARKLE2",
"S_BOXSPARKLE3",
"S_BOXSPARKLE4",
"S_BOX_FLICKER",
"S_BOX_POP1",
@ -5511,8 +5512,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// Got Flag Sign
"S_GOTFLAG",
"S_GOTREDFLAG",
"S_GOTBLUEFLAG",
"S_CORK",
@ -5852,6 +5851,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_XPLD_FLICKY",
"S_XPLD1",
"S_XPLD2",
"S_XPLD3",
"S_XPLD4",
"S_XPLD5",
"S_XPLD6",
"S_XPLD_EGGTRAP",
// Underwater Explosion
@ -6815,7 +6818,7 @@ static const char *const HUDITEMS_LIST[] = {
"TIMELEFTNUM",
"TIMEUP",
"HUNTPICS",
"GRAVBOOTSICO",
"POWERUPS",
"LAP"
};

View file

@ -498,6 +498,7 @@ extern boolean singletics;
#include "d_clisrv.h"
extern consvar_t cv_timetic; // display high resolution timer
extern consvar_t cv_powerupdisplay; // display powerups
extern consvar_t cv_showinputjoy; // display joystick in time attack
extern consvar_t cv_forceskin; // force clients to use the server's skin
extern consvar_t cv_downloading; // allow clients to downloading WADs.

View file

@ -1547,7 +1547,7 @@ static inline void HU_DrawSpectatorTicker(void)
templength = length;
}
V_DrawString(templength, height + 8, V_TRANSLUCENT, current);
V_DrawString(templength, height + 8, V_TRANSLUCENT|V_ALLOWLOWERCASE, current);
}
length += (signed)strlen(player_names[i]) * 8 + 16;
@ -1559,7 +1559,6 @@ static inline void HU_DrawSpectatorTicker(void)
//
static void HU_DrawRankings(void)
{
patch_t *p;
playersort_t tab[MAXPLAYERS];
INT32 i, j, scorelines;
boolean completed[MAXPLAYERS];
@ -1568,25 +1567,6 @@ static void HU_DrawRankings(void)
// draw the current gametype in the lower right
HU_drawGametype();
if (G_GametypeHasTeams())
{
if (gametype == GT_CTF)
p = bflagico;
else
p = bmatcico;
V_DrawSmallScaledPatch(128 - SHORT(p->width)/4, 4, 0, p);
V_DrawCenteredString(128, 16, 0, va("%u", bluescore));
if (gametype == GT_CTF)
p = rflagico;
else
p = rmatcico;
V_DrawSmallScaledPatch(192 - SHORT(p->width)/4, 4, 0, p);
V_DrawCenteredString(192, 16, 0, va("%u", redscore));
}
if (gametype != GT_RACE && gametype != GT_COMPETITION && gametype != GT_COOP)
{
if (cv_timelimit.value && timelimitintics > 0)

View file

@ -680,7 +680,7 @@ state_t states[NUMSTATES] =
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_OBJPLACE_DUMMY}, //S_OBJPLACE_DUMMY
// 1-Up box sprites (uses player sprite)
{SPR_PLAY, SPR2_LIFE, 2, {NULL}, 0, 16, S_PLAY_BOX2}, // S_PLAY_BOX1
{SPR_PLAY, SPR2_LIFE, 2, {NULL}, 0, 18, S_PLAY_BOX2}, // S_PLAY_BOX1
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_PLAY_BOX1}, // S_PLAY_BOX2
{SPR_PLAY, SPR2_LIFE, 4, {NULL}, 0, 4, S_PLAY_ICON2}, // S_PLAY_ICON1
{SPR_NULL, 0, 12, {NULL}, 0, 0, S_PLAY_ICON3}, // S_PLAY_ICON2
@ -1727,9 +1727,10 @@ state_t states[NUMSTATES] =
{SPR_NULL, 0, 2, {A_SetRandomTics}, TICRATE/2, 3*TICRATE, S_CANNONLAUNCHER1}, // S_CANNONLAUNCHER3
// Monitor Miscellany
{SPR_NSPK, FF_TRANS40, 20, {NULL}, 0, 0, S_BOXSPARKLE2}, // S_BOXSPARKLE1
{SPR_NSPK, FF_TRANS60, 10, {NULL}, 0, 0, S_BOXSPARKLE3}, // S_BOXSPARKLE2
{SPR_NSPK, FF_TRANS80, 5, {NULL}, 0, 0, S_NULL}, // S_BOXSPARKLE3
{SPR_NSPK, 0, 16, {NULL}, 0, 0, S_BOXSPARKLE2}, // S_BOXSPARKLE1
{SPR_NSPK, 1, 12, {NULL}, 0, 0, S_BOXSPARKLE3}, // S_BOXSPARKLE2
{SPR_NSPK, 2, 8, {NULL}, 0, 0, S_BOXSPARKLE4}, // S_BOXSPARKLE3
{SPR_NSPK, 3, 4, {NULL}, 0, 0, S_NULL}, // S_BOXSPARKLE4
{SPR_MSTV, 0, 1, {NULL}, 0, 0, S_SPAWNSTATE}, // S_BOX_FLICKER
{SPR_MSTV, 0, 4, {A_MonitorPop}, 0, 0, S_BOX_POP2}, // S_BOX_POP1
@ -2735,8 +2736,6 @@ state_t states[NUMSTATES] =
// CTF Sign
{SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG
{SPR_GFLG, 1|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTREDFLAG
{SPR_GFLG, 2|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTBLUEFLAG
{SPR_CORK, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CORK
@ -3121,11 +3120,15 @@ state_t states[NUMSTATES] =
{SPR_SPRK, FF_TRANS90|3, 1, {NULL}, 0, 0, S_NULL}, // S_SPRK16
// Robot Explosion
{SPR_BOM1, 0, 0, {A_FlickySpawn}, 0, 0, S_XPLD1}, // S_XPLD_FLICKY
{SPR_BOM1, 0, 1, {A_Scream}, 0, 0, S_XPLD2}, // S_XPLD1
{SPR_BOM1, FF_ANIMATE|1, 15, {NULL}, 2, 5, S_NULL}, // S_XPLD2
{SPR_BOM1, 0, 0, {A_FlickySpawn}, 0, 0, S_XPLD1}, // S_XPLD_FLICKY
{SPR_BOM1, 0, 2, {A_Scream}, 0, 0, S_XPLD2}, // S_XPLD1
{SPR_BOM1, 1, 2, {NULL}, 0, 0, S_XPLD3}, // S_XPLD2
{SPR_BOM1, 2, 3, {NULL}, 0, 0, S_XPLD4}, // S_XPLD3
{SPR_BOM1, 3, 3, {NULL}, 0, 0, S_XPLD5}, // S_XPLD4
{SPR_BOM1, 4, 4, {NULL}, 0, 0, S_XPLD6}, // S_XPLD5
{SPR_BOM1, 5, 4, {NULL}, 0, 0, S_NULL}, // S_XPLD6
{SPR_BOM1, FF_ANIMATE, 20, {NULL}, 3, 5, S_INVISIBLE}, // S_XPLD_EGGTRAP
{SPR_BOM1, FF_ANIMATE, 21, {NULL}, 5, 4, S_INVISIBLE}, // S_XPLD_EGGTRAP
// Underwater Explosion
{SPR_BOM4, 0, 3, {A_Scream}, 0, 0, S_WPLD2}, // S_WPLD1
@ -6386,8 +6389,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_RING_ICON, // damage
@ -6413,8 +6416,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_PITY_ICON, // damage
@ -6440,8 +6443,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_ATTRACT_ICON,// damage
@ -6467,8 +6470,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_FORCE_ICON, // damage
@ -6494,8 +6497,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_ARMAGEDDON_ICON, // damage
@ -6521,8 +6524,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_WHIRLWIND_ICON, // damage
@ -6548,8 +6551,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_ELEMENTAL_ICON, // damage
@ -6575,8 +6578,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_SNEAKERS_ICON, // damage
@ -6602,8 +6605,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_INVULN_ICON, // damage
@ -6629,8 +6632,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_1UP_ICON, // damage
@ -6656,8 +6659,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_EGGMAN_ICON, // damage
@ -6683,8 +6686,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_MIXUP_ICON, // damage
@ -6710,8 +6713,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_UNKNOWN, // damage
@ -6737,8 +6740,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_GRAVITY_ICON, // damage
@ -6764,8 +6767,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_RECYCLER_ICON, // damage
@ -6791,8 +6794,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_SCORE1K_ICON, // damage
@ -6818,8 +6821,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_SCORE10K_ICON, // damage
@ -6845,8 +6848,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_FLAMEAURA_ICON, // damage
@ -6872,8 +6875,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_BUBBLEWRAP_ICON, // damage
@ -6899,8 +6902,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_THUNDERCOIN_ICON, // damage
@ -6926,8 +6929,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_PITY_ICON, // damage
@ -6953,8 +6956,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_ATTRACT_ICON,// damage
@ -6980,8 +6983,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_FORCE_ICON, // damage
@ -7007,8 +7010,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_ARMAGEDDON_ICON, // damage
@ -7034,8 +7037,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_WHIRLWIND_ICON, // damage
@ -7061,8 +7064,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_ELEMENTAL_ICON, // damage
@ -7088,8 +7091,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_SNEAKERS_ICON, // damage
@ -7115,8 +7118,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_INVULN_ICON, // damage
@ -7142,8 +7145,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_EGGMAN_ICON, // damage
@ -7169,8 +7172,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_GRAVITY_ICON, // damage
@ -7196,8 +7199,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_FLAMEAURA_ICON, // damage
@ -7223,8 +7226,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_BUBBLEWRAP_ICON, // damage
@ -7250,8 +7253,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
36*FRACUNIT, // height
20*FRACUNIT, // radius
44*FRACUNIT, // height
0, // display offset
100, // mass
MT_THUNDERCOIN_ICON, // damage
@ -7277,8 +7280,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_RING_ICON, // damage
@ -7304,8 +7307,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_pop, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
18*FRACUNIT, // radius
40*FRACUNIT, // height
0, // display offset
100, // mass
MT_RING_ICON, // damage

View file

@ -1834,6 +1834,7 @@ typedef enum state
S_BOXSPARKLE1,
S_BOXSPARKLE2,
S_BOXSPARKLE3,
S_BOXSPARKLE4,
S_BOX_FLICKER,
S_BOX_POP1,
@ -2826,8 +2827,6 @@ typedef enum state
// Got Flag Sign
S_GOTFLAG,
S_GOTREDFLAG,
S_GOTBLUEFLAG,
S_CORK,
@ -3167,6 +3166,10 @@ typedef enum state
S_XPLD_FLICKY,
S_XPLD1,
S_XPLD2,
S_XPLD3,
S_XPLD4,
S_XPLD5,
S_XPLD6,
S_XPLD_EGGTRAP,
// Underwater Explosion

View file

@ -1266,7 +1266,7 @@ void Command_ObjectPlace_f(void)
if (!COM_CheckParm("-silent"))
{
HU_SetCEchoFlags(V_RETURN8|V_MONOSPACE);
HU_SetCEchoFlags(V_RETURN8|V_MONOSPACE|V_AUTOFADEOUT);
HU_SetCEchoDuration(10);
HU_DoCEcho(va(M_GetText(
"\\\\\\\\\\\\\\\\\\\\\\\\\x82"

View file

@ -1196,24 +1196,25 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 61},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "HUD Transparency", &cv_translucenthud, 66},
{IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 71},
{IT_STRING | IT_CVAR, NULL, "Score/Time/Rings", &cv_timetic, 71},
{IT_STRING | IT_CVAR, NULL, "Show Powerups", &cv_powerupdisplay, 76},
#ifdef SEENAMES
{IT_STRING | IT_CVAR, NULL, "Show player names", &cv_seenames, 76},
{IT_STRING | IT_CVAR, NULL, "Show player names", &cv_seenames, 81},
#endif
{IT_HEADER, NULL, "Console", NULL, 85},
{IT_STRING | IT_CVAR, NULL, "Background color", &cons_backcolor, 91},
{IT_STRING | IT_CVAR, NULL, "Text Size", &cv_constextsize, 96},
{IT_HEADER, NULL, "Console", NULL, 90},
{IT_STRING | IT_CVAR, NULL, "Background color", &cons_backcolor, 96},
{IT_STRING | IT_CVAR, NULL, "Text Size", &cv_constextsize, 101},
{IT_HEADER, NULL, "Level", NULL, 105},
{IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 111},
{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 116},
{IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 121},
{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 126},
{IT_HEADER, NULL, "Level", NULL, 110},
{IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 116},
{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 121},
{IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 126},
{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 131},
{IT_HEADER, NULL, "Diagnostic", NULL, 135},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 141},
{IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 146},
{IT_HEADER, NULL, "Diagnostic", NULL, 140},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 146},
{IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 151},
};
static menuitem_t OP_VideoModeMenu[] =

View file

@ -3365,8 +3365,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
P_KillPlayer(player, source, damage);
}
P_HitDeathMessages(player, inflictor, source, damagetype);
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
}
@ -3381,6 +3379,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
else
target->health -= damage;
if (player)
P_HitDeathMessages(player, inflictor, source, damagetype);
if (source && source->player && target)
G_GhostAddHit(target);

View file

@ -31,6 +31,7 @@
#include "p_polyobj.h"
#include "p_slopes.h"
#include "hu_stuff.h"
#include "v_video.h" // V_AUTOFADEOUT|V_ALLOWLOWERCASE
#include "m_misc.h"
#include "m_cond.h" //unlock triggers
#include "lua_hook.h" // LUAh_LinedefExecute
@ -3815,9 +3816,9 @@ DoneSection2:
if (!P_IsFlagAtBase(MT_REDFLAG))
break;
HU_SetCEchoFlags(0);
HU_SetCEchoFlags(V_AUTOFADEOUT|V_ALLOWLOWERCASE);
HU_SetCEchoDuration(5);
HU_DoCEcho(va(M_GetText("%s\\captured the blue flag.\\\\\\\\"), player_names[player-players]));
HU_DoCEcho(va(M_GetText("%s%s%s\\CAPTURED THE %sBLUE FLAG%s.\\\\\\\\"), "\x85", player_names[player-players], "\x80", "\x84", "\x80"));
if (splitscreen || players[consoleplayer].ctfteam == 1)
S_StartSound(NULL, sfx_flgcap);
@ -3848,9 +3849,9 @@ DoneSection2:
if (!P_IsFlagAtBase(MT_BLUEFLAG))
break;
HU_SetCEchoFlags(0);
HU_SetCEchoFlags(V_AUTOFADEOUT|V_ALLOWLOWERCASE);
HU_SetCEchoDuration(5);
HU_DoCEcho(va(M_GetText("%s\\captured the red flag.\\\\\\\\"), player_names[player-players]));
HU_DoCEcho(va(M_GetText("%s%s%s\\CAPTURED THE %sRED FLAG%s.\\\\\\\\"), "\x84", player_names[player-players], "\x80", "\x85", "\x80"));
if (splitscreen || players[consoleplayer].ctfteam == 2)
S_StartSound(NULL, sfx_flgcap);

View file

@ -2585,13 +2585,11 @@ static void P_DoPlayerHeadSigns(player_t *player)
}
else
sign->z += P_GetPlayerHeight(player)+FixedMul(16*FRACUNIT, player->mo->scale);
if (leveltime & 4)
{
if (player->gotflag & GF_REDFLAG)
P_SetMobjStateNF(sign, S_GOTREDFLAG);
}
else if (player->gotflag & GF_BLUEFLAG)
P_SetMobjStateNF(sign, S_GOTBLUEFLAG);
if (player->gotflag & GF_REDFLAG)
sign->frame = 1|FF_FULLBRIGHT;
else //if (player->gotflag & GF_BLUEFLAG)
sign->frame = 2|FF_FULLBRIGHT;
}
}
}

View file

@ -440,6 +440,18 @@ void SCR_ClosedCaptions(void)
{
UINT8 i;
boolean gamestopped = (paused || P_AutoPause());
INT32 basey = BASEVIDHEIGHT;
if (gamestate == GS_LEVEL)
{
if (splitscreen)
basey -= 8;
else if (((maptol & TOL_NIGHTS) && (modeattacking == ATTACKING_NIGHTS))
|| (cv_powerupdisplay.value == 2)
|| (cv_powerupdisplay.value == 1 && ((stplyr == &players[displayplayer] && !camera.chase)
|| ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase))))
basey -= 16;
}
for (i = 0; i < NUMCAPTIONS; i++)
{
@ -456,7 +468,7 @@ void SCR_ClosedCaptions(void)
continue;
flags = V_SNAPTORIGHT|V_SNAPTOBOTTOM|V_ALLOWLOWERCASE;
y = BASEVIDHEIGHT-((i + 2)*10);
y = basey-((i + 2)*10);
if (closedcaptions[i].b)
y -= (closedcaptions[i].b--)*vid.dupy;

View file

@ -85,14 +85,14 @@ sfxinfo_t S_sfx[NUMSFX] =
{"athun1", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Thunder"},
{"athun2", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Thunder"},
{"amwtr1", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr2", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr3", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr4", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr5", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr6", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr7", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr8", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"},
{"amwtr1", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr2", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr3", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr4", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr5", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr6", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr7", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"amwtr8", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stream"},
{"bubbl1", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"},
{"bubbl2", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"},
{"bubbl3", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"},

View file

@ -101,6 +101,7 @@ static patch_t *invincibility;
static patch_t *sneakers;
static patch_t *gravboots;
static patch_t *nonicon;
static patch_t *nonicon2;
static patch_t *bluestat;
static patch_t *byelstat;
static patch_t *orngstat;
@ -150,7 +151,7 @@ hudinfo_t hudinfo[NUMHUDITEMS] =
{ 130, 93, 0}, // HUD_TIMEUP
{ 152, 168, 0}, // HUD_HUNTPICS
{ 152, 24, V_SNAPTORIGHT}, // HUD_GRAVBOOTSICO
{ 288, 176, V_SNAPTORIGHT|V_SNAPTOBOTTOM}, // HUD_POWERUPS
};
//
@ -275,18 +276,18 @@ void ST_LoadGraphics(void)
scatterring = W_CachePatchName("SCATIND", PU_HUDGFX);
grenadering = W_CachePatchName("GRENIND", PU_HUDGFX);
railring = W_CachePatchName("RAILIND", PU_HUDGFX);
jumpshield = W_CachePatchName("TVWWC0", PU_HUDGFX);
forceshield = W_CachePatchName("TVFOC0", PU_HUDGFX);
ringshield = W_CachePatchName("TVATC0", PU_HUDGFX);
watershield = W_CachePatchName("TVELC0", PU_HUDGFX);
bombshield = W_CachePatchName("TVARC0", PU_HUDGFX);
pityshield = W_CachePatchName("TVPIC0", PU_HUDGFX);
flameshield = W_CachePatchName("TVFLC0", PU_HUDGFX);
bubbleshield = W_CachePatchName("TVBBC0", PU_HUDGFX);
thundershield = W_CachePatchName("TVZPC0", PU_HUDGFX);
invincibility = W_CachePatchName("TVIVC0", PU_HUDGFX);
sneakers = W_CachePatchName("TVSSC0", PU_HUDGFX);
gravboots = W_CachePatchName("TVGVC0", PU_HUDGFX);
jumpshield = W_CachePatchName("TVWWICON", PU_HUDGFX);
forceshield = W_CachePatchName("TVFOICON", PU_HUDGFX);
ringshield = W_CachePatchName("TVATICON", PU_HUDGFX);
watershield = W_CachePatchName("TVELICON", PU_HUDGFX);
bombshield = W_CachePatchName("TVARICON", PU_HUDGFX);
pityshield = W_CachePatchName("TVPIICON", PU_HUDGFX);
flameshield = W_CachePatchName("TVFLICON", PU_HUDGFX);
bubbleshield = W_CachePatchName("TVBBICON", PU_HUDGFX);
thundershield = W_CachePatchName("TVZPICON", PU_HUDGFX);
invincibility = W_CachePatchName("TVIVICON", PU_HUDGFX);
sneakers = W_CachePatchName("TVSSICON", PU_HUDGFX);
gravboots = W_CachePatchName("TVGVICON", PU_HUDGFX);
tagico = W_CachePatchName("TAGICO", PU_HUDGFX);
rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX);
@ -296,6 +297,7 @@ void ST_LoadGraphics(void)
gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX);
gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX);
nonicon = W_CachePatchName("NONICON", PU_HUDGFX);
nonicon2 = W_CachePatchName("NONICON2", PU_HUDGFX);
// NiGHTS HUD things
bluestat = W_CachePatchName("BLUESTAT", PU_HUDGFX);
@ -644,7 +646,7 @@ static void ST_drawTime(void)
if (!tics && downwards && (leveltime/5 & 1)) // overtime!
return;
if (cv_timetic.value == 1) // Tics only -- how simple is this?
if (cv_timetic.value == 3) // Tics only -- how simple is this?
ST_DrawNumFromHud(HUD_SECONDS, tics, V_HUDTRANS);
else
{
@ -652,7 +654,7 @@ static void ST_drawTime(void)
ST_DrawPatchFromHud(HUD_TIMECOLON, sbocolon, V_HUDTRANS); // Colon
ST_DrawPadNumFromHud(HUD_SECONDS, seconds, 2, V_HUDTRANS); // Seconds
if (cv_timetic.value == 2 || cv_timetic.value == 3 || modeattacking) // there's not enough room for tics in splitscreen, don't even bother trying!
if (cv_timetic.value == 1 || cv_timetic.value == 2 || modeattacking) // there's not enough room for tics in splitscreen, don't even bother trying!
{
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod, V_HUDTRANS); // Period
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2, V_HUDTRANS); // Tics
@ -679,7 +681,7 @@ static inline void ST_drawRings(void)
else
ringnum = max(stplyr->rings, 0);
if (cv_timetic.value == 3) // Yes, even in modeattacking
if (cv_timetic.value == 2) // Yes, even in modeattacking
ST_DrawNumFromHud(HUD_RINGSNUMTICS, ringnum, V_PERPLAYER|((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
else
ST_DrawNumFromHud(HUD_RINGSNUM, ringnum, V_PERPLAYER|((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
@ -1128,93 +1130,160 @@ static void ST_drawLevelTitle(void)
V_DrawCenteredString(subttlxpos, lvlttly+48, V_ALLOWLOWERCASE, subttl);
}
static void ST_drawFirstPersonHUD(void)
static void ST_drawPowerupHUD(void)
{
player_t *player = stplyr;
patch_t *p = NULL;
UINT16 invulntime = 0;
INT32 offs = hudinfo[HUD_POWERUPS].x;
static INT32 flagoffs = 0, shieldoffs = 0;
#define ICONSEP (16+4) // matches weapon rings HUD
if (player->playerstate != PST_LIVE)
if (stplyr->spectator || stplyr->playerstate != PST_LIVE)
return;
// Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right
if ((player->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE)
if (stplyr->powers[pw_shield] & SH_NOSTACK)
{
UINT8 i, max = (player->powers[pw_shield] & SH_FORCEHP);
for (i = 0; i <= max; i++)
shieldoffs = ICONSEP;
if ((stplyr->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE)
{
V_DrawScaledPatch(304-(3*i), 24+(3*i), (V_PERPLAYER|V_SNAPTORIGHT|V_SNAPTOTOP)|((i == max) ? V_HUDTRANS : V_HUDTRANSHALF), forceshield);
UINT8 i, max = (stplyr->powers[pw_shield] & SH_FORCEHP);
for (i = 0; i <= max; i++)
{
V_DrawSmallScaledPatch(offs-(i<<1), hudinfo[HUD_POWERUPS].y-(i<<1), (V_PERPLAYER|hudinfo[HUD_POWERUPS].f)|((i == max) ? V_HUDTRANS : V_HUDTRANSHALF), forceshield);
}
}
else
{
switch (stplyr->powers[pw_shield] & SH_NOSTACK)
{
case SH_WHIRLWIND: p = jumpshield; break;
case SH_ELEMENTAL: p = watershield; break;
case SH_ARMAGEDDON: p = bombshield; break;
case SH_ATTRACT: p = ringshield; break;
case SH_PITY: p = pityshield; break;
case SH_FLAMEAURA: p = flameshield; break;
case SH_BUBBLEWRAP: p = bubbleshield; break;
case SH_THUNDERCOIN: p = thundershield; break;
default: break;
}
if (p)
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, p);
}
}
else switch (player->powers[pw_shield] & SH_NOSTACK)
else if (shieldoffs)
{
case SH_WHIRLWIND: p = jumpshield; break;
case SH_ELEMENTAL: p = watershield; break;
case SH_ARMAGEDDON: p = bombshield; break;
case SH_ATTRACT: p = ringshield; break;
case SH_PITY: p = pityshield; break;
case SH_FLAMEAURA: p = flameshield; break;
case SH_BUBBLEWRAP: p = bubbleshield; break;
case SH_THUNDERCOIN: p = thundershield; break;
default: break;
}
if (p)
V_DrawScaledPatch(304, 24, V_PERPLAYER|V_SNAPTORIGHT|V_SNAPTOTOP|V_HUDTRANS, p);
// pw_flashing just sets the icon to flash no matter what.
invulntime = player->powers[pw_flashing] ? 1 : player->powers[pw_invulnerability];
if (invulntime > 3*TICRATE || (invulntime && leveltime & 1))
V_DrawScaledPatch(304, 24 + 28, V_PERPLAYER|V_SNAPTORIGHT|V_SNAPTOTOP|V_HUDTRANS, invincibility);
if (player->powers[pw_sneakers] > 3*TICRATE || (player->powers[pw_sneakers] && leveltime & 1))
{
V_DrawScaledPatch(304, 24 + 56, V_PERPLAYER|V_SNAPTORIGHT|V_SNAPTOTOP|V_HUDTRANS, sneakers);
}
p = NULL;
{
UINT32 airtime;
UINT32 frame = 0;
spriteframe_t *sprframe;
// If both air timers are active, use the air timer with the least time left
if (player->powers[pw_underwater] && player->powers[pw_spacetime])
airtime = min(player->powers[pw_underwater], player->powers[pw_spacetime]);
else // Use whichever one is active otherwise
airtime = (player->powers[pw_spacetime]) ? player->powers[pw_spacetime] : player->powers[pw_underwater];
if (!airtime)
return; // No air timers are active, nothing would be drawn anyway
airtime--; // The original code was all n*TICRATE + 1, so let's remove 1 tic for simplicity
if (airtime > 11*TICRATE)
return; // Not time to draw any drown numbers yet
// Choose which frame to use based on time left
if (airtime <= 11*TICRATE && airtime >= 10*TICRATE)
frame = 5;
else if (airtime <= 9*TICRATE && airtime >= 8*TICRATE)
frame = 4;
else if (airtime <= 7*TICRATE && airtime >= 6*TICRATE)
frame = 3;
else if (airtime <= 5*TICRATE && airtime >= 4*TICRATE)
frame = 2;
else if (airtime <= 3*TICRATE && airtime >= 2*TICRATE)
frame = 1;
else if (airtime <= 1*TICRATE && airtime > 0)
frame = 0;
if (shieldoffs > 1)
shieldoffs = 2*shieldoffs/3;
else
return; // Don't draw anything between numbers
if (player->charflags & SF_MACHINE)
frame += 6; // Robots use different drown numbers
// Get the front angle patch for the frame
sprframe = &sprites[SPR_DRWN].spriteframes[frame];
p = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
shieldoffs = 0;
}
offs -= shieldoffs;
// YOU have a flag. Display a monitor-like icon for it.
if (stplyr->gotflag)
{
flagoffs = ICONSEP;
p = (stplyr->gotflag & GF_REDFLAG) ? gotrflag : gotbflag;
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, p);
}
else if (flagoffs)
{
if (flagoffs > 1)
flagoffs = 2*flagoffs/3;
else
flagoffs = 0;
}
offs -= flagoffs;
invulntime = stplyr->powers[pw_flashing] ? stplyr->powers[pw_flashing] : stplyr->powers[pw_invulnerability];
if (stplyr->powers[pw_invulnerability] > 3*TICRATE || (invulntime && leveltime & 1))
{
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, invincibility);
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", invulntime/TICRATE));
}
if (invulntime > 7)
offs -= ICONSEP;
else
{
UINT8 a = ICONSEP, b = 7-invulntime;
while (b--)
a = 2*a/3;
offs -= a;
}
if (stplyr->powers[pw_sneakers] > 3*TICRATE || (stplyr->powers[pw_sneakers] && leveltime & 1))
{
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, sneakers);
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", stplyr->powers[pw_sneakers]/TICRATE));
}
if (stplyr->powers[pw_sneakers] > 7)
offs -= ICONSEP;
else
{
UINT8 a = ICONSEP, b = 7-stplyr->powers[pw_sneakers];
while (b--)
a = 2*a/3;
offs -= a;
}
if (stplyr->powers[pw_gravityboots] > 3*TICRATE || (stplyr->powers[pw_gravityboots] && leveltime & 1))
{
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, gravboots);
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", stplyr->powers[pw_gravityboots]/TICRATE));
}
#undef ICONSEP
}
static void ST_drawFirstPersonHUD(void)
{
patch_t *p = NULL;
UINT32 airtime;
UINT32 frame = 0;
spriteframe_t *sprframe;
// If both air timers are active, use the air timer with the least time left
if (stplyr->powers[pw_underwater] && stplyr->powers[pw_spacetime])
airtime = min(stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime]);
else // Use whichever one is active otherwise
airtime = (stplyr->powers[pw_spacetime]) ? stplyr->powers[pw_spacetime] : stplyr->powers[pw_underwater];
if (!airtime)
return; // No air timers are active, nothing would be drawn anyway
airtime--; // The original code was all n*TICRATE + 1, so let's remove 1 tic for simplicity
if (airtime > 11*TICRATE)
return; // Not time to draw any drown numbers yet
// Choose which frame to use based on time left
if (airtime <= 11*TICRATE && airtime >= 10*TICRATE)
frame = 5;
else if (airtime <= 9*TICRATE && airtime >= 8*TICRATE)
frame = 4;
else if (airtime <= 7*TICRATE && airtime >= 6*TICRATE)
frame = 3;
else if (airtime <= 5*TICRATE && airtime >= 4*TICRATE)
frame = 2;
else if (airtime <= 3*TICRATE && airtime >= 2*TICRATE)
frame = 1;
else if (airtime <= 1*TICRATE && airtime > 0)
frame = 0;
else
return; // Don't draw anything between numbers
if (stplyr->charflags & SF_MACHINE)
frame += 6; // Robots use different drown numbers
// Get the front angle patch for the frame
sprframe = &sprites[SPR_DRWN].spriteframes[frame];
p = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
// Display the countdown drown numbers!
if (p)
V_DrawScaledPatch((BASEVIDWIDTH/2) - (SHORT(p->width)/2) + SHORT(p->leftoffset), 60 - SHORT(p->topoffset),
@ -1674,7 +1743,7 @@ static void ST_drawWeaponRing(powertype_t weapon, INT32 rwflag, INT32 wepflag, I
if (weapon == pw_infinityring
|| (stplyr->ringweapons & rwflag))
txtflags |= V_20TRANS;
; //txtflags |= V_20TRANS;
else
{
txtflags |= V_TRANSLUCENT;
@ -1683,10 +1752,10 @@ static void ST_drawWeaponRing(powertype_t weapon, INT32 rwflag, INT32 wepflag, I
V_DrawScaledPatch(8 + xoffs, y, V_PERPLAYER|V_SNAPTOBOTTOM|patflags, pat);
if (stplyr->powers[weapon] > 99)
V_DrawThinString(8 + xoffs + 1, y, V_PERPLAYER|V_SNAPTOBOTTOM|txtflags, va("%d", stplyr->powers[weapon]));
else
V_DrawString(8 + xoffs, y, V_PERPLAYER|V_SNAPTOBOTTOM|txtflags, va("%d", stplyr->powers[weapon]));
//if (stplyr->powers[weapon] > 9)
V_DrawRightAlignedThinString(24 + xoffs, y + 8, V_PERPLAYER|V_SNAPTOBOTTOM|txtflags, va("%d", stplyr->powers[weapon]));
/*else
V_DrawRightAlignedString(24 + xoffs, y + 8, V_PERPLAYER|V_SNAPTOBOTTOM|txtflags, va("%d", stplyr->powers[weapon]));*/
if (stplyr->currentweapon == wepflag)
V_DrawScaledPatch(6 + xoffs, y-2, V_PERPLAYER|V_SNAPTOBOTTOM, curweapon);
@ -1756,57 +1825,67 @@ static void ST_drawTagHUD(void)
{
sprintf(pstext, "%s", M_GetText("You cannot move while hiding."));
if (!splitscreen)
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
V_DrawThinString(16, 176 - 24, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""F12:""\x80 Switch view"));
}
// Print the stuff.
if (pstext[0])
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER, pstext);
V_DrawThinString(16, 176 - 16, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, pstext);
}
static void ST_drawCTFHUD(void)
static void ST_drawTeamHUD(void)
{
INT32 i, y = 176;
UINT16 whichflag = 0;
patch_t *p;
#define SEP 20
// Draw the flags
V_DrawSmallScaledPatch(256, y, V_HUDTRANS|V_PERPLAYER|V_SNAPTOBOTTOM|V_SNAPTORIGHT, rflagico);
V_DrawSmallScaledPatch(280, y, V_HUDTRANS|V_PERPLAYER|V_SNAPTOBOTTOM|V_SNAPTORIGHT, bflagico);
if (gametype == GT_CTF)
p = bflagico;
else
p = bmatcico;
for (i = 0; i < MAXPLAYERS; i++)
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
if (gametype == GT_CTF)
p = rflagico;
else
p = rmatcico;
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
if (gametype != GT_CTF)
goto num;
{
if (players[i].gotflag & GF_REDFLAG) // Red flag isn't at base
V_DrawScaledPatch(256, y-4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOBOTTOM|V_SNAPTORIGHT, nonicon);
else if (players[i].gotflag & GF_BLUEFLAG) // Blue flag isn't at base
V_DrawScaledPatch(280, y-4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOBOTTOM|V_SNAPTORIGHT, nonicon);
INT32 i;
UINT16 whichflag = 0;
whichflag |= players[i].gotflag;
if ((whichflag & (GF_REDFLAG|GF_BLUEFLAG)) == (GF_REDFLAG|GF_BLUEFLAG))
break; // both flags were found, let's stop early
}
// YOU have a flag. Display a monitor-like icon for it.
if (stplyr->gotflag)
{
patch_t *p = (stplyr->gotflag & GF_REDFLAG) ? gotrflag : gotbflag;
V_DrawScaledPatch(304, 24 + 84, V_PERPLAYER|V_SNAPTORIGHT|V_SNAPTOTOP|V_HUDTRANS, p);
}
// Display a countdown timer showing how much time left until the flag your team dropped returns to base.
{
char timeleft[33];
if (redflag && redflag->fuse > 1)
// Show which flags aren't at base.
for (i = 0; i < MAXPLAYERS; i++)
{
sprintf(timeleft, "%u", (redflag->fuse / TICRATE));
V_DrawCenteredString(268, y+8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOBOTTOM|V_SNAPTORIGHT, timeleft);
if (players[i].gotflag & GF_BLUEFLAG) // Blue flag isn't at base
V_DrawScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(nonicon->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon);
if (players[i].gotflag & GF_REDFLAG) // Red flag isn't at base
V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(nonicon2->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2);
whichflag |= players[i].gotflag;
if ((whichflag & (GF_REDFLAG|GF_BLUEFLAG)) == (GF_REDFLAG|GF_BLUEFLAG))
break; // both flags were found, let's stop early
}
if (blueflag && blueflag->fuse > 1)
// Display a countdown timer showing how much time left until the flag returns to base.
{
sprintf(timeleft, "%u", (blueflag->fuse / TICRATE));
V_DrawCenteredString(300, y+8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOBOTTOM|V_SNAPTORIGHT, timeleft);
if (blueflag && blueflag->fuse > 1)
V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (blueflag->fuse / TICRATE)));
if (redflag && redflag->fuse > 1)
V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (redflag->fuse / TICRATE)));
}
}
num:
V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", bluescore));
V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", redscore));
#undef SEP
}
static void ST_drawSpecialStageHUD(void)
@ -1815,7 +1894,7 @@ static void ST_drawSpecialStageHUD(void)
{
if (hudinfo[HUD_SS_TOTALRINGS].x)
ST_DrawNumFromHud(HUD_SS_TOTALRINGS, totalrings, V_HUDTRANS);
else if (cv_timetic.value == 3)
else if (cv_timetic.value == 2)
V_DrawTallNum(hudinfo[HUD_RINGSNUMTICS].x, hudinfo[HUD_SS_TOTALRINGS].y, hudinfo[HUD_RINGSNUMTICS].f|V_PERPLAYER|V_HUDTRANS, totalrings);
else
V_DrawTallNum(hudinfo[HUD_RINGSNUM].x, hudinfo[HUD_SS_TOTALRINGS].y, hudinfo[HUD_RINGSNUM].f|V_PERPLAYER|V_HUDTRANS, totalrings);
@ -2035,6 +2114,8 @@ static void ST_overlayDrawer(void)
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, BASEVIDHEIGHT/2 - (SHORT(p->height)/2), V_PERPLAYER|(stplyr->spectator ? V_HUDTRANSHALF : V_HUDTRANS), p);
}
if (G_GametypeHasTeams())
ST_drawTeamHUD();
if (!hu_showscores) // hide the following if TAB is held
{
@ -2079,9 +2160,6 @@ static void ST_overlayDrawer(void)
// Tag HUD Stuff
else if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (!stplyr->spectator))
ST_drawTagHUD();
// CTF HUD Stuff
else if (gametype == GT_CTF)
ST_drawCTFHUD();
// Special Stage HUD
if (!useNightsSS && G_IsSpecialStage(gamemap) && stplyr == &players[displayplayer])
@ -2093,9 +2171,6 @@ static void ST_overlayDrawer(void)
else
ST_doHuntIconsAndSound();
if (stplyr->powers[pw_gravityboots] > 3*TICRATE || (stplyr->powers[pw_gravityboots] && leveltime & 1))
V_DrawScaledPatch(hudinfo[HUD_GRAVBOOTSICO].x, hudinfo[HUD_GRAVBOOTSICO].y, hudinfo[HUD_GRAVBOOTSICO].f|V_PERPLAYER, gravboots);
if(!P_IsLocalPlayer(stplyr))
{
char name[MAXPLAYERNAME+1];
@ -2109,10 +2184,14 @@ static void ST_overlayDrawer(void)
// This is where we draw all the fun cheese if you have the chasecam off!
if ((stplyr == &players[displayplayer] && !camera.chase)
|| ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase))
|| ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase))
{
ST_drawFirstPersonHUD();
if (cv_powerupdisplay.value)
ST_drawPowerupHUD();
}
else if (cv_powerupdisplay.value == 2)
ST_drawPowerupHUD();
}
#ifdef HAVE_BLUA
@ -2149,27 +2228,30 @@ static void ST_overlayDrawer(void)
if (cv_playersforexit.value != 4)
{
total *= cv_playersforexit.value;
if (total % 4) total += 4; // round up
if (total & 3)
total += 4; // round up
total /= 4;
}
if (exiting < total)
{
total -= exiting;
V_DrawCenteredString(BASEVIDWIDTH/2, 124, V_PERPLAYER, va(M_GetText("%d more player%s required to exit."), total, ((total == 1) ? "" : "s")));
V_DrawThinString(16, 176 - 16, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, va(M_GetText("%d player%s remaining"), total, ((total == 1) ? "" : "s")));
if (!splitscreen)
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
{
V_DrawThinString(16, 176 - 24, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""F12:""\x80 Switch view"));
}
}
}
else if (!splitscreen && gametype != GT_COOP && (stplyr->exiting || (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)))
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
V_DrawThinString(16, 176 - 16, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""F12:""\x80 Switch view"));
else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
{
INT32 respawntime = cv_respawntime.value - stplyr->deadtimer/TICRATE;
if (respawntime > 0 && !stplyr->spectator)
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER|V_HUDTRANSHALF, va(M_GetText("Respawn in %d..."), respawntime));
V_DrawThinString(16, 176 - 16, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, va(M_GetText("Respawn in %d..."), respawntime));
else
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("Press Jump to respawn."));
V_DrawThinString(16, 176 - 16, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""JUMP:""\x80 Respawn"));
}
else if (stplyr->spectator && (gametype != GT_COOP || stplyr->playerstate == PST_LIVE)
#ifdef HAVE_BLUA
@ -2177,14 +2259,13 @@ static void ST_overlayDrawer(void)
#endif
)
{
V_DrawCenteredString(BASEVIDWIDTH/2, 60, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("You are a spectator."));
if (G_GametypeHasTeams())
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("Press Fire to be assigned to a team."));
else if (G_IsSpecialStage(gamemap) && useNightsSS)
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("You cannot play until the stage has ended."));
else if (gametype == GT_COOP && stplyr->lives <= 0)
INT32 y = 176 - 16; // HUD_LIVES
if (G_IsSpecialStage(gamemap) && useNightsSS)
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_YELLOWMAP, M_GetText("Wait for the stage to end..."));
else if (gametype == GT_COOP)
{
if (cv_cooplives.value == 2
if (stplyr->lives <= 0
&& cv_cooplives.value == 2
&& (netgame || multiplayer))
{
INT32 i;
@ -2201,14 +2282,26 @@ static void ST_overlayDrawer(void)
}
if (i != MAXPLAYERS)
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("You'll steal a life on respawn."));
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("You'll steal a life on respawn..."));
else
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("Wait to respawn..."));
}
else
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("Wait to respawn..."));
}
else if (gametype != GT_COOP)
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("Press Fire to enter the game."));
else
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""FIRE:""\x80 Enter game"));
y -= 8;
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""SPIN:""\x80 Sink"));
y -= 8;
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""JUMP:""\x80 Float"));
y -= 8;
if (!splitscreen)
V_DrawCenteredString(BASEVIDWIDTH/2, 132, V_HUDTRANSHALF, M_GetText("Press F12 to watch another player."));
V_DrawCenteredString(BASEVIDWIDTH/2, 148, V_PERPLAYER|V_HUDTRANSHALF, M_GetText("Press Jump to float and Spin to sink."));
{
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("\x82""F12:""\x80 Switch view"));
y -= 8;
}
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_GRAYMAP, M_GetText("Spectator mode:"));
}
}
@ -2252,6 +2345,24 @@ void ST_Drawer(void)
#endif
if (rendermode != render_none) ST_doPaletteStuff();
// Blindfold!
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK)
&& (leveltime < hidetime * TICRATE))
{
if (players[displayplayer].pflags & PF_TAGIT)
{
stplyr = &players[displayplayer];
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31|V_PERPLAYER);
V_DrawThinString(16, 176 - 24, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_YELLOWMAP, M_GetText("You are blindfolded!"));
}
else if (splitscreen && players[secondarydisplayplayer].pflags & PF_TAGIT)
{
stplyr = &players[secondarydisplayplayer];
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31|V_PERPLAYER);
V_DrawThinString(16, 176 - 24, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_YELLOWMAP, M_GetText("You are blindfolded!"));
}
}
if (st_overlay)
{
// No deadview!

View file

@ -101,7 +101,7 @@ typedef enum
HUD_TIMELEFTNUM,
HUD_TIMEUP,
HUD_HUNTPICS,
HUD_GRAVBOOTSICO,
HUD_POWERUPS,
NUMHUDITEMS
} hudnum_t;