mirror of
https://github.com/pret/pokecrystal.git
synced 2026-08-23 09:44:11 -05:00
Replace magic numbers with constants in engine/battle/ai/switch.asm (#1216)
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user