aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/minigames/geisha/penetration.h
diff options
context:
space:
mode:
authorSven Hesse2012-06-08 05:16:01 +0200
committerSven Hesse2012-06-08 05:16:01 +0200
commitc414baa35d4cc4b11929d9c4995a1027d16f59e6 (patch)
tree0c0346e7f5e673c3490fe9879a73dda02a463559 /engines/gob/minigames/geisha/penetration.h
parent421b93ce0574b76eeae0ffe0598f1f6858ddf1f1 (diff)
downloadscummvm-rg350-c414baa35d4cc4b11929d9c4995a1027d16f59e6.tar.gz
scummvm-rg350-c414baa35d4cc4b11929d9c4995a1027d16f59e6.tar.bz2
scummvm-rg350-c414baa35d4cc4b11929d9c4995a1027d16f59e6.zip
GOB: Implement shooting in Penetration
Geisha's Penetration minigame should be complete now. This also means that Geisha is now basically complete. The only thing missing is the MDYPlayer, but since the music is only played once during the title screen, and it has a PCM-based fallback (which is currently played), this is low priority.
Diffstat (limited to 'engines/gob/minigames/geisha/penetration.h')
-rw-r--r--engines/gob/minigames/geisha/penetration.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/engines/gob/minigames/geisha/penetration.h b/engines/gob/minigames/geisha/penetration.h
index 9abae258b2..50004eba8e 100644
--- a/engines/gob/minigames/geisha/penetration.h
+++ b/engines/gob/minigames/geisha/penetration.h
@@ -65,7 +65,8 @@ private:
static const byte kPalettes[kFloorCount][3 * kPaletteSize];
static const byte kMaps[kModeCount][kFloorCount][kMapWidth * kMapHeight];
- static const int kEnemyCount = 9;
+ static const int kEnemyCount = 9;
+ static const int kMaxBulletCount = 10;
struct MapObject {
uint16 tileX;
@@ -122,6 +123,18 @@ private:
void clear();
};
+ struct ManagedBullet : public MapObject {
+ ANIObject *bullet;
+
+ int16 deltaX;
+ int16 deltaY;
+
+ ManagedBullet();
+ ~ManagedBullet();
+
+ void clear();
+ };
+
enum Keys {
kKeyUp = 0,
kKeyDown,
@@ -163,10 +176,13 @@ private:
Common::List<MapObject> _shields;
Common::List<ManagedMouth> _mouths;
- ManagedEnemy _enemies[kEnemyCount];
+ ManagedEnemy _enemies[kEnemyCount];
+ ManagedBullet _bullets[kMaxBulletCount];
Common::List<MapObject *> _blockingObjects;
+ uint8 _shotCoolDown;
+
SoundDesc _soundShield;
SoundDesc _soundBite;
SoundDesc _soundKiss;
@@ -191,10 +207,8 @@ private:
void drawFloorText();
void drawEndText();
- bool isBlocked(const MapObject &self, int16 x, int16 y,
- const MapObject *checkBlockedBy = 0, bool *blockedBy = 0) const;
- void findPath(MapObject &obj, int x, int y,
- const MapObject *checkBlockedBy = 0, bool *blockedBy = 0) const;
+ bool isBlocked(const MapObject &self, int16 x, int16 y, MapObject **blockedBy = 0);
+ void findPath(MapObject &obj, int x, int y, MapObject **blockedBy = 0);
void updateAnims();
@@ -206,6 +220,14 @@ private:
void subMove(int x, int y, Submarine::Direction direction);
void subShoot();
+ int findEmptyBulletSlot() const;
+ uint16 directionToBullet(Submarine::Direction direction) const;
+ void setBulletPosition(const ManagedSub &sub, ManagedBullet &bullet) const;
+
+ void bulletsMove();
+ void bulletMove(ManagedBullet &bullet);
+ void checkShotEnemy(MapObject &shotObject);
+
void checkExits();
void checkShields();
void checkMouths();