2021-04-25 19:52:58 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
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... ;) )
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2021-04-22 16:52:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class DRealmsScreen : SkippableScreenJob
|
|
|
|
{
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-22 16:52:39 +00:00
|
|
|
{
|
|
|
|
Super.Init(fadein | fadeout);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-22 16:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Start()
|
|
|
|
{
|
|
|
|
Duke.PlaySpecialMusic(Duke.MUS_INTRO);
|
|
|
|
}
|
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
if (ticks >= 7 * GameTicRate) jobstate = finished;
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double smoothratio)
|
|
|
|
{
|
|
|
|
let tex = TexMan.CheckForTexture("DREALMS");
|
|
|
|
int translation = TexMan.UseGamePalette(tex)? Translation.MakeID(Translation_BasePalette, Duke.DREALMSPAL) : 0;
|
|
|
|
|
|
|
|
screen.DrawTexture(tex, true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-22 17:59:45 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-04-25 22:09:46 +00:00
|
|
|
class DukeTitleScreen : SkippableScreenJob
|
2021-04-22 17:59:45 +00:00
|
|
|
{
|
|
|
|
int soundanm;
|
|
|
|
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-22 17:59:45 +00:00
|
|
|
{
|
|
|
|
Super.Init(fadein | fadeout);
|
|
|
|
soundanm = 0;
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Start()
|
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
if (isNam() || userConfig.nologo) Duke.PlaySpecialMusic(Duke.MUS_INTRO);
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
int clock = ticks * 120 / GameTicRate;
|
|
|
|
if (soundanm == 0 && clock >= 120 && clock < 120 + 60)
|
|
|
|
{
|
|
|
|
soundanm = 1;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
if (soundanm == 1 && clock > 220 && clock < (220 + 30))
|
|
|
|
{
|
|
|
|
soundanm = 2;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
if (soundanm == 2 && clock >= 280 && clock < 395)
|
|
|
|
{
|
|
|
|
soundanm = 3;
|
2023-01-01 17:22:08 +00:00
|
|
|
if (isPlutoPak()) Duke.PlaySound("FLY_BY", CHAN_AUTO, CHANF_UI);
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
else if (soundanm == 3 && clock >= 395)
|
|
|
|
{
|
|
|
|
soundanm = 4;
|
2023-01-01 17:22:08 +00:00
|
|
|
if (isPlutoPak()) Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (clock > (860 + 120))
|
|
|
|
{
|
|
|
|
jobstate = finished;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double smoothratio)
|
|
|
|
{
|
|
|
|
int clock = (ticks + smoothratio) * 120 / GameTicRate;
|
2021-04-22 19:30:13 +00:00
|
|
|
int etrans = Translation.MakeID(Translation_BasePalette, Duke.TITLEPAL);
|
2021-04-22 17:59:45 +00:00
|
|
|
|
|
|
|
// Only translate if the image depends on the global palette.
|
|
|
|
let tex = TexMan.CheckForTexture("BETASCREEN");
|
2021-04-22 19:30:13 +00:00
|
|
|
int trans = TexMan.UseGamePalette(tex)? etrans : 0;
|
2021-04-22 17:59:45 +00:00
|
|
|
screen.DrawTexture(tex, true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, trans, DTA_LegacyRenderStyle, STYLE_Normal);
|
|
|
|
|
|
|
|
double scale = clamp(clock - 120, 0, 60) / 64.;
|
|
|
|
if (scale > 0.)
|
|
|
|
{
|
|
|
|
let tex = TexMan.CheckForTexture("DUKENUKEM");
|
2021-04-22 19:30:13 +00:00
|
|
|
trans = TexMan.UseGamePalette(tex)? etrans : 0; // re-check for different texture!
|
2021-04-22 17:59:45 +00:00
|
|
|
|
|
|
|
screen.DrawTexture(tex, true, 160, 104, DTA_FullscreenScale, FSMode_Fit320x200,
|
|
|
|
DTA_CenterOffsetRel, true, DTA_TranslationIndex, trans, DTA_ScaleX, scale, DTA_ScaleY, scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
scale = clamp(clock - 220, 0, 30) / 32.;
|
|
|
|
if (scale > 0.)
|
|
|
|
{
|
|
|
|
let tex = TexMan.CheckForTexture("THREEDEE");
|
2021-04-22 19:30:13 +00:00
|
|
|
trans = TexMan.UseGamePalette(tex)? etrans : 0; // re-check for different texture!
|
2021-04-22 17:59:45 +00:00
|
|
|
|
|
|
|
screen.DrawTexture(tex, true, 160, 129, DTA_FullscreenScale, FSMode_Fit320x200,
|
|
|
|
DTA_CenterOffsetRel, true, DTA_TranslationIndex, trans, DTA_ScaleX, scale, DTA_ScaleY, scale);
|
|
|
|
}
|
|
|
|
|
2023-01-01 17:22:08 +00:00
|
|
|
if (isPlutoPak())
|
2021-04-22 17:59:45 +00:00
|
|
|
{
|
|
|
|
scale = (410 - clamp(clock, 280, 395)) / 16.;
|
|
|
|
if (scale > 0. && clock > 280)
|
|
|
|
{
|
|
|
|
let tex = TexMan.CheckForTexture("TITLEPLUTOPAKSPRITE");
|
2021-04-22 19:30:13 +00:00
|
|
|
trans = TexMan.UseGamePalette(tex)? etrans : 0; // re-check for different texture!
|
2021-04-22 17:59:45 +00:00
|
|
|
|
|
|
|
screen.DrawTexture(tex, true, 160, 151, DTA_FullscreenScale, FSMode_Fit320x200,
|
|
|
|
DTA_CenterOffsetRel, true, DTA_TranslationIndex, trans, DTA_ScaleX, scale, DTA_ScaleY, scale);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void OnDestroy()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("NITEVISION_ONOFF", CHAN_AUTO, CHANF_UI);
|
2021-04-22 17:59:45 +00:00
|
|
|
}
|
|
|
|
}
|
2021-04-22 19:30:13 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Episode1End1 : SkippableScreenJob
|
|
|
|
{
|
|
|
|
int bonuscnt;
|
|
|
|
TextureID bossani;
|
|
|
|
TextureID breatheani;
|
|
|
|
bool breathebg;
|
|
|
|
|
|
|
|
const breathe_x = 176;
|
|
|
|
const breathe_y = 59;
|
|
|
|
const boss_x = 86;
|
|
|
|
const boss_y = 59;
|
|
|
|
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-22 19:30:13 +00:00
|
|
|
{
|
|
|
|
bonuscnt = 0;
|
|
|
|
breathebg = false;
|
|
|
|
bossani.SetInvalid();
|
|
|
|
breatheani.SetInvalid();
|
|
|
|
Super.Init(fadein | fadeout);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-22 19:30:13 +00:00
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-04-22 19:30:13 +00:00
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
static const int breathe_time[] = { 0, 30, 60, 90 };
|
|
|
|
static const int breathe_time2[] = { 30, 60, 90, 120 };
|
|
|
|
static const String breathe_tile[] = { "VICTORY2", "VICTORY3", "VICTORY2", "" };
|
|
|
|
|
|
|
|
static const int boss_time[] = { 0, 220, 260, 290, 320, 350, 350 };
|
|
|
|
static const int boss_time2[] = { 120, 260, 290, 320, 350, 380, 380 };
|
|
|
|
static const String boss_tile[] = { "VICTORY4", "VICTORY5", "VICTORY6", "VICTORY7", "VICTORY8", "VICTORY9", "VICTORY9" };
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-04-22 19:30:13 +00:00
|
|
|
int currentclock = ticks * 120 / GameTicRate;
|
|
|
|
|
|
|
|
bossani.SetInvalid();
|
|
|
|
breathebg = false;
|
|
|
|
breatheani.SetInvalid();
|
|
|
|
|
|
|
|
// boss
|
|
|
|
if (currentclock > 390 && currentclock < 780)
|
|
|
|
{
|
|
|
|
for (int t = 0, tt = 0; t < 35; t +=5, tt++) if ((currentclock % 390) > boss_time[tt] && (currentclock % 390) <= boss_time2[tt])
|
|
|
|
{
|
|
|
|
if (t == 10 && bonuscnt == 1)
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("SHOTGUN_FIRE", CHAN_AUTO, CHANF_UI);
|
|
|
|
Duke.PlaySound("SQUISHED", CHAN_AUTO, CHANF_UI);
|
2021-04-22 19:30:13 +00:00
|
|
|
bonuscnt++;
|
|
|
|
}
|
|
|
|
bossani = TexMan.CheckForTexture(boss_tile[tt]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Breathe
|
|
|
|
if (currentclock < 450 || currentclock >= 750)
|
|
|
|
{
|
|
|
|
if (currentclock >= 750)
|
|
|
|
{
|
|
|
|
breathebg = true;
|
|
|
|
if (currentclock >= 750 && bonuscnt == 2)
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("DUKETALKTOBOSS", CHAN_AUTO, CHANF_UI);
|
2021-04-22 19:30:13 +00:00
|
|
|
bonuscnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int t = 0, tt = 0; t < 20; t += 5, tt++)
|
|
|
|
if (breathe_tile[tt] != "" && (currentclock % 120) > breathe_time[tt] && (currentclock % 120) <= breathe_time2[tt])
|
|
|
|
{
|
|
|
|
if (t == 5 && bonuscnt == 0)
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("BOSSTALKTODUKE", CHAN_AUTO, CHANF_UI);
|
2021-04-22 19:30:13 +00:00
|
|
|
bonuscnt++;
|
|
|
|
}
|
|
|
|
breatheani = TexMan.CheckForTexture(breathe_tile[tt]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double sr)
|
|
|
|
{
|
|
|
|
int etrans = Translation.MakeID(Translation_BasePalette, Duke.ENDINGPAL);
|
|
|
|
|
|
|
|
let tex = TexMan.CheckForTexture("VICTORY1");
|
|
|
|
int trans = TexMan.UseGamePalette(tex)? etrans : 0;
|
|
|
|
screen.DrawTexture(tex, false, 0, 50, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, trans, DTA_LegacyRenderStyle, STYLE_Normal, DTA_TopLeft, true);
|
|
|
|
|
|
|
|
if (bossani.isValid())
|
|
|
|
{
|
|
|
|
trans = TexMan.UseGamePalette(tex)? etrans : 0; // re-check for different texture!
|
|
|
|
screen.DrawTexture(bossani, false, boss_x, boss_y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, trans, DTA_TopLeft, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (breathebg)
|
|
|
|
{
|
|
|
|
tex = TexMan.CheckForTexture("VICTORY9");
|
|
|
|
trans = TexMan.UseGamePalette(tex)? etrans : 0; // re-check for different texture!
|
|
|
|
screen.DrawTexture(tex, false, 86, 59, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, trans, DTA_TopLeft, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (breatheani.isValid())
|
|
|
|
{
|
|
|
|
trans = TexMan.UseGamePalette(tex)? etrans : 0; // re-check for different texture!
|
|
|
|
screen.DrawTexture(breatheani, false, breathe_x, breathe_y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, trans, DTA_TopLeft, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-22 19:33:51 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class E2EndScreen : ImageScreen
|
|
|
|
{
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-22 19:33:51 +00:00
|
|
|
{
|
2021-04-25 18:02:40 +00:00
|
|
|
Super.InitNamed("E2ENDSCREEN", fadein | fadeout | stopsound, 0x7fffffff, 0);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-22 19:33:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Start()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-22 19:33:51 +00:00
|
|
|
}
|
|
|
|
}
|
2021-04-23 08:07:02 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Episode3End : ImageScreen
|
|
|
|
{
|
|
|
|
int soundstate;
|
|
|
|
int finishtime;
|
|
|
|
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
2021-04-25 18:02:40 +00:00
|
|
|
Super.InitNamed("radlogo.anm", fadein|fadeout, 0x7fffffff);
|
2021-04-23 08:07:02 +00:00
|
|
|
soundstate = 0;
|
|
|
|
finishtime = 0;
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnSkip()
|
|
|
|
{
|
2021-05-22 00:15:49 +00:00
|
|
|
System.StopAllSounds();
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
switch (soundstate)
|
|
|
|
{
|
|
|
|
case 0:
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("ENDSEQVOL3SND5", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
soundstate++;
|
|
|
|
break;
|
|
|
|
|
2022-11-24 20:27:08 +00:00
|
|
|
/*
|
2021-04-23 08:07:02 +00:00
|
|
|
case 1:
|
2022-11-24 20:27:08 +00:00
|
|
|
if (!Duke.CheckSoundPlaying("ENDSEQVOL3SND5"))
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("ENDSEQVOL3SND6", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
soundstate++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2022-11-24 20:27:08 +00:00
|
|
|
if (!Duke.CheckSoundPlaying("ENDSEQVOL3SND6"))
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("ENDSEQVOL3SND7", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
soundstate++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
2022-11-24 20:27:08 +00:00
|
|
|
if (!Duke.CheckSoundPlaying("ENDSEQVOL3SND7"))
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("ENDSEQVOL3SND8", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
soundstate++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
2022-11-24 20:27:08 +00:00
|
|
|
if (!Duke.CheckSoundPlaying("ENDSEQVOL3SND8"))
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("ENDSEQVOL3SND92, CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
soundstate++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
2022-11-24 20:27:08 +00:00
|
|
|
if (!Duke.CheckSoundPlaying("ENDSEQVOL3SND9"))
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
|
|
|
soundstate++;
|
2021-05-22 00:15:49 +00:00
|
|
|
finishtime = ticks + GameTicRate * (System.SoundEnabled() ? 1 : 5); // if sound is off this wouldn't wait without a longer delay here.
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
2023-01-01 17:22:08 +00:00
|
|
|
if (isPlutoPak())
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
|
|
|
if (ticks > finishtime) jobstate = finished;
|
|
|
|
}
|
|
|
|
break;
|
2022-11-24 20:27:08 +00:00
|
|
|
*/
|
2021-04-23 08:07:02 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2021-05-22 00:15:49 +00:00
|
|
|
if (jobstate != running) System.StopAllSounds();
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnDestroy()
|
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
if (!isPlutoPak()) Duke.PlaySound("ENDSEQVOL3SND4", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Episode4Text : SkippableScreenJob
|
|
|
|
{
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
|
|
|
Super.Init(fadein|fadeout);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override void Draw(double sm)
|
|
|
|
{
|
2021-04-26 22:01:25 +00:00
|
|
|
Duke.BigText(160, 60, "$Thanks to all our", 0);
|
|
|
|
Duke.BigText(160, 60 + 16, "$fans for giving", 0);
|
|
|
|
Duke.BigText(160, 60 + 16 + 16, "$us big heads.", 0);
|
|
|
|
Duke.BigText(160, 70 + 16 + 16 + 16, "$Look for a Duke Nukem 3D", 0);
|
|
|
|
Duke.BigText(160, 70 + 16 + 16 + 16 + 16, "$sequel soon.", 0);
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Start()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("ENDSEQVOL3SND4", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Episode5End : ImageScreen
|
|
|
|
{
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-23 08:07:02 +00:00
|
|
|
{
|
2021-04-25 18:02:40 +00:00
|
|
|
Super.InitNamed("FIREFLYGROWEFFECT", fadein|fadeout|stopsound);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
if (ticks == 1) Duke.PlaySound("E5L7_DUKE_QUIT_YOU", CHAN_AUTO, CHANF_UI);
|
2021-04-23 08:07:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-23 10:24:42 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2021-04-23 14:03:25 +00:00
|
|
|
// This handles both Duke and RR.
|
2021-04-23 10:24:42 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class DukeMultiplayerBonusScreen : SkippableScreenJob
|
|
|
|
{
|
|
|
|
int playerswhenstarted;
|
|
|
|
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init(int pws)
|
2021-04-23 10:24:42 +00:00
|
|
|
{
|
|
|
|
Super.Init(fadein|fadeout);
|
2021-04-23 14:03:25 +00:00
|
|
|
playerswhenstarted = pws;
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 10:24:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Start()
|
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
if (!isRR()) Duke.PlayBonusMusic();
|
2021-04-23 10:24:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double smoothratio)
|
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
bool isRR = isRR();
|
2021-04-23 14:03:25 +00:00
|
|
|
double titlescale = isRR? 0.36 : 1;
|
|
|
|
|
2021-04-23 10:24:42 +00:00
|
|
|
String tempbuf;
|
|
|
|
int currentclock = int((ticks + smoothratio) * 120 / GameTicRate);
|
|
|
|
Screen.DrawTexture(TexMan.CheckForTexture("MENUSCREEN"), false, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_Color, 0xff808080, DTA_LegacyRenderStyle, STYLE_Normal);
|
2021-04-23 14:03:25 +00:00
|
|
|
Screen.DrawTexture(TexMan.CheckForTexture("INGAMEDUKETHREEDEE"), true, 160, 34, DTA_FullscreenScale, FSMode_Fit320x200, DTA_CenterOffsetRel, true, DTA_ScaleX, titlescale, DTA_ScaleY, titlescale);
|
2023-01-01 17:22:08 +00:00
|
|
|
if (isPlutoPak()) Screen.DrawTexture(TexMan.CheckForTexture("MENUPLUTOPAKSPRITE"), true, 260, 36, DTA_FullscreenScale, FSMode_Fit320x200, DTA_CenterOffsetRel, true);
|
2021-04-23 10:24:42 +00:00
|
|
|
|
2021-05-26 22:32:57 +00:00
|
|
|
Raze.DrawScoreboard(60);
|
2021-04-23 10:24:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-23 12:19:25 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class DukeLevelSummaryScreen : SummaryScreenBase
|
|
|
|
{
|
|
|
|
String lastmapname;
|
2022-11-24 20:27:08 +00:00
|
|
|
Sound speech;
|
2021-04-23 12:19:25 +00:00
|
|
|
int displaystate;
|
|
|
|
int dukeAnimStart;
|
|
|
|
|
|
|
|
TextureID texBg;
|
|
|
|
TextureID texOv[4];
|
|
|
|
|
2023-01-14 09:00:37 +00:00
|
|
|
double text_x;
|
|
|
|
double val_x;
|
|
|
|
|
2021-04-23 12:19:25 +00:00
|
|
|
enum EScreenFlags
|
|
|
|
{
|
|
|
|
printTimeText = 1,
|
|
|
|
printTimeVal = 2,
|
|
|
|
printKillsText = 4,
|
|
|
|
printKillsVal = 8,
|
|
|
|
printSecretsText = 16,
|
|
|
|
printSecretsVal = 32,
|
|
|
|
printStatsAll = 63,
|
|
|
|
dukeAnim = 64,
|
|
|
|
dukeWait = 128,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-04-27 22:51:28 +00:00
|
|
|
ScreenJob Init(MapRecord m, SummaryInfo s)
|
2021-04-23 12:19:25 +00:00
|
|
|
{
|
|
|
|
Super.Init(fadein | fadeout);
|
2021-04-27 22:51:28 +00:00
|
|
|
SetParameters(m, s);
|
2021-05-02 10:02:55 +00:00
|
|
|
String basetex = level.InterBackground;
|
|
|
|
if (basetex.length() == 0)
|
|
|
|
{
|
|
|
|
let cluster = level.GetCluster();
|
|
|
|
if (cluster != null) basetex = cluster.InterBackground;
|
|
|
|
}
|
|
|
|
if (basetex.length() == 0) basetex = "BONUSSCREEN";
|
2021-04-23 12:19:25 +00:00
|
|
|
texBg = TexMan.CheckForTexture(basetex);
|
|
|
|
for(int i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
String otex = String.Format("%s_O%d", basetex, i+1);
|
|
|
|
texOv[i] = TexMan.CheckForTexture(otex);
|
|
|
|
}
|
2021-04-23 14:03:25 +00:00
|
|
|
lastmapname = level.DisplayName();
|
2021-04-23 12:19:25 +00:00
|
|
|
speech = -1;
|
|
|
|
displaystate = 0;
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override bool OnEvent(InputEvent ev)
|
|
|
|
{
|
2021-05-22 00:15:49 +00:00
|
|
|
if (ev.type == InputEvent.Type_KeyDown && !System.specialKeyEvent(ev))
|
2021-04-23 12:19:25 +00:00
|
|
|
{
|
|
|
|
if ((displaystate & printStatsAll) != printStatsAll)
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-23 12:19:25 +00:00
|
|
|
displaystate = printStatsAll;
|
|
|
|
}
|
|
|
|
else if (!(displaystate & dukeAnim))
|
|
|
|
{
|
|
|
|
displaystate |= dukeAnim;
|
|
|
|
dukeAnimStart = ticks;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("SHOTGUN_COCK", CHAN_AUTO, CHANF_UI);
|
|
|
|
static const Sound speeches[] = { "BONUS_SPEECH1", "BONUS_SPEECH2", "BONUS_SPEECH3", "BONUS_SPEECH4" };
|
2021-04-23 12:19:25 +00:00
|
|
|
speech = speeches[random(0, 3)];
|
|
|
|
Duke.PlaySound(speech, CHAN_AUTO, CHANF_UI, 1);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-01-14 09:00:37 +00:00
|
|
|
private void CalcLayout()
|
|
|
|
{
|
|
|
|
static const String texts[] = { "$TXT_YourTime", "$TXT_ParTime", "$TXT_3DRTIME", "$TXT_EnemiesKilled", "$TXT_EnemiesLeft", "$TXT_SECFND", "$TXT_SECMISS" };
|
|
|
|
let myfont = Raze.PickSmallFont();
|
|
|
|
let fact = screen.GetAspectRatio();
|
|
|
|
let vwidth = 320 * 0.75 * fact;
|
|
|
|
let left = 5 + (320 - vwidth) / 2;
|
|
|
|
let twidth = 0.0;
|
|
|
|
|
|
|
|
text_x = 10;
|
|
|
|
val_x = 151;
|
|
|
|
for(int i = 0; i < texts.size(); i++)
|
|
|
|
{
|
|
|
|
twidth = max(twidth, myfont.StringWidth(texts[i]));
|
|
|
|
}
|
|
|
|
if (twidth > 140 && twidth < 156)
|
|
|
|
{
|
|
|
|
val_x += twidth - 140;
|
|
|
|
}
|
2023-01-14 09:37:07 +00:00
|
|
|
else if (twidth >= 156)
|
2023-01-14 09:00:37 +00:00
|
|
|
{
|
|
|
|
val_x = 166;
|
|
|
|
text_x -= twidth - 156;
|
|
|
|
if (text_x < left)
|
|
|
|
{
|
|
|
|
val_x += left - text_x;
|
|
|
|
text_x = left;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-23 12:19:25 +00:00
|
|
|
override void Start()
|
|
|
|
{
|
|
|
|
Duke.PlayBonusMusic();
|
|
|
|
}
|
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
2023-01-14 09:00:37 +00:00
|
|
|
CalcLayout();
|
2021-04-23 12:19:25 +00:00
|
|
|
if ((displaystate & printStatsAll) != printStatsAll)
|
|
|
|
{
|
|
|
|
if (ticks == 15 * 3)
|
|
|
|
{
|
|
|
|
displaystate |= printTimeText;
|
|
|
|
}
|
|
|
|
else if (ticks == 15 * 4)
|
|
|
|
{
|
|
|
|
displaystate |= printTimeVal;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
else if (ticks == 15 * 6)
|
|
|
|
{
|
|
|
|
displaystate |= printKillsText;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("FLY_BY", CHAN_AUTO, CHANF_UI);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
else if (ticks == 15 * 7)
|
|
|
|
{
|
|
|
|
displaystate |= printKillsVal;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
else if (ticks == 15 * 9)
|
|
|
|
{
|
|
|
|
displaystate |= printSecretsText;
|
|
|
|
}
|
|
|
|
else if (ticks == 15 * 10)
|
|
|
|
{
|
|
|
|
displaystate |= printSecretsVal;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("PIPEBOMB_EXPLODE", CHAN_AUTO, CHANF_UI);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (displaystate & dukeAnim)
|
|
|
|
{
|
|
|
|
if (ticks >= dukeAnimStart + 60)
|
|
|
|
{
|
|
|
|
displaystate ^= dukeAnim | dukeWait;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (displaystate & dukeWait)
|
|
|
|
{
|
|
|
|
if (speech <= 0 || !Duke.CheckSoundPlaying(speech))
|
|
|
|
jobstate = finished;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintTime()
|
|
|
|
{
|
|
|
|
String tempbuf;
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(text_x, 59 + 9, "$TXT_YourTime", 0);
|
|
|
|
Duke.GameText(text_x, 69 + 9, "$TXT_ParTime", 0);
|
2023-01-01 17:22:08 +00:00
|
|
|
if (!isNamWW2GI())
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(text_x, 79 + 9, "$TXT_3DRTIME", 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printTimeVal)
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = FormatTime(stats.time);
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 59 + 9, tempbuf, 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
2021-04-29 14:16:04 +00:00
|
|
|
tempbuf = FormatTime(level.parTime);
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 69 + 9, tempbuf, 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
2023-01-01 17:22:08 +00:00
|
|
|
if (!isNamWW2GI())
|
2021-04-23 12:19:25 +00:00
|
|
|
{
|
2021-04-29 14:16:04 +00:00
|
|
|
tempbuf = FormatTime(level.designerTime);
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 79 + 9, tempbuf, 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintKills()
|
|
|
|
{
|
|
|
|
String tempbuf;
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(text_x, 94 + 9, "$TXT_EnemiesKilled", 0);
|
|
|
|
Duke.GameText(text_x, 104 + 9, "$TXT_EnemiesLeft", 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printKillsVal)
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", stats.kills);
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 94 + 9, tempbuf, 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
2021-04-26 00:00:40 +00:00
|
|
|
if (stats.maxkills < 0)
|
2021-04-23 12:19:25 +00:00
|
|
|
{
|
|
|
|
tempbuf = "$TXT_N_A";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", max(0, stats.maxkills - stats.kills));
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 104 + 9, tempbuf, 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintSecrets()
|
|
|
|
{
|
|
|
|
String tempbuf;
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(text_x, 119 + 9, "$TXT_SECFND", 0);
|
|
|
|
Duke.GameText(text_x, 129 + 9, "$TXT_SECMISS", 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printSecretsVal)
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", stats.secrets);
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 119 + 9, tempbuf, 0);
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", max(0, stats.maxsecrets - stats.secrets));
|
2023-01-14 09:00:37 +00:00
|
|
|
Duke.GameText(val_x, 129 + 9, tempbuf, 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double sr)
|
|
|
|
{
|
|
|
|
Screen.DrawTexture(texBg, true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal);
|
|
|
|
|
2021-04-27 22:51:28 +00:00
|
|
|
Duke.GameText(160, 190, "$PRESSKEY", 8 - (sin(ticks * 4) * 8), 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
|
|
|
|
if (displaystate & dukeAnim)
|
|
|
|
{
|
|
|
|
switch (((ticks - dukeAnimStart) >> 2) % 15)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
Screen.DrawTexture(texOv[2], true, 199, 31, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TopLeft, true);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
Screen.DrawTexture(texOv[3], true, 199, 31, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TopLeft, true);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!(displaystate & dukeWait))
|
|
|
|
{
|
|
|
|
switch((ticks >> 3) & 3)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 3:
|
|
|
|
Screen.DrawTexture(texOv[0], true, 199, 31, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TopLeft, true);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
Screen.DrawTexture(texOv[1], true, 199, 31, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TopLeft, true);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-14 09:00:37 +00:00
|
|
|
if (displaystate & printTimeText)
|
|
|
|
{
|
|
|
|
PrintTime();
|
|
|
|
}
|
|
|
|
if (displaystate & printKillsText)
|
|
|
|
{
|
|
|
|
PrintKills();
|
|
|
|
}
|
|
|
|
if (displaystate & printSecretsText)
|
|
|
|
{
|
|
|
|
PrintSecrets();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-27 22:51:28 +00:00
|
|
|
if (lastmapname) Duke.BigText(160, 20 - 6, lastmapname, 0);
|
|
|
|
Duke.BigText(160, 36 - 6, "$Completed", 0);
|
2021-04-23 12:19:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-04-23 14:03:25 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2021-04-27 22:51:28 +00:00
|
|
|
//
|
2021-04-23 14:03:25 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class RRLevelSummaryScreen : SummaryScreenBase
|
|
|
|
{
|
|
|
|
String lastmapname;
|
2022-11-24 20:27:08 +00:00
|
|
|
Sound speech;
|
2021-04-23 14:03:25 +00:00
|
|
|
int displaystate;
|
|
|
|
int exitSoundStart;
|
|
|
|
TextureID texBg;
|
|
|
|
|
2023-01-14 09:37:07 +00:00
|
|
|
double text_x;
|
|
|
|
double val_x;
|
|
|
|
double val_x2;
|
|
|
|
double press_x;
|
|
|
|
double map_x;
|
|
|
|
|
|
|
|
|
2021-04-23 14:03:25 +00:00
|
|
|
enum EFlags
|
|
|
|
{
|
|
|
|
printTimeText = 1,
|
|
|
|
printTimeVal = 2,
|
|
|
|
printKillsText = 4,
|
|
|
|
printKillsVal = 8,
|
|
|
|
printSecretsText = 16,
|
|
|
|
printSecretsVal = 32,
|
|
|
|
printStatsAll = 63,
|
|
|
|
exitSound = 64,
|
|
|
|
exitWait = 128,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-04-27 22:51:28 +00:00
|
|
|
ScreenJob Init(MapRecord m, SummaryInfo s, bool dofadeout = true)
|
2021-04-23 14:03:25 +00:00
|
|
|
{
|
|
|
|
Super.Init(dofadeout? (fadein | fadeout) : fadein);
|
2021-04-27 22:51:28 +00:00
|
|
|
SetParameters(m, s);
|
2021-05-02 11:12:24 +00:00
|
|
|
String basetex = level.InterBackground;
|
|
|
|
if (basetex.length() == 0)
|
|
|
|
{
|
|
|
|
let cluster = level.GetCluster();
|
|
|
|
if (cluster != null) basetex = cluster.InterBackground;
|
|
|
|
}
|
|
|
|
if (basetex.length() == 0) basetex = "BONUSPIC01";
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-04-23 14:03:25 +00:00
|
|
|
lastmapname = level.DisplayName();
|
2021-05-02 11:12:24 +00:00
|
|
|
texBg = TexMan.CheckForTexture(basetex);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override bool OnEvent(InputEvent ev)
|
|
|
|
{
|
2021-05-22 00:15:49 +00:00
|
|
|
if (ev.type == InputEvent.Type_KeyDown && !System.specialKeyEvent(ev))
|
2021-04-23 14:03:25 +00:00
|
|
|
{
|
|
|
|
if ((displaystate & printStatsAll) != printStatsAll)
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("FART1", CHAN_AUTO, CHANF_UI);
|
2021-04-23 14:03:25 +00:00
|
|
|
displaystate = printStatsAll;
|
|
|
|
}
|
|
|
|
else if (!(displaystate & exitSound))
|
|
|
|
{
|
|
|
|
displaystate |= exitSound;
|
|
|
|
exitSoundStart = ticks;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("CHUG", CHAN_AUTO, CHANF_UI);
|
|
|
|
static const Sound speeches[] = { "BONUS_SPEECH1", "BONUS_SPEECH2", "BONUS_SPEECH3", "BONUS_SPEECH4" };
|
2021-04-23 14:03:25 +00:00
|
|
|
speech = speeches[random(0, 3)];
|
|
|
|
Duke.PlaySound(speech, CHAN_AUTO, CHANF_UI);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-01-14 09:37:07 +00:00
|
|
|
private void CalcLayout()
|
|
|
|
{
|
|
|
|
static const String texts[] = { "$TXT_YerTime", "$TXT_ParTime", "$TXT_XTRTIME"};
|
|
|
|
static const String texts2[] = { "$TXT_VarmintsKilled", "$TXT_VarmintsLeft", "$TXT_SECFND", "$TXT_SECMISS" };
|
|
|
|
let myfont = Raze.PickBigFont();
|
|
|
|
let fact = screen.GetAspectRatio();
|
|
|
|
let vwidth = 320 * 0.75 * fact;
|
|
|
|
let left = 5 + (320 - vwidth) / 2;
|
|
|
|
let twidth = 0.0;
|
|
|
|
let twidth1 = 0.0;
|
|
|
|
|
|
|
|
text_x = 30;
|
|
|
|
val_x = 191;
|
|
|
|
val_x2 = 231;
|
|
|
|
for(int i = 0; i < texts.size(); i++)
|
|
|
|
{
|
|
|
|
twidth1 = max(twidth1, 0.35 * myfont.StringWidth(texts[i]));
|
|
|
|
}
|
|
|
|
for(int i = 0; i < texts2.size(); i++)
|
|
|
|
{
|
|
|
|
twidth = max(twidth, 0.35 * myfont.StringWidth(texts2[i]));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (twidth1 > 155 && twidth1 < 190 && twidth < 230)
|
|
|
|
{
|
|
|
|
Console.printf("small case: %f, %f", twidth, val_x);
|
|
|
|
val_x = val_x2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
twidth = max(twidth, twidth1 + 40);
|
|
|
|
|
|
|
|
if (twidth >= 195 && twidth < 230)
|
|
|
|
{
|
|
|
|
val_x2 += twidth - 195;
|
|
|
|
val_x = val_x2;
|
|
|
|
}
|
|
|
|
else if (twidth >= 230)
|
|
|
|
{
|
|
|
|
val_x2 = 266;
|
|
|
|
text_x -= twidth - 230;
|
|
|
|
if (text_x < left)
|
|
|
|
{
|
|
|
|
val_x2 += left - text_x;
|
|
|
|
text_x = left;
|
|
|
|
}
|
|
|
|
val_x = val_x2;
|
|
|
|
}
|
|
|
|
|
|
|
|
map_x = 80;
|
|
|
|
let w = myfont.StringWidth(lastmapname) * 0.35;
|
|
|
|
if (w > 320) map_x = -(w - 320) / 2;
|
|
|
|
else if (w > 240) map_x = (320 - w) / 2;
|
|
|
|
|
|
|
|
press_x = 15;
|
|
|
|
w = myfont.StringWidth("$PRESSKEY") * 0.35;
|
|
|
|
if (w > 320) press_x = -(w - 320) / 2;
|
|
|
|
else if (w > 300) press_x = (320 - w) / 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-23 14:03:25 +00:00
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
if ((displaystate & printStatsAll) != printStatsAll)
|
|
|
|
{
|
|
|
|
if (ticks == 15 * 3)
|
|
|
|
{
|
|
|
|
displaystate |= printTimeText;
|
|
|
|
}
|
|
|
|
else if (ticks == 15 * 4)
|
|
|
|
{
|
|
|
|
displaystate |= printTimeVal;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("FART1", CHAN_AUTO, CHANF_UI);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
else if (ticks == 15 * 6)
|
|
|
|
{
|
|
|
|
displaystate |= printKillsText;
|
|
|
|
}
|
|
|
|
else if (ticks == 15 * 7)
|
|
|
|
{
|
|
|
|
displaystate |= printKillsVal;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("FART1", CHAN_AUTO, CHANF_UI);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
else if (ticks == 15 * 9)
|
|
|
|
{
|
|
|
|
displaystate |= printSecretsText;
|
|
|
|
}
|
|
|
|
else if (ticks == 15 * 10)
|
|
|
|
{
|
|
|
|
displaystate |= printSecretsVal;
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("FART1", CHAN_AUTO, CHANF_UI);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (displaystate & exitSound)
|
|
|
|
{
|
|
|
|
if (ticks >= exitSoundStart + 60)
|
|
|
|
{
|
|
|
|
displaystate ^= exitSound | exitWait;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (displaystate & exitWait)
|
|
|
|
{
|
|
|
|
if (speech <= 0 || !Duke.CheckSoundPlaying(speech))
|
|
|
|
jobstate = finished;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintTime()
|
|
|
|
{
|
|
|
|
String tempbuf;
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(text_x, 48, "$TXT_YerTime", -1);
|
|
|
|
Duke.BigText(text_x, 64, "$TXT_ParTime", -1);
|
|
|
|
Duke.BigText(text_x, 80, "$TXT_XTRTIME", -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printTimeVal)
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = FormatTime(stats.time);
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x, 48, tempbuf, -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
|
2021-04-29 14:16:04 +00:00
|
|
|
tempbuf = FormatTime(level.parTime);
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x, 64, tempbuf, -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
|
2021-04-29 14:16:04 +00:00
|
|
|
tempbuf = FormatTime(level.designerTime);
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x, 80, tempbuf, -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintKills()
|
|
|
|
{
|
|
|
|
String tempbuf;
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(text_x, 112, "$TXT_VarmintsKilled", -1);
|
|
|
|
Duke.BigText(text_x, 128, "$TXT_VarmintsLeft", -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printKillsVal)
|
|
|
|
{
|
2021-04-27 22:59:07 +00:00
|
|
|
tempbuf = String.Format("%-3d", stats.kills);
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x2, 112, tempbuf, -1);
|
2021-04-26 00:00:40 +00:00
|
|
|
if (stats.maxkills < 0)
|
2021-04-23 14:03:25 +00:00
|
|
|
{
|
|
|
|
tempbuf = "$TXT_N_A";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", max(0, stats.maxkills - stats.kills));
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x2, 128, tempbuf, -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintSecrets()
|
|
|
|
{
|
|
|
|
String tempbuf;
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(text_x, 144, "$TXT_SECFND", -1);
|
|
|
|
Duke.BigText(text_x, 160, "$TXT_SECMISS", -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printSecretsVal)
|
|
|
|
{
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", stats.secrets);
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x2, 144, tempbuf, -1);
|
2021-04-26 00:00:40 +00:00
|
|
|
tempbuf = String.Format("%-3d", max(0, stats.maxsecrets - stats.secrets));
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(val_x2, 160, tempbuf, -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double sr)
|
|
|
|
{
|
2023-01-14 09:37:07 +00:00
|
|
|
CalcLayout();
|
2021-04-23 14:03:25 +00:00
|
|
|
Screen.DrawTexture(texBg, true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal);
|
|
|
|
|
2023-01-14 09:37:07 +00:00
|
|
|
Duke.BigText(map_x, 16, lastmapname, -1);
|
|
|
|
Duke.BigText(press_x, 192, "$PRESSKEY", -1);
|
2021-04-23 14:03:25 +00:00
|
|
|
|
|
|
|
if (displaystate & printTimeText)
|
|
|
|
{
|
|
|
|
PrintTime();
|
|
|
|
}
|
|
|
|
if (displaystate & printKillsText)
|
|
|
|
{
|
|
|
|
PrintKills();
|
|
|
|
}
|
|
|
|
if (displaystate & printSecretsText)
|
|
|
|
{
|
|
|
|
PrintSecrets();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class RRRAEndOfGame : SkippableScreenJob
|
|
|
|
{
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init()
|
2021-04-23 14:03:25 +00:00
|
|
|
{
|
|
|
|
Super.Init(fadein|fadeout);
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnSkip()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.StopSound("LN_FINAL");
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Start()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
Duke.PlaySound("LN_FINAL", CHAN_AUTO, CHANF_UI);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
2022-11-24 20:27:08 +00:00
|
|
|
if (!Duke.CheckSoundPlaying("LN_FINAL") && ticks > 15 * GameTicRate) jobstate = finished; // make sure it stays, even if sound is off.
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Draw(double sr)
|
|
|
|
{
|
|
|
|
let tex = TexMan.CheckForTexture(((ticks >> 2) & 1)? "ENDGAME2" : "ENDGAME");
|
|
|
|
Screen.DrawTexture(tex, true, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-23 12:26:29 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class DukeLoadScreen : ScreenJob
|
|
|
|
{
|
|
|
|
MapRecord rec;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-04-25 19:52:58 +00:00
|
|
|
ScreenJob Init(MapRecord maprec)
|
2021-04-23 12:26:29 +00:00
|
|
|
{
|
2021-04-27 23:12:07 +00:00
|
|
|
Super.Init(fadein);
|
2021-04-23 12:26:29 +00:00
|
|
|
rec = maprec;
|
2021-04-25 19:52:58 +00:00
|
|
|
return self;
|
2021-04-23 12:26:29 +00:00
|
|
|
}
|
2021-04-27 23:12:07 +00:00
|
|
|
|
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
if (fadestate == visible) jobstate = finished;
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-04-23 12:26:29 +00:00
|
|
|
override void Draw(double sr)
|
|
|
|
{
|
|
|
|
Screen.DrawTexture(TexMan.CheckForTexture("LOADSCREEN"), false, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal);
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2023-01-01 17:22:08 +00:00
|
|
|
if (!isRR())
|
2021-04-23 14:03:25 +00:00
|
|
|
{
|
2021-05-01 18:14:30 +00:00
|
|
|
Duke.BigText(160, 90, (rec.flags & MapRecord.USERMAP)? "$TXT_LOADUM" : "$TXT_LOADING", 0);
|
|
|
|
Duke.BigText(160, 114, rec.DisplayName(), 0);
|
2021-04-23 14:03:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
int y = isRRRA()? 140 : 90;
|
2021-04-23 14:03:25 +00:00
|
|
|
Duke.BigText(160, y, (rec.flags & MapRecord.USERMAP)? "$TXT_ENTRUM" : "$TXT_ENTERIN", 0);
|
|
|
|
Duke.BigText(160, y+24, rec.DisplayName(), 0);
|
|
|
|
}
|
2021-04-23 12:26:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|