aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood/gamemodule.cpp
diff options
context:
space:
mode:
authorjohndoe1232012-11-13 13:19:49 +0000
committerWillem Jan Palenstijn2013-05-08 20:47:37 +0200
commit685ce4e3122dfd48ce136f6bc6baaacf142e8850 (patch)
tree9d58d662e72de38af51f6a7dcfa1110cea135091 /engines/neverhood/gamemodule.cpp
parent73e0372cefad2fa4eb95d4c02c66b3361b7599be (diff)
downloadscummvm-rg350-685ce4e3122dfd48ce136f6bc6baaacf142e8850.tar.gz
scummvm-rg350-685ce4e3122dfd48ce136f6bc6baaacf142e8850.tar.bz2
scummvm-rg350-685ce4e3122dfd48ce136f6bc6baaacf142e8850.zip
NEVERHOOD: Add initCodeSymbolsPuzzle
Diffstat (limited to 'engines/neverhood/gamemodule.cpp')
-rw-r--r--engines/neverhood/gamemodule.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index ce72a22835..c7ce53fe79 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -262,6 +262,23 @@ void GameModule::initCannonSymbolsPuzzle() {
}
}
+void GameModule::initCodeSymbolsPuzzle() {
+ if (!getSubVar(VA_IS_PUZZLE_INIT, 0x0CD09B50)) {
+ for (int i = 0; i < 12; ++i)
+ setSubVar(VA_CODE_SYMBOLS, i, i);
+ for (int i = 0; i < 12; ++i) {
+ uint32 index1 = _vm->_rnd->getRandomNumber(12 - 1);
+ uint32 index2 = _vm->_rnd->getRandomNumber(12 - 1);
+ uint32 temp = getSubVar(VA_CODE_SYMBOLS, index1);
+ setSubVar(VA_CODE_SYMBOLS, index1, getSubVar(VA_CODE_SYMBOLS, index2));
+ setSubVar(VA_CODE_SYMBOLS, index2, temp);
+ }
+ setGlobalVar(V_NOISY_SYMBOL_INDEX, _vm->_rnd->getRandomNumber(11 - 1) + 1);
+ setSubVar(VA_IS_PUZZLE_INIT, 0x0CD09B50, 1);
+ }
+
+}
+
uint32 GameModule::getCurrRadioMusicFileHash() {
uint musicIndex = getGlobalVar(V_CURR_RADIO_MUSIC_INDEX);
return (musicIndex % 5 != 0) ? 0 : kRadioMusicFileHashes[CLIP<uint>(musicIndex / 5, 0, 17)];