aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/use.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-06 20:17:19 +0200
committerFilippos Karapetis2011-12-06 20:17:19 +0200
commit16c9620dbad66d7c1f2bc5f4d172393c34b92371 (patch)
tree433ea89233448f379b4ffbec8c0e52c0e6a592b4 /engines/dreamweb/use.cpp
parent7566d2c985e497ca2bca1db700a9fee7eabf9351 (diff)
downloadscummvm-rg350-16c9620dbad66d7c1f2bc5f4d172393c34b92371.tar.gz
scummvm-rg350-16c9620dbad66d7c1f2bc5f4d172393c34b92371.tar.bz2
scummvm-rg350-16c9620dbad66d7c1f2bc5f4d172393c34b92371.zip
DREAMWEB: 'grafittidoor', 'hotelcontrol', 'openhoteldoor', 'openhoteldoor2', 'opentomb' ported to C++
Diffstat (limited to 'engines/dreamweb/use.cpp')
-rw-r--r--engines/dreamweb/use.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index f8a3054e65..c70c625969 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1025,4 +1025,84 @@ void DreamGenContext::useHole() {
}
}
+void DreamGenContext::openHotelDoor() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero
+ if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+ // Wrong item
+ cx = 300;
+ al = 14;
+ showPuzText();
+ putBackObStuff();
+ } else {
+ playChannel1(16);
+ showFirstUse();
+ data.byte(kLockstatus) = 0;
+ data.byte(kGetback) = 1;
+ }
+}
+
+void DreamGenContext::openHotelDoor2() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero
+ if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+ // Wrong item
+ cx = 300;
+ al = 14;
+ showPuzText();
+ putBackObStuff();
+ } else {
+ playChannel1(16);
+ showFirstUse();
+ putBackObStuff();
+ }
+}
+
+void DreamGenContext::grafittiDoor() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero
+ if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+ // Wrong item
+ cx = 300;
+ al = 14;
+ showPuzText();
+ putBackObStuff();
+ } else {
+ showFirstUse();
+ putBackObStuff();
+ }
+}
+
+void DreamGenContext::openTomb() {
+ data.byte(kProgresspoints)++;
+ showFirstUse();
+ data.word(kWatchingtime) = 35 * 2;
+ data.word(kReeltowatch) = 1;
+ data.word(kEndwatchreel) = 33;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::hotelControl() {
+ if (data.byte(kReallocation) != 21 || data.byte(kMapx) != 33)
+ showSecondUse(); // Not right control
+ else
+ showFirstUse();
+
+ putBackObStuff();
+}
+
} /*namespace dreamgen */