![]() |
Routines |
| Prev: A219 | Up: Map | Next: A263 |
|
This selects the next red cross parcel, spawns it, if required, then queues the mesage "RED CROSS PARCEL".
|
||||
|
Don't deliver a new red cross parcel while the previous one still exists.
|
||||
| event_new_red_cross_parcel | A228 | LD A,($771D) | Fetch the red cross parcel's room (and flags) | |
| A22B | AND $3F | Mask off the room part | ||
| A22D | CP $3F | Is it $3F? (i.e. room_NONE ($FF) masked) | ||
| A22F | RET NZ | Return if not | ||
|
Select the contents of the next parcel; choosing the first item from the list which does not already exist.
|
||||
| A230 | LD DE,$A25F | Point DE at the red cross parcel contents list | ||
| A233 | LD B,$04 | There are four entries in the list | ||
|
Start loop
|
||||
| event_new_red_cross_parcel_0 | A235 | LD A,(DE) | Fetch item number | |
| A236 | CALL item_to_itemstruct | Turn it into an itemstruct | ||
| A239 | INC HL | Get its room and mask it | ||
| A23A | LD A,(HL) | |||
| A23B | AND $3F | |||
| A23D | CP $3F | Is it $3F? (i.e. room_NONE ($FF) masked) | ||
| A23F | JR Z,parcel_found | Jump to parcel_found if so | ||
| A241 | INC DE | |||
| A242 | DJNZ event_new_red_cross_parcel_0 | ...loop while (...) | ||
| A244 | RET | Return - a parcel could not be spawned | ||
| parcel_found | A245 | LD A,(DE) | Set red_cross_parcel_current_contents to the item number | |
| A246 | LD ($A263),A | |||
| A249 | LD DE,$771D | Copy the red cross parcel reset data over the red cross parcel itemstruct | ||
| A24C | LD HL,$A259 | |||
| A24F | LD BC,$0006 | |||
| A252 | LDIR | |||
| A254 | LD B,$09 | Queue the message "RED CROSS PARCEL" and exit via | ||
| A256 | JP queue_message | |||
|
Red cross parcel reset data.
|
||||
| red_cross_parcel_reset_data | A259 | DEFB $14 | Room: room_20_REDCROSS | |
| A25A | DEFB $2C,$2C,$0C | TinyPos: (44, 44, 12) | ||
| A25D | DEFB $80,$F4 | Coord: (128, 244) | ||
|
Red cross parcel contents list.
|
||||
| red_cross_parcel_contents_list | A25F | DEFB $0E | item_PURSE | |
| A260 | DEFB $00 | item_WIRESNIPS | ||
| A261 | DEFB $05 | item_BRIBE | ||
| A262 | DEFB $0F | item_COMPASS | ||
| Prev: A219 | Up: Map | Next: A263 |