Prev: EE23 Up: Map Next: EE3D
EE25: 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 EE25 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".
EE28 RET C Return if there's any token set in UserInput_SecondToken.
EE29 LD B,$00 Set B to 00, so that BC now holds the direction number.
EE2B CALL GetRoomPointer Call GetRoomPointer.
EE2E ADD HL,BC HL+=BC.
EE2F LD A,(HL) A=*HL.
EE30 OR A Jump to MovePlayer_Invalid if A is zero.
EE31 JR Z,MovePlayer_Invalid
EE33 CALL Handler_InjuryCheck Call Handler_InjuryCheck.
EE36 RET Return.
Nothing else is valid.
Print "You can't go in that direction.".
MovePlayer_Invalid EE37 LD HL,$BD32 HL=Messaging_YouCantGoInThatDirection.
EE3A JP PrintResponse Jump to PrintResponse.
Prev: EE23 Up: Map Next: EE3D