From d47eb2f1e3abb6762d8d6e0f36826d35ef75fa2f Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sun, 20 Oct 2024 13:58:22 +0200 Subject: [PATCH] Add support for E1M4B and E1M8B as part of Wadfusion. --- language.version | 4 ++-- vanilladoom.lst | 3 +++ zscript/compat/swwm_compat.zsc | 25 ++++++++++++++++++++ zscript/handler/swwm_handler_vanillaboss.zsc | 7 ++++-- zscript/handler/swwm_handler_worldload.zsc | 1 + zscript/swwm_thinkers_player.zsc | 22 ++++++++++++++++- 6 files changed, 57 insertions(+), 5 deletions(-) diff --git a/language.version b/language.version index fca59f872..82f3c3fee 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1156 \cu(Mon Oct 7 10:51:27 CEST 2024)\c-"; -SWWM_SHORTVER="\cw1.3pre r1156 \cu(2024-10-07 10:51:27)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1157 \cu(Sun Oct 20 13:58:22 CEST 2024)\c-"; +SWWM_SHORTVER="\cw1.3pre r1157 \cu(2024-10-20 13:58:22)\c-"; diff --git a/vanilladoom.lst b/vanilladoom.lst index c69cd3df3..ed466ea67 100644 --- a/vanilladoom.lst +++ b/vanilladoom.lst @@ -65,6 +65,9 @@ F6EE16F770AD309D608EA0B1F1E249FC F951882CB5A8DEF910F0ED966A1054C5 FB564DF28BC8D4BF70F60FB3256BCF9D FE97DCB9E6235FB3C52AE7C143160D73 +# E1M4B + E1M8B +1D80B17F6283346D35EDB86CD684C4D3 +A1F105211112747EE50BA520462A471E # DOOM II 0BB515B79E0A6C42C4846C4E6F5F1D73 0D491365C1B88B7D1B603890100DD03E diff --git a/zscript/compat/swwm_compat.zsc b/zscript/compat/swwm_compat.zsc index d9e8dbd0b..2533f99e4 100644 --- a/zscript/compat/swwm_compat.zsc +++ b/zscript/compat/swwm_compat.zsc @@ -86,6 +86,31 @@ Class SWWMLevelCompatibility : LevelPostProcessor for ( int i=118; i<=125; i++ ) SetThingEdNum(i,0); break; + case 'A1F105211112747EE50BA520462A471E': + { + // E1M8B + level.nextsecretmap = level.nextmap; // so the handler can detect this + level.nextmap = "E2M1"; + // no damage in exit sector + SetSectorSpecial(538,0); + // paint it black + for ( int i=1; i<4; i++ ) + level.Sectors[538].SetSpecialColor(i,"Black"); + // teleport sequence + static const int exitlines[] = + { + 3048, 3055, 3073, + 3074, 3075, 3076, + 3077, 3078, 3079, + 3080, 3081, 3082 + }; + for ( int i=0; i<12; i++ ) + SetLineSpecial(exitlines[i],ACS_Execute,-Int('E1M8_KNOCKOUT')); + // remove enemies + for ( int i=183; i<=190; i++ ) + SetThingEdNum(i,0); + break; + } // Doom E2M8 case 'EFFE91DF41AD41F6973C06F0AD67DDB9': level.nextsecretmap = level.nextmap; // so the handler can detect this diff --git a/zscript/handler/swwm_handler_vanillaboss.zsc b/zscript/handler/swwm_handler_vanillaboss.zsc index 71c51ab27..ee3440a4a 100644 --- a/zscript/handler/swwm_handler_vanillaboss.zsc +++ b/zscript/handler/swwm_handler_vanillaboss.zsc @@ -123,7 +123,8 @@ extend Class SWWMHandler MAP_HMAP40, MAP_HMAP60, MAP_EVMAP30, // eviternity - MAP_EVIIMAP30 // eviternity 2 + MAP_EVIIMAP30, // eviternity 2 + MAP_DE1M8B // "tech gone bad" }; static play void AddBoss( int tid, String tag, bool endgame = false ) @@ -178,6 +179,8 @@ extend Class SWWMHandler || (mapsum ~== "97079958C7E89C1908890730B8B9FEB7") || (mapsum ~== "058FB092EA1B70DA1E3CBF501C4A91A1") ) return MAP_DE1M8; + if ( mapsum ~== "A1F105211112747EE50BA520462A471E" ) + return MAP_DE1M8B; if ( mapsum ~== "EFFE91DF41AD41F6973C06F0AD67DDB9" ) return MAP_DE2M8; if ( mapsum ~== "EF128313112110ED6C1549AF96AF26C9" ) @@ -239,7 +242,7 @@ extend Class SWWMHandler private void VanillaBossSpawn( WorldEvent e ) { if ( bossmap == -1 ) bossmap = WhichVanillaBossMap(); - if ( bossmap == MAP_DE1M8 ) + if ( (bossmap == MAP_DE1M8) || (bossmap == MAP_DE1M8B) ) { if ( e.Thing is 'BaronOfHell' ) { diff --git a/zscript/handler/swwm_handler_worldload.zsc b/zscript/handler/swwm_handler_worldload.zsc index caf2c6ad3..54221ba08 100644 --- a/zscript/handler/swwm_handler_worldload.zsc +++ b/zscript/handler/swwm_handler_worldload.zsc @@ -251,6 +251,7 @@ extend Class SWWMHandler switch ( whichboss ) { case MAP_DE1M8: + case MAP_DE1M8B: SendInterfaceEvent(consoleplayer,"swwmsetdialogue.PHOBOS"); break; case MAP_DE2M8: diff --git a/zscript/swwm_thinkers_player.zsc b/zscript/swwm_thinkers_player.zsc index f2aa6e226..3997d60cd 100644 --- a/zscript/swwm_thinkers_player.zsc +++ b/zscript/swwm_thinkers_player.zsc @@ -234,11 +234,31 @@ Class SWWMStats : SWWMStaticThinker || (li.cluster != level.cluster) || FindLevelStats(li.mapname) ) continue; + // wadfusion hack for E1M4B and E1M8B + bool wf_hack = false; + if ( (li.mapname == "E1M4") && LevelInfo.MapExists("E1M4B") ) + { + let cv = CVar.GetCVar("wf_blackroomswap_e1m4b"); + if ( cv && cv.GetBool() ) + { + wf_hack = true; + li = LevelInfo.FindLevelInfo("E1M4B"); + } + } + else if ( (li.mapname == "E1M8") && LevelInfo.MapExists("E1M8B") ) + { + let cv = CVar.GetCVar("wf_blackroomswap_e1m8b"); + if ( cv && cv.GetBool() ) + { + wf_hack = true; + li = LevelInfo.FindLevelInfo("E1M8B"); + } + } let ls = new("LevelStat"); // we can automatically assume that all levels from the same cluster will have this flag as well ls.hub = !!(level.clusterflags&level.CLUSTER_HUB); ls.visited = false; - ls.cluster = li.cluster; + ls.cluster = wf_hack?1:li.cluster; // force cluster to be 1 for Romero's extra maps ls.levelname = li.LookupLevelName(); // level name may contain trailing whitespace due to DEHACKED nonsense, so strip it ls.levelname.StripRight();