Prev: F169 Up: Map Next: F19D
F16B: Move Player
Used by the routines at Action_North, Action_South, Action_East, Action_West and Action_Up.
Input
C Requested direction where:
00 NORTH
01 SOUTH
02 EAST
03 WEST
04 UP
05 DOWN
MovePlayer F16B 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".
F16E RET C Return if there's any token set in UserInput_Token_2.
F16F LD B,$00 Set B to 00 so that BC now holds the direction number.
F171 CALL GetRoomPointer Call GetRoomPointer.
F174 ADD HL,BC HL+=BC.
F175 LD A,(HL) A=*HL.
F176 OR A Jump to CheckPlayer_RowingBoat if A is zero.
F177 JR Z,CheckPlayer_RowingBoat
F179 CALL $EF54 Call EF54.
F17C RET Return.
Is the player stuck out on the rowing boat?
CheckPlayer_RowingBoat F17D LD A,($BCCB) Skip forward to CheckPlayer_AtSea if the *CurrentRoom is not room 04: " In A Rowing Boat".
F180 CP $04
F182 JR NZ,CheckPlayer_AtSea
The player is stuck in the rowing boat...
F184 LD A,C Jump to Response_TryClimbing if the player was trying to move "UP" (04). Instead they must climb the ladder.
F185 CP $04
F187 JP Z,Response_TryClimbing
F18A 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"...
F18D JP Response_YouCantGoInThatDirection Jump to Response_YouCantGoInThatDirection.
Is the player stuck out at sea?
CheckPlayer_AtSea F190 CP $02 Jump to MovePlayer_Invalid if *CurrentRoom is not room 02: " The Open Sea".
F192 JR NZ,MovePlayer_Invalid
As above, except there's now no ladder!
F194 LD A,C Jump to Response_TryRowing if the player was trying to move "NORTH", "SOUTH", "EAST" or "WEST".
F195 CP $04
F197 JP C,Response_TryRowing
Nothing else is valid.
Print "You can't go in that direction.".
MovePlayer_Invalid F19A JP Response_YouCantGoInThatDirection Jump to Response_YouCantGoInThatDirection.
Prev: F169 Up: Map Next: F19D