mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 19:01:50 +00:00
debugrank command: let force rank grade, also make cv_debugrank a PlayerCheat instead of ServerCheat
This commit is contained in:
parent
a512c93a2c
commit
f238655e6a
2 changed files with 23 additions and 1 deletions
|
|
@ -811,7 +811,6 @@ consvar_t cv_timescale = OnlineCheat(cvlist_timer)("timescale", "1.0").floating_
|
||||||
//
|
//
|
||||||
|
|
||||||
consvar_t cv_botscanvote = ServerCheat("botscanvote", "No").yes_no();
|
consvar_t cv_botscanvote = ServerCheat("botscanvote", "No").yes_no();
|
||||||
consvar_t cv_debugrank = ServerCheat("debugrank", "Off").on_off().description("Show GP rank state on the HUD");
|
|
||||||
|
|
||||||
void Gravity_OnChange(void);
|
void Gravity_OnChange(void);
|
||||||
consvar_t cv_gravity = ServerCheat("gravity", "0.8").floating_point().onchange(Gravity_OnChange).description("Change the default gravity"); // change DEFAULT_GRAVITY if you change this
|
consvar_t cv_gravity = ServerCheat("gravity", "0.8").floating_point().onchange(Gravity_OnChange).description("Change the default gravity"); // change DEFAULT_GRAVITY if you change this
|
||||||
|
|
@ -830,6 +829,19 @@ consvar_t cv_kartdebugnodes = ServerCheat("debugnodes", "Off").on_off().descript
|
||||||
consvar_t cv_1pswap = PlayerCheat("1pswap", "1").min_max(1, MAXSPLITSCREENPLAYERS).description("Let P1's Profile control a different splitscreen player");
|
consvar_t cv_1pswap = PlayerCheat("1pswap", "1").min_max(1, MAXSPLITSCREENPLAYERS).description("Let P1's Profile control a different splitscreen player");
|
||||||
|
|
||||||
consvar_t cv_debugfinishline = PlayerCheat("debugfinishline", "Off").on_off().description("Highlight finish lines and respawn lines with high contrast colors");
|
consvar_t cv_debugfinishline = PlayerCheat("debugfinishline", "Off").on_off().description("Highlight finish lines and respawn lines with high contrast colors");
|
||||||
|
|
||||||
|
consvar_t cv_debugrank = PlayerCheat("debugrank", "Off").description("Show GP rank state on the HUD; optionally force a rank grade").values({
|
||||||
|
{0, "Off"},
|
||||||
|
{1, "On"},
|
||||||
|
// This matches the order of gp_rank_e
|
||||||
|
{2, "E"},
|
||||||
|
{3, "D"},
|
||||||
|
{4, "C"},
|
||||||
|
{5, "B"},
|
||||||
|
{6, "A"},
|
||||||
|
{7, "S"},
|
||||||
|
});
|
||||||
|
|
||||||
consvar_t cv_debugrender_contrast = PlayerCheat("debugrender_contrast", "0.0").floating_point().min_max(-FRACUNIT, FRACUNIT).description("Change level lighting");
|
consvar_t cv_debugrender_contrast = PlayerCheat("debugrender_contrast", "0.0").floating_point().min_max(-FRACUNIT, FRACUNIT).description("Change level lighting");
|
||||||
consvar_t cv_debugrender_portal = PlayerCheat("debugrender_portal", "Off").on_off().description("Highlight visual portals in red");
|
consvar_t cv_debugrender_portal = PlayerCheat("debugrender_portal", "Off").on_off().description("Highlight visual portals in red");
|
||||||
consvar_t cv_debugrender_spriteclip = PlayerCheat("debugrender_spriteclip", "Off").on_off().description("Let sprites draw through walls");
|
consvar_t cv_debugrender_spriteclip = PlayerCheat("debugrender_spriteclip", "Off").on_off().description("Let sprites draw through walls");
|
||||||
|
|
|
||||||
10
src/k_rank.c
10
src/k_rank.c
|
|
@ -25,6 +25,7 @@
|
||||||
#include "fastcmp.h"
|
#include "fastcmp.h"
|
||||||
#include "byteptr.h"
|
#include "byteptr.h"
|
||||||
#include "k_race.h"
|
#include "k_race.h"
|
||||||
|
#include "command.h"
|
||||||
|
|
||||||
// I was ALMOST tempted to start tearing apart all
|
// I was ALMOST tempted to start tearing apart all
|
||||||
// of the map loading code and turning it into C++
|
// of the map loading code and turning it into C++
|
||||||
|
|
@ -383,6 +384,15 @@ void K_UpdateGPRank(void)
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
gp_rank_e K_CalculateGPGrade(gpRank_t *rankData)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
extern consvar_t cv_debugrank;
|
||||||
|
|
||||||
|
if (cv_debugrank.value >= 2)
|
||||||
|
{
|
||||||
|
return GRADE_E + (cv_debugrank.value - 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const fixed_t gradePercents[GRADE_A] = {
|
static const fixed_t gradePercents[GRADE_A] = {
|
||||||
7*FRACUNIT/20, // D: 35% or higher
|
7*FRACUNIT/20, // D: 35% or higher
|
||||||
10*FRACUNIT/20, // C: 50% or higher
|
10*FRACUNIT/20, // C: 50% or higher
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue