diff --git a/games/peasant/NOTES b/games/peasant/NOTES index 4a65a285..cff7b085 100644 --- a/games/peasant/NOTES +++ b/games/peasant/NOTES @@ -36,6 +36,7 @@ peasant2 18302 17368 -- use lookup table for next room (and other changes) 17780 -- size as of the switch to dictionary word lookup 18012 -- hook up more of archery + 18120 -- finish hooking up archery partial save, can we fit in 4k? 102 lines ; inventory was 115? @@ -186,8 +187,9 @@ POINTS IMPLEMENTED: (in order of implementation) + 2 (fall in mud puddle) + 2 (give trinket to brothers) + 2 (get super trinket) ++ 3 (win archery game) ====== - 54 points + 57 points deaths/endings implemented diff --git a/games/peasant/archery.s b/games/peasant/archery.s index 763d0893..6a1b63dc 100644 --- a/games/peasant/archery.s +++ b/games/peasant/archery.s @@ -95,6 +95,15 @@ game_loop: jsr wait_until_keypress +; lda #$30 ; got 0 of 3 +; lda #$31 ; got 1 of 3 + lda #$33 ; got 3 of 3 + sta ARROW_SCORE + + lda ARROW_SCORE + ora #ARROW_DONE + sta ARROW_SCORE + lda #LOCATION_ARCHERY jmp update_map_location @@ -123,6 +132,9 @@ game_loop: ; exit level ;************************ game_over: + lda ARROW_SCORE + ora #ARROW_DONE + sta ARROW_SCORE rts diff --git a/games/peasant/peasant2.s b/games/peasant/peasant2.s index 45d71e95..02b4ceca 100644 --- a/games/peasant/peasant2.s +++ b/games/peasant/peasant2.s @@ -146,6 +146,79 @@ new_location: jsr draw_peasant + + ;===================== + ; special archery + ;===================== + + lda ARROW_SCORE + bpl game_loop + + ; coming back from archery game + + and #$7f ; unset + sta ARROW_SCORE + + and #$f ; see if score (bottom) is 0 + beq arrow_game_zero + + sta TEMP0 + + lda ARROW_SCORE + lsr + lsr + lsr + lsr + cmp TEMP0 + bne arrow_game_lost + +arrow_game_won: + ; get 3 points + lda #3 + jsr score_points + + ; get bow + lda INVENTORY_1 + ora #INV1_BOW + sta INVENTORY_1 + + ; set won + lda GAME_STATE_0 + ora #ARROW_BEATEN + sta GAME_STATE_0 + + lda TEMP0 + clc + adc #'0' + sta archery_won_message+14 + + ldx #archery_won_message + jsr partial_message_step + jmp game_loop + +arrow_game_zero: + ldx #archery_zero_message + jsr partial_message_step + jmp arrow_game_lose_common + +arrow_game_lost: + lda TEMP0 + clc + adc #'0' + sta archery_some_message+24 ; urgh affected by compression + + ldx #archery_some_message + jsr partial_message_step + +arrow_game_lose_common: + ldx #archery_lose_message + jsr partial_message_step + + game_loop: jsr move_peasant diff --git a/games/peasant/peasant2_actions.s b/games/peasant/peasant2_actions.s index 37a2353d..d1c6fc0c 100644 --- a/games/peasant/peasant2_actions.s +++ b/games/peasant/peasant2_actions.s @@ -625,6 +625,10 @@ archery_play_game2: lda #LOCATION_ARCHERY_GAME jsr update_map_location + ; FIXME: make random + lda #$30 + sta ARROW_SCORE + rts diff --git a/games/peasant/text/peasant2.inc b/games/peasant/text/peasant2.inc index 9ba613c2..7b15ce4c 100644 --- a/games/peasant/text/peasant2.inc +++ b/games/peasant/text/peasant2.inc @@ -387,6 +387,7 @@ archery_get_arrow_message: ; (get [X]=3-5 bullseyes) +archery_won_message: .byte 34,"Nice shootin! 3 hits.",34,13 .byte "Says Mendelev. ",34,"Here's",13 .byte "your prize!",34," You got the",13 @@ -398,6 +399,7 @@ archery_get_arrow_message: ; BEAT GAME = +3 POINTS ; get bow +archery_zero_message: .byte 34,"Sorry!",34," says",13 .byte "Dongolev.",34,"Not a single",13 .byte "hit. Your game face must be",13 @@ -405,6 +407,7 @@ archery_get_arrow_message: .byte "back when your shipment",13 .byte "comes in.",0 +archery_some_message: .byte 34,"Sorry!",34," says",13 .byte "Dongolev.",34,"Only 1",13 .byte "hit. Your game face must be",13 @@ -412,6 +415,7 @@ archery_get_arrow_message: .byte "back when your shipment",13 .byte "comes in.",0 +archery_lose_message: .byte 34,"But since you gave us this",13 .byte "trinket, and you obviously",13 .byte "don't have a prayer of",13 diff --git a/games/peasant/zp.inc b/games/peasant/zp.inc index 6e0b8c85..fa7050aa 100644 --- a/games/peasant/zp.inc +++ b/games/peasant/zp.inc @@ -102,6 +102,7 @@ APPLEII_MODEL = $8B ESC_PRESSED = $8C PREVIOUS_LOCATION= $8D + ;======================= ; savegame state ;======================= @@ -158,6 +159,7 @@ KERREK_STATE = $9C KERREK_DECOMPOSING = $02 KERREK_SKELETON = $03 ARROW_SCORE = $9D ; bottom=score, top=random num needed 3-5? + ARROW_DONE = $80 SCORE_HUNDREDS = $9E SCORE_TENSONES = $9F