aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-05-02 11:47:47 +0200
committerAstatin <[email protected]>2025-05-02 11:47:47 +0200
commite322573ecc55a821506e5313e3b9994e1b58745e (patch)
treef3a7fc1b5db202fa8bcd586f50b488091c94373d
parent54fc17521381b2376b43f4e1542ae293319d0582 (diff)
Fix laser not taking a turn to turn when jumped over
-rw-r--r--enemiesattacks/basic.gbasm4
-rw-r--r--enemiesattacks/freeze.gbasm4
-rw-r--r--enemiesattacks/laser.gbasm18
-rw-r--r--entity/fox.gbasm14
4 files changed, 17 insertions, 23 deletions
diff --git a/enemiesattacks/basic.gbasm b/enemiesattacks/basic.gbasm
index 63bf3e4..103ebc5 100644
--- a/enemiesattacks/basic.gbasm
+++ b/enemiesattacks/basic.gbasm
@@ -9,9 +9,7 @@ Basic_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D
BIT 1, A
JR NZ, =.attack
- LD A, E
- OR $00
- LD D, A
+ LD D, E
RET
.attack:
diff --git a/enemiesattacks/freeze.gbasm b/enemiesattacks/freeze.gbasm
index 35dadf3..057dec4 100644
--- a/enemiesattacks/freeze.gbasm
+++ b/enemiesattacks/freeze.gbasm
@@ -9,9 +9,7 @@ Freeze_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D
BIT 1, A
JR NZ, =.attack
- LD A, E
- OR $00
- LD D, A
+ LD D, E
RET
.attack:
diff --git a/enemiesattacks/laser.gbasm b/enemiesattacks/laser.gbasm
index 9e2f67d..648c5f7 100644
--- a/enemiesattacks/laser.gbasm
+++ b/enemiesattacks/laser.gbasm
@@ -1,4 +1,4 @@
-Laser_sight_check: ; BC = XY of the enemy. D is unchanged. Direction to face in E (or 0 if not)
+Laser_sight_check: ; BC = XY of the enemy. D = direction (must be unchanged). Direction to face in E (or 0 if not)
LD E, $00
; straight line + distance <= 4
@@ -49,22 +49,6 @@ Laser_sight_check: ; BC = XY of the enemy. D is unchanged. Direction to face in
RET
Laser_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D
- LD A, E
- DEC A
- DEC D
- XOR D
- INC D
- CP $00
- JR Z, =.attack
- BIT 1, A
- JR NZ, =.attack
-
- LD A, E
- OR $00
- LD D, A
- RET
-
- .attack:
PUSH DE
PUSH BC
diff --git a/entity/fox.gbasm b/entity/fox.gbasm
index 6f12b3d..33eb51a 100644
--- a/entity/fox.gbasm
+++ b/entity/fox.gbasm
@@ -106,6 +106,20 @@ Fox_Turn:
CP $00
JR Z, =.Try_Basic_Attack
+ LD A, E
+ DEC A
+ DEC D
+ XOR D
+ INC D
+ CP $00
+ JR Z, =.attack
+ BIT 1, A
+ JR NZ, =.attack
+
+ LD D, E
+ JR =.Start_action_or_movement.end
+
+ .attack:
LD D, E
LD A, L
AND $f0