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

@@ -147,9 +147,8 @@ WildFled_EnemyFled_LinkBattleCanceled:
call CheckMobileBattleError
jr c, .skip_sfx
; BUG: SFX_RUN does not play correctly when a wild Pokémon flees from battle (see docs/bugs_and_glitches.md)
ld de, SFX_RUN
call PlaySFX
call WaitPlaySFX
.skip_sfx
call SetPlayerTurn
@@ -158,6 +157,11 @@ WildFled_EnemyFled_LinkBattleCanceled:
ret
BattleTurn:
ldh a, [hInMenu]
push af
ld a, 1 ; or "xor a" for the value 0
ldh [hInMenu], a
.loop
call Stubbed_Increments5_a89a
call CheckContestBattleOver
@@ -227,6 +231,8 @@ BattleTurn:
jp .loop
.quit
pop af
ldh [hInMenu], a
ret
Stubbed_Increments5_a89a:
@@ -6166,14 +6172,13 @@ LoadEnemyMon:
jr nz, .Happiness
; Get Magikarp's length
; BUG: Magikarp length limits have a unit conversion error (see docs/bugs_and_glitches.md)
ld de, wEnemyMonDVs
ld bc, wPlayerID
callfar CalcMagikarpLength
; No reason to keep going if length > 1536 mm (i.e. if HIGH(length) > 6 feet)
ld a, [wMagikarpLength]
cp HIGH(1536)
cp 5
jr nz, .CheckMagikarpArea
; 5% chance of skipping both size checks
@@ -6182,7 +6187,7 @@ LoadEnemyMon:
jr c, .CheckMagikarpArea
; Try again if length >= 1616 mm (i.e. if LOW(length) >= 4 inches)
ld a, [wMagikarpLength + 1]
cp LOW(1616)
cp 4
jr nc, .GenerateDVs
; 20% chance of skipping this check
@@ -6191,24 +6196,23 @@ LoadEnemyMon:
jr c, .CheckMagikarpArea
; Try again if length >= 1600 mm (i.e. if LOW(length) >= 3 inches)
ld a, [wMagikarpLength + 1]
cp LOW(1600)
cp 3
jr nc, .GenerateDVs
.CheckMagikarpArea:
; BUG: Magikarp in Lake of Rage are shorter, not longer (see docs/bugs_and_glitches.md)
ld a, [wMapGroup]
cp GROUP_LAKE_OF_RAGE
jr z, .Happiness
jr nz, .Happiness
ld a, [wMapNumber]
cp MAP_LAKE_OF_RAGE
jr z, .Happiness
jr nz, .Happiness
; 40% chance of not flooring
call Random
cp 39 percent + 1
jr c, .Happiness
; Try again if length < 1024 mm (i.e. if HIGH(length) < 3 feet)
ld a, [wMagikarpLength]
cp HIGH(1024)
cp 3
jr c, .GenerateDVs ; try again
; Finally done with DVs
@@ -6410,7 +6414,7 @@ LoadEnemyMon:
ld bc, NUM_BATTLE_STATS * 2
call CopyBytes
; BUG: PRZ and BRN stat reductions don't apply to switched Pokémon (see docs/bugs_and_glitches.md)
call ApplyStatusEffectOnEnemyStats
ret
CheckSleepingTreeMon:
@@ -6803,10 +6807,11 @@ BadgeStatBoosts:
ld hl, wBattleMonAttack
ld c, 4
.CheckBadge:
; BUG: Glacier Badge may not boost Special Defense depending on the value of Special Attack (see docs/bugs_and_glitches.md)
ld a, b
srl b
push af
call c, BoostStat
pop af
inc hl
inc hl
; Check every other badge.