Update to ZDoom r1192:

- Added an 'allcheats' CVAR. This will enable all cheats from all
  supported games in any game being played.
- Changed Chex Quest DoomEdNum initilization so that all empty slots 
  are filled with Doom actors if they exist.
- Added missing spawn filters to Chex Quest items.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@168 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2008-09-01 20:02:17 +00:00
parent d3fdbd3428
commit d24fbfdcaa
8 changed files with 59 additions and 7 deletions

View file

@ -1,4 +1,9 @@
September 1, 2008 (Changes by Graf Zahl) September 1, 2008 (Changes by Graf Zahl)
- Added an 'allcheats' CVAR. This will enable all cheats from all
supported games in any game being played.
- Changed Chex Quest DoomEdNum initilization so that all empty slots
are filled with Doom actors if they exist.
- Added missing spawn filters to Chex Quest items.
- Gave the PlayerPawn base class a default damage fade color instead of - Gave the PlayerPawn base class a default damage fade color instead of
hacking it into the actor when actually used. hacking it into the actor when actually used.
- Fixed: The DamageFade color was not saved in savegames. - Fixed: The DamageFade color was not saved in savegames.

View file

@ -251,6 +251,12 @@ void FActorInfo::RegisterIDs ()
DoomEdMap.AddType (DoomEdNum, Class); DoomEdMap.AddType (DoomEdNum, Class);
} }
} }
// Fill out the list for Chex Quest with Doom's actors
if (gameinfo.gametype == GAME_Chex && DoomEdMap.FindType(DoomEdNum) == NULL &&
(GameFilter & GAME_Doom))
{
DoomEdMap.AddType (DoomEdNum, Class, true);
}
} }
//========================================================================== //==========================================================================
@ -548,7 +554,7 @@ FDoomEdMap::~FDoomEdMap()
Empty(); Empty();
} }
void FDoomEdMap::AddType (int doomednum, const PClass *type) void FDoomEdMap::AddType (int doomednum, const PClass *type, bool temporary)
{ {
unsigned int hash = (unsigned int)doomednum % DOOMED_HASHSIZE; unsigned int hash = (unsigned int)doomednum % DOOMED_HASHSIZE;
FDoomEdEntry *entry = DoomEdHash[hash]; FDoomEdEntry *entry = DoomEdHash[hash];
@ -563,11 +569,12 @@ void FDoomEdMap::AddType (int doomednum, const PClass *type)
entry->DoomEdNum = doomednum; entry->DoomEdNum = doomednum;
DoomEdHash[hash] = entry; DoomEdHash[hash] = entry;
} }
else else if (!entry->temp)
{ {
Printf (PRINT_BOLD, "Warning: %s and %s both have doomednum %d.\n", Printf (PRINT_BOLD, "Warning: %s and %s both have doomednum %d.\n",
type->TypeName.GetChars(), entry->Type->TypeName.GetChars(), doomednum); type->TypeName.GetChars(), entry->Type->TypeName.GetChars(), doomednum);
} }
entry->temp = temporary;
entry->Type = type; entry->Type = type;
} }

View file

@ -232,7 +232,7 @@ public:
~FDoomEdMap(); ~FDoomEdMap();
const PClass *FindType (int doomednum) const; const PClass *FindType (int doomednum) const;
void AddType (int doomednum, const PClass *type); void AddType (int doomednum, const PClass *type, bool temporary = false);
void DelType (int doomednum); void DelType (int doomednum);
void Empty (); void Empty ();
@ -246,6 +246,7 @@ private:
FDoomEdEntry *HashNext; FDoomEdEntry *HashNext;
const PClass *Type; const PClass *Type;
int DoomEdNum; int DoomEdNum;
bool temp;
}; };
static FDoomEdEntry *DoomEdHash[DOOMED_HASHSIZE]; static FDoomEdEntry *DoomEdHash[DOOMED_HASHSIZE];

View file

@ -42,6 +42,7 @@ struct cheatseq_t
bool (*Handler)(cheatseq_t *); bool (*Handler)(cheatseq_t *);
}; };
static bool CheatCheckList (event_t *ev, cheatseq_t *cheats, int numcheats);
static bool CheatAddKey (cheatseq_t *cheat, BYTE key, bool *eat); static bool CheatAddKey (cheatseq_t *cheat, BYTE key, bool *eat);
static bool Cht_Generic (cheatseq_t *); static bool Cht_Generic (cheatseq_t *);
static bool Cht_Music (cheatseq_t *); static bool Cht_Music (cheatseq_t *);
@ -169,6 +170,8 @@ 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 CheatKimHyers[] = { 'k','i','m','h','y','e','r','s',255 };
static BYTE CheatShrrill[] = { 's','h','r','r','i','l','l',255 }; static BYTE CheatShrrill[] = { 's','h','r','r','i','l','l',255 };
static BYTE CheatTNTem[] = { 't','n','t','e','m',255 };
static cheatseq_t DoomCheats[] = static cheatseq_t DoomCheats[] =
{ {
{ CheatMus, 0, 1, 0, {0,0}, Cht_Music }, { CheatMus, 0, 1, 0, {0,0}, Cht_Music },
@ -281,19 +284,26 @@ static cheatseq_t ChexCheats[] =
{ CheatLeeSnyder, 0, 0, 0, {0,0}, Cht_ChangeLevel } { CheatLeeSnyder, 0, 0, 0, {0,0}, Cht_ChangeLevel }
}; };
static cheatseq_t SpecialCheats[] =
{
{ CheatTNTem, 0, 0, 0, {CHT_MASSACRE,0}, Cht_Generic }
};
extern bool CheckCheatmode (); extern bool CheckCheatmode ();
CVAR(Bool, allcheats, false, CVAR_ARCHIVE)
// Respond to keyboard input events, intercept cheats. // Respond to keyboard input events, intercept cheats.
// [RH] Cheats eat the last keypress used to trigger them // [RH] Cheats eat the last keypress used to trigger them
bool ST_Responder (event_t *ev) bool ST_Responder (event_t *ev)
{ {
bool eat = false; bool eat = false;
if (ev->type == EV_KeyDown) if (!allcheats)
{ {
cheatseq_t *cheats; cheatseq_t *cheats;
int numcheats; int numcheats;
int i;
switch (gameinfo.gametype) switch (gameinfo.gametype)
{ {
@ -325,6 +335,29 @@ bool ST_Responder (event_t *ev)
default: default:
return false; return false;
} }
return CheatCheckList(ev, cheats, numcheats);
}
else
{
static cheatseq_t *cheatlists[] = { DoomCheats, HereticCheats, HexenCheats, StrifeCheats, ChexCheats, SpecialCheats };
static int counts[] = { countof(DoomCheats), countof(HereticCheats), countof(HexenCheats),
countof(StrifeCheats), countof(ChexCheats), countof(SpecialCheats) };
for (int i=0; i<countof(cheatlists); i++)
{
if (CheatCheckList(ev, cheatlists[i], counts[i])) return true;
}
}
return false;
}
static bool CheatCheckList (event_t *ev, cheatseq_t *cheats, int numcheats)
{
bool eat = false;
if (ev->type == EV_KeyDown)
{
int i;
for (i = 0; i < numcheats; i++, cheats++) for (i = 0; i < numcheats; i++, cheats++)
{ {

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the // This file was automatically generated by the
// updaterevision tool. Do not edit by hand. // updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "1190" #define ZD_SVN_REVISION_STRING "1192"
#define ZD_SVN_REVISION_NUMBER 1190 #define ZD_SVN_REVISION_NUMBER 1192

View file

@ -2,16 +2,19 @@
actor Bootspoon : Fist actor Bootspoon : Fist
{ {
game Chex
obituary "" obituary ""
} }
actor SuperBootspork : Chainsaw 2005 actor SuperBootspork : Chainsaw 2005
{ {
game Chex
obituary "" obituary ""
} }
actor MiniZorcher : Pistol actor MiniZorcher : Pistol
{ {
game Chex
obituary "" obituary ""
inventory.pickupmessage "$GOTMINIZORCHER" inventory.pickupmessage "$GOTMINIZORCHER"
states states

View file

@ -46,6 +46,7 @@ ACTOR FogPatchSmall 10001
ACTOR FogPatchMedium : FogPatchSmall 10002 ACTOR FogPatchMedium : FogPatchSmall 10002
{ {
Game Hexen
States States
{ {
Spawn: Spawn:
@ -61,6 +62,7 @@ ACTOR FogPatchMedium : FogPatchSmall 10002
ACTOR FogPatchLarge : FogPatchMedium 10003 ACTOR FogPatchLarge : FogPatchMedium 10003
{ {
Game Hexen
States States
{ {
Spawn: Spawn:

View file

@ -3,6 +3,7 @@
ACTOR Heresiarch 10080 native ACTOR Heresiarch 10080 native
{ {
Game Hexen
Health 5000 Health 5000
Painchance 10 Painchance 10
Speed 16 Speed 16