chore: fix bugs
Some checks failed
CI / build (push) Failing after 1m18s

This commit is contained in:
Giulia Sanguineti
2025-10-01 10:11:42 +02:00
parent d138ed1bd4
commit 4c8d3e962f
44 changed files with 236 additions and 235 deletions

View File

@@ -213,11 +213,31 @@ DEF TRANS_NO_CAVE_F EQU 1 ; bit set in TRANS_NO_CAVE and TRANS_NO_CAVE_STRONGER
StartTrainerBattle_DetermineWhichAnimation:
; The screen flashes a different number of times depending on the level of
; your lead Pokemon relative to the opponent's.
; BUG: Battle transitions fail to account for enemy's level (see docs/bugs_and_glitches.md)
ld a, [wOtherTrainerClass]
and a
jr z, .wild
farcall SetTrainerBattleLevel
.wild
ld b, PARTY_LENGTH
ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH - 1
.loop
ld a, [hli]
or [hl]
jr nz, .okay
add hl, de
dec b
jr nz, .loop
.okay
ld de, MON_LEVEL - MON_HP - 1
add hl, de
ld de, 0
ld a, [wBattleMonLevel]
ld a, [hl]
add 3
ld hl, wEnemyMonLevel
ld hl, wCurPartyLevel
cp [hl]
jr nc, .not_stronger
set TRANS_STRONGER_F, e