aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hdb/ai-funcs.cpp23
-rw-r--r--engines/hdb/ai.h1
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();