From 6477e7234e0f8f0d049958099819ad328a34ed61 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 3 Apr 2020 17:16:23 -0400 Subject: [PATCH] mist: can actually take the tower elevator --- mist/leveldata_octagon.inc | 14 +++++++----- mist/octagon_bookshelf.s | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/mist/leveldata_octagon.inc b/mist/leveldata_octagon.inc index f4f6d869..b33c661b 100644 --- a/mist/leveldata_octagon.inc +++ b/mist/leveldata_octagon.inc @@ -351,8 +351,10 @@ location18: .word $0000 ; east bg .word $0000 ; west bg .byte BG_SOUTH - .byte $ff - + .byte DIRECTION_S ; special exit + .byte 29,35 ; special x + .byte 34,40 ; special y + .word elevator_button-1 ; special function ; OCTAGON_TOWER_BOOK -- tower, bookside location19: @@ -390,12 +392,12 @@ location20: ; OCTAGON_BOOK_VIEW -- ladder, view outside location21: - .byte $ff ; north exit - .byte OCTAGON_BOOK_LADDER ; south exit + .byte OCTAGON_BOOK_LADDER ; north exit + .byte $ff ; south exit .byte $ff ; east exit .byte $ff ; west exit - .byte $ff ; north exit_dir - .byte DIRECTION_S ; south exit_dir + .byte DIRECTION_N ; north exit_dir + .byte $ff ; south exit_dir .byte $ff ; east exit_dir .byte $ff ; west exit_dir .word tower_book_view_n_lzsa ; north bg diff --git a/mist/octagon_bookshelf.s b/mist/octagon_bookshelf.s index 461c98fe..86135189 100644 --- a/mist/octagon_bookshelf.s +++ b/mist/octagon_bookshelf.s @@ -1,4 +1,49 @@ + ; elevator button pressed + +elevator_button: + + ; see which floor we are on + + ldy #LOCATION_SOUTH_EXIT + lda location18,Y + cmp #OCTAGON_ELEVATOR_OUT + bne elevator_goto_library_level + +elevator_goto_tower_level: + ; we want to go up the tower + + ; change exit + lda #OCTAGON_TOWER_BOOK + sta location18,Y + + ; change bg image + + ldy #LOCATION_SOUTH_BG + lda #elevator_tower_s_lzsa + sta location18+1,Y + + jmp change_location + +elevator_goto_library_level: + ; we want to move back to the library + + ; change exit + lda #OCTAGON_ELEVATOR_OUT + sta location18,Y + + ; change south bg image + ldy #LOCATION_SOUTH_BG + lda #elevator_lib_s_lzsa + sta location18+1,Y + + jmp change_location + + open_bookshelf: ; change background of center room N