From 6f964e8d35ba4463ea2764e24906d2d8e785b5d5 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Sat, 13 May 2023 19:44:50 -0700 Subject: [PATCH] add changeskill command --- docs/console.html | 6 ++++++ src/console/c_cmds.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/docs/console.html b/docs/console.html index d5ca0a735b..7fb5d4c8c5 100644 --- a/docs/console.html +++ b/docs/console.html @@ -2361,6 +2361,11 @@ alias -creep "joy_speedmultiplier 1.0" of a music lump or file on disk (which need not have been specified with the -file parameter). +
changeskill skill
+
Changes the current skill of the game. The skill change will take + effect at the next map change. The skill must be a number. The default skill + levels range from 0 to 4 inclusive. +
chase
Turns the chasecom on and off. This command also works while watching demos, so you can bind it to a key and watch demos in the third @@ -3177,6 +3182,7 @@ alias -creep "joy_speedmultiplier 1.0" centerview
changemap
changemus
+ changeskill
chase
chase_dist
chase_height
diff --git a/src/console/c_cmds.cpp b/src/console/c_cmds.cpp index c5752c9b94..f48dcfa82f 100644 --- a/src/console/c_cmds.cpp +++ b/src/console/c_cmds.cpp @@ -408,6 +408,39 @@ CCMD (changemap) } } +CCMD (changeskill) +{ + if (!players[consoleplayer].mo || !usergame) + { + Printf ("Use the skill command when not in a game.\n"); + return; + } + + if (!players[consoleplayer].settings_controller && netgame) + { + Printf ("Only setting controllers can change the skill.\n"); + return; + } + + if (argv.argc() == 2) + { + int skill = atoi(argv[1]); + if (skill < 0 || skill >= AllSkills.Size()) + { + Printf ("Skill %d is out of range.\n", skill); + } + else + { + NextSkill = skill; + Printf ("Skill %d will take effect on the next map.\n", skill); + } + } + else + { + Printf ("Usage: changeskill \n"); + } +} + CCMD (give) { if (CheckCheatmode () || argv.argc() < 2)