diff options
author | Nipun Garg | 2019-06-23 08:59:11 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:57 +0200 |
commit | fd5d7ae477e237e7b3c3748613c714eb22833433 (patch) | |
tree | 80662f9801e4b9db819cbbd38b71032593de9d8e /engines | |
parent | 8cdd69ba4175cdff5e711c53c87ddec36c6eae13 (diff) | |
download | scummvm-rg350-fd5d7ae477e237e7b3c3748613c714eb22833433.tar.gz scummvm-rg350-fd5d7ae477e237e7b3c3748613c714eb22833433.tar.bz2 scummvm-rg350-fd5d7ae477e237e7b3c3748613c714eb22833433.zip |
HDB: Add moveEnts()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/ai-funcs.cpp | 44 | ||||
-rw-r--r-- | engines/hdb/ai.h | 2 |
2 files changed, 46 insertions, 0 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index ff0c4f951c..20d84fdd41 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -1237,6 +1237,50 @@ void AI::animGrabbing() { _player->animFrame = 5; } +void AI::moveEnts() { + static int frameDelay = kAnimFrameDelay; + AIEntity *e; + + if (frameDelay-- > 0) + return; + + // Call aiAction for Floating Entities + for (Common::Array<AIEntity *>::iterator it = _floats->begin(); it != _floats->end(); it++) { + if ((*it)->aiAction) + (*it)->aiAction((*it)); + } + + // Call aiAction for all other Entities + for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) { + e = (*it); + if (e->aiAction) { + // NPC Touchplate Counter + if (e != _player && e->touchpWait) { + e->touchpWait--; + if (!e->touchpWait) { + if (e->tileX == e->touchpX && e->tileY == e->touchpY && onEvenTile(e->x, e->y)) + e->touchpWait = 1; + else { + checkActionList(e, e->touchpX, e->touchpY, false); + g_hdb->_map->setMapBGTileIndex(e->touchpX, e->touchpY, e->touchpTile); + e->touchpX = e->touchpY = e->touchpTile = 0; + } + } + } + // Stunned Entity Timer + if (!e->stunnedWait) + e->aiAction(e); + else { + if (e->stunnedWait < g_hdb->getTimeSlice()) + e->stunnedWait = 0; + } + } + } + + warning("STUB: moveEnts: Laser Rescan"); + warning("STUB: moveEnts: Laser Looping Sound Channel"); +} + int AI::checkForTouchplate(int x, int y) { int tileIndex = g_hdb->_map->getMapBGTileIndex(x, y); if (tileIndex == _touchplateOff || tileIndex == _templeTouchpOff) diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index a064088395..6601df3c8e 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -628,6 +628,8 @@ public: void drawEnts(int x, int y, int w, int h); void animGrabbing(); + void moveEnts(); + int checkForTouchplate(int x, int y); void addAnimateTarget(int x, int y, int start, int end, AnimSpeed speed, bool killAuto, bool inMap, const char *tileName); |