Fix magic numbers in Celebi event code

This commit is contained in:
Idain 2024-01-01 23:00:57 -04:00 committed by xCrystal
parent 5d94f1c7b4
commit 5fb672b220

View File

@ -132,7 +132,7 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
cp 8 * 10 + 2
cp 10 * TILE_WIDTH + 2
jp nc, .FreezeCelebiPosition
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
@ -159,9 +159,9 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 11 + 4
cp 11 * TILE_WIDTH + 4
jr nc, .ShiftY
cp 8 * 8 + 4
cp 8 * TILE_WIDTH + 4
jr nc, .ReinitSpriteAnimFrame
.ShiftY:
pop af
@ -171,7 +171,7 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr c, .float_up
jr .float_down
@ -179,7 +179,7 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr nc, .float_up
.float_down
ld hl, SPRITEANIMSTRUCT_YCOORD
@ -200,9 +200,9 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr c, .left
cp -(8 * 3 + 2)
cp -(3 * TILE_WIDTH + 2)
jr nc, .left
ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
add hl, bc