Prev: A50B Up: Map Next: A58C
A51C: Escaped
This is called when the hero has made an escape attempt. It prints the 'WELL DONE' message then tests to see if the correct objects were used in the escape attempt. It then prints an according sequence of messages. If the attempt was successful then on restart the game is reset, otherwise the hero is sent to solitary.
The items map to win-lose states as follows:
Combination Items Message Result
Uniform Purse Papers Compass
0 . . . . "BUT WERE RECAPTURED TOTALLY UNPREPARED" Lose
1 . . . X "BUT WERE RECAPTURED DUE TO LACK OF PAPERS" Lose
2 . . X . "BUT WERE RECAPTURED TOTALLY LOST" Lose
3 . . X X (the game offers no extra message) Win
4 . X . . "BUT WERE RECAPTURED TOTALLY LOST" Lose
5 . X . X "AND WILL CROSS THE BORDER SUCCESSFULLY" Win
6 . X X . "BUT WERE RECAPTURED TOTALLY LOST" Lose
8 X . . . "BUT WERE RECAPTURED AND SHOT AS A SPY" Lose
9 X . . X "BUT WERE RECAPTURED AND SHOT AS A SPY" Lose
10 X . X . "BUT WERE RECAPTURED AND SHOT AS A SPY" Lose
12 X X . . "BUT WERE RECAPTURED AND SHOT AS A SPY" Lose
Used by the routine at in_permitted_area.
escaped A51C CALL screen_reset Reset the screen
Print standard prefix messages.
A51F LD HL,$A5CE Point HL at the escape messages
A522 CALL screenlocstring_plot Print "WELL DONE" "YOU HAVE ESCAPED" "FROM THE CAMP" (each print call advances HL)
A525 CALL screenlocstring_plot
A528 CALL screenlocstring_plot
Form an escape items bitfield.
A52B LD C,$00 Clear the item flags
A52D LD HL,$8215 Point HL at the first held item
A530 CALL join_item_to_escapeitem Turn the item into a flag
A533 INC HL Point HL at the second held item
A534 CALL join_item_to_escapeitem Turn the item into a flag, merging with previous result
Print item-tailored messages.
A537 LD A,C Move flags into A
A538 CP $05 If the flags show we're holding are escapeitem_COMPASS and escapeitem_PURSE then jump to the success case
A53A JR Z,escaped_success
A53C CP $03 Otherwise if we don't have both escapeitem_COMPASS and escapeitem_PAPERS jump to the captured case
A53E JR NZ,escaped_captured
escaped_success A540 LD HL,$A5FD Point HL at the fourth escape message
A543 CALL screenlocstring_plot Print "AND WILL CROSS THE "BORDER SUCCESSFULLY"
A546 CALL screenlocstring_plot
A549 LD A,$FF Signal to reset the game at the end of this routine
A54B PUSH AF
A54C JR escaped_press_any_key Jump to "press any key"
escaped_captured A54E PUSH AF Save flags
A54F LD HL,$A628 Point HL at the sixth escape message
A552 CALL screenlocstring_plot Print "BUT WERE RECAPTURED"
A555 POP AF Fetch flags
A556 PUSH AF
A557 CP $08 If flags include escapeitem_UNIFORM print "AND SHOT AS A SPY"
A559 JR NC,escaped_plot
A55B LD HL,$A652 Point HL at the eighth escape message
A55E AND A If flags is zero then print "TOTALLY UNPREPARED"
A55F JR Z,escaped_plot
A561 LD HL,$A667 Point HL at the ninth escape message
A564 BIT 0,A If there was no compass then print "TOTALLY LOST"
A566 JR Z,escaped_plot
A568 LD HL,$A676 Print "DUE TO LACK OF PAPERS"
escaped_plot A56B CALL screenlocstring_plot Print
escaped_press_any_key A56E LD HL,$A68E Print "PRESS ANY KEY"
A571 CALL screenlocstring_plot
Wait for a keypress.
escaped_0 A574 CALL keyscan_all Wait for a key down
A577 JR NZ,escaped_0
escaped_1 A579 CALL keyscan_all Wait for a key up
A57C JR Z,escaped_1
A57E POP AF Fetch flags
Reset the game, or send the hero to solitary.
A57F CP $FF Are the flags $FF?
A581 JP Z,reset_game Reset the game if so (exit via)
A584 CP $08 Are the flags greater or equal to escapeitem_UNIFORM?
A586 JP NC,reset_game Reset the game if so (exit via)
A589 JP solitary Otherwise send the hero to solitary (exit via)
Prev: A50B Up: Map Next: A58C