aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-07-03 21:39:38 +0530
committerEugene Sandulenko2019-09-03 17:17:09 +0200
commiteacc59bca9a22af15fffe809c3de383c0e144c38 (patch)
tree6a5286b5b3f366b2ffad96a6ccd462f7fa250324 /engines/hdb
parente1d69ed3893a2ea67d238c2f09d49b181765ab46 (diff)
downloadscummvm-rg350-eacc59bca9a22af15fffe809c3de383c0e144c38.tar.gz
scummvm-rg350-eacc59bca9a22af15fffe809c3de383c0e144c38.tar.bz2
scummvm-rg350-eacc59bca9a22af15fffe809c3de383c0e144c38.zip
HDB: Add useDoorOpenCloseBot()
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-use.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/hdb/ai-use.cpp b/engines/hdb/ai-use.cpp
index bca73155d8..f48b9e620a 100644
--- a/engines/hdb/ai-use.cpp
+++ b/engines/hdb/ai-use.cpp
@@ -292,8 +292,19 @@ bool AI::useAutoDoorOpenClose(AIEntity *e, int x, int y) {
// Any Type Door
bool AI::useDoorOpenCloseBot(AIEntity *e, int x, int y) {
- warning("STUB: Define useDoorOpenCloseBot");
- return false;
+ int tileIndex = g_hdb->_map->getMapBGTileIndex(x, y);
+
+ if (e == _player || e->type == AI_SLUG_ATTACK || e->type == AI_GEM_ATTACK) {
+ if (isClosedDoor(x, y))
+ g_hdb->_sound->playSound(SND_GUY_UHUH);
+ return false;
+ }
+
+ addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, NULL);
+ // AddCallback( CALLBACK_DOOR_OPEN_CLOSE, x, y, DELAY_5SECONDS / fs );
+ if (g_hdb->_map->onScreen(x, y))
+ g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
+ return true;
}
} // End of Namespace