aboutsummaryrefslogtreecommitdiff
path: root/playerattacks.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-01-16 18:13:21 +0900
committerAstatin <[email protected]>2025-01-16 18:13:21 +0900
commit02038990a93c0b4cf58269b5456327ea64b998b7 (patch)
tree8f23c7270bc705d17d9d380d3a927f12f20ca1fa /playerattacks.gbasm
parentdc5a9431bf4438000dcd028aa6b9c17c9ca492d8 (diff)
Move basic enemy attack & walker AI to enemiesattacks
Diffstat (limited to 'playerattacks.gbasm')
-rw-r--r--playerattacks.gbasm79
1 files changed, 79 insertions, 0 deletions
diff --git a/playerattacks.gbasm b/playerattacks.gbasm
new file mode 100644
index 0000000..6f1eead
--- /dev/null
+++ b/playerattacks.gbasm
@@ -0,0 +1,79 @@
+Loading_Mode_VBlank:
+ LD A, $mem_current_mode
+ CP $enum_loading_mode
+ RET NZ
+
+ LD A, $mem_loading_mode_vblank_func_pointer_high
+ LD B, A
+ LD A, $mem_loading_mode_vblank_func_pointer_low
+ LD C, A
+ PUSH BC
+ RET
+
+Loading_Mode_Regular:
+ LD A, $mem_current_mode
+ CP $enum_loading_mode
+ RET NZ
+
+ LD A, $mem_loading_mode_regular_func_pointer_high
+ LD B, A
+ LD A, $mem_loading_mode_regular_func_pointer_low
+ LD C, A
+ PUSH BC
+ RET
+
+Canceled_Attack_VBlank:
+ RET
+
+Canceled_Attack_Regular:
+ LD A, $enum_dungeon_mode
+ LD $mem_requested_mode, A
+ RET
+
+Canceled_Attack:
+ LD HL, $mem_entities_list
+ LD A, L
+ ADD $13
+ LD L, A
+ Reset_Entities_Animations.loop:
+ LD A, (HL)
+ AND $07
+ LD (HL), A
+ Reset_Entities_Animations.loop.next:
+ LD A, L
+ AND $f0
+ ADD $13
+ LD L, A
+ CP $03
+ JR NZ, =Reset_Entities_Animations.loop
+
+ LD BC, =Canceled_Attack_VBlank
+ LD A, B
+ LD $mem_loading_mode_vblank_func_pointer_high, A
+ LD A, C
+ LD $mem_loading_mode_vblank_func_pointer_low, A
+
+ LD BC, =Canceled_Attack_Regular
+ LD A, B
+ LD $mem_loading_mode_regular_func_pointer_high, A
+ LD A, C
+ LD $mem_loading_mode_regular_func_pointer_low, A
+
+ LD A, $enum_loading_mode
+ LD $mem_requested_mode, A
+
+ .CLOSE_DIALOGUE
+
+ LD A, $mem_map_loading_flags
+ SET 3, A
+ LD $mem_map_loading_flags, A
+
+ LD A, $mem_bunny_direction
+ OR $40
+ LD $mem_bunny_direction, A
+ RET
+
+.INCLUDE "playerattacks/hop.gbasm"
+.INCLUDE "playerattacks/heal.gbasm"
+.INCLUDE "playerattacks/freeze.gbasm"
+.INCLUDE "playerattacks/earcoptr.gbasm"