diff options
author | Filippos Karapetis | 2011-12-07 23:33:27 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-07 23:33:27 +0200 |
commit | aae7192d09a94f8865255ccb5aa0341f7d8bbdec (patch) | |
tree | ac3f7c8b7a6162540ce62227d514c2e2cea363d5 /engines/dreamweb | |
parent | 6d7053dec941a499314750781e52fab927bca72b (diff) | |
download | scummvm-rg350-aae7192d09a94f8865255ccb5aa0341f7d8bbdec.tar.gz scummvm-rg350-aae7192d09a94f8865255ccb5aa0341f7d8bbdec.tar.bz2 scummvm-rg350-aae7192d09a94f8865255ccb5aa0341f7d8bbdec.zip |
DREAMWEB: 'bossman' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 50 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/people.cpp | 31 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 30 insertions, 53 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index fe00db19a5..bbc909baae 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -523,56 +523,6 @@ gotheavyframe: addToPeopleList(); } -void DreamGenContext::bossMan() { - STACK_CHECK; - checkSpeed(); - if (!flags.z()) - goto notboss; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 4); - if (flags.z()) - goto firstdes; - _cmp(ax, 20); - if (flags.z()) - goto secdes; - _cmp(ax, 41); - if (!flags.z()) - goto gotallboss; - ax = 0; - _inc(data.byte(kGunpassflag)); - es.byte(bx+7) = 10; - goto gotallboss; -firstdes: - _cmp(data.byte(kGunpassflag), 1); - if (flags.z()) - goto gotallboss; - push(ax); - randomNumber(); - cl = al; - ax = pop(); - _cmp(cl, 10); - if (flags.c()) - goto gotallboss; - ax = 0; - goto gotallboss; -secdes: - _cmp(data.byte(kGunpassflag), 1); - if (flags.z()) - goto gotallboss; - ax = 0; -gotallboss: - es.word(bx+3) = ax; -notboss: - showGameReel(); - addToPeopleList(); - al = es.byte(bx+7); - _and(al, 128); - if (flags.z()) - return /* (nottalkedboss) */; - data.byte(kTalkedtoboss) = 1; -} - void DreamGenContext::introMonks1() { STACK_CHECK; checkSpeed(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f5f6800312..638287f8e8 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -647,7 +647,6 @@ public: void findOpenPos(); void describeOb(); void deleteExFrame(); - void bossMan(); void searchForSame(); void fadeFromWhite(); void rollEm(); diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp index 7479c4c184..18a2ff4478 100644 --- a/engines/dreamweb/people.cpp +++ b/engines/dreamweb/people.cpp @@ -32,7 +32,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = { &DreamGenContext::receptionist, NULL, NULL, NULL, NULL, &DreamGenContext::soldier1, - &DreamGenContext::bossMan, NULL, + NULL, NULL, &DreamGenContext::heavy, NULL, NULL, NULL, &DreamGenContext::bartender, NULL, @@ -64,7 +64,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = { /*&DreamGenContext::receptionist*/NULL, &DreamGenContext::genericPerson /*maleFan*/, &DreamGenContext::genericPerson /*femaleFan*/, &DreamGenContext::louis, &DreamGenContext::louisChair, /*&DreamGenContext::soldier1*/NULL, - /*&DreamGenContext::bossMan*/NULL, &DreamGenContext::interviewer, + &DreamGenContext::bossMan, &DreamGenContext::interviewer, /*&DreamGenContext::heavy*/NULL, &DreamGenContext::manAsleep /*manAsleep2*/, &DreamGenContext::genericPerson /*manSatStill*/, &DreamGenContext::drinker, /*&DreamGenContext::bartender*/NULL, &DreamGenContext::genericPerson /*otherSmoker*/, @@ -593,4 +593,31 @@ void DreamGenContext::louisChair(ReelRoutine &routine) { addToPeopleList(&routine); } +void DreamGenContext::bossMan(ReelRoutine &routine) { + checkSpeed(); + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + + if (nextReelPointer == 4) { + if (data.byte(kGunpassflag) != 1 && engine->randomNumber() >= 10) + nextReelPointer = 0; + } else if (nextReelPointer == 20) { + if (data.byte(kGunpassflag) != 1) + nextReelPointer = 0; + } else if (nextReelPointer == 41) { + nextReelPointer = 0; + data.byte(kGunpassflag)++; + routine.b7 = 10; + } + + routine.setReelPointer(nextReelPointer); + } + + showGameReel(&routine); + addToPeopleList(&routine); + + if (routine.b7 & 128) + data.byte(kTalkedtoboss) = 1; +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index f374c87f0d..ec01fd116f 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -451,6 +451,7 @@ void drinker(ReelRoutine &routine); void alleyBarkSound(ReelRoutine &routine); void louisChair(ReelRoutine &routine); + void bossMan(ReelRoutine &routine); void singleKey(uint8 key, uint16 x, uint16 y); void loadSaveBox(); void loadKeypad(); |