diff --git a/mist/graphics_stoney/Makefile b/mist/graphics_stoney/Makefile index d8a14f56..a0f2e780 100644 --- a/mist/graphics_stoney/Makefile +++ b/mist/graphics_stoney/Makefile @@ -17,6 +17,7 @@ stoney_graphics.inc: \ lighthouse_inside_e.lzsa lighthouse_inside_w.lzsa \ lighthouse_inside_n.lzsa \ lighthouse_inside_nowater_n.lzsa lighthouse_inside_notrunk_n.lzsa \ + lighthouse_inside_lidup_n.lzsa \ lighthouse_upstairs_e.lzsa lighthouse_upstairs_w.lzsa \ lighthouse_battery_w.lzsa \ lighthouse_downladder_e.lzsa \ @@ -70,6 +71,7 @@ stoney_graphics.inc: \ echo "lighthouse_inside_n_lzsa: .incbin \"lighthouse_inside_n.lzsa\"" >> stoney_graphics.inc echo "lighthouse_inside_nowater_n_lzsa: .incbin \"lighthouse_inside_nowater_n.lzsa\"" >> stoney_graphics.inc echo "lighthouse_inside_notrunk_n_lzsa: .incbin \"lighthouse_inside_notrunk_n.lzsa\"" >> stoney_graphics.inc + echo "lighthouse_inside_lidup_n_lzsa: .incbin \"lighthouse_inside_lidup_n.lzsa\"" >> stoney_graphics.inc echo "lighthouse_upstairs_e_lzsa: .incbin \"lighthouse_upstairs_e.lzsa\"" >> stoney_graphics.inc echo "lighthouse_upstairs_w_lzsa: .incbin \"lighthouse_upstairs_w.lzsa\"" >> stoney_graphics.inc echo "lighthouse_battery_w_lzsa: .incbin \"lighthouse_battery_w.lzsa\"" >> stoney_graphics.inc diff --git a/mist/graphics_stoney/lighthouse_inside_lidup_n.png b/mist/graphics_stoney/lighthouse_inside_lidup_n.png new file mode 100644 index 00000000..68cfd2a9 Binary files /dev/null and b/mist/graphics_stoney/lighthouse_inside_lidup_n.png differ diff --git a/mist/stoney_puzzles.s b/mist/stoney_puzzles.s index 5a75f41e..150ba5c1 100644 --- a/mist/stoney_puzzles.s +++ b/mist/stoney_puzzles.s @@ -428,15 +428,26 @@ draw_notrunk: bne done_draw_trunk ; bra draw_trunk: + ; see if lid is up + lda TRUNK_STATE + and #TRUNK_LID_OPEN + bne draw_trunk_open + +draw_trunk_closed: lda #lighthouse_inside_n_lzsa sta location5+1,Y ; STONEY_LIGHTHOUSE_INSIDE + jmp done_draw_trunk + +draw_trunk_open: + lda #lighthouse_inside_lidup_n_lzsa + sta location5+1,Y ; STONEY_LIGHTHOUSE_INSIDE done_draw_trunk: - - lda PUMP_STATE beq done_update_pump_state cmp #DRAINED_EXIT @@ -1596,6 +1607,21 @@ start_key_animation: rts inside_other: + + ; if water-up-not-open do nothing + ; if water-down, go down steps + ; if water-up-open - grab key + + lda PUMP_STATE + cmp #DRAINED_LIGHTHOUSE + bne inside_water_up +inside_and_drained: + lda #STONEY_LIGHTHOUSE_SPIRAL + sta LOCATION + jmp change_location +inside_water_up: + + rts rotate_to_ladder: @@ -1646,9 +1672,29 @@ looking_toward_trunk: cmp #8 bne done_draw_inside_lighthouse + ; done animating lda #0 sta ANIMATE_FRAME + ; open trunk but only if trunk is up + ; so if TRUNK_STATE & TRUNK_WATER_DRAINED = 1 + ; and PUMP_STATE & DRAINED_LIGHTHOUSE = 0 + lda PUMP_STATE + and #DRAINED_LIGHTHOUSE + bne dont_open_trunk + + lda TRUNK_STATE + and #TRUNK_WATER_DRAINED + beq dont_open_trunk + + lda TRUNK_STATE + ora #TRUNK_LID_OPEN + sta TRUNK_STATE + + ; actually change background + jsr update_pump_state + jsr change_direction +dont_open_trunk: done_draw_inside_lighthouse: rts @@ -1714,3 +1760,10 @@ key_frame5_sprite: .byte $AA,$AA,$A0,$00,$0A,$0A,$A0 + ; at 16,30 +trunk_key_sprite: + .byte 5,2 + .byte $AA,$AA,$AA,$0A,$0A + .byte $00,$A0,$A0,$00,$A0 + + diff --git a/mist/zp.inc b/mist/zp.inc index 31c075bb..d2d1e862 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -244,7 +244,8 @@ TRUNK_STATE = $C9 ; trunk state in stonsehip TRUNK_VALVE_OPEN = $01 TRUNK_WATER_DRAINED = $02 TRUNK_KEY_TAKEN = $04 - TRUNK_HATCH_OPEN = $08 + TRUNK_LID_OPEN = $08 + TRUNK_HATCH_OPEN = $10 SELENA_BUTTON_STATUS = $CA SELENA_BUTTON1 = $01 ; POOL (water)