From b62f2318682cfe956dc1956342dc24f1964fb4f4 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 27 Nov 2021 01:36:40 -0500 Subject: [PATCH] peasant: can now get riches and also the baby --- games/peasant/Makefile | 1 + games/peasant/NOTES | 10 ++-- games/peasant/parse_input.s | 2 + games/peasant/peasant3.s | 24 +++++++++ games/peasant/peasant3_actions.s | 92 ++++++++++++++++++++++++++------ games/peasant/text/peasant3.inc | 14 +++-- 6 files changed, 118 insertions(+), 25 deletions(-) diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 85f1f65d..de0ac417 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -504,6 +504,7 @@ parse_input.inc: generate_common parse_input ./generate_common -a 0xee00 -s parse_common_load parse_input.lst >> parse_input.inc ./generate_common -a 0xee00 -s parse_common_save parse_input.lst >> parse_input.inc ./generate_common -a 0xee00 -s get_noun_again parse_input.lst >> parse_input.inc + ./generate_common -a 0xee00 -s parse_input_smc parse_input.lst >> parse_input.inc ### diff --git a/games/peasant/NOTES b/games/peasant/NOTES index 25e39077..a080d8e4 100644 --- a/games/peasant/NOTES +++ b/games/peasant/NOTES @@ -191,8 +191,9 @@ POINTS IMPLEMENTED: (in order of implementation) + 10 (get belt) + 5 (kill kerrek) + 7 (talk to knight once have belt, robe, and on fire) ++ 7 (get riches from jhonka) ====== - 79 points + 86 points deaths/endings implemented @@ -200,7 +201,8 @@ deaths/endings implemented +1 Typing "die" +2 Beating the game +3 Cutting off arms, legs, and head -+4 kick/punch/kill old gary -+5 get arrow (while dongolev shooting) -+6 walk on range (while dongolev shooting) ++4 kick/punch/kill Old Gary ++5 get arrow (while Dongolev shooting) ++6 walk on range (while Dongolev shooting) +7 walk too close to Kerrek ++8 say "yes" when Jhonka asks if you stole riches diff --git a/games/peasant/parse_input.s b/games/peasant/parse_input.s index 8207cf51..dea28a18 100644 --- a/games/peasant/parse_input.s +++ b/games/peasant/parse_input.s @@ -41,6 +41,8 @@ done_upcase_loop: jsr get_noun +parse_input_smc: + nop ;================================ ; jump into verb table diff --git a/games/peasant/peasant3.s b/games/peasant/peasant3.s index 02144a79..b837de3d 100644 --- a/games/peasant/peasant3.s +++ b/games/peasant/peasant3.s @@ -140,6 +140,30 @@ new_location: jsr draw_peasant + + ;======================= + ; before game text + + lda MAP_LOCATION + cmp #LOCATION_JHONKA_CAVE + bne no_before_game_text + + ; at jhonka cave + + ; check to see if in hay + + lda GAME_STATE_1 + and #IN_HAY_BALE + beq no_before_game_text + + ldx #jhonka_in_hay_message + jsr finish_parse_message + + +no_before_game_text: + + game_loop: jsr move_peasant diff --git a/games/peasant/peasant3_actions.s b/games/peasant/peasant3_actions.s index 2cafa110..62c62359 100644 --- a/games/peasant/peasant3_actions.s +++ b/games/peasant/peasant3_actions.s @@ -64,7 +64,23 @@ jhonka_get: ; check if alive lda KERREK_STATE and #$f - beq jhonka_get_kerrek_alive + bne jhonka_get_kerrek_dead + +jhonka_get_kerrek_alive: + + lda CURRENT_NOUN + + cmp #NOUN_NOTE + beq jhonka_get_note + + ; else "probably wish" message + jmp parse_common_get + +jhonka_get_note: + ldx #jhonka_get_note_message + jmp finish_parse_message + jhonka_get_kerrek_dead: @@ -94,15 +110,72 @@ jhonka_get_riches_no_hay: jmp finish_parse_message jhonka_get_riches_in_hay: - ; TODO: see if in hay ldx #jhonka_steal_riches_message + jsr partial_message_step - ; TODO: points, etc +jhonka_wait_for_answer: + jsr clear_bottom + jsr hgr_input + lda #$60 ; modify parse input to return + sta parse_input_smc ; rather than verb-jump + + jsr parse_input + + lda CURRENT_VERB + cmp #VERB_NO + beq jhonka_verb_no + cmp #VERB_YES + beq jhonka_verb_yes + + ldx #jhonka_answer_him_message + jsr partial_message_step + + jmp jhonka_wait_for_answer + +jhonka_verb_no: + ; restore parse_message + lda #$EA + sta parse_input_smc + + ; get riches + + lda INVENTORY_2 + ora #INV2_RICHES + sta INVENTORY_2 + + ; add 7 points + lda #7 + jsr score_points + + ldx #jhonka_no_message jmp finish_parse_message +jhonka_verb_yes: + ; restore parse_message + lda #$EA + sta parse_input_smc + + ; this kills you + lda #LOAD_GAME_OVER + sta WHICH_LOAD + + lda #NEW_FROM_DISK + sta LEVEL_OVER + + ldx #jhonka_yes_message + jsr partial_message_step + + ldx #jhonka_yes_message2 + jmp finish_parse_message + + jhonka_get_club: ldx #jhonka_get_club_message @@ -110,20 +183,7 @@ jhonka_get_club: -jhonka_get_kerrek_alive: - lda CURRENT_NOUN - - cmp #NOUN_NOTE - beq jhonka_get_note - - ; else "probably wish" message - jmp parse_common_get - -jhonka_get_note: - ldx #jhonka_get_note_message - jmp finish_parse_message ;================= diff --git a/games/peasant/text/peasant3.inc b/games/peasant/text/peasant3.inc index 48543873..8e1f940e 100644 --- a/games/peasant/text/peasant3.inc +++ b/games/peasant/text/peasant3.inc @@ -4,8 +4,8 @@ peasant3_dialog_start: ; Jhonka cave ;============= -; TODO ; + (walk in haystack) +jhonka_in_hay_message: .byte "Hey, nice disguise! The",13 .byte "Jhonka doesn't seem to",13 .byte "notice you.",0 @@ -156,30 +156,33 @@ jhonka_steal_riches_message: .byte "riches?!",34," growls the",13 .byte "Jhonka.",0 -; TODO + ; + 7 POINTS ; + no +jhonka_no_message: .byte 34,"Okay. Lemme know if you",13 .byte "see riches anywhere,",34," he",13 .byte "grunts and goes back to his",13 .byte "hopping. You smooth",13 .byte "talker, you.",0 -; TODO ; + yes (to the Jhonka when he asks you about his riches) +jhonka_yes_message: .byte 34,"I KILL YOU!!",34," screams the",13 .byte "Jhonka.",0 + ; {The Jhonka clubs you to death} (Warning: Obviously, you will die.) +jhonka_yes_message2: .byte "Club or turkey leg, the",13 .byte "Jhonka sure just beat you",13 .byte "senseless with whatever he",13 .byte "was holding. You dead.",13 .byte "Thanks for playing!",0 -; TODO ; + Type any command other than "yes" or "no" ; after the Jhonka asks if you stole the riches ; you can't walk while waiting here +jhonka_answer_him_message: .byte "Just answer him, yes or no,",13 .byte "you fool!",0 @@ -241,7 +244,8 @@ jhonka_give_message: ; + talk jhonka (while inside the hay) jhonka_talk_in_hay_message: -.byte "Not now! You'll blow your cover!",0 +.byte "Not now! You'll blow your",13 +.byte "cover!",0 ; + talk ; + talk jhonka (jhonka there, not in hay)