diff options
-rw-r--r-- | devtools/create_kyradat/create_kyradat.cpp | 15 | ||||
-rw-r--r-- | devtools/create_kyradat/create_kyradat.h | 5 | ||||
-rw-r--r-- | devtools/create_kyradat/games.cpp | 10 | ||||
-rw-r--r-- | devtools/create_kyradat/tables.cpp | 35 | ||||
-rw-r--r-- | dists/engine-data/kyra.dat | bin | 460294 -> 462993 bytes | |||
-rw-r--r-- | engines/kyra/eobcommon.cpp | 36 | ||||
-rw-r--r-- | engines/kyra/eobcommon.h | 18 | ||||
-rw-r--r-- | engines/kyra/gui_eob.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/items_eob.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/magic_eob.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/resource.h | 5 | ||||
-rw-r--r-- | engines/kyra/script_eob.cpp | 5 | ||||
-rw-r--r-- | engines/kyra/sprites_eob.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/staticres_eob.cpp | 10 |
14 files changed, 141 insertions, 21 deletions
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp index 68fc8cc5b7..582516bc93 100644 --- a/devtools/create_kyradat/create_kyradat.cpp +++ b/devtools/create_kyradat/create_kyradat.cpp @@ -346,6 +346,11 @@ const ExtractFilename extractFilenames[] = { { kEobBaseDscItemShapeMap, kTypeRawData, false }, { kEobBaseDscTelptrShpCoords, kTypeRawData, false }, + { kEobBasePortalSeqData, kTypeRawData, false }, + { kEobBaseManDef, kTypeRawData, true }, + { kEobBaseManWord, kTypeStringList, true }, + { kEobBaseManPrompt, kTypeStringList, true }, + { kEobBaseDscMonsterFrmOffsTbl1, kTypeRawData, false }, { kEobBaseDscMonsterFrmOffsTbl2, kTypeRawData, false }, @@ -1556,7 +1561,15 @@ const char *getIdString(const int id) { case kEobBaseFlightObjSclIndex: return "kEobBaseFlightObjSclIndex"; case kEobBaseDscTelptrShpCoords: - return "kEobBaseDscTelptrShpCoords"; + return "kEobBaseDscTelptrShpCoords"; + case kEobBasePortalSeqData: + return "kEobBasePortalSeqData"; + case kEobBaseManDef: + return "kEobBaseManDef"; + case kEobBaseManWord: + return "kEobBaseManWord"; + case kEobBaseManPrompt: + return "kEobBaseManPrompt"; case kEobBaseBookNumbers: return "kEobBaseBookNumbers"; case kEobBaseMageSpellsList: diff --git a/devtools/create_kyradat/create_kyradat.h b/devtools/create_kyradat/create_kyradat.h index 54fd91b394..ebaff503f4 100644 --- a/devtools/create_kyradat/create_kyradat.h +++ b/devtools/create_kyradat/create_kyradat.h @@ -361,6 +361,11 @@ enum kExtractID { kEobBaseFlightObjSclIndex, kEobBaseDscTelptrShpCoords, + + kEobBasePortalSeqData, + kEobBaseManDef, + kEobBaseManWord, + kEobBaseManPrompt, kEobBaseBookNumbers, kEobBaseMageSpellsList, diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp index 5f710507f4..6e1503b45b 100644 --- a/devtools/create_kyradat/games.cpp +++ b/devtools/create_kyradat/games.cpp @@ -1215,6 +1215,11 @@ const int eob1FloppyNeed[] = { kEobBaseDscItemShapeMap, kEobBaseDscTelptrShpCoords, + kEobBasePortalSeqData, + kEobBaseManDef, + kEobBaseManWord, + kEobBaseManPrompt, + kEobBaseDscMonsterFrmOffsTbl1, kEobBaseDscMonsterFrmOffsTbl2, @@ -1423,6 +1428,11 @@ const int eob2FloppyNeed[] = { kEobBaseDscItemShapeMap, kEobBaseDscTelptrShpCoords, + kEobBasePortalSeqData, + kEobBaseManDef, + kEobBaseManWord, + kEobBaseManPrompt, + kEobBaseDscMonsterFrmOffsTbl1, kEobBaseDscMonsterFrmOffsTbl2, diff --git a/devtools/create_kyradat/tables.cpp b/devtools/create_kyradat/tables.cpp index 663652d4be..e27c6edf44 100644 --- a/devtools/create_kyradat/tables.cpp +++ b/devtools/create_kyradat/tables.cpp @@ -2063,6 +2063,36 @@ const ExtractEntrySearchData kEobBaseDscTelptrShpCoordsProvider[] = { EXTRACT_END_ENTRY }; +const ExtractEntrySearchData kEobBasePortalSeqDataProvider[] = { + { UNK_LANG, kPlatformPC, { 0x0000007E, 0x000002D0, { { 0x18, 0x7E, 0x65, 0x17, 0x4C, 0xD2, 0xB5, 0x2E, 0x81, 0xF8, 0x1C, 0xAC, 0x37, 0x21, 0x62, 0x2A } } } }, + + EXTRACT_END_ENTRY +}; + +const ExtractEntrySearchData kEobBaseManDefProvider[] = { + { EN_ANY, kPlatformPC, { 0x00000078, 0x000002CD, { { 0x33, 0x9B, 0x0C, 0x6A, 0x2E, 0x4F, 0xE9, 0x02, 0x7B, 0xEE, 0xF1, 0x04, 0xA3, 0xBA, 0xD4, 0xF3 } } } }, // Eob 1 + { DE_DEU, kPlatformPC, { 0x00000078, 0x000002C4, { { 0x92, 0x20, 0x58, 0x5F, 0x44, 0x09, 0x0B, 0xF0, 0xDA, 0x09, 0xE2, 0x44, 0x0B, 0xB7, 0x95, 0x96 } } } }, // Eob 1 + { EN_ANY, kPlatformPC, { 0x000000C8, 0x00000834, { { 0x18, 0xEA, 0x33, 0xB7, 0x4B, 0x72, 0x23, 0x8D, 0x0E, 0x9F, 0x4E, 0xF5, 0x09, 0xA3, 0x9C, 0xEA } } } }, // Eob 2 + { DE_DEU, kPlatformPC, { 0x000000C8, 0x00000622, { { 0xFE, 0x1D, 0x94, 0x3A, 0x0B, 0x17, 0x89, 0xEF, 0x60, 0x18, 0xB2, 0x43, 0x7A, 0x02, 0xDB, 0x61 } } } }, // Eob 2 + EXTRACT_END_ENTRY +}; + +const ExtractEntrySearchData kEobBaseManWordProvider[] = { + { EN_ANY, kPlatformPC, { 0x000000E0, 0x00005134, { { 0x68, 0x9C, 0x19, 0x2B, 0x5F, 0x38, 0x36, 0x41, 0xA7, 0x7E, 0xB7, 0x51, 0x41, 0x60, 0x1D, 0x67 } } } }, // Eob 1 + { DE_DEU, kPlatformPC, { 0x000000EA, 0x00005458, { { 0xEC, 0x14, 0x11, 0xE9, 0x19, 0xFD, 0xF8, 0xFC, 0xA8, 0x46, 0x3D, 0xCD, 0x56, 0x08, 0xC3, 0x4A } } } }, // Eob 1 + { EN_ANY, kPlatformPC, { 0x0000017E, 0x00008B64, { { 0x66, 0x38, 0x09, 0x5B, 0x2E, 0x50, 0x54, 0x43, 0x1C, 0xEC, 0x56, 0x3B, 0x72, 0x39, 0xF9, 0xC3 } } } }, // Eob 2 + { DE_DEU, kPlatformPC, { 0x0000015B, 0x00007C37, { { 0x44, 0xA3, 0x32, 0x88, 0x9F, 0x63, 0x28, 0xA0, 0xBD, 0x00, 0xF1, 0x08, 0xCA, 0xE5, 0xFE, 0x5F } } } }, // Eob 2 + EXTRACT_END_ENTRY +}; + +const ExtractEntrySearchData kEobBaseManPromptProvider[] = { + { EN_ANY, kPlatformPC, { 0x00000041, 0x000013AC, { { 0x40, 0x2B, 0xB5, 0x99, 0xEF, 0x8F, 0x3C, 0x9F, 0xB1, 0x5A, 0xBE, 0xE4, 0x80, 0x8E, 0xBB, 0x96 } } } }, // Eob 1 + { DE_DEU, kPlatformPC, { 0x00000048, 0x000015A5, { { 0x0B, 0xB4, 0x9E, 0xAD, 0xB3, 0x56, 0x75, 0xC1, 0xAE, 0x29, 0xF7, 0xB5, 0x82, 0x14, 0xD1, 0x27 } } } }, // Eob 1 + { EN_ANY, kPlatformPC, { 0x00000041, 0x000013AC, { { 0x40, 0x2B, 0xB5, 0x99, 0xEF, 0x8F, 0x3C, 0x9F, 0xB1, 0x5A, 0xBE, 0xE4, 0x80, 0x8E, 0xBB, 0x96 } } } }, // Eob 2 + { DE_DEU, kPlatformPC, { 0x0000005C, 0x00001D08, { { 0x10, 0xCE, 0x2D, 0xED, 0xA9, 0xA0, 0x7C, 0xA1, 0x91, 0x3F, 0xD8, 0x43, 0x03, 0x53, 0x97, 0xCA } } } }, // Eob 2 + EXTRACT_END_ENTRY +}; + const ExtractEntrySearchData kEobBaseDscMonsterFrmOffsTbl1Provider[] = { { UNK_LANG, kPlatformPC, { 0x00000020, 0x00001000, { { 0x98, 0x27, 0x57, 0x25, 0x3B, 0x04, 0x7D, 0x14, 0x3A, 0xD4, 0xA2, 0x5D, 0xBA, 0x04, 0x45, 0xAC } } } }, EXTRACT_END_ENTRY @@ -3758,6 +3788,11 @@ const ExtractEntry extractProviders[] = { { kEobBaseDscItemShapeMap, kEobBaseDscItemShapeMapProvider }, { kEobBaseDscTelptrShpCoords, kEobBaseDscTelptrShpCoordsProvider }, + { kEobBasePortalSeqData, kEobBasePortalSeqDataProvider }, + { kEobBaseManDef, kEobBaseManDefProvider }, + { kEobBaseManWord, kEobBaseManWordProvider }, + { kEobBaseManPrompt, kEobBaseManPromptProvider }, + { kEobBaseDscMonsterFrmOffsTbl1, kEobBaseDscMonsterFrmOffsTbl1Provider }, { kEobBaseDscMonsterFrmOffsTbl2, kEobBaseDscMonsterFrmOffsTbl2Provider }, diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat Binary files differindex 3b79f0406d..7cbd3b6c2c 100644 --- a/dists/engine-data/kyra.dat +++ b/dists/engine-data/kyra.dat diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index eef3873285..f323dd4e17 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -1500,6 +1500,40 @@ int EobCoreEngine::countResurrectionCandidates() { return _rrCount; } +void EobCoreEngine::seq_portal() { + //_portalSeq +} + +bool EobCoreEngine::checkPassword() { + char answ[20]; + Screen::FontId of = _screen->setFont(Screen::FID_8_FNT); + _screen->copyPage(0, 10); + + _screen->setScreenDim(13); + gui_drawBox(_screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, _color1_1, _color2_1, -1); + gui_drawBox((_screen->_curDim->sx << 3) + 1, _screen->_curDim->sy + 1, (_screen->_curDim->w << 3) - 2, _screen->_curDim->h - 2, _color1_1, _color2_1, _bkgColor_1); + _screen->modifyScreenDim(13, _screen->_curDim->sx + 1, _screen->_curDim->sy + 2, _screen->_curDim->w - 2, _screen->_curDim->h - 16); + + for (int i = 0; i < 3; i++) { + _screen->fillRect(_screen->_curDim->sx << 3, _screen->_curDim->sy, ((_screen->_curDim->sx + _screen->_curDim->w) << 3) - 1, (_screen->_curDim->sy + _screen->_curDim->h) - 1, _bkgColor_1); + int c = rollDice(1, _mnNumWord - 1, -1); + _screen->drawShape(0, _largeItemShapes[_mnDef[c << 2]], 100, 2, 13); + _screen->printShadedText(Common::String::format(_mnPrompt[0], _mnDef[(c << 2) + 1], _mnDef[(c << 2) + 2]).c_str(), (_screen->_curDim->sx + 1) << 3, _screen->_curDim->sy, _screen->_curDim->unk8, _bkgColor_1); + memset(answ, 0, 20); + gui_drawBox(76, 100, 133, 14, _color2_1, _color1_1, -1); + gui_drawBox(77, 101, 131, 12, _color2_1, _color1_1, -1); + if (_gui->getTextInput(answ, 10, 103, 15, _screen->_curDim->unk8, _bkgColor_1, 8) < 0) + i = 3; + if (scumm_stricmp(_mnWord[c], answ) && i == 2) + return false; + } + + _screen->modifyScreenDim(13, _screen->_curDim->sx - 1, _screen->_curDim->sy - 2, _screen->_curDim->w + 2, _screen->_curDim->h + 16); + _screen->setFont(of); + _screen->copyPage(10, 0); + return true; +} + void EobCoreEngine::useSlotWeapon(int charIndex, int slotIndex, Item item) { EobCharacter *c = &_characters[charIndex]; int tp = item ? _items[item].type : 0; @@ -2110,7 +2144,7 @@ void EobCoreEngine::explodeMonster(EobMonsterInPlay *m) { } void EobCoreEngine::snd_playSoundEffect(int id, int volume) { - if (id < 1 || id > 119 || shouldQuit()) + if ((id < 1) || (_flags.gameID == GI_EOB2 && id > 119) || shouldQuit()) return; _sound->playSoundEffect(id, volume); diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index 1c730f7687..7ebc883f3e 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -174,15 +174,15 @@ struct EobMonsterProperty { int32 experience; uint8 u30; - uint8 sound1; - uint8 sound2; + int8 sound1; + int8 sound2; uint8 numRemoteAttacks; uint8 remoteWeaponChangeMode; uint8 numRemoteWeapons; int8 remoteWeapons[5]; - uint8 tuResist; + int8 tuResist; uint8 dmgModifierEvade; uint8 decorations[3]; @@ -623,6 +623,7 @@ protected: const uint8 *_wllFlagPreset; int _wllFlagPresetSize; const uint8 *_teleporterShapeCoords; + const uint8 *_portalSeq; // Script void runLevelScript(int block, int flags); @@ -807,12 +808,16 @@ protected: // misc void delay(uint32 millis, bool doUpdate = false, bool isMainLoop = false); + void displayParchment(int id); int countResurrectionCandidates(); + + void seq_portal(); + bool checkPassword(); + virtual int resurrectionSelectDialogue() = 0; virtual void useHorn(int charIndex, int weaponSlot) {} virtual bool checkPartyStatusExtra() = 0; - virtual void drawLightningColumn() {} virtual int charSelectDialogue() { return -1; } virtual void characterLevelGain(int charIndex) {} @@ -826,6 +831,11 @@ protected: const char * const *_saveLoadStrings; + const uint8 *_mnDef; + const char * const *_mnWord; + const char * const *_mnPrompt; + int _mnNumWord; + int _rrCount; const char *_rrNames[10]; int8 _rrId[10]; diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp index c495eb541f..9dec1584c5 100644 --- a/engines/kyra/gui_eob.cpp +++ b/engines/kyra/gui_eob.cpp @@ -2509,7 +2509,7 @@ int GUI_Eob::getTextInput(char *dest, int x, int y, int destMaxLen, int textColo in = 0; _keyPressed.reset(); - while (!in) { + while (!in && !_vm->shouldQuit()) { if (next <= _vm->_system->getMillis()) { if (cursorState) { _screen->copyRegion((pos + 1) << 3, 191, (x + pos) << 3, y, 8, 9, 2, 0, Screen::CR_NO_P_CHECK); @@ -2595,7 +2595,7 @@ int GUI_Eob::getTextInput(char *dest, int x, int y, int destMaxLen, int textColo _screen->printShadedText(sufx, (x + pos) << 3, y, textColor1, textColor2); _screen->updateScreen(); - } while (_keyPressed.keycode != Common::KEYCODE_RETURN && _keyPressed.keycode != Common::KEYCODE_ESCAPE); + } while (_keyPressed.keycode != Common::KEYCODE_RETURN && _keyPressed.keycode != Common::KEYCODE_ESCAPE && !_vm->shouldQuit()); return _keyPressed.keycode == Common::KEYCODE_ESCAPE ? -1 : len; } @@ -3194,8 +3194,10 @@ bool GUI_Eob::restParty() { continue; if (_vm->checkInventoryForItem(i, 30, -1) == -1) continue; - if (_vm->restParty_checkHealSpells(i)) + if (_vm->restParty_checkHealSpells(i)) { useHealers = confirmDialogue(40); + break; + } } } diff --git a/engines/kyra/items_eob.cpp b/engines/kyra/items_eob.cpp index 78d3f8b8aa..b48c3934c8 100644 --- a/engines/kyra/items_eob.cpp +++ b/engines/kyra/items_eob.cpp @@ -176,7 +176,9 @@ int EobCoreEngine::deleteInventoryItem(int charIndex, int slot) { void EobCoreEngine::deleteBlockItem(uint16 block, int type) { uint16 itm = _levelBlockProperties[block].drawObjects; if (!itm) - return; + return; + + _levelBlockProperties[block].drawObjects = 0; for (uint16 i2 = itm, i = 0; itm != i2 || !i; i++ ) { if (type == _items[itm].type || type == -1) { diff --git a/engines/kyra/magic_eob.cpp b/engines/kyra/magic_eob.cpp index 70e4892342..3eb7591413 100644 --- a/engines/kyra/magic_eob.cpp +++ b/engines/kyra/magic_eob.cpp @@ -75,7 +75,7 @@ void EobCoreEngine::useMagicScroll(int charIndex, int type, int weaponSlot) { } void EobCoreEngine::usePotion(int charIndex, int weaponSlot) { - EobCharacter *c = &_characters[_openBookChar]; + EobCharacter *c = &_characters[charIndex]; int val = deleteInventoryItem(charIndex, weaponSlot); snd_playSoundEffect(10); @@ -607,6 +607,7 @@ bool EobCoreEngine::magicObjectStatusHit(EobMonsterInPlay *m, int type, bool try } bool EobCoreEngine::turnUndeadHit(EobMonsterInPlay *m, int hitChance, int casterLevel) { + assert(_monsterProps[m->type].tuResist > 0); uint8 e = _turnUndeadEffect[_monsterProps[m->type].tuResist * 14 + MIN(casterLevel, 14)]; if (e == 0xff) { diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 55946e5b7f..0f1539b610 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -435,6 +435,11 @@ enum KyraResources { kEobBaseDscTelptrShpCoords, + kEobBasePortalSeqData, + kEobBaseManDef, + kEobBaseManWord, + kEobBaseManPrompt, + kEobBaseBookNumbers, kEobBaseMageSpellsList, kEobBaseClericSpellsList, diff --git a/engines/kyra/script_eob.cpp b/engines/kyra/script_eob.cpp index 1e113fb2ae..715970074a 100644 --- a/engines/kyra/script_eob.cpp +++ b/engines/kyra/script_eob.cpp @@ -1416,12 +1416,11 @@ int EobInfProcessor::oeob_sequence(int8 *data) { return 0; case -2: - // portal sequence - error("EobInfProcessor::oeob_sequence(): unimplemented cmd -2"); + _vm->seq_portal(); break; case -1: - // copy protection + _vm->_runFlag = _vm->checkPassword(); break; default: diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp index 97ee51bd22..3447b6bc7f 100644 --- a/engines/kyra/sprites_eob.cpp +++ b/engines/kyra/sprites_eob.cpp @@ -107,8 +107,8 @@ const uint8 *EobCoreEngine::loadMonsterProperties(const uint8 *data) { data += 2; d->u30 = *data++; - d->sound1 = *data++; - d->sound2 = *data++; + d->sound1 = (int8)*data++; + d->sound2 = (int8)*data++; d->numRemoteAttacks = *data++; if (*data++ != 0xff) { @@ -121,7 +121,7 @@ const uint8 *EobCoreEngine::loadMonsterProperties(const uint8 *data) { } } - d->tuResist = *data++; + d->tuResist = (int8)*data++; d->dmgModifierEvade = *data++; for (int i = 0; i < 3; i++) @@ -1181,7 +1181,7 @@ bool EobCoreEngine::walkMonsterNextStep(EobMonsterInPlay *m, int destBlock, int m->dir = direction; checkSceneUpdateNeed(obl); - if (!_partyResting && p->sound2) + if (!_partyResting && p->sound2 > 0) snd_processEnvironmentalSoundEffect(p->sound2, m->block); return true; diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp index ea943f32d4..9b15d4aea8 100644 --- a/engines/kyra/staticres_eob.cpp +++ b/engines/kyra/staticres_eob.cpp @@ -448,6 +448,10 @@ void EobCoreEngine::initStaticResource() { _npcPreset = _staticres->loadEobNpcData(kEobBaseNpcPresets, temp); _teleporterShapeCoords = _staticres->loadRawData(kEobBaseDscTelptrShpCoords, temp); + _portalSeq = _staticres->loadRawData(kEobBasePortalSeqData, temp); + _mnDef = _staticres->loadRawData(kEobBaseManDef, temp); + _mnWord = _staticres->loadStrings(kEobBaseManWord, _mnNumWord); + _mnPrompt = _staticres->loadStrings(kEobBaseManPrompt, temp); _monsterStepTable0 = (int8*) _staticres->loadRawData(_flags.gameID == GI_EOB2 ? kEobBaseMonsterStepTable02 : kEobBaseMonsterStepTable01, temp); _monsterStepTable1 = (int8*)_staticres->loadRawData(kEobBaseMonsterStepTable1, temp); @@ -1114,10 +1118,10 @@ void EobEngine::initStaticResource() { p->experience = READ_LE_UINT16(ps); ps += 2; p->u30 = *ps++; - p->sound1 = *ps++; - p->sound2 = *ps++; + p->sound1 = (int8)*ps++; + p->sound2 = (int8)*ps++; p->numRemoteAttacks = *ps++; - p->tuResist = *ps++; + p->tuResist = (int8)*ps++; p->dmgModifierEvade = *ps++; } } |