peasant: can get the pebbles

This commit is contained in:
Vince Weaver 2021-10-25 00:44:57 -04:00
parent 4c5d08d6e2
commit 543dfbc2bd
4 changed files with 51 additions and 11 deletions

View File

@ -67,29 +67,29 @@ draw_inv_text:
lda #28
sta CURSOR_Y
ldy #0
ldy #0 ; row
inv_reset_mask:
lda #1
lda #1 ; start at low item
sta INVENTORY_MASK
draw_inv_loop:
cpy #9
cpy #9 ; if <9, left column >=9, right
bcs right_column ; bge
left_column:
lda #4
lda #4 ; left column is #4
bne done_column ; bra
right_column:
lda #23
lda #23 ; right column is #23
done_column:
sta CURSOR_X
tya
pha
pha ; save Y
jsr have_item_y
jsr have_item_y ; check if have item
beq questionmarks
@ -337,10 +337,10 @@ done_inv_keypress:
have_item:
ldy INVENTORY_Y
have_item_y:
tya
and #$3
tya ; move to A
and #$7 ; mask off to bottom 2?
tax
lda masks,X
lda masks,X ; load in mask
sta INVENTORY_MASK
tya

View File

@ -224,6 +224,20 @@ parse_common_throw:
parse_common_get:
parse_common_take:
parse_common_steal:
lda CURRENT_NOUN
cmp #NOUN_PEBBLES
bne not_pebbles
was_pebbles:
lda INVENTORY_1
and #INV1_PEBBLES
beq not_pebbles
ldx #<get_pebbles_message
ldy #>get_pebbles_message
jmp finish_parse_message
not_pebbles:
ldx #<get_message
ldy #>get_message
jmp finish_parse_message

View File

@ -295,10 +295,31 @@ lake_west_get_berries:
jmp finish_parse_message
lake_west_get_pebbles:
lda INVENTORY_1
and #INV1_PEBBLES
bne lake_west_yes_pebbles
lake_west_no_pebbles:
; FIXME: only if standing on them
; pick up pebbles
lda INVENTORY_1
ora #INV1_PEBBLES
sta INVENTORY_1
; add score
lda #1
jsr score_points
; print message
ldx #<lake_west_get_pebbles_message
ldy #>lake_west_get_pebbles_message
jmp finish_parse_message
lake_west_yes_pebbles:
jmp parse_common_get
;=================
; look

View File

@ -162,7 +162,12 @@ get_message:
.byte "get that.",0
; + get pebbles/rocks (after you've gotten them)
.byte "Come now. We've been through this jaunty little bit before. You took them from the half lake screen with the cattail and stuff.",0
get_pebbles_message:
.byte "Come now. We've been",13
.byte "through this jaunty little",13
.byte "bit before. You took them",13
.byte "from the half lake screen",13
.byte "with the cattail and stuff.",0
; + give
give_message: