You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # constants/map_constants.asm # constants/wram_constants.asm # data/radio/oaks_pkmn_talk_routes.asm # data/radio/pnp_hidden_places.asm # engine/battle/core.asm # engine/breeding.asm # engine/phone/phone_scripts.asm # engine/radio.asm # maps/BattleTower1F.asm # maps/OlivineLighthouse2F.asm # maps/OlivineLighthouse6F.asm # maps/PokemonFanClub.asm # maps/RadioTower1F.asm # maps/RadioTower2F.asm # maps/Route30BerryHouse.asm # maps/Route34IlexForestGate.asm # maps/Route36NationalParkGate.asm # maps/RuinsOfAlphKabutoChamber.asm # maps/RuinsOfAlphResearchCenter.asm # maps/VermilionPort.asm # maps/VictoryRoad.asm
This commit is contained in:
@@ -95,7 +95,7 @@ Function170139: ; 170139
|
||||
ld [wMisc], a
|
||||
ld a, l
|
||||
ld [wMisc + 1], a
|
||||
ld hl, wBT_OTTempPkmn1DVs
|
||||
ld hl, wBT_OTTempMon1DVs
|
||||
ld a, [wPlayerID]
|
||||
ld [hli], a
|
||||
ld a, [wPlayerID + 1]
|
||||
@@ -112,7 +112,7 @@ Function170139: ; 170139
|
||||
ld bc, wPlayerID
|
||||
ld de, wPlayerGender
|
||||
farcall GetMobileOTTrainerClass
|
||||
ld de, wBT_OTTempPkmn1CaughtGender
|
||||
ld de, wBT_OTTempMon1CaughtGender
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
@@ -279,59 +279,59 @@ RunBattleTowerTrainer: ; 17024d
|
||||
|
||||
|
||||
ReadBTTrainerParty: ; 1702b7
|
||||
; Initialise the BattleTower-Trainer and his Pkmn
|
||||
; Initialise the BattleTower-Trainer and his mon
|
||||
call CopyBTTrainer_FromBT_OT_TowBT_OTTemp
|
||||
|
||||
; Check the nicknames for illegal characters, and replace bad nicknames
|
||||
; with their species names.
|
||||
ld de, wBT_OTTempPkmn1Name ; $c643
|
||||
ld de, wBT_OTTempMon1Name ; $c643
|
||||
ld c, MON_NAME_LENGTH
|
||||
farcall CheckStringForErrors
|
||||
jr nc, .skip_mon_1
|
||||
|
||||
ld a, [wBT_OTTempPkmn1]
|
||||
ld a, [wBT_OTTempMon1]
|
||||
ld [wNamedObjectIndexBuffer], a
|
||||
call GetPokemonName
|
||||
ld l, e
|
||||
ld h, d
|
||||
ld de, wBT_OTTempPkmn1Name ; $c643
|
||||
ld de, wBT_OTTempMon1Name ; $c643
|
||||
ld bc, MON_NAME_LENGTH
|
||||
call CopyBytes
|
||||
|
||||
.skip_mon_1
|
||||
ld de, wBT_OTTempPkmn2Name ; $c67e
|
||||
ld de, wBT_OTTempMon2Name ; $c67e
|
||||
ld c, MON_NAME_LENGTH
|
||||
farcall CheckStringForErrors
|
||||
jr nc, .skip_mon_2
|
||||
ld a, [wBT_OTTempPkmn2] ; [$c64e]
|
||||
ld a, [wBT_OTTempMon2] ; [$c64e]
|
||||
ld [wNamedObjectIndexBuffer], a
|
||||
call GetPokemonName
|
||||
ld l, e
|
||||
ld h, d
|
||||
ld de, wBT_OTTempPkmn2Name ; $c67e
|
||||
ld de, wBT_OTTempMon2Name ; $c67e
|
||||
ld bc, MON_NAME_LENGTH
|
||||
call CopyBytes
|
||||
|
||||
.skip_mon_2
|
||||
ld de, wBT_OTTempPkmn3Name ; $c686 + 51 = $c6b9
|
||||
ld de, wBT_OTTempMon3Name ; $c686 + 51 = $c6b9
|
||||
ld c, MON_NAME_LENGTH
|
||||
farcall CheckStringForErrors
|
||||
jr nc, .skip_mon_3
|
||||
ld a, [wBT_OTTempPkmn3] ; [$c689]
|
||||
ld a, [wBT_OTTempMon3] ; [$c689]
|
||||
ld [wNamedObjectIndexBuffer], a
|
||||
call GetPokemonName
|
||||
ld l, e
|
||||
ld h, d
|
||||
ld de, wBT_OTTempPkmn3Name ; $c686 + 51 = $c6b9
|
||||
ld de, wBT_OTTempMon3Name ; $c686 + 51 = $c6b9
|
||||
ld bc, MON_NAME_LENGTH
|
||||
call CopyBytes
|
||||
|
||||
.skip_mon_3
|
||||
; Add the terminator character to each of these names
|
||||
ld a, "@"
|
||||
ld [wBT_OTTempPkmn1NameEnd - 1], a ; $c64d
|
||||
ld [wBT_OTTempPkmn2NameEnd - 1], a ; $c688
|
||||
ld [wBT_OTTempPkmn3NameEnd - 1], a ; $c68a + 57 = $c6c3
|
||||
ld [wBT_OTTempMon1NameEnd - 1], a ; $c64d
|
||||
ld [wBT_OTTempMon2NameEnd - 1], a ; $c688
|
||||
ld [wBT_OTTempMon3NameEnd - 1], a ; $c68a + 57 = $c6c3
|
||||
; Fix errors in the movesets
|
||||
call CheckBTMonMovesForErrors
|
||||
; Repair the trainer name if needed, then copy it to wOTPlayerName
|
||||
@@ -360,7 +360,7 @@ ReadBTTrainerParty: ; 1702b7
|
||||
ld a, HIGH(wOTPartyMonNicknames)
|
||||
ld [wBGMapBuffer + 1], a
|
||||
|
||||
; Copy Pkmn into Memory from the address in hl
|
||||
; Copy mon into Memory from the address in hl
|
||||
ld de, wOTPartyMon1Species
|
||||
ld bc, wOTPartyCount
|
||||
ld a, BATTLETOWER_PARTY_LENGTH
|
||||
@@ -398,7 +398,7 @@ ReadBTTrainerParty: ; 1702b7
|
||||
|
||||
ValidateBTParty: ; 170394
|
||||
; Check for and fix errors in party data
|
||||
ld hl, wBT_OTTempPkmn1Species
|
||||
ld hl, wBT_OTTempMon1Species
|
||||
ld d, BATTLETOWER_PARTY_LENGTH
|
||||
.pkmn_loop
|
||||
push de
|
||||
@@ -483,8 +483,8 @@ endr
|
||||
push de
|
||||
ld hl, MON_STAT_EXP - 1
|
||||
add hl, bc
|
||||
ld b, $1
|
||||
predef CalcPkmnStats
|
||||
ld b, TRUE
|
||||
predef CalcMonStats
|
||||
pop de
|
||||
pop hl
|
||||
dec de
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -56,9 +56,9 @@ _CheckForBattleTowerRules: ; 8b201
|
||||
|
||||
.TextPointers: ; 8b222
|
||||
dw JumpText_ExcuseMeYoureNotReady
|
||||
dw JumpText_OnlyThreePkmnMayBeEntered
|
||||
dw JumpText_ThePkmnMustAllBeDifferentKinds
|
||||
dw JumpText_ThePkmnMustNotHoldTheSameItems
|
||||
dw JumpText_OnlyThreeMonMayBeEntered
|
||||
dw JumpText_TheMonMustAllBeDifferentKinds
|
||||
dw JumpText_TheMonMustNotHoldTheSameItems
|
||||
dw JumpText_YouCantTakeAnEgg
|
||||
; 8b22c
|
||||
|
||||
@@ -92,21 +92,21 @@ JumpText_EggDoesNotQualify: ; 0x8b242
|
||||
db "@"
|
||||
; 0x8b247
|
||||
|
||||
JumpText_OnlyThreePkmnMayBeEntered: ; 0x8b247
|
||||
JumpText_OnlyThreeMonMayBeEntered: ; 0x8b247
|
||||
; Only three #MON may be entered.
|
||||
text_jump Text_OnlyThreePkmnMayBeEntered
|
||||
text_jump Text_OnlyThreeMonMayBeEntered
|
||||
db "@"
|
||||
; 0x8b24c
|
||||
|
||||
JumpText_ThePkmnMustAllBeDifferentKinds: ; 0x8b24c
|
||||
JumpText_TheMonMustAllBeDifferentKinds: ; 0x8b24c
|
||||
; The @ #MON must all be different kinds.
|
||||
text_jump Text_ThePkmnMustAllBeDifferentKinds
|
||||
text_jump Text_TheMonMustAllBeDifferentKinds
|
||||
db "@"
|
||||
; 0x8b251
|
||||
|
||||
JumpText_ThePkmnMustNotHoldTheSameItems: ; 0x8b251
|
||||
JumpText_TheMonMustNotHoldTheSameItems: ; 0x8b251
|
||||
; The @ #MON must not hold the same items.
|
||||
text_jump Text_ThePkmnMustNotHoldTheSameItems
|
||||
text_jump Text_TheMonMustNotHoldTheSameItems
|
||||
db "@"
|
||||
; 0x8b256
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ DayCareMan: ; 166d6
|
||||
call GetPriceToRetrieveBreedmon
|
||||
call DayCare_AskWithdrawBreedMon
|
||||
jr c, .print_text
|
||||
farcall RetrievePokemonFromDayCareMan
|
||||
farcall RetrieveMonFromDayCareMan
|
||||
call DayCare_GetBackMonForMoney
|
||||
ld hl, wDayCareMan
|
||||
res DAYCAREMAN_HAS_MON_F, [hl]
|
||||
@@ -83,7 +83,7 @@ DayCareLady: ; 1672a
|
||||
call GetPriceToRetrieveBreedmon
|
||||
call DayCare_AskWithdrawBreedMon
|
||||
jr c, .print_text
|
||||
farcall RetrievePokemonFromDayCareLady
|
||||
farcall RetrieveMonFromDayCareLady
|
||||
call DayCare_GetBackMonForMoney
|
||||
ld hl, wDayCareLady
|
||||
res DAYCARELADY_HAS_MON_F, [hl]
|
||||
@@ -566,8 +566,8 @@ DayCare_GiveEgg: ; 169ac
|
||||
ld e, l
|
||||
pop hl
|
||||
push bc
|
||||
ld b, $0
|
||||
predef CalcPkmnStats
|
||||
ld b, FALSE
|
||||
predef CalcMonStats
|
||||
pop bc
|
||||
ld hl, MON_HP
|
||||
add hl, bc
|
||||
|
||||
@@ -185,8 +185,8 @@ DoNPCTrade: ; fcc63
|
||||
ld a, [wOTTrademonSpecies]
|
||||
ld [wCurPartySpecies], a
|
||||
xor a
|
||||
ld [wMonType], a
|
||||
ld [wPokemonWithdrawDepositParameter], a
|
||||
ld [wMonType], a ; PARTYMON
|
||||
ld [wPokemonWithdrawDepositParameter], a ; REMOVE_PARTY
|
||||
callfar RemoveMonFromPartyOrBox
|
||||
predef TryAddMonToParty
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ DoPoisonStep:: ; 505da
|
||||
ld a, [wPartyCount]
|
||||
cp [hl]
|
||||
jr nz, .party_loop
|
||||
predef CheckPlayerPartyForFitPkmn
|
||||
predef CheckPlayerPartyForFitMon
|
||||
ld a, d
|
||||
ld [wScriptVar], a
|
||||
ret
|
||||
|
||||
@@ -118,7 +118,7 @@ ReturnShuckle: ; 737e
|
||||
cp 150
|
||||
ld a, SHUCKIE_HAPPY
|
||||
jr nc, .HappyToStayWithYou
|
||||
xor a ; take from pc
|
||||
xor a ; REMOVE_PARTY
|
||||
ld [wPokemonWithdrawDepositParameter], a
|
||||
callfar RemoveMonFromPartyOrBox
|
||||
ld a, SHUCKIE_RETURNED
|
||||
|
||||
Reference in New Issue
Block a user