aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2007-01-31 02:33:20 +0000
committerPaul Gilbert2007-01-31 02:33:20 +0000
commit33707d6e42df7eca0fcf842daae6615155d9b60e (patch)
tree4a313eac3eea1f4cf06df9537af49389e466c7da /engines
parent0bd31443f9268a41338b33b0b9a9ea81f0fb3f01 (diff)
downloadscummvm-rg350-33707d6e42df7eca0fcf842daae6615155d9b60e.tar.gz
scummvm-rg350-33707d6e42df7eca0fcf842daae6615155d9b60e.tar.bz2
scummvm-rg350-33707d6e42df7eca0fcf842daae6615155d9b60e.zip
Added animation handler for the player exiting the sewer, and some bugfixes to allow Ratpouch to correctly open up the dungeon exit
svn-id: r25301
Diffstat (limited to 'engines')
-rw-r--r--engines/lure/hotspots.cpp40
-rw-r--r--engines/lure/hotspots.h5
2 files changed, 39 insertions, 6 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index d1a8991fe0..15cd7daf38 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -512,8 +512,10 @@ void Hotspot::setRandomDest() {
// Sets or clears the hotspot as occupying an area in its room's pathfinding data
void Hotspot::setOccupied(bool occupiedFlag) {
- if (occupiedFlag == coveredFlag()) return;
- setCoveredFlag(occupiedFlag);
+ if ((coveredFlag() != VB_INITIAL) &&
+ (occupiedFlag == (coveredFlag() == VB_TRUE)))
+ return;
+ setCoveredFlag(occupiedFlag ? VB_TRUE : VB_FALSE);
int xp = x() >> 3;
int yp = (y() - 8 + heightCopy() - 4) >> 3;
@@ -595,7 +597,7 @@ void Hotspot::updateMovement() {
resetPosition();
} else {
// Make sure the cell occupied by character is covered
- _data->coveredFlag = true;
+ _data->coveredFlag = VB_TRUE;
setOccupied(true);
}
}
@@ -1922,6 +1924,8 @@ HandlerMethodPtr HotspotTickHandlers::getHandler(uint16 procOffset) {
return skorlAnimHandler;
case 0x7F69:
return droppingTorchAnimHandler;
+ case 0x7FA1:
+ return playerSewerExitAnimHandler;
case 0x8009:
return fireAnimHandler;
case 0x81B3:
@@ -2553,7 +2557,7 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) {
if ((fields.getField(37) == 0) && h.currentActions().isEmpty()) {
if (h.roomNumber() == h.currentActions().top().roomNumber()) {
- // In room - et a random destination
+ // In room - set a random destination
h.setRandomDest();
} else {
@@ -2617,6 +2621,33 @@ void HotspotTickHandlers::droppingTorchAnimHandler(Hotspot &h) {
}
}
+void HotspotTickHandlers::playerSewerExitAnimHandler(Hotspot &h) {
+ if (h.frameCtr() > 0)
+ {
+ h.decrFrameCtr();
+ }
+ else if (h.executeScript())
+ {
+ Resources &res = Resources::getReference();
+
+ // Deactive the dropping animation
+ h.setLayer(0);
+ res.deactivateHotspot(h.hotspotId());
+
+ // Position the player
+ Hotspot *playerHotspot = res.getActiveHotspot(PLAYER_ID);
+ playerHotspot->setPosition(FULL_SCREEN_WIDTH / 2, (FULL_SCREEN_HEIGHT - MENUBAR_Y_SIZE) / 2);
+ playerHotspot->setDirection(DOWN);
+ playerHotspot->setCharacterMode(CHARMODE_NONE);
+
+ // Setup Ratpouch
+ Hotspot *ratpouchHotspot = res.getActiveHotspot(RATPOUCH_ID);
+ ratpouchHotspot->setCharacterMode(CHARMODE_NONE);
+ ratpouchHotspot->setDelayCtr(0);
+ ratpouchHotspot->setActions(0x821C00);
+ }
+}
+
void HotspotTickHandlers::fireAnimHandler(Hotspot &h) {
standardAnimHandler(h);
h.setOccupied(true);
@@ -2867,6 +2898,7 @@ void HotspotTickHandlers::headAnimHandler(Hotspot &h) {
uint16 frameNumber = 0;
if (character->y() < 79) {
+ // TODO:
//character = res.getActiveHotspot(RATPOUCH_ID);
frameNumber = 1;
} else {
diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h
index 6cdb75f2a8..137e3ffa7f 100644
--- a/engines/lure/hotspots.h
+++ b/engines/lure/hotspots.h
@@ -65,6 +65,7 @@ private:
static void followerAnimHandler(Hotspot &h);
static void skorlAnimHandler(Hotspot &h);
static void droppingTorchAnimHandler(Hotspot &h);
+ static void playerSewerExitAnimHandler(Hotspot &h);
static void fireAnimHandler(Hotspot &h);
static void prisonerAnimHandler(Hotspot &h);
static void talkAnimHandler(Hotspot &h);
@@ -406,11 +407,11 @@ public:
assert(_data);
_data->pauseCtr = value;
}
- bool coveredFlag() {
+ VariantBool coveredFlag() {
assert(_data);
return _data->coveredFlag;
}
- void setCoveredFlag(bool value) {
+ void setCoveredFlag(VariantBool value) {
assert(_data);
_data->coveredFlag = value;
}