[Scummvm-cvs-logs] scummvm master -> d5ebc69de0af1992b821297d5e9cc9e8baa604de

bluegr bluegr at gmail.com
Sun Oct 6 17:09:08 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d5ebc69de0 NEVERHOOD: Move more scene-specific Klaymen animations to their scenes


Commit: d5ebc69de0af1992b821297d5e9cc9e8baa604de
    https://github.com/scummvm/scummvm/commit/d5ebc69de0af1992b821297d5e9cc9e8baa604de
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-10-06T08:08:19-07:00

Commit Message:
NEVERHOOD: Move more scene-specific Klaymen animations to their scenes

Changed paths:
    engines/neverhood/klaymen.cpp
    engines/neverhood/klaymen.h
    engines/neverhood/modules/module1000_sprites.cpp
    engines/neverhood/modules/module1000_sprites.h
    engines/neverhood/modules/module1300_sprites.cpp
    engines/neverhood/modules/module1300_sprites.h
    engines/neverhood/modules/module2100_sprites.cpp
    engines/neverhood/modules/module2100_sprites.h
    engines/neverhood/modules/module2200_sprites.cpp
    engines/neverhood/modules/module2200_sprites.h



diff --git a/engines/neverhood/klaymen.cpp b/engines/neverhood/klaymen.cpp
index ff6738a..5b0295b 100644
--- a/engines/neverhood/klaymen.cpp
+++ b/engines/neverhood/klaymen.cpp
@@ -1501,112 +1501,11 @@ uint32 Klaymen::hmPeekWall(int messageNum, const MessageParam &param, Entity *se
 	return hmLowLevelAnimation(messageNum, param, sender);
 }
 
-void Klaymen::stJumpToRing1() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stJumpToRing1))) {
-		_busyStatus = 0;
-		startAnimation(0xD82890BA, 0, -1);
-		setupJumpToRing();
-	}
-}
-
-void Klaymen::setupJumpToRing() {
-	_acceptInput = false;
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmJumpToRing);
-	SetSpriteUpdate(&Klaymen::suUpdateDestX);
-	NextState(&Klaymen::stHangOnRing);
-	sendMessage(_attachedSprite, 0x482B, 0);
-}
-
-uint32 Klaymen::hmJumpToRing(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x168050A0) {
-			sendMessage(_attachedSprite, 0x4806, 0);
-			_acceptInput = true;
-		} else if (param.asInteger() == 0x320AC306) {
-			playSound(0, 0x5860C640);
-		} else if (param.asInteger() == 0x4AB28209) {
-			sendMessage(_attachedSprite, 0x482A, 0);
-		} else if (param.asInteger() == 0x88001184) {
-			sendMessage(_attachedSprite, 0x482B, 0);
-		}
-		break;
-	}
-	return messageResult;
-}
-
 void Klaymen::suUpdateDestX() {
 	AnimatedSprite::updateDeltaXY();
 	_destX = _x;
 }
 
-void Klaymen::stHangOnRing() {
-	_busyStatus = 0;
-	_acceptInput = true;
-	startAnimation(0x4829E0B8, 0, -1);
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
-}
-
-void Klaymen::stJumpToRing2() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stJumpToRing2))) {
-		_busyStatus = 0;
-		startAnimation(0x900980B2, 0, -1);
-		setupJumpToRing();
-	}
-}
-
-void Klaymen::stJumpToRing3() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stJumpToRing3))) {
-		_busyStatus = 0;
-		_acceptInput = false;
-		startAnimation(0xBA1910B2, 0, -1);
-		SetUpdateHandler(&Klaymen::update);
-		SetSpriteUpdate(&Klaymen::suUpdateDestX);
-		SetMessageHandler(&Klaymen::hmJumpToRing3);
-		NextState(&Klaymen::stHoldRing3);
-		sendMessage(_attachedSprite, 0x482B, 0);
-	}
-}
-
-uint32 Klaymen::hmJumpToRing3(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x168050A0) {
-			sendMessage(_attachedSprite, 0x4806, 0);
-		} else if (param.asInteger() == 0x320AC306) {
-			playSound(0, 0x5860C640);
-		} else if (param.asInteger() == 0x4AB28209) {
-			sendMessage(_attachedSprite, 0x482A, 0);
-		} else if (param.asInteger() == 0x88001184) {
-			sendMessage(_attachedSprite, 0x482B, 0);
-		}
-		break;
-	}
-	return messageResult;
-}
-
-void Klaymen::stHoldRing3() {
-	_busyStatus = 0;
-	_acceptInput = true;
-	startAnimation(0x4A293FB0, 0, -1);
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmHoldRing3);
-	SetSpriteUpdate(NULL);
-}
-
-uint32 Klaymen::hmHoldRing3(int messageNum, const MessageParam &param, Entity *sender) {
-	if (messageNum == 0x1008) {
-		stReleaseRing();
-		return 0;
-	}
-	return hmLowLevel(messageNum, param, sender);
-}
-
 void Klaymen::stReleaseRing() {
 	_busyStatus = 1;
 	_acceptInput = false;
@@ -1618,14 +1517,6 @@ void Klaymen::stReleaseRing() {
 	SetSpriteUpdate(NULL);
 }
 
-void Klaymen::stJumpToRing4() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stJumpToRing4))) {
-		_busyStatus = 0;
-		startAnimation(0xB8699832, 0, -1);
-		setupJumpToRing();
-	}
-}
-
 void Klaymen::startWalkToAttachedSpriteXDistance(int16 distance) {
 	startWalkToXDistance(_attachedSprite->getX(), distance);
 }
@@ -2526,61 +2417,6 @@ void Klaymen::stInsertKey() {
 	}
 }
 
-uint32 Klaymen::hmReadNote(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x04684052) {
-			_acceptInput = true;
-			sendMessage(_parentScene, 0x2002, 0);
-		}
-		break;
-	}
-	return messageResult;
-}
-
-void Klaymen::stReadNote() {
-	_busyStatus = 2;
-	_acceptInput = false;
-	startAnimation(0x123E9C9F, 0, -1);
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmReadNote);
-	SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
-}
-
-uint32 Klaymen::hmHitByDoor(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
-	int16 speedUpFrameIndex;
-	switch (messageNum) {
-	case 0x1008:
-		speedUpFrameIndex = getFrameIndex(kKlaymenSpeedUpHash);
-		if (_currFrameIndex < speedUpFrameIndex) {
-			startAnimation(0x35AA8059, speedUpFrameIndex, -1);
-			_y = 438;
-		}
-		messageResult = 0;
-		break;
-	case 0x100D:
-		if (param.asInteger() == 0x1A1A0785) {
-			playSound(0, 0x40F0A342);
-		} else if (param.asInteger() == 0x60428026) {
-			playSound(0, 0x40608A59);
-		}
-		break;
-	}
-	return messageResult;
-}
-
-void Klaymen::stHitByDoor() {
-	_busyStatus = 1;
-	_acceptInput = false;
-	startAnimation(0x35AA8059, 0, -1);
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmHitByDoor);
-	SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
-	playSound(0, 0x402E82D4);
-}
-
 uint32 Klaymen::hmPeekWallReturn(int messageNum, const MessageParam &param, Entity *sender) {
 	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
 	switch (messageNum) {
@@ -2646,65 +2482,6 @@ void Klaymen::stPeekWallReturn() {
 	SetSpriteUpdate(NULL);
 }
 
-void Klaymen::stPullHammerLever() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stPullHammerLever))) {
-		_busyStatus = 2;
-		_acceptInput = false;
-		startAnimation(0x00648953, 0, -1);
-		SetUpdateHandler(&Klaymen::update);
-		SetMessageHandler(&Klaymen::hmPullHammerLever);
-		SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
-	}
-}
-
-uint32 Klaymen::hmPullHammerLever(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = Klaymen::hmLever(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x4AB28209)
-			sendMessage(_attachedSprite, 0x480F, 0);
-		break;
-	}
-	return messageResult;
-}
-
-void Klaymen::suRidePlatformDown() {
-	_platformDeltaY++;
-	_y += _platformDeltaY;
-	if (_y > 600)
-		sendMessage(this, 0x1019, 0);
-}
-
-void Klaymen::stRidePlatformDown() {
-	if (!stStartActionFromIdle(AnimationCallback(&Klaymen::stRidePlatformDown))) {
-		_busyStatus = 1;
-		sendMessage(_parentScene, 0x4803, 0);
-		_acceptInput = false;
-		_platformDeltaY = 0;
-		startAnimation(0x5420E254, 0, -1);
-		SetUpdateHandler(&Klaymen::update);
-		SetMessageHandler(&Klaymen::hmLowLevel);
-		SetSpriteUpdate(&Klaymen::suRidePlatformDown);
-		_vm->_soundMan->playSoundLooping(0xD3B02847);
-	}
-}
-
-void Klaymen::stCrashDown() {
-	playSound(0, 0x41648271);
-	_busyStatus = 1;
-	_acceptInput = false;
-	startAnimationByHash(0x000BAB02, 0x88003000, 0);
-	SetUpdateHandler(&Klaymen::update);
-	SetSpriteUpdate(NULL);
-	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	NextState(&Klaymen::stCrashDownFinished);
-}
-
-void Klaymen::stCrashDownFinished() {
-	setDoDeltaX(2);
-	stTryStandIdle();
-}
-
 void Klaymen::upSpitOutFall() {
 	Klaymen::update();
 	if (_spitOutCountdown != 0 && (--_spitOutCountdown == 0)) {
@@ -2713,24 +2490,6 @@ void Klaymen::upSpitOutFall() {
 	}
 }
 
-uint32 Klaymen::hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x168050A0) {
-			sendMessage(_attachedSprite, 0x480F, 0);
-		} else if (param.asInteger() == 0x586B0300) {
-			sendMessage(_otherSprite, 0x480E, 1);
-		} else if (param.asInteger() == 0x4AB28209) {
-			sendMessage(_attachedSprite, 0x482A, 0);
-		} else if (param.asInteger() == 0x88001184) {
-			sendMessage(_attachedSprite, 0x482B, 0);
-		}
-		break;
-	}
-	return messageResult;
-}
-
 uint32 Klaymen::hmStandIdleSpecial(int messageNum, const MessageParam &param, Entity *sender) {
 	switch (messageNum) {
 	case 0x4811:
@@ -2773,53 +2532,6 @@ uint32 Klaymen::hmPressDoorButton(int messageNum, const MessageParam &param, Ent
 	return messageResult;
 }
 
-uint32 Klaymen::hmMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x01084280) {
-			sendMessage(_attachedSprite, 0x480B, (uint32)_doDeltaX);
-		} else if (param.asInteger() == 0x02421405) {
-			if (_isMoveObjectRequested) {
-				if (sendMessage(_attachedSprite, 0x480C, (uint32)_doDeltaX) != 0)
-					stContinueMovingVenusFlyTrap();
-			} else {
-				SetMessageHandler(&Klaymen::hmFirstMoveVenusFlyTrap);
-			}
-		} else if (param.asInteger() == 0x4AB28209) {
-			sendMessage(_attachedSprite, 0x482A, 0);
-		} else if (param.asInteger() == 0x88001184) {
-			sendMessage(_attachedSprite, 0x482B, 0);
-		} else if (param.asInteger() == 0x32180101) {
-			playSound(0, 0x405002D8);
-		} else if (param.asInteger() == 0x0A2A9098) {
-			playSound(0, 0x0460E2FA);
-		}
-		break;
-	case 0x480A:
-		_isMoveObjectRequested = true;
-		return 0;
-	}
-	return hmLowLevelAnimation(messageNum, param, sender);
-}
-
-uint32 Klaymen::hmFirstMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x4AB28209) {
-			sendMessage(_attachedSprite, 0x482A, 0);
-		} else if (param.asInteger() == 0x88001184) {
-			sendMessage(_attachedSprite, 0x482B, 0);
-		} else if (param.asInteger() == 0x32180101) {
-			playSound(0, 0x405002D8);
-		} else if (param.asInteger() == 0x0A2A9098) {
-			playSound(0, 0x0460E2FA);
-		}
-		break;
-	}
-	return messageResult;
-}
-
 uint32 Klaymen::hmHitByBoxingGlove(int messageNum, const MessageParam &param, Entity *sender) {
 	int16 speedUpFrameIndex;
 	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
@@ -2843,18 +2555,6 @@ uint32 Klaymen::hmHitByBoxingGlove(int messageNum, const MessageParam &param, En
 	return messageResult;
 }
 
-uint32 Klaymen::hmJumpAndFall(int messageNum, const MessageParam &param, Entity *sender) {
-	uint32 messageResult = hmLowLevel(messageNum, param, sender);
-	switch (messageNum) {
-	case 0x100D:
-		if (param.asInteger() == 0x1307050A) {
-			playSound(0, 0x40428A09);
-		}
-		break;
-	}
-	return messageResult;
-}
-
 void Klaymen::suFallDown() {
 	AnimatedSprite::updateDeltaXY();
 	HitRect *hitRect = _parentScene->findHitRectAtPos(_x, _y + 10);
@@ -2866,19 +2566,6 @@ void Klaymen::suFallDown() {
 	_parentScene->checkCollision(this, 0xFFFF, 0x4810, 0);
 }
 
-void Klaymen::stJumpToRingVenusFlyTrap() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stJumpToRingVenusFlyTrap))) {
-		_busyStatus = 2;
-		_acceptInput = false;
-		startAnimation(0x584984B4, 0, -1);
-		SetUpdateHandler(&Klaymen::update);
-		SetMessageHandler(&Klaymen::hmJumpToRingVenusFlyTrap);
-		SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
-		NextState(&Klaymen::stLandOnFeet);
-		sendMessage(_attachedSprite, 0x482B, 0);
-	}
-}
-
 void Klaymen::stStandIdleSpecial() {
 	playSound(0, 0x56548280);
 	_busyStatus = 0;
@@ -2935,34 +2622,6 @@ void Klaymen::stFallTouchdown() {
 	stTryStandIdle();
 }
 
-void Klaymen::stJumpAndFall() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stJumpAndFall))) {
-		sendMessage(_parentScene, 0x1024, 3);
-		_busyStatus = 2;
-		_acceptInput = false;
-		startAnimation(0xB93AB151, 0, -1);
-		SetUpdateHandler(&Klaymen::update);
-		SetMessageHandler(&Klaymen::hmJumpAndFall);
-		SetSpriteUpdate(&Klaymen::suFallDown);
-		NextState(&Klaymen::stLandOnFeet);
-	}
-}
-
-void Klaymen::stDropFromRing() {
-	if (_attachedSprite) {
-		_x = _attachedSprite->getX();
-		sendMessage(_attachedSprite, 0x4807, 0);
-		_attachedSprite = NULL;
-	}
-	_busyStatus = 2;
-	_acceptInput = false;
-	startAnimation(0x586984B1, 0, -1);
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(&Klaymen::suFallDown);
-	NextState(&Klaymen::stLandOnFeet);
-}
-
 void Klaymen::stPressDoorButton() {
 	_busyStatus = 2;
 	_acceptInput = true;
@@ -2987,34 +2646,6 @@ void Klaymen::evHitByBoxingGloveDone() {
 	sendMessage(_parentScene, 0x1024, 1);
 }
 
-void Klaymen::stMoveVenusFlyTrap() {
-	if (!stStartAction(AnimationCallback(&Klaymen::stMoveVenusFlyTrap))) {
-		_busyStatus = 2;
-		_isMoveObjectRequested = false;
-		_acceptInput = true;
-		setDoDeltaX(_attachedSprite->getX() < _x ? 1 : 0);
-		startAnimation(0x5C01A870, 0, -1);
-		SetUpdateHandler(&Klaymen::update);
-		SetMessageHandler(&Klaymen::hmMoveVenusFlyTrap);
-		SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
-		FinalizeState(&Klaymen::evMoveVenusFlyTrapDone);
-	}
-}
-
-void Klaymen::stContinueMovingVenusFlyTrap() {
-	_isMoveObjectRequested = false;
-	_acceptInput = true;
-	startAnimationByHash(0x5C01A870, 0x01084280, 0);
-	SetUpdateHandler(&Klaymen::update);
-	SetMessageHandler(&Klaymen::hmMoveVenusFlyTrap);
-	SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
-	FinalizeState(&Klaymen::evMoveVenusFlyTrapDone);
-}
-
-void Klaymen::evMoveVenusFlyTrapDone() {
-	sendMessage(_attachedSprite, 0x482A, 0);
-}
-
 void Klaymen::suFallSkipJump() {
 	updateDeltaXY();
 	HitRect *hitRect = _parentScene->findHitRectAtPos(_x, _y + 10);
diff --git a/engines/neverhood/klaymen.h b/engines/neverhood/klaymen.h
index 23259f4..77233d0 100644
--- a/engines/neverhood/klaymen.h
+++ b/engines/neverhood/klaymen.h
@@ -33,7 +33,6 @@ namespace Neverhood {
 // TODO This code is horrible and weird and a lot of stuff needs renaming once a better name is found
 // TODO Also the methods should probably rearranged and be grouped together more consistently
 
-class Klaymen;
 class Scene;
 
 const uint32 kKlaymenSpeedUpHash = 0x004A2148;
@@ -67,29 +66,25 @@ public:
 	void startIdleAnimation(uint32 fileHash, AnimationCb callback);
 	void upIdleAnimation();
 
+	// Idle animations - start
 	void stIdlePickEar();
 	void evIdlePickEarDone();
-	uint32 hmIdlePickEar(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stIdleSpinHead();
-	uint32 hmIdleSpinHead(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stIdleArms();
 	void evIdleArmsDone();
-	uint32 hmIdleArms(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stIdleChest();
-	uint32 hmIdleChest(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stIdleHeadOff();
-	uint32 hmIdleHeadOff(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stIdleWonderAbout();
-
 	void stIdleTeleporterHands();
-
 	void stIdleTeleporterHands2();
 
+	uint32 hmIdlePickEar(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmIdleSpinHead(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmIdleArms(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmIdleChest(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmIdleHeadOff(int messageNum, const MessageParam &param, Entity *sender);
+	// Idle animations - end
+
 	void stTryStandIdle();
 	void stStandAround();
 	void upStandIdle();
@@ -150,12 +145,6 @@ public:
 	void stInsertKey();
 	uint32 hmInsertKey(int messageNum, const MessageParam &param, Entity *sender);
 
-	void stReadNote();
-	uint32 hmReadNote(int messageNum, const MessageParam &param, Entity *sender);
-
-	void stHitByDoor();
-	uint32 hmHitByDoor(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stPeekWall();
 	uint32 hmPeekWall(int messageNum, const MessageParam &param, Entity *sender);
 
@@ -166,18 +155,8 @@ public:
 	void upPeekWallBlink();
 
 	void stPeekWall1();
-
 	void stPeekWall2();
 
-	void stPullHammerLever();
-	uint32 hmPullHammerLever(int messageNum, const MessageParam &param, Entity *sender);
-
-	void stRidePlatformDown();
-	void suRidePlatformDown();
-
-	void stCrashDown();
-	void stCrashDownFinished();
-
 	void stShrink();
 	uint32 hmShrink(int messageNum, const MessageParam &param, Entity *sender);
 
@@ -228,20 +207,6 @@ public:
 	void stClimbLadderHalf();
 	uint32 hmClimbLadderHalf(int messageNum, const MessageParam &param, Entity *sender);
 
-	void setupJumpToRing();
-	void stJumpToRing1();
-	void stJumpToRing2();
-	void stJumpToRing4();
-	uint32 hmJumpToRing(int messageNum, const MessageParam &param, Entity *sender);
-
-	void stHangOnRing();
-
-	void stJumpToRing3();
-	uint32 hmJumpToRing3(int messageNum, const MessageParam &param, Entity *sender);
-
-	void stHoldRing3();
-	uint32 hmHoldRing3(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stReleaseRing();
 
 	void stLandOnFeet();
@@ -327,11 +292,6 @@ public:
 	void stFinishGrow();
 	uint32 hmFinishGrow(int messageNum, const MessageParam &param, Entity *sender);
 
-	void stJumpToRingVenusFlyTrap();
-	uint32 hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
-
-	void stDropFromRing();
-
 	void stStandIdleSpecial();
 	uint32 hmStandIdleSpecial(int messageNum, const MessageParam &param, Entity *sender);
 
@@ -343,18 +303,9 @@ public:
 	void suFallDown();
 	void upSpitOutFall();
 
-	void stJumpAndFall();
-	uint32 hmJumpAndFall(int messageNum, const MessageParam &param, Entity *sender);
-
 	void stFalling();
 	void stFallTouchdown();
 
-	void stMoveVenusFlyTrap();
-	void stContinueMovingVenusFlyTrap();
-	uint32 hmMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
-	uint32 hmFirstMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
-	void evMoveVenusFlyTrapDone();
-
 	void stPeekInside();
 	void stPeekInsideReturn();
 	void stPeekInsideBlink();
diff --git a/engines/neverhood/modules/module1000_sprites.cpp b/engines/neverhood/modules/module1000_sprites.cpp
index 447fd9d..dedeb73 100644
--- a/engines/neverhood/modules/module1000_sprites.cpp
+++ b/engines/neverhood/modules/module1000_sprites.cpp
@@ -999,7 +999,7 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
 			GotoState(&Klaymen::stSleeping);
 		break;
 	case 0x480D:
-		GotoState(&Klaymen::stPullHammerLever);
+		GotoState(&KmScene1001::stPullHammerLever);
 		break;
 	case 0x4812:
 		GotoState(&Klaymen::stPickUpGeneric);
@@ -1054,12 +1054,51 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
 	return 0;
 }
 
+void KmScene1001::stPullHammerLever() {
+	if (!stStartAction(AnimationCallback(&KmScene1001::stPullHammerLever))) {
+		_busyStatus = 2;
+		_acceptInput = false;
+		startAnimation(0x00648953, 0, -1);
+		SetUpdateHandler(&Klaymen::update);
+		SetMessageHandler(&KmScene1001::hmPullHammerLever);
+		SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+	}
+}
+
+uint32 KmScene1001::hmPullHammerLever(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = Klaymen::hmLever(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x4AB28209)
+			sendMessage(_attachedSprite, 0x480F, 0);
+		break;
+	}
+	return messageResult;
+}
+
 KmScene1002::KmScene1002(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y)
 	: Klaymen(vm, parentScene, x, y) {
 
 	setKlaymenIdleTable1();
 }
 
+void KmScene1002::setupJumpToRing() {
+	_acceptInput = false;
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&KmScene1002::hmJumpToRing);
+	SetSpriteUpdate(&Klaymen::suUpdateDestX);
+	NextState(&KmScene1002::stHangOnRing);
+	sendMessage(_attachedSprite, 0x482B, 0);
+}
+
+void KmScene1002::stJumpToRing1() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stJumpToRing1))) {
+		_busyStatus = 0;
+		startAnimation(0xD82890BA, 0, -1);
+		setupJumpToRing();
+	}
+}
+
 void KmScene1002::xUpdate() {
 	if (_x >= 250 && _x <= 435 && _y >= 420) {
 		if (_idleTableNum == 0) {
@@ -1089,9 +1128,9 @@ uint32 KmScene1002::xHandleMessage(int messageNum, const MessageParam &param) {
 		break;
 	case 0x4803:
 		if (param.asInteger() == 1)
-			GotoState(&Klaymen::stJumpAndFall);
+			GotoState(&KmScene1002::stJumpAndFall);
 		else if (param.asInteger() == 2)
-			GotoState(&Klaymen::stDropFromRing);
+			GotoState(&KmScene1002::stDropFromRing);
 		break;
 	case 0x4804:
 		GotoState(&Klaymen::stPeekWall);
@@ -1099,24 +1138,24 @@ uint32 KmScene1002::xHandleMessage(int messageNum, const MessageParam &param) {
 	case 0x4805:
 		switch (param.asInteger()) {
 		case 1:
-			GotoState(&Klaymen::stJumpToRing1);
+			GotoState(&KmScene1002::stJumpToRing1);
 			break;
 		case 2:
-			GotoState(&Klaymen::stJumpToRing2);
+			GotoState(&KmScene1002::stJumpToRing2);
 			break;
 		case 3:
-			GotoState(&Klaymen::stJumpToRing3);
+			GotoState(&KmScene1002::stJumpToRing3);
 			break;
 		case 4:
-			GotoState(&Klaymen::stJumpToRing4);
+			GotoState(&KmScene1002::stJumpToRing4);
 			break;
 		}
 		break;
 	case 0x480A:
-		GotoState(&Klaymen::stMoveVenusFlyTrap);
+		GotoState(&KmScene1002::stMoveVenusFlyTrap);
 		break;
 	case 0x480D:
-		GotoState(&Klaymen::stJumpToRingVenusFlyTrap);
+		GotoState(&KmScene1002::stJumpToRingVenusFlyTrap);
 		break;
 	case 0x4816:
 		if (param.asInteger() == 0)
@@ -1192,7 +1231,7 @@ uint32 KmScene1004::xHandleMessage(int messageNum, const MessageParam &param) {
 		startWalkToX(_dataResource.getPoint(param.asInteger()).x, false);
 		break;
 	case 0x481E:
-		GotoState(&Klaymen::stReadNote);
+		GotoState(&KmScene1004::stReadNote);
 		break;
 	case 0x4820:
 		sendMessage(_parentScene, 0x2000, 0);
@@ -1235,4 +1274,264 @@ uint32 KmScene1004::xHandleMessage(int messageNum, const MessageParam &param) {
 	return 0;
 }
 
+uint32 KmScene1002::hmJumpToRing(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x168050A0) {
+			sendMessage(_attachedSprite, 0x4806, 0);
+			_acceptInput = true;
+		} else if (param.asInteger() == 0x320AC306) {
+			playSound(0, 0x5860C640);
+		} else if (param.asInteger() == 0x4AB28209) {
+			sendMessage(_attachedSprite, 0x482A, 0);
+		} else if (param.asInteger() == 0x88001184) {
+			sendMessage(_attachedSprite, 0x482B, 0);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+void KmScene1002::stHangOnRing() {
+	_busyStatus = 0;
+	_acceptInput = true;
+	startAnimation(0x4829E0B8, 0, -1);
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&Klaymen::hmLowLevel);
+	SetSpriteUpdate(NULL);
+}
+
+void KmScene1002::stJumpToRing2() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stJumpToRing2))) {
+		_busyStatus = 0;
+		startAnimation(0x900980B2, 0, -1);
+		setupJumpToRing();
+	}
+}
+
+void KmScene1002::stJumpToRing3() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stJumpToRing3))) {
+		_busyStatus = 0;
+		_acceptInput = false;
+		startAnimation(0xBA1910B2, 0, -1);
+		SetUpdateHandler(&Klaymen::update);
+		SetSpriteUpdate(&Klaymen::suUpdateDestX);
+		SetMessageHandler(&KmScene1002::hmJumpToRing3);
+		NextState(&KmScene1002::stHoldRing3);
+		sendMessage(_attachedSprite, 0x482B, 0);
+	}
+}
+
+uint32 KmScene1002::hmJumpToRing3(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x168050A0) {
+			sendMessage(_attachedSprite, 0x4806, 0);
+		} else if (param.asInteger() == 0x320AC306) {
+			playSound(0, 0x5860C640);
+		} else if (param.asInteger() == 0x4AB28209) {
+			sendMessage(_attachedSprite, 0x482A, 0);
+		} else if (param.asInteger() == 0x88001184) {
+			sendMessage(_attachedSprite, 0x482B, 0);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+void KmScene1002::stHoldRing3() {
+	_busyStatus = 0;
+	_acceptInput = true;
+	startAnimation(0x4A293FB0, 0, -1);
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&KmScene1002::hmHoldRing3);
+	SetSpriteUpdate(NULL);
+}
+
+uint32 KmScene1002::hmHoldRing3(int messageNum, const MessageParam &param, Entity *sender) {
+	if (messageNum == 0x1008) {
+		stReleaseRing();
+		return 0;
+	}
+	return hmLowLevel(messageNum, param, sender);
+}
+
+void KmScene1002::stJumpToRing4() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stJumpToRing4))) {
+		_busyStatus = 0;
+		startAnimation(0xB8699832, 0, -1);
+		setupJumpToRing();
+	}
+}
+
+void KmScene1002::stJumpToRingVenusFlyTrap() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stJumpToRingVenusFlyTrap))) {
+		_busyStatus = 2;
+		_acceptInput = false;
+		startAnimation(0x584984B4, 0, -1);
+		SetUpdateHandler(&Klaymen::update);
+		SetMessageHandler(&KmScene1002::hmJumpToRingVenusFlyTrap);
+		SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+		NextState(&KmScene1002::stLandOnFeet);
+		sendMessage(_attachedSprite, 0x482B, 0);
+	}
+}
+
+uint32 KmScene1002::hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x168050A0) {
+			sendMessage(_attachedSprite, 0x480F, 0);
+		} else if (param.asInteger() == 0x586B0300) {
+			sendMessage(_otherSprite, 0x480E, 1);
+		} else if (param.asInteger() == 0x4AB28209) {
+			sendMessage(_attachedSprite, 0x482A, 0);
+		} else if (param.asInteger() == 0x88001184) {
+			sendMessage(_attachedSprite, 0x482B, 0);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+void KmScene1002::stJumpAndFall() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stJumpAndFall))) {
+		sendMessage(_parentScene, 0x1024, 3);
+		_busyStatus = 2;
+		_acceptInput = false;
+		startAnimation(0xB93AB151, 0, -1);
+		SetUpdateHandler(&Klaymen::update);
+		SetMessageHandler(&KmScene1002::hmJumpAndFall);
+		SetSpriteUpdate(&Klaymen::suFallDown);
+		NextState(&KmScene1002::stLandOnFeet);
+	}
+}
+
+void KmScene1002::stDropFromRing() {
+	if (_attachedSprite) {
+		_x = _attachedSprite->getX();
+		sendMessage(_attachedSprite, 0x4807, 0);
+		_attachedSprite = NULL;
+	}
+	_busyStatus = 2;
+	_acceptInput = false;
+	startAnimation(0x586984B1, 0, -1);
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&Klaymen::hmLowLevel);
+	SetSpriteUpdate(&Klaymen::suFallDown);
+	NextState(&KmScene1002::stLandOnFeet);
+}
+
+uint32 KmScene1002::hmJumpAndFall(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevel(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x1307050A) {
+			playSound(0, 0x40428A09);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+void KmScene1002::stMoveVenusFlyTrap() {
+	if (!stStartAction(AnimationCallback(&KmScene1002::stMoveVenusFlyTrap))) {
+		_busyStatus = 2;
+		_isMoveObjectRequested = false;
+		_acceptInput = true;
+		setDoDeltaX(_attachedSprite->getX() < _x ? 1 : 0);
+		startAnimation(0x5C01A870, 0, -1);
+		SetUpdateHandler(&Klaymen::update);
+		SetMessageHandler(&KmScene1002::hmMoveVenusFlyTrap);
+		SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+		FinalizeState(&KmScene1002::evMoveVenusFlyTrapDone);
+	}
+}
+
+void KmScene1002::stContinueMovingVenusFlyTrap() {
+	_isMoveObjectRequested = false;
+	_acceptInput = true;
+	startAnimationByHash(0x5C01A870, 0x01084280, 0);
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&KmScene1002::hmMoveVenusFlyTrap);
+	SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+	FinalizeState(&KmScene1002::evMoveVenusFlyTrapDone);
+}
+
+void KmScene1002::evMoveVenusFlyTrapDone() {
+	sendMessage(_attachedSprite, 0x482A, 0);
+}
+
+uint32 KmScene1002::hmMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x01084280) {
+			sendMessage(_attachedSprite, 0x480B, (uint32)_doDeltaX);
+		} else if (param.asInteger() == 0x02421405) {
+			if (_isMoveObjectRequested) {
+				if (sendMessage(_attachedSprite, 0x480C, (uint32)_doDeltaX) != 0)
+					stContinueMovingVenusFlyTrap();
+			} else {
+				SetMessageHandler(&KmScene1002::hmFirstMoveVenusFlyTrap);
+			}
+		} else if (param.asInteger() == 0x4AB28209) {
+			sendMessage(_attachedSprite, 0x482A, 0);
+		} else if (param.asInteger() == 0x88001184) {
+			sendMessage(_attachedSprite, 0x482B, 0);
+		} else if (param.asInteger() == 0x32180101) {
+			playSound(0, 0x405002D8);
+		} else if (param.asInteger() == 0x0A2A9098) {
+			playSound(0, 0x0460E2FA);
+		}
+		break;
+	case 0x480A:
+		_isMoveObjectRequested = true;
+		return 0;
+	}
+	return hmLowLevelAnimation(messageNum, param, sender);
+}
+
+uint32 KmScene1002::hmFirstMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x4AB28209) {
+			sendMessage(_attachedSprite, 0x482A, 0);
+		} else if (param.asInteger() == 0x88001184) {
+			sendMessage(_attachedSprite, 0x482B, 0);
+		} else if (param.asInteger() == 0x32180101) {
+			playSound(0, 0x405002D8);
+		} else if (param.asInteger() == 0x0A2A9098) {
+			playSound(0, 0x0460E2FA);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+uint32 KmScene1004::hmReadNote(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
+	switch (messageNum) {
+	case 0x100D:
+		if (param.asInteger() == 0x04684052) {
+			_acceptInput = true;
+			sendMessage(_parentScene, 0x2002, 0);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+void KmScene1004::stReadNote() {
+	_busyStatus = 2;
+	_acceptInput = false;
+	startAnimation(0x123E9C9F, 0, -1);
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&KmScene1004::hmReadNote);
+	SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+}
+
 } // End of namespace Neverhood
diff --git a/engines/neverhood/modules/module1000_sprites.h b/engines/neverhood/modules/module1000_sprites.h
index 7a7e443..2ab9f7a 100644
--- a/engines/neverhood/modules/module1000_sprites.h
+++ b/engines/neverhood/modules/module1000_sprites.h
@@ -203,14 +203,41 @@ protected:
 class KmScene1001 : public Klaymen {
 public:
 	KmScene1001(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
+
 protected:
+	void stPullHammerLever();
+	uint32 hmPullHammerLever(int messageNum, const MessageParam &param, Entity *sender);
+
 	uint32 xHandleMessage(int messageNum, const MessageParam &param);
 };
 
 class KmScene1002 : public Klaymen {
 public:
 	KmScene1002(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
+
 protected:
+	void stJumpToRing1();
+	void stJumpToRing2();
+	void stJumpToRing3();
+	void stJumpToRing4();
+	void setupJumpToRing();
+	void stHangOnRing();
+	void stHoldRing3();
+	void stDropFromRing();
+	void stJumpToRingVenusFlyTrap();
+	void stJumpAndFall();
+	void stMoveVenusFlyTrap();
+	void stContinueMovingVenusFlyTrap();
+	void evMoveVenusFlyTrapDone();
+
+	uint32 hmJumpToRing(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmJumpToRing3(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmHoldRing3(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmJumpAndFall(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
+	uint32 hmFirstMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
+
 	void xUpdate();
 	uint32 xHandleMessage(int messageNum, const MessageParam &param);
 };
@@ -218,7 +245,10 @@ protected:
 class KmScene1004 : public Klaymen {
 public:
 	KmScene1004(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
+
 protected:
+	void stReadNote();
+	uint32 hmReadNote(int messageNum, const MessageParam &param, Entity *sender);
 	uint32 xHandleMessage(int messageNum, const MessageParam &param);
 };
 
diff --git a/engines/neverhood/modules/module1300_sprites.cpp b/engines/neverhood/modules/module1300_sprites.cpp
index 14e6e59..a65f236 100644
--- a/engines/neverhood/modules/module1300_sprites.cpp
+++ b/engines/neverhood/modules/module1300_sprites.cpp
@@ -715,7 +715,7 @@ uint32 KmScene1305::xHandleMessage(int messageNum, const MessageParam &param) {
 		GotoState(&Klaymen::stTryStandIdle);
 		break;
 	case 0x4804:
-		GotoState(&Klaymen::stCrashDown);
+		GotoState(&KmScene1305::stCrashDown);
 		break;
 	case 0x4817:
 		setDoDeltaX(param.asInteger());
@@ -725,6 +725,22 @@ uint32 KmScene1305::xHandleMessage(int messageNum, const MessageParam &param) {
 	return 0;
 }
 
+void KmScene1305::stCrashDown() {
+	playSound(0, 0x41648271);
+	_busyStatus = 1;
+	_acceptInput = false;
+	startAnimationByHash(0x000BAB02, 0x88003000, 0);
+	SetUpdateHandler(&Klaymen::update);
+	SetSpriteUpdate(NULL);
+	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
+	NextState(&KmScene1305::stCrashDownFinished);
+}
+
+void KmScene1305::stCrashDownFinished() {
+	setDoDeltaX(2);
+	stTryStandIdle();
+}
+
 KmScene1306::KmScene1306(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y)
 	: Klaymen(vm, parentScene, x, y) {
 
diff --git a/engines/neverhood/modules/module1300_sprites.h b/engines/neverhood/modules/module1300_sprites.h
index eb98c3d..e044d3c 100644
--- a/engines/neverhood/modules/module1300_sprites.h
+++ b/engines/neverhood/modules/module1300_sprites.h
@@ -175,6 +175,9 @@ class KmScene1305 : public Klaymen {
 public:
 	KmScene1305(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
 protected:
+	void stCrashDown();
+	void stCrashDownFinished();
+
 	uint32 xHandleMessage(int messageNum, const MessageParam &param);
 };
 
diff --git a/engines/neverhood/modules/module2100_sprites.cpp b/engines/neverhood/modules/module2100_sprites.cpp
index 48d1ee1..707ebe3 100644
--- a/engines/neverhood/modules/module2100_sprites.cpp
+++ b/engines/neverhood/modules/module2100_sprites.cpp
@@ -165,7 +165,7 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
 			GotoState(&Klaymen::stTryStandIdle);
 		break;
 	case 0x4811:
-		GotoState(&Klaymen::stHitByDoor);
+		GotoState(&KmScene2101::stHitByDoor);
 		break;
 	case 0x4812:
 		if (param.asInteger() == 2)
@@ -224,4 +224,37 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
 	return messageResult;
 }
 
+uint32 KmScene2101::hmHitByDoor(int messageNum, const MessageParam &param, Entity *sender) {
+	uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
+	int16 speedUpFrameIndex;
+	switch (messageNum) {
+	case 0x1008:
+		speedUpFrameIndex = getFrameIndex(kKlaymenSpeedUpHash);
+		if (_currFrameIndex < speedUpFrameIndex) {
+			startAnimation(0x35AA8059, speedUpFrameIndex, -1);
+			_y = 438;
+		}
+		messageResult = 0;
+		break;
+	case 0x100D:
+		if (param.asInteger() == 0x1A1A0785) {
+			playSound(0, 0x40F0A342);
+		} else if (param.asInteger() == 0x60428026) {
+			playSound(0, 0x40608A59);
+		}
+		break;
+	}
+	return messageResult;
+}
+
+void KmScene2101::stHitByDoor() {
+	_busyStatus = 1;
+	_acceptInput = false;
+	startAnimation(0x35AA8059, 0, -1);
+	SetUpdateHandler(&Klaymen::update);
+	SetMessageHandler(&KmScene2101::hmHitByDoor);
+	SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+	playSound(0, 0x402E82D4);
+}
+
 } // End of namespace Neverhood
diff --git a/engines/neverhood/modules/module2100_sprites.h b/engines/neverhood/modules/module2100_sprites.h
index 2a3aac7..85a6b9f 100644
--- a/engines/neverhood/modules/module2100_sprites.h
+++ b/engines/neverhood/modules/module2100_sprites.h
@@ -62,6 +62,10 @@ protected:
 class KmScene2101 : public Klaymen {
 public:
 	KmScene2101(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
+
+	void stHitByDoor();
+	uint32 hmHitByDoor(int messageNum, const MessageParam &param, Entity *sender);
+
 protected:
 	uint32 xHandleMessage(int messageNum, const MessageParam &param);
 };
diff --git a/engines/neverhood/modules/module2200_sprites.cpp b/engines/neverhood/modules/module2200_sprites.cpp
index 8cdaf6c..82fd5e3 100644
--- a/engines/neverhood/modules/module2200_sprites.cpp
+++ b/engines/neverhood/modules/module2200_sprites.cpp
@@ -1073,7 +1073,7 @@ uint32 KmScene2206::xHandleMessage(int messageNum, const MessageParam &param) {
 		GotoState(&Klaymen::stTryStandIdle);
 		break;
 	case 0x4803:
-		GotoState(&Klaymen::stRidePlatformDown);
+		GotoState(&KmScene2206::stRidePlatformDown);
 		break;
 	case 0x4804:
 		if (param.asInteger() != 0) {
@@ -1147,6 +1147,27 @@ uint32 KmScene2206::xHandleMessage(int messageNum, const MessageParam &param) {
 	return 0;
 }
 
+void KmScene2206::suRidePlatformDown() {
+	_platformDeltaY++;
+	_y += _platformDeltaY;
+	if (_y > 600)
+		sendMessage(this, 0x1019, 0);
+}
+
+void KmScene2206::stRidePlatformDown() {
+	if (!stStartActionFromIdle(AnimationCallback(&KmScene2206::stRidePlatformDown))) {
+		_busyStatus = 1;
+		sendMessage(_parentScene, 0x4803, 0);
+		_acceptInput = false;
+		_platformDeltaY = 0;
+		startAnimation(0x5420E254, 0, -1);
+		SetUpdateHandler(&Klaymen::update);
+		SetMessageHandler(&Klaymen::hmLowLevel);
+		SetSpriteUpdate(&KmScene2206::suRidePlatformDown);
+		_vm->_soundMan->playSoundLooping(0xD3B02847);
+	}
+}
+
 KmScene2207::KmScene2207(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y)
 	: Klaymen(vm, parentScene, x, y) {
 
diff --git a/engines/neverhood/modules/module2200_sprites.h b/engines/neverhood/modules/module2200_sprites.h
index f1529cb..276df33 100644
--- a/engines/neverhood/modules/module2200_sprites.h
+++ b/engines/neverhood/modules/module2200_sprites.h
@@ -229,6 +229,9 @@ public:
 	KmScene2206(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
 	~KmScene2206();
 protected:
+	void stRidePlatformDown();
+	void suRidePlatformDown();
+
 	void xUpdate();
 	uint32 xHandleMessage(int messageNum, const MessageParam &param);
 };






More information about the Scummvm-git-logs mailing list