From 2bbb15675de0d2bbebc8cc9978f5c7fb15bc73b9 Mon Sep 17 00:00:00 2001 From: Jordan Moore <46928924+jordanmoore753@users.noreply.github.com> Date: Mon, 29 Dec 2025 18:48:23 -0500 Subject: [PATCH] Replace magic numbers with constants in engine/battle/ai/switch.asm (#1216) --- engine/battle/ai/switch.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/battle/ai/switch.asm b/engine/battle/ai/switch.asm index 1ead063e6..52d0c7c4c 100644 --- a/engine/battle/ai/switch.asm +++ b/engine/battle/ai/switch.asm @@ -247,7 +247,7 @@ CheckAbleToSwitch: call CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] - cp 10 + cp BASE_AI_SWITCH_SCORE ret nc ld a, b @@ -259,7 +259,7 @@ CheckAbleToSwitch: ld c, $10 call CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] - cp 10 + cp BASE_AI_SWITCH_SCORE jr nc, .okay ld c, $20 @@ -272,7 +272,7 @@ CheckAbleToSwitch: .no_last_counter_move call CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] - cp 10 + cp BASE_AI_SWITCH_SCORE ret nc call FindAliveEnemyMons @@ -476,7 +476,7 @@ FindEnemyMonsWithASuperEffectiveMove: ; if immune or not very effective: continue ld a, [wTypeMatchup] - cp 10 + cp EFFECTIVE jr c, .nope ; if neutral: load 1 and continue @@ -576,7 +576,7 @@ FindEnemyMonsThatResistPlayer: ld hl, wBaseType call CheckTypeMatchup ld a, [wTypeMatchup] - cp 10 + 1 + cp EFFECTIVE + 1 jr nc, .dont_choose_mon ld a, [wBattleMonType2]