- Added Blzut3's patch for a real Chex Quest game mode.

SVN r1188 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-30 19:44:19 +00:00
commit dbcc246cf3
47 changed files with 969 additions and 126 deletions

View file

@ -229,7 +229,7 @@ void CT_Drawer (void)
}
// draw the prompt, text, and cursor
ChatQueue[len] = gameinfo.gametype == GAME_Doom ? '_' : '[';
ChatQueue[len] = gameinfo.gametype & GAME_DoomChex ? '_' : '[';
ChatQueue[len+1] = '\0';
if (con_scaletext < 2)
{

View file

@ -667,7 +667,7 @@ void D_Display ()
FTexture *tex;
int x;
tex = TexMan[gameinfo.gametype & (GAME_Doom|GAME_Strife) ? "M_PAUSE" : "PAUSED"];
tex = TexMan[gameinfo.gametype & (GAME_DoomStrifeChex) ? "M_PAUSE" : "PAUSED"];
x = (SCREENWIDTH - tex->GetWidth()*CleanXfac)/2 +
tex->LeftOffset*CleanXfac;
screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
@ -2457,24 +2457,6 @@ void D_DoomMain (void)
DecalLibrary.Clear ();
DecalLibrary.ReadAllDecals ();
// Patch the game for Chex quest differences
if (gameinfo.flags & GI_CHEX_QUEST)
{
// remove the drop items from the zombie and shotgunguy
// (this could be done with a DECORATE lump but would need
// as much code to load it.)
PClass *info;
info = (PClass*)PClass::FindClass("Zombieman");
if (info) info->Meta.SetMetaInt (ACMETA_DropItems, 0);
info = (PClass*)PClass::FindClass("ShotgunGuy");
if (info) info->Meta.SetMetaInt (ACMETA_DropItems, 0);
int lump = Wads.CheckNumForFullName("chex.deh", 0);
if (lump >= 0) DoDehPatch(NULL, true, lump);
}
// [RH] Try adding .deh and .bex files on the command line.
// If there are none, try adding any in the config file.

View file

@ -393,9 +393,9 @@ void F_TextWrite (void)
return;
// draw some of the text onto the screen
leftmargin = (gameinfo.gametype & (GAME_Doom|GAME_Strife|GAME_Hexen) ? 10 : 20) - 160;
leftmargin = (gameinfo.gametype & (GAME_DoomStrifeChex|GAME_Hexen) ? 10 : 20) - 160;
rowheight = screen->Font->GetHeight () +
(gameinfo.gametype & (GAME_Doom|GAME_Strife) ? 3 : -1);
(gameinfo.gametype & (GAME_DoomStrifeChex) ? 3 : -1);
scale = (CleanXfac != 1 || CleanYfac != 1);
cx = leftmargin;
@ -405,7 +405,7 @@ void F_TextWrite (void)
}
else
{
cy = (gameinfo.gametype & (GAME_Doom|GAME_Strife) ? 10 : 5) - 100;
cy = (gameinfo.gametype & (GAME_DoomStrifeChex) ? 10 : 5) - 100;
}
ch = FinaleText.GetChars();

View file

@ -1689,7 +1689,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
{
int cstype = SBarInfoScript->GetGameType();
if(cstype == GAME_Doom) //Did the user specify a "base"
if(cstype == GAME_Doom || cstype == GAME_Chex) //Did the user specify a "base"
{
StatusBar = CreateDoomStatusBar ();
}
@ -1712,7 +1712,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
}
if (StatusBar == NULL)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
StatusBar = CreateDoomStatusBar ();
}

View file

@ -41,6 +41,7 @@ void ABasicArmor::Tick ()
{
switch (gameinfo.gametype)
{
case GAME_Chex:
case GAME_Doom:
Icon = TexMan.CheckForTexture (SavePercent == FRACUNIT/3 ? "ARM1A0" : "ARM2A0", FTexture::TEX_Any);
break;

View file

@ -211,6 +211,10 @@ static void ParseLock(FScanner &sc)
{
if (gameinfo.gametype != GAME_Strife) keynum=-1;
}
else if (sc.Compare("CHEX"))
{
if (gameinfo.gametype != GAME_Chex) keynum=-1;
}
else sc.UnGet();
ignorekey = true;

View file

@ -262,7 +262,7 @@ AAmmo *AWeapon::AddAmmo (AActor *other, const PClass *ammotype, int amount)
// [BC] This behavior is from the original Doom. Give 5/2 times as much ammo when
// we pick up a weapon in deathmatch.
if (( deathmatch ) && ( gameinfo.gametype == GAME_Doom ))
if (( deathmatch ) && ( gameinfo.gametype & GAME_DoomChex ))
amount = amount * 5 / 2;
// extra ammo in baby mode and nightmare mode

View file

@ -1177,7 +1177,7 @@ void DBaseStatusBar::Draw (EHudState state)
{
int y, i, time = level.time / TICRATE, height;
int totaltime = level.totaltime / TICRATE;
EColorRange highlight = (gameinfo.gametype == GAME_Doom) ?
EColorRange highlight = (gameinfo.gametype & GAME_DoomChex) ?
CR_UNTRANSLATED : CR_YELLOW;
height = screen->Font->GetHeight () * CleanYfac;

View file

@ -225,7 +225,7 @@ void FGameConfigFile::DoGameSetup (const char *gamename)
{
const char *key;
const char *value;
enum { Doom, Heretic, Hexen, Strife } game;
enum { Doom, Heretic, Hexen, Strife, Chex } game;
if (strcmp (gamename, "Heretic") == 0)
game = Heretic;
@ -233,6 +233,8 @@ void FGameConfigFile::DoGameSetup (const char *gamename)
game = Hexen;
else if (strcmp (gamename, "Strife") == 0)
game = Strife;
else if (strcmp (gamename, "Chex") == 0)
game = Chex;
else
game = Doom;
@ -663,6 +665,18 @@ void FGameConfigFile::SetupWeaponList (const char *gamename)
LocalWeapons.Slots[7].AddWeapon ("Mauler");
LocalWeapons.Slots[8].AddWeapon ("Sigil");
}
else if (strcmp (gamename, "Chex") == 0)
{
LocalWeapons.Slots[1].AddWeapon ("Bootspoon");
LocalWeapons.Slots[1].AddWeapon ("SuperBootspork");
LocalWeapons.Slots[2].AddWeapon ("MiniZorcher");
LocalWeapons.Slots[3].AddWeapon ("LargeZorcher");
LocalWeapons.Slots[3].AddWeapon ("SuperLargeZorcher");
LocalWeapons.Slots[4].AddWeapon ("RapidZorcher");
LocalWeapons.Slots[5].AddWeapon ("ZorchPropulsor");
LocalWeapons.Slots[6].AddWeapon ("PhasingZorcher");
LocalWeapons.Slots[7].AddWeapon ("LAZDevice");
}
else // Doom
{
LocalWeapons.Slots[1].AddWeapon ("Fist");

View file

@ -40,9 +40,9 @@
gameinfo_t gameinfo;
const char *GameNames[9] =
const char *GameNames[17] =
{
NULL, "Doom", "Heretic", NULL, "Hexen", NULL, NULL, NULL, "Strife"
NULL, "Doom", "Heretic", NULL, "Hexen", NULL, NULL, NULL, "Strife", NULL, NULL, NULL, NULL, NULL, NULL, NULL, "Chex"
};
@ -278,12 +278,12 @@ gameinfo_t ChexGameInfo =
"FLOOR7_2",
&DoomBorder,
0,
GAME_Doom,
GAME_Chex,
100,
"F_SKY1",
24*FRACUNIT,
"xlat/doom.txt",
{ "mapinfo/doomcommon.txt", "mapinfo/chex.txt" },
{ "mapinfo/chex.txt", NULL },
MAKERGB(95,175,87),
};

View file

@ -58,13 +58,16 @@ enum EGameType
GAME_Heretic = 2,
GAME_Hexen = 4,
GAME_Strife = 8,
GAME_Chex = 16, //Chex is basically Doom, but we need to have a different set of actors.
GAME_Raven = GAME_Heretic|GAME_Hexen,
GAME_DoomStrife = GAME_Doom|GAME_Strife
GAME_Raven = GAME_Heretic|GAME_Hexen,
GAME_DoomStrife = GAME_Doom|GAME_Strife,
GAME_DoomChex = GAME_Doom|GAME_Chex,
GAME_DoomStrifeChex = GAME_Doom|GAME_Strife|GAME_Chex
};
#endif
extern const char *GameNames[9];
extern const char *GameNames[17];
typedef struct
{

View file

@ -45,6 +45,7 @@ extern FStringTable GStrings;
// QuitGame messages
#define NUM_QUITDOOMMESSAGES 15
#define NUM_QUITSTRIFEMESSAGES 8
#define NUM_QUITCHEXMESSAGES 2
extern const char *endmsg[];

View file

@ -184,9 +184,12 @@ enum EGameType
GAME_Heretic = 2,
GAME_Hexen = 4,
GAME_Strife = 8,
GAME_Chex = 16,
GAME_Raven = GAME_Heretic|GAME_Hexen,
GAME_DoomStrife = GAME_Doom|GAME_Strife
GAME_Raven = GAME_Heretic|GAME_Hexen,
GAME_DoomStrife = GAME_Doom|GAME_Strife,
GAME_DoomChex = GAME_Doom|GAME_Chex,
GAME_DoomStrifeChex = GAME_Doom|GAME_Strife|GAME_Chex
};
#endif

View file

@ -81,10 +81,20 @@ void cht_DoCheat (player_t *player, int cheat)
// fall through to CHT_GOD
case CHT_GOD:
player->cheats ^= CF_GODMODE;
if (player->cheats & CF_GODMODE)
msg = GStrings("STSTR_DQDON");
if (gameinfo.gametype != GAME_Chex)
{
if (player->cheats & CF_GODMODE)
msg = GStrings("STSTR_DQDON");
else
msg = GStrings("STSTR_DQDOFF");
}
else
msg = GStrings("STSTR_DQDOFF");
{
if (player->cheats & CF_GODMODE)
msg = GStrings("STSTR_CDQDON");
else
msg = GStrings("STSTR_CDQDOFF");
}
SB_state = screen->GetPageCount ();
break;
@ -160,7 +170,10 @@ void cht_DoCheat (player_t *player, int cheat)
{
player->mo->GiveInventoryType (type);
}
msg = GStrings("STSTR_CHOPPERS");
if(gameinfo.gametype != GAME_Chex)
msg = GStrings("STSTR_CHOPPERS");
else
msg = GStrings("STSTR_CCHOPPERS");
}
// [RH] The original cheat also set powers[pw_invulnerability] to true.
// Since this is a timer and not a boolean, it effectively turned off
@ -191,7 +204,10 @@ void cht_DoCheat (player_t *player, int cheat)
cht_Give (player, "ammo");
cht_Give (player, "keys");
cht_Give (player, "armor");
msg = GStrings("STSTR_KFAADDED");
if(gameinfo.gametype != GAME_Chex)
msg = GStrings("STSTR_KFAADDED");
else
msg = GStrings("STSTR_CKFAADDED");
break;
case CHT_IDFA:
@ -199,7 +215,10 @@ void cht_DoCheat (player_t *player, int cheat)
cht_Give (player, "weapons");
cht_Give (player, "ammo");
cht_Give (player, "armor");
msg = GStrings("STSTR_FAADDED");
if(gameinfo.gametype != GAME_Chex)
msg = GStrings("STSTR_FAADDED");
else
msg = GStrings("STSTR_CFAADDED");
break;
case CHT_BEHOLDV:
@ -622,6 +641,10 @@ void cht_Give (player_t *player, const char *name, int amount)
{
type = PClass::FindClass ("Backpack");
}
else if (gameinfo.gametype == GAME_Chex)
{
type = PClass::FindClass ("Zorchpack");
}
else
{ // Hexen doesn't have a backpack, foo!
type = NULL;
@ -850,6 +873,10 @@ void cht_Take (player_t *player, const char *name, int amount)
{
type = PClass::FindClass ("Backpack");
}
else if (gameinfo.gametype == GAME_Chex)
{
type = PClass::FindClass ("Zorchpack");
}
else
{ // Hexen doesn't have a backpack, foo!
type = NULL;

View file

@ -926,7 +926,7 @@ void M_NotifyNewSave (const char *file, const char *title, bool okForQuicksave)
//
void M_DrawLoad (void)
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
FTexture *title = TexMan["M_LOADG"];
screen->DrawTexture (title,
@ -952,7 +952,7 @@ void M_DrawLoad (void)
//
void M_DrawSaveLoadBorder (int x, int y, int len)
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
int i;
@ -1272,7 +1272,10 @@ void M_LoadGame (int choice)
{
if (netgame)
{
M_StartMessage (GStrings("LOADNET"), NULL, false);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage (GStrings("CLOADNET"), NULL, false);
else
M_StartMessage (GStrings("LOADNET"), NULL, false);
return;
}
@ -1289,7 +1292,7 @@ void M_LoadGame (int choice)
//
void M_DrawSave()
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
FTexture *title = TexMan["M_SAVEG"];
screen->DrawTexture (title,
@ -1401,7 +1404,10 @@ void M_QuickSave ()
M_SaveGame (0);
return;
}
mysnprintf (tempstring, countof(tempstring), GStrings("QSPROMPT"), quickSaveSlot->Title);
if(gameinfo.gametype == GAME_Chex)
mysnprintf (tempstring, countof(tempstring), GStrings("CQSPROMPT"), quickSaveSlot->Title);
else
mysnprintf (tempstring, countof(tempstring), GStrings("QSPROMPT"), quickSaveSlot->Title);
strcpy (savegamestring, quickSaveSlot->Title);
M_StartMessage (tempstring, M_QuickSaveResponse, true);
}
@ -1425,7 +1431,10 @@ void M_QuickLoad ()
{
if (netgame)
{
M_StartMessage (GStrings("QLOADNET"), NULL, false);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage (GStrings("CQLOADNET"), NULL, false);
else
M_StartMessage (GStrings("QLOADNET"), NULL, false);
return;
}
@ -1437,7 +1446,10 @@ void M_QuickLoad ()
M_LoadGame (0);
return;
}
mysnprintf (tempstring, countof(tempstring), GStrings("QLPROMPT"), quickSaveSlot->Title);
if(gameinfo.gametype == GAME_Chex)
mysnprintf (tempstring, countof(tempstring), GStrings("CQLPROMPT"), quickSaveSlot->Title);
else
mysnprintf (tempstring, countof(tempstring), GStrings("QLPROMPT"), quickSaveSlot->Title);
M_StartMessage (tempstring, M_QuickLoadResponse, true);
}
@ -1499,7 +1511,7 @@ void M_DrawReadThis ()
//
void M_DrawMainMenu (void)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
screen->DrawTexture (TexMan["M_DOOM"], 94, 2, DTA_Clean, true, TAG_DONE);
}
@ -1542,9 +1554,9 @@ void M_DrawHereticMainMenu ()
//
void M_DrawNewGame(void)
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
screen->DrawTexture (TexMan[gameinfo.gametype == GAME_Doom ? "M_NEWG" : "M_NGAME"], 96, 14, DTA_Clean, true, TAG_DONE);
screen->DrawTexture (TexMan[gameinfo.gametype & GAME_DoomChex ? "M_NEWG" : "M_NGAME"], 96, 14, DTA_Clean, true, TAG_DONE);
screen->DrawTexture (TexMan["M_SKILL"], 54, 38, DTA_Clean, true, TAG_DONE);
}
}
@ -1553,12 +1565,15 @@ void M_NewGame(int choice)
{
if (netgame && !demoplayback)
{
M_StartMessage (GStrings("NEWGAME"), NULL, false);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage (GStrings("CNEWGAME"), NULL, false);
else
M_StartMessage (GStrings("NEWGAME"), NULL, false);
return;
}
// Set up episode menu positioning
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
EpiDef.x = 48;
EpiDef.y = 63;
@ -1679,7 +1694,7 @@ static void M_DrawClassMenu ()
if (ClassMenuDef.numitems > 4 && gameinfo.gametype & GAME_Raven)
tit_y = 2;
screen->DrawText (gameinfo.gametype == GAME_Doom ? CR_RED : CR_UNTRANSLATED,
screen->DrawText (gameinfo.gametype & GAME_DoomChex ? CR_RED : CR_UNTRANSLATED,
160 - BigFont->StringWidth (text)/2,
tit_y,
text, DTA_Clean, true, TAG_DONE);
@ -1738,7 +1753,7 @@ static void DrawHexenSkillMenu()
//
void M_DrawEpisode ()
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
screen->DrawTexture (TexMan["M_EPISOD"], 54, 38, DTA_Clean, true, TAG_DONE);
}
@ -1790,6 +1805,10 @@ void M_Episode (int choice)
M_StartMessage(GStrings("SWSTRING"),NULL,false);
//M_SetupNextMenu(&ReadDef);
}
else if (gameinfo.gametype == GAME_Chex)
{
M_StartMessage(GStrings("CSWSTRING"),NULL,false);
}
else
{
showSharewareMessage = 3*TICRATE;
@ -1818,7 +1837,10 @@ static void SCClass (int option)
{
if (netgame)
{
M_StartMessage (GStrings("NEWGAME"), NULL, false);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage (GStrings("CNEWGAME"), NULL, false);
else
M_StartMessage (GStrings("NEWGAME"), NULL, false);
return;
}
@ -1846,7 +1868,10 @@ static void M_ChooseClass (int choice)
{
if (netgame)
{
M_StartMessage (GStrings("NEWGAME"), NULL, false);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage (GStrings("CNEWGAME"), NULL, false);
else
M_StartMessage (GStrings("NEWGAME"), NULL, false);
return;
}
@ -1899,11 +1924,17 @@ void M_EndGame(int choice)
if (netgame)
{
M_StartMessage(GStrings("NETEND"),NULL,false);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage(GStrings("CNETEND"),NULL,false);
else
M_StartMessage(GStrings("NETEND"),NULL,false);
return;
}
M_StartMessage(GStrings("ENDGAME"),M_EndGameResponse,true);
if(gameinfo.gametype == GAME_Chex)
M_StartMessage(GStrings("CENDGAME"),M_EndGameResponse,true);
else
M_StartMessage(GStrings("ENDGAME"),M_EndGameResponse,true);
}
@ -1966,12 +1997,19 @@ void M_QuitGame (int choice)
{
// We pick index 0 which is language sensitive,
// or one at random, between 1 and maximum number.
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
int quitmsg = gametic % (gameinfo.gametype == GAME_Doom ? NUM_QUITDOOMMESSAGES : NUM_QUITSTRIFEMESSAGES - 1);
if (quitmsg != 0 || gameinfo.gametype == GAME_Strife)
int quitmsg = 0;gametic % (gameinfo.gametype == GAME_Doom ? (gameinfo.gametype != GAME_Chex ? NUM_QUITDOOMMESSAGES : NUM_QUITCHEXMESSAGES - 1) : NUM_QUITSTRIFEMESSAGES - 1);
if (gameinfo.gametype == GAME_Doom)
quitmsg = gametic % NUM_QUITDOOMMESSAGES;
else if (gameinfo.gametype == GAME_Strife)
quitmsg = gametic % NUM_QUITSTRIFEMESSAGES - 1;
else //Chex quest has 2 messages but one is more likely to show
quitmsg = (gametic % NUM_QUITCHEXMESSAGES + 6) > NUM_QUITCHEXMESSAGES ? NUM_QUITCHEXMESSAGES - 1 : (gametic % NUM_QUITCHEXMESSAGES + 6);
if (quitmsg != 0 || gameinfo.gametype == GAME_Strife || gameinfo.gametype == GAME_Chex)
{
EndString.Format("QUITMSG%d", quitmsg + (gameinfo.gametype == GAME_Doom ? 0 : NUM_QUITDOOMMESSAGES + 1));
EndString.Format("QUITMSG%d", quitmsg + (gameinfo.gametype == GAME_Doom ? 0 : (gameinfo.gametype == GAME_Chex ? NUM_QUITDOOMMESSAGES + NUM_QUITSTRIFEMESSAGES : NUM_QUITDOOMMESSAGES + 1)));
EndString.Format("%s\n\n%s", GStrings(EndString), GStrings("DOSY"));
}
else
@ -2061,7 +2099,7 @@ static void M_PlayerSetupDrawer ()
EColorRange label, value;
DWORD color;
if (!(gameinfo.gametype & (GAME_Doom|GAME_Strife)))
if (!(gameinfo.gametype & (GAME_DoomStrifeChex)))
{
xo = 5;
yo = 5;
@ -2077,7 +2115,7 @@ static void M_PlayerSetupDrawer ()
// Draw title
const char * text = GStrings("MNU_PLAYERSETUP");
screen->DrawText (gameinfo.gametype == GAME_Doom ? CR_RED : CR_UNTRANSLATED,
screen->DrawText (gameinfo.gametype & GAME_DoomChex ? CR_RED : CR_UNTRANSLATED,
160 - BigFont->StringWidth (text)/2,
15,
text, DTA_Clean, true, TAG_DONE);
@ -3210,7 +3248,7 @@ void M_Drawer ()
if (color == CR_UNTRANSLATED)
{
// The default DBIGFONT is white but Doom's default should be red.
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
color = CR_RED;
}
@ -3241,12 +3279,12 @@ void M_Drawer ()
screen->SetFont (ConFont);
screen->DrawText (CR_RED, x - 16,
currentMenu->y + itemOn*LINEHEIGHT +
(!(gameinfo.gametype & (GAME_Doom|GAME_Strife)) ? 6 : -1), "\xd",
(!(gameinfo.gametype & (GAME_DoomStrifeChex)) ? 6 : -1), "\xd",
DTA_Clean, true, TAG_DONE);
screen->SetFont (SmallFont);
}
}
else if (gameinfo.gametype == GAME_Doom)
else if (gameinfo.gametype & GAME_DoomChex)
{
screen->DrawTexture (TexMan[skullName[whichSkull]],
x + SKULLXOFF, currentMenu->y - 5 + itemOn*LINEHEIGHT,
@ -3398,7 +3436,7 @@ void M_Init (void)
atterm (M_Deinit);
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
TopLevelMenu = currentMenu = &MainDef;
if (gameinfo.gametype == GAME_Strife)
@ -3429,10 +3467,10 @@ void M_Init (void)
lastSaveSlot = NULL;
strcpy (NewSaveNode.Title, "<New Save Game>");
underscore[0] = (gameinfo.gametype & (GAME_Doom|GAME_Strife)) ? '_' : '[';
underscore[0] = (gameinfo.gametype & (GAME_DoomStrifeChex)) ? '_' : '[';
underscore[1] = '\0';
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
LINEHEIGHT = 16;
}
@ -3494,7 +3532,7 @@ void M_Init (void)
ClassMenuDef.numitems = 1;
}
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
if (gameinfo.gametype & (GAME_DoomStrifeChex))
{
ClassMenuDef.x = 48;
ClassMenuDef.y = 63;

View file

@ -605,6 +605,7 @@ static bool FindFreeName (FString &fullname, const char *extension)
case GAME_Heretic: gamename = "Heretic_"; break;
case GAME_Hexen: gamename = "Hexen_"; break;
case GAME_Strife: gamename = "Strife_"; break;
case GAME_Chex: gamename = "Chex_"; break;
default: gamename = ""; break;
}

View file

@ -1374,7 +1374,7 @@ static BYTE BitTranslate[32];
void M_OptInit (void)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
LabelColor = CR_UNTRANSLATED;
ValueColor = CR_GRAY;
@ -1658,7 +1658,7 @@ void M_OptDrawer ()
if (BigFont && CurrentMenu->texttitle)
{
screen->SetFont (BigFont);
screen->DrawText (gameinfo.gametype == GAME_Doom ? CR_RED : CR_UNTRANSLATED,
screen->DrawText (gameinfo.gametype & GAME_DoomChex ? CR_RED : CR_UNTRANSLATED,
160-BigFont->StringWidth (CurrentMenu->texttitle)/2, 10,
CurrentMenu->texttitle, DTA_Clean, true, TAG_DONE);
screen->SetFont (SmallFont);
@ -2185,7 +2185,7 @@ void M_OptResponder (event_t *ev)
{
maxitems = 15;
}
if (gameinfo.gametype != GAME_Doom)
if (!(gameinfo.gametype & GAME_DoomChex))
{
maxitems -= 2;
rowheight = 9;

View file

@ -82,6 +82,7 @@ xx(StrifePlayer)
xx(FighterPlayer)
xx(ClericPlayer)
xx(MagePlayer)
xx(ChexPlayer)
xx(ChickenPlayer)
xx(PigPlayer)

View file

@ -1412,7 +1412,7 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround)
return P_LookForEnemies (actor, allaround);
}
if (!(gameinfo.gametype & (GAME_Doom|GAME_Strife)) &&
if (!(gameinfo.gametype & (GAME_DoomStrifeChex)) &&
!multiplayer &&
players[0].health <= 0)
{ // Single player game and player is dead; look for monsters

View file

@ -548,7 +548,7 @@ bool P_NewLookPlayers (AActor *actor, angle_t fov, fixed_t mindist, fixed_t maxd
return P_NewLookEnemies (actor, fov, mindist, maxdist, chasegoal);
}
if (!(gameinfo.gametype & (GAME_Doom|GAME_Strife)) &&
if (!(gameinfo.gametype & (GAME_DoomStrifeChex)) &&
!multiplayer &&
players[0].health <= 0)
{ // Single player game and player is dead; look for monsters

View file

@ -321,7 +321,7 @@ static int GibHealth(AActor *actor)
return -abs(
actor->GetClass()->Meta.GetMetaInt (
AMETA_GibHealth,
gameinfo.gametype == GAME_Doom ?
gameinfo.gametype & GAME_DoomChex ?
-actor->GetDefault()->health :
-actor->GetDefault()->health/2));
}

View file

@ -1896,7 +1896,7 @@ void P_ZMovement (AActor *mo)
if (mo->z <= mo->floorz)
{
if ((mo->flags & MF_MISSILE) &&
(gameinfo.gametype != GAME_Doom || !(mo->flags & MF_NOCLIP)))
(!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP)))
{
mo->z = mo->floorz;
if (mo->flags2 & MF2_BOUNCETYPE)
@ -2006,7 +2006,7 @@ void P_ZMovement (AActor *mo)
mo->momz = -mo->momz;
}
if (mo->flags & MF_MISSILE &&
(gameinfo.gametype != GAME_Doom || !(mo->flags & MF_NOCLIP)))
(!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP)))
{
if (mo->flags3 & MF3_CEILINGHUGGER)
{
@ -4025,7 +4025,7 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
th = Spawn (bloodcls, x, y, z, ALLOW_REPLACE);
th->momz = FRACUNIT*2;
th->angle = dir;
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
th->tics -= pr_spawnblood() & 3;
@ -4039,7 +4039,7 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
}
// Moved out of the blood actor so that replacing blood is easier
if (gameinfo.gametype & GAME_DoomStrife)
if (gameinfo.gametype & GAME_DoomStrifeChex)
{
if (gameinfo.gametype == GAME_Strife)
{
@ -4861,7 +4861,7 @@ void AActor::Crash()
if (crashstate == NULL)
{
int gibhealth = -abs(GetClass()->Meta.GetMetaInt (AMETA_GibHealth,
gameinfo.gametype == GAME_Doom ? -GetDefault()->health : -GetDefault()->health/2));
gameinfo.gametype & GAME_DoomChex ? -GetDefault()->health : -GetDefault()->health/2));
if (health < gibhealth)
{ // Extreme death

View file

@ -344,7 +344,7 @@ static void ParseOuter (FScanner &sc)
break;
case OUT_IFDOOM:
if (gameinfo.gametype != GAME_Doom)
if (!(gameinfo.gametype & GAME_DoomChex))
{
ifskip = true;
}

View file

@ -125,6 +125,11 @@ void SetupPlayerClasses ()
newclass.Type = PClass::FindClass (NAME_StrifePlayer);
PlayerClasses.Push (newclass);
}
else if (gameinfo.gametype == GAME_Chex)
{
newclass.Type = PClass::FindClass (NAME_ChexPlayer);
PlayerClasses.Push (newclass);
}
}
CCMD (clearplayerclasses)

View file

@ -86,7 +86,7 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld)
}
else
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
if (flags & ML_RESERVED_ETERNITY)
{

View file

@ -523,7 +523,7 @@ void R_InitSkins (void)
if (stricmp (sc.String, "heretic") == 0)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
transtype = PClass::FindClass (NAME_HereticPlayer);
skins[i].othergame = true;
@ -547,7 +547,7 @@ void R_InitSkins (void)
transtype = PClass::FindClass (NAME_DoomPlayer);
skins[i].othergame = true;
}
else if (gameinfo.gametype != GAME_Doom)
else if (!(gameinfo.gametype & GAME_DoomChex))
{
remove = true;
}
@ -618,7 +618,7 @@ void R_InitSkins (void)
// [GRB] Assume Doom skin by default
if (!remove && basetype == NULL)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
basetype = transtype = PClass::FindClass (NAME_DoomPlayer);
}
@ -849,7 +849,7 @@ void R_InitSprites ()
clearbufshort (zeroarray, MAXWIDTH, 0);
// [RH] Create a standard translation to map skins between Heretic and Doom
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype == GAME_DoomChex)
{
R_CreateSkinTranslation ("SPALHTIC");
}

View file

@ -363,7 +363,7 @@ void R_InitTranslationTables ()
}
// Create the standard translation tables
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
for (i = 0x70; i < 0x80; i++)
{ // map green ramp to gray, brown, red
@ -575,7 +575,7 @@ static void R_CreatePlayerTranslation (float h, float s, float v, FPlayerSkin *s
bases = s;
basev = v;
if (gameinfo.gametype == GAME_Doom || gameinfo.gametype == GAME_Strife)
if (gameinfo.gametype & GAME_DoomStrifeChex)
{
// Build player sprite translation
s -= 0.23f;

View file

@ -1267,8 +1267,8 @@ static void S_AddSNDINFO (int lump)
}
break;
case SI_IfDoom:
if (gameinfo.gametype != GAME_Doom)
case SI_IfDoom: //also Chex
if (!(gameinfo.gametype & GAME_DoomChex))
{
skipToEndIf = true;
}

View file

@ -153,6 +153,22 @@ static BYTE CheatStoneCold[] = { 's','t','o','n','e','c','o','l','d',255 };
static BYTE CheatElvis[] = { 'e','l','v','i','s',255 };
static BYTE CheatTopo[] = { 't','o','p','o',255 };
//[BL] Graf will probably get rid of this
static BYTE CheatJoelKoenigs[] = { 'j','o','e','l','k','o','e','n','i','g','s',255 };
static BYTE CheatDavidBrus[] = { 'd','a','v','i','d','b','r','u','s',255 };
static BYTE CheatScottHolman[] = { 's','c','o','t','t','h','o','l','m','a','n',255 };
static BYTE CheatMikeKoenigs[] = { 'm','i','k','e','k','o','e','n','i','g','s',255 };
static BYTE CheatCharlesJacobi[] = { 'c','h','a','r','l','e','s','j','a','c','o','b','i',255 };
static BYTE CheatAndrewBenson[] = { 'a','n','d','r','e','w','b','e','n','s','o','n',255 };
static BYTE CheatDeanHyers[] = { 'd','e','a','n','h','y','e','r','s',255 };
static BYTE CheatMaryBregi[] = { 'm','a','r','y','b','r','e','g','i',255 };
static BYTE CheatAllen[] = { 'a','l','l','e','n',255 };
static BYTE CheatDigitalCafe[] = { 'd','i','g','i','t','a','l','c','a','f','e',255 };
static BYTE CheatJoshuaStorms[] = { 'j','o','s','h','u','a','s','t','o','r','m','s',255 };
static BYTE CheatLeeSnyder[] = { 'l','e','e','s','n','y','d','e','r',0,0,255 };
static BYTE CheatKimHyers[] = { 'k','i','m','h','y','e','r','s',255 };
static BYTE CheatShrrill[] = { 's','h','r','r','i','l','l',255 };
static cheatseq_t DoomCheats[] =
{
{ CheatMus, 0, 1, 0, {0,0}, Cht_Music },
@ -246,6 +262,25 @@ static cheatseq_t StrifeCheats[] =
{ CheatLego, 0, 0, 0, {CHT_LEGO,0}, Cht_Generic },
};
static cheatseq_t ChexCheats[] =
{
{ CheatMus, 0, 1, 0, {0,0}, Cht_Music },
{ CheatKimHyers, 0, 1, 0, {0,0}, Cht_MyPos },
{ CheatShrrill, 0, 0, 0, {0,0}, Cht_AutoMap },
{ CheatDavidBrus, 0, 0, 0, {CHT_IDDQD,0}, Cht_Generic },
{ CheatMikeKoenigs, 0, 0, 0, {CHT_IDKFA,0}, Cht_Generic },
{ CheatScottHolman, 0, 0, 0, {CHT_IDFA,0}, Cht_Generic },
{ CheatCharlesJacobi, 0, 0, 0, {CHT_NOCLIP,0}, Cht_Generic },
{ CheatAndrewBenson, 0, 0, 0, {CHT_BEHOLDV,0}, Cht_Generic },
{ CheatDeanHyers, 0, 0, 0, {CHT_BEHOLDS,0}, Cht_Generic },
{ CheatMaryBregi, 0, 0, 0, {CHT_BEHOLDI,0}, Cht_Generic },
{ CheatAllen, 0, 0, 0, {CHT_BEHOLDR,0}, Cht_Generic },
{ CheatDigitalCafe, 0, 0, 0, {CHT_BEHOLDA,0}, Cht_Generic },
{ CheatJoshuaStorms, 0, 0, 0, {CHT_BEHOLDL,0}, Cht_Generic },
{ CheatJoelKoenigs, 0, 0, 0, {CHT_CHAINSAW,0}, Cht_Generic },
{ CheatLeeSnyder, 0, 0, 0, {0,0}, Cht_ChangeLevel }
};
extern bool CheckCheatmode ();
// Respond to keyboard input events, intercept cheats.
@ -282,6 +317,11 @@ bool ST_Responder (event_t *ev)
numcheats = countof(StrifeCheats);
break;
case GAME_Chex:
cheats = ChexCheats;
numcheats = countof(ChexCheats);
break;
default:
return false;
}

View file

@ -857,6 +857,10 @@ static void ActorGame (FScanner &sc, AActor *defaults, Baggage &bag)
{
bag.Info->GameFilter |= GAME_Strife;
}
else if (sc.Compare ("Chex"))
{
bag.Info->GameFilter |= GAME_Chex;
}
else if (sc.Compare ("Any"))
{
bag.Info->GameFilter = GAME_Any;
@ -1940,8 +1944,8 @@ static void InventoryPickupflash (FScanner &sc, AInventory *defaults, Baggage &b
static void InventoryPickupmsg (FScanner &sc, AInventory *defaults, Baggage &bag)
{
// allow game specific pickup messages
const char * games[] = {"Doom", "Heretic", "Hexen", "Raven", "Strife", NULL};
int gamemode[]={GAME_Doom, GAME_Heretic, GAME_Hexen, GAME_Raven, GAME_Strife};
const char * games[] = {"Doom", "Heretic", "Hexen", "Raven", "Strife", "Chex", NULL};
int gamemode[]={GAME_Doom, GAME_Heretic, GAME_Hexen, GAME_Raven, GAME_Strife, GAME_Chex};
sc.MustGetString();
int game = sc.MatchString(games);

View file

@ -286,7 +286,7 @@ FFont::FFont (const char *name, const char *nametemplate, int first, int count,
BYTE usedcolors[256], identity[256];
double *luminosity;
int maxyoffs;
bool doomtemplate = gameinfo.gametype == GAME_Doom ? strncmp (nametemplate, "STCFN", 5) == 0 : false;
bool doomtemplate = gameinfo.gametype & GAME_DoomChex ? strncmp (nametemplate, "STCFN", 5) == 0 : false;
bool stcfn121 = false;
Chars = new CharData[count];
@ -2092,7 +2092,7 @@ void V_InitFonts()
}
if (!(BigFont=FFont::FindFont("BigFont")))
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
BigFont = new FSingleLumpFont ("BigFont", Wads.GetNumForName ("DBIGFONT"));
}

View file

@ -1412,7 +1412,7 @@ void FWadCollection::RenameSprites (int startlump)
// When not playing Doom rename all BLOD sprites to BLUD so that
// the same blood states can be used everywhere
if (gameinfo.gametype != GAME_Doom)
if (!(gameinfo.gametype & GAME_DoomChex))
{
if (*(DWORD *)LumpInfo[i].name == MAKE_ID('B', 'L', 'O', 'D'))
{

View file

@ -64,8 +64,8 @@ CVAR (Bool, wi_noautostartmap, false, CVAR_ARCHIVE)
void WI_loadData ();
void WI_unloadData ();
#define NEXTSTAGE (gameinfo.gametype == GAME_Doom ? "weapons/rocklx" : "doors/dr1_clos")
#define PASTSTATS (gameinfo.gametype == GAME_Doom ? "weapons/shotgr" : "plats/pt1_stop")
#define NEXTSTAGE (gameinfo.gametype & GAME_DoomChex ? "weapons/rocklx" : "doors/dr1_clos")
#define PASTSTATS (gameinfo.gametype & GAME_DoomChex ? "weapons/shotgr" : "plats/pt1_stop")
// GLOBAL LOCATIONS
#define WI_TITLEY 2
@ -314,6 +314,7 @@ void WI_LoadBackground(bool isenterpic)
lumpname = NULL;
switch(gameinfo.gametype)
{
case GAME_Chex:
case GAME_Doom:
if (gamemode != commercial)
{
@ -688,14 +689,14 @@ static void WI_DrawCharPatch (FTexture *patch, int x, int y)
{
screen->DrawTexture (patch, x, y,
DTA_Clean, true,
DTA_ShadowAlpha, (gameinfo.gametype == GAME_Doom) ? 0 : FRACUNIT/2,
DTA_ShadowAlpha, (gameinfo.gametype & GAME_DoomChex) ? 0 : FRACUNIT/2,
TAG_DONE);
}
else
{
screen->DrawTexture (patch, x, y,
DTA_Clean, true,
DTA_ShadowAlpha, (gameinfo.gametype == GAME_Doom) ? 0 : FRACUNIT/2,
DTA_ShadowAlpha, (gameinfo.gametype & GAME_DoomChex) ? 0 : FRACUNIT/2,
DTA_Translation, BigFont->GetColorTranslation (CR_UNTRANSLATED), // otherwise it doesn't look good in Strife!
TAG_DONE);
}
@ -779,7 +780,7 @@ void WI_drawLF ()
if (y < NG_STATSY - screen->Font->GetHeight()*3/4)
{
// don't draw 'finished' if the level name is too high!
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
screen->DrawTexture(finished, 160 - finished->GetWidth()/2, y, DTA_Clean, true, TAG_DONE);
}
@ -809,7 +810,7 @@ void WI_drawEL ()
// draw "entering"
// be careful with the added height so that it works for oversized 'entering' patches!
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
screen->DrawTexture(entering, (SCREENWIDTH - entering->GetWidth() * CleanXfac) / 2, y * CleanYfac, DTA_CleanNoMove, true, TAG_DONE);
y += entering->GetHeight() + screen->Font->GetHeight()/4;
@ -1557,7 +1558,7 @@ void WI_drawNetgameStats ()
WI_drawLF();
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
// draw stat titles (top line)
screen->DrawTexture (kills, NG_STATSX+NG_SPACINGX-kills->GetWidth(), NG_STATSY, DTA_Clean, true, TAG_DONE);
@ -1675,7 +1676,7 @@ void WI_updateStats ()
{
WI_updateAnimatedBack ();
if ((gameinfo.gametype != GAME_Doom || acceleratestage)
if ((!(gameinfo.gametype & GAME_DoomChex) || acceleratestage)
&& sp_state != 10)
{
if (acceleratestage)
@ -1694,7 +1695,7 @@ void WI_updateStats ()
if (sp_state == 2)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
cnt_kills[0] += 2;
@ -1710,7 +1711,7 @@ void WI_updateStats ()
}
else if (sp_state == 4)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
cnt_items[0] += 2;
@ -1726,7 +1727,7 @@ void WI_updateStats ()
}
else if (sp_state == 6)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
cnt_secret[0] += 2;
@ -1742,7 +1743,7 @@ void WI_updateStats ()
}
else if (sp_state == 8)
{
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
if (!(bcnt&3))
S_Sound (CHAN_VOICE | CHAN_UI, "weapons/pistol", 1, ATTN_NONE);
@ -1800,7 +1801,7 @@ void WI_drawStats (void)
WI_drawLF();
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
screen->DrawTexture (kills, SP_STATSX, SP_STATSY, DTA_Clean, true, TAG_DONE);
WI_drawPercent (320 - SP_STATSX, SP_STATSY, cnt_kills[0], wbs->maxkills);
@ -1956,7 +1957,7 @@ void WI_loadData(void)
int i;
char name[9];
if (gameinfo.gametype == GAME_Doom)
if (gameinfo.gametype & GAME_DoomChex)
{
wiminus = TexMan["WIMINUS"]; // minus sign
percent = TexMan["WIPCNT"]; // percent sign

View file

@ -944,7 +944,7 @@ static void AddStackInfo (HANDLE file, void *dumpaddress, DWORD code, CONTEXT *c
}
#endif
Writef (file, " ");
for (i = 0; i < max*sizeof(void*); ++i)
for (i = 0; i < int(max*sizeof(void*)); ++i)
{
if (!SafeReadMemory ((BYTE *)scan + i, &peekb, 1))
{

View file

@ -1092,7 +1092,7 @@ void ST_Endoom()
if (showendoom == 0) exit(0);
int endoom_lump = Wads.CheckNumForName (
gameinfo.gametype == GAME_Doom? "ENDOOM" :
gameinfo.gametype & GAME_DoomChex ? "ENDOOM" :
gameinfo.gametype == GAME_Heretic? "ENDTEXT" :
gameinfo.gametype == GAME_Strife? "ENDSTRF" : NULL);