diff options
-rw-r--r-- | engines/xeen/combat.cpp | 10 | ||||
-rw-r--r-- | engines/xeen/combat.h | 2 | ||||
-rw-r--r-- | engines/xeen/interface.cpp | 28 | ||||
-rw-r--r-- | engines/xeen/interface.h | 2 | ||||
-rw-r--r-- | engines/xeen/spells.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/sprites.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/town.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/xeen.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/xeen.h | 2 |
9 files changed, 32 insertions, 28 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 471fefd751..254c33fa0c 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -123,6 +123,8 @@ Combat::Combat(XeenEngine *vm): _vm(vm), _missVoc("miss.voc"), _pow1Voc("pow1.vo _attackWeapon = nullptr; _attackWeaponId = 0; _hitChanceBonus = 0; + _dangerPresent = false; + _moveMonsters = false; } void Combat::clear() { @@ -437,7 +439,7 @@ void Combat::moveMonsters() { Map &map = *_vm->_map; Party &party = *_vm->_party; - if (!_vm->_moveMonsters) + if (!_moveMonsters) return; intf._tillMove = 0; @@ -448,7 +450,7 @@ void Combat::moveMonsters() { Common::fill(&_monsterMoved[0], &_monsterMoved[MAX_NUM_MONSTERS], false); Common::fill(&_rangeAttacking[0], &_rangeAttacking[MAX_NUM_MONSTERS], false); Common::fill(&_gmonHit[0], &_gmonHit[36], -1); - _vm->_dangerSenseAllowed = false; + _dangerPresent = false; for (uint idx = 0; idx < map._mobData._monsters.size(); ++idx) { MazeMonster &monster = map._mobData._monsters[idx]; @@ -469,7 +471,7 @@ void Combat::moveMonsters() { MonsterStruct &monsterData = map._monsterData[monster._spriteId]; if (pt == monster._position) { - _vm->_dangerSenseAllowed = true; + _dangerPresent = true; if ((monster._isAttacking || _vm->_mode == MODE_SLEEPING) && !_monsterMoved[idx]) { if (party._mazePosition.x == pt.x || party._mazePosition.y == pt.y) { @@ -704,7 +706,7 @@ void Combat::moveMonster(int monsterId, const Common::Point &pt) { Map &map = *_vm->_map; MazeMonster &monster = map._mobData._monsters[monsterId]; - if (_monsterMap[pt.y][pt.x] < 3 && !monster._damageType && _vm->_moveMonsters) { + if (_monsterMap[pt.y][pt.x] < 3 && !monster._damageType && _moveMonsters) { ++_monsterMap[pt.y][pt.x]; --_monsterMap[monster._position.y][monster._position.x]; monster._position = pt; diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h index 466152a70e..f78e928aa4 100644 --- a/engines/xeen/combat.h +++ b/engines/xeen/combat.h @@ -118,6 +118,8 @@ public: int _attackWeaponId; File _missVoc, _pow1Voc; int _hitChanceBonus; + bool _dangerPresent; + bool _moveMonsters; public: Combat(XeenEngine *vm); diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 1b3ee4f32c..434320762d 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -143,7 +143,7 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), InterfaceMap(vm), _flipUIFrame = 0; _face1UIFrame = 0; _face2UIFrame = 0; - _batUIFrame = 0; + _levitateUIFrame = 0; _spotDoorsUIFrame = 0; _dangerSenseUIFrame = 0; _face1State = _face2State = 0; @@ -327,11 +327,11 @@ void Interface::perform() { switch (_buttonValue) { case Common::KEYCODE_TAB: // Stop mosters doing any movement - _vm->_moveMonsters = false; + combat._moveMonsters = false; if (ControlPanel::show(_vm) == -1) { _vm->_quitMode = 2; } else { - _vm->_moveMonsters = 1; + combat._moveMonsters = 1; } break; @@ -488,9 +488,9 @@ void Interface::perform() { case Common::KEYCODE_EQUALS: case Common::KEYCODE_KP_EQUALS: // Toggle minimap - _vm->_moveMonsters = false; + combat._moveMonsters = false; party._automapOn = !party._automapOn; - _vm->_moveMonsters = true; + combat._moveMonsters = true; break; case Common::KEYCODE_b: @@ -547,9 +547,9 @@ void Interface::perform() { case Common::KEYCODE_i: // Show Info dialog - _vm->_moveMonsters = false; + combat._moveMonsters = false; InfoDialog::show(_vm); - _vm->_moveMonsters = true; + combat._moveMonsters = true; break; case Common::KEYCODE_m: @@ -1237,7 +1237,7 @@ void Interface::draw3d(bool updateFlag) { if (_flipUIFrame == 0) _flipWater = !_flipWater; if (_tillMove && (_vm->_mode == MODE_1 || _vm->_mode == MODE_COMBAT) && - !combat._monstersAttacking && _vm->_moveMonsters) { + !combat._monstersAttacking && combat._moveMonsters) { if (--_tillMove == 0) combat.moveMonsters(); } @@ -1270,7 +1270,7 @@ void Interface::draw3d(bool updateFlag) { if (combat._attackMonsters[0] != -1 || combat._attackMonsters[1] != -1 || combat._attackMonsters[2] != -1) { if ((_vm->_mode == MODE_1 || _vm->_mode == MODE_SLEEPING) && - !combat._monstersAttacking && !_charsShooting && _vm->_moveMonsters) { + !combat._monstersAttacking && !_charsShooting && combat._moveMonsters) { doCombat(); if (scripts._eventSkipped) scripts.checkEvents(); @@ -1743,16 +1743,18 @@ void Interface::drawMiniMap() { * Draw the display borders */ void Interface::assembleBorder() { + Combat &combat = *_vm->_combat; Resources &res = *_vm->_resources; Screen &screen = *_vm->_screen; // Draw the outer frame res._globalSprites.draw(screen._windows[0], 0, Common::Point(8, 8)); - // Draw the animating bat character used to show when levitate is active - _borderSprites.draw(screen._windows[0], _vm->_party->_levitateActive ? _batUIFrame + 16 : 16, + // Draw the animating bat character on the left screen edge to indicate + // that the party is being levitated + _borderSprites.draw(screen._windows[0], _vm->_party->_levitateActive ? _levitateUIFrame + 16 : 16, Common::Point(0, 82)); - _batUIFrame = (_batUIFrame + 1) % 12; + _levitateUIFrame = (_levitateUIFrame + 1) % 12; // Draw UI element to indicate whether can spot hidden doors _borderSprites.draw(screen, @@ -1762,7 +1764,7 @@ void Interface::assembleBorder() { // Draw UI element to indicate whether can sense danger _borderSprites.draw(screen, - (_vm->_dangerSenseAllowed && _vm->_party->checkSkill(DANGER_SENSE)) ? _spotDoorsUIFrame + 40 : 40, + (combat._dangerPresent && _vm->_party->checkSkill(DANGER_SENSE)) ? _spotDoorsUIFrame + 40 : 40, Common::Point(107, 9)); _dangerSenseUIFrame = (_dangerSenseUIFrame + 1) % 12; diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 80b798047c..66a40c23cf 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -115,7 +115,7 @@ public: int _face1UIFrame, _face2UIFrame; int _spotDoorsUIFrame; int _dangerSenseUIFrame; - int _batUIFrame; + int _levitateUIFrame; bool _upDoorText; Common::String _screenText; byte _tillMove; diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp index d2a2af31c0..25aae11af2 100644 --- a/engines/xeen/spells.cpp +++ b/engines/xeen/spells.cpp @@ -151,7 +151,7 @@ int Spells::castSpell(Character *c, int spellId) { } } - _vm->_moveMonsters = 1; + combat._moveMonsters = 1; intf._tillMove = oldTillMove; return result; } diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index b596432992..597d4dff8e 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -134,7 +134,9 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi setupScaling(newScale, xOffset + width, yOffset + height); Common::Point destPos = pt; - destPos.x += (xOffset + width - _scaledWidth) / 2; + if (!(flags & SPRFLAG_2000)) { + destPos.x += (xOffset + width - _scaledWidth) / 2; + } bool flipped = (flags & SPRFLAG_HORIZ_FLIPPED) != 0; int xInc = flipped ? -1 : 1; diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp index 3a8b6d8231..0934aef34f 100644 --- a/engines/xeen/town.cpp +++ b/engines/xeen/town.cpp @@ -217,7 +217,7 @@ int Town::townAction(int actionId) { intf._face1UIFrame = intf._face2UIFrame = 0; intf._dangerSenseUIFrame = 0; intf._spotDoorsUIFrame = 0; - intf._batUIFrame = 0; + intf._levitateUIFrame = 0; _townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos); if (actionId == 0 && isDarkCc) { @@ -1148,7 +1148,7 @@ void Town::drawTownAnim(bool flag) { intf._face2UIFrame = 0; intf._dangerSenseUIFrame = 0; intf._spotDoorsUIFrame = 0; - intf._batUIFrame = 0; + intf._levitateUIFrame = 0; intf.assembleBorder(); } diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index a3240bf8b5..1410d65627 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -52,9 +52,7 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc) _town = nullptr; _eventData = nullptr; _quitMode = 0; - _dangerSenseAllowed = false; _noDirectionSense = false; - _moveMonsters = false; _mode = MODE_0; _startupWindowActive = false; } @@ -315,13 +313,13 @@ void XeenEngine::play() { _screen->_windows[0].update(); _events->setCursor(0); - _moveMonsters = true; + _combat->_moveMonsters = true; if (_mode == MODE_0) { _mode = MODE_1; _screen->fadeIn(4); } - _moveMonsters = true; + _combat->_moveMonsters = true; gameLoop(); } diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h index 76cb1c1159..2d995a1dd3 100644 --- a/engines/xeen/xeen.h +++ b/engines/xeen/xeen.h @@ -153,9 +153,7 @@ public: GameEvent _gameEvent; Common::SeekableReadStream *_eventData; int _quitMode; - bool _dangerSenseAllowed; bool _noDirectionSense; - bool _moveMonsters; bool _startupWindowActive; public: XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc); |