Prev: EF9A Up: Map Next: EFFC
EFCB: Action: Papers
This checks that the hero is within the main gate bounds. hero_map_position_x must be in ($69..$6D) and hero_map_position_y must be in ($49..$4B). If so, the hero will be transported to the outside of the gates.
Range checking that X is in ($69..$6D) and Y is in ($49..$4B).
action_papers EFCB LD DE,$696D Load DE with the X coordinates of the main gate ($69..$6D)
EFCE LD HL,$81B8 Point HL at global map position (hero)
EFD1 LD B,$02 Set B for two iterations
Start loop
ap_coord_check_loop EFD3 LD A,(HL) Fetch the next coord
EFD4 CP D Return if the hero's out of bounds
EFD5 RET C
EFD6 CP E
EFD7 RET NC
EFD8 INC HL On the second iteration advance to hero_map_position_y ($49..$4B)
EFD9 LD DE,$494B On the second iteration load DE with the Y coordinates of the main gate
EFDC DJNZ ap_coord_check_loop ...loop
The hero was within the bounds of the main gate.
Using the papers at the main gate when not in uniform causes the hero to be sent to solitary. Check for that.
EFDE LD DE,$CEA6 Point DE at the guard sprite set
EFE1 LD A,($8015) Load hero's vischar.mi.sprite
EFE4 CP E Jump to solitary if not using the guard sprite set
EFE5 JP NZ,solitary
The hero was wearing the uniform so is transported outside of the gate.
EFE8 CALL increase_morale_by_10_score_by_50 Increase morale by 10, score by 50
EFEB XOR A Set hero's vischar.room to room_0_OUTDOORS
EFEC LD ($801C),A
Transition to outside the main gate.
EFEF LD HL,$EFF9 Point HL at outside_main_gate location
EFF2 LD IY,$8000 Point IY at the hero's vischar
EFF6 JP transition Jump to transition -- never returns
The position outside of the main gate to which the hero is transported.
outside_main_gate EFF9 DEFB $D6,$8A,$06
Prev: EF9A Up: Map Next: EFFC