diff options
author | Strangerke | 2014-11-25 17:06:54 +0100 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:45:29 -0500 |
commit | 79fa346ca04a6a2a0ac7cb725d21ba496944feb1 (patch) | |
tree | 88989f345e6eac7694220571ee6e1e39c85408ae /engines/access/amazon/amazon_game.cpp | |
parent | 2ea4601589196ba91d2e87582cb5f9325e0b1f95 (diff) | |
download | scummvm-rg350-79fa346ca04a6a2a0ac7cb725d21ba496944feb1.tar.gz scummvm-rg350-79fa346ca04a6a2a0ac7cb725d21ba496944feb1.tar.bz2 scummvm-rg350-79fa346ca04a6a2a0ac7cb725d21ba496944feb1.zip |
ACCESS: Implement calcIQ
Diffstat (limited to 'engines/access/amazon/amazon_game.cpp')
-rw-r--r-- | engines/access/amazon/amazon_game.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index c12af5e339..33e5888cf4 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -624,8 +624,33 @@ void AmazonEngine::updateSummary(int chap) { } } -void AmazonEngine::CALCIQ() { - warning("TODO: CALCIQ"); +void AmazonEngine::calcIQ() { + int tmpIQ = 170; + for (int i = 0; i < 256; i++) { + if (_help1[i] == 1) + tmpIQ -= 3; + } + + for (int i = 0; i < 256; i++) { + if (_help2[i] == 1) + tmpIQ -= 5; + } + + for (int i = 0; i < 256; i++) { + if (_help3[i] == 1) + tmpIQ -= 10; + } + + if (tmpIQ < 0) + tmpIQ = 0; + + _iqValue = tmpIQ; + + if (_iqValue <= 100) + _badEnd = 1; + + if (_iqValue <= 0) + _noHints = 1; } void AmazonEngine::helpTitle() { @@ -646,7 +671,7 @@ void AmazonEngine::helpTitle() { _fonts._font2.drawString(_screen, HELPLVLTXT[_helpLevel], Common::Point(posX, 36)); Common::String iqText = "IQ: "; - CALCIQ(); + calcIQ(); Common::String IQSCORE = Common::String::format("d", _iqValue); while (IQSCORE.size() != 4) IQSCORE = " " + IQSCORE; |