summaryrefslogtreecommitdiff
path: root/engine/battle/ai/switch.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle/ai/switch.asm')
-rw-r--r--engine/battle/ai/switch.asm31
1 files changed, 11 insertions, 20 deletions
diff --git a/engine/battle/ai/switch.asm b/engine/battle/ai/switch.asm
index d397c8d32..b975776c2 100644
--- a/engine/battle/ai/switch.asm
+++ b/engine/battle/ai/switch.asm
@@ -1,4 +1,4 @@
-CheckPlayerMoveTypeMatchups: ; 3484e
+CheckPlayerMoveTypeMatchups:
; Check how well the moves you've already used
; fare against the enemy's Pokemon. Used to
; score a potential switch.
@@ -95,10 +95,9 @@ CheckPlayerMoveTypeMatchups: ; 3484e
pop de
pop hl
ret
-; 348de
-.CheckEnemyMoveMatchups: ; 348de
+.CheckEnemyMoveMatchups:
ld de, wEnemyMonMoves
ld b, NUM_MOVES + 1
ld c, 0
@@ -163,21 +162,19 @@ CheckPlayerMoveTypeMatchups: ; 3484e
.doubledown
call .DecreaseScore
-.DecreaseScore: ; 34931
+.DecreaseScore:
ld a, [wEnemyAISwitchScore]
dec a
ld [wEnemyAISwitchScore], a
ret
-; 34939
-.IncreaseScore: ; 34939
+.IncreaseScore:
ld a, [wEnemyAISwitchScore]
inc a
ld [wEnemyAISwitchScore], a
ret
-; 34941
-CheckAbleToSwitch: ; 34941
+CheckAbleToSwitch:
xor a
ld [wEnemySwitchMonParam], a
call FindAliveEnemyMons
@@ -292,10 +289,9 @@ CheckAbleToSwitch: ; 34941
add $10
ld [wEnemySwitchMonParam], a
ret
-; 349f4
-FindAliveEnemyMons: ; 349f4
+FindAliveEnemyMons:
ld a, [wOTPartyCount]
cp 2
jr c, .only_one
@@ -344,10 +340,9 @@ FindAliveEnemyMons: ; 349f4
.more_than_one
and a
ret
-; 34a2a
-FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
+FindEnemyMonsImmuneToLastCounterMove:
ld hl, wOTPartyMon1
ld a, [wOTPartyCount]
ld b, a
@@ -412,10 +407,9 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
inc d
srl c
jr .loop
-; 34a85
-FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
+FindAliveEnemyMonsWithASuperEffectiveMove:
push bc
ld a, [wOTPartyCount]
ld e, a
@@ -445,7 +439,7 @@ FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
and c
ld c, a
-FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
+FindEnemyMonsWithASuperEffectiveMove:
ld a, -1
ld [wEnemyAISwitchScore], a
@@ -551,10 +545,9 @@ FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
ld [wEnemyAISwitchScore], a
pop bc
ret
-; 34b20
-FindEnemyMonsThatResistPlayer: ; 34b20
+FindEnemyMonsThatResistPlayer:
push bc
ld hl, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
@@ -613,10 +606,9 @@ FindEnemyMonsThatResistPlayer: ; 34b20
and c
ld c, a
ret
-; 34b77
-FindEnemyMonsWithAtLeastQuarterMaxHP: ; 34b77
+FindEnemyMonsWithAtLeastQuarterMaxHP:
push bc
ld de, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
@@ -669,4 +661,3 @@ FindEnemyMonsWithAtLeastQuarterMaxHP: ; 34b77
and c
ld c, a
ret
-; 34bb1