diff options
author | Filippos Karapetis | 2013-10-06 04:55:52 +0300 |
---|---|---|
committer | Filippos Karapetis | 2013-10-06 04:56:41 +0300 |
commit | f35298f9eed0c98a9ec839e80f95c9fcab075223 (patch) | |
tree | 3ec95ff547d1da89f4f236cfb0866689cfe69b68 /engines/neverhood/modules/module1600_sprites.cpp | |
parent | a1719ac3d0c895ce428fe91ccc90792f3ac2d43a (diff) | |
download | scummvm-rg350-f35298f9eed0c98a9ec839e80f95c9fcab075223.tar.gz scummvm-rg350-f35298f9eed0c98a9ec839e80f95c9fcab075223.tar.bz2 scummvm-rg350-f35298f9eed0c98a9ec839e80f95c9fcab075223.zip |
NEVERHOOD: Move module-specific Klaymen code to its respective module
Diffstat (limited to 'engines/neverhood/modules/module1600_sprites.cpp')
-rw-r--r-- | engines/neverhood/modules/module1600_sprites.cpp | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/engines/neverhood/modules/module1600_sprites.cpp b/engines/neverhood/modules/module1600_sprites.cpp index 4473a83ec9..06a00c82c0 100644 --- a/engines/neverhood/modules/module1600_sprites.cpp +++ b/engines/neverhood/modules/module1600_sprites.cpp @@ -843,4 +843,92 @@ void Tracks::findTrackPoint(NPoint pt, int &minMatchTrackIndex, int &minMatchDis } } +KmScene1608::KmScene1608(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y) + : Klaymen(vm, parentScene, x, y) { + + // Empty +} + +uint32 KmScene1608::xHandleMessage(int messageNum, const MessageParam ¶m) { + uint32 messageResult = 0; + switch (messageNum) { + case 0x2032: + _isSittingInTeleporter = param.asInteger() != 0; + messageResult = 1; + break; + case 0x4001: + case 0x4800: + startWalkToX(param.asPoint().x, false); + break; + case 0x4004: + if (_isSittingInTeleporter) + GotoState(&Klaymen::stSitIdleTeleporter); + else + GotoState(&Klaymen::stTryStandIdle); + break; + case 0x4812: + if (param.asInteger() == 2) + GotoState(&Klaymen::stPickUpNeedle); + else if (param.asInteger() == 1) + GotoState(&Klaymen::stPickUpTube); + else + GotoState(&Klaymen::stPickUpGeneric); + break; + case 0x4817: + setDoDeltaX(param.asInteger()); + gotoNextStateExt(); + break; + case 0x481B: + if (param.asPoint().y != 0) + startWalkToXDistance(param.asPoint().y, param.asPoint().x); + else + startWalkToAttachedSpriteXDistance(param.asPoint().x); + break; + case 0x481D: + if (_isSittingInTeleporter) + GotoState(&Klaymen::stTurnToUseInTeleporter); + break; + case 0x481E: + if (_isSittingInTeleporter) + GotoState(&Klaymen::stReturnFromUseInTeleporter); + break; + case 0x481F: + if (param.asInteger() == 1) + GotoState(&Klaymen::stWonderAboutAfter); + else if (param.asInteger() == 0) + GotoState(&Klaymen::stWonderAboutHalf); + else if (param.asInteger() == 4) + GotoState(&Klaymen::stTurnAwayFromUse); + else if (param.asInteger() == 3) + GotoState(&Klaymen::stTurnToUseHalf); + else + GotoState(&Klaymen::stWonderAbout); + break; + case 0x482D: + setDoDeltaX(_x > (int16)param.asInteger() ? 1 : 0); + gotoNextStateExt(); + break; + case 0x4834: + GotoState(&Klaymen::stStepOver); + break; + case 0x4835: + sendMessage(_parentScene, 0x2032, 1); + _isSittingInTeleporter = true; + GotoState(&Klaymen::stSitInTeleporter); + break; + case 0x4836: + sendMessage(_parentScene, 0x2032, 0); + _isSittingInTeleporter = false; + GotoState(&Klaymen::stGetUpFromTeleporter); + break; + case 0x483F: + startSpecialWalkRight(param.asInteger()); + break; + case 0x4840: + startSpecialWalkLeft(param.asInteger()); + break; + } + return messageResult; +} + } // End of namespace Neverhood |