setamps cheat command

This commit is contained in:
Antonio Martinez 2025-06-29 21:37:58 -04:00
parent e21745fccc
commit 0a7abc7a9e
3 changed files with 21 additions and 0 deletions

View file

@ -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() );

View file

@ -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;

View file

@ -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);