diff --git a/ootw/ootw_cavern.s b/ootw/ootw_cavern.s index 167b883c..54b5a7ee 100644 --- a/ootw/ootw_cavern.s +++ b/ootw/ootw_cavern.s @@ -142,6 +142,42 @@ done_shake: lda SLUGDEATH beq still_alive +collapsing: + lda SLUGDEATH_PROGRESS + cmp #18 + bmi still_collapsing + +really_dead: + lda #$ff + sta GAME_OVER + jmp just_slugs + + +still_collapsing: + tax + + lda collapse_progression,X + sta INL + lda collapse_progression+1,X + sta INH + + lda PHYSICIST_X + sta XPOS + lda PHYSICIST_Y + sec + sbc EARTH_OFFSET + sta YPOS + + jsr put_sprite + + lda FRAMEL + and #$1f + bne no_collapse_progress + + inc SLUGDEATH_PROGRESS + inc SLUGDEATH_PROGRESS +no_collapse_progress: + jmp just_slugs @@ -368,6 +404,7 @@ draw_slugs: ; see if attack + lda PHYSICIST_X sec sbc slugg0_x ; -2 to +2 @@ -376,9 +413,16 @@ draw_slugs: and #$fc bne no_attack attack: + ; FIXME: make slug stand up if in range + + lda SLUGDEATH ; don't re-attack if already dead + bne no_attack + lda #$1 sta SLUGDEATH - ; FIXME: make slug stand up + lda #0 + sta SLUGDEATH_PROGRESS + no_attack: inc slugg0_gait ; increment slug gait counter diff --git a/ootw/ootw_sprites.inc b/ootw/ootw_sprites.inc index e16a681b..9cc6b161 100644 --- a/ootw/ootw_sprites.inc +++ b/ootw/ootw_sprites.inc @@ -109,8 +109,10 @@ collapse_progression: .word collapse3 .word collapse4 .word collapse5 - .word collapse5 - .word collapse5 + .word collapse5 ; 6 + .word collapse5 ; 7 + .word collapse5 ; 8 + .word collapse5 ; 9 collapse1: .byte $4,$8 diff --git a/ootw/zp.inc b/ootw/zp.inc index 66576da7..c174e0ce 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -165,7 +165,9 @@ DIRECTION = $F5 GAIT = $F6 TENTACLE_X = $F7 TENTACLE_PROGRESS = $F8 +SLUGDEATH_PROGRESS = $F8 TENTACLE_GRAB = $F9 +SLUGDEATH = $F9 TEMP = $FA TEMPY = $FB INL = $FC