diff options
-rw-r--r-- | engines/bladerunner/game_constants.h | 40 | ||||
-rw-r--r-- | engines/bladerunner/mouse.cpp | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 12 | ||||
-rw-r--r-- | engines/bladerunner/script/police_maze.cpp | 471 | ||||
-rw-r--r-- | engines/bladerunner/script/police_maze.h | 50 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ps10.cpp | 453 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/rc01.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/script.h | 2 |
10 files changed, 707 insertions, 335 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index cf5e3fb6e6..79381975f7 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -536,6 +536,7 @@ enum Variables { kVariableChapter = 1, kVariableChinyen = 2, kVariablePoliceMazeScore = 9, + kVariablePoliceMazePS10TargetCounter = 10, kVariableGenericWalkerAModel = 32, kVariableGenericWalkerBModel = 33, kVariableGenericWalkerCModel = 34, @@ -846,6 +847,15 @@ enum Sets { }; enum GameItems { + kItemPoliceMazeTarget1 = 0, + kItemPoliceMazeTarget2 = 1, + kItemPoliceMazeTarget3 = 2, + kItemPoliceMazeTarget4 = 3, + kItemPoliceMazeTarget5 = 4, + kItemPoliceMazeTarget6 = 5, + kItemPoliceMazeTarget7 = 6, + kItemPoliceMazeTarget8 = 7, + kItemPoliceMazeTarget9 = 8, kItemChromeDebris = 66, kItemCandy = 79, kItemChopstickWrapper = 82, @@ -887,6 +897,36 @@ enum ActorCombatStates { kActorCombatStateApproachRangedAttack = 8 }; +enum PoliceMazeTrackInstruction { + kPMTIActivate = -26, + kPMTILeave = -25, + kPMTIShoot = -24, + kPMTIEnemyReset = -23, + kPMTIEnemySet = -22, + kPMTIFlagReset = -21, + kPMTIFlagSet = -20, + kPMTIVariableDec = -19, + kPMTIVariableInc = -18, + kPMTIVariableReset = -17, + kPMTIVariableSet = -16, + kPMTITargetSet = -15, + kPMTI12 = -14, + kPMTI13 = -13, + kPMTIPausedSet = -12, + kPMTIPausedReset = -11, + kPMTIPlaySound = -10, + kPMTIObstacleReset = -9, + kPMTIObstacleSet = -8, + kPMTIWaitRandom = -7, + kPMTIRotate = -6, + kPMTIFacing = -5, + kPMTIRestart = -4, + kPMTIWait = -3, + kPMTIMove = -2, + kPMTIPosition = -1, + kPMTI26 = 0 +}; + } // End of namespace BladeRunner #endif diff --git a/engines/bladerunner/mouse.cpp b/engines/bladerunner/mouse.cpp index a3a52b7046..7639e305dc 100644 --- a/engines/bladerunner/mouse.cpp +++ b/engines/bladerunner/mouse.cpp @@ -170,19 +170,19 @@ void Mouse::setRandomY() { switch (_vm->_settings->getDifficulty()) { case 0: _randomCountdownY = 2; - _randomX = _vm->_rnd.getRandomNumberRng(-3, 3); + _randomX = _vm->_rnd.getRandomNumberRng(0, 6) - 3; _randomY = _vm->_rnd.getRandomNumberRng(10, 20); break; case 1: _randomCountdownY = 3; - _randomX = _vm->_rnd.getRandomNumberRng(-4, 4); + _randomX = _vm->_rnd.getRandomNumberRng(0, 8) - 4; _randomY = _vm->_rnd.getRandomNumberRng(15, 25); break; case 2: _randomCountdownY = 4; - _randomX = _vm->_rnd.getRandomNumberRng(-5, 5); + _randomX = _vm->_rnd.getRandomNumberRng(0, 10) - 5; _randomY = _vm->_rnd.getRandomNumberRng(20, 30); break; } diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 56b54ac0eb..1e3dff8c1b 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -1503,7 +1503,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { } } break; - case 21: + case kAnimationModeHit: switch (_animationState) { case 14: case 15: @@ -1520,7 +1520,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { } _animationFrame = 0; break; - case 16: + default: if (Random_Query(0, 1) == 1) { _animationState = 26; } else { @@ -1530,7 +1530,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } break; - case 22: + case kAnimationModeCombatHit: if (Random_Query(0, 1) == 1) { _animationState = 23; } else { @@ -1587,7 +1587,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationState = 41; _animationFrame = 0; break; - case 48: + case kAnimationModeDie: switch (_animationState) { case 14: case 15: @@ -1610,7 +1610,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } break; - case 49: + case kAnimationModeCombatDie: _animationState = 28; _animationFrame = 0; break; @@ -1622,7 +1622,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationState = 55; _animationFrame = 0; break; - case 53: + case kAnimationModeSit: if (_animationState != 60 && (Player_Query_Current_Set() == kSetNR03 || Player_Query_Current_Set() == kSetNR05_NR08)) { _animationState = 60; _animationFrame = 0; diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp index f9beec0751..3aa3ebbfc8 100644 --- a/engines/bladerunner/script/police_maze.cpp +++ b/engines/bladerunner/script/police_maze.cpp @@ -49,8 +49,8 @@ PoliceMaze::~PoliceMaze() { void PoliceMaze::reset() { _isPaused = false; - _needAnnouncement = false; - _announcementRead = false; + _isActive = false; + _isEnding = false; for (int i = 0; i < kNumMazeTracks; i++) { _tracks[i] = 0; @@ -62,14 +62,15 @@ void PoliceMaze::reset() { void PoliceMaze::clear(bool isLoadingGame) { for (int i = 0; i < kNumMazeTracks; i++) { - if (_tracks[i]->isPresent()) + if (_tracks[i]->isPresent()) { _tracks[i]->clear(isLoadingGame); + } } } void PoliceMaze::activate() { - _needAnnouncement = true; - _announcementRead = false; + _isActive = true; + _isEnding = false; } void PoliceMaze::setPauseState(bool state) { @@ -78,37 +79,40 @@ void PoliceMaze::setPauseState(bool state) { uint32 t = _vm->getTotalPlayTime(); - for (int i = 0; i < kNumMazeTracks; i++) + for (int i = 0; i < kNumMazeTracks; i++) { _tracks[i]->setTime(t); + } } void PoliceMaze::tick() { - if (_isPaused) + if (_isPaused) { return; + } - if (_vm->_scene->getSetId() != kSetPS10_PS11_PS12_PS13) + if (_vm->_scene->getSetId() != kSetPS10_PS11_PS12_PS13) { return; + } - if (_announcementRead) { - _needAnnouncement = false; - + if (_isEnding) { + _isActive = false; return; } - for (int i = 0; i < kNumMazeTracks; i++) + for (int i = 0; i < kNumMazeTracks; i++) { _tracks[i]->tick(); + } bool notFound = true; for (int i = 0; i < kNumMazeTracks; i++) { - if (!_tracks[i]->isVisible()) { + if (!_tracks[i]->isPaused()) { notFound = false; break; } } - if (notFound && _needAnnouncement && !_announcementRead) { - _needAnnouncement = false; - _announcementRead = true; + if (notFound && _isActive && !_isEnding) { + _isActive = false; + _isEnding = true; if (_vm->_scene->getSceneId() == kScenePS13) { Actor_Voice_Over(320, kActorAnsweringMachine); @@ -127,53 +131,53 @@ PoliceMazeTargetTrack::~PoliceMazeTargetTrack() { } void PoliceMazeTargetTrack::reset() { - _isPresent = 0; - _itemId = -1; - _count = 0; - _data = 0; - _dataIndex = 0; - _updateDelay = 0; - _waitTime = 0; - _time = 0; - _haveToWait = false; - _pmt_var4 = 0; - _pointIndex = 0; - _pmt_var5 = 0; - _rotating = false; - _maxAngle = 0; - _angleChange = 0; - _visible = true; + _isPresent = false; + _itemId = -1; + _pointCount = 0; + _data = nullptr; + _dataIndex = 0; + _timeLeftUpdate = 0; + _timeLeftWait = 0; + _time = 0; + _isWaiting = false; + _isMoving = false; + _pointIndex = 0; + _pointTarget = 0; + _isRotating = false; + _angleTarget = 0; + _angleDelta = 0; + _isPaused = true; } void PoliceMazeTargetTrack::clear(bool isLoadingGame) { reset(); } -void PoliceMazeTargetTrack::add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int count, void *list, bool a11) { - _data = (int *)list; +void PoliceMazeTargetTrack::add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, const int *instructions, bool isActive) { + _data = (const int *)instructions; - if (true /* !GameIsLoading */) { // FIXME + if (true /* !GameIsLoading */) { // TODO: FIXME _itemId = trackId; - _count = count; + _pointCount = steps; _dataIndex = 0; - double coef = 1.0f / (long double)count; + double coef = 1.0f / (long double)steps; double coefX = (endX - startX) * coef; double coefY = (endY - startY) * coef; double coefZ = (endZ - startZ) * coef; - for (int i = 0; i < count; i++) { + for (int i = 0; i < steps; i++) { _points[i].x = i * coefX + startX; _points[i].y = i * coefY + startY; _points[i].z = i * coefZ + startZ; } - _points[count].x = endX; - _points[count].y = endY; - _points[count].z = endZ; + _points[steps].x = endX; + _points[steps].y = endY; + _points[steps].z = endZ; - _visible = !a11; + _isPaused = !isActive; } _isPresent = true; } @@ -186,63 +190,67 @@ bool PoliceMazeTargetTrack::tick() { uint32 oldTime = _time; _time = _vm->getTotalPlayTime(); int32 timeDiff = _time - oldTime; - _updateDelay -= timeDiff; + _timeLeftUpdate -= timeDiff; - if (_updateDelay > 0) + if (_timeLeftUpdate > 0) { return false; + } - _updateDelay = 66; + _timeLeftUpdate = 66; - if (_visible) + if (_isPaused) { return false; + } - if (_haveToWait) { - _waitTime -= timeDiff; + if (_isWaiting) { + _timeLeftWait -= timeDiff; - if (_waitTime > 0) + if (_timeLeftWait > 0) { return true; + } - _haveToWait = false; - _waitTime = 0; + _isWaiting = false; + _timeLeftWait = 0; } - if (_vm->_items->isSpinning(_itemId)) + if (_vm->_items->isSpinning(_itemId)) { return true; + } - if (_rotating) { - float angle = _vm->_items->getFacing(_itemId) + _angleChange; + if (_isRotating) { + float angle = _vm->_items->getFacing(_itemId) + _angleDelta; - if (_angleChange > 0) { - if (angle >= _maxAngle) { - angle = _maxAngle; - _rotating = false; + if (_angleDelta > 0) { + if (angle >= _angleTarget) { + angle = _angleTarget; + _isRotating = false; } - } else if (_angleChange < 0) { - if (angle <= _maxAngle) { - angle = _maxAngle; - _rotating = false; + } else if (_angleDelta < 0) { + if (angle <= _angleTarget) { + angle = _angleTarget; + _isRotating = false; } } else { - _rotating = false; + _isRotating = false; } _vm->_items->setFacing(_itemId, angle); - if (_rotating) + if (_isRotating) return false; } bool advancePoint = false; - if (_pmt_var4) { - if (_pointIndex < _pmt_var5) { + if (_isMoving) { + if (_pointIndex < _pointTarget) { _pointIndex++; advancePoint = true; - } else if (_pointIndex > _pmt_var5) { + } else if (_pointIndex > _pointTarget) { _pointIndex--; advancePoint = true; } else { - _pmt_var4 = 0; + _isMoving = 0; } } @@ -254,215 +262,254 @@ bool PoliceMazeTargetTrack::tick() { } bool cont = true; - int var1 = 0, var2 = 0, var3 = 0, varRes = 0; while (cont) { _dataIndex++; - switch (_data[_dataIndex - 1] + 26) { - case 0: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; + debug ("ItemId %3i, pos %3i, instruction %3i", _itemId, _dataIndex - 1, _data[_dataIndex - 1]); - if (Global_Variable_Query(var1) >= Global_Variable_Query(var2)) { - setVisible(); - cont = false; - } else { - cont = true; + switch (_data[_dataIndex - 1]) { + case kPMTIActivate: + { + int variableId = _data[_dataIndex++]; + int maxValue = _data[_dataIndex++]; + + if (Global_Variable_Query(variableId) >= maxValue) { + setPaused(); + cont = false; + } else { + cont = true; + } + break; } - break; - case 1: + case kPMTILeave: if (!_vm->_items->isPoliceMazeEnemy(_itemId) && _vm->_items->isTarget(_itemId)) { Police_Maze_Increment_Score(1); } break; - case 2: - var1 = _data[_dataIndex++]; - _dataIndex++; + case kPMTIShoot: + { + int soundId = _data[_dataIndex++]; + _dataIndex++; // second argument is not used - if (_vm->_items->isTarget(_itemId)) { - Sound_Play(var1, 90, 0, 0, 50); - Police_Maze_Decrement_Score(1); - Actor_Force_Stop_Walking(0); + if (_vm->_items->isTarget(_itemId)) { + Sound_Play(soundId, 90, 0, 0, 50); + Police_Maze_Decrement_Score(1); + Actor_Force_Stop_Walking(kActorMcCoy); - if (Player_Query_Combat_Mode() == 1) { - Actor_Change_Animation_Mode(0, 22); - } else { - Actor_Change_Animation_Mode(0, 21); - } + if (Player_Query_Combat_Mode()) { + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatHit); + } else { + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeHit); + } - int snd; + int snd; - if (Random_Query(1, 2) == 1) { - snd = 9900; - } else { - snd = 9905; + if (Random_Query(1, 2) == 1) { + snd = 9900; + } else { + snd = 9905; + } + Sound_Play_Speech_Line(kActorMcCoy, snd, 75, 0, 99); + + _vm->_mouse->setRandomY(); } - Sound_Play_Speech_Line(0, snd, 75, 0, 99); - _vm->_mouse->setRandomY(); + cont = false; + break; } - cont = false; - break; + case kPMTIEnemyReset: + { + int itemId = _data[_dataIndex++]; + _vm->_items->setPoliceMazeEnemy(itemId, false); + break; + } - case 3: - var1 = _data[_dataIndex++]; - _vm->_items->setPoliceMazeEnemy(var1, 0); - break; + case kPMTIEnemySet: + { + int itemId = _data[_dataIndex++]; + _vm->_items->setPoliceMazeEnemy(itemId, true); + break; + } - case 4: - var1 = _data[_dataIndex++]; - _vm->_items->setPoliceMazeEnemy(var1, 1); - break; + case kPMTIFlagReset: + { + int gameFlagId = _data[_dataIndex++]; + Game_Flag_Reset(gameFlagId); + break; + } - case 5: - var1 = _data[_dataIndex++]; - Game_Flag_Reset(var1); - break; + case kPMTIFlagSet: + { + int gameFlagId = _data[_dataIndex++]; + Game_Flag_Set(gameFlagId); + break; + } - case 6: - var1 = _data[_dataIndex++]; - Game_Flag_Set(var1); - break; + case kPMTIVariableDec: + { + int variableId = _data[_dataIndex++]; + Global_Variable_Decrement(variableId, 1); + break; + } - case 7: - var1 = _data[_dataIndex++]; - Global_Variable_Decrement(var1, 1); - break; + case kPMTIVariableInc: + { + int variableId = _data[_dataIndex++]; + int maxValue = _data[_dataIndex++]; + if (Global_Variable_Query(variableId) < maxValue) { + Global_Variable_Increment(variableId, 1); + } + break; + } - case 8: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; - if (Global_Variable_Query(var1) < var2) { - Global_Variable_Increment(var1, 1); + case kPMTIVariableReset: + { + int variableId = _data[_dataIndex++]; + Global_Variable_Reset(variableId); + break; } - break; - case 9: - var1 = _data[_dataIndex++]; - Global_Variable_Reset(var1); - break; + case kPMTIVariableSet: + { + int variableId = _data[_dataIndex++]; + int value = _data[_dataIndex++]; + Global_Variable_Set(variableId, value); + break; + } - case 10: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; - Global_Variable_Set(var1, var2); - break; + case kPMTITargetSet: + { + int itemId = _data[_dataIndex++]; + int value = _data[_dataIndex++]; + _vm->_items->setIsTarget(itemId, value); + break; + } - case 11: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; - _vm->_items->setIsTarget(var1, var2); - break; + case kPMTI12: + { + int trackId1 = _data[_dataIndex++]; + int trackId2 = _data[_dataIndex++]; + int trackId3 = _data[_dataIndex++]; - case 12: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; - var3 = _data[_dataIndex++]; + switch (Random_Query(1, 3)) { + case 1: + _vm->_policeMaze->_tracks[trackId1]->resetPaused(); + break; - switch (Random_Query(1, 3)) { - case 1: - varRes = var1; - break; + case 2: + _vm->_policeMaze->_tracks[trackId2]->resetPaused(); + break; - case 2: - varRes = var2; - break; + case 3: + _vm->_policeMaze->_tracks[trackId3]->resetPaused(); + break; + } - case 3: - varRes = var3; break; } - _vm->_policeMaze->_tracks[varRes]->resetVisible(); - break; - - case 13: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; + case kPMTI13: + { + int trackId1 = _data[_dataIndex++]; + int trackId2 = _data[_dataIndex++]; - if (Random_Query(1, 2) == 1) { - varRes = var1; - } else { - varRes = var2; + if (Random_Query(1, 2) == 1) { + _vm->_policeMaze->_tracks[trackId1]->resetPaused(); + } else { + _vm->_policeMaze->_tracks[trackId2]->resetPaused(); + } + break; } - _vm->_policeMaze->_tracks[varRes]->resetVisible(); - break; - case 14: - var1 = _data[_dataIndex++]; - _vm->_policeMaze->_tracks[var1]->setVisible(); - break; + case kPMTIPausedSet: + { + int trackId = _data[_dataIndex++]; + _vm->_policeMaze->_tracks[trackId]->setPaused(); + break; + } - case 15: - var1 = _data[_dataIndex++]; - _vm->_policeMaze->_tracks[var1]->resetVisible(); - break; + case kPMTIPausedReset: + { + int trackId = _data[_dataIndex++]; + _vm->_policeMaze->_tracks[trackId]->resetPaused(); + break; + } - case 16: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; - Sound_Play(var1, var2, 0, 0, 50); - break; + case kPMTIPlaySound: + { + int soundId = _data[_dataIndex++]; + int volume = _data[_dataIndex++]; + Sound_Play(soundId, volume, 0, 0, 50); + break; + } - case 17: - var1 = _data[_dataIndex++]; - _vm->_items->setIsObstacle(var1, 0); - break; + case kPMTIObstacleReset: + { + int itemId = _data[_dataIndex++]; + _vm->_items->setIsObstacle(itemId, 0); + break; + } - case 18: - var1 = _data[_dataIndex++]; - _vm->_items->setIsObstacle(var1, 1); - break; + case kPMTIObstacleSet: + { + int itemId = _data[_dataIndex++]; + _vm->_items->setIsObstacle(itemId, 1); + break; + } - case 19: - var1 = _data[_dataIndex++]; - var2 = _data[_dataIndex++]; - _waitTime = Random_Query(var1, var2); - _haveToWait = true; + case kPMTIWaitRandom: + { + int randomMin = _data[_dataIndex++]; + int randomMax = _data[_dataIndex++]; + _timeLeftWait = Random_Query(randomMin, randomMax); + _isWaiting = true; - cont = false; - break; + cont = false; + break; + } - case 20: - _maxAngle = _data[_dataIndex++]; - _angleChange = _data[_dataIndex++]; - _rotating = true; + case kPMTIRotate: + _angleTarget = _data[_dataIndex++]; + _angleDelta = _data[_dataIndex++]; + _isRotating = true; cont = false; break; - case 21: - var1 = _data[_dataIndex++]; - _vm->_items->setFacing(_itemId, var1); - break; + case kPMTIFacing: + { + int angle = _data[_dataIndex++]; + _vm->_items->setFacing(_itemId, angle); + break; + } - case 22: + case kPMTIRestart: _dataIndex = 0; cont = false; break; - case 23: - _waitTime = _data[_dataIndex++]; - _haveToWait = true; + case kPMTIWait: + _timeLeftWait = _data[_dataIndex++]; + _isWaiting = true; cont = false; break; - case 24: - _pmt_var5 = _data[_dataIndex++]; - _pmt_var4 = 1; + case kPMTIMove: + _pointTarget = _data[_dataIndex++]; + _isMoving = true; cont = false; break; - case 25: + case kPMTIPosition: _pointIndex = _data[_dataIndex++]; - _pmt_var4 = 0; + _isMoving = false; _vm->_items->setXYZ(_itemId, _points[_pointIndex]); readdObject(_itemId); break; @@ -471,7 +518,7 @@ bool PoliceMazeTargetTrack::tick() { return false; } - if (_visible || _haveToWait) { + if (_isPaused || _isWaiting) { cont = false; } } diff --git a/engines/bladerunner/script/police_maze.h b/engines/bladerunner/script/police_maze.h index 73eb973e95..e53d68e373 100644 --- a/engines/bladerunner/script/police_maze.h +++ b/engines/bladerunner/script/police_maze.h @@ -36,23 +36,23 @@ enum { class BladeRunnerEngine; class PoliceMazeTargetTrack : ScriptBase { - uint32 _time; - bool _isPresent; - int _itemId; - int _count; + uint32 _time; + bool _isPresent; + int _itemId; + int _pointCount; Vector3 _points[kNumTrackPoints]; - int *_data; - int _dataIndex; - int32 _updateDelay; - int32 _waitTime; - bool _haveToWait; - int _pmt_var4; - int _pointIndex; - int _pmt_var5; - bool _rotating; - int _maxAngle; - int _angleChange; - bool _visible; + const int *_data; + int _dataIndex; + int32 _timeLeftUpdate; + int32 _timeLeftWait; + bool _isWaiting; + int _isMoving; + int _pointIndex; + int _pointTarget; + bool _isRotating; + int _angleTarget; + int _angleDelta; + bool _isPaused; public: PoliceMazeTargetTrack(BladeRunnerEngine *vm); @@ -60,13 +60,13 @@ public: void reset(); void clear(bool isLoadingGame); - void add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int count, void *list, bool a11); + void add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, const int *instructions, bool isActive); bool tick(); - bool isPresent() { return _isPresent; } - void setVisible() { _visible = true; } - void resetVisible() { _visible = false; } - bool isVisible() { return _visible; } + bool isPresent() const { return _isPresent; } + void setPaused() { _isPaused = true; } + void resetPaused() { _isPaused = false; } + bool isPaused() const { return _isPaused; } void setTime(uint32 t) { _time = t; } void readdObject(int itemId); @@ -74,10 +74,10 @@ public: class PoliceMaze : ScriptBase { bool _isPaused; - bool _needAnnouncement; - bool _announcementRead; - int _pm_var1; - int _pm_var2; + bool _isActive; + bool _isEnding; + int _pm_var1; + int _pm_var2; public: PoliceMazeTargetTrack *_tracks[kNumMazeTracks]; diff --git a/engines/bladerunner/script/scene/ps10.cpp b/engines/bladerunner/script/scene/ps10.cpp index 8a1677fed3..3957ee1c7d 100644 --- a/engines/bladerunner/script/scene/ps10.cpp +++ b/engines/bladerunner/script/scene/ps10.cpp @@ -24,6 +24,299 @@ namespace BladeRunner { +enum PoliceMazePS10Tracks { + kPoliceMazePS10Track1 = 0, + kPoliceMazePS10Track2 = 1, + kPoliceMazePS10Track3 = 2, + kPoliceMazePS10Track4 = 3, + kPoliceMazePS10Track5 = 4, + kPoliceMazePS10Track6 = 5, + kPoliceMazePS10Track7 = 6, + kPoliceMazePS10Track8 = 7, + kPoliceMazePS10Track9 = 8 +}; + +static int kPoliceMazePS10TargetCount = 20; + +static const int *getPoliceMazePS10TrackData1() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget1, + kPMTIObstacleReset, kItemPoliceMazeTarget2, + kPMTIFacing, 989, + kPMTIPosition, 0, + kPMTITargetSet, kItemPoliceMazeTarget1, 1, + kPMTITargetSet, kItemPoliceMazeTarget2, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget1, + kPMTIWaitRandom, 3000, 5000, + kPMTIObstacleSet, kItemPoliceMazeTarget1, + kPMTIPlaySound, 159, 100, + kPMTIMove, 14, + kPMTIWait, 1000, + kPMTIRotate, 740, 80, + kPMTIEnemySet, kItemPoliceMazeTarget1, + kPMTIWait, 0, + kPMTIRotate, 488, 80, + kPMTIWait, 1000, + kPMTIShoot, 27, 33, + kPMTIWait, 0, + kPMTIRotate, 740, 80, + kPMTIPausedReset, kPoliceMazePS10Track2, + kPMTIObstacleReset, kItemPoliceMazeTarget1, + kPMTIObstacleSet, kItemPoliceMazeTarget2, + kPMTIPausedSet, kPoliceMazePS10Track1, + kPMTIPosition, 0, + kPMTIRestart + }; + + return trackData; +} + +static const int *getPoliceMazePS10TrackData2() { + static int trackData[] = { + kPMTIFacing, 740, + kPMTIPosition, 0, + kPMTIEnemySet, kItemPoliceMazeTarget2, + kPMTIMove, 69, + kPMTIWait, 500, + kPMTIObstacleReset, kItemPoliceMazeTarget2, + kPMTIPausedReset, kPoliceMazePS10Track5, + kPMTIPausedSet, kPoliceMazePS10Track2, + kPMTIPosition, 0, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData3() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget3, + kPMTIFacing, 993, + kPMTIPosition, 0, + kPMTIWaitRandom, 3000, 5000, + kPMTIObstacleSet, kItemPoliceMazeTarget3, + kPMTIPlaySound, 159, 100, + kPMTITargetSet, kItemPoliceMazeTarget3, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget3, + kPMTIMove, 5, + kPMTIWait, 1000, + kPMTIEnemySet, kItemPoliceMazeTarget3, + kPMTIRotate, 233, 80, + kPMTIWait, 0, + kPMTIRotate, 491, 80, + kPMTIWait, 500, + kPMTIShoot, 27, 33, + kPMTIWait, 500, + kPMTIRotate, 233, 80, + kPMTIWait, 0, + kPMTIRotate, 993, 80, + kPMTIPlaySound, 34, 33, + kPMTIMove, 0, + kPMTIObstacleReset, kItemPoliceMazeTarget3, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData4() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget4, + kPMTIFacing, 993, + kPMTIPosition, 0, + kPMTIWaitRandom, 3000, 6000, + kPMTIObstacleSet, kItemPoliceMazeTarget4, + kPMTIPlaySound, 159, 100, + kPMTITargetSet, kItemPoliceMazeTarget4, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget4, + kPMTIMove, 34, + kPMTIWait, 500, + kPMTIRotate, 491, 80, + kPMTIMove, 0, + kPMTILeave, + kPMTIObstacleReset, kItemPoliceMazeTarget4, + kPMTIPausedReset, kPoliceMazePS10Track8, + kPMTIPausedSet, kPoliceMazePS10Track4, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData5() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget5, + kPMTIFacing, 0, + kPMTIPosition, 0, + kPMTIWaitRandom, 4000, 6000, + kPMTIObstacleSet, kItemPoliceMazeTarget5, + kPMTIPlaySound, 159, 100, + kPMTITargetSet, kItemPoliceMazeTarget5, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget5, + kPMTIMove, 5, + kPMTIWait, 1000, + kPMTIRotate, 512, 100, + kPMTIWait, 2000, + kPMTIRotate, 0, -100, + kPMTIPlaySound, 34, 33, + kPMTIMove, 0, + kPMTILeave, + kPMTIObstacleReset, kItemPoliceMazeTarget5, + kPMTIPausedReset, kPoliceMazePS10Track1, + kPMTIPausedSet, kPoliceMazePS10Track5, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData6() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget6, + kPMTIFacing, 999, + kPMTIPosition, 0, + kPMTIWaitRandom, 4000, 6000, + kPMTIObstacleSet, kItemPoliceMazeTarget6, + kPMTIPlaySound, 159, 100, + kPMTITargetSet, kItemPoliceMazeTarget6, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget6, + kPMTIMove, 7, + kPMTIWait, 500, + kPMTIEnemySet, kItemPoliceMazeTarget6, + kPMTIRotate, 750, 80, + kPMTIWait, 0, + kPMTIRotate, 500, 80, + kPMTIWait, 1000, + kPMTIShoot, 27, 33, + kPMTIWait, 0, + kPMTIRotate, 750, 80, + kPMTIWait, 0, + kPMTIRotate, 999, 80, + kPMTIPlaySound, 34, 33, + kPMTIMove, 0, + kPMTIObstacleReset, kItemPoliceMazeTarget6, + kPMTIPausedReset, kPoliceMazePS10Track7, + kPMTIPausedReset, kPoliceMazePS10Track9, + kPMTIPausedSet, kPoliceMazePS10Track6, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData7() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget7, + kPMTIFacing, 264, + kPMTIPosition, 0, + kPMTIWaitRandom, 3000, 6000, + kPMTITargetSet, kItemPoliceMazeTarget7, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget7, + kPMTIObstacleSet, kItemPoliceMazeTarget7, + kPMTIMove, 89, + kPMTIWaitRandom, 4000, 8000, + kPMTIFacing, 776, + kPMTIMove, 0, + kPMTILeave, + kPMTIObstacleReset, kItemPoliceMazeTarget7, + kPMTIPausedSet, kPoliceMazePS10Track7, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData8() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget8, + kPMTIFacing, 993, + kPMTIPosition, 0, + kPMTIWaitRandom, 4000, 6000, + kPMTIObstacleSet, kItemPoliceMazeTarget8, + kPMTIPlaySound, 159, 100, + kPMTITargetSet, kItemPoliceMazeTarget8, 1, + kPMTIEnemyReset, kItemPoliceMazeTarget8, + kPMTIMove, 34, + kPMTIWait, 500, + kPMTIEnemySet, kItemPoliceMazeTarget8, + kPMTIRotate, 491, 80, + kPMTIMove, 20, + kPMTIWait, 0, + kPMTIShoot, 27, 33, + kPMTIMove, 0, + kPMTIObstacleReset, kItemPoliceMazeTarget8, + kPMTIPausedReset, kPoliceMazePS10Track4, + kPMTIPausedSet, kPoliceMazePS10Track8, + kPMTIRestart + }; + return trackData; +} + +static const int *getPoliceMazePS10TrackData9() { + static int trackData[] = { + kPMTIActivate, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIVariableInc, kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount, + kPMTIObstacleReset, kItemPoliceMazeTarget9, + kPMTIFacing, 738, + kPMTIPosition, 0, + kPMTIWaitRandom, 2000, 5000, + kPMTITargetSet, kItemPoliceMazeTarget9, 1, + kPMTIEnemySet, kItemPoliceMazeTarget9, + kPMTIObstacleSet, kItemPoliceMazeTarget9, + kPMTIPlaySound, 0, 33, + kPMTIMove, 23, + kPMTIPlaySound, 0, 33, + kPMTIWait, 200, + kPMTIPlaySound, 32, 33, + kPMTIRotate, 498, 100, + kPMTIPlaySound, 0, 33, + kPMTIWait, 100, + kPMTIShoot, 27, 33, + kPMTIPlaySound, 32, 33, + kPMTIMove, 35, + kPMTIPlaySound, 32, 33, + kPMTIWait, 100, + kPMTIShoot, 27, 33, + kPMTIPlaySound, 0, 33, + kPMTIMove, 23, + kPMTIPlaySound, 32, 33, + kPMTIWait, 100, + kPMTIShoot, 27, 33, + kPMTIPlaySound, 32, 33, + kPMTIRotate, 758, 100, + kPMTIPlaySound, 32, 33, + kPMTIMove, 89, + kPMTIPlaySound, 0, 33, + kPMTIWaitRandom, 4000, 6000, + kPMTITargetSet, kItemPoliceMazeTarget9, 1, + kPMTIEnemySet, kItemPoliceMazeTarget9, + kPMTIFacing, 216, + kPMTIPlaySound, 32, 33, + kPMTIMove, 69, + kPMTIWait, 100, + kPMTIPlaySound, 32, 33, + kPMTIRotate, 498, 100, + kPMTIWait, 100, + kPMTIShoot, 27, 33, + kPMTIPlaySound, 0, 33, + kPMTIRotate, 216, 100, + kPMTIPlaySound, 32, 33, + kPMTIMove, 0, + kPMTIObstacleReset, kItemPoliceMazeTarget9, + kPMTIPausedSet, kPoliceMazePS10Track9, + kPMTIRestart + }; + return trackData; +} + void SceneScriptPS10::InitializeScene() { Police_Maze_Set_Pause_State(true); if (Game_Flag_Query(15)) { @@ -38,30 +331,20 @@ void SceneScriptPS10::InitializeScene() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); -} - -static int track_data_0[] = {-26, 10, 20, -18, 10, 20, -9, 0, -9, 1,-5, 989, -1, 0, -15, 0, 1, -15, 1, 1,-23, 0, -7, 3000, 5000, -8, 0, -10, 159, 100,-2, 14, -3, 1000, -6, 740, 80, -22, 0, -3,0, -6, 488, 80, -3, 1000, -24, 27, 33, -3, 0, -6, 740, 80, -11, 1, -9, 0, -8, 1, -12, 0, -1, 0, -4}; -static int track_data_1[] = {-5, 740, -1, 0, -22, 1, -2, 69, -3, 500, -9, 1, -11, 4, -12, 1, -1, 0, -4}; -static int track_data_2[] = {-26, 10, 20, -18, 10, 20, -9, 2, -5, 993, -1, 0, -7, 3000, 5000, -8, 2, -10, 159, 100, -15, 2, 1, -23, 2, -2, 5, -3, 1000, -22, 2, -6, 233, 80, -3, 0, -6, 491, 80, -3, 500, -24, 27, 33, -3, 500, -6, 233, 80, -3, 0, -6, 993, 80, -10, 34, 33, -2, 0, -9, 2, -4}; -static int track_data_3[] = {-26, 10, 20, -18, 10, 20, -9, 3, -5, 993, -1, 0, -7, 3000, 6000, -8, 3, -10, 159, 100, -15, 3, 1, -23, 3, -2, 34, -3, 500, -6, 491, 80, -2, 0, -25, -9, 3, -11, 7, -12, 3, -4}; -static int track_data_4[] = {-26, 10, 20, -18, 10, 20, -9, 4, -5, 0, -1, 0, -7, 4000, 6000, -8, 4, -10, 159, 100, -15, 4, 1, -23, 4, -2, 5, -3, 1000, -6, 512, 100, -3, 2000, -6, 0, -100, -10, 34, 33, -2, 0, -25, -9, 4, -11, 0, -12, 4, -4}; -static int track_data_5[] = {-26, 10, 20, -18, 10, 20, -9, 5, -5, 999, -1, 0, -7, 4000, 6000, -8, 5, -10, 159, 100, -15, 5, 1, -23, 5, -2, 7, -3, 500, -22, 5, -6, 750, 80, -3, 0, -6, 500, 80, -3, 1000, -24, 27, 33, -3, 0, -6, 750, 80, -3, 0, -6, 999, 80, -10, 34, 33, -2, 0, -9, 5, -11, 6, -11, 8, -12, 5, -4}; -static int track_data_6[] = {-26, 10, 20, -18, 10, 20, -9, 6, -5, 264, -1, 0, -7, 3000, 6000, -15, 6, 1, -23, 6, -8, 6, -2, 89, -7, 4000, 8000, -5, 776, -2, 0, -25, -9, 6, -12, 6, -4}; -static int track_data_7[] = {-26, 10, 20, -18, 10, 20, -9, 7, -5, 993, -1, 0, -7, 4000, 6000, -8, 7, -10, 159, 100, -15, 7, 1, -23, 7, -2, 34, -3, 500, -22, 7, -6, 491, 80, -2, 20, -3, 0, -24, 27, 33, -2, 0, -9, 7, -11, 3, -12, 7, -4}; -static int track_data_8[] = {-26, 10, 20, -18, 10, 20, -9, 8, -5, 738, -1, 0, -7, 2000, 5000, -15, 8, 1, -22, 8, -8, 8, -10, 0, 33, -2, 23, -10, 0, 33, -3, 200, -10, 32, 33, -6, 498, 100, -10, 0, 33, -3, 100, -24, 27, 33, -10, 32, 33, -2, 35, -10, 32, 33, -3, 100, -24, 27, 33, -10, 0, 33, -2, 23, -10, 32, 33, -3, 100, -24, 27, 33, -10, 32, 33, -6, 758, 100, -10, 32, 33, -2, 89, -10, 0, 33, -7, 4000, 6000, -15, 8, 1, -22, 8, -5, 216, -10, 32, 33, -2, 69, -3, 100, -10, 32, 33, -6, 498, 100, -3, 100, -24, 27, 33, -10, 0, 33, -6, 216, 100, -10, 32, 33, -2, 0, -9, 8, -12, 8, -4}; + Ambient_Sounds_Add_Sound( 1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); +} void SceneScriptPS10::SceneLoaded() { Obstacle_Object("PARKMETR01", true); @@ -85,26 +368,26 @@ void SceneScriptPS10::SceneLoaded() { Unclickable_Object("PARKMETR16"); Unobstacle_Object("E.SM.WIRE01", true); if (!Query_System_Currently_Loading_Game()) { - Item_Add_To_World(0, 443, 14, -240.0f, -80.74f, 145.0f, 989, 72, 36, true, false, false, true); - Item_Add_To_World(1, 443, 14, -240.0f, -8.74f, 145.0f, 740, 72, 36, true, false, false, true); - Item_Add_To_World(2, 445, 14, -165.0f, 111.53f, -10.0f, 993, 72, 36, true, false, false, true); - Item_Add_To_World(3, 447, 14, -125.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); - Item_Add_To_World(4, 441, 14, -246.71f, 205.51f, -20.0f, 0, 72, 36, true, false, false, true); - Item_Add_To_World(5, 445, 14, -27.69f, -86.92f, 434.0f, 999, 72, 36, true, false, false, true); - Item_Add_To_World(6, 441, 14, -347.15f, 7.68f, -20.0f, 264, 72, 36, true, false, false, true); - Item_Add_To_World(7, 449, 14, -51.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); - Item_Add_To_World(8, 445, 14, 39.0f, 9.16f, -20.0f, 738, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget1, 443, 14, -240.0f, -80.74f, 145.0f, 989, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget2, 443, 14, -240.0f, -8.74f, 145.0f, 740, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget3, 445, 14, -165.0f, 111.53f, -10.0f, 993, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget4, 447, 14, -125.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget5, 441, 14, -246.71f, 205.51f, -20.0f, 0, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget6, 445, 14, -27.69f, -86.92f, 434.0f, 999, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget7, 441, 14, -347.15f, 7.68f, -20.0f, 264, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget8, 449, 14, -51.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); + Item_Add_To_World(kItemPoliceMazeTarget9, 445, 14, 39.0f, 9.16f, -20.0f, 738, 72, 36, true, false, false, true); } - Police_Maze_Target_Track_Add(0, -240.0f, -80.74f, 145.0f, -240.0f, -8.74f, 145.0f, 15, track_data_0, false); - Police_Maze_Target_Track_Add(1, -240.0f, -8.74f, 145.0f, -450.0f, -8.74f, 145.0f, 70, track_data_1, false); - Police_Maze_Target_Track_Add(2, -165.0f, 111.53f, -10.0f, -165.0f, 167.53f, -10.0f, 6, track_data_2, true); - Police_Maze_Target_Track_Add(3, -125.0f, 160.0f, -10.0f, -51.0f, 160.0f, -10.0f, 35, track_data_3, false); - Police_Maze_Target_Track_Add(4, -246.71f, 205.51f, -20.0f, -246.71f, 241.51f, -20.0f, 6, track_data_4, true); - Police_Maze_Target_Track_Add(5, -27.69f, -86.92f, 434.0f, -27.69f, -18.92f, 434.0f, 8, track_data_5, true); - Police_Maze_Target_Track_Add(6, -347.15f, 7.68f, -20.0f, 39.0f, 9.16f, -20.0f, 90, track_data_6, false); - Police_Maze_Target_Track_Add(7, -51.0f, 160.0f, -10.0f, -125.0f, 160.0f, -10.0f, 35, track_data_7, true); - Police_Maze_Target_Track_Add(8, 39.0f, 9.16f, -20.0f, -347.15f, 7.68f, -20.0f, 90, track_data_8, false); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget1, -240.0f, -80.74f, 145.0f, -240.0f, -8.74f, 145.0f, 15, getPoliceMazePS10TrackData1(), false); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget2, -240.0f, -8.74f, 145.0f, -450.0f, -8.74f, 145.0f, 70, getPoliceMazePS10TrackData2(), false); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget3, -165.0f, 111.53f, -10.0f, -165.0f, 167.53f, -10.0f, 6, getPoliceMazePS10TrackData3(), true); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget4, -125.0f, 160.0f, -10.0f, -51.0f, 160.0f, -10.0f, 35, getPoliceMazePS10TrackData4(), false); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget5, -246.71f, 205.51f, -20.0f, -246.71f, 241.51f, -20.0f, 6, getPoliceMazePS10TrackData5(), true); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget6, -27.69f, -86.92f, 434.0f, -27.69f, -18.92f, 434.0f, 8, getPoliceMazePS10TrackData6(), true); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget7, -347.15f, 7.68f, -20.0f, 39.0f, 9.16f, -20.0f, 90, getPoliceMazePS10TrackData7(), false); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget8, -51.0f, 160.0f, -10.0f, -125.0f, 160.0f, -10.0f, 35, getPoliceMazePS10TrackData8(), true); + Police_Maze_Target_Track_Add(kItemPoliceMazeTarget9, 39.0f, 9.16f, -20.0f, -347.15f, 7.68f, -20.0f, 90, getPoliceMazePS10TrackData9(), false); Preload(441); Preload(442); Preload(443); @@ -132,13 +415,13 @@ bool SceneScriptPS10::ClickedOnActor(int actorId) { bool SceneScriptPS10::ClickedOnItem(int itemId, bool a2) { if (Player_Query_Combat_Mode()) { switch (itemId) { - case 3: + case kItemPoliceMazeTarget4: Sound_Play(4, 50, 0, 0, 50); break; - case 4: + case kItemPoliceMazeTarget5: Sound_Play(555, 50, 0, 0, 50); break; - case 6: + case kItemPoliceMazeTarget7: Sound_Play(555, 50, 0, 0, 50); break; default: @@ -146,34 +429,34 @@ bool SceneScriptPS10::ClickedOnItem(int itemId, bool a2) { break; } Item_Spin_In_World(itemId); - if (itemId == 0) { - Item_Flag_As_Non_Target(0); - Item_Flag_As_Non_Target(1); + if (itemId == kItemPoliceMazeTarget1) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget1); + Item_Flag_As_Non_Target(kItemPoliceMazeTarget2); } - if (itemId == 1) { - Item_Flag_As_Non_Target(0); - Item_Flag_As_Non_Target(1); + if (itemId == kItemPoliceMazeTarget2) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget1); + Item_Flag_As_Non_Target(kItemPoliceMazeTarget2); } - if (itemId == 2) { - Item_Flag_As_Non_Target(2); + if (itemId == kItemPoliceMazeTarget3) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget3); } - if (itemId == 3) { - Item_Flag_As_Non_Target(3); + if (itemId == kItemPoliceMazeTarget4) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget4); } - if (itemId == 4) { - Item_Flag_As_Non_Target(4); + if (itemId == kItemPoliceMazeTarget5) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget5); } - if (itemId == 5) { - Item_Flag_As_Non_Target(5); + if (itemId == kItemPoliceMazeTarget6) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget6); } - if (itemId == 6) { - Item_Flag_As_Non_Target(6); + if (itemId == kItemPoliceMazeTarget7) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget7); } - if (itemId == 7) { - Item_Flag_As_Non_Target(7); + if (itemId == kItemPoliceMazeTarget8) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget8); } - if (itemId == 8) { - Item_Flag_As_Non_Target(8); + if (itemId == kItemPoliceMazeTarget9) { + Item_Flag_As_Non_Target(kItemPoliceMazeTarget9); } else { Item_Flag_As_Non_Target(itemId); } @@ -185,12 +468,12 @@ bool SceneScriptPS10::ClickedOnItem(int itemId, bool a2) { bool SceneScriptPS10::ClickedOnExit(int exitId) { if (exitId == 1) { - if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 6, 12, 1, false)) { + if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 6, 12, true, false)) { Game_Flag_Set(14); - sub_402238(); - Global_Variable_Decrement(9, 20 - Global_Variable_Query(10)); - Global_Variable_Set(10, 20); - Set_Enter(14, kScenePS11); + removeTargets(); + Global_Variable_Decrement(kVariablePoliceMazeScore, kPoliceMazePS10TargetCount - Global_Variable_Query(kVariablePoliceMazePS10TargetCounter)); + Global_Variable_Set(kVariablePoliceMazePS10TargetCounter, kPoliceMazePS10TargetCount); + Set_Enter(kSetPS10_PS11_PS12_PS13, kScenePS11); } return true; } @@ -210,17 +493,17 @@ void SceneScriptPS10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptPS10::PlayerWalkedIn() { if (Game_Flag_Query(15)) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -352.09f, -9.23f, 267.95f, 0, 0, true, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -352.09f, -9.23f, 267.95f, 0, false, true, 0); Police_Maze_Set_Pause_State(false); Game_Flag_Reset(15); //return true; return; } else { Player_Set_Combat_Mode(true); - Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 5, 0, 0, true); - Actor_Says(kActorAnsweringMachine, 280, 3); - Actor_Says(kActorAnsweringMachine, 290, 3); - Actor_Says(kActorAnsweringMachine, 300, 3); + Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 5, 0, false, true); + Actor_Says(kActorAnsweringMachine, 280, kAnimationModeTalk); + Actor_Says(kActorAnsweringMachine, 290, kAnimationModeTalk); + Actor_Says(kActorAnsweringMachine, 300, kAnimationModeTalk); Police_Maze_Set_Pause_State(false); //return true; return; @@ -233,16 +516,16 @@ void SceneScriptPS10::PlayerWalkedOut() { void SceneScriptPS10::DialogueQueueFlushed(int a1) { } -void SceneScriptPS10::sub_402238() { - Item_Remove_From_World(0); - Item_Remove_From_World(1); - Item_Remove_From_World(2); - Item_Remove_From_World(3); - Item_Remove_From_World(4); - Item_Remove_From_World(5); - Item_Remove_From_World(6); - Item_Remove_From_World(7); - Item_Remove_From_World(8); +void SceneScriptPS10::removeTargets() { + Item_Remove_From_World(kItemPoliceMazeTarget1); + Item_Remove_From_World(kItemPoliceMazeTarget2); + Item_Remove_From_World(kItemPoliceMazeTarget3); + Item_Remove_From_World(kItemPoliceMazeTarget4); + Item_Remove_From_World(kItemPoliceMazeTarget5); + Item_Remove_From_World(kItemPoliceMazeTarget6); + Item_Remove_From_World(kItemPoliceMazeTarget7); + Item_Remove_From_World(kItemPoliceMazeTarget8); + Item_Remove_From_World(kItemPoliceMazeTarget9); } } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp index 867e3bd661..db89807022 100644 --- a/engines/bladerunner/script/scene/rc01.cpp +++ b/engines/bladerunner/script/scene/rc01.cpp @@ -74,6 +74,8 @@ void SceneScriptRC01::InitializeScene() { // Global_Variable_Set(kVariableChapter, 2); // Chapter_Enter(2, kSetRC03, kSceneRC03); + Set_Enter(14, 73); + #endif if (!Game_Flag_Query(kFlagIntroPlayed)) { diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h index 54047ed8a8..51cac52db6 100644 --- a/engines/bladerunner/script/scene_script.h +++ b/engines/bladerunner/script/scene_script.h @@ -385,7 +385,7 @@ DECLARE_SCRIPT(PS09) END_SCRIPT DECLARE_SCRIPT(PS10) - void sub_402238(); + void removeTargets(); END_SCRIPT DECLARE_SCRIPT(PS11) diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 5f39646ea0..6c7d8f5bd9 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -1105,8 +1105,8 @@ void ScriptBase::Combat_Flee_Waypoint_Set_Data(int fleeWaypointId, int type, int _vm->_combat->_fleeWaypoints[fleeWaypointId].field7 = a8; } -void ScriptBase::Police_Maze_Target_Track_Add(int itemId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, signed int data[], bool a10) { - _vm->_policeMaze->_tracks[itemId]->add(itemId, startX, startY, startZ, endX, endY, endZ, steps, data, a10); +void ScriptBase::Police_Maze_Target_Track_Add(int itemId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, const int* instructions, bool isActive) { + _vm->_policeMaze->_tracks[itemId]->add(itemId, startX, startY, startZ, endX, endY, endZ, steps, instructions, isActive); _vm->_policeMaze->activate(); } diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index 8e7ac9e50a..5e1e160498 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -209,7 +209,7 @@ protected: float World_Waypoint_Query_Z(int waypointId); void Combat_Cover_Waypoint_Set_Data(int coverWaypointId, int a2, int setId, int a4, float x, float y, float z); void Combat_Flee_Waypoint_Set_Data(int fleeWaypointId, int a2, int setId, int a4, float x, float y, float z, int a8); - void Police_Maze_Target_Track_Add(int itemId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, signed int data[], bool a10); + void Police_Maze_Target_Track_Add(int itemId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, const int* instructions, bool isActive); int Police_Maze_Query_Score(); void Police_Maze_Zero_Score(); void Police_Maze_Increment_Score(int delta); |