diff options
author | athrxx | 2011-08-15 01:43:26 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-12-26 16:18:14 +0100 |
commit | b288889c978990423b08dad8f838d891610f36b5 (patch) | |
tree | 888ac176612b06a7389e6b8f3f623d472cf10cdd /engines/kyra | |
parent | 0d54aff6324b1f6c739df89ab072328cc5402873 (diff) | |
download | scummvm-rg350-b288889c978990423b08dad8f838d891610f36b5.tar.gz scummvm-rg350-b288889c978990423b08dad8f838d891610f36b5.tar.bz2 scummvm-rg350-b288889c978990423b08dad8f838d891610f36b5.zip |
KYRA: (EOB) - implement wall of force spell
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/eobcommon.cpp | 9 | ||||
-rw-r--r-- | engines/kyra/eobcommon.h | 19 | ||||
-rw-r--r-- | engines/kyra/loleobbase.h | 4 | ||||
-rw-r--r-- | engines/kyra/magic_eob.cpp | 59 | ||||
-rw-r--r-- | engines/kyra/resource.h | 6 | ||||
-rw-r--r-- | engines/kyra/saveload_eob.cpp | 51 | ||||
-rw-r--r-- | engines/kyra/scene_eob.cpp | 7 | ||||
-rw-r--r-- | engines/kyra/script_eob.cpp | 12 | ||||
-rw-r--r-- | engines/kyra/sequences_eob2.cpp | 20 | ||||
-rw-r--r-- | engines/kyra/sprites_eob.cpp | 19 | ||||
-rw-r--r-- | engines/kyra/staticres_eob.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/timer_eob.cpp | 2 |
12 files changed, 178 insertions, 36 deletions
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index dc987c1533..c94cb16703 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -141,6 +141,8 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa _restPartyElapsedTime = 0; _allowSkip = false; + _wallsOfForce = 0; + _rrCount = 0; memset(_rrNames, 0, 10 * sizeof(const char*)); memset(_rrId, 0, 10 * sizeof(int8)); @@ -205,6 +207,7 @@ EobCoreEngine::~EobCoreEngine() { delete[] _spells; delete[] _spellAnimBuffer; + delete[] _wallsOfForce; delete _gui; _gui = 0; @@ -318,6 +321,9 @@ Common::Error EobCoreEngine::init() { _spellAnimBuffer = new uint8[4096]; memset(_spellAnimBuffer, 0, 4096); + _wallsOfForce = new WallOfForce[5]; + memset(_wallsOfForce, 0, 5 * sizeof(WallOfForce)); + memset(_doorType, 0, sizeof(_doorType)); memset(_noDoorSwitch, 0, sizeof(_noDoorSwitch)); @@ -349,7 +355,6 @@ Common::Error EobCoreEngine::go() { loadItemsAndDecorationsShapes(); _screen->setMouseCursor(0, 0, _itemIconShapes[0]); - _screen->showMouse(); loadItemDefs(); int action = 0; @@ -363,6 +368,7 @@ Common::Error EobCoreEngine::go() { startupLoad(); _gameToLoad = -1; } else { + _screen->showMouse(); action = mainMenu(); } @@ -453,6 +459,7 @@ void EobCoreEngine::runLoop() { _timer->update(); updateScriptTimers(); + updateWallOfForceTimers(); if (_sceneUpdateRequired) drawScene(1); diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index 51dfb8b726..ffc951e80d 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -561,6 +561,12 @@ protected: const uint16 *_encodeMonsterShpTable; const uint8 _teleporterWallId; + const int16 *_wallOfForceDsX; + const uint8 *_wallOfForceDsY; + const uint8 *_wallOfForceDsNumW; + const uint8 *_wallOfForceDsNumH; + const uint8 *_wallOfForceShpId; + const int8 *_monsterDirChangeTable; // Level @@ -833,6 +839,9 @@ protected: void *generateMonsterTempData(LevelTempData *tmp); void restoreMonsterTempData(LevelTempData *tmp); void releaseMonsterTempData(LevelTempData *tmp); + void *generateWallOfForceTempData(LevelTempData *tmp); + void restoreWallOfForceTempData(LevelTempData *tmp); + void releaseWallOfForceTempData(LevelTempData *tmp); const char * const *_saveLoadStrings; @@ -920,6 +929,9 @@ protected: Item createMagicWeaponItem(int flags, int icon, int value, int type); void removeMagicWeaponItem(Item item); + void updateWallOfForceTimers(); + void destroyWallOfForce(int index); + int findSingleSpellTarget(int dist); int findFirstCharacterSpellTarget(); @@ -1031,6 +1043,13 @@ protected: EobSpell *_spells; int _numSpells; + struct WallOfForce { + uint16 block; + uint32 duration; + }; + + WallOfForce *_wallsOfForce; + const char *const *_bookNumbers; const char *const *_mageSpellList; int _mageSpellListSize; diff --git a/engines/kyra/loleobbase.h b/engines/kyra/loleobbase.h index ba59fe796b..02b236d44f 100644 --- a/engines/kyra/loleobbase.h +++ b/engines/kyra/loleobbase.h @@ -60,6 +60,7 @@ struct LevelTempData { uint16 *flags; void *monsters; void *flyingObjects; + void *wallsOfForce; uint8 monsterDifficulty; }; @@ -315,6 +316,9 @@ protected: void restoreFlyingObjectTempData(LevelTempData *tmp); void *generateFlyingObjectTempData(LevelTempData *tmp); void releaseFlyingObjectTempData(LevelTempData *tmp); + virtual void *generateWallOfForceTempData(LevelTempData *tmp) { return 0; } + virtual void restoreWallOfForceTempData(LevelTempData *tmp) {} + virtual void releaseWallOfForceTempData(LevelTempData *tmp) {} LevelTempData *_lvlTempData[29]; const int _numFlyingObjects; diff --git a/engines/kyra/magic_eob.cpp b/engines/kyra/magic_eob.cpp index 2ad0da7258..646d389706 100644 --- a/engines/kyra/magic_eob.cpp +++ b/engines/kyra/magic_eob.cpp @@ -24,6 +24,7 @@ #include "kyra/eobcommon.h" #include "kyra/resource.h" +#include "common/system.h" namespace Kyra { @@ -490,11 +491,11 @@ bool EobCoreEngine::magicObjectDamageHit(EobFlyingObject *fo, int dcTimes, int d int blockDamage = fo->flags & 2; int hitTest = fo->flags & 4; - int s = 5; - int dmgType = 3; + int savingThrowType = 5; + int savingThrowEffect = 3; if (fo->flags & 8) { - s = 4; - dmgType = 0; + savingThrowType = 4; + savingThrowEffect = 0; } int dmgFlag = _spells[fo->callBackIndex].damageFlags; @@ -516,7 +517,7 @@ bool EobCoreEngine::magicObjectDamageHit(EobFlyingObject *fo, int dcTimes, int d continue; } - calcAndInflictMonsterDamage(&_monsters[*m], 0, 0, dmg, dmgFlag, s, dmgType); + calcAndInflictMonsterDamage(&_monsters[*m], 0, 0, dmg, dmgFlag, savingThrowType, savingThrowEffect); res = true; } updateAllMonsterShapes(); @@ -532,7 +533,7 @@ bool EobCoreEngine::magicObjectDamageHit(EobFlyingObject *fo, int dcTimes, int d int dmg = rollDice(dcTimes, dcPips, dcOffs) * level; res = true; - calcAndInflictCharacterDamage(i, 0, 0, dmg, dmgFlag, s, dmgType); + calcAndInflictCharacterDamage(i, 0, 0, dmg, dmgFlag, savingThrowType, savingThrowEffect); } } else { int c = _dscItemPosIndex[(_currentDirection << 2) + (fo->curPos & 3)]; @@ -545,7 +546,7 @@ bool EobCoreEngine::magicObjectDamageHit(EobFlyingObject *fo, int dcTimes, int d if ((_characters[c].flags & 1) && (!hitTest || monsterAttackHitTest(&_monsters[0], c))) { int dmg = rollDice(dcTimes, dcPips, dcOffs) * level; res = true; - calcAndInflictCharacterDamage(c, 0, 0, dmg, dmgFlag, s, dmgType); + calcAndInflictCharacterDamage(c, 0, 0, dmg, dmgFlag, savingThrowType, savingThrowEffect); } } } @@ -708,6 +709,22 @@ void EobCoreEngine::removeMagicWeaponItem(Item item) { _items[item].level = -1; } +void EobCoreEngine::updateWallOfForceTimers() { + uint32 ct = _system->getMillis(); + for (int i = 0; i < 5; i++) { + if (!_wallsOfForce[i].block) + continue; + if (_wallsOfForce[i].duration < ct) + destroyWallOfForce(i); + } +} + +void EobCoreEngine::destroyWallOfForce(int index) { + memset(_levelBlockProperties[_wallsOfForce[index].block].walls, 0, 4); + _wallsOfForce[index].block = 0; + _sceneUpdateRequired = true; +} + int EobCoreEngine::findSingleSpellTarget(int dist) { uint16 bl = _currentBlock; int res = -1; @@ -924,7 +941,7 @@ void EobCoreEngine::spellCallback_start_vampiricTouch() { Item i = (t != -1) ? createMagicWeaponItem(0x18, 83, 0, t) : -1; if (t == -1 || i == -1) { if (_flags.gameID == GI_EOB2) - printWarning(_magicStrings8[0]); + printWarning(_magicStrings8[2]); removeCharacterEffect(_activeSpell, _activeSpellCharId, 0); deleteCharEventTimer(_activeSpellCharId, -_activeSpell); _returnAfterSpellCallback = true; @@ -1019,7 +1036,33 @@ bool EobCoreEngine::spellCallback_end_holdMonster(void *obj) { } void EobCoreEngine::spellCallback_start_wallOfForce() { + uint16 bl = calcNewBlockPosition(_currentBlock, _currentDirection); + LevelBlockProperty *l = &_levelBlockProperties[bl]; + if (l->walls[0] || l->walls[1] || l->walls[2] || l->walls[3] || (l->flags & 7)) { + printWarning(_magicStrings8[3]); + return; + } + + uint32 dur = 0xffffffff; + int s = 0; + int i = 0; + for (; i < 5; i++) { + if (!_wallsOfForce[i].block) + break; + if (_wallsOfForce[i].duration < dur) { + dur = _wallsOfForce[i].duration; + s = i; + } + } + + if (i == 5) + destroyWallOfForce(s); + + memset(_levelBlockProperties[bl].walls, 74, 4); + _wallsOfForce[s].block = bl; + _wallsOfForce[s].duration = _system->getMillis() + (((getMageLevel(_openBookChar) * 546) >> 1) + 546) * _tickLength; + _sceneUpdateRequired = true; } void EobCoreEngine::spellCallback_start_disintegrate() { diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 5ed658ccee..f330d42004 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -627,6 +627,12 @@ enum KyraResources { kEob2HornStrings, kEob2HornSounds, + kEob2WallOfForceDsX, + kEob2WallOfForceDsY, + kEob2WallOfForceNumW, + kEob2WallOfForceNumH, + kEob2WallOfForceShpId, + kLolIngamePakFiles, kLolCharacterDefs, kLolIngameSfxFiles, diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp index 05eea820bb..24a10133d0 100644 --- a/engines/kyra/saveload_eob.cpp +++ b/engines/kyra/saveload_eob.cpp @@ -72,6 +72,7 @@ void LolEobBaseEngine::generateTempData() { _lvlTempData[l]->monsters = generateMonsterTempData(_lvlTempData[l]); _lvlTempData[l]->flyingObjects = generateFlyingObjectTempData(_lvlTempData[l]); + _lvlTempData[l]->wallsOfForce = generateWallOfForceTempData(_lvlTempData[l]); _hasTempDataFlags |= (1 << l); delete[] p2; @@ -104,6 +105,7 @@ void LolEobBaseEngine::restoreBlockTempData(int levelIndex) { restoreMonsterTempData(_lvlTempData[l]); restoreFlyingObjectTempData(_lvlTempData[l]); + restoreWallOfForceTempData(_lvlTempData[l]); delete[] p2; } @@ -115,6 +117,7 @@ void LolEobBaseEngine::releaseTempData() { delete[] _lvlTempData[i]->flags; releaseMonsterTempData(_lvlTempData[i]); releaseFlyingObjectTempData(_lvlTempData[i]); + releaseWallOfForceTempData(_lvlTempData[i]); delete _lvlTempData[i]; _lvlTempData[i] = 0; } @@ -293,13 +296,15 @@ Common::Error EobCoreEngine::loadGameState(int slot) { } _lvlTempData[i] = new LevelTempData; - _lvlTempData[i]->wallsXorData = new uint8[4096]; - _lvlTempData[i]->flags = new uint16[1024]; + LevelTempData *l = _lvlTempData[i]; + l->wallsXorData = new uint8[4096]; + l->flags = new uint16[1024]; EobMonsterInPlay *lm = new EobMonsterInPlay[30]; - _lvlTempData[i]->monsters = lm; + l->monsters = lm; EobFlyingObject *lf = new EobFlyingObject[_numFlyingObjects]; - _lvlTempData[i]->flyingObjects = lf; - LevelTempData *l = _lvlTempData[i]; + l->flyingObjects = lf; + WallOfForce *lw = new WallOfForce[5]; + l->wallsOfForce = lw; in.read(l->wallsXorData, 4096); for (int ii = 0; ii < 1024; ii++) @@ -349,10 +354,14 @@ Common::Error EobCoreEngine::loadGameState(int slot) { m->flags = in.readByte(); m->unused = in.readByte(); } + + for (int ii = 0; ii < 5; ii++) { + WallOfForce *w = &lw[ii]; + w->block = in.readUint16BE(); + w->duration = in.readUint32BE(); + } } - if (_flags.gameID == GI_EOB1) - _screen->loadPalette("EOBPAL.COL", _screen->getPalette(0)); loadLevel(_currentLevel, _currentSub); _sceneUpdateRequired = true; _screen->setFont(Screen::FID_6_FNT); @@ -515,6 +524,7 @@ Common::Error EobCoreEngine::saveGameStateIntern(int slot, const char *saveName, EobMonsterInPlay *lm = (EobMonsterInPlay*)_lvlTempData[i]->monsters; EobFlyingObject *lf = (EobFlyingObject*)_lvlTempData[i]->flyingObjects; + WallOfForce *lw = (WallOfForce*)_lvlTempData[i]->wallsOfForce; for (int ii = 0; ii < 30; ii++) { EobMonsterInPlay *m = &lm[ii]; @@ -560,6 +570,12 @@ Common::Error EobCoreEngine::saveGameStateIntern(int slot, const char *saveName, out->writeByte(m->flags); out->writeByte(m->unused); } + + for (int ii = 0; ii < 5; ii++) { + WallOfForce *w = &lw[ii]; + out->writeUint16BE(w->block); + out->writeUint32BE(w->duration); + } } out->finalize(); @@ -591,6 +607,27 @@ void EobCoreEngine::releaseMonsterTempData(LevelTempData *tmp) { delete[] p; } +void *EobCoreEngine::generateWallOfForceTempData(LevelTempData *tmp) { + WallOfForce *w = new WallOfForce[5]; + memcpy(w, _wallsOfForce, sizeof(WallOfForce) * 5); + uint32 ct = _system->getMillis(); + for (int i = 0; i < 5; i++) + w[i].duration = (w[i].duration > ct) ? w[i].duration - ct : _tickLength; + return w; +} + +void EobCoreEngine::restoreWallOfForceTempData(LevelTempData *tmp) { + memcpy(_wallsOfForce, tmp->wallsOfForce, sizeof(WallOfForce) * 5); + uint32 ct = _system->getMillis(); + for (int i = 0; i < 5; i++) + _wallsOfForce[i].duration += ct; +} + +void EobCoreEngine::releaseWallOfForceTempData(LevelTempData *tmp) { + WallOfForce *p = (WallOfForce*)tmp->wallsOfForce; + delete[] p; +} + #endif // ENABLE_EOB } // End of namespace Kyra diff --git a/engines/kyra/scene_eob.cpp b/engines/kyra/scene_eob.cpp index aef131f6cb..afce9efdfa 100644 --- a/engines/kyra/scene_eob.cpp +++ b/engines/kyra/scene_eob.cpp @@ -1144,9 +1144,12 @@ int EobCoreEngine::calcNewBlockPositionAndTestPassability(uint16 curBlock, uint1 if (!f) assert((_flags.gameID == GI_EOB1 && w < 70) || (_flags.gameID == GI_EOB2 && w < 80)); - if (w == 74 && _currentBlock == curBlock) { + if (_flags.gameID == GI_EOB2 && w == 74 && _currentBlock == curBlock) { for (int i = 0; i < 5; i++) { - + if (_wallsOfForce[i].block == b) { + destroyWallOfForce(i); + f = _wllWallFlags[0]; + } } } diff --git a/engines/kyra/script_eob.cpp b/engines/kyra/script_eob.cpp index 15f3c80b22..6feac6bd77 100644 --- a/engines/kyra/script_eob.cpp +++ b/engines/kyra/script_eob.cpp @@ -638,13 +638,13 @@ int EobInfProcessor::oeob_calcAndInflictCharacterDamage(int8 *data) { int useStrModifierOrBase = *pos++; int flg = (charIndex == -1) ? 4 : 0; - int a = 5; - int damageType = 1; + int savingThrowType = 5; + int savingThrowEffect = 1; if (_vm->game() == GI_EOB2) { flg = *pos++; - a = *pos++; - damageType = *pos++; + savingThrowType = *pos++; + savingThrowEffect = *pos++; } else if (!itemOrPips) { useStrModifierOrBase = times; times = 0; @@ -652,9 +652,9 @@ int EobInfProcessor::oeob_calcAndInflictCharacterDamage(int8 *data) { if (charIndex == -1) { for (int i = 0; i < 6; i++) - _vm->calcAndInflictCharacterDamage(i, times, itemOrPips, useStrModifierOrBase, flg, a, damageType); + _vm->calcAndInflictCharacterDamage(i, times, itemOrPips, useStrModifierOrBase, flg, savingThrowType, savingThrowEffect); } else { - _vm->calcAndInflictCharacterDamage(charIndex, times, itemOrPips, useStrModifierOrBase, flg, a, damageType); + _vm->calcAndInflictCharacterDamage(charIndex, times, itemOrPips, useStrModifierOrBase, flg, savingThrowType, savingThrowEffect); } return pos - data; } diff --git a/engines/kyra/sequences_eob2.cpp b/engines/kyra/sequences_eob2.cpp index 395e94713c..ea96779bb1 100644 --- a/engines/kyra/sequences_eob2.cpp +++ b/engines/kyra/sequences_eob2.cpp @@ -239,7 +239,7 @@ void DarkMoonEngine::seq_playIntro() { sq.loadScene(1, 2); sq.waitForSongNotifier(4); - //intro scroll + // intro scroll if (!skipFlag() && !shouldQuit()) { for (int i = 0; i < 280; i += 3) { uint32 endtime = _system->getMillis() + _tickLength; @@ -978,7 +978,7 @@ void DarkmoonSequenceHelper::loadScene(int index, int pageNum) { } if (!s) - error("DarkmoonSequenceHelper::loadScene(): Sequence CPS file loading failed."); + error("DarkmoonSequenceHelper::loadScene(): CPS file loading failure in scene %d", index); if (_mode == kFinale) s->read(_palettes[0]->getData(), 768); @@ -1026,7 +1026,7 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) { if (s->pal) setPaletteWithoutTextColor(palIndex); delay(s->delay); - if (_mode == DarkmoonSequenceHelper::kIntro && s->pal) + if (_mode == kIntro && s->pal) setPaletteWithoutTextColor(0); break; @@ -1035,7 +1035,7 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) { shapeW = _shapes[s->obj][2]; shapeH = _shapes[s->obj][3]; - if (_mode == DarkmoonSequenceHelper::kFinale) { + if (_mode == kFinale) { _screen->setScreenDim(18); x -= (_screen->_curDim->sx << 3); y -= _screen->_curDim->sy; @@ -1045,7 +1045,7 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) { x2 = x; } - _screen->drawShape(0, _shapes[s->obj], x, y, _mode == DarkmoonSequenceHelper::kIntro ? 0 : 18); + _screen->drawShape(0, _shapes[s->obj], x, y, _mode == kIntro ? 0 : 18); if (s->pal) setPaletteWithoutTextColor(palIndex); @@ -1054,7 +1054,7 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) { delay(s->delay); - if (_mode == DarkmoonSequenceHelper::kIntro) { + if (_mode == kIntro) { if (s->pal) setPaletteWithoutTextColor(0); _screen->copyRegion(x - 8, y - 8, x, y, (shapeW + 1) << 3, shapeH, 2, 0, Screen::CR_NO_P_CHECK); @@ -1076,14 +1076,14 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) { delay(s->delay); - if (_mode == DarkmoonSequenceHelper::kIntro && s->pal) + if (_mode == kIntro && s->pal) setPaletteWithoutTextColor(0); break; case 3: case 4: // fade shape in or out or restore background - if (_mode == DarkmoonSequenceHelper::kFinale) + if (_mode == kFinale) break; _screen->setShapeFadeMode(0, true); @@ -1109,10 +1109,10 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) { case 5: // copy region - if (_mode == DarkmoonSequenceHelper::kFinale && s->pal) + if (_mode == kFinale && s->pal) setPaletteWithoutTextColor(palIndex); - _screen->copyRegion(s->x2 << 3, s->y2, s->x1, s->y1, s->w << 3, s->h, (s->obj && _mode == DarkmoonSequenceHelper::kFinale) ? 6 : 2, 0, Screen::CR_NO_P_CHECK); + _screen->copyRegion(s->x2 << 3, s->y2, s->x1, s->y1, s->w << 3, s->h, (s->obj && _mode == kFinale) ? 6 : 2, 0, Screen::CR_NO_P_CHECK); _screen->updateScreen(); delay(s->delay); break; diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp index e4001b24d7..caf4a748da 100644 --- a/engines/kyra/sprites_eob.cpp +++ b/engines/kyra/sprites_eob.cpp @@ -587,7 +587,24 @@ void EobCoreEngine::drawMonsters(int index) { } void EobCoreEngine::drawWallOfForce(int index) { - + int d = _dscDimMap[index]; + assert(d < 3); + int dH = _wallOfForceDsNumH[d]; + int dW = _wallOfForceDsNumW[d]; + int y = _wallOfForceDsY[d]; + int shpId = _wallOfForceShpId[d] + _teleporterPulse; + int h = _wallOfForceShapes[shpId][1]; + int w = _wallOfForceShapes[shpId][2] << 3; + + for (int i = 0; i < dH; i++) { + int x = _wallOfForceDsX[index]; + for (int ii = 0; ii < dW; ii++) { + drawBlockObject(0, 2, _wallOfForceShapes[shpId], x, y, 5); + x += w; + } + y += h; + shpId ^= 1; + } } void EobCoreEngine::drawFlyingObjects(int index) { diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp index 5995f8a5cd..069bf1337d 100644 --- a/engines/kyra/staticres_eob.cpp +++ b/engines/kyra/staticres_eob.cpp @@ -1280,6 +1280,12 @@ void DarkMoonEngine::initStaticResource() { _dranFoolsStrings = _staticres->loadStrings(kEob2DranFoolsStrings, temp); _hornStrings = _staticres->loadStrings(kEob2HornStrings, temp); _hornSounds = _staticres->loadRawData(kEob2HornSounds, temp); + + _wallOfForceDsX = (const int16*)_staticres->loadRawDataBe16(kEob2WallOfForceDsX, temp); + _wallOfForceDsY = _staticres->loadRawData(kEob2WallOfForceDsY, temp); + _wallOfForceDsNumW = _staticres->loadRawData(kEob2WallOfForceNumW, temp); + _wallOfForceDsNumH = _staticres->loadRawData(kEob2WallOfForceNumH, temp); + _wallOfForceShpId = _staticres->loadRawData(kEob2WallOfForceShpId, temp); } void DarkMoonEngine::initSpells() { diff --git a/engines/kyra/timer_eob.cpp b/engines/kyra/timer_eob.cpp index 20a05f9ee6..61fa554193 100644 --- a/engines/kyra/timer_eob.cpp +++ b/engines/kyra/timer_eob.cpp @@ -371,7 +371,7 @@ void EobCoreEngine::timerUpdateTeleporters(int timerNum) { _teleporterPulse ^= 1; for (int i = 0; i < 18; i++) { uint8 w = _visibleBlocks[i]->walls[_sceneDrawVarDown]; - if ((_flags.gameID == GI_EOB1 && w == 52) || (_flags.gameID == GI_EOB2 && (w == 44 || w == 74))) { + if ((w == _teleporterWallId) || (_flags.gameID == GI_EOB2 && w == 74)) { _sceneUpdateRequired = true; return; } |