From bb9d492db6ae19e76b022f749612adf1daae94cf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 2 May 2021 14:01:10 +0200 Subject: [PATCH] - migrated RRRA as well. --- source/core/mapinfo.h | 2 +- source/core/screenjob.cpp | 4 +- source/games/duke/src/player_r.cpp | 5 +- source/games/duke/src/premap.cpp | 17 +-- source/games/duke/src/premap_r.cpp | 4 +- .../redneck.ridesagain/engine/rmapinfo.txt | 120 ++++++++++++++++++ .../static/filter/redneck/engine/engine.def | 37 ------ .../static/zscript/games/duke/ui/cutscenes.zs | 31 +++-- 8 files changed, 146 insertions(+), 74 deletions(-) create mode 100644 wadsrc/static/filter/redneck.ridesagain/engine/rmapinfo.txt delete mode 100644 wadsrc/static/filter/redneck/engine/engine.def diff --git a/source/core/mapinfo.h b/source/core/mapinfo.h index d12ffb783..cce27cf8c 100644 --- a/source/core/mapinfo.h +++ b/source/core/mapinfo.h @@ -150,7 +150,7 @@ struct MapRecord // game specific stuff int rr_startsound = 0; - int rr_mamaspawn = 5; + int rr_mamaspawn = 15; const char* LabelName() const { diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index 9771ce3a6..1c5bd0597 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -473,7 +473,7 @@ void ShowIntermission(MapRecord* fromMap, MapRecord* toMap, SummaryInfo* info, C { if (!fromMap->outro.Create(runner, fromMap, !!toMap)) { - if (fromcluster != nullptr && !fromcluster->outro.Create(runner, fromMap, !!toMap)) + if (fromcluster == nullptr || !fromcluster->outro.Create(runner, fromMap, !!toMap)) globalCutscenes.DefaultMapOutro.Create(runner, fromMap, !!toMap); } @@ -485,7 +485,7 @@ void ShowIntermission(MapRecord* fromMap, MapRecord* toMap, SummaryInfo* info, C { if (!toMap->intro.Create(runner, toMap, !!fromMap)) { - if (tocluster != nullptr && !tocluster->intro.Create(runner, toMap, !!fromMap)) + if (tocluster == nullptr || !tocluster->intro.Create(runner, toMap, !!fromMap)) globalCutscenes.DefaultMapIntro.Create(runner, toMap, !!fromMap); } globalCutscenes.LoadingScreen.Create(runner, toMap, true); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 148df22b6..a0a84fc31 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3382,9 +3382,8 @@ void processinput_r(int snum) psectlotag = 2; } } - else if (psectlotag == 7777) - if (currentLevel->levelNumber == makelevelnum(1, 6)) - lastlevel = 1; + else if (psectlotag == 7777 && (currentLevel->gameflags & LEVEL_RR_HULKSPAWN)) + lastlevel = 1; if (psectlotag == 848 && sector[psect].floorpicnum == WATERTILE2) psectlotag = 1; diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index b5aebdc50..c714b2316 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -671,19 +671,7 @@ void prelevel_common(int g) WindDir = 0; fakebubba_spawn = 0; RRRA_ExitedLevel = 0; - mamaspawn_count = 15; - /* todo - if (ud.level_number != 3 || ud.volume_number != 0) { - if (ud.level_number == 2 && ud.volume_number == 1) - mamaspawn_count = 10; - else if (ud.level_number == 6 && ud.volume_number == 1) - mamaspawn_count = 15; - else if (ud.level_number == 4 && ud.volume_number == 1) - ps[myconnectindex].moonshine_amount = 0; - } else - mamaspawn_count = 5; - */ - + mamaspawn_count = currentLevel->rr_mamaspawn; BellTime = 0; BellSprite = nullptr; @@ -919,8 +907,7 @@ void enterlevel(MapRecord *mi, int gamemode) resetinventory(i); clearweapon = true; } - if (clearweapon || (isRRRA() && currentLevel->mapindex == 3 && currentLevel->cluster == 1) - || (!isRRRA() && currentLevel->mapindex == 2 && currentLevel->cluster == 2)) + if (clearweapon) { resetweapons(i); ps[i].gotweapon.Clear(PISTOL_WEAPON); diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index ca85c3083..cb86ffc62 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -431,11 +431,11 @@ void prelevel_r(int g) prelevel_common(g); p = &ps[screenpeek]; + if (currentLevel->gameflags & LEVEL_RR_CLEARMOONSHINE) + ps[myconnectindex].steroids_amount = 0; if (isRRRA()) { - if (currentLevel->levelNumber == makelevelnum(1, 4)) - ps[myconnectindex].steroids_amount = 0; for (j = 0; j < MAXSPRITES; j++) { diff --git a/wadsrc/static/filter/redneck.ridesagain/engine/rmapinfo.txt b/wadsrc/static/filter/redneck.ridesagain/engine/rmapinfo.txt new file mode 100644 index 000000000..bd8cda805 --- /dev/null +++ b/wadsrc/static/filter/redneck.ridesagain/engine/rmapinfo.txt @@ -0,0 +1,120 @@ +// Cutscene definitions for RR + +cluster 2 +{ + outro + { + function = RRCutscenes.BuildRAE2End + } +} + +map { 1, 1 } +{ + interbackground = "LEVELMAP01" + rr_startsound = 63 +} + +map { 1, 2 } +{ + interbackground = "LEVELMAP02" + rr_startsound = 64 +} + +map { 1, 3 } +{ + interbackground = "LEVELMAP03" + rr_startsound = 77 + clearweapons +} + +map { 1, 4 } +{ + interbackground = "LEVELMAP04" + rr_startsound = 80 + rr_mamaspawn = 5 +} + +map { 1, 5 } +{ + interbackground = "LEVELMAP05" + rr_startsound = 102 + PrecacheTextures = "#02577" +} + +map { 1, 6 } +{ + interbackground = "LEVELMAP06" + rr_startsound = 103 +} + +map { 1, 7 } +{ + interbackground = "LEVELMAP07" + rr_startsound = 104 +} + +map { 2, 1 } +{ + interbackground = "LEVELMAP08" + rr_startsound = 105 +} + +map { 2, 2 } +{ + interbackground = "LEVELMAP09" + rr_startsound = 176 + clearweapons +} + +map { 2, 3 } +{ + interbackground = "LEVELMAP10" + rr_startsound = 177 + rr_mamaspawn = 10 +} + +map { 2, 4 } +{ + interbackground = "LEVELMAP11" + rr_startsound = 198 +} + +map { 2, 5 } +{ + interbackground = "LEVELMAP12" + rr_startsound = 230 + rr_clearmoonshine +} + +map { 2, 6 } +{ + interbackground = "LEVELMAP13" + rr_startsound = 255 +} + +map { 2, 7 } +{ + interbackground = "LEVELMAP14" + rr_startsound = 283 + rrra_hulkspawn + PrecacheTextures = "UFO1_RRRA", "UFO2", "UFO3", "UFO4", "UFO5" +} + +cutscenes +{ + loadscreen + { + function = DukeCutscenes.BuildLoading // identical with Duke's + } + defaultmapintro + { + function = RRCutscenes.BuildMapIntro // this plays the 'travel' animation. + transitiononly + } +} + +gameinfo +{ + summaryscreen = RRCutscenes.BuildSPSummary + mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's +} diff --git a/wadsrc/static/filter/redneck/engine/engine.def b/wadsrc/static/filter/redneck/engine/engine.def deleted file mode 100644 index 23d74da39..000000000 --- a/wadsrc/static/filter/redneck/engine/engine.def +++ /dev/null @@ -1,37 +0,0 @@ -// Cutscene definitions for RR -/* -definecutscene intro -{ - function RRCutscenes.BuildIntro -} - -definecutscene episode 1 -{ - outro - { - function RRCutscenes.BuildE1End - } -} - -definecutscene episode 2 -{ - outro - { - function RRCutscenes.BuildE2End - } -} - -definecutscene mapintro -{ - function RRCutscenes.BuildMapIntro // this plays the 'travel' animation. - transitiononly -} - -definecutscene loading -{ - function DukeCutscenes.BuildLoading // identical with Duke's -} - -definecutscene summary RRCutscenes.BuildSPSummary -definecutscene mpsummary DukeCutscenes.BuildMPSummary // identical with Duke's -*/ \ No newline at end of file diff --git a/wadsrc/static/zscript/games/duke/ui/cutscenes.zs b/wadsrc/static/zscript/games/duke/ui/cutscenes.zs index 6909a46ac..690427294 100644 --- a/wadsrc/static/zscript/games/duke/ui/cutscenes.zs +++ b/wadsrc/static/zscript/games/duke/ui/cutscenes.zs @@ -319,17 +319,21 @@ class RRCutscenes static void BuildE2End(ScreenJobRunner runner) { - if (!Raze.isRRRA()) - { - Array soundinfo; - soundinfo.Pushv(1, RRSnd.LN_FINAL + 1); - runner.Append(MoviePlayerJob.CreateWithSoundinfo("rr_outro.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 9, 9, 9)); - runner.Append(ImageScreen.CreateNamed("TENSCREEN")); - } - else - { - runner.Append(new("RRRAEndOfGame").Init()); - } + Array soundinfo; + soundinfo.Pushv(1, RRSnd.LN_FINAL + 1); + runner.Append(MoviePlayerJob.CreateWithSoundinfo("rr_outro.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 9, 9, 9)); + runner.Append(ImageScreen.CreateNamed("TENSCREEN")); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildRAE2End(ScreenJobRunner runner) + { + runner.Append(new("RRRAEndOfGame").Init()); } //--------------------------------------------------------------------------- @@ -351,13 +355,12 @@ class RRCutscenes static void BuildMapIntro(ScreenJobRunner runner, MapRecord map) { - if (!raze.isRRRA()) return; - int ln = map.levelnumber; + int ln = map.levelnumber - 1; if (ln == 0) return; if (ln >= 1000) ln -= 1000-7; let fn = String.Format("lvl%d.anm", ln); Array soundinfo; - runner.Append(MoviePlayerJob.CreateWithSoundinfo(fn, soundinfo, 0, 20, 20, 7200)); // wait for one minute on the final frame so that the video doesn't stop before the user notices. + runner.Append(MoviePlayerJob.CreateWithSoundinfo(fn, soundinfo, 0, 20, 20, 2000)); // wait for a few seconds on the final frame so that the video doesn't stop before the user notices. } } \ No newline at end of file