IDMYPOS cheat back to infinite duration, some clean-ups for the RATE cheat

This commit is contained in:
Fabian Greffrath 2022-01-28 15:26:17 +01:00
parent a9bcaffd7b
commit 2ad22c6601
6 changed files with 17 additions and 24 deletions

View File

@ -113,7 +113,7 @@ typedef struct player_s
int armortype;
// Power ups. invinc and invis are tic counters.
int powers[NUMPOWERS+2];
int powers[NUMPOWERS+3];
boolean cards[NUMCARDS];
boolean backpack;

View File

@ -213,7 +213,8 @@ typedef enum {
pw_allmap,
pw_infrared,
NUMPOWERS,
pw_mapcoords
pw_mapcoords,
pw_renderstats,
} powertype_t;
// Power up durations (how many seconds till expiration).

View File

@ -30,7 +30,6 @@
#include "p_tick.h"
#include "g_game.h"
#include "r_data.h"
#include "r_main.h"
#include "p_inter.h"
#include "m_cheat.h"
#include "m_argv.h"
@ -536,7 +535,8 @@ char buf[3];
// killough 2/7/98: simplified using dprintf and made output more user-friendly
static void cheat_mypos()
{
plyr->powers[pw_mapcoords] = 10 * TICRATE;
if (!(plyr->powers[pw_mapcoords] ^= 1))
dprintf("%s", "");
}
void cheat_mypos_print()
@ -751,7 +751,8 @@ static void cheat_nuke()
static void cheat_rate()
{
rendering_stats ^= 1;
if (!(plyr->powers[pw_renderstats] ^= 1))
dprintf("%s", "");
}
//-----------------------------------------------------------------------------

View File

@ -452,13 +452,16 @@ void P_PlayerThink (player_t* player)
if (player->powers[pw_ironfeet] > 0) // killough
player->powers[pw_ironfeet]--;
if (player->powers[pw_mapcoords] > 0)
if (player->powers[pw_renderstats])
{
extern void R_ShowRenderingStats();
R_ShowRenderingStats();
}
if (player->powers[pw_mapcoords])
{
extern void cheat_mypos_print();
cheat_mypos_print();
player->powers[pw_mapcoords]--;
if (player->powers[pw_mapcoords] == 0)
player->message = "";
}
if (player->damagecount)

View File

@ -606,20 +606,11 @@ void R_SetupFrame (player_t *player)
//
int rendered_visplanes, rendered_segs, rendered_vissprites;
boolean rendering_stats;
static void R_ShowStats(void)
void R_ShowRenderingStats(void)
{
static int saved_tick;
if (leveltime >= saved_tick + TICRATE)
{
if (rendering_stats)
{
dprintf("Segs %d, Visplanes %d, Sprites %d", rendered_segs,
rendered_visplanes, rendered_vissprites);
}
saved_tick = leveltime;
}
dprintf("Segs %d, Visplanes %d, Sprites %d",
rendered_segs, rendered_visplanes, rendered_vissprites);
}
static void R_ClearStats(void)
@ -741,8 +732,6 @@ void R_RenderPlayerView (player_t* player)
// Check for new console commands.
NetUpdate ();
R_ShowStats();
}
//----------------------------------------------------------------------------

View File

@ -54,7 +54,6 @@ extern int loopcount;
//
extern int rendered_visplanes, rendered_segs, rendered_vissprites;
extern boolean rendering_stats;
//
// Lighting LUT.