Routines |
Prev: AFDF | Up: Map | Next: B14C |
This is called when a character accepts the bribe.
Used by the routines at collision and target_reached.
|
||||||||
accept_bribe | B107 | CALL increase_morale_by_10_score_by_50 | Increase morale by 10, score by 50 | |||||
B10A | LD (IY+$01),$00 | Clear the vischar_PURSUIT_PURSUE flag | ||||||
B10E | PUSH IY | Point HL at IY->route | ||||||
B110 | POP HL | |||||||
B111 | INC L | |||||||
B112 | INC L | |||||||
B113 | CALL get_target_assign_pos | Call get_target_assign_pos | ||||||
Return early if we have no bribes.
|
||||||||
B116 | LD DE,$8215 | Point DE at items_held | ||||||
B119 | LD A,(DE) | Fetch the first item | ||||||
B11A | CP $05 | Does it hold item_BRIBE? | ||||||
B11C | JR Z,accept_bribe_0 | Jump forward if it does | ||||||
B11E | INC DE | Advance to the second item | ||||||
B11F | LD A,(DE) | Fetch the second item | ||||||
B120 | CP $05 | Does it hold item_BRIBE? | ||||||
B122 | RET NZ | Return if not | ||||||
Remove the bribe item.
|
||||||||
accept_bribe_0 | B123 | LD A,$FF | Assign item_NONE to the item slot, removing the bribe item | |||||
B125 | LD (DE),A | |||||||
B126 | AND $3F | Set the bribe item's item_struct room to itemstruct_ROOM_NONE | ||||||
B128 | LD ($76EC),A | |||||||
B12B | CALL draw_all_items | Draw held items | ||||||
Set the vischar_PURSUIT_SAW_BRIBE flag on all visible hostiles. Iterate over hostile and visible non-player characters.
|
||||||||
B12E | LD B,$07 | 7 iterations | ||||||
B130 | LD HL,$8020 | Start at the second visible character | ||||||
Start loop
|
||||||||
accept_bribe_1 | B133 | LD A,(HL) | Fetch the character index | |||||
B134 | CP $14 | Is it > character_20_PRISONER_1? | ||||||
B136 | JR NC,accept_bribe_2 | Jump forward if so | ||||||
B138 | INC L | Set flags to vischar_PURSUIT_SAW_BRIBE if hostile | ||||||
B139 | LD (HL),$04 | |||||||
B13B | DEC L | |||||||
accept_bribe_2 | B13C | LD A,L | Advance to the next vischar | |||||
B13D | ADD A,$20 | |||||||
B13F | LD L,A | |||||||
B140 | DJNZ accept_bribe_1 | ...loop | ||||||
B142 | LD B,$11 | Queue the message "HE TAKES THE BRIBE" | ||||||
B144 | CALL queue_message | |||||||
B147 | LD B,$12 | Then queue the messsage "AND ACTS AS DECOY" | ||||||
B149 | JP queue_message | Return |
Prev: AFDF | Up: Map | Next: B14C |