aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-12-12 15:52:19 +0900
committerAstatin <[email protected]>2024-12-12 15:52:19 +0900
commite93a99e8e8565db0111b40d3286ce3d78f263559 (patch)
tree5dea1c3d71de34d6b96ec01d8d0583bad053489b
parentc9ab625b7f226e778fe5cba894fe088e044e704c (diff)
Earcopter damages + blinking animation
-rw-r--r--animations/rotatingball.gbasm10
-rw-r--r--attacks/earcoptr.gbasm86
-rw-r--r--definitions.gbasm1
-rw-r--r--entity/actions.gbasm4
-rw-r--r--entity/display.gbasm19
5 files changed, 104 insertions, 16 deletions
diff --git a/animations/rotatingball.gbasm b/animations/rotatingball.gbasm
index 69ca7e5..cbc2776 100644
--- a/animations/rotatingball.gbasm
+++ b/animations/rotatingball.gbasm
@@ -1,5 +1,5 @@
Rotation_Values:
- .DB $F4, $07, $F5, $0A, $F7, $0D, $F8, $0F, $FD, $13, $00, $14, $03, $14, $06, $14, $09, $13, $0C, $12, $0E, $10, $11, $0E, $12, $0B, $13, $09, $14, $06, $14, $02, $13, $FF, $12, $FD, $11, $FA, $0E, $F8, $0C, $F6, $09, $F5, $06, $F4, $03, $F4, $00, $F4, $FD, $F5, $FB, $F7, $F8, $F9, $F7, $FB, $F5, $FE, $F4, $01, $F4, $04
+ .DB $F5, $0A, $F9, $0F, $FE, $13, $0A, $13, $0F, $0F, $13, $0A, $14, $04, $13, $FE, $0F, $F9, $0A, $F5, $04, $F4, $FE, $F5, $F9, $F9, $F5, $FE, $F4, $04, $F5, $0A
Rotating_Ball_Animation:
INC HL
@@ -43,16 +43,14 @@ Rotating_Ball_Animation:
LD E, (HL)
INC E
- LD A, $1f
- AND E
- LD E, A
- XOR A
+ LD A, $2f
CP E
- JP Z, =Rotating_Ball.End_animation
+ JP C, =Rotating_Ball.End_animation
LD (HL), E
LD A, E
+ AND $0f
SLA A
LD DE, =Rotation_Values
ADD E
diff --git a/attacks/earcoptr.gbasm b/attacks/earcoptr.gbasm
index 3700a88..baa08b9 100644
--- a/attacks/earcoptr.gbasm
+++ b/attacks/earcoptr.gbasm
@@ -1,3 +1,70 @@
+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
+ 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
+ CP $00
+ RET Z
+ CP $11
+ RET C
+
+ SUB $10
+ LD BC, $mem_entities_list
+ SLA A
+ SLA A
+ SLA A
+ SLA A
+ INC A
+ LD C, A
+
+ LD A, (BC)
+ LD E, A
+
+ LD A, $mem_bunny_x
+ SUB E
+ .ABS
+ CP $02
+ RET NC
+
+ INC C
+
+ LD A, (BC)
+ LD E, A
+
+ LD A, $mem_bunny_y
+ SUB E
+ .ABS
+ CP $02
+ RET NC
+
+ INC C
+ LD A, (BC)
+ AND $0f
+ OR $50
+ LD (BC), A
+
+ LD A, C
+ ADD $03
+ LD C, A
+ LD A, (BC)
+ SUB $01
+ RET C
+ LD (BC), A
+ RET
+
Earcoptr_Attack:
PUSH BC
LD A, $mem_bunny_x
@@ -8,14 +75,21 @@ Earcoptr_Attack:
CALL =Try_Launch_Animation
POP BC
- LD A, $enum_dungeon_mode
+ LD BC, =Earcoptr_Attack_Loading_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, =Earcoptr_Attack_Loading_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
- LD $mem_current_mode, A
LD A, $00
LD $mem_display_flag, A
-
- LD A, $mem_map_loading_flags
- SET 3, A
- LD $mem_map_loading_flags, A
RET
diff --git a/definitions.gbasm b/definitions.gbasm
index 2d2746c..8da8615 100644
--- a/definitions.gbasm
+++ b/definitions.gbasm
@@ -36,6 +36,7 @@
; death = 2
; superjump = 3
; shaking = 4
+; blinking = 5 (Blink with both loading steps and animation step)
.DEFINE mem_bunny_health ($cb06)
.DEFINE mem_bunny_flags ($cb07)
diff --git a/entity/actions.gbasm b/entity/actions.gbasm
index 8d3adb3..5bc8200 100644
--- a/entity/actions.gbasm
+++ b/entity/actions.gbasm
@@ -168,10 +168,6 @@ Fox_Turn:
LD D, A
Fox_Turn.Health_check:
- LD A, $mem_moving_animation_step
- CP $03
- JR NZ, =Fox_Turn.Health_check.end
-
LD A, L
AND $f0
ADD $06
diff --git a/entity/display.gbasm b/entity/display.gbasm
index ed3e29b..d6899ff 100644
--- a/entity/display.gbasm
+++ b/entity/display.gbasm
@@ -90,6 +90,25 @@ Display_Entity:
.ADD_A_TO_DIRECTION_BC
Display_Entity.Moving_Animation.end:
+ Display_Entity.Blinking_Animation:
+ LD A, D
+ AND $f0
+ CP $50
+ JR NZ, =Display_Entity.Blinking_Animation.end
+
+ LD A, $mem_moving_animation_step
+ PUSH DE
+ LD E, A
+ LD A, $mem_loading_step
+ XOR E
+ POP DE
+ AND $02
+ CP $00
+ JP Z, =Display_Entity.skip
+
+ Display_Entity.Blinking_Animation.end:
+
+
Display_Entity.Action_Animation:
LD A, D
AND $f0