DREAMWEB: 'usechurchgate', 'usefullcart' ported to C++

This commit is contained in:
Filippos Karapetis 2011-12-06 13:17:28 +02:00
parent 6ad12bc093
commit c244f6e662
5 changed files with 51 additions and 64 deletions

View File

@ -580,6 +580,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'updatepeople',
'usebalcony',
'usecharset1',
'usechurchgate',
'usechurchhole',
'usecoveredbox',
'usedryer',
@ -588,6 +589,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'useelevator3',
'useelevator4',
'useelevator5',
'usefullcart',
'useladder',
'useladderb',
'usehatch',

View File

@ -5441,28 +5441,6 @@ alreadyfull:
putBackObStuff();
}
void DreamGenContext::useFullCart() {
STACK_CHECK;
_inc(data.byte(kProgresspoints));
al = 2;
ah = data.byte(kRoomnum);
_add(ah, 6);
turnAnyPathOn();
data.byte(kManspath) = 4;
data.byte(kFacing) = 4;
data.byte(kTurntoface) = 4;
data.byte(kFinaldest) = 4;
findXYFromPath();
data.byte(kResetmanxy) = 1;
showFirstUse();
data.word(kWatchingtime) = 72*2;
data.word(kReeltowatch) = 58;
data.word(kEndwatchreel) = 142;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
data.byte(kGetback) = 1;
}
void DreamGenContext::usePlinth() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
@ -7056,46 +7034,6 @@ void DreamGenContext::setupTimedUse() {
data.word(kTimedoffset) = bx;
}
void DreamGenContext::useChurchGate() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
if (!flags.z())
goto gatewith;
withWhat();
return;
gatewith:
al = data.byte(kWithobject);
ah = data.byte(kWithtype);
cl = 'C';
ch = 'U';
dl = 'T';
dh = 'T';
compare();
if (flags.z())
goto cutgate;
cx = 300;
al = 14;
showPuzText();
putBackObStuff();
return;
cutgate:
showFirstUse();
data.word(kWatchingtime) = 64*2;
data.word(kReeltowatch) = 4;
data.word(kEndwatchreel) = 70;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
data.byte(kGetback) = 1;
_inc(data.byte(kProgresspoints));
al = 3;
turnPathOn();
_cmp(data.byte(kAidedead), 0);
if (flags.z())
return /* (notopenchurch) */;
al = 2;
turnPathOn();
}
void DreamGenContext::useGun() {
STACK_CHECK;
_cmp(data.byte(kObjecttype), 4);

View File

@ -756,7 +756,6 @@ public:
void selectOpenOb();
void useGun();
void autoAppear();
void useFullCart();
void newPlace();
void useCardReader1();
void useCardReader2();
@ -780,7 +779,6 @@ public:
void execCommand();
void updateSymbolBot();
void findPuzText();
void useChurchGate();
void monkAndRyan();
void swapWithInv();
void useControl();

View File

@ -397,6 +397,8 @@
void callHotelLift();
void useShield();
void useWall();
void useChurchGate();
void useFullCart();
void wearWatch();
void wearShades();
void checkFolderCoords();

View File

@ -692,4 +692,51 @@ void DreamGenContext::sLabDoorF() {
}
}
void DreamGenContext::useChurchGate() {
if (data.byte(kWithobject) == 255) {
withWhat();
return;
}
char id[4] = { 'C', 'U', 'T', 'T' }; // 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 {
// Cut gate
showFirstUse();
data.word(kWatchingtime) = 64 * 2;
data.word(kReeltowatch) = 4;
data.word(kEndwatchreel) = 70;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
data.byte(kGetback) = 1;
data.byte(kProgresspoints)++;
turnPathOn(3);
if (data.byte(kAidedead) != 0)
turnPathOn(2); // Open church
}
}
void DreamGenContext::useFullCart() {
data.byte(kProgresspoints)++;
turnAnyPathOn(2, data.byte(kRoomnum) + 6);
data.byte(kManspath) = 4;
data.byte(kFacing) = 4;
data.byte(kTurntoface) = 4;
data.byte(kFinaldest) = 4;
findXYFromPath();
data.byte(kResetmanxy) = 1;
showFirstUse();
data.word(kWatchingtime) = 72 * 2;
data.word(kReeltowatch) = 58;
data.word(kEndwatchreel) = 142;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
data.byte(kGetback) = 1;
}
} /*namespace dreamgen */