aboutsummaryrefslogtreecommitdiff
path: root/entity/actions.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-01-24 18:08:33 +0900
committerAstatin <[email protected]>2025-01-24 18:08:33 +0900
commit1a6621e5b1da42ee4b6b9132790ec744efc009c2 (patch)
tree89aeb457555655d2e4ed74a0fe32bfca74851a26 /entity/actions.gbasm
parent57326c9acf9cbb025d54093fb90fd70614659400 (diff)
Add laser enemy attack
Diffstat (limited to 'entity/actions.gbasm')
-rw-r--r--entity/actions.gbasm46
1 files changed, 39 insertions, 7 deletions
diff --git a/entity/actions.gbasm b/entity/actions.gbasm
index 520eb0a..f97fbc4 100644
--- a/entity/actions.gbasm
+++ b/entity/actions.gbasm
@@ -74,18 +74,21 @@ Update_Animation_Steps:
.update_mode:
- LD A, $mem_bunny_health
- CP $00
- JR Z =.Dead_mode
-
LD A, $mem_requested_mode
LD $mem_current_mode, A
.end:
+ LD A, $mem_bunny_health
+ CP $00
+ JR Z =.Dead_mode
+
RET
.Dead_mode:
+ LD A, $20
+ LD $mem_bunny_direction, A
+
LD A, $enum_dead_mode
LD $mem_current_mode, A
@@ -276,12 +279,20 @@ Fox_Turn:
CP $00
JP NZ, =.Start_action_or_movement.end
- CALL =Check_player_next_to
+ ; CALL =Check_player_next_to
+ CALL =Laser_sight_check
LD A, E
CP $00
JR Z, =.nyo_basic_attack
- CALL =Basic_Attack
+ ; CALL =Basic_Attack
+ LD A, L
+ AND $f0
+ ADD $07
+ LD L, A
+
+ SET 2, (HL)
+
JR =.Start_action_or_movement.end
.nyo_basic_attack:
@@ -296,9 +307,30 @@ Fox_Turn:
AND $07
BIT 3, D
LD D, A
- JR Z, =.End_movement.end
+ JR Z, =.End_movement.check_end_of_turn_mode_attack
LD A, $01
.ADD_A_TO_DIRECTION_BC
+
+ .End_movement.check_end_of_turn_mode_attack:
+
+ LD A, L
+ AND $f0
+ ADD $07
+ LD L, A
+
+ BIT 2, (HL)
+ RES 2, (HL)
+ JR Z, =.End_movement.end
+
+ CALL =Laser_sight_check
+ LD A, E
+ CP $00
+ JR Z, =.laser_sight_check_fail
+
+ CALL =Laser_Attack
+
+ .laser_sight_check_fail:
+
.End_movement.end:
.Skip_Turn: