Prev: 59607 Up: Map Next: 59901
59871: Handle Distant Weapon
Used by the routine at Handle_Weapon_Pickup.
Deals with a weapon that is in a different room from Sabreman (see Handle_Weapon_Pickup). Bit 0 of the flags is set, so that the weapon is drawn without an old image to erase when Sabreman comes back. If the weapon falls it moves down through the rooms below until it gets to one that has a floor, and it is put at the y position 158 with its counter cleared.
Input
IX Small object record of the weapon
Handle_Distant_Weapon 59871 SET 0,(IX+7) Set bit 0 of the flags.
59875 BIT 2,(IX+7) Jump to Handle_Distant_Weapon_Find_Floor if the weapon is falling.
59879 JR NZ,Handle_Distant_Weapon_Find_Floor
59881 RET Return.
Handle_Distant_Weapon_Next_Room 59882 INC (IX+4) Move the weapon to the room below.
Handle_Distant_Weapon_Find_Floor 59885 CALL Read_World_Map Read the world map entry of the room that the weapon is in. The flags of the room are returned in E.
59888 BIT 4,E Jump back to Handle_Distant_Weapon_Next_Room if the room has no floor.
59890 JR Z,Handle_Distant_Weapon_Next_Room
59892 LD (IX+3),158 Set the y position of the weapon to 158.
59896 LD (IX+6),0 Clear the counter in byte 6.
59900 RET Return.
Prev: 59607 Up: Map Next: 59901