mist: stoney: trunk/key puzzle all hooked up?

This commit is contained in:
Vince Weaver 2020-08-10 14:54:44 -04:00
parent f0f0140b4a
commit 3c9f42ecd4
7 changed files with 87 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 952 B

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -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

View File

@ -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:
;====================================

View File

@ -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 INL
lda #>trunk_key_sprite
sta INH
jsr put_sprite_crop
done_draw_floor_key:
rts

View File

@ -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)