Replace magic numbers with constants in engine/battle/ai/switch.asm (#1216)

This commit is contained in:
Jordan Moore
2025-12-29 18:48:23 -05:00
committed by GitHub
parent a718a256f8
commit 2bbb15675d

View File

@@ -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]