DREAMWEB: Port 'autoappear' to C++

This commit is contained in:
Filippos Karapetis 2011-12-12 17:49:34 +02:00
parent 5bbca02938
commit 0ade2240d0
5 changed files with 47 additions and 71 deletions

View File

@ -222,6 +222,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'animpointer',
'atmospheres',
'attendant',
'autoappear',
'autolook',
'autosetwalk',
'backobject',

View File

@ -4580,76 +4580,6 @@ void DreamGenContext::removeFreeObject() {
es = pop();
}
void DreamGenContext::autoAppear() {
STACK_CHECK;
_cmp(data.byte(kLocation), 32);
if (!flags.z())
goto notinalley;
al = 5;
resetLocation();
al = 10;
setLocation();
data.byte(kDestpos) = 10;
return;
notinalley:
_cmp(data.byte(kReallocation), 24);
if (!flags.z())
goto notinedens;
_cmp(data.byte(kGeneraldead), 1);
if (!flags.z())
goto edenspart2;
_inc(data.byte(kGeneraldead));
al = 44;
placeSetObject();
al = 18;
placeSetObject();
al = 93;
placeSetObject();
al = 92;
removeSetObject();
al = 55;
removeSetObject();
al = 75;
removeSetObject();
al = 84;
removeSetObject();
al = 85;
removeSetObject();
return;
edenspart2:
_cmp(data.byte(kSartaindead), 1);
if (!flags.z())
return /* (notedens2) */;
al = 44;
removeSetObject();
al = 93;
removeSetObject();
al = 55;
placeSetObject();
_inc(data.byte(kSartaindead));
return;
notinedens:
_cmp(data.byte(kReallocation), 25);
if (!flags.z())
goto notonsartroof;
data.byte(kNewsitem) = 3;
al = 6;
resetLocation();
al = 11;
setLocation();
data.byte(kDestpos) = 11;
return;
notonsartroof:
_cmp(data.byte(kReallocation), 2);
if (!flags.z())
return /* (notinlouiss) */;
_cmp(data.byte(kRockstardead), 0);
if (flags.z())
return /* (notinlouiss) */;
al = 23;
placeSetObject();
}
void DreamGenContext::setupTimedUse() {
STACK_CHECK;
_cmp(data.word(kTimecount), 0);

View File

@ -589,7 +589,6 @@ public:
void searchForString();
void selectOpenOb();
void useGun();
void autoAppear();
void useHandle();
void incRyanPage();
void findExObject();

View File

@ -4262,4 +4262,49 @@ void DreamGenContext::useButtonA() {
}
}
void DreamGenContext::autoAppear() {
if (data.byte(kLocation) == 32) {
// In alley
al = 5;
resetLocation();
setLocation(10);
data.byte(kDestpos) = 10;
return;
}
if (data.byte(kReallocation) == 24) {
// In Eden's apartment
if (data.byte(kGeneraldead) == 1) {
data.byte(kGeneraldead)++;
placeSetObject(44);
placeSetObject(18);
placeSetObject(93);
removeSetObject(92);
removeSetObject(55);
removeSetObject(75);
removeSetObject(84);
removeSetObject(85);
} else if (data.byte(kSartaindead) == 1) {
// Eden's part 2
removeSetObject(44);
removeSetObject(93);
placeSetObject(55);
data.byte(kSartaindead)++;
}
} else {
// Not in Eden's
if (data.byte(kReallocation) == 25) {
// Sart roof
data.byte(kNewsitem) = 3;
al = 6;
resetLocation();
setLocation(11);
data.byte(kDestpos) = 11;
} else {
if (data.byte(kReallocation) == 2 && data.byte(kRockstardead) != 0)
placeSetObject(23);
}
}
}
} // End of namespace DreamGen

View File

@ -565,5 +565,6 @@
void monkSpeaking();
void rollEndCredits2();
void useButtonA();
void autoAppear();
#endif