aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-07-03 05:53:49 +0530
committerEugene Sandulenko2019-09-03 17:17:08 +0200
commit34f0992c4d911c18a194358dd5d61792c4b6cb69 (patch)
treeaeef165baf6a7f350943d0436a699a19a0fbcb96 /engines/hdb
parent60958086c2bf81b4d0523e24ce8b7463336007df (diff)
downloadscummvm-rg350-34f0992c4d911c18a194358dd5d61792c4b6cb69.tar.gz
scummvm-rg350-34f0992c4d911c18a194358dd5d61792c4b6cb69.tar.bz2
scummvm-rg350-34f0992c4d911c18a194358dd5d61792c4b6cb69.zip
HDB: Add aiChicken functions
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-player.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/engines/hdb/ai-player.cpp b/engines/hdb/ai-player.cpp
index f430a65a2e..5b045b54f5 100644
--- a/engines/hdb/ai-player.cpp
+++ b/engines/hdb/ai-player.cpp
@@ -595,19 +595,34 @@ void aiGemAttackAction(AIEntity *e) {
}
void aiChickenAction(AIEntity *e) {
- warning("STUB: AI: aiChickenAction required");
+ static int delay = 64;
+
+ if (g_hdb->_map->checkEntOnScreen(e) && !delay) {
+ warning("Play SND_CHICKEN_AMBIENT");
+ delay = g_hdb->_rnd->getRandomNumber(128) + 160;
+ aiChickenUse(e);
+ }
+
+ if (delay)
+ delay--;
+
+ if (e->goalX)
+ g_hdb->_ai->animateEntity(e);
+ else
+ g_hdb->_ai->animEntFrames(e);
}
void aiChickenUse(AIEntity *e) {
- warning("STUB: AI: aiChickenUse required");
+ warning("Play SND_CHICKEN_BAGAWK");
}
void aiChickenInit(AIEntity *e) {
- warning("STUB: AI: aiChickenInit required");
+ e->aiUse = aiChickenUse;
+ e->aiAction = aiChickenAction;
}
void aiChickenInit2(AIEntity *e) {
- warning("STUB: AI: aiChickenInit2 required");
+ e->draw = e->standdownGfx[0];
}
void aiDollyInit(AIEntity *e) {