Skool Daze Routines
25750: Guide character to a location on the same floor
Used by the routine at 25534, which jumps here when the character under consideration is on the same floor as his destination.
DE Character's coordinates
H Character number (152-169)
L 101
25750 INC L L=102 (byte 102 holds the destination x-coordinate)
25751 LD A,E A=character's x-coordinate
25752 CP (HL) Is the character at the destination?
25753 JR NZ,25765 Jump if not
25755 LD L,96 Byte 96 holds the character's animatory state
25757 BIT 0,(HL) Is the character midstride?
25759 JP Z,25256 Jump if not
25762 JP 25627
25765 LD A,D A=character's y-coordinate
25766 CP 169 169=bottom floor
25768 LD A,(HL) A=destination x-coordinate
25769 JP Z,25627 Jump if the character is on the bottom floor
The character is on the middle floor or the top floor. But which side of the wall?
25772 LD A,D A=character's y-coordinate
25773 CP 155 155=top floor
25775 LD A,57 57=x-coordinate of wall between Map and Reading Rooms
25777 JR Z,25781 Jump if the character is on the top floor
25779 LD A,38 38=x-coordinate of wall between White and Exam Rooms
25781 CP E Is the character to the left of the wall?
25782 JR NC,25792 Jump if so
The character is on the right side of the wall.
25784 CP (HL)
25785 LD A,(HL) A=destination x-coordinate
25786 JP C,25627 Jump if the character doesn't need to go down the stairs
25789 JP 25590 Send the character to the top of the staircase
The character is on the left side of the wall.
25792 CP (HL)
25793 LD A,(HL) A=destination x-coordinate
25794 JP NC,25627 Jump if the character doesn't need to go down the stairs
25797 LD A,12 12=x-coordinate of top of staircases on the left
25799 JP 25592 Send the character to the top of the staircase