![]() |
Routines |
| Prev: 50310 | Up: Map | Next: 50338 |
|
Used by the routines at Validate_Take_OpenChest, Validate_Take_Rope, Action_Drop, Action_Give, Action_Kill, Action_Open, Action_Close, Action_Wear, Action_Tie 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 | 50319 | LD A,B | Call GetObjectLocation to fetch where the original object is. | |||||||||||||
| 50320 | CALL GetObjectLocation | |||||||||||||||
|
Destroy the "from" item by clearing its location.
|
||||||||||||||||
| 50323 | PUSH BC | Call UpdateObjectLocation to clear the original object. | ||||||||||||||
| 50324 | PUSH AF | |||||||||||||||
| 50325 | LD C,0 | |||||||||||||||
| 50327 | CALL UpdateObjectLocation | |||||||||||||||
| 50330 | POP AF | Restore the new object and its destination from the stack. | ||||||||||||||
| 50331 | POP BC | |||||||||||||||
|
Create the "to" item at the same location where the "from" item was.
|
||||||||||||||||
| 50332 | LD B,C | Call UpdateObjectLocation to put the new object in its place. | ||||||||||||||
| 50333 | LD C,A | |||||||||||||||
| 50334 | CALL UpdateObjectLocation | |||||||||||||||
| 50337 | RET | Return. | ||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||
| Prev: 50310 | Up: Map | Next: 50338 |