summaryrefslogtreecommitdiff
path: root/engine/battle
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/ai/items.asm12
-rw-r--r--engine/battle/battle_transition.asm2
-rw-r--r--engine/battle/core.asm16
-rw-r--r--engine/battle/effect_commands.asm14
-rw-r--r--engine/battle/menu.asm6
-rw-r--r--engine/battle/move_effects/baton_pass.asm2
6 files changed, 27 insertions, 25 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm
index 4de82d153..62adaca77 100644
--- a/engine/battle/ai/items.asm
+++ b/engine/battle/ai/items.asm
@@ -20,8 +20,9 @@ AI_SwitchOrTryItem:
and a
jr nz, DontSwitch
+ ; always load the first trainer class in wTrainerClass for Battle Tower trainers
ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH
- ld a, [wInBattleTowerBattle] ; always load the first trainer class in wTrainerClass for BattleTower-Trainers
+ ld a, [wInBattleTowerBattle]
and a
jr nz, .ok
@@ -29,6 +30,7 @@ AI_SwitchOrTryItem:
dec a
ld bc, NUM_TRAINER_ATTRIBUTES
call AddNTimes
+
.ok
bit SWITCH_OFTEN_F, [hl]
jp nz, SwitchOften
@@ -145,13 +147,13 @@ SwitchSometimes:
ld [wEnemySwitchMonIndex], a
jp AI_TrySwitch
-CheckSubstatusCantRun:
+CheckSubstatusCantRun: ; unreferenced
ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
AI_TryItem:
- ; items are not allowed in the BattleTower
+ ; items are not allowed in the Battle Tower
ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -213,7 +215,7 @@ AI_TryItem:
inc hl
jr c, .loop
-.used_item
+; used item
xor a
ld [de], a
inc a
@@ -259,7 +261,7 @@ AI_TryItem:
cp e
jr nc, .yes
-.no
+.no ; unreferenced
and a
ret
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm
index a1cdd239d..318556f7f 100644
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -449,7 +449,7 @@ ENDM
spin_quadrant LOWER_LEFT, .wedge1, 1, 11
db -1
-.load
+.load:
ld a, [hli]
ld e, a
ld a, [hli]
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 85cba5f85..56b20b9cc 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1697,7 +1697,7 @@ HandleWeather:
cp USING_EXTERNAL_CLOCK
jr z, .enemy_first
-.player_first
+; player first
call SetPlayerTurn
call .SandstormDamage
call SetEnemyTurn
@@ -2711,7 +2711,7 @@ AskUseNextPokemon:
ForcePlayerMonChoice:
call EmptyBattleTextbox
call LoadStandardMenuHeader
- call SetUpBattlePartyMenu_NoLoop
+ call SetUpBattlePartyMenu
call ForcePickPartyMonInBattle
ld a, [wLinkMode]
and a
@@ -2810,9 +2810,9 @@ IsMobileBattle:
cp LINK_MOBILE
ret
-SetUpBattlePartyMenu_NoLoop:
+SetUpBattlePartyMenu:
call ClearBGPalettes
-SetUpBattlePartyMenu: ; switch to fullscreen menu?
+SetUpBattlePartyMenu_Loop: ; switch to fullscreen menu?
farcall LoadPartyMenuGFX
farcall InitPartyMenuWithCancel
farcall InitPartyMenuBGPal7
@@ -3486,7 +3486,7 @@ OfferSwitch:
ld a, [wMenuCursorY]
dec a
jr nz, .said_no
- call SetUpBattlePartyMenu_NoLoop
+ call SetUpBattlePartyMenu
call PickSwitchMonInBattle
jr c, .canceled_switch
ld a, [wCurBattleMon]
@@ -5043,7 +5043,7 @@ BattleMenuPKMN_ReturnFromStats:
call LoadStandardMenuHeader
call ClearBGPalettes
BattleMenuPKMN_Loop:
- call SetUpBattlePartyMenu
+ call SetUpBattlePartyMenu_Loop
xor a
ld [wPartyMenuActionText], a
call JumpToPartyMenuAndPrintText
@@ -8952,13 +8952,13 @@ InitBattleDisplay:
ldh [rSVBK], a
ld hl, wDecompressScratch
- ld bc, wScratchAttrmap - wDecompressScratch
+ ld bc, BG_MAP_WIDTH * BG_MAP_HEIGHT
ld a, " "
call ByteFill
ld de, wDecompressScratch
hlbgcoord 0, 0
- lb bc, BANK(.BlankBGMap), $40
+ lb bc, BANK(@), (BG_MAP_WIDTH * BG_MAP_HEIGHT) / LEN_2BPP_TILE
call Request2bpp
pop af
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 4d670b4b1..d3f9290fa 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -134,7 +134,7 @@ BattleCommand_CheckTurn:
and a
jp nz, CheckEnemyTurn
-CheckPlayerTurn:
+; check player turn
ld hl, wPlayerSubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -2586,7 +2586,7 @@ PlayerAttackDamage:
cp SPECIAL
jr nc, .special
-.physical
+; physical
ld hl, wEnemyMonDefense
ld a, [hli]
ld b, a
@@ -2826,9 +2826,9 @@ EnemyAttackDamage:
ld a, [hl]
cp SPECIAL
- jr nc, .Special
+ jr nc, .special
-.physical
+; physical
ld hl, wBattleMonDefense
ld a, [hli]
ld b, a
@@ -2852,7 +2852,7 @@ EnemyAttackDamage:
ld hl, wEnemyAttack
jr .thickclub
-.Special:
+.special
ld hl, wBattleMonSpclDef
ld a, [hli]
ld b, a
@@ -6124,7 +6124,7 @@ INCLUDE "engine/battle/move_effects/conversion.asm"
BattleCommand_ResetStats:
; resetstats
- ld a, 7 ; neutral
+ ld a, BASE_STAT_LEVEL
ld hl, wPlayerStatLevels
call .Fill
ld hl, wEnemyStatLevels
@@ -6147,7 +6147,7 @@ BattleCommand_ResetStats:
jp StdBattleTextbox
.Fill:
- ld b, wPlayerStatLevelsEnd - wPlayerStatLevels
+ ld b, NUM_LEVEL_STATS
.next
ld [hli], a
dec b
diff --git a/engine/battle/menu.asm b/engine/battle/menu.asm
index a4955ec6a..e29bff48b 100644
--- a/engine/battle/menu.asm
+++ b/engine/battle/menu.asm
@@ -9,8 +9,7 @@ LoadBattleMenu:
call ExitMenu
ret
-SafariBattleMenu:
-; untranslated
+SafariBattleMenu: ; unreferenced
ld hl, SafariBattleMenuHeader
call LoadMenuHeader
jr CommonBattleMenu
@@ -18,7 +17,8 @@ SafariBattleMenu:
ContestBattleMenu:
ld hl, ContestBattleMenuHeader
call LoadMenuHeader
-; fallthrough
+ ; fallthrough
+
CommonBattleMenu:
ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a
diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm
index 46baeb75f..bafe33866 100644
--- a/engine/battle/move_effects/baton_pass.asm
+++ b/engine/battle/move_effects/baton_pass.asm
@@ -17,7 +17,7 @@ BattleCommand_BatonPass:
; Transition into switchmon menu
call LoadStandardMenuHeader
- farcall SetUpBattlePartyMenu_NoLoop
+ farcall SetUpBattlePartyMenu
farcall ForcePickSwitchMonInBattle