diff options
author | Astatin <[email protected]> | 2025-08-27 17:04:54 +0200 |
---|---|---|
committer | Astatin <[email protected]> | 2025-08-27 17:04:54 +0200 |
commit | 09a173d2f1123b6ac203c247094c312473705802 (patch) | |
tree | 83be7ff3a2f804492a9edc7b7234399f12d11534 | |
parent | fb897a615f65af2ff99dc6070067262c809a2ac4 (diff) |
Fix health not updated on death, fix penguin freeze not working on bunny blink, fix entity initial spawn
-rw-r--r-- | enemiesattacks/freeze.gbasm | 2 | ||||
-rw-r--r-- | entity/init.gbasm | 33 | ||||
-rw-r--r-- | modes/dialoguemenu.gbasm | 15 | ||||
-rw-r--r-- | modes/dungeon.gbasm | 22 | ||||
-rw-r--r-- | modes/dungeongeneration.gbasm | 1 |
5 files changed, 40 insertions, 33 deletions
diff --git a/enemiesattacks/freeze.gbasm b/enemiesattacks/freeze.gbasm index 666206e..db58a04 100644 --- a/enemiesattacks/freeze.gbasm +++ b/enemiesattacks/freeze.gbasm @@ -56,7 +56,7 @@ Freeze_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D POP BC RET Z - LD A, $mem_bunny_flags + LD A, $mem_bunny_status CP $00 RET NZ diff --git a/entity/init.gbasm b/entity/init.gbasm index c67d782..173bf32 100644 --- a/entity/init.gbasm +++ b/entity/init.gbasm @@ -32,11 +32,11 @@ Initialize_Entities: LD A, $00 LD $tmp_var_3, A - CALL =Initialize_Enemy - CALL =Initialize_Enemy - CALL =Initialize_Enemy - CALL =Initialize_Enemy - CALL =Initialize_Enemy + CALL =Spawn_Entity + CALL =Spawn_Entity + CALL =Spawn_Entity + CALL =Spawn_Entity + CALL =Spawn_Entity LD A, $tmp_var_1 LD $mem_bunny_current_room_idx, A @@ -137,8 +137,6 @@ Initialize_Entity: ; HL => pointer to entity struct, A => entity loaded index, 1 CALL =Carve_Entity_Collision_Map - POP BC - ; Direction LD A, $33 LD (HL+), A @@ -213,27 +211,28 @@ FindFreeEntity: JR NZ, =FindFreeEntity.loop RET -Respawn_Entities: - LD A, $mem_dungeon_flags - BIT 2, A - RET Z - +Maybe_Respawn_Entity: LD A, $mem_moving_animation_step CP $04 RET NZ + CALL =RNG_Step + AND $07 + CP $00 + RET NZ + LD A, $mem_enemies_alive_count CP $05 RET NC +Spawn_Entity: + LD A, $mem_dungeon_flags + BIT 2, A + RET Z + LD A, $00 LD $tmp_var_3, A - CALL =RNG_Step - AND $07 - CP $00 - RET NZ - CALL =FindFreeEntity CALL =Initialize_Enemy diff --git a/modes/dialoguemenu.gbasm b/modes/dialoguemenu.gbasm index 126495b..76d7470 100644 --- a/modes/dialoguemenu.gbasm +++ b/modes/dialoguemenu.gbasm @@ -18,12 +18,25 @@ Dialogue_VBLANK_Entrypoint: LD $reg_lyc, A .top_bar.end: - CALL $OAM_DMA_Transfer_routine + LD A, $mem_current_mode + CP $enum_dead_mode + JR NZ, =.update_health_mana.end + LD HL, $9d60 + LD A, $mem_bunny_health + CALL =Print_8bit + + LD HL, $9d64 + LD A, $mem_bunny_mana + CALL =Print_8bit + .update_health_mana.end: + CALL =Dialogue_Arrow_Animation CALL =Copy_Dialogue_Buffer CALL =Display_dialogue_cursor + CALL $OAM_DMA_Transfer_routine + ; LYC LD A, $0a LD $reg_lyc, A diff --git a/modes/dungeon.gbasm b/modes/dungeon.gbasm index 0386a5f..ae9d052 100644 --- a/modes/dungeon.gbasm +++ b/modes/dungeon.gbasm @@ -163,20 +163,16 @@ Dungeon_VBLANK_Entrypoint: CALL $OAM_DMA_Transfer_routine - LD A, $mem_current_mode - BIT 7, A - JR NZ, =Skip_VBlank_Dungeon_Update - LD HL, $9d60 - LD A, $mem_bunny_health - CALL =Print_8bit + LD HL, $9d60 + LD A, $mem_bunny_health + CALL =Print_8bit - LD HL, $9d64 - LD A, $mem_bunny_mana - CALL =Print_8bit + LD HL, $9d64 + LD A, $mem_bunny_mana + CALL =Print_8bit - CALL =Display_Prepared_Blocks - CALL =Display_Object - Skip_VBlank_Dungeon_Update: + CALL =Display_Prepared_Blocks + CALL =Display_Object ; LYC .ENABLE_LYC_INTERRUPT @@ -192,7 +188,7 @@ Dungeon_VBLANK_Entrypoint: CALL =Entities_Actions CALL =Object_Interactions_Check - CALL =Respawn_Entities + CALL =Maybe_Respawn_Entity CALL =Prepare_Scrolling_Map Skip_Dungeon_Update: diff --git a/modes/dungeongeneration.gbasm b/modes/dungeongeneration.gbasm index dc6fd8a..08643c5 100644 --- a/modes/dungeongeneration.gbasm +++ b/modes/dungeongeneration.gbasm @@ -145,7 +145,6 @@ New_Floor: CALL =Dungeon_Generation CALL =Initialize_Entities CALL =Initialize_Objects - .map.end: ; Reset animations |