diff --git a/mist/graphics_stoney/lighthouse_path_e.png b/mist/graphics_stoney/lighthouse_path_e.png index ff0b523b..c54261f0 100644 Binary files a/mist/graphics_stoney/lighthouse_path_e.png and b/mist/graphics_stoney/lighthouse_path_e.png differ diff --git a/mist/graphics_stoney/umbrella_path_e.png b/mist/graphics_stoney/umbrella_path_e.png index 67c41741..cc02b5df 100644 Binary files a/mist/graphics_stoney/umbrella_path_e.png and b/mist/graphics_stoney/umbrella_path_e.png differ diff --git a/mist/graphics_stoney/umbrella_path_w.png b/mist/graphics_stoney/umbrella_path_w.png index 2a83ce17..08d63c70 100644 Binary files a/mist/graphics_stoney/umbrella_path_w.png and b/mist/graphics_stoney/umbrella_path_w.png differ diff --git a/mist/leveldata_stoney.inc b/mist/leveldata_stoney.inc index dc0d2fbc..b2a5f482 100644 --- a/mist/leveldata_stoney.inc +++ b/mist/leveldata_stoney.inc @@ -936,8 +936,8 @@ location50: .word $0000 ; west bg .byte BG_NORTH .byte DIRECTION_N ; special exit - .byte 8,23 ; special x - .byte 20,46 ; special y + .byte 8,25 ; special x + .byte 24,46 ; special y .word goto_trunk-1 ; STONEY_LIGHTHOUSE_TRUNK_CLOSE -- closeup of trunk diff --git a/mist/stoney.s b/mist/stoney.s index 737784d6..9f512241 100644 --- a/mist/stoney.s +++ b/mist/stoney.s @@ -204,6 +204,10 @@ not_a_doorway: beq fg_draw_trunk_close cmp #STONEY_LIGHTHOUSE_INSIDE beq fg_draw_inside_lighthouse + cmp #STONEY_LIGHTHOUSE_DOOR + beq fg_lighthouse_door + cmp #STONEY_TRUNK + beq fg_draw_trunk jmp nothing_special @@ -278,6 +282,32 @@ fg_draw_inside_lighthouse: jsr draw_inside_lighthouse jmp nothing_special +fg_draw_trunk: + jsr draw_floor_key + jmp nothing_special + +fg_lighthouse_door: + lda HOLDING_ITEM + beq not_holding_key + + ; if outside door, drop key and close lid + lda #0 + sta HOLDING_ITEM + jsr update_inside_lighthouse_action + + lda TRUNK_STATE + ora #TRUNK_KEY_ON_FLOOR ; drop key on floor + sta TRUNK_STATE + +not_holding_key: + + ; close lid + lda TRUNK_STATE + and #~(TRUNK_LID_OPEN) + sta TRUNK_STATE + + jsr update_pump_state + nothing_special: ;==================================== diff --git a/mist/stoney_puzzles.s b/mist/stoney_puzzles.s index 611dba0b..dfaa3b97 100644 --- a/mist/stoney_puzzles.s +++ b/mist/stoney_puzzles.s @@ -1452,7 +1452,36 @@ doorway2_water_list: ; water raises: FULL OF WATER, PLUG OPEN ; close plug: EMPTY OF WATER, PLUG CLOSED + + ;==================================== + ; goto the trunk close + ; OR pickup floor key if applicable + ;==================================== goto_trunk: + lda CURSOR_X + cmp #22 + bcc goto_the_trunk ; blt + + ; pickup floor key? + lda TRUNK_STATE + and #TRUNK_KEY_ON_FLOOR + beq no_floor_key + +pickup_floor_key: + lda TRUNK_STATE + and #~TRUNK_KEY_ON_FLOOR + sta TRUNK_STATE + + lda #HOLDING_KEY + sta HOLDING_ITEM + + jsr update_inside_lighthouse_action + +no_floor_key: + rts + +goto_the_trunk: + lda #STONEY_TRUNK_CLOSE sta LOCATION @@ -1924,8 +1953,33 @@ unlock_hatch: ; unlock the hatch lda TRUNK_STATE ora #TRUNK_HATCH_OPEN + ora #TRUNK_KEY_ON_FLOOR ; drop key on floor sta TRUNK_STATE jsr update_hatch_state jmp change_direction + + + + ;======================== + ; draw floor key + ;======================== +draw_floor_key: + lda TRUNK_STATE + and #TRUNK_KEY_ON_FLOOR + beq done_draw_floor_key + + lda #23 + sta XPOS + lda #34 + sta YPOS + + lda #trunk_key_sprite + sta INH + jsr put_sprite_crop + +done_draw_floor_key: + rts diff --git a/mist/zp.inc b/mist/zp.inc index d2d1e862..4a9df7cc 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -246,6 +246,7 @@ TRUNK_STATE = $C9 ; trunk state in stonsehip TRUNK_KEY_TAKEN = $04 TRUNK_LID_OPEN = $08 TRUNK_HATCH_OPEN = $10 + TRUNK_KEY_ON_FLOOR = $20 SELENA_BUTTON_STATUS = $CA SELENA_BUTTON1 = $01 ; POOL (water)