Skip to content

Commit

Permalink
DREAMWEB: Port 'usehandle', 'usealtar' to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Dec 14, 2011
1 parent 509755a commit dd8304d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 73 deletions.
2 changes: 2 additions & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -795,6 +795,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'updatepeople',
'updatesymboltop',
'updatesymbolbot',
'usealtar',
'useaxe',
'usebalcony',
'usebuttona',
Expand All @@ -818,6 +819,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'useelevator5',
'useelvdoor',
'usefullcart',
'usehandle',
'usehole',
'usekey',
'useladder',
Expand Down
71 changes: 0 additions & 71 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -3306,53 +3306,6 @@ void DreamGenContext::notHeldError() {
putBackObStuff();
}

void DreamGenContext::useAltar() {
STACK_CHECK;
al = 'C';
ah = 'N';
cl = 'D';
ch = 'A';
findExObject();
_cmp(al, (114));
if (flags.z())
goto thingsonaltar;
al = 'C';
ah = 'N';
cl = 'D';
ch = 'B';
findExObject();
_cmp(al, (114));
if (flags.z())
goto thingsonaltar;
_cmp(data.byte(kCanmovealtar), 1);
if (flags.z())
goto movealtar;
cx = 300;
al = 23;
showPuzText();
data.byte(kGetback) = 1;
return;
movealtar:
_inc(data.byte(kProgresspoints));
showSecondUse();
data.word(kWatchingtime) = 160;
data.word(kReeltowatch) = 81;
data.word(kEndwatchreel) = 174;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
al = 47;
bl = 52;
bh = 76;
cx = 32;
dx = 98;
setupTimedUse();
data.byte(kGetback) = 1;
return;
thingsonaltar:
showFirstUse();
data.byte(kGetback) = 1;
}

void DreamGenContext::nextColon() {
STACK_CHECK;
lookcolon:
Expand Down Expand Up @@ -3463,30 +3416,6 @@ void DreamGenContext::moneyPoke() {
cs.byte(bx) = al;
}

void DreamGenContext::useHandle() {
STACK_CHECK;
al = 'C';
ah = 'U';
cl = 'T';
ch = 'W';
findSetObject();
al = es.byte(bx+58);
_cmp(al, 255);
if (!flags.z())
goto havecutwire;
cx = 300;
al = 12;
showPuzText();
data.byte(kGetback) = 1;
return;
havecutwire:
cx = 300;
al = 13;
showPuzText();
data.byte(kNewlocation) = 22;
data.byte(kGetback) = 1;
}

void DreamGenContext::useStereo() {
STACK_CHECK;
_cmp(data.byte(kLocation), 0);
Expand Down
2 changes: 0 additions & 2 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -500,7 +500,6 @@ class DreamGenContext : public DreamBase, public Context {
void dirCom();
void endGameSeq();
void findFirstPath();
void useAltar();
void startTalk();
void getAnyAd();
void reminders();
Expand Down Expand Up @@ -559,7 +558,6 @@ class DreamGenContext : public DreamBase, public Context {
void searchForString();
void selectOpenOb();
void useGun();
void useHandle();
void incRyanPage();
void clearChanges();
void searchForFiles();
Expand Down
2 changes: 2 additions & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -345,6 +345,8 @@
void useCooker();
void useWire();
void useControl();
void useHandle();
void useAltar();
bool defaultUseHandler(const char *id);
void openTVDoor();
void wearWatch();
Expand Down
39 changes: 39 additions & 0 deletions engines/dreamweb/use.cpp
Expand Up @@ -1434,4 +1434,43 @@ void DreamGenContext::useKey() {
}
}

void DreamGenContext::useHandle() {
SetObject *object = getSetAd(findSetObject("CUTW"));
if (object->mapad[0] == 255) {
// Wire not cut
showPuzText(12, 300);
} else {
// Wire has been cut
showPuzText(13, 300);
data.byte(kNewlocation) = 22;
}

data.byte(kGetback) = 1;
}

void DreamGenContext::useAltar() {
if (findExObject("CNDA") == 114 || findExObject("CNDB") == 114) {
// Things on altar
showFirstUse();
data.byte(kGetback) = 1;
return;
}

if (data.byte(kCanmovealtar) == 1) {
// Move altar
data.byte(kProgresspoints)++;
showSecondUse();
data.word(kWatchingtime) = 160;
data.word(kReeltowatch) = 81;
data.word(kEndwatchreel) = 174;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
DreamBase::setupTimedUse(47, 32, 98, 52, 76);
data.byte(kGetback) = 1;
} else {
showPuzText(23, 300);
data.byte(kGetback) = 1;
}
}

} // End of namespace DreamGen

0 comments on commit dd8304d

Please sign in to comment.