From 7a23da4520cf9cbfa6cea3f4878ea32fc74e1a74 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 14 Dec 2021 00:41:58 -0500 Subject: [PATCH] peasant: more hooking up of Trogdor --- games/peasant/Makefile | 2 +- games/peasant/NOTES | 3 +- games/peasant/parse_input.s | 2 + games/peasant/text/trogdor.inc | 22 ++++-- games/peasant/tokens.inc | 6 +- games/peasant/trogdor.s | 7 ++ games/peasant/trogdor_actions.s | 114 +++++++++++++++++++++++++++++++- 7 files changed, 145 insertions(+), 11 deletions(-) diff --git a/games/peasant/Makefile b/games/peasant/Makefile index fd484ff5..5857a907 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -650,7 +650,7 @@ DIALOG_TROGDOR.LZSA: dialog_trogdor dialog_trogdor: dialog_trogdor.o ld65 -o dialog_trogdor dialog_trogdor.o -C ../../linker_scripts/apple2_d000.inc -dialog_trogdor.o: dialog_trogdor.s text/cliff.inc +dialog_trogdor.o: dialog_trogdor.s text/trogdor.inc ca65 -o dialog_trogdor.o dialog_trogdor.s -l dialog_trogdor.lst ### diff --git a/games/peasant/NOTES b/games/peasant/NOTES index f160616c..14c5a635 100644 --- a/games/peasant/NOTES +++ b/games/peasant/NOTES @@ -205,8 +205,9 @@ POINTS IMPLEMENTED: (in order of implementation) + 3 (wear robe) + 2 (get grease) + 10 (catch on fire) ++ 7 (throw sword at trogdor) ====== - 122 points + 129 points deaths/endings implemented diff --git a/games/peasant/parse_input.s b/games/peasant/parse_input.s index 56e845fc..65c184f2 100644 --- a/games/peasant/parse_input.s +++ b/games/peasant/parse_input.s @@ -842,6 +842,7 @@ verb_lookup: .byte "SHOW",VERB_SHOW|$80 .byte "SIT",VERB_SIT|$80 .byte "SKIP",VERB_SKIP|$80 +.byte "SLAY",VERB_SLAY|$80 .byte "SLEEP",VERB_SLEEP|$80 .byte "SMELL",VERB_SMELL|$80 .byte "SNIFF",VERB_SNIFF|$80 @@ -1033,6 +1034,7 @@ noun_lookup_again: .byte "DOING",NOUN_DOING_SPROINGS|$80 .byte "DONGOLEV",NOUN_DONGOLEV|$80 .byte "DOOR",NOUN_DOOR|$80 +.byte "DRAGON",NOUN_DRAGON|$80 .byte "DRAWER",NOUN_DRAWER|$80 .byte "DRESSER",NOUN_DRESSER|$80 .byte "DUDE",NOUN_DUDE|$80 diff --git a/games/peasant/text/trogdor.inc b/games/peasant/text/trogdor.inc index be24ce1e..39a14710 100644 --- a/games/peasant/text/trogdor.inc +++ b/games/peasant/text/trogdor.inc @@ -10,13 +10,22 @@ .byte "Maybe next time don't get",13 .byte "too close.",0 +; + (enter Trogdor's cave) +trogdor_entry_message: +.byte "The beaded curtain slams",13 +.byte "shut behind you. There's no",13 +.byte "turning back now.",0 + + ; + look +trogdor_look_message: .byte "You're in a giant cavern",13 .byte "which houses a giant",13 .byte "dragon. You didn't shrink",13 .byte "or anything.",0 ; + look dragon/trogdor (while he's asleep) +trogdor_look_trogdor_message: .byte "Holy crap! Trogdor's way",13 .byte "bigger in person than he",13 .byte "looks in most tapestries",13 @@ -25,12 +34,8 @@ .byte "cottage doesn't seem so bad",13 .byte "anymore.",0 -; + (enter Trogdor's cave) -.byte "The beaded curtain slams",13 -.byte "shut behind you. There's no",13 -.byte "turning back now.",0 - ; + wake up trogdor +trogdor_wake_message: .byte 34,"Troggie...",34,", you murmur.",13 .byte 34,"Troggie, wake up it's time",13 .byte "for Burnination school.",34,13 @@ -38,16 +43,20 @@ ; + attack trogdor (when he's asleep) ; + kill / slay trogdor (while Trogdor's asleep, in his lair) +trogdor_attack_message: .byte "Like how?",0 ; + talk trogdor (while he's asleep) +trogdor_talk_message: .byte "You yell some choice",13 .byte "expletives at Trogdor but",13 .byte "he doesn't wake up. There's",13 .byte "a cool echo, though.",0 + ; +7 POINTS ; + throw sword +trogdor_throw_sword_message: .byte "This is it! You hurl the",13 .byte "Trog-Sword with all your",13 .byte "might at the sleeping",13 @@ -55,11 +64,13 @@ ; walks over, throws, animation +trogdor_throw_sword_message2: .byte "Now you've done it!",13 .byte "Trogdor's awake and the",13 .byte "Trog-Sword doesn't seem to",13 .byte "be doing a whole lot.",0 +trogdor_throw_sword_message3: .byte "Your legs lock in fear,",13 .byte "your eyes glaze over and",13 .byte "you wish for some Depeasant",13 @@ -67,6 +78,7 @@ .byte "you think you hear Trogdor",13 .byte "whimpering!",0 +trogdor_throw_sword_message4: .byte "Aw crap, that's you",13 .byte "whimpering. At least your",13 .byte "voice still works, I guess.",0 diff --git a/games/peasant/tokens.inc b/games/peasant/tokens.inc index c604f120..dec8e439 100644 --- a/games/peasant/tokens.inc +++ b/games/peasant/tokens.inc @@ -76,7 +76,8 @@ 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 +VERB_SLAY = 78 +VERB_ALL_DONE = 79 ; not a verb, but indicating end, must be last NOUN_NONE = 0 ; @@ -198,5 +199,6 @@ NOUN_SHIRT = 115 NOUN_SHIELD = 116 NOUN_SWORD = 117 NOUN_HELM = 118 +NOUN_DRAGON = 119 ; -NOUN_UNKNOWN = 119 +NOUN_UNKNOWN = 120 diff --git a/games/peasant/trogdor.s b/games/peasant/trogdor.s index 08cccb5a..5351d787 100644 --- a/games/peasant/trogdor.s +++ b/games/peasant/trogdor.s @@ -109,6 +109,13 @@ new_location: jsr update_top + ;=========================== + ; intro message + + ldx #trogdor_entry_message + jsr finish_parse_message + game_loop: ; jsr move_peasant diff --git a/games/peasant/trogdor_actions.s b/games/peasant/trogdor_actions.s index 636d6e79..54109b4d 100644 --- a/games/peasant/trogdor_actions.s +++ b/games/peasant/trogdor_actions.s @@ -1,3 +1,5 @@ +.include "tokens.inc" + ;======================= ;======================= ;======================= @@ -7,11 +9,119 @@ ;======================= trogdor_inner_verb_table: -; .byte VERB_LOOK -; .word cliff_base_look-1 + .byte VERB_ATTACK + .word trogdor_attack-1 + .byte VERB_KILL + .word trogdor_attack-1 + .byte VERB_SLAY + .word trogdor_attack-1 + .byte VERB_LOOK + .word trogdor_look-1 + .byte VERB_WAKE + .word trogdor_wake-1 + .byte VERB_TALK + .word trogdor_talk-1 + .byte VERB_THROW + .word trogdor_throw-1 .byte 0 +trogdor_look: + lda CURRENT_NOUN + cmp #NOUN_NONE + beq trogdor_look_at + cmp #NOUN_DRAGON + beq trogdor_look_trogdor + cmp #NOUN_TROGDOR + beq trogdor_look_trogdor + + jmp parse_common_look + +trogdor_look_at: + ldx #trogdor_look_message + jmp finish_parse_message + +trogdor_look_trogdor: + ldx #trogdor_look_trogdor_message + jmp finish_parse_message + + +trogdor_wake: + lda CURRENT_NOUN + cmp #NOUN_DRAGON + beq trogdor_wake_trogdor + cmp #NOUN_TROGDOR + beq trogdor_wake_trogdor + + jmp parse_common_unknown + +trogdor_wake_trogdor: + ldx #trogdor_wake_message + jmp finish_parse_message + +trogdor_attack: + lda CURRENT_NOUN + cmp #NOUN_DRAGON + beq trogdor_attack_trogdor + cmp #NOUN_TROGDOR + beq trogdor_attack_trogdor + + jmp parse_common_unknown + +trogdor_attack_trogdor: + ldx #trogdor_attack_message + jmp finish_parse_message + + +trogdor_talk: + lda CURRENT_NOUN + cmp #NOUN_DRAGON + beq trogdor_talk_trogdor + cmp #NOUN_TROGDOR + beq trogdor_talk_trogdor + + jmp parse_common_talk + +trogdor_talk_trogdor: + ldx #trogdor_talk_message + jmp finish_parse_message + + +trogdor_throw: + lda CURRENT_NOUN + cmp #NOUN_SWORD + beq trogdor_throw_sword + + jmp parse_common_unknown + +trogdor_throw_sword: + ldx #trogdor_throw_sword_message + jsr partial_message_step + + lda #7 + jsr score_points + + ldx #trogdor_throw_sword_message2 + jsr partial_message_step + + ldx #trogdor_throw_sword_message3 + jsr partial_message_step + + ldx #trogdor_throw_sword_message4 + jmp finish_parse_message + + + + trogdor_cave: