diff options
author | Le Philousophe | 2019-04-06 12:06:37 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-06-01 22:43:48 +0200 |
commit | c427cd9dcab111dd7f11a5ae96d0e20fd94ddb13 (patch) | |
tree | e8a2c0ea91f7e613e49a0883e1055ae5c8fd5eca /engines/cryomni3d/versailles/engine.cpp | |
parent | 9496c796bccc0c71b08b5d48c38a5ac9090c6977 (diff) | |
download | scummvm-rg350-c427cd9dcab111dd7f11a5ae96d0e20fd94ddb13.tar.gz scummvm-rg350-c427cd9dcab111dd7f11a5ae96d0e20fd94ddb13.tar.bz2 scummvm-rg350-c427cd9dcab111dd7f11a5ae96d0e20fd94ddb13.zip |
CRYOMNI3D: Implement level 3
Diffstat (limited to 'engines/cryomni3d/versailles/engine.cpp')
-rw-r--r-- | engines/cryomni3d/versailles/engine.cpp | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp index 3baaf81458..a227a2676d 100644 --- a/engines/cryomni3d/versailles/engine.cpp +++ b/engines/cryomni3d/versailles/engine.cpp @@ -608,7 +608,7 @@ void CryOmni3DEngine_Versailles::changeLevel(int level) { } // TODO: countdown _inventory.clear(); - } else if (_currentLevel <= 2) { + } else if (_currentLevel <= 3) { // TODO: remove this when we implemented all levels } else { error("New level %d is not implemented (yet)", level); @@ -1190,9 +1190,7 @@ int CryOmni3DEngine_Versailles::handleWarp() { bool CryOmni3DEngine_Versailles::handleWarpMouse(unsigned int *actionId, unsigned int movingCursor) { - PlaceStateActionKey mask = PlaceStateActionKey(_currentPlaceId, _placeStates[_currentPlaceId].state, - *actionId); - *actionId = _actionMasks.getVal(mask, *actionId); + fixActionId(actionId); if (getCurrentMouseButton() == 2 || getNextKey().keycode == Common::KEYCODE_SPACE) { @@ -1240,6 +1238,44 @@ bool CryOmni3DEngine_Versailles::handleWarpMouse(unsigned int *actionId, return false; } +void CryOmni3DEngine_Versailles::fixActionId(unsigned int *actionId) const { + PlaceStateActionKey mask = PlaceStateActionKey(_currentPlaceId, _placeStates[_currentPlaceId].state, + *actionId); + Common::HashMap<PlaceStateActionKey, unsigned int>::const_iterator it = _actionMasks.find(mask); + if (it != _actionMasks.end()) { + *actionId = it->_value; + return; + } + + // Special case for level 3 taking dialogs variables into account + if (_currentLevel == 3) { + if (_dialogsMan["{LE JOUEUR-A-TENTE-OUVRIR-PETITE-PORTE}"] == 'N') { + if (*actionId == 13060) { + *actionId = 23060; + } else if (*actionId == 13100) { + if (currentGameTime() != 4) { + *actionId = 23100; + } + } else if (*actionId == 13130) { + *actionId = 23130; + } else if (*actionId == 13150) { + *actionId = 23150; + } + } else if (_dialogsMan["{JOUEUR-POSSEDE-CLE}"] == 'Y') { + if (*actionId == 13100) { + if (currentGameTime() != 4) { + *actionId = 23100; + } + } else if (*actionId == 13130) { + *actionId = 23130; + } else if (*actionId == 13150) { + *actionId = 23150; + } + + } + } +} + void CryOmni3DEngine_Versailles::animateWarpTransition(const Transition *transition) { double srcAlpha = transition->srcAlpha; double srcBeta = transition->srcBeta; |