Prev: 8354 Up: Map Next: 8544
83D5: Handle offer action if an offer is in place.
Used by the routine at Game_Main.
Input
Output
Offer_Handle 83D5 LD HL,Offer_Count
83D8 DEC (HL)
83D9 JP NZ,Stage_Draw
83DC LD A,(Offer_ObjIndex)
83DF CP $18
83E1 JP Z,Skar_View
83E4 LD HL,(Bg_ItemTableMid)
83E7 LD A,L
83E8 OR H
83E9 BIT 4,A
83EB JR NZ,Offer_Handle_0
83ED LD HL,(Offer_PersonPtr)
83F0 LD A,L
83F1 OR H
83F2 JP NZ,Offer_Handle_9
83F5 CALL Message_DisplayAt
83F8 DEFM "no answer!"
8402 DEFB $5E
8403 JR Offer_Handle_1
Offer_Handle_0 8405 LD A,(CurrentRoom_Type)
8408 CP $01
840A JP NZ,Offer_Handle_7
840D LD HL,Inv_Pocket1
8410 LD BC,$0003
8413 LD A,(Shop_ObjIndex)
8416 OR $80
8418 CPIR
841A JR Z,Offer_Handle_2
841C CALL Message_DisplayAt
841F DEFM "for what?"
8428 DEFB $5E
This entry point is used by the routine at Hero_Arrest.
Offer_Handle_1 8429 CALL Inv_Update
842C JP Stage_Draw
Offer_Handle_2 842F LD A,(Inv_Select)
8432 AND A
8433 JR Z,Offer_Handle_4
This entry point is used by the routines at Action_HandleOffer, Offer_HandleSkar, Offer_HandlePita and Offer_HandleBren.
Offer_DontWantMessage 8435 LD A,(Inv_Select)
8438 AND A
8439 JR Z,Offer_Handle_3
843B CALL Message_DisplayAt
843E DEFM "i dont want "
844A DEFB $5E
844B LD A,(Offer_ObjIndex)
844E CALL Object_GetNounAddr
8451 CALL Print_String
8454 LD A,$73
8456 CALL Print_SelectChar
8459 JR Offer_Handle_1
Offer_Handle_3 845B CALL Message_DisplayAt
845E DEFM "no thank you"
846A DEFB $5E
846B JR Offer_Handle_1
Offer_Handle_4 846D LD HL,IridiValue
8470 LD DE,Obj_Price
8473 CALL BCD_Subtract
8476 JR NC,Offer_Handle_5
8478 CALL Exit_NotEnough
847B JR Offer_Handle_1
Offer_Handle_5 847D LD HL,Inv_Pocket1
8480 LD BC,$0003
8483 LD A,(Shop_ObjIndex)
8486 OR $80
8488 CPIR
848A DEC HL
848B RES 7,(HL)
Offer_Handle_6 848D CALL Message_DisplayAt
8490 DEFM "thank you"
8499 DEFB $5E
849A JP Offer_Handle_1
Offer_Handle_7 849D CP $02
849F JP NZ,Offer_Handle_8
84A2 LD A,(Inv_Select)
84A5 AND A
84A6 JP Z,Offer_DontWantMessage
84A9 LD L,A
84AA LD H,$00
84AC LD DE,_b14e
84AF ADD HL,DE
84B0 LD DE,(Shop_ObjIndex)
84B4 LD A,(HL)
84B5 AND $7F
84B7 CP E
84B8 JP NZ,Offer_DontWantMessage
84BB LD (HL),$00
84BD LD HL,IridiValue
84C0 LD DE,Obj_Price
84C3 CALL ValueAddAsBCDCarry
84C6 JP Offer_Handle_6
Offer_Handle_8 84C9 JP Offer_Handle_6
Offer Jump table.
84CC DEFW Offer_HandleSkar Determines how each person reacts when being offered an object.
84CE DEFW Offer_HandleRyde
84D0 DEFW Offer_HandleKara
84D2 DEFW Offer_HandleKeli
84D4 DEFW Offer_HandleKahn
84D6 DEFW Offer_HandleDain
84D8 DEFW Offer_HandleMhor
84DA DEFW Offer_HandleTeth
84DC DEFW Offer_HandlePita
84DE DEFW Offer_HandleBren
84E0 DEFW Offer_HandleLoeg
To a person
Offer_Handle_9 84E2 LD IX,(Offer_PersonPtr) Get the address of the person being offered to and clear the pointer.
84E6 LD HL,$0000
84E9 LD (Offer_PersonPtr),HL
84EC BIT 4,(IX+$13) Check for the rat.
84F0 JR NZ,Offer_Handle_12
84F2 LD A,(Inv_Select)
84F5 AND A
84F6 JR NZ,Offer_Handle_11
Give Iridi...
84F8 LD HL,$0000 Clear all your money.
84FB LD (IridiValue),HL
84FE LD ($B155),HL
This entry point is used by the routine at Action_HandleOffer.
Offer_Handle_10 8501 CALL Message_DisplayAt }
8504 DEFM "how generous!"
8511 DEFB $5E
8512 JP Offer_Handle_1
Offer an object...
Offer_Handle_11 8515 LD L,A Workout which pocket being offered (1~3)
8516 LD H,$00
8518 LD DE,_b14e
851B ADD HL,DE
851C LD C,L
851D LD B,H
851E LD L,(IX+$0E) See who is being offered to
8521 LD H,$00
8523 ADD HL,HL
8524 LD DE,$84CA Use the jump table to see how to handle it...
8527 ADD HL,DE
8528 LD E,(HL)
8529 INC HL
852A LD D,(HL)
852B EX DE,HL
852C JP (HL)
To the rat.
Offer_Handle_12 852D CALL Message_DisplayAt
8530 DEFM "i am only a rat!"
8540 DEFB $5E
8541 JP Offer_Handle_1
Prev: 8354 Up: Map Next: 8544