diff options
-rw-r--r-- | src/hexen/d_net.c | 2 | ||||
-rw-r--r-- | src/hexen/g_game.c | 7 | ||||
-rw-r--r-- | src/hexen/h2_main.c | 46 | ||||
-rw-r--r-- | src/hexen/p_inter.c | 6 | ||||
-rw-r--r-- | src/hexen/p_setup.c | 8 | ||||
-rw-r--r-- | src/hexen/p_switch.c | 23 | ||||
-rw-r--r-- | src/hexen/sb_bar.c | 33 |
7 files changed, 118 insertions, 7 deletions
diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c index 5bd0eed0..6dd0b74d 100644 --- a/src/hexen/d_net.c +++ b/src/hexen/d_net.c @@ -172,7 +172,7 @@ static void InitConnectData(net_connect_data_t *connect_data) connect_data->lowres_turn = false; connect_data->drone = false; - connect_data->max_players = MAXPLAYERS; + connect_data->max_players = (gamemode == shareware) ? 4 : MAXPLAYERS; //! // @category net diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index 3593ffe2..04e0e5af 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -1471,6 +1471,13 @@ void G_SecretExitLevel (void) void G_Completed(int map, int position) { + if (gamemode == shareware && map > 4) + { + P_SetMessage(&players[consoleplayer], "ACCESS DENIED -- DEMO", true); + S_StartSound(NULL, SFX_CHAT); + return; + } + gameaction = ga_completed; LeaveMap = map; LeavePosition = position; diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 9d92a65b..c907d29c 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -93,6 +93,7 @@ extern boolean askforquit; // PUBLIC DATA DEFINITIONS ------------------------------------------------- GameMode_t gamemode; +char *gamedescription; char *iwadfile; static char demolumpname[9]; // Demo lump to start playing. boolean nomonsters; // checkparm of -nomonsters @@ -253,6 +254,45 @@ static void D_AddFile(char *filename) W_AddFile(filename); } +// Find out what version of Hexen is playing. + +void D_IdentifyVersion(void) +{ + // The Hexen Shareware, ne 4 Level Demo Version, is missing the SKY1 lump + // and uses the SKY2 lump instead. Let's use this fact and the missing + // levels from MAP05 onward to identify it and set gamemode accordingly. + + if (W_CheckNumForName("SKY1") == -1 && + W_CheckNumForName("MAP05") == -1 ) + { + gamemode = shareware; + } +} + +// Set the gamedescription string. + +void D_SetGameDescription(void) +{ +/* + NB: The 4 Level Demo Version actually prints a four-lined banner + (and indeed waits for a keypress): + + Hexen: Beyond Heretic + + 4 Level Demo Version + Press any key to continue. +*/ + + if (gamemode == shareware) + { + gamedescription = "Hexen: 4 Level Demo Version"; + } + else + { + gamedescription = "Hexen"; + } +} + //========================================================================== // // H2_Main @@ -332,11 +372,13 @@ void D_DoomMain(void) D_AddFile(iwadfile); W_CheckCorrectIWAD(hexen); + D_IdentifyVersion(); + D_SetGameDescription(); AdjustForMacIWAD(); HandleArgs(); - I_PrintStartupBanner("Hexen"); + I_PrintStartupBanner(gamedescription); ST_Message("MN_Init: Init menu system.\n"); MN_Init(); @@ -664,7 +706,7 @@ void H2_GameLoop(void) M_snprintf(filename, sizeof(filename), "debug%i.txt", consoleplayer); debugfile = fopen(filename, "w"); } - I_SetWindowTitle("Hexen"); + I_SetWindowTitle(gamedescription); I_GraphicsCheckCommandLine(); I_SetGrabMouseCallback(D_GrabMouseCallback); I_InitGraphics(); diff --git a/src/hexen/p_inter.c b/src/hexen/p_inter.c index 587614ff..4f1ecda8 100644 --- a/src/hexen/p_inter.c +++ b/src/hexen/p_inter.c @@ -747,6 +747,12 @@ static void TryPickupArtifact(player_t * player, artitype_t artifactType, TXT_ARTIPUZZGEAR }; + if (gamemode == shareware) + { + artifactMessages[arti_blastradius] = TXT_ARTITELEPORT; + artifactMessages[arti_teleport] = TXT_ARTIBLASTRADIUS; + } + if (P_GiveArtifact(player, artifactType, artifact)) { if (artifact->special) diff --git a/src/hexen/p_setup.c b/src/hexen/p_setup.c index 1ff6cef5..428e6166 100644 --- a/src/hexen/p_setup.c +++ b/src/hexen/p_setup.c @@ -796,16 +796,22 @@ static void InitMapInfo(void) int mcmdValue; mapInfo_t *info; char songMulch[10]; + char *default_sky_name = DEFAULT_SKY_NAME; mapMax = 1; + if (gamemode == shareware) + { + default_sky_name = "SKY2"; + } + // Put defaults into MapInfo[0] info = MapInfo; info->cluster = 0; info->warpTrans = 0; info->nextMap = 1; // Always go to map 1 if not specified info->cdTrack = 1; - info->sky1Texture = R_TextureNumForName(DEFAULT_SKY_NAME); + info->sky1Texture = R_TextureNumForName(default_sky_name); info->sky2Texture = info->sky1Texture; info->sky1ScrollDelta = 0; info->sky2ScrollDelta = 0; diff --git a/src/hexen/p_switch.c b/src/hexen/p_switch.c index 9d86f92a..a90269a7 100644 --- a/src/hexen/p_switch.c +++ b/src/hexen/p_switch.c @@ -25,7 +25,14 @@ // CHANGE THE TEXTURE OF A WALL SWITCH TO ITS OPPOSITE // //================================================================== -switchlist_t alphSwitchList[] = { +switchlist_t alphSwitchListDemo[] = { + {"SW_1_UP", "SW_1_DN", SFX_SWITCH1}, + {"SW_2_UP", "SW_2_DN", SFX_SWITCH1}, + {"SW52_OFF", "SW52_ON", SFX_SWITCH2}, + {"\0", "\0", 0} +}; + +switchlist_t alphSwitchListFull[] = { {"SW_1_UP", "SW_1_DN", SFX_SWITCH1}, {"SW_2_UP", "SW_2_DN", SFX_SWITCH1}, {"VALVE1", "VALVE2", SFX_VALVE_TURN}, @@ -39,6 +46,8 @@ switchlist_t alphSwitchList[] = { {"\0", "\0", 0} }; +switchlist_t *alphSwitchList = NULL; + int switchlist[MAXSWITCHES * 2]; int numswitches; button_t buttonlist[MAXBUTTONS]; @@ -58,6 +67,18 @@ void P_InitSwitchList(void) int i; int index; + if (!alphSwitchList) + { + if (gamemode == shareware) + { + alphSwitchList = alphSwitchListDemo; + } + else + { + alphSwitchList = alphSwitchListFull; + } + } + for (index = 0, i = 0; i < MAXSWITCHES; i++) { if (!alphSwitchList[i].soundID) diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c index bcc5b675..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); + } } //========================================================================== @@ -314,6 +342,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 +359,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; |