DREAMWEB: Port 'usebuttona' to C++

This commit is contained in:
Filippos Karapetis 2011-12-12 16:55:32 +02:00
parent cc079c739a
commit 273fc3ff1a
5 changed files with 22 additions and 29 deletions

View File

@ -750,6 +750,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'undertextline',
'updatepeople',
'usebalcony',
'usebuttona',
'usecardreader1',
'usecardreader2',
'usecardreader3',

View File

@ -4849,34 +4849,6 @@ nottvsoldier:
putBackObStuff();
}
void DreamGenContext::useButtonA() {
STACK_CHECK;
al = 95;
isSetObOnMap();
if (flags.z())
goto donethisbit;
showFirstUse();
al = 0;
ah = data.byte(kRoomnum);
_dec(ah);
turnAnyPathOn();
al = 9;
removeSetObject();
al = 95;
placeSetObject();
data.word(kWatchingtime) = 15*2;
data.word(kReeltowatch) = 71;
data.word(kEndwatchreel) = 85;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
data.byte(kGetback) = 1;
_inc(data.byte(kProgresspoints));
return;
donethisbit:
showSecondUse();
putBackObStuff();
}
void DreamGenContext::quitKey() {
STACK_CHECK;
_cmp(data.byte(kCommandtype), 222);

View File

@ -610,7 +610,6 @@ public:
void searchForFiles();
void getExAd();
void initialMonCols();
void useButtonA();
void execCommand();
void updateSymbolBot();
void findPuzText();

View File

@ -4242,4 +4242,24 @@ void DreamGenContext::monkSpeaking() {
getRidOfTemp();
}
void DreamGenContext::useButtonA() {
if (!isSetObOnMap(95)) {
showFirstUse();
turnAnyPathOn(0, data.byte(kRoomnum) - 1);
removeSetObject(9);
placeSetObject(95);
data.word(kWatchingtime) = 15 * 2;
data.word(kReeltowatch) = 71;
data.word(kEndwatchreel) = 85;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
data.byte(kGetback) = 1;
data.byte(kProgresspoints)++;
} else {
// Done this bit
showSecondUse();
putBackObStuff();
}
}
} // End of namespace DreamGen

View File

@ -564,5 +564,6 @@
void showPuzText();
void monkSpeaking();
void rollEndCredits2();
void useButtonA();
#endif