From 30d20a92fa0c69b194227053bf81482a5219a55c Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 11 Aug 2019 19:12:57 -0400 Subject: [PATCH] ootw: l3: steam collisions happen now --- ootw/ootw_c3_vent.s | 98 ++++++++++++++++++- .../sprites/physicist_rolling.inc | 4 + 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/ootw/ootw_c3_vent.s b/ootw/ootw_c3_vent.s index 838a9c22..e2699e88 100644 --- a/ootw/ootw_c3_vent.s +++ b/ootw/ootw_c3_vent.s @@ -420,6 +420,24 @@ draw_fell_stop: ; dead/poisoned draw_poisoned: + lda PHYSICIST_X + sta XPOS + lda PHYSICIST_Y + and #$fe + sta YPOS + + lda GAIT + lsr + lsr + and #$fe + tay + + lda rolling_poison_progression,Y + sta INL + lda rolling_poison_progression+1,Y + jmp actually_draw + + ; rolling draw_rolling: @@ -455,13 +473,18 @@ actually_draw: inc FRAMEH vent_frame_no_oflo: - lda VENT_DEATH beq no_death_count inc VENT_END_COUNT no_death_count: + ;========================== + ; check if steamed + ;========================== + + jsr steam_collide + ;========================== ; check if done this level ;========================== @@ -626,6 +649,14 @@ steam2_off: .byte 36 steam3_off: .byte 36 steam4_off: .byte 36 +steam_on: +steam1_on: .byte 0 +steam2_on: .byte 0 +steam3_on: .byte 0 +steam4_on: .byte 0 + + + ;============================== ; handle steam @@ -696,6 +727,9 @@ draw_steam_on: and #$6 tay + lda #1 + sta steam_on,X + lda puff_cycle_progression,Y sta INL lda puff_cycle_progression+1,Y @@ -708,14 +742,18 @@ draw_steam_stop: lda puff_end_progression,Y sta INL lda puff_end_progression+1,Y -; jmp steam_draw + ; fallthrough steam_draw: sta INH jsr put_sprite + jmp steam_done draw_steam_off: + lda #0 + sta steam_on,X + steam_done: pla tax @@ -723,3 +761,59 @@ steam_done: bpl steam_draw_loop rts + + + + + + ;============================== + ; steam_collide + ;============================== +steam_collide: + + ldx #3 +steam_collide_loop: + + lda steam_on,X ; skip if no steam out + beq steam_loop_continue + + lda PHYSICIST_Y + cmp steam_y,X + bne steam_loop_continue + + ; collide if + ; = + ; 0UUU physicist+3=X + ; 0UUU physicist+2=X + ; 0UUU physicist+1=X + + clc + lda PHYSICIST_X + adc #1 + + cmp steam_x,X + beq steamed + + adc #1 + + cmp steam_x,X + beq steamed + + adc #1 + + cmp steam_x,X + beq steamed + + +steam_loop_continue: + dex + bpl steam_collide_loop + + +not_steamed: + rts + +steamed: + lda #2 + sta VENT_DEATH + rts diff --git a/ootw/ootw_graphics/sprites/physicist_rolling.inc b/ootw/ootw_graphics/sprites/physicist_rolling.inc index 72fd5378..3fc5b52f 100644 --- a/ootw/ootw_graphics/sprites/physicist_rolling.inc +++ b/ootw/ootw_graphics/sprites/physicist_rolling.inc @@ -50,6 +50,10 @@ rolling8: .byte $AA,$AA,$99,$99,$B4 .byte $AA,$AA,$99,$99,$BB +rolling_poison_progression: +.word poisoned1 +.word poisoned2 +.word poisoned3 poisoned1: .byte 8,2