diff options
author | Torbjörn Andersson | 2018-12-15 19:14:51 +0100 |
---|---|---|
committer | Paul Gilbert | 2018-12-15 19:24:36 -0800 |
commit | 313cd2315e43bd0d9a052a6486dab36648a98d1b (patch) | |
tree | ab5dceff1ae0dc2cde2cf24199eccddbd464b2fa /engines/sherlock | |
parent | b2cd3d9fd7b30fcb6ba315b10c0c87b3dcf744ca (diff) | |
download | scummvm-rg350-313cd2315e43bd0d9a052a6486dab36648a98d1b.tar.gz scummvm-rg350-313cd2315e43bd0d9a052a6486dab36648a98d1b.tar.bz2 scummvm-rg350-313cd2315e43bd0d9a052a6486dab36648a98d1b.zip |
SHERLOCK: Fix computer aim in Serrated Scalpel's darts game
The computer opponent always aims for the bullseye as long as he
needs more than 50 points. After that, he's supposed to aim for
the closest score to what he needs to win. But this coordinate
was never used, and the computer player would always aim at the
same spot outside of the dart board. This, of course, made it
practically impossible for it to beat you. This commit fixes
that.
I thought at first that this fix wasn't quite right, because the
computer won't always hit the score he aims for even if you remove
the random inaccuracy from its aim. But I think it still hits
near the intended target, so maybe this is good enough?
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_darts.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sherlock/scalpel/scalpel_darts.cpp b/engines/sherlock/scalpel/scalpel_darts.cpp index 1b7c266de7..2b81cb71f4 100644 --- a/engines/sherlock/scalpel/scalpel_darts.cpp +++ b/engines/sherlock/scalpel/scalpel_darts.cpp @@ -470,8 +470,8 @@ Common::Point Darts::getComputerDartDest(int playerNum) { --aim; } while (!done); - target.x = 75 + ((target.x - 75) * 20 / 27); - target.y = 75 + ((target.y - 75) * 2 / 3); + target.x = 75 + ((pt.x - 75) * 20 / 27); + target.y = 75 + ((pt.y - 75) * 2 / 3); } // Pick a level of accuracy. The higher the level, the more accurate their throw will be |