diff options
Diffstat (limited to 'engines')
153 files changed, 2160 insertions, 932 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index eb56992f50..1c592267e0 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -34,8 +34,8 @@ #include "bladerunner/movement_track.h" #include "bladerunner/scene.h" #include "bladerunner/scene_objects.h" -#include "bladerunner/script/scene.h" -#include "bladerunner/script/ai.h" +#include "bladerunner/script/scene_script.h" +#include "bladerunner/script/ai_script.h" #include "bladerunner/set.h" #include "bladerunner/slice_animations.h" #include "bladerunner/slice_renderer.h" @@ -170,7 +170,7 @@ void Actor::changeAnimationMode(int animationMode, bool force) { } if (animationMode != _animationMode) { - _vm->_aiScripts->ChangeAnimationMode(_id, animationMode); + _vm->_aiScripts->changeAnimationMode(_id, animationMode); _animationMode = animationMode; } } @@ -229,8 +229,8 @@ void Actor::countdownTimerUpdate(int timerId) { case 0: case 1: case 2: - if (!_vm->_aiScripts->IsInsideScript() && !_vm->_sceneScript->IsInsideScript()) { - _vm->_aiScripts->TimerExpired(this->_id, timerId); + if (!_vm->_aiScripts->isInsideScript() && !_vm->_sceneScript->isInsideScript()) { + _vm->_aiScripts->timerExpired(this->_id, timerId); this->_timersRemain[timerId] = 0; } else { this->_timersRemain[timerId] = 1; @@ -311,7 +311,7 @@ void Actor::movementTrackNext(bool omitAiScript) { //return true; } else { if (!omitAiScript) { - _vm->_aiScripts->CompletedMovementTrack(_id); + _vm->_aiScripts->completedMovementTrack(_id); } //return false; } @@ -346,7 +346,7 @@ void Actor::movementTrackWaypointReached() { if (!_movementTrackDelayOnNextWaypoint) { _movementTrackDelayOnNextWaypoint = 1; } - if (_vm->_aiScripts->ReachedMovementTrackWaypoint(_id, _movementTrackWalkingToWaypointId)) { + if (_vm->_aiScripts->reachedMovementTrackWaypoint(_id, _movementTrackWalkingToWaypointId)) { seconds = _movementTrackDelayOnNextWaypoint; if (seconds > 1) { changeAnimationMode(kAnimationModeIdle, false); @@ -572,7 +572,7 @@ bool Actor::tick(bool forceDraw, Common::Rect *screenRect) { if (needsUpdate) { int newAnimation = 0, newFrame = 0; - _vm->_aiScripts->UpdateAnimation(_id, &newAnimation, &newFrame); + _vm->_aiScripts->updateAnimation(_id, &newAnimation, &newFrame); if (_animationId != newAnimation) { if (_fps != 0 && _fps != -1) { @@ -714,16 +714,16 @@ void Actor::setSetId(int setId) { if (_setId > 0) { for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) { if (_vm->_actors[i]->_id != _id && _vm->_actors[i]->_setId == _setId) { - _vm->_aiScripts->OtherAgentExitedThisScene(i, _id); + _vm->_aiScripts->otherAgentExitedThisScene(i, _id); } } } _setId = setId; - _vm->_aiScripts->EnteredScene(_id, _setId); + _vm->_aiScripts->enteredScene(_id, _setId); if (_setId > 0) { for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) { if (_vm->_actors[i]->_id != _id && _vm->_actors[i]->_setId == _setId) { - _vm->_aiScripts->OtherAgentEnteredThisScene(i, _id); + _vm->_aiScripts->otherAgentEnteredThisScene(i, _id); } } } @@ -959,7 +959,7 @@ void Actor::retire(bool retired, int width, int height, int retiredByActorId) { _vm->_playerDead = true; } if (_isRetired) { - _vm->_aiScripts->Retired(_id, retiredByActorId); + _vm->_aiScripts->retired(_id, retiredByActorId); } } @@ -1045,8 +1045,8 @@ void Actor::setGoal(int goalNumber) { return; } - _vm->_aiScripts->GoalChanged(_id, oldGoalNumber, goalNumber); - _vm->_sceneScript->ActorChangedGoal(_id, goalNumber, oldGoalNumber, _vm->_scene->getSetId() == _setId); + _vm->_aiScripts->goalChanged(_id, oldGoalNumber, goalNumber); + _vm->_sceneScript->actorChangedGoal(_id, goalNumber, oldGoalNumber, _vm->_scene->getSetId() == _setId); } int Actor::getGoal() const { @@ -1087,7 +1087,7 @@ void Actor::acquireClue(int clueId, bool unknownFlag, int fromActorId) { bool hasAlready = hasClue(clueId); _clues->acquire(clueId, unknownFlag, fromActorId); if (!hasAlready) { - _vm->_aiScripts->ReceivedClue(_id, clueId, fromActorId); + _vm->_aiScripts->receivedClue(_id, clueId, fromActorId); } } diff --git a/engines/bladerunner/actor_dialogue_queue.cpp b/engines/bladerunner/actor_dialogue_queue.cpp index 1dc7acc859..dbf5598a52 100644 --- a/engines/bladerunner/actor_dialogue_queue.cpp +++ b/engines/bladerunner/actor_dialogue_queue.cpp @@ -28,7 +28,7 @@ #include "bladerunner/audio_speech.h" #include "bladerunner/scene.h" -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -99,7 +99,7 @@ void ActorDialogueQueue::flush(int a1, bool callScript) { } clear(); if (callScript) { - _vm->_sceneScript->DialogueQueueFlushed(a1); + _vm->_sceneScript->dialogueQueueFlushed(a1); } } diff --git a/engines/bladerunner/ambient_sounds.cpp b/engines/bladerunner/ambient_sounds.cpp index 27ab61f74f..64a85bc46c 100644 --- a/engines/bladerunner/ambient_sounds.cpp +++ b/engines/bladerunner/ambient_sounds.cpp @@ -117,7 +117,7 @@ void AmbientSounds::addSpeech(int actorId, int sentenceId, int timeMin, int time void AmbientSounds::playSound(int sfxId, int volume, int panStart, int panEnd, int priority) { const char *name = _vm->_gameInfo->getSfxTrack(sfxId); - _vm->_audioPlayer->playAud(name, volume * _ambientVolume / 100, panStart, panEnd, priority, AudioPlayer::OVERRIDE_VOLUME); + _vm->_audioPlayer->playAud(name, volume * _ambientVolume / 100, panStart, panEnd, priority, kAudioPlayerOverrideVolume); } void AmbientSounds::addLoopingSound(int sfxId, int volume, int pan, int delay) { @@ -149,7 +149,7 @@ void AmbientSounds::addLoopingSound(int sfxId, int volume, int pan, int delay) { actualVolumeStart = 0; } - track.audioPlayerTrack = _vm->_audioPlayer->playAud(name, actualVolumeStart, pan, pan, 99, AudioPlayer::LOOP | AudioPlayer::OVERRIDE_VOLUME); + track.audioPlayerTrack = _vm->_audioPlayer->playAud(name, actualVolumeStart, pan, pan, 99, kAudioPlayerLoop | kAudioPlayerOverrideVolume); if (track.audioPlayerTrack == -1) { removeLoopingSoundByIndex(i, 0); @@ -212,14 +212,12 @@ void AmbientSounds::tick() { track.volume = _vm->_rnd.getRandomNumberRng(track.volumeMin, track.volumeMax); - track.audioPlayerTrack = _vm->_audioPlayer->playAud( - track.name, - track.volume * _ambientVolume / 100, - panStart, - panEnd, - track.priority, - AudioPlayer::OVERRIDE_VOLUME - ); + track.audioPlayerTrack = _vm->_audioPlayer->playAud(track.name, + track.volume * _ambientVolume / 100, + panStart, + panEnd, + track.priority, + kAudioPlayerOverrideVolume); track.nextPlayTime = now + _vm->_rnd.getRandomNumberRng(track.timeMin, track.timeMax); } @@ -233,7 +231,7 @@ void AmbientSounds::setVolume(int volume) { if (_vm->_audioPlayer->isActive(_loopingSounds[i].audioPlayerTrack)) { _vm->_audioPlayer->adjustVolume(_loopingSounds[i].audioPlayerTrack, newVolume, 1, false); } else { - _loopingSounds[i].audioPlayerTrack = _vm->_audioPlayer->playAud(_loopingSounds[i].name, 1, _loopingSounds[i].pan, _loopingSounds[i].pan, 99, AudioPlayer::LOOP | AudioPlayer::OVERRIDE_VOLUME); + _loopingSounds[i].audioPlayerTrack = _vm->_audioPlayer->playAud(_loopingSounds[i].name, 1, _loopingSounds[i].pan, _loopingSounds[i].pan, 99, kAudioPlayerLoop | kAudioPlayerOverrideVolume); if (_loopingSounds[i].audioPlayerTrack == -1) { removeLoopingSound(i, 0); } else { diff --git a/engines/bladerunner/audio_player.cpp b/engines/bladerunner/audio_player.cpp index 7aeba9c188..e1ef0263b6 100644 --- a/engines/bladerunner/audio_player.cpp +++ b/engines/bladerunner/audio_player.cpp @@ -274,7 +274,7 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in AudStream *audioStream = new AudStream(_cache, hash); int actualVolume = volume; - if (!(flags & OVERRIDE_VOLUME)) { + if (!(flags & kAudioPlayerOverrideVolume)) { actualVolume = _sfxVolume * volume / 100; } @@ -284,7 +284,7 @@ int AudioPlayer::playAud(const Common::String &name, int volume, int panFrom, in Audio::Mixer::kPlainSoundType, audioStream, priority, - flags & LOOP, + flags & kAudioPlayerLoop, actualVolume, panFrom, mixerChannelEnded, diff --git a/engines/bladerunner/audio_player.h b/engines/bladerunner/audio_player.h index a75f633633..07bfb56461 100644 --- a/engines/bladerunner/audio_player.h +++ b/engines/bladerunner/audio_player.h @@ -70,6 +70,12 @@ public: void decRef(int32 hash); }; + +enum AudioPlayerFlags { + kAudioPlayerLoop = 1, + kAudioPlayerOverrideVolume = 2 +}; + class AudioPlayer { static const int kTracks = 6; @@ -94,11 +100,6 @@ public: AudioPlayer(BladeRunnerEngine *vm); ~AudioPlayer(); - enum { - LOOP = 1, - OVERRIDE_VOLUME = 2 - }; - int playAud(const Common::String &name, int volume, int panStart, int panEnd, int priority, byte flags = 0); bool isActive(int track) const; void stop(int track, bool immediately); diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index c35955e3a6..df657065f7 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -49,10 +49,10 @@ #include "bladerunner/scene_objects.h" #include "bladerunner/screen_effects.h" #include "bladerunner/set.h" -#include "bladerunner/script/ai.h" -#include "bladerunner/script/init.h" -#include "bladerunner/script/kia.h" -#include "bladerunner/script/scene.h" +#include "bladerunner/script/ai_script.h" +#include "bladerunner/script/init_script.h" +#include "bladerunner/script/kia_script.h" +#include "bladerunner/script/scene_script.h" #include "bladerunner/settings.h" #include "bladerunner/shape.h" #include "bladerunner/slice_animations.h" @@ -63,6 +63,7 @@ #include "bladerunner/ui/esper.h" #include "bladerunner/ui/kia.h" #include "bladerunner/ui/spinner.h" +#include "bladerunner/ui/vk.h" #include "bladerunner/vqa_decoder.h" #include "bladerunner/waypoints.h" #include "bladerunner/zbuffer.h" @@ -396,7 +397,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { _esper = new ESPER(this); - // TODO: VK + _vk = new VK(this); _mouse = new Mouse(this); // _mouse->setCursorPosition(320, 240); @@ -428,7 +429,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { _scene = new Scene(this); // Load INIT.DLL - ScriptInit initScript(this); + InitScript initScript(this); initScript.SCRIPT_Initialize_Game(); // TODO: Load AI-ACT1.DLL @@ -442,7 +443,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { void BladeRunnerEngine::initChapterAndScene() { // TODO: Init actors... for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) { - _aiScripts->Initialize(i); + _aiScripts->initialize(i); } for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) { @@ -463,7 +464,8 @@ void BladeRunnerEngine::shutdown() { // TODO: Write BLADE.INI - // TODO: Shutdown VK + delete _vk; + _vk = nullptr; delete _esper; _esper = nullptr; @@ -569,7 +571,6 @@ void BladeRunnerEngine::shutdown() { // TODO: Delete sine and cosine lookup tables - // TODO: Unload AI dll delete _aiScripts; _aiScripts = nullptr; @@ -585,7 +586,8 @@ void BladeRunnerEngine::shutdown() { // TODO: Delete Scores - // TODO: Delete Elevators + delete _elevator; + _elevator = nullptr; delete _spinner; _spinner = nullptr; @@ -683,6 +685,10 @@ Common::Point BladeRunnerEngine::getMousePos() const { return p; } +bool BladeRunnerEngine::isMouseButtonDown() const { + return _eventMan->getButtonState() != 0; +} + void BladeRunnerEngine::gameLoop() { _gameIsRunning = true; do { @@ -726,7 +732,7 @@ void BladeRunnerEngine::gameTick() { if (_gameIsRunning && _windowIsActive) { // TODO: Only run if not in Kia, script, nor AI - if (!_sceneScript->IsInsideScript() && !_aiScripts->IsInsideScript()) { + if (!_sceneScript->isInsideScript() && !_aiScripts->isInsideScript()) { _settings->openNewScene(); } @@ -751,7 +757,11 @@ void BladeRunnerEngine::gameTick() { return; } - // TODO: VK + if (_vk->isOpen()) { + _vk->tick(); + _ambientSounds->tick(); + return; + } if (_elevator->isOpen()) { _elevator->tick(); @@ -763,7 +773,7 @@ void BladeRunnerEngine::gameTick() { _actorDialogueQueue->tick(); if (_scene->didPlayerWalkIn()) { - _sceneScript->PlayerWalkedIn(); + _sceneScript->playerWalkedIn(); } bool inDialogueMenu = _dialogueMenu->isVisible(); if (!inDialogueMenu) { @@ -778,7 +788,7 @@ void BladeRunnerEngine::gameTick() { bool backgroundChanged = false; int frame = _scene->advanceFrame(); if (frame >= 0) { - _sceneScript->SceneFrameAdvanced(frame); + _sceneScript->sceneFrameAdvanced(frame); backgroundChanged = true; } (void)backgroundChanged; @@ -793,7 +803,7 @@ void BladeRunnerEngine::gameTick() { actorsUpdate(); } - if (_settings->getNewScene() == -1 || _sceneScript->IsInsideScript() || _aiScripts->IsInsideScript()) { + if (_settings->getNewScene() == -1 || _sceneScript->isInsideScript() || _aiScripts->isInsideScript()) { _sliceRenderer->setView(*_view); // Tick and draw all actors in current set @@ -982,11 +992,11 @@ void BladeRunnerEngine::actorsUpdate() { int setId = _scene->getSetId(); //TODO: original game updates every non-visible characters by updating only one character in one frame - if (setId != 89 || _gameVars[1] != 4 || _gameFlags->query(670) != 1 || !_aiScripts->IsInsideScript()) { + if (setId != 89 || _gameVars[1] != 4 || _gameFlags->query(670) != 1 || !_aiScripts->isInsideScript()) { for (int i = 0; i < actorCount; i++) { Actor *actor = _actors[i]; if (actor->getSetId() == setId) { - _aiScripts->Update(i); + _aiScripts->update(i); actor->countdownTimersUpdate(); } } @@ -1056,6 +1066,10 @@ void BladeRunnerEngine::handleKeyUp(Common::Event &event) { return; } + if (_vk->isOpen()) { + return; + } + if (_dialogueMenu->isOpen()) { return; } @@ -1078,7 +1092,7 @@ void BladeRunnerEngine::handleKeyUp(Common::Event &event) { void BladeRunnerEngine::handleKeyDown(Common::Event &event) { //TODO: - if (!playerHasControl() /* || ActorWalkingLoop || PlayingSpeechLine || VqaIsPlaying */) { + if (!playerHasControl() /* || ActorWalkingLoop || ActorSpeaking || VqaIsPlaying */) { return; } @@ -1163,6 +1177,15 @@ void BladeRunnerEngine::handleMouseAction(int x, int y, bool buttonLeft, bool bu return; } + if (_vk->isOpen()) { + if (buttonDown) { + _vk->handleMouseDown(x, y, buttonLeft); + } else { + _vk->handleMouseUp(x, y, buttonLeft); + } + return; + } + if (_elevator->isOpen()) { if (buttonDown) { _elevator->handleMouseDown(x, y); @@ -1222,28 +1245,27 @@ void BladeRunnerEngine::handleMouseAction(int x, int y, bool buttonLeft, bool bu void BladeRunnerEngine::handleMouseClickExit(int x, int y, int exitIndex) { debug("clicked on exit %d %d %d", exitIndex, x, y); - _sceneScript->ClickedOnExit(exitIndex); + _sceneScript->clickedOnExit(exitIndex); } void BladeRunnerEngine::handleMouseClickRegion(int x, int y, int regionIndex) { debug("clicked on region %d %d %d", regionIndex, x, y); - _sceneScript->ClickedOn2DRegion(regionIndex); + _sceneScript->clickedOn2DRegion(regionIndex); } void BladeRunnerEngine::handleMouseClick3DObject(int x, int y, int objectId, bool isClickable, bool isTarget) { const char *objectName = _scene->objectGetName(objectId); debug("Clicked on object %s", objectName); - _sceneScript->ClickedOn3DObject(objectName, false); + _sceneScript->clickedOn3DObject(objectName, false); } void BladeRunnerEngine::handleMouseClickEmpty(int x, int y, Vector3 &mousePosition) { - bool sceneMouseClick = _sceneScript->MouseClick(x, y); + bool sceneMouseClick = _sceneScript->mouseClick(x, y); if (sceneMouseClick) { return; } - bool isRunning; debug("Clicked on nothing %f, %f, %f", mousePosition.x, mousePosition.y, mousePosition.z); _playerActor->loopWalkToXYZ(mousePosition, 0, false, false, false, &isRunning); @@ -1251,14 +1273,14 @@ void BladeRunnerEngine::handleMouseClickEmpty(int x, int y, Vector3 &mousePositi void BladeRunnerEngine::handleMouseClickItem(int x, int y, int itemId) { debug("Clicked on item %d", itemId); - _sceneScript->ClickedOnItem(itemId, false); + _sceneScript->clickedOnItem(itemId, false); } void BladeRunnerEngine::handleMouseClickActor(int x, int y, int actorId) { debug("Clicked on actor %d", actorId); - bool t = _sceneScript->ClickedOnActor(actorId); + bool t = _sceneScript->clickedOnActor(actorId); if (!_combat->isActive() && !t) { - _aiScripts->ClickedByPlayer(actorId); + _aiScripts->clickedByPlayer(actorId); } } diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h index fd72cf8f99..40ac1df3bf 100644 --- a/engines/bladerunner/bladerunner.h +++ b/engines/bladerunner/bladerunner.h @@ -84,6 +84,7 @@ class TextResource; class KIAShapes; class Vector3; class View; +class VK; class Waypoints; class ZBuffer; @@ -131,6 +132,7 @@ public: Spinner *_spinner; SuspectsDatabase *_suspectsDatabase; View *_view; + VK *_vk; Waypoints *_waypoints; int *_gameVars; @@ -191,6 +193,7 @@ public: bool init2(); Common::Point getMousePos() const; + bool isMouseButtonDown() const; void gameLoop(); void gameTick(); diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index f4c00a8d49..c74adf0b1e 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -439,6 +439,9 @@ enum SpinnerDestinations { }; enum Flags { + kFlagRC02Discovered = 1, + kFlagGotOfficersStatement = 3, + kFlagRC01toRC02 = 8, kFlagRC02toRC01 = 9, kFlagIntroPlayed = 24, kFlagMA02toMA06 = 33, @@ -447,14 +450,33 @@ enum Flags { kFlagMA04ToMA02 = 36, kFlagMA01toMA06 = 37, kFlagMA06toMA01 = 38, + kFlagIzoIsReplicant = 44, + kFlagGordoIsReplicant = 45, + kFlagLucyIsReplicant = 46, + kFlagDektoraIsReplicant = 47, + kFlagSadikIsReplicant = 48, kFlagMA07toMA06 = 57, kFlagMA06toMA07 = 58, kFlagMA04toMA05 = 62, kFlagMA05toMA04 = 63, kFlagRC03toRC01 = 114, + kFlagRC01toRC03 = 115, + kFlagChromeDebrisTaken = 163, kFlagRC01PoliceDone = 186, - kFlagMA01Locked = 250, + kFlagShellCasingsTaken = 190, + kFlagSpinnerToCT01 = 248, + kFlagSpinnerToRC01 = 249, + kFlagSpinnerToMA01 = 250, + kFlagSpinnerToPS01 = 251, + kFlagSpinnerToAR01 = 252, + kFlagSpinnerToDR01 = 253, + kFlagSpinnerToBB01 = 254, + kFlagSpinnerToNR01 = 255, + kFlagSpinnerToHF01 = 256, + kFlagSpinnerToTB02 = 307, kFlagDirectorsCut = 378, + KFlagMcCoyAndOfficerLearyTalking = 392, + KFlagMcCoyAndOfficerLearyArtMetaphor = 397, kFlagKIAPrivacyAddon = 487, kFlagKIAPrivacyAddonIntro = 599 }; @@ -643,6 +665,12 @@ enum Sets { kSetRunciterInterior = 16 }; +enum GameItems { + kItemChromeDebris = 66, + kItemShellCasingA = 100, + kItemShellCasingB = 101, + kItemShellCasingC = 102 +}; } // End of namespace BladeRunner diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk index 3b461d5a64..eefae18c50 100644 --- a/engines/bladerunner/module.mk +++ b/engines/bladerunner/module.mk @@ -44,17 +44,17 @@ MODULE_OBJS = \ scene_objects.o \ screen_effects.o \ script/script.o \ - script/init.o \ - script/kia.o \ - script/vk.o \ - script/esper.o \ - script/ai.o \ + script/init_script.o \ + script/kia_script.o \ + script/vk_script.o \ + script/esper_script.o \ + script/ai_script.o \ script/ai/leon.o \ script/ai/maggie.o \ script/ai/mccoy.o \ script/ai/officer_leary.o \ script/ai/runciter.o \ - script/scene.o \ + script/scene_script.o \ script/scene/ar01.o \ script/scene/ar02.o \ script/scene/bb01.o \ @@ -195,6 +195,7 @@ MODULE_OBJS = \ ui/ui_input_box.o \ ui/ui_scroll_box.o \ ui/ui_slider.o \ + ui/vk.o \ view.o \ vqa_decoder.o \ vqa_player.o \ diff --git a/engines/bladerunner/scene.cpp b/engines/bladerunner/scene.cpp index 2c4b5d0ac7..f9f49f3589 100644 --- a/engines/bladerunner/scene.cpp +++ b/engines/bladerunner/scene.cpp @@ -35,7 +35,7 @@ #include "bladerunner/set.h" #include "bladerunner/settings.h" #include "bladerunner/slice_renderer.h" -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" #include "bladerunner/ui/spinner.h" #include "bladerunner/vqa_player.h" @@ -110,12 +110,12 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { _vqaPlayer = new VQAPlayer(_vm, &_vm->_surfaceBack); - if (!_vm->_sceneScript->Open(sceneName)) { + if (!_vm->_sceneScript->open(sceneName)) { return false; } if (!isLoadingGame) { - _vm->_sceneScript->InitializeScene(); + _vm->_sceneScript->initializeScene(); } Common::String setResourceName = Common::String::format("%s-MIN.SET", sceneName.c_str()); @@ -128,7 +128,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { if (isLoadingGame) { // TODO: Advance VQA frame if (sceneId == kScenePS10 || sceneId == kScenePS11 || sceneId == kScenePS12 || sceneId == kScenePS13) { // police maze? - _vm->_sceneScript->SceneLoaded(); + _vm->_sceneScript->sceneLoaded(); } return true; } @@ -147,7 +147,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { _vm->_playerActor->setAtXYZ(_actorStartPosition, _actorStartFacing); _vm->_playerActor->setSetId(setId); - _vm->_sceneScript->SceneLoaded(); + _vm->_sceneScript->sceneLoaded(); _vm->_sceneObjects->clear(); @@ -174,7 +174,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { // TODO: calculate walking obstacles?? if (_specialLoopMode != kSceneLoopModeLoseControl) { - _vm->_sceneScript->PlayerWalkedIn(); + _vm->_sceneScript->playerWalkedIn(); } return true; @@ -188,7 +188,7 @@ bool Scene::close(bool isLoadingGame) { //_vm->_policeMaze->clear(!isLoadingGame); if (isLoadingGame) { - _vm->_sceneScript->PlayerWalkedOut(); + _vm->_sceneScript->playerWalkedOut(); } // if (SceneScript_isLoaded() && !SceneScript_unload()) { diff --git a/engines/bladerunner/script/ai/leon.cpp b/engines/bladerunner/script/ai/leon.cpp index 45e1c7423d..f1f619f382 100644 --- a/engines/bladerunner/script/ai/leon.cpp +++ b/engines/bladerunner/script/ai/leon.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/ai.h" +#include "bladerunner/script/ai_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/ai/maggie.cpp b/engines/bladerunner/script/ai/maggie.cpp index 150a2a3a0b..50e5013dab 100644 --- a/engines/bladerunner/script/ai/maggie.cpp +++ b/engines/bladerunner/script/ai/maggie.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/ai.h" +#include "bladerunner/script/ai_script.h" #include "bladerunner/vector.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 366361e365..1129ff937d 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/ai.h" +#include "bladerunner/script/ai_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp index 9b85a4cdf8..da6cdfc7e5 100644 --- a/engines/bladerunner/script/ai/officer_leary.cpp +++ b/engines/bladerunner/script/ai/officer_leary.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/ai.h" +#include "bladerunner/script/ai_script.h" namespace BladeRunner { @@ -45,7 +45,7 @@ bool AIScriptOfficerLeary::Update() { } else if (Global_Variable_Query(1) == 5 && Actor_Query_Goal_Number(kActorOfficerLeary) < 400) { AI_Movement_Track_Flush(kActorOfficerLeary); Actor_Set_Goal_Number(kActorOfficerLeary, 400); - } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(163) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) { + } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(kFlagChromeDebrisTaken) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) { Game_Flag_Set(kFlagRC01PoliceDone); Actor_Set_Goal_Number(kActorOfficerLeary, 3); } else if (Actor_Query_Goal_Number(kActorOfficerLeary) != 1 && Actor_Query_Goal_Number(kActorOfficerLeary) != 2 && Game_Flag_Query(199) == 1) { @@ -854,7 +854,7 @@ bool AIScriptOfficerLeary::UpdateAnimation(int *animation, int *frame) { *frame = var_45D5B4_animation_frame; return true; case 0: - if (Game_Flag_Query(199) && !Game_Flag_Query(392)) { + if (Game_Flag_Query(199) && !Game_Flag_Query(KFlagMcCoyAndOfficerLearyTalking)) { var_45D5B0_animation_state = 31; var_45D5B4_animation_frame = 0; *animation = 604; diff --git a/engines/bladerunner/script/ai/runciter.cpp b/engines/bladerunner/script/ai/runciter.cpp index 0c66876efb..c0c3d3ff68 100644 --- a/engines/bladerunner/script/ai/runciter.cpp +++ b/engines/bladerunner/script/ai/runciter.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/ai.h" +#include "bladerunner/script/ai_script.h" namespace BladeRunner { @@ -99,7 +99,7 @@ void AIScriptRunciter::OtherAgentEnteredCombatMode(int otherActorId, int combatM Actor_Says(kActorRunciter, 610, 18); Actor_Says(kActorMcCoy, 4785, -1); Actor_Says(kActorRunciter, 620, 15); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Says(kActorRunciter, 630, 12); Actor_Says(kActorRunciter, 640, 17); Actor_Says(kActorMcCoy, 4790, -1); diff --git a/engines/bladerunner/script/ai.cpp b/engines/bladerunner/script/ai_script.cpp index f61b0212a7..503fb733df 100644 --- a/engines/bladerunner/script/ai.cpp +++ b/engines/bladerunner/script/ai_script.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/ai.h" +#include "bladerunner/script/ai_script.h" #include "bladerunner/bladerunner.h" @@ -55,14 +55,14 @@ AIScripts::~AIScripts() { delete[] _actorUpdating; } -void AIScripts::Initialize(int actor) { +void AIScripts::initialize(int actor) { assert(actor < _actorCount); if (_AIScripts[actor]) { _AIScripts[actor]->Initialize(); } } -void AIScripts::Update(int actor) { +void AIScripts::update(int actor) { assert(actor < _actorCount); if (this->_actorUpdating[actor] != 1) { this->_actorUpdating[actor] = true; @@ -74,7 +74,7 @@ void AIScripts::Update(int actor) { } } -void AIScripts::TimerExpired(int actor, int timer) { +void AIScripts::timerExpired(int actor, int timer) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -83,7 +83,7 @@ void AIScripts::TimerExpired(int actor, int timer) { _inScriptCounter--; } -void AIScripts::CompletedMovementTrack(int actor) { +void AIScripts::completedMovementTrack(int actor) { assert(actor < _actorCount); if (!_vm->_actors[actor]->inCombat()) { _inScriptCounter++; @@ -94,7 +94,7 @@ void AIScripts::CompletedMovementTrack(int actor) { } } -void AIScripts::ReceivedClue(int actor, int clueId, int fromActorId) { +void AIScripts::receivedClue(int actor, int clueId, int fromActorId) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -103,7 +103,7 @@ void AIScripts::ReceivedClue(int actor, int clueId, int fromActorId) { _inScriptCounter--; } -void AIScripts::ClickedByPlayer(int actor) { +void AIScripts::clickedByPlayer(int actor) { assert(actor < _actorCount); if(_vm->_actors[actor]->inCombat()) { @@ -117,7 +117,7 @@ void AIScripts::ClickedByPlayer(int actor) { _inScriptCounter--; } -void AIScripts::EnteredScene(int actor, int setId) { +void AIScripts::enteredScene(int actor, int setId) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -126,7 +126,7 @@ void AIScripts::EnteredScene(int actor, int setId) { _inScriptCounter--; } -void AIScripts::OtherAgentEnteredThisScene(int actor, int otherActorId) { +void AIScripts::otherAgentEnteredThisScene(int actor, int otherActorId) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -135,7 +135,7 @@ void AIScripts::OtherAgentEnteredThisScene(int actor, int otherActorId) { _inScriptCounter--; } -void AIScripts::OtherAgentExitedThisScene(int actor, int otherActorId) { +void AIScripts::otherAgentExitedThisScene(int actor, int otherActorId) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -144,7 +144,7 @@ void AIScripts::OtherAgentExitedThisScene(int actor, int otherActorId) { _inScriptCounter--; } -void AIScripts::Retired(int actor, int retiredByActorId) { +void AIScripts::retired(int actor, int retiredByActorId) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -153,7 +153,7 @@ void AIScripts::Retired(int actor, int retiredByActorId) { _inScriptCounter--; } -void AIScripts::GoalChanged(int actor, int currentGoalNumber, int newGoalNumber) { +void AIScripts::goalChanged(int actor, int currentGoalNumber, int newGoalNumber) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -162,7 +162,7 @@ void AIScripts::GoalChanged(int actor, int currentGoalNumber, int newGoalNumber) _inScriptCounter--; } -bool AIScripts::ReachedMovementTrackWaypoint(int actor, int waypointId) { +bool AIScripts::reachedMovementTrackWaypoint(int actor, int waypointId) { assert(actor < _actorCount); bool result = false; if (!_vm->_actors[actor]->inCombat()) { @@ -175,7 +175,7 @@ bool AIScripts::ReachedMovementTrackWaypoint(int actor, int waypointId) { return result; } -void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) { +void AIScripts::updateAnimation(int actor, int *animation, int *frame) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { @@ -184,7 +184,7 @@ void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) { _inScriptCounter--; } -void AIScripts::ChangeAnimationMode(int actor, int mode) { +void AIScripts::changeAnimationMode(int actor, int mode) { assert(actor < _actorCount); _inScriptCounter++; if (_AIScripts[actor]) { diff --git a/engines/bladerunner/script/ai.h b/engines/bladerunner/script/ai_script.h index 135aef5e9c..c90d023ffb 100644 --- a/engines/bladerunner/script/ai.h +++ b/engines/bladerunner/script/ai_script.h @@ -181,22 +181,22 @@ public: AIScripts(BladeRunnerEngine *vm, int actorCount); ~AIScripts(); - void Initialize(int actor); - void Update(int actor); - void TimerExpired(int actor, int timer); - void CompletedMovementTrack(int actor); - void ReceivedClue(int actor, int clueId, int fromActorId); - void ClickedByPlayer(int actor); - void EnteredScene(int actor, int setId); - void OtherAgentEnteredThisScene(int actor, int otherActorId); - void OtherAgentExitedThisScene(int actor, int otherActorId); - void Retired(int actor, int retiredByActorId); - void GoalChanged(int actor, int currentGoalNumber, int newGoalNumber); - bool ReachedMovementTrackWaypoint(int actor, int waypointId); - void UpdateAnimation(int actor, int *animation, int *frame); - void ChangeAnimationMode(int actor, int mode); - - bool IsInsideScript() const { return _inScriptCounter > 0; } + void initialize(int actor); + void update(int actor); + void timerExpired(int actor, int timer); + void completedMovementTrack(int actor); + void receivedClue(int actor, int clueId, int fromActorId); + void clickedByPlayer(int actor); + void enteredScene(int actor, int setId); + void otherAgentEnteredThisScene(int actor, int otherActorId); + void otherAgentExitedThisScene(int actor, int otherActorId); + void retired(int actor, int retiredByActorId); + void goalChanged(int actor, int currentGoalNumber, int newGoalNumber); + bool reachedMovementTrackWaypoint(int actor, int waypointId); + void updateAnimation(int actor, int *animation, int *frame); + void changeAnimationMode(int actor, int mode); + + bool isInsideScript() const { return _inScriptCounter > 0; } }; } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/esper.cpp b/engines/bladerunner/script/esper_script.cpp index e6c0390cbb..bf369f96ae 100644 --- a/engines/bladerunner/script/esper.cpp +++ b/engines/bladerunner/script/esper_script.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/esper.h" +#include "bladerunner/script/esper_script.h" #include "bladerunner/bladerunner.h" #include "bladerunner/mouse.h" diff --git a/engines/bladerunner/script/esper.h b/engines/bladerunner/script/esper_script.h index 63e30e55e0..63e30e55e0 100644 --- a/engines/bladerunner/script/esper.h +++ b/engines/bladerunner/script/esper_script.h diff --git a/engines/bladerunner/script/init.cpp b/engines/bladerunner/script/init_script.cpp index 76ade879ad..2c0b530118 100644 --- a/engines/bladerunner/script/init.cpp +++ b/engines/bladerunner/script/init_script.cpp @@ -20,13 +20,13 @@ * */ -#include "bladerunner/script/init.h" +#include "bladerunner/script/init_script.h" #include "bladerunner/bladerunner.h" namespace BladeRunner { -void ScriptInit::SCRIPT_Initialize_Game() { +void InitScript::SCRIPT_Initialize_Game() { Assign_Player_Gun_Hit_Sounds(0, 517, 518, 519); Assign_Player_Gun_Hit_Sounds(1, 520, 521, 522); Assign_Player_Gun_Hit_Sounds(2, 523, 524, 525); @@ -54,7 +54,7 @@ void ScriptInit::SCRIPT_Initialize_Game() { Init_Shadows(); } -void ScriptInit::Init_Globals() { +void InitScript::Init_Globals() { for (int i = 0; i != 55; ++i) Global_Variable_Set(i, 0); @@ -71,38 +71,38 @@ void ScriptInit::Init_Globals() { Set_Score(6, 28); } -void ScriptInit::Init_Game_Flags() { +void InitScript::Init_Game_Flags() { for (int i = 0; i != 730; ++i) { Game_Flag_Reset(i); } if (Random_Query(1, 2) == 1) { - Game_Flag_Set(44); + Game_Flag_Set(kFlagIzoIsReplicant); } if (Random_Query(1, 2) == 1) { - Game_Flag_Set(45); + Game_Flag_Set(kFlagGordoIsReplicant); } if (Random_Query(1, 2) == 1) { - Game_Flag_Set(46); + Game_Flag_Set(kFlagLucyIsReplicant); } if (Random_Query(1, 2) == 1) { - Game_Flag_Set(47); + Game_Flag_Set(kFlagDektoraIsReplicant); } if (Random_Query(1, 2) == 1) { - Game_Flag_Set(48); + Game_Flag_Set(kFlagSadikIsReplicant); } if (Random_Query(1, 2) == 1) { Game_Flag_Set(560); } - if (!Game_Flag_Query(45) && !Game_Flag_Query(46) && !Game_Flag_Query(47)) { - Game_Flag_Set(47); + if (!Game_Flag_Query(kFlagGordoIsReplicant) && !Game_Flag_Query(kFlagLucyIsReplicant) && !Game_Flag_Query(kFlagDektoraIsReplicant)) { + Game_Flag_Set(kFlagDektoraIsReplicant); } - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Global_Variable_Set(40, 1); - } else if (Game_Flag_Query(45) && !Game_Flag_Query(46)) { + } else if (Game_Flag_Query(kFlagGordoIsReplicant) && !Game_Flag_Query(kFlagLucyIsReplicant)) { Global_Variable_Set(40, 2); - } else if (!Game_Flag_Query(45) && Game_Flag_Query(46)) { + } else if (!Game_Flag_Query(kFlagGordoIsReplicant) && Game_Flag_Query(kFlagLucyIsReplicant)) { Global_Variable_Set(40, 3); } else if (Random_Query(1, 2) == 1) { Global_Variable_Set(40, 2); @@ -111,10 +111,10 @@ void ScriptInit::Init_Game_Flags() { } Game_Flag_Set(182); - Game_Flag_Set(249); + Game_Flag_Set(kFlagSpinnerToRC01); } -void ScriptInit::Init_Clues() { +void InitScript::Init_Clues() { for (int i = 0; i != 288; ++i) { Actor_Clue_Add_To_Database(kActorMcCoy, i, 0, false, false, -1); } @@ -526,7 +526,7 @@ static ClueWeight ClueWeightsForLuther[44] = { {kClueHowieLeeInterview, 30} }; -void ScriptInit::Init_Clues2() { +void InitScript::Init_Clues2() { for (int i = 0; i != 288; ++i) { Actor_Clue_Add_To_Database(kActorVoiceOver, i, 100, false, false, -1); } @@ -1651,7 +1651,7 @@ void ScriptInit::Init_Clues2() { Actor_Clue_Add_To_Database(kActorGenwalkerC, kClueMcCoyIsABladeRunner, 65, false, false, -1); } -void ScriptInit::Init_World_Waypoints() { +void InitScript::Init_World_Waypoints() { World_Waypoint_Set(0, 7, -676.0f, -0.04f, -94.0f); World_Waypoint_Set(1, 7, -807.0f, -0.04f, 109.0f); World_Waypoint_Set(2, 15, 541.8f, 0.38f, -435.68f); @@ -2186,7 +2186,7 @@ void ScriptInit::Init_World_Waypoints() { World_Waypoint_Set(335, 102, -50.0f, 0.0f, 212.0f); } -void ScriptInit::Init_SDB() { +void InitScript::Init_SDB() { SDB_Set_Actor(kSuspectSadik, kActorSadik); SDB_Set_Sex(kSuspectSadik, 1); SDB_Add_MO_Clue(kSuspectSadik, kClueCrystalsCase); @@ -2367,7 +2367,7 @@ void ScriptInit::Init_SDB() { SDB_Add_Photo_Clue(kSuspectGuzza, kClueGuzza, 27); } -void ScriptInit::Init_CDB() { +void InitScript::Init_CDB() { CDB_Set_Crime(kClueOfficersStatement, kCrimeAnimalMurder); CDB_Set_Crime(kClueDoorForced1, kCrimeAnimalMurder); CDB_Set_Crime(kClueDoorForced2, kCrimeAnimalMurder); @@ -2657,7 +2657,7 @@ void ScriptInit::Init_CDB() { CDB_Set_Clue_Asset_Type(kClueFolder, kClueTypeObject); } -void ScriptInit::Init_Spinner() { +void InitScript::Init_Spinner() { Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationPoliceStation, true); Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationMcCoysApartment, true); Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationRuncitersAnimals, true); @@ -2670,7 +2670,7 @@ void ScriptInit::Init_Spinner() { Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationHysteriaHall, false); } -void ScriptInit::Init_Actor_Friendliness() { +void InitScript::Init_Actor_Friendliness() { Actor_Set_Friendliness_To_Other(kActorSteele, kActorMcCoy, 65); Actor_Set_Friendliness_To_Other(kActorSteele, kActorGuzza, 60); Actor_Set_Friendliness_To_Other(kActorSteele, kActorGrigorian, 30); @@ -2800,7 +2800,7 @@ void ScriptInit::Init_Actor_Friendliness() { Actor_Set_Friendliness_To_Other(kActorGaff, kActorSergeantWalls, 70); } -void ScriptInit::Init_Actor_Combat_Aggressiveness() { +void InitScript::Init_Actor_Combat_Aggressiveness() { Actor_Set_Combat_Aggressiveness(kActorGuzza, 50); Actor_Set_Combat_Aggressiveness(kActorBulletBob, 50); Actor_Set_Combat_Aggressiveness(kActorTyrellGuard, 50); @@ -2820,11 +2820,11 @@ void ScriptInit::Init_Actor_Combat_Aggressiveness() { Actor_Set_Combat_Aggressiveness(kActorFreeSlotA, 100); } -void ScriptInit::Init_Actor_Honesty() { +void InitScript::Init_Actor_Honesty() { Actor_Set_Honesty(kActorZuben, 90); } -void ScriptInit::Init_Actor_Intelligence() { +void InitScript::Init_Actor_Intelligence() { Actor_Set_Intelligence(kActorZuben, 20); Actor_Set_Intelligence(kActorGordo, 70); Actor_Set_Intelligence(kActorLucy, 60); @@ -2841,11 +2841,11 @@ void ScriptInit::Init_Actor_Intelligence() { Actor_Set_Intelligence(kActorFreeSlotA, 10); } -void ScriptInit::Init_Actor_Stability() { +void InitScript::Init_Actor_Stability() { Actor_Set_Stability(kActorZuben, 35); } -void ScriptInit::Init_Actor_Health() { +void InitScript::Init_Actor_Health() { Actor_Set_Health(kActorMcCoy, 50, 50); Actor_Set_Health(kActorSteele, 50, 50); Actor_Set_Health(kActorGordo, 50, 50); @@ -2925,24 +2925,24 @@ void ScriptInit::Init_Actor_Health() { Actor_Set_Health(kActorMutant3, 20, 20); Actor_Set_Health(kActorFreeSlotA, 20, 20); Actor_Set_Health(kActorFreeSlotB, 20, 20); - if (Game_Flag_Query(45) == 1) { + if (Game_Flag_Query(kFlagGordoIsReplicant)) { Actor_Set_Health(kActorGordo, 60, 60); } - if (Game_Flag_Query(46) == 1) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Set_Health(kActorLucy, 40, 40); } - if (Game_Flag_Query(44) == 1) { + if (Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Set_Health(kActorIzo, 65, 65); } - if (Game_Flag_Query(47) == 1) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Set_Health(kActorDektora, 70, 70); } - if (Game_Flag_Query(48) == 1) { + if (Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Set_Health(kActorSadik, 80, 80); } } -void ScriptInit::Init_Combat_Cover_Waypoints() { +void InitScript::Init_Combat_Cover_Waypoints() { Combat_Cover_Waypoint_Set_Data(0, 0, 7, 25, -603.0f, 0.0f, 32.0f); Combat_Cover_Waypoint_Set_Data(1, 0, 7, 25, -670.0f, 0.0f, -24.0f); Combat_Cover_Waypoint_Set_Data(2, 0, 7, 25, -604.0f, 0.0f, -96.0f); @@ -2982,7 +2982,7 @@ void ScriptInit::Init_Combat_Cover_Waypoints() { Combat_Cover_Waypoint_Set_Data(36, 20, 41, 38, 357.81f, 40.63f, 387.9f); } -void ScriptInit::Init_Combat_Flee_Waypoints() { +void InitScript::Init_Combat_Flee_Waypoints() { Combat_Flee_Waypoint_Set_Data(0, 4, 37, 34, 187.0f, 8.0f, -197.0f, -1); Combat_Flee_Waypoint_Set_Data(1, 4, 37, 34, 454.0f, 8.0f, -717.0f, -1); Combat_Flee_Waypoint_Set_Data(2, 4, 38, 35, -10.87f, 47.76f, -141.32f, -1); @@ -3062,7 +3062,7 @@ void ScriptInit::Init_Combat_Flee_Waypoints() { Combat_Flee_Waypoint_Set_Data(76, 20, 41, 38, 435.13f, 37.18f, -292.34f, -1); } -void ScriptInit::Init_Shadows() { +void InitScript::Init_Shadows() { int list[] = {440, 37, 38, 83, 874}; Disable_Shadows(list, 5); } diff --git a/engines/bladerunner/script/init.h b/engines/bladerunner/script/init_script.h index 7b95008abb..15069f165c 100644 --- a/engines/bladerunner/script/init.h +++ b/engines/bladerunner/script/init_script.h @@ -29,9 +29,9 @@ namespace BladeRunner { class BladeRunnerEngine; -class ScriptInit : ScriptBase { +class InitScript : ScriptBase { public: - ScriptInit(BladeRunnerEngine *vm) + InitScript(BladeRunnerEngine *vm) : ScriptBase(vm) { } diff --git a/engines/bladerunner/script/kia.cpp b/engines/bladerunner/script/kia_script.cpp index e2db62f463..44d5666592 100644 --- a/engines/bladerunner/script/kia.cpp +++ b/engines/bladerunner/script/kia_script.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/kia.h" +#include "bladerunner/script/kia_script.h" #include "bladerunner/bladerunner.h" #include "bladerunner/mouse.h" @@ -216,7 +216,7 @@ void KIAScript::SCRIPT_KIA_DLL_Play_Clue_Asset_Script(int notUsed, int clueId) { case kClueDetonatorWire: KIA_Play_Slice_Model(974); KIA_Play_Actor_Dialogue(kActorVoiceOver, 2320); - if (Game_Flag_Query(48)) { + if (Game_Flag_Query(kFlagSadikIsReplicant)) { KIA_Play_Actor_Dialogue(kActorVoiceOver, 2330); KIA_Play_Actor_Dialogue(kActorVoiceOver, 2340); } diff --git a/engines/bladerunner/script/kia.h b/engines/bladerunner/script/kia_script.h index f134f8cdff..f134f8cdff 100644 --- a/engines/bladerunner/script/kia.h +++ b/engines/bladerunner/script/kia_script.h diff --git a/engines/bladerunner/script/scene/ar01.cpp b/engines/bladerunner/script/scene/ar01.cpp index 080f67a5e4..d6c33b1913 100644 --- a/engines/bladerunner/script/scene/ar01.cpp +++ b/engines/bladerunner/script/scene/ar01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -35,7 +35,7 @@ void SceneScriptAR01::InitializeScene() { } Scene_Exit_Add_2D_Exit(0, 134, 165, 177, 290, 3); Scene_Exit_Add_2D_Exit(1, 319, 0, 639, 207, 0); - if (Game_Flag_Query(252)) { + if (Game_Flag_Query(kFlagSpinnerToAR01)) { Scene_Exit_Add_2D_Exit(2, 0, 404, 99, 479, 2); } Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); @@ -67,22 +67,22 @@ void SceneScriptAR01::InitializeScene() { Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(252) && !Game_Flag_Query(321) && !Game_Flag_Query(323)) { + if (Game_Flag_Query(kFlagSpinnerToAR01) && !Game_Flag_Query(321) && !Game_Flag_Query(323)) { Actor_Set_Invisible(kActorMcCoy, true); Game_Flag_Set(273); Scene_Loop_Start_Special(0, 1, 0); Scene_Loop_Set_Default(2); - } else if (Game_Flag_Query(252) && Game_Flag_Query(321)) { + } else if (Game_Flag_Query(kFlagSpinnerToAR01) && Game_Flag_Query(321)) { Scene_Loop_Start_Special(0, 0, 0); Scene_Loop_Set_Default(2); Game_Flag_Reset(321); - } else if (!Game_Flag_Query(252) && Game_Flag_Query(321)) { + } else if (!Game_Flag_Query(kFlagSpinnerToAR01) && Game_Flag_Query(321)) { Scene_Loop_Start_Special(0, 6, 0); Scene_Loop_Set_Default(7); Game_Flag_Reset(321); - } else if (Game_Flag_Query(252) && Game_Flag_Query(323)) { + } else if (Game_Flag_Query(kFlagSpinnerToAR01) && Game_Flag_Query(323)) { Scene_Loop_Set_Default(2); - } else if (!Game_Flag_Query(252) && Game_Flag_Query(323)) { + } else if (!Game_Flag_Query(kFlagSpinnerToAR01) && Game_Flag_Query(323)) { Scene_Loop_Set_Default(7); } else { Scene_Loop_Set_Default(7); @@ -227,64 +227,64 @@ bool SceneScriptAR01::ClickedOnExit(int exitId) { switch (spinnerDest) { case 0: Game_Flag_Set(178); - Game_Flag_Reset(252); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); Scene_Loop_Start_Special(1, 5, 1); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(252); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); Scene_Loop_Start_Special(1, 5, 1); break; case 2: Game_Flag_Set(182); - Game_Flag_Reset(252); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(1, 5, 1); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(252); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); Scene_Loop_Start_Special(1, 5, 1); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(252); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(1, 5, 1); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(252); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(1, 5, 1); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(252); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); Scene_Loop_Start_Special(1, 5, 1); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(252); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); Scene_Loop_Start_Special(1, 5, 1); break; case 9: Game_Flag_Set(257); - Game_Flag_Reset(252); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToAR01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); Scene_Loop_Start_Special(1, 5, 1); break; diff --git a/engines/bladerunner/script/scene/ar02.cpp b/engines/bladerunner/script/scene/ar02.cpp index 614f345076..72ec31fdb1 100644 --- a/engines/bladerunner/script/scene/ar02.cpp +++ b/engines/bladerunner/script/scene/ar02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -62,11 +62,11 @@ void SceneScriptAR02::InitializeScene() { Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(252) && Game_Flag_Query(320)) { + if (Game_Flag_Query(kFlagSpinnerToAR01) && Game_Flag_Query(320)) { Scene_Loop_Start_Special(0, 1, 0); Scene_Loop_Set_Default(2); Game_Flag_Reset(320); - } else if (!Game_Flag_Query(252) && Game_Flag_Query(320)) { + } else if (!Game_Flag_Query(kFlagSpinnerToAR01) && Game_Flag_Query(320)) { Scene_Loop_Start_Special(0, 0, 0); Scene_Loop_Set_Default(2); Game_Flag_Reset(320); diff --git a/engines/bladerunner/script/scene/bb01.cpp b/engines/bladerunner/script/scene/bb01.cpp index 2c746a769c..5bc75907c0 100644 --- a/engines/bladerunner/script/scene/bb01.cpp +++ b/engines/bladerunner/script/scene/bb01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -34,7 +34,7 @@ void SceneScriptBB01::InitializeScene() { } Scene_Exit_Add_2D_Exit(0, 0, 0, 72, 299, 3); Scene_Exit_Add_2D_Exit(1, 151, 218, 322, 290, 3); - if (Game_Flag_Query(254)) { + if (Game_Flag_Query(kFlagSpinnerToBB01)) { Scene_Exit_Add_2D_Exit(2, 0, 311, 312, 479, 2); } Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); @@ -51,12 +51,12 @@ void SceneScriptBB01::InitializeScene() { Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - if (Game_Flag_Query(254) && !Game_Flag_Query(265) && !Game_Flag_Query(263)) { + if (Game_Flag_Query(kFlagSpinnerToBB01) && !Game_Flag_Query(265) && !Game_Flag_Query(263)) { Scene_Loop_Start_Special(0, 0, 0); Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(254) && Game_Flag_Query(265)) { + } else if (Game_Flag_Query(kFlagSpinnerToBB01) && Game_Flag_Query(265)) { Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(254) && Game_Flag_Query(263)) { + } else if (Game_Flag_Query(kFlagSpinnerToBB01) && Game_Flag_Query(263)) { Scene_Loop_Set_Default(1); } else { Scene_Loop_Set_Default(5); @@ -112,64 +112,64 @@ bool SceneScriptBB01::ClickedOnExit(int exitId) { switch (spinnerDest) { case 0: Game_Flag_Set(178); - Game_Flag_Reset(254); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); Scene_Loop_Start_Special(1, 4, 1); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(254); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); Scene_Loop_Start_Special(1, 4, 1); break; case 2: Game_Flag_Set(182); - Game_Flag_Reset(254); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(1, 4, 1); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(254); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); Scene_Loop_Start_Special(1, 4, 1); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(254); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(1, 4, 1); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(254); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); Scene_Loop_Start_Special(1, 4, 1); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(254); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(1, 4, 1); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(254); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); Scene_Loop_Start_Special(1, 4, 1); break; case 9: Game_Flag_Set(257); - Game_Flag_Reset(254); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToBB01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); Scene_Loop_Start_Special(1, 4, 1); break; diff --git a/engines/bladerunner/script/scene/bb02.cpp b/engines/bladerunner/script/scene/bb02.cpp index cd182003aa..a507f4dd67 100644 --- a/engines/bladerunner/script/scene/bb02.cpp +++ b/engines/bladerunner/script/scene/bb02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb03.cpp b/engines/bladerunner/script/scene/bb03.cpp index dccbfe0dab..c2444c1daa 100644 --- a/engines/bladerunner/script/scene/bb03.cpp +++ b/engines/bladerunner/script/scene/bb03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb04.cpp b/engines/bladerunner/script/scene/bb04.cpp index 7f770a50e5..60aa69b489 100644 --- a/engines/bladerunner/script/scene/bb04.cpp +++ b/engines/bladerunner/script/scene/bb04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb05.cpp b/engines/bladerunner/script/scene/bb05.cpp index 82957b28a5..e0919ed579 100644 --- a/engines/bladerunner/script/scene/bb05.cpp +++ b/engines/bladerunner/script/scene/bb05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb06.cpp b/engines/bladerunner/script/scene/bb06.cpp index 50cdb37f8a..cce94c1e6b 100644 --- a/engines/bladerunner/script/scene/bb06.cpp +++ b/engines/bladerunner/script/scene/bb06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb07.cpp b/engines/bladerunner/script/scene/bb07.cpp index 351448fa6c..82710928d8 100644 --- a/engines/bladerunner/script/scene/bb07.cpp +++ b/engines/bladerunner/script/scene/bb07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb08.cpp b/engines/bladerunner/script/scene/bb08.cpp index 298f53a9bc..1d85ecabcd 100644 --- a/engines/bladerunner/script/scene/bb08.cpp +++ b/engines/bladerunner/script/scene/bb08.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb09.cpp b/engines/bladerunner/script/scene/bb09.cpp index bcea82f29b..3a12551ec3 100644 --- a/engines/bladerunner/script/scene/bb09.cpp +++ b/engines/bladerunner/script/scene/bb09.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb10.cpp b/engines/bladerunner/script/scene/bb10.cpp index aec9161c4b..c90456abf3 100644 --- a/engines/bladerunner/script/scene/bb10.cpp +++ b/engines/bladerunner/script/scene/bb10.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb11.cpp b/engines/bladerunner/script/scene/bb11.cpp index 3e9aec34b4..faa4a6e8a8 100644 --- a/engines/bladerunner/script/scene/bb11.cpp +++ b/engines/bladerunner/script/scene/bb11.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb12.cpp b/engines/bladerunner/script/scene/bb12.cpp index 8d49377875..29795bdea2 100644 --- a/engines/bladerunner/script/scene/bb12.cpp +++ b/engines/bladerunner/script/scene/bb12.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/bb51.cpp b/engines/bladerunner/script/scene/bb51.cpp index 45eeab4774..9314b371b5 100644 --- a/engines/bladerunner/script/scene/bb51.cpp +++ b/engines/bladerunner/script/scene/bb51.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct01.cpp b/engines/bladerunner/script/scene/ct01.cpp index 0fe5bf9831..330339e528 100644 --- a/engines/bladerunner/script/scene/ct01.cpp +++ b/engines/bladerunner/script/scene/ct01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -37,13 +37,13 @@ void SceneScriptCT01::InitializeScene() { Game_Flag_Reset(88); Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 28); if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - if (Game_Flag_Query(248)) { + if (Game_Flag_Query(kFlagSpinnerToCT01)) { Scene_Loop_Start_Special(0, 0, 0); } else { Scene_Loop_Start_Special(0, 6, 0); } } - } else if (Game_Flag_Query(248)) { + } else if (Game_Flag_Query(kFlagSpinnerToCT01)) { Setup_Scene_Information(-530.0f, -6.5f, 241.0f, 506); Game_Flag_Set(247); } else { @@ -56,7 +56,7 @@ void SceneScriptCT01::InitializeScene() { if (Game_Flag_Query(94)) { Scene_Exit_Add_2D_Exit(2, 506, 400, 639, 479, 2); } - if (Game_Flag_Query(248)) { + if (Game_Flag_Query(kFlagSpinnerToCT01)) { Scene_Exit_Add_2D_Exit(3, 0, 286, 158, 350, 2); } Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); @@ -75,7 +75,7 @@ void SceneScriptCT01::InitializeScene() { Ambient_Sounds_Add_Sound(375, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(248)) { + if (Game_Flag_Query(kFlagSpinnerToCT01)) { Scene_Loop_Set_Default(2); } else { Scene_Loop_Set_Default(7); @@ -243,72 +243,72 @@ bool SceneScriptCT01::ClickedOnExit(int exitId) { case 0: Game_Flag_Set(178); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); Scene_Loop_Start_Special(1, 5, 1); break; case 1: Game_Flag_Set(179); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); Scene_Loop_Start_Special(1, 5, 1); break; case 2: Game_Flag_Set(182); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(1, 5, 1); break; case 4: Game_Flag_Set(180); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); Scene_Loop_Start_Special(1, 5, 1); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(248); + Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Reset(247); - Game_Flag_Set(307); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(1, 5, 1); break; case 6: Game_Flag_Set(177); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(1, 5, 1); break; case 7: Game_Flag_Set(258); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); Scene_Loop_Start_Special(1, 5, 1); break; case 8: Game_Flag_Set(181); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); Scene_Loop_Start_Special(1, 5, 1); break; case 9: Game_Flag_Set(257); Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToCT01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); Scene_Loop_Start_Special(1, 5, 1); break; diff --git a/engines/bladerunner/script/scene/ct02.cpp b/engines/bladerunner/script/scene/ct02.cpp index 85c8fcb818..e94e0ba719 100644 --- a/engines/bladerunner/script/scene/ct02.cpp +++ b/engines/bladerunner/script/scene/ct02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct03.cpp b/engines/bladerunner/script/scene/ct03.cpp index a43cdace98..3a9a46cd2d 100644 --- a/engines/bladerunner/script/scene/ct03.cpp +++ b/engines/bladerunner/script/scene/ct03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct04.cpp b/engines/bladerunner/script/scene/ct04.cpp index 598be6c1b2..fd7afa56fb 100644 --- a/engines/bladerunner/script/scene/ct04.cpp +++ b/engines/bladerunner/script/scene/ct04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct05.cpp b/engines/bladerunner/script/scene/ct05.cpp index 2522b1d100..0416883819 100644 --- a/engines/bladerunner/script/scene/ct05.cpp +++ b/engines/bladerunner/script/scene/ct05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct06.cpp b/engines/bladerunner/script/scene/ct06.cpp index d04dccf5ed..1bb00c1ca1 100644 --- a/engines/bladerunner/script/scene/ct06.cpp +++ b/engines/bladerunner/script/scene/ct06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct07.cpp b/engines/bladerunner/script/scene/ct07.cpp index 42bbcc4942..2eb7805c44 100644 --- a/engines/bladerunner/script/scene/ct07.cpp +++ b/engines/bladerunner/script/scene/ct07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct08.cpp b/engines/bladerunner/script/scene/ct08.cpp index e2e6203a0b..a0c989de9e 100644 --- a/engines/bladerunner/script/scene/ct08.cpp +++ b/engines/bladerunner/script/scene/ct08.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -29,9 +29,9 @@ void SceneScriptCT08::InitializeScene() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); Outtake_Play(kOuttakeMovieB1, false, -1); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Outtake_Play(kOuttakeMovieB2, false, -1); - } else if (Game_Flag_Query(47)) { + } else if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Outtake_Play(kOuttakeMovieB3, false, -1); } else { Outtake_Play(kOuttakeMovieB4, false, -1); diff --git a/engines/bladerunner/script/scene/ct09.cpp b/engines/bladerunner/script/scene/ct09.cpp index 10b0a77f9c..40a7706b3a 100644 --- a/engines/bladerunner/script/scene/ct09.cpp +++ b/engines/bladerunner/script/scene/ct09.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct10.cpp b/engines/bladerunner/script/scene/ct10.cpp index 186b7678ff..c0ad361642 100644 --- a/engines/bladerunner/script/scene/ct10.cpp +++ b/engines/bladerunner/script/scene/ct10.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct11.cpp b/engines/bladerunner/script/scene/ct11.cpp index 3942a89b42..ad46be78cd 100644 --- a/engines/bladerunner/script/scene/ct11.cpp +++ b/engines/bladerunner/script/scene/ct11.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp index 826d0945fe..7800a55dc8 100644 --- a/engines/bladerunner/script/scene/ct12.cpp +++ b/engines/bladerunner/script/scene/ct12.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -64,13 +64,13 @@ void SceneScriptCT12::InitializeScene() { Actor_Set_At_XYZ(kActorGaff, -534.0f, -6.5f, 952.0f, 367); Game_Flag_Set(294); } - if (Game_Flag_Query(123) && Game_Flag_Query(248)) { + if (Game_Flag_Query(123) && Game_Flag_Query(kFlagSpinnerToCT01)) { if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { Scene_Loop_Start_Special(0, 1, 0); } Scene_Loop_Set_Default(2); Game_Flag_Reset(123); - } else if (Game_Flag_Query(123) && !Game_Flag_Query(248)) { + } else if (Game_Flag_Query(123) && !Game_Flag_Query(kFlagSpinnerToCT01)) { if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { Scene_Loop_Start_Special(0, 0, 0); } diff --git a/engines/bladerunner/script/scene/ct51.cpp b/engines/bladerunner/script/scene/ct51.cpp index 73d6d92d7a..afbb8537da 100644 --- a/engines/bladerunner/script/scene/ct51.cpp +++ b/engines/bladerunner/script/scene/ct51.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/dr01.cpp b/engines/bladerunner/script/scene/dr01.cpp index cc6eb640ae..ea609f538e 100644 --- a/engines/bladerunner/script/scene/dr01.cpp +++ b/engines/bladerunner/script/scene/dr01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -36,7 +36,7 @@ void SceneScriptDR01::InitializeScene() { } Scene_Exit_Add_2D_Exit(0, 240, 60, 450, 250, 0); Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - if (Game_Flag_Query(253) && Global_Variable_Query(1) < 4) { + if (Game_Flag_Query(kFlagSpinnerToDR01) && Global_Variable_Query(1) < 4) { Scene_Exit_Add_2D_Exit(2, 610, 0, 639, 479, 1); } if (Global_Variable_Query(1) >= 3) { @@ -136,56 +136,56 @@ bool SceneScriptDR01::ClickedOnExit(int exitId) { switch (spinnerDest) { case 2: Game_Flag_Set(182); - Game_Flag_Reset(253); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(253); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(253); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); break; case 0: Game_Flag_Set(178); - Game_Flag_Reset(253); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(253); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(253); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(253); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(253); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); break; case 9: Game_Flag_Set(257); - Game_Flag_Reset(253); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToDR01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); break; default: diff --git a/engines/bladerunner/script/scene/dr02.cpp b/engines/bladerunner/script/scene/dr02.cpp index 78987dcdc9..6e71bb1d9d 100644 --- a/engines/bladerunner/script/scene/dr02.cpp +++ b/engines/bladerunner/script/scene/dr02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/dr03.cpp b/engines/bladerunner/script/scene/dr03.cpp index 077eb39eea..cdee6a181d 100644 --- a/engines/bladerunner/script/scene/dr03.cpp +++ b/engines/bladerunner/script/scene/dr03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/dr04.cpp b/engines/bladerunner/script/scene/dr04.cpp index fe8032997a..81302e4e3f 100644 --- a/engines/bladerunner/script/scene/dr04.cpp +++ b/engines/bladerunner/script/scene/dr04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/dr05.cpp b/engines/bladerunner/script/scene/dr05.cpp index 0793d8bbcc..ce2a76218a 100644 --- a/engines/bladerunner/script/scene/dr05.cpp +++ b/engines/bladerunner/script/scene/dr05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -142,7 +142,7 @@ void SceneScriptDR05::PlayerWalkedIn() { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -10.0f, 0.3f, 133.0f, 0, 0, false, 0); if (!Game_Flag_Query(511)) { Game_Flag_Set(511); - if (Game_Flag_Query(48)) { + if (Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Voice_Over(730, kActorVoiceOver); Actor_Voice_Over(740, kActorVoiceOver); Actor_Voice_Over(750, kActorVoiceOver); diff --git a/engines/bladerunner/script/scene/dr06.cpp b/engines/bladerunner/script/scene/dr06.cpp index 6f3947c6fb..aedfa4550d 100644 --- a/engines/bladerunner/script/scene/dr06.cpp +++ b/engines/bladerunner/script/scene/dr06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hc01.cpp b/engines/bladerunner/script/scene/hc01.cpp index 2169986b9e..fbf54e0adc 100644 --- a/engines/bladerunner/script/scene/hc01.cpp +++ b/engines/bladerunner/script/scene/hc01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hc02.cpp b/engines/bladerunner/script/scene/hc02.cpp index 746a0f487c..97292f29ac 100644 --- a/engines/bladerunner/script/scene/hc02.cpp +++ b/engines/bladerunner/script/scene/hc02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hc03.cpp b/engines/bladerunner/script/scene/hc03.cpp index 93fea0ac9a..bf9330dd97 100644 --- a/engines/bladerunner/script/scene/hc03.cpp +++ b/engines/bladerunner/script/scene/hc03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hc04.cpp b/engines/bladerunner/script/scene/hc04.cpp index d83dfc4cf0..43745380b8 100644 --- a/engines/bladerunner/script/scene/hc04.cpp +++ b/engines/bladerunner/script/scene/hc04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp index 764a4d536f..67f538f12e 100644 --- a/engines/bladerunner/script/scene/hf01.cpp +++ b/engines/bladerunner/script/scene/hf01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -40,7 +40,7 @@ void SceneScriptHF01::InitializeScene() { if (!Game_Flag_Query(663)) { Scene_Exit_Add_2D_Exit(1, 304, 239, 492, 339, 0); Scene_Exit_Add_2D_Exit(2, 560, 231, 639, 360, 0); - if (Game_Flag_Query(256)) { + if (Game_Flag_Query(kFlagSpinnerToHF01)) { Scene_Exit_Add_2D_Exit(3, 0, 311, 66, 417, 2); } } @@ -61,7 +61,7 @@ void SceneScriptHF01::InitializeScene() { Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(256)) { + if (Game_Flag_Query(kFlagSpinnerToHF01)) { if (!Game_Flag_Query(309) && !Game_Flag_Query(311) && !Game_Flag_Query(313)) { Scene_Loop_Start_Special(0, 0, 0); } @@ -75,7 +75,7 @@ void SceneScriptHF01::InitializeScene() { void SceneScriptHF01::SceneLoaded() { Obstacle_Object("LOFT41", true); - if (!Game_Flag_Query(256)) { + if (!Game_Flag_Query(kFlagSpinnerToHF01)) { Unobstacle_Object("OBSTACLE BOX15", true); } } @@ -190,64 +190,64 @@ bool SceneScriptHF01::ClickedOnExit(int exitId) { switch (spinnerDest) { case 0: Game_Flag_Set(178); - Game_Flag_Reset(256); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); Scene_Loop_Start_Special(1, 4, 1); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(256); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); Scene_Loop_Start_Special(1, 4, 1); break; case 2: Game_Flag_Set(182); - Game_Flag_Reset(256); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(1, 4, 1); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(256); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); Scene_Loop_Start_Special(1, 4, 1); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(256); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(1, 4, 1); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(256); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); Scene_Loop_Start_Special(1, 4, 1); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(256); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); Scene_Loop_Start_Special(1, 4, 1); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(256); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(1, 4, 1); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(256); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToHF01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); Scene_Loop_Start_Special(1, 4, 1); break; diff --git a/engines/bladerunner/script/scene/hf02.cpp b/engines/bladerunner/script/scene/hf02.cpp index 258b942f3f..9df62e4d2a 100644 --- a/engines/bladerunner/script/scene/hf02.cpp +++ b/engines/bladerunner/script/scene/hf02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp index 1117f222da..09bf589bb7 100644 --- a/engines/bladerunner/script/scene/hf03.cpp +++ b/engines/bladerunner/script/scene/hf03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -76,7 +76,7 @@ void SceneScriptHF03::sub_401C80() { Actor_Says(kActorMcCoy, 1630, 15); if (Global_Variable_Query(40) == 3) { Actor_Set_Goal_Number(kActorLucy, 214); - } else if (Game_Flag_Query(46)) { + } else if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Set_Goal_Number(kActorLucy, 212); } else { Actor_Set_Goal_Number(kActorLucy, 210); @@ -105,7 +105,7 @@ void SceneScriptHF03::sub_401C80() { Actor_Says(kActorMcCoy, 6785, 15); Actor_Says(kActorLucy, 970, 16); Actor_Says(kActorLucy, 980, 17); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Says(kActorLucy, 990, 17); } Actor_Says(kActorMcCoy, 6790, 15); @@ -120,7 +120,7 @@ void SceneScriptHF03::sub_401C80() { Actor_Says(kActorMcCoy, 1660, 15); Actor_Says(kActorLucy, 230, 14); Actor_Clue_Acquire(kActorLucy, kClueMcCoyHelpedLucy, 1, kActorMcCoy); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Set_Goal_Number(kActorLucy, 212); } else { Actor_Set_Goal_Number(kActorLucy, 210); @@ -150,11 +150,11 @@ void SceneScriptHF03::sub_401C80() { bool SceneScriptHF03::ClickedOnActor(int actorId) { if (actorId == 6 && Actor_Query_Goal_Number(kActorLucy) == 205) { - if (Game_Flag_Query(46) ? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, 1, false) : !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 378, 0, 1, false)) { + if (Game_Flag_Query(kFlagLucyIsReplicant) ? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, 1, false) : !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 378, 0, 1, false)) { Actor_Face_Actor(kActorMcCoy, kActorLucy, true); if (!Game_Flag_Query(613)) { Game_Flag_Set(613); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Says(kActorMcCoy, 1605, 15); Actor_Says(kActorLucy, 100, 12); Actor_Says(kActorMcCoy, 1610, 14); @@ -166,7 +166,7 @@ bool SceneScriptHF03::ClickedOnActor(int actorId) { Actor_Says(kActorMcCoy, 1620, 14); Actor_Says(kActorLucy, 130, 17); Actor_Says(kActorMcCoy, 1625, 15); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Says(kActorLucy, 140, 12); Actor_Says(kActorLucy, 150, 13); Actor_Says(kActorLucy, 160, 15); diff --git a/engines/bladerunner/script/scene/hf04.cpp b/engines/bladerunner/script/scene/hf04.cpp index f96053a773..09a849c781 100644 --- a/engines/bladerunner/script/scene/hf04.cpp +++ b/engines/bladerunner/script/scene/hf04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp index ea1fe7f28d..22fd331132 100644 --- a/engines/bladerunner/script/scene/hf05.cpp +++ b/engines/bladerunner/script/scene/hf05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -468,7 +468,7 @@ void SceneScriptHF05::sub_403738() { Actor_Set_At_XYZ(kActorCrazylegs, -315.15f, 0.0f, 241.06f, 583); Actor_Set_Goal_Number(kActorCrazylegs, 699); Game_Flag_Set(652); - if (Game_Flag_Query(255)) { + if (Game_Flag_Query(kFlagSpinnerToNR01)) { Set_Enter(54, kSceneNR01); } else { Game_Flag_Set(313); diff --git a/engines/bladerunner/script/scene/hf06.cpp b/engines/bladerunner/script/scene/hf06.cpp index 406e4e5a92..f1acea722f 100644 --- a/engines/bladerunner/script/scene/hf06.cpp +++ b/engines/bladerunner/script/scene/hf06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/hf07.cpp b/engines/bladerunner/script/scene/hf07.cpp index bdd748fdf0..e9fe2f05fd 100644 --- a/engines/bladerunner/script/scene/hf07.cpp +++ b/engines/bladerunner/script/scene/hf07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp01.cpp b/engines/bladerunner/script/scene/kp01.cpp index af6f57f759..72ab3d5117 100644 --- a/engines/bladerunner/script/scene/kp01.cpp +++ b/engines/bladerunner/script/scene/kp01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp02.cpp b/engines/bladerunner/script/scene/kp02.cpp index 1e83d1e310..b123160519 100644 --- a/engines/bladerunner/script/scene/kp02.cpp +++ b/engines/bladerunner/script/scene/kp02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp03.cpp b/engines/bladerunner/script/scene/kp03.cpp index 27f1ee2583..bb8c005240 100644 --- a/engines/bladerunner/script/scene/kp03.cpp +++ b/engines/bladerunner/script/scene/kp03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp04.cpp b/engines/bladerunner/script/scene/kp04.cpp index daa95f866a..97eda1bd24 100644 --- a/engines/bladerunner/script/scene/kp04.cpp +++ b/engines/bladerunner/script/scene/kp04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp05.cpp b/engines/bladerunner/script/scene/kp05.cpp index 11a246b301..6ac4d1f1e0 100644 --- a/engines/bladerunner/script/scene/kp05.cpp +++ b/engines/bladerunner/script/scene/kp05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp06.cpp b/engines/bladerunner/script/scene/kp06.cpp index e237bfaf5d..462bd83f0c 100644 --- a/engines/bladerunner/script/scene/kp06.cpp +++ b/engines/bladerunner/script/scene/kp06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/kp07.cpp b/engines/bladerunner/script/scene/kp07.cpp index 0b6558ef81..23c05c72d4 100644 --- a/engines/bladerunner/script/scene/kp07.cpp +++ b/engines/bladerunner/script/scene/kp07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -29,7 +29,7 @@ void SceneScriptKP07::InitializeScene() { Game_Flag_Reset(578); Scene_Exit_Add_2D_Exit(0, 315, 185, 381, 285, 0); if (Game_Flag_Query(653)) { - if (Game_Flag_Query(47) && Actor_Query_Goal_Number(kActorDektora) < 599) { + if (Game_Flag_Query(kFlagDektoraIsReplicant) && Actor_Query_Goal_Number(kActorDektora) < 599) { Actor_Set_Targetable(kActorDektora, true); Global_Variable_Increment(51, 1); Actor_Put_In_Set(kActorDektora, 48); @@ -41,19 +41,19 @@ void SceneScriptKP07::InitializeScene() { Actor_Put_In_Set(kActorZuben, 48); Actor_Set_At_XYZ(kActorZuben, -26.0f, -41.52f, -135.0f, 0); } - if (Game_Flag_Query(44) && Actor_Query_Goal_Number(kActorIzo) < 599) { + if (Game_Flag_Query(kFlagIzoIsReplicant) && Actor_Query_Goal_Number(kActorIzo) < 599) { Global_Variable_Increment(51, 1); Actor_Set_Targetable(kActorIzo, true); Actor_Put_In_Set(kActorIzo, 48); Actor_Set_At_XYZ(kActorIzo, -38.0f, -41.52f, -175.0f, 500); } - if (Game_Flag_Query(45) && Actor_Query_Goal_Number(kActorGordo) < 599) { + if (Game_Flag_Query(kFlagGordoIsReplicant) && Actor_Query_Goal_Number(kActorGordo) < 599) { Global_Variable_Increment(51, 1); Actor_Set_Targetable(kActorGordo, true); Actor_Put_In_Set(kActorGordo, 48); Actor_Set_At_XYZ(kActorGordo, 61.0f, -41.52f, -3.0f, 921); } - if (Game_Flag_Query(46) && Actor_Query_Goal_Number(kActorLucy) < 599) { + if (Game_Flag_Query(kFlagLucyIsReplicant) && Actor_Query_Goal_Number(kActorLucy) < 599) { Global_Variable_Increment(51, 1); Actor_Put_In_Set(kActorLucy, 48); Actor_Set_At_XYZ(kActorLucy, 78.0f, -41.52f, -119.0f, 659); diff --git a/engines/bladerunner/script/scene/ma01.cpp b/engines/bladerunner/script/scene/ma01.cpp index 289f5b0203..d820a175ed 100644 --- a/engines/bladerunner/script/scene/ma01.cpp +++ b/engines/bladerunner/script/scene/ma01.cpp @@ -20,20 +20,20 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { void SceneScriptMA01::InitializeScene() { Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); - if (Game_Flag_Query(kFlagMA01Locked)) { + if (Game_Flag_Query(kFlagSpinnerToMA01)) { Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); } if (Game_Flag_Query(kFlagMA06toMA01)) { Setup_Scene_Information(1446.0f, 0.0f, -725.0f, 660); } Scene_Exit_Add_2D_Exit(0, 328, 132, 426, 190, 0); - if (Game_Flag_Query(kFlagMA01Locked)) { + if (Game_Flag_Query(kFlagSpinnerToMA01)) { Scene_Exit_Add_2D_Exit(1, 234, 240, 398, 328, 2); } Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); @@ -119,64 +119,64 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) { switch (spinnerDest) { case kSpinnerDestinationPoliceStation: Game_Flag_Set(178); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationRuncitersAnimals: Game_Flag_Set(182); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationChinatown: Game_Flag_Set(176); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationTyrellBuilding: Game_Flag_Set(261); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationAnimoidRow: Game_Flag_Set(180); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationDNARow: Game_Flag_Set(177); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationBradburyBuilding: Game_Flag_Set(258); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationNightclubRow: Game_Flag_Set(181); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; case kSpinnerDestinationHysteriaHall: Game_Flag_Set(257); - Game_Flag_Reset(kFlagMA01Locked); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToMA01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true); break; @@ -242,7 +242,7 @@ void SceneScriptMA01::PlayerWalkedOut() { Actor_Set_Invisible(kActorMcCoy, false); Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(37) && Global_Variable_Query(1) == 1) { + if (!Game_Flag_Query(kFlagMA01toMA06) && Global_Variable_Query(1) == 1) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); Outtake_Play(kOuttakeTowards2, true, -1); diff --git a/engines/bladerunner/script/scene/ma02.cpp b/engines/bladerunner/script/scene/ma02.cpp index 0bdb0d2f2c..98887ed67e 100644 --- a/engines/bladerunner/script/scene/ma02.cpp +++ b/engines/bladerunner/script/scene/ma02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -227,7 +227,7 @@ bool SceneScriptMA02::sub_401F7C() { void SceneScriptMA02::sub_402044() { int i = 0; int arr[7]; - if (Global_Variable_Query(1) < 4 && Game_Flag_Query(45)) { + if (Global_Variable_Query(1) < 4 && Game_Flag_Query(kFlagGordoIsReplicant)) { arr[i++] = 0; } arr[i++] = 1; diff --git a/engines/bladerunner/script/scene/ma04.cpp b/engines/bladerunner/script/scene/ma04.cpp index 13ca308227..a92890d9bc 100644 --- a/engines/bladerunner/script/scene/ma04.cpp +++ b/engines/bladerunner/script/scene/ma04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -30,7 +30,7 @@ void SceneScriptMA04::InitializeScene() { if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false); } - } else if (Game_Flag_Query(35)) { + } else if (Game_Flag_Query(kFlagMA02ToMA04)) { Setup_Scene_Information(-7099.0f, 954.0f, 1866.0f, 502); } else if (Game_Flag_Query(647)) { Setup_Scene_Information(-7107.0f, 954.0f, 1742.0f, 502); @@ -239,10 +239,10 @@ void SceneScriptMA04::PlayerWalkedIn() { } if (Game_Flag_Query(647)) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 0); - } else if (Game_Flag_Query(35)) { + } else if (Game_Flag_Query(kFlagMA02ToMA04)) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7143.0f, 954.0f, 1868.0f, 0, 1, false, 0); } - Game_Flag_Reset(35); + Game_Flag_Reset(kFlagMA02ToMA04); Game_Flag_Reset(kFlagMA05toMA04); Game_Flag_Reset(647); if (Game_Flag_Query(61)) { @@ -268,9 +268,9 @@ void SceneScriptMA04::PlayerWalkedIn() { Actor_Clue_Acquire(kActorMcCoy, kCluePhoneCallGuzza, false, kActorGuzza); Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationTyrellBuilding, true); Game_Flag_Set(kFlagRC01PoliceDone); - if (!Game_Flag_Query(163)) { - Game_Flag_Set(163); - Item_Remove_From_World(66); + if (!Game_Flag_Query(kFlagChromeDebrisTaken)) { + Game_Flag_Set(kFlagChromeDebrisTaken); + Item_Remove_From_World(kItemChromeDebris); } Actor_Set_Goal_Number(kActorOfficerLeary, 99); Actor_Put_In_Set(kActorOfficerLeary, 93); diff --git a/engines/bladerunner/script/scene/ma05.cpp b/engines/bladerunner/script/scene/ma05.cpp index a086a25c87..40efc3641d 100644 --- a/engines/bladerunner/script/scene/ma05.cpp +++ b/engines/bladerunner/script/scene/ma05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ma06.cpp b/engines/bladerunner/script/scene/ma06.cpp index df325fece7..732b260e72 100644 --- a/engines/bladerunner/script/scene/ma06.cpp +++ b/engines/bladerunner/script/scene/ma06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -131,7 +131,7 @@ void SceneScriptMA06::activateElevator() { if (floor > 1) { Game_Flag_Set(kFlagMA06toMA07); } else if (floor == 1) { - if (Game_Flag_Query(kFlagMA01Locked)) { + if (Game_Flag_Query(kFlagSpinnerToMA01)) { Game_Flag_Set(kFlagMA06toMA01); } else { Sound_Play(412, 100, 0, 0, 50); diff --git a/engines/bladerunner/script/scene/ma07.cpp b/engines/bladerunner/script/scene/ma07.cpp index bdba1a0371..a009096795 100644 --- a/engines/bladerunner/script/scene/ma07.cpp +++ b/engines/bladerunner/script/scene/ma07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -128,8 +128,8 @@ void SceneScriptMA07::PlayerWalkedIn() { if (Actor_Query_Goal_Number(kActorRachael) == 300) { Actor_Set_Goal_Number(kActorRachael, 305); } - if (Game_Flag_Query(58)) { - Game_Flag_Reset(58); + if (Game_Flag_Query(kFlagMA06toMA07)) { + Game_Flag_Reset(kFlagMA06toMA07); } if (!Game_Flag_Query(648) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { Scene_Exits_Disable(); diff --git a/engines/bladerunner/script/scene/ma08.cpp b/engines/bladerunner/script/scene/ma08.cpp index bd7d15f235..8e68edc1b7 100644 --- a/engines/bladerunner/script/scene/ma08.cpp +++ b/engines/bladerunner/script/scene/ma08.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp index da71325115..8dd675eb7e 100644 --- a/engines/bladerunner/script/scene/nr01.cpp +++ b/engines/bladerunner/script/scene/nr01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -47,7 +47,7 @@ void SceneScriptNR01::InitializeScene() { Scene_Exit_Add_2D_Exit(1, 201, 320, 276, 357, 2); } Scene_Exit_Add_2D_Exit(2, 583, 262, 639, 365, 1); - if (Game_Flag_Query(255)) { + if (Game_Flag_Query(kFlagSpinnerToNR01)) { Scene_Exit_Add_2D_Exit(3, 320, 445, 639, 479, 2); } Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); @@ -68,14 +68,14 @@ void SceneScriptNR01::InitializeScene() { Ambient_Sounds_Add_Sound(376, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); if (Game_Flag_Query(643) && Actor_Query_Goal_Number(kActorSteele) == 230) { - Game_Flag_Reset(255); - Game_Flag_Reset(256); + Game_Flag_Reset(kFlagSpinnerToNR01); + Game_Flag_Reset(kFlagSpinnerToHF01); } - if (Game_Flag_Query(255) && !Game_Flag_Query(247)) { + if (Game_Flag_Query(kFlagSpinnerToNR01) && !Game_Flag_Query(247)) { Scene_Loop_Start_Special(0, 0, 0); Scene_Loop_Set_Default(1); Game_Flag_Set(247); - } else if (Game_Flag_Query(255) && Game_Flag_Query(247)) { + } else if (Game_Flag_Query(kFlagSpinnerToNR01) && Game_Flag_Query(247)) { Scene_Loop_Set_Default(1); } else { Scene_Loop_Set_Default(4); @@ -154,72 +154,72 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { switch (Spinner_Interface_Choose_Dest(-1, 1)) { case 9: Game_Flag_Set(257); - Game_Flag_Reset(255); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToNR01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); Scene_Loop_Start_Special(1, 3, 1); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(254); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); Scene_Loop_Start_Special(1, 3, 1); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(253); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(1, 3, 1); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(307); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(1, 3, 1); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(252); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); Scene_Loop_Start_Special(1, 3, 1); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(248); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); Scene_Loop_Start_Special(1, 3, 1); break; case 2: Game_Flag_Set(182); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(249); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(1, 3, 1); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(250); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); Scene_Loop_Start_Special(1, 3, 1); break; case 0: Game_Flag_Set(178); - Game_Flag_Reset(255); + Game_Flag_Reset(kFlagSpinnerToNR01); Game_Flag_Reset(247); - Game_Flag_Set(251); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); Scene_Loop_Start_Special(1, 3, 1); break; diff --git a/engines/bladerunner/script/scene/nr02.cpp b/engines/bladerunner/script/scene/nr02.cpp index adb15ffce8..93b168b75e 100644 --- a/engines/bladerunner/script/scene/nr02.cpp +++ b/engines/bladerunner/script/scene/nr02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr03.cpp b/engines/bladerunner/script/scene/nr03.cpp index dfeacb16f4..beb3ec7632 100644 --- a/engines/bladerunner/script/scene/nr03.cpp +++ b/engines/bladerunner/script/scene/nr03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr04.cpp b/engines/bladerunner/script/scene/nr04.cpp index 1f5ee4727d..2ef114a3e6 100644 --- a/engines/bladerunner/script/scene/nr04.cpp +++ b/engines/bladerunner/script/scene/nr04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr05.cpp b/engines/bladerunner/script/scene/nr05.cpp index ac58901f1f..e8608f4230 100644 --- a/engines/bladerunner/script/scene/nr05.cpp +++ b/engines/bladerunner/script/scene/nr05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr06.cpp b/engines/bladerunner/script/scene/nr06.cpp index 25d1148189..6b304dc5f0 100644 --- a/engines/bladerunner/script/scene/nr06.cpp +++ b/engines/bladerunner/script/scene/nr06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr07.cpp b/engines/bladerunner/script/scene/nr07.cpp index dde74478b8..27d85ecaba 100644 --- a/engines/bladerunner/script/scene/nr07.cpp +++ b/engines/bladerunner/script/scene/nr07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -177,7 +177,7 @@ void SceneScriptNR07::sub_4018D4() { Actor_Change_Animation_Mode(kActorDektora, 71); Actor_Change_Animation_Mode(kActorMcCoy, 21); Loop_Actor_Walk_To_XYZ(kActorDektora, -102.0f, -73.5f, -233.0f, 0, 0, true, 0); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Set_Goal_Number(kActorDektora, 245); } else { Actor_Set_Goal_Number(kActorDektora, 295); @@ -257,7 +257,7 @@ void SceneScriptNR07::sub_401EF4() { Game_Flag_Set(638); Actor_Clue_Acquire(kActorMcCoy, kClueDragonflyBelt, 1, kActorDektora); int v0 = Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy); - if (!Game_Flag_Query(47) && v0 < 40) { + if (!Game_Flag_Query(kFlagDektoraIsReplicant) && v0 < 40) { sub_4018D4(); return; } @@ -276,7 +276,7 @@ void SceneScriptNR07::sub_4020F0() { Actor_Says(kActorMcCoy, 3645, 12); Actor_Says(kActorDektora, 620, 30); int v0 = Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy); - if (!Game_Flag_Query(47) && v0 < 40) { + if (!Game_Flag_Query(kFlagDektoraIsReplicant) && v0 < 40) { sub_4018D4(); return; } @@ -308,7 +308,7 @@ void SceneScriptNR07::sub_402284() { Actor_Says(kActorDektora, 730, 30); Actor_Says(kActorMcCoy, 3685, 13); Voight_Kampff_Activate(kActorDektora, 40); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { sub_401A10(); } else { sub_4018D4(); @@ -323,7 +323,7 @@ void SceneScriptNR07::sub_402510() { Actor_Face_Actor(kActorDektora, kActorMcCoy, true); Actor_Says(kActorMcCoy, 3695, 15); Actor_Modify_Friendliness_To_Other(kActorDektora, kActorMcCoy, 5); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { sub_401A10(); } else { sub_4018D4(); @@ -333,7 +333,7 @@ void SceneScriptNR07::sub_402510() { void SceneScriptNR07::sub_402614() { Actor_Says(kActorMcCoy, 3705, 19); Actor_Says(kActorDektora, 760, 53); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Modify_Friendliness_To_Other(kActorDektora, kActorMcCoy, -5); Actor_Says(kActorMcCoy, 3710, 18); sub_401A10(); diff --git a/engines/bladerunner/script/scene/nr08.cpp b/engines/bladerunner/script/scene/nr08.cpp index 346d71a7fe..ef54702191 100644 --- a/engines/bladerunner/script/scene/nr08.cpp +++ b/engines/bladerunner/script/scene/nr08.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr09.cpp b/engines/bladerunner/script/scene/nr09.cpp index 0fda348f12..fd4faeccb0 100644 --- a/engines/bladerunner/script/scene/nr09.cpp +++ b/engines/bladerunner/script/scene/nr09.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr10.cpp b/engines/bladerunner/script/scene/nr10.cpp index a898daa7d2..c3f7bd85a7 100644 --- a/engines/bladerunner/script/scene/nr10.cpp +++ b/engines/bladerunner/script/scene/nr10.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/nr11.cpp b/engines/bladerunner/script/scene/nr11.cpp index 915c5a9738..20a1706704 100644 --- a/engines/bladerunner/script/scene/nr11.cpp +++ b/engines/bladerunner/script/scene/nr11.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -289,7 +289,7 @@ void SceneScriptNR11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptNR11::PlayerWalkedIn() { if (Actor_Query_Goal_Number(kActorDektora) == 250) { Player_Set_Combat_Mode(true); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Set_Goal_Number(kActorSteele, 210); } } @@ -301,7 +301,7 @@ void SceneScriptNR11::PlayerWalkedIn() { Actor_Set_Invisible(kActorMcCoy, false); Player_Set_Combat_Mode(false); Player_Gains_Control(); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { if (Actor_Query_Goal_Number(kActorSteele) == 211) { Actor_Set_At_XYZ(kActorMcCoy, -37.41f, 0.33f, -86.0f, 26); Delay(500); diff --git a/engines/bladerunner/script/scene/ps01.cpp b/engines/bladerunner/script/scene/ps01.cpp index 5e31057dde..28f92a158c 100644 --- a/engines/bladerunner/script/scene/ps01.cpp +++ b/engines/bladerunner/script/scene/ps01.cpp @@ -20,14 +20,14 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { void SceneScriptPS01::InitializeScene() { Setup_Scene_Information(1872.0f, 16592.0f, -2975.0f, 200); Scene_Exit_Add_2D_Exit(0, 36, 194, 138, 326, 0); - if (Game_Flag_Query(251)) { + if (Game_Flag_Query(kFlagSpinnerToPS01)) { Scene_Exit_Add_2D_Exit(1, 344, 288, 584, 384, 2); } Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); @@ -37,7 +37,7 @@ void SceneScriptPS01::InitializeScene() { Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); if (Game_Flag_Query(130)) { - if (Game_Flag_Query(251)) { + if (Game_Flag_Query(kFlagSpinnerToPS01)) { Scene_Loop_Set_Default(1); } else { Scene_Loop_Set_Default(5); @@ -53,7 +53,7 @@ void SceneScriptPS01::InitializeScene() { void SceneScriptPS01::SceneLoaded() { Obstacle_Object("TUBE81", true); - if (Game_Flag_Query(251)) { + if (Game_Flag_Query(kFlagSpinnerToPS01)) { Unobstacle_Object("Barrier Obstacle", true); } Unobstacle_Object("BOX38", true); @@ -99,64 +99,64 @@ bool SceneScriptPS01::ClickedOnExit(int exitId) { switch (spinnerDest) { case 2: Game_Flag_Set(182); - Game_Flag_Reset(251); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); Scene_Loop_Start_Special(1, 4, 1); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(251); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); Scene_Loop_Start_Special(1, 4, 1); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(251); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); Scene_Loop_Start_Special(1, 4, 1); break; case 5: Game_Flag_Set(261); - Game_Flag_Reset(251); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); Scene_Loop_Start_Special(1, 4, 1); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(251); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); Scene_Loop_Start_Special(1, 4, 1); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(251); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); Scene_Loop_Start_Special(1, 4, 1); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(251); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); Scene_Loop_Start_Special(1, 4, 1); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(251); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); Scene_Loop_Start_Special(1, 4, 1); break; case 9: Game_Flag_Set(257); - Game_Flag_Reset(251); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToPS01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); Scene_Loop_Start_Special(1, 4, 1); break; diff --git a/engines/bladerunner/script/scene/ps02.cpp b/engines/bladerunner/script/scene/ps02.cpp index 16e23b0dba..544ff32a58 100644 --- a/engines/bladerunner/script/scene/ps02.cpp +++ b/engines/bladerunner/script/scene/ps02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps03.cpp b/engines/bladerunner/script/scene/ps03.cpp index cad54b7768..854e85f666 100644 --- a/engines/bladerunner/script/scene/ps03.cpp +++ b/engines/bladerunner/script/scene/ps03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps04.cpp b/engines/bladerunner/script/scene/ps04.cpp index ef0b2d64c5..7629aa822e 100644 --- a/engines/bladerunner/script/scene/ps04.cpp +++ b/engines/bladerunner/script/scene/ps04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps05.cpp b/engines/bladerunner/script/scene/ps05.cpp index c93db0b22f..a0bb9a7135 100644 --- a/engines/bladerunner/script/scene/ps05.cpp +++ b/engines/bladerunner/script/scene/ps05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -164,7 +164,7 @@ void SceneScriptPS05::DialogueQueueFlushed(int a1) { void SceneScriptPS05::sub_401B34() { int i = 0; int arr[7]; - if (Global_Variable_Query(1) < 4 && Game_Flag_Query(45)) { + if (Global_Variable_Query(1) < 4 && Game_Flag_Query(kFlagGordoIsReplicant)) { arr[i++] = 0; } arr[i++] = 1; diff --git a/engines/bladerunner/script/scene/ps06.cpp b/engines/bladerunner/script/scene/ps06.cpp index bf25f799ce..f289b6ee5f 100644 --- a/engines/bladerunner/script/scene/ps06.cpp +++ b/engines/bladerunner/script/scene/ps06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -66,13 +66,13 @@ bool SceneScriptPS06::ClickedOn3DObject(const char *objectName, bool a2) { Delay(2000); Actor_Voice_Over(3780, kActorVoiceOver); Actor_Voice_Over(3790, kActorVoiceOver); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Voice_Over(3800, kActorVoiceOver); Actor_Voice_Over(3810, kActorVoiceOver); Actor_Voice_Over(3820, kActorVoiceOver); Actor_Voice_Over(3830, kActorVoiceOver); Actor_Clue_Acquire(kActorMcCoy, kClueCarRegistration1, 1, -1); - } else if (Game_Flag_Query(45)) { + } else if (Game_Flag_Query(kFlagGordoIsReplicant)) { Actor_Voice_Over(3840, kActorVoiceOver); Actor_Voice_Over(3850, kActorVoiceOver); Actor_Voice_Over(3860, kActorVoiceOver); diff --git a/engines/bladerunner/script/scene/ps07.cpp b/engines/bladerunner/script/scene/ps07.cpp index 01285f5280..f07b4d9e8e 100644 --- a/engines/bladerunner/script/scene/ps07.cpp +++ b/engines/bladerunner/script/scene/ps07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps09.cpp b/engines/bladerunner/script/scene/ps09.cpp index 8b21415564..e6c79bd24d 100644 --- a/engines/bladerunner/script/scene/ps09.cpp +++ b/engines/bladerunner/script/scene/ps09.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -250,7 +250,7 @@ void SceneScriptPS09::sub_402090() { Actor_Says(kActorGrigorian, 50, 13); Actor_Says(kActorMcCoy, 4275, 18); Actor_Says(kActorMcCoy, 4280, 19); - if (Game_Flag_Query(44)) { + if (Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Says(kActorGrigorian, 60, 14); Actor_Says(kActorMcCoy, 4285, 13); Actor_Says(kActorGrigorian, 70, 12); @@ -262,7 +262,7 @@ void SceneScriptPS09::sub_402090() { Actor_Says(kActorMcCoy, 4300, 17); return; } - if (!Game_Flag_Query(44)) { + if (!Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Says(kActorGrigorian, 130, 15); Actor_Says(kActorGrigorian, 140, 13); Actor_Says(kActorMcCoy, 4305, 13); diff --git a/engines/bladerunner/script/scene/ps10.cpp b/engines/bladerunner/script/scene/ps10.cpp index 059f802fa0..d45a4b8e67 100644 --- a/engines/bladerunner/script/scene/ps10.cpp +++ b/engines/bladerunner/script/scene/ps10.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps11.cpp b/engines/bladerunner/script/scene/ps11.cpp index f3dd32b322..1aa227b022 100644 --- a/engines/bladerunner/script/scene/ps11.cpp +++ b/engines/bladerunner/script/scene/ps11.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps12.cpp b/engines/bladerunner/script/scene/ps12.cpp index 04322f28dd..7db642891e 100644 --- a/engines/bladerunner/script/scene/ps12.cpp +++ b/engines/bladerunner/script/scene/ps12.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps13.cpp b/engines/bladerunner/script/scene/ps13.cpp index ac0509dfde..7a47f807cf 100644 --- a/engines/bladerunner/script/scene/ps13.cpp +++ b/engines/bladerunner/script/scene/ps13.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps14.cpp b/engines/bladerunner/script/scene/ps14.cpp index f68936ee99..a6b64ab7e8 100644 --- a/engines/bladerunner/script/scene/ps14.cpp +++ b/engines/bladerunner/script/scene/ps14.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ps15.cpp b/engines/bladerunner/script/scene/ps15.cpp index 4d0a350818..0d18724ced 100644 --- a/engines/bladerunner/script/scene/ps15.cpp +++ b/engines/bladerunner/script/scene/ps15.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp index fd1304d5df..c069ed2f08 100644 --- a/engines/bladerunner/script/scene/rc01.cpp +++ b/engines/bladerunner/script/scene/rc01.cpp @@ -20,19 +20,31 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { void SceneScriptRC01::InitializeScene() { #if BLADERUNNER_DEBUG_GAME //TODO: not part of game, remove - // Game_Flag_Set(kFlagIntroPlayed); // force skip intro + Game_Flag_Set(kFlagIntroPlayed); // force skip intro Game_Flag_Set(kFlagRC02toRC01); // no landing // Game_Flag_Set(kFlagRC01PoliceDone); // Game_Flag_Set(kFlagKIAPrivacyAddon); + // Spinner_Set_Selectable_Destination_Flag(0, true); + // Spinner_Set_Selectable_Destination_Flag(1, true); + // Spinner_Set_Selectable_Destination_Flag(2, true); + // Spinner_Set_Selectable_Destination_Flag(3, true); + // Spinner_Set_Selectable_Destination_Flag(4, true); + // Spinner_Set_Selectable_Destination_Flag(5, true); + // Spinner_Set_Selectable_Destination_Flag(6, true); + // Spinner_Set_Selectable_Destination_Flag(7, true); + // Spinner_Set_Selectable_Destination_Flag(8, true); + // Spinner_Set_Selectable_Destination_Flag(9, true); // ESPER_Flag_To_Activate(); + // Voight_Kampff_Activate(kActorLucy, 50); + #endif if (!Game_Flag_Query(kFlagIntroPlayed)) { @@ -51,7 +63,7 @@ void SceneScriptRC01::InitializeScene() { Setup_Scene_Information(-10.98f, -0.30f, 318.15f, 616); } Scene_Exit_Add_2D_Exit(0, 314, 145, 340, 255, 0); - if (Game_Flag_Query(249)) { + if (Game_Flag_Query(kFlagSpinnerToRC01)) { Scene_Exit_Add_2D_Exit(1, 482, 226, 639, 280, 2); } if (Global_Variable_Query(1) > 1 && Game_Flag_Query(710)) { @@ -92,7 +104,7 @@ void SceneScriptRC01::InitializeScene() { if (!Game_Flag_Query(kFlagRC02toRC01) && !Game_Flag_Query(kFlagRC03toRC01)) { Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 5, false); } - if (Game_Flag_Query(249)) { + if (Game_Flag_Query(kFlagSpinnerToRC01)) { Scene_Loop_Set_Default(6); } else { Scene_Loop_Set_Default(10); @@ -182,8 +194,8 @@ void SceneScriptRC01::SceneLoaded() { Preload(589); } - if (!Game_Flag_Query(163)) { - Item_Add_To_World(66, 938, 69, -148.60f, -0.30f, 225.15f, 256, 24, 24, false, true, false, true); + if (!Game_Flag_Query(kFlagChromeDebrisTaken)) { + Item_Add_To_World(kItemChromeDebris, 938, 69, -148.60f, -0.30f, 225.15f, 256, 24, 24, false, true, false, true); } if (!Game_Flag_Query(kFlagIntroPlayed)) { @@ -268,15 +280,15 @@ bool SceneScriptRC01::ClickedOnActor(int actorId) { if (Actor_Query_Goal_Number(kActorOfficerLeary) == 1) { Actor_Set_Goal_Number(kActorOfficerLeary, 0); } - if (Game_Flag_Query(3)) { + if (Game_Flag_Query(kFlagGotOfficersStatement)) { Actor_Says(kActorMcCoy, 4535, 13); - Game_Flag_Set(392); + Game_Flag_Set(KFlagMcCoyAndOfficerLearyTalking); if (Actor_Clue_Query(kActorOfficerLeary, kClueCrowdInterviewA) && !Actor_Clue_Query(kActorMcCoy, kClueCrowdInterviewA)) { Actor_Face_Object(kActorOfficerLeary, "70_1", true); Actor_Says(kActorOfficerLeary, 100, 15); Actor_Face_Actor(kActorOfficerLeary, kActorMcCoy, true); Actor_Clue_Acquire(kActorMcCoy, kClueCrowdInterviewA, true, kActorOfficerLeary); - Game_Flag_Reset(392); + Game_Flag_Reset(KFlagMcCoyAndOfficerLearyTalking); } else if (Actor_Clue_Query(kActorOfficerLeary, kClueCrowdInterviewB) && !Actor_Clue_Query(kActorMcCoy, kClueCrowdInterviewB)) { Actor_Face_Object(kActorOfficerLeary, "70_5", true); Actor_Says(kActorOfficerLeary, 120, 19); @@ -284,26 +296,26 @@ bool SceneScriptRC01::ClickedOnActor(int actorId) { Actor_Says(kActorOfficerLeary, 130, 14); I_Sez("JM: Did it have a huge, ugly piece of chrome on it?"); Actor_Clue_Acquire(kActorMcCoy, kClueCrowdInterviewB, true, kActorOfficerLeary); - Game_Flag_Reset(392); + Game_Flag_Reset(KFlagMcCoyAndOfficerLearyTalking); } else { Actor_Says(kActorOfficerLeary, 90, 16); I_Sez("JM: This officer has a talent for vivid metaphors."); - if (!Game_Flag_Query(397)) { + if (!Game_Flag_Query(KFlagMcCoyAndOfficerLearyArtMetaphor)) { I_Sez("DL: What is that supposed to mean? I didn't write this line..."); Actor_Says(kActorMcCoy, 4540, 16); - Game_Flag_Set(397); + Game_Flag_Set(KFlagMcCoyAndOfficerLearyArtMetaphor); } - Game_Flag_Reset(392); + Game_Flag_Reset(KFlagMcCoyAndOfficerLearyTalking); } } else { I_Sez("MG: Hey, leave that officer alone. Can't you see he's busy?"); I_Sez("JM: (...mmm, donuts...)"); - Game_Flag_Set(3); + Game_Flag_Set(kFlagGotOfficersStatement); Actor_Clue_Acquire(kActorMcCoy, kClueOfficersStatement, true, kActorOfficerLeary); Actor_Says(kActorMcCoy, 4515, 13); - Game_Flag_Set(392); + Game_Flag_Set(KFlagMcCoyAndOfficerLearyTalking); Actor_Says(kActorOfficerLeary, 40, 13); - if (!Game_Flag_Query(1)) { + if (!Game_Flag_Query(kFlagRC02Discovered)) { Actor_Says(kActorOfficerLeary, 50, 14); Actor_Says(kActorOfficerLeary, 60, 15); I_Sez("MG: It's all fun and games until someone loses a tiger cub."); @@ -313,7 +325,7 @@ bool SceneScriptRC01::ClickedOnActor(int actorId) { Actor_Says(kActorOfficerLeary, 80, 18); Actor_Says(kActorMcCoy, 4530, 15); } - Game_Flag_Reset(392); + Game_Flag_Reset(KFlagMcCoyAndOfficerLearyTalking); } } return true; @@ -322,15 +334,15 @@ bool SceneScriptRC01::ClickedOnActor(int actorId) { } bool SceneScriptRC01::ClickedOnItem(int itemId, bool a2) { - if (itemId == 66) { + if (itemId == kItemChromeDebris) { Actor_Set_Goal_Number(kActorOfficerLeary, 0); - if (!Loop_Actor_Walk_To_Item(kActorMcCoy, 66, 36, 1, false)) { - Actor_Face_Item(kActorMcCoy, 66, true); + if (!Loop_Actor_Walk_To_Item(kActorMcCoy, kItemChromeDebris, 36, 1, false)) { + Actor_Face_Item(kActorMcCoy, kItemChromeDebris, true); Actor_Clue_Acquire(kActorMcCoy, kClueChromeDebris, true, -1); Actor_Face_Actor(kActorOfficerLeary, kActorMcCoy, true); Actor_Says(kActorOfficerLeary, 20, 12); - Game_Flag_Set(163); - Item_Remove_From_World(66); + Game_Flag_Set(kFlagChromeDebrisTaken); + Item_Remove_From_World(kItemChromeDebris); Item_Pickup_Spin_Effect(938, 426, 316); I_Sez("JM: Chrome...is that what that is?"); Actor_Says(kActorMcCoy, 4505, 13); @@ -365,7 +377,7 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { switch (Global_Variable_Query(1)) { case 1: case 4: - Game_Flag_Set(8); + Game_Flag_Set(kFlagRC01toRC02); Set_Enter(16, kSceneRC02); break; case 2: @@ -413,8 +425,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { switch (spinnerDest) { case kSpinnerDestinationPoliceStation: Game_Flag_Set(178); - Game_Flag_Reset(249); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -424,8 +436,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationMcCoysApartment: Game_Flag_Set(179); - Game_Flag_Reset(249); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -435,8 +447,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationChinatown: Game_Flag_Set(176); - Game_Flag_Reset(249); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -446,8 +458,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationTyrellBuilding: Game_Flag_Set(261); - Game_Flag_Reset(249); - Game_Flag_Set(307); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToTB02); Set_Enter(17, kSceneTB02); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -457,8 +469,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationAnimoidRow: Game_Flag_Set(180); - Game_Flag_Reset(249); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -468,8 +480,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationDNARow: Game_Flag_Set(177); - Game_Flag_Reset(249); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -479,8 +491,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationBradburyBuilding: Game_Flag_Set(258); - Game_Flag_Reset(249); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -490,8 +502,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationNightclubRow: Game_Flag_Set(181); - Game_Flag_Reset(249); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -501,8 +513,8 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { break; case kSpinnerDestinationHysteriaHall: Game_Flag_Set(257); - Game_Flag_Reset(249); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToRC01); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); if (Game_Flag_Query(kFlagRC01PoliceDone)) { Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true); @@ -519,7 +531,7 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) { } if (exitId == 2) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -471.98f, -0.3f, 258.15f, 4, 1, false, 0)) { - Game_Flag_Set(115); + Game_Flag_Set(kFlagRC01toRC03); Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); Set_Enter(70, kSceneRC03); @@ -578,7 +590,7 @@ void SceneScriptRC01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo } void SceneScriptRC01::PlayerWalkedIn() { - if (Game_Flag_Query(249) && !Game_Flag_Query(kFlagRC02toRC01) && !Game_Flag_Query(kFlagRC03toRC01)) { + if (Game_Flag_Query(kFlagSpinnerToRC01) && !Game_Flag_Query(kFlagRC02toRC01) && !Game_Flag_Query(kFlagRC03toRC01)) { walkToCenter(); } @@ -595,7 +607,7 @@ void SceneScriptRC01::PlayerWalkedIn() { Player_Gains_Control(); Game_Flag_Reset(kFlagRC02toRC01); - if (Game_Flag_Query(1) && !Game_Flag_Query(4)) { + if (Game_Flag_Query(kFlagRC02Discovered) && !Game_Flag_Query(4)) { Actor_Voice_Over(1910, kActorVoiceOver); Actor_Voice_Over(1920, kActorVoiceOver); Actor_Voice_Over(1930, kActorVoiceOver); @@ -609,7 +621,7 @@ void SceneScriptRC01::PlayerWalkedIn() { void SceneScriptRC01::PlayerWalkedOut() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(8) && !Game_Flag_Query(115) && Global_Variable_Query(1)) { + if (!Game_Flag_Query(kFlagRC01toRC02) && !Game_Flag_Query(kFlagRC01toRC03) && Global_Variable_Query(1)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Outtake_Play(kOuttakeAway2, 1, -1); diff --git a/engines/bladerunner/script/scene/rc02.cpp b/engines/bladerunner/script/scene/rc02.cpp index 02dd4ee699..0a95e40a5c 100644 --- a/engines/bladerunner/script/scene/rc02.cpp +++ b/engines/bladerunner/script/scene/rc02.cpp @@ -20,12 +20,12 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { void SceneScriptRC02::InitializeScene() { - if (Game_Flag_Query(8)) { + if (Game_Flag_Query(kFlagRC01toRC02)) { Setup_Scene_Information(-103.0f, -1238.89f, 108603.04f, 1007); } else { Setup_Scene_Information(-20.2f, -1238.89f, 108100.73f, 539); @@ -79,10 +79,10 @@ void SceneScriptRC02::SceneLoaded() { if (Actor_Clue_Query(kActorMcCoy, kClueRuncitersVideo) || Global_Variable_Query(1) > 1) { Unclickable_Object("SCRTY CA03"); } - if (!Game_Flag_Query(190)) { - Item_Add_To_World(100, 966, 16, -52.88f, -1238.89f, 108467.74f, 256, 6, 6, false, true, false, true); - Item_Add_To_World(101, 966, 16, -37.16f, -1238.89f, 108456.59f, 512, 6, 6, false, true, false, true); - Item_Add_To_World(102, 966, 16, -62.86f, -1238.89f, 108437.52f, 625, 6, 6, false, true, false, true); + if (!Game_Flag_Query(kFlagShellCasingsTaken)) { + Item_Add_To_World(kItemShellCasingA, 966, 16, -52.88f, -1238.89f, 108467.74f, 256, 6, 6, false, true, false, true); + Item_Add_To_World(kItemShellCasingB, 966, 16, -37.16f, -1238.89f, 108456.59f, 512, 6, 6, false, true, false, true); + Item_Add_To_World(kItemShellCasingC, 966, 16, -62.86f, -1238.89f, 108437.52f, 625, 6, 6, false, true, false, true); } } @@ -152,7 +152,7 @@ void SceneScriptRC02::dialogueWithRunciter() { case 10: Actor_Says(kActorMcCoy, 4585, 13); Actor_Face_Actor(kActorRunciter, kActorMcCoy, true); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Says(kActorRunciter, 250, 13); Actor_Says(kActorRunciter, 270, 13); Actor_Clue_Acquire(kActorMcCoy, kClueRunciterInterviewB1, 1, kActorRunciter); @@ -295,14 +295,14 @@ bool SceneScriptRC02::ClickedOnActor(int actorId) { } bool SceneScriptRC02::ClickedOnItem(int itemId, bool a2) { - if (itemId == 100 || itemId == 101 || itemId == 102) { - if (!Loop_Actor_Walk_To_Item(kActorMcCoy, 100, 24, 1, false)) { - Actor_Face_Item(kActorMcCoy, 100, true); + if (itemId == kItemShellCasingA || itemId == kItemShellCasingB || itemId == kItemShellCasingC) { + if (!Loop_Actor_Walk_To_Item(kActorMcCoy, kItemShellCasingA, 24, 1, false)) { + Actor_Face_Item(kActorMcCoy, kItemShellCasingA, true); Actor_Clue_Acquire(kActorMcCoy, kClueShellCasings, 1, -1); - Game_Flag_Set(190); - Item_Remove_From_World(100); - Item_Remove_From_World(101); - Item_Remove_From_World(102); + Game_Flag_Set(kFlagShellCasingsTaken); + Item_Remove_From_World(kItemShellCasingA); + Item_Remove_From_World(kItemShellCasingB); + Item_Remove_From_World(kItemShellCasingC); Item_Pickup_Spin_Effect(966, 395, 352); Actor_Voice_Over(1960, kActorVoiceOver); } @@ -346,18 +346,18 @@ void SceneScriptRC02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptRC02::PlayerWalkedIn() { Player_Set_Combat_Mode(false); - if (Game_Flag_Query(8)) { + if (Game_Flag_Query(kFlagRC01toRC02)) { Player_Loses_Control(); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -72.2f, -1238.89f, 108496.73f, 0, 0, false, 0); Player_Gains_Control(); - Game_Flag_Reset(8); - if (!Game_Flag_Query(1)) { + Game_Flag_Reset(kFlagRC01toRC02); + if (!Game_Flag_Query(kFlagRC02Discovered)) { Actor_Voice_Over(1970, kActorVoiceOver); Actor_Voice_Over(1980, kActorVoiceOver); Actor_Voice_Over(1990, kActorVoiceOver); Actor_Clue_Acquire(kActorMcCoy, kClueLimpingFootprints, 1, -1); Actor_Clue_Acquire(kActorMcCoy, kClueGracefulFootprints, 1, -1); - Game_Flag_Set(1); + Game_Flag_Set(kFlagRC02Discovered); } if (Actor_Query_Which_Set_In(kActorRunciter) == 16 && Actor_Query_Goal_Number(kActorRunciter) < 300) { Actor_Set_Goal_Number(kActorRunciter, 1); diff --git a/engines/bladerunner/script/scene/rc03.cpp b/engines/bladerunner/script/scene/rc03.cpp index 6f7bdad3cc..ca6bfc96fa 100644 --- a/engines/bladerunner/script/scene/rc03.cpp +++ b/engines/bladerunner/script/scene/rc03.cpp @@ -20,14 +20,14 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { void SceneScriptRC03::InitializeScene() { - if (Game_Flag_Query(115) ) { + if (Game_Flag_Query(kFlagRC01toRC03) ) { Setup_Scene_Information(298.0f, -4.0f, 405.0f, 800); - Game_Flag_Reset(115); + Game_Flag_Reset(kFlagRC01toRC03); } else if (Game_Flag_Query(117) ) { Setup_Scene_Information(-469.0f, -4.0f, 279.0f, 250); } else if (Game_Flag_Query(119) ) { @@ -247,13 +247,13 @@ void SceneScriptRC03::PlayerWalkedIn() { Actor_Says_With_Pause(kActorIzo, 630, 0, -1); Actor_Says_With_Pause(kActorIzo, 640, 0, -1); Actor_Says_With_Pause(kActorIzo, 650, 0, -1); - if (Game_Flag_Query(44) ) { + if (Game_Flag_Query(kFlagIzoIsReplicant) ) { Actor_Set_Goal_Number(kActorSteele, 100); } Actor_Change_Animation_Mode(kActorMcCoy, 20); Loop_Actor_Walk_To_XYZ(kActorIzo, 180.0f, -4.0f, 184.0f, 0, 0, false, 0); Actor_Change_Animation_Mode(kActorIzo, 6); - if (!Game_Flag_Query(44)) { + if (!Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Set_Goal_Number(kActorSteele, 100); } Player_Gains_Control(); diff --git a/engines/bladerunner/script/scene/rc04.cpp b/engines/bladerunner/script/scene/rc04.cpp index 72f50588a9..dee3c7a551 100644 --- a/engines/bladerunner/script/scene/rc04.cpp +++ b/engines/bladerunner/script/scene/rc04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -105,7 +105,7 @@ void SceneScriptRC04::sub_401DF4() { Actor_Says(kActorBulletBob, 330, 33); Actor_Says(kActorBulletBob, 340, 37); Actor_Says(kActorMcCoy, 5015, 11); - if (Game_Flag_Query(44)) { + if (Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Says(kActorBulletBob, 350, 32); Actor_Says(kActorBulletBob, 360, 33); Actor_Says(kActorBulletBob, 370, 30); @@ -143,7 +143,7 @@ void SceneScriptRC04::sub_401DF4() { Actor_Says(kActorBulletBob, 340, 11); Actor_Says(kActorMcCoy, 5015, 16); Actor_Modify_Friendliness_To_Other(kActorBulletBob, kActorMcCoy, 3); - if (Game_Flag_Query(44)) { + if (Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Says(kActorBulletBob, 350, 32); Actor_Says(kActorBulletBob, 360, 30); Actor_Says(kActorBulletBob, 370, 33); diff --git a/engines/bladerunner/script/scene/rc51.cpp b/engines/bladerunner/script/scene/rc51.cpp index 33c8549017..6a376a725b 100644 --- a/engines/bladerunner/script/scene/rc51.cpp +++ b/engines/bladerunner/script/scene/rc51.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/tb02.cpp b/engines/bladerunner/script/scene/tb02.cpp index 301fa98f46..5ae0a54d44 100644 --- a/engines/bladerunner/script/scene/tb02.cpp +++ b/engines/bladerunner/script/scene/tb02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -63,7 +63,7 @@ void SceneScriptTB02::InitializeScene() { Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); } - if (Game_Flag_Query(307) && Global_Variable_Query(1) < 4) { + if (Game_Flag_Query(kFlagSpinnerToTB02) && Global_Variable_Query(1) < 4) { Scene_Exit_Add_2D_Exit(2, 67, 0, 233, 362, 3); } if (Game_Flag_Query(155)) { @@ -195,56 +195,56 @@ bool SceneScriptTB02::ClickedOnExit(int exitId) { switch (Spinner_Interface_Choose_Dest(-1, 0)) { case 9: Game_Flag_Set(257); - Game_Flag_Reset(307); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(307); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(307); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(307); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(307); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(307); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); break; case 2: Game_Flag_Set(182); - Game_Flag_Reset(307); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(307); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); break; case 0: Game_Flag_Set(178); - Game_Flag_Reset(307); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); break; default: @@ -431,7 +431,7 @@ void SceneScriptTB02::sub_402B50() { switch (answer) { case 740: Actor_Says(kActorMcCoy, 5250, 15); - if (Game_Flag_Query(48)) { + if (Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Says(kActorSteele, 2250, 12); Actor_Says(kActorSteele, 2260, 13); Actor_Says(kActorMcCoy, 5265, 12); diff --git a/engines/bladerunner/script/scene/tb03.cpp b/engines/bladerunner/script/scene/tb03.cpp index 599e321402..8803740d7a 100644 --- a/engines/bladerunner/script/scene/tb03.cpp +++ b/engines/bladerunner/script/scene/tb03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/tb05.cpp b/engines/bladerunner/script/scene/tb05.cpp index 0b1bd1c672..b3299292f1 100644 --- a/engines/bladerunner/script/scene/tb05.cpp +++ b/engines/bladerunner/script/scene/tb05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -54,7 +54,7 @@ void SceneScriptTB05::SceneLoaded() { if (!Actor_Clue_Query(kActorMcCoy, kClueDragonflyEarring)) { Item_Add_To_World(76, 940, 72, 76.160004f, 147.36f, -235.14999f, 0, 6, 6, false, true, false, true); } - if (!Actor_Clue_Query(kActorMcCoy, kClueTyrellSalesPamphlet1) && !Actor_Clue_Query(kActorMcCoy, kClueTyrellSalesPamphlet2) && (Game_Flag_Query(45) || Game_Flag_Query(46))) { + if (!Actor_Clue_Query(kActorMcCoy, kClueTyrellSalesPamphlet1) && !Actor_Clue_Query(kActorMcCoy, kClueTyrellSalesPamphlet2) && (Game_Flag_Query(kFlagGordoIsReplicant) || Game_Flag_Query(kFlagLucyIsReplicant))) { Item_Add_To_World(119, 972, 72, 129.00999f, 147.12f, -162.98f, 0, 8, 8, false, true, false, true); } } @@ -136,7 +136,7 @@ bool SceneScriptTB05::ClickedOnItem(int itemId, bool a2) { Item_Remove_From_World(119); Item_Pickup_Spin_Effect(972, 449, 431); Actor_Voice_Over(4280, kActorVoiceOver); - if (Game_Flag_Query(45)) { + if (Game_Flag_Query(kFlagGordoIsReplicant)) { Actor_Voice_Over(4290, kActorVoiceOver); Actor_Clue_Acquire(kActorMcCoy, kClueTyrellSalesPamphlet1, 1, -1); } else { diff --git a/engines/bladerunner/script/scene/tb06.cpp b/engines/bladerunner/script/scene/tb06.cpp index 5642281d26..2970446ca3 100644 --- a/engines/bladerunner/script/scene/tb06.cpp +++ b/engines/bladerunner/script/scene/tb06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -79,7 +79,7 @@ bool SceneScriptTB06::ClickedOnActor(int actorId) { Actor_Voice_Over(2310, kActorVoiceOver); Item_Pickup_Spin_Effect(974, 66, 397); Actor_Voice_Over(2320, kActorVoiceOver); - if (Game_Flag_Query(48)) { + if (Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Voice_Over(2330, kActorVoiceOver); Actor_Voice_Over(2340, kActorVoiceOver); } diff --git a/engines/bladerunner/script/scene/tb07.cpp b/engines/bladerunner/script/scene/tb07.cpp index 5a249c649e..688c9f4c22 100644 --- a/engines/bladerunner/script/scene/tb07.cpp +++ b/engines/bladerunner/script/scene/tb07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -96,56 +96,56 @@ bool SceneScriptTB07::ClickedOnExit(int exitId) { switch (Spinner_Interface_Choose_Dest(-1, 0)) { case 9: Game_Flag_Set(257); - Game_Flag_Reset(307); - Game_Flag_Set(256); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToHF01); Set_Enter(37, kSceneHF01); break; case 8: Game_Flag_Set(181); - Game_Flag_Reset(307); - Game_Flag_Set(255); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToNR01); Set_Enter(54, kSceneNR01); break; case 7: Game_Flag_Set(258); - Game_Flag_Reset(307); - Game_Flag_Set(254); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToBB01); Set_Enter(20, kSceneBB01); break; case 6: Game_Flag_Set(177); - Game_Flag_Reset(307); - Game_Flag_Set(253); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToDR01); Set_Enter(7, kSceneDR01); break; case 4: Game_Flag_Set(180); - Game_Flag_Reset(307); - Game_Flag_Set(252); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToAR01); Set_Enter(0, kSceneAR01); break; case 3: Game_Flag_Set(176); - Game_Flag_Reset(307); - Game_Flag_Set(248); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToCT01); Set_Enter(4, kSceneCT01); break; case 2: Game_Flag_Set(182); - Game_Flag_Reset(307); - Game_Flag_Set(249); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToRC01); Set_Enter(69, kSceneRC01); break; case 1: Game_Flag_Set(179); - Game_Flag_Reset(307); - Game_Flag_Set(250); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToMA01); Set_Enter(49, kSceneMA01); break; case 0: Game_Flag_Set(178); - Game_Flag_Reset(307); - Game_Flag_Set(251); + Game_Flag_Reset(kFlagSpinnerToTB02); + Game_Flag_Set(kFlagSpinnerToPS01); Set_Enter(61, kScenePS01); break; default: diff --git a/engines/bladerunner/script/scene/ug01.cpp b/engines/bladerunner/script/scene/ug01.cpp index a1dde296e8..8c60aabd38 100644 --- a/engines/bladerunner/script/scene/ug01.cpp +++ b/engines/bladerunner/script/scene/ug01.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug02.cpp b/engines/bladerunner/script/scene/ug02.cpp index af91b5a060..2415bb78fd 100644 --- a/engines/bladerunner/script/scene/ug02.cpp +++ b/engines/bladerunner/script/scene/ug02.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -67,7 +67,7 @@ void SceneScriptUG02::SceneLoaded() { Clickable_Object("CRATE_3"); Footstep_Sounds_Set(0, 0); Footstep_Sounds_Set(8, 2); - if (!Game_Flag_Query(656) && Game_Flag_Query(44)) { + if (!Game_Flag_Query(656) && Game_Flag_Query(kFlagIzoIsReplicant)) { Item_Add_To_World(88, 963, 75, -300.37f, 120.16f, -81.31f, 0, 8, 8, false, true, false, true); } } diff --git a/engines/bladerunner/script/scene/ug03.cpp b/engines/bladerunner/script/scene/ug03.cpp index d5d80c9d90..a8119a893f 100644 --- a/engines/bladerunner/script/scene/ug03.cpp +++ b/engines/bladerunner/script/scene/ug03.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug04.cpp b/engines/bladerunner/script/scene/ug04.cpp index 13fb0d472c..8c54e64aad 100644 --- a/engines/bladerunner/script/scene/ug04.cpp +++ b/engines/bladerunner/script/scene/ug04.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug05.cpp b/engines/bladerunner/script/scene/ug05.cpp index 3a66f5e45a..e2f83c6fc3 100644 --- a/engines/bladerunner/script/scene/ug05.cpp +++ b/engines/bladerunner/script/scene/ug05.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -246,7 +246,7 @@ void SceneScriptUG05::sub_402218() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); if (v0 == kActorLucy) { - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { if (Global_Variable_Query(48) > 3) { Outtake_Play(kOuttakeEnd1B, false, -1); } else { @@ -256,7 +256,7 @@ void SceneScriptUG05::sub_402218() { Outtake_Play(kOuttakeEnd1A, false, -1); } } else if (v0 == kActorDektora) { - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { if (Global_Variable_Query(48) > 3) { Outtake_Play(kOuttakeEnd1E, false, -1); } else { diff --git a/engines/bladerunner/script/scene/ug06.cpp b/engines/bladerunner/script/scene/ug06.cpp index 55a84442f9..d69103aef8 100644 --- a/engines/bladerunner/script/scene/ug06.cpp +++ b/engines/bladerunner/script/scene/ug06.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug07.cpp b/engines/bladerunner/script/scene/ug07.cpp index fdb61c766a..29e7cfe72d 100644 --- a/engines/bladerunner/script/scene/ug07.cpp +++ b/engines/bladerunner/script/scene/ug07.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug08.cpp b/engines/bladerunner/script/scene/ug08.cpp index 667fa620fe..c346ac9a67 100644 --- a/engines/bladerunner/script/scene/ug08.cpp +++ b/engines/bladerunner/script/scene/ug08.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug09.cpp b/engines/bladerunner/script/scene/ug09.cpp index f217b3df67..502dda9942 100644 --- a/engines/bladerunner/script/scene/ug09.cpp +++ b/engines/bladerunner/script/scene/ug09.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug10.cpp b/engines/bladerunner/script/scene/ug10.cpp index 2568e433cd..fc21e8b580 100644 --- a/engines/bladerunner/script/scene/ug10.cpp +++ b/engines/bladerunner/script/scene/ug10.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug12.cpp b/engines/bladerunner/script/scene/ug12.cpp index 2f560d8f65..7b696c6938 100644 --- a/engines/bladerunner/script/scene/ug12.cpp +++ b/engines/bladerunner/script/scene/ug12.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug13.cpp b/engines/bladerunner/script/scene/ug13.cpp index 668132088d..0623cea57a 100644 --- a/engines/bladerunner/script/scene/ug13.cpp +++ b/engines/bladerunner/script/scene/ug13.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug14.cpp b/engines/bladerunner/script/scene/ug14.cpp index 8cb205856c..5e768b90b0 100644 --- a/engines/bladerunner/script/scene/ug14.cpp +++ b/engines/bladerunner/script/scene/ug14.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug15.cpp b/engines/bladerunner/script/scene/ug15.cpp index e35121fe11..760e9c42f8 100644 --- a/engines/bladerunner/script/scene/ug15.cpp +++ b/engines/bladerunner/script/scene/ug15.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug16.cpp b/engines/bladerunner/script/scene/ug16.cpp index 4b1ce4f7c5..6e37cb6b4d 100644 --- a/engines/bladerunner/script/scene/ug16.cpp +++ b/engines/bladerunner/script/scene/ug16.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug17.cpp b/engines/bladerunner/script/scene/ug17.cpp index 1f223b2312..d501e6dbab 100644 --- a/engines/bladerunner/script/scene/ug17.cpp +++ b/engines/bladerunner/script/scene/ug17.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug18.cpp b/engines/bladerunner/script/scene/ug18.cpp index 08d6269e8b..8c35ce7985 100644 --- a/engines/bladerunner/script/scene/ug18.cpp +++ b/engines/bladerunner/script/scene/ug18.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene/ug19.cpp b/engines/bladerunner/script/scene/ug19.cpp index cee17d1223..f73e9f8196 100644 --- a/engines/bladerunner/script/scene/ug19.cpp +++ b/engines/bladerunner/script/scene/ug19.cpp @@ -20,7 +20,7 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { diff --git a/engines/bladerunner/script/scene.cpp b/engines/bladerunner/script/scene_script.cpp index 646fa486af..639bca8c4e 100644 --- a/engines/bladerunner/script/scene.cpp +++ b/engines/bladerunner/script/scene_script.cpp @@ -20,11 +20,20 @@ * */ -#include "bladerunner/script/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { -bool SceneScript::Open(const Common::String &name) { +SceneScript::SceneScript(BladeRunnerEngine *vm) + : _vm(vm) + , _inScriptCounter(0) + , _currentScript(nullptr) {} + +SceneScript::~SceneScript() { + delete _currentScript; +} + +bool SceneScript::open(const Common::String &name) { delete _currentScript; if (name == "AR01") { _currentScript = new SceneScriptAR01(_vm); return true; } @@ -145,23 +154,19 @@ bool SceneScript::Open(const Common::String &name) { return false; } -SceneScript::~SceneScript() { - delete _currentScript; -} - -void SceneScript::InitializeScene() { +void SceneScript::initializeScene() { _inScriptCounter++; _currentScript->InitializeScene(); _inScriptCounter--; } -void SceneScript::SceneLoaded() { +void SceneScript::sceneLoaded() { _inScriptCounter++; _currentScript->SceneLoaded(); _inScriptCounter--; } -bool SceneScript::MouseClick(int x, int y) { +bool SceneScript::mouseClick(int x, int y) { if (_inScriptCounter > 0) return true; @@ -176,9 +181,10 @@ bool SceneScript::MouseClick(int x, int y) { return result; } -bool SceneScript::ClickedOn3DObject(const char *objectName, bool a2) { - if (_inScriptCounter > 0) +bool SceneScript::clickedOn3DObject(const char *objectName, bool a2) { + if (_inScriptCounter > 0) { return true; + } _inScriptCounter++; bool result = _currentScript->ClickedOn3DObject(objectName, a2); @@ -186,9 +192,10 @@ bool SceneScript::ClickedOn3DObject(const char *objectName, bool a2) { return result; } -bool SceneScript::ClickedOnActor(int actorId) { - if (_inScriptCounter > 0) +bool SceneScript::clickedOnActor(int actorId) { + if (_inScriptCounter > 0) { return true; + } _inScriptCounter++; bool result = _currentScript->ClickedOnActor(actorId); @@ -196,9 +203,10 @@ bool SceneScript::ClickedOnActor(int actorId) { return result; } -bool SceneScript::ClickedOnItem(int itemId, bool a2) { - if (_inScriptCounter > 0) +bool SceneScript::clickedOnItem(int itemId, bool a2) { + if (_inScriptCounter > 0) { return true; + } _inScriptCounter++; bool result = _currentScript->ClickedOnItem(itemId, a2); @@ -206,9 +214,10 @@ bool SceneScript::ClickedOnItem(int itemId, bool a2) { return result; } -bool SceneScript::ClickedOnExit(int exitId) { - if (_inScriptCounter > 0) +bool SceneScript::clickedOnExit(int exitId) { + if (_inScriptCounter > 0) { return true; + } _inScriptCounter++; bool result = _currentScript->ClickedOnExit(exitId); @@ -216,9 +225,10 @@ bool SceneScript::ClickedOnExit(int exitId) { return result; } -bool SceneScript::ClickedOn2DRegion(int region) { - if (_inScriptCounter > 0) +bool SceneScript::clickedOn2DRegion(int region) { + if (_inScriptCounter > 0) { return true; + } _inScriptCounter++; bool result = _currentScript->ClickedOn2DRegion(region); @@ -226,13 +236,13 @@ bool SceneScript::ClickedOn2DRegion(int region) { return result; } -void SceneScript::SceneFrameAdvanced(int frame) { +void SceneScript::sceneFrameAdvanced(int frame) { _inScriptCounter++; _currentScript->SceneFrameAdvanced(frame); _inScriptCounter--; } -void SceneScript::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +void SceneScript::actorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { _inScriptCounter++; //TODO remove this check if(_currentScript) @@ -240,19 +250,19 @@ void SceneScript::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool c _inScriptCounter--; } -void SceneScript::PlayerWalkedIn() { +void SceneScript::playerWalkedIn() { _inScriptCounter++; _currentScript->PlayerWalkedIn(); _inScriptCounter--; } -void SceneScript::PlayerWalkedOut() { +void SceneScript::playerWalkedOut() { _inScriptCounter++; _currentScript->PlayerWalkedOut(); _inScriptCounter--; } -void SceneScript::DialogueQueueFlushed(int a1) { +void SceneScript::dialogueQueueFlushed(int a1) { _inScriptCounter++; _currentScript->DialogueQueueFlushed(a1); _inScriptCounter--; diff --git a/engines/bladerunner/script/scene.h b/engines/bladerunner/script/scene_script.h index 9afe69669b..b38df3e5dc 100644 --- a/engines/bladerunner/script/scene.h +++ b/engines/bladerunner/script/scene_script.h @@ -529,29 +529,25 @@ protected: SceneScriptBase *_currentScript; public: - SceneScript(BladeRunnerEngine *vm) - : _vm(vm), - _inScriptCounter(0), - _currentScript(nullptr) { - } + SceneScript(BladeRunnerEngine *vm); ~SceneScript(); - bool Open(const Common::String &name); - - void InitializeScene(); - void SceneLoaded(); - bool MouseClick(int x, int y); - bool ClickedOn3DObject(const char *objectName, bool a2); - bool ClickedOnActor(int actorId); - bool ClickedOnItem(int itemId, bool a2); - bool ClickedOnExit(int exitId); - bool ClickedOn2DRegion(int region); - void SceneFrameAdvanced(int frame); - void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); - void PlayerWalkedIn(); - void PlayerWalkedOut(); - void DialogueQueueFlushed(int a1); - bool IsInsideScript() { return _inScriptCounter > 0; } + bool open(const Common::String &name); + + void initializeScene(); + void sceneLoaded(); + bool mouseClick(int x, int y); + bool clickedOn3DObject(const char *objectName, bool a2); + bool clickedOnActor(int actorId); + bool clickedOnItem(int itemId, bool a2); + bool clickedOnExit(int exitId); + bool clickedOn2DRegion(int region); + void sceneFrameAdvanced(int frame); + void actorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); + void playerWalkedIn(); + void playerWalkedOut(); + void dialogueQueueFlushed(int a1); + bool isInsideScript() const { return _inScriptCounter > 0; } }; } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 3f84f31ad0..c67f935fdc 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -53,11 +53,16 @@ #include "bladerunner/ui/esper.h" #include "bladerunner/ui/kia.h" #include "bladerunner/ui/spinner.h" +#include "bladerunner/ui/vk.h" #include "bladerunner/vector.h" #include "bladerunner/waypoints.h" namespace BladeRunner { +ScriptBase::ScriptBase(BladeRunnerEngine *vm) { + _vm = vm; +} + void ScriptBase::Preload(int animationId) { _vm->_sliceRenderer->preload(animationId); } @@ -243,13 +248,13 @@ void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause, Actor *actor = _vm->_actors[actorId]; - if(animationMode != -1) { + if (animationMode != -1) { actor->stopWalking(false); } actor->speechPlay(sentenceId, false); bool animationModeChanged = false; - if(animationMode >= 0) { + if (animationMode >= 0) { if (actorId != 0) { actor->changeAnimationMode(animationMode, false); animationModeChanged = true; @@ -1079,16 +1084,17 @@ int ScriptBase::Spinner_Interface_Choose_Dest(int loopId, bool immediately) { void ScriptBase::ESPER_Flag_To_Activate() { if (!_vm->_esper->isOpen()) { _vm->_esper->open(&_vm->_surfaceBack); - while (_vm->_esper->isOpen()) { + while (_vm->_esper->isOpen() && _vm->_gameIsRunning) { _vm->gameTick(); } } } -bool ScriptBase::Voight_Kampff_Activate(int actorId, int a2){ - //TODO - warning("Voight_Kampff_Activate(%d, %d)", actorId, a2); - return false; +void ScriptBase::Voight_Kampff_Activate(int actorId, int calibrationRatio){ + _vm->_vk->open(actorId, calibrationRatio); + while (_vm->_vk->isOpen() && _vm->_gameIsRunning) { + _vm->gameTick(); + } } int ScriptBase::Elevator_Activate(int elevatorId) { @@ -1102,7 +1108,7 @@ void ScriptBase::View_Score_Board() { // ScriptBase::Query_Score void ScriptBase::Set_Score(int a0, int a1) { - // debug("STUB: Set_Score(%d, %d)", a0, a1); + warning("Set_Score(%d, %d)", a0, a1); } void ScriptBase::Give_McCoy_Ammo(int ammoType, int ammo) { @@ -1291,28 +1297,25 @@ void ScriptBase::ESPER_Add_Photo(const char *name, int photoId, int shapeId) { _vm->_esper->addPhoto(name, photoId, shapeId); } -void ScriptBase::ESPER_Define_Special_Region(int regionId, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, const char *name) { - _vm->_esper->defineRegion(regionId, Common::Rect(a2, a3, a4, a5), Common::Rect(a6, a7, a8, a9), Common::Rect(a10, a11, a12, a13), name); +void ScriptBase::ESPER_Define_Special_Region(int regionId, int innerLeft, int innerTop, int innerRight, int innerBottom, int outerLeft, int outerTop, int outerRight, int outerBottom, int selectionLeft, int selectionTop, int selectionRight, int selectionBottom, const char *name) { + _vm->_esper->defineRegion(regionId, Common::Rect(innerLeft, innerTop, innerRight, innerBottom), Common::Rect(outerLeft, outerTop, outerRight, outerBottom), Common::Rect(selectionLeft, selectionTop, selectionRight, selectionBottom), name); } -void ScriptBase::VK_Add_Question(int intensity, int questionId, int a3) { - //TODO - warning("VK_Add_Question(%d, %d, %d)", intensity, questionId, a3); +void ScriptBase::VK_Play_Speech_Line(int actorId, int sentenceId, float duration) { + _vm->_vk->playSpeechLine(actorId, sentenceId, duration); } -void ScriptBase::VK_Eye_Animates(int a1) { - //TODO - warning("VK_Eye_Animates(%d)", a1); +void ScriptBase::VK_Add_Question(int intensity, int sentenceId, int relatedSentenceId) { + _vm->_vk->addQuestion(intensity, sentenceId, relatedSentenceId); } -void ScriptBase::VK_Subject_Reacts(int a1, int a2, int a3, int a4) { - //TODO - warning("VK_Subject_Reacts(%d, %d, %d, %d)", a1, a2, a3, a4); +void ScriptBase::VK_Subject_Reacts(int intensity, int humanResponse, int replicantResponse, int anxiety) { + _vm->gameWaitForActive(); + _vm->_vk->subjectReacts(intensity, humanResponse, replicantResponse, anxiety); } -void ScriptBase::VK_Play_Speech_Line(int actorId, int sentenceId, float a3) { - //TODO - warning("VK_Play_Speech_Line(%d, %d, %g)", actorId, sentenceId, a3); +void ScriptBase::VK_Eye_Animates(int loopId) { + _vm->_vk->eyeAnimates(loopId); } } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index 154345f73f..4632a64340 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -37,9 +37,7 @@ protected: BladeRunnerEngine *_vm; public: - ScriptBase(BladeRunnerEngine *vm) { - _vm = vm; - } + ScriptBase(BladeRunnerEngine *vm); virtual ~ScriptBase() {} protected: @@ -232,7 +230,7 @@ protected: // Spinner_Query_Selectable_Destination_Flag(int destination); int Spinner_Interface_Choose_Dest(int loopId, bool immediately); void ESPER_Flag_To_Activate(); - bool Voight_Kampff_Activate(int actorId, int a2); + void Voight_Kampff_Activate(int actorId, int calibrationRatio); int Elevator_Activate(int elevatorId); void View_Score_Board(); // Query_Score @@ -273,16 +271,16 @@ protected: void AI_Movement_Track_Flush(int actorId); void ESPER_Add_Photo(const char *name, int photoId, int shapeId); - void ESPER_Define_Special_Region(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, const char *name); + void ESPER_Define_Special_Region(int regionId, int innerLeft, int innerTop, int innerRight, int innerBottom, int outerLeft, int outerTop, int outerRight, int outerBottom, int selectionLeft, int selectionTop, int selectionRight, int selectionBottom, const char *name); void KIA_Play_Actor_Dialogue(int actorId, int sentenceId); void KIA_Play_Slice_Model(int sliceModelId); void KIA_Play_Photograph(int photographId); - void VK_Play_Speech_Line(int actorId, int sentenceId, float a3); - void VK_Add_Question(int intensity, int questionId, int a3); - void VK_Subject_Reacts(int a1, int a2, int a3, int a4); - void VK_Eye_Animates(int a1); + void VK_Play_Speech_Line(int actorId, int sentenceId, float duration); + void VK_Add_Question(int intensity, int sentenceId, int relatedSentenceId); + void VK_Subject_Reacts(int intensity, int humanResponse, int replicantResponse, int anxiety); + void VK_Eye_Animates(int loopId); }; } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/vk.cpp b/engines/bladerunner/script/vk_script.cpp index 7b5f378396..8a7ddb26eb 100644 --- a/engines/bladerunner/script/vk.cpp +++ b/engines/bladerunner/script/vk_script.cpp @@ -20,12 +20,71 @@ * */ -#include "bladerunner/script/vk.h" +#include "bladerunner/script/vk_script.h" #include "bladerunner/bladerunner.h" +#include "bladerunner/mouse.h" namespace BladeRunner { +VKScript::VKScript(BladeRunnerEngine *vm) : ScriptBase(vm) { + _inScriptCounter = 0; + _calibrationQuestionCounter = 0; + _questionCounter = 0; +} + +void VKScript::initialize(int actorId) { + ++_inScriptCounter; + _vm->_mouse->disable(); + SCRIPT_VK_DLL_Initialize(actorId); + _vm->_mouse->enable(); + --_inScriptCounter; +} + +void VKScript::calibrate(int actorId) { + ++_inScriptCounter; + _vm->_mouse->disable(); + SCRIPT_VK_DLL_Calibrate(actorId); + _vm->_mouse->enable(); + --_inScriptCounter; +} + +void VKScript::beginTest(int actorId) { + ++_inScriptCounter; + _vm->_mouse->disable(); + SCRIPT_VK_DLL_Begin_Test(actorId); + _vm->_mouse->enable(); + --_inScriptCounter; +} + +void VKScript::mcCoyAsksQuestion(int actorId, int questionId) { + ++_inScriptCounter; + _vm->_mouse->disable(); + SCRIPT_VK_DLL_McCoy_Asks_Question(actorId, questionId); + _vm->_mouse->enable(); + --_inScriptCounter; +} + +void VKScript::questionAsked(int actorId, int questionId) { + ++_inScriptCounter; + _vm->_mouse->disable(); + SCRIPT_VK_DLL_Question_Asked(actorId, questionId); + _vm->_mouse->enable(); + --_inScriptCounter; +} + +void VKScript::shutdown(int actorId, int humanPercentage, int replicantPercentage, int anxiety) { + ++_inScriptCounter; + _vm->_mouse->disable(); + SCRIPT_VK_DLL_Shutdown(actorId, humanPercentage, replicantPercentage, anxiety); + _vm->_mouse->enable(); + --_inScriptCounter; +} + +bool VKScript::isInsideScript() const { + return _inScriptCounter > 0; +} + bool VKScript::SCRIPT_VK_DLL_Initialize(int actorId) { VK_Add_Question(0, 7400, -1); VK_Add_Question(0, 7405, -1); @@ -83,24 +142,24 @@ bool VKScript::SCRIPT_VK_DLL_Initialize(int actorId) { } void VKScript::SCRIPT_VK_DLL_Calibrate(int actorId) { - if (calibrationQuestionCounter == 0) { + if (_calibrationQuestionCounter == 0) { VK_Play_Speech_Line(kActorMcCoy, 7370, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7385, 0.5f); askCalibrationQuestion1(actorId, 7385); - } else if (calibrationQuestionCounter == 1) { + } else if (_calibrationQuestionCounter == 1) { VK_Play_Speech_Line(kActorMcCoy, 7390, 0.5f); askCalibrationQuestion2(actorId, 7390); - } else if (calibrationQuestionCounter == 2) { + } else if (_calibrationQuestionCounter == 2) { VK_Play_Speech_Line(kActorMcCoy, 7395, 0.5f); askCalibrationQuestion3(actorId, 7395); } - if (++calibrationQuestionCounter > 3) { - calibrationQuestionCounter = 0; + if (++_calibrationQuestionCounter > 3) { + _calibrationQuestionCounter = 0; } } -bool VKScript::SCRIPT_VK_DLL_Begin_Test() { - unknown2 = 0; +bool VKScript::SCRIPT_VK_DLL_Begin_Test(int actorId) { + _questionCounter = 0; return false; } @@ -220,7 +279,7 @@ void VKScript::SCRIPT_VK_DLL_McCoy_Asks_Question(int actorId, int questionId) { VK_Play_Speech_Line(kActorMcCoy, 7620, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7625, 0.5f); if (actorId != kActorBulletBob) { - if (actorId == kActorDektora && Game_Flag_Query(47)) { + if (actorId == kActorDektora && Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2330, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7880, 0.5f); } @@ -293,7 +352,7 @@ void VKScript::SCRIPT_VK_DLL_McCoy_Asks_Question(int actorId, int questionId) { VK_Play_Speech_Line(kActorMcCoy, 7780, 0.5f); break; } - if (++unknown2 >= 10) { + if (++_questionCounter >= 10) { VK_Subject_Reacts(5, 0, 0, 100); } } @@ -318,7 +377,7 @@ void VKScript::SCRIPT_VK_DLL_Question_Asked(int actorId, int questionId) { } } -void VKScript::SCRIPT_VK_DLL_Shutdown(int actorId, signed int humanPercentage, signed replicantPercentage) { +void VKScript::SCRIPT_VK_DLL_Shutdown(int actorId, int humanPercentage, int replicantPercentage, int anxiety) { if (humanPercentage > 79 && replicantPercentage > 79) { VK_Play_Speech_Line(kActorAnsweringMachine, 450, 0.5f); } else if (replicantPercentage > 79) { @@ -373,7 +432,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1240, 0.5f); break; case 7390: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 1250, 0.5f); VK_Subject_Reacts(40, 0, 2, 5); VK_Play_Speech_Line(kActorLucy, 1260, 0.5f); @@ -384,7 +443,7 @@ void VKScript::askLucy(int questionId) { } break; case 7395: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 1280, 0.5f); VK_Subject_Reacts(40, 0, 0, 0); } else { @@ -393,7 +452,7 @@ void VKScript::askLucy(int questionId) { } break; case 7400: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, 0, 8, -5); } else { VK_Subject_Reacts(30, 9, 0, -10); @@ -403,7 +462,7 @@ void VKScript::askLucy(int questionId) { break; case 7405: VK_Play_Speech_Line(kActorLucy, 1310, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(50, 1, 11, 5); } else { VK_Subject_Reacts(60, 11, 1, 5); @@ -411,7 +470,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1320, 0.5f); break; case 7410: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(40, 1, 10, -5); VK_Eye_Animates(2); } else { @@ -420,7 +479,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1330, 0.5f); break; case 7415: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 1340, 0.5f); VK_Subject_Reacts(50, 1, 11, -5); VK_Play_Speech_Line(kActorMcCoy, 7935, 0.5f); @@ -434,7 +493,7 @@ void VKScript::askLucy(int questionId) { VK_Eye_Animates(3); VK_Play_Speech_Line(kActorLucy, 1370, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 8000, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(50, 1, 11, -8); } else { VK_Subject_Reacts(60, 11, -2, -8); @@ -443,7 +502,7 @@ void VKScript::askLucy(int questionId) { break; case 7425: VK_Play_Speech_Line(kActorLucy, 1400, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, -2, 9, -2); } else { VK_Subject_Reacts(20, 9, -2, -2); @@ -452,7 +511,7 @@ void VKScript::askLucy(int questionId) { break; case 7430: VK_Play_Speech_Line(kActorLucy, 1420, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, -1, 9, -3); } else { VK_Subject_Reacts(30, 9, -1, -3); @@ -462,7 +521,7 @@ void VKScript::askLucy(int questionId) { VK_Eye_Animates(2); break; case 7435: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 1440, 0.5f); VK_Subject_Reacts(30, 5, 10, 2); } else { @@ -472,7 +531,7 @@ void VKScript::askLucy(int questionId) { break; case 7440: VK_Play_Speech_Line(kActorLucy, 1460, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(40, 5, 10, 2); VK_Eye_Animates(3); } else { @@ -481,7 +540,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1470, 0.5f); break; case 7445: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 1480, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7940, 0.5f); VK_Subject_Reacts(50, 4, 11, 10); @@ -494,7 +553,7 @@ void VKScript::askLucy(int questionId) { } break; case 7450: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, 3, 9, -6); } else { VK_Subject_Reacts(30, 9, 4, -6); @@ -505,7 +564,7 @@ void VKScript::askLucy(int questionId) { case 7455: VK_Play_Speech_Line(kActorLucy, 1540, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7950, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(10, 1, 8, -5); } else { VK_Subject_Reacts(10, 9, -1, -2); @@ -513,7 +572,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1550, 0.5f); break; case 7460: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(30, 1, 10, -5); } else { VK_Subject_Reacts(30, 9, 2, -5); @@ -525,7 +584,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1580, 0.5f); break; case 7465: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(40, -1, 11, 2); VK_Play_Speech_Line(kActorLucy, 1590, 0.5f); } else { @@ -535,7 +594,7 @@ void VKScript::askLucy(int questionId) { } break; case 7470: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 1610, 0.5f); VK_Subject_Reacts(20, 3, 9, -5); VK_Play_Speech_Line(kActorLucy, 1620, 0.5f); @@ -548,7 +607,7 @@ void VKScript::askLucy(int questionId) { } break; case 7475: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Eye_Animates(3); VK_Play_Speech_Line(kActorLucy, 1660, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7965, 0.5f); @@ -567,7 +626,7 @@ void VKScript::askLucy(int questionId) { case 7480: VK_Play_Speech_Line(kActorLucy, 1720, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7975, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, 2, 10, 7); } else { VK_Subject_Reacts(50, 12, 3, 7); @@ -576,7 +635,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorMcCoy, 7980, 0.5f); break; case 7485: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, -2, 10, 6); } else { VK_Subject_Reacts(30, 10, -2, 6); @@ -585,7 +644,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1740, 0.5f); break; case 7490: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(30, 3, 11, 9); } else { VK_Subject_Reacts(40, 11, 1, 8); @@ -596,7 +655,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1760, 0.5f); break; case 7495: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(10, 2, 8, 5); } else { VK_Subject_Reacts(30, 10, -1, 5); @@ -606,7 +665,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1780, 0.5f); break; case 7515: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(50, -1, 12, 5); VK_Play_Speech_Line(kActorLucy, 1790, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7995, 0.5f); @@ -617,7 +676,7 @@ void VKScript::askLucy(int questionId) { } break; case 7525: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, -4, 9, 5); VK_Eye_Animates(3); } else { @@ -629,7 +688,7 @@ void VKScript::askLucy(int questionId) { case 7535: VK_Play_Speech_Line(kActorLucy, 1830, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 8000, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(10, 1, 8, 0); } else { VK_Subject_Reacts(20, 9, -1, 0); @@ -639,7 +698,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorMcCoy, 8005, 0.5f); break; case 7540: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Eye_Animates(3); VK_Play_Speech_Line(kActorLucy, 1860, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 8010, 0.5f); @@ -652,7 +711,7 @@ void VKScript::askLucy(int questionId) { break; case 7550: VK_Play_Speech_Line(kActorLucy, 1890, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, 2, 9, -1); } else { VK_Subject_Reacts(10, 8, -1, -2); @@ -662,7 +721,7 @@ void VKScript::askLucy(int questionId) { break; case 7565: VK_Play_Speech_Line(kActorLucy, 1910, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(30, -2, 10, 8); } else { VK_Subject_Reacts(20, 9, -3, 6); @@ -673,7 +732,7 @@ void VKScript::askLucy(int questionId) { break; case 7580: VK_Play_Speech_Line(kActorLucy, 1930, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(20, 5, 10, -1); } else { VK_Subject_Reacts(30, 10, 3, 0); @@ -690,7 +749,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 1970, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7590, 0.5f); VK_Play_Speech_Line(kActorLucy, 1980, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(40, 1, 11, 5); } else { VK_Subject_Reacts(50, 12, -3, 5); @@ -701,7 +760,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 2000, 0.5f); break; case 7595: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 2010, 0.5f); VK_Subject_Reacts(30, -2, 10, 5); VK_Play_Speech_Line(kActorLucy, 2020, 0.5f); @@ -713,7 +772,7 @@ void VKScript::askLucy(int questionId) { } break; case 7600: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(75, 4, 13, 15); } else { VK_Subject_Reacts(60, 12, -2, 10); @@ -726,7 +785,7 @@ void VKScript::askLucy(int questionId) { break; case 7605: VK_Play_Speech_Line(kActorLucy, 2070, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(30, 0, 11, 12); } else { VK_Subject_Reacts(50, 10, -3, 15); @@ -734,7 +793,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 2080, 0.5f); break; case 7620: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(60, -2, 14, 12); } else { VK_Subject_Reacts(70, 9, -1, 10); @@ -750,7 +809,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorMcCoy, 7655, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7660, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7665, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(80, 5, 14, 25); } else { VK_Subject_Reacts(70, 9, -2, 20); @@ -758,7 +817,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 2120, 0.5f); break; case 7670: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Play_Speech_Line(kActorLucy, 2130, 0.5f); VK_Subject_Reacts(30, -3, 11, 8); VK_Play_Speech_Line(kActorLucy, 2140, 0.5f); @@ -771,7 +830,7 @@ void VKScript::askLucy(int questionId) { case 7680: VK_Eye_Animates(2); VK_Play_Speech_Line(kActorLucy, 2170, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(65, 1, 6, 5); } else { VK_Subject_Reacts(50, 10, 3, 4); @@ -779,7 +838,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 2180, 0.5f); break; case 7690: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(40, 0, 12, 0); } else { VK_Subject_Reacts(50, 13, 0, 0); @@ -791,7 +850,7 @@ void VKScript::askLucy(int questionId) { VK_Play_Speech_Line(kActorLucy, 2210, 0.5f); break; case 7705: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Eye_Animates(3); VK_Subject_Reacts(30, 0, 0, 0); VK_Play_Speech_Line(kActorLucy, 2220, 0.5f); @@ -819,7 +878,7 @@ void VKScript::askLucy(int questionId) { } break; case 7740: - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(40, -3, -1, 3); } else { VK_Subject_Reacts(50, -1, -3, 3); @@ -834,7 +893,7 @@ void VKScript::askLucy(int questionId) { break; case 7750: VK_Eye_Animates(3); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(60, 4, 10, 15); } else { VK_Subject_Reacts(80, 12, -3, 18); @@ -845,7 +904,7 @@ void VKScript::askLucy(int questionId) { break; case 7770: VK_Play_Speech_Line(kActorLucy, 2350, 0.5f); - if (Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagLucyIsReplicant)) { VK_Subject_Reacts(90, -3, -1, 12); } else { VK_Eye_Animates(2); @@ -1135,7 +1194,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 1480, 0.5f); break; case 7400: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 1490, 0.5f); VK_Subject_Reacts(15, -1, 9, 0); VK_Play_Speech_Line(kActorDektora, 1500, 0.5f); @@ -1146,7 +1205,7 @@ void VKScript::askDektora(int questionId) { break; case 7405: VK_Eye_Animates(3); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 1520, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7840, 0.5f); VK_Subject_Reacts(20, -1, 9, 10); @@ -1170,7 +1229,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 1610, 0.5f); break; case 7420: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 1620, 0.5f); VK_Subject_Reacts(25, -1, 9, 0); } else { @@ -1189,7 +1248,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 1660, 0.5f); break; case 7435: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 1670, 0.5f); VK_Subject_Reacts(60, -2, 9, 0); VK_Play_Speech_Line(kActorDektora, 1680, 0.5f); @@ -1227,7 +1286,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorMcCoy, 7815, 0.5f); break; case 7460: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Subject_Reacts(40, -2, 10, 10); VK_Play_Speech_Line(kActorDektora, 1810, 0.5f); } else { @@ -1236,7 +1295,7 @@ void VKScript::askDektora(int questionId) { } break; case 7465: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Subject_Reacts(60, -3, 10, 5); VK_Play_Speech_Line(kActorDektora, 1830, 0.5f); } else { @@ -1245,7 +1304,7 @@ void VKScript::askDektora(int questionId) { } break; case 7470: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 1850, 0.5f); VK_Subject_Reacts(50, -2, 11, 0); VK_Play_Speech_Line(kActorDektora, 1860, 0.5f); @@ -1261,7 +1320,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 1900, 0.5f); break; case 7480: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Subject_Reacts(55, -3, 12, 5); VK_Play_Speech_Line(kActorDektora, 1910, 0.5f); } else { @@ -1289,7 +1348,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 1990, 0.5f); break; case 7515: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2000, 0.5f); VK_Subject_Reacts(72, -3, 12, 2); VK_Play_Speech_Line(kActorDektora, 2010, 0.5f); @@ -1309,7 +1368,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 2070, 0.5f); break; case 7535: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2080, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7845, 0.5f); VK_Play_Speech_Line(kActorDektora, 2090, 0.5f); @@ -1326,7 +1385,7 @@ void VKScript::askDektora(int questionId) { break; case 7540: VK_Eye_Animates(2); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Subject_Reacts(70, -5, 12, 80); VK_Play_Speech_Line(kActorDektora, 2140, 0.5f); } else { @@ -1372,7 +1431,7 @@ void VKScript::askDektora(int questionId) { case 7600: VK_Play_Speech_Line(kActorDektora, 2300, 0.5f); VK_Subject_Reacts(30, 4, 4, 5); - if (!Game_Flag_Query(47)) { + if (!Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2310, 0.5f); } break; @@ -1393,7 +1452,7 @@ void VKScript::askDektora(int questionId) { break; case 7670: VK_Eye_Animates(3); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2380, 0.5f); VK_Play_Speech_Line(kActorMcCoy, 7890, 0.5f); VK_Play_Speech_Line(kActorDektora, 2390, 0.5f); @@ -1408,7 +1467,7 @@ void VKScript::askDektora(int questionId) { break; case 7680: VK_Eye_Animates(3); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Subject_Reacts(70, -4, 14, 15); VK_Play_Speech_Line(kActorDektora, 2440, 0.5f); } else { @@ -1425,7 +1484,7 @@ void VKScript::askDektora(int questionId) { break; case 7705: VK_Eye_Animates(3); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2500, 0.5f); VK_Subject_Reacts(85, 7, 14, 20); VK_Play_Speech_Line(kActorDektora, 2510, 0.5f); @@ -1443,7 +1502,7 @@ void VKScript::askDektora(int questionId) { VK_Play_Speech_Line(kActorDektora, 2560, 0.5f); break; case 7750: - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2580, 0.5f); VK_Subject_Reacts(90, -5, 14, 20); VK_Play_Speech_Line(kActorDektora, 2590, 0.5f); @@ -1459,7 +1518,7 @@ void VKScript::askDektora(int questionId) { break; case 7770: VK_Eye_Animates(2); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { VK_Play_Speech_Line(kActorDektora, 2630, 0.5f); VK_Subject_Reacts(99, 6, 15, 30); } else { diff --git a/engines/bladerunner/script/vk.h b/engines/bladerunner/script/vk_script.h index ee82843ae1..6f09c12abe 100644 --- a/engines/bladerunner/script/vk.h +++ b/engines/bladerunner/script/vk_script.h @@ -30,21 +30,29 @@ namespace BladeRunner { class BladeRunnerEngine; class VKScript : ScriptBase { + int _inScriptCounter; + int _calibrationQuestionCounter; + int _questionCounter; + public: - VKScript(BladeRunnerEngine *vm) - : ScriptBase(vm) { - } + VKScript(BladeRunnerEngine *vm); + + void initialize(int actorId); + void calibrate(int actorId); + void beginTest(int actorId); + void mcCoyAsksQuestion(int actorId, int questionId); + void questionAsked(int actorId, int questionId); + void shutdown(int actorId, int humanPercentage, int replicantPercentage, int anxiety); + bool isInsideScript() const; + +private: bool SCRIPT_VK_DLL_Initialize(int actorId); void SCRIPT_VK_DLL_Calibrate(int actorId); - bool SCRIPT_VK_DLL_Begin_Test(); + bool SCRIPT_VK_DLL_Begin_Test(int actorId); void SCRIPT_VK_DLL_McCoy_Asks_Question(int actorId, int questionId); void SCRIPT_VK_DLL_Question_Asked(int actorId, int questionId); - void SCRIPT_VK_DLL_Shutdown(int actorId, signed int humanPercentage, signed int replicantPercentage); - -private: - int calibrationQuestionCounter; - int unknown2; + void SCRIPT_VK_DLL_Shutdown(int actorId, int humanPercentage, int replicantPercentage, int anxiety); void askLucy(int questionId); void askGrigorian(int questionId); @@ -62,4 +70,3 @@ private: } // End of namespace BladeRunner #endif - diff --git a/engines/bladerunner/ui/elevator.cpp b/engines/bladerunner/ui/elevator.cpp index 4c72be2345..2e6f036b4b 100644 --- a/engines/bladerunner/ui/elevator.cpp +++ b/engines/bladerunner/ui/elevator.cpp @@ -46,7 +46,7 @@ Elevator::Elevator(BladeRunnerEngine *vm) { Elevator::~Elevator() { delete _imagePicker; - reset(); + _imagePicker = nullptr; } int Elevator::activate(int elevatorId) { diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp index 3df6f7d11b..79b8f5d3ac 100644 --- a/engines/bladerunner/ui/esper.cpp +++ b/engines/bladerunner/ui/esper.cpp @@ -31,7 +31,7 @@ #include "bladerunner/game_info.h" #include "bladerunner/mouse.h" #include "bladerunner/shape.h" -#include "bladerunner/script/esper.h" +#include "bladerunner/script/esper_script.h" #include "bladerunner/text_resource.h" #include "bladerunner/ui/ui_image_picker.h" #include "bladerunner/vqa_player.h" @@ -39,8 +39,6 @@ #include "common/rect.h" #include "common/str.h" -#include "graphics/surface.h" - namespace BladeRunner { ESPER::ESPER(BladeRunnerEngine *vm) { @@ -55,12 +53,10 @@ ESPER::ESPER(BladeRunnerEngine *vm) { _isDrawingSelection = false; _isOpen = false; - _photoData = nullptr; - _viewportData = nullptr; _shapeButton = nullptr; _shapeThumbnail = nullptr; - _vqaMainPlayer = nullptr; - _vqaPhotoPlayer = nullptr; + _vqaPlayerMain = nullptr; + _vqaPlayerPhoto = nullptr; _script = nullptr; reset(); @@ -94,11 +90,9 @@ void ESPER::open(Graphics::Surface *surface) { return; } - _photoData = new Graphics::Surface(); - _photoData->create(kPhotoWidth, kPhotoHeight, createRGB555()); + _surfacePhoto.create(kPhotoWidth, kPhotoHeight, createRGB555()); - _viewportData = new Graphics::Surface(); - _viewportData->create(_screen.width(), _screen.height(), createRGB555()); + _surfaceViewport.create(_screen.width(), _screen.height(), createRGB555()); _viewportNext = _viewport; @@ -111,11 +105,11 @@ void ESPER::open(Graphics::Surface *surface) { _shapesPhotos.resize(10); - _vqaMainPlayer = new VQAPlayer(_vm, &_vm->_surfaceBack); - if (!_vqaMainPlayer->open("ESPER.VQA")) { + _vqaPlayerMain = new VQAPlayer(_vm, &_vm->_surfaceBack); + if (!_vqaPlayerMain->open("ESPER.VQA")) { return; } - _vqaMainPlayer->setLoop(2, -1, kLoopSetModeJustStart, nullptr, nullptr); + _vqaPlayerMain->setLoop(2, -1, kLoopSetModeJustStart, nullptr, nullptr); _isOpen = true; _flash = false; @@ -143,16 +137,14 @@ void ESPER::close() { delete _shapeButton; _shapeButton = nullptr; - delete _photoData; - _photoData = nullptr; + _surfacePhoto.free(); - delete _viewportData; - _viewportData = nullptr; + _surfaceViewport.free(); - if (_vqaMainPlayer) { - _vqaMainPlayer->close(); - delete _vqaMainPlayer; - _vqaMainPlayer= nullptr; + if (_vqaPlayerMain) { + _vqaPlayerMain->close(); + delete _vqaPlayerMain; + _vqaPlayerMain= nullptr; } _vm->closeArchive("MODE.MIX"); @@ -163,7 +155,7 @@ void ESPER::close() { reset(); } -bool ESPER::isOpen() { +bool ESPER::isOpen() const { return _isOpen; } @@ -197,7 +189,7 @@ void ESPER::handleMouseDown(int x, int y, bool mainButton) { _isMouseDown = true; playSound(460, 100); } - if ( _mouseOverScroll >= 0 && _mouseOverScroll <= 3 && !_isScrolling) { + if (_mouseOverScroll >= 0 && _mouseOverScroll <= 3 && !_isScrolling) { scrollingStart(_mouseOverScroll); } tick(); @@ -210,7 +202,7 @@ void ESPER::handleMouseDown(int x, int y, bool mainButton) { } void ESPER::tick() { - if (!_vm->_windowIsActive) { + if (!_vm->_gameIsRunning) { return; } @@ -230,7 +222,8 @@ void ESPER::tick() { draw(_vm->_surfaceFront); _buttons->draw(_vm->_surfaceFront); - tickMouse(_vm->_surfaceFront); + drawMouse(_vm->_surfaceFront); + tickSound(); _vm->blitToScreen(_vm->_surfaceFront); @@ -315,11 +308,9 @@ void ESPER::mouseUpCallback(int buttonId, void *callbackData) { } void ESPER::reset() { - delete _photoData; - _photoData = nullptr; + _surfacePhoto.free(); - delete _viewportData; - _viewportData = nullptr; + _surfaceViewport.free(); delete _shapeButton; _shapeButton = nullptr; @@ -327,11 +318,11 @@ void ESPER::reset() { delete _shapeThumbnail; _shapeThumbnail = nullptr; - delete _vqaMainPlayer; - _vqaMainPlayer = nullptr; + delete _vqaPlayerMain; + _vqaPlayerMain = nullptr; - delete _vqaPhotoPlayer; - _vqaPhotoPlayer = nullptr; + delete _vqaPlayerPhoto; + _vqaPlayerPhoto = nullptr; delete _script; _script = nullptr; @@ -343,10 +334,10 @@ void ESPER::reset() { } void ESPER::resetData() { - if (_vqaPhotoPlayer) { - _vqaPhotoPlayer->close(); - delete _vqaPhotoPlayer; - _vqaPhotoPlayer = nullptr; + if (_vqaPlayerPhoto) { + _vqaPlayerPhoto->close(); + delete _vqaPlayerPhoto; + _vqaPlayerPhoto = nullptr; } if (_shapeThumbnail) { @@ -565,7 +556,7 @@ void ESPER::draw(Graphics::Surface &surface) { if (!_isOpen) { return; } - _vqaMainPlayer->update(false); + _vqaPlayerMain->update(false); switch (_stateMain) { case kEsperMainStateOpening: case kEsperMainStateList: @@ -669,7 +660,7 @@ void ESPER::drawPhotoOpening(Graphics::Surface &surface) { _timePhotoOpeningNext = timeNow + 20; } - copyImageScale(_photoData, _viewport, &surface, Common::Rect(_screen.left, _screen.top, _photoOpeningWidth, _photoOpeningHeight)); + copyImageScale(&_surfacePhoto, _viewport, &surface, Common::Rect(_screen.left, _screen.top, _photoOpeningWidth, _photoOpeningHeight)); surface.hLine(_screen.left, _photoOpeningHeight, _screen.right - 1, 0x03E0); surface.vLine(_photoOpeningWidth, _screen.top, _screen.bottom - 1, 0x03E0); @@ -819,13 +810,13 @@ void ESPER::drawPhotoSharpening(Graphics::Surface &surface) { } if (_regionSelectedAck && !_regions[_regionSelected].name.empty()) { - _vqaPhotoPlayer->update(true, false); - copyImageBlur(_viewportData, Common::Rect(0, 0, 299, 263), &surface, _screen, _blur); - copyImageBlit(_viewportData, Common::Rect(0, 0, 0, 0), &surface, Common::Rect(_screen.left, _screen.top, _photoOpeningWidth, _photoOpeningHeight)); + _vqaPlayerPhoto->update(true, false); + copyImageBlur(&_surfaceViewport, Common::Rect(0, 0, 299, 263), &surface, _screen, _blur); + copyImageBlit(&_surfaceViewport, Common::Rect(0, 0, 0, 0), &surface, Common::Rect(_screen.left, _screen.top, _photoOpeningWidth, _photoOpeningHeight)); } else { drawPhoto(surface); - copyImageScale(_photoData, _viewport, _viewportData, Common::Rect(0, 0, _screen.width(), _screen.height())); - copyImageBlit(_viewportData, Common::Rect(0, 0, 0, 0), &surface, Common::Rect(_screen.left, _screen.top, _photoOpeningWidth, _photoOpeningHeight)); + copyImageScale(&_surfacePhoto, _viewport, &_surfaceViewport, Common::Rect(0, 0, _screen.width(), _screen.height())); + copyImageBlit(&_surfaceViewport, Common::Rect(0, 0, 0, 0), &surface, Common::Rect(_screen.left, _screen.top, _photoOpeningWidth, _photoOpeningHeight)); } drawGrid(surface); @@ -871,14 +862,14 @@ void ESPER::drawPhotoZoomOut(Graphics::Surface &surface) { } void ESPER::drawVideoZooming(Graphics::Surface &surface) { - if (_vqaPhotoPlayer == nullptr) { - _vqaPhotoPlayer = new VQAPlayer(_vm, _viewportData); - if (!_vqaPhotoPlayer->open(Common::String(_regions[_regionSelected].name) + ".VQA")) { + if (_vqaPlayerPhoto == nullptr) { + _vqaPlayerPhoto = new VQAPlayer(_vm, &_surfaceViewport); + if (!_vqaPlayerPhoto->open(Common::String(_regions[_regionSelected].name) + ".VQA")) { setStatePhoto(kEsperPhotoStateShow); _vm->_mouse->enable(); - delete _vqaPhotoPlayer; - _vqaPhotoPlayer = nullptr; + delete _vqaPlayerPhoto; + _vqaPlayerPhoto = nullptr; return; } @@ -897,8 +888,8 @@ void ESPER::drawVideoZooming(Graphics::Surface &surface) { _blur += _zoomDelta * 5.0f; } - int frame = _vqaPhotoPlayer->update(true, advanceFrame); - if (frame == _vqaPhotoPlayer->getFrameCount() - 1) { + int frame = _vqaPlayerPhoto->update(true, advanceFrame); + if (frame == _vqaPlayerPhoto->getFrameCount() - 1) { _vqaLastFrame = frame; setStatePhoto(kEsperPhotoStatePhotoSharpening); } @@ -906,7 +897,7 @@ void ESPER::drawVideoZooming(Graphics::Surface &surface) { if (flash) { flashViewport(); } - copyImageBlur(_viewportData, Common::Rect(0, 0, 299, 263), &surface, _screen, _blur); + copyImageBlur(&_surfaceViewport, Common::Rect(0, 0, 299, 263), &surface, _screen, _blur); drawGrid(surface); } @@ -918,8 +909,8 @@ void ESPER::drawVideoZoomOut(Graphics::Surface &surface) { _timeZoomNext = timeNow + 300; playSound(419, 25); //TODO: implement frame loading after seek, then advanceFrame can be removed - _vqaPhotoPlayer->seekToFrame(_vqaLastFrame); - int nextFrame = _vqaPhotoPlayer->getFrameCount() / 4; + _vqaPlayerPhoto->seekToFrame(_vqaLastFrame); + int nextFrame = _vqaPlayerPhoto->getFrameCount() / 4; if (nextFrame <= 0) { nextFrame = 1; } else if (nextFrame > 4) { @@ -930,29 +921,27 @@ void ESPER::drawVideoZoomOut(Graphics::Surface &surface) { _vqaLastFrame -= nextFrame; } - _vqaPhotoPlayer->update(true, advanceFrame); + _vqaPlayerPhoto->update(true, advanceFrame); if (flash) { flashViewport(); } - copyImageBlit(_viewportData, Common::Rect(0, 0, 0, 0), &surface, _screen); + copyImageBlit(&_surfaceViewport, Common::Rect(0, 0, 0, 0), &surface, _screen); drawGrid(surface); if (timeNow > _timeZoomNext && _vqaLastFrame <= 0) { - _vqaPhotoPlayer->close(); - delete _vqaPhotoPlayer; - _vqaPhotoPlayer = nullptr; + _vqaPlayerPhoto->close(); + delete _vqaPlayerPhoto; + _vqaPlayerPhoto = nullptr; - //TODO: there is code to stop zooming, but it is not working properly in original game - // if (_isMouseDown) { - // zoomOutStart(); - // } else { - // zoomOutStop(); - // } - zoomOutStart(); + if (_vm->isMouseButtonDown()) { + zoomOutStart(); + } else { + zoomOutStop(); + } } } void ESPER::drawPhoto(Graphics::Surface &surface) { - copyImageBlur(_photoData, _viewport, &surface, _screen, _blur); + copyImageBlur(&_surfacePhoto, _viewport, &surface, _screen, _blur); } void ESPER::drawGrid(Graphics::Surface &surface) { @@ -966,7 +955,7 @@ void ESPER::drawGrid(Graphics::Surface &surface) { } void ESPER::drawPhotoWithGrid(Graphics::Surface &surface) { - copyImageScale(_photoData, _viewport, &surface, _screen); + copyImageScale(&_surfacePhoto, _viewport, &surface, _screen); drawGrid(surface); } @@ -1028,8 +1017,8 @@ void ESPER::drawSelection(Graphics::Surface &surface, bool crosshair, int style) } void ESPER::drawVideoFrame(Graphics::Surface &surface) { - _vqaPhotoPlayer->update(true, false); - copyImageBlit(_viewportData, Common::Rect(0, 0, 0, 0), &surface, _screen); + _vqaPlayerPhoto->update(true, false); + copyImageBlit(&_surfaceViewport, Common::Rect(0, 0, 0, 0), &surface, _screen); } void ESPER::drawTextCoords(Graphics::Surface &surface) { @@ -1038,9 +1027,92 @@ void ESPER::drawTextCoords(Graphics::Surface &surface) { _vm->_mainFont->drawColor(Common::String::format("EW %04d", 12 * _viewport.left + 167), surface, 364, 364, 0x001F); } +void ESPER::drawMouse(Graphics::Surface &surface) { + if (_vm->_mouse->isDisabled()) { + return; + } + + int cursor = -1; + + Common::Point p = _vm->getMousePos(); + + _mouseOverScroll = 4; + if (_stateMain == kEsperMainStatePhoto) { + if (_screen.contains(p)) { + if ((_statePhoto == kEsperPhotoStateShow) && ( _zoom != 2.0f)) { + if (_isMouseDown) { + if (_isDrawingSelection) { + _selection.right = p.x; + _selection.bottom = p.y; + } else { + _selection.left = p.x; + _selection.top = p.y; + _selection.right = p.x + 1; + _selection.bottom = p.y + 1; + _isDrawingSelection = true; + } + } else { + if (_isDrawingSelection) { + _selection.right = p.x; + _selection.bottom = p.y; + + if (_selection.right < _selection.left) { + SWAP(_selection.left, _selection.right); + } + if (_selection.bottom < _selection.top) { + SWAP(_selection.bottom, _selection.top); + } + + if (_selection.right >= _selection.left + 3) { + updateSelection(); + _vm->_mouse->disable(); + zoomingStart(); + } else { + resetSelectionRect(); + } + } + _isDrawingSelection = false; + } + } + surface.vLine(p.x, p.y - 8, p.y - 1, 0x03E0); + surface.vLine(p.x, p.y + 8, p.y + 1, 0x03E0); + surface.hLine(p.x - 8, p.y, p.x - 1, 0x03E0); + surface.hLine(p.x + 8, p.y, p.x + 1, 0x03E0); + _mouseOverScroll = -1; + } else if (p.x >= 85 && p.y >= 73 && p.x <= 484 && p.y <= 436) { + if (!_isDrawingSelection && _statePhoto != kEsperPhotoStateVideoShow && _zoom != 2.0f) { + _mouseOverScroll = (angle_1024((_screen.left + _screen.right) / 2, (_screen.top + _screen.bottom) / 2, p.x, p.y) + 128) / 256; + if (_mouseOverScroll >= 4) { + _mouseOverScroll = 0; + } + if (_mouseOverScroll == 0 && this->_viewport.top == 0) { + _mouseOverScroll = 4; + } else if (_mouseOverScroll == 1 && this->_viewport.right == kPhotoWidth - 1) { + _mouseOverScroll = 4; + } else if (_mouseOverScroll == 2 && this->_viewport.bottom == kPhotoHeight - 1) { + _mouseOverScroll = 4; + } else if (_mouseOverScroll == 3 && this->_viewport.left == 0) { + _mouseOverScroll = 4; + } + if (_mouseOverScroll != 4) { + cursor = _mouseOverScroll + 2; + } + } + } + } + + if (_mouseOverScroll == 4) { + cursor = _buttons->hasHoveredImage() ? 1 : 0; + } + if (cursor != -1) { + _vm->_mouse->setCursor(cursor); + _vm->_mouse->draw(surface, p.x, p.y); + } +} + void ESPER::flashViewport() { - uint16 *ptr = (uint16 *)_viewportData->getPixels(); - for (int i = 0; i < _viewportData->w * _viewportData->h; ++i) { + uint16 *ptr = (uint16 *)_surfaceViewport.getPixels(); + for (int i = 0; i < _surfaceViewport.w * _surfaceViewport.h; ++i) { int8 r = (*ptr >> 10) & 0x1F; int8 g = (*ptr >> 5) & 0x1F; int8 b = (*ptr ) & 0x1F; @@ -1303,89 +1375,6 @@ void ESPER::tickSound() { } } -void ESPER::tickMouse(Graphics::Surface &surface) { - if (_vm->_mouse->isDisabled()) { - return; - } - - int cursor = -1; - - Common::Point p = _vm->getMousePos(); - - _mouseOverScroll = 4; - if (_stateMain == kEsperMainStatePhoto) { - if (_screen.contains(p)) { - if ((_statePhoto == kEsperPhotoStateShow) && ( _zoom != 2.0f)) { - if (_isMouseDown) { - if (_isDrawingSelection) { - _selection.right = p.x; - _selection.bottom = p.y; - } else { - _selection.left = p.x; - _selection.top = p.y; - _selection.right = p.x + 1; - _selection.bottom = p.y + 1; - _isDrawingSelection = true; - } - } else { - if (_isDrawingSelection) { - _selection.right = p.x; - _selection.bottom = p.y; - - if (_selection.right < _selection.left) { - SWAP(_selection.left, _selection.right); - } - if (_selection.bottom < _selection.top) { - SWAP(_selection.bottom, _selection.top); - } - - if (_selection.right >= _selection.left + 3) { - updateSelection(); - _vm->_mouse->disable(); - zoomingStart(); - } else { - resetSelectionRect(); - } - } - _isDrawingSelection = false; - } - } - surface.vLine(p.x, p.y - 8, p.y - 1, 0x03E0); - surface.vLine(p.x, p.y + 8, p.y + 1, 0x03E0); - surface.hLine(p.x - 8, p.y, p.x - 1, 0x03E0); - surface.hLine(p.x + 8, p.y, p.x + 1, 0x03E0); - _mouseOverScroll = -1; - } else if (p.x >= 85 && p.y >= 73 && p.x <= 484 && p.y <= 436) { - if (!_isDrawingSelection && _statePhoto != kEsperPhotoStateVideoShow && _zoom != 2.0f) { - _mouseOverScroll = (angle_1024((_screen.left + _screen.right) / 2, (_screen.top + _screen.bottom) / 2, p.x, p.y) + 128) / 256; - if (_mouseOverScroll >= 4) { - _mouseOverScroll = 0; - } - if (_mouseOverScroll == 0 && this->_viewport.top == 0) { - _mouseOverScroll = 4; - } else if (_mouseOverScroll == 1 && this->_viewport.right == kPhotoWidth - 1) { - _mouseOverScroll = 4; - } else if (_mouseOverScroll == 2 && this->_viewport.bottom == kPhotoHeight - 1) { - _mouseOverScroll = 4; - } else if (_mouseOverScroll == 3 && this->_viewport.left == 0) { - _mouseOverScroll = 4; - } - if (_mouseOverScroll != 4) { - cursor = _mouseOverScroll + 2; - } - } - } - } - - if (_mouseOverScroll == 4) { - cursor = _buttons->hasHoveredImage() ? 1 : 0; - } - if (cursor != -1) { - _vm->_mouse->setCursor(cursor); - _vm->_mouse->draw(surface, p.x, p.y); - } -} - void ESPER::tickScroll() { int timeNow = _vm->getTotalPlayTime(); if (timeNow <= _timeScrollNext) { @@ -1425,20 +1414,20 @@ void ESPER::selectPhoto(int photoId) { reset(); } - int photoSize = _photoData->w * _photoData->h * _photoData->format.bytesPerPixel; + int photoSize = _surfacePhoto.w * _surfacePhoto.h * _surfacePhoto.format.bytesPerPixel; s->skip(3); // not used, but there is compression type uint width = s->readUint32LE(); uint height = s->readUint32LE(); int photoCompressedSize = s->size() - s->pos(); - uint8 *photoCompressed = (uint8 *)_photoData->getPixels() + photoSize - photoCompressedSize; + uint8 *photoCompressed = (uint8 *)_surfacePhoto.getPixels() + photoSize - photoCompressedSize; s->read(photoCompressed, photoCompressedSize); - decompress_lcw(photoCompressed, photoCompressedSize, (uint8 *)_photoData->getPixels(), photoSize); + decompress_lcw(photoCompressed, photoCompressedSize, (uint8 *)_surfacePhoto.getPixels(), photoSize); // apply palette for (uint j = 0; j < width * height; ++j) { - // _photoData[j] = Palette[_photoData[j]]; + // _surfacePhoto[j] = Palette[_surfacePhoto[j]]; } _shapeThumbnail = new Shape(_vm); diff --git a/engines/bladerunner/ui/esper.h b/engines/bladerunner/ui/esper.h index d63efa31bd..4a1c606498 100644 --- a/engines/bladerunner/ui/esper.h +++ b/engines/bladerunner/ui/esper.h @@ -26,9 +26,7 @@ #include "common/array.h" #include "common/rect.h" -namespace Graphics { -struct Surface; -} +#include "graphics/surface.h" namespace BladeRunner { @@ -96,11 +94,11 @@ class ESPER { UIImagePicker *_buttons; - Graphics::Surface *_photoData; - Graphics::Surface *_viewportData; + Graphics::Surface _surfacePhoto; + Graphics::Surface _surfaceViewport; - VQAPlayer *_vqaMainPlayer; - VQAPlayer *_vqaPhotoPlayer; + VQAPlayer *_vqaPlayerMain; + VQAPlayer *_vqaPlayerPhoto; int _vqaLastFrame; Shape *_shapeButton; @@ -190,7 +188,7 @@ public: void open(Graphics::Surface *surface); void close(); - bool isOpen(); + bool isOpen() const; void handleMouseUp(int x, int y, bool buttonLeft); void handleMouseDown(int x, int y, bool buttonLeft); @@ -242,6 +240,7 @@ private: void drawSelection(Graphics::Surface &surface, bool crosshair, int style); void drawVideoFrame(Graphics::Surface &surface); void drawTextCoords(Graphics::Surface &surface); + void drawMouse(Graphics::Surface &surface); void flashViewport(); @@ -250,7 +249,6 @@ private: void copyImageBlit(Graphics::Surface *src, Common::Rect srcRect, Graphics::Surface *dst, Common::Rect dstRect); void tickSound(); - void tickMouse(Graphics::Surface &surface); void tickScroll(); int findEmptyPhoto(); diff --git a/engines/bladerunner/ui/kia.cpp b/engines/bladerunner/ui/kia.cpp index 729bec8d84..c27a548b3a 100644 --- a/engines/bladerunner/ui/kia.cpp +++ b/engines/bladerunner/ui/kia.cpp @@ -33,7 +33,7 @@ #include "bladerunner/mouse.h" #include "bladerunner/scene.h" #include "bladerunner/shape.h" -#include "bladerunner/script/kia.h" +#include "bladerunner/script/kia_script.h" #include "bladerunner/settings.h" #include "bladerunner/slice_renderer.h" #include "bladerunner/text_resource.h" @@ -192,7 +192,7 @@ void KIA::open(KIASections sectionId) { } } -bool KIA::isOpen() { +bool KIA::isOpen() const { return _currentSectionId != kKIASectionNone; } @@ -350,8 +350,8 @@ void KIA::tick() { _buttons->drawTooltip(_vm->_surfaceFront, mouse.x, mouse.y); } _vm->_mouse->draw(_vm->_surfaceFront, mouse.x, mouse.y); - _vm->blitToScreen(_vm->_surfaceFront); + _vm->blitToScreen(_vm->_surfaceFront); _vm->_system->delayMillis(10); _timeLast = timeNow; diff --git a/engines/bladerunner/ui/kia.h b/engines/bladerunner/ui/kia.h index 0ac7a22600..1c2dc19d9f 100644 --- a/engines/bladerunner/ui/kia.h +++ b/engines/bladerunner/ui/kia.h @@ -25,7 +25,6 @@ #include "common/str.h" - namespace Common { struct KeyState; } @@ -68,7 +67,6 @@ enum KIASections { kKIASectionPogo = 10 }; - class KIA { static const char *kPogo; static const int kPlayerActorDialogueQueueCapacity = 31; @@ -130,7 +128,7 @@ public: void openLastOpened(); void open(KIASections sectionId); - bool isOpen(); + bool isOpen() const; void tick(); diff --git a/engines/bladerunner/ui/kia_section_clues.cpp b/engines/bladerunner/ui/kia_section_clues.cpp index fc6270b938..e003e9bb28 100644 --- a/engines/bladerunner/ui/kia_section_clues.cpp +++ b/engines/bladerunner/ui/kia_section_clues.cpp @@ -29,7 +29,7 @@ #include "bladerunner/game_flags.h" #include "bladerunner/game_info.h" #include "bladerunner/font.h" -#include "bladerunner/script/kia.h" +#include "bladerunner/script/kia_script.h" #include "bladerunner/text_resource.h" #include "bladerunner/ui/kia.h" #include "bladerunner/ui/kia_log.h" @@ -76,6 +76,7 @@ KIASectionClues::~KIASectionClues() { _uiContainer->clear(); delete _filterScrollBox; delete _cluesScrollBox; + delete _buttons; delete _uiContainer; } diff --git a/engines/bladerunner/ui/kia_section_crimes.cpp b/engines/bladerunner/ui/kia_section_crimes.cpp index b70f790659..417a0588e0 100644 --- a/engines/bladerunner/ui/kia_section_crimes.cpp +++ b/engines/bladerunner/ui/kia_section_crimes.cpp @@ -30,7 +30,7 @@ #include "bladerunner/game_flags.h" #include "bladerunner/game_info.h" #include "bladerunner/shape.h" -#include "bladerunner/script/kia.h" +#include "bladerunner/script/kia_script.h" #include "bladerunner/suspects_database.h" #include "bladerunner/text_resource.h" #include "bladerunner/ui/kia.h" diff --git a/engines/bladerunner/ui/kia_section_suspects.cpp b/engines/bladerunner/ui/kia_section_suspects.cpp index 0cad1123d7..af2c457d92 100644 --- a/engines/bladerunner/ui/kia_section_suspects.cpp +++ b/engines/bladerunner/ui/kia_section_suspects.cpp @@ -30,7 +30,7 @@ #include "bladerunner/game_flags.h" #include "bladerunner/game_info.h" #include "bladerunner/shape.h" -#include "bladerunner/script/kia.h" +#include "bladerunner/script/kia_script.h" #include "bladerunner/suspects_database.h" #include "bladerunner/text_resource.h" #include "bladerunner/ui/kia.h" diff --git a/engines/bladerunner/ui/ui_image_picker.cpp b/engines/bladerunner/ui/ui_image_picker.cpp index c0015f1721..639c02f592 100644 --- a/engines/bladerunner/ui/ui_image_picker.cpp +++ b/engines/bladerunner/ui/ui_image_picker.cpp @@ -136,7 +136,11 @@ bool UIImagePicker::setImageTooltip(int i, const char *tooltip) { return false; } - _images[i].tooltip = tooltip; + if (tooltip != nullptr) { + _images[i].tooltip = tooltip; + } else { + _images[i].tooltip.clear(); + } return true; } @@ -191,14 +195,17 @@ void UIImagePicker::draw(Graphics::Surface &surface) { continue; } - // TODO: Check interaction with Mouse::isDisabled if (i == _hoveredImageIndex && i == _pressedImageIndex && _isButtonDown) { - if (img.shapeDown) { - img.shapeDown->draw(surface, img.rect.left, img.rect.top); + if (!_vm->_mouse->isDisabled()) { + if (img.shapeDown) { + img.shapeDown->draw(surface, img.rect.left, img.rect.top); + } } } else if (i == _hoveredImageIndex && !_isButtonDown) { - if (img.shapeHovered) { - img.shapeHovered->draw(surface, img.rect.left, img.rect.top); + if (!_vm->_mouse->isDisabled()) { + if (img.shapeHovered) { + img.shapeHovered->draw(surface, img.rect.left, img.rect.top); + } } } else { if (img.shapeUp) { @@ -222,6 +229,11 @@ void UIImagePicker::drawTooltip(Graphics::Surface &surface, int x, int y) { } Common::String &tooltip = _images[_hoveredImageIndex].tooltip; + + if (tooltip.empty()) { + return; + } + int width = _vm->_mainFont->getTextWidth(tooltip) + 1; int height = _vm->_mainFont->getTextHeight(tooltip) + 1; diff --git a/engines/bladerunner/ui/vk.cpp b/engines/bladerunner/ui/vk.cpp new file mode 100644 index 0000000000..fab58e994f --- /dev/null +++ b/engines/bladerunner/ui/vk.cpp @@ -0,0 +1,917 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/ui/vk.h" + +#include "bladerunner/actor.h" +#include "bladerunner/ambient_sounds.h" +#include "bladerunner/audio_player.h" +#include "bladerunner/bladerunner.h" +#include "bladerunner/combat.h" +#include "bladerunner/font.h" +#include "bladerunner/game_constants.h" +#include "bladerunner/game_flags.h" +#include "bladerunner/game_info.h" +#include "bladerunner/mouse.h" +#include "bladerunner/music.h" +#include "bladerunner/scene.h" +#include "bladerunner/shape.h" +#include "bladerunner/script/vk_script.h" +#include "bladerunner/slice_renderer.h" +#include "bladerunner/text_resource.h" +#include "bladerunner/ui/ui_image_picker.h" +#include "bladerunner/vqa_player.h" + +#include "common/str.h" +#include "common/keyboard.h" + +namespace BladeRunner { + +VK::VK(BladeRunnerEngine *vm) { + _vm = vm; + + reset(); +} + +VK::~VK() { + reset(); +} + +void VK::open(int actorId, int calibrationRatio) { + if (!_vm->openArchive("MODE.MIX")) { + return; + } + + reset(); + + _questions.resize(3); + for (int i = 0; i < (int)_questions.size(); ++i) { + _questions[i].resize(18); + for (int j = 0; j < (int)_questions[i].size(); ++j) { + _questions[i][j].isPresent = false; + _questions[i][j].wasAsked = false; + } + } + + _volumeAmbient = _vm->_ambientSounds->getVolume(); + _volumeMusic = _vm->_music->getVolume(); + + _actorId = actorId; + _calibrationRatio = calibrationRatio; + _calibration = 0; + + _buttons = new UIImagePicker(_vm, 8); + + _shapes.resize(15); + for (int i = 0; i < (int)_shapes.size(); ++i) { + _shapes[i] = new Shape(_vm); + _shapes[i]->open("VK.SHP", i); + } + + _vqaPlayerMain = new VQAPlayer(_vm, &_vm->_surfaceBack); + if (!_vqaPlayerMain->open("VK.VQA")) { + return; + } + + Common::String eyeVqa; + switch (actorId) { + case kActorDektora: + eyeVqa = "VKDEKT.VQA"; + break; + case kActorLucy: + eyeVqa = "VKLUCY.VQA"; + break; + case kActorGrigorian: + eyeVqa = "VKKASH.VQA"; + break; + case kActorBulletBob: + eyeVqa = "VKBOB.VQA"; + break; + case kActorRunciter: + eyeVqa = "VKRUNC.VQA"; + break; + default: + return; + } + + _surfaceEye.create(172, 116, createRGB555()); + _vqaPlayerEye = new VQAPlayer(_vm, &_surfaceEye); + if (!_vqaPlayerEye->open(eyeVqa)) { + return; + } + if (!_vqaPlayerEye->setLoop(0, -1, kLoopSetModeEnqueue, nullptr, nullptr)) { + return; + } + + _isOpen = true; + + _script = new VKScript(_vm); + + //TODO: time->lock() + + init(); +} + +bool VK::isOpen() const { + return _isOpen; +} + +void VK::close() { + if (_vm->_audioPlayer->isActive(_soundTrackId1)) { + _vm->_audioPlayer->stop(_soundTrackId1, false); + } + + if (_vm->_audioPlayer->isActive(_soundTrackId3)) { + _vm->_audioPlayer->stop(_soundTrackId3, false); + } + + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(458), 33, 0, 0, 50, 0); + + _script->shutdown(_actorId, _humanProbability, _replicantProbability, _anxiety); + + delete _script; + _script = nullptr; + + + if (_buttons) { + _buttons->deactivate(); + _buttons->resetImages(); + delete _buttons; + _buttons = nullptr; + } + + if (_vqaPlayerEye) { + _vqaPlayerEye->close(); + delete _vqaPlayerEye; + _vqaPlayerEye = nullptr; + } + + if (_vqaPlayerMain) { + _vqaPlayerMain->close(); + delete _vqaPlayerMain; + _vqaPlayerMain = nullptr; + } + + _questions.clear(); + + for (int i = 0; i < (int)_shapes.size(); ++i) { + delete _shapes[i]; + } + _shapes.clear(); + + _vm->closeArchive("MODE.MIX"); + _vm->_music->setVolume(_volumeMusic); + _vm->_ambientSounds->setVolume(_volumeAmbient); + + // TODO: time->unlock(); + // _vm->_scene->resume(false); +} + +void VK::tick() { + int mouseX, mouseY; + _vm->_mouse->getXY(&mouseX, &mouseY); + if (!_vm->_mouse->isDisabled()) { + _buttons->handleMouseAction(mouseX, mouseY, false, false, false); + } + + draw(); + + _vm->blitToScreen(_vm->_surfaceFront); + _vm->_system->delayMillis(10); + + if (_isClosing && (int)_vm->getTotalPlayTime() >= _timeClose && !_script->isInsideScript()) { + close(); + _vm->_mouse->enable(); + reset(); + } +} + +void VK::handleMouseDown(int mouseX, int mouseY, bool mainButton) { + if (!_vm->_mouse->isDisabled()) { + if (!_buttons->handleMouseAction(mouseX, mouseY, true, false, false)) { + tick(); + } + } +} + +void VK::handleMouseUp(int mouseX, int mouseY, bool mainButton) { + if (!_vm->_mouse->isDisabled()) { + _buttons->handleMouseAction(mouseX, mouseY, false, true, false); + } +} + +void VK::addQuestion(int intensity, int sentenceId, int relatedSentenceId) { + for (int i = 0; i < (int)_questions[intensity].size(); ++i) { + if (!_questions[intensity][i].isPresent) { + _questions[intensity][i].isPresent = true; + _questions[intensity][i].sentenceId = sentenceId; + _questions[intensity][i].relatedSentenceId = relatedSentenceId; + return; + } + } +} + +void VK::playSpeechLine(int actorId, int sentenceId, float duration) { + _vm->gameWaitForActive(); + + _vm->_mouse->disable(); + + Actor *actor = _vm->_actors[actorId]; + actor->speechPlay(sentenceId, true); + + while (_vm->_gameIsRunning) { + // ActorSpeaking = 1; + _vm->_speechSkipped = false; + _vm->gameTick(); + // ActorSpeaking = 0; + if (_vm->_speechSkipped || !actor->isSpeeching()) { + actor->speechStop(); + break; + } + } + + if (duration > 0.0f && !_vm->_speechSkipped) { + int timeEnd = duration * 1000.0f + _vm->getTotalPlayTime(); + while (timeEnd > (int)_vm->getTotalPlayTime() && _vm->_gameIsRunning) { + _vm->gameTick(); + } + } + + _vm->_speechSkipped = false; + + _vm->_mouse->enable(); +} + +void VK::subjectReacts(int intensity, int humanResponse, int replicantResponse, int anxiety) { + humanResponse = CLIP(humanResponse, -20, 20); + replicantResponse = CLIP(replicantResponse, -20, 20); + + int timeNow = _vm->getTotalPlayTime(); + + if (intensity > 0) { + _needleValueTarget = 78 * intensity / 100; + _needleValueDelta = (_needleValueTarget - _needleValue) / 10; + _timeNextNeedleStep = timeNow + 66; + } + + if (humanResponse != 0) { + _humanProbability = CLIP(_humanProbability + humanResponse + _calibration, 0, 100); + if (_humanProbability >= 80 && !_isClosing) { + _isClosing = true; + _timeClose = timeNow + 3000; + _vm->_mouse->disable(); + } + _humanGaugeTarget = humanResponse; + _humanGaugeDelta = humanResponse / 10; + if (_humanGaugeDelta == 0) { + _humanGaugeDelta = humanResponse / abs(humanResponse); + } + } + + if (replicantResponse != 0) { + _replicantProbability = CLIP(_replicantProbability + replicantResponse - _calibration, 0, 100); + if (_replicantProbability >= 80 && !_isClosing) { + _isClosing = true; + _timeClose = timeNow + 3000; + _vm->_mouse->disable(); + } + _replicantGaugeTarget = replicantResponse; + _replicantGauge = replicantResponse / 10; + if (_replicantGaugeDelta == 0) { + _replicantGaugeDelta = replicantResponse / abs(replicantResponse); + } + } + + _anxiety = CLIP(_anxiety + anxiety, 0, 100); + if (_anxiety == 100 && !_isClosing) { + _isClosing = true; + _timeClose = timeNow + 3000; + _vm->_mouse->disable(); + } +} + +void VK::eyeAnimates(int loopId) { + _vqaPlayerEye->setLoop(loopId, -1, kLoopSetModeImmediate, nullptr, nullptr); + _vqaPlayerEye->setLoop(0, -1, kLoopSetModeEnqueue, nullptr, nullptr); +} + +void VK::mouseDownCallback(int buttonId, void *callbackData) { + VK *self = (VK *)callbackData; + + switch (buttonId) { + case 1: + self->startAdjustement(); + break; + case 2: + case 3: + case 4: + if (self->_calibrationStarted) { + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(457), 100, 0, 0, 50, 0); + } + break; + case 5: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(457), 100, 0, 0, 50, 0); + break; + default: + return; + } +} + +void VK::mouseUpCallback(int buttonId, void *callbackData) { + VK *self = (VK *)callbackData; + + switch (buttonId) { + case 0: + self->calibrate(); + break; + case 1: + self->stopAdjustement(); + break; + case 2: + self->askQuestion(0); + break; + case 3: + self->askQuestion(1); + break; + case 4: + self->askQuestion(2); + break; + case 5: + self->_isClosing = true; + break; + default: + return; + } +} + +void VK::loopEnded(void *callbackData, int frame, int loopId) { + VK *self = (VK *)callbackData; + + self->_vqaLoopEnded = true; + self->_vqaPlayerMain->setLoop(2, -1, kLoopSetModeJustStart, nullptr, nullptr); +} + +void VK::reset() { + _buttons = nullptr; + _vqaPlayerMain = nullptr; + _vqaPlayerEye = nullptr; + + _script = nullptr; + + _isOpen = false; + + _shapes.clear(); + + _calibrationCounter = 0; + _calibrationStarted = false; + _calibration = 0; + + _testStarted = false; + + _needleValue = 0; + _needleValueTarget = 0; + _needleValueDelta = 0; + _timeNextNeedleStep = 0; + _timeNeedleReturn = 0; + _timeNextNeedleOscillate = 0; + + _humanProbability = 0; + _humanGauge = 0; + _humanGaugeTarget = 0; + _humanGaugeDelta = 0; + _timeNextHumanGaugeStep = 0; + + _replicantProbability = 0; + _replicantGauge = 0; + _replicantGaugeTarget = 0; + _replicantGaugeDelta = 0; + _timeNextReplicantGaugeStep = 0; + + _anxiety = 0; + + _blinkState = 0; + _timeNextBlink = 0; + _timeNextGaugesBlink = 0; + + _isClosing = false; + _timeClose = 0; + + _isAdjusting = false; + _adjustment = 154; + _adjustmentTarget = 154; + _adjustmentDelta = 0; + + _eyeLineSelected = 1; + _eyeLineX = 315; + _eyeLineXLast = 315; + _eyeLineY = 281; + _eyeLineYLast = 281; + _eyeLineXDelta = 8; + _eyeLineYDelta = 8; + _timeNextEyeLineStep = 0; + _timeNextEyeLineStart = 0; + + _soundTrackId1 = -1; + _soundTrackId2 = -1; + _soundTrackId3 = -1; + _vqaLoopEnded = false; + + _surfaceEye.free(); +} + +void VK::init() { + _vm->_mouse->disable(); + + _buttons->activate(nullptr, nullptr, mouseDownCallback, mouseUpCallback, this); + _buttons->defineImage(0, Common::Rect(191, 364, 218, 373), nullptr, _shapes[2], _shapes[3], _vm->_textVK->getText(1)); + _buttons->defineImage(1, Common::Rect(154, 258, 161, 265), _shapes[4], _shapes[4], _shapes[5], _vm->_textVK->getText(2)); + _buttons->defineImage(2, Common::Rect(515, 368, 538, 398), nullptr, _shapes[6], _shapes[7], nullptr); + _buttons->defineImage(3, Common::Rect(548, 368, 571, 398), nullptr, _shapes[8], _shapes[9], nullptr); + _buttons->defineImage(4, Common::Rect(581, 368, 604, 398), nullptr, _shapes[10], _shapes[11], nullptr); + _buttons->defineImage(5, Common::Rect( 31, 363, 65, 392), nullptr, _shapes[0], _shapes[1], _vm->_textVK->getText(0)); + _buttons->defineImage(6, Common::Rect( 59, 262, 87, 277), nullptr, nullptr, nullptr, _vm->_textVK->getText(6)); + _buttons->defineImage(7, Common::Rect( 59, 306, 87, 322), nullptr, nullptr, nullptr, _vm->_textVK->getText(7)); + + _script->initialize(_actorId); + + _vqaPlayerMain->setLoop(0, -1, kLoopSetModeJustStart, nullptr, nullptr); + tick(); + _vqaPlayerMain->setLoop(1, -1, kLoopSetModeEnqueue, loopEnded, this); +} + +void VK::draw() { + if (!_isOpen || !_vm->_gameIsRunning) { + return; + } + + int frame = _vqaPlayerMain->update(); + if (frame >= 0) { + _vqaFrameMain = frame; + } + + if (frame == 0) { + _soundTrackId2 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(426), 33, 0, 0, 50, 0); + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(431), 50, 0, 0, 50, 0); + } else if (frame == 26) { + _vm->_audioPlayer->stop(_soundTrackId2, false); + _soundTrackId1 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(429), 50, 30, 30, 50, kAudioPlayerLoop); + } else if (frame == 40) { + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(428), 33, 0, 0, 50, 0); + eyeAnimates(1); + } else if (frame == 59) { + _vm->_mouse->enable(); + _buttons->setImageShapeHovered(2, nullptr); + _buttons->setImageShapeDown(2, nullptr); + _buttons->setImageShapeHovered(3, nullptr); + _buttons->setImageShapeDown(3, nullptr); + _buttons->setImageShapeHovered(4, nullptr); + _buttons->setImageShapeDown(4, nullptr); + } else if (frame == 100) { + if (_vm->_rnd.getRandomNumberRng(0, 100) > 60) { + eyeAnimates(1); + } + } else if (frame == 140) { + if (_vm->_rnd.getRandomNumberRng(0, 10) > 6) { + _soundTrackId3 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(459), 83, 0, 0, 50, 0); + } + } + + blit(_vm->_surfaceBack, _vm->_surfaceFront); + + Graphics::Surface &surface = _vm->_surfaceFront; + + int timeNow = _vm->getTotalPlayTime(); + + if (_isAdjusting && !_testStarted && !_vm->isMouseButtonDown()) { + _isAdjusting = false; + } + + if (_vqaFrameMain >= 26) { + if (_isClosing && timeNow >= _timeNextGaugesBlink) { + if (_blinkState) { + _buttons->setImageShapeUp(6, nullptr); + _buttons->setImageShapeUp(7, nullptr); + _blinkState = 0; + } else { + if (_humanProbability >= 80) { + _buttons->setImageShapeUp(6, _shapes[13]); + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(0), 100, 0, 0, 50, 0); + } + if (_replicantProbability >= 80) { + _buttons->setImageShapeUp(7, _shapes[14]); + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(0), 100, 0, 0, 50, 0); + } + _blinkState = 1; + } + _timeNextGaugesBlink = timeNow + 600; + } + + _buttons->draw(surface); + + if (_humanGaugeDelta != 0 && timeNow >= _timeNextHumanGaugeStep) { + _humanGauge += _humanGaugeDelta; + + if ((_humanGaugeDelta > 0 && _humanGauge >= _humanGaugeTarget) + || (_humanGaugeDelta < 0 && _humanGauge <= _humanGaugeTarget)) { + _humanGauge = _humanGaugeTarget; + } + + if (_humanGauge == _humanGaugeTarget) { + if (_humanGaugeTarget != 0) { + _humanGaugeTarget = 0; + _humanGaugeDelta = -_humanGaugeDelta; + _timeNextHumanGaugeStep = timeNow + 500; + } else { + _humanGaugeDelta = 0; + } + } else { + _timeNextHumanGaugeStep = timeNow + 66; + } + } + drawHumanGauge(surface); + + if (_replicantGaugeDelta != 0 && timeNow >= _timeNextReplicantGaugeStep) { + _replicantGauge += _replicantGaugeDelta; + + if ((_replicantGaugeDelta > 0 && _replicantGauge >= _replicantGaugeTarget) + || (_replicantGaugeDelta < 0 && _replicantGauge <= _replicantGaugeTarget)) { + _replicantGauge = _replicantGaugeTarget; + } + + if (_replicantGauge == _replicantGaugeTarget) { + if (_replicantGaugeTarget != 0) { + _replicantGaugeTarget = 0; + _replicantGaugeDelta = -_replicantGaugeDelta; + _timeNextReplicantGaugeStep = timeNow + 500; + } else { + _replicantGaugeDelta = 0; + } + } else { + _timeNextReplicantGaugeStep = timeNow + 66; + } + } + drawReplicantGauge(surface); + + if (!_calibrationStarted && _vqaFrameMain >= 59 && timeNow >= _timeNextBlink) { + if (_blinkState) { + _buttons->setImageShapeUp(0, nullptr); + _blinkState = false; + } else { + _buttons->setImageShapeUp(0, _shapes[2]); + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(461), 50, 0, 0, 50, 0); + _blinkState = true; + } + _timeNextBlink = timeNow + 600; + } + + if (_adjustmentDelta != 0 && timeNow >= _timeNextAdjustementStep) { + if (_adjustmentDelta > 0) { + _adjustment += 3; + if (_adjustment >= _adjustmentTarget) { + _adjustment = _adjustmentTarget; + _adjustmentDelta = 0; + } + } else { + _adjustment -= 3; + if (_adjustment <= _adjustmentTarget) { + _adjustment = _adjustmentTarget; + _adjustmentDelta = 0; + } + } + setAdjustment(_adjustment + 4); + } + setAdjustmentFromMouse(); + + if (_calibrationStarted && !_testStarted && timeNow >= _timeNextBlink) { + if (_blinkState) { + _buttons->setImageShapeUp(2, nullptr); + _buttons->setImageShapeUp(3, nullptr); + _buttons->setImageShapeUp(4, nullptr); + _blinkState = 0; + } else { + _buttons->setImageShapeUp(2, _shapes[7]); + _buttons->setImageShapeUp(3, _shapes[9]); + _buttons->setImageShapeUp(4, _shapes[11]); + _blinkState = 1; + + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(462), 33, 0, 0, 50, 0); + } + _timeNextBlink = timeNow + 600; + } + + if (_needleValueDelta != 0 && timeNow >= _timeNextNeedleStep) { + if (_needleValueDelta > 0) { + _needleValue += 4; + if (_needleValue >= _needleValueTarget) { + _needleValue = _needleValueTarget; + _needleValueMax = _needleValueTarget; + _needleValueDelta = -_needleValueDelta; + _needleValueTarget = 0; + + _timeNeedleReturn = timeNow + 1800; + + if (!_testStarted) { + animateAdjustment(_needleValueMax + 165); + } + } + } else if (timeNow >= _timeNeedleReturn) { + _needleValue -= 4; + if (_needleValue <= _needleValueTarget) { + _needleValue = _needleValueTarget; + _needleValueDelta = 0; + } + } + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(455), 20, 0, 0, 50, 0); + _timeNextNeedleStep = timeNow + 66; + } + + drawNeedle(surface); + drawEye(surface); + drawEyeCrosshair(surface, timeNow); + if (timeNow >= _timeNextNeedleOscillate) { + _timeNextNeedleOscillate = timeNow + 66; + } + int mouseX, mouseY; + _vm->_mouse->getXY(&mouseX, &mouseY); + _buttons->drawTooltip(surface, mouseX, mouseY); + } + + drawMouse(surface); +} + +void VK::drawNeedle(Graphics::Surface &surface) { + int x = _needleValue + 165; + if ((int)_vm->getTotalPlayTime() >= _timeNextNeedleOscillate && x > 165) { + x = CLIP(x + (int)_vm->_rnd.getRandomNumberRng(0, 4) - 2, 165, 245); + } + + float needleOffset = abs(38.0f - _needleValue); + float y = 345 - sqrt(72.0f * 72.0f - needleOffset * needleOffset); + + float colorIntensity = MIN(78.0f, _needleValue + 39.0f) / 78.0f; + + int r = 6 * colorIntensity; + int g = 8 * colorIntensity; + int b = 12 * colorIntensity; + + surface.drawLine(203, 324, x - 2, y, ((7 - r ) << 10) | ((18 - g ) << 5) | (23 - b )); + surface.drawLine(203, 324, x + 2, y, ((7 - r ) << 10) | ((18 - g ) << 5) | (23 - b )); + surface.drawLine(203, 324, x - 1, y, ((7 - r / 2) << 10) | ((18 - g / 2) << 5) | (23 - b / 2)); + surface.drawLine(203, 324, x + 1, y, ((7 - r / 2) << 10) | ((18 - g / 2) << 5) | (23 - b / 2)); + surface.drawLine(203, 324, x, y - 1, ((7 - r / 2) << 10) | ((18 - g / 2) << 5) | (23 - b / 2)); + surface.drawLine(203, 324, x, y, 0x1E57); +} + +void VK::drawEye(Graphics::Surface &surface) { + _vqaPlayerEye->update(true); + surface.copyRectToSurface(_surfaceEye, 315, 281, Common::Rect(0, 0, _surfaceEye.w, _surfaceEye.h)); +} + +void VK::drawEyeCrosshair(Graphics::Surface &surface, int timeNow) { + surface.drawLine(315, _eyeLineY, 486, _eyeLineY, 0x848u); + surface.drawLine(315, _eyeLineY - 1, 486, _eyeLineY - 1, 0x848u); + surface.drawLine(315, _eyeLineY, _vm->_rnd.getRandomNumberRng(10, 20) + 315, _eyeLineY, 0x84Au); + surface.drawLine(486 - _vm->_rnd.getRandomNumberRng(10, 20), _eyeLineY, 486, _eyeLineY, 0x84Au); + surface.drawLine(486 - _vm->_rnd.getRandomNumberRng(10, 20), _eyeLineY - 1, 486, _eyeLineY - 1, 0x846u); + surface.drawLine(315, _eyeLineY - 1, _vm->_rnd.getRandomNumberRng(10, 20) + 315, _eyeLineY - 1, 0x846u); + + surface.drawLine(_eyeLineX, 281, _eyeLineX, 396, 0x848u); + surface.drawLine(_eyeLineX - 1, 281, _eyeLineX - 1, 396, 0x848u); + surface.drawLine(_eyeLineX, 281, _eyeLineX, _vm->_rnd.getRandomNumberRng(10, 20) + 281, 0x846u); + surface.drawLine(_eyeLineX, 396 - _vm->_rnd.getRandomNumberRng(10, 20), _eyeLineX, 396, 0x846u); + surface.drawLine(_eyeLineX - 1, 396 - _vm->_rnd.getRandomNumberRng(10, 20), _eyeLineX - 1, 396, 0x84Au); + surface.drawLine(_eyeLineX - 1, 281, _eyeLineX - 1, _vm->_rnd.getRandomNumberRng(10, 20) + 281, 0x84Au); + + if (timeNow >= _timeNextEyeLineStart) { + if (_eyeLineSelected) { + if (_eyeLineYLast != _eyeLineY) { + surface.drawLine(315, _eyeLineYLast, 486, _eyeLineYLast, 0x844u); + } + _eyeLineYLast = _eyeLineY; + if (timeNow >= _timeNextEyeLineStep) { + _eyeLineY += _eyeLineYDelta; + if (_eyeLineYDelta > 0) { + if (_eyeLineY >= 396) { + _eyeLineY = 396; + _eyeLineYDelta = -_eyeLineYDelta; + } + } else if (_eyeLineY <= 281) { + _eyeLineY = 281; + _eyeLineYDelta = -_eyeLineYDelta; + _eyeLineSelected = 0; + _timeNextEyeLineStart = timeNow + 1000; + } + _timeNextEyeLineStep = timeNow + 50; + } + } else { + if (_eyeLineXLast != _eyeLineX) { + surface.drawLine(_eyeLineXLast, 281, _eyeLineXLast, 396, 0x844u); + } + _eyeLineXLast = _eyeLineX; + if (timeNow >= _timeNextEyeLineStep) { + _eyeLineX += _eyeLineXDelta; + if ( _eyeLineXDelta > 0) { + if (_eyeLineX >= 486) { + _eyeLineX = 486; + _eyeLineXDelta = -_eyeLineXDelta; + } + } else if (_eyeLineX <= 315) { + _eyeLineX = 315; + _eyeLineXDelta = -_eyeLineXDelta; + _eyeLineSelected = 1; + _timeNextEyeLineStart = timeNow + 1000; + } + _timeNextEyeLineStep = timeNow + 50; + } + } + } +} + +void VK::drawMouse(Graphics::Surface &surface) { + if (_vm->_mouse->isDisabled()) { + return; + } + + Common::Point p = _vm->getMousePos(); + + if (_buttons->hasHoveredImage()) { + _vm->_mouse->setCursor(1); + } else { + _vm->_mouse->setCursor(0); + } + + _vm->_mouse->draw(surface, p.x, p.y); +} + +void VK::drawGauge(Graphics::Surface &surface, int value, int x, int y, int width) { + _shapes[12]->draw(surface, x + (width / 2) * value / 20 , y); +} + +void VK::drawHumanGauge(Graphics::Surface &surface) { + drawGauge(surface, _humanGauge, 72, 271, 87); +} + +void VK::drawReplicantGauge(Graphics::Surface &surface) { + drawGauge(surface, _replicantGauge, 72, 293, 87); +} + +void VK::calibrate() { + if (_calibrationCounter >= 3 || _testStarted) { + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(460), 100, 0, 0, 50, 0); + } else { + _vm->_mouse->disable(); + _script->calibrate(_actorId); + _vm->_mouse->enable(); + ++_calibrationCounter; + if (_calibrationCounter == 3) { + _buttons->setImageShapeHovered(0, nullptr); + _buttons->setImageShapeDown(0, nullptr); + _buttons->setImageTooltip(0, nullptr); + } + } + _calibrationStarted = true; + _buttons->setImageShapeUp(0, nullptr); + + _buttons->setImageShapeHovered(2, _shapes[6]); + _buttons->setImageShapeDown(2, _shapes[7]); + _buttons->setImageTooltip(2, _vm->_textVK->getText(3)); + + _buttons->setImageShapeHovered(3, _shapes[8]); + _buttons->setImageShapeDown(3, _shapes[9]); + _buttons->setImageTooltip(3, _vm->_textVK->getText(4)); + + _buttons->setImageShapeHovered(4, _shapes[10]); + _buttons->setImageShapeDown(4, _shapes[11]); + _buttons->setImageTooltip(4, _vm->_textVK->getText(5)); +} + +void VK::beginTest() { + if (_calibrationStarted && !_testStarted) { + _vm->_mouse->disable(); + _calibration = ((100.0f / (100.0f - 4.0f) * (_adjustment - 154.0f)) - _calibrationRatio) / 5.0f; + _script->beginTest(_actorId); + _testStarted = true; + _buttons->setImageShapeHovered(0, nullptr); + _buttons->setImageShapeDown(0, nullptr); + _buttons->setImageTooltip(0, nullptr); + _buttons->setImageShapeDown(1, _shapes[4]); + _buttons->setImageTooltip(1, nullptr); + _buttons->setImageShapeUp(2, nullptr); + _buttons->setImageShapeUp(3, nullptr); + _buttons->setImageShapeUp(4, nullptr); + _vm->_mouse->enable(); + } else { + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(460), 100, 0, 0, 50, 0); + } +} + +void VK::startAdjustement() { + if (_testStarted) { + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(460), 100, 0, 0, 50, 0); + } else { + _isAdjusting = true; + } +} + +void VK::stopAdjustement() { + if (_testStarted) { + _isAdjusting = false; + } +} + +void VK::animateAdjustment(int target) { + _adjustmentTarget = MAX(target - 4, 154); + _adjustmentDelta = (_adjustmentTarget - _adjustment) / 5; + _timeNextAdjustementStep = _vm->getTotalPlayTime() + 50; +} + +void VK::setAdjustment(int x) { + _adjustment = CLIP(x - 4, 154, 246); + float offset = abs(199.0f - _adjustment); + int y = sqrt(88.0f * 88.0f - offset * offset); + _buttons->setImageLeft(1, _adjustment); + _buttons->setImageTop(1, 345 - y); +} + +void VK::setAdjustmentFromMouse() { + if (_isAdjusting && !_testStarted) { + int mouseX, mouseY; + _vm->_mouse->getXY(&mouseX, &mouseY); + setAdjustment(mouseX); + if (_adjustmentTarget != _adjustment) { + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(456), 100, 0, 0, 50, 0); + } + _adjustmentTarget = _adjustment; + _adjustmentDelta = 0; + } +} + +void VK::askQuestion(int intensity) { + assert(intensity < (int)_questions.size()); + + if (!_testStarted) { + beginTest(); + } + + if (!_testStarted) { + return; + } + + int foundQuestionIndex = -1; + int foundQuestionIndexLast = -1; + + for (int i = 0; i < (int)_questions[intensity].size(); ++i) { + if (_questions[intensity][i].isPresent && !_questions[intensity][i].wasAsked) { + int relatedQuestion = -1; + if (_questions[intensity][i].relatedSentenceId >= 0) { + // TODO: but not used in game + // relatedQuestion = vk::findQuestionById(this, questions, relatedQuestionId); + } + + if (relatedQuestion < 0 || _questions[intensity][relatedQuestion].wasAsked) { + foundQuestionIndexLast = i; + if (_vm->_rnd.getRandomNumberRng(0, 100) < 20) { + foundQuestionIndex = i; + break; + } + } + } + } + + if (foundQuestionIndex < 0) { + foundQuestionIndex = foundQuestionIndexLast; + } + + if (foundQuestionIndex >= 0) { + _vm->_mouse->disable(); + _questions[intensity][foundQuestionIndex].wasAsked = true; + _script->mcCoyAsksQuestion(_actorId, _questions[intensity][foundQuestionIndex].sentenceId); + _script->questionAsked(_actorId, _questions[intensity][foundQuestionIndex].sentenceId); + _vm->_mouse->enable(); + } else if (!_isClosing && !_script->isInsideScript()) { + _isClosing = true; + _vm->_mouse->disable(); + _timeClose = _vm->getTotalPlayTime() + 3000; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/ui/vk.h b/engines/bladerunner/ui/vk.h new file mode 100644 index 0000000000..77a419afb5 --- /dev/null +++ b/engines/bladerunner/ui/vk.h @@ -0,0 +1,174 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BLADERUNNER_VK_H +#define BLADERUNNER_VK_H + +#include "common/array.h" +#include "common/str.h" + +#include "graphics/surface.h" + +namespace BladeRunner { + +class BladeRunnerEngine; +class VKScript; +class Shape; +class UIImagePicker; +class VQAPlayer; + +class VK { + struct Question { + bool isPresent; + bool wasAsked; + int sentenceId; + int relatedSentenceId; + }; + + BladeRunnerEngine *_vm; + + VKScript *_script; + + UIImagePicker *_buttons; + Common::Array<Shape *> _shapes; + + VQAPlayer *_vqaPlayerMain; + VQAPlayer *_vqaPlayerEye; + int _vqaFrameMain; + bool _vqaLoopEnded; + + Graphics::Surface _surfaceEye; + + bool _isOpen; + int _actorId; + bool _calibrationStarted; + bool _testStarted; + + Common::Array<Common::Array<Question> > _questions; + + int _volumeAmbient; + int _volumeMusic; + int _soundTrackId1; + int _soundTrackId2; + int _soundTrackId3; + + int _calibration; + int _calibrationRatio; + int _calibrationCounter; + + int _humanProbability; + int _humanGauge; + int _humanGaugeTarget; + int _humanGaugeDelta; + int _timeNextHumanGaugeStep; + + int _replicantProbability; + int _replicantGauge; + int _replicantGaugeTarget; + int _replicantGaugeDelta; + int _timeNextReplicantGaugeStep; + + int _anxiety; + + int _needleValue; + int _needleValueMax; + int _needleValueTarget; + int _needleValueDelta; + int _timeNextNeedleStep; + int _timeNextNeedleOscillate; + int _timeNeedleReturn; + + bool _isClosing; + int _timeClose; + + int _blinkState; + int _timeNextBlink; + int _timeNextGaugesBlink; + + bool _isAdjusting; + int _adjustment; + int _adjustmentTarget; + int _adjustmentDelta; + int _timeNextAdjustementStep; + + int _eyeLineSelected; + int _eyeLineX; + int _eyeLineXLast; + int _eyeLineY; + int _eyeLineYLast; + int _eyeLineXDelta; + int _eyeLineYDelta; + int _timeNextEyeLineStep; + int _timeNextEyeLineStart; + +public: + VK(BladeRunnerEngine *vm); + ~VK(); + + void open(int actorId, int calibrationRatio); + bool isOpen() const; + void close(); + + void tick(); + + void resume(); + + void handleMouseDown(int mouseX, int mouseY, bool mainButton); + void handleMouseUp(int mouseX, int mouseY, bool mainButton); + + void playSpeechLine(int actorId, int sentenceId, float duration); + void addQuestion(int intensity, int sentenceId, int relatedSentenceId); + void subjectReacts(int intensity, int humanResponse, int replicantResponse, int anxiety); + void eyeAnimates(int loopId); + +private: + static void mouseDownCallback(int buttonId, void *callbackData); + static void mouseUpCallback(int buttonId, void *callbackData); + static void loopEnded(void *callbackData, int frame, int loopId); + + void reset(); + void init(); + + void draw(); + + void drawNeedle(Graphics::Surface &surface); + void drawEye(Graphics::Surface &surface); + void drawEyeCrosshair(Graphics::Surface &surface, int timeNow); + void drawMouse(Graphics::Surface &surface); + void drawGauge(Graphics::Surface &surface, int value, int x, int y, int width); + void drawHumanGauge(Graphics::Surface &surface); + void drawReplicantGauge(Graphics::Surface &surface); + + void calibrate(); + void beginTest(); + + void startAdjustement(); + void stopAdjustement(); + void animateAdjustment(int target); + void setAdjustment(int x); + void setAdjustmentFromMouse(); + + void askQuestion(int intensity); +}; + +} // End of namespace BladeRunner +#endif diff --git a/engines/bladerunner/zbuffer.cpp b/engines/bladerunner/zbuffer.cpp index 184755b5f9..044992670b 100644 --- a/engines/bladerunner/zbuffer.cpp +++ b/engines/bladerunner/zbuffer.cpp @@ -74,6 +74,7 @@ ZBuffer::ZBuffer() { } ZBuffer::~ZBuffer() { + delete _dirtyRects; delete[] _zbuf1; delete[] _zbuf2; } |