![]() |
Routines |
| Prev: C412 | Up: Map | Next: C439 |
|
Used by the routines at Action_Examine, Action_Take, Action_DropThrow, Action_Place, Action_Shooting, Action_Drink, Action_Open, Action_Close, Action_Shout, Action_Pull, Action_Wear, Action_Light and Action_Unlock.
Transforms one item into another by destroying the "from" item and creating the "to" item in the same location. Rather than use item properties, the game just has separate objects that don't exist until an action is performed.
An example is:
|
||||||||||||||||
|
Get the location of the "from" item so the "to" item can be created in the same place.
|
||||||||||||||||
| TransformItem | C426 | LD A,B | Copy the "from" item ID into A. | |||||||||||||
| C427 | CALL ObjectEventLocator | Call ObjectEventLocator to get the room ID where the "from" item is located (returns in A). | ||||||||||||||
| C42A | PUSH BC | Stash the item IDs and flags on the stack for later. | ||||||||||||||
| C42B | PUSH AF | |||||||||||||||
|
Destroy the "from" item by setting its location to 00 (inactive).
|
||||||||||||||||
| C42C | LD C,$00 | Set the room ID to 00 to deactivate the "from" item. | ||||||||||||||
| C42E | CALL Handler_UpdateObjectLocation | Call Handler_UpdateObjectLocation to update the "from" item's location to 00. | ||||||||||||||
| C431 | POP AF | Restore the item IDs and flags from the stack. | ||||||||||||||
| C432 | POP BC | |||||||||||||||
|
Create the "to" item at the same location where the "from" item was.
|
||||||||||||||||
| C433 | LD B,C | Copy the "to" item ID into B. | ||||||||||||||
| C434 | LD C,A | Copy the location (from A) into C. | ||||||||||||||
| C435 | CALL Handler_UpdateObjectLocation | Call Handler_UpdateObjectLocation to create the "to" item at the stored location. | ||||||||||||||
| C438 | RET | Return. | ||||||||||||||
| Prev: C412 | Up: Map | Next: C439 |