From aa5a06a7d5c1dc101feaef437c18f8c15e96c76b Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 22 Aug 2019 13:20:10 -0400 Subject: [PATCH] ootw: can now get shot by aliens --- ootw/TODO | 3 ++- ootw/collision.s | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ ootw/laser.s | 3 +++ ootw/physicist.s | 4 +-- 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/ootw/TODO b/ootw/TODO index e403d8ba..05d03560 100644 --- a/ootw/TODO +++ b/ootw/TODO @@ -2,7 +2,8 @@ TODO Before release: ==================== - l2/l4 -- have aliens shoot + l2/l4 -- let physicist get show + l2/l4 -- balance alien shooting behavior l2 -- move doors to final behavior (break room one needs to be locked) diff --git a/ootw/collision.s b/ootw/collision.s index 1a114176..58500ba6 100644 --- a/ootw/collision.s +++ b/ootw/collision.s @@ -248,6 +248,38 @@ calc_gun_right_friend_continue: done_calc_gun_right_friend_collision: + ;========================== + ; adjust for physicist + +calc_gun_right_physicist: + + lda COLLISION_X + cmp PHYSICIST_X + bcs calc_gun_right_physicist_continue ; bge + + ; only if closer than previous found + lda RIGHT_SHOOT_LIMIT + cmp PHYSICIST_X + bcc calc_gun_right_physicist_continue ; blt + + lda PHYSICIST_STATE + cmp #P_DISINTEGRATING + beq calc_gun_right_physicist_continue + +calc_gun_right_physicist_there: + + lda PHYSICIST_X + sta RIGHT_SHOOT_LIMIT + + ; set target if hit + lda #TARGET_PHYSICIST + sta RIGHT_SHOOT_TARGET + +calc_gun_right_physicist_continue: +done_calc_gun_right_physicist_collision: + + + ;========================== ; adjust for alien @@ -459,6 +491,40 @@ calc_gun_left_friend_continue: done_calc_gun_left_friend_collision: + + ;========================== + ; adjust for physicist + +calc_gun_left_physicist: + + lda COLLISION_X + cmp PHYSICIST_X + beq calc_gun_left_physicist_continue ; ble (not w self) + bcc calc_gun_left_physicist_continue ; blt + + ; only if closer than previous found + lda LEFT_SHOOT_LIMIT + cmp PHYSICIST_X + bcs calc_gun_left_physicist_continue ; bge + + lda PHYSICIST_STATE + cmp #P_DISINTEGRATING + beq calc_gun_left_physicist_continue + +calc_gun_left_physicist_there: + + lda PHYSICIST_X + sta LEFT_SHOOT_LIMIT + ; set target if hit + lda #TARGET_PHYSICIST + sta LEFT_SHOOT_TARGET + +calc_gun_left_physicist_continue: +done_calc_gun_left_physicist_collision: + + + + ;========================== ; adjust for alien diff --git a/ootw/laser.s b/ootw/laser.s index cc0a96bf..f514e981 100644 --- a/ootw/laser.s +++ b/ootw/laser.s @@ -304,6 +304,9 @@ hit_something_common: cmp #TARGET_FRIEND beq laser_hit_friend + cmp #TARGET_PHYSICIST + beq laser_hit_physicist + ; FIXME: reduce shields if hit them? jmp done_hit_something diff --git a/ootw/physicist.s b/ootw/physicist.s index 9e5b9f9b..a868b734 100644 --- a/ootw/physicist.s +++ b/ootw/physicist.s @@ -420,7 +420,7 @@ no_collapse_progress: physicist_disintegrating: lda GAIT - cmp #18 + cmp #28 bne disintegrate_not_done disintegrate_really_dead: @@ -438,7 +438,7 @@ disintegrate_not_done: sta INH lda FRAMEL - and #$1f + and #$7 bne no_disintegrate_progress inc GAIT