mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-02 00:53:16 +00:00
- implemented the game progression interface.
This commit is contained in:
parent
9952e6d2b0
commit
30e96293cf
7 changed files with 73 additions and 47 deletions
|
@ -839,10 +839,6 @@ int32_t md_undefinemodel(int32_t modelid);
|
||||||
|
|
||||||
int32_t loaddefinitionsfile(const char *fn, bool loadadds = false);
|
int32_t loaddefinitionsfile(const char *fn, bool loadadds = false);
|
||||||
|
|
||||||
// if loadboard() fails with -2 return, try loadoldboard(). if it fails with
|
|
||||||
// -2, board is dodgy
|
|
||||||
int32_t engineLoadBoardV5V6(const char *filename, char fromwhere, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum);
|
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
# include "polymost.h"
|
# include "polymost.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -582,9 +582,7 @@ void InitItems()
|
||||||
|
|
||||||
{
|
{
|
||||||
if (isWh2()) {
|
if (isWh2()) {
|
||||||
startWh2Ending([](bool) {
|
CompleteLevel(nullptr);
|
||||||
gameaction = ga_mainmenu;
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plr.treasure[THORNEDSKULL] = 1;
|
plr.treasure[THORNEDSKULL] = 1;
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include "v_draw.h"
|
#include "v_draw.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "mmulti.h"
|
#include "mmulti.h"
|
||||||
|
#include "raze_music.h"
|
||||||
|
#include "statistics.h"
|
||||||
|
|
||||||
BEGIN_WH_NS
|
BEGIN_WH_NS
|
||||||
|
|
||||||
|
@ -338,6 +340,69 @@ void GameInterface::Ticker()
|
||||||
r_NoInterpolate = false;
|
r_NoInterpolate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameInterface::LevelCompleted(MapRecord* map, int skill)
|
||||||
|
{
|
||||||
|
if (map)
|
||||||
|
{
|
||||||
|
STAT_Update(false);
|
||||||
|
auto pplr = &player[pyrn];
|
||||||
|
auto completion = [=](bool)
|
||||||
|
{
|
||||||
|
spritesound(S_CHAINDOOR1, &sprite[pplr->spritenum]);
|
||||||
|
playertorch = 0;
|
||||||
|
spritesound(S_WARP, &sprite[pplr->spritenum]);
|
||||||
|
};
|
||||||
|
if (isWh2()) {
|
||||||
|
showStatisticsScreen(completion);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
completion(false);
|
||||||
|
}
|
||||||
|
else if (!isWh2())
|
||||||
|
{
|
||||||
|
STAT_Update(true);
|
||||||
|
showVictoryScreen([=](bool)
|
||||||
|
{
|
||||||
|
gameaction = ga_mainmenu;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
STAT_Update(true);
|
||||||
|
startWh2Ending([](bool) {
|
||||||
|
gameaction = ga_mainmenu;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameInterface::NextLevel(MapRecord* map, int skill)
|
||||||
|
{
|
||||||
|
mapon = map->levelNumber;
|
||||||
|
currentLevel = map;
|
||||||
|
difficulty = skill;
|
||||||
|
nextlevel = true;
|
||||||
|
prepareboard(currentLevel->fileName);
|
||||||
|
STAT_NewLevel(currentLevel->labelName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GameInterface::NewGame(MapRecord* map, int skill)
|
||||||
|
{
|
||||||
|
//pNet.ready2send = false;
|
||||||
|
//game.nNetMode = NetMode.Single;
|
||||||
|
|
||||||
|
mapon = map->levelNumber;
|
||||||
|
currentLevel = map;
|
||||||
|
difficulty = skill;
|
||||||
|
justteleported = false;
|
||||||
|
nextlevel = false;
|
||||||
|
Mus_Stop();
|
||||||
|
prepareboard(currentLevel->fileName);
|
||||||
|
STAT_StartNewGame(isWh2() ? "Witchaven2" : "Witchaven", skill);
|
||||||
|
STAT_NewLevel(currentLevel->labelName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GameInterface::MenuSound(EMenuSounds snd)
|
void GameInterface::MenuSound(EMenuSounds snd)
|
||||||
{
|
{
|
||||||
if (!isWh2()) SND_Sound(85);
|
if (!isWh2()) SND_Sound(85);
|
||||||
|
|
|
@ -273,7 +273,6 @@ void setdelayfunc(int item, int delay);
|
||||||
|
|
||||||
extern boolean nextlevel;
|
extern boolean nextlevel;
|
||||||
|
|
||||||
void loadnewlevel(int mapon);
|
|
||||||
void preparesectors();
|
void preparesectors();
|
||||||
boolean prepareboard(const char* fname);
|
boolean prepareboard(const char* fname);
|
||||||
|
|
||||||
|
@ -543,9 +542,9 @@ struct GameInterface : public ::GameInterface
|
||||||
void Ticker() override;
|
void Ticker() override;
|
||||||
const char* GenericCheat(int player, int cheat) override;
|
const char* GenericCheat(int player, int cheat) override;
|
||||||
const char* CheckCheatMode() override;
|
const char* CheckCheatMode() override;
|
||||||
//void NextLevel(MapRecord* map, int skill) override;
|
void NextLevel(MapRecord* map, int skill) override;
|
||||||
//void NewGame(MapRecord* map, int skill) override;
|
void NewGame(MapRecord* map, int skill) override;
|
||||||
//void LevelCompleted(MapRecord* map, int skill) override;
|
void LevelCompleted(MapRecord* map, int skill) override;
|
||||||
//bool DrawAutomapPlayer(int x, int y, int z, int a) override;
|
//bool DrawAutomapPlayer(int x, int y, int z, int a) override;
|
||||||
//int playerKeyMove() override { return 40; }
|
//int playerKeyMove() override { return 40; }
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "ns.h"
|
#include "ns.h"
|
||||||
#include "wh.h"
|
#include "wh.h"
|
||||||
#include "gamestate.h"
|
#include "gamestate.h"
|
||||||
|
#include "mapinfo.h"
|
||||||
|
|
||||||
BEGIN_WH_NS
|
BEGIN_WH_NS
|
||||||
|
|
||||||
|
@ -461,33 +462,12 @@ void teleporter() {
|
||||||
switch (sector[plr.sector].hitag) {
|
switch (sector[plr.sector].hitag) {
|
||||||
case 1: // NEXTLEVEL
|
case 1: // NEXTLEVEL
|
||||||
justteleported = true;
|
justteleported = true;
|
||||||
|
CompleteLevel(currentLevel);
|
||||||
if(isWh2()) {
|
|
||||||
auto pplr = &plr;
|
|
||||||
showStatisticsScreen([=](bool)
|
|
||||||
{
|
|
||||||
mapon++;
|
|
||||||
spritesound(S_CHAINDOOR1, &sprite[pplr->spritenum]);
|
|
||||||
playertorch = 0;
|
|
||||||
spritesound(S_WARP, &sprite[pplr->spritenum]);
|
|
||||||
loadnewlevel(mapon);
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
mapon++;
|
|
||||||
spritesound(S_CHAINDOOR1, &sprite[plr.spritenum]);
|
|
||||||
playertorch = 0;
|
|
||||||
spritesound(S_WARP, &sprite[plr.spritenum]);
|
|
||||||
loadnewlevel(mapon);
|
|
||||||
break;
|
break;
|
||||||
case 2: // ENDOFDEMO
|
case 2: // ENDOFDEMO
|
||||||
spritesound(S_THUNDER1, &sprite[plr.spritenum]);
|
spritesound(S_THUNDER1, &sprite[plr.spritenum]);
|
||||||
justteleported = true;
|
justteleported = true;
|
||||||
showVictoryScreen([=](bool)
|
CompleteLevel(nullptr);
|
||||||
{
|
|
||||||
gameaction = ga_mainmenu;
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -9,18 +9,6 @@ BEGIN_WH_NS
|
||||||
|
|
||||||
boolean nextlevel;
|
boolean nextlevel;
|
||||||
|
|
||||||
void loadnewlevel(int mapon) {
|
|
||||||
#if 0
|
|
||||||
MapInfo nextmap;
|
|
||||||
if(gCurrentEpisode != nullptr && (nextmap = gCurrentEpisode.getMap(mapon)) != nullptr) {
|
|
||||||
boardfilename = nextmap.path;
|
|
||||||
Console.Println("Entering level " + boardfilename);
|
|
||||||
nextlevel = true;
|
|
||||||
gGameScreen.loadboard(boardfilename, nullptr);
|
|
||||||
} else game.show();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void preparesectors() {
|
void preparesectors() {
|
||||||
int endwall, j, k = 0, startwall;
|
int endwall, j, k = 0, startwall;
|
||||||
int dax, day;
|
int dax, day;
|
||||||
|
|
|
@ -23,7 +23,7 @@ int damage_vel, damage_svel, damage_angvel;
|
||||||
void viewBackupPlayerLoc( int nPlayer )
|
void viewBackupPlayerLoc( int nPlayer )
|
||||||
{
|
{
|
||||||
SPRITE& pSprite = sprite[player[nPlayer].spritenum];
|
SPRITE& pSprite = sprite[player[nPlayer].spritenum];
|
||||||
PLOCATION pPLocation = gPrevPlayerLoc[nPlayer];
|
PLOCATION& pPLocation = gPrevPlayerLoc[nPlayer];
|
||||||
pPLocation.x = pSprite.x;
|
pPLocation.x = pSprite.x;
|
||||||
pPLocation.y = pSprite.y;
|
pPLocation.y = pSprite.y;
|
||||||
pPLocation.z = player[nPlayer].z;
|
pPLocation.z = player[nPlayer].z;
|
||||||
|
|
Loading…
Reference in a new issue