diff options
author | Astatin <[email protected]> | 2024-12-10 14:41:29 +0900 |
---|---|---|
committer | Astatin <[email protected]> | 2024-12-10 14:41:29 +0900 |
commit | 9af81e83a630f45f915649c5ad5144e848ccfae8 (patch) | |
tree | 8f2ceb1ad2d14e0670d2331b98b1219ecbcdfaba /entity | |
parent | 0aebab4bd7a436a0a20168c573b87cb77d86def9 (diff) |
Unfreeze the foxies
Diffstat (limited to 'entity')
-rw-r--r-- | entity/actions.gbasm | 77 | ||||
-rw-r--r-- | entity/init.gbasm | 12 |
2 files changed, 66 insertions, 23 deletions
diff --git a/entity/actions.gbasm b/entity/actions.gbasm index f7a6e77..8d3adb3 100644 --- a/entity/actions.gbasm +++ b/entity/actions.gbasm @@ -167,6 +167,59 @@ Fox_Turn: LD A, (HL+) 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 + LD L, A + + LD A, (HL) + CP $00 + JR NZ, =Fox_Turn.Health_check.end + + LD A, L + AND $f0 + LD L, A + + LD (HL), $00 + JP NZ, =Fox_Turn.Skip_turn + Fox_Turn.Health_check.end: + + Fox_Turn.Freeze_shiver: + LD A, $mem_moving_animation_step + CP $00 + JP NZ, =Fox_Turn.Freeze_shiver.end + LD A, L + AND $f0 + ADD $08 + LD L, A + LD A, $01 + CP (HL) + JR NZ, =Fox_Turn.Freeze_shiver.end + LD A, D + AND $07 + LD D, A + CALL =RNG_Step + CP $55 + JP NC, =Fox_Turn.Skip_turn + LD A, D + OR $40 + LD D, A + + CALL =RNG_Step + CP $55 + JP NC, =Fox_Turn.Skip_turn + + LD A, $00 + LD (HL-), A + RES 1, (HL) + JP =Fox_Turn.Skip_turn + Fox_Turn.Freeze_shiver.end: + Fox_Turn.Should_turn_be_skipped: LD A, L AND $f0 @@ -394,27 +447,7 @@ Fox_Turn: .ADD_A_TO_DIRECTION_BC Fox_Turn.End_movement.end: - 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 - LD L, A - - LD A, (HL) - CP $00 - JR NZ, =Fox_Turn.Health_check.end - - LD A, L - AND $f0 - LD L, A - - LD (HL), $00 - Fox_Turn.Health_check.end: - + Fox_Turn.Skip_Turn: LD A, L AND $f0 LD L, A @@ -425,8 +458,6 @@ Fox_Turn: LD (HL+), A LD A, D LD (HL+), A - - Fox_Turn.Skip_Turn: POP DE POP BC POP HL diff --git a/entity/init.gbasm b/entity/init.gbasm index 99e522c..f94cbd5 100644 --- a/entity/init.gbasm +++ b/entity/init.gbasm @@ -1,4 +1,16 @@ Initialize_Entities: + LD A, $mem_bunny_health + LD B, A + LD HL, $mem_entities_list + Clear_Entities.loop: + XOR A + LD (HL+), A + CP L + JR NZ, =Clear_Entities.loop + + LD A, B + LD $mem_bunny_health, A + LD HL, $mem_entities_list LD A, $01 LD (HL+), A |