diff --git a/src/cvars.cpp b/src/cvars.cpp index f13457d4d..fd93e79f8 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -856,6 +856,10 @@ 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"); +#ifdef DEVELOP + consvar_t cv_debugchallenges = PlayerCheat("debugchallenges", "Off").on_off().description("Chao keys are infinite, unlock any tile, relock tiles, animations play quickly"); +#endif + consvar_t cv_debugfinishline = PlayerCheat("debugfinishline", "Off").on_off().description("Highlight finish lines, respawn lines, death pits and instakill planes with high contrast colors"); consvar_t cv_debughudtracker = PlayerCheat("debughudtracker", "Off").on_off().description("Highlight overlapping HUD tracker blocks"); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index d1d2e8492..da532c564 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -6036,6 +6036,12 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili categoryside = (challengesmenu.extradata[id].flip <= TILEFLIP_MAX/4 || challengesmenu.extradata[id].flip > (3*TILEFLIP_MAX)/4); +#ifdef DEVELOP + extern consvar_t cv_debugchallenges; + if (cv_debugchallenges.value) + categoryside = false; +#endif + if (categoryside) { char categoryid = '0'; diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 53b72c2ce..8e6395437 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -10,7 +10,9 @@ #include "../r_skins.h" #include "../s_sound.h" -//#define CHAOKEYDEBUG +#ifdef DEVELOP +extern consvar_t cv_debugchallenges; +#endif menuitem_t MISC_ChallengesStatsDummyMenu[] = { @@ -382,10 +384,6 @@ void M_Challenges(INT32 choice) boolean M_CanKeyHiliTile(void) { - // No keys to do it with? - if (gamedata->chaokeys == 0) - return false; - // No tile data? if (challengesmenu.extradata == NULL) return false; @@ -398,6 +396,16 @@ boolean M_CanKeyHiliTile(void) if (gamedata->unlocked[challengesmenu.currentunlock] == true) return false; +#ifdef DEVELOP + // Ignore game design? + if (cv_debugchallenges.value) + return true; +#endif + + // No keys to do it with? + if (gamedata->chaokeys == 0) + return false; + UINT16 i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy; // Not a hinted tile. @@ -517,19 +525,26 @@ void M_ChallengesTick(void) { challengesmenu.chaokeyhold++; - const UINT32 chaohold_duration = + UINT32 chaohold_duration = CHAOHOLD_PADDING + ((unlockables[challengesmenu.currentunlock].majorunlock == true) ? CHAOHOLD_MAJOR : CHAOHOLD_STANDARD ); +#ifdef DEVELOP + if (cv_debugchallenges.value) + chaohold_duration = 0; +#endif + if (challengesmenu.chaokeyhold > chaohold_duration) { -#ifndef CHAOKEYDEBUG - gamedata->chaokeys -= (unlockables[challengesmenu.currentunlock].majorunlock == true) - ? 10 : 1; +#ifdef DEVELOP + if (!cv_debugchallenges.value) #endif + gamedata->chaokeys -= (unlockables[challengesmenu.currentunlock].majorunlock == true) + ? 10 : 1; + challengesmenu.chaokeyhold = 0; challengesmenu.unlockcount[CMC_CHAOANIM]++; @@ -640,6 +655,11 @@ void M_ChallengesTick(void) { tic_t nexttime = M_MenuExtraHeld(pid) ? (UNLOCKTIME*2) : MAXUNLOCKTIME; +#ifdef DEVELOP + if (cv_debugchallenges.value) + nexttime = UNLOCKTIME; +#endif + if (++challengesmenu.unlockanim >= nexttime) { challengesmenu.requestnew = true; @@ -768,8 +788,8 @@ boolean M_ChallengesInputs(INT32 ch) challengesmenu.unlockcount[CMC_CHAONOPE] = 6; S_StartSound(NULL, sfx_s3k7b); //sfx_s3kb2 -#ifdef CHAOKEYDEBUG - if (challengesmenu.currentunlock < MAXUNLOCKABLES && challengesmenu.unlockanim >= UNLOCKTIME && gamedata->unlocked[challengesmenu.currentunlock] == true) +#ifdef DEVELOP + if (cv_debugchallenges.value && challengesmenu.currentunlock < MAXUNLOCKABLES && challengesmenu.unlockanim >= UNLOCKTIME && gamedata->unlocked[challengesmenu.currentunlock] == true) { gamedata->unlocked[challengesmenu.currentunlock] = gamedata->unlockpending[challengesmenu.currentunlock] = false;