Prev: 31920 Up: Map Next: 32027
31980: Make current character be happy if possible
Used by the routine at 31636.
31980 CALL 34350 Check if Current Character is asleep and display "[CHARACTER] IS ASLEEP" window if so
31983 LD A,(30615) Load A with index of Current Character
31986 LD E,0 Point HL at strength...
31988 CALL 34174 ...of character whose index is A
31991 PUSH HL Switch pointer from HL to IX...
31992 POP IX ...
31994 LD A,(IX+2) Load A with stamina of Current Character...
31997 CP 30 ...and if this is anything up to 30...
31999 JP C,34538 ...then display "[CHARACTER] IS TOO TIRED TO BE HAPPY" window and exit
32002 LD A,(IX+1) Load A with the happiness of Current Character...
32005 CP 5 ...and if this is anything up to 5...
32007 JP C,34490 ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit
32010 LD A,(30615) Load A with index of Current Character...
32013 LD E,A ...and copy into DE...
32014 LD D,0 ...
32016 LD HL,32027 Point HL to table of default happiness levels...
32019 ADD HL,DE ...and add character index as offset
32020 LD A,(HL) Load entry into A...
32021 LD (IX+1),A ...and set happiness of Current Character to this value
32024 JP 34762 Display "[CHARACTER] WILL TRY TO BE HAPPY" window
Prev: 31920 Up: Map Next: 32027