"Events" ;"Queues an interrupt routine to run in some number of turns. Uses: IQ-LENGTH Sets: IQ-LENGTH IQUEUE (contents) Args: IRTN: The interrupt routine to enqueue. TURNZ: The number of turns to count. 1 means the end of the current turn, 2 means the end of the next turn, etc. If TURNZ is -1, the interrupt will run after every subsequent turn until dequeued." > .IRTN> > ;"Removes an interrupt routine from the event queue. Interrupt routines should call this to dequeue themselves after they've fired. Uses and sets: IQ-LENGTH IQUEUE (contents) Args: IRTN: The interrupt routine." > ) (> .IRTN> )>>> ;"Marks a slot in the interrupt queue as deleted. Internal use only. Sets: IQUEUE (contents) Args: IQPOS: An index into IQUEUE." > ;"Compacts the interrupt queue, freeing up deleted slots. Internal use only. Uses and sets: IQ-LENGTH IQUEUE" > ) ( -9> >> >> 0> > > )> >>)>>> ;"Determines whether an interrupt routine is queued to run at the end of the current turn. Uses: IQ-LENGTH IQUEUE Args: E: The interrupt routine. Returns: True if the interrupt will run at the end of the current turn, i.e. if it's queued with a remaining turn count of 1 or -1, otherwise false." > ) (<==? > .E> 1 -1> )>)>>> "Clocker" ;"Advances the turn count, decrements interrupt turn counters, and runs eligible interrupt routines. Uses: MOVES IQ-LENGTH IQUEUE (contents) Sets: MOVES IQUEUE (contents) Returns: True if any interrupt routines were fired and returned true (indicating that something was printed), otherwise false." > > )> )> -1> >>>>)> 0> 1>> 0> >>>> )>)>> .FIRED> ;"Waits for a number of turns, exiting early if any interrupt routines printed a message. Args: TURNS: The number of turns to wait." ,M-END>> > > .ENDACT .INTERRUPT> )>>>