peasant: hook up actions inside NN cabin

can now get robe
This commit is contained in:
Vince Weaver 2021-11-29 00:41:40 -05:00
parent f190cc50bc
commit 7cba779963
4 changed files with 274 additions and 152 deletions

View File

@ -194,8 +194,11 @@ POINTS IMPLEMENTED: (in order of implementation)
+ 7 (get riches from jhonka)
+ 5 (throw baby)
+ 5 (deploy baby)
+ 1 (close drawer)
+ 10 (get robe)
+ 3 (wear robe)
======
96 points
110 points
deaths/endings implemented

View File

@ -816,211 +816,257 @@ inside_cottage_sleep:
;=======================
inside_nn_verb_table:
.if 0
.byte VERB_ASK
.word archery_ask-1
.byte VERB_GET
.word archery_get-1
.byte VERB_GIVE
.word archery_give-1
.byte VERB_HALDO
.word archery_haldo-1
.byte VERB_LOOK
.word archery_look-1
.byte VERB_PLAY
.word archery_play-1
.byte VERB_STEAL
.word archery_steal-1
.byte VERB_TALK
.word archery_talk-1
.word inside_nn_look-1
.byte VERB_OPEN
.word inside_nn_open-1
.byte VERB_CLOSE
.word inside_nn_close-1
.byte VERB_GET
.word inside_nn_get-1
.byte VERB_TAKE
.word archery_take-1
.endif
.word inside_nn_take-1
.byte VERB_STEAL
.word inside_nn_steal-1
.byte 0
.if 0
;================
; ask
;================
archery_ask:
; TODO
jmp parse_common_ask
;================
; get
;================
archery_get:
archery_steal:
archery_take:
inside_nn_get:
inside_nn_steal:
inside_nn_take:
lda CURRENT_NOUN
cmp #NOUN_TARGET
beq archery_get_target
cmp #NOUN_ARROW
beq archery_get_arrow
cmp #NOUN_ROBE
beq inside_nn_get_robe
cmp #NOUN_DRESSER
beq inside_nn_get_dresser
cmp #NOUN_DRAWER
beq inside_nn_get_drawer
cmp #NOUN_BROOM
beq inside_nn_get_broom
; else "probably wish" message
jmp parse_common_get
archery_get_target:
ldx #<archery_get_target_message
ldy #>archery_get_target_message
inside_nn_get_robe:
; first see if drawer closed
lda GAME_STATE_2
and #DRESSER_OPEN
beq inside_nn_get_robe_drawer_closed
; next see if already have it
lda INVENTORY_2
and #INV2_ROBE
beq inside_nn_actually_get_robe
inside_nn_get_robe_already_have:
ldx #<inside_nn_get_robe_already_message
ldy #>inside_nn_get_robe_already_message
jmp finish_parse_message
archery_get_arrow:
ldx #<archery_get_arrow_message
ldy #>archery_get_arrow_message
inside_nn_get_robe_drawer_closed:
ldx #<inside_nn_get_robe_drawer_closed_message
ldy #>inside_nn_get_robe_drawer_closed_message
jmp finish_parse_message
;================
; give
;================
archery_give:
; TODO
inside_nn_actually_get_robe:
jmp parse_common_give
; get 10 pts
;================
; haldo
;================
archery_haldo:
lda #$10
jsr score_points
; TODO
; get robe
jmp parse_common_haldo
lda INVENTORY_2
ora #INV2_ROBE
sta INVENTORY_2
ldx #<inside_nn_get_robe_message
ldy #>inside_nn_get_robe_message
jmp finish_parse_message
inside_nn_get_dresser:
inside_nn_get_drawer:
ldx #<inside_nn_get_dresser_message
ldy #>inside_nn_get_dresser_message
jmp finish_parse_message
inside_nn_get_broom:
ldx #<inside_nn_get_broom_message
ldy #>inside_nn_get_broom_message
jmp finish_parse_message
;=================
; look
;=================
archery_look:
inside_nn_look:
lda CURRENT_NOUN
cmp #NOUN_DESK
beq archery_look_at_desk
cmp #NOUN_TARGET
beq archery_look_at_target
cmp #NOUN_ARCHER
beq archery_look_at_archer
cmp #NOUN_BROOM
beq inside_nn_look_broom
cmp #NOUN_DRAWER
beq inside_nn_look_drawer
cmp #NOUN_DRESSER
beq inside_nn_look_dresser
cmp #NOUN_NONE
beq archery_look_at
beq inside_nn_look_at
jmp parse_common_look
archery_look_at:
ldx #<archery_look_message
ldy #>archery_look_message
inside_nn_look_at:
ldx #<inside_nn_look_at_message
ldy #>inside_nn_look_at_message
jmp finish_parse_message
archery_look_at_archer:
ldx #<archery_look_at_archer_message
ldy #>archery_look_at_archer_message
inside_nn_look_broom:
ldx #<inside_nn_look_brook_message
ldy #>inside_nn_look_brook_message
jmp finish_parse_message
archery_look_at_target:
ldx #<archery_look_at_target_message
ldy #>archery_look_at_target_message
inside_nn_look_dresser:
inside_nn_look_drawer:
lda GAME_STATE_2
and #DRESSER_OPEN
bne inside_nn_look_drawer_open
inside_nn_look_drawer_closed:
ldx #<inside_nn_look_closed_drawer_message
ldy #>inside_nn_look_closed_drawer_message
jmp finish_parse_message
archery_look_at_desk:
ldx #<archery_look_at_desk_message
ldy #>archery_look_at_desk_message
inside_nn_look_drawer_open:
lda INVENTORY_2
and #INV2_ROBE
bne inside_nn_look_drawer_open_norobe
inside_nn_look_drawer_open_robe:
ldx #<inside_nn_look_open_drawer_message
ldy #>inside_nn_look_open_drawer_message
jmp finish_parse_message
inside_nn_look_drawer_open_norobe:
ldx #<inside_nn_look_norobe_drawer_message
ldy #>inside_nn_look_norobe_drawer_message
jmp finish_parse_message
;================
; play
; open
;================
archery_play:
inside_nn_open:
lda CURRENT_NOUN
cmp #NOUN_GAME
beq archery_play_game
cmp #NOUN_DRAWER
beq inside_nn_open_drawer
cmp #NOUN_DRESSER
beq inside_nn_open_drawer
jmp parse_common_unknown
archery_play_game:
ldx #<archery_play_game_message
ldy #>archery_play_game_message
jmp finish_parse_message
inside_nn_open_drawer:
; first check to see if it's already open
;================
; talk
;================
archery_talk:
lda GAME_STATE_2
and #DRESSER_OPEN
bne inside_nn_open_drawer_already_open
; only talk if close
lda PEASANT_X
cmp #23
bcc archery_talk_too_far
; check Y too?
; probably less than $7D?
; actual game will walk you in if close
; will it work from beind?
lda CURRENT_NOUN
cmp #NOUN_MAN
beq archery_talk_mendelev
cmp #NOUN_GUY
beq archery_talk_mendelev
cmp #NOUN_DUDE
beq archery_talk_mendelev
cmp #NOUN_MENDELEV
beq archery_talk_mendelev
cmp #NOUN_ARCHER
beq archery_talk_mendelev
jmp parse_common_unknown
archery_talk_mendelev:
ldx #<archery_talk_mendelev_message
ldy #>archery_talk_mendelev_message
jsr partial_message_step
ldx #<archery_talk_mendelev2_message
ldy #>archery_talk_mendelev2_message
jsr partial_message_step
ldx #<archery_talk_mendelev3_message
ldy #>archery_talk_mendelev3_message
jsr finish_parse_message
; add 1 point to score if don't have mask or trinket
; add 2 points otherwise
; see if robe has been taken
lda INVENTORY_2
and #INV2_TRINKET
bne archer_2_points
and #INV2_ROBE
beq inside_nn_open_drawer_closed_full
lda INVENTORY_1
and #INV1_MONSTER_MASK
bne archer_2_points
archer_1_point:
lda #1
bne archer_score_points ; bra
archer_2_points:
lda #2
archer_score_points:
jsr score_points
rts
archery_talk_too_far:
ldx #<archery_talk_far_message
ldy #>archery_talk_far_message
inside_nn_open_drawer_closed_empty:
ldx #<inside_nn_open_empty_drawer_message
ldy #>inside_nn_open_empty_drawer_message
jmp finish_parse_message
.endif
inside_nn_open_drawer_closed_full:
; open the drawer
lda GAME_STATE_2
ora #DRESSER_OPEN
sta GAME_STATE_2
ldx #<inside_nn_open_closed_drawer_message
ldy #>inside_nn_open_closed_drawer_message
jmp finish_parse_message
inside_nn_open_drawer_already_open:
ldx #<inside_nn_open_open_drawer_message
ldy #>inside_nn_open_open_drawer_message
jmp finish_parse_message
;================
; close
;================
inside_nn_close:
lda CURRENT_NOUN
cmp #NOUN_DRAWER
beq inside_nn_close_drawer
cmp #NOUN_DRESSER
beq inside_nn_close_drawer
jmp parse_common_unknown
inside_nn_close_drawer:
; first check to see if it's open
lda GAME_STATE_2
and #DRESSER_OPEN
bne inside_nn_close_drawer_open
inside_nn_close_drawer_closed:
ldx #<inside_nn_close_closed_drawer_message
ldy #>inside_nn_close_closed_drawer_message
jmp finish_parse_message
inside_nn_close_drawer_open:
; regardless, we close the drawer
lda GAME_STATE_2
and #<(~DRESSER_OPEN)
sta GAME_STATE_2
; see if robe has been taken
lda INVENTORY_2
and #INV2_ROBE
beq inside_nn_close_drawer_full
inside_nn_close_drawer_empty:
; get 1 pt
lda #1
jsr score_points
ldx #<inside_nn_close_empty_drawer_message
ldy #>inside_nn_close_empty_drawer_message
jmp finish_parse_message
inside_nn_close_drawer_full:
ldx #<inside_nn_close_full_drawer_message
ldy #>inside_nn_close_full_drawer_message
jmp finish_parse_message
.include "dialog_inside.inc"

View File

@ -0,0 +1,42 @@
; based on code from here
; http://eightbitsoundandfury.ld8.org/programming.html
NOTE_C3 = 255
NOTE_CSHARP3 = 241
NOTE_D3 = 227
NOTE_DSHARP3 = 214
NOTE_E3 = 202
NOTE_F3 = 191
NOTE_FSHARP3 = 180
NOTE_G3 = 170
NOTE_GSHARP3 = 161
NOTE_A3 = 152
NOTE_ASHARP3 = 143
NOTE_B3 = 135
NOTE_C4 = 128
NOTE_CSHARP4 = 121
NOTE_D4 = 114
NOTE_DSHARP4 = 108
NOTE_E4 = 102
NOTE_F4 = 96
NOTE_FSHARP4 = 91
NOTE_G4 = 85
NOTE_GSHARP4 = 81
NOTE_A4 = 76
NOTE_ASHARP4 = 72
NOTE_B4 = 68
NOTE_C5 = 64
NOTE_CSHARP5 = 60
NOTE_D5 = 57
NOTE_DSHARP5 = 54
NOTE_E5 = 51
NOTE_F5 = 48
NOTE_FSHARP5 = 45
NOTE_G5 = 43
NOTE_GSHARP5 = 40
NOTE_A5 = 38
NOTE_ASHARP5 = 36
NOTE_B5 = 34

View File

@ -460,7 +460,11 @@ inside_cottage_leaving_post_trinket_message:
; Inside Mysterious (Ned's) Cottage
;===================================
;=========
; look
; + look
inside_nn_look_at_message:
.byte "This place could use some",13
.byte "serious sprucing of the",13
.byte "'up' variety. There's a",13
@ -469,6 +473,7 @@ inside_cottage_leaving_post_trinket_message:
.byte "all mysterious like.",0
; + look broom
inside_nn_look_brook_message:
.byte "The broom is all black and",13
.byte "artistic, implying perhaps",13
.byte "that it is closer to the",13
@ -476,15 +481,17 @@ inside_cottage_leaving_post_trinket_message:
.byte "avoid emphasis.",0
; + look drawer/dresser (closed)
inside_nn_look_closed_drawer_message:
.byte "This dresser needs a good",13
.byte "wipe down with new",13
.byte "Indenture(tm), the dust",13
.byte "busting miracle spray.",13
.byte "There is an especially enticing",13
.byte "top drawer that is",13
.byte "There is an especially",13
.byte "enticing top drawer that is",13
.byte "currently closed.",0
; + look drawer/dresser (open)
inside_nn_look_open_drawer_message:
.byte "This dresser needs a good",13
.byte "wipe down with new",13
.byte "Indenture(tm), the dust",13
@ -493,7 +500,8 @@ inside_cottage_leaving_post_trinket_message:
.byte "there are some brown lumpy",13
.byte "clothes in it.",0
; + look drawer/dresser (after robe)
; + look drawer/dresser (open, after robe taken)
inside_nn_look_norobe_drawer_message:
.byte "This dresser needs a good",13
.byte "wipe down with new",13
.byte "Indenture(tm), the dust",13
@ -501,23 +509,33 @@ inside_cottage_leaving_post_trinket_message:
.byte "There is a drawer open, but",13
.byte "it's empty.",0
;======
; open
; + open drawer (it's closed, not taken)
inside_nn_open_closed_drawer_message:
.byte "There's a vintage peasant",13
.byte "robe in there! Just like",13
.byte "grampa used to wear.",0
; + open drawer (it's open)
inside_nn_open_open_drawer_message:
.byte "Yeah, totally! Except it's",13
.byte "already open you moron.",0
; + open drawer (after getting robe and closing)
inside_nn_open_empty_drawer_message:
.byte "You already closed it,",13
.byte "which was nice, and so we",13
.byte "gave you some points. Let",13
.byte "sleeping drawers lie.",0
;=========
; close
;+1 POINT
; + close drawer
inside_nn_close_empty_drawer_message:
.byte "Aww, how thoughtful and",13
.byte "boring of you. Break into",13
.byte "this peasant's home, steal",13
@ -526,6 +544,7 @@ inside_cottage_leaving_post_trinket_message:
.byte "You're a real saint.",0
; + close drawer (w/o taking robe)
inside_nn_close_full_drawer_message:
.byte "Right, right. Wouldn't",13
.byte "want to leave the robes out",13
.byte "where any old guy trying to",13
@ -533,19 +552,29 @@ inside_cottage_leaving_post_trinket_message:
.byte "could take them.",0
; + close drawer (already closed)
inside_nn_close_closed_drawer_message:
.byte "A riddle: What can be",13
.byte "closed that is already",13
.byte "closed? (hint: not this",13
.byte "drawer)",0
;============
; get
; +10 points
; + get robe
; + get/take robe (drawer must be open)
inside_nn_get_robe_message:
.byte "Yeah! Get that robe!",0
; + get/take robe (after you've gotten it)
.byte "You still remember the time when you took them. Oh, the times have changed ... but the robes?",0
inside_nn_get_robe_already_message:
.byte "You still remember the time",13
.byte "when you took them. Oh, the",13
.byte "times have changed ... but",13
.byte "the robes?",0
; + get/take robe (drawer closed)
; + get/take robe (drawer closed, whether you have it or not)
inside_nn_get_robe_drawer_closed_message:
.byte "You reach into the closed",13
.byte "drawer and nearly break",13
.byte "your hand slamming it. Just",13
@ -554,12 +583,14 @@ inside_cottage_leaving_post_trinket_message:
.byte "blamelessness.",0
; + get/take drawer/dresser
inside_nn_get_dresser_message:
.byte "You get a hernia from",13
.byte "lifting it. -2 Movement",13
.byte "points, -10 Constitution.",13
.byte "Don't do that again.",0
; + get/take broom
inside_nn_get_broom_message:
.byte "No, no. The broom is in the",13
.byte "foreground and you can't",13
.byte "take things from the",13