Prev: 83CE Up: Map Next: 8459
83D6: Show the planet-secured screen, award the bonus, and move on to the next planet
Used by the routine at level_done.
Called by level_done once the rocket has launched. Prints the four lines at planet_secured_lines and the name of the planet just finished (one of five, planet_names; +$12 of the current player's record, score, is its number) into planet_secured_name_text, then the four lines from next_planet_lines with the next planet's name copied into next_planet_name_text -- after the fifth planet the first comes round again.
It then resets the rocket's base position (rocket_x), sets the player's +$1A and +$1B to 6, and counts a bonus of ten times 5000 (BCD, the score adder in test_player_shots) onto the score with a zap (sound_zap) and a pause after each. Last it deals the player's last pick-up place again (the second entry point of deal_places, with IY at the dealing list's last entry and DE at the current player's last place, +$65 of score) and clears the player's own gone bits in the 290 world objects' kinds (mask_world_objects) with a mask worked out from the player in play (player_in_play): $7F for player 1 (bit 7), $BF for player 2 (bit 6).
planet_secured 83D6 LD DE,planet_secured_lines The first four lines
83D9 LD B,$04
83DB CALL print_strings
83DE LD A,(level) Copy this planet's name (16 bytes) into planet_secured_name_text
83E1 ADD A,A
83E2 ADD A,A
83E3 ADD A,A
83E4 ADD A,A
83E5 LD HL,planet_names
83E8 CALL add_a_to_hl
83EB LD DE,planet_secured_name_text
83EE LD C,$10
83F0 LDIR
83F2 LD A,(level) After the last planet the next is the first (number $FF, made 0 below)
83F5 CP $04
83F7 JR NZ,planet_secured_0
83F9 LD A,$FF
83FB LD (level),A
83FE LD HL,planet_names
planet_secured_0 8401 LD DE,next_planet_name_text Copy the next planet's name (15 bytes) into next_planet_name_text
8404 LD C,$0F
8406 LDIR
8408 LD DE,planet_secured_name Print this planet's name
840B CALL print_string
840E LD HL,$5268 The rocket's base position
8411 LD (rocket_x),HL
8414 LD HL,$0A73
8417 LD (rocket_y),HL
841A LD A,(level) Next planet
841D INC A
841E LD (level),A
8421 LD B,$04 The four lines from next_planet_lines
8423 CALL print_strings
8426 LD A,$06 The player's +$1A and +$1B to 6
8428 LD (rocket_part_carried),A
842B LD (parts_built),A
842E LD B,$0A Ten times: 5000 points, a zap and a pause
planet_secured_1 8430 PUSH BC
8431 LD BC,$5000
8434 CALL add_score
8437 CALL sound_zap
843A LD D,$FF
843C CALL delay
843F POP BC
8440 DJNZ planet_secured_1
8442 LD DE,place_last Deal one pick-up place again
8445 LD IY,dealing_list_last
8449 CALL deal_places_0
844C LD A,(player_in_play) A mask from the player in play (player_in_play) for the world objects' kinds (mask_world_objects): $7F for player 1, $BF for player 2
844F INC A
8450 XOR $03
8452 CPL
8453 RRCA
8454 RRCA
8455 LD E,A
8456 JP mask_world_objects
Prev: 83CE Up: Map Next: 8459