From 6317d01c6126626d96d700648d8570bcc53e14e9 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 14 Dec 2021 23:34:30 -0500 Subject: [PATCH] peasant: hook up missing parts of ending --- games/peasant/new_game.s | 1 + games/peasant/text/trogdor.inc | 9 +- games/peasant/trogdor_actions.s | 183 ++++++++++++++++++++----- games/peasant/trogdor_speech.s | 228 +++++++++++++++++++++++++++++--- games/peasant/zp.inc | 15 ++- 5 files changed, 382 insertions(+), 54 deletions(-) diff --git a/games/peasant/new_game.s b/games/peasant/new_game.s index e9e5224b..d3cd1286 100644 --- a/games/peasant/new_game.s +++ b/games/peasant/new_game.s @@ -118,6 +118,7 @@ start_new_game: sta GAME_STATE_0 sta GAME_STATE_1 sta GAME_STATE_2 + sta GAME_STATE_3 sta NED_STATUS sta BUSH_STATUS sta KERREK_STATE diff --git a/games/peasant/text/trogdor.inc b/games/peasant/text/trogdor.inc index de9f20e1..80cfcdf7 100644 --- a/games/peasant/text/trogdor.inc +++ b/games/peasant/text/trogdor.inc @@ -98,7 +98,8 @@ trogdor_throw_sword_message4: ;====================================== ;====================================== -; Type any command other than "Talk" or "Talk Trogdor" after Trogdor wakes up +; any command except talk/look +trogdor_awake_message: .byte "Trogdor is awake and a",13 .byte "couple seconds from a",13 .byte "Rather Dashing BBQ. Might",13 @@ -106,6 +107,7 @@ trogdor_throw_sword_message4: .byte "him.",0 ; + look dragon/trogdor (when he's awake) +trogdor_look_awake_message: .byte "Trogdor is looming",13 .byte "menacingly over you with a",13 .byte "tiny wee sword stuck in his",13 @@ -114,20 +116,23 @@ trogdor_throw_sword_message4: ; +10 POINTS ; + talk trogdor +end_talk_message: .byte "You scream that your name",13 .byte "is Rather Dashing and that",13 .byte "Trogdor burninated your",13 .byte "cottage and you're here for",13 .byte "revenge!",0 +trogdor_sup_message: .byte 34,"Sup, mortal,",34," booms",13 .byte "Trogdor. ",34,"I really",13 .byte "appreciate you making the",13 .byte "effort to come all the way",13 -.byte "up here to vanquish me and",13 ; and vanquish me ? +.byte "up here and vanquish me and",13 .byte "all. But, I'm kinda",13 .byte "indestructible.",34,0 +trogdor_surprised_message: .byte 34,"Yeah, I can't be killed.",13 .byte "I'm surprised nobody",13 .byte "mentioned that to you. I'll",13 diff --git a/games/peasant/trogdor_actions.s b/games/peasant/trogdor_actions.s index 54109b4d..34343c42 100644 --- a/games/peasant/trogdor_actions.s +++ b/games/peasant/trogdor_actions.s @@ -27,6 +27,7 @@ trogdor_inner_verb_table: trogdor_look: + lda CURRENT_NOUN cmp #NOUN_NONE beq trogdor_look_at @@ -49,6 +50,7 @@ trogdor_look_trogdor: trogdor_wake: + lda CURRENT_NOUN cmp #NOUN_DRAGON beq trogdor_wake_trogdor @@ -117,13 +119,65 @@ trogdor_throw_sword: ldx #trogdor_throw_sword_message4 - jmp finish_parse_message + jsr partial_message_step + + ;============================== + ; now we can no longer move + ; you have about 10s or so to say "look" or "talk" + ; otherwise it continues to the ending + + jsr clear_bottom + lda #$60 ; modify parse input to return + sta parse_input_smc ; rather than verb-jump + lda #$FF + sta BABY_COUNT + +trogdor_awake_loop: + + lda #120 + jsr wait + + lda KEYPRESS + bpl awake_no_keypress + + jsr clear_bottom + jsr hgr_input + + jsr parse_input + + lda CURRENT_VERB + cmp #VERB_LOOK + bne awake_check_talk +awake_looking: + ldx #trogdor_look_awake_message + jsr partial_message_step + jmp awake_try_again + +awake_check_talk: + cmp #VERB_TALK + beq awake_talk_trogdor + +awake_default: + ldx #trogdor_awake_message + jsr partial_message_step + +awake_try_again: + jsr clear_bottom + +awake_no_keypress: + dec BABY_COUNT + bne trogdor_awake_loop + ; we timed out! Skip to burnination + jmp burninate_rather_dashing -trogdor_cave: + +awake_talk_trogdor: lda #end_talk_message + jsr partial_message_step + + ;============================== + ;============================== + ; print sup message + ;============================== + ;============================== + + ldx #trogdor_sup_message + jsr finish_parse_message_nowait + + lda #trogdor_sup + sta SPEECH_PTRH + + jsr trogdor_talks + + + ;============================== + ;============================== + ; print surprised message + ;============================== + ;============================== + + ldx #trogdor_surprised_message + jsr finish_parse_message_nowait + + lda #trogdor_honestly + sta SPEECH_PTRH + + jsr trogdor_talks + + ;============================== ;============================== @@ -164,37 +260,14 @@ trogdor_cave: ldy #>trogdor_honestly_message jsr finish_parse_message_nowait - ;================================== - ; text to speech, where available! - lda SOUND_STATUS - and #SOUND_SSI263 - beq skip_speech - -speech_loop: - - ; trogdor - - lda #4 ; assume slot #4 for now - jsr ssi263_speech_init lda #trogdor_honestly sta SPEECH_PTRH - jsr ssi263_speak - -wait_for_speech: - lda speech_busy - bmi wait_for_speech - bpl done_speech - -skip_speech: - jsr wait_until_keypress - -done_speech: - jsr hgr_partial_restore + jsr trogdor_talks ;============================== @@ -207,12 +280,13 @@ done_speech: ldy #>trogdor_honestly_message2 jsr finish_parse_message - ; UPDATE SCORE lda #$10 ; it's BCD jsr score_points +burninate_rather_dashing: + trogdor_open: lda #