diff options
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/combat.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/combat.h | 2 | ||||
-rw-r--r-- | engines/xeen/dialogs/dialogs_input.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/dialogs/dialogs_message.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/dialogs/dialogs_party.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/dialogs/dialogs_spells.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/interface.cpp | 24 | ||||
-rw-r--r-- | engines/xeen/locations.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/party.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/scripts.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/spells.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/xeen.cpp | 7 | ||||
-rw-r--r-- | engines/xeen/xeen.h | 8 |
13 files changed, 38 insertions, 35 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index adc7643bf7..f3baca77a4 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -638,7 +638,7 @@ void Combat::monstersAttack() { Condition condition = party._activeParty[charNum].worstCondition(); if (condition == DEPRESSED || condition == CONFUSED || condition == NO_CONDITION) { - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; break; } } @@ -890,7 +890,7 @@ void Combat::doMonsterTurn(int monsterId) { if (ableChars.size() == 0) { party._dead = true; - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; return; } @@ -2095,7 +2095,7 @@ void Combat::reset() { clearShooting(); setupCombatParty(); - _combatMode = COMBATMODE_1; + _combatMode = COMBATMODE_INTERACTIVE; _monster2Attack = -1; } diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h index e6ac1e27bb..e1a02c0759 100644 --- a/engines/xeen/combat.h +++ b/engines/xeen/combat.h @@ -58,7 +58,7 @@ enum ShootType { }; enum CombatMode { - COMBATMODE_STARTUP = 0, COMBATMODE_1 = 1, COMBATMODE_2 = 2 + COMBATMODE_STARTUP = 0, COMBATMODE_INTERACTIVE = 1, COMBATMODE_2 = 2 }; enum PowType { diff --git a/engines/xeen/dialogs/dialogs_input.cpp b/engines/xeen/dialogs/dialogs_input.cpp index 764d772edc..d273e57b10 100644 --- a/engines/xeen/dialogs/dialogs_input.cpp +++ b/engines/xeen/dialogs/dialogs_input.cpp @@ -84,7 +84,7 @@ Common::KeyState Input::waitForKey(const Common::String &msg) { intf._tillMove = 0; bool flag = !_vm->_startupWindowActive && !windows[25]._enabled - && _vm->_mode != MODE_FF && _vm->_mode != MODE_17; + && _vm->_mode != MODE_FF && _vm->_mode != MODE_INTERACTIVE7; PendingEvent pe; while (!_vm->shouldExit()) { diff --git a/engines/xeen/dialogs/dialogs_message.cpp b/engines/xeen/dialogs/dialogs_message.cpp index df8afea34c..f571e6e811 100644 --- a/engines/xeen/dialogs/dialogs_message.cpp +++ b/engines/xeen/dialogs/dialogs_message.cpp @@ -51,7 +51,7 @@ void MessageDialog::execute(const Common::String &msg, MessageWaitType waitType) break; case WT_ANIMATED_WAIT: - if (windows[11]._enabled || _vm->_mode == MODE_17) { + if (windows[11]._enabled || _vm->_mode == MODE_INTERACTIVE7) { g_vm->_locations->wait(); break; } diff --git a/engines/xeen/dialogs/dialogs_party.cpp b/engines/xeen/dialogs/dialogs_party.cpp index 306d1f9c2b..6bd54db712 100644 --- a/engines/xeen/dialogs/dialogs_party.cpp +++ b/engines/xeen/dialogs/dialogs_party.cpp @@ -58,7 +58,7 @@ void PartyDialog::execute() { setupBackground(); while (!_vm->shouldExit()) { - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; // Build up a list of available characters in the Roster that are on the // same side of Xeen as the player is currently on diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp index e59fbdef9c..122b22985e 100644 --- a/engines/xeen/dialogs/dialogs_spells.cpp +++ b/engines/xeen/dialogs/dialogs_spells.cpp @@ -137,7 +137,7 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int spells._lastCaster = _buttonValue; intf.highlightChar(_buttonValue); - if (_vm->_mode == MODE_17) { + if (_vm->_mode == MODE_INTERACTIVE7) { windows[10].writeString(Common::String::format(Res.GUILD_OPTIONS, XeenEngine::printMil(party._gold).c_str(), Res.GUILD_TEXT, c->_name.c_str())); } else { diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 82523546dd..e986b9f2c1 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -559,7 +559,7 @@ void Interface::perform() { if (combat._attackMonsters[0] != -1 || combat._attackMonsters[1] != -1 || combat._attackMonsters[2] != -1) { - if ((_vm->_mode == MODE_1 || _vm->_mode == MODE_SLEEPING) + if ((_vm->_mode == MODE_INTERACTIVE || _vm->_mode == MODE_SLEEPING) && !combat._monstersAttacking && !_charsShooting) { doCombat(); } @@ -999,7 +999,7 @@ void Interface::rest() { map.cellFlagLookup(party._mazePosition); if ((map._currentCantRest || (map.mazeData()._mazeFlags & RESTRICTION_REST)) - && _vm->_mode != MODE_12) { + && _vm->_mode != MODE_INTERACTIVE2) { ErrorScroll::show(_vm, Res.TOO_DANGEROUS_TO_REST, WT_NONFREEZED_WAIT); } else { // Check whether any character is in danger of dying @@ -1025,14 +1025,14 @@ void Interface::rest() { Mode oldMode = _vm->_mode; _vm->_mode = MODE_SLEEPING; - if (oldMode == MODE_12) { + if (oldMode == MODE_INTERACTIVE2) { party.changeTime(8 * 60); } else { for (int idx = 0; idx < 10; ++idx) { chargeStep(); draw3d(true); - if (_vm->_mode == MODE_1) { + if (_vm->_mode == MODE_INTERACTIVE) { _vm->_mode = oldMode; return; } @@ -1190,7 +1190,7 @@ void Interface::draw3d(bool updateFlag, bool pauseFlag) { _flipUIFrame = (_flipUIFrame + 1) % 4; if (_flipUIFrame == 0) _flipWater = !_flipWater; - if (_tillMove && (_vm->_mode == MODE_1 || _vm->_mode == MODE_COMBAT) && + if (_tillMove && (_vm->_mode == MODE_INTERACTIVE || _vm->_mode == MODE_COMBAT) && !combat._monstersAttacking && combat._moveMonsters) { if (--_tillMove == 0) combat.moveMonsters(); @@ -1226,7 +1226,7 @@ void Interface::draw3d(bool updateFlag, bool pauseFlag) { if (combat._attackMonsters[0] != -1 || combat._attackMonsters[1] != -1 || combat._attackMonsters[2] != -1) { - if ((_vm->_mode == MODE_1 || _vm->_mode == MODE_SLEEPING) && + if ((_vm->_mode == MODE_INTERACTIVE || _vm->_mode == MODE_SLEEPING) && !combat._monstersAttacking && !_charsShooting && combat._moveMonsters) { doCombat(); if (scripts._eventSkipped) @@ -1589,7 +1589,7 @@ void Interface::doCombat() { combat.run(); nextChar(); - if (_vm->_mode == MODE_1) { + if (_vm->_mode == MODE_INTERACTIVE) { party._treasure._gems = 0; party._treasure._gold = 0; party._treasure._hasItems = false; @@ -1680,7 +1680,7 @@ void Interface::doCombat() { break; } - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; if (combat._partyRan && (combat._attackMonsters[0] != -1 || combat._attackMonsters[1] != -1 || combat._attackMonsters[2] != -1)) { party.checkPartyDead(); @@ -1701,7 +1701,7 @@ exit: _vm->_mode = MODE_COMBAT; draw3d(true); party.giveTreasure(); - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; party._stepped = true; unhighlightChar(); @@ -1730,7 +1730,7 @@ exit: } } - combat._combatMode = COMBATMODE_1; + combat._combatMode = COMBATMODE_INTERACTIVE; } void Interface::nextChar() { @@ -1741,7 +1741,7 @@ void Interface::nextChar() { return; if ((combat._attackMonsters[0] == -1 && combat._attackMonsters[1] == -1 && combat._attackMonsters[2] == -1) || combat._combatParty.size() == 0) { - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; return; } @@ -1751,7 +1751,7 @@ void Interface::nextChar() { // Check if party is dead party.checkPartyDead(); if (party._dead) { - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; break; } diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp index da4e1cd112..00e7c0e762 100644 --- a/engines/xeen/locations.cpp +++ b/engines/xeen/locations.cpp @@ -497,7 +497,7 @@ GuildLocation::GuildLocation() : BaseLocation(GUILD) { addButton(Common::Rect(234, 64, 308, 72), Common::KEYCODE_b); addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_s); addButton(Common::Rect(234, 84, 308, 92), 0); - g_vm->_mode = MODE_17; + g_vm->_mode = MODE_INTERACTIVE7; _vocName = _ccNum ? "parrot1.voc" : "guild10.voc"; } @@ -560,7 +560,7 @@ TavernLocation::TavernLocation() : BaseLocation(TAVERN) { addButton(Common::Rect(234, 64, 308, 72), Common::KEYCODE_f); addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_t); addButton(Common::Rect(234, 84, 308, 92), Common::KEYCODE_r); - g_vm->_mode = MODE_17; + g_vm->_mode = MODE_INTERACTIVE7; _vocName = _ccNum ? "hello1.voc" : "hello.voc"; } @@ -713,7 +713,7 @@ Character *TavernLocation::doOptions(Character *c) { party._activeParty[idx]._xeenSide = map._loadCcNum; } - g_vm->_mode = MODE_17; + g_vm->_mode = MODE_INTERACTIVE7; party.addTime(1440); party._mazeId = 0; diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index cbf848935e..5e564523d7 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -524,7 +524,7 @@ void Party::addTime(int numMinutes) { _newDay = true; if (_newDay && _minutes >= 300) { - if (_vm->_mode != MODE_RECORD_EVENTS && _vm->_mode != MODE_17) { + if (_vm->_mode != MODE_SCRIPT_IN_PROGRESS && _vm->_mode != MODE_INTERACTIVE7) { resetTemps(); if (_rested || _vm->_mode == MODE_SLEEPING) { _rested = false; @@ -696,7 +696,7 @@ void Party::giveTreasure() { return; bool monstersPresent = combat.areMonstersPresent(); - if (_vm->_mode != MODE_RECORD_EVENTS && monstersPresent) + if (_vm->_mode != MODE_SCRIPT_IN_PROGRESS && monstersPresent) return; combat.clearShooting(); @@ -781,7 +781,7 @@ void Party::giveTreasure() { events.clearEvents(); if (_vm->_mode != MODE_COMBAT) - _vm->_mode = MODE_1; + _vm->_mode = MODE_INTERACTIVE; w.close(); _gold += _treasure._gold; diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 0e6d721241..d3ff17cffa 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -186,7 +186,7 @@ int Scripts::checkEvents() { if (event._position == _currentPos && event._line == _lineNum && (party._mazeDirection | _currentPos.x | _currentPos.y)) { if (event._direction == party._mazeDirection || event._direction == DIR_ALL) { - _vm->_mode = MODE_RECORD_EVENTS; + _vm->_mode = MODE_SCRIPT_IN_PROGRESS; _scriptExecuted = true; doOpcode(event); break; @@ -1463,7 +1463,7 @@ void Scripts::doCloudsEnding() { g_vm->_party->_cloudsCompleted = true; doEnding("ENDGAME"); - g_vm->_mode = MODE_1; + g_vm->_mode = MODE_INTERACTIVE; g_vm->_saves->saveGame(); g_vm->_gameMode = GMODE_MENU; diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp index 7aa89bbee1..763da71733 100644 --- a/engines/xeen/spells.cpp +++ b/engines/xeen/spells.cpp @@ -1150,7 +1150,7 @@ void Spells::superShelter() { spellFailed(); } else { Mode oldMode = _vm->_mode; - _vm->_mode = MODE_12; + _vm->_mode = MODE_INTERACTIVE2; sound.playFX(30); intf.rest(); _vm->_mode = oldMode; diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index 1e15ec7792..371f437172 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -197,7 +197,8 @@ bool XeenEngine::canLoadGameStateCurrently() { } bool XeenEngine::canSaveGameStateCurrently() { - return _mode != MODE_COMBAT && _mode != MODE_STARTUP && (_map->mazeData()._mazeFlags & RESTRICTION_SAVE) == 0; + return _mode != MODE_COMBAT && _mode != MODE_STARTUP && _mode != MODE_SCRIPT_IN_PROGRESS + && (_map->mazeData()._mazeFlags & RESTRICTION_SAVE) == 0; } void XeenEngine::playGame() { @@ -243,7 +244,7 @@ void XeenEngine::play() { _combat->_moveMonsters = true; if (_mode == MODE_STARTUP) { - _mode = MODE_1; + _mode = MODE_INTERACTIVE; _screen->fadeIn(); } @@ -272,6 +273,8 @@ void XeenEngine::gameLoop() { _map->cellFlagLookup(_party->_mazePosition); if (_map->_currentIsEvent) { _gameMode = (GameMode)_scripts->checkEvents(); + if (isLoadPending()) + continue; if (shouldExit()) return; } diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h index 85cc01d7e7..a092538d09 100644 --- a/engines/xeen/xeen.h +++ b/engines/xeen/xeen.h @@ -78,7 +78,7 @@ enum XeenDebugChannels { enum Mode { MODE_FF = -1, MODE_STARTUP = 0, - MODE_1 = 1, + MODE_INTERACTIVE = 1, MODE_COMBAT = 2, MODE_3 = 3, MODE_4 = 4, @@ -86,11 +86,11 @@ enum Mode { MODE_6 = 6, MODE_7 = 7, MODE_8 = 8, - MODE_RECORD_EVENTS = 9, + MODE_SCRIPT_IN_PROGRESS = 9, MODE_CHARACTER_INFO = 10, - MODE_12 = 12, + MODE_INTERACTIVE2 = 12, MODE_DIALOG_123 = 13, - MODE_17 = 17, + MODE_INTERACTIVE7 = 17, MODE_86 = 86 }; |