diff options
author | Thanasis Antoniou | 2019-04-24 14:58:10 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-04-24 15:13:26 +0300 |
commit | ac32d35ff47d3d0dac069fd7e125031ad24708d4 (patch) | |
tree | a40ad04f2e56338be1c5941701ad687d0e8750e1 | |
parent | 0ba4e561685dfac437f2c2157cf5dfd10400bfdb (diff) | |
download | scummvm-rg350-ac32d35ff47d3d0dac069fd7e125031ad24708d4.tar.gz scummvm-rg350-ac32d35ff47d3d0dac069fd7e125031ad24708d4.tar.bz2 scummvm-rg350-ac32d35ff47d3d0dac069fd7e125031ad24708d4.zip |
BLADERUNNER: Restore relared VK questions mechanism
-rw-r--r-- | engines/bladerunner/script/vk_script.cpp | 133 | ||||
-rw-r--r-- | engines/bladerunner/ui/vk.cpp | 63 | ||||
-rw-r--r-- | engines/bladerunner/ui/vk.h | 1 |
3 files changed, 146 insertions, 51 deletions
diff --git a/engines/bladerunner/script/vk_script.cpp b/engines/bladerunner/script/vk_script.cpp index 81fb67d05d..688cda7cf8 100644 --- a/engines/bladerunner/script/vk_script.cpp +++ b/engines/bladerunner/script/vk_script.cpp @@ -86,48 +86,101 @@ bool VKScript::isInsideScript() const { } bool VKScript::SCRIPT_VK_DLL_Initialize(int actorId) { - VK_Add_Question(0, 7400, -1); - VK_Add_Question(0, 7405, -1); - VK_Add_Question(0, 7410, -1); - VK_Add_Question(0, 7415, -1); - VK_Add_Question(0, 7420, -1); - VK_Add_Question(0, 7425, -1); + VK_Add_Question(0, 7400, -1); // Low 01 + VK_Add_Question(0, 7405, -1); // Low 02 + VK_Add_Question(0, 7410, -1); // Low 03 + VK_Add_Question(0, 7415, -1); // Low 04 + VK_Add_Question(0, 7420, -1); // Low 05 + VK_Add_Question(0, 7425, -1); // Low 06 +#if BLADERUNNER_RESTORED_CUT_CONTENT + if (actorId == kActorLucy) { + VK_Add_Question(0, 7430, 7770); // Low 07 -> High 10 (A game/ It's not, really, just part of the test) + } else if (actorId == kActorDektora) { + VK_Add_Question(0, 7430, -1); // Low 07 + } +#else if (actorId == kActorLucy || actorId == kActorDektora) { - VK_Add_Question(0, 7430, -1); + VK_Add_Question(0, 7430, -1); // Low 07 + } +#endif // BLADERUNNER_RESTORED_CUT_CONTENT + VK_Add_Question(0, 7435, -1); // Low 08 + VK_Add_Question(0, 7440, -1); // Low 09 + VK_Add_Question(0, 7445, -1); // Low 10 + VK_Add_Question(0, 7450, -1); // Low 11 + VK_Add_Question(0, 7455, -1); // Low 12 + VK_Add_Question(0, 7460, -1); // Low 13 + VK_Add_Question(0, 7465, -1); // Low 14 + VK_Add_Question(0, 7470, -1); // Low 15 + VK_Add_Question(1, 7475, -1); // Medium 01 + VK_Add_Question(1, 7480, -1); // Medium 02 + VK_Add_Question(1, 7485, -1); // Medium 03 + VK_Add_Question(1, 7490, -1); // Medium 04 + VK_Add_Question(1, 7495, -1); // Medium 05 + VK_Add_Question(1, 7515, -1); // Medium 06 + VK_Add_Question(1, 7525, -1); // Medium 07 + VK_Add_Question(1, 7535, -1); // Medium 08 + VK_Add_Question(1, 7540, -1); // Medium 09 + VK_Add_Question(1, 7550, -1); // Medium 10 + VK_Add_Question(1, 7565, -1); // Medium 11 + VK_Add_Question(1, 7580, -1); // Medium 12 + VK_Add_Question(1, 7585, -1); // Medium 13 +#if BLADERUNNER_RESTORED_CUT_CONTENT + if (actorId == kActorBulletBob) { + // Bullet Bob's Medium 14 is related to Low 05 (Low 05 is supposed to be asked first) + VK_Add_Question(1, 7595, 7420); // Medium 14 -> Low 05 (Hamster) + } else { + VK_Add_Question(1, 7595, -1); // Medium 14 + } +#else + VK_Add_Question(1, 7595, -1); // Medium 14 +#endif // BLADERUNNER_RESTORED_CUT_CONTENT +#if BLADERUNNER_RESTORED_CUT_CONTENT + if (actorId == kActorLucy) { + VK_Add_Question(1, 7600, 7475); // Medium 15 -> Medium 01 (Can't have children not ever) + } else { + VK_Add_Question(1, 7600, -1); // Medium 15 + } +#else + VK_Add_Question(1, 7600, -1); // Medium 15 +#endif // BLADERUNNER_RESTORED_CUT_CONTENT + VK_Add_Question(2, 7605, -1); // High 01 + VK_Add_Question(2, 7620, -1); // High 02 +#if BLADERUNNER_RESTORED_CUT_CONTENT + if (actorId == kActorGrigorian) { + VK_Add_Question(2, 7635, 7585); // High 03 -> Medium 13 // book/ magazine with dead animals + } else { + VK_Add_Question(2, 7635, -1); // High 03 + } +#else + VK_Add_Question(2, 7635, -1); // High 03 +#endif // BLADERUNNER_RESTORED_CUT_CONTENT + VK_Add_Question(2, 7670, -1); // High 04 + VK_Add_Question(2, 7680, -1); // High 05 +#if BLADERUNNER_RESTORED_CUT_CONTENT + if (actorId == kActorBulletBob) { + VK_Add_Question(2, 7690, 7565); // High 06 -> Medium 11 (when people laughing at him) + } else if (actorId == kActorDektora) { + VK_Add_Question(2, 7690, 7750); // High 06 -> High 09 (You don't write them / I Just read 'em) + } else { + VK_Add_Question(2, 7690, -1); // High 06 + } +#else + VK_Add_Question(2, 7690, -1); // High 06 +#endif // BLADERUNNER_RESTORED_CUT_CONTENT +#if BLADERUNNER_RESTORED_CUT_CONTENT + if (actorId == kActorBulletBob) { + VK_Add_Question(2, 7705, 7635); // High 07 -> High 03 (I've had enough) + } else if (actorId == kActorGrigorian) { + VK_Add_Question(2, 7705, 7605); // High 07 -> High 01 (They're just questions x2) + } else { + VK_Add_Question(2, 7705, -1); // High 07 } - VK_Add_Question(0, 7435, -1); - VK_Add_Question(0, 7440, -1); - VK_Add_Question(0, 7445, -1); - VK_Add_Question(0, 7450, -1); - VK_Add_Question(0, 7455, -1); - VK_Add_Question(0, 7460, -1); - VK_Add_Question(0, 7465, -1); - VK_Add_Question(0, 7470, -1); - VK_Add_Question(1, 7475, -1); - VK_Add_Question(1, 7480, -1); - VK_Add_Question(1, 7485, -1); - VK_Add_Question(1, 7490, -1); - VK_Add_Question(1, 7495, -1); - VK_Add_Question(1, 7515, -1); - VK_Add_Question(1, 7525, -1); - VK_Add_Question(1, 7535, -1); - VK_Add_Question(1, 7540, -1); - VK_Add_Question(1, 7550, -1); - VK_Add_Question(1, 7565, -1); - VK_Add_Question(1, 7580, -1); - VK_Add_Question(1, 7585, -1); - VK_Add_Question(1, 7595, -1); - VK_Add_Question(1, 7600, -1); - VK_Add_Question(2, 7605, -1); - VK_Add_Question(2, 7620, -1); - VK_Add_Question(2, 7635, -1); - VK_Add_Question(2, 7670, -1); - VK_Add_Question(2, 7680, -1); - VK_Add_Question(2, 7690, -1); - VK_Add_Question(2, 7705, -1); - VK_Add_Question(2, 7740, -1); - VK_Add_Question(2, 7750, -1); - VK_Add_Question(2, 7770, -1); +#else + VK_Add_Question(2, 7705, -1); // High 07 +#endif // BLADERUNNER_RESTORED_CUT_CONTENT + VK_Add_Question(2, 7740, -1); // High 08 + VK_Add_Question(2, 7750, -1); // High 09 + VK_Add_Question(2, 7770, -1); // High 10 switch (actorId) { case kActorDektora: diff --git a/engines/bladerunner/ui/vk.cpp b/engines/bladerunner/ui/vk.cpp index a68ec60bf5..6345082788 100644 --- a/engines/bladerunner/ui/vk.cpp +++ b/engines/bladerunner/ui/vk.cpp @@ -45,6 +45,7 @@ #include "common/str.h" #include "common/keyboard.h" +#include "bladerunner/debugger.h" namespace BladeRunner { @@ -878,6 +879,27 @@ void VK::setAdjustmentFromMouse() { } } +/** +* This is ScummVM's version of this function (original name: findQuestionById) +* It will search through all questions to find a related question Id and its intensity +*/ +void VK::findRelatedQuestionBySentenceId(int inSentenceId, int &outRelatedQuestionId, int &outRelatedIntensity) { + outRelatedQuestionId = -1; + outRelatedIntensity = -1; + + for (int intensity = 0; intensity < 3; ++intensity) { + for (int i = 0; i < (int)_questions[intensity].size(); ++i) { + if (_questions[intensity][i].isPresent + && _questions[intensity][i].sentenceId == inSentenceId + ) { + outRelatedQuestionId = i; + outRelatedIntensity = intensity; + return; + } + } + } +} + void VK::askQuestion(int intensity) { assert(intensity < (int)_questions.size()); @@ -895,18 +917,37 @@ void VK::askQuestion(int intensity) { for (int i = 0; i < (int)_questions[intensity].size(); ++i) { if (_questions[intensity][i].isPresent && !_questions[intensity][i].wasAsked) { // cut content? related questions are not used in game - // int relatedQuestion = -1; - // if (_questions[intensity][i].relatedSentenceId >= 0) { - // 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; + // + // Note: There are questions that seem related and a subject may reference them + // (eg Bullet Bob does that with the "hamster" - VK Low 05 and VK Medium 14) + // + // This was probably meant to be a mechanism to prevent asking a related question before asking the original one + // to avoid inconsistencies. However, this seems it would restrict relevant questions within the same intensity + // which should be changed. + // + // An issue with this issue is that if in a pair of related questions from different intensities + // (eg in Bob's case L05 -> M14), if M14 is the last available question from the Medium intensity, + // and L05 has not been asked, then what question should McCoy ask? + // + // The original code (if it worked) would simply not make any question and that's the simplest solution to adopt. + // This issue is only likely to occur in vanilla game (with very low probability) + // with High intensity questions that depend on questions of other intensity + // + int relatedSentenceId = _questions[intensity][i].relatedSentenceId; + int relatedQuestionId = -1; + int relatedQuestionIntensity = -1; + + if (relatedSentenceId >= 0) { + findRelatedQuestionBySentenceId(relatedSentenceId, relatedQuestionId, relatedQuestionIntensity); + } + + if (relatedQuestionId < 0 || _questions[relatedQuestionIntensity][relatedQuestionId].wasAsked) { + foundQuestionIndexLast = i; + if (_vm->_rnd.getRandomNumberRng(0, 100) < 20) { + foundQuestionIndex = i; + break; + } } - // } } } diff --git a/engines/bladerunner/ui/vk.h b/engines/bladerunner/ui/vk.h index 77a419afb5..328953c9e2 100644 --- a/engines/bladerunner/ui/vk.h +++ b/engines/bladerunner/ui/vk.h @@ -167,6 +167,7 @@ private: void setAdjustment(int x); void setAdjustmentFromMouse(); + void findRelatedQuestionBySentenceId(int inSentenceId, int &outRelatedQuestionId, int &outRelatedIntensity); void askQuestion(int intensity); }; |