From 47a9cce1339bae07918076e87ed63945906f36e5 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 2 Mar 2024 04:27:41 -0700 Subject: [PATCH] Add shittysigns cheat --- src/cvars.cpp | 3 ++- src/d_netcmd.h | 1 + src/hardware/hw_md2.c | 2 +- src/info.c | 3 ++- src/info.h | 2 +- src/m_cheat.c | 20 ++++++++++++++++++++ src/p_mobj.c | 4 ++++ 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index 2b439d89e..8541f8d0a 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -902,7 +902,8 @@ consvar_t cv_palettenum = PlayerCheat("palettenum", "0").values(CV_Unsigned).onc extern CV_PossibleValue_t renderhitbox_cons_t[]; consvar_t cv_renderhitbox = PlayerCheat("renderhitbox", "Off").values(renderhitbox_cons_t).description("Show hitboxes around objects"); -consvar_t cv_mentalsonic = PlayerCheat("mentalsonic", "Off").values(CV_OnOff).flags(CV_HIDDEN).description("Works out at the library"); +consvar_t cv_mentalsonic = Player("mentalsonic", "Off").dont_save().values(CV_OnOff).flags(CV_NOSHOWHELP).description("Works out at the library"); +consvar_t cv_shittysigns = Player("shittysigns", "Off").dont_save().values(CV_OnOff).flags(CV_NOSHOWHELP).description("It's better because it's worse"); // // Dummy variables used solely in the menu system. diff --git a/src/d_netcmd.h b/src/d_netcmd.h index d1d0fa643..99c284fd3 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -99,6 +99,7 @@ extern consvar_t cv_debugrank; extern consvar_t cv_battletest; extern consvar_t cv_mentalsonic; +extern consvar_t cv_shittysigns; typedef enum { CV_CAPSULETEST_OFF, diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 0b912cd0c..3fdc221e9 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1186,7 +1186,7 @@ static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendpatch, INT32 ski static boolean HWR_AllowModel(mobj_t *mobj) { // Don't allow rendering of model for these. - if (mobj->sprite2 == SPR2_XTRA || mobj->sprite2 == SPR2_SIGN || mobj->sprite2 == SPR2_SIGL || mobj->sprite2 == SPR2_TALK) + if (mobj->sprite2 == SPR2_XTRA || mobj->sprite2 == SPR2_SIGN || mobj->sprite2 == SPR2_SIGL || mobj->sprite2 == SPR2_SSIG || mobj->sprite2 == SPR2_TALK) return false; // Otherwise, render the model. diff --git a/src/info.c b/src/info.c index 2ee9c0c9c..8d8e72053 100644 --- a/src/info.c +++ b/src/info.c @@ -762,7 +762,7 @@ char spr2names[NUMPLAYERSPRITES][5] = "SPIN", // Spinout "DEAD", // Dead - "SIGN", "SIGL", // Finish signpost + "SIGN", "SIGL", "SSIG", // Finish signpost "XTRA", // Three Faces of Darkness "TALK", // Dialogue }; @@ -806,6 +806,7 @@ playersprite_t spr2defaults[NUMPLAYERSPRITES] = { 0, // SPR2_SIGN SPR2_SIGN, // SPR2_SIGL + SPR2_SIGN, // SPR2_SSIG 0, // SPR2_XTRA 0, // SPR2_TALK }; diff --git a/src/info.h b/src/info.h index ecdfc7e97..fd062e658 100644 --- a/src/info.h +++ b/src/info.h @@ -1296,7 +1296,7 @@ typedef enum playersprite SPR2_DRRN, SPR2_DRRO, SPR2_DRRI, SPR2_SPIN, SPR2_DEAD, - SPR2_SIGN, SPR2_SIGL, + SPR2_SIGN, SPR2_SIGL, SPR2_SSIG, SPR2_XTRA, SPR2_TALK, diff --git a/src/m_cheat.c b/src/m_cheat.c index 4564fe9bb..e9d8b7e1d 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -177,6 +177,21 @@ static UINT8 cheatf_mentalsonic(void) return 1; } +static UINT8 cheatf_shittysigns(void) +{ + cv_shittysigns.value = !(cv_shittysigns.value); + if (cv_shittysigns.value) + { + S_StartSound(NULL, sfx_mixup); + } + else + { + S_StartSound(NULL, sfx_nghurt); + } + + return 1; +} + #ifdef DEVELOP static UINT8 cheatf_devmode(void) { @@ -255,6 +270,10 @@ static cheatseq_t cheat_mentalsonic = { (UINT8[]){ SCRAMBLE('m'), SCRAMBLE('e'), SCRAMBLE('n'), SCRAMBLE('t'), SCRAMBLE('a'), SCRAMBLE('l'), SCRAMBLE(' '), SCRAMBLE('s'), SCRAMBLE('o'), SCRAMBLE('n'), SCRAMBLE('i'), SCRAMBLE('c'), 0xff } }; +static cheatseq_t cheat_shittysigns = { + NULL, cheatf_shittysigns, + (UINT8[]){ SCRAMBLE('i'), SCRAMBLE('d'), SCRAMBLE('s'), SCRAMBLE('p'), SCRAMBLE('i'), SCRAMBLE('s'), SCRAMBLE('p'), SCRAMBLE('o'), SCRAMBLE('p'), SCRAMBLE('d'), 0xff } +}; #ifdef DEVELOP static cheatseq_t cheat_devmode = { @@ -275,6 +294,7 @@ cheatseq_t *cheatseqlist[] = &cheat_savetheanimals, &cheat_savetheframes, &cheat_mentalsonic, + &cheat_shittysigns, #ifdef DEVELOP &cheat_devmode, &cheat_skipgoner, diff --git a/src/p_mobj.c b/src/p_mobj.c index 6e670a772..12bf519bf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8912,9 +8912,13 @@ static boolean P_MobjRegularThink(mobj_t *mobj) { cur->skin = &skins[newplayer->skin]; cur->color = newplayer->skincolor; + // Even if we didn't have the Perfect Sign to consider, // it's still necessary to refresh SPR2 on skin changes. P_SetMobjState(cur, (newperfect == true) ? S_KART_SIGL : S_KART_SIGN); + + if (cv_shittysigns.value && cur->state != &states[S_KART_SIGL]) + cur->sprite2 = P_GetSkinSprite2(&skins[newplayer->skin], SPR2_SSIG, NULL);; } } else if (cur->state == &states[S_SIGN_ERROR])