Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix magic numbers in Celebi event code #1103

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions engine/events/celebi.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -171,15 +171,15 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr c, .float_up
jr .float_down

.moving_left
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
Expand All @@ -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
Expand Down