Note quirk with alien guardian and boss heart HP

This commit is contained in:
Michael Miceli 2023-06-19 12:39:55 -04:00
parent def22881be
commit 7fbde5318c
2 changed files with 18 additions and 7 deletions

View File

@ -169,6 +169,10 @@ heart can be.
(PLAYER_WEAPON_STRENGTH * 16) + 55 + (GAME_COMPLETION_COUNT * 16) (PLAYER_WEAPON_STRENGTH * 16) + 55 + (GAME_COMPLETION_COUNT * 16)
``` ```
Note if `PLAYER_WEAPON_STRENGTH * 16` is larger than 255, then the results will
wrap around. So sometimes the HP is actually lower than a previous playthrough
where `GAME_COMPLETION_COUNT` was lower. This occurs every 16 loops.
| Completion Count | Result (hex) | Result (decimal) | | Completion Count | Result (hex) | Result (decimal) |
|------------------|--------------|------------------| |------------------|--------------|------------------|
| 0 | #$67 | 103 | | 0 | #$67 | 103 |
@ -177,5 +181,13 @@ heart can be.
| 3 | #$97 | 151 | | 3 | #$97 | 151 |
| 4 | #$a0 | 160 | | 4 | #$a0 | 160 |
| 5 | #$a0 | 160 | | 5 | #$a0 | 160 |
| ... | ... | ... |
| 15 | #$a0 | 160 |
| 16 | #$67 | 103 |
| 17 | #$77 | 119 |
| 18 | #$87 | 135 |
| 19 | #$97 | 151 |
| 20 | #$a0 | 160 |
| 21 | #$a0 | 160 |
All sample results assume the player's `PLAYER_WEAPON_STRENGTH` is 3 (S weapon). All sample results assume the player's `PLAYER_WEAPON_STRENGTH` is 3 (S weapon).

View File

@ -8938,14 +8938,14 @@ alien_guardian_routine_00:
set_guardian_and_heart_enemy_hp: set_guardian_and_heart_enemy_hp:
jsr set_game_completion_10x ; $07 = #$10 * GAME_COMPLETION_COUNT jsr set_game_completion_10x ; $07 = #$10 * GAME_COMPLETION_COUNT
lda PLAYER_WEAPON_STRENGTH ; load player's weapon strength lda PLAYER_WEAPON_STRENGTH ; load player's weapon strength
jsr mv_low_nibble_to_high ; move low nibble into high nibble, setting low nibble to all 0 jsr mv_low_nibble_to_high ; move low nibble into high nibble, setting low nibble to all 0, i.e. PLAYER_WEAPON_STRENGTH * #$10
clc ; clear carry in preparation for addition clc ; clear carry in preparation for addition
adc #$37 ; add #$37 to a adc #$37 ; add #$37 to a
bcs @set_max_hp bcs @set_max_hp ; if this caused an overflow set HP to #$a0
adc $07 adc $07 ; no overflow occurred, add (#$10 * GAME_COMPLETION_COUNT)
bcs @set_max_hp bcs @set_max_hp ; if this caused an overflow set HP to #$a0
cmp #$a0 cmp #$a0 ; see if sum is larger than #$a0
bcc @set_enemy_hp bcc @set_enemy_hp ; branch if sum is smaller than #$a0 to set sum to result; otherwise use max HP of #$a0
@set_max_hp: @set_max_hp:
lda #$a0 ; a = #$a0 (max hp) lda #$a0 ; a = #$a0 (max hp)
@ -9921,7 +9921,6 @@ alien_spider_set_ground_vel_and_routine:
jmp set_enemy_routine_to_a ; set routine to alien_spider_routine_03 jmp set_enemy_routine_to_a ; set routine to alien_spider_routine_03
; alien spider hp = weapon strength + completion count + 2 ; alien spider hp = weapon strength + completion count + 2
;
set_alien_spider_hp_sprite_attr: set_alien_spider_hp_sprite_attr:
lda PLAYER_WEAPON_STRENGTH ; load player weapon strength lda PLAYER_WEAPON_STRENGTH ; load player weapon strength
adc GAME_COMPLETION_COUNT ; add with the number of times the game has been completed adc GAME_COMPLETION_COUNT ; add with the number of times the game has been completed