Routines |
Prev: CCFB | Up: Map | Next: CD6A |
This resets an item which has been discovered.
|
||||||||
item_discovered | CD31 | LD A,C | Copy item index to A | |||||
CD32 | CP $FF | Is it item_NONE? ($FF) | ||||||
CD34 | RET Z | Return if so | ||||||
CD35 | AND $0F | Mask against itemstruct_ITEM_MASK | ||||||
CD37 | PUSH AF | Preserve A while we do calls | ||||||
CD38 | LD B,$10 | Queue the message "ITEM DISCOVERED" | ||||||
CD3A | CALL queue_message | |||||||
CD3D | LD B,$05 | Decrease morale by 5 | ||||||
CD3F | CALL decrease_morale | |||||||
CD42 | POP AF | Restore A | ||||||
CD43 | ADD A,A | Point HL at default_item_locations[A] | ||||||
CD44 | ADD A,C | |||||||
CD45 | LD HL,$CD6A | |||||||
CD48 | LD D,$00 | |||||||
CD4A | LD E,A | |||||||
CD4B | ADD HL,DE | |||||||
CD4C | LD A,(HL) | Load default_item_location.room_and_flags | ||||||
CD4D | EX DE,HL | Bank default_item_location pointer | ||||||
CD4E | EX AF,AF' | Bank room_and_flags | ||||||
Bug: C is not masked, so could go out of range.
|
||||||||
CD4F | LD A,C | Copy item index to A | ||||||
CD50 | CALL item_to_itemstruct | Convert the item index into an itemstruct pointer in HL | ||||||
CD53 | RES 7,(HL) | Wipe the itemstruct.item_and_flags itemstruct_ITEM_FLAG_HELD flag | ||||||
CD55 | EX DE,HL | Unbank default_item_location pointer | ||||||
CD56 | INC DE | Advance DE to itemstruct.room_and_flags | ||||||
CD57 | LD BC,$0003 | Copy room_and_flags and pos from default_item_location | ||||||
CD5A | LDIR | |||||||
CD5C | EX DE,HL | Swap itemstruct pointer back into HL | ||||||
CD5D | EX AF,AF' | Unbank room_and_flags | ||||||
CD5E | AND A | Is it room_0_OUTDOORS? | ||||||
CD5F | JR NZ,id_interior | Jump if not | ||||||
CD61 | LD (HL),A | Set height to zero. Note A is already zero | ||||||
CD62 | JP calc_exterior_item_iso_pos | Exit via calc_exterior_item_iso_pos | ||||||
id_interior | CD65 | LD (HL),$05 | Set height to 5 | |||||
CD67 | JP calc_interior_item_iso_pos | Exit via calc_interior_item_iso_pos |
Prev: CCFB | Up: Map | Next: CD6A |