You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Pkmn -> Mon
Since we're aiming for consistency across the codebase, I believe it includes a uniform way to refer to the creatures this game consists of in the labels of the code. The only exceptions to this rule are labels referring to things named through the use of the <PK><MN> or <PKMN> characters, in which case PKMN is used. Most of this was already consistent enough™, I just picked the convention with the most occurences and fixed the outliers.
This commit is contained in:
@@ -12,9 +12,9 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
|
||||
|
||||
; Write $ff into the Item-Slots
|
||||
ld a, $ff
|
||||
ld [wBT_OTPkmn1Item], a
|
||||
ld [wBT_OTPkmn2Item], a
|
||||
ld [wBT_OTPkmn3Item], a
|
||||
ld [wBT_OTMon1Item], a
|
||||
ld [wBT_OTMon2Item], a
|
||||
ld [wBT_OTMon3Item], a
|
||||
|
||||
; Set wBT_OTTrainer as start address to write the following data to
|
||||
ld de, wBT_OTTrainer
|
||||
@@ -32,8 +32,8 @@ if DEF(_CRYSTAL11)
|
||||
else
|
||||
; Crystal 1.0 used the wrong constant here, so only the first 21
|
||||
; trainers in BattleTowerTrainers can be sampled.
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_MON
|
||||
cp BATTLETOWER_NUM_UNIQUE_MON
|
||||
endc
|
||||
jr nc, .resample
|
||||
ld b, a
|
||||
@@ -68,7 +68,7 @@ endc
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
|
||||
call Function_LoadRandomBattleTowerPkmn
|
||||
call Function_LoadRandomBattleTowerMon
|
||||
pop af
|
||||
|
||||
ld hl, BattleTowerTrainerData
|
||||
@@ -92,15 +92,15 @@ endc
|
||||
ret
|
||||
|
||||
|
||||
Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||
Function_LoadRandomBattleTowerMon: ; 1f8081
|
||||
ld c, BATTLETOWER_PARTY_LENGTH
|
||||
.loop
|
||||
push bc
|
||||
ld a, BANK(sBTPkmnPrevTrainer1)
|
||||
ld a, BANK(sBTMonPrevTrainer1)
|
||||
call GetSRAMBank
|
||||
|
||||
.FindARandomBattleTowerPkmn:
|
||||
; From Which LevelGroup are the Pkmn loaded
|
||||
.FindARandomBattleTowerMon:
|
||||
; From Which LevelGroup are the mon loaded
|
||||
; a = 1..10
|
||||
ld a, [wBTChoiceOfLvlGroup]
|
||||
dec a
|
||||
@@ -115,12 +115,12 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||
ld a, [hRandomAdd]
|
||||
add b
|
||||
ld b, a
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_MON
|
||||
cp BATTLETOWER_NUM_UNIQUE_MON
|
||||
jr nc, .resample
|
||||
; in register 'a' is the chosen Pkmn of the LevelGroup
|
||||
; in register 'a' is the chosen mon of the LevelGroup
|
||||
|
||||
; Check if Pkmn was already loaded before
|
||||
; Check if mon was already loaded before
|
||||
; Check current and the 2 previous teams
|
||||
; includes check if item is double at the current team
|
||||
ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
|
||||
@@ -129,42 +129,42 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||
ld b, a
|
||||
ld a, [hld]
|
||||
ld c, a
|
||||
ld a, [wBT_OTPkmn1]
|
||||
ld a, [wBT_OTMon1]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [wBT_OTPkmn1Item]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [wBT_OTMon1Item]
|
||||
cp c
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [wBT_OTPkmn2]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [wBT_OTMon2]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [wBT_OTPkmn2Item]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [wBT_OTMon2Item]
|
||||
cp c
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [wBT_OTPkmn3]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [wBT_OTMon3]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [wBT_OTPkmn3Item]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [wBT_OTMon3Item]
|
||||
cp c
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [sBTPkmnPrevTrainer1]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [sBTMonPrevTrainer1]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [sBTPkmnPrevTrainer2]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [sBTMonPrevTrainer2]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [sBTPkmnPrevTrainer3]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [sBTMonPrevTrainer3]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [sBTPkmnPrevPrevTrainer1]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [sBTMonPrevPrevTrainer1]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [sBTPkmnPrevPrevTrainer2]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [sBTMonPrevPrevTrainer2]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
ld a, [sBTPkmnPrevPrevTrainer3]
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
ld a, [sBTMonPrevPrevTrainer3]
|
||||
cp b
|
||||
jr z, .FindARandomBattleTowerPkmn
|
||||
jr z, .FindARandomBattleTowerMon
|
||||
|
||||
ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
|
||||
call CopyBytes
|
||||
@@ -193,18 +193,18 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||
dec c
|
||||
jp nz, .loop
|
||||
|
||||
ld a, [sBTPkmnPrevTrainer1]
|
||||
ld [sBTPkmnPrevPrevTrainer1], a
|
||||
ld a, [sBTPkmnPrevTrainer2]
|
||||
ld [sBTPkmnPrevPrevTrainer2], a
|
||||
ld a, [sBTPkmnPrevTrainer3]
|
||||
ld [sBTPkmnPrevPrevTrainer3], a
|
||||
ld a, [wBT_OTPkmn1]
|
||||
ld [sBTPkmnPrevTrainer1], a
|
||||
ld a, [wBT_OTPkmn2]
|
||||
ld [sBTPkmnPrevTrainer2], a
|
||||
ld a, [wBT_OTPkmn3]
|
||||
ld [sBTPkmnPrevTrainer3], a
|
||||
ld a, [sBTMonPrevTrainer1]
|
||||
ld [sBTMonPrevPrevTrainer1], a
|
||||
ld a, [sBTMonPrevTrainer2]
|
||||
ld [sBTMonPrevPrevTrainer2], a
|
||||
ld a, [sBTMonPrevTrainer3]
|
||||
ld [sBTMonPrevPrevTrainer3], a
|
||||
ld a, [wBT_OTMon1]
|
||||
ld [sBTMonPrevTrainer1], a
|
||||
ld a, [wBT_OTMon2]
|
||||
ld [sBTMonPrevTrainer2], a
|
||||
ld a, [wBT_OTMon3]
|
||||
ld [sBTMonPrevTrainer3], a
|
||||
call CloseSRAM
|
||||
ret
|
||||
; 1f814e
|
||||
|
||||
Reference in New Issue
Block a user