diff options
author | Nipun Garg | 2019-07-01 08:58:46 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:06 +0200 |
commit | 016e0baca8bbdb6e172c3731da0b88beef3b934c (patch) | |
tree | 79a7c3779f70d56b7e53ee9267db67310bc825d4 /engines/hdb | |
parent | f2150cd89a07e0607976a2fe580ffec8367bfd45 (diff) | |
download | scummvm-rg350-016e0baca8bbdb6e172c3731da0b88beef3b934c.tar.gz scummvm-rg350-016e0baca8bbdb6e172c3731da0b88beef3b934c.tar.bz2 scummvm-rg350-016e0baca8bbdb6e172c3731da0b88beef3b934c.zip |
HDB: Add entityFace()
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/ai-funcs.cpp | 23 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 14 insertions, 10 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index ff336bc6bf..a59e468b95 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -1619,16 +1619,6 @@ void AI::animEntFrames(AIEntity *e) { } } -void AI::animLuaEntity(const char *initName, AIState st) { - for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) { - if (Common::matchString((*it)->entityName, initName)) { - (*it)->state = st; - (*it)->animFrame = 0; - (*it)->animDelay = (*it)->animCycle; - } - } -} - void AI::drawEnts(int x, int y, int w, int h) { static int stunAnim = 0; @@ -1814,6 +1804,19 @@ void AI::animGrabbing() { _player->animFrame = 5; } +void AI::entityFace(const char *luaName, int dir) { + AIEntity *e = locateEntity(luaName); + e->dir = (AIDir)dir; + + switch (e->dir) { + case DIR_UP: e->state = STATE_STANDUP; break; + case DIR_DOWN: e->state = STATE_STANDDOWN; break; + case DIR_LEFT: e->state = STATE_STANDLEFT; break; + case DIR_RIGHT: e->state = STATE_STANDRIGHT; break; + case DIR_NONE: break; + } +} + void AI::moveEnts() { static int frameDelay = kAnimFrameDelay; AIEntity *e; diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index ccd9aed42d..4e424870e9 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -760,6 +760,7 @@ public: void drawEnts(int x, int y, int w, int h); void drawLevel2Ents(); void animGrabbing(); + void entityFace(const char *luaName, int dir); void moveEnts(); |