Prev: DF98 Up: Map Next: E05F
E027: Handle Rock Fragments
Handler for the object types 51 to 53 (the pieces of a stalactite that has landed). The counter in byte 06 goes up on every call. The type goes up by one on every second call, and when it would go past 53 the piece moves four pixels to the left and is destroyed (see Destroy_Creature). The piece is removed if Sabreman is not in the room.
Input
IX Object record
Handle_Rock_Fragments E027 CALL StoreEntity Save the state of the piece.
E02A LD A,($8F1C) Fetch the room x of Sabreman.
E02D CP (IX+$02) Jump to Remove_Unseen_Weapon to remove the piece if it is in a different room x.
E030 JP NZ,Remove_Unseen_Weapon
E033 LD A,($8F1E) Fetch the room y of Sabreman.
E036 CP (IX+$04) Jump to Remove_Unseen_Weapon to remove the piece if it is in a different room y.
E039 JP NZ,Remove_Unseen_Weapon
E03C INC (IX+$06) Increase the counter.
E03F BIT 0,(IX+$06) Jump to Update_Object_Sprite if the counter is odd.
E043 JP NZ,Update_Object_Sprite
E046 LD A,(IX+$00) Fetch the type.
E049 INC A Add one.
E04A CP $54 Jump to Handle_Rock_Fragments_Explode if the type is past 53.
E04C JR NC,Handle_Rock_Fragments_Explode
E04E LD (IX+$00),A Store the type.
E051 JP Update_Object_Sprite Jump to Update_Object_Sprite.
Handle_Rock_Fragments_Explode E054 LD A,(IX+$01) Fetch the x position.
E057 SUB $04 Subtract four.
E059 LD (IX+$01),A Store the x position.
E05C JP Destroy_Creature Destroy the piece.
Prev: DF98 Up: Map Next: E05F