From c414baa35d4cc4b11929d9c4995a1027d16f59e6 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 8 Jun 2012 05:16:01 +0200 Subject: 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. --- engines/gob/minigames/geisha/penetration.h | 34 ++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'engines/gob/minigames/geisha/penetration.h') 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 _shields; Common::List _mouths; - ManagedEnemy _enemies[kEnemyCount]; + ManagedEnemy _enemies[kEnemyCount]; + ManagedBullet _bullets[kMaxBulletCount]; Common::List _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(); -- cgit v1.2.3