DREAMWEB: 'grafittidoor', 'hotelcontrol', 'openhoteldoor', 'openhoteldoor2', 'opentomb' ported to C++

This commit is contained in:
Filippos Karapetis 2011-12-06 20:17:19 +02:00
parent 7566d2c985
commit 16c9620dba
5 changed files with 90 additions and 119 deletions

View file

@ -330,6 +330,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getundertimed', 'getundertimed',
'getxad', 'getxad',
'getyad', 'getyad',
'grafittidoor',
'handclap', 'handclap',
'hangon', 'hangon',
'hangoncurs', 'hangoncurs',
@ -337,6 +338,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'hangonp', 'hangonp',
'hangonw', 'hangonw',
'hotelbell', 'hotelbell',
'hotelcontrol',
'initialinv', 'initialinv',
'initman', 'initman',
'initrain', 'initrain',
@ -425,11 +427,14 @@ generator = cpp(context, "DreamGen", blacklist = [
'openeden', 'openeden',
'openfile', 'openfile',
'openforsave', 'openforsave',
'openhoteldoor',
'openhoteldoor2',
'openinv', 'openinv',
'openlouis', 'openlouis',
'openpoolboss', 'openpoolboss',
'openryan' 'openryan'
'opensarters', 'opensarters',
'opentomb',
'opentvdoor', 'opentvdoor',
'openyourneighbour', 'openyourneighbour',
'othersmoker', 'othersmoker',

View file

@ -5075,34 +5075,6 @@ cupfromtapfull:
putBackObStuff(); putBackObStuff();
} }
void DreamGenContext::hotelControl() {
STACK_CHECK;
_cmp(data.byte(kReallocation), 21);
if (!flags.z())
goto notrightcont;
_cmp(data.byte(kMapx), 33);
if (!flags.z())
goto notrightcont;
showFirstUse();
putBackObStuff();
return;
notrightcont:
showSecondUse();
putBackObStuff();
}
void DreamGenContext::openTomb() {
STACK_CHECK;
_inc(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::notHeldError() { void DreamGenContext::notHeldError() {
STACK_CHECK; STACK_CHECK;
createPanel(); createPanel();
@ -5336,92 +5308,6 @@ void DreamGenContext::drawItAll() {
showIcon(); showIcon();
} }
void DreamGenContext::openHotelDoor() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
if (!flags.z())
goto hoteldoorwith;
withWhat();
return;
hoteldoorwith:
al = data.byte(kWithobject);
ah = data.byte(kWithtype);
cl = 'K';
ch = 'E';
dl = 'Y';
dh = 'A';
compare();
if (flags.z())
goto keyonhotel1;
cx = 300;
al = 14;
showPuzText();
putBackObStuff();
return;
keyonhotel1:
al = 16;
playChannel1();
showFirstUse();
data.byte(kLockstatus) = 0;
data.byte(kGetback) = 1;
}
void DreamGenContext::openHotelDoor2() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
if (!flags.z())
goto hoteldoorwith2;
withWhat();
return;
hoteldoorwith2:
al = data.byte(kWithobject);
ah = data.byte(kWithtype);
cl = 'K';
ch = 'E';
dl = 'Y';
dh = 'A';
compare();
if (flags.z())
goto keyonhotel2;
cx = 300;
al = 14;
showPuzText();
putBackObStuff();
return;
keyonhotel2:
al = 16;
playChannel1();
showFirstUse();
putBackObStuff();
}
void DreamGenContext::grafittiDoor() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
if (!flags.z())
goto grafwith;
withWhat();
return;
grafwith:
al = data.byte(kWithobject);
ah = data.byte(kWithtype);
cl = 'A';
ch = 'P';
dl = 'E';
dh = 'N';
compare();
if (flags.z())
goto dograf;
cx = 300;
al = 14;
showPuzText();
putBackObStuff();
return;
dograf:
showFirstUse();
putBackObStuff();
}
void DreamGenContext::usePoolReader() { void DreamGenContext::usePoolReader() {
STACK_CHECK; STACK_CHECK;
_cmp(data.byte(kWithobject), 255); _cmp(data.byte(kWithobject), 255);

View file

@ -564,7 +564,6 @@ public:
void isRyanHolding(); void isRyanHolding();
void showSlots(); void showSlots();
void useCashCard(); void useCashCard();
void openTomb();
void doSomeTalk(); void doSomeTalk();
void showSaveOps(); void showSaveOps();
void introMonks1(); void introMonks1();
@ -625,7 +624,6 @@ public:
void attendant(); void attendant();
void cantDrop(); void cantDrop();
void copper(); void copper();
void openHotelDoor();
void drinker(); void drinker();
void nextColon(); void nextColon();
void placeFreeObject(); void placeFreeObject();
@ -727,11 +725,9 @@ public:
void isSetObOnMap(); void isSetObOnMap();
void getDestInfo(); void getDestInfo();
void setupTimedUse(); void setupTimedUse();
void grafittiDoor();
void makeCaps(); void makeCaps();
void read(); void read();
void additionalText(); void additionalText();
void hotelControl();
void mugger(); void mugger();
void searchForString(); void searchForString();
void selectOpenOb(); void selectOpenOb();
@ -771,7 +767,6 @@ public:
void inToInv(); void inToInv();
void parser(); void parser();
void setMouse(); void setMouse();
void openHotelDoor2();
void selectLocation(); void selectLocation();
void underTextLine(); void underTextLine();
void showNames(); void showNames();

View file

@ -547,6 +547,11 @@
void sLabDoorE(); void sLabDoorE();
void sLabDoorD(); void sLabDoorD();
void sLabDoorF(); void sLabDoorF();
void openHotelDoor();
void openHotelDoor2();
void grafittiDoor();
void openTomb();
void hotelControl();
void obsThatDoThings(); void obsThatDoThings();
void makeMainScreen(); void makeMainScreen();
void openInv(); void openInv();

View file

@ -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 */ } /*namespace dreamgen */