Prev: 31710 Up: Map Next: 31763
31722: Send current character to sleep if possible
Used by the routine at 31636.
31722 LD A,(30615) Load A with index of Current Character
31725 LD E,0 Point HL at strength...
31727 CALL 34174 ...of character whose index is A
31730 PUSH HL Switch pointer from HL to IX...
31731 POP IX ...
31733 BIT 7,(IX+6) If character's asleep flag is set...
31737 JP NZ,34478 ...then display "[CHARACTER] IS ALREADY ASLEEP" window and exit
31740 LD A,(IX+2) Load A with stamina of Current Character...
31743 CP 70 ...and if this is at least 70...
31745 JP NC,34484 ...then display "[CHARACTER] IS TOO WAKEFUL TO SLEEP" window and exit
31748 LD A,(IX+1) Load A with the happiness of Current Character...
31751 CP 30 ...and if this is anything up to 30...
31753 JP C,34490 ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit
31756 SET 7,(IX+6) Set the character's asleep flag
31760 JP 34738 Display "[CHARACTER] HAS GONE TO SLEEP" window and exit
Prev: 31710 Up: Map Next: 31763