From 16c9620dbad66d7c1f2bc5f4d172393c34b92371 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 20:17:19 +0200 Subject: DREAMWEB: 'grafittidoor', 'hotelcontrol', 'openhoteldoor', 'openhoteldoor2', 'opentomb' ported to C++ --- engines/dreamweb/use.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'engines/dreamweb/use.cpp') 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 */ -- cgit v1.2.3