diff options
author | Max Horn | 2011-12-16 16:24:41 +0100 |
---|---|---|
committer | Max Horn | 2011-12-16 16:25:38 +0100 |
commit | f878f0453a88ee5b11cfc0c755c2bfcd2a9ad6f9 (patch) | |
tree | f79a67a6840f2f87045a59b15a4fb1ecd1cf7b4e /engines | |
parent | 86c3c8b4620f3841ba587790bdad9f262d1ed339 (diff) | |
download | scummvm-rg350-f878f0453a88ee5b11cfc0c755c2bfcd2a9ad6f9.tar.gz scummvm-rg350-f878f0453a88ee5b11cfc0c755c2bfcd2a9ad6f9.tar.bz2 scummvm-rg350-f878f0453a88ee5b11cfc0c755c2bfcd2a9ad6f9.zip |
DREAMWEB: Convert useGun to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 177 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 112 |
4 files changed, 113 insertions, 178 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9106dc0425..906ce3adc3 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -3026,183 +3026,6 @@ notfoundinside: goto insideloop; } -void DreamGenContext::useGun() { - STACK_CHECK; - _cmp(data.byte(kObjecttype), 4); - if (flags.z()) - goto istakengun; - showSecondUse(); - putBackObStuff(); - return; -istakengun: - _cmp(data.byte(kReallocation), 22); - if (!flags.z()) - goto notinpoolroom; - cx = 300; - al = 34; - showPuzText(); - data.byte(kLastweapon) = 1; - data.byte(kCombatcount) = 39; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -notinpoolroom: - _cmp(data.byte(kReallocation), 25); - if (!flags.z()) - goto nothelicopter; - cx = 300; - al = 34; - showPuzText(); - data.byte(kLastweapon) = 1; - data.byte(kCombatcount) = 19; - data.byte(kGetback) = 1; - data.byte(kDreamnumber) = 2; - data.byte(kRoomafterdream) = 38; - data.byte(kSartaindead) = 1; - _inc(data.byte(kProgresspoints)); - return; -nothelicopter: - _cmp(data.byte(kReallocation), 27); - if (!flags.z()) - goto notinrockroom; - cx = 300; - al = 46; - showPuzText(); - data.byte(kPointermode) = 2; - data.byte(kRockstardead) = 1; - data.byte(kLastweapon) = 1; - data.byte(kNewsitem) = 1; - data.byte(kGetback) = 1; - data.byte(kRoomafterdream) = 32; - data.byte(kDreamnumber) = 0; - _inc(data.byte(kProgresspoints)); - return; -notinrockroom: - _cmp(data.byte(kReallocation), 8); - if (!flags.z()) - goto notbystudio; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - goto notbystudio; - _cmp(data.byte(kMapy), 40); - if (!flags.z()) - goto notbystudio; - al = 92; - isSetObOnMap(); - if (flags.z()) - goto notbystudio; - _cmp(data.byte(kManspath), 9); - if (flags.z()) - goto notbystudio; - data.byte(kDestination) = 9; - data.byte(kFinaldest) = 9; - autoSetWalk(); - data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -notbystudio: - _cmp(data.byte(kReallocation), 6); - if (!flags.z()) - goto notsarters; - _cmp(data.byte(kMapx), 11); - if (!flags.z()) - goto notsarters; - _cmp(data.byte(kMapy), 20); - if (!flags.z()) - goto notsarters; - al = 5; - isSetObOnMap(); - if (!flags.z()) - goto notsarters; - data.byte(kDestination) = 1; - data.byte(kFinaldest) = 1; - autoSetWalk(); - al = 5; - removeSetObject(); - al = 6; - placeSetObject(); - al = 1; - ah = data.byte(kRoomnum); - _dec(ah); - turnAnyPathOn(); - data.byte(kLiftflag) = 1; - data.word(kWatchingtime) = 40*2; - data.word(kReeltowatch) = 4; - data.word(kEndwatchreel) = 43; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -notsarters: - _cmp(data.byte(kReallocation), 29); - if (!flags.z()) - goto notaide; - data.byte(kGetback) = 1; - al = 13; - resetLocation(); - al = 12; - setLocation(); - data.byte(kDestpos) = 12; - data.byte(kDestination) = 2; - data.byte(kFinaldest) = 2; - autoSetWalk(); - data.word(kWatchingtime) = 164*2; - data.word(kReeltowatch) = 3; - data.word(kEndwatchreel) = 164; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kAidedead) = 1; - data.byte(kDreamnumber) = 3; - data.byte(kRoomafterdream) = 33; - _inc(data.byte(kProgresspoints)); - return; -notaide: - _cmp(data.byte(kReallocation), 23); - if (!flags.z()) - goto notwithboss; - _cmp(data.byte(kMapx), 0); - if (!flags.z()) - goto notwithboss; - _cmp(data.byte(kMapy), 50); - if (!flags.z()) - goto notwithboss; - _cmp(data.byte(kManspath), 5); - if (flags.z()) - goto pathokboss; - data.byte(kDestination) = 5; - data.byte(kFinaldest) = 5; - autoSetWalk(); -pathokboss: - data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; - return; -notwithboss: - _cmp(data.byte(kReallocation), 8); - if (!flags.z()) - goto nottvsoldier; - _cmp(data.byte(kMapx), 11); - if (!flags.z()) - goto nottvsoldier; - _cmp(data.byte(kMapy), 10); - if (!flags.z()) - goto nottvsoldier; - _cmp(data.byte(kManspath), 2); - if (flags.z()) - goto pathoktv; - data.byte(kDestination) = 2; - data.byte(kFinaldest) = 2; - autoSetWalk(); -pathoktv: - data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; - return; -nottvsoldier: - showFirstUse(); - putBackObStuff(); -} - void DreamGenContext::showDiaryKeys() { STACK_CHECK; _cmp(data.byte(kPresscount), 0); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 945e8ad10f..ddccd5eaad 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -539,7 +539,6 @@ public: void read(); void searchForString(); void selectOpenOb(); - void useGun(); void incRyanPage(); void clearChanges(); void searchForFiles(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index b50b1bccd7..3330f6f019 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -519,5 +519,6 @@ void openOb(); void withWhat(); void notHeldError(); + void useGun(); #endif diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 08b96cf33a..b0666bab33 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -764,6 +764,118 @@ void DreamGenContext::useChurchGate() { turnPathOn(2); // Open church } +void DreamGenContext::useGun() { + + if (data.byte(kObjecttype) != 4) { + // gun is not taken + showSecondUse(); + putBackObStuff(); + + } else if (data.byte(kReallocation) == 22) { + // in pool room + showPuzText(34, 300); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 39; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 25) { + // helicopter + showPuzText(34, 300); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 19; + data.byte(kGetback) = 1; + data.byte(kDreamnumber) = 2; + data.byte(kRoomafterdream) = 38; + data.byte(kSartaindead) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 27) { + // in rock room + showPuzText(46, 300); + data.byte(kPointermode) = 2; + data.byte(kRockstardead) = 1; + data.byte(kLastweapon) = 1; + data.byte(kNewsitem) = 1; + data.byte(kGetback) = 1; + data.byte(kRoomafterdream) = 32; + data.byte(kDreamnumber) = 0; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 22 && data.byte(kMapy) == 40 + && !isSetObOnMap(92) && data.byte(kManspath) != 9) { + // by studio + data.byte(kDestination) = 9; + data.byte(kFinaldest) = 9; + autoSetWalk(); + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 6 && data.byte(kMapx) == 11 && data.byte(kMapy) == 20 + && isSetObOnMap(5)) { + // sarters + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + autoSetWalk(); + removeSetObject(5); + placeSetObject(6); + turnAnyPathOn(1, data.byte(kRoomnum) - 1); + data.byte(kLiftflag) = 1; + data.word(kWatchingtime) = 40*2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 43; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 29) { + // aide + data.byte(kGetback) = 1; + al = 13; + resetLocation(); + setLocation(12); + data.byte(kDestpos) = 12; + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autoSetWalk(); + data.word(kWatchingtime) = 164*2; + data.word(kReeltowatch) = 3; + data.word(kEndwatchreel) = 164; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kAidedead) = 1; + data.byte(kDreamnumber) = 3; + data.byte(kRoomafterdream) = 33; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 23 && data.byte(kMapx) == 0 && data.byte(kMapy) == 50) { + // with boss + if (data.byte(kManspath) != 5) { + data.byte(kDestination) = 5; + data.byte(kFinaldest) = 5; + autoSetWalk(); + } + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + + } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { + // tv soldier + if (data.byte(kManspath) != 2) { + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autoSetWalk(); + } + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + + } else { + showFirstUse(); + putBackObStuff(); + } +} + void DreamGenContext::useFullCart() { data.byte(kProgresspoints)++; turnAnyPathOn(2, data.byte(kRoomnum) + 6); |