diff --git a/mist/Makefile b/mist/Makefile index e9737a6c..bf42a3a2 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -275,7 +275,8 @@ cabin.o: cabin.s zp.inc hardware.inc common_defines.inc \ keyboard.s \ draw_pointer.s \ link_book_channel.s \ - marker_switch.s + marker_switch.s \ + cabin_boiler_puzzle.s ca65 -o cabin.o cabin.s -l cabin.lst diff --git a/mist/cabin.s b/mist/cabin.s index 07d078e8..60ebc7af 100644 --- a/mist/cabin.s +++ b/mist/cabin.s @@ -199,7 +199,18 @@ marker_switch: enter_cabin: lda #DIRECTION_E sta DIRECTION + + lda LOCATION + cmp #CABIN_OPEN + bne open_the_door + + lda #CABIN_ENTRANCE + bne done_enter_cabin ; bra + +open_the_door: lda #CABIN_OPEN + +done_enter_cabin: sta LOCATION jmp change_location @@ -234,6 +245,7 @@ exit_to_mist: ; puzzles .include "marker_switch.s" + .include "cabin_boiler_puzzle.s" ; level data .include "leveldata_cabin.inc" diff --git a/mist/cabin_boiler_puzzle.s b/mist/cabin_boiler_puzzle.s new file mode 100644 index 00000000..fe0ae3ea --- /dev/null +++ b/mist/cabin_boiler_puzzle.s @@ -0,0 +1,6 @@ + ; this is a painful one + +goto_safe: + lda #CABIN_SAFE + sta LOCATION + jmp change_location diff --git a/mist/leveldata_cabin.inc b/mist/leveldata_cabin.inc index 9c654e79..cb562575 100644 --- a/mist/leveldata_cabin.inc +++ b/mist/leveldata_cabin.inc @@ -53,17 +53,20 @@ location2: .byte $ff ; north exit .byte $ff ; south exit .byte CABIN_INSIDE ; east exit - .byte $ff ; west exit + .byte CABIN_OUTSIDE ; west exit .byte $ff ; north exit_dir .byte $ff ; south exit_dir .byte DIRECTION_E ; east exit_dir - .byte $ff ; west exit_dir + .byte DIRECTION_W ; west exit_dir .word $0000 ; north bg .word $0000 ; south bg .word boiler_room_e_lzsa ; east bg - .word $0000 ; west bg - .byte BG_EAST - .byte $ff + .word boiler_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte DIRECTION_W ; special exit + .byte 28,36 ; special x + .byte 16,32 ; special y + .word goto_safe-1 ; CABIN_INSIDE -- inside the cabin @@ -81,7 +84,11 @@ location3: .word boiler_e_lzsa ; east bg .word boiler_w_lzsa ; west bg .byte BG_EAST|BG_WEST - .byte $ff + .byte DIRECTION_W ; special exit + .byte 28,36 ; special x + .byte 16,32 ; special y + .word goto_safe-1 + ; CABIN_SAFE -- looking at safe location4: