Prev: B3E1 Up: Map Next: B417
B3F6: Action: Shovel
This handles the hero using the shovel to clear the blockage in tunnel room number 50.
action_shovel B3F6 LD A,($68A0) If the global current room index isn't room_50_BLOCKED_TUNNEL bail out
B3F9 CP $32
B3FB RET NZ
Bomb out if the blockage is already removed.
B3FC LD A,($7077) Fetch the room definition's first boundary byte
B3FF CP $FF Is it 255?
B401 RET Z Return if so - the blockage was already removed
Otherwise we can remove the blockage
(Note that the hero doesn't need to be adjacent to the blockage for this to work, only in the same room).
The blockage boundary's x0 is set to 255. This invalidates the boundary by forcing the "x < bounds->x0" test at B2D9 (in interior_bounds_check) to fail.
B402 LD A,$FF roomdef_50_blocked_tunnel_boundary[0] = 255
B404 LD ($7077),A
Remove the blockage graphic.
B407 INC A roomdef_50_blocked_tunnel_collapsed_tunnel = 0
B408 LD ($708C),A
B40B CALL setup_room Setup the room
B40E CALL choose_game_window_attributes Choose game window attributes
B411 CALL plot_interior_tiles Render visible tiles array into the screen buffer
B414 JP increase_morale_by_10_score_by_50 Increase morale by 10, score by 50 and exit via
Prev: B3E1 Up: Map Next: B417