Prev: 9DC0 Up: Map Next: 9E51
9DC1: Hero; Handle pick up an object / money.
Used by the routine at Game_Main.
Input
Output
Hero_PickUp 9DC1 LD HL,(Bg_ItemTableMid) Get the index of the two interactive items behind player.
9DC4 LD A,L Both must be of the same type to be a surface and be in range of 01 ~ 0F.
9DC5 AND H
9DC6 AND $0F
9DC8 RET Z
9DC9 LD E,A Using the interaction index, check to see if an object is being held in that slot.
9DCA LD D,$00
9DCC LD HL,(Room_CurrentInfoDataPtr)
9DCF ADD HL,DE
9DD0 LD A,(HL)
9DD1 AND A A zero being held, means no object on the surface.
9DD2 RET Z
9DD3 LD A,(CurrentRoom_Type) Bank
9DD6 CP $09
9DD8 JR NZ,Hero_PickUp_0
9DDA LD DE,BankAccountLow
9DDD JR Hero_PickUp_1
Hero_PickUp_0 9DDF CP $05 Gambling
9DE1 JR NZ,Hero_PickUp_2
9DE3 LD A,(Room_Flags)
9DE6 AND A
9DE7 RET NZ
9DE8 EX DE,HL
9DE9 ADD HL,HL
9DEA ADD HL,HL
9DEB LD BC,Event_NumDoors
9DEE ADD HL,BC
9DEF EX DE,HL
Hero_PickUp_1 9DF0 PUSH HL
9DF1 PUSH DE
9DF2 LD HL,IridiValue
9DF5 CALL ValueAddAsBCDCarry
9DF8 POP DE
9DF9 LD HL,TempStore
9DFC LD BC,$0004
9DFF LDIR
9E01 POP HL
9E02 LD A,(HL)
9E03 LD (HL),$00
9E05 PUSH AF
9E06 JP Hero_PickUp_5
Hero_PickUp_2 9E09 LD A,(Inv_Pocket3) Check for carrying three objects.
9E0C AND A
9E0D JP Z,Hero_PickUp_3
9E10 CALL Message_Display
Str_HandsFull 9E13 DEFB $16
9E14 DEFB $05
9E15 DEFB $0A
9E16 DEFM "your hands are full"
9E29 DEFB $5E
9E2A RET
Hero_PickUp_3 9E2B LD A,(HL) Place object into pocket.
9E2C PUSH AF
9E2D LD (HL),$00
9E2F LD HL,(Inv_Pocket1)
9E32 LD (Inv_Pocket2),HL
9E35 LD (Inv_Pocket1),A
9E38 LD A,(CurrentRoom_Type)
9E3B XOR $01
9E3D JR Z,Hero_PickUp_4
9E3F LD A,$01
Hero_PickUp_4 9E41 LD (Inv_Select),A
Hero_PickUp_5 9E44 LD DE,$0005
9E47 LD HL,$02EE
9E4A CALL $03B5
9E4D POP AF
9E4E JP Obj_DrawOrClearByIndex
Prev: 9DC0 Up: Map Next: 9E51