add SKILL cheat to show (or change) game skill level (#1016)

* add SKILL cheat to show (or change) game skill level

* rephrase message, fix fast and respawn when changing from/to Nightmare
This commit is contained in:
Fabian Greffrath 2023-04-26 22:51:23 +02:00 committed by GitHub
parent c3d3ff355d
commit 90c3df526c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 2 deletions

View File

@ -59,6 +59,8 @@ static void cheat_clev0();
static void cheat_mypos();
static void cheat_comp(char *buf);
static void cheat_comp0();
static void cheat_skill(char *buf);
static void cheat_skill0();
static void cheat_friction();
static void cheat_pushers();
static void cheat_tran();
@ -185,6 +187,12 @@ struct cheat_s cheat[] = {
{"comp", NULL, not_net | not_demo | not_menu,
{cheat_comp0} },
{"skill", NULL, not_net | not_demo | not_menu,
{cheat_skill}, -1 },
{"skill", NULL, not_net | not_demo | not_menu,
{cheat_skill0} },
{"killem", NULL, not_net | not_demo,
{cheat_massacre} }, // jff 2/01/98 kill all monsters
@ -690,6 +698,26 @@ static void cheat_friction()
"Variable Friction disabled");
}
extern const char *default_skill_strings[];
static void cheat_skill0()
{
doomprintf(MESSAGES_NONE, "Skill: %s", default_skill_strings[gameskill + 1]);
}
static void cheat_skill(char *buf)
{
int skill = buf[0] - '0';
if (skill >= 1 && skill <= 5)
{
gameskill = skill - 1;
doomprintf(MESSAGES_NONE, "Next Level Skill: %s", default_skill_strings[gameskill + 1]);
G_SetFastParms(fastparm || gameskill == sk_nightmare);
respawnmonsters = gameskill == sk_nightmare || respawnparm;
}
}
// Pusher cheat
// phares 3/10/98

View File

@ -4125,7 +4125,7 @@ static void M_UpdateMouseLook(void)
}
}
static const char *default_skill_strings[] = {
const char *default_skill_strings[] = {
// dummy first option because defaultskill is 1-based
"", "ITYTD", "HNTR", "HMP", "UV", "NM", NULL
};

View File

@ -545,7 +545,7 @@ default_t defaults[] = {
"default_skill",
(config_t *) &defaultskill, NULL,
{4}, {1,5}, number, ss_gen, wad_no,
"selects default skill (1 = TYTD, 2 = NTR, 3 = HMP, 4 = UV, 5 = NM)"
"selects default skill (1 = ITYTD, 2 = HNTR, 3 = HMP, 4 = UV, 5 = NM)"
},
{ // killough 3/6/98: preserve autorun across games