- exported the item pickup messages to the string table and use the global 'nomonsters' flag.

This commit is contained in:
Christoph Oelckers 2020-08-22 20:14:00 +02:00
parent bddd196539
commit 6b1d6a44d7
8 changed files with 72 additions and 160 deletions

View file

@ -352,7 +352,7 @@ void UserConfig::ProcessOptions()
Args->CollectFiles("-name", names, ".---"); // this shouldn't collect any file names at all so use a nonsense extension
CommandName = Args->CheckValue("-name");
static const char* nomos[] = { "-nomonsters", "-nodudes", nullptr };
static const char* nomos[] = { "-nomonsters", "-nodudes", "-nocreatures", nullptr };
Args->CollectFiles("-nomonsters", nomos, ".---"); // this shouldn't collect any file names at all so use a nonsense extension
nomonsters = Args->CheckParm("-nomonsters");

View file

@ -418,7 +418,6 @@ static const short skullDurations[] = { 6, 25, 43, 50, 68, 78, 101, 111, 134, 15
class DMainTitle : public DScreenJob
{
int String_Copyright;
const char* a;
const char* b;
int state = 0;
@ -432,9 +431,8 @@ class DMainTitle : public DScreenJob
public:
DMainTitle() : DScreenJob(fadein)
{
String_Copyright = FindGString("COPYRIGHT");
a = gString[String_Copyright];
b = gString[String_Copyright + 1];
a = GStrings("TXT_EX_COPYRIGHT1");
b = GStrings("TXT_EX_COPYRIGHT2");
var_18 = skullDurations[0];
}
@ -1287,7 +1285,6 @@ private:
// temporary.
void RunCinemaScene(int num)
{
num = -1;
JobDesc job = { num == -1? (DScreenJob*)Create<DExCredits>() : Create<DCinema>(num) };
RunScreenJob(&job, 1, [](bool) { gamestate = GS_LEVEL; });
SyncScreenJob();

View file

@ -64,41 +64,6 @@ bool EndLevel = false;
/* these are XORed in the original game executable then XORed back to normal when the game first starts. Here they are normally */
const char *gString[] =
{
"ITEMS",
"LIFE BLOOD",
"LIFE",
"VENOM",
"YOU'RE LOSING YOUR GRIP",
"FULL LIFE",
"INVINCIBILITY",
"INVISIBILITY",
"TORCH",
"SOBEK MASK",
"INCREASED WEAPON POWER!",
"THE MAP!",
"AN EXTRA LIFE!",
".357 MAGNUM!",
"GRENADE",
"M-60",
"FLAME THROWER!",
"COBRA STAFF!",
"THE EYE OF RAH GAUNTLET!",
"SPEED LOADER",
"AMMO",
"FUEL",
"COBRA!",
"RAW ENERGY",
"POWER KEY",
"TIME KEY",
"WAR KEY",
"EARTH KEY",
"MAGIC",
"LOCATION PRESERVED",
"COPYRIGHT",
"LOBOTOMY SOFTWARE, INC.",
"3D ENGINE BY 3D REALMS",
"",
"",
"PASSWORDS",
"HOLLY",
"KIMBERLY",
@ -322,7 +287,6 @@ short nBodyTotal = 0;
short lastfps;
short nMapMode = 0;
short bNoCreatures = false;
short nTotalPlayers = 1;
// TODO: Rename this (or make it static) so it doesn't conflict with library function
@ -340,7 +304,6 @@ short bSlipMode = false;
short bDoFlashes = true;
short bHolly = false;
short nItemTextIndex;
short besttarget;
short scan_char = 0;
@ -831,10 +794,6 @@ void FinishLevel()
}
void SetHiRes()
{
}
void DoClockBeep()
{
for (int i = headspritestat[407]; i != -1; i = nextspritestat[i]) {
@ -1046,14 +1005,6 @@ static void GameMove(void)
moveframes--;
}
#if defined(_WIN32) && defined(DEBUGGINGAIDS)
// See FILENAME_CASE_CHECK in cache1d.c
static int32_t check_filename_casing(void)
{
return 1;
}
#endif
int32_t r_maxfpsoffset = 0;
void PatchDemoStrings()
@ -1088,75 +1039,6 @@ void ExitGame()
static int32_t nonsharedtimer;
void CheckCommandLine(int argc, char const* const* argv, int &doTitle)
{
// Check for any command line arguments
for (int i = 1; i < argc; i++)
{
const char* pChar = argv[i];
if (*pChar == '/')
{
pChar++;
//strlwr(pChar);
if (Bstrcasecmp(pChar, "nocreatures") == 0) {
bNoCreatures = true;
}
else if (Bstrcasecmp(pChar, "network") == 0)
{
nNetPlayerCount = -1;
forcelevel = levelnew;
bModemPlay = false;
doTitle = false;
}
else
{
char c = tolower(*pChar);
switch (c)
{
case 'h':
SetHiRes();
break;
#if 0
case 's':
socket = atoi(pChar + 1);
break;
#endif
case 't':
nNetTime = atoi(pChar + 1);
if (nNetTime < 0) {
nNetTime = 0;
}
else {
nNetTime = nNetTime * 1800;
}
break;
case 'c':
{
break;
}
default:
{
if (isdigit(c))
{
levelnew = atoi(pChar);
forcelevel = levelnew;
doTitle = false;
Printf("Jumping to level %d...\n", levelnew);
}
break;
}
}
}
}
}
}
static const char* actions[] =
{
"Move_Forward",
@ -1266,7 +1148,6 @@ int GameInterface::app_main()
PatchDemoStrings();
// loc_115F5:
nItemTextIndex = FindGString("ITEMS");
nFirstPassword = FindGString("PASSWORDS");
nFirstPassInfo = FindGString("PASSINFO");

View file

@ -214,8 +214,6 @@ extern short lastfps;
extern int flash;
extern short bNoCreatures;
extern short nLocalSpr;
extern short levelnew;
@ -231,7 +229,6 @@ extern int lCountDown;
extern short bSlipMode;
extern short nItemTextIndex;
extern const char* gString[];
extern const char* gPSDemoString[];
extern const char* gEXDemoString[];

View file

@ -431,7 +431,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
int v6 = nLotag % 1000;
if (!bNoCreatures || v6 < 100 || v6 > 118)
if (!userConfig.nomonsters || v6 < 100 || v6 > 118)
{
if (v6 > 999) {
mydeletesprite(nSprite);
@ -452,7 +452,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 118: // Anubis with drum
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -462,7 +462,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 117:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -492,7 +492,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 111:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -502,7 +502,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 108:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -512,7 +512,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 107:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -522,7 +522,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 106:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -532,7 +532,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 105:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -542,7 +542,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 104:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -552,7 +552,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 103:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -562,7 +562,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 102:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -572,7 +572,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 101:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}
@ -582,7 +582,7 @@ void ProcessSpriteTag(short nSprite, short nLotag, short nHitag)
}
case 100:
{
if (bNoCreatures) {
if (userConfig.nomonsters) {
mydeletesprite(nSprite);
return;
}

View file

@ -353,7 +353,7 @@ short nBeforeScene[] = { 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
void CheckBeforeScene(int nLevel)
{
if (1)//nLevel == kMap20)
if (nLevel == kMap20)
{
RunCinemaScene(-1);
return;
@ -439,12 +439,6 @@ int FindGString(const char *str)
return -1;
}
uint8_t CheckForEscape()
{
return inputState.CheckAllInput();
}
static SavegameHelper sgh("menu",
SA(nCinemaSeen),
SA(energytile),

View file

@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "menu.h"
#include "sound.h"
#include "buildtiles.h"
#include "gstrings.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
@ -908,6 +909,17 @@ void DoKenTest()
}
}
static void pickupMessage(int no)
{
no = nItemText[no];
if (no != -1)
{
FStringf label("TXT_EX_PICKUP%d", no + 1);
auto str = GStrings[label];
if (str) Printf(PRINT_NOTIFY, "%s\n", str);
}
}
void FuncPlayer(int a, int nDamage, int nRun)
{
int var_48 = 0;
@ -1740,7 +1752,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -1805,7 +1817,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -1896,7 +1908,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -1970,7 +1982,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2044,7 +2056,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2215,7 +2227,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2277,7 +2289,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2339,7 +2351,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2401,7 +2413,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2463,7 +2475,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);
@ -2525,7 +2537,7 @@ do_default_b:
{
if (nItemText[var_70] > -1 && nTotalPlayers == 1)
{
StatusMessage(400, gString[nItemTextIndex + nItemText[var_70]]);
pickupMessage(var_70);
}
TintPalette(var_44*4, var_8C*4, 0);

View file

@ -2286,4 +2286,35 @@ from destruction.
Your bravery and heroism
are legendary.
",TXT_EX_CINEMA8,,,,,,,,,,,,,,,,,,,,,,
",TXT_EX_CINEMA8,,,,,,,,,,,,,,,,,,,,,,
"LOBOTOMY SOFTWARE, INC.,",TXT_EX_COPYRIGHT1,,,,,,,,,,,,,,,,,,,,,,
"3D ENGINE BY 3D REALMS,",TXT_EX_COPYRIGHT2,,,,,,,,,,,,,,,,,,,,,,
Life Blood,TXT_EX_PICKUP1,,,,,,,,,,,,,,,,,,,,,,
Life,TXT_EX_PICKUP2,,,,,,,,,,,,,,,,,,,,,,
Venom,TXT_EX_PICKUP3,,,,,,,,,,,,,,,,,,,,,,
You're Losing Your Grip,TXT_EX_PICKUP4,,,,,,,,,,,,,,,,,,,,,,
Full Life,TXT_EX_PICKUP5,,,,,,,,,,,,,,,,,,,,,,
Invincibility,TXT_EX_PICKUP6,,,,,,,,,,,,,,,,,,,,,,
Invisibility,TXT_EX_PICKUP7,,,,,,,,,,,,,,,,,,,,,,
Torch,TXT_EX_PICKUP8,,,,,,,,,,,,,,,,,,,,,,
Sobek Mask,TXT_EX_PICKUP9,,,,,,,,,,,,,,,,,,,,,,
Increased Weapon Power!,TXT_EX_PICKUP10,,,,,,,,,,,,,,,,,,,,,,
The Map!,TXT_EX_PICKUP11,,,,,,,,,,,,,,,,,,,,,,
An Extra Life!,TXT_EX_PICKUP12,,,,,,,,,,,,,,,,,,,,,,
.357 Magnum!,TXT_EX_PICKUP13,,,,,,,,,,,,,,,,,,,,,,
Grenade,TXT_EX_PICKUP14,,,,,,,,,,,,,,,,,,,,,,
M-60,TXT_EX_PICKUP15,,,,,,,,,,,,,,,,,,,,,,
Flame Thrower!,TXT_EX_PICKUP16,,,,,,,,,,,,,,,,,,,,,,
Cobra Staff!,TXT_EX_PICKUP17,,,,,,,,,,,,,,,,,,,,,,
The Eye Of Rah Gauntlet!,TXT_EX_PICKUP18,,,,,,,,,,,,,,,,,,,,,,
Speed Loader,TXT_EX_PICKUP19,,,,,,,,,,,,,,,,,,,,,,
Ammo,TXT_EX_PICKUP20,,,,,,,,,,,,,,,,,,,,,,
Fuel,TXT_EX_PICKUP21,,,,,,,,,,,,,,,,,,,,,,
Cobra!,TXT_EX_PICKUP22,,,,,,,,,,,,,,,,,,,,,,
Raw Energy,TXT_EX_PICKUP23,,,,,,,,,,,,,,,,,,,,,,
Power Key,TXT_EX_PICKUP24,,,,,,,,,,,,,,,,,,,,,,
Time Key,TXT_EX_PICKUP25,,,,,,,,,,,,,,,,,,,,,,
War Key,TXT_EX_PICKUP26,,,,,,,,,,,,,,,,,,,,,,
Earth Key,TXT_EX_PICKUP27,,,,,,,,,,,,,,,,,,,,,,
Magic,TXT_EX_PICKUP28,,,,,,,,,,,,,,,,,,,,,,
Location Preserved,TXT_EX_PICKUP29,,,,,,,,,,,,,,,,,,,,,,
1 default Identifier Remarks Filter eng enc ena enz eni ens enj enb enl ent enw cs de el eo es esm esn esg esc esa esd esv eso esr ess esf esl esy esz esb ese esh esi esu fi fr hu it jp ko nl pl pt ptg ro ru sr
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320