Merge pull request #477 from mid-kid/master

Medium-sized cleanups
This commit is contained in:
yenatch
2018-02-25 20:12:59 -05:00
committed by GitHub
78 changed files with 857 additions and 814 deletions

View File

@@ -74,7 +74,7 @@ SwitchOften: ; 38045
ld a, [wEnemySwitchMonParam]
and $f
inc a
; In register 'a' is the number (1-6) of the Pkmn to switch to
; In register 'a' is the number (1-6) of the mon to switch to
ld [wEnemySwitchMonIndex], a
jp AI_TrySwitch
; 38083

View File

@@ -47,7 +47,7 @@ DoBattle: ; 3c000
.player_2
call LoadTileMapToTempTileMap
call CheckPlayerPartyForFitPkmn
call CheckPlayerPartyForFitMon
ld a, d
and a
jp z, LostBattle
@@ -86,7 +86,7 @@ DoBattle: ; 3c000
call ResetBattleParticipants
call InitBattleMon
call ResetPlayerStatLevels
call SendOutPkmnText
call SendOutMonText
call NewBattleMonStatus
call BreakAttraction
call SendOutPlayerMon
@@ -1697,7 +1697,7 @@ HandleScreens: ; 3cb36
res SCREENS_LIGHT_SCREEN, [hl]
push hl
push de
ld hl, BattleText_PkmnLightScreenFell
ld hl, BattleText_MonsLightScreenFell
call StdBattleTextBox
pop de
pop hl
@@ -1711,7 +1711,7 @@ HandleScreens: ; 3cb36
ld [de], a
ret nz
res SCREENS_REFLECT, [hl]
ld hl, BattleText_PkmnReflectFaded
ld hl, BattleText_MonsReflectFaded
jp StdBattleTextBox
; 3cb9e
@@ -1822,7 +1822,7 @@ SubtractHPFromTarget: ; 3cc39
; 3cc3f
SubtractHPFromUser: ; 3cc3f
; Subtract HP from Pkmn
; Subtract HP from mon
call SubtractHP
jp UpdateHPBarBattleHuds
; 3cc45
@@ -2054,7 +2054,7 @@ HandleEnemyMonFaint: ; 3cd55
xor a
ld [wWhichMonFaintedFirst], a
call UpdateBattleStateAndExperienceAfterEnemyFaint
call CheckPlayerPartyForFitPkmn
call CheckPlayerPartyForFitMon
ld a, d
and a
jp z, LostBattle
@@ -2186,7 +2186,7 @@ UpdateBattleStateAndExperienceAfterEnemyFaint: ; 3ce01
call PlayerMonFaintHappinessMod
.player_mon_did_not_faint
call CheckPlayerPartyForFitPkmn
call CheckPlayerPartyForFitMon
ld a, d
and a
ret z
@@ -2308,7 +2308,7 @@ FaintYourPokemon: ; 3cef1
hlcoord 9, 7
lb bc, 5, 11
call ClearBox
ld hl, BattleText_PkmnFainted
ld hl, BattleText_MonFainted
jp StdBattleTextBox
; 3cf14
@@ -2322,7 +2322,7 @@ FaintEnemyPokemon: ; 3cf14
hlcoord 1, 0
lb bc, 4, 10
call ClearBox
ld hl, BattleText_EnemyPkmnFainted
ld hl, BattleText_EnemyMonFainted
jp StdBattleTextBox
; 3cf35
@@ -2670,7 +2670,7 @@ HandlePlayerMonFaint: ; 3d14e
ld a, $1
ld [wWhichMonFaintedFirst], a
call PlayerMonFaintHappinessMod
call CheckPlayerPartyForFitPkmn
call CheckPlayerPartyForFitMon
ld a, d
and a
jp z, LostBattle
@@ -2829,7 +2829,7 @@ ForcePlayerMonChoice: ; 3d227
call CloseWindow
call GetMemSGBLayout
call SetPalettes
call SendOutPkmnText
call SendOutMonText
call NewBattleMonStatus
call BreakAttraction
call SendOutPlayerMon
@@ -2851,7 +2851,7 @@ PlayerPartyMonEntrance: ; 3d2b3
call AddBattleParticipant
call InitBattleMon
call ResetPlayerStatLevels
call SendOutPkmnText
call SendOutMonText
call NewBattleMonStatus
call BreakAttraction
call SendOutPlayerMon
@@ -2934,7 +2934,7 @@ SwitchMonAlreadyOut: ; 3d34f
cp [hl]
jr nz, .notout
ld hl, BattleText_PkmnIsAlreadyOut
ld hl, BattleText_MonIsAlreadyOut
call StdBattleTextBox
scf
ret
@@ -3197,11 +3197,11 @@ ForceEnemySwitch: ; 3d4c3
ld a, [wEnemySwitchMonIndex]
dec a
ld b, a
call LoadEnemyPkmnToSwitchTo
call LoadEnemyMonToSwitchTo
call ClearEnemyMonBox
call NewEnemyMonStatus
call ResetEnemyStatLevels
call Function_SetEnemyPkmnAndSendOutAnimation
call Function_SetEnemyMonAndSendOutAnimation
call BreakAttraction
call ResetBattleParticipants
ret
@@ -3214,15 +3214,15 @@ EnemySwitch: ; 3d4e1
call ResetEnemyBattleVars
call CheckWhetherSwitchmonIsPredetermined
jr c, .skip
call FindPkmnInOTPartyToSwitchIntoBattle
call FindMonInOTPartyToSwitchIntoBattle
.skip
; 'b' contains the PartyNr of the Pkmn the AI will switch to
call LoadEnemyPkmnToSwitchTo
; 'b' contains the PartyNr of the mon the AI will switch to
call LoadEnemyMonToSwitchTo
call OfferSwitch
push af
call ClearEnemyMonBox
call Function_BattleTextEnemySentOut
call Function_SetEnemyPkmnAndSendOutAnimation
call Function_SetEnemyMonAndSendOutAnimation
pop af
ret c
; If we're here, then we're switching too
@@ -3240,15 +3240,15 @@ EnemySwitch_SetMode: ; 3d517
call ResetEnemyBattleVars
call CheckWhetherSwitchmonIsPredetermined
jr c, .skip
call FindPkmnInOTPartyToSwitchIntoBattle
call FindMonInOTPartyToSwitchIntoBattle
.skip
; 'b' contains the PartyNr of the Pkmn the AI will switch to
call LoadEnemyPkmnToSwitchTo
; 'b' contains the PartyNr of the mon the AI will switch to
call LoadEnemyMonToSwitchTo
ld a, 1
ld [wEnemyIsSwitching], a
call ClearEnemyMonBox
call Function_BattleTextEnemySentOut
jp Function_SetEnemyPkmnAndSendOutAnimation
jp Function_SetEnemyMonAndSendOutAnimation
; 3d533
CheckWhetherSwitchmonIsPredetermined: ; 3d533
@@ -3319,7 +3319,7 @@ AddBattleParticipant: ; 3d581
predef_jump SmallFarFlagAction
; 3d599
FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
FindMonInOTPartyToSwitchIntoBattle: ; 3d599
ld b, $ff
ld a, $1
ld [wBuffer1], a
@@ -3347,7 +3347,7 @@ FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
pop bc
jr z, .discourage
call LookUpTheEffectivenessOfEveryMove
call IsThePlayerPkmnTypesEffectiveAgainstOTPkmn
call IsThePlayerMonTypesEffectiveAgainstOTMon
jr .loop
.discourage
@@ -3394,9 +3394,9 @@ LookUpTheEffectivenessOfEveryMove: ; 3d5d7
ret
; 3d618
IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618
; Calculates the effectiveness of the types of the PlayerPkmn
; against the OTPkmn
IsThePlayerMonTypesEffectiveAgainstOTMon: ; 3d618
; Calculates the effectiveness of the types of the PlayerMon
; against the OTMon
push bc
ld hl, wOTPartyCount
ld a, b
@@ -3508,8 +3508,8 @@ ScoreMonTypeMatchups: ; 3d672
ret
; 3d6ca
LoadEnemyPkmnToSwitchTo: ; 3d6ca
; 'b' contains the PartyNr of the Pkmn the AI will switch to
LoadEnemyMonToSwitchTo: ; 3d6ca
; 'b' contains the PartyNr of the mon the AI will switch to
ld a, b
ld [wCurPartyMon], a
ld hl, wOTPartyMon1Level
@@ -3581,7 +3581,7 @@ OfferSwitch: ; 3d74b
ld a, [wCurPartyMon]
push af
callfar Battle_GetTrainerName
ld hl, BattleText_EnemyIsAboutToUseWillPlayerChangePkmn
ld hl, BattleText_EnemyIsAboutToUseWillPlayerChangeMon
call StdBattleTextBox
lb bc, 1, 7
call PlaceYesNoBox
@@ -3637,14 +3637,14 @@ Function_BattleTextEnemySentOut: ; 3d7b8
jp WaitBGMap
; 3d7c7
Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7
Function_SetEnemyMonAndSendOutAnimation: ; 3d7c7
ld a, [wTempEnemyMonSpecies]
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, OTPARTYMON
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
call GetEnemyMonFrontpic
xor a
@@ -3721,8 +3721,8 @@ ResetEnemyStatLevels: ; 3d867
ret
; 3d873
CheckPlayerPartyForFitPkmn: ; 3d873
; Has the player any Pkmn in his Party that can fight?
CheckPlayerPartyForFitMon: ; 3d873
; Has the player any mon in his Party that can fight?
ld a, [wPartyCount]
ld e, a
xor a
@@ -4308,7 +4308,7 @@ PursuitSwitch: ; 3dc5b
ld b, RESET_FLAG
predef SmallFarFlagAction
call PlayerMonFaintedAnimation
ld hl, BattleText_PkmnFainted
ld hl, BattleText_MonFainted
jr .done_fainted
.check_enemy_fainted
@@ -4324,7 +4324,7 @@ PursuitSwitch: ; 3dc5b
call PlaySFX
call WaitSFX
call EnemyMonFaintedAnimation
ld hl, BattleText_EnemyPkmnFainted
ld hl, BattleText_EnemyMonFainted
.done_fainted
call StdBattleTextBox
@@ -5306,7 +5306,7 @@ TryPlayerSwitch: ; 3e358
ld a, [wCurPartyMon]
cp d
jr nz, .check_trapped
ld hl, BattleText_PkmnIsAlreadyOut
ld hl, BattleText_MonIsAlreadyOut
call StdBattleTextBox
jp BattleMenuPKMN_Loop
@@ -5319,7 +5319,7 @@ TryPlayerSwitch: ; 3e358
jr z, .try_switch
.trapped
ld hl, BattleText_PkmnCantBeRecalled
ld hl, BattleText_MonCantBeRecalled
call StdBattleTextBox
jp BattleMenuPKMN_Loop
@@ -5396,7 +5396,7 @@ EnemyMonEntrance: ; 3e3ff
; 3e40b
BattleMonEntrance: ; 3e40b
call WithdrawPkmnText
call WithdrawMonText
ld c, 50
call DelayFrames
@@ -5419,7 +5419,7 @@ BattleMonEntrance: ; 3e40b
call AddBattleParticipant
call InitBattleMon
call ResetPlayerStatLevels
call SendOutPkmnText
call SendOutMonText
call NewBattleMonStatus
call BreakAttraction
call SendOutPlayerMon
@@ -5938,7 +5938,7 @@ CheckPlayerHasUsableMoves: ; 3e786
ret nz
.force_struggle
ld hl, BattleText_PkmnHasNoMovesLeft
ld hl, BattleText_MonHasNoMovesLeft
call StdBattleTextBox
ld c, 60
call DelayFrames
@@ -6408,7 +6408,7 @@ LoadEnemyMon: ; 3e8eb
ld de, wEnemyMonMaxHP
ld b, FALSE
ld hl, wEnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1) ; wLinkBattleRNs + 7 ; ?
predef CalcPkmnStats
predef CalcMonStats
; If we're in a trainer battle,
; get the rest of the parameters from the party struct
@@ -7350,7 +7350,7 @@ GiveExperiencePoints: ; 3ee3b
ld a, [wCurPartyMon]
ld hl, wPartyMonNicknames
call GetNick
ld hl, Text_PkmnGainedExpPoint
ld hl, Text_MonGainedExpPoint
call BattleTextBox
ld a, [wStringBuffer2 + 1]
ld [hQuotient + 2], a
@@ -7419,7 +7419,7 @@ GiveExperiencePoints: ; 3ee3b
.not_max_exp
xor a ; PARTYMON
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
callfar CalcLevel
pop bc
ld hl, MON_LEVEL
@@ -7456,7 +7456,7 @@ GiveExperiencePoints: ; 3ee3b
add hl, bc
push bc
ld b, TRUE
predef CalcPkmnStats
predef CalcMonStats
pop bc
pop de
ld hl, MON_MAXHP + 1
@@ -7532,7 +7532,7 @@ GiveExperiencePoints: ; 3ee3b
.skip_animation2
xor a ; PARTYMON
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
hlcoord 9, 0
ld b, $a
ld c, $9
@@ -7648,7 +7648,7 @@ BoostExp: ; 3f106
ret
; 3f11b
Text_PkmnGainedExpPoint: ; 3f11b
Text_MonGainedExpPoint: ; 3f11b
text_jump Text_Gained
start_asm
ld hl, TextJump_StringBuffer2ExpPoints
@@ -7692,7 +7692,7 @@ AnimateExpBar: ; 3f136
ld [wd002], a
xor a ; PARTYMON
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
ld a, [wTempMonLevel]
ld b, a
ld e, a
@@ -7856,23 +7856,23 @@ AnimateExpBar: ; 3f136
ld [hBGMapMode], a
ret
SendOutPkmnText: ; 3f26d
SendOutMonText: ; 3f26d
ld a, [wLinkMode]
and a
jr z, .not_linked
ld hl, JumpText_GoPkmn ; If we're in a LinkBattle print just "Go <PlayerMon>"
ld hl, JumpText_GoMon ; If we're in a LinkBattle print just "Go <PlayerMon>"
ld a, [wBattleHasJustStarted] ; unless this (unidentified) variable is set
and a
jr nz, .skip_to_textbox
.not_linked
; Depending on the HP of the enemy Pkmn, the game prints a different text
; Depending on the HP of the enemy mon, the game prints a different text
ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
ld hl, JumpText_GoPkmn
ld hl, JumpText_GoMon
jr z, .skip_to_textbox
; compute enemy helth remaining as a percentage
@@ -7901,43 +7901,43 @@ SendOutPkmnText: ; 3f26d
call Divide
ld a, [hQuotient + 2]
ld hl, JumpText_GoPkmn
ld hl, JumpText_GoMon
cp 70
jr nc, .skip_to_textbox
ld hl, JumpText_DoItPkmn
ld hl, JumpText_DoItMon
cp 40
jr nc, .skip_to_textbox
ld hl, JumpText_GoForItPkmn
ld hl, JumpText_GoForItMon
cp 10
jr nc, .skip_to_textbox
ld hl, JumpText_YourFoesWeakGetmPkmn
ld hl, JumpText_YourFoesWeakGetmMon
.skip_to_textbox
jp BattleTextBox
; 3f2d1
JumpText_GoPkmn: ; 3f2d1
text_jump Text_GoPkmn
JumpText_GoMon: ; 3f2d1
text_jump Text_GoMon
start_asm
jr Function_TextJump_BattleMonNick01
; 3f2d6
JumpText_DoItPkmn: ; 3f2d8
text_jump Text_DoItPkmn
JumpText_DoItMon: ; 3f2d8
text_jump Text_DoItMon
start_asm
jr Function_TextJump_BattleMonNick01
; 3f2dd
JumpText_GoForItPkmn: ; 3f2df
text_jump Text_GoForItPkmn
JumpText_GoForItMon: ; 3f2df
text_jump Text_GoForItMon
start_asm
jr Function_TextJump_BattleMonNick01
; 3f2e4
JumpText_YourFoesWeakGetmPkmn: ; 3f2e6
text_jump Text_YourFoesWeakGetmPkmn
JumpText_YourFoesWeakGetmMon: ; 3f2e6
text_jump Text_YourFoesWeakGetmMon
start_asm
Function_TextJump_BattleMonNick01: ; 3f2eb
ld hl, TextJump_BattleMonNick01
@@ -7949,14 +7949,14 @@ TextJump_BattleMonNick01: ; 3f2ef
db "@"
; 3f2f4
WithdrawPkmnText: ; 3f2f4
ld hl, .WithdrawPkmnText
WithdrawMonText: ; 3f2f4
ld hl, .WithdrawMonText
jp BattleTextBox
.WithdrawPkmnText:
.WithdrawMonText:
text_jump Text_BattleMonNickComma
start_asm
; Print text to withdraw Pkmn
; Print text to withdraw mon
; depending on HP the message is different
push de
push bc
@@ -8037,7 +8037,7 @@ Unreferenced_HandleSafariAngerEatingStatus:
and a
jr z, .angry
dec [hl]
ld hl, BattleText_WildPkmnIsEating
ld hl, BattleText_WildMonIsEating
jr .finish
.angry
@@ -8046,7 +8046,7 @@ Unreferenced_HandleSafariAngerEatingStatus:
and a
ret z
dec [hl]
ld hl, BattleText_WildPkmnIsAngry
ld hl, BattleText_WildMonIsAngry
jr nz, .finish
push hl
ld a, [wEnemyMonSpecies]

View File

@@ -203,7 +203,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0)
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [wCurPartyMon], a
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
call ReleasePKMN_ByePKMN
@@ -463,7 +463,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [wCurPartyMon], a
ld a, PC_DEPOSIT
ld a, REMOVE_BOX
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
call ReleasePKMN_ByePKMN
@@ -591,7 +591,7 @@ _MovePKMNWithoutMail: ; e2759
ld a, [hl]
and A_BUTTON
jr nz, .a_button
call MovePkmnWithoutMail_DPad
call MoveMonWithoutMail_DPad
jr c, .d_pad
and a
ret z
@@ -750,7 +750,7 @@ _MovePKMNWithoutMail: ; e2759
ld a, [hl]
and A_BUTTON
jr nz, .a_button_2
call MovePkmnWithoutMail_DPad_2
call MoveMonWithoutMail_DPad_2
jr c, .dpad_2
and a
ret z
@@ -862,7 +862,7 @@ Withdraw_UpDown: ; e29b5 (38:69b5)
jp BillsPC_JoypadDidNothing
; e29d0 (38:69d0)
MovePkmnWithoutMail_DPad: ; e29d0
MoveMonWithoutMail_DPad: ; e29d0
ld hl, hJoyLast
ld a, [wBillsPC_NumMonsOnScreen]
ld d, a
@@ -886,7 +886,7 @@ MovePkmnWithoutMail_DPad: ; e29d0
jr nz, BillsPC_PressRight
jr BillsPC_JoypadDidNothing
MovePkmnWithoutMail_DPad_2: ; e29f4
MoveMonWithoutMail_DPad_2: ; e29f4
ld hl, hJoyLast
ld a, [wBillsPC_NumMonsOnScreen]
ld d, a
@@ -1763,7 +1763,7 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6)
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
call CloseSRAM
farcall CalcwBufferMonStats
farcall CalcBufferMonStats
ret
.party
@@ -1806,7 +1806,7 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6)
ld bc, BOXMON_STRUCT_LENGTH
call CopyMonToTemp
call CloseSRAM
farcall CalcwBufferMonStats
farcall CalcBufferMonStats
ret
DepositPokemon: ; e307c (38:707c)
@@ -1819,9 +1819,9 @@ DepositPokemon: ; e307c (38:707c)
call GetNick
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
predef SendGetPkmnIntoFromBox
predef SendGetMonIntoFromBox
jr c, .asm_boxisfull
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ld a, [wCurPartySpecies]
@@ -1874,9 +1874,9 @@ TryWithdrawPokemon: ; e30fa (38:70fa)
call CloseSRAM
xor a
ld [wPokemonWithdrawDepositParameter], a
predef SendGetPkmnIntoFromBox
predef SendGetMonIntoFromBox
jr c, .PartyFull
ld a, PC_DEPOSIT
ld a, REMOVE_BOX
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ld a, [wCurPartySpecies]
@@ -2010,7 +2010,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
.dw_return ; e322a
pop af
ld e, a
farcall MovePkmnWOMail_InsertMon_SaveGame
farcall MoveMonWOMail_InsertMon_SaveGame
ret
; e3233
@@ -2095,7 +2095,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld a, [wBillsPC_BackupLoadedBox]
dec a
ld e, a
farcall MovePkmnWOMail_SaveGame
farcall MoveMonWOMail_SaveGame
ld a, [wBillsPC_BackupCursorPosition]
ld hl, wBillsPC_BackupScrollPosition
add [hl]
@@ -2112,8 +2112,8 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld bc, BOXMON_STRUCT_LENGTH
call CopyMonToTemp
call CloseSRAM
farcall CalcwBufferMonStats
ld a, PC_DEPOSIT
farcall CalcBufferMonStats
ld a, REMOVE_BOX
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ret
@@ -2123,7 +2123,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld a, [wBillsPC_LoadedBox]
dec a
ld e, a
farcall MovePkmnWOMail_SaveGame
farcall MoveMonWOMail_SaveGame
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
@@ -2146,7 +2146,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call CopyMonToTemp
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ret

View File

@@ -117,7 +117,7 @@ BillsPC_MovePKMNMenu: ; e4cd
jr .quit
.no_mail
farcall StartMovePkmnWOMail_SaveGame
farcall StartMoveMonWOMail_SaveGame
jr c, .quit
farcall _MovePKMNWithoutMail
call ReturnToMapFromSubmenu
@@ -145,30 +145,30 @@ BillsPC_DepositMenu: ; e4fe (3:64fe)
Unreferenced_Functione512:
ld a, [wPartyCount]
and a
jr z, .no_pkmn
jr z, .no_mon
cp 2
jr c, .only_one_pkmn
jr c, .only_one_mon
and a
ret
.no_pkmn
ld hl, .Text_NoPKMN
.no_mon
ld hl, .Text_NoMon
call MenuTextBoxBackup
scf
ret
.only_one_pkmn
ld hl, .Text_ItsYourLastPKMN
.only_one_mon
ld hl, .Text_ItsYourLastMon
call MenuTextBoxBackup
scf
ret
.Text_NoPKMN: ; 0xe52e
.Text_NoMon: ; 0xe52e
; You don't have a single #MON!
text_jump UnknownText_0x1c1062
db "@"
.Text_ItsYourLastPKMN: ; 0xe533
.Text_ItsYourLastMon: ; 0xe533
; You can't deposit your last #MON!
text_jump UnknownText_0x1c1080
db "@"

View File

@@ -288,8 +288,8 @@ HatchEggs: ; 16f70 (5:6f70)
push hl
ld bc, MON_STAT_EXP - 1
add hl, bc
ld b, $0
predef CalcPkmnStats
ld b, FALSE
predef CalcMonStats
pop bc
ld hl, MON_MAXHP
add hl, bc

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -44,7 +44,7 @@ Special_DayCareMan: ; 166d6
call GetPriceToRetrieveBreedmon
call DayCare_AskWithdrawBreedMon
jr c, .print_text
farcall RetrievePokemonFromDayCareMan
farcall RetrieveMonFromDayCareMan
call DayCare_GetBackMonForMoney
ld hl, wDayCareMan
res 0, [hl]
@@ -83,7 +83,7 @@ Special_DayCareLady: ; 1672a
call GetPriceToRetrieveBreedmon
call DayCare_AskWithdrawBreedMon
jr c, .print_text
farcall RetrievePokemonFromDayCareLady
farcall RetrieveMonFromDayCareLady
call DayCare_GetBackMonForMoney
ld hl, wDayCareLady
res 0, [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

View File

@@ -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

View File

@@ -118,7 +118,7 @@ Special_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

View File

@@ -55,7 +55,7 @@ EvolveAfterBattle_MasterLoop
push hl
xor a
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
pop hl
.loop
@@ -264,8 +264,8 @@ EvolveAfterBattle_MasterLoop
ld hl, wTempMonExp + 2
ld de, wTempMonMaxHP
ld b, $1
predef CalcPkmnStats
ld b, TRUE
predef CalcMonStats
ld a, [wCurPartyMon]
ld hl, wPartyMons

View File

@@ -623,7 +623,7 @@ ParkBall: ; e8a2
.SendToPC:
call ClearSprites
predef SendPkmnIntoBox
predef SendMonIntoBox
farcall SetBoxMonCaughtData
@@ -1282,8 +1282,8 @@ UpdateStatsAfterItem: ; ee8c
ld e, l
ld a, MON_STAT_EXP - 1
call GetPartyParamLocation
ld b, $1
predef_jump CalcPkmnStats
ld b, TRUE
predef_jump CalcMonStats
; ee9f
RareCandy_StatBooster_ExitMenu: ; ee9f
@@ -1422,7 +1422,7 @@ RareCandy: ; ef14
xor a ; PARTYMON
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
hlcoord 9, 0
ld b, 10
@@ -1846,13 +1846,13 @@ UseItem_SelectMon: ; f1f9 (3:71f9)
push de
push bc
call ClearBGPalettes
call ChoosePkmnToUseItemOn
call ChooseMonToUseItemOn
pop bc
pop de
pop hl
ret
ChoosePkmnToUseItemOn: ; f21c (3:721c)
ChooseMonToUseItemOn: ; f21c (3:721c)
farcall LoadPartyMenuGFX
farcall InitPartyMenuWithCancel
farcall InitPartyMenuGFX
@@ -2154,7 +2154,7 @@ Softboiled_MilkDrinkFunction: ; f3df (3:73df)
push bc
ld a, PARTYMENUACTION_HEALING_ITEM
ld [wPartyMenuActionText], a
call ChoosePkmnToUseItemOn
call ChooseMonToUseItemOn
pop bc
jr c, .set_carry
ld a, [wPartyMenuCursor]
@@ -2475,7 +2475,7 @@ Mysteryberry: ; f5bf
ld [wd002], a
.loop
; Party Screen opens to choose on which Pkmn to use the Item
; Party Screen opens to choose on which mon to use the Item
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
jp c, PPRestoreItem_Cancel

View File

@@ -790,7 +790,7 @@ Link_PrepPartyData_Gen1: ; 28499
add hl, bc
ld c, STAT_SATK
ld b, TRUE
predef CalcPkmnStatC
predef CalcMonStatC
pop bc
pop de
@@ -1069,7 +1069,7 @@ Function2868a: ; 2868a
add hl, bc
ld c, STAT_SATK
ld b, TRUE
predef CalcPkmnStatC
predef CalcMonStatC
pop bc
pop hl
ld a, [hQuotient + 1]
@@ -1082,7 +1082,7 @@ Function2868a: ; 2868a
add hl, bc
ld c, STAT_SDEF
ld b, TRUE
predef CalcPkmnStatC
predef CalcMonStatC
pop bc
pop hl
ld a, [hQuotient + 1]
@@ -1863,7 +1863,7 @@ LinkTrade: ; 28b87
add hl, bc
ld a, [hl]
ld [wd002], a
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
callfar RemoveMonFromPartyOrBox
ld a, [wPartyCount]

View File

@@ -175,7 +175,7 @@ CheckPokeItem:: ; 44654
farcall CheckCurPartyMonFainted
ld a, POKEMAIL_LAST_MON
jr c, .close_sram_return
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ld a, POKEMAIL_CORRECT

View File

@@ -343,7 +343,7 @@ Unused_PlaceEnemyHPLevel:
call GetNick
pop hl
call PlaceString
call CopyPkmnToTempMon
call CopyMonToTempMon
pop hl
ld a, [wCurPartySpecies]
cp EGG

View File

@@ -1,5 +1,5 @@
TryAddMonToParty: ; d88c
; Check if to copy wild Pkmn or generate new Pkmn
; Check if to copy wild mon or generate a new one
; Whose is it?
ld de, wPartyCount
ld a, [wMonType]
@@ -47,6 +47,7 @@ TryAddMonToParty: ; d88c
ld hl, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
; Only initialize the nickname for party mon
ld a, [wMonType]
and a
jr nz, .skipnickname
@@ -76,24 +77,34 @@ TryAddMonToParty: ; d88c
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
GeneratePartyMonStats: ; d906
; wBattleMode specifies whether it's a wild mon or not.
; wMonType specifies whether it's an opposing mon or not.
; wCurPartySpecies/wCurPartyLevel specify the species and level.
; hl points to the wPartyMon struct to fill.
ld e, l
ld d, h
push hl
; Initialize the species
ld a, [wCurPartySpecies]
ld [wCurSpecies], a
call GetBaseData
ld a, [wBaseDexNo]
ld [de], a
inc de
; Copy the item if it's a wild mon
ld a, [wBattleMode]
and a
ld a, $0
jr z, .skipitem
ld a, [wEnemyMonItem]
.skipitem
ld [de], a
inc de
; Copy the moves if it's a wild mon
push de
ld h, d
ld l, e
@@ -124,15 +135,19 @@ GeneratePartyMonStats: ; d906
.next
pop de
rept 4
rept NUM_MOVES
inc de
endr
; Initialize ID.
ld a, [wPlayerID]
ld [de], a
inc de
ld a, [wPlayerID + 1]
ld [de], a
inc de
; Initialize Exp.
push de
ld a, [wCurPartyLevel]
ld d, a
@@ -147,24 +162,28 @@ endr
ld a, [hProduct + 3]
ld [de], a
inc de
; Initialize stat experience.
xor a
ld b, $a
ld b, MON_DVS - MON_STAT_EXP
.loop
ld [de], a
inc de
dec b
jr nz, .loop
pop hl
push hl
ld a, [wMonType]
and $f
jr z, .generateDVs
jr z, .registerpokedex
push hl
farcall GetTrainerDVs
pop hl
jr .initializetrainermonstats
jr .initializeDVs
.generateDVs
.registerpokedex
ld a, [wCurPartySpecies]
ld [wd265], a
dec a
@@ -174,23 +193,26 @@ endr
dec a
call SetSeenAndCaughtMon
pop de
pop hl
push hl
ld a, [wBattleMode]
and a
jr nz, .copywildmonstats
jr nz, .copywildmonDVs
call Random
ld b, a
call Random
ld c, a
.initializetrainermonstats
.initializeDVs
ld a, b
ld [de], a
inc de
ld a, c
ld [de], a
inc de
; Initialize PP.
push hl
push de
inc hl
@@ -201,39 +223,52 @@ endr
rept 4
inc de
endr
ld a, 70
; Initialize happiness.
ld a, BASE_HAPPINESS
ld [de], a
inc de
xor a
; PokerusStatus
ld [de], a
inc de
; CaughtData/CaughtTime/CaughtLevel
ld [de], a
inc de
; CaughtGender/CaughtLocation
ld [de], a
inc de
; Initialize level.
ld a, [wCurPartyLevel]
ld [de], a
inc de
xor a
; Status
ld [de], a
inc de
; Unused
ld [de], a
inc de
ld bc, 10
; Initialize HP.
ld bc, MON_STAT_EXP - 1
add hl, bc
ld a, $1
ld a, 1
ld c, a
ld b, FALSE
call CalcPkmnStatC
call CalcMonStatC
ld a, [hProduct + 2]
ld [de], a
inc de
ld a, [hProduct + 3]
ld [de], a
inc de
jr .next2
jr .initstats
.copywildmonstats
.copywildmonDVs
ld a, [wEnemyMonDVs]
ld [de], a
inc de
@@ -252,19 +287,27 @@ endr
jr nz, .wildmonpploop
pop hl
; Initialize happiness.
ld a, BASE_HAPPINESS
ld [de], a
inc de
xor a
; PokerusStatus
ld [de], a
inc de
; CaughtData/CaughtTime/CaughtLevel
ld [de], a
inc de
; CaughtGender/CaughtLocation
ld [de], a
inc de
; Initialize level.
ld a, [wCurPartyLevel]
ld [de], a
inc de
ld hl, wEnemyMonStatus
; Copy wEnemyMonStatus
ld a, [hli]
@@ -282,24 +325,24 @@ endr
ld [de], a
inc de
.next2
.initstats
ld a, [wBattleMode]
dec a
jr nz, .generatestats
ld hl, wEnemyMonMaxHP
ld bc, 2 * 6 ; MaxHP + 5 Stats
ld bc, PARTYMON_STRUCT_LENGTH - MON_MAXHP
call CopyBytes
pop hl
jr .next3
jr .registerunowndex
.generatestats
pop hl
ld bc, MON_STAT_EXP - 1
add hl, bc
ld b, $0 ; if b = 1, then stat calculation takes stat exp into account.
call CalcPkmnStats
ld b, FALSE
call CalcMonStats
.next3
.registerunowndex
ld a, [wMonType]
and $f
jr nz, .done
@@ -434,12 +477,12 @@ AddTempmonToParty: ; da96
and a
ret
SendGetPkmnIntoFromBox: ; db3f
; Sents/Gets Pkmn into/from Box depending on Parameter
; wPokemonWithdrawDepositParameter == 0: get Pkmn into Party
; wPokemonWithdrawDepositParameter == 1: sent Pkmn into Box
; wPokemonWithdrawDepositParameter == 2: get Pkmn from DayCare
; wPokemonWithdrawDepositParameter == 3: put Pkmn into DayCare
SendGetMonIntoFromBox: ; db3f
; Sents/Gets mon into/from Box depending on Parameter
; wPokemonWithdrawDepositParameter == 0: get mon into Party
; wPokemonWithdrawDepositParameter == 1: sent mon into Box
; wPokemonWithdrawDepositParameter == 2: get mon from DayCare
; wPokemonWithdrawDepositParameter == 3: put mon into DayCare
ld a, BANK(sBoxCount)
call GetSRAMBank
@@ -452,7 +495,7 @@ SendGetPkmnIntoFromBox: ; db3f
ld hl, wBreedMon1Species
jr z, .breedmon
; we want to sent a Pkmn into the Box
; we want to sent a mon into the Box
; so check if there's enough space
ld hl, sBoxCount
ld a, [hl]
@@ -597,7 +640,7 @@ SendGetPkmnIntoFromBox: ; db3f
srl a
add $2
ld [wMonType], a
predef CopyPkmnToTempMon
predef CopyMonToTempMon
callfar CalcLevel
ld a, d
ld [wCurPartyLevel], a
@@ -616,8 +659,8 @@ SendGetPkmnIntoFromBox: ; db3f
add hl, bc
push bc
ld b, $1
call CalcPkmnStats
ld b, TRUE
call CalcMonStats
pop bc
ld a, [wPokemonWithdrawDepositParameter]
@@ -732,7 +775,7 @@ RestorePPofDepositedPokemon: ; dcb6
ret
; dd21
RetrievePokemonFromDayCareMan: ; dd21
RetrieveMonFromDayCareMan: ; dd21
ld a, [wBreedMon1Species]
ld [wCurPartySpecies], a
ld de, SFX_TRANSACTION
@@ -745,10 +788,10 @@ RetrievePokemonFromDayCareMan: ; dd21
ld [wCurPartyLevel], a
xor a
ld [wPokemonWithdrawDepositParameter], a
jp Functiondd64
jp RetrieveBreedmon
; dd42
RetrievePokemonFromDayCareLady: ; dd42
RetrieveMonFromDayCareLady: ; dd42
ld a, [wBreedMon2Species]
ld [wCurPartySpecies], a
ld de, SFX_TRANSACTION
@@ -761,10 +804,10 @@ RetrievePokemonFromDayCareLady: ; dd42
ld [wCurPartyLevel], a
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
jp Functiondd64
jp RetrieveBreedmon
; dd64
Functiondd64: ; dd64
RetrieveBreedmon: ; dd64
ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
@@ -810,12 +853,12 @@ Functiondd64: ; dd64
pop hl
call CopyBytes
push hl
call Functionde1a
call GetLastPartyMon
pop hl
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
call GetBaseData
call Functionde1a
call GetLastPartyMon
ld b, d
ld c, e
ld hl, MON_LEVEL
@@ -829,8 +872,8 @@ Functiondd64: ; dd64
ld hl, $a
add hl, bc
push bc
ld b, $1
call CalcPkmnStats
ld b, TRUE
call CalcMonStats
ld hl, wPartyMon1Moves
ld a, [wPartyCount]
dec a
@@ -861,7 +904,7 @@ Functiondd64: ; dd64
ret
; de1a
Functionde1a: ; de1a
GetLastPartyMon: ; de1a
ld a, [wPartyCount]
dec a
ld hl, wPartyMon1Species
@@ -875,7 +918,7 @@ Functionde1a: ; de1a
DepositMonWithDayCareMan: ; de2a
ld de, wBreedMon1Nick
call DepositBreedmon
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
jp RemoveMonFromPartyOrBox
; de37
@@ -883,7 +926,7 @@ DepositMonWithDayCareMan: ; de2a
DepositMonWithDayCareLady: ; de37
ld de, wBreedMon2Nick
call DepositBreedmon
xor a
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
jp RemoveMonFromPartyOrBox
; de44
@@ -904,8 +947,8 @@ DepositBreedmon: ; de44
ld bc, BOXMON_STRUCT_LENGTH
jp CopyBytes
SendPkmnIntoBox: ; de6e
; Sends the Pkmn into one of Bills Boxes
SendMonIntoBox: ; de6e
; Sends the mon into one of Bills Boxes
; the data comes mainly from 'wEnemyMon:'
ld a, BANK(sBoxCount)
call GetSRAMBank
@@ -1359,8 +1402,8 @@ ComputeNPCTrademonStats: ; e134
push de
ld a, MON_STAT_EXP - 1
call GetPartyParamLocation
ld b, $1
call CalcPkmnStats
ld b, TRUE
call CalcMonStats
pop de
ld a, MON_HP
call GetPartyParamLocation
@@ -1372,17 +1415,17 @@ ComputeNPCTrademonStats: ; e134
ret
; e167
CalcPkmnStats: ; e167
; Calculates all 6 Stats of a Pkmn
CalcMonStats: ; e167
; Calculates all 6 Stats of a mon
; b: Take into account stat EXP if TRUE
; 'c' counts from 1-6 and points with 'wBaseStats' to the base value
; hl is the path to the Stat EXP
; results in $ffb5 and $ffb6 are saved in [de]
; de points to where the final stats will be saved
ld c, $0
.loop
inc c
call CalcPkmnStatC
call CalcMonStatC
ld a, [hMultiplicand + 1]
ld [de], a
inc de
@@ -1395,7 +1438,7 @@ CalcPkmnStats: ; e167
ret
; e17b
CalcPkmnStatC: ; e17b
CalcMonStatC: ; e17b
; 'c' is 1-6 and points to the BaseStat
; 1: HP
; 2: Attack
@@ -1626,7 +1669,7 @@ GivePoke:: ; e277
ld a, [wCurPartySpecies]
ld [wTempEnemyMonSpecies], a
callfar LoadEnemyMon
call SendPkmnIntoBox
call SendMonIntoBox
jp nc, .FailedToGiveMon
ld a, BOXMON
ld [wMonType], a

View File

@@ -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

View File

@@ -494,7 +494,7 @@ UseItem: ; 10311
ret
.NoPokemon:
ld hl, TextJump_YouDontHaveAPkmn
ld hl, TextJump_YouDontHaveAMon
call Pack_PrintTextNoScroll
ret
@@ -648,7 +648,7 @@ GiveItem: ; 103fd
ret
.NoPokemon: ; 10486 (4:4486)
ld hl, TextJump_YouDontHaveAPkmn
ld hl, TextJump_YouDontHaveAMon
call Pack_PrintTextNoScroll
ret
; 1048d (4:448d)
@@ -1668,9 +1668,9 @@ Text_ThisIsntTheTime: ; 0x10af3
db "@"
; 0x10af8
TextJump_YouDontHaveAPkmn: ; 0x10af8
TextJump_YouDontHaveAMon: ; 0x10af8
; You don't have a #MON!
text_jump Text_YouDontHaveAPkmn
text_jump Text_YouDontHaveAMon
db "@"
; 0x10afd

View File

@@ -1543,7 +1543,7 @@ RadioChannels:
; entries correspond to constants/radio_constants.asm
; frequency value given here = 4 × ingame_frequency 2
dbw 16, .PkmnTalkAndPokedexShow
dbw 16, .PKMNTalkAndPokedexShow
dbw 28, .PokemonMusic
dbw 32, .LuckyChannel
dbw 40, .BuenasPassword
@@ -1554,7 +1554,7 @@ RadioChannels:
dbw 80, .EvolutionRadio
db -1
.PkmnTalkAndPokedexShow:
.PKMNTalkAndPokedexShow:
; Pokédex Show in the morning
; Oak's Pokémon Talk in the afternoon and evening
@@ -1653,7 +1653,7 @@ LoadStation_OaksPokemonTalk: ; 91753 (24:5753)
ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow
call Radio_BackUpFarCallParams
ld de, OaksPkmnTalkName
ld de, OaksPKMNTalkName
ret
LoadStation_PokedexShow: ; 91766 (24:5766)
@@ -1846,7 +1846,7 @@ NoRadioName: ; 918a9 (24:58a9)
; 918bf
OaksPkmnTalkName: db "OAK's <PK><MN> Talk@"
OaksPKMNTalkName: db "OAK's <PK><MN> Talk@"
PokedexShowName: db "#DEX Show@"
PokemonMusicName: db "#MON Music@"
LuckyChannelName: db "Lucky Channel@"

Some files were not shown because too many files have changed in this diff Show More