Prev: B387 Up: Map Next: B3C4
B3A8: Action: Bribe
This handles the hero bribing a fellow prisoner. It searches through the visible, friendly characters only and returns the first found. The selected character will then pursue the hero. Once they've touched it will accept the bribe (see tr_pursue).
Iterate over non-player visible characters.
action_bribe B3A8 LD HL,$8020 Point HL at the second visible character
B3AB LD B,$07 Set B for seven iterations
Start loop
action_bribe_0 B3AD LD A,(HL) Fetch the vischar's character index
B3AE CP $FF Is it character_NONE?
B3B0 JR Z,action_bribe_1 Jump to the next vischar if so
B3B2 CP $14 Is it character_20_PRISONER_1?
B3B4 JR NC,bribe_found Jump to bribe_found if >=
action_bribe_1 B3B6 LD A,$20 Step to the next vischar
B3B8 ADD A,L
B3B9 LD L,A
B3BA DJNZ action_bribe_0 ...loop
B3BC RET Return
bribe_found B3BD LD ($AF8E),A Set the global bribed character to A
B3C0 INC L Point HL at vischar flags
B3C1 LD (HL),$01 Set flags to vischar_PURSUIT_PURSUE
B3C3 RET Return
Prev: B387 Up: Map Next: B3C4