From d90b7dc3c89b12724a3f8b47a4b888c46e8dc74e Mon Sep 17 00:00:00 2001 From: Narishma-gb <194818981+Narishma-gb@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:02:38 +0100 Subject: [PATCH] Replace numbers with constants --- data/maps/objects/Route3.asm | 2 +- data/maps/objects/TradeCenter.asm | 2 +- engine/battle/animations.asm | 8 ++++---- engine/overworld/trainer_sight.asm | 10 +++++----- scripts/PokemonTower6F.asm | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/data/maps/objects/Route3.asm b/data/maps/objects/Route3.asm index ce7224b57b..6f491468ec 100644 --- a/data/maps/objects/Route3.asm +++ b/data/maps/objects/Route3.asm @@ -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 diff --git a/data/maps/objects/TradeCenter.asm b/data/maps/objects/TradeCenter.asm index 74613f9af4..cfa1fe0bcd 100644 --- a/data/maps/objects/TradeCenter.asm +++ b/data/maps/objects/TradeCenter.asm @@ -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 diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index a6d12012e2..ce6c6d5df4 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm index f32b558a55..da845fda27 100644 --- a/engine/overworld/trainer_sight.asm +++ b/engine/overworld/trainer_sight.asm @@ -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] @@ -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] @@ -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] @@ -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 diff --git a/scripts/PokemonTower6F.asm b/scripts/PokemonTower6F.asm index cf246c5694..251b375921 100644 --- a/scripts/PokemonTower6F.asm +++ b/scripts/PokemonTower6F.asm @@ -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