Back to Skool Routines
31969: Walk up and down a few times or until...
Used by command lists 18, 42 and 44 to make a character walk about a fixed location until a specified time, or until a certain number of walkabouts have been performed.
H Character number (183-214)
31969 LD L,6 Collect the next two bytes (the event ID and the maximum walkabout count) from the command list and place them in bytes 6 and 7 of the character's buffer
31971 CALL 25188
31974 LD L,7 Decrease the walkabout counter at byte 7 of the character's buffer
31976 DEC (HL)
31977 JR NZ,31993 Jump forward to check for the time/event if the character has not yet performed the maximum number of walkabouts
31979 INC (HL) Set the walkabout counter back to 1 to ensure that we return to this execution path next time (to check whether the character has returned to the walkabout origin)
31980 LD L,5 Byte 5 holds the x-coordinate of the walkabout origin
31982 CALL 31924 Reset the carry flag if the character is at the walkabout origin
31985 JP NC,25484 Move to the next instruction in the command list if the specified time has arrived or the character has completed all his walkabouts
31988 CALL 25503 Otherwise send the character off to another walkabout destination (or back to the walkabout origin) via the routine at 25581, and return to the instruction at 31991 (below) when done
31991 JR 31974
31993 CALL 31915 Reset the carry flag if the specified time has arrived and the character is at the walkabout origin
31996 JR 31985