aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2011-09-14 20:07:45 +0200
committerSven Hesse2011-09-14 20:31:50 +0200
commit6c259c5d66415e1c36640ae00ff38fa93a3e432f (patch)
treebde52b358ee0368353092a1c1ff8b5d06e9e0369 /engines/gob
parent2edfb693bedbd578c6019970ae66b2d6384509ca (diff)
downloadscummvm-rg350-6c259c5d66415e1c36640ae00ff38fa93a3e432f.tar.gz
scummvm-rg350-6c259c5d66415e1c36640ae00ff38fa93a3e432f.tar.bz2
scummvm-rg350-6c259c5d66415e1c36640ae00ff38fa93a3e432f.zip
GOB: Randomize the evil fish types
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/minigames/geisha/diving.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index 355edd7f88..ae041b77f9 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -36,6 +36,15 @@ namespace Gob {
namespace Geisha {
+static const int kEvilFishTypeCount = 3;
+
+static const int kEvilFishTypes[kEvilFishTypeCount][5] = {
+ { 0, 14, 8, 9, 3}, // Shark
+ {15, 1, 12, 13, 3}, // Moray
+ {16, 2, 10, 11, 3} // Ray
+};
+
+
Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
_objects(0), _gui(0), _oko(0), _lungs(0), _heart(0),
_blackPearl(0), _whitePearlCount(0), _blackPearlCount(0) {
@@ -113,9 +122,8 @@ void Diving::init() {
_heart->setVisible(true);
_heart->setPause(true);
- _evilFish[0] = new EvilFish(*_objects, 320, 0, 14, 8, 9, 3); // Shark
- _evilFish[1] = new EvilFish(*_objects, 320, 15, 1, 12, 13, 3); // Moray
- _evilFish[2] = new EvilFish(*_objects, 320, 16, 2, 10, 11, 3); // Ray
+ for (uint i = 0; i < kEvilFishCount; i++)
+ _evilFish[i] = new EvilFish(*_objects, 320, 0, 0, 0, 0, 0);
for (uint i = 0; i < kMaxShotCount; i++) {
_shot[i] = new ANIObject(*_objects);
@@ -221,6 +229,11 @@ void Diving::evilFishEnter() {
if (fish.isVisible())
continue;
+ int fishType = _vm->_util->getRandom(kEvilFishTypeCount);
+ fish.mutate(kEvilFishTypes[fishType][0], kEvilFishTypes[fishType][1],
+ kEvilFishTypes[fishType][2], kEvilFishTypes[fishType][3],
+ kEvilFishTypes[fishType][4]);
+
fish.enter((EvilFish::Direction)_vm->_util->getRandom(2), 90 + i * 20);
}
}