mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-25 09:29:35 +00:00
peasant: hook up mountain pass parsing
This commit is contained in:
parent
0bccb44c8a
commit
02c0799b69
|
@ -274,6 +274,7 @@ PEASANT2: peasant2.o
|
||||||
ld65 -o PEASANT2 peasant2.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
ld65 -o PEASANT2 peasant2.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
||||||
|
|
||||||
peasant2.o: peasant2.s zp.inc inventory.inc dialog_peasant2.inc \
|
peasant2.o: peasant2.s zp.inc inventory.inc dialog_peasant2.inc \
|
||||||
|
peasant2_actions.s \
|
||||||
graphics_peasantry/graphics_peasant2.inc sprites/peasant_sprites.inc \
|
graphics_peasantry/graphics_peasant2.inc sprites/peasant_sprites.inc \
|
||||||
graphics_peasantry/priority_peasant2.inc \
|
graphics_peasantry/priority_peasant2.inc \
|
||||||
sprites/inventory_sprites.inc \
|
sprites/inventory_sprites.inc \
|
||||||
|
|
|
@ -28,6 +28,8 @@ peasant2 18302
|
||||||
20493 -- more parse code (release 0.76)
|
20493 -- more parse code (release 0.76)
|
||||||
16995 -- move inventory to language card
|
16995 -- move inventory to language card
|
||||||
17122 -- add all verbs in (+), optimize text box drawing (-)
|
17122 -- add all verbs in (+), optimize text box drawing (-)
|
||||||
|
17918 -- text parsing nearing completion
|
||||||
|
18208 -- mountain pass parsing working
|
||||||
|
|
||||||
partial save, can we fit in 4k?
|
partial save, can we fit in 4k?
|
||||||
102 lines ; inventory was 115?
|
102 lines ; inventory was 115?
|
||||||
|
|
|
@ -1026,20 +1026,40 @@ unknown_loop:
|
||||||
;=========================
|
;=========================
|
||||||
; now add in common calls
|
; now add in common calls
|
||||||
|
|
||||||
ldx #0
|
lda #<common_verb_table
|
||||||
|
sta INL
|
||||||
|
lda #>common_verb_table
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
; jsr load_custom_verb_table
|
||||||
|
|
||||||
|
; rts
|
||||||
|
|
||||||
|
; Fallthrough
|
||||||
|
|
||||||
|
;=========================
|
||||||
|
;=========================
|
||||||
|
; load custom verb table
|
||||||
|
;=========================
|
||||||
|
;=========================
|
||||||
|
; verb table to load in INL/INH
|
||||||
|
load_custom_verb_table:
|
||||||
|
|
||||||
|
|
||||||
|
ldy #0
|
||||||
common_verb_loop:
|
common_verb_loop:
|
||||||
lda common_verb_table,X
|
lda (INL),Y
|
||||||
beq done_verb_loop ; 0 means done
|
beq done_verb_loop ; 0 means done
|
||||||
|
|
||||||
asl ; mul by 2
|
asl ; mul by 2
|
||||||
tay
|
tax
|
||||||
lda common_verb_table+1,X
|
iny
|
||||||
sta verb_table,Y
|
lda (INL),Y
|
||||||
lda common_verb_table+2,X
|
sta verb_table,X
|
||||||
sta verb_table+1,Y
|
iny
|
||||||
inx
|
lda (INL),Y
|
||||||
inx
|
sta verb_table+1,X
|
||||||
inx
|
iny
|
||||||
jmp common_verb_loop ; make this a bne (bra)?
|
jmp common_verb_loop ; make this a bne (bra)?
|
||||||
|
|
||||||
done_verb_loop:
|
done_verb_loop:
|
||||||
|
@ -1119,4 +1139,4 @@ common_verb_table:
|
||||||
.word parse_common_why-1
|
.word parse_common_why-1
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
.include "dialog_peasant2.inc"
|
|
||||||
|
|
|
@ -29,6 +29,16 @@ peasant_quest:
|
||||||
|
|
||||||
jsr update_map_location
|
jsr update_map_location
|
||||||
|
|
||||||
|
; load updated verb table
|
||||||
|
|
||||||
|
lda #<mountain_pass_verb_table
|
||||||
|
sta INL
|
||||||
|
lda #>mountain_pass_verb_table
|
||||||
|
sta INH
|
||||||
|
jsr load_custom_verb_table
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; update score
|
; update score
|
||||||
|
|
||||||
jsr update_score
|
jsr update_score
|
||||||
|
@ -248,3 +258,5 @@ map_priority_hi:
|
||||||
;.incbin "DIALOG_PEASANT2.LZSA"
|
;.incbin "DIALOG_PEASANT2.LZSA"
|
||||||
|
|
||||||
;.include "dialog_peasant2.inc"
|
;.include "dialog_peasant2.inc"
|
||||||
|
|
||||||
|
.include "peasant2_actions.s"
|
||||||
|
|
228
games/peasant/peasant2_actions.s
Normal file
228
games/peasant/peasant2_actions.s
Normal file
|
@ -0,0 +1,228 @@
|
||||||
|
;.include "tokens.inc"
|
||||||
|
|
||||||
|
|
||||||
|
;=======================
|
||||||
|
;=======================
|
||||||
|
;=======================
|
||||||
|
; mountain pass
|
||||||
|
;=======================
|
||||||
|
;=======================
|
||||||
|
;=======================
|
||||||
|
|
||||||
|
mountain_pass_verb_table:
|
||||||
|
.byte VERB_ASK
|
||||||
|
.word mountain_pass_ask-1
|
||||||
|
.byte VERB_ATTACK
|
||||||
|
.word mountain_pass_attack-1
|
||||||
|
.byte VERB_BREAK
|
||||||
|
.word mountain_pass_break-1
|
||||||
|
.byte VERB_LOOK
|
||||||
|
.word mountain_pass_look-1
|
||||||
|
.byte VERB_TALK
|
||||||
|
.word mountain_pass_talk-1
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
|
||||||
|
;================
|
||||||
|
; ask
|
||||||
|
;================
|
||||||
|
mountain_pass_ask:
|
||||||
|
lda CURRENT_NOUN
|
||||||
|
|
||||||
|
cmp #NOUN_FIRE
|
||||||
|
beq ask_about_fire
|
||||||
|
cmp #NOUN_JHONKA
|
||||||
|
beq ask_about_jhonka
|
||||||
|
cmp #NOUN_KERREK
|
||||||
|
beq ask_about_kerrek
|
||||||
|
cmp #NOUN_NED
|
||||||
|
beq ask_about_ned
|
||||||
|
cmp #NOUN_ROBE
|
||||||
|
beq ask_about_robe
|
||||||
|
cmp #NOUN_SMELL
|
||||||
|
beq ask_about_smell
|
||||||
|
cmp #NOUN_TROGDOR
|
||||||
|
beq ask_about_trogdor
|
||||||
|
|
||||||
|
; else ask about unknown
|
||||||
|
|
||||||
|
ask_about_unknown:
|
||||||
|
ldx #<knight_ask_unknown_message
|
||||||
|
ldy #>knight_ask_unknown_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_fire:
|
||||||
|
ldx #<knight_ask_fire_message
|
||||||
|
ldy #>knight_ask_fire_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_jhonka:
|
||||||
|
ldx #<knight_ask_jhonka_message
|
||||||
|
ldy #>knight_ask_jhonka_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_kerrek:
|
||||||
|
ldx #<knight_ask_kerrek_message
|
||||||
|
ldy #>knight_ask_kerrek_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_ned:
|
||||||
|
ldx #<knight_ask_ned_message
|
||||||
|
ldy #>knight_ask_ned_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_robe:
|
||||||
|
ldx #<knight_ask_robe_message
|
||||||
|
ldy #>knight_ask_robe_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_smell:
|
||||||
|
ldx #<knight_ask_smell_message
|
||||||
|
ldy #>knight_ask_smell_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
ask_about_trogdor:
|
||||||
|
ldx #<knight_ask_trogdor_message
|
||||||
|
ldy #>knight_ask_trogdor_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;================
|
||||||
|
; attack
|
||||||
|
;================
|
||||||
|
mountain_pass_break:
|
||||||
|
mountain_pass_attack:
|
||||||
|
lda CURRENT_NOUN
|
||||||
|
cmp #NOUN_SIGN
|
||||||
|
beq attack_sign
|
||||||
|
|
||||||
|
jmp parse_common_unknown
|
||||||
|
|
||||||
|
attack_sign:
|
||||||
|
ldx #<attack_sign_message
|
||||||
|
ldy #>attack_sign_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
|
||||||
|
;=================
|
||||||
|
; look
|
||||||
|
;=================
|
||||||
|
|
||||||
|
mountain_pass_look:
|
||||||
|
|
||||||
|
lda CURRENT_NOUN
|
||||||
|
|
||||||
|
cmp #NOUN_KNIGHT
|
||||||
|
beq knight_look
|
||||||
|
cmp #NOUN_MAN
|
||||||
|
beq knight_look
|
||||||
|
cmp #NOUN_DUDE
|
||||||
|
beq knight_look
|
||||||
|
cmp #NOUN_GUY
|
||||||
|
beq knight_look
|
||||||
|
|
||||||
|
cmp #NOUN_SIGN
|
||||||
|
beq sign_look
|
||||||
|
cmp #NOUN_TROGDOR
|
||||||
|
beq trogdor_look
|
||||||
|
cmp #NOUN_NONE
|
||||||
|
beq pass_look
|
||||||
|
|
||||||
|
jmp parse_common_look
|
||||||
|
|
||||||
|
knight_look:
|
||||||
|
ldx #<knight_look_message
|
||||||
|
ldy #>knight_look_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
pass_look:
|
||||||
|
ldx #<pass_look_message
|
||||||
|
ldy #>pass_look_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
sign_look:
|
||||||
|
ldx #<sign_look_message
|
||||||
|
ldy #>sign_look_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
trogdor_look:
|
||||||
|
ldx #<trogdor_look_message
|
||||||
|
ldy #>trogdor_look_message
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; talk
|
||||||
|
;===================
|
||||||
|
|
||||||
|
mountain_pass_talk:
|
||||||
|
|
||||||
|
lda CURRENT_NOUN
|
||||||
|
cmp #NOUN_KNIGHT
|
||||||
|
beq talk_to_knight
|
||||||
|
cmp #NOUN_GUY
|
||||||
|
beq talk_to_knight
|
||||||
|
cmp #NOUN_MAN
|
||||||
|
beq talk_to_knight
|
||||||
|
cmp #NOUN_DUDE
|
||||||
|
beq talk_to_knight
|
||||||
|
|
||||||
|
; else, no one
|
||||||
|
jmp parse_common_talk
|
||||||
|
|
||||||
|
talk_to_knight:
|
||||||
|
|
||||||
|
lda GAME_STATE_2
|
||||||
|
and #TALKED_TO_KNIGHT
|
||||||
|
bne knight_skip_text
|
||||||
|
|
||||||
|
; first time only
|
||||||
|
ldx #<talk_knight_first_message
|
||||||
|
ldy #>talk_knight_first_message
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
; first time only
|
||||||
|
ldx #<talk_knight_second_message
|
||||||
|
ldy #>talk_knight_second_message
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
knight_skip_text:
|
||||||
|
ldx #<talk_knight_third_message
|
||||||
|
ldy #>talk_knight_third_message
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
ldx #<talk_knight_stink_message
|
||||||
|
ldy #>talk_knight_stink_message
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
ldx #<talk_knight_dress_message
|
||||||
|
ldy #>talk_knight_dress_message
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
ldx #<talk_knight_fire_message
|
||||||
|
ldy #>talk_knight_fire_message
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
ldx #<talk_knight_fourth_message
|
||||||
|
ldy #>talk_knight_fourth_message
|
||||||
|
|
||||||
|
lda GAME_STATE_2
|
||||||
|
and #TALKED_TO_KNIGHT
|
||||||
|
bne knight_skip_text2
|
||||||
|
|
||||||
|
jsr partial_message_step
|
||||||
|
|
||||||
|
; first time only
|
||||||
|
ldx #<talk_knight_fifth_message
|
||||||
|
ldy #>talk_knight_fifth_message
|
||||||
|
|
||||||
|
lda GAME_STATE_2
|
||||||
|
ora #TALKED_TO_KNIGHT
|
||||||
|
sta GAME_STATE_2
|
||||||
|
|
||||||
|
knight_skip_text2:
|
||||||
|
jmp finish_parse_message
|
||||||
|
|
||||||
|
|
||||||
|
.include "dialog_peasant2.inc"
|
Loading…
Reference in New Issue
Block a user