From 0a7abc7a9ef56119ed0279161ed4c1638fc29e47 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Sun, 29 Jun 2025 21:37:58 -0400 Subject: [PATCH] setamps cheat command --- src/d_netcmd.c | 11 +++++++++++ src/m_cheat.c | 8 ++++++++ src/m_cheat.h | 2 ++ 3 files changed, 21 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5d3ad62d7..d259c8f13 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -557,6 +557,7 @@ void D_RegisterClientCommands(void) COM_AddDebugCommand("freeze", Command_CheatFreeze_f); COM_AddDebugCommand("setrings", Command_Setrings_f); COM_AddDebugCommand("setspheres", Command_Setspheres_f); + COM_AddDebugCommand("setamps", Command_Setamps_f); COM_AddDebugCommand("setlives", Command_Setlives_f); COM_AddDebugCommand("setroundscore", Command_Setroundscore_f); COM_AddDebugCommand("devmode", Command_Devmode_f); @@ -1634,6 +1635,7 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...) break; case CHEAT_SPHERES: + case CHEAT_AMPS: COPY(WRITEINT16, int); break; } @@ -6143,6 +6145,15 @@ static void Got_Cheat(const UINT8 **cp, INT32 playernum) break; } + case CHEAT_AMPS: { + INT16 amps = READINT16(*cp); + + player->amps = amps; + + CV_CheaterWarning(targetPlayer, va("amps = %d", amps)); + break; + } + case CHEAT_FREEZE: { const char *status = P_FreezeCheat() ? "off" : "on"; P_SetFreezeCheat( !P_FreezeCheat() ); diff --git a/src/m_cheat.c b/src/m_cheat.c index 3c48ec521..e78e56cb9 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -433,6 +433,14 @@ void Command_Setspheres_f(void) D_Cheat(consoleplayer, CHEAT_SPHERES, atoi(COM_Argv(1))); } +void Command_Setamps_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_AMPS, atoi(COM_Argv(1))); +} + void Command_Setlives_f(void) { REQUIRE_CHEATS; diff --git a/src/m_cheat.h b/src/m_cheat.h index 1ee2707fe..2983389cb 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -43,6 +43,7 @@ typedef enum { CHEAT_GIVEPOWERUP, CHEAT_SPHERES, CHEAT_FREEZE, + CHEAT_AMPS, NUMBER_OF_CHEATS } cheat_t; @@ -74,6 +75,7 @@ void Command_CheatFreeze_f(void); void Command_Savecheckpoint_f(void); void Command_Setrings_f(void); void Command_Setspheres_f(void); +void Command_Setamps_f(void); void Command_Setlives_f(void); void Command_Setroundscore_f(void); void Command_Devmode_f(void);