diff options
author | Astatin <[email protected]> | 2025-05-15 15:42:26 +0200 |
---|---|---|
committer | Astatin <[email protected]> | 2025-05-15 15:42:26 +0200 |
commit | a1dad7db479d8203df30a649a688f7351b667d8e (patch) | |
tree | 66c878c78365d87f7b37a2ea506c1e1979e0d536 | |
parent | ef9de76cd0bc313385b7edac3659e03ab36d3c1e (diff) |
Fix some bugs owl found
-rw-r--r-- | TODO | 7 | ||||
-rw-r--r-- | enemiesattacks/freeze.gbasm | 4 | ||||
-rw-r--r-- | enemiesattacks/poison.gbasm | 4 | ||||
-rw-r--r-- | enemiesattacks/walk.gbasm | 48 | ||||
-rw-r--r-- | entity/bunny.gbasm | 12 | ||||
-rw-r--r-- | entity/questgoal.gbasm | 18 | ||||
-rw-r--r-- | map/dungeons.gbasm | 2 | ||||
-rw-r--r-- | playerattacks.gbasm | 9 | ||||
-rw-r--r-- | playerattacks/earcoptr.gbasm | 31 | ||||
-rw-r--r-- | playerattacks/freeze.gbasm | 36 | ||||
-rw-r--r-- | playerattacks/heal.gbasm | 2 |
11 files changed, 100 insertions, 73 deletions
@@ -1,4 +1,11 @@ Bugs: + x - Cancel attack breaks enemy facing direction + x - Heal at max should cancel + x - Off screen lasers + x - Path finding in tunnel + - Object loading after being in view + - Kill before or after attack ? + x - Bugs health underflow when attacked Accessibility issues: -> freeze/earcopter attack patterns are not obvious (either needs to be shown on map or add select menu with infos if not possible + tutorial to explain the existence of select menu ?) diff --git a/enemiesattacks/freeze.gbasm b/enemiesattacks/freeze.gbasm index 86e47d9..cdf5afc 100644 --- a/enemiesattacks/freeze.gbasm +++ b/enemiesattacks/freeze.gbasm @@ -56,6 +56,10 @@ Freeze_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D POP BC RET Z + LD A, $mem_bunny_flags + CP $00 + RET NZ + LD A, $01 LD $mem_bunny_status, A LD A, $02 diff --git a/enemiesattacks/poison.gbasm b/enemiesattacks/poison.gbasm index 807eae3..8970571 100644 --- a/enemiesattacks/poison.gbasm +++ b/enemiesattacks/poison.gbasm @@ -56,6 +56,10 @@ Poison_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D POP BC RET Z + LD A, $mem_bunny_flags + CP $00 + RET NZ + LD A, $08 LD $mem_bunny_status, A diff --git a/enemiesattacks/walk.gbasm b/enemiesattacks/walk.gbasm index a11b32f..1bc762b 100644 --- a/enemiesattacks/walk.gbasm +++ b/enemiesattacks/walk.gbasm @@ -1,3 +1,20 @@ +.MACRODEF INVERT_AXIS + PUSH AF + LD A, $tmp_var_3 + CP $00 + JR Z, =$skip_invert_axis + LD A, B + LD B, C + LD C, A + LD A, D + DEC A + XOR $02 + INC A + LD D, A + $skip_invert_axis: + POP AF +.END + Walking: ; entity XY in BC, Breaks E, Direction result in D ; Is Bunny close enough to follow LD A, $mem_bunny_x @@ -41,20 +58,18 @@ Walking: ; entity XY in BC, Breaks E, Direction result in D AND $02 LD $tmp_var_3, A + .INVERT_AXIS + + LD A, $tmp_var_3 CP $00 - JR Z, =.skip_invert_axis + JR Z, =.skip_invert_target_axis LD A, $mem_bunny_predicted_y LD $tmp_var_1, A LD A, $mem_bunny_predicted_x LD $tmp_var_2, A - - LD E, B - LD B, C - LD C, E - - .skip_invert_axis: + .skip_invert_target_axis: ; Choose direction LD A, B @@ -74,17 +89,15 @@ Walking: ; entity XY in BC, Breaks E, Direction result in D .Check_Horizontal_Collision: LD E, A - DEC E - LD A, $tmp_var_3 - XOR E - INC E - INC A OR $08 PUSH BC + PUSH DE LD D, A + .INVERT_AXIS LD A, $01 .ADD_A_TO_DIRECTION_BC CALL =Is_Collisionable + POP DE POP BC CP $00 LD A, E @@ -110,8 +123,6 @@ Walking: ; entity XY in BC, Breaks E, Direction result in D DEC A LD E, A - LD A, $tmp_var_3 - XOR E INC A OR $08 LD D, A @@ -119,13 +130,8 @@ Walking: ; entity XY in BC, Breaks E, Direction result in D ; Check collision .No_movement: - LD A, $tmp_var_3 - CP $00 - JR Z, =.skip_invert_axis2 - LD E, B - LD B, C - LD C, E - .skip_invert_axis2: + + .INVERT_AXIS LD A, D AND $07 diff --git a/entity/bunny.gbasm b/entity/bunny.gbasm index 3806df4..7520720 100644 --- a/entity/bunny.gbasm +++ b/entity/bunny.gbasm @@ -191,6 +191,8 @@ Move_Bunny: LD A, D LD $mem_bunny_direction, A + LD A, $00 + LD $mem_bunny_animation, A BIT 3, D JR Z, =.Start_action_or_movement.end @@ -240,7 +242,11 @@ Move_Bunny: LD A, (HL) DEC A DAA - LD (HL+), A + JR C, =.skip_update_health + LD (HL), A + + .skip_update_health: + INC HL SET 3, (HL) LD A, $24 @@ -451,7 +457,7 @@ Center_viewport_around_entity: ; Entity pointer in HL LD B, A LD A, (HL) - SUB $04 + SUB $05 LD $mem_viewport_y, A LD A, (HL+) @@ -480,7 +486,7 @@ Center_viewport_around_entity: ; Entity pointer in HL LD A, C SWAP A AND $f0 - SUB $38 + SUB $48 LD C, A LD A, E diff --git a/entity/questgoal.gbasm b/entity/questgoal.gbasm index 445f56c..64cd745 100644 --- a/entity/questgoal.gbasm +++ b/entity/questgoal.gbasm @@ -38,6 +38,10 @@ Open_Dialogue: LD (HL), $enum_direction_up JR =.Check_end .Check_end: + LD A, (HL) + SWAP A + OR (HL) + LD (HL), A .START_SCRIPT =Demo_quest_bunny @@ -78,19 +82,7 @@ QuestGoal_Turn: CALL =Walking.Random_walker .Start_action_or_movement.end: - .End_movement: - LD A, $mem_moving_animation_step - CP $0f - JP NZ, =.End_movement.end - LD A, D - AND $07 - BIT 3, D - LD D, A - JR Z, =.End_movement.end - LD A, $01 - .ADD_A_TO_DIRECTION_BC - - .End_movement.end: + CALL =Entity_End_movement .Skip_Turn: LD A, L diff --git a/map/dungeons.gbasm b/map/dungeons.gbasm index 5fb5a2c..27a84a7 100644 --- a/map/dungeons.gbasm +++ b/map/dungeons.gbasm @@ -88,6 +88,8 @@ Dungeon: .name: .DB =Dungeon_Name_1_Txt .max_floor: .DB 0x0a, inv(0x0a) .spawning_patterns: + .DB $entity_cat_index, $entity_cat_index, $entity_cat_index, $entity_fimsh_index, 0b11111111 + .DB $entity_cat_index, $entity_cat_index, $entity_cat_index, $entity_fimsh_index, 0b00000010 .DB $entity_cat_index, $entity_cat_index, $entity_penguin_index, $entity_fimsh_index, 0b00100011 .DB $entity_cat_index, $entity_cat_index, $entity_fox_index, $entity_fimsh_index, 0b00100111 diff --git a/playerattacks.gbasm b/playerattacks.gbasm index 1d937b9..4847c4c 100644 --- a/playerattacks.gbasm +++ b/playerattacks.gbasm @@ -36,9 +36,12 @@ Canceled_Attack: ADD $13 LD L, A Reset_Entities_Animations.loop: - LD A, (HL) - AND $07 - LD (HL), A + RES 3, (HL) + LD A, L + AND $f0 + ADD $0a + LD L, A + LD (HL), $00 Reset_Entities_Animations.loop.next: LD A, L AND $f0 diff --git a/playerattacks/earcoptr.gbasm b/playerattacks/earcoptr.gbasm index ef6a4b5..721692e 100644 --- a/playerattacks/earcoptr.gbasm +++ b/playerattacks/earcoptr.gbasm @@ -1,24 +1,13 @@ Earcoptr_Attack_Loading_VBlank: - LD A, $mem_loading_step - INC A - AND $1f - LD $mem_loading_step, A - CP $00 - RET NZ - - LD A, $enum_dungeon_mode - LD $mem_current_mode, A - LD $mem_requested_mode, A - CALL =Update_VBlank_Handler - LD A, $mem_map_loading_flags - SET 3, A - LD $mem_map_loading_flags, A RET Earcoptr_Attack_Loading_Regular: LD A, $mem_loading_step + INC A + AND $1f + LD $mem_loading_step, A CP $00 - RET Z + JR Z, =.end_attack CP $11 RET C @@ -76,6 +65,18 @@ Earcoptr_Attack_Loading_Regular: RET + .end_attack: + LD A, $enum_dungeon_mode + LD $mem_current_mode, A + LD $mem_requested_mode, A + CALL =Update_VBlank_Handler + + LD A, $mem_map_loading_flags + SET 3, A + LD $mem_map_loading_flags, A + + RET + Earcoptr_Attack: PUSH BC LD A, $mem_bunny_x diff --git a/playerattacks/freeze.gbasm b/playerattacks/freeze.gbasm index 80e3ca1..0ce697f 100644 --- a/playerattacks/freeze.gbasm +++ b/playerattacks/freeze.gbasm @@ -20,34 +20,21 @@ Freeze_Attack_Loading_VBlank: JR Z, =.Blink_Animation.dark_palette LD A, $palette_normal LD $mem_prepared_color_palette, A - JR =.end + RET .Blink_Animation.dark_palette: LD A, $palette_white LD $mem_prepared_color_palette, A - .end: - LD A, $mem_loading_step - INC A - AND $0f - LD $mem_loading_step, A - CP $00 - RET NZ - - LD A, $enum_dungeon_mode - LD $mem_current_mode, A - LD $mem_requested_mode, A - CALL =Update_VBlank_Handler - - LD A, $mem_map_loading_flags - SET 3, A - LD $mem_map_loading_flags, A RET Freeze_Attack_Loading_Regular: LD A, $mem_loading_step + INC A + AND $0f + LD $mem_loading_step, A CP $00 - RET Z + JR Z, =.end_attack LD BC, $mem_entities_list SLA A @@ -101,6 +88,19 @@ Freeze_Attack_Loading_Regular: LD (BC), A RET + .end_attack: + + LD A, $enum_dungeon_mode + LD $mem_current_mode, A + LD $mem_requested_mode, A + CALL =Update_VBlank_Handler + + LD A, $mem_map_loading_flags + SET 3, A + LD $mem_map_loading_flags, A + + RET + Freeze_Attack: LD BC, =Freeze_Attack_Loading_VBlank LD A, B diff --git a/playerattacks/heal.gbasm b/playerattacks/heal.gbasm index 2cc7b10..b8718b9 100644 --- a/playerattacks/heal.gbasm +++ b/playerattacks/heal.gbasm @@ -1,5 +1,7 @@ Heal_Attack: LD A, $mem_bunny_health + CP $20 + JP Z, =Canceled_Attack ADD $03 DAA CP $20 |