diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/gui.h | 2 | ||||
-rw-r--r-- | engines/kyra/gui_lok.h | 1 | ||||
-rw-r--r-- | engines/kyra/gui_lol.cpp | 276 | ||||
-rw-r--r-- | engines/kyra/gui_v2.h | 1 | ||||
-rw-r--r-- | engines/kyra/items_lol.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/lol.cpp | 11 | ||||
-rw-r--r-- | engines/kyra/lol.h | 5 | ||||
-rw-r--r-- | engines/kyra/screen_lol.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/screen_lol.h | 1 | ||||
-rw-r--r-- | engines/kyra/script_lol.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/sprites_lol.cpp | 2 |
11 files changed, 259 insertions, 56 deletions
diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h index ba47e7e92c..20266276ce 100644 --- a/engines/kyra/gui.h +++ b/engines/kyra/gui.h @@ -81,6 +81,8 @@ struct Button { int8 mouseWheel; Callback buttonCallback; + + uint16 arg; }; struct MenuItem { diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h index 237a0f0d14..eec57f5546 100644 --- a/engines/kyra/gui_lok.h +++ b/engines/kyra/gui_lok.h @@ -47,6 +47,7 @@ namespace Kyra { button.height = j; \ button.flags2 = k; \ button.mouseWheel = 0; \ + button.arg = 0; \ } while (0) #define GUI_V1_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \ diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index e8a9526793..9a1b7673ee 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -69,7 +69,7 @@ void LoLEngine::gui_drawPlayField() { } void LoLEngine::gui_drawScene(int pageNum) { - if (!(_updateFlags & 1) && _weaponsDisabled == false && _unkDrawLevelBool && _vcnBlocks) + if (!(_updateFlags & 1) && _weaponsDisabled == false && _partyAwake && _vcnBlocks) drawScene(pageNum); } @@ -407,17 +407,11 @@ void LoLEngine::gui_drawCharPortraitWithStats(int charNum) { if (_characters[charNum].damageSuffered) _screen->fprintString("%d", 17, 28, 254, 0, 1, _characters[charNum].damageSuffered); - if (!cp) - _screen->hideMouse(); - uint8 col = (charNum != _selectedCharacter || countActiveCharacters() == 1) ? 1 : 212; _screen->drawBox(0, 0, 65, 33, col); _screen->copyRegion(0, 0, _activeCharsXpos[charNum], 143, 66, 34, _screen->_curPage, cp, Screen::CR_NO_P_CHECK); - if (!cp) - _screen->showMouse(); - _screen->setCurPage(cp); _screen->setFont(tmpFid); } @@ -928,12 +922,8 @@ void LoLEngine::gui_initButton(int index, int x, int y, int val) { _activeButtons = b; } - b->data0Val2 = 0xfe; - b->data0Val3 = 0x01; - b->data1Val2 = 0xfe; - b->data1Val3 = 0x01; - b->data2Val2 = 0xfe; - b->data2Val3 = 0x01; + b->data0Val2 = b->data1Val2 = b->data2Val2 = 0xfe; + b->data0Val3 = b->data1Val3 = b->data2Val3 = 0x01; b->index = cnt; b->keyCode = _buttonData[index].keyCode; @@ -941,12 +931,12 @@ void LoLEngine::gui_initButton(int index, int x, int y, int val) { b->dimTableIndex = _buttonData[index].screenDim; b->flags = _buttonData[index].buttonflags; - b->data2Val2 = (val != -1) ? (uint8)(val & 0xff) : _buttonData[index].index; + b->arg = (val != -1) ? (uint8)(val & 0xff) : _buttonData[index].index; if (index == 15) { // magic sub menu b->x = _activeCharsXpos[_subMenuIndex] + 44; - b->data2Val2 = _subMenuIndex; + b->arg = _subMenuIndex; b->y = _buttonData[index].y; b->width = _buttonData[index].w - 1; b->height = _buttonData[index].h - 1; @@ -967,7 +957,7 @@ void LoLEngine::gui_initButton(int index, int x, int y, int val) { } int LoLEngine::clickedUpArrow(Button *button) { - if (button->data2Val2 && !_floatingCursorsEnabled) + if (button->arg && !_floatingCursorsEnabled) return 0; moveParty(_currentDirection, ((button->flags2 & 0x1080) == 0x1080) ? 1 : 0, 0, 80); @@ -976,7 +966,7 @@ int LoLEngine::clickedUpArrow(Button *button) { } int LoLEngine::clickedDownArrow(Button *button) { - if (button->data2Val2 && !_floatingCursorsEnabled) + if (button->arg && !_floatingCursorsEnabled) return 0; moveParty(_currentDirection ^ 2, 0, 1, 83); @@ -985,7 +975,7 @@ int LoLEngine::clickedDownArrow(Button *button) { } int LoLEngine::clickedLeftArrow(Button *button) { - if (button->data2Val2 && !_floatingCursorsEnabled) + if (button->arg && !_floatingCursorsEnabled) return 0; moveParty((_currentDirection - 1) & 3, ((button->flags2 & 0x1080) == 0x1080) ? 1 : 0, 2, 82); @@ -994,7 +984,7 @@ int LoLEngine::clickedLeftArrow(Button *button) { } int LoLEngine::clickedRightArrow(Button *button) { - if (button->data2Val2 && !_floatingCursorsEnabled) + if (button->arg && !_floatingCursorsEnabled) return 0; moveParty((_currentDirection + 1) & 3, ((button->flags2 & 0x1080) == 0x1080) ? 1 : 0, 3, 84); @@ -1003,7 +993,7 @@ int LoLEngine::clickedRightArrow(Button *button) { } int LoLEngine::clickedTurnLeftArrow(Button *button) { - if (button->data2Val2 && !_floatingCursorsEnabled) + if (button->arg && !_floatingCursorsEnabled) return 0; gui_toggleButtonDisplayMode(79, 1); @@ -1025,7 +1015,7 @@ int LoLEngine::clickedTurnLeftArrow(Button *button) { } int LoLEngine::clickedTurnRightArrow(Button *button) { - if (button->data2Val2 && !_floatingCursorsEnabled) + if (button->arg && !_floatingCursorsEnabled) return 0; gui_toggleButtonDisplayMode(81, 1); @@ -1048,7 +1038,7 @@ int LoLEngine::clickedTurnRightArrow(Button *button) { } int LoLEngine::clickedAttackButton(Button *button) { - int c = button->data2Val2; + int c = button->arg; if (_characters[c].flags & 0x314C) return 1; @@ -1092,7 +1082,7 @@ int LoLEngine::clickedAttackButton(Button *button) { } int LoLEngine::clickedMagicButton(Button *button) { - int c = button->data2Val2; + int c = button->arg; if (_characters[c].flags & 0x314C) return 1; @@ -1111,7 +1101,7 @@ int LoLEngine::clickedMagicButton(Button *button) { int LoLEngine::clickedMagicSubmenu(Button *button) { int spellLevel = (_mouseY - 144) >> 3; - int c = button->data2Val2; + int c = button->arg; gui_enableDefaultPlayfieldButtons(); @@ -1163,7 +1153,7 @@ int LoLEngine::clickedPortraitLeft(Button *button) { gui_disableControls(1); } - _selectedCharacter = button->data2Val2; + _selectedCharacter = button->arg; _weaponsDisabled = true; gui_displayCharInventory(_selectedCharacter); gui_enableCharInventoryButtons(_selectedCharacter); @@ -1172,9 +1162,9 @@ int LoLEngine::clickedPortraitLeft(Button *button) { } int LoLEngine::clickedLiveMagicBarsLeft(Button *button) { - gui_highlightPortraitFrame(button->data2Val2); - _txt->printMessage(0, getLangString(0x4047), _characters[button->data2Val2].name, _characters[button->data2Val2].hitPointsCur, - _characters[button->data2Val2].hitPointsMax, _characters[button->data2Val2].magicPointsCur, _characters[button->data2Val2].magicPointsMax); + gui_highlightPortraitFrame(button->arg); + _txt->printMessage(0, getLangString(0x4047), _characters[button->arg].name, _characters[button->arg].hitPointsCur, + _characters[button->arg].hitPointsMax, _characters[button->arg].magicPointsCur, _characters[button->arg].magicPointsMax); return 1; } @@ -1183,7 +1173,7 @@ int LoLEngine::clickedPortraitEtcRight(Button *button) { return 1; int flg = _itemProperties[_itemsInPlay[_itemInHand].itemPropertyIndex].flags; - int c = button->data2Val2; + int c = button->arg; if (flg & 1) { if (!(_characters[c].flags & 8) || (flg & 0x20)) { @@ -1201,7 +1191,7 @@ int LoLEngine::clickedPortraitEtcRight(Button *button) { int LoLEngine::clickedCharInventorySlot(Button *button) { if (_itemInHand) { - uint16 sl = 1 << button->data2Val2; + uint16 sl = 1 << button->arg; int type = _itemProperties[_itemsInPlay[_itemInHand].itemPropertyIndex].type; if (!(sl & type)) { bool f = false; @@ -1220,17 +1210,17 @@ int LoLEngine::clickedCharInventorySlot(Button *button) { return 1; } } else { - if (!_characters[_selectedCharacter].items[button->data2Val2]) { - _txt->printMessage(0, getLangString(_inventorySlotDesc[button->data2Val2] + 8)); + if (!_characters[_selectedCharacter].items[button->arg]) { + _txt->printMessage(0, getLangString(_inventorySlotDesc[button->arg] + 8)); return 1; } } int ih = _itemInHand; - setHandItem(_characters[_selectedCharacter].items[button->data2Val2]); - _characters[_selectedCharacter].items[button->data2Val2] = ih; - gui_drawCharInventoryItem(button->data2Val2); + setHandItem(_characters[_selectedCharacter].items[button->arg]); + _characters[_selectedCharacter].items[button->arg] = ih; + gui_drawCharInventoryItem(button->arg); recalcCharacterStats(_selectedCharacter); @@ -1239,7 +1229,7 @@ int LoLEngine::clickedCharInventorySlot(Button *button) { if (ih) runItemScript(_selectedCharacter, ih, 0x80, 0, 0); - gui_drawCharInventoryItem(button->data2Val2); + gui_drawCharInventoryItem(button->arg); gui_drawCharPortraitWithStats(_selectedCharacter); gui_changeCharacterStats(_selectedCharacter); @@ -1284,7 +1274,7 @@ int LoLEngine::clickedSceneDropItem(Button *button) { return 0; uint16 block = _currentBlock; - if (button->data2Val2 > 1) { + if (button->arg > 1) { block = calcNewBlockPosition(_currentBlock, _currentDirection); int f = _wllWallFlags[_levelBlockProperties[block].walls[_currentDirection ^ 2]]; if (!(f & 0x80) || (f & 2)) @@ -1293,7 +1283,7 @@ int LoLEngine::clickedSceneDropItem(Button *button) { uint16 x = 0; uint16 y = 0; - int i = dirIndex[(_currentDirection << 2) + button->data2Val2]; + int i = dirIndex[(_currentDirection << 2) + button->arg]; calcCoordinates(x, y, block, offsX[i], offsY[i]); setItemPosition(_itemInHand, x, y, 0, 1); @@ -1341,7 +1331,7 @@ int LoLEngine::clickedScenePickupItem(Button *button) { } int LoLEngine::clickedInventorySlot(Button *button) { - int slot = _inventoryCurItem + button->data2Val2; + int slot = _inventoryCurItem + button->arg; if (slot > 47) slot -= 48; @@ -1358,7 +1348,7 @@ int LoLEngine::clickedInventorySlot(Button *button) { _screen->hideMouse(); _inventory[slot] = 0; - gui_drawInventoryItem(button->data2Val2); + gui_drawInventoryItem(button->arg); _screen->copyRegion(button->x, button->y - 3, button->x, button->y - 3, 25, 27, 0, 2); KyraEngine_v1::snd_playSoundEffect(99); @@ -1386,13 +1376,13 @@ int LoLEngine::clickedInventorySlot(Button *button) { _inventory[slot] = hItem; } - gui_drawInventoryItem(button->data2Val2); + gui_drawInventoryItem(button->arg); return 1; } int LoLEngine::clickedInventoryScroll(Button *button) { - int8 inc = (int8)button->data2Val2; + int8 inc = (int8)button->arg; int shp = (inc == 1) ? 75 : 74; if (button->flags2 & 0x1000) inc *= 9; @@ -1460,11 +1450,11 @@ int LoLEngine::clickedSequenceWindow(Button *button) { } int LoLEngine::clickedScroll(Button *button) { - if (_selectedSpell == button->data2Val2) + if (_selectedSpell == button->arg) return 1; gui_highlightSelectedSpell(false); - _selectedSpell = button->data2Val2; + _selectedSpell = button->arg; gui_highlightSelectedSpell(true); gui_drawAllCharPortraitsWithStats(); @@ -1472,7 +1462,7 @@ int LoLEngine::clickedScroll(Button *button) { } int LoLEngine::clickedSpellTargetCharacter(Button *button) { - int t = button->data2Val2; + int t = button->arg; _txt->printMessage(0, "%s.\r", _characters[t].name); if ((_spellProperties[_activeSpell.spell].flags & 0xff) == 1) { @@ -1534,7 +1524,199 @@ int LoLEngine::clickedOptions(Button *button) { int LoLEngine::clickedRestParty(Button *button) { gui_toggleButtonDisplayMode(77, 1); - gui_toggleButtonDisplayMode(77, 0); + Button b; + memset(&b, 0, sizeof(Button)); + b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xfe; + b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01; + + if (_weaponsDisabled) + clickedExitCharInventory(&b); + + int tHp = -1; + int tMp = -1; + int tHa = -1; + int needPoisoningFlags = 0; + int needHealingFlags = 0; + int needMagicGainFlags = 0; + + for (int i = 0; i < 4; i++) { + LoLCharacter *c = &_characters[i]; + if (!(c->flags & 1) || (c->flags & 8)) + continue; + + if (c->hitPointsMax > tHp) + tHp = c->hitPointsMax; + + if (c->magicPointsMax > tMp) + tMp = c->magicPointsMax; + + if (c->flags & 0x80) { + needPoisoningFlags |= (1 << i); + if (c->hitPointsCur > tHa) + tHa = c->hitPointsCur; + } else { + if (c->hitPointsCur < c->hitPointsMax) + needHealingFlags |= (1 << i); + } + + if (c->magicPointsCur < c->magicPointsMax) + needMagicGainFlags |= (1 << i); + + c->flags |= 0x1000; + } + + if (needHealingFlags || needMagicGainFlags) { + _screen->fillRect(112, 0, 288, 120, 1); + gui_drawAllCharPortraitsWithStats(); + + _txt->printMessage(0x8000, getLangString(0x4057)); + gui_toggleButtonDisplayMode(77, 0); + + int h = 600 / tHp; + if (h > 30) + h = 30; + + int m = 600 / tMp; + if (m > 30) + m = 30; + + int a = 600 / tHa; + if (a > 15) + a = 15; + + uint32 delay1 = _system->getMillis() + h * _tickLength; + uint32 delay2 = _system->getMillis() + m * _tickLength; + uint32 delay3 = _system->getMillis() + a * _tickLength; + + _partyAwake = false; + _updateFlags |= 1; + + for (int i = 0, im = _smoothScrollModeNormal ? 32 : 16; i < im; i++) { + timerProcessMonsters(0); + timerProcessMonsters(1); + timerProcessDoors(0); + timerProcessFlyingObjects(0); + + if (_partyAwake) + break; + } + + resetBlockProperties(); + + do { + for (int i = 0, im = _smoothScrollModeNormal ? 8 : 4; i < im; i++) { + timerProcessMonsters(0); + timerProcessMonsters(1); + timerProcessDoors(0); + timerProcessFlyingObjects(0); + + if (_partyAwake) + break; + } + + int f = checkInput(0); + removeInputTop(); + + if (f & !(f & 0x800)) { + gui_triggerEvent(f); + } else { + gui_notifyButtonListChanged(); + + if (!_partyAwake) { + if (_system->getMillis() > delay3) { + for (int i = 0; i < 4; i++) { + if (!(needPoisoningFlags & (1 << i))) + continue; + inflictDamage(i, 1, 0x8000, 1, 0x80); + if (_characters[i].flags & 8) + needPoisoningFlags &= ~(1 << i); + } + delay3 = _system->getMillis() + a * _tickLength; + } + + if (_system->getMillis() > delay1) { + for (int i = 0; i < 4; i++) { + if (!(needHealingFlags & (1 << i))) + continue; + increaseCharacterHitpoints(i, 1, false); + gui_drawCharPortraitWithStats(i); + if (_characters[i].hitPointsCur == _characters[i].hitPointsMax) + needHealingFlags &= ~(1 << i); + } + delay1 = _system->getMillis() + h * _tickLength; + } + + if (_system->getMillis() > delay2) { + for (int i = 0; i < 4; i++) { + if (!(needMagicGainFlags & (1 << i))) + continue; + _characters[i].magicPointsCur++; + gui_drawCharPortraitWithStats(i); + if (_characters[i].magicPointsCur == _characters[i].magicPointsMax) + needMagicGainFlags &= ~(1 << i); + } + delay2 = _system->getMillis() + m * _tickLength; + } + _screen->updateScreen(); + } + } + } while (!_partyAwake && (needHealingFlags || needMagicGainFlags)); + + for (int i = 0; i < 4; i++) { + int frm = 0; + int upd = 0; + bool setframe = true; + + if (_characters[i].flags & 0x1000) { + _characters[i].flags &= 0xefff; + + if (_partyAwake) { + if (_characters[i].damageSuffered) { + frm = 5; + snd_playSoundEffect(_characters[i].screamSfx, -1); + } else { + frm = 4; + } + upd = 6; + } + + } else { + if (_characters[i].damageSuffered) + setframe = false; + else + frm = 4; + } + + if (setframe) + setTemporaryFaceFrame(i, frm, upd, 1); + } + + _updateFlags &= 0xfffe; + _partyAwake = true; + updateDrawPage2(); + gui_drawScene(0); + _txt->printMessage(0x8000, getLangString(0x4059)); + _screen->fadeToPalette1(40); + + } else { + for (int i = 0; i < 4; i++) + _characters[i].flags &= 0xefff; + + if (needPoisoningFlags) { + setTemporaryFaceFrameForAllCharacters(0, 0, 0); + for (int i = 0; i < 4; i++) { + if (needPoisoningFlags & (1 << i)) + setTemporaryFaceFrame(i, 3, 8, 0); + } + _txt->printMessage(0x8000, getLangString(0x405a)); + gui_drawAllCharPortraitsWithStats(); + + } else { + setTemporaryFaceFrameForAllCharacters(2, 4, 1); + _txt->printMessage(0x8000, getLangString(0x4058)); + } + gui_toggleButtonDisplayMode(77, 0); + } return 1; } @@ -1636,7 +1818,7 @@ void GUI_LoL::processButton(Button *button) { val1 = button->data2Val1; dataPtr = button->data2ShapePtr; callback = button->data2Callback; - val2 = button->data2Val2; + val2 = button->arg; val3 = button->data2Val3; } else { val1 = button->data0Val1; diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h index f4ceda7369..e43f79ea78 100644 --- a/engines/kyra/gui_v2.h +++ b/engines/kyra/gui_v2.h @@ -54,6 +54,7 @@ namespace Kyra { button.data2Val3 = s; \ button.flags2 = t; \ button.mouseWheel = 0; \ + button.arg = 0; \ } while (0) #define GUI_V2_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \ diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index 765747f687..2e625b5a93 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -470,7 +470,7 @@ void LoLEngine::objectFlightProcessHits(FlyingObject *t, int x, int y, int objec } } else if (objectOnNextBlock == 4) { - _unkDrawLevelBool = true; + _partyAwake = true; if (_itemProperties[_itemsInPlay[t->item].itemPropertyIndex].flags & 0x4000) { for (int i = 0; i < 4; i++) { if (_characters[i].flags & 1) diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index c45d23b2d3..5eeb8e371e 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -138,7 +138,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy _monsters = 0; _monsterProperties = 0; _lvlBlockIndex = _lvlShapeIndex = 0; - _unkDrawLevelBool = true; + _partyAwake = true; _vcnBlocks = 0; _vcnShift = 0; _vcnExpTable = 0; @@ -884,7 +884,7 @@ void LoLEngine::startupNew() { _availableSpells[0] = 0; setupScreenDims(); - memset(_unkWordArraySize8, 0x100, 8); + memset(_globalScriptVars2, 0x100, 8); static int selectIds[] = { -9, -1, -8, -5 }; addCharacter(selectIds[_charSelection]); @@ -1066,6 +1066,13 @@ void LoLEngine::setTemporaryFaceFrame(int charNum, int frame, int updateDelay, i gui_drawCharPortraitWithStats(charNum); } +void LoLEngine::setTemporaryFaceFrameForAllCharacters(int frame, int updateDelay, int redraw) { + for (int i = 0; i < 4; i++) + setTemporaryFaceFrame(i, frame, updateDelay, 0); + if (redraw) + gui_drawAllCharPortraitsWithStats(); +} + void LoLEngine::setCharacterUpdateEvent(int charNum, int updateType, int updateDelay, int overwrite) { LoLCharacter *l = &_characters[charNum]; for (int i = 0; i < 5; i++) { diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 495641fa04..ba0a5b8d55 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -785,6 +785,7 @@ private: // characters bool addCharacter(int id); void setTemporaryFaceFrame(int charNum, int frame, int updateDelay, int redraw); + void setTemporaryFaceFrameForAllCharacters(int frame, int updateDelay, int redraw); void setCharacterUpdateEvent(int charNum, int updateType, int updateDelay, int overwrite); int countActiveCharacters(); void loadCharFaceShapes(int charNum, int id); @@ -947,7 +948,7 @@ private: int _sceneDefaultUpdate; int _lvlBlockIndex; int _lvlShapeIndex; - bool _unkDrawLevelBool; + bool _partyAwake; uint8 *_vcnBlocks; uint8 *_vcnShift; uint8 *_vcnExpTable; @@ -1196,7 +1197,7 @@ private: uint8 _compassBroken; uint8 _drainMagic; - uint16 _unkWordArraySize8[8]; + uint16 _globalScriptVars2[8]; uint8 *_pageBuffer1; uint8 *_pageBuffer2; diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 4559edcc09..81bad0522d 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -658,6 +658,12 @@ void Screen_LoL::fadeToBlack(int delay, const UpdateFunctor *upFunc) { _fadeFlag = 2; } +void Screen_LoL::fadeToPalette1(int delay) { + loadSpecialColors(_palettes[0]); + fadePalette(_palettes[0], delay); + _fadeFlag = 0; +} + void Screen_LoL::loadSpecialColors(uint8 *destPalette) { memcpy(destPalette + 0x240, _screenPalette + 0x240, 12); } diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 1c2b6a3b93..e839f31752 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -64,6 +64,7 @@ public: // palette stuff void fadeToBlack(int delay=0x54, const UpdateFunctor *upFunc = 0); + void fadeToPalette1(int delay); void loadSpecialColors(uint8 *destPalette); void copyColor(int dstColorIndex, int srcColorIndex); bool fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedTime, uint32 targetTime); diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 13479799c7..0a42fffc76 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -139,7 +139,9 @@ int LoLEngine::olol_moveParty(EMCState *script) { Button b; memset(&b, 0, sizeof(Button)); - + b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xfe; + b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01; + switch (mode) { case 0: clickedUpArrow(&b); @@ -642,7 +644,7 @@ int LoLEngine::olol_getGlobalVar(EMCState *script) { case 5: return _credits; case 6: - return _unkWordArraySize8[stackPos(1)]; + return _globalScriptVars2[stackPos(1)]; case 8: return _updateFlags; case 9: @@ -695,7 +697,7 @@ int LoLEngine::olol_setGlobalVar(EMCState *script) { break; case 6: - _unkWordArraySize8[a] = b; + _globalScriptVars2[a] = b; break; case 7: diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index acef7cd426..f9890ea9b1 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -1099,7 +1099,7 @@ void LoLEngine::updateMonster(MonsterInPlay *monster) { // second recovery phase after delivering an attack // monsters will rearrange positions in this phase so as to allow a maximum // number of monsters possible attacking at the same time - _unkDrawLevelBool = true; + _partyAwake = true; monster->fightCurTick--; if ((monster->fightCurTick <= 0) || (checkDrawObjectSpace(_partyPosX, _partyPosY, monster->x, monster->y) > 256) || (monster->flags & 8)) setMonsterMode(monster, 7); |