Prev: 7DC5 Up: Map Next: 7F5D
7E90: Drop object
Used by the routine at Vectors.
ObjectDrop 7E90 LD A,(ManData_InventoryCount_DFC9) Cannot drop if carrying no items.
7E93 AND A
7E94 RET Z
7E95 LD DE,$0005 Beep
7E98 LD HL,$0190
7E9B CALL $03B5
7E9E LD IX,ManData_PosPrimary_dfc3 IX if offset so that we can get to the start of the inventory linked list.
7EA2 LD A,(ManData_SelectIndex_DFCA) Get index of selected object. Run through the linked list until we get to the selected object.
7EA5 LD B,A
7EA6 INC B
ObjectDrop_0 7EA7 LD L,(IX+$04)
7EAA LD H,(IX+$05)
7EAD LD ( s0),IX Remember object before.
7EB1 PUSH HL
7EB2 POP IX
7EB4 DJNZ ObjectDrop_0
7EB6 PUSH HL Ix nows points to the selected object.
7EB7 LD (ActionObjectDroppedPtr),HL
7EBA LD E,(IX+$04)
7EBD LD D,(IX+$05)
7EC0 LD A,(AreaDataCurrent_Index) Are we in Cnoc Suil?
7EC3 CP $0D
7EC5 JR NZ,ObjectDrop_1
7EC7 BIT 6,(IX+$03) ... and is the 'Oracle' flag set?
7ECB JR NZ,ObjectDrop_4
ObjectDrop_1 7ECD LD HL,TripValue Not an oracle object.
7ED0 LD A,(HL)
7ED1 AND A
7ED2 JR Z,ObjectDrop_3
7ED4 CP (IX+$02)
7ED7 JR Z,ObjectDrop_2
7ED9 INC HL
7EDA SET 7,(HL)
7EDC JR ObjectDrop_3
ObjectDrop_2 7EDE LD (HL),$00
7EE0 INC HL
7EE1 SET 6,(HL)
7EE3 LD HL,(TripObjPtr)
7EE6 LD A,L
7EE7 OR H
7EE8 JR Z,ObjectDrop_3
7EEA POP BC
7EEB PUSH HL
7EEC PUSH HL
7EED POP IX
ObjectDrop_3 7EEF LD HL,(AreaDataCurrent_ObjectsPtr)
7EF2 LD A,(HL)
7EF3 LD (IX+$04),A
7EF6 INC HL
7EF7 LD A,(HL)
7EF8 LD (IX+$05),A
7EFB POP BC
7EFC PUSH BC
7EFD LD (HL),B
7EFE DEC HL
7EFF LD (HL),C
ObjectDrop_4 7F00 LD IX,( s0)
7F04 LD (IX+$04),E
7F07 LD (IX+$05),D
7F0A POP IX Put selected object onto path at players location.
7F0C LD HL,(ManData_PosPrimary_dfc3)
7F0F SRL H
7F11 RR L
7F13 LD (IX+$00),L
7F16 LD HL,(ManData_PosSecondary_dfc5)
7F19 SRL H
7F1B RR L
7F1D LD (IX+$01),L
7F20 LD HL,ManData_InventoryCount_DFC9 Decrease number of objects carried.
7F23 DEC (HL)
7F24 LD A,(AreaDataCurrent_Index) Are we in Cnoc Suil?
7F27 CP $0D
7F29 JP NZ,$7D49
7F2C BIT 6,(IX+$03) ... and is the 'Oracle' flag set?
7F30 JP Z,$7D49
7F33 PUSH IX Update inventory display.
7F35 LD A,$01
7F37 CALL UpdateInv_B
7F3A POP HL Find objects message and display on screen.
7F3B LD DE,$0006
7F3E ADD HL,DE
7F3F LD A,$2B
ObjectDrop_5 7F41 CPIR
7F43 JR NZ,ObjectDrop_5
7F45 LD C,$06
ObjectDrop_6 7F47 LD A,$16
7F49 RST $10
7F4A LD A,C
7F4B RST $10
7F4C XOR A
7F4D RST $10
7F4E INC C
ObjectDrop_7 7F4F LD A,(HL)
7F50 INC HL
7F51 CP $5E
7F53 RET Z
7F54 CP $2B
7F56 JR Z,ObjectDrop_6
7F58 CALL Vector_PrintChar
7F5B JR ObjectDrop_7
Prev: 7DC5 Up: Map Next: 7F5D