From d7150059db53f402e710e0b2035d475cef9b992d Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 20 Oct 2021 11:39:34 -0400 Subject: [PATCH] peasant: hook up text in river/stone level --- games/peasant/parse_input.s | 2 + games/peasant/peasant2.s | 40 +++++++++--- games/peasant/peasant2_actions.s | 102 +++++++++++++++++++++++++++++++ games/peasant/text/peasant2.inc | 9 ++- games/peasant/tokens.inc | 4 +- 5 files changed, 146 insertions(+), 11 deletions(-) diff --git a/games/peasant/parse_input.s b/games/peasant/parse_input.s index 7663c2f2..943b9c8e 100644 --- a/games/peasant/parse_input.s +++ b/games/peasant/parse_input.s @@ -893,6 +893,8 @@ noun_lookup: .byte "WELL",NOUN_WELL|$80 .byte "WINDOW",NOUN_WINDOW|$80 .byte "WOMAN",NOUN_WOMAN|$80 +.byte "RIVER",NOUN_RIVER|$80 +.byte "STONE",NOUN_STONE|$80 .byte $00 diff --git a/games/peasant/peasant2.s b/games/peasant/peasant2.s index 347774fb..170b14ec 100644 --- a/games/peasant/peasant2.s +++ b/games/peasant/peasant2.s @@ -29,14 +29,6 @@ peasant_quest: jsr update_map_location - ; load updated verb table - - lda #mountain_pass_verb_table - sta INH - jsr load_custom_verb_table - ; update score @@ -53,6 +45,23 @@ new_location: lda #0 sta GAME_OVER + ;========================== + ; load updated verb table + + ; we are PEASANT2 so locations 5...9 map to 0...4 + + lda MAP_LOCATION + sec + sbc #5 + tax + + lda verb_tables_low,X + sta INL + lda verb_tables_hi,X + sta INH + jsr load_custom_verb_table + + ;===================== ; load bg @@ -252,6 +261,21 @@ map_priority_hi: .byte >river_priority_lzsa ; 8 -- river .byte >knight_priority_lzsa ; 9 -- knight +verb_tables_low: + .byte river_stone_verb_table ; 5 -- haystack + .byte >river_stone_verb_table ; 6 -- puddle + .byte >river_stone_verb_table ; 7 -- archery + .byte >river_stone_verb_table ; 8 -- river + .byte >mountain_pass_verb_table ; 9 -- knight + + ;peasant2_text_lzsa: diff --git a/games/peasant/peasant2_actions.s b/games/peasant/peasant2_actions.s index 31dbfb78..6bff3c27 100644 --- a/games/peasant/peasant2_actions.s +++ b/games/peasant/peasant2_actions.s @@ -1,6 +1,108 @@ ;.include "tokens.inc" + ;======================= + ;======================= + ;======================= + ; River and Stone + ;======================= + ;======================= + ;======================= + +river_stone_verb_table: + .byte VERB_GET + .word river_stone_get-1 + .byte VERB_LOOK + .word river_stone_look-1 + .byte VERB_STEAL + .word river_stone_steal-1 + .byte VERB_SWIM + .word river_stone_swim-1 + .byte VERB_TAKE + .word river_stone_take-1 + .byte 0 + + + ;================ + ; get + ;================ +river_stone_steal: +river_stone_take: +river_stone_get: + lda CURRENT_NOUN + + cmp #NOUN_ROCK + beq river_get_rock + cmp #NOUN_STONE + beq river_get_rock + + ; else "probably wish" message + + jmp parse_common_get + +river_get_rock: + ldx #river_get_rock_message + jmp finish_parse_message + + ;================= + ; look + ;================= + +river_stone_look: + + lda CURRENT_NOUN + + cmp #NOUN_ROCK + beq river_look_at_rock + cmp #NOUN_STONE + beq river_look_at_rock + cmp #NOUN_WATER + beq river_look_at_water + cmp #NOUN_RIVER + beq river_look_at_water + cmp #NOUN_NONE + beq river_look_at + + jmp parse_common_look + +river_look_at: + ldx #river_look_message + jmp finish_parse_message + +river_look_at_rock: + ldx #river_look_at_rock_message + jmp finish_parse_message + +river_look_at_water: + ldx #river_look_at_water_message + jmp finish_parse_message + + + + ;=================== + ; swim + ;=================== + +river_stone_swim: + + lda CURRENT_NOUN + + cmp #NOUN_WATER + beq river_swim + cmp #NOUN_RIVER + beq river_swim + + jmp parse_common_unknown + +river_swim: + ldx #river_swim_message + jmp finish_parse_message + ;======================= ;======================= ;======================= diff --git a/games/peasant/text/peasant2.inc b/games/peasant/text/peasant2.inc index 644d4eb0..0816fbb9 100644 --- a/games/peasant/text/peasant2.inc +++ b/games/peasant/text/peasant2.inc @@ -194,22 +194,27 @@ ;================= ; + look +river_look_message: .byte "Not much to see. River's",13 .byte "got a rock in it.",0 -; + look water +; + look water/river +river_look_at_water_message: .byte "Got a rock in it.",0 -; + look rock +; + look rock/stone +river_look_at_rock_message: .byte "The ages have worn this",13 .byte "rock down. It is a rock of",13 .byte "ages. Still a-rollin.",0 ; + swim river/water +river_swim_message: .byte "Peasants can't swim. Like,",13 .byte "it's illegal.",0 ; + get/take/steal rock +river_get_rock_message: .byte "For what? Now you're just",13 .byte "making up puzzles to solve.",0 diff --git a/games/peasant/tokens.inc b/games/peasant/tokens.inc index bd64a865..07447fb9 100644 --- a/games/peasant/tokens.inc +++ b/games/peasant/tokens.inc @@ -169,5 +169,7 @@ NOUN_WATERFALL = 92 NOUN_WELL = 93 NOUN_WINDOW = 94 NOUN_WOMAN = 95 +NOUN_RIVER = 96 +NOUN_STONE = 97 ; -NOUN_UNKNOWN = 96 +NOUN_UNKNOWN = 98