aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-funcs.cpp
diff options
context:
space:
mode:
authorNipun Garg2019-08-03 10:42:07 +0530
committerEugene Sandulenko2019-09-03 17:17:31 +0200
commit7ad5cf9d30ca24ace6709b43fe4549897505c8ab (patch)
tree8b806a3b359ac1b2f83470ad048e456868a842d0 /engines/hdb/ai-funcs.cpp
parent878eefceb5e2937512c060385a3464a1c38b2def (diff)
downloadscummvm-rg350-7ad5cf9d30ca24ace6709b43fe4549897505c8ab.tar.gz
scummvm-rg350-7ad5cf9d30ca24ace6709b43fe4549897505c8ab.tar.bz2
scummvm-rg350-7ad5cf9d30ca24ace6709b43fe4549897505c8ab.zip
HDB: Add new PPC-specific code
Diffstat (limited to 'engines/hdb/ai-funcs.cpp')
-rw-r--r--engines/hdb/ai-funcs.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index 7faa8880c3..73e0b8e203 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -784,6 +784,11 @@ void AI::killPlayer(Death method) {
g_hdb->_window->closeDialogChoice();
g_hdb->_window->stopPanicZone();
+ if (g_hdb->isPPC()) {
+ g_hdb->_window->closeDlvs();
+ g_hdb->_window->closeInv();
+ }
+
switch (method) {
case DEATH_NORMAL:
_player->state = STATE_DYING;
@@ -811,8 +816,10 @@ void AI::killPlayer(Death method) {
g_hdb->_sound->playSound(SND_PANIC_DEATH);
break;
case DEATH_PLUMMET:
- _player->state = STATE_PLUMMET;
- g_hdb->_sound->playSound(SND_GUY_PLUMMET);
+ if (!g_hdb->isDemo()) {
+ _player->state = STATE_PLUMMET;
+ g_hdb->_sound->playSound(SND_GUY_PLUMMET);
+ }
break;
}
@@ -2312,6 +2319,15 @@ void AI::movePlayer(uint16 buttons) {
// Just trying to put away a dialog?
if (buttons & kButtonB) {
+ if (g_hdb->isPPC()) {
+ if (g_hdb->_window->deliveriesActive()) {
+ g_hdb->_window->closeDlvs();
+ return;
+ } else if (g_hdb->_window->inventoryActive()) {
+ g_hdb->_window->closeInv();
+ return;
+ }
+ }
if (g_hdb->_window->dialogActive()) {
g_hdb->_window->closeDialog();
return;
@@ -2471,6 +2487,13 @@ void AI::movePlayer(uint16 buttons) {
if (_player->touchpWait > kPlayerTouchPWait / 4)
return;
+ if (g_hdb->isPPC()) {
+ // Are the Deliveries active?
+ if (g_hdb->_window->deliveriesActive())
+ if (!g_hdb->_ai->cinematicsActive())
+ return;
+ }
+
// Is a dialog active?
if (g_hdb->_window->dialogActive()) {
if (!cinematicsActive())
@@ -2483,6 +2506,13 @@ void AI::movePlayer(uint16 buttons) {
return;
}
+ if (g_hdb->isPPC()) {
+ // Is the Inventory active?
+ if (g_hdb->_window->inventoryActive())
+ if (!g_hdb->_ai->cinematicsActive())
+ return;
+ }
+
// In a cinematic?
if (_playerLock || _numWaypoints)
return;