aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-07-03 23:09:40 +0530
committerEugene Sandulenko2019-09-03 17:17:10 +0200
commit478c10a1fb8516b16b6f3d40aba6f8c5385fc16a (patch)
tree5edd62d5220bbe5ea5aeca6d8b3217d9b11bfca3 /engines/hdb
parent9da57f1eb76ce20c3943070f618559ccdda57b2e (diff)
downloadscummvm-rg350-478c10a1fb8516b16b6f3d40aba6f8c5385fc16a.tar.gz
scummvm-rg350-478c10a1fb8516b16b6f3d40aba6f8c5385fc16a.tar.bz2
scummvm-rg350-478c10a1fb8516b16b6f3d40aba6f8c5385fc16a.zip
HDB: Unstub aiVortexianAction
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-player.cpp31
-rw-r--r--engines/hdb/ai.h4
2 files changed, 33 insertions, 2 deletions
diff --git a/engines/hdb/ai-player.cpp b/engines/hdb/ai-player.cpp
index 323b308c46..599844be03 100644
--- a/engines/hdb/ai-player.cpp
+++ b/engines/hdb/ai-player.cpp
@@ -1638,7 +1638,36 @@ void aiGooCupInit2(AIEntity *e) {
}
void aiVortexianAction(AIEntity *e) {
- warning("STUB: AI: aiVortexianAction required");
+ // anim the alpha blending : down to 32, up to 180, back down...
+ e->value2 += e->value1;
+ if ((e->value2 & 0xff) > 128) {
+ e->value2 = (e->value2 & 0xff00) | 128;
+ e->value1 = -e->value1;
+ } else if ((e->value2 & 0xff) < 32) {
+ e->value2 = (e->value2 & 0xff00) | 32;
+ e->value1 = -e->value1;
+ }
+
+ // anim the shape
+ e->animFrame++;
+ if (e->animFrame >= e->standdownFrames) {
+ e->animFrame = 0;
+
+ // every 4th frame, check for player collision &
+ // do an autosave
+ AIEntity *p = g_hdb->_ai->getPlayer();
+ if (abs(p->x - e->x) < 4 && abs(p->y - e->y) < 4) {
+ if (!(e->value2 & 0xff00)) {
+ // let's make sure we don't autosave every frikken second!
+ e->value2 |= 0xff00;
+
+ g_hdb->saveWhenReady(kAutoSaveSlot);
+ g_hdb->_window->openMessageBar("Saving progress at Vortexian...", 1);
+ }
+ } else
+ e->value2 &= 0x00ff;
+ }
+ e->draw = e->standdownGfx[e->animFrame];
}
void aiVortexianUse(AIEntity *e) {
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 2e1d26e570..1a0f1d35b5 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -50,7 +50,9 @@ enum {
kRunToggleDelay = 2,
kMsgDelay = 3,
kYouGotX = -1,
- kYouGotY = (kScreenHeight - 16)
+ kYouGotY = (kScreenHeight - 16),
+ kNumSaveSlots = 8,
+ kAutoSaveSlot = 0
};
enum AIType {