From c4c51501ecfa4befd206925d0d579436df136203 Mon Sep 17 00:00:00 2001 From: vulcandth Date: Thu, 29 Aug 2024 21:23:57 -0500 Subject: [PATCH] Swap headbutt tree OAM anim with player sprite --- engine/events/field_moves.asm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 38f0b7e8b..2944b14a4 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -42,11 +42,23 @@ ShakeHeadbuttTree: add hl, bc ld [hl], FIELDMOVE_TREE + ldh a, [hUsedOAMIndex] + ; a = (NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH - a + cpl + add NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH + 1 + push af + ld l, a + ld h, HIGH(wShadowOAM) + ld bc, SPRITEOAMSTRUCT_LENGTH * 4 ldh a, [hUsedOAMIndex] ; a = (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH - a cpl add (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH + 1 + ld e, a + ld d, HIGH(wShadowOAM) + call CopyBytes + pop af ld [wCurSpriteOAMAddr], a farcall DoNextFrameForAllSprites_OW call HideHeadbuttTree @@ -66,9 +78,9 @@ ShakeHeadbuttTree: dec [hl] ldh a, [hUsedOAMIndex] - ; a = (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH - a + ; a = (NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH - a cpl - add (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH + 1 + add NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH + 1 ld [wCurSpriteOAMAddr], a farcall DoNextFrameForAllSprites_OW