From 67f5b2245f3842a636af585e2ad010f6864f2c4d Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Nov 2019 15:48:50 +0000 Subject: [PATCH] Secret stuff. (I intend to keep candid discussion of this outside of any commits; you'll see me write up a comment describing what's going on here soon.) --- src/dehacked.c | 44 ++++++++++++++++++++++++++++---------------- src/f_finale.c | 17 ++++++++++++++--- src/g_game.c | 2 +- src/info.c | 32 ++++++++++++++++++++++++++++++++ src/info.h | 9 +++++++++ src/m_cheat.c | 20 +++++++------------- src/p_inter.c | 12 ++++++++++++ src/p_mobj.c | 2 +- src/p_setup.c | 19 +++++++++++++++++++ src/r_things.c | 2 -- src/screen.c | 2 +- src/v_video.c | 10 ++++++++-- src/w_wad.c | 3 +++ 13 files changed, 135 insertions(+), 39 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 34ee1f170..dd6b1273f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1851,24 +1851,29 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) // end copypasta from readcutscenescene else if (fastcmp(word, "NAME")) { - INT32 j; - - // HACK: Add yellow control char now - // so the drawing function doesn't call it repeatedly - char name[34]; - name[0] = '\x82'; // color yellow - name[1] = 0; - strncat(name, word2, 33); - name[33] = 0; - - // Replace _ with ' ' - for (j = 0; j < 32 && name[j]; j++) + if (*word2 != '\0') { - if (name[j] == '_') - name[j] = ' '; - } + INT32 j; - strncpy(textprompts[num]->page[pagenum].name, name, 32); + // HACK: Add yellow control char now + // so the drawing function doesn't call it repeatedly + char name[34]; + name[0] = '\x82'; // color yellow + name[1] = 0; + strncat(name, word2, 33); + name[33] = 0; + + // Replace _ with ' ' + for (j = 0; j < 32 && name[j]; j++) + { + if (name[j] == '_') + name[j] = ' '; + } + + strncpy(textprompts[num]->page[pagenum].name, name, 32); + } + else + *textprompts[num]->page[pagenum].name = '\0'; } else if (fastcmp(word, "ICON")) strncpy(textprompts[num]->page[pagenum].iconname, word2, 8); @@ -1901,6 +1906,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) else if (i == 16 || fastcmp(word2, "BLUE")) backcolor = 16; else if (i == 17 || fastcmp(word2, "PURPLE")) backcolor = 17; else if (i == 18 || fastcmp(word2, "LAVENDER")) backcolor = 18; + else if (i >= 256 && i < 512) backcolor = i; // non-transparent palette index else if (i < 0) backcolor = INT32_MAX; // CONS_BACKCOLOR user-configured else backcolor = 1; // default gray textprompts[num]->page[pagenum].backcolor = backcolor; @@ -5665,6 +5671,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Trapgoyle Demon fire "S_DEMONFIRE", + // The letter + "S_LETTER", + // GFZ flowers "S_GFZFLOWERA", "S_GFZFLOWERB", @@ -7652,6 +7661,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ARROW", // Arrow "MT_DEMONFIRE", // Trapgoyle fire + // The letter + "MT_LETTER", + // Greenflower Scenery "MT_GFZFLOWER1", "MT_GFZFLOWER2", diff --git a/src/f_finale.c b/src/f_finale.c index eb1415042..968da572d 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -3453,6 +3453,17 @@ void F_TextPromptDrawer(void) V_DrawString(textr-8, chevrony + (skullAnimCounter/5), (V_SNAPTOBOTTOM|V_YELLOWMAP), "\x1B"); // down arrow } +#define nocontrolallowed(j) {\ + players[j].powers[pw_nocontrol] = 1;\ + if (players[j].mo)\ + {\ + if (players[j].mo->state == states+S_PLAY_STND && players[j].mo->tics != -1)\ + players[j].mo->tics++;\ + else if (players[j].mo->state == states+S_PLAY_WAIT)\ + P_SetPlayerMobjState(players[j].mo, S_PLAY_STND);\ + }\ + } + void F_TextPromptTicker(void) { INT32 i; @@ -3482,10 +3493,10 @@ void F_TextPromptTicker(void) // But only consoleplayer can advance the prompt. // \todo Proper per-player splitscreen support (individual prompts) if (i == consoleplayer || i == secondarydisplayplayer) - players[i].powers[pw_nocontrol] = 1; + nocontrolallowed(i) } else if (i == consoleplayer) - players[i].powers[pw_nocontrol] = 1; + nocontrolallowed(i) if (!splitscreen) break; @@ -3527,7 +3538,7 @@ void F_TextPromptTicker(void) continue; } else if (i == consoleplayer) - players[i].powers[pw_nocontrol] = 1; + nocontrolallowed(i) else continue; diff --git a/src/g_game.c b/src/g_game.c index e2f43e4f2..749658679 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3912,7 +3912,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean } if (netgame || multiplayer) // Nice try, haxor. - ultimatemode = false; + pultmode = false; if (!demoplayback && !netgame) // Netgame sets random seed elsewhere, demo playback sets seed just before us! P_SetRandSeed(M_RandomizedSeed()); // Use a more "Random" random seed diff --git a/src/info.c b/src/info.c index cfaad552d..d933dec5c 100644 --- a/src/info.c +++ b/src/info.c @@ -195,6 +195,9 @@ char sprnames[NUMSPRITES + 1][5] = "AROW", // Arrow "CFIR", // Colored fire of various sorts + // The letter + "LETR", + // Greenflower Scenery "FWR1", "FWR2", // GFZ Sunflower @@ -2202,6 +2205,8 @@ state_t states[NUMSTATES] = {SPR_CFIR, FF_FULLBRIGHT|FF_ANIMATE, -1, {NULL}, 5, 2, S_NULL}, // S_DEMONFIRE + {SPR_LETR, FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_LETTER + // GFZ flowers {SPR_FWR1, FF_ANIMATE, -1, {NULL}, 7, 3, S_NULL}, // S_GFZFLOWERA {SPR_FWR2, FF_ANIMATE, -1, {NULL}, 19, 3, S_NULL}, // S_GFZFLOWERB @@ -9909,6 +9914,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_LETTER + -1, // doomednum + S_LETTER, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 7*FRACUNIT, // radius -- heaven + 13*FRACUNIT, // height -- hell + 0, // display offset + 0, // mass + 1, // damage + sfx_None, // activesound + MF_SPECIAL|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags + S_NULL // raisestate + }, + { // MT_GFZFLOWER1 800, // doomednum S_GFZFLOWERA, // spawnstate diff --git a/src/info.h b/src/info.h index e7f41f585..3414f2484 100644 --- a/src/info.h +++ b/src/info.h @@ -451,6 +451,9 @@ typedef enum sprite SPR_AROW, // Arrow SPR_CFIR, // Colored fire of various sorts + // The letter + SPR_LETR, + // Greenflower Scenery SPR_FWR1, SPR_FWR2, // GFZ Sunflower @@ -2338,6 +2341,9 @@ typedef enum state // Trapgoyle Demon fire S_DEMONFIRE, + // The letter + S_LETTER, + // GFZ flowers S_GFZFLOWERA, S_GFZFLOWERB, @@ -4348,6 +4354,9 @@ typedef enum mobj_type MT_ARROW, // Arrow MT_DEMONFIRE, // Trapgoyle fire + // The letter + MT_LETTER, + // Greenflower Scenery MT_GFZFLOWER1, MT_GFZFLOWER2, diff --git a/src/m_cheat.c b/src/m_cheat.c index bb757839a..4371f9e5b 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -70,7 +70,6 @@ static UINT8 cheatf_ultimate(void) return 1; } -#ifdef REDXVI static UINT8 cheatf_warp(void) { if (modifiedgame) @@ -83,16 +82,15 @@ static UINT8 cheatf_warp(void) // Temporarily unlock stuff. G_SetGameModified(false); - unlockables[2].unlocked = true; // credits - unlockables[3].unlocked = true; // sound test - unlockables[16].unlocked = true; // level select + unlockables[31].unlocked = true; // credits + unlockables[30].unlocked = true; // sound test + unlockables[28].unlocked = true; // level select // Refresh secrets menu existing. M_ClearMenus(true); M_StartControlPanel(); return 1; } -#endif #ifdef DEVELOP static UINT8 cheatf_devmode(void) @@ -133,20 +131,18 @@ static cheatseq_t cheat_ultimate_joy = { SCRAMBLE(KEY_ENTER), 0xff } }; -#ifdef REDXVI static cheatseq_t cheat_warp = { 0, cheatf_warp, - { SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff } + { SCRAMBLE('c'), SCRAMBLE('a'), SCRAMBLE('s'), SCRAMBLE('h'), SCRAMBLE('r'), SCRAMBLE('i'), SCRAMBLE('d'), SCRAMBLE('a'), 0xff } }; static cheatseq_t cheat_warp_joy = { 0, cheatf_warp, - { SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), - SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), - SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), + { SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_DOWNARROW), + SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_DOWNARROW), + SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_ENTER), 0xff } }; -#endif #ifdef DEVELOP static cheatseq_t cheat_devmode = { @@ -239,10 +235,8 @@ boolean cht_Responder(event_t *ev) ret += cht_CheckCheat(&cheat_ultimate, (char)ch); ret += cht_CheckCheat(&cheat_ultimate_joy, (char)ch); -#ifdef REDXVI ret += cht_CheckCheat(&cheat_warp, (char)ch); ret += cht_CheckCheat(&cheat_warp_joy, (char)ch); -#endif #ifdef DEVELOP ret += cht_CheckCheat(&cheat_devmode, (char)ch); #endif diff --git a/src/p_inter.c b/src/p_inter.c index 9017f795d..1c8d27dae 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -27,6 +27,7 @@ #include "m_cheat.h" // objectplace #include "m_misc.h" #include "v_video.h" // video flags for CEchos +#include "f_finale.h" // CTF player names #define CTFTEAMCODE(pl) pl->ctfteam ? (pl->ctfteam == 1 ? "\x85" : "\x84") : "" @@ -1392,6 +1393,17 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } } break; + case MT_LETTER: + { + if (special->health && !player->bot) + { + F_StartTextPrompt(199, 0, toucher, 0, true, false); + special->health = 0; + if (player->continues < 99) + player->continues++; + } + return; + } case MT_FIREFLOWER: if (player->bot) return; diff --git a/src/p_mobj.c b/src/p_mobj.c index 5735dc27b..d6a1b5eb4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11584,7 +11584,7 @@ You should think about modifying the deathmatch starts to take full advantage of if (i == MT_PITY_BOX || i == MT_ELEMENTAL_BOX || i == MT_ATTRACT_BOX || i == MT_FORCE_BOX || i == MT_ARMAGEDDON_BOX || i == MT_WHIRLWIND_BOX || i == MT_FLAMEAURA_BOX || i == MT_BUBBLEWRAP_BOX || i == MT_THUNDERCOIN_BOX - || i == MT_RING_BOX) + || i == MT_RING_BOX || i == MT_STARPOST) return; // No rings or shields in Ultimate mode // Don't include the gold repeating boxes here please. diff --git a/src/p_setup.c b/src/p_setup.c index cef176636..93f6ce031 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3004,6 +3004,25 @@ boolean P_SetupLevel(boolean skipprecip) leveltime = maxstarposttime; } + if (unlockables[27].unlocked // pandora's box +#ifndef DEVELOP + && !modifiedgame +#endif + && !(netgame || multiplayer) && gamemap == 0x1d35-016464) + { + P_SpawnMobj(0640370000, 0x11000000, 0b11000110000000000000000000, MT_LETTER)->angle = ANGLE_90; + if (textprompts[199]->page[1].backcolor != 259) + { + char *buf = W_CacheLumpName("WATERMAP", PU_STATIC), *b = buf; + while ((*b != 65) && (b-buf < 256)) { *b = (*b - 65)&255; b++; } *b = '\0'; + Z_Free(textprompts[199]->page[1].text); + textprompts[199]->page[1].text = Z_StrDup(buf); + textprompts[199]->page[1].lines = 4; + textprompts[199]->page[1].backcolor = 259; + Z_Free(buf); + } + } + if (modeattacking == ATTACKING_RECORD && !demoplayback) P_LoadRecordGhosts(); else if (modeattacking == ATTACKING_NIGHTS && !demoplayback) diff --git a/src/r_things.c b/src/r_things.c index 00eaae1c2..de7b01993 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -3154,8 +3154,6 @@ void R_AddSkins(UINT16 wadnum) skin->availability = atoi(value); if (skin->availability >= MAXUNLOCKABLES) skin->availability = 0; - if (skin->availability) - STRBUFCPY(unlockables[skin->availability - 1].name, skin->realname); } else if (!R_ProcessPatchableFields(skin, stoken, value)) CONS_Debug(DBG_SETUP, "R_AddSkins: Unknown keyword '%s' in S_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename); diff --git a/src/screen.c b/src/screen.c index 9939aff93..f1d91de66 100644 --- a/src/screen.c +++ b/src/screen.c @@ -440,7 +440,7 @@ void SCR_ClosedCaptions(void) if (gamestate == GS_LEVEL) { if (promptactive) - basey -= 28; + basey -= 42; else if (splitscreen) basey -= 8; else if ((modeattacking == ATTACKING_NIGHTS) diff --git a/src/v_video.c b/src/v_video.c index 34d64cb04..55cfd4aab 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1895,7 +1895,13 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color) { UINT8 *deststop, *buf; - boxheight *= vid.dupy; + boxheight = ((boxheight * 4) + (boxheight/2)*5); + + if (color >= 256 && color < 512) + { + V_DrawFill((BASEVIDWIDTH-(vid.width/vid.dupx))/2, BASEVIDHEIGHT-boxheight, (vid.width/vid.dupx),boxheight, (color-256)|V_SNAPTOBOTTOM); + return; + } if (color == INT32_MAX) color = cons_backcolor.value; @@ -1938,7 +1944,7 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color) // heavily simplified -- we don't need to know x or y position, // just the start and stop positions deststop = screens[0] + vid.rowbytes * vid.height; - buf = deststop - vid.rowbytes * ((boxheight * 4) + (boxheight/2)*5); // 4 lines of space plus gaps between and some leeway + buf = deststop - vid.rowbytes * boxheight * vid.dupy; // 4 lines of space plus gaps between and some leeway for (; buf < deststop; ++buf) *buf = promptbgmap[*buf]; } diff --git a/src/w_wad.c b/src/w_wad.c index 4d08b26dc..dbab18fad 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -981,6 +981,9 @@ lumpnum_t W_CheckNumForName(const char *name) INT32 i; lumpnum_t check = INT16_MAX; + if (!*name) // some doofus gave us an empty string? + return LUMPERROR; + // Check the lumpnumcache first. Loop backwards so that we check // most recent entries first for (i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)