GNAP: Prepare the merge of scene group 0 (WIP)

This commit is contained in:
Strangerke 2016-04-26 22:00:39 +02:00 committed by Eugene Sandulenko
parent 71ba82154e
commit 19d205b3da
4 changed files with 212 additions and 211 deletions

View File

@ -28,39 +28,39 @@
namespace Gnap {
enum {
kHSPlatypus = 0,
kHSExitTruck = 1,
kHSMud = 2,
kHSPigs = 3,
kHSSpaceship = 4,
kHSDevice = 5,
kHSWalkArea1 = 6,
kHSWalkArea2 = 7,
kHSWalkArea3 = 8,
kHSWalkArea4 = 9,
kHSWalkArea5 = 10,
kHSWalkArea6 = 11,
kHSWalkArea7 = 12,
kHSWalkArea8 = 13
kHS01Platypus = 0,
kHS01ExitTruck = 1,
kHS01Mud = 2,
kHS01Pigs = 3,
kHS01Spaceship = 4,
kHS01Device = 5,
kHS01WalkArea1 = 6,
kHS01WalkArea2 = 7,
kHS01WalkArea3 = 8,
kHS01WalkArea4 = 9,
kHS01WalkArea5 = 10,
kHS01WalkArea6 = 11,
kHS01WalkArea7 = 12,
kHS01WalkArea8 = 13
};
enum {
kASLookSpaceship = 1,
kASLookSpaceshipDone = 2,
kASLeaveScene = 3,
kASTakeMud = 5,
kASLookPigs = 6,
kASUsePigs = 7
kAS01LookSpaceship = 1,
kAS01LookSpaceshipDone = 2,
kAS01LeaveScene = 3,
kAS01TakeMud = 5,
kAS01LookPigs = 6,
kAS01UsePigs = 7
};
Scene01::Scene01(GnapEngine *vm) : Scene(vm) {
_s01_pigsIdCtr = 0;
_s01_smokeIdCtr = 0;
_s01_spaceshipSurface = nullptr;
_pigsIdCtr = 0;
_smokeIdCtr = 0;
_spaceshipSurface = nullptr;
}
Scene01::~Scene01() {
delete _s01_spaceshipSurface;
delete _spaceshipSurface;
}
int Scene01::init() {
@ -70,24 +70,24 @@ int Scene01::init() {
}
void Scene01::updateHotspots() {
_vm->setHotspot(kHSPlatypus, 0, 0, 0, 0, SF_DISABLED | SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR);
_vm->setHotspot(kHSExitTruck, 780, 226, 800, 455, SF_EXIT_R_CURSOR | SF_WALKABLE, 10, 6);
_vm->setHotspot(kHSMud, 138, 282, 204, 318, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 3, 5);
_vm->setHotspot(kHSPigs, 408, 234, 578, 326, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 6, 4);
_vm->setHotspot(kHSSpaceship, 0, 200, 94, 292, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 1, 6);
_vm->setHotspot(kHSWalkArea1, 0, 0, 162, 426);
_vm->setHotspot(kHSWalkArea2, 162, 0, 237, 396);
_vm->setHotspot(kHSWalkArea3, 237, 0, 319, 363);
_vm->setHotspot(kHSWalkArea4, 520, 0, 800, 404);
_vm->setHotspot(kHSWalkArea5, 300, 447, 800, 600);
_vm->setHotspot(kHSWalkArea6, 678, 0, 800, 404);
_vm->setHotspot(kHSWalkArea7, 0, 0, 520, 351);
_vm->setHotspot(kHSWalkArea8, 0, 546, 300, 600);
_vm->setDeviceHotspot(kHSDevice, -1, -1, -1, -1);
_vm->setHotspot(kHS01Platypus, 0, 0, 0, 0, SF_DISABLED | SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR);
_vm->setHotspot(kHS01ExitTruck, 780, 226, 800, 455, SF_EXIT_R_CURSOR | SF_WALKABLE, 10, 6);
_vm->setHotspot(kHS01Mud, 138, 282, 204, 318, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 3, 5);
_vm->setHotspot(kHS01Pigs, 408, 234, 578, 326, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 6, 4);
_vm->setHotspot(kHS01Spaceship, 0, 200, 94, 292, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 1, 6);
_vm->setHotspot(kHS01WalkArea1, 0, 0, 162, 426);
_vm->setHotspot(kHS01WalkArea2, 162, 0, 237, 396);
_vm->setHotspot(kHS01WalkArea3, 237, 0, 319, 363);
_vm->setHotspot(kHS01WalkArea4, 520, 0, 800, 404);
_vm->setHotspot(kHS01WalkArea5, 300, 447, 800, 600);
_vm->setHotspot(kHS01WalkArea6, 678, 0, 800, 404);
_vm->setHotspot(kHS01WalkArea7, 0, 0, 520, 351);
_vm->setHotspot(kHS01WalkArea8, 0, 546, 300, 600);
_vm->setDeviceHotspot(kHS01Device, -1, -1, -1, -1);
if (_vm->isFlag(kGFPlatypus))
_vm->_hotspots[kHSPlatypus]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR;
_vm->_hotspots[kHS01Platypus]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR;
if (_vm->isFlag(kGFMudTaken))
_vm->_hotspots[kHSMud]._flags = SF_WALKABLE | SF_DISABLED;
_vm->_hotspots[kHS01Mud]._flags = SF_WALKABLE | SF_DISABLED;
_vm->_hotspotsCount = 14;
}
@ -136,14 +136,14 @@ void Scene01::run() {
switch (_vm->_sceneClickedHotspot) {
case kHSDevice:
case kHS01Device:
if (_vm->_gnapActionStatus < 0) {
_vm->runMenu();
updateHotspots();
}
break;
case kHSPlatypus:
case kHS01Platypus:
if (_vm->_gnapActionStatus < 0 && _vm->isFlag(kGFPlatypus)) {
if (_vm->_grabCursorSpriteIndex == kItemDisguise) {
_vm->gnapUseDisguiseOnPlatypus();
@ -172,7 +172,7 @@ void Scene01::run() {
}
break;
case kHSSpaceship:
case kHS01Spaceship:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, 2);
@ -181,7 +181,7 @@ void Scene01::run() {
case LOOK_CURSOR:
_vm->_gnapIdleFacing = kDirUpLeft;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1))
_vm->_gnapActionStatus = kASLookSpaceship;
_vm->_gnapActionStatus = kAS01LookSpaceship;
break;
case GRAB_CURSOR:
case TALK_CURSOR:
@ -193,7 +193,7 @@ void Scene01::run() {
}
break;
case kHSMud:
case kHS01Mud:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y, 2, 3);
@ -204,7 +204,7 @@ void Scene01::run() {
break;
case GRAB_CURSOR:
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y, 0, _vm->getGnapSequenceId(gskIdle, 2, 3) | 0x10000, 1);
_vm->_gnapActionStatus = kASTakeMud;
_vm->_gnapActionStatus = kAS01TakeMud;
break;
case TALK_CURSOR:
case PLAT_CURSOR:
@ -215,7 +215,7 @@ void Scene01::run() {
}
break;
case kHSPigs:
case kHS01Pigs:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 7, 2);
@ -224,17 +224,17 @@ void Scene01::run() {
case LOOK_CURSOR:
_vm->_gnapIdleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 7, 2) | 0x10000, 1);
_vm->_gnapActionStatus = kASLookPigs;
_vm->_gnapActionStatus = kAS01LookPigs;
break;
case GRAB_CURSOR:
_vm->_gnapIdleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 7, 2) | 0x10000, 1);
_vm->_gnapActionStatus = kASUsePigs;
_vm->_gnapActionStatus = kAS01UsePigs;
break;
case TALK_CURSOR:
_vm->_gnapIdleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 7, 2) | 0x10000, 1);
_vm->_gnapActionStatus = kASLookPigs;
_vm->_gnapActionStatus = kAS01LookPigs;
break;
case PLAT_CURSOR:
_vm->playGnapImpossible(0, 0);
@ -244,25 +244,25 @@ void Scene01::run() {
}
break;
case kHSExitTruck:
case kHS01ExitTruck:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y, 0, 0x107AB, 1);
_vm->_gnapActionStatus = kASLeaveScene;
_vm->_gnapActionStatus = kAS01LeaveScene;
if (_vm->isFlag(kGFPlatypus))
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y + 1, -1, 0x107CD, 1);
_vm->_newSceneNum = 2;
}
break;
case kHSWalkArea1:
case kHSWalkArea2:
case kHSWalkArea3:
case kHSWalkArea4:
case kHSWalkArea5:
case kHSWalkArea6:
case kHSWalkArea7:
case kHSWalkArea8:
case kHS01WalkArea1:
case kHS01WalkArea2:
case kHS01WalkArea3:
case kHS01WalkArea4:
case kHS01WalkArea5:
case kHS01WalkArea6:
case kHS01WalkArea7:
case kHS01WalkArea8:
if (_vm->_gnapActionStatus < 0)
_vm->gnapWalkTo(-1, -1, -1, -1, 1);
break;
@ -312,26 +312,26 @@ void Scene01::updateAnimations() {
if (_vm->_gameSys->getAnimationStatus(0) == 2) {
_vm->_gameSys->setAnimation(0, 0, 0);
switch (_vm->_gnapActionStatus) {
case kASLookSpaceship:
_s01_spaceshipSurface = _vm->_gameSys->createSurface(47);
_vm->_gameSys->insertSpriteDrawItem(_s01_spaceshipSurface, 0, 0, 255);
case kAS01LookSpaceship:
_spaceshipSurface = _vm->_gameSys->createSurface(47);
_vm->_gameSys->insertSpriteDrawItem(_spaceshipSurface, 0, 0, 255);
_vm->_gameSys->setAnimation(133, 256, 0);
_vm->_gameSys->insertSequence(133, 256, 0, 0, kSeqNone, 0, 0, 0);
_vm->_gnapActionStatus = kASLookSpaceshipDone;
_vm->_gnapActionStatus = kAS01LookSpaceshipDone;
break;
case kASLookSpaceshipDone:
case kAS01LookSpaceshipDone:
_vm->_gameSys->removeSequence(133, 256, true);
_vm->_gameSys->removeSpriteDrawItem(_s01_spaceshipSurface, 255);
_vm->deleteSurface(&_s01_spaceshipSurface);
_vm->_gameSys->removeSpriteDrawItem(_spaceshipSurface, 255);
_vm->deleteSurface(&_spaceshipSurface);
_vm->_gnapActionStatus = -1;
break;
case kASLeaveScene:
case kAS01LeaveScene:
_vm->_sceneDone = true;
break;
case kASTakeMud:
case kAS01TakeMud:
_vm->playGnapPullOutDevice(2, 3);
_vm->playGnapUseDevice(0, 0);
_vm->_gameSys->insertSequence(128, 40, 129, 40, kSeqSyncWait, 0, 0, 0);
@ -339,14 +339,14 @@ void Scene01::updateAnimations() {
_vm->_gnapActionStatus = -1;
break;
case kASLookPigs:
case kAS01LookPigs:
_vm->playSound(138, false);
_vm->playSound(139, false);
_vm->playSound(140, false);
_vm->_gnapActionStatus = -1;
break;
case kASUsePigs:
case kAS01UsePigs:
_vm->playGnapPullOutDevice(7, 2);
_vm->playGnapUseDevice(0, 0);
_vm->_gameSys->insertSequence(135, 39, 0, 0, kSeqNone, 25, _vm->getRandom(140) - 40, 0);
@ -364,18 +364,18 @@ void Scene01::updateAnimations() {
}
if (_vm->_gameSys->getAnimationStatus(4) == 2) {
_s01_smokeIdCtr = (_s01_smokeIdCtr + 1) % 2;
_vm->_gameSys->setAnimation(0x86, _s01_smokeIdCtr + 20, 4);
_vm->_gameSys->insertSequence(0x86, _s01_smokeIdCtr + 20,
0x86, (_s01_smokeIdCtr + 1) % 2 + 20,
_smokeIdCtr = (_smokeIdCtr + 1) % 2;
_vm->_gameSys->setAnimation(0x86, _smokeIdCtr + 20, 4);
_vm->_gameSys->insertSequence(0x86, _smokeIdCtr + 20,
0x86, (_smokeIdCtr + 1) % 2 + 20,
kSeqSyncWait, 0, 0, 0);
}
if (_vm->_gameSys->getAnimationStatus(2) == 2) {
_s01_pigsIdCtr = (_s01_pigsIdCtr + 1) % 2;
_vm->_gameSys->setAnimation(0x7F, _s01_pigsIdCtr + 40, 2);
_vm->_gameSys->insertSequence(0x7F, _s01_pigsIdCtr + 40,
0x7F, (_s01_pigsIdCtr + 1) % 2 + 40,
_pigsIdCtr = (_pigsIdCtr + 1) % 2;
_vm->_gameSys->setAnimation(0x7F, _pigsIdCtr + 40, 2);
_vm->_gameSys->insertSequence(0x7F, _pigsIdCtr + 40,
0x7F, (_pigsIdCtr + 1) % 2 + 40,
kSeqSyncWait, 0, 0, 0);
}
}

View File

@ -42,8 +42,9 @@ public:
virtual void updateAnimationsCb() {}
private:
int _s01_pigsIdCtr, _s01_smokeIdCtr;
Graphics::Surface *_s01_spaceshipSurface;
int _pigsIdCtr;
int _smokeIdCtr;
Graphics::Surface *_spaceshipSurface;
};
} // End of namespace Gnap

View File

@ -28,42 +28,42 @@
namespace Gnap {
enum {
kHSPlatypus = 0,
kHSChicken = 1,
kHSTruck1 = 2,
kHSTruck2 = 3,
kHSTruckGrill = 4,
kHSDevice = 5,
kHSExitHouse = 6,
kHSExitBarn = 7,
kHSExitCreek = 8,
kHSExitPigpen = 9,
kHSWalkArea1 = 10,
kHSWalkArea2 = 11,
kHSWalkArea3 = 12,
kHSWalkArea4 = 13
kHS02Platypus = 0,
kHS02Chicken = 1,
kHS02Truck1 = 2,
kHS02Truck2 = 3,
kHS02TruckGrill = 4,
kHS02Device = 5,
kHS02ExitHouse = 6,
kHS02ExitBarn = 7,
kHS02ExitCreek = 8,
kHS02ExitPigpen = 9,
kHS02WalkArea1 = 10,
kHS02WalkArea2 = 11,
kHS02WalkArea3 = 12,
kHS02WalkArea4 = 13
};
enum {
kASUseTruckNoKeys = 0,
kASUseGasWithTruck = 1,
kASUseTruckGas = 2,
kASUseTruckNoGas = 3,
kASGrabTruckGrill = 5,
kASLeaveScene = 6,
kASTalkChicken = 7,
kASGrabChicken = 8,
kASGrabChickenDone = 9,
kASUseTruckNoKeysDone = 11,
kASUseGasWithTruckDone = 12,
kASUseTwigWithChicken = 16
kAS02UseTruckNoKeys = 0,
kAS02UseGasWithTruck = 1,
kAS02UseTruckGas = 2,
kAS02UseTruckNoGas = 3,
kAS02GrabTruckGrill = 5,
kAS02LeaveScene = 6,
kAS02TalkChicken = 7,
kAS02GrabChicken = 8,
kAS02GrabChickenDone = 9,
kAS02UseTruckNoKeysDone = 11,
kAS02UseGasWithTruckDone = 12,
kAS02UseTwigWithChicken = 16
};
Scene02::Scene02(GnapEngine *vm) : Scene(vm) {
_s02_truckGrillCtr = 0;
_s02_nextChickenSequenceId = 0;
_s02_currChickenSequenceId = 0;
_s02_gnapTruckSequenceId = 0;
_truckGrillCtr = 0;
_nextChickenSequenceId = 0;
_currChickenSequenceId = 0;
_gnapTruckSequenceId = 0;
}
int Scene02::init() {
@ -72,22 +72,22 @@ int Scene02::init() {
}
void Scene02::updateHotspots() {
_vm->setHotspot(kHSPlatypus, 0, 0, 0, 0, SF_DISABLED | SF_WALKABLE);
_vm->setHotspot(kHSChicken, 606, 455, 702, 568, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 7, 8);
_vm->setHotspot(kHSTruck1, 385, 258, 464, 304, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 6, 5);
_vm->setHotspot(kHSTruck2, 316, 224, 390, 376, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 5, 6);
_vm->setHotspot(kHSTruckGrill, 156, 318, 246, 390, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 2, 7);
_vm->setHotspot(kHSExitHouse, 480, 120, 556, 240, SF_EXIT_U_CURSOR, 7, 5);
_vm->setHotspot(kHSExitBarn, 610, 0, 800, 164, SF_EXIT_U_CURSOR, 10, 5);
_vm->setHotspot(kHSExitCreek, 780, 336, 800, 556, SF_EXIT_R_CURSOR | SF_WALKABLE, 10, 8);
_vm->setHotspot(kHSExitPigpen, 0, 300, 20, 600, SF_EXIT_L_CURSOR | SF_WALKABLE, 0, 8);
_vm->setHotspot(kHSWalkArea1, 92, 140, 304, 430, 0, 3, 1);
_vm->setHotspot(kHSWalkArea2, 0, 0, 800, 380);
_vm->setHotspot(kHSWalkArea3, 0, 0, 386, 445);
_vm->setHotspot(kHSWalkArea4, 386, 0, 509, 410);
_vm->setDeviceHotspot(kHSDevice, -1, -1, -1, -1);
_vm->setHotspot(kHS02Platypus, 0, 0, 0, 0, SF_DISABLED | SF_WALKABLE);
_vm->setHotspot(kHS02Chicken, 606, 455, 702, 568, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 7, 8);
_vm->setHotspot(kHS02Truck1, 385, 258, 464, 304, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 6, 5);
_vm->setHotspot(kHS02Truck2, 316, 224, 390, 376, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 5, 6);
_vm->setHotspot(kHS02TruckGrill, 156, 318, 246, 390, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 2, 7);
_vm->setHotspot(kHS02ExitHouse, 480, 120, 556, 240, SF_EXIT_U_CURSOR, 7, 5);
_vm->setHotspot(kHS02ExitBarn, 610, 0, 800, 164, SF_EXIT_U_CURSOR, 10, 5);
_vm->setHotspot(kHS02ExitCreek, 780, 336, 800, 556, SF_EXIT_R_CURSOR | SF_WALKABLE, 10, 8);
_vm->setHotspot(kHS02ExitPigpen, 0, 300, 20, 600, SF_EXIT_L_CURSOR | SF_WALKABLE, 0, 8);
_vm->setHotspot(kHS02WalkArea1, 92, 140, 304, 430, 0, 3, 1);
_vm->setHotspot(kHS02WalkArea2, 0, 0, 800, 380);
_vm->setHotspot(kHS02WalkArea3, 0, 0, 386, 445);
_vm->setHotspot(kHS02WalkArea4, 386, 0, 509, 410);
_vm->setDeviceHotspot(kHS02Device, -1, -1, -1, -1);
if (_vm->isFlag(kGFPlatypus))
_vm->_hotspots[kHSPlatypus]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR;
_vm->_hotspots[kHS02Platypus]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR;
_vm->_hotspotsCount = 14;
}
@ -95,11 +95,11 @@ void Scene02::run() {
_vm->playSound(0x1091C, true);
_vm->startSoundTimerC(6);
_s02_currChickenSequenceId = 0x14B;
_currChickenSequenceId = 0x14B;
_vm->_gameSys->setAnimation(0x14B, 179, 2);
_vm->_gameSys->insertSequence(0x14B, 179, 0, 0, kSeqNone, 0, 0, 0);
_s02_nextChickenSequenceId = -1;
_nextChickenSequenceId = -1;
_vm->_timers[5] = _vm->getRandom(20) + 30;
_vm->_timers[4] = _vm->getRandom(100) + 300;
@ -159,14 +159,14 @@ void Scene02::run() {
_vm->updateGrabCursorSprite(0, 0);
switch (_vm->_sceneClickedHotspot) {
case kHSDevice:
case kHS02Device:
if (_vm->_gnapActionStatus < 0) {
_vm->runMenu();
updateHotspots();
}
break;
case kHSPlatypus:
case kHS02Platypus:
if (_vm->_gnapActionStatus < 0 && _vm->isFlag(kGFPlatypus)) {
if (_vm->_grabCursorSpriteIndex == kItemDisguise) {
_vm->gnapUseDisguiseOnPlatypus();
@ -195,13 +195,13 @@ void Scene02::run() {
}
break;
case kHSChicken:
case kHS02Chicken:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemTwig) {
_vm->_gnapIdleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y + 1,
0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kASUseTwigWithChicken;
_vm->_gnapActionStatus = kAS02UseTwigWithChicken;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y + 1, 9, 8);
} else {
@ -212,14 +212,14 @@ void Scene02::run() {
case GRAB_CURSOR:
_vm->_gnapIdleFacing = kDirBottomRight;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1))
_vm->_gnapActionStatus = kASGrabChicken;
_vm->_gnapActionStatus = kAS02GrabChicken;
else
_vm->_gnapActionStatus = -1;
break;
case TALK_CURSOR:
_vm->_gnapIdleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kASTalkChicken;
_vm->_gnapActionStatus = kAS02TalkChicken;
break;
case PLAT_CURSOR:
_vm->playGnapImpossible(0, 0);
@ -229,23 +229,23 @@ void Scene02::run() {
}
break;
case kHSTruck1:
case kHSTruck2:
case kHS02Truck1:
case kHS02Truck2:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemKeys) {
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 2, 2) | 0x10000, 1)) {
_vm->setGrabCursorSprite(-1);
_vm->invRemove(kItemKeys);
if (_vm->isFlag(kGFTruckFilledWithGas))
_vm->_gnapActionStatus = kASUseTruckGas;
_vm->_gnapActionStatus = kAS02UseTruckGas;
else
_vm->_gnapActionStatus = kASUseTruckNoGas;
_vm->_gnapActionStatus = kAS02UseTruckNoGas;
}
} else if (_vm->_grabCursorSpriteIndex == kItemGas) {
_vm->_hotspots[kHSWalkArea4]._flags |= SF_WALKABLE;
_vm->_hotspots[kHS02WalkArea4]._flags |= SF_WALKABLE;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y, 0, _vm->getGnapSequenceId(gskIdle, 2, 2) | 0x10000, 1))
_vm->_gnapActionStatus = kASUseGasWithTruck;
_vm->_hotspots[kHSWalkArea4]._flags &= ~SF_WALKABLE;
_vm->_gnapActionStatus = kAS02UseGasWithTruck;
_vm->_hotspots[kHS02WalkArea4]._flags &= ~SF_WALKABLE;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y, 2, 2);
} else {
@ -257,14 +257,14 @@ void Scene02::run() {
if (_vm->isFlag(kGFTruckKeysUsed)) {
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 2, 2) | 0x10000, 1)) {
if (_vm->isFlag(kGFTruckFilledWithGas))
_vm->_gnapActionStatus = kASUseTruckGas;
_vm->_gnapActionStatus = kAS02UseTruckGas;
else
_vm->_gnapActionStatus = kASUseTruckNoGas;
_vm->_gnapActionStatus = kAS02UseTruckNoGas;
}
} else {
_vm->_gnapIdleFacing = kDirUnk4;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 2, 2) | 0x10000, 1))
_vm->_gnapActionStatus = kASUseTruckNoKeys;
_vm->_gnapActionStatus = kAS02UseTruckNoKeys;
}
break;
case TALK_CURSOR:
@ -276,7 +276,7 @@ void Scene02::run() {
}
break;
case kHSTruckGrill:
case kHS02TruckGrill:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 2, 4);
@ -288,7 +288,7 @@ void Scene02::run() {
case GRAB_CURSOR:
_vm->_gnapIdleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kASGrabTruckGrill;
_vm->_gnapActionStatus = kAS02GrabTruckGrill;
break;
case TALK_CURSOR:
case PLAT_CURSOR:
@ -299,11 +299,11 @@ void Scene02::run() {
}
break;
case kHSExitHouse:
case kHS02ExitHouse:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[6].x, _vm->_hotspotsWalkPos[6].y, 0, 0x107AD, 1);
_vm->_gnapActionStatus = kASLeaveScene;
_vm->_gnapActionStatus = kAS02LeaveScene;
if (_vm->isFlag(kGFPlatypus))
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[6].x + 1, _vm->_hotspotsWalkPos[6].y, -1, 0x107C1, 1);
updateHotspots();
@ -311,11 +311,11 @@ void Scene02::run() {
}
break;
case kHSExitBarn:
case kHS02ExitBarn:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[7].x, _vm->_hotspotsWalkPos[7].y, 0, 0x107AD, 1);
_vm->_gnapActionStatus = kASLeaveScene;
_vm->_gnapActionStatus = kAS02LeaveScene;
if (_vm->isFlag(kGFPlatypus))
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[7].x + 1, _vm->_hotspotsWalkPos[7].y, -1, 0x107C1, 1);
updateHotspots();
@ -323,32 +323,32 @@ void Scene02::run() {
}
break;
case kHSExitCreek:
case kHS02ExitCreek:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[8].x, _vm->_hotspotsWalkPos[8].y, 0, 0x107AB, 1);
_vm->_gnapActionStatus = kASLeaveScene;
_vm->_gnapActionStatus = kAS02LeaveScene;
if (_vm->isFlag(kGFPlatypus))
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[8].x, _vm->_hotspotsWalkPos[8].y, -1, 0x107CD, 1);
_vm->_newSceneNum = 3;
}
break;
case kHSExitPigpen:
case kHS02ExitPigpen:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[9].x, _vm->_hotspotsWalkPos[9].y, 0, 0x107AF, 1);
_vm->_gnapActionStatus = kASLeaveScene;
_vm->_gnapActionStatus = kAS02LeaveScene;
if (_vm->isFlag(kGFPlatypus))
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[9].x, _vm->_hotspotsWalkPos[9].y, -1, 0x107CF, 1);
_vm->_newSceneNum = 1;
}
break;
case kHSWalkArea1:
case kHSWalkArea2:
case kHSWalkArea3:
case kHSWalkArea4:
case kHS02WalkArea1:
case kHS02WalkArea2:
case kHS02WalkArea3:
case kHS02WalkArea4:
if (_vm->_gnapActionStatus < 0)
_vm->gnapWalkTo(-1, -1, -1, -1, 1);
break;
@ -379,12 +379,12 @@ void Scene02::run() {
else
_vm->_gameSys->insertSequence(0x154, 256, 0, 0, kSeqNone, 0, 0, 0);
}
if (!_vm->_timers[5] && _s02_nextChickenSequenceId == -1 && _vm->_gnapActionStatus != 7 && _vm->_gnapActionStatus != 8) {
if (!_vm->_timers[5] && _nextChickenSequenceId == -1 && _vm->_gnapActionStatus != 7 && _vm->_gnapActionStatus != 8) {
if (_vm->getRandom(6) != 0) {
_s02_nextChickenSequenceId = 0x14B;
_nextChickenSequenceId = 0x14B;
_vm->_timers[5] = _vm->getRandom(20) + 30;
} else {
_s02_nextChickenSequenceId = 0x14D;
_nextChickenSequenceId = 0x14D;
_vm->_timers[5] = _vm->getRandom(20) + 50;
}
}
@ -406,14 +406,14 @@ void Scene02::run() {
void Scene02::updateAnimations() {
if (_vm->_gameSys->getAnimationStatus(0) == 2) {
switch (_vm->_gnapActionStatus) {
case kASUseTruckNoKeys:
case kAS02UseTruckNoKeys:
_vm->_gameSys->insertSequence(0x14E, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gameSys->setAnimation(0x14E, _vm->_gnapId, 0);
_vm->_gnapSequenceId = 0x14E;
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapActionStatus = kASUseTruckNoKeysDone;
_vm->_gnapActionStatus = kAS02UseTruckNoKeysDone;
break;
case kASUseGasWithTruck:
case kAS02UseGasWithTruck:
_vm->_gameSys->insertSequence(0x151, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gameSys->setAnimation(0x151, _vm->_gnapId, 0);
_vm->_gnapSequenceId = 0x151;
@ -421,9 +421,9 @@ void Scene02::updateAnimations() {
_vm->invRemove(kItemGas);
_vm->setGrabCursorSprite(-1);
_vm->setFlag(kGFTruckFilledWithGas);
_vm->_gnapActionStatus = kASUseGasWithTruckDone;
_vm->_gnapActionStatus = kAS02UseGasWithTruckDone;
break;
case kASUseTruckGas:
case kAS02UseTruckGas:
_vm->_timers[5] = 9999;
_vm->_timers[4] = 9999;
_vm->hideCursor();
@ -440,7 +440,7 @@ void Scene02::updateAnimations() {
_vm->_newSceneNum = 47;
_vm->_sceneDone = true;
break;
case kASUseTruckNoGas:
case kAS02UseTruckNoGas:
_vm->hideCursor();
_vm->setGrabCursorSprite(-1);
_vm->_timers[4] = 250;
@ -457,54 +457,54 @@ void Scene02::updateAnimations() {
_vm->_sceneDone = true;
_vm->setFlag(kGFUnk25);
break;
case kASGrabTruckGrill:
switch (_s02_truckGrillCtr) {
case kAS02GrabTruckGrill:
switch (_truckGrillCtr) {
case 0:
_s02_gnapTruckSequenceId = 0x158;
_gnapTruckSequenceId = 0x158;
break;
case 1:
_s02_gnapTruckSequenceId = 0x159;
_gnapTruckSequenceId = 0x159;
break;
case 2:
_s02_gnapTruckSequenceId = 0x157;
_gnapTruckSequenceId = 0x157;
break;
}
_s02_truckGrillCtr = (_s02_truckGrillCtr + 1) % 3;
_vm->_gameSys->insertSequence(_s02_gnapTruckSequenceId, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gameSys->setAnimation(_s02_gnapTruckSequenceId, _vm->_gnapId, 0);
_vm->_gnapSequenceId = _s02_gnapTruckSequenceId;
_truckGrillCtr = (_truckGrillCtr + 1) % 3;
_vm->_gameSys->insertSequence(_gnapTruckSequenceId, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gameSys->setAnimation(_gnapTruckSequenceId, _vm->_gnapId, 0);
_vm->_gnapSequenceId = _gnapTruckSequenceId;
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapActionStatus = -1;
break;
case kASLeaveScene:
case kAS02LeaveScene:
_vm->_sceneDone = true;
break;
case kASTalkChicken:
_s02_nextChickenSequenceId = 0x14C;
case kAS02TalkChicken:
_nextChickenSequenceId = 0x14C;
break;
case kASGrabChicken:
_s02_nextChickenSequenceId = 0x150;
case kAS02GrabChicken:
_nextChickenSequenceId = 0x150;
_vm->_timers[2] = 100;
break;
case kASGrabChickenDone:
case kAS02GrabChickenDone:
_vm->_gameSys->insertSequence(0x107B5, _vm->_gnapId, 0x150, 179, kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B5;
_vm->_gnapSequenceDatNum = 1;
_s02_currChickenSequenceId = 0x14B;
_currChickenSequenceId = 0x14B;
_vm->_gameSys->setAnimation(0x14B, 179, 2);
_vm->_gameSys->insertSequence(_s02_currChickenSequenceId, 179, 0, 0, kSeqNone, 0, 0, 0);
_vm->_gameSys->insertSequence(_currChickenSequenceId, 179, 0, 0, kSeqNone, 0, 0, 0);
_vm->_gnapActionStatus = -1;
_vm->_timers[5] = 30;
break;
case kASUseTwigWithChicken:
case kAS02UseTwigWithChicken:
_vm->playGnapShowItem(5, 0, 0);
_vm->_gameSys->insertSequence(0x155, 179, _s02_currChickenSequenceId, 179, kSeqSyncExists, 0, 0, 0);
_s02_currChickenSequenceId = 0x155;
_s02_nextChickenSequenceId = -1;
_vm->_gameSys->insertSequence(0x155, 179, _currChickenSequenceId, 179, kSeqSyncExists, 0, 0, 0);
_currChickenSequenceId = 0x155;
_nextChickenSequenceId = -1;
_vm->_gnapActionStatus = -1;
break;
case kASUseTruckNoKeysDone:
case kASUseGasWithTruckDone:
case kAS02UseTruckNoKeysDone:
case kAS02UseGasWithTruckDone:
default:
_vm->_gnapActionStatus = -1;
break;
@ -512,25 +512,25 @@ void Scene02::updateAnimations() {
}
if (_vm->_gameSys->getAnimationStatus(2) == 2) {
if (_s02_nextChickenSequenceId == 0x150) {
_vm->_gameSys->setAnimation(_s02_nextChickenSequenceId, 179, 0);
_vm->_gameSys->insertSequence(_s02_nextChickenSequenceId, 179, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gameSys->removeSequence(_s02_currChickenSequenceId, 179, true);
_s02_nextChickenSequenceId = -1;
_s02_currChickenSequenceId = -1;
_vm->_gnapActionStatus = kASGrabChickenDone;
if (_nextChickenSequenceId == 0x150) {
_vm->_gameSys->setAnimation(_nextChickenSequenceId, 179, 0);
_vm->_gameSys->insertSequence(_nextChickenSequenceId, 179, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gameSys->removeSequence(_currChickenSequenceId, 179, true);
_nextChickenSequenceId = -1;
_currChickenSequenceId = -1;
_vm->_gnapActionStatus = kAS02GrabChickenDone;
_vm->_timers[5] = 500;
} else if (_s02_nextChickenSequenceId == 0x14C) {
_vm->_gameSys->setAnimation(_s02_nextChickenSequenceId, 179, 2);
_vm->_gameSys->insertSequence(_s02_nextChickenSequenceId, 179, _s02_currChickenSequenceId, 179, kSeqSyncWait, 0, 0, 0);
_s02_currChickenSequenceId = _s02_nextChickenSequenceId;
_s02_nextChickenSequenceId = -1;
} else if (_nextChickenSequenceId == 0x14C) {
_vm->_gameSys->setAnimation(_nextChickenSequenceId, 179, 2);
_vm->_gameSys->insertSequence(_nextChickenSequenceId, 179, _currChickenSequenceId, 179, kSeqSyncWait, 0, 0, 0);
_currChickenSequenceId = _nextChickenSequenceId;
_nextChickenSequenceId = -1;
_vm->_gnapActionStatus = -1;
} else if (_s02_nextChickenSequenceId != -1) {
_vm->_gameSys->setAnimation(_s02_nextChickenSequenceId, 179, 2);
_vm->_gameSys->insertSequence(_s02_nextChickenSequenceId, 179, _s02_currChickenSequenceId, 179, kSeqSyncWait, 0, 0, 0);
_s02_currChickenSequenceId = _s02_nextChickenSequenceId;
_s02_nextChickenSequenceId = -1;
} else if (_nextChickenSequenceId != -1) {
_vm->_gameSys->setAnimation(_nextChickenSequenceId, 179, 2);
_vm->_gameSys->insertSequence(_nextChickenSequenceId, 179, _currChickenSequenceId, 179, kSeqSyncWait, 0, 0, 0);
_currChickenSequenceId = _nextChickenSequenceId;
_nextChickenSequenceId = -1;
}
}
}

View File

@ -42,10 +42,10 @@ public:
virtual void updateAnimationsCb() {}
private:
int _s02_truckGrillCtr;
int _s02_nextChickenSequenceId;
int _s02_currChickenSequenceId;
int _s02_gnapTruckSequenceId;
int _truckGrillCtr;
int _nextChickenSequenceId;
int _currChickenSequenceId;
int _gnapTruckSequenceId;
};
} // End of namespace Gnap