ULTIMA4: Move fix for LB Abyss response to create_ultima

This commit is contained in:
Paul Gilbert 2020-05-05 21:56:14 -07:00
parent f72927d5df
commit e8482d8c1d
4 changed files with 21 additions and 15 deletions

View File

@ -76,6 +76,10 @@ public:
return feof(_file);
}
int pos() const {
return ftell(_file);
}
uint32 computeMD5();
};
@ -106,7 +110,7 @@ public:
writeWord((val >> 16) & 0xffff);
}
int write(void *buf, int size) {
int write(const void *buf, int size) {
return (int)fwrite(buf, 1, size, _file);
}

View File

@ -31,6 +31,21 @@ void extractStringTable(File &src, const char *filename, int offset, int count)
char c;
for (int idx = 0; idx < count; ++idx) {
if (offset == 87754 && idx == 19) {
// String entry #19 for Lord British is dodgy in the original data
const char *STR = "\n\n\n\n\nHe says:\nThe Great Stygian Abyss is the darkest pocket of evil "
"remaining in Britannia!\n\n\n\n\nIt is said that in the deepest recesses of "
"the Abyss is the Chamber of the Codex!\n\n\n\nIt is also said that only one "
"of highest Virtue may enter this Chamber, one such as an Avatar!!!\n";
dest.write(STR, (int)strlen(STR));
dest.writeByte(0);
// Skip to next line
while (src.readByte()) {}
while (src.readByte()) {}
continue;
}
do {
c = src.readByte();
dest.writeByte(c);
@ -55,7 +70,7 @@ void extractUltima4Resources() {
// Extract string tables
extractStringTable(f2, "hawkwind.dat", 74729, 53);
extractStringTable(f2, "lb_keywords.dat", 87581, 24);
extractStringTable(f2, "lb_text.dat", 87754, 25);
extractStringTable(f2, "lb_text.dat", 87754, 24);
extractStringTable(f2, "virtue.dat", 0x0fc7b, 11);
extractStringTable(f2, "endgame1.dat", 0x0fee4, 7);
extractStringTable(f2, "endgame2.dat", 0x10187, 5);

View File

@ -41,12 +41,7 @@ Response *lordBritishGetIntro(const DynamicResponse *resp);
*/
Dialogue *U4LBDialogueLoader::load(void *source) {
Std::vector<Common::String> lbKeywords = u4read_stringtable("lb_keywords");
// There's a \0 in the 19th Common::String so we get a spurious 20th entry
Std::vector<Common::String> lbText = u4read_stringtable("lb_text");
for (int i = 20; i < 24; i++)
lbText[i] = lbText[i + 1];
lbText.pop_back();
Dialogue *dlg = new Dialogue();
dlg->setTurnAwayProb(0);
@ -63,14 +58,6 @@ Dialogue *U4LBDialogueLoader::load(void *source) {
dlg->addKeyword(lbKeywords[i], new Response(lbText[i]));
}
/* since the original game files are a bit sketchy on the 'abyss' keyword,
let's handle it here just to be safe :) */
dlg->addKeyword("abyss",
new Response("\n\n\n\n\nHe says:\nThe Great Stygian Abyss is the darkest pocket of evil "
"remaining in Britannia!\n\n\n\n\nIt is said that in the deepest recesses of "
"the Abyss is the Chamber of the Codex!\n\n\n\nIt is also said that only one "
"of highest Virtue may enter this Chamber, one such as an Avatar!!!\n"));
Response *heal = new Response("\n\n\n\n\n\nHe says: I am\nwell, thank ye.");
heal->add(g_responseParts->HEALCONFIRM);
dlg->addKeyword("heal", heal);