Basic_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D LD A, D AND $f0 SWAP A LD D, A 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 LD A, D SWAP A AND $70 OR D LD D, A RET .attack: LD A, E SWAP A AND $70 OR E LD D, A LD A, L AND $f0 OR $0a LD L, A LD (HL), $01 PUSH BC LD A, $mem_bunny_direction AND $08 LD B, A LD A, $mem_bunny_flags AND $01 OR B CP $09 POP BC RET Z LD A, $mem_bunny_health SUB $01 JR C, =.health_underflow_fix DAA LD $mem_bunny_health, A JR =.Skip_health_underflow_fix .health_underflow_fix: LD A, $00 LD $mem_bunny_health, A .Skip_health_underflow_fix: LD A, $mem_bunny_flags SET 3, A LD $mem_bunny_flags, A PUSH BC LD A, $mem_moving_animation_step LD B, A LD A, $1f SUB B LD $mem_blinking_animation_counter, A .SET_SOUND_EFFECT =_sound_effect_Damage POP BC RET