Prev: 54983 Up: Map Next: 55077
54996: Update game time, time left and, every minute, read-text of Crystal Ball
Used by the routine at 54853.
54996 LD A,(23407) [EVERY 1/50 SECOND] Increase number of elapsed 1/50 seconds
54999 INC A ...
55000 LD (23407),A ...
55003 CP 50 If new value isn't 50 then return...
55005 RET NZ ...
55006 XOR A [EVERY 1 SECOND] Else, set the value to zero (start of next full second)...
55007 LD (23407),A ...
55010 CALL 55233 If character whose turn it is to move is free and awake, then update their current room if possible
55013 LD A,(23406) Increase number of seconds elapsed...
55016 INC A ...
55017 LD (23406),A ...
55020 CP 60 If new value isn't 60 then return...
55022 RET NZ ...
55023 XOR A [EVERY 1 MINUTE] Else, set the value to zero (start of next minute)...
55024 LD (23406),A ...
55027 CALL 55077 Update all characters' stats (deteriorate or regenerate) and wake up / send to sleep if required
55030 CALL 55349 Move the lift to a random floor if Magic Knight is not nearby
55033 LD A,(42292) Update read-text property of Crystal Ball...
55036 INC A ...
55037 LD (42292),A ...
55040 CP 144 If read-text property is less than 144...
55042 JR NZ,55049 ...skip ahead to 55049...
55044 LD A,139 ...else set read-text property of Crystal Ball to 139...
55046 LD (42292),A ...
55049 LD A,(23405) Increase number of minutes elapsed...
55052 INC A ...
55053 LD (23405),A ...
55056 CP 5 If new value isn't 5 then return...
55058 RET NZ ...
55059 XOR A [EVERY 5 MINUTES] Else, set the value to zero (start of next "hour")...
55060 LD (23405),A ...
55063 LD A,(23404) Decrease number of hours left...
55066 DEC A ...
55067 LD (23404),A ...
55070 JP Z,55478 If zero then jump to "out of time" game over message
55073 CALL 38075 Set parameters for and play upward scale sound
55076 RET Return
Prev: 54983 Up: Map Next: 55077