Prev: B606 Up: Map Next: B626
B613: Transform Item
Used by the routines at Handler_ChangeRoom and Handler_ReportTheKill.
Transform Item.
Input
B From item ID (the item to be destroyed)
C To item ID (the item to be created)
Get the location of the "from" item so the "to" item can be created in the same place.
TransformItem B613 LD A,B Copy the "from" item ID into A.
B614 CALL GetItemRoom Call GetItemRoom to get the room ID where the "from" item is located (returns in A).
B617 PUSH BC Remember the items and the room while the first is removed.
B618 PUSH AF
Destroy the "from" item by setting its location to 00 (inactive).
B619 LD C,$00 Set the room ID to 00 to deactivate the "from" item.
B61B CALL SetItemRoom Call SetItemRoom to update the "from" item's location to 00.
B61E POP AF Restore AF, BC from the stack.
B61F POP BC
Create the "to" item at the same location where the "from" item was.
B620 LD B,C Copy the "to" item ID into B.
B621 LD C,A Copy the location (from A) into C.
B622 CALL SetItemRoom Call SetItemRoom to create the "to" item at the stored location.
B625 RET Return.
Prev: B606 Up: Map Next: B626