From a4c16f7447103c3264d1d4fd1ae3f980e242e604 Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Sun, 10 Oct 2010 09:47:19 +0000 Subject: HUGO: Move Dos strings from Parser to hugo.dat svn-id: r53109 --- dists/engine-data/hugo.dat | Bin 174175 -> 174491 bytes engines/hugo/hugo.h | 2 +- engines/hugo/parser.cpp | 43 +++++++++++++++++---------------------- engines/hugo/parser.h | 9 ++++---- tools/create_hugo/create_hugo.h | 2 +- tools/create_hugo/staticparser.h | 11 ++++++++-- 6 files changed, 35 insertions(+), 32 deletions(-) diff --git a/dists/engine-data/hugo.dat b/dists/engine-data/hugo.dat index 720f5dac88..8fda3fb2f4 100644 Binary files a/dists/engine-data/hugo.dat and b/dists/engine-data/hugo.dat differ diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index 9801546f34..b86a0da268 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -33,7 +33,7 @@ #include "hugo/game.h" #define HUGO_DAT_VER_MAJ 0 // 1 byte -#define HUGO_DAT_VER_MIN 24 // 1 byte +#define HUGO_DAT_VER_MIN 25 // 1 byte #define DATAALIGNMENT 4 namespace Common { diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index a232e9df96..fae5dcf350 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -736,13 +736,13 @@ bool Parser_v1d::isNear(char *verb, char *noun, object_t *obj, char *comment) { return true; } else if (obj->screenIndex != *_vm._screen_p) { // Not in same screen if (obj->objValue) - strcpy (comment, "You don't have it!"); + strcpy (comment, _vm._textParser[kCmtAny4]); return false; } if (obj->cycling == INVISIBLE) { if (obj->seqNumb) { // There is an image - strcpy(comment, "I don't see it anywhere"); + strcpy(comment, _vm._textParser[kCmtAny5]); return false; } else { // No image, assume visible if ((obj->radius < 0) || @@ -754,10 +754,10 @@ bool Parser_v1d::isNear(char *verb, char *noun, object_t *obj, char *comment) { // or is not carrying it (small, portable objects of value) if (noun) { // Don't say unless object specified if (obj->objValue && (verb != _vm._arrayVerbs[_vm._take][0])) - strcpy(comment, "You don't have it!"); + strcpy(comment, _vm._textParser[kCmtAny4]); else - strcpy(comment, "You're not close enough!"); - } + strcpy(comment, _vm._textParser[kCmtClose]); + } return false; } } @@ -772,9 +772,9 @@ bool Parser_v1d::isNear(char *verb, char *noun, object_t *obj, char *comment) { // or is not carrying it (small, portable objects of value) if (noun) { // Don't say unless object specified if (obj->objValue && (verb != _vm._arrayVerbs[_vm._take][0])) - strcpy(comment, "You don't have it!"); + strcpy(comment, _vm._textParser[kCmtAny4]); else - strcpy(comment, "You're not close enough!"); + strcpy(comment, _vm._textParser[kCmtClose]); } return false; } @@ -794,23 +794,23 @@ bool Parser_v1d::isGenericVerb(char *word, object_t *obj) { if ((LOOK & obj->genericCmd) == LOOK) Utils::Box(BOX_ANY, "%s", _vm._textData[obj->dataIndex]); else - Utils::Box(BOX_ANY, "I see nothing special about it"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBUnusual_1d]); } else if (word == _vm._arrayVerbs[_vm._take][0]) { if (obj->carriedFl) - Utils::Box(BOX_ANY, "You already have it"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBHave]); else if ((TAKE & obj->genericCmd) == TAKE) takeObject(obj); else if (!obj->verbOnlyFl) // Make sure not taking object in context! - Utils::Box(BOX_ANY, "It is of no use to you"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNoUse]); else return false; } else if (word == _vm._arrayVerbs[_vm._drop][0]) { if (!obj->carriedFl) - Utils::Box(BOX_ANY, "You don't have it"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBDontHave]); else if ((DROP & obj->genericCmd) == DROP) dropObject(obj); else - Utils::Box(BOX_ANY, "No! You'll be needing it"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNeed]); } else { // It was not a generic cmd return false; } @@ -908,7 +908,7 @@ void Parser_v1d::lineHandler() { Utils::strlwr(_line); // Convert to lower case if (!strcmp("exit", _line) || strstr(_line, "quit")) { - if (Utils::Box(BOX_YESNO, "Are you sure you want to QUIT?") != 0) + if (Utils::Box(BOX_YESNO, "%s", _vm._textParser[kTBExit_1d]) != 0) _vm.endGame(); else return; @@ -969,9 +969,7 @@ void Parser_v1d::lineHandler() { else if (!isCatchallVerb(true, noun, verb, _vm._catchallList) && !isCatchallVerb(false, noun, verb, _vm._backgroundObjects[*_vm._screen_p]) && !isCatchallVerb(false, noun, verb, _vm._catchallList)) - Utils::Box(BOX_ANY, "Apparently our hero either doesn't\n" - "understand what you mean or doesn't\n" - "think that would be very useful!"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBEh_1d]); } Parser_v2d::Parser_v2d(HugoEngine &vm) : Parser_v1d(vm) { @@ -990,7 +988,7 @@ void Parser_v2d::lineHandler() { Utils::strlwr(_line); // Convert to lower case if (!strcmp("exit", _line) || strstr(_line, "quit")) { - if (Utils::Box(BOX_YESNO, "Are you sure you want to QUIT?") != 0) + if (Utils::Box(BOX_YESNO, "%s", _vm._textParser[kTBExit_1d]) != 0) _vm.endGame(); else return; @@ -1054,17 +1052,14 @@ void Parser_v2d::lineHandler() { if (*farComment != '\0') { // An object matched but not near enough Utils::Box(BOX_ANY, "%s", farComment); } else if (_maze.enabledFl && (verb == _vm._arrayVerbs[_vm._look][0])) { - Utils::Box(BOX_ANY, "You are in a maze of\n" - "twisty little paths,\n" - "which are all alike!"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBMaze]); showTakeables(); } else if (verb && noun) { // A combination I didn't think of - Utils::Box(BOX_ANY, "I don't think that would\n" - "accomplish much, somehow!"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNoUse_2d]); } else if (verb || noun) { - Utils::Box(BOX_ANY, "I don't fully understand!"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNoun]); } else { - Utils::Box(BOX_ANY, "I find that befuddling!"); + Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBEh_2d]); } } } diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index 96e5085050..de58c4bc35 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -35,10 +35,11 @@ namespace Hugo { enum seqTextParser { - kTBExit = 0, kTBMaze, kTBNoPoint, kTBNoun, kTBVerb, - kTBEh, kTBUnusual, kTBHave, kTBNoUse, kTBDontHave, - kTBNeed, kTBOk, kCmtAny1, kCmtAny2, kCmtAny3, - kCmtClose, kTBIntro, kTBOutro + kTBExit = 0, kTBMaze, kTBNoPoint, kTBNoun, kTBVerb, + kTBEh, kTBUnusual, kTBHave, kTBNoUse, kTBDontHave, + kTBNeed, kTBOk, kCmtAny1, kCmtAny2, kCmtAny3, + kCmtClose, kTBIntro, kTBOutro, kTBUnusual_1d, kCmtAny4, + kCmtAny5, kTBExit_1d, kTBEh_1d, kTBEh_2d, kTBNoUse_2d }; class Parser { diff --git a/tools/create_hugo/create_hugo.h b/tools/create_hugo/create_hugo.h index 02f7d9fbc1..0215885c1d 100644 --- a/tools/create_hugo/create_hugo.h +++ b/tools/create_hugo/create_hugo.h @@ -31,7 +31,7 @@ #define DATAALIGNMENT 4 #define HUGO_DAT_VER_MAJ 0 // 1 byte -#define HUGO_DAT_VER_MIN 24 // 1 byte +#define HUGO_DAT_VER_MIN 25 // 1 byte typedef unsigned char uint8; typedef unsigned char byte; diff --git a/tools/create_hugo/staticparser.h b/tools/create_hugo/staticparser.h index 95e790f40a..9e67e98c26 100644 --- a/tools/create_hugo/staticparser.h +++ b/tools/create_hugo/staticparser.h @@ -33,7 +33,7 @@ #ifndef STATICPARSER_H #define STATICPARSER_H -#define NUM_PARSER_TEXT 18 +#define NUM_PARSER_TEXT 25 const char *textParser[NUM_PARSER_TEXT] = { "You should press ALT+F4 or click on Game/Exit.", "You are in a maze of\ntwisty little paths,\nwhich are all alike!", @@ -52,7 +52,14 @@ const char *textParser[NUM_PARSER_TEXT] = { "I don't see any here!", "You're not close enough!", "You are carrying:", - "\nPress ESCAPE to continue" + "\nPress ESCAPE to continue", + "I see nothing special about it", + "You don't have it!", + "I don't see it anywhere", + "Are you sure you want to QUIT?", + "Apparently our hero either doesn't\nunderstand what you mean or doesn't\nthink that would be very useful!", + "I find that befuddling!", + "I don't think that would\naccomplish much, somehow!" }; #endif //STATICPARSER_H -- cgit v1.2.3