diff --git a/games/peasant/NOTES b/games/peasant/NOTES index f8951d88..4a65a285 100644 --- a/games/peasant/NOTES +++ b/games/peasant/NOTES @@ -35,6 +35,7 @@ peasant2 18302 17100 -- move parse_input high and move p2 strings back in 17368 -- use lookup table for next room (and other changes) 17780 -- size as of the switch to dictionary word lookup + 18012 -- hook up more of archery partial save, can we fit in 4k? 102 lines ; inventory was 115? @@ -184,8 +185,9 @@ POINTS IMPLEMENTED: (in order of implementation) + 3 (jump in hay) + 2 (fall in mud puddle) + 2 (give trinket to brothers) ++ 2 (get super trinket) ====== - 52 points + 54 points deaths/endings implemented diff --git a/games/peasant/parse_input.s b/games/peasant/parse_input.s index bb5c9c36..9dce2c2d 100644 --- a/games/peasant/parse_input.s +++ b/games/peasant/parse_input.s @@ -702,6 +702,7 @@ verb_lookup: .byte "SAVE",VERB_SAVE|$80 .byte "SAY",VERB_SAY|$80 .byte "SCARE",VERB_SCARE|$80 +.byte "SEARCH",VERB_SEARCH|$80 .byte "SHOOT",VERB_SHOOT|$80 .byte "SHOW",VERB_SHOW|$80 .byte "SIT",VERB_SIT|$80 diff --git a/games/peasant/peasant4_actions.s b/games/peasant/peasant4_actions.s index a0dd031a..9861af22 100644 --- a/games/peasant/peasant4_actions.s +++ b/games/peasant/peasant4_actions.s @@ -447,6 +447,12 @@ lady_cottage_verb_table: .word lady_cottage_knock-1 .byte VERB_OPEN .word lady_cottage_open-1 + .byte VERB_GET + .word lady_cottage_get-1 + .byte VERB_TAKE + .word lady_cottage_get-1 + .byte VERB_SEARCH + .word lady_cottage_search-1 .byte 0 ;================= @@ -550,7 +556,171 @@ lady_cottage_open_door: rts + ;================ + ; get + ;================ +lady_cottage_get: + lda CURRENT_NOUN + cmp #NOUN_BERRIES + beq lady_cottage_handle_berries + + jmp parse_common_get + + ;================ + ; search + ;================ +lady_cottage_search: + lda CURRENT_NOUN + + cmp #NOUN_BUSH + beq lady_cottage_handle_berries + + jmp parse_common_unknown + + + ;=================== + ; handle the bushes + ;=================== +lady_cottage_handle_berries: + + lda BUSH_STATUS + cmp #$f + bne try_bushes +already_got_trinket: + + ldx #lady_cottage_already_trinket_message + jmp finish_parse_message + +try_bushes: + ; sort of a quadrant + ; walks you over to the one in the quadrant + + lda PEASANT_X + cmp #15 + bcc left_bush +right_bush: + lda PEASANT_Y + cmp #$6D + bcc handle_bush4 + bcs handle_bush3 + +left_bush: + lda PEASANT_Y + cmp #$6D + bcc handle_bush2 + bcs handle_bush1 + + ; bottom left +handle_bush1: + lda BUSH_STATUS + and #BUSH_1_SEARCHED + bne bush_already_searched + + lda BUSH_STATUS + ora #BUSH_1_SEARCHED + bne actually_search_bush ; bra + + ; top left +handle_bush2: + lda BUSH_STATUS + and #BUSH_2_SEARCHED + bne bush_already_searched + + lda BUSH_STATUS + ora #BUSH_2_SEARCHED + bne actually_search_bush ; bra + + ; bottom right +handle_bush3: + lda BUSH_STATUS + and #BUSH_3_SEARCHED + bne bush_already_searched + + lda BUSH_STATUS + ora #BUSH_3_SEARCHED + bne actually_search_bush ; bra + + ; top right +handle_bush4: + lda BUSH_STATUS + and #BUSH_4_SEARCHED + bne bush_already_searched + + lda BUSH_STATUS + ora #BUSH_4_SEARCHED +; bne actually_search_bush ; bra + + +actually_search_bush: + sta BUSH_STATUS + tax + lda bush_count_lookup,X + cmp #1 + beq searched_1_bush + cmp #2 + beq searched_2_bush + cmp #3 + beq searched_3_bush + +searched_4_bush: + + ; add 2 points to score + + lda #2 + jsr score_points + + ; get trinket + + lda INVENTORY_2 + ora #INV2_TRINKET + sta INVENTORY_2 + + ldx #lady_cottage_searched_4_bushes_message + jmp finish_parse_message + +searched_1_bush: + ldx #lady_cottage_searched_1_bush_message + jmp finish_parse_message + +searched_2_bush: + ldx #lady_cottage_searched_2_bushes_message + jmp finish_parse_message + +searched_3_bush: + ldx #lady_cottage_searched_3_bushes_message + jmp finish_parse_message + +bush_already_searched: + ldx #lady_cottage_already_searched_message + jmp finish_parse_message + + + + ; probably a better way to do this? +bush_count_lookup: + .byte $00 ; 0000 + .byte $01 ; 0001 + .byte $01 ; 0010 + .byte $02 ; 0011 + .byte $01 ; 0100 + .byte $02 ; 0101 + .byte $02 ; 0110 + .byte $03 ; 0111 + .byte $01 ; 1000 + .byte $02 ; 1001 + .byte $02 ; 1010 + .byte $03 ; 1011 + .byte $02 ; 1100 + .byte $03 ; 1101 + .byte $03 ; 1110 + .byte $04 ; 1111 ;======================= diff --git a/games/peasant/text/peasant4.inc b/games/peasant/text/peasant4.inc index 8bf24420..0be57d37 100644 --- a/games/peasant/text/peasant4.inc +++ b/games/peasant/text/peasant4.inc @@ -265,23 +265,27 @@ lady_cottage_look_at_bushes_message: ; walks to nearest? ; + get berries (first bush) [walks to lower left] +lady_cottage_searched_1_bush_message: .byte "You reach into the bush to",13 .byte "snag some berries but",13 .byte "they all just squish in",13 .byte "your hand.",0 ; + get berries (second bush) [left] +lady_cottage_searched_2_bushes_message: .byte "Man, nothing in this bush",13 .byte "but squished berries",13 .byte "either.",0 ; + get berries (third bush) +lady_cottage_searched_3_bushes_message: .byte "Too bad you don't want any",13 .byte "squished berries, cuz hey:",13 .byte "jackpot!",0 ; +2 POINTS ; + get berries (fourth bush) +lady_cottage_searched_4_bushes_message: .byte "You reach into the bush to",13 .byte "snag you some berries but",13 .byte "instead find a Super",13 @@ -293,6 +297,7 @@ lady_cottage_look_at_bushes_message: ; + get berries (same twice) ; + search bush (same twice) +lady_cottage_already_searched_message: .byte "You already searched that",13 .byte "bush. It was okay. Nothing",13 .byte "to write home about... oh,",13 @@ -301,6 +306,7 @@ lady_cottage_look_at_bushes_message: ; + search bush (already found trinket) ; + get berries (already found trinket) +lady_cottage_already_trinket_message: .byte "You've searched your fill",13 .byte "of berry bushes for this",13 .byte "game. If you want to search",13 diff --git a/games/peasant/tokens.inc b/games/peasant/tokens.inc index a215e169..87a523a0 100644 --- a/games/peasant/tokens.inc +++ b/games/peasant/tokens.inc @@ -45,37 +45,38 @@ VERB_RIDE = 43 VERB_RING = 44 VERB_SAVE = 45 VERB_SCARE = 46 -VERB_SHOOT = 47 -VERB_SHOW = 48 -VERB_SIT = 49 -VERB_SKIP = 50 -VERB_SLEEP = 51 -VERB_SMELL = 52 -VERB_SNIFF = 53 -VERB_STEAL = 54 -VERB_SWIM = 55 -VERB_TAKE = 56 -VERB_TALK = 57 -VERB_THIS = 58 -VERB_THROW = 59 -VERB_TRY = 60 -VERB_TURN = 61 -VERB_USE = 62 -VERB_VERSION = 63 -VERB_WAKE = 64 -VERB_WEAR = 65 -VERB_WHAT = 66 -VERB_WHERE = 67 -VERB_WHY = 68 -VERB_YES = 69 -VERB_HELP = 70 -VERB_ATTACK = 71 -VERB_HUG = 72 -VERB_HIDE = 73 -VERB_MOVE = 74 -VERB_CUT = 75 -VERB_SAY = 76 -VERB_ALL_DONE = 77 ; not a verb, but indicating end, must be last +VERB_SEARCH = 47 +VERB_SHOOT = 48 +VERB_SHOW = 49 +VERB_SIT = 50 +VERB_SKIP = 51 +VERB_SLEEP = 52 +VERB_SMELL = 53 +VERB_SNIFF = 54 +VERB_STEAL = 55 +VERB_SWIM = 56 +VERB_TAKE = 57 +VERB_TALK = 58 +VERB_THIS = 59 +VERB_THROW = 60 +VERB_TRY = 61 +VERB_TURN = 62 +VERB_USE = 63 +VERB_VERSION = 64 +VERB_WAKE = 65 +VERB_WEAR = 66 +VERB_WHAT = 67 +VERB_WHERE = 68 +VERB_WHY = 69 +VERB_YES = 70 +VERB_HELP = 71 +VERB_ATTACK = 72 +VERB_HUG = 73 +VERB_HIDE = 74 +VERB_MOVE = 75 +VERB_CUT = 76 +VERB_SAY = 77 +VERB_ALL_DONE = 78 ; not a verb, but indicating end, must be last NOUN_NONE = 0 ; diff --git a/games/peasant/zp.inc b/games/peasant/zp.inc index 95a15305..6e0b8c85 100644 --- a/games/peasant/zp.inc +++ b/games/peasant/zp.inc @@ -147,7 +147,11 @@ GAME_STATE_2 = $99 NED_STATUS = $9A BUSH_STATUS = $9B ; status of bush search - + BUSH_1_SEARCHED = $01 + BUSH_2_SEARCHED = $02 + BUSH_3_SEARCHED = $04 + BUSH_4_SEARCHED = $08 + KERREK_STATE = $9C KERREK_ALIVE = $00 KERREK_DEAD = $01