Prev: 61801 Up: Map Next: 61853
61803: Move Player
Used by the routines at Action_North, Action_South, Action_East, Action_West and Action_Up.
Input
C Requested direction where:
0 NORTH
1 SOUTH
2 EAST
3 WEST
4 UP
5 DOWN
MovePlayer 61803 CALL Parser_ValidateNoDirectObject Call Parser_ValidateNoDirectObject.
All "MOVE" commands can only be called on their own; you can't type "NORTH TO BEACH" or "UP LADDER".
61806 RET C Return if there's any token set in UserInput_Token_2.
61807 LD B,0 Set B to 0 so that BC now holds the direction number.
61809 CALL GetRoomPointer Call GetRoomPointer.
61812 ADD HL,BC HL+=BC.
61813 LD A,(HL) A=*HL.
61814 OR A Jump to CheckPlayer_RowingBoat if A is zero.
61815 JR Z,CheckPlayer_RowingBoat
61817 CALL 61268 Call 61268.
61820 RET Return.
Is the player stuck out on the rowing boat?
CheckPlayer_RowingBoat 61821 LD A,(48331) Skip forward to CheckPlayer_AtSea if the *CurrentRoom is not room 4: " In A Rowing Boat".
61824 CP 4
61826 JR NZ,CheckPlayer_AtSea
The player is stuck in the rowing boat...
61828 LD A,C Jump to Response_TryClimbing if the player was trying to move "UP" (4). Instead they must climb the ladder.
61829 CP 4
61831 JP Z,Response_TryClimbing
61834 JP C,Response_TryRowing Jump to Response_TryRowing if the player was trying to move "NORTH", "SOUTH", "EAST" or "WEST". Instead, they need to row.
Else, the player was trying to move "DOWN"...
61837 JP Response_YouCantGoInThatDirection Jump to Response_YouCantGoInThatDirection.
Is the player stuck out at sea?
CheckPlayer_AtSea 61840 CP 2 Jump to MovePlayer_Invalid if *CurrentRoom is not room 2: " The Open Sea".
61842 JR NZ,MovePlayer_Invalid
As above, except there's now no ladder!
61844 LD A,C Jump to Response_TryRowing if the player was trying to move "NORTH", "SOUTH", "EAST" or "WEST".
61845 CP 4
61847 JP C,Response_TryRowing
Nothing else is valid.
Print "You can't go in that direction.".
MovePlayer_Invalid 61850 JP Response_YouCantGoInThatDirection Jump to Response_YouCantGoInThatDirection.
Prev: 61801 Up: Map Next: 61853