From ad816c1bc28ab81ddb892ff878f65969bddd9764 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 20 Jan 2015 06:53:45 +0100 Subject: First shot at support for the Hexen 4-level Demo With these changes it is possible to run the game using the HEXEN.WAD IWAD from the 4-level Demo and start a new game as one of the three player classes. Known missing bits: - The game does not yet identify itself as the demo version - The cheat codes are still unchanged - Bug compatibility, see e.g. http://dengine.net/dew/index.php?title=Libhexen --- src/hexen/sb_bar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/hexen/sb_bar.c') diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c index bcc5b675..e75edd25 100644 --- a/src/hexen/sb_bar.c +++ b/src/hexen/sb_bar.c @@ -314,6 +314,7 @@ void SB_Init(void) void SB_SetClassData(void) { int class; + int maxplayers = (gamemode == shareware) ? 4 : MAXPLAYERS; class = PlayerClass[consoleplayer]; // original player class (not pig) PatchWEAPONSLOT = W_CacheLumpNum(W_GetNumForName("wpslot0") @@ -330,12 +331,12 @@ void SB_SetClassData(void) if (!netgame) { // single player game uses red life gem (the second gem) PatchLIFEGEM = W_CacheLumpNum(W_GetNumForName("lifegem") - + MAXPLAYERS * class + 1, PU_STATIC); + + maxplayers * class + 1, PU_STATIC); } else { PatchLIFEGEM = W_CacheLumpNum(W_GetNumForName("lifegem") - + MAXPLAYERS * class + consoleplayer, + + maxplayers * class + consoleplayer, PU_STATIC); } SB_state = -1; -- cgit v1.2.3 From 73c2a3bb31ceaad24ac11bbb8c93c2d76291d418 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 2 Feb 2015 09:35:41 +0100 Subject: adapt cheat codes for the demo version --- src/hexen/sb_bar.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/hexen/sb_bar.c') diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c index e75edd25..6ca8fec4 100644 --- a/src/hexen/sb_bar.c +++ b/src/hexen/sb_bar.c @@ -303,6 +303,34 @@ void SB_Init(void) PatchKILLS = W_CacheLumpName("KILLS", PU_STATIC); } SB_SetClassData(); + + if (gamemode == shareware) + { + CheatGodSeq = (cheatseq_t) CHEAT("bgokey", 0); + CheatNoClipSeq = (cheatseq_t) CHEAT("rjohnson", 0); + CheatWeaponsSeq = (cheatseq_t) CHEAT("crhinehart", 0); + CheatHealthSeq = (cheatseq_t) CHEAT("sgurno", 0); + CheatKeysSeq = (cheatseq_t) CHEAT("mraymondjudy", 0); + CheatSoundSeq = (cheatseq_t) CHEAT("kschilder", 0); + CheatTickerSeq = (cheatseq_t) CHEAT("rrettenmund", 0); + CheatArtifactAllSeq = (cheatseq_t) CHEAT("braffel", 0); + CheatPuzzleSeq = (cheatseq_t) CHEAT("tmoore", 0); + CheatWarpSeq = (cheatseq_t) CHEAT("bpelletier", 2); + CheatPigSeq = (cheatseq_t) CHEAT("ebiessman", 0); + CheatMassacreSeq = (cheatseq_t) CHEAT("cstika", 0); + CheatIDKFASeq = (cheatseq_t) CHEAT("rambo", 0); + CheatQuickenSeq1 = (cheatseq_t) CHEAT("quicken", 0); + CheatQuickenSeq2 = (cheatseq_t) CHEAT("quickenquicken", 0); + CheatQuickenSeq3 = (cheatseq_t) CHEAT("quickenquickenquicken", 0); + CheatClass1Seq = (cheatseq_t) CHEAT("plipo", 0); + CheatClass2Seq = (cheatseq_t) CHEAT("plipo", 1); + CheatVersionSeq = (cheatseq_t) CHEAT("pmacarther", 0); + CheatDebugSeq = (cheatseq_t) CHEAT("jsumwalt", 0); + CheatScriptSeq1 = (cheatseq_t) CHEAT("mwagabaza", 0); + CheatScriptSeq2 = (cheatseq_t) CHEAT("mwagabaza", 1); + CheatScriptSeq3 = (cheatseq_t) CHEAT("mwagabaza", 2); + CheatRevealSeq = (cheatseq_t) CHEAT("reveal", 0); + } } //========================================================================== -- cgit v1.2.3 From a64ebd8e36b6cd13f18163d0a3365f4e80d90805 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 30 Mar 2015 16:34:12 +0200 Subject: Turn maxplayers into a global variable ... and decrease its value from MAXPLAYERS (i.e. 8) to 4 if (gamemode == shareware). It seems that it was hard-coded to this value until some time between the releases of the Demo and the Full version. Arrays are still declared with their full width of 8, though, they are just not iterated over the whole range anymore. This fixes playback of the IWAD demos. --- src/hexen/sb_bar.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/hexen/sb_bar.c') diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c index 6ca8fec4..3846f4c6 100644 --- a/src/hexen/sb_bar.c +++ b/src/hexen/sb_bar.c @@ -342,7 +342,6 @@ void SB_Init(void) void SB_SetClassData(void) { int class; - int maxplayers = (gamemode == shareware) ? 4 : MAXPLAYERS; class = PlayerClass[consoleplayer]; // original player class (not pig) PatchWEAPONSLOT = W_CacheLumpNum(W_GetNumForName("wpslot0") @@ -1053,7 +1052,7 @@ void DrawMainBar(void) if (deathmatch) { temp = 0; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { temp += CPlayer->frags[i]; } @@ -1380,7 +1379,7 @@ void DrawFullScreenStuff(void) if (deathmatch) { temp = 0; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { if (playeringame[i]) { -- cgit v1.2.3