Wrongwarp cheat

`banana` was the cheat for the previous entry in the series.
Visuals are incomplete but I have to go out in a little bit and the bulk of it is done

(The Tournament mode cheat's password is "placeholder" for now.)
This commit is contained in:
toaster 2023-06-07 14:24:33 +01:00
parent c8f74aef2b
commit 7bda2f72cf
5 changed files with 187 additions and 1 deletions

View file

@ -425,6 +425,8 @@ extern menuitem_t MISC_ChallengesStatsDummyMenu[];
extern menu_t MISC_ChallengesDef;
extern menu_t MISC_StatisticsDef;
extern menu_t MISC_WrongWarpDef;
extern menuitem_t MISC_SoundTest[];
extern menu_t MISC_SoundTestDef;
@ -1237,6 +1239,13 @@ void M_Statistics(INT32 choice);
void M_DrawStatistics(void);
boolean M_StatisticsInputs(INT32 ch);
extern struct wrongwarp_s {
INT32 ticker;
} wrongwarp;
void M_WrongWarp(INT32 choice);
void M_DrawWrongWarp(void);
typedef enum
{
stereospecial_none = 0,

View file

@ -5900,6 +5900,116 @@ void M_DrawStatistics(void)
#undef STATSSTEP
static INT32 M_WrongWarpFallingHelper(INT32 y, INT32 falltime)
{
if (wrongwarp.ticker < falltime)
{
return y;
}
if (wrongwarp.ticker > falltime + 2*TICRATE)
{
return INT32_MAX;
}
if (wrongwarp.ticker < falltime + TICRATE)
{
y += + ((wrongwarp.ticker - falltime) & 1 ? 1 : -1);
return y;
}
y += floor(pow(1.5, (double)(wrongwarp.ticker - (falltime + TICRATE))));
return y;
}
void M_DrawWrongWarp(void)
{
INT32 titleoffset = 0, titlewidth, x, y;
const char *titletext = "WRONG GAME? WRONG GAME! ";
if (gamestate == GS_MENU)
{
patch_t *pat, *pat2;
INT32 animtimer, anim2 = 0;
pat = W_CachePatchName("TITLEBG1", PU_CACHE);
pat2 = W_CachePatchName("TITLEBG2", PU_CACHE);
animtimer = ((wrongwarp.ticker*5)/16) % SHORT(pat->width);
anim2 = SHORT(pat2->width) - (((wrongwarp.ticker*5)/16) % SHORT(pat2->width));
// SRB2Kart: F_DrawPatchCol is over-engineered; recoded to be less shitty and error-prone
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
x = -((INT32)animtimer);
y = 0;
while (x < BASEVIDWIDTH)
{
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, pat, NULL);
x += SHORT(pat->width);
}
x = -anim2;
y = BASEVIDHEIGHT - SHORT(pat2->height);
while (x < BASEVIDWIDTH)
{
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, pat2, NULL);
x += SHORT(pat2->width);
}
}
{
patch_t *ttcheckers = W_CachePatchName("TTCHECK", PU_CACHE);
y = FixedMul(40<<FRACBITS, FixedDiv(wrongwarp.ticker%70, 70));
V_DrawSciencePatch(0, -y, 0, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + y, 0, ttcheckers, FRACUNIT);
y = M_WrongWarpFallingHelper(36, 7*TICRATE/4);
if (y != INT32_MAX)
{
patch_t *ttbanner = W_CachePatchName("TTKBANNR", PU_CACHE);
V_DrawSmallScaledPatch(84, y, 0, ttbanner);
}
y = M_WrongWarpFallingHelper(87, 4*TICRATE/3);
if (y != INT32_MAX)
{
patch_t *ttkart = W_CachePatchName("TTKART", PU_CACHE);
V_DrawSmallScaledPatch(84, y, 0, ttkart);
}
}
if (wrongwarp.ticker < 2*TICRATE/3)
return;
V_DrawFadeScreen(31, min((wrongwarp.ticker - 2*TICRATE/3), 5));
y = 20;
x = BASEVIDWIDTH - 8;
if (wrongwarp.ticker < TICRATE)
{
INT32 adjust = floor(pow(2, (double)(TICRATE - wrongwarp.ticker)));
x += adjust/2;
y += adjust;
}
titlewidth = V_LSTitleHighStringWidth(titletext, 0);
titleoffset = (-wrongwarp.ticker) % titlewidth;
while (titleoffset < BASEVIDWIDTH)
{
V_DrawLSTitleHighString(titleoffset, y, 0, titletext);
titleoffset += titlewidth;
}
patch_t *bumper = W_CachePatchName((cv_alttitle.value ? "MTSJUMPR1" : "MTSBUMPR1"), PU_CACHE);
V_DrawScaledPatch(x-(SHORT(bumper->width)), (BASEVIDHEIGHT-8)-(SHORT(bumper->height)), 0, bumper);
}
void M_DrawSoundTest(void)
{
UINT8 pid = 0; // todo: Add ability for any splitscreen player to bring up the menu.

View file

@ -91,6 +91,14 @@ static UINT8 cheatf_warp(void)
return 1;
}
static UINT8 cheatf_wrongwarp(void)
{
// Tee hee.
M_WrongWarp(0);
return 1;
}
#ifdef DEVELOP
static UINT8 cheatf_devmode(void)
{
@ -119,7 +127,11 @@ static UINT8 cheatf_devmode(void)
static cheatseq_t cheat_warp = {
NULL, cheatf_warp,
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
(UINT8[]){ SCRAMBLE('p'), SCRAMBLE('l'), SCRAMBLE('a'), SCRAMBLE('c'), SCRAMBLE('e'), SCRAMBLE('h'), SCRAMBLE('o'), SCRAMBLE('l'), SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('r'), 0xff }
};
static cheatseq_t cheat_wrongwarp = {
NULL, cheatf_wrongwarp,
(UINT8[]){ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff }
};
@ -133,6 +145,7 @@ static cheatseq_t cheat_devmode = {
cheatseq_t *cheatseqlist[] =
{
&cheat_warp,
&cheat_wrongwarp,
#ifdef DEVELOP
&cheat_devmode,
#endif

View file

@ -4,6 +4,7 @@ target_sources(SRB2SDL2 PRIVATE
extras-challenges.c
extras-egg-tv.cpp
extras-statistics.c
extras-wrong.c
main-1.c
main-profile-select.c
options-1.c

53
src/menus/extras-wrong.c Normal file
View file

@ -0,0 +1,53 @@
/// \file menus/extras-wrong.c
/// \brief Wrongwarp
#include "../k_menu.h"
struct wrongwarp_s wrongwarp;
static menuitem_t MISC_WrongWarpMenu[] =
{
{IT_NOTHING, NULL, NULL, NULL, {NULL}, 0, 0},
};
void M_WrongWarp(INT32 choice)
{
(void)choice;
wrongwarp.ticker = 0;
MISC_WrongWarpDef.prevMenu = currentMenu;
M_SetupNextMenu(&MISC_WrongWarpDef, false);
}
static void M_WrongWarpTick(void)
{
wrongwarp.ticker++;
}
static boolean M_WrongWarpInputs(INT32 ch)
{
(void)ch;
if (wrongwarp.ticker < TICRATE/2)
return true;
return false;
}
menu_t MISC_WrongWarpDef = {
sizeof (MISC_WrongWarpMenu)/sizeof (menuitem_t),
&MainDef,
0,
MISC_WrongWarpMenu,
0, 0,
0, 0,
MBF_SOUNDLESS,
"YEAWAY",
98, 0,
M_DrawWrongWarp,
M_WrongWarpTick,
NULL,
NULL,
M_WrongWarpInputs,
};