From aa148d602c00c4d1f0f9df60c8b8d889dfa86864 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Apr 2021 00:56:36 +0200 Subject: [PATCH] - scriptified SW's 2D screens. Compiles but not tested yet. --- source/games/blood/src/sbar.cpp | 2 +- source/games/duke/src/premap.cpp | 2 +- source/games/sw/all.cpp | 1 - source/games/sw/src/2d.cpp | 692 ----------------- source/games/sw/src/draw.cpp | 4 +- source/games/sw/src/game.cpp | 11 +- source/games/sw/src/game.h | 1 - source/games/sw/src/menus.cpp | 26 - source/games/sw/src/menus.h | 1 - source/games/sw/src/namelist.h | 48 ++ source/games/sw/src/sounds.cpp | 33 + source/games/sw/src/text.cpp | 18 - .../filter/shadowwarrior/engine/engine.def | 44 ++ wadsrc/static/zscript.txt | 2 + .../static/zscript/games/blood/ui/screens.zs | 23 + wadsrc/static/zscript/games/duke/dukegame.zs | 28 + wadsrc/static/zscript/games/duke/ui/menu.zs | 27 + .../static/zscript/games/duke/ui/screens.zs | 8 +- wadsrc/static/zscript/games/sw/swgame.zs | 713 ++++++++++++++++++ wadsrc/static/zscript/games/sw/ui/screens.zs | 591 +++++++++++++++ wadsrc/static/zscript/screenjob.zs | 5 +- 21 files changed, 1525 insertions(+), 755 deletions(-) delete mode 100644 source/games/sw/src/2d.cpp create mode 100644 wadsrc/static/filter/shadowwarrior/engine/engine.def create mode 100644 wadsrc/static/zscript/games/sw/swgame.zs create mode 100644 wadsrc/static/zscript/games/sw/ui/screens.zs diff --git a/source/games/blood/src/sbar.cpp b/source/games/blood/src/sbar.cpp index 952e40ab8..8fb20dcc7 100644 --- a/source/games/blood/src/sbar.cpp +++ b/source/games/blood/src/sbar.cpp @@ -218,7 +218,7 @@ private: stats.font = SmallFont; stats.letterColor = CR_DARKRED; stats.standardColor = CR_DARKGRAY; - stats.time = Scale(gFrameCount, 1000, kTicsPerSec); + stats.time = gFrameCount / GameTicRate; if (automapMode == am_full) { diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 7908cb417..ca78eeab5 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -1052,7 +1052,7 @@ void exitlevel(MapRecord* nextlevel) info.maxkills = ps[0].max_actors_killed; info.secrets = ps[0].secret_rooms; info.maxsecrets = ps[0].max_secret_rooms; - info.time = ps[0].player_par; + info.time = ps[0].player_par / GameTicRate; info.endofgame = endofgame; Mus_Stop(); diff --git a/source/games/sw/all.cpp b/source/games/sw/all.cpp index 8087a4922..6ff08afb9 100644 --- a/source/games/sw/all.cpp +++ b/source/games/sw/all.cpp @@ -1,4 +1,3 @@ -#include "src/2d.cpp" #include "src/actor.cpp" #include "src/ai.cpp" #include "src/break.cpp" diff --git a/source/games/sw/src/2d.cpp b/source/games/sw/src/2d.cpp deleted file mode 100644 index 372d43383..000000000 --- a/source/games/sw/src/2d.cpp +++ /dev/null @@ -1,692 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 1997, 2005 - 3D Realms Entertainment - -This file is part of Shadow Warrior version 1.2 - -Shadow Warrior is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -Original Source: 1997 - Frank Maddin and Jim Norwood -Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms -*/ -//------------------------------------------------------------------------- - -#include "ns.h" -#include "screenjob.h" -#include "game.h" -#include "sounds.h" -#include "v_draw.h" -#include "menus.h" -#include "gamecontrol.h" -#include "mapinfo.h" -#include "misc.h" -#include "network.h" -#include "pal.h" - - -BEGIN_SW_NS - -#if 0 -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -class DSWDRealmsScreen : public DSkippableScreenJob -{ -public: - DSWDRealmsScreen() : DSkippableScreenJob(fadein | fadeout) {} - - void OnTick() override - { - if (ticks > 5 * GameTicRate) state = finished; - } - - void Draw(double) override - { - const auto tex = tileGetTexture(THREED_REALMS_PIC, true); - const int translation = TRANSLATION(Translation_BasePalettes, DREALMSPAL); - - twod->ClearScreen(); - DrawTexture(twod, tex, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - } -}; -#endif - - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -void Logo(const CompletionFunc& completion) -{ -#if 0 - StopSound(); - PlaySong(nullptr, ThemeSongs[0], ThemeTrack[0]); - - static const AnimSound logosound[] = - { - { 1, DIGI_NOMESSWITHWANG }, - { 5, DIGI_INTRO_SLASH }, - { 15, DIGI_INTRO_WHIRL }, - { -1, -1 } - }; - static const int logoframetimes[] = { 360, 8, 128 }; - - if (!userConfig.nologo) - { - TArray jobs; - jobs.Push(Create()); - jobs.Push(PlayVideo("sw.anm", logosound, logoframetimes, true)); - RunScreenJob(jobs, completion, SJ_BLOCKUI); - } - else completion(false); -#endif -} - -#if 0 - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -DScreenJob* GetFinishAnim(int num) -{ - static const AnimSound serpsound[] = - { - { 1, DIGI_SERPTAUNTWANG }, - { 16, DIGI_SHAREND_TELEPORT }, - { 35, DIGI_WANGTAUNTSERP1 }, - { 51, DIGI_SHAREND_UGLY1 }, - { 64, DIGI_SHAREND_UGLY2 }, - { -1, -1 } - }; - static const int serpzillaframetimes[] = { 16, 16, 140 }; - - static const AnimSound sumosound[] = - { - { 2, DIGI_JG41012 }, - { 30, DIGI_HOTHEADSWITCH }, - { 42, DIGI_HOTHEADSWITCH }, - { 59, DIGI_JG41028 }, - { -1, -1 } - }; - static const int sumoframetimes[] = { 40, 10, 130 }; - - static const AnimSound zillasound[] = - { - { 1, DIGI_ZC1 }, - { 5, DIGI_JG94024 }, - { 14, DIGI_ZC2 }, - { 30, DIGI_ZC3 }, - { 32, DIGI_ZC4 }, - { 37, DIGI_ZC5 }, - { 63, DIGI_Z16043 }, - { 63, DIGI_ZC6 }, - { 63, DIGI_ZC7 }, - { 72, DIGI_ZC7 }, - { 73, DIGI_ZC4 }, - { 77, DIGI_ZC5 }, - { 87, DIGI_ZC8 }, - { 103, DIGI_ZC7 }, - { 108, DIGI_ZC9 }, - { 120, DIGI_JG94039 }, - { -1, -1 } - }; - - static const char* const ANIMname[] = - { - "swend.anm", - "sumocinm.anm", - "zfcin.anm", - }; - - switch (num) - { - case ANIM_SERP: return PlayVideo("swend.anm", serpsound, serpzillaframetimes); - case ANIM_SUMO: return PlayVideo("sumocinm.anm", sumosound, sumoframetimes); - case ANIM_ZILLA:return PlayVideo("zfcin.anm", zillasound, serpzillaframetimes); - default: return nullptr; - } -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -class DSWCreditsScreen : public DSkippableScreenJob -{ - enum - { - CREDITS1_PIC = 5111, - CREDITS2_PIC = 5118 - }; - int state = 0; - int starttime; - int curpic; - - void Skipped() override - { - StopSound(); - } - - void Start() override - { - // Lo Wang feel like singing! - PlaySound(DIGI_JG95012, v3df_none, CHAN_VOICE, CHANF_UI); - } - - void OnTick() override - { - if (state == 0) - { - if (!soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE)) - { - starttime = ticks; - state = 1; - StopSound(); - curpic = CREDITS1_PIC; - - // try 14 then 2 then quit - if (!PlaySong(nullptr, ThemeSongs[5], ThemeTrack[5], true)) - { - PlaySong(nullptr, nullptr, 2, true); - } - } - } - else - { - if (ticks >= starttime + 8 * GameTicRate) - { - curpic = CREDITS1_PIC + CREDITS2_PIC - curpic; - starttime = ticks; - } - } - } - - void Draw(double) override - { - twod->ClearScreen(); - if (state == 1) - DrawTexture(twod, tileGetTexture(curpic, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - } -}; -#endif -//--------------------------------------------------------------------------- -// -// Summary screen -// -//--------------------------------------------------------------------------- - -static int BonusPunchSound(short) -{ - PlaySound(DIGI_PLAYERYELL3, v3df_none); - return 0; -} - -static int BonusKickSound(short) -{ - PlaySound(DIGI_PLAYERYELL2, v3df_none); - return 0; -} - -static int BonusGrabSound(short) -{ - PlaySound(DIGI_BONUS_GRAB, v3df_none); - return 0; -} - - -enum -{ - BONUS_SCREEN_PIC = 5120, - BONUS_ANIM = 5121, - BONUS_ANIM_FRAMES = (5159 - 5121), - - BREAK_LIGHT_RATE = 18, - - BONUS_PUNCH = 5121, - BONUS_KICK = 5136, - BONUS_GRAB = 5151, - BONUS_REST = 5121, - - BONUS_TICS = 8, - BONUS_GRAB_TICS = 20, - BONUS_REST_TICS = 50, -}; - -static STATE s_BonusPunch[] = -{ - {BONUS_PUNCH + 0, BONUS_TICS, NULL, &s_BonusPunch[1]}, - {BONUS_PUNCH + 1, BONUS_TICS, NULL, &s_BonusPunch[2]}, - {BONUS_PUNCH + 2, BONUS_TICS, NULL, &s_BonusPunch[3]}, - {BONUS_PUNCH + 2, 0 | SF_QUICK_CALL, BonusPunchSound, &s_BonusPunch[4]}, - {BONUS_PUNCH + 3, BONUS_TICS, NULL, &s_BonusPunch[5]}, - {BONUS_PUNCH + 4, BONUS_TICS, NULL, &s_BonusPunch[6]}, - {BONUS_PUNCH + 5, BONUS_TICS, NULL, &s_BonusPunch[7]}, - {BONUS_PUNCH + 6, BONUS_TICS, NULL, &s_BonusPunch[8]}, - {BONUS_PUNCH + 7, BONUS_TICS, NULL, &s_BonusPunch[9]}, - {BONUS_PUNCH + 8, BONUS_TICS, NULL, &s_BonusPunch[10]}, - {BONUS_PUNCH + 9, BONUS_TICS, NULL, &s_BonusPunch[11]}, - {BONUS_PUNCH + 10, BONUS_TICS, NULL, &s_BonusPunch[12]}, - {BONUS_PUNCH + 11, BONUS_TICS, NULL, &s_BonusPunch[13]}, - {BONUS_PUNCH + 12, BONUS_TICS, NULL, &s_BonusPunch[14]}, - {BONUS_PUNCH + 14, 90, NULL, &s_BonusPunch[15]}, - {BONUS_PUNCH + 14, BONUS_TICS, NULL, &s_BonusPunch[15]}, -}; - -static STATE s_BonusKick[] = -{ - {BONUS_KICK + 0, BONUS_TICS, NULL, &s_BonusKick[1]}, - {BONUS_KICK + 1, BONUS_TICS, NULL, &s_BonusKick[2]}, - {BONUS_KICK + 2, BONUS_TICS, NULL, &s_BonusKick[3]}, - {BONUS_KICK + 2, 0 | SF_QUICK_CALL, BonusKickSound, &s_BonusKick[4]}, - {BONUS_KICK + 3, BONUS_TICS, NULL, &s_BonusKick[5]}, - {BONUS_KICK + 4, BONUS_TICS, NULL, &s_BonusKick[6]}, - {BONUS_KICK + 5, BONUS_TICS, NULL, &s_BonusKick[7]}, - {BONUS_KICK + 6, BONUS_TICS, NULL, &s_BonusKick[8]}, - {BONUS_KICK + 7, BONUS_TICS, NULL, &s_BonusKick[9]}, - {BONUS_KICK + 8, BONUS_TICS, NULL, &s_BonusKick[10]}, - {BONUS_KICK + 9, BONUS_TICS, NULL, &s_BonusKick[11]}, - {BONUS_KICK + 10, BONUS_TICS, NULL, &s_BonusKick[12]}, - {BONUS_KICK + 11, BONUS_TICS, NULL, &s_BonusKick[13]}, - {BONUS_KICK + 12, BONUS_TICS, NULL, &s_BonusKick[14]}, - {BONUS_KICK + 14, 90, NULL, &s_BonusKick[15]}, - {BONUS_KICK + 14, BONUS_TICS, NULL, &s_BonusKick[15]}, -}; - -static STATE s_BonusGrab[] = -{ - {BONUS_GRAB + 0, BONUS_GRAB_TICS, NULL, &s_BonusGrab[1]}, - {BONUS_GRAB + 1, BONUS_GRAB_TICS, NULL, &s_BonusGrab[2]}, - {BONUS_GRAB + 2, BONUS_GRAB_TICS, NULL, &s_BonusGrab[3]}, - {BONUS_GRAB + 2, 0 | SF_QUICK_CALL, BonusGrabSound, &s_BonusGrab[4]}, - {BONUS_GRAB + 3, BONUS_GRAB_TICS, NULL, &s_BonusGrab[5]}, - {BONUS_GRAB + 4, BONUS_GRAB_TICS, NULL, &s_BonusGrab[6]}, - {BONUS_GRAB + 5, BONUS_GRAB_TICS, NULL, &s_BonusGrab[7]}, - {BONUS_GRAB + 6, BONUS_GRAB_TICS, NULL, &s_BonusGrab[8]}, - {BONUS_GRAB + 7, BONUS_GRAB_TICS, NULL, &s_BonusGrab[9]}, - {BONUS_GRAB + 8, BONUS_GRAB_TICS, NULL, &s_BonusGrab[10]}, - {BONUS_GRAB + 9, 90, NULL, &s_BonusGrab[11]}, - {BONUS_GRAB + 9, BONUS_GRAB_TICS, NULL, &s_BonusGrab[11]}, -}; - -static STATE s_BonusRest[] = -{ - {BONUS_REST + 0, BONUS_REST_TICS, NULL, &s_BonusRest[1]}, - {BONUS_REST + 1, BONUS_REST_TICS, NULL, &s_BonusRest[2]}, - {BONUS_REST + 2, BONUS_REST_TICS, NULL, &s_BonusRest[3]}, - {BONUS_REST + 1, BONUS_REST_TICS, NULL, &s_BonusRest[0]}, -}; - -static STATE * s_BonusAnim[] = -{ - s_BonusPunch, - s_BonusKick, - s_BonusGrab -}; - -#if 0 -class DSWLevelSummaryScreen : public DScreenJob -{ - int minutes, seconds, second_tics; - int nextclock = synctics; - STATE * State = s_BonusRest; - int Tics = 0; - -public: - DSWLevelSummaryScreen() - { - second_tics = (PlayClock / 120); - minutes = (second_tics / 60); - seconds = (second_tics % 60); - } -private: - - static void gNextState(STATE** State) - { - // Transition to the next state - *State = (*State)->NextState; - - if (TEST((*State)->Tics, SF_QUICK_CALL)) - { - (*(*State)->Animator)(0); - *State = (*State)->NextState; - } - } - - - // Generic state control - static void gStateControl(STATE** State, int* tics) - { - *tics += synctics; - - // Skip states if too much time has passed - while (*tics >= (*State)->Tics) - { - // Set Tics - *tics -= (*State)->Tics; - gNextState(State); - } - - // Call the correct animator - if ((*State)->Animator) - (*(*State)->Animator)(0); - } - - bool OnEvent(event_t* ev) override - { - if (ev->type == EV_KeyDown && !specialKeyEvent(ev)) - { - if (State >= s_BonusRest && State < &s_BonusRest[countof(s_BonusRest)]) - { - State = s_BonusAnim[STD_RANDOM_RANGE(countof(s_BonusAnim))]; - Tics = 0; - nextclock = ticks; - } - } - return true; - } - - void Start() override - { - FX_StopAllSounds(); - PlaySong(nullptr, ThemeSongs[1], ThemeTrack[1]); - } - - void OnTick() override - { - while (ticks > nextclock) - { - nextclock++; - gStateControl(&State, &Tics); - } - - if (State == State->NextState) - { - state = finished; - StopSound(); - } - } - - void Draw(double) override - { - twod->ClearScreen(); - DrawTexture(twod, tileGetTexture(BONUS_SCREEN_PIC, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - MNU_DrawString(160, 20, currentLevel->DisplayName(), 1, 19, 0); - MNU_DrawString(170, 30, GStrings("COMPLETED"), 1, 19, 0); - - DrawTexture(twod, tileGetTexture(State->Pic), 158, 86, DTA_FullscreenScale, FSMode_Fit320x200, - DTA_TopLeft, true, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - - auto BONUS_LINE = [](int i) { return (50 + ((i) * 20)); }; - - int line = 0; - FString ds; - ds.Format("%s %2d:%02d", GStrings("TXT_YOURTIME"), minutes, seconds); - MNU_DrawString(60, BONUS_LINE(line++), ds, 1, 16); - - if (currentLevel->designerTime > 0) - { - ds.Format("%s %d:%02d", GStrings("TXT_3DRTIME"), currentLevel->designerTime / 60, currentLevel->designerTime % 60); - MNU_DrawString(40, BONUS_LINE(line++), ds, 1, 16); - } - - if (currentLevel->parTime > 0) - { - ds.Format("%s %d:%02d", GStrings("TXT_PARTIME"), currentLevel->parTime / 60, currentLevel->parTime % 60); - MNU_DrawString(40, BONUS_LINE(line++), ds, 1, 16); - } - - // always read secrets and kills from the first player - ds.Format("%s: %d / %d", GStrings("TXT_SECRETS"), Player->SecretsFound, LevelSecrets); - MNU_DrawString(60, BONUS_LINE(line++), ds, 1, 16); - - ds.Format("%s: %d / %d", GStrings("KILLS"), Player->Kills, TotalKillable); - MNU_DrawString(60, BONUS_LINE(line), ds, 1, 16); - - MNU_DrawString(160, 185, GStrings("PRESSKEY"), 1, 19, 0); - } - -}; -#endif - -//--------------------------------------------------------------------------- -// -// Deathmatch summary screen -// -//--------------------------------------------------------------------------- - -static constexpr int SM_SIZ(int num) { return (num * 4); } - -enum -{ - STAT_SCREEN_PIC = 5114, - - STAT_START_X = 20, - STAT_START_Y = 85, - STAT_OFF_Y = 9, - STAT_HEADER_Y = 14, - STAT_TABLE_X = (STAT_START_X + SM_SIZ(15)), - STAT_TABLE_XOFF = SM_SIZ(6) -}; - -#if 0 -class DSWMultiSummaryScreen : public DSkippableScreenJob -{ - short death_total[MAX_SW_PLAYERS_REG]{}; - short kills[MAX_SW_PLAYERS_REG]{}; - - void Skipped() override - { - StopSound(); - } - - void Draw(double) override - { - if (clock == 0) PlaySong(nullptr, ThemeSongs[1], ThemeTrack[1]); - - twod->ClearScreen(); - DrawTexture(twod, tileGetTexture(STAT_SCREEN_PIC, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - MNU_DrawString(160, 68, GStrings("MULTIPLAYER TOTALS"), 0, 0); - MNU_DrawString(160, 189, GStrings("PRESSKEY"), 0, 0, 0); - - int x = STAT_START_X; - int y = STAT_START_Y; - - // Hm.... how to translate this without messing up the formatting? - MNU_DrawSmallString(x, y, " NAME 1 2 3 4 5 6 7 8 KILLS", 0, 0); - int rows = OrigCommPlayers; - int cols = OrigCommPlayers; - - y += STAT_HEADER_Y; - - FString ds; - for (int i = 0; i < rows; i++) - { - x = STAT_START_X; - auto pp = Player + i; - - ds.Format("%d", i + 1); - MNU_DrawSmallString(x, y, ds, 0, 0); - - ds.Format(" %-13s", pp->PlayerName); - MNU_DrawSmallString(x, y, ds, 0, User[pp->PlayerSprite]->spal); - - x = STAT_TABLE_X; - for (int j = 0; j < cols; j++) - { - int pal = 0; - death_total[j] += pp->KilledPlayer[j]; - - if (i == j) - { - // don't add kill for self or team player - pal = PALETTE_PLAYER0 + 4; - kills[i] -= pp->KilledPlayer[j]; // subtract self kills - } - else if (gNet.TeamPlay) - { - if (User[pp->PlayerSprite]->spal == User[Player[j].PlayerSprite]->spal) - { - // don't add kill for self or team player - pal = PALETTE_PLAYER0 + 4; - kills[i] -= pp->KilledPlayer[j]; // subtract self kills - } - else - kills[i] += pp->KilledPlayer[j]; // kills added here - } - else - { - kills[i] += pp->KilledPlayer[j]; // kills added here - } - - ds.Format("%d", pp->KilledPlayer[j]); - MNU_DrawSmallString(x, y, ds, 0, pal); - x += STAT_TABLE_XOFF; - } - - y += STAT_OFF_Y; - } - - - // Deaths - - x = STAT_START_X; - y += STAT_OFF_Y; - - ds.Format(" %s", GStrings("DEATHS")); - MNU_DrawSmallString(x, y, ds, 0, 0); - x = STAT_TABLE_X; - - for (int j = 0; j < cols; j++) - { - ds.Format("%d", death_total[j]); - MNU_DrawSmallString(x, y, ds, 0, 0); - x += STAT_TABLE_XOFF; - } - - x = STAT_START_X; - y += STAT_OFF_Y; - - // Kills - x = STAT_TABLE_X + SM_SIZ(50); - y = STAT_START_Y + STAT_HEADER_Y; - - for (int i = 0; i < rows; i++) - { - auto pp = Player + i; - - ds.Format("%d", kills[i]); //pp->Kills); - MNU_DrawSmallString(x, y, ds, 0, 0); - - y += STAT_OFF_Y; - } - } -}; -#endif - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -void StatScreen(int FinishAnim, CompletionFunc completion) -{ -#if 0 - TArray jobs; - - if (FinishAnim) - { - StopSound(); - jobs.Push(GetFinishAnim(FinishAnim)); - jobs.Push(Create()); - if (FinishAnim == ANIM_ZILLA) - jobs.Push(Create()); - } - else if (gNet.MultiGameType != MULTI_GAME_COMMBAT) - { - jobs.Push(Create()); - } - else - { - jobs.Push(Create()); - } - RunScreenJob(jobs, completion); -#endif -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -void SybexScreen(CompletionFunc completion) -{ -#if 0 - if (!SW_SHAREWARE || CommEnabled) completion(false); - else - { - TArray jobs(1, true); - jobs[0] = Create(tileGetTexture(5261), DScreenJob::fadein | DScreenJob::fadeout, 0x7fffffff); - RunScreenJob(jobs, completion, SJ_BLOCKUI); - } -#endif -} - -#if 0 -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -class DSWLoadScreen : public DScreenJob -{ - MapRecord* rec; - -public: - DSWLoadScreen(MapRecord* maprec) : DScreenJob(0), rec(maprec) {} - - void Draw(double) override - { - const int TITLE_PIC = 2324; - twod->ClearScreen(); - DrawTexture(twod, tileGetTexture(TITLE_PIC), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - - MNU_DrawString(160, 170, /*DemoMode ? GStrings("TXT_LBDEMO") :*/ GStrings("TXT_ENTERING"), 1, 16, 0); - MNU_DrawString(160, 180, rec->DisplayName(), 1, 16, 0); - } -}; - -void loadscreen(MapRecord* rec, CompletionFunc func) -{ - TArray jobs(1, true); - jobs[0] = Create(rec); - RunScreenJob(jobs, func); -} -#endif - -END_SW_NS diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index c384de81a..56b6baac5 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1699,7 +1699,9 @@ drawscreen(PLAYERp pp, double smoothratio) if (paused && !M_Active()) { - MNU_DrawString(160, 100, "Game Paused", 0, 0, 0); + auto str = GStrings("Game Paused"); + int w = SmallFont->StringWidth(str); + DrawText(twod, SmallFont, CR_UNDEFINED, 160-w, 100, str, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE); } if (!CommEnabled && TEST(pp->Flags, PF_DEAD)) diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index adc6cbd0e..2378deab5 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -154,7 +154,6 @@ FString ThemeSongs[6]; int ThemeTrack[6]; /// L O C A L P R O T O T Y P E S ///////////////////////////////////////////////////////// -void SybexScreen(void); ///////////////////////////////////////////////////////////////////////////////////////////// #define x(a, b) registerName(#a, b); @@ -256,12 +255,6 @@ void GameInterface::DrawBackground(void) twod->ClearScreen(); DrawTexture(twod, tileGetTexture(TITLE_PIC), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, DTA_Color, shadeToLight(20), TAG_DONE); - - if (CommEnabled) - { - MNU_DrawString(160, 170, "Lo Wang is waiting for other players...", 1, 16, 0); - MNU_DrawString(160, 180, "They are afraid!", 1, 16, 0); - } } //--------------------------------------------------------------------------- @@ -553,6 +546,8 @@ void GameInterface::LevelCompleted(MapRecord *map, int skill) StopSound(); STAT_Update(map == nullptr); +#if 0 + // else if (gNet.MultiGameType != MULTI_GAME_COMMBAT) StatScreen(FinishAnim, [=](bool) { if (map == nullptr) @@ -568,7 +563,7 @@ void GameInterface::LevelCompleted(MapRecord *map, int skill) } else gameaction = ga_nextlevel; }); - +#endif } //--------------------------------------------------------------------------- // diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 804525de2..cb50e24bb 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -77,7 +77,6 @@ extern GAME_SET gs; enum { DREALMSPAL = 1, - THREED_REALMS_PIC = 2325, MAXMIRRORS = 8, // This is just some, high, blank tile number not used diff --git a/source/games/sw/src/menus.cpp b/source/games/sw/src/menus.cpp index ef66a628e..4bf74c606 100644 --- a/source/games/sw/src/menus.cpp +++ b/source/games/sw/src/menus.cpp @@ -222,30 +222,4 @@ void DoPaletteFlash(PLAYERp pp) } - -bool MNU_ShareWareMessage() -{ - const char* extra_text; - short w, h; - - if (SW_SHAREWARE) - { - extra_text = "Be sure to call 800-3DREALMS today"; - MNU_DrawString(160, 110, extra_text, 1, 16, 0); - extra_text = "and order the game."; - MNU_DrawString(160, 120, extra_text, 1, 16, 0); - extra_text = "You are only playing the first "; - MNU_DrawString(160, 130, extra_text, 1, 16, 0); - extra_text = "four levels, and are missing most"; - MNU_DrawString(160, 140, extra_text, 1, 16, 0); - extra_text = "of the game, weapons and monsters."; - MNU_DrawString(160, 150, extra_text, 1, 16, 0); - extra_text = "See the ordering information."; - MNU_DrawString(160, 160, extra_text, 1, 16, 0); - //SET(item->flags, mf_disabled); - } - return true; -} - - END_SW_NS diff --git a/source/games/sw/src/menus.h b/source/games/sw/src/menus.h index 7105d669b..6ee40e181 100644 --- a/source/games/sw/src/menus.h +++ b/source/games/sw/src/menus.h @@ -32,7 +32,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS -void MNU_DrawString(int x, int y, const char* string, int shade, int pal, int align = -1); void MNU_DrawSmallString(int x, int y, const char* string, int shade, int pal, int align = -1, double alpha = 1); END_SW_NS diff --git a/source/games/sw/src/namelist.h b/source/games/sw/src/namelist.h index 30ffa5fc9..40809cc19 100644 --- a/source/games/sw/src/namelist.h +++ b/source/games/sw/src/namelist.h @@ -66,6 +66,7 @@ x(BLACK___, 2306) x(FragBarErase, 2375) x(FragBarErase2, 2376) x(MENUBAR, 2427) +x(THREED_REALMS_PIC, 2325) x(MIRROR, 340) x(FLOORMIRROR, 341) @@ -168,3 +169,50 @@ x(CREDITS2, 5118) x(SUPPORT, 4979) x(ONLINE, 5113) +x(STAT_SCREEN_PIC, 5114) +x(BONUS_SCREEN_PIC, 5120) + +x(BONUS_PUNCH00, 5121) +x(BONUS_PUNCH01, 5122) +x(BONUS_PUNCH02, 5123) +x(BONUS_PUNCH03, 5124) +x(BONUS_PUNCH04, 5125) +x(BONUS_PUNCH05, 5126) +x(BONUS_PUNCH06, 5127) +x(BONUS_PUNCH07, 5128) +x(BONUS_PUNCH08, 5129) +x(BONUS_PUNCH09, 5130) +x(BONUS_PUNCH10, 5131) +x(BONUS_PUNCH11, 5132) +x(BONUS_PUNCH12, 5133) +x(BONUS_PUNCH13, 5134) +x(BONUS_PUNCH14, 5135) + +x(BONUS_KICK00, 5136) +x(BONUS_KICK01, 5137) +x(BONUS_KICK02, 5138) +x(BONUS_KICK03, 5139) +x(BONUS_KICK04, 5140) +x(BONUS_KICK05, 5141) +x(BONUS_KICK06, 5142) +x(BONUS_KICK07, 5143) +x(BONUS_KICK08, 5144) +x(BONUS_KICK09, 5145) +x(BONUS_KICK10, 5146) +x(BONUS_KICK11, 5147) +x(BONUS_KICK12, 5148) +x(BONUS_KICK13, 5149) +x(BONUS_KICK14, 5150) + +x(BONUS_GRAB00, 5151) +x(BONUS_GRAB01, 5152) +x(BONUS_GRAB02, 5153) +x(BONUS_GRAB03, 5154) +x(BONUS_GRAB04, 5155) +x(BONUS_GRAB05, 5156) +x(BONUS_GRAB06, 5157) +x(BONUS_GRAB07, 5158) +x(BONUS_GRAB08, 5159) +x(BONUS_GRAB09, 5160) + +x(TITLE_PIC, 2324) diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index 8d0a364b3..16ce58cf3 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -48,6 +48,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "serializer.h" #include "gamecontrol.h" #include "gamestate.h" +#include "vm.h" BEGIN_SW_NS @@ -981,5 +982,37 @@ void StopFX() if (soundEngine) soundEngine->StopAllChannels(); } +DEFINE_ACTION_FUNCTION(_SW, PlaySound) +{ + PARAM_PROLOGUE; + PARAM_INT(sound); + PARAM_INT(vflags); + PARAM_INT(channel); + PARAM_INT(cflags); + PlaySound(sound, Voc3D_Flags(vflags), channel, EChanFlags::FromInt(cflags)); + return 0; +} + +DEFINE_ACTION_FUNCTION_NATIVE(_SW, StopSound, StopSound) +{ + StopSound(); + return 0; +} + +DEFINE_ACTION_FUNCTION(_SW, IsSoundPlaying) +{ + PARAM_PROLOGUE; + PARAM_INT(channel); + ACTION_RETURN_BOOL(soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, channel)); + +} + +DEFINE_ACTION_FUNCTION(_SW, PlaySong) +{ + PARAM_PROLOGUE; + PARAM_INT(song); + PlaySong(nullptr, ThemeSongs[song], ThemeTrack[song], true); + return 0; +} END_SW_NS diff --git a/source/games/sw/src/text.cpp b/source/games/sw/src/text.cpp index 751e0ee3a..53d806abc 100644 --- a/source/games/sw/src/text.cpp +++ b/source/games/sw/src/text.cpp @@ -108,24 +108,6 @@ void InitFonts() // //--------------------------------------------------------------------------- -void MNU_DrawString(int x, int y, const char* string, int shade, int pal, int align) -{ - if (align > -1) - { - int w = SmallFont->StringWidth(string); - if (align == 0) x -= w / 2; - else x -= w; - } - DrawText(twod, SmallFont, CR_UNDEFINED, x, y, string, DTA_FullscreenScale, FSMode_Fit320x200, - DTA_Color, shadeToLight(shade), DTA_TranslationIndex, TRANSLATION(Translation_Remap, pal), TAG_DONE); -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void MNU_DrawSmallString(int x, int y, const char* string, int shade, int pal, int align, double alpha) { if (align > -1) diff --git a/wadsrc/static/filter/shadowwarrior/engine/engine.def b/wadsrc/static/filter/shadowwarrior/engine/engine.def new file mode 100644 index 000000000..f9e05669e --- /dev/null +++ b/wadsrc/static/filter/shadowwarrior/engine/engine.def @@ -0,0 +1,44 @@ +// Cutscene definitions for Duke + +definecutscene intro +{ + function SWCutscenes.BuildIntro +} + +definecutscene map "$woods" +{ + outro + { + function SWCutscenes.BuildSerpentAnim + } +} + +definecutscene map "$plax1" +{ + outro + { + function SWCutscenes.BuildSumoAnim + } +} + +definecutscene map "$volcano" +{ + outro + { + function SWCutscenes.BuildZillaAnim + } +} + +definecutscene sharewareend +{ + function SWCutscenes.BuildSybexScreen +} + +definecutscene loading +{ + function SWCutscenes.BuildLoading +} + +definecutscene summary SWCutscenes.BuildSPSummary +definecutscene mpsummary SWCutscenes.BuildMPSummary + diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 32b768850..6a79ab679 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -36,5 +36,7 @@ version "4.3" #include "zscript/games/blood/bloodgame.zs" #include "zscript/games/blood/ui/menu.zs" #include "zscript/games/blood/ui/screens.zs" +#include "zscript/games/sw/swgame.zs" #include "zscript/games/sw/ui/menu.zs" +#include "zscript/games/sw/ui/screens.zs" #include "zscript/games/exhumed/ui/menu.zs" diff --git a/wadsrc/static/zscript/games/blood/ui/screens.zs b/wadsrc/static/zscript/games/blood/ui/screens.zs index 95eef9622..99a4933ca 100644 --- a/wadsrc/static/zscript/games/blood/ui/screens.zs +++ b/wadsrc/static/zscript/games/blood/ui/screens.zs @@ -1,3 +1,26 @@ +//------------------------------------------------------------------------- +/* +Copyright (C) 2010-2019 EDuke32 developers and contributors +Copyright (C) 2019 Nuke.YKT +Copyright (C) 2019-2021 Christoph Oelckers + +This file is part of Raze. + +NBlood is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 2 +as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +//------------------------------------------------------------------------- class BloodIntroImage : ImageScreen diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index 7b40f78d3..e0e960b5e 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -1,3 +1,31 @@ +//------------------------------------------------------------------------- +/* +Copyright (C) 1996, 2003 - 3D Realms Entertainment +Copyright (C) 2020-2021 Christoph Oelckers + +This file is part of Raze. + +Duke Nukem 3D is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +aint with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +Original Source: 1996 - Todd Replogle +Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms +( not much left of the original code, though... ;) ) +*/ +//------------------------------------------------------------------------- + // contains all global Duke definitions struct Duke native { diff --git a/wadsrc/static/zscript/games/duke/ui/menu.zs b/wadsrc/static/zscript/games/duke/ui/menu.zs index 604624f96..fb701c7a7 100644 --- a/wadsrc/static/zscript/games/duke/ui/menu.zs +++ b/wadsrc/static/zscript/games/duke/ui/menu.zs @@ -1,3 +1,30 @@ +//------------------------------------------------------------------------- +/* +Copyright (C) 1996, 2003 - 3D Realms Entertainment +Copyright (C) 2020-2021 Christoph Oelckers + +This file is part of Raze. + +Duke Nukem 3D is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +aint with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +Original Source: 1996 - Todd Replogle +Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms +( not much left of the original code, though... ;) ) +*/ +//------------------------------------------------------------------------- class DukeMenuDelegate : RazeMenuDelegate { diff --git a/wadsrc/static/zscript/games/duke/ui/screens.zs b/wadsrc/static/zscript/games/duke/ui/screens.zs index c4030a162..d04bbb678 100644 --- a/wadsrc/static/zscript/games/duke/ui/screens.zs +++ b/wadsrc/static/zscript/games/duke/ui/screens.zs @@ -681,12 +681,12 @@ class DukeLevelSummaryScreen : SummaryScreenBase tempbuf = FormatTime(stats.time); Duke.GameText((320 >> 2) + 71, 59 + 9, tempbuf, 0); - tempbuf = FormatTime(level.parTime); + tempbuf = FormatTime(level.parTime / 26); // Build weirdness again... Duke.GameText((320 >> 2) + 71, 69 + 9, tempbuf, 0); if (!Raze.isNamWW2GI()) { - tempbuf = FormatTime(level.designerTime); + tempbuf = FormatTime(level.designerTime / 26); Duke.GameText((320 >> 2) + 71, 79 + 9, tempbuf, 0); } } @@ -911,10 +911,10 @@ class RRLevelSummaryScreen : SummaryScreenBase tempbuf = FormatTime(stats.time); Duke.BigText(191, 48, tempbuf, -1); - tempbuf = FormatTime(level.parTime); + tempbuf = FormatTime(level.parTime / 26); Duke.BigText(191, 64, tempbuf, -1); - tempbuf = FormatTime(level.designerTime); + tempbuf = FormatTime(level.designerTime / 26); Duke.BigText(191, 80, tempbuf, -1); } } diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs new file mode 100644 index 000000000..3c2f60179 --- /dev/null +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -0,0 +1,713 @@ +//------------------------------------------------------------------------- +/* +Copyright (C) 1997, 2005 - 3D Realms Entertainment +Copyright (C) 2019-2021 Christoph Oelckers + +This file is part of Raze + +Shadow Warrior is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +Original Source: 1997 - Frank Maddin and Jim Norwood +Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms +*/ +//------------------------------------------------------------------------- + +struct SW native +{ + enum ESWSoundFlag + { + v3df_none = 0, // Default, take no action, use all defaults + v3df_follow = 1, // 1 = Do coordinate updates on sound + // Use this only if the sprite won't be deleted soon + v3df_kill = 2, // 1 = Sound is to be deleted + v3df_doppler = 4, // 1 = Don't use doppler pitch variance + v3df_dontpan = 8, // 1 = Don't do panning of sound + v3df_ambient = 16, // 1 = Sound is ambient, use ambient struct info. + v3df_intermit = 32, // 1 = Intermittant sound + v3df_init = 64, // 1 = First pass of sound, don't play it. + // This is mainly used for intermittent sounds + v3df_nolookup = 128, // don't use ambient table lookup + } + + native static void PlaySound(int sound, int flags, int channel = CHAN_AUTO, int cflags = 0); + native static void StopSound(); + native static bool IsSoundPlaying(int channel); // soundEngine.IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE)) + native static void PlaySong(int trackid); + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void DrawString(int x, int y, String text, int shade, int pal, int align = -1) + { + if (align != -1) x -= SmallFont.StringWidth(text) * (align == 0 ? 0.5 : 1); + Screen.DrawText(SmallFont, Font.CR_UNDEFINED, x, y, text, DTA_FullscreenScale, FSMode_Fit320x200, + DTA_Color, Raze.shadeToLight(shade), DTA_TranslationIndex, Translation.MakeID(Translation_Remap, pal)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void DrawSmallString(int x, int y, String text, int shade, int pal, int align = -1, double alpha = 1.) + { + if (align != -1) x -= SmallFont2.StringWidth(text) * (align == 0 ? 0.5 : 1); + Screen.DrawText(SmallFont2, Font.CR_UNDEFINED, x, y, text, DTA_FullscreenScale, FSMode_Fit320x200, + DTA_Color, Raze.shadeToLight(shade), DTA_TranslationIndex, Translation.MakeID(Translation_Remap, pal), DTA_Alpha, alpha); + } + + +} + + +struct SWSnd native +{ + enum ESounds + { + DIGI_NULL= 0, + DIGI_SWORDSWOOSH= 1, + DIGI_STAR= 2, + DIGI_STARCLINK= 3, + DIGI_STARWIZ= 4, + DIGI_UZIFIRE= 5, + DIGI_RICHOCHET1= 6, + DIGI_RICHOCHET2= 7, + DIGI_REMOVECLIP= 8, + DIGI_REPLACECLIP= 9, + DIGI_SHELL= 10, + DIGI_RIOTFIRE= 11, + DIGI_RIOTFIRE2= 12, + DIGI_RIOTRELOAD= 13, + DIGI_BOLTEXPLODE= 14, + DIGI_BOLTWIZ= 15, + DIGI_30MMFIRE= 16, + DIGI_30MMRELOAD= 17, + DIGI_30MMEXPLODE= 18, + DIGI_30MMWIZ= 19, + DIGI_HEADFIRE= 20, + DIGI_HEADSHOTWIZ= 21, + DIGI_HEADSHOTHIT= 22, + DIGI_MINETHROW= 23, + DIGI_MINEBOUNCE= 24, + DIGI_MINEBLOW= 25, + DIGI_MINEBEEP= 26, + DIGI_HEARTBEAT= 27, + DIGI_HEARTFIRE= 28, + DIGI_HEARTWIZ= 29, + DIGI_MISSLFIRE= 30, + DIGI_MISSLEXP= 31, + DIGI_RFWIZ= 32, + DIGI_NAPFIRE= 33, + DIGI_NAPWIZ= 34, + DIGI_NAPPUFF= 35, + DIGI_MIRVFIRE= 36, + DIGI_MIRVWIZ= 37, + DIGI_SPIRALFIRE= 38, + DIGI_SPIRALWIZ= 39, + DIGI_MAGIC1= 40, + DIGI_MAGIC2= 41, + DIGI_MAGIC3= 42, + DIGI_MAGIC4= 43, + DIGI_MAGIC5= 44, + DIGI_MAGIC6= 45, + DIGI_MAGIC7= 46, + DIGI_SWCLOAKUNCLOAK= 47, + DIGI_DHVOMIT= 48, + DIGI_DHCLUNK= 49, + DIGI_DHSQUISH= 50, + DIGI_NULL_DHSQUISH= 50, + DIGI_PROJECTILELAVAHIT=51, + DIGI_PROJECTILEWATERHIT=52, + DIGI_KEY= 53, + DIGI_ITEM= 54, + DIGI_BIGITEM= 55, + DIGI_BODYFALL1= 56, + DIGI_HITGROUND= 57, + DIGI_BODYSQUISH1= 58, + DIGI_BODYBURN= 59, + DIGI_BODYBURNSCREAM= 60, + DIGI_BODYCRUSHED1= 61, + DIGI_BODYHACKED1= 62, + DIGI_BODYSINGED= 63, + DIGI_DROWN= 64, + DIGI_SCREAM1= 65, + DIGI_SCREAM2= 66, + DIGI_SCREAM3= 67, + DIGI_HIT1= 68, + DIGI_ELECTRICUTE1= 69, + DIGI_REMOVEME= 70, + DIGI_IMPALED= 71, + DIGI_OOF1= 72, + DIGI_ACTORBODYFALL1= 73, + IGI_ACTORHITGROUND= 74, + DIGI_COOLIEEXPLODE= 75, + DIGI_COOLIESCREAM= 76, + DIGI_COOLIEALERT= 77, + DIGI_COOLIEAMBIENT= 78, + DIGI_COOLIEPAIN= 79, + DIGI_CGMATERIALIZE= 80, + DIGI_CGALERT= 81, + DIGI_CGTHIGHBONE= 82, + DIGI_CGAMBIENT= 83, + DIGI_CGPAIN= 84, + DIGI_CGMAGIC= 85, + DIGI_CGMAGICHIT= 86, + DIGI_CGSCREAM= 87, + DIGI_NINJAAMBIENT= 88, + DIGI_NINJASTAR= 89, + DIGI_NINJAPAIN= 90, + DIGI_NINJASCREAM= 91, + DIGI_NINJAALERT= 92, + DIGI_NINJAUZIATTACK= 93, + DIGI_NINJARIOTATTACK= 94, + DIGI_RIPPERAMBIENT= 95, + DIGI_RIPPERALERT= 96, + DIGI_RIPPERATTACK= 97, + DIGI_RIPPERPAIN= 98, + DIGI_RIPPERSCREAM= 99, + DIGI_RIPPERHEARTOUT= 100, + DIGI_GRDAMBIENT= 101, + DIGI_GRDALERT= 102, + DIGI_GRDPAIN= 103, + DIGI_GRDSCREAM= 104, + DIGI_GRDFIREBALL= 105, + DIGI_GRDSWINGAXE= 106, + DIGI_GRDAXEHIT= 107, + DIGI_SPAMBIENT= 108, + DIGI_SPALERT= 109, + DIGI_SPPAIN= 110, + DIGI_SPSCREAM= 111, + DIGI_SPBLADE= 112, + DIGI_SPELEC= 113, + DIGI_SPTELEPORT= 114, + DIGI_AHAMBIENT= 115, + DIGI_AHSCREAM= 116, + DIGI_AHEXPLODE= 117, + DIGI_AHSWOOSH= 118, + DIGI_HORNETBUZZ= 119, + DIGI_HORNETSTING= 120, + DIGI_HORNETPAIN= 121, + DIGI_HORNETDEATH= 122, + DIGI_SERPAMBIENT= 123, + DIGI_SERPALERT= 124, + DIGI_SERPPAIN= 125, + DIGI_SERPSCREAM= 126, + DIGI_SERPDEATHEXPLODE=127, + DIGI_SERPSWORDATTACK= 128, + DIGI_SERPMAGICLAUNCH= 129, + DIGI_SERPSUMMONHEADS= 130, + DIGI_SERPTAUNTYOU= 131, + DIGI_LAVABOSSAMBIENT= 132, + DIGI_LAVABOSSSWIM= 133, + DIGI_LAVABOSSRISE= 134, + DIGI_LAVABOSSALERT= 135, + DIGI_LAVABOSSFLAME= 136, + DIGI_LAVABOSSMETEOR= 137, + DIGI_LAVABOSSMETEXP= 138, + DIGI_LAVABOSSPAIN= 139, + DIGI_LAVABOSSSIZZLE= 140, + DIGI_LAVABOSSEXPLODE= 141, + DIGI_BOATSTART= 142, + DIGI_BOATRUN= 143, + DIGI_BOATSTOP= 144, + DIGI_BOATFIRE= 145, + DIGI_TANKSTART= 146, + DIGI_TANKRUN= 147, + DIGI_TANKSTOP= 148, + DIGI_TANKIDLE= 149, + DIGI_TANKFIRE= 150, + DIGI_TRUKRUN= 151, + DIGI_TRUKIDLE= 152, + DIGI_SUBRUN= 153, + DIGI_SUBIDLE= 154, + DIGI_SUBDOOR= 155, + DIGI_BOMBRFLYING= 156, + DIGI_BOMBRDROPBOMB= 157, + DIGI_BUBBLES= 158, + DIGI_CHAIN= 159, + DIGI_CHAINDOOR= 160, + DIGI_CRICKETS= 161, + DIGI_WOODDOOROPEN= 162, + DIGI_WOODDOORCLOSE= 163, + DIGI_METALDOOROPEN= 164, + DIGI_METALDOORCLOSE= 165, + DIGI_SLIDEDOOROPEN= 166, + DIGI_SLIDEDOORCLOSE= 167, + DIGI_STONEDOOROPEN= 168, + DIGI_STONEDOORCLOSE= 169, + DIGI_SQUEAKYDOOROPEN= 170, + DIGI_SQUEAKYDOORCLOSE=171, + DIGI_DRILL= 172, + DIGI_CAVEDRIP1= 173, + DIGI_CAVEDRIP2= 174, + DIGI_DRIP= 175, + DIGI_WATERFALL1= 176, + DIGI_WATERFALL2= 177, + DIGI_WATERFLOW1= 178, + DIGI_WATERFLOW2= 179, + DIGI_ELEVATOR= 180, + DIGI_SMALLEXP= 181, + DIGI_MEDIUMEXP= 182, + DIGI_LARGEEXP= 183, + DIGI_HUGEEXP= 184, + DIGI_NULL_HUGEEXP= 184, + DIGI_FIRE1= 185, + DIGI_FIRE2= 186, + DIGI_FIREBALL1= 187, + DIGI_FIREBALL2= 188, + DIGI_GEAR1= 189, + DIGI_GONG= 190, + DIGI_LAVAFLOW1= 191, + DIGI_MACHINE1= 192, + DIGI_MUBBUBBLES1= 193, + DIGI_EARTHQUAKE= 194, + DIGI_SEWERFLOW1= 195, + DIGI_SPLASH1= 196, + DIGI_STEAM1= 197, + DIGI_VOLCANOSTEAM1= 198, + DIGI_STOMPER= 199, + DIGI_SWAMP= 200, + DIGI_REGULARSWITCH= 201, + DIGI_BIGSWITCH= 202, + DIGI_STONESWITCH= 203, + DIGI_GLASSSWITCH= 204, + DIGI_HUGESWITCH= 205, + DIGI_THUNDER= 206, + DIGI_TELEPORT= 207, + DIGI_UNDERWATER= 208, + DIGI_UNLOCK= 209, + DIGI_SQUEAKYVALVE= 210, + DIGI_VOID1= 211, + DIGI_VOID2= 212, + DIGI_VOID3= 213, + DIGI_VOID4= 214, + DIGI_VOID5= 215, + DIGI_ERUPTION= 216, + DIGI_VOLCANOPROJECTILE= 217, + DIGI_LIGHTWIND= 218, + DIGI_STRONGWIND= 219, + DIGI_BREAKINGWOOD= 220, + DIGI_BREAKSTONES= 221, + DIGI_ENGROOM1= 222, + DIGI_ENGROOM2= 223, + DIGI_ENGROOM3= 224, + DIGI_ENGROOM4= 225, + DIGI_ENGROOM5= 226, + DIGI_BREAKGLASS= 227, + DIGI_MUSSTING= 228, + DIGI_HELI= 229, + DIGI_BIGHART= 230, + DIGI_WIND4= 231, + DIGI_SPOOKY1= 232, + DIGI_DRILL1= 233, + DIGI_JET= 234, + DIGI_DRUMCHANT= 235, + DIGI_BUZZZ= 236, + DIGI_CHOP_CLICK= 237, + DIGI_SWORD_UP= 238, + DIGI_UZI_UP= 239, + DIGI_SHOTGUN_UP= 240, + DIGI_ROCKET_UP= 241, + DIGI_GRENADE_UP= 242, + DIGI_RAIL_UP= 243, + DIGI_MINE_UP= 244, + DIGI_TAUNTAI1= 246, + DIGI_TAUNTAI2= 247, + DIGI_TAUNTAI3= 248, + DIGI_TAUNTAI4= 249, + DIGI_TAUNTAI5= 250, + DIGI_TAUNTAI6= 251, + DIGI_TAUNTAI7= 252, + DIGI_TAUNTAI8= 253, + DIGI_TAUNTAI9= 254, + DIGI_TAUNTAI10= 255, + DIGI_PLAYERPAIN1= 256, + DIGI_PLAYERPAIN2= 257, + DIGI_PLAYERPAIN3= 258, + DIGI_PLAYERPAIN4= 259, + DIGI_PLAYERPAIN5= 260, + DIGI_PLAYERYELL1= 261, + DIGI_PLAYERYELL2= 262, + DIGI_PLAYERYELL3= 263, + DIGI_SEARCHWALL= 264, + DIGI_NOURINAL= 265, + DIGI_FALLSCREAM= 266, + DIGI_GOTITEM1= 267, + DIGI_LASTPLAYERVOICE= 268, + DIGI_RAILFIRE= 269, + DIGI_NULL_RAILFIRE= 269, + DIGI_RAILREADY= 270, + DIGI_RAILPWRUP= 271, + DIGI_NUCLEAREXP= 272, + DIGI_NUKESTDBY= 273, + DIGI_NUKECDOWN= 274, + DIGI_NUKEREADY= 275, + DIGI_CHEMGAS= 276, + DIGI_CHEMBOUNCE= 277, + DIGI_THROW= 278, + DIGI_PULL= 279, + DIGI_MINEARM= 280, + DIGI_HEARTDOWN= 281, + DIGI_TOOLBOX= 282, + DIGI_NULL_TOOLBOX= 282, + DIGI_GASPOP= 283, + DIGI_40MMBNCE= 284, + DIGI_BURGLARALARM= 285, + DIGI_CARALARM= 286, + DIGI_CARALARMOFF= 287, + DIGI_CALTROPS= 288, + DIGI_NIGHTON= 289, + DIGI_NIGHTOFF= 290, + DIGI_SHOTSHELLSPENT= 291, + DIGI_BUSSKID= 292, + DIGI_BUSCRASH= 293, + DIGI_BUSENGINE= 294, + DIGI_ARMORHIT= 295, + DIGI_ASIREN1= 296, + DIGI_FIRETRK1= 297, + DIGI_TRAFFIC1= 298, + DIGI_TRAFFIC2= 299, + DIGI_TRAFFIC3= 300, + DIGI_TRAFFIC4= 301, + DIGI_TRAFFIC5= 302, + DIGI_TRAFFIC6= 303, + DIGI_HELI1= 304, + DIGI_JET1= 305, + DIGI_MOTO1= 306, + DIGI_MOTO2= 307, + DIGI_NEON1= 308, + DIGI_SUBWAY= 309, + DIGI_TRAIN1= 310, + DIGI_COINS= 311, + DIGI_SWORDCLANK= 312, + DIGI_RIPPER2AMBIENT= 313, + DIGI_RIPPER2ALERT= 314, + DIGI_RIPPER2ATTACK= 315, + DIGI_RIPPER2PAIN= 316, + DIGI_RIPPER2SCREAM= 317, + DIGI_RIPPER2HEARTOUT=318, + DIGI_M60= 319, + DIGI_SUMOSCREAM= 320, + DIGI_SUMOALERT= 321, + DIGI_SUMOAMBIENT= 322, + DIGI_SUMOPAIN= 323, + DIGI_RAMUNLOCK= 324, + DIGI_CARDUNLOCK= 325, + DIGI_ANCIENTSECRET= 326, + DIGI_AMERICANDRIVER= 327, + DIGI_DRIVELIKEBABOON= 328, + DIGI_BURNBABY= 329, + DIGI_LIKEBIGWEAPONS= 330, + DIGI_COWABUNGA= 331, + DIGI_NOCHARADE= 332, + DIGI_TIMETODIE= 333, + DIGI_EATTHIS= 334, + DIGI_FIRECRACKERUPASS=335, + DIGI_HOLYCOW= 336, + DIGI_HOLYPEICESOFCOW= 337, + DIGI_HOLYSHIT= 338, + DIGI_HOLYPEICESOFSHIT=339, + DIGI_PAYINGATTENTION= 340, + DIGI_EVERYBODYDEAD= 341, + DIGI_KUNGFU= 342, + DIGI_HOWYOULIKEMOVE= 343, + DIGI_NOMESSWITHWANG= 344, + DIGI_RAWREVENGE= 345, + DIGI_YOULOOKSTUPID= 346, + DIGI_TINYDICK= 347, + DIGI_NOTOURNAMENT= 348, + DIGI_WHOWANTSWANG= 349, + DIGI_MOVELIKEYAK= 350, + DIGI_ALLINREFLEXES= 351, + DIGI_EVADEFOREVER= 352, + DIGI_MRFLY= 353, + DIGI_SHISEISI= 354, + DIGI_LIKEFIREWORKS= 355, + DIGI_LIKEHIROSHIMA= 356, + DIGI_LIKENAGASAKI= 357, + DIGI_LIKEPEARL= 358, + DIGI_IAMSHADOW= 359, + DIGI_ILIKENUKES= 360, + DIGI_ILIKESWORD= 361, + DIGI_ILIKESHURIKEN= 362, + DIGI_BADLUCK= 363, + DIGI_NOMOVIEMRCHAN= 364, + DIGI_REALLIFEMRCHAN= 365, + DIGI_NOLIKEMUSIC= 366, + DIGI_NODIFFERENCE= 367, + DIGI_NOFEAR= 368, + DIGI_NOPAIN= 369, + DIGI_NOREPAIRMAN= 370, + DIGI_SONOFABITCH= 371, + DIGI_PAINFORWEAK= 372, + DIGI_GOSPEEDY= 373, + DIGI_GETTINGSTIFF= 374, + DIGI_TOMBRAIDER= 375, + DIGI_STICKYGOTU1= 376, + DIGI_STICKYGOTU2= 377, + DIGI_STICKYGOTU3= 378, + DIGI_STICKYGOTU4= 379, + DIGI_SWORDGOTU1= 380, + DIGI_SWORDGOTU2= 381, + DIGI_SWORDGOTU3= 382, + DIGI_HURTBAD1= 383, + DIGI_HURTBAD2= 384, + DIGI_HURTBAD3= 385, + DIGI_HURTBAD4= 386, + DIGI_HURTBAD5= 387, + DIGI_TOILETGIRLSCREAM= 388, + DIGI_TOILETGIRLALERT= 389, + DIGI_TOILETGIRLAMBIENT=390, + DIGI_TOILETGIRLPAIN= 391, + DIGI_TOILETGIRLTAUNT1= 392, + DIGI_TOILETGIRLTAUNT2= 393, + DIGI_SUMOFART= 394, + DIGI_GIBS1= 395, + DIGI_GIBS2= 396, + DIGI_BIRDS1= 397, + DIGI_BIRDS2= 398, + DIGI_TOILET= 399, + DIGI_FORKLIFTIDLE= 400, + DIGI_FORKLIFTRUN= 401, + DIGI_TOYCAR= 402, + DIGI_UZIMATIC= 403, + DIGI_COMPUTERPOWER= 404, + DIGI_GENERATORON= 405, + DIGI_GENERATORRUN= 406, + DIGI_BIGDRILL= 407, + DIGI_FLUORLIGHT= 408, + DIGI_AMOEBA= 409, + DIGI_BODYFALL2= 410, + DIGI_GIBS3= 411, + DIGI_NINJACHOKE= 412, + DIGI_TRAIN3= 413, + DIGI_TRAINR02= 414, + DIGI_TRAIN8= 415, + DIGI_TRASHLID= 416, + DIGI_GETMEDKIT= 417, + DIGI_AHH= 418, + DIGI_PALARM= 419, + DIGI_PFLIP= 420, + DIGI_PROLL1= 421, + DIGI_PROLL2= 422, + DIGI_PROLL3= 423, + DIGI_BUNNYATTACK= 424, + DIGI_BUNNYDIE1= 425, + DIGI_BUNNYDIE2= 426, + DIGI_BUNNYDIE3= 427, + DIGI_BUNNYAMBIENT= 428, + DIGI_STONESLIDE= 429, + DIGI_NINJAINHALF= 430, + DIGI_RIPPER2CHEST= 431, + DIGI_WHIPME= 432, + DIGI_ENDLEV= 433, + DIGI_MDALARM= 434, + DIGI_BREAKMETAL= 435, + DIGI_BREAKDEBRIS= 436, + DIGI_BREAKMARBELS= 437, + DIGI_BANZAI= 438, + DIGI_HAHA1= 439, + DIGI_HAHA2= 440, + DIGI_HAHA3= 441, + DIGI_ITEM_SPAWN= 442, + DIGI_NOREPAIRMAN2= 443, + DIGI_NOPOWER= 444, + DIGI_DOUBLEUZI= 445, + DIGI_NOTORDBUNNY= 446, + DIGI_CANBEONLYONE= 447, + DIGI_MIRROR1= 448, + DIGI_MIRROR2= 449, + DIGI_HITTINGWALLS= 450, + DIGI_GOTRAILGUN= 451, + DIGI_RABBITHUMP1= 452, + DIGI_RABBITHUMP2= 453, + DIGI_RABBITHUMP3= 454, + DIGI_RABBITHUMP4= 455, + DIGI_FAGRABBIT1= 456, + DIGI_FAGRABBIT2= 457, + DIGI_FAGRABBIT3= 458, + DIGI_STINKLIKEBABBOON= 459, + DIGI_WHATYOUEATBABY= 460, + DIGI_WHATDIEDUPTHERE= 461, + DIGI_YOUGOPOOPOO= 462, + DIGI_PULLMYFINGER= 463, + DIGI_SOAPYOUGOOD= 464, + DIGI_WASHWANG= 465, + DIGI_DROPSOAP= 466, + DIGI_REALTITS= 467, + DIGI_MSTRLEEP= 468, + DIGI_SEEKLEEPADVICE= 469, + DIGI_AVENGELEEPDEATH= 470, + DIGI_LEEPGHOST= 471, + DIGI_DOOR1= 472, + DIGI_DOOR2= 473, + DIGI_DOOR3= 474, + DIGI_FLAGWAVE= 475, + DIGI_SURFACE= 476, + DIGI_GASHURT= 477, + DIGI_BONUS_GRAB= 478, + DIGI_ANIMECRY= 479, + DIGI_ANIMESING1= 480, + DIGI_ANIMEMAD1= 481, + DIGI_ANIMESING2= 482, + DIGI_ANIMEMAD2= 483, + DIGI_PLAYER_TELEPORT= 484, + DIGI_INTRO_SLASH= 485, + DIGI_WARNING= 486, + DIGI_INTRO_WHIRL= 487, + DIGI_TOILETGIRLFART1= 488, + DIGI_TOILETGIRLFART2= 489, + DIGI_TOILETGIRLFART3= 490, + DIGI_WINDCHIMES= 491, + DIGI_MADATCARPET= 492, + DIGI_JUMPONCARPET= 493, + DIGI_USEBROKENVEHICLE= 494, + DIGI_STEPONCALTROPS= 495, + DIGI_WANGSEESERP= 496, + DIGI_SERPTAUNTWANG= 497, + DIGI_WANGTAUNTSERP1= 498, + DIGI_WANGTAUNTSERP2= 499, + DIGI_WANGORDER1= 500, + DIGI_WANGORDER2= 501, + DIGI_WANGDROWNING= 502, + DIGI_ZILLAREGARDS= 503, + DIGI_PMESSAGE= 504, + DIGI_SHAREND_UGLY1= 505, + DIGI_SHAREND_UGLY2= 506, + DIGI_SHAREND_TELEPORT= 507, + DIGI_HOTHEADSWITCH= 508, + DIGI_BOATCREAK= 509, + DIGI_BOATRUN2= 510, + DIGI_BOATIDLE= 511, + DIGI_SHIPBELL= 512, + DIGI_FOGHORN= 513, + DIGI_CANNON= 514, + DIGI_JG41001= 515, + DIGI_JG41012= 516, + DIGI_JG41018= 517, + DIGI_JG41028= 518, + DIGI_JG41048= 519, + DIGI_JG41052= 520, + DIGI_JG41058= 521, + DIGI_JG41060= 522, + DIGI_JG41075= 523, + DIGI_JG42004= 524, + DIGI_JG42019= 525, + DIGI_JG42021= 526, + DIGI_JG42028= 527, + DIGI_JG42033= 528, + DIGI_JG42034= 529, + DIGI_JG42050= 530, + DIGI_JG42056= 531, + DIGI_JG42061= 532, + DIGI_JG43004= 533, + DIGI_JG43015= 534, + DIGI_JG43019= 535, + DIGI_JG43021= 536, + DIGI_JG44011= 537, + DIGI_JG44014= 538, + DIGI_JG44027= 539, + DIGI_JG44038= 540, + DIGI_JG44039= 541, + DIGI_JG44048= 542, + DIGI_JG44052= 543, + DIGI_JG45014= 544, + DIGI_JG44068= 545, + DIGI_JG45010= 546, + DIGI_JG45018= 547, + DIGI_JG45030= 548, + DIGI_JG45033= 549, + DIGI_JG45043= 550, + DIGI_JG45053= 551, + DIGI_JG45067= 552, + DIGI_JG46005= 553, + DIGI_JG46010= 554, + DIGI_LANI049= 555, + DIGI_LANI051= 556, + DIGI_LANI052= 557, + DIGI_LANI054= 558, + DIGI_LANI060= 559, + DIGI_LANI063= 560, + DIGI_LANI065= 561, + DIGI_LANI066= 562, + DIGI_LANI073= 563, + DIGI_LANI075= 564, + DIGI_LANI077= 565, + DIGI_LANI079= 566, + DIGI_LANI089= 567, + DIGI_LANI091= 568, + DIGI_LANI093= 569, + DIGI_LANI095= 570, + DIGI_VENTWALK= 571, + DIGI_CARWALK= 572, + DIGI_JETSOAR= 573, + DIGI_VACUUM= 574, + DIGI_GIRLNINJAALERTT= 575, + DIGI_GIRLNINJASCREAM= 576, + DIGI_GIRLNINJAALERT= 577, + DIGI_PRUNECACKLE= 578, + DIGI_PRUNECACKLE2= 579, + DIGI_PRUNECACKLE3= 580, + DIGI_SUMOSTOMP= 581, + DIGI_VATOR= 582, + DIGI_JG9009= 583, + DIGI_Z16004= 584, + DIGI_Z16012= 585, + DIGI_Z16022= 586, + DIGI_Z16027= 587, + DIGI_JG93030= 588, + DIGI_JG94002= 589, + DIGI_Z17010= 590, + DIGI_Z17052= 591, + DIGI_Z17025= 592, + DIGI_ML25014= 593, + DIGI_ML250101= 594, + DIGI_JG9022= 595, + DIGI_JG9032= 596, + DIGI_JG9038= 597, + DIGI_JG9055= 598, + DIGI_JG9060= 599, + DIGI_JG92055= 600, + DIGI_ML25032= 601, + DIGI_JG92036= 602, + DIGI_JG92042= 603, + DIGI_ML26001= 604, + DIGI_JG93000= 605, + DIGI_JG93011= 606, + DIGI_JG93018= 607, + DIGI_JG93023= 608, + DIGI_ML26008= 609, + DIGI_ML26011= 610, + DIGI_JG94007= 611, + DIGI_JG94024= 612, + DIGI_JG94039= 613, + DIGI_JG95012= 614, + DIGI_ZILLASTOMP= 615, + DIGI_ZC1= 616, + DIGI_ZC2= 617, + DIGI_ZC3= 618, + DIGI_ZC4= 619, + DIGI_ZC5= 620, + DIGI_ZC6= 621, + DIGI_ZC7= 622, + DIGI_ZC8= 623, + DIGI_ZC9= 624, + DIGI_Z16043= 625, + } +} diff --git a/wadsrc/static/zscript/games/sw/ui/screens.zs b/wadsrc/static/zscript/games/sw/ui/screens.zs new file mode 100644 index 000000000..6cb630cb7 --- /dev/null +++ b/wadsrc/static/zscript/games/sw/ui/screens.zs @@ -0,0 +1,591 @@ +//------------------------------------------------------------------------- +/* +Copyright (C) 1997, 2005 - 3D Realms Entertainment +Copyright (C) 2019-2021 Christoph Oelckers + +This file is part of Raze + +Shadow Warrior is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +Original Source: 1997 - Frank Maddin and Jim Norwood +Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms +*/ +//------------------------------------------------------------------------- + + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +class SWDRealmsScreen : SkippableScreenJob +{ + const DREALMSPAL = 1; + + ScreenJob Init() + { + Super.Init(fadein | fadeout); + return self; + } + + override void Start() + { + SW.PlaySong(0); + } + + override void OnTick() + { + if (ticks > 5 * GameTicRate) jobstate = finished; + } + + override void Draw(double sm) + { + let tex = TexMan.CheckForTexture("THREED_REALMS_PIC", TexMan.Type_Any); + int translation = Translation.MakeID(Translation_BasePalette, DREALMSPAL); + Screen.DrawTexture(tex, false, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal); + } +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +class SWCreditsScreen : SkippableScreenJob +{ + int mystate; + int starttime; + TextureID curpic; + TextureID pic1, pic2; + + ScreenJob Init() + { + Super.Init(fadein|fadeout); + pic1 = TexMan.CheckForTexture("CREDITS1", TexMan.Type_Any); + pic2 = TexMan.CheckForTexture("CREDITS2", TexMan.Type_Any); + return self; + + } + override void OnSkip() + { + SW.StopSound(); + } + + override void Start() + { + // Lo Wang feel like singing! + SW.PlaySound(SWSnd.DIGI_JG95012, SW.v3df_none, CHAN_VOICE, CHANF_UI); + } + + override void OnTick() + { + if (mystate == 0) + { + if (!SW.IsSoundPlaying(CHAN_VOICE)) + { + starttime = ticks; + mystate = 1; + SW.StopSound(); + curpic = pic1; + SW.PlaySong(5); //) PlaySong(2); + } + } + else + { + if (ticks >= starttime + 8 * GameTicRate) + { + curpic = curpic == pic1? pic2 : pic1; + starttime = ticks; + } + } + } + + override void Draw(double sr) + { + if (mystate == 1) + Screen.DrawTexture(curpic, false, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal); + } +} + +//--------------------------------------------------------------------------- +// +// Summary screen animation +// +//--------------------------------------------------------------------------- + +struct SWSummaryAnimation +{ + TextureID frames[15]; + Sound snd; + int delay, length; + int tics; + + int curframe; + + void Init(String nametemplate, int length_, Sound sound_, int delay_) + { + for (int i = 0; i < length_; i++) + { + String name = String.Format(nametemplate, i); + frames[i] = TexMan.CheckForTexture(name, TexMan.Type_Any); + } + snd = sound_; + delay = delay_; + length = length_; + } + + bool Tick() + { + tics += 3; + if (curframe < length-1) + { + if (tics >= delay) + { + tics -= delay; + curframe++; + if (curframe == 3) SW.PlaySound(snd, SW.v3df_none); + } + return false; + } + return tics >= 90; + } + + TextureID getTex() + { + return frames[curframe]; + } +} + +//--------------------------------------------------------------------------- +// +// Summary screen +// +//--------------------------------------------------------------------------- + +class SWSummaryScreen : SummaryScreenBase +{ + SWSummaryAnimation anim; + int animstate; + TextureID rest[4]; + + ScreenJob Init(MapRecord mr, SummaryInfo info) + { + Super.Init(fadein|fadeout); + SetParameters(mr, info); + switch (random(0, 2)) + { + case 0: + anim.Init("BONUS_PUNCH%02d", 15, SWSnd.DIGI_PLAYERYELL3, 8); + break; + case 1: + anim.Init("BONUS_KICK%02d", 15, SWSnd.DIGI_PLAYERYELL2, 8); + break; + case 2: + anim.Init("BONUS_GRAB%02d", 15, SWSnd.DIGI_BONUS_GRAB, 20); + break; + } + rest[0] = TexMan.CheckForTexture("BONUS_PUNCH00", TexMan.Type_Any); + rest[3] = rest[1] = TexMan.CheckForTexture("BONUS_PUNCH01", TexMan.Type_Any); + rest[2] = TexMan.CheckForTexture("BONUS_PUNCH02", TexMan.Type_Any); + return self; + } + + override bool OnEvent(InputEvent ev) + { + if (ev.type == InputEvent.Type_KeyDown && !Raze.specialKeyEvent(ev)) + { + if (animstate == 0) animstate = 1; + } + return true; + } + + override void Start() + { + Raze.StopAllSounds(); + SW.PlaySong(1); + } + + override void OnTick() + { + if (animstate == 1) + { + if (anim.Tick()) + { + SW.StopSound(); + jobstate = finished; + } + } + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + private static int BONUS_LINE(int i) { return (50 + ((i) * 20)); } + + override void Draw(double sm) + { + Screen.DrawTexture(TexMan.CheckForTexture("BONUS_SCREEN_PIC", TexMan.Type_Any), true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal); + SW.DrawString(160, 20, currentLevel.DisplayName(), 1, 19, 0); + SW.DrawString(170, 30, "$COMPLETED", 1, 19, 0); + + Textureid animtex; + if (animstate == 0) animtex = rest[(ticks / 17) & 3]; + else animtex = anim.getTex(); + + Screen.DrawTexture(animtex, false, 158, 86, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TopLeft, true, DTA_LegacyRenderStyle, STYLE_Normal); + + int line = 0; + String ds; + + ds = String.Format("%s %s", StringTable.Localize("$TXT_YOURTIME"), FormatTime(stats.time)); + SW.DrawString(60, BONUS_LINE(line++), ds, 1, 16); + + if (currentLevel.designerTime > 0) + { + ds = String.Format("%s %d:%02d", StringTable.Localize("$TXT_3DRTIME"), currentLevel.designerTime / 60, currentLevel.designerTime % 60); + SW.DrawString(40, BONUS_LINE(line++), ds, 1, 16); + } + + if (currentLevel.parTime > 0) + { + ds = String.Format("%s %d:%02d", StringTable.Localize("$TXT_PARTIME"), currentLevel.parTime / 60, currentLevel.parTime % 60); + SW.DrawString(40, BONUS_LINE(line++), ds, 1, 16); + } + + // always read secrets and kills from the first player + ds = String.Format("%s: %d / %d", StringTable.Localize("$TXT_SECRETS"), stats.Secrets, stats.MaxSecrets); + SW.DrawString(60, BONUS_LINE(line++), ds, 1, 16); + + ds = String.Format("%s: %d / %d", StringTable.Localize("$KILLS"), stats.Kills, stats.MaxKills); + SW.DrawString(60, BONUS_LINE(line), ds, 1, 16); + + SW.DrawString(160, 185, "$PRESSKEY", 1, 19, 0); + } + +} + +//--------------------------------------------------------------------------- +// +// Deathmatch summary screen +// +//--------------------------------------------------------------------------- + +class SWMultiSummaryScreen : SkippableScreenJob +{ + enum EConst + { + + STAT_START_X = 20, + STAT_START_Y = 85, + STAT_OFF_Y = 9, + STAT_HEADER_Y = 14, + STAT_TABLE_X = (STAT_START_X + 15*4), + STAT_TABLE_XOFF = 6*4, + MAXPLAYERS = 8, + PALETTE_PLAYER0 = 16 + + } + + int numplayers; + + ScreenJob Init(int numplayer_) + { + numplayers = numplayer_; + Super.Init(fadein | fadeout); + return self; + } + + override void Start() + { + SW.PlaySong(1); + } + + override void OnSkip() + { + SW.StopSound(); + } + + override void Draw(double sr) + { + int death_total[MAXPLAYERS]; + int kills[MAXPLAYERS]; + + Screen.DrawTexture(TexMan.CheckForTexture("STAT_SCREEN_PIC", TexMan.Type_Any), true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal); + SW.DrawString(160, 68, "$MULTIPLAYER TOTALS", 0, 0); + SW.DrawString(160, 189, "$PRESSKEY", 0, 0, 0); + + int x = STAT_START_X; + int y = STAT_START_Y; + + // Hm.... how to translate this without messing up the formatting? + SW.DrawSmallString(x, y, " NAME 1 2 3 4 5 6 7 8 KILLS", 0, 0); + int rows = numplayers; + int cols = numplayers; + + y += STAT_HEADER_Y; + + String ds; + for (int i = 0; i < rows; i++) + { + x = STAT_START_X; + + ds = String.Format("%d", i + 1); + SW.DrawSmallString(x, y, ds, 0, 0); + + ds = String.Format(" %-13s", Raze.PlayerName(i)); + SW.DrawSmallString(x, y, ds, 0, Raze.playerPalette(i)); + + x = STAT_TABLE_X; + for (int j = 0; j < cols; j++) + { + int pal = 0; + int frags = Raze.PlayerFrags(i, j); + death_total[j] += frags; + + if (i == j) + { + // don't add kill for self or team player + pal = PALETTE_PLAYER0 + 4; + kills[i] -= frags; // subtract self kills + } + else if (false/*gNet.TeamPlay*/) + { + if (Raze.playerPalette(i) == Raze.playerPalette(j)) + { + // don't add kill for self or team player + pal = PALETTE_PLAYER0 + 4; + kills[i] -= frags; // subtract self kills + } + else + kills[i] += frags; // kills added here + } + else + { + kills[i] += frags; // kills added here + } + + ds = String.Format("%d", frags); + SW.DrawSmallString(x, y, ds, 0, pal); + x += STAT_TABLE_XOFF; + } + + y += STAT_OFF_Y; + } + + + // Deaths + + x = STAT_START_X; + y += STAT_OFF_Y; + + ds = String.Format(" %s", StringTable.Localize("$DEATHS")); + SW.DrawSmallString(x, y, ds, 0, 0); + x = STAT_TABLE_X; + + for (int j = 0; j < cols; j++) + { + ds = String.Format("%d", death_total[j]); + SW.DrawSmallString(x, y, ds, 0, 0); + x += STAT_TABLE_XOFF; + } + + x = STAT_START_X; + y += STAT_OFF_Y; + + // Kills + x = STAT_TABLE_X + 200; + y = STAT_START_Y + STAT_HEADER_Y; + + for (int i = 0; i < rows; i++) + { + ds = String.Format("%d", kills[i]); //pp.Kills); + SW.DrawSmallString(x, y, ds, 0, 0); + + y += STAT_OFF_Y; + } + } +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +class SWLoadScreen : ScreenJob +{ + MapRecord rec; + + ScreenJob Init(MapRecord maprec) + { + Super.Init(fadein); + rec = maprec; + return self; + } + + override void OnTick() + { + if (fadestate == visible) jobstate = finished; + } + + override void Draw(double sr) + { + Screen.DrawTexture(TexMan.CheckForTexture("TITLE_PIC", TexMan.Type_Any), true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal); + SW.DrawString(160, 170, "$TXT_ENTERING", 1, 16, 0); + SW.DrawString(160, 180, rec.DisplayName(), 1, 16, 0); + } +} + + +class SWCutscenes +{ + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildIntro(ScreenJobRunner runner) + { + if (!userConfig.nologo) + { + SW.StopSound(); + SW.PlaySong(0); + Array soundinfo; + soundinfo.Pushv( + 1, SWSnd.DIGI_NOMESSWITHWANG, + 5, SWSnd.DIGI_INTRO_SLASH, + 15, SWSnd.DIGI_INTRO_WHIRL); + runner.Append(new("SWDRealmsScreen").Init()); + runner.Append(MoviePlayerJob.CreateWithSoundinfo("sw.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 8, 360, 128)); + } + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildSerpentAnim(ScreenJobRunner runner) + { + Array soundinfo; + soundinfo.Pushv( + 1, SWSnd.DIGI_SERPTAUNTWANG, + 16, SWSnd.DIGI_SHAREND_TELEPORT, + 35, SWSnd.DIGI_WANGTAUNTSERP1, + 51, SWSnd.DIGI_SHAREND_UGLY1, + 64, SWSnd.DIGI_SHAREND_UGLY2); + static const int serpzillaframetimes[] = { 16, 16, 140 }; + runner.Append(MoviePlayerJob.CreateWithSoundinfo("swend.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 16, 16, 140)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildSumoAnim(ScreenJobRunner runner) + { + Array soundinfo; + soundinfo.Pushv( + 2, SWSnd.DIGI_JG41012, + 30, SWSnd.DIGI_HOTHEADSWITCH, + 42, SWSnd.DIGI_HOTHEADSWITCH, + 59, SWSnd.DIGI_JG41028); + runner.Append(MoviePlayerJob.CreateWithSoundinfo("sumocinm.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 10, 40, 130)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildZillaAnim(ScreenJobRunner runner) + { + Array soundinfo; + soundinfo.Pushv( + 1, SWSnd.DIGI_ZC1, + 5, SWSnd.DIGI_JG94024, + 14, SWSnd.DIGI_ZC2, + 30, SWSnd.DIGI_ZC3, + 32, SWSnd.DIGI_ZC4, + 37, SWSnd.DIGI_ZC5, + 63, SWSnd.DIGI_Z16043, + 63, SWSnd.DIGI_ZC6, + 63, SWSnd.DIGI_ZC7, + 72, SWSnd.DIGI_ZC7, + 73, SWSnd.DIGI_ZC4, + 77, SWSnd.DIGI_ZC5, + 87, SWSnd.DIGI_ZC8, + 103, SWSnd.DIGI_ZC7, + 108, SWSnd.DIGI_ZC9, + 120, SWSnd.DIGI_JG94039); + runner.Append(MoviePlayerJob.CreateWithSoundinfo("zfcin.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 16, 16, 140)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildSybexScreen(ScreenJobRunner runner) + { + if (Raze.isShareware() && !netgame) + runner.Append(ImageScreen.CreateNamed("#05261", TexMan.Type_Any)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildMPSummary(ScreenJobRunner runner, MapRecord map, SummaryInfo stats) + { + runner.Append(new("SWMultiSummaryScreen").Init(stats.playercount)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildSPSummary(ScreenJobRunner runner, MapRecord map, SummaryInfo stats) + { + runner.Append(new("SWSummaryScreen").Init(map, stats)); + } + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + static void BuildLoading(ScreenJobRunner runner, MapRecord map) + { + runner.Append(new("SWLoadScreen").Init(map)); + } +} diff --git a/wadsrc/static/zscript/screenjob.zs b/wadsrc/static/zscript/screenjob.zs index a2f30f5d7..8182323f4 100644 --- a/wadsrc/static/zscript/screenjob.zs +++ b/wadsrc/static/zscript/screenjob.zs @@ -204,7 +204,10 @@ class SummaryScreenBase : ScreenJob String FormatTime(int time) { - return String.Format("%02d:%02d", (time / (26 * 60)) % 60, (time / 26) % 60); + if (time >= 60 * 50) + return String.Format("%02d:%02d:%02d", time / (60*60), (time / 60) % 60, time % 60); + else + return String.Format("%02d:%02d", (time / 60) % 60, time % 60); } }