aboutsummaryrefslogtreecommitdiff
path: root/entity/actions.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-10-29 16:12:03 +0900
committerAstatin <[email protected]>2024-10-29 16:12:03 +0900
commit96df60d319238dc7df53fe948e8a2593f1857be7 (patch)
tree9df94fd700f765e83cde3c997ab6e4a1d9d171de /entity/actions.gbasm
parent7bcae43031d18c2b992581cb00358ae3d457d5c6 (diff)
Bunny can attack foxes
Diffstat (limited to 'entity/actions.gbasm')
-rw-r--r--entity/actions.gbasm27
1 files changed, 25 insertions, 2 deletions
diff --git a/entity/actions.gbasm b/entity/actions.gbasm
index 9f46123..c87f13a 100644
--- a/entity/actions.gbasm
+++ b/entity/actions.gbasm
@@ -77,8 +77,6 @@ Update_Animation_Steps:
Update_Animation_Steps.end:
RET
-
-
Fox_AI:
PUSH HL
PUSH BC
@@ -258,6 +256,31 @@ Fox_AI:
.ADD_A_TO_DIRECTION_BC
Fox_AI.End_movement.end:
+ Fox_AI.Health_check:
+ LD A, $mem_map_loading_flags
+ BIT 3, A
+ JP Z, =Fox_AI.Health_check.end
+
+ LD A, $mem_moving_animation_step
+ CP $03
+ JR NZ, =Fox_AI.Health_check.end
+
+ LD A, L
+ AND $f0
+ ADD $06
+ LD L, A
+
+ LD A, (HL)
+ CP $00
+ JR NZ, =Fox_AI.Health_check.end
+
+ LD A, L
+ AND $f0
+ LD L, A
+
+ LD (HL), $00
+ Fox_AI.Health_check.end:
+
LD A, L
AND $f0
LD L, A