Prev: 93DA Up: Map Next: 962B
95ED: Is Location Lit?
Used by the routines at 70F3, Drawing, Action_Dir, Action_Examine, Action_None and ActionCapture.
We're only interested if the currently processed character is the player. Return if not.
LocationLit 95ED LD A,($B6EA) Return if CurrentCharacter is not zero.
95F0 AND A
95F1 RET NZ
Begin...
95F2 PUSH IX Store IX and BC on the stack.
95F4 PUSH BC
Check if the player object is inside "something".
95F5 LD IX,$C11B IX="You".
95F9 CALL ContainerLit Call ContainerLit.
95FC INC A If the player is inside of another object then jump to LocationLit_Sword.
95FD JR NZ,LocationLit_Sword
Check the location data to see if this location is light or dark.
95FF CALL GetObjectLocationInIX Call GetObjectLocationInIX.
9602 BIT 7,(IX+$00) If the location is marked as being "LIGHT" then jump to LocationLit_Return to return.
9606 JR NZ,LocationLit_Return
The "Short Strong Sword" is a light source, can it be used?
LocationLit_Sword 9608 PUSH IY Stash IY on the stack briefly.
960A LD A,$0E Using A=$0E and HL=C305 which are the object ID and object location for "Short Strong Sword", call 9E34.
960C LD IY,$C305
9610 CALL $9E34
9613 POP IY Restore IY from the stack.
9615 JR Z,LocationLit_IsDark Jump to LocationLit_IsDark if it is dark.
9617 LD A,($C30C) A=the attributes for "Short Strong Sword".
961A XOR $F7 XOR 11110111.
961C AND $1C If the "Short Strong Sword" is not "Broken", "Gives Light" and is not "Full" (?) then jump to LocationLit_IsLight.
961E JR Z,LocationLit_IsLight
The below handle the two responses for "light" and "dark" using the carry flag to signify darkness when set, and light unset.
LocationLit_IsDark 9620 LD HL,$AE1F HL="it is dark".
9623 SCF Set the carry flag.
LocationLit_Return 9624 POP BC Restore BC and IX from the stack.
9625 POP IX
9627 RET Return.
LocationLit_IsLight 9628 AND A Reset the carry flag.
9629 JR LocationLit_Return Jump to LocationLit_Return.
Prev: 93DA Up: Map Next: 962B