From 19459a735b7946881000b5dbde3e9e1550b73580 Mon Sep 17 00:00:00 2001 From: Michael Day Date: Wed, 20 Dec 2023 22:50:11 -0500 Subject: [PATCH 1/4] doom: support Sigil II loaded as pwad --- src/crispy.h | 1 + src/doom/d_englsh.h | 20 ++++++++++++++++++++ src/doom/d_main.c | 6 ++++++ src/doom/deh_bexpars.c | 4 ++-- src/doom/deh_bexpars.h | 2 +- src/doom/f_finale.c | 2 ++ src/doom/g_game.c | 16 ++++++++++++++-- src/doom/hu_stuff.c | 11 +++++++++++ src/doom/m_menu.c | 25 ++++++++++++++++++++++++- src/doom/p_enemy.c | 4 ++++ src/doom/s_sound.c | 2 +- src/doom/sounds.c | 10 ++++++++++ src/doom/sounds.h | 10 ++++++++++ src/doom/st_stuff.c | 3 ++- src/doom/wi_stuff.c | 6 +++++- 15 files changed, 113 insertions(+), 9 deletions(-) diff --git a/src/crispy.h b/src/crispy.h index c44dbf2d32..46460fc089 100644 --- a/src/crispy.h +++ b/src/crispy.h @@ -97,6 +97,7 @@ typedef struct boolean fliplevels; boolean flipweapons; boolean haved1e5; + boolean haved1e6; boolean havee1m10; boolean havemap33; boolean havessg; diff --git a/src/doom/d_englsh.h b/src/doom/d_englsh.h index 6dd42bdf08..9ab6a7ace2 100644 --- a/src/doom/d_englsh.h +++ b/src/doom/d_englsh.h @@ -207,6 +207,16 @@ #define HUSTR_E5M8 "E5M8: Halls of Perdition" #define HUSTR_E5M9 "E5M9: Realm of Iblis" +#define HUSTR_E6M1 "E6M1: Cursed Darkness" +#define HUSTR_E6M2 "E6M2: Violent Hatred" +#define HUSTR_E6M3 "E6M3: Twilight Desolation" +#define HUSTR_E6M4 "E6M4: Fragments of Sanity" +#define HUSTR_E6M5 "E6M5: Wrathful Reckoning" +#define HUSTR_E6M6 "E6M6: Vengeance Unleashed" +#define HUSTR_E6M7 "E6M7: Descent Into Terror" +#define HUSTR_E6M8 "E6M8: Abyss of Despair" +#define HUSTR_E6M9 "E6M9: Shattered Homecoming" + #define HUSTR_1 "level 1: entryway" #define HUSTR_2 "level 2: underhalls" #define HUSTR_3 "level 3: the gantlet" @@ -511,6 +521,16 @@ "\n"\ "Lock and load. Rip and tear." +#define E6TEXT \ +"Satan erred in casting you to Hell's\n"\ +"darker depths. His plan failed. He has\n"\ +"tried for so long to destroy you, and he\n"\ +"has lost every single time. His only\n"\ +"option is to flood Earth with demons\n"\ +"and hope you go down fighting.\n"\ +"\n"\ +"Prepare for HELLION!" + // after level 6, put this: #define C1TEXT \ diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 8ec1ce1412..a08b9fc4b2 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -2132,6 +2132,12 @@ void D_DoomMain (void) (W_CheckNumForName("e5m1") != -1) && (W_CheckNumForName("wilv40") != -1); + // [crispy] check for presence of a 6th episode + crispy->haved1e6 = (gameversion == exe_ultimate) && + (W_CheckNumForName("m_epi6") != -1) && + (W_CheckNumForName("e6m1") != -1) && + (W_CheckNumForName("wilv50") != -1); + // [crispy] check for presence of E1M10 crispy->havee1m10 = (gamemode == retail) && (W_CheckNumForName("e1m10") != -1) && diff --git a/src/doom/deh_bexpars.c b/src/doom/deh_bexpars.c index f7b540130b..5e7d1ff2df 100644 --- a/src/doom/deh_bexpars.c +++ b/src/doom/deh_bexpars.c @@ -22,7 +22,7 @@ #include "deh_bexpars.h" #include "deh_io.h" -int bex_pars[6][10] = {{0}}; +int bex_pars[7][10] = {{0}}; int bex_cpars[32] = {0}; static void *DEH_BEXParsStart(deh_context_t *context, char *line) @@ -43,7 +43,7 @@ static void DEH_BEXParsParseLine(deh_context_t *context, char *line, void *tag) if (sscanf(line, "par %32d %32d %32d", &episode, &map, &partime) == 3) { - if (episode >= 1 && episode <= 5 && map >= 1 && map <= 9) + if (episode >= 1 && episode <= 6 && map >= 1 && map <= 9) bex_pars[episode][map] = partime; else { diff --git a/src/doom/deh_bexpars.h b/src/doom/deh_bexpars.h index 8dac3440d4..0fee7b42bd 100644 --- a/src/doom/deh_bexpars.h +++ b/src/doom/deh_bexpars.h @@ -19,7 +19,7 @@ #ifndef DEH_BEXPARS_H #define DEH_BEXPARS_H -extern int bex_pars[6][10]; +extern int bex_pars[7][10]; extern int bex_cpars[32]; #endif /* #ifndef DEH_BEXPARS_H */ diff --git a/src/doom/f_finale.c b/src/doom/f_finale.c index b84f03cf95..a7e0ea8964 100644 --- a/src/doom/f_finale.c +++ b/src/doom/f_finale.c @@ -76,6 +76,7 @@ static textscreen_t textscreens[] = { doom, 3, 8, "MFLR8_4", E3TEXT}, { doom, 4, 8, "MFLR8_3", E4TEXT}, { doom, 5, 8, "FLOOR7_2", E5TEXT}, // [crispy] Sigil + { doom, 6, 8, "FLOOR7_2", E6TEXT}, // [crispy] Sigil II { doom2, 1, 6, "SLIME16", C1TEXT}, { doom2, 1, 11, "RROCK14", C2TEXT}, @@ -1012,6 +1013,7 @@ static void F_ArtScreenDrawer(void) break; // [crispy] Sigil case 5: + case 6: lumpname = "SIGILEND"; if (W_CheckNumForName(DEH_String(lumpname)) == -1) { diff --git a/src/doom/g_game.c b/src/doom/g_game.c index 8bc3d565fa..9fbda51a32 100644 --- a/src/doom/g_game.c +++ b/src/doom/g_game.c @@ -1733,7 +1733,7 @@ void G_ScreenShot (void) // DOOM Par Times -static const int pars[6][10] = +static const int pars[7][10] = { {0}, {0,30,75,120,90,165,180,180,30,165}, @@ -1743,6 +1743,8 @@ static const int pars[6][10] = ,{0,165,255,135,150,180,390,135,360,180} // [crispy] Episode 5 par times from Sigil v1.21 ,{0,90,150,360,420,780,420,780,300,660} + // [crispy] Episode 6 par times from Sigil II v1.0 + ,{0,480,300,240,420,510,840,960,390,450} }; // DOOM II Par Times @@ -2011,6 +2013,7 @@ void G_DoCompleted (void) switch (gameepisode) { case 1: + case 6: wminfo.next = 3; break; case 2: @@ -2072,7 +2075,9 @@ void G_DoCompleted (void) // [crispy] single player par times for episode 4 (gameepisode == 4 && crispy->singleplayer) || // [crispy] par times for Sigil - gameepisode == 5) + gameepisode == 5 || + // [crispy] par times for Sigil II + gameepisode == 6) { // [crispy] support [PARS] sections in BEX files if (bex_pars[gameepisode][gamemap]) @@ -2672,6 +2677,13 @@ G_InitNew skytexturename = "SKY3"; } break; + case 6: // [crispy] Sigil II + skytexturename = "SKY6_ZD"; + if (R_CheckTextureNumForName(DEH_String(skytexturename)) == -1) + { + skytexturename = "SKY3"; + } + break; } skytexturename = DEH_String(skytexturename); skytexture = R_TextureNumForName(skytexturename); diff --git a/src/doom/hu_stuff.c b/src/doom/hu_stuff.c index 90656eac84..fa7aadd0d7 100644 --- a/src/doom/hu_stuff.c +++ b/src/doom/hu_stuff.c @@ -175,6 +175,17 @@ const char *mapnames[] = // DOOM shareware/registered/retail (Ultimate) names. HUSTR_E5M8, HUSTR_E5M9, + // [crispy] Sigil II + HUSTR_E6M1, + HUSTR_E6M2, + HUSTR_E6M3, + HUSTR_E6M4, + HUSTR_E6M5, + HUSTR_E6M6, + HUSTR_E6M7, + HUSTR_E6M8, + HUSTR_E6M9, + "NEWLEVEL", "NEWLEVEL", "NEWLEVEL", diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c index 88ebc1699e..b3a4b31b4d 100644 --- a/src/doom/m_menu.c +++ b/src/doom/m_menu.c @@ -316,6 +316,7 @@ enum ep3, ep4, ep5, // [crispy] Sigil + ep6, // [crispy] Sigil II ep_end } episodes_e; @@ -326,6 +327,17 @@ menuitem_t EpisodeMenu[]= {1,"M_EPI3", M_Episode,'i'}, {1,"M_EPI4", M_Episode,'t'} ,{1,"M_EPI5", M_Episode,'s'} // [crispy] Sigil + ,{1,"M_EPI6", M_Episode,'s'} // [crispy] Sigil II +}; + +// [crispy] have Sigil II but not Sigil +menuitem_t EpisodeMenuSII[]= +{ + {1,"M_EPI1", M_Episode,'k'}, + {1,"M_EPI2", M_Episode,'t'}, + {1,"M_EPI3", M_Episode,'i'}, + {1,"M_EPI4", M_Episode,'t'} + ,{1,"M_EPI6", M_Episode,'s'} // [crispy] Sigil II }; menu_t EpiDef = @@ -1352,6 +1364,9 @@ void M_Episode(int choice) } epi = choice; + // [crispy] have Sigil II loaded but not Sigil + if (epi == 4 && crispy->haved1e6 && !crispy->haved1e5) + epi = 5; M_SetupNextMenu(&NewDef); } @@ -3294,10 +3309,18 @@ void M_Init (void) } // [crispy] Sigil - if (!crispy->haved1e5) + if (!crispy->haved1e5 && !crispy->haved1e6) { EpiDef.numitems = 4; } + else if (crispy->haved1e5 != crispy->haved1e6) + { + EpiDef.numitems = 5; + if (crispy->haved1e6) + { + EpiDef.menuitems = EpisodeMenuSII; + } + } // Versions of doom.exe before the Ultimate Doom release only had // three episodes; if we're emulating one of those then don't try diff --git a/src/doom/p_enemy.c b/src/doom/p_enemy.c index 26fc69b39d..97f6dde3a6 100644 --- a/src/doom/p_enemy.c +++ b/src/doom/p_enemy.c @@ -1720,6 +1720,10 @@ static boolean CheckBossEnd(mobjtype_t motype) case 5: return (gamemap == 8 && !critical->havesigil); + // [crispy] no trigger for Sigil II E6 + case 6: + return 0; + default: return gamemap == 8; } diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c index 5a6d8e44af..2bdb69cdc8 100644 --- a/src/doom/s_sound.c +++ b/src/doom/s_sound.c @@ -424,7 +424,7 @@ void S_Start(void) mus_e1m9, // Tim e4m9 }; - if (gameepisode < 4 || gameepisode == 5) // [crispy] Sigil + if (gameepisode < 4 || gameepisode == 5 || gameepisode == 6) // [crispy] Sigil { mnum = mus_e1m1 + (gameepisode-1)*9 + gamemap-1; } diff --git a/src/doom/sounds.c b/src/doom/sounds.c index 8d75a55a56..1f7c124da3 100644 --- a/src/doom/sounds.c +++ b/src/doom/sounds.c @@ -81,6 +81,16 @@ musicinfo_t S_music[] = MUSIC("e5m7"), MUSIC("e5m8"), MUSIC("e5m9"), + // [crispy] Sigil II + MUSIC("e6m1"), + MUSIC("e6m2"), + MUSIC("e6m3"), + MUSIC("e6m4"), + MUSIC("e6m5"), + MUSIC("e6m6"), + MUSIC("e6m7"), + MUSIC("e6m8"), + MUSIC("e6m9"), MUSIC("sigint"), MUSIC("inter"), MUSIC("intro"), diff --git a/src/doom/sounds.h b/src/doom/sounds.h index e49ecf088a..2928f34c3a 100644 --- a/src/doom/sounds.h +++ b/src/doom/sounds.h @@ -82,6 +82,16 @@ typedef enum mus_e5m7, mus_e5m8, mus_e5m9, + // [crispy] Sigil II + mus_e6m1, + mus_e6m2, + mus_e6m3, + mus_e6m4, + mus_e6m5, + mus_e6m6, + mus_e6m7, + mus_e6m8, + mus_e6m9, mus_sigint, mus_inter, mus_intro, diff --git a/src/doom/st_stuff.c b/src/doom/st_stuff.c index db1af4ee6e..a22ee89a4b 100644 --- a/src/doom/st_stuff.c +++ b/src/doom/st_stuff.c @@ -1187,7 +1187,8 @@ ST_Responder (event_t* ev) if (epsd > 4) { // [crispy] Sigil - if (!(crispy->haved1e5 && epsd == 5)) + if (!(crispy->haved1e5 && epsd == 5) && + !(crispy->haved1e6 && epsd == 6)) return false; } if (epsd == 4 && gameversion < exe_ultimate) diff --git a/src/doom/wi_stuff.c b/src/doom/wi_stuff.c index 1820cbd778..1a1c41f8dd 100644 --- a/src/doom/wi_stuff.c +++ b/src/doom/wi_stuff.c @@ -1555,7 +1555,7 @@ static boolean WI_drawParTime (void) } // [crispy] PWAD: par times for Sigil - if (wbs->epsd == 4) + if (wbs->epsd == 4 || wbs->epsd == 5) { result = true; } @@ -1875,6 +1875,10 @@ static void WI_loadUnloadData(load_callback_t callback) { M_StringCopy(name, DEH_String("SIGILINT"), sizeof(name)); } + else if (crispy->haved1e6 && wbs->epsd == 5 && W_CheckNumForName(DEH_String("SIGILIN2")) != -1) // [crispy] Sigil + { + M_StringCopy(name, DEH_String("SIGILIN2"), sizeof(name)); + } else { DEH_snprintf(name, sizeof(name), "WIMAP%d", wbs->epsd); From 53cc8b89152a0e227854bf58a93b6920da20f0c8 Mon Sep 17 00:00:00 2001 From: Michael Day Date: Sat, 23 Dec 2023 11:09:17 -0500 Subject: [PATCH 2/4] doom: add sideload support for Sigil II --- src/crispy.h | 1 + src/doom/d_main.c | 2 +- src/doom/d_pwad.c | 180 ++++++++++++++++++++++++++++++++++++++------ src/doom/d_pwad.h | 2 +- src/doom/f_finale.c | 14 +++- src/doom/g_game.c | 8 ++ src/doom/p_enemy.c | 4 +- src/doom/sounds.c | 1 + src/doom/sounds.h | 1 + src/doom/wi_stuff.c | 3 + 10 files changed, 186 insertions(+), 30 deletions(-) diff --git a/src/crispy.h b/src/crispy.h index 46460fc089..de6e702cc6 100644 --- a/src/crispy.h +++ b/src/crispy.h @@ -114,6 +114,7 @@ typedef struct char *havenerve; char *havemaster; char *havesigil; + char *havesigil2; const char *sdlversion; const char *platform; diff --git a/src/doom/d_main.c b/src/doom/d_main.c index a08b9fc4b2..6afaf7b059 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -1993,7 +1993,7 @@ void D_DoomMain (void) gamevariant != freedoom && strncasecmp(M_BaseName(iwadfile), "rekkr", 5)) { - D_LoadSigilWad(); + D_LoadSigilWads(); } if (gamemission == doom2) diff --git a/src/doom/d_pwad.c b/src/doom/d_pwad.c index 25b1542cfe..c886f939bf 100644 --- a/src/doom/d_pwad.c +++ b/src/doom/d_pwad.c @@ -28,16 +28,17 @@ #include "m_misc.h" #include "w_main.h" #include "w_wad.h" +#include "w_merge.h" // [crispy] W_MergeFile() extern char *iwadfile; // [crispy] auto-load SIGIL.WAD (and SIGIL_SHREDS.WAD) if available -void D_LoadSigilWad (void) +static boolean LoadSigilWad (const char *iwaddir, boolean pwadtexture) { int i, j; char *sigil_shreds = NULL; const char *sigil_basename; - char *dirname, *autoload_dir; + char *autoload_dir; const char *const sigil_wads[] = { "SIGIL_v1_21.wad", @@ -61,12 +62,6 @@ void D_LoadSigilWad (void) {"D_INTRO", "D_SIGTIT"}, }; - const char *const texture_files[] = { - "PNAMES", - "TEXTURE1", - "TEXTURE2", - }; - // [crispy] don't load SIGIL.WAD if another PWAD already provides E5M1 i = W_CheckNumForName("E5M1"); if (i != -1) @@ -76,34 +71,27 @@ void D_LoadSigilWad (void) { crispy->havesigil = (char *)-1; } - return; + return false; } // [crispy] don't load SIGIL.WAD if SIGIL_COMPAT.WAD is already loaded i = W_CheckNumForName("E3M1"); if (i != -1 && !strncasecmp(W_WadNameForLump(lumpinfo[i]), "SIGIL_COMPAT", 12)) { - return; + return false; } - // [crispy] don't load SIGIL.WAD if another PWAD already modifies the texture files - for (i = 0; i < arrlen(texture_files); i++) + if (pwadtexture) { - j = W_CheckNumForName(texture_files[i]); - - if (j != -1 && !W_IsIWADLump(lumpinfo[j])) - { - return; - } + return false; } - dirname = M_DirName(iwadfile); - sigil_shreds = M_StringJoin(dirname, DIR_SEPARATOR_S, "SIGIL_SHREDS.WAD", NULL); + sigil_shreds = M_StringJoin(iwaddir, DIR_SEPARATOR_S, "SIGIL_SHREDS.WAD", NULL); // [crispy] load SIGIL.WAD for (i = 0; i < arrlen(sigil_wads); i++) { - crispy->havesigil = M_StringJoin(dirname, DIR_SEPARATOR_S, sigil_wads[i], NULL); + crispy->havesigil = M_StringJoin(iwaddir, DIR_SEPARATOR_S, sigil_wads[i], NULL); if (M_FileExists(crispy->havesigil)) { @@ -118,12 +106,11 @@ void D_LoadSigilWad (void) break; } } - free(dirname); if (crispy->havesigil == NULL) { free(sigil_shreds); - return; + return false; } printf(" [Sigil] adding %s\n", crispy->havesigil); @@ -183,8 +170,151 @@ void D_LoadSigilWad (void) } } - // [crispy] regenerate the hashtable - W_GenerateHashTable(); + return true; +} + +// [crispy] auto-load Sigil II +static boolean LoadSigil2Wad (const char *iwaddir, boolean pwadtexture) +{ + int i, j; + const char *sigil2_basename; + char *autoload_dir; + + const char *const sigil2_wads[] = { + "SIGIL_II_MP3_V1_0.WAD", + "SIGIL_II_V1_0.WAD", + }; + + static const struct { + const char *name; + const char new_name[8]; + } sigil2_lumps [] = { + {"CREDIT", "SG2CREDI"}, + {"HELP1", "SG2HELP1"}, + {"TITLEPIC", "SG2TITLE"}, + {"SIGILEND", "SGL2END"}, + {"DEHACKED", "SG2_DEH"}, + {"DEMO1", "SG2DEMO1"}, + {"DEMO2", "SG2DEMO2"}, + {"DEMO3", "SG2DEMO3"}, + {"DEMO4", "SG2DEMO4"}, + {"D_INTER", "D_SG2INT"}, + {"D_INTRO", "D_SG2TIT"}, + }; + + // [crispy] don't load Sigil II if another PWAD already provides E6M1 + i = W_CheckNumForName("E6M1"); + if (i != -1) + { + // [crispy] indicate that SIGIL_II_*.WAD is already loaded as a PWAD + if (!strncasecmp(W_WadNameForLump(lumpinfo[i]), "SIGIL_II", 8)) + { + crispy->havesigil2 = (char *)-1; + } + + return false; + } + + // [crispy] don't load Sigil II if another PWAD already modifies the + // texture files + if (pwadtexture) + { + return false; + } + + // [crispy] load Sigil II + for (i = 0; i < arrlen(sigil2_wads); i++) + { + crispy->havesigil2 = M_StringJoin(iwaddir, DIR_SEPARATOR_S, + sigil2_wads[i], NULL); + + if (M_FileExists(crispy->havesigil2)) + { + break; + } + + free(crispy->havesigil2); + crispy->havesigil2 = D_FindWADByName(sigil2_wads[i]); + + if (crispy->havesigil2) + { + break; + } + } + + if (crispy->havesigil2 == NULL) + { + return false; + } + + printf(" [Sigil II] adding %s\n", crispy->havesigil2); + W_MergeFile(crispy->havesigil2); + sigil2_basename = M_BaseName(crispy->havesigil2); + + // [crispy] rename intrusive Sigil II graphics, demos and music lumps out + // of the way + for (i = 0; i < arrlen(sigil2_lumps); i++) + { + j = W_CheckNumForName(sigil2_lumps[i].name); + + if (j != -1 && !strcasecmp(W_WadNameForLump(lumpinfo[j]), sigil2_basename)) + { + memcpy(lumpinfo[j]->name, sigil2_lumps[i].new_name, 8); + } + } + + // [crispy] load WAD and DEH files from autoload directories + if (!M_ParmExists("-noautoload")) + { + if ((autoload_dir = M_GetAutoloadDir(sigil2_basename, false))) + { + W_AutoLoadWADs(autoload_dir); + DEH_AutoLoadPatches(autoload_dir); + free(autoload_dir); + } + } + + return true; +} + +// [crispy] auto-load Sigil and Sigil II if available +void D_LoadSigilWads (void) +{ + int i, j; + boolean sigilloaded, sigil2loaded; + boolean pwadtexture = false; + char *iwaddir; + + const char *const texture_file[] = { + "PNAMES", + "TEXTURE1", + "TEXTURE2", + }; + + // [crispy] don't load Sigils if another PWAD already modifies the texture + // files + for (i = 0; i < arrlen(texture_file); i++) + { + j = W_CheckNumForName(texture_file[i]); + + if (j != -1 && !W_IsIWADLump(lumpinfo[j])) + { + pwadtexture = true; + break; + } + } + + iwaddir = M_DirName(iwadfile); + sigilloaded = LoadSigilWad(iwaddir, pwadtexture); + sigil2loaded = LoadSigil2Wad(iwaddir, pwadtexture); + + if (sigilloaded || sigil2loaded) + { + // [crispy] regenerate the hashtable + W_GenerateHashTable(); + } + + free(iwaddir); } // [crispy] check if NERVE.WAD is already loaded as a PWAD diff --git a/src/doom/d_pwad.h b/src/doom/d_pwad.h index 0f05aeeba0..bb0a98eddf 100644 --- a/src/doom/d_pwad.h +++ b/src/doom/d_pwad.h @@ -21,7 +21,7 @@ #ifndef __D_PWAD__ #define __D_PWAD__ -void D_LoadSigilWad(void); +void D_LoadSigilWads(void); void D_LoadNerveWad(void); void D_LoadMasterlevelsWad(void); diff --git a/src/doom/f_finale.c b/src/doom/f_finale.c index a7e0ea8964..a0b7cb180b 100644 --- a/src/doom/f_finale.c +++ b/src/doom/f_finale.c @@ -1013,13 +1013,25 @@ static void F_ArtScreenDrawer(void) break; // [crispy] Sigil case 5: - case 6: lumpname = "SIGILEND"; if (W_CheckNumForName(DEH_String(lumpname)) == -1) { return; } break; + // [crispy] Sigil II + case 6: + lumpname = "SGL2END"; + if (W_CheckNumForName(DEH_String(lumpname)) == -1) + { + lumpname = "SIGILEND"; + + if (W_CheckNumForName(DEH_String(lumpname)) == -1) + { + return; + } + } + break; default: return; } diff --git a/src/doom/g_game.c b/src/doom/g_game.c index 9fbda51a32..e4c9479b2e 100644 --- a/src/doom/g_game.c +++ b/src/doom/g_game.c @@ -2586,6 +2586,14 @@ G_InitNew M_ClearRandom (); + // [crispy] Spider Mastermind gets increased health in Sigil II. Normally + // the Sigil II DEH handles this, but we don't load the DEH if the WAD gets + // sideloaded. + if (crispy->havesigil2 && crispy->havesigil2 != (char *)-1) + { + mobjinfo[MT_SPIDER].spawnhealth = (episode == 6) ? 9000 : 3000; + } + if (skill == sk_nightmare || respawnparm ) respawnmonsters = true; else diff --git a/src/doom/p_enemy.c b/src/doom/p_enemy.c index 97f6dde3a6..ad5a62ab92 100644 --- a/src/doom/p_enemy.c +++ b/src/doom/p_enemy.c @@ -1720,9 +1720,9 @@ static boolean CheckBossEnd(mobjtype_t motype) case 5: return (gamemap == 8 && !critical->havesigil); - // [crispy] no trigger for Sigil II E6 + // [crispy] no trigger for auto-loaded Sigil II E6 case 6: - return 0; + return (gamemap == 8 && !critical->havesigil2); default: return gamemap == 8; diff --git a/src/doom/sounds.c b/src/doom/sounds.c index 1f7c124da3..8f30172282 100644 --- a/src/doom/sounds.c +++ b/src/doom/sounds.c @@ -92,6 +92,7 @@ musicinfo_t S_music[] = MUSIC("e6m8"), MUSIC("e6m9"), MUSIC("sigint"), + MUSIC("sg2int"), MUSIC("inter"), MUSIC("intro"), MUSIC("bunny"), diff --git a/src/doom/sounds.h b/src/doom/sounds.h index 2928f34c3a..399029b577 100644 --- a/src/doom/sounds.h +++ b/src/doom/sounds.h @@ -93,6 +93,7 @@ typedef enum mus_e6m8, mus_e6m9, mus_sigint, + mus_sg2int, mus_inter, mus_intro, mus_bunny, diff --git a/src/doom/wi_stuff.c b/src/doom/wi_stuff.c index 1a1c41f8dd..f2c34a0049 100644 --- a/src/doom/wi_stuff.c +++ b/src/doom/wi_stuff.c @@ -1676,6 +1676,9 @@ void WI_Ticker(void) // [crispy] Sigil else if (crispy->haved1e5 && wbs->epsd == 4 && W_CheckNumForName(DEH_String("D_SIGINT")) != -1) S_ChangeMusic(mus_sigint, true); + // [crispy] Sigil II + else if (crispy->haved1e6 && wbs->epsd == 5 && W_CheckNumForName(DEH_String("D_SG2INT")) != -1) + S_ChangeMusic(mus_sg2int, true); else S_ChangeMusic(mus_inter, true); } From 589b56f7234dc1336cbc1e75a5d7428804e7e010 Mon Sep 17 00:00:00 2001 From: Michael Day Date: Sun, 24 Dec 2023 21:23:26 -0500 Subject: [PATCH 3/4] doom: next level key supports Sigil II --- src/doom/m_menu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c index b3a4b31b4d..b0e11d1405 100644 --- a/src/doom/m_menu.c +++ b/src/doom/m_menu.c @@ -2169,12 +2169,13 @@ static int G_ReloadLevel(void) static int G_GotoNextLevel(void) { - byte doom_next[5][9] = { + byte doom_next[6][9] = { {12, 13, 19, 15, 16, 17, 18, 21, 14}, {22, 23, 24, 25, 29, 27, 28, 31, 26}, {32, 33, 34, 35, 36, 39, 38, 41, 37}, {42, 49, 44, 45, 46, 47, 48, 51, 43}, - {52, 53, 54, 55, 56, 59, 58, 11, 57}, + {52, 53, 54, 55, 56, 59, 58, 61, 57}, + {62, 63, 69, 65, 66, 67, 68, 11, 64}, }; byte doom2_next[33] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, @@ -2217,8 +2218,13 @@ static int G_GotoNextLevel(void) if (gamemode == registered) doom_next[2][7] = 11; - if (!crispy->haved1e5) + // [crispy] Sigil and Sigil II + if (!crispy->haved1e5 && !crispy->haved1e6) doom_next[3][7] = 11; + else if (!crispy->haved1e5 && crispy->haved1e6) + doom_next[3][7] = 61; + else if (crispy->haved1e5 && !crispy->haved1e6) + doom_next[4][7] = 11; if (gameversion == exe_chex) { From e1dc4d5eae9f1fe78f84b899088d869aad628fdc Mon Sep 17 00:00:00 2001 From: Michael Day Date: Sun, 24 Dec 2023 21:25:32 -0500 Subject: [PATCH 4/4] doom: properly init Sigil II music --- src/doom/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c index 2bdb69cdc8..23a1379ddd 100644 --- a/src/doom/s_sound.c +++ b/src/doom/s_sound.c @@ -294,7 +294,7 @@ void S_Init(int sfxVolume, int musicVolume) I_AtExit(S_Shutdown, true); // [crispy] initialize dedicated music tracks for the 4th episode - for (i = mus_e4m1; i <= mus_e5m9; i++) + for (i = mus_e4m1; i <= mus_e6m9; i++) { musicinfo_t *const music = &S_music[i]; char namebuf[9];