diff --git a/ootw/dummy_friend.s b/ootw/dummy_friend.s index d62c46fc..fe332026 100644 --- a/ootw/dummy_friend.s +++ b/ootw/dummy_friend.s @@ -1,6 +1,13 @@ ; Include on levels where there is no friend +FAI_FOLLOWING = 0 +FAI_RUNTO_PANEL = 1 +FAI_OPENING_PANEL = 2 +FAI_DISINTEGRATING = 3 +FAI_END_L2 = 4 + + F_STANDING = 0 F_WALKING = 1 F_RUNNING = 2 @@ -10,7 +17,10 @@ F_KEYPAD = 5 F_OPEN_VENT = 6 F_DISINTEGRATING= 7 +friend_ai_state: friend_state: friend_x: +friend_gait: +.byte $00 friend_room: .byte $ff diff --git a/ootw/friend.s b/ootw/friend.s index 57ecd074..3d760326 100644 --- a/ootw/friend.s +++ b/ootw/friend.s @@ -11,7 +11,9 @@ friend_ai_state: .byte 0 FAI_FOLLOWING = 0 FAI_RUNTO_PANEL = 1 FAI_OPENING_PANEL = 2 -FAI_END_L2 = 3 +FAI_DISINTEGRATING = 3 +FAI_END_L2 = 4 + F_STANDING = 0 F_WALKING = 1 @@ -26,11 +28,13 @@ fai_table_lo: .byte friend_ai_following ; 00 .byte >friend_ai_runto_panel ; 01 .byte >friend_ai_opening_panel ; 02 + .byte >friend_ai_disintegrating ; 03 ;======================================= @@ -98,6 +102,7 @@ friend_ai_opening_panel: lda #F_KEYPAD sta friend_state +friend_ai_disintegrating: friend_ai_done: rts diff --git a/ootw/laser.s b/ootw/laser.s index 4294ded6..00b45fdb 100644 --- a/ootw/laser.s +++ b/ootw/laser.s @@ -225,61 +225,44 @@ done_move_laser: rts ;=================== - ; hit somthing, left + ; hit something, left ;=================== disable_laser_left: - lda #0 - sta laser0_out - lda LEFT_SHOOT_TARGET - beq done_disable_laser_left - - tax - and #$f0 - - cmp #TARGET_ALIEN - beq laser_alien_left - - jmp done_disable_laser_left - -laser_alien_left: - txa - and #$f - tax - - lda #A_DISINTEGRATING - sta alien_state,X - - lda #0 - sta alien_gait,X - - jmp done_lasering_left - -done_lasering_left: -done_disable_laser_left: - - rts - + jmp hit_something_common ;==================== - ; hit somthing, right + ; hit something, right ;==================== disable_laser_right: - lda #0 - sta laser0_out lda RIGHT_SHOOT_TARGET - beq done_disable_laser_right + + + ;====================== + ; hit something, common + ;====================== +hit_something_common: + + ; disable laser + ldx #0 + stx laser0_out tax and #$f0 cmp #TARGET_ALIEN - beq laser_alien_right + beq laser_hit_alien - jmp done_disable_laser_right + cmp #TARGET_FRIEND + beq laser_hit_friend + + ; FIXME: reduce shields if hit them? + + jmp done_hit_something + +laser_hit_alien: -laser_alien_right: txa and #$f tax @@ -290,11 +273,27 @@ laser_alien_right: lda #0 sta alien_gait,X - jmp done_lasering_right + jmp done_hit_something -done_lasering_right: -done_disable_laser_right: +laser_hit_friend: + + lda #F_DISINTEGRATING + sta friend_state + + lda #FAI_DISINTEGRATING + sta friend_ai_state + + lda #0 + sta friend_gait + + + +; jmp done_hit_something + +done_hit_something: rts + +