diff options
Diffstat (limited to 'engines/kyra/engine/darkmoon.cpp')
-rw-r--r-- | engines/kyra/engine/darkmoon.cpp | 81 |
1 files changed, 81 insertions, 0 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; |