Skip to content

Commit

Permalink
Replace numbers with constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Narishma-gb committed Jan 30, 2025
1 parent 526e3b5 commit d90b7dc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion data/maps/objects/Route3.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Route3_Object:
def_warp_events

def_bg_events
bg_event 59, 9, 10 ; Route3SignText
bg_event 59, 9, TEXT_ROUTE3_SIGN

def_object_events
object_event 57, 11, SPRITE_SUPER_NERD, STAY, NONE, TEXT_ROUTE3_SUPER_NERD
Expand Down
2 changes: 1 addition & 1 deletion data/maps/objects/TradeCenter.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ TradeCenter_Object:
def_bg_events

def_object_events
object_event 2, 2, SPRITE_RED, STAY, 0, TEXT_TRADECENTER_OPPONENT
object_event 2, 2, SPRITE_RED, STAY, ANY_DIR, TEXT_TRADECENTER_OPPONENT

def_warps_to TRADE_CENTER
8 changes: 4 additions & 4 deletions engine/battle/animations.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ AnimationSubstitute:
; Changes the pokemon's sprite to the mini sprite
ld hl, wTempPic
xor a
ld bc, $310
ld bc, 7 * 7 tiles
call FillMemory
ldh a, [hWhoseTurn]
and a
Expand Down Expand Up @@ -2120,7 +2120,7 @@ GetMonSpriteTileMapPointerFromRowCount:
ldh a, [hWhoseTurn]
and a
jr nz, .enemyTurn
ld a, 20 * 5 + 1
ld a, 5 * SCREEN_WIDTH + 1
jr .next
.enemyTurn
ld a, 12
Expand All @@ -2133,7 +2133,7 @@ GetMonSpriteTileMapPointerFromRowCount:
sub b
and a
jr z, .done
ld de, 20
ld de, SCREEN_WIDTH
.loop
add hl, de
dec a
Expand Down Expand Up @@ -2294,7 +2294,7 @@ CopyTileIDs:
dec c
jr nz, .columnLoop
pop hl
ld bc, 20
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
Expand Down
10 changes: 5 additions & 5 deletions engine/overworld/trainer_sight.asm
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ TrainerWalkUpToPlayer::
swap a
dec a
ld c, a ; bc = steps yet to go to reach player
xor a
ld b, a ; a = direction to go to
xor a ; NPC_MOVEMENT_DOWN
ld b, a
jr .writeWalkScript
.facingUp
ld a, [wTrainerScreenY]
Expand All @@ -111,7 +111,7 @@ TrainerWalkUpToPlayer::
dec a
ld c, a ; bc = steps yet to go to reach player
ld b, $0
ld a, $40 ; a = direction to go to
ld a, NPC_MOVEMENT_UP
jr .writeWalkScript
.facingRight
ld a, [wTrainerScreenX]
Expand All @@ -124,7 +124,7 @@ TrainerWalkUpToPlayer::
dec a
ld c, a ; bc = steps yet to go to reach player
ld b, $0
ld a, $c0 ; a = direction to go to
ld a, NPC_MOVEMENT_RIGHT
jr .writeWalkScript
.facingLeft
ld a, [wTrainerScreenX]
Expand All @@ -137,7 +137,7 @@ TrainerWalkUpToPlayer::
dec a
ld c, a ; bc = steps yet to go to reach player
ld b, $0
ld a, $80 ; a = direction to go to
ld a, NPC_MOVEMENT_LEFT
.writeWalkScript
ld hl, wNPCMovementDirections2
ld de, wNPCMovementDirections2
Expand Down
2 changes: 1 addition & 1 deletion scripts/PokemonTower6F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PokemonTower6FMarowakBattleScript:
.did_not_defeat
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, $10
ld a, D_RIGHT
ld [wSimulatedJoypadStatesEnd], a
xor a
ld [wSpritePlayerStateData2MovementByte1], a
Expand Down

0 comments on commit d90b7dc

Please sign in to comment.