DREAMWEB: Port 'usepipe' to C++
This commit is contained in:
parent
27f5661dfc
commit
ef94b2d15a
5 changed files with 29 additions and 48 deletions
|
@ -802,6 +802,7 @@ generator = cpp(context, "DreamGen", blacklist = [
|
||||||
'usemenu',
|
'usemenu',
|
||||||
'usemon',
|
'usemon',
|
||||||
'useobject',
|
'useobject',
|
||||||
|
'usepipe',
|
||||||
'useplate',
|
'useplate',
|
||||||
'useplinth',
|
'useplinth',
|
||||||
'usepoolreader',
|
'usepoolreader',
|
||||||
|
|
|
@ -3590,53 +3590,6 @@ void DreamGenContext::notHeldError() {
|
||||||
putBackObStuff();
|
putBackObStuff();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DreamGenContext::usePipe() {
|
|
||||||
STACK_CHECK;
|
|
||||||
_cmp(data.byte(kWithobject), 255);
|
|
||||||
if (!flags.z())
|
|
||||||
goto pipewith;
|
|
||||||
withWhat();
|
|
||||||
return;
|
|
||||||
pipewith:
|
|
||||||
al = data.byte(kWithobject);
|
|
||||||
ah = data.byte(kWithtype);
|
|
||||||
cl = 'C';
|
|
||||||
ch = 'U';
|
|
||||||
dl = 'P';
|
|
||||||
dh = 'E';
|
|
||||||
compare();
|
|
||||||
if (flags.z())
|
|
||||||
goto fillcup;
|
|
||||||
al = data.byte(kWithobject);
|
|
||||||
ah = data.byte(kWithtype);
|
|
||||||
cl = 'C';
|
|
||||||
ch = 'U';
|
|
||||||
dl = 'P';
|
|
||||||
dh = 'F';
|
|
||||||
compare();
|
|
||||||
if (flags.z())
|
|
||||||
goto alreadyfull;
|
|
||||||
cx = 300;
|
|
||||||
al = 14;
|
|
||||||
showPuzText();
|
|
||||||
putBackObStuff();
|
|
||||||
return;
|
|
||||||
fillcup:
|
|
||||||
cx = 300;
|
|
||||||
al = 36;
|
|
||||||
showPuzText();
|
|
||||||
putBackObStuff();
|
|
||||||
al = data.byte(kWithobject);
|
|
||||||
getExAd();
|
|
||||||
es.byte(bx+15) = 'F'-'A';
|
|
||||||
return;
|
|
||||||
alreadyfull:
|
|
||||||
cx = 300;
|
|
||||||
al = 35;
|
|
||||||
showPuzText();
|
|
||||||
putBackObStuff();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DreamGenContext::useOpenBox() {
|
void DreamGenContext::useOpenBox() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
_cmp(data.byte(kWithobject), 255);
|
_cmp(data.byte(kWithobject), 255);
|
||||||
|
|
|
@ -511,7 +511,6 @@ public:
|
||||||
void useAltar();
|
void useAltar();
|
||||||
void startTalk();
|
void startTalk();
|
||||||
void getAnyAd();
|
void getAnyAd();
|
||||||
void usePipe();
|
|
||||||
void reminders();
|
void reminders();
|
||||||
void runTap();
|
void runTap();
|
||||||
void dumpDiaryKeys();
|
void dumpDiaryKeys();
|
||||||
|
|
|
@ -332,6 +332,7 @@
|
||||||
void useHatch();
|
void useHatch();
|
||||||
void useLighter();
|
void useLighter();
|
||||||
void useSLab();
|
void useSLab();
|
||||||
|
void usePipe();
|
||||||
void wheelSound();
|
void wheelSound();
|
||||||
void callHotelLift();
|
void callHotelLift();
|
||||||
void useShield();
|
void useShield();
|
||||||
|
|
|
@ -1314,4 +1314,31 @@ void DreamGenContext::useSLab() {
|
||||||
data.byte(kGetback) = 1;
|
data.byte(kGetback) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DreamGenContext::usePipe() {
|
||||||
|
if (data.byte(kWithobject) == 255) {
|
||||||
|
withWhat();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero
|
||||||
|
char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero
|
||||||
|
|
||||||
|
if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) {
|
||||||
|
// Fill cup
|
||||||
|
showPuzText(36, 300);
|
||||||
|
putBackObStuff();
|
||||||
|
DynObject *exObject = getExAd(data.byte(kWithobject));
|
||||||
|
exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup)
|
||||||
|
return;
|
||||||
|
} else if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) {
|
||||||
|
// Already full
|
||||||
|
showPuzText(14, 300);
|
||||||
|
showPuzText();
|
||||||
|
putBackObStuff();
|
||||||
|
} else {
|
||||||
|
showPuzText(35, 300);
|
||||||
|
putBackObStuff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace DreamGen
|
} // End of namespace DreamGen
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue