DREAMWEB: Port 'usehandle', 'usealtar' to C++

This commit is contained in:
Filippos Karapetis 2011-12-15 00:43:08 +02:00
parent 509755a010
commit dd8304dd75
5 changed files with 43 additions and 73 deletions

View File

@ -795,6 +795,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'updatepeople',
'updatesymboltop',
'updatesymbolbot',
'usealtar',
'useaxe',
'usebalcony',
'usebuttona',
@ -818,6 +819,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'useelevator5',
'useelvdoor',
'usefullcart',
'usehandle',
'usehole',
'usekey',
'useladder',

View File

@ -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:
@ -3463,30 +3416,6 @@ numberpoke3:
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);

View File

@ -500,7 +500,6 @@ public:
void dirCom();
void endGameSeq();
void findFirstPath();
void useAltar();
void startTalk();
void getAnyAd();
void reminders();
@ -559,7 +558,6 @@ public:
void searchForString();
void selectOpenOb();
void useGun();
void useHandle();
void incRyanPage();
void clearChanges();
void searchForFiles();

View File

@ -345,6 +345,8 @@
void useCooker();
void useWire();
void useControl();
void useHandle();
void useAltar();
bool defaultUseHandler(const char *id);
void openTVDoor();
void wearWatch();

View File

@ -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