mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Constant swap explains this Battle Tower bug
This commit is contained in:
parent
7de7441e72
commit
16eb97ae9c
@ -44,6 +44,12 @@
|
||||
BATTLETOWER_NROFPKMNS EQU 3
|
||||
BATTLETOWER_NROFTRAINERS EQU 7
|
||||
|
||||
BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70
|
||||
BATTLETOWER_TRAINER_MASK EQU %1111111
|
||||
|
||||
BATTLETOWER_NUM_UNIQUE_PKMN EQU 21
|
||||
BATTLETOWER_PKMN_MASK EQU %11111
|
||||
|
||||
BATTLETOWER_TRAINERDATALENGTH EQU $24
|
||||
BATTLE_TOWER_STRUCT_LENGTH EQU $e0 ; NAME_LENGTH + BATTLETOWER_NROFPKMNS * (PARTYMON_STRUCT_LENGTH + PKMN_NAME_LENGTH) + BATTLETOWER_TRAINERDATALENGTH
|
||||
|
||||
|
@ -23,9 +23,6 @@ BattleTowerTrainers: ; 1f814e
|
||||
db "KAUFMAN@@@", SWIMMERM
|
||||
db "LANCASTER@", SKIER
|
||||
db "McMAHILL@@", CAMPER
|
||||
if !DEF(_CRYSTAL11)
|
||||
BattleTowerTrainersEnd:
|
||||
endc
|
||||
; The following can only be sampled in Crystal 1.1.
|
||||
db "OBRIEN@@@@", GENTLEMAN
|
||||
db "FROST@@@@@", BEAUTY
|
||||
@ -76,7 +73,4 @@ endc
|
||||
db "DYKSTRA@@@", SWIMMERF
|
||||
db "EATON@@@@@", BIKER
|
||||
db "WONG@@@@@@", FIREBREATHER
|
||||
if DEF(_CRYSTAL11)
|
||||
BattleTowerTrainersEnd:
|
||||
endc
|
||||
; 1f8450
|
||||
|
@ -27,11 +27,14 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
|
||||
add b
|
||||
ld b, a ; b contains the nr of the trainer
|
||||
if DEF(_CRYSTAL11)
|
||||
and $7f
|
||||
and BATTLETOWER_TRAINER_MASK
|
||||
cp BATTLETOWER_NUM_UNIQUE_TRAINERS
|
||||
else
|
||||
and $1f
|
||||
; Crystal 1.0 used the wrong constants here, so only the first 21
|
||||
; trainers in BattleTowerTrainers can be sampled.
|
||||
and BATTLETOWER_PKMN_MASK
|
||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
endc
|
||||
cp (BattleTowerTrainersEnd - BattleTowerTrainers) / NAME_LENGTH
|
||||
jr nc, .resample
|
||||
ld b, a
|
||||
|
||||
@ -112,8 +115,8 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||
ld a, [hRandomAdd]
|
||||
add b
|
||||
ld b, a
|
||||
and $1f
|
||||
cp BATTLETOWER_NROFPKMNS * BATTLETOWER_NROFTRAINERS
|
||||
and BATTLETOWER_PKMN_MASK
|
||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
jr nc, .resample
|
||||
; in register 'a' is the chosen Pkmn of the LevelGroup
|
||||
|
||||
|
@ -213,7 +213,7 @@ BattleTower_ExecuteJumptable: ; 8b25b
|
||||
|
||||
BattleTower_CheckPartyLengthIs3: ; 8b2bb
|
||||
ld a, [PartyCount]
|
||||
cp 3
|
||||
cp BATTLETOWER_NROFPKMNS
|
||||
ret
|
||||
; 8b2c1
|
||||
|
||||
@ -235,13 +235,13 @@ BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1
|
||||
cp b
|
||||
ret z
|
||||
ld a, b
|
||||
cp 3
|
||||
cp BATTLETOWER_NROFPKMNS
|
||||
ret
|
||||
; 8b2da
|
||||
|
||||
Function_PartyCountEq3: ; 8b2da
|
||||
ld a, [PartyCount]
|
||||
cp 3
|
||||
cp BATTLETOWER_NROFPKMNS
|
||||
ret z
|
||||
scf
|
||||
ret
|
||||
|
Loading…
Reference in New Issue
Block a user