diff options
-rw-r--r-- | engines/kyra/engine/darkmoon.cpp | 81 | ||||
-rw-r--r-- | engines/kyra/engine/darkmoon.h | 3 | ||||
-rw-r--r-- | engines/kyra/engine/eobcommon.h | 2 | ||||
-rw-r--r-- | engines/kyra/engine/sprites_eob.cpp | 56 | ||||
-rw-r--r-- | engines/kyra/resource/staticres_eob.cpp | 1 |
5 files changed, 86 insertions, 57 deletions
diff --git a/engines/kyra/engine/darkmoon.cpp b/engines/kyra/engine/darkmoon.cpp index efe66a4d43..718e8a190e 100644 --- a/engines/kyra/engine/darkmoon.cpp +++ b/engines/kyra/engine/darkmoon.cpp @@ -42,6 +42,8 @@ DarkMoonEngine::DarkMoonEngine(OSystem *system, const GameFlags &flags) : EoBCor _amigaSoundIndex1 = 0; _amigaSoundIndex2 = 0; _amigaCurSoundIndex = 0; + _amigaSoundPatch = 0; + _amigaSoundPatchSize = 0; } DarkMoonEngine::~DarkMoonEngine() { @@ -235,6 +237,85 @@ void DarkMoonEngine::loadMonsterDecoration(Common::SeekableReadStream *stream, i } } +const uint8 *DarkMoonEngine::loadMonsterProperties(const uint8 *data) { + uint8 cmd = *data++; + while (cmd != 0xFF) { + EoBMonsterProperty *d = &_monsterProps[cmd]; + d->armorClass = (int8)*data++; + d->hitChance = (int8)*data++; + d->level = (int8)*data++; + d->hpDcTimes = *data++; + d->hpDcPips = *data++; + d->hpDcBase = *data++; + d->attacksPerRound = *data++; + d->dmgDc[0].times = *data++; + d->dmgDc[0].pips = *data++; + d->dmgDc[0].base = (int8)*data++; + d->dmgDc[1].times = *data++; + d->dmgDc[1].pips = *data++; + d->dmgDc[1].base = (int8)*data++; + d->dmgDc[2].times = *data++; + d->dmgDc[2].pips = *data++; + d->dmgDc[2].base = (int8)*data++; + d->immunityFlags = READ_LE_UINT16(data); + data += 2; + d->capsFlags = READ_LE_UINT16(data); + data += 2; + d->typeFlags = READ_LE_UINT16(data); + data += 2; + d->experience = READ_LE_UINT16(data); + data += 2; + + d->u30 = *data++; + d->sound1 = (int8)*data++; + d->sound2 = (int8)*data++; + + // I have confirmed with WinUAE that the monster sounds in EOB II Amiga German are broken. Some + // monsters do at least have walking sounds. Attack sounds seem to be completely dysfunctional + // for all monsters. Maybe the devs who did the localization used the DOS resources without doing + // the necessary modifications. A quick debug run and comparison leaves the impression that the + // German Amiga version indeed has the track numbers from the DOS version. + // WORKAROUND: I've made an autogenerated sound patch file from the English version for all levels, + // sub levels and monster types. It became clear from the patch file that 95% of all sound entries + // are sound1 = 38 and sound2 = 36. So I eliminated these entries from the patch file and set + // the 38/36 combo as the default. This remaining patch file is rather small... + if (_flags.platform == Common::kPlatformAmiga && _flags.lang == Common::DE_DEU) { + d->sound1 = 38; + d->sound2 = 36; + uint8 id = (_currentLevel - 1) | (_currentSub << 4) | (cmd << 5); + for (int i = 0; i < _amigaSoundPatchSize; i += 3) { + if (_amigaSoundPatch[i] == id) { + d->sound1 = _amigaSoundPatch[i + 1]; + d->sound2 = _amigaSoundPatch[i + 2]; + break; + } + } + } + + d->numRemoteAttacks = *data++; + + if (*data++ != 0xFF) { + d->remoteWeaponChangeMode = *data++; + d->numRemoteWeapons = *data++; + + for (int i = 0; i < d->numRemoteWeapons; i++) { + d->remoteWeapons[i] = (int8)*data; + data += 2; + } + } + + d->tuResist = (int8)*data++; + d->dmgModifierEvade = *data++; + + for (int i = 0; i < 3; i++) + d->decorations[i] = *data++; + + cmd = *data++; + } + + return data; +} + void DarkMoonEngine::replaceMonster(int unit, uint16 block, int pos, int dir, int type, int shpIndex, int mode, int h2, int randItem, int fixedItem) { uint8 flg = _levelBlockProperties[block].flags & 7; diff --git a/engines/kyra/engine/darkmoon.h b/engines/kyra/engine/darkmoon.h index b3a69d254a..05847dfabb 100644 --- a/engines/kyra/engine/darkmoon.h +++ b/engines/kyra/engine/darkmoon.h @@ -94,6 +94,7 @@ private: // Monsters void generateMonsterPalettes(const char *file, int16 monsterIndex); void loadMonsterDecoration(Common::SeekableReadStream *stream, int16 monsterIndex); + const uint8 *loadMonsterProperties(const uint8 *data); void replaceMonster(int unit, uint16 block, int d, int dir, int type, int shpIndex, int mode, int h2, int randItem, int fixedItem); bool killMonsterExtra(EoBMonsterInPlay *m); @@ -122,6 +123,8 @@ private: const char *const *_amigaSoundMapExtra; const int8 *_amigaSoundIndex1; const uint8 *_amigaSoundIndex2; + const uint8 *_amigaSoundPatch; + int _amigaSoundPatchSize; int _amigaCurSoundIndex; diff --git a/engines/kyra/engine/eobcommon.h b/engines/kyra/engine/eobcommon.h index c4340a2348..97d7ea3167 100644 --- a/engines/kyra/engine/eobcommon.h +++ b/engines/kyra/engine/eobcommon.h @@ -491,7 +491,7 @@ protected: uint8 *loadTownsShape(Common::SeekableReadStream *stream); virtual void generateMonsterPalettes(const char *file, int16 monsterIndex) {} virtual void loadMonsterDecoration(Common::SeekableReadStream *stream, int16 monsterIndex) {} - const uint8 *loadMonsterProperties(const uint8 *data); + virtual const uint8 *loadMonsterProperties(const uint8 *data) { return 0; } const uint8 *loadActiveMonsterData(const uint8 *data, int level); void initMonster(int index, int unit, uint16 block, int pos, int dir, int type, int shpIndex, int mode, int i, int randItem, int fixedItem); void placeMonster(EoBMonsterInPlay *m, uint16 block, int dir); diff --git a/engines/kyra/engine/sprites_eob.cpp b/engines/kyra/engine/sprites_eob.cpp index 17a5f555ed..362c6c85c9 100644 --- a/engines/kyra/engine/sprites_eob.cpp +++ b/engines/kyra/engine/sprites_eob.cpp @@ -88,62 +88,6 @@ uint8 *EoBCoreEngine::loadTownsShape(Common::SeekableReadStream *stream) { return shape; } -const uint8 *EoBCoreEngine::loadMonsterProperties(const uint8 *data) { - uint8 cmd = *data++; - while (cmd != 0xFF) { - EoBMonsterProperty *d = &_monsterProps[cmd]; - d->armorClass = (int8)*data++; - d->hitChance = (int8)*data++; - d->level = (int8)*data++; - d->hpDcTimes = *data++; - d->hpDcPips = *data++; - d->hpDcBase = *data++; - d->attacksPerRound = *data++; - d->dmgDc[0].times = *data++; - d->dmgDc[0].pips = *data++; - d->dmgDc[0].base = (int8)*data++; - d->dmgDc[1].times = *data++; - d->dmgDc[1].pips = *data++; - d->dmgDc[1].base = (int8)*data++; - d->dmgDc[2].times = *data++; - d->dmgDc[2].pips = *data++; - d->dmgDc[2].base = (int8)*data++; - d->immunityFlags = READ_LE_UINT16(data); - data += 2; - d->capsFlags = READ_LE_UINT16(data); - data += 2; - d->typeFlags = READ_LE_UINT16(data); - data += 2; - d->experience = READ_LE_UINT16(data); - data += 2; - - d->u30 = *data++; - d->sound1 = (int8)*data++; - d->sound2 = (int8)*data++; - d->numRemoteAttacks = *data++; - - if (*data++ != 0xFF) { - d->remoteWeaponChangeMode = *data++; - d->numRemoteWeapons = *data++; - - for (int i = 0; i < d->numRemoteWeapons; i++) { - d->remoteWeapons[i] = (int8)*data; - data += 2; - } - } - - d->tuResist = (int8)*data++; - d->dmgModifierEvade = *data++; - - for (int i = 0; i < 3; i++) - d->decorations[i] = *data++; - - cmd = *data++; - } - - return data; -} - const uint8 *EoBCoreEngine::loadActiveMonsterData(const uint8 *data, int level) { for (uint8 p = *data++; p != 0xFF; p = *data++) { uint8 v = *data++; diff --git a/engines/kyra/resource/staticres_eob.cpp b/engines/kyra/resource/staticres_eob.cpp index c0ec2431b6..2082fc6ac4 100644 --- a/engines/kyra/resource/staticres_eob.cpp +++ b/engines/kyra/resource/staticres_eob.cpp @@ -1369,6 +1369,7 @@ void DarkMoonEngine::initStaticResource() { _amigaSoundFiles2 = _staticres->loadStrings(kEoB2SoundFilesIngame2, temp); _amigaSoundIndex1 = (const int8*)_staticres->loadRawData(kEoB2SoundIndex1, temp); _amigaSoundIndex2 = _staticres->loadRawData(kEoB2SoundIndex2, temp); + _amigaSoundPatch = _staticres->loadRawData(kEoB2MonsterSoundPatchData, _amigaSoundPatchSize); static const char *const errorSlotNoNameString[3] = { " You must specify\r a name for your\r save game!", |