aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-11-25 17:06:54 +0100
committerPaul Gilbert2014-12-12 22:45:29 -0500
commit79fa346ca04a6a2a0ac7cb725d21ba496944feb1 (patch)
tree88989f345e6eac7694220571ee6e1e39c85408ae
parent2ea4601589196ba91d2e87582cb5f9325e0b1f95 (diff)
downloadscummvm-rg350-79fa346ca04a6a2a0ac7cb725d21ba496944feb1.tar.gz
scummvm-rg350-79fa346ca04a6a2a0ac7cb725d21ba496944feb1.tar.bz2
scummvm-rg350-79fa346ca04a6a2a0ac7cb725d21ba496944feb1.zip
ACCESS: Implement calcIQ
-rw-r--r--engines/access/amazon/amazon_game.cpp31
-rw-r--r--engines/access/amazon/amazon_game.h2
2 files changed, 29 insertions, 4 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;
diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h
index 89d15d36e2..6208796b8a 100644
--- a/engines/access/amazon/amazon_game.h
+++ b/engines/access/amazon/amazon_game.h
@@ -83,7 +83,7 @@ private:
*/
void setupGame();
- void CALCIQ();
+ void calcIQ();
void helpTitle();
void drawHelpText(const Common::String &msg);
void doCredit();