aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2023-11-20 00:33:27 -0600
committerdannye <33dannye@gmail.com>2023-11-20 20:23:27 -0600
commit298e99d3776580585c3f434e5d93137ae431bdd3 (patch)
treea808c4ffd0fd0f9bd28972bae5236e0d3345c8e5 /engine/battle
parentAdd sound bits documentation for wOptions (#110) (diff)
parentName 2 unnamed labels I missed in SeafoamIslandsB4F and PokemonMansion3F (#437) (diff)
downloadpokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.gz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.xz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/core.asm17
-rw-r--r--engine/battle/effects.asm2
-rw-r--r--engine/battle/init_battle.asm8
-rw-r--r--engine/battle/init_battle_variables.asm2
-rw-r--r--engine/battle/link_battle_versus_text.asm4
5 files changed, 20 insertions, 13 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index addff324..3bc59a4f 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -2599,9 +2599,9 @@ MoveSelectionMenu:
; so it is necessary to put the di ei block to not cause tearing
call TextBoxBorder
hlcoord 4, 12
- ld [hl], $7a
+ ld [hl], "─"
hlcoord 10, 12
- ld [hl], $7e
+ ld [hl], "┘"
ei
hlcoord 6, 13
call .writemoves
@@ -2659,11 +2659,12 @@ MoveSelectionMenu:
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr z, .matchedkeyspicked
+ ; Disable left, right, and START buttons in regular battles.
ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
ld b, D_UP | D_DOWN | A_BUTTON | B_BUTTON | SELECT
jr z, .matchedkeyspicked
- ld b, $ff
+ ld b, D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON | SELECT | START
.matchedkeyspicked
ld a, b
ld [hli], a ; wMenuWatchedKeys
@@ -2687,8 +2688,12 @@ SelectMenuItem:
call PlaceString
jr .select
.battleselect
+ ; Hide move swap cursor in TestBattle.
ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
+ ; This causes PrintMenuItem to not run in TestBattle.
+ ; MoveSelectionMenu still draws part of its window, an issue
+ ; which did not seem to exist in the Japanese versions.
jr nz, .select
call PrintMenuItem
ld a, [wMenuItemToSwap]
@@ -2758,8 +2763,9 @@ ENDC
jr z, .disabled
ld a, [wPlayerBattleStatus3]
bit 3, a ; transformed
- jr nz, .dummy ; game freak derp
-.dummy
+ jr nz, .transformedMoveSelected
+.transformedMoveSelected ; pointless
+ ; Allow moves copied by Transform to be used.
ld a, [wCurrentMenuItem]
ld hl, wBattleMonMoves
ld c, a
@@ -6265,6 +6271,7 @@ GetCurrentMove:
jr .selected
.player
ld de, wPlayerMoveNum
+ ; Apply InitBattleVariables to TestBattle.
ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
ld a, [wTestBattlePlayerSelectedMove]
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index f13d679c..c6ec7628 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -128,7 +128,7 @@ PoisonEffect:
ret nc
.inflictPoison
dec hl
- set 3, [hl] ; mon is now poisoned
+ set PSN, [hl]
push de
dec de
ldh a, [hWhoseTurn]
diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm
index e7be112c..e4c56d6d 100644
--- a/engine/battle/init_battle.asm
+++ b/engine/battle/init_battle.asm
@@ -11,12 +11,12 @@ InitOpponent:
DetermineWildOpponent:
ld a, [wd732]
- bit 1, a
- jr z, .notDebug
+ bit BIT_DEBUG_MODE, a
+ jr z, .notDebugMode
ldh a, [hJoyHeld]
- bit BIT_B_BUTTON, a
+ bit BIT_B_BUTTON, a ; disable wild encounters
ret nz
-.notDebug
+.notDebugMode
ld a, [wNumberOfNoRandomBattleStepsLeft]
and a
ret nz
diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm
index dd9f9714..aa081296 100644
--- a/engine/battle/init_battle_variables.asm
+++ b/engine/battle/init_battle_variables.asm
@@ -20,7 +20,7 @@ InitBattleVariables:
ld [hli], a ; wPlayerHPBarColor
ld [hl], a ; wEnemyHPBarColor
ld hl, wCanEvolveFlags
- ld b, $3c
+ ld b, wMiscBattleDataEnd - wMiscBattleData
.loop
ld [hli], a
dec b
diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm
index e55a0672..d06f7f39 100644
--- a/engine/battle/link_battle_versus_text.asm
+++ b/engine/battle/link_battle_versus_text.asm
@@ -12,9 +12,9 @@ DisplayLinkBattleVersusTextBox:
call PlaceString
; place bold "VS" tiles between the names
hlcoord 9, 8
- ld a, $69
+ ld a, "<BOLD_V>"
ld [hli], a
- ld [hl], $6a
+ ld [hl], "<BOLD_S>"
xor a
ld [wUpdateSpritesEnabled], a
callfar SetupPlayerAndEnemyPokeballs