summaryrefslogtreecommitdiff
path: root/engine/battle
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/ai/items.asm2
-rw-r--r--engine/battle/core.asm48
-rw-r--r--engine/battle/effect_commands.asm19
-rw-r--r--engine/battle/menu.asm8
-rw-r--r--engine/battle/move_effects/beat_up.asm4
-rw-r--r--engine/battle/move_effects/conversion.asm2
-rw-r--r--engine/battle/move_effects/conversion2.asm2
-rw-r--r--engine/battle/move_effects/disable.asm2
-rw-r--r--engine/battle/move_effects/magnitude.asm2
-rw-r--r--engine/battle/move_effects/mimic.asm2
-rw-r--r--engine/battle/move_effects/mirror_move.asm2
-rw-r--r--engine/battle/move_effects/sketch.asm2
-rw-r--r--engine/battle/move_effects/spite.asm4
-rw-r--r--engine/battle/move_effects/thief.asm8
-rw-r--r--engine/battle/move_effects/transform.asm2
-rw-r--r--engine/battle/read_trainer_attributes.asm4
16 files changed, 56 insertions, 57 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm
index 16e9ef20..11636fde 100644
--- a/engine/battle/ai/items.asm
+++ b/engine/battle/ai/items.asm
@@ -822,7 +822,7 @@ PrintText_UsedItemOn_AND_AIUpdateHUD:
PrintText_UsedItemOn:
ld a, [wCurEnemyItem]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 8aa0a79a..aca0185e 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -328,7 +328,7 @@ HandleBerserkGene:
push bc
callfar GetUserItem
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
sub BERSERK_GENE
pop bc
pop de
@@ -1108,7 +1108,7 @@ HandlePerishSong:
ret z
dec [hl]
ld a, [hl]
- ld [wDeciramBuffer], a
+ ld [wTextDecimalByte], a
push af
ld hl, PerishCountText
call StdBattleTextbox
@@ -1182,7 +1182,7 @@ HandleWrap:
ret nz
ld a, [de]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld [wFXAnimID], a
call GetMoveName
dec [hl]
@@ -1235,7 +1235,7 @@ HandleLeftovers:
callfar GetUserItem
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
ld a, b
cp HELD_LEFTOVERS
@@ -1381,7 +1381,7 @@ HandleMysteryberry:
.skip_checks
callfar GetUserItem
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
xor a
ld [hl], a
call GetPartymonItem
@@ -3491,7 +3491,7 @@ TryToRunAwayFromBattle:
push hl
push de
ld a, [wBattleMonItem]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld b, a
callfar GetItemHeldEffect
ld a, b
@@ -3797,7 +3797,7 @@ SendOutPlayerMon:
call GetBattleMonBackpic
xor a
ldh [hGraphicStartTile], a
- ld [wBattleMenuCursorBuffer], a
+ ld [wBattleMenuCursorPosition], a
ld [wCurMoveNum], a
ld [wTypeModifier], a
ld [wPlayerMoveStruct + MOVE_ANIM], a
@@ -4107,7 +4107,7 @@ UseOpponentItem:
call RefreshBattleHuds
callfar GetOpponentItem
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
callfar ConsumeHeldItem
ld hl, RecoveredUsingText
@@ -4201,7 +4201,7 @@ UseConfusionHealingItem:
.heal_status
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVarAddr
res SUBSTATUS_CONFUSED, [hl]
@@ -4268,7 +4268,7 @@ HandleStatBoostingHeldItems:
jr nz, .loop
pop bc
ld a, [bc]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
push bc
dec hl
dec hl
@@ -4661,7 +4661,7 @@ BattleMenu:
.next
ld a, $1
ldh [hBGMapMode], a
- ld a, [wBattleMenuCursorBuffer]
+ ld a, [wBattleMenuCursorPosition]
cp $1
jp z, BattleMenu_Fight
cp $3
@@ -4736,7 +4736,7 @@ BattleMenu_Pack:
and a
jr nz, .run
callfar CheckItemPocket
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
cp BALL
jr z, .ball
call ClearBGPalettes
@@ -5144,7 +5144,7 @@ MoveSelectionScreen:
.battle_player_moves
call MoveInfoBox
- ld a, [wMoveSwapBuffer]
+ ld a, [wSwappingMove]
and a
jr z, .interpret_joypad
hlcoord 5, 13
@@ -5168,7 +5168,7 @@ MoveSelectionScreen:
push af
xor a
- ld [wMoveSwapBuffer], a
+ ld [wSwappingMove], a
ld a, [wMenuCursorY]
dec a
ld [wMenuCursorY], a
@@ -5306,7 +5306,7 @@ MoveSelectionScreen:
ret
.pressed_select
- ld a, [wMoveSwapBuffer]
+ ld a, [wSwappingMove]
and a
jr z, .start_swap
ld hl, wBattleMonMoves
@@ -5324,14 +5324,14 @@ MoveSelectionScreen:
ld a, [hl]
and $f
ld b, a
- ld a, [wMoveSwapBuffer]
+ ld a, [wSwappingMove]
swap a
add b
ld [hl], a
jr .swap_moves_in_party_struct
.not_swapping_disabled_move
- ld a, [wMoveSwapBuffer]
+ ld a, [wSwappingMove]
cp b
jr nz, .swap_moves_in_party_struct
ld a, [hl]
@@ -5359,12 +5359,12 @@ MoveSelectionScreen:
.transformed
xor a
- ld [wMoveSwapBuffer], a
+ ld [wSwappingMove], a
jp MoveSelectionScreen
.swap_bytes
push hl
- ld a, [wMoveSwapBuffer]
+ ld a, [wSwappingMove]
dec a
ld c, a
ld b, 0
@@ -5386,7 +5386,7 @@ MoveSelectionScreen:
.start_swap
ld a, [wMenuCursorY]
- ld [wMoveSwapBuffer], a
+ ld [wSwappingMove], a
jp MoveSelectionScreen
MoveInfoBox:
@@ -5453,7 +5453,7 @@ MoveInfoBox:
call PrintNum
hlcoord 8, 11
- ld de, wNamedObjectIndexBuffer
+ ld de, wNamedObjectIndex
lb bc, 1, 2
call PrintNum
@@ -6157,7 +6157,7 @@ LoadEnemyMon:
ld [de], a
ld a, [wTempEnemyMonSpecies]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetPokemonName
@@ -7745,7 +7745,7 @@ StartBattle:
ldh [hMapAnims], a
xor a
ld [wTempBattleMonSpecies], a
- ld [wBattleMenuCursorBuffer], a
+ ld [wBattleMenuCursorPosition], a
farcall PlayBattleMusic
ld a, 0
ld [wSpriteUpdatesEnabled], a
@@ -7964,7 +7964,7 @@ ExitBattle:
ld [wPartyMenuCursor], a
ld [wKeyItemsPocketCursor], a
ld [wItemsPocketCursor], a
- ld [wBattleMenuCursorBuffer], a
+ ld [wBattleMenuCursorPosition], a
ld [wCurMoveNum], a
ld [wBallsPocketCursor], a
ld [wLastPocket], a
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 548b7c81..58d7d016 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -606,7 +606,7 @@ MoveDisabled:
ld a, BATTLE_VARS_MOVE
call GetBattleVar
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetMoveName
ld hl, DisabledMoveText
@@ -2192,7 +2192,7 @@ BattleCommand_ApplyDamage:
.focus_band_text
call GetOpponentItem
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
ld hl, HungOnText
jp StdBattleTextbox
@@ -3585,7 +3585,7 @@ UpdateMoveData:
ld a, BATTLE_VARS_MOVE
call GetBattleVar
ld [wCurSpecies], a
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
dec a
call GetMoveData
@@ -3601,7 +3601,7 @@ BattleCommand_SleepTarget:
jr nz, .not_protected_by_item
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
ld hl, ProtectedByText
jr .fail
@@ -3739,7 +3739,7 @@ BattleCommand_Poison:
cp HELD_PREVENT_POISON
jr nz, .do_poison
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
ld hl, ProtectedByText
jr .failed
@@ -4785,7 +4785,6 @@ BattleCommand_TriStatusChance:
; tristatuschance
call BattleCommand_EffectChance
-
.loop
; 1/3 chance of each status
call BattleRandom
@@ -4793,11 +4792,11 @@ BattleCommand_TriStatusChance:
and %11
jr z, .loop
dec a
- ld hl, .ptrs
+ ld hl, .StatusCommands
rst JumpTable
ret
-.ptrs
+.StatusCommands:
dw BattleCommand_ParalyzeTarget ; paralyze
dw BattleCommand_FreezeTarget ; freeze
dw BattleCommand_BurnTarget ; burn
@@ -5827,7 +5826,7 @@ BattleCommand_Confuse:
cp HELD_PREVENT_CONFUSE
jr nz, .no_item_protection
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
call AnimateFailedMove
ld hl, ProtectedByText
@@ -5917,7 +5916,7 @@ BattleCommand_Paralyze:
cp HELD_PREVENT_PARALYZE
jr nz, .no_item_protection
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
call AnimateFailedMove
ld hl, ProtectedByText
diff --git a/engine/battle/menu.asm b/engine/battle/menu.asm
index e9a7e593..4887b73b 100644
--- a/engine/battle/menu.asm
+++ b/engine/battle/menu.asm
@@ -14,11 +14,11 @@ ContestBattleMenu:
; fallthrough
CommonBattleMenu:
- ld a, [wBattleMenuCursorBuffer]
- ld [wMenuCursorBuffer], a
+ ld a, [wBattleMenuCursorPosition]
+ ld [wMenuCursorPosition], a
call _2DMenu
- ld a, [wMenuCursorBuffer]
- ld [wBattleMenuCursorBuffer], a
+ ld a, [wMenuCursorPosition]
+ ld [wBattleMenuCursorPosition], a
call ExitMenu
ret
diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm
index 32e0112c..d2797f79 100644
--- a/engine/battle/move_effects/beat_up.asm
+++ b/engine/battle/move_effects/beat_up.asm
@@ -114,7 +114,7 @@ BattleCommand_BeatUp:
ld hl, wOTPartySpecies
add hl, bc
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetPokemonName
jr .got_enemy_nick
@@ -152,7 +152,7 @@ BattleCommand_BeatUp:
.wild
ld a, [wEnemyMonSpecies]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetPokemonName
ld hl, BeatUpAttackText
call StdBattleTextbox
diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm
index b6081a6b..b67ed992 100644
--- a/engine/battle/move_effects/conversion.asm
+++ b/engine/battle/move_effects/conversion.asm
@@ -89,7 +89,7 @@ BattleCommand_Conversion:
ld [de], a
inc de
ld [de], a
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
farcall GetTypeName
call AnimateCurrentMove
ld hl, TransformedTypeText
diff --git a/engine/battle/move_effects/conversion2.asm b/engine/battle/move_effects/conversion2.asm
index bc866727..df6d9109 100644
--- a/engine/battle/move_effects/conversion2.asm
+++ b/engine/battle/move_effects/conversion2.asm
@@ -55,7 +55,7 @@ BattleCommand_Conversion2:
call BattleCommand_SwitchTurn
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
predef GetTypeName
ld hl, TransformedTypeText
jp StdBattleTextbox
diff --git a/engine/battle/move_effects/disable.asm b/engine/battle/move_effects/disable.asm
index de6dbc60..4020aa88 100644
--- a/engine/battle/move_effects/disable.asm
+++ b/engine/battle/move_effects/disable.asm
@@ -63,7 +63,7 @@ BattleCommand_Disable:
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
ld [hl], a
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetMoveName
ld hl, WasDisabledText
jp StdBattleTextbox
diff --git a/engine/battle/move_effects/magnitude.asm b/engine/battle/move_effects/magnitude.asm
index f8961b66..87510db0 100644
--- a/engine/battle/move_effects/magnitude.asm
+++ b/engine/battle/move_effects/magnitude.asm
@@ -18,7 +18,7 @@ BattleCommand_GetMagnitude:
push de
inc hl
ld a, [hl]
- ld [wDeciramBuffer], a
+ ld [wTextDecimalByte], a
call BattleCommand_MoveDelay
ld hl, MagnitudeText
call StdBattleTextbox
diff --git a/engine/battle/move_effects/mimic.asm b/engine/battle/move_effects/mimic.asm
index 71eb72c6..a8bc1e11 100644
--- a/engine/battle/move_effects/mimic.asm
+++ b/engine/battle/move_effects/mimic.asm
@@ -37,7 +37,7 @@ BattleCommand_Mimic:
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
ld [hl], a
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld bc, wBattleMonPP - wBattleMonMoves
add hl, bc
ld [hl], 5
diff --git a/engine/battle/move_effects/mirror_move.asm b/engine/battle/move_effects/mirror_move.asm
index 86259d11..e3ac3e1c 100644
--- a/engine/battle/move_effects/mirror_move.asm
+++ b/engine/battle/move_effects/mirror_move.asm
@@ -24,7 +24,7 @@ BattleCommand_MirrorMove:
.use
ld a, b
ld [hl], a
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
push af
ld a, BATTLE_VARS_MOVE_ANIM
diff --git a/engine/battle/move_effects/sketch.asm b/engine/battle/move_effects/sketch.asm
index 654fb3f5..aa541098 100644
--- a/engine/battle/move_effects/sketch.asm
+++ b/engine/battle/move_effects/sketch.asm
@@ -34,7 +34,7 @@ BattleCommand_Sketch:
.get_last_move
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld b, a
; Fail if move is invalid or is Struggle.
and a
diff --git a/engine/battle/move_effects/spite.asm b/engine/battle/move_effects/spite.asm
index 3e1c2f9b..0244f778 100644
--- a/engine/battle/move_effects/spite.asm
+++ b/engine/battle/move_effects/spite.asm
@@ -24,7 +24,7 @@ BattleCommand_Spite:
ld a, [hli]
cp b
jr nz, .loop
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
dec hl
ld b, 0
push bc
@@ -78,7 +78,7 @@ BattleCommand_Spite:
call AnimateCurrentMove
pop de
ld a, d
- ld [wDeciramBuffer], a
+ ld [wTextDecimalByte], a
ld hl, SpiteEffectText
jp StdBattleTextbox
diff --git a/engine/battle/move_effects/thief.asm b/engine/battle/move_effects/thief.asm
index e588c5ff..03e3fb6a 100644
--- a/engine/battle/move_effects/thief.asm
+++ b/engine/battle/move_effects/thief.asm
@@ -21,7 +21,7 @@ BattleCommand_Thief:
; Can't steal mail.
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld d, a
farcall ItemIsMail
ret c
@@ -45,7 +45,7 @@ BattleCommand_Thief:
ld [de], a
call .playeritem
- ld a, [wNamedObjectIndexBuffer]
+ ld a, [wNamedObjectIndex]
ld [hl], a
ld [de], a
jr .stole
@@ -68,7 +68,7 @@ BattleCommand_Thief:
; Can't steal mail!
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
ld d, a
farcall ItemIsMail
ret c
@@ -86,7 +86,7 @@ BattleCommand_Thief:
ld [de], a
call .enemyitem
- ld a, [wNamedObjectIndexBuffer]
+ ld a, [wNamedObjectIndex]
ld [hl], a
ld [de], a
diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm
index 8b3226f3..e7e0a53f 100644
--- a/engine/battle/move_effects/transform.asm
+++ b/engine/battle/move_effects/transform.asm
@@ -99,7 +99,7 @@ BattleCommand_Transform:
jr nz, .pp_loop
pop hl
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetPokemonName
ld hl, wEnemyStats
ld de, wPlayerStats
diff --git a/engine/battle/read_trainer_attributes.asm b/engine/battle/read_trainer_attributes.asm
index 3f4d4a98..9dc7d2fe 100644
--- a/engine/battle/read_trainer_attributes.asm
+++ b/engine/battle/read_trainer_attributes.asm
@@ -6,7 +6,7 @@ GetTrainerClassName:
ld [wCurSpecies], a
ld a, TRAINER_NAME
- ld [wNamedObjectTypeBuffer], a
+ ld [wNamedObjectType], a
call GetName
ld de, wStringBuffer1
ret
@@ -32,7 +32,7 @@ GetOTName:
ld [wCurSpecies], a
ld a, TRAINER_NAME
- ld [wNamedObjectTypeBuffer], a
+ ld [wNamedObjectType], a
call GetName
ld hl, wStringBuffer1