mirror of
https://github.com/pret/pokered.git
synced 2024-10-22 22:55:31 +00:00
Identify wcf91 as wCurPartySpecies, wCurItem, and wCurListMenuItem (#457)
This commit is contained in:
parent
6e3ab0a9e9
commit
77d051479b
50 changed files with 181 additions and 177 deletions
|
@ -683,7 +683,7 @@ DoSpecialEffectByAnimationId:
|
||||||
INCLUDE "data/battle_anims/special_effects.asm"
|
INCLUDE "data/battle_anims/special_effects.asm"
|
||||||
|
|
||||||
DoBallTossSpecialEffects:
|
DoBallTossSpecialEffects:
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp ULTRA_BALL + 1 ; is it a Master Ball or Ultra Ball?
|
cp ULTRA_BALL + 1 ; is it a Master Ball or Ultra Ball?
|
||||||
jr nc, .skipFlashingEffect
|
jr nc, .skipFlashingEffect
|
||||||
.flashingEffect ; do a flashing effect if it's Master Ball or Ultra Ball
|
.flashingEffect ; do a flashing effect if it's Master Ball or Ultra Ball
|
||||||
|
@ -2031,7 +2031,7 @@ ChangeMonPic:
|
||||||
and a
|
and a
|
||||||
jr z, .playerTurn
|
jr z, .playerTurn
|
||||||
ld a, [wChangeMonPicEnemyTurnSpecies]
|
ld a, [wChangeMonPicEnemyTurnSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
xor a
|
xor a
|
||||||
ld [wSpriteFlipped], a
|
ld [wSpriteFlipped], a
|
||||||
|
@ -2599,7 +2599,7 @@ TossBallAnimation:
|
||||||
|
|
||||||
ld hl, .PokeBallAnimations
|
ld hl, .PokeBallAnimations
|
||||||
; choose which toss animation to use
|
; choose which toss animation to use
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp POKE_BALL
|
cp POKE_BALL
|
||||||
ld b, TOSS_ANIM
|
ld b, TOSS_ANIM
|
||||||
jr z, .done
|
jr z, .done
|
||||||
|
|
|
@ -32,7 +32,7 @@ PrintBeginningBattleText:
|
||||||
ld b, SILPH_SCOPE
|
ld b, SILPH_SCOPE
|
||||||
call IsItemInBag
|
call IsItemInBag
|
||||||
ld a, [wEnemyMonSpecies2]
|
ld a, [wEnemyMonSpecies2]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
cp RESTLESS_SOUL
|
cp RESTLESS_SOUL
|
||||||
jr z, .isMarowak
|
jr z, .isMarowak
|
||||||
ld a, b
|
ld a, b
|
||||||
|
|
|
@ -229,7 +229,7 @@ StartBattle:
|
||||||
ld b, 0
|
ld b, 0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl] ; species
|
ld a, [hl] ; species
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wBattleMonSpecies2], a
|
ld [wBattleMonSpecies2], a
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
hlcoord 1, 5
|
hlcoord 1, 5
|
||||||
|
@ -1353,7 +1353,7 @@ EnemySendOutFirstMon:
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wEnemyMonSpecies2], a
|
ld [wEnemyMonSpecies2], a
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
call LoadEnemyMonData
|
call LoadEnemyMonData
|
||||||
ld hl, wEnemyMonHP
|
ld hl, wEnemyMonHP
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
|
@ -1420,7 +1420,7 @@ EnemySendOutFirstMon:
|
||||||
ld hl, TrainerSentOutText
|
ld hl, TrainerSentOutText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, [wEnemyMonSpecies2]
|
ld a, [wEnemyMonSpecies2]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
|
@ -1759,7 +1759,7 @@ SendOutMon:
|
||||||
call PlayMoveAnimation
|
call PlayMoveAnimation
|
||||||
hlcoord 4, 11
|
hlcoord 4, 11
|
||||||
predef AnimateSendingOutMon
|
predef AnimateSendingOutMon
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
call PrintEmptyString
|
call PrintEmptyString
|
||||||
jp SaveScreenTilesToBuffer1
|
jp SaveScreenTilesToBuffer1
|
||||||
|
@ -1841,7 +1841,7 @@ DrawPlayerHUDAndHPBar:
|
||||||
call PrintLevel
|
call PrintLevel
|
||||||
.doNotPrintLevel
|
.doNotPrintLevel
|
||||||
ld a, [wLoadedMonSpecies]
|
ld a, [wLoadedMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
hlcoord 10, 9
|
hlcoord 10, 9
|
||||||
predef DrawHP
|
predef DrawHP
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
@ -2159,7 +2159,7 @@ DisplayBattleMenu::
|
||||||
jp LoadScreenTilesFromBuffer1 ; restore saved screen and return
|
jp LoadScreenTilesFromBuffer1 ; restore saved screen and return
|
||||||
.throwSafariBallWasSelected
|
.throwSafariBallWasSelected
|
||||||
ld a, SAFARI_BALL
|
ld a, SAFARI_BALL
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
jr UseBagItem
|
jr UseBagItem
|
||||||
|
|
||||||
.upperLeftMenuItemWasNotSelected ; a menu item other than the upper left item was selected
|
.upperLeftMenuItemWasNotSelected ; a menu item other than the upper left item was selected
|
||||||
|
@ -2184,7 +2184,7 @@ DisplayBattleMenu::
|
||||||
|
|
||||||
; bait was selected
|
; bait was selected
|
||||||
ld a, SAFARI_BAIT
|
ld a, SAFARI_BAIT
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
jr UseBagItem
|
jr UseBagItem
|
||||||
|
|
||||||
BagWasSelected:
|
BagWasSelected:
|
||||||
|
@ -2236,7 +2236,7 @@ DisplayBagMenu:
|
||||||
|
|
||||||
UseBagItem:
|
UseBagItem:
|
||||||
; either use an item from the bag or use a safari zone item
|
; either use an item from the bag or use a safari zone item
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetItemName
|
call GetItemName
|
||||||
call CopyToStringBuffer
|
call CopyToStringBuffer
|
||||||
|
@ -2305,7 +2305,7 @@ PartyMenuOrRockOrRun:
|
||||||
jr nz, .partyMenuWasSelected
|
jr nz, .partyMenuWasSelected
|
||||||
; safari battle
|
; safari battle
|
||||||
ld a, SAFARI_ROCK
|
ld a, SAFARI_ROCK
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
jp UseBagItem
|
jp UseBagItem
|
||||||
.partyMenuWasSelected
|
.partyMenuWasSelected
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
|
@ -2379,7 +2379,7 @@ PartyMenuOrRockOrRun:
|
||||||
jr nz, .doEnemyMonAnimation
|
jr nz, .doEnemyMonAnimation
|
||||||
; enemy mon is not minimised
|
; enemy mon is not minimised
|
||||||
ld a, [wEnemyMonSpecies]
|
ld a, [wEnemyMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
|
@ -6771,7 +6771,7 @@ InitBattle::
|
||||||
|
|
||||||
InitOpponent:
|
InitOpponent:
|
||||||
ld a, [wCurOpponent]
|
ld a, [wCurOpponent]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wEnemyMonSpecies2], a
|
ld [wEnemyMonSpecies2], a
|
||||||
jr InitBattleCommon
|
jr InitBattleCommon
|
||||||
|
|
||||||
|
@ -6847,14 +6847,14 @@ InitWildBattle:
|
||||||
ld a, "T"
|
ld a, "T"
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], "@"
|
ld [hl], "@"
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
push af
|
push af
|
||||||
ld a, MON_GHOST
|
ld a, MON_GHOST
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
call LoadMonFrontSprite ; load ghost sprite
|
call LoadMonFrontSprite ; load ghost sprite
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
jr .spriteLoaded
|
jr .spriteLoaded
|
||||||
.isNoGhost
|
.isNoGhost
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
|
@ -7030,7 +7030,7 @@ LoadMonBackPic:
|
||||||
; Assumes the monster's attributes have
|
; Assumes the monster's attributes have
|
||||||
; been loaded with GetMonHeader.
|
; been loaded with GetMonHeader.
|
||||||
ld a, [wBattleMonSpecies2]
|
ld a, [wBattleMonSpecies2]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
hlcoord 1, 5
|
hlcoord 1, 5
|
||||||
ld b, 7
|
ld b, 7
|
||||||
ld c, 8
|
ld c, 8
|
||||||
|
|
|
@ -118,5 +118,5 @@ GetMonSpecies:
|
||||||
ld d, 0
|
ld d, 0
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -54,7 +54,7 @@ ReadTrainer:
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
and a ; have we reached the end of the trainer data?
|
and a ; have we reached the end of the trainer data?
|
||||||
jr z, .FinishUp
|
jr z, .FinishUp
|
||||||
ld [wcf91], a ; write species somewhere (XXX why?)
|
ld [wCurPartySpecies], a
|
||||||
ld a, ENEMY_PARTY_DATA
|
ld a, ENEMY_PARTY_DATA
|
||||||
ld [wMonDataLocation], a
|
ld [wMonDataLocation], a
|
||||||
push hl
|
push hl
|
||||||
|
@ -71,7 +71,7 @@ ReadTrainer:
|
||||||
jr z, .AddLoneMove
|
jr z, .AddLoneMove
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, ENEMY_PARTY_DATA
|
ld a, ENEMY_PARTY_DATA
|
||||||
ld [wMonDataLocation], a
|
ld [wMonDataLocation], a
|
||||||
push hl
|
push hl
|
||||||
|
|
|
@ -76,7 +76,7 @@ TryDoWildEncounter:
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wEnemyMonSpecies2], a
|
ld [wEnemyMonSpecies2], a
|
||||||
ld a, [wRepelRemainingSteps]
|
ld a, [wRepelRemainingSteps]
|
||||||
and a
|
and a
|
||||||
|
|
|
@ -98,7 +98,7 @@ TestBattle: ; unreferenced except in _DEBUG
|
||||||
|
|
||||||
; Give the player a level 20 Rhydon.
|
; Give the player a level 20 Rhydon.
|
||||||
ld a, RHYDON
|
ld a, RHYDON
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, 20
|
ld a, 20
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
xor a
|
xor a
|
||||||
|
|
|
@ -4,7 +4,7 @@ SetDebugNewGameParty: ; unreferenced except in _DEBUG
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp -1
|
cp -1
|
||||||
ret z
|
ret z
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
|
@ -97,7 +97,7 @@ IF DEF(_DEBUG)
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp -1
|
cp -1
|
||||||
jr z, .items_end
|
jr z, .items_end
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
inc de
|
inc de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc de
|
inc de
|
||||||
|
|
|
@ -13,7 +13,7 @@ _GivePokemon::
|
||||||
; add to box
|
; add to box
|
||||||
xor a
|
xor a
|
||||||
ld [wEnemyBattleStatus3], a
|
ld [wEnemyBattleStatus3], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wEnemyMonSpecies2], a
|
ld [wEnemyMonSpecies2], a
|
||||||
callfar LoadEnemyMonData
|
callfar LoadEnemyMonData
|
||||||
call SetPokedexOwnedFlag
|
call SetPokedexOwnedFlag
|
||||||
|
@ -52,7 +52,7 @@ _GivePokemon::
|
||||||
ret
|
ret
|
||||||
|
|
||||||
SetPokedexOwnedFlag:
|
SetPokedexOwnedFlag:
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
push af
|
push af
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
predef IndexToPokedex
|
predef IndexToPokedex
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
AerodactylFossil:
|
AerodactylFossil:
|
||||||
ld a, FOSSIL_AERODACTYL
|
ld a, FOSSIL_AERODACTYL
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
call DisplayMonFrontSpriteInBox
|
call DisplayMonFrontSpriteInBox
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
tx_pre AerodactylFossilText
|
tx_pre AerodactylFossilText
|
||||||
|
@ -12,7 +12,7 @@ AerodactylFossilText::
|
||||||
|
|
||||||
KabutopsFossil:
|
KabutopsFossil:
|
||||||
ld a, FOSSIL_KABUTOPS
|
ld a, FOSSIL_KABUTOPS
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
call DisplayMonFrontSpriteInBox
|
call DisplayMonFrontSpriteInBox
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
tx_pre KabutopsFossilText
|
tx_pre KabutopsFossilText
|
||||||
|
@ -24,7 +24,6 @@ KabutopsFossilText::
|
||||||
|
|
||||||
DisplayMonFrontSpriteInBox:
|
DisplayMonFrontSpriteInBox:
|
||||||
; Displays a pokemon's front sprite in a pop-up window.
|
; Displays a pokemon's front sprite in a pop-up window.
|
||||||
; [wcf91] = pokemon internal id number
|
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ldh [hAutoBGTransferEnabled], a
|
ldh [hAutoBGTransferEnabled], a
|
||||||
call Delay3
|
call Delay3
|
||||||
|
@ -35,7 +34,7 @@ DisplayMonFrontSpriteInBox:
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld de, vChars1 tile $31
|
ld de, vChars1 tile $31
|
||||||
|
|
|
@ -5,7 +5,7 @@ Route15GateLeftBinoculars:
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
tx_pre Route15UpstairsBinocularsText
|
tx_pre Route15UpstairsBinocularsText
|
||||||
ld a, ARTICUNO
|
ld a, ARTICUNO
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
call PlayCry
|
call PlayCry
|
||||||
jp DisplayMonFrontSpriteInBox
|
jp DisplayMonFrontSpriteInBox
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ InGameTrade_DoTrade:
|
||||||
jp c, .tradeFailed ; jump if the player didn't select a pokemon
|
jp c, .tradeFailed ; jump if the player didn't select a pokemon
|
||||||
ld a, [wInGameTradeGiveMonSpecies]
|
ld a, [wInGameTradeGiveMonSpecies]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
cp b
|
cp b
|
||||||
ld a, $2
|
ld a, $2
|
||||||
jr nz, .tradeFailed ; jump if the selected mon's species is not the required one
|
jr nz, .tradeFailed ; jump if the selected mon's species is not the required one
|
||||||
|
@ -128,7 +128,7 @@ InGameTrade_DoTrade:
|
||||||
pop af
|
pop af
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
ld a, [wInGameTradeReceiveMonSpecies]
|
ld a, [wInGameTradeReceiveMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
xor a
|
xor a
|
||||||
ld [wMonDataLocation], a ; not used
|
ld [wMonDataLocation], a ; not used
|
||||||
ld [wRemoveMonFromBox], a
|
ld [wRemoveMonFromBox], a
|
||||||
|
|
|
@ -72,7 +72,7 @@ DisplayPokemartDialogue_::
|
||||||
ld a, [wIsKeyItem]
|
ld a, [wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .unsellableItem
|
jr nz, .unsellableItem
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
jr c, .unsellableItem
|
jr c, .unsellableItem
|
||||||
ld a, PRICEDITEMLISTMENU
|
ld a, PRICEDITEMLISTMENU
|
||||||
|
@ -156,7 +156,7 @@ DisplayPokemartDialogue_::
|
||||||
call DisplayChooseQuantityMenu
|
call DisplayChooseQuantityMenu
|
||||||
inc a
|
inc a
|
||||||
jr z, .buyMenuLoop ; if the player closed the choose quantity menu with the B button
|
jr z, .buyMenuLoop ; if the player closed the choose quantity menu with the B button
|
||||||
ld a, [wcf91] ; item ID
|
ld a, [wCurItem]
|
||||||
ld [wd11e], a ; store item ID for GetItemName
|
ld [wd11e], a ; store item ID for GetItemName
|
||||||
call GetItemName
|
call GetItemName
|
||||||
call CopyToStringBuffer
|
call CopyToStringBuffer
|
||||||
|
|
|
@ -222,7 +222,7 @@ HandlePrizeChoice:
|
||||||
jr .subtractCoins
|
jr .subtractCoins
|
||||||
.giveMon
|
.giveMon
|
||||||
ld a, [wd11e]
|
ld a, [wd11e]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
push af
|
push af
|
||||||
call GetPrizeMonLevel
|
call GetPrizeMonLevel
|
||||||
ld c, a
|
ld c, a
|
||||||
|
@ -287,7 +287,7 @@ OhFineThenTextPtr:
|
||||||
text_end
|
text_end
|
||||||
|
|
||||||
GetPrizeMonLevel:
|
GetPrizeMonLevel:
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld hl, PrizeMonLevelDictionary
|
ld hl, PrizeMonLevelDictionary
|
||||||
.loop
|
.loop
|
||||||
|
|
|
@ -196,9 +196,9 @@ WriteMonPartySpriteOAMBySpecies:
|
||||||
UnusedPartyMonSpriteFunction:
|
UnusedPartyMonSpriteFunction:
|
||||||
; This function is unused and doesn't appear to do anything useful. It looks
|
; This function is unused and doesn't appear to do anything useful. It looks
|
||||||
; like it may have been intended to load the tile patterns and OAM data for
|
; like it may have been intended to load the tile patterns and OAM data for
|
||||||
; the mon party sprite associated with the species in [wcf91].
|
; the mon party sprite associated with the species in [wCurPartySpecies].
|
||||||
; However, its calculations are off and it loads garbage data.
|
; However, its calculations are off and it loads garbage data.
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call GetPartyMonSpriteID
|
call GetPartyMonSpriteID
|
||||||
push af
|
push af
|
||||||
ld hl, vSprites tile $00
|
ld hl, vSprites tile $00
|
||||||
|
|
|
@ -69,7 +69,7 @@ SetPal_StatusScreen:
|
||||||
ld de, wPalPacket
|
ld de, wPalPacket
|
||||||
ld bc, $10
|
ld bc, $10
|
||||||
call CopyData
|
call CopyData
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
cp NUM_POKEMON_INDEXES + 1
|
cp NUM_POKEMON_INDEXES + 1
|
||||||
jr c, .pokemon
|
jr c, .pokemon
|
||||||
ld a, $1 ; not pokemon
|
ld a, $1 ; not pokemon
|
||||||
|
@ -97,7 +97,7 @@ SetPal_Pokedex:
|
||||||
ld de, wPalPacket
|
ld de, wPalPacket
|
||||||
ld bc, $10
|
ld bc, $10
|
||||||
call CopyData
|
call CopyData
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call DeterminePaletteIDOutOfBattle
|
call DeterminePaletteIDOutOfBattle
|
||||||
ld hl, wPalPacket + 3
|
ld hl, wPalPacket + 3
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
; function to add an item (in varying quantities) to the player's bag or PC box
|
; function to add an item (in varying quantities) to the player's bag or PC box
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; [wItemQuantity] = item quantity
|
; [wItemQuantity] = item quantity
|
||||||
; sets carry flag if successful, unsets carry flag if unsuccessful
|
; sets carry flag if successful, unsets carry flag if unsuccessful
|
||||||
AddItemToInventory_::
|
AddItemToInventory_::
|
||||||
|
@ -30,7 +30,7 @@ AddItemToInventory_::
|
||||||
.notAtEndOfInventory
|
.notAtEndOfInventory
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld b, a ; b = ID of current item in table
|
ld b, a ; b = ID of current item in table
|
||||||
ld a, [wcf91] ; a = ID of item being added
|
ld a, [wCurItem] ; a = ID of item being added
|
||||||
cp b ; does the current item in the table match the item being added?
|
cp b ; does the current item in the table match the item being added?
|
||||||
jp z, .increaseItemQuantity ; if so, increase the item's quantity
|
jp z, .increaseItemQuantity ; if so, increase the item's quantity
|
||||||
inc hl
|
inc hl
|
||||||
|
@ -50,7 +50,7 @@ AddItemToInventory_::
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, 0
|
ld b, 0
|
||||||
add hl, bc ; hl = address to store the item
|
add hl, bc ; hl = address to store the item
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [hli], a ; store item ID
|
ld [hli], a ; store item ID
|
||||||
ld a, [wItemQuantity]
|
ld a, [wItemQuantity]
|
||||||
ld [hli], a ; store item quantity
|
ld [hli], a ; store item quantity
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
UseItem_::
|
UseItem_::
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wActionResultOrTookBattleTurn], a ; initialise to success value
|
ld [wActionResultOrTookBattleTurn], a ; initialise to success value
|
||||||
ld a, [wcf91] ;contains item_ID
|
ld a, [wCurItem]
|
||||||
cp HM01
|
cp HM01
|
||||||
jp nc, ItemUseTMHM
|
jp nc, ItemUseTMHM
|
||||||
ld hl, ItemUsePtrTable
|
ld hl, ItemUsePtrTable
|
||||||
|
@ -187,7 +187,7 @@ ItemUseBall:
|
||||||
ld b, a
|
ld b, a
|
||||||
|
|
||||||
; Get the item ID.
|
; Get the item ID.
|
||||||
ld hl, wcf91
|
ld hl, wCurItem
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
|
|
||||||
; The Master Ball always succeeds.
|
; The Master Ball always succeeds.
|
||||||
|
@ -251,7 +251,7 @@ ItemUseBall:
|
||||||
call Multiply
|
call Multiply
|
||||||
|
|
||||||
; Determine BallFactor. It's 8 for Great Balls and 12 for the others.
|
; Determine BallFactor. It's 8 for Great Balls and 12 for the others.
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp GREAT_BALL
|
cp GREAT_BALL
|
||||||
ld a, 12
|
ld a, 12
|
||||||
jr nz, .skip1
|
jr nz, .skip1
|
||||||
|
@ -336,7 +336,7 @@ ItemUseBall:
|
||||||
; Poké Ball: BallFactor2 = 255
|
; Poké Ball: BallFactor2 = 255
|
||||||
; Great Ball: BallFactor2 = 200
|
; Great Ball: BallFactor2 = 200
|
||||||
; Ultra/Safari Ball: BallFactor2 = 150
|
; Ultra/Safari Ball: BallFactor2 = 150
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld b, 255
|
ld b, 255
|
||||||
cp POKE_BALL
|
cp POKE_BALL
|
||||||
jr z, .skip4
|
jr z, .skip4
|
||||||
|
@ -428,11 +428,11 @@ ItemUseBall:
|
||||||
ld [wDamageMultipliers], a
|
ld [wDamageMultipliers], a
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
push af
|
push af
|
||||||
predef MoveAnimation
|
predef MoveAnimation
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
pop af
|
pop af
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
|
|
||||||
|
@ -490,15 +490,15 @@ ItemUseBall:
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
.skip6
|
.skip6
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
push af
|
push af
|
||||||
ld a, [wEnemyMonSpecies2]
|
ld a, [wEnemyMonSpecies2]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, [wEnemyMonLevel]
|
ld a, [wEnemyMonLevel]
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
callfar LoadEnemyMonData
|
callfar LoadEnemyMonData
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
pop hl
|
pop hl
|
||||||
pop af
|
pop af
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
|
@ -509,7 +509,7 @@ ItemUseBall:
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld a, [wEnemyMonSpecies]
|
ld a, [wEnemyMonSpecies]
|
||||||
ld [wCapturedMonSpecies], a
|
ld [wCapturedMonSpecies], a
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ld a, [wBattleType]
|
ld a, [wBattleType]
|
||||||
dec a ; is this the old man battle?
|
dec a ; is this the old man battle?
|
||||||
|
@ -762,7 +762,7 @@ ItemUseEvoStone:
|
||||||
jp nz, ItemUseNotTime
|
jp nz, ItemUseNotTime
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wEvoStoneItemID], a
|
ld [wEvoStoneItemID], a
|
||||||
push af
|
push af
|
||||||
ld a, EVO_STONE_PARTY_MENU
|
ld a, EVO_STONE_PARTY_MENU
|
||||||
|
@ -773,7 +773,7 @@ ItemUseEvoStone:
|
||||||
pop bc
|
pop bc
|
||||||
jr c, .canceledItemUse
|
jr c, .canceledItemUse
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, $01
|
ld a, $01
|
||||||
ld [wForceEvolution], a
|
ld [wForceEvolution], a
|
||||||
ld a, SFX_HEAL_AILMENT
|
ld a, SFX_HEAL_AILMENT
|
||||||
|
@ -808,7 +808,7 @@ ItemUseMedicine:
|
||||||
jp z, .emptyParty
|
jp z, .emptyParty
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
push af
|
push af
|
||||||
ld a, USE_ITEM_PARTY_MENU
|
ld a, USE_ITEM_PARTY_MENU
|
||||||
ld [wPartyMenuTypeOrMessageID], a
|
ld [wPartyMenuTypeOrMessageID], a
|
||||||
|
@ -840,11 +840,11 @@ ItemUseMedicine:
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld [wUsedItemOnWhichPokemon], a
|
ld [wUsedItemOnWhichPokemon], a
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld e, a
|
ld e, a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
pop af
|
pop af
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
ld a, [wPseudoItemID]
|
ld a, [wPseudoItemID]
|
||||||
|
@ -855,7 +855,7 @@ ItemUseMedicine:
|
||||||
cp d ; is the pokemon trying to use softboiled on itself?
|
cp d ; is the pokemon trying to use softboiled on itself?
|
||||||
jr z, ItemUseMedicine ; if so, force another choice
|
jr z, ItemUseMedicine ; if so, force another choice
|
||||||
.checkItemType
|
.checkItemType
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp REVIVE
|
cp REVIVE
|
||||||
jr nc, .healHP ; if it's a Revive or Max Revive
|
jr nc, .healHP ; if it's a Revive or Max Revive
|
||||||
cp FULL_HEAL
|
cp FULL_HEAL
|
||||||
|
@ -868,7 +868,7 @@ ItemUseMedicine:
|
||||||
.cureStatusAilment
|
.cureStatusAilment
|
||||||
ld bc, wPartyMon1Status - wPartyMon1
|
ld bc, wPartyMon1Status - wPartyMon1
|
||||||
add hl, bc ; hl now points to status
|
add hl, bc ; hl now points to status
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
lb bc, ANTIDOTE_MSG, 1 << PSN
|
lb bc, ANTIDOTE_MSG, 1 << PSN
|
||||||
cp ANTIDOTE
|
cp ANTIDOTE
|
||||||
jr z, .checkMonStatus
|
jr z, .checkMonStatus
|
||||||
|
@ -922,7 +922,7 @@ ItemUseMedicine:
|
||||||
or b
|
or b
|
||||||
jr nz, .notFainted
|
jr nz, .notFainted
|
||||||
.fainted
|
.fainted
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp REVIVE
|
cp REVIVE
|
||||||
jr z, .updateInBattleFaintedData
|
jr z, .updateInBattleFaintedData
|
||||||
cp MAX_REVIVE
|
cp MAX_REVIVE
|
||||||
|
@ -954,7 +954,7 @@ ItemUseMedicine:
|
||||||
pop hl
|
pop hl
|
||||||
jr .compareCurrentHPToMaxHP
|
jr .compareCurrentHPToMaxHP
|
||||||
.notFainted
|
.notFainted
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp REVIVE
|
cp REVIVE
|
||||||
jp z, .healingItemNoEffect
|
jp z, .healingItemNoEffect
|
||||||
cp MAX_REVIVE
|
cp MAX_REVIVE
|
||||||
|
@ -974,7 +974,7 @@ ItemUseMedicine:
|
||||||
pop hl
|
pop hl
|
||||||
jr nz, .notFullHP
|
jr nz, .notFullHP
|
||||||
.fullHP ; if the pokemon's current HP equals its max HP
|
.fullHP ; if the pokemon's current HP equals its max HP
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp FULL_RESTORE
|
cp FULL_RESTORE
|
||||||
jp nz, .healingItemNoEffect
|
jp nz, .healingItemNoEffect
|
||||||
inc hl
|
inc hl
|
||||||
|
@ -983,7 +983,7 @@ ItemUseMedicine:
|
||||||
and a ; does the pokemon have a status ailment?
|
and a ; does the pokemon have a status ailment?
|
||||||
jp z, .healingItemNoEffect
|
jp z, .healingItemNoEffect
|
||||||
ld a, FULL_HEAL
|
ld a, FULL_HEAL
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
dec hl
|
dec hl
|
||||||
dec hl
|
dec hl
|
||||||
dec hl
|
dec hl
|
||||||
|
@ -1073,7 +1073,7 @@ ItemUseMedicine:
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
jr .addHealAmount
|
jr .addHealAmount
|
||||||
.notUsingSoftboiled2
|
.notUsingSoftboiled2
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp SODA_POP
|
cp SODA_POP
|
||||||
ld b, 60 ; Soda Pop heal amount
|
ld b, 60 ; Soda Pop heal amount
|
||||||
jr z, .addHealAmount
|
jr z, .addHealAmount
|
||||||
|
@ -1108,7 +1108,7 @@ ItemUseMedicine:
|
||||||
ld e, l ; de now points to current HP
|
ld e, l ; de now points to current HP
|
||||||
ld hl, (wPartyMon1MaxHP + 1) - (wPartyMon1HP + 1)
|
ld hl, (wPartyMon1MaxHP + 1) - (wPartyMon1HP + 1)
|
||||||
add hl, de ; hl now points to max HP
|
add hl, de ; hl now points to max HP
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp REVIVE
|
cp REVIVE
|
||||||
jr z, .setCurrentHPToHalfMaxHP
|
jr z, .setCurrentHPToHalfMaxHP
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
|
@ -1120,7 +1120,7 @@ ItemUseMedicine:
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
sbc b
|
sbc b
|
||||||
jr nc, .setCurrentHPToMaxHp ; if current HP exceeds max HP after healing
|
jr nc, .setCurrentHPToMaxHp ; if current HP exceeds max HP after healing
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp HYPER_POTION
|
cp HYPER_POTION
|
||||||
jr c, .setCurrentHPToMaxHp ; if using a Full Restore or Max Potion
|
jr c, .setCurrentHPToMaxHp ; if using a Full Restore or Max Potion
|
||||||
cp MAX_REVIVE
|
cp MAX_REVIVE
|
||||||
|
@ -1150,7 +1150,7 @@ ItemUseMedicine:
|
||||||
ld [wHPBarNewHP], a
|
ld [wHPBarNewHP], a
|
||||||
dec de
|
dec de
|
||||||
.doneHealingPartyHP ; done updating the pokemon's current HP in the party data structure
|
.doneHealingPartyHP ; done updating the pokemon's current HP in the party data structure
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp FULL_RESTORE
|
cp FULL_RESTORE
|
||||||
jr nz, .updateInBattleData
|
jr nz, .updateInBattleData
|
||||||
ld bc, wPartyMon1Status - (wPartyMon1MaxHP + 1)
|
ld bc, wPartyMon1Status - (wPartyMon1MaxHP + 1)
|
||||||
|
@ -1169,7 +1169,7 @@ ItemUseMedicine:
|
||||||
ld [wBattleMonHP], a
|
ld [wBattleMonHP], a
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
ld [wBattleMonHP + 1], a
|
ld [wBattleMonHP + 1], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp FULL_RESTORE
|
cp FULL_RESTORE
|
||||||
jr nz, .calculateHPBarCoords
|
jr nz, .calculateHPBarCoords
|
||||||
xor a
|
xor a
|
||||||
|
@ -1194,7 +1194,7 @@ ItemUseMedicine:
|
||||||
call RemoveUsedItem
|
call RemoveUsedItem
|
||||||
pop hl
|
pop hl
|
||||||
.skipRemovingItem
|
.skipRemovingItem
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp FULL_RESTORE
|
cp FULL_RESTORE
|
||||||
jr c, .playStatusAilmentCuringSound
|
jr c, .playStatusAilmentCuringSound
|
||||||
cp FULL_HEAL
|
cp FULL_HEAL
|
||||||
|
@ -1212,7 +1212,7 @@ ItemUseMedicine:
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
ld a, REVIVE_MSG
|
ld a, REVIVE_MSG
|
||||||
ld [wPartyMenuTypeOrMessageID], a
|
ld [wPartyMenuTypeOrMessageID], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp REVIVE
|
cp REVIVE
|
||||||
jr z, .showHealingItemMessage
|
jr z, .showHealingItemMessage
|
||||||
cp MAX_REVIVE
|
cp MAX_REVIVE
|
||||||
|
@ -1267,7 +1267,7 @@ ItemUseMedicine:
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp RARE_CANDY
|
cp RARE_CANDY
|
||||||
jp z, .useRareCandy
|
jp z, .useRareCandy
|
||||||
push hl
|
push hl
|
||||||
|
@ -1293,7 +1293,7 @@ ItemUseMedicine:
|
||||||
pop hl
|
pop hl
|
||||||
call .recalculateStats
|
call .recalculateStats
|
||||||
ld hl, VitaminStats
|
ld hl, VitaminStats
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
sub HP_UP - 1
|
sub HP_UP - 1
|
||||||
ld c, a
|
ld c, a
|
||||||
.statNameLoop ; loop to get the address of the name of the stat the vitamin increases
|
.statNameLoop ; loop to get the address of the name of the stat the vitamin increases
|
||||||
|
@ -1357,7 +1357,7 @@ ItemUseMedicine:
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
push af
|
push af
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
|
@ -1412,7 +1412,7 @@ ItemUseMedicine:
|
||||||
ld a, $01
|
ld a, $01
|
||||||
ld [wUpdateSpritesEnabled], a
|
ld [wUpdateSpritesEnabled], a
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
pop af
|
pop af
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
jp RemoveUsedItem
|
jp RemoveUsedItem
|
||||||
|
@ -1650,7 +1650,7 @@ ItemUseXStat:
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af ; save [wPlayerMoveEffect]
|
push af ; save [wPlayerMoveEffect]
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
sub X_ATTACK - ATTACK_UP1_EFFECT
|
sub X_ATTACK - ATTACK_UP1_EFFECT
|
||||||
ld [hl], a ; store player move effect
|
ld [hl], a ; store player move effect
|
||||||
call PrintItemUseTextAndRemoveItem
|
call PrintItemUseTextAndRemoveItem
|
||||||
|
@ -1954,7 +1954,7 @@ ItemUsePPUp:
|
||||||
ItemUsePPRestore:
|
ItemUsePPRestore:
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wPPRestoreItem], a
|
ld [wPPRestoreItem], a
|
||||||
.chooseMon
|
.chooseMon
|
||||||
xor a
|
xor a
|
||||||
|
@ -2155,7 +2155,7 @@ ItemUseTMHM:
|
||||||
ld a, [wIsInBattle]
|
ld a, [wIsInBattle]
|
||||||
and a
|
and a
|
||||||
jp nz, ItemUseNotTime
|
jp nz, ItemUseNotTime
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
sub TM01 ; underflows below 0 for HM items (before TM items)
|
sub TM01 ; underflows below 0 for HM items (before TM items)
|
||||||
push af
|
push af
|
||||||
jr nc, .skipAdding
|
jr nc, .skipAdding
|
||||||
|
@ -2190,7 +2190,7 @@ ItemUseTMHM:
|
||||||
.useMachine
|
.useMachine
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
push af
|
push af
|
||||||
.chooseMon
|
.chooseMon
|
||||||
ld hl, wStringBuffer
|
ld hl, wStringBuffer
|
||||||
|
@ -2237,13 +2237,13 @@ ItemUseTMHM:
|
||||||
jr c, .chooseMon
|
jr c, .chooseMon
|
||||||
predef LearnMove ; teach move
|
predef LearnMove ; teach move
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
pop af
|
pop af
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
ld a, b
|
ld a, b
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
ret c
|
ret c
|
||||||
jp RemoveUsedItem
|
jp RemoveUsedItem
|
||||||
|
@ -2538,14 +2538,14 @@ GetSelectedMoveOffset2:
|
||||||
; confirms the item toss and then tosses the item
|
; confirms the item toss and then tosses the item
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; [wWhichPokemon] = index of item within inventory
|
; [wWhichPokemon] = index of item within inventory
|
||||||
; [wItemQuantity] = quantity to toss
|
; [wItemQuantity] = quantity to toss
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; clears carry flag if the item is tossed, sets carry flag if not
|
; clears carry flag if the item is tossed, sets carry flag if not
|
||||||
TossItem_::
|
TossItem_::
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
pop hl
|
pop hl
|
||||||
jr c, .tooImportantToToss
|
jr c, .tooImportantToToss
|
||||||
|
@ -2556,7 +2556,7 @@ TossItem_::
|
||||||
and a
|
and a
|
||||||
jr nz, .tooImportantToToss
|
jr nz, .tooImportantToToss
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetItemName
|
call GetItemName
|
||||||
call CopyToStringBuffer
|
call CopyToStringBuffer
|
||||||
|
@ -2576,7 +2576,7 @@ TossItem_::
|
||||||
push hl
|
push hl
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
call RemoveItemFromInventory
|
call RemoveItemFromInventory
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetItemName
|
call GetItemName
|
||||||
call CopyToStringBuffer
|
call CopyToStringBuffer
|
||||||
|
@ -2607,7 +2607,7 @@ TooImportantToTossText:
|
||||||
|
|
||||||
; checks if an item is a key item
|
; checks if an item is a key item
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wIsKeyItem] = result
|
; [wIsKeyItem] = result
|
||||||
; 00: item is not key item
|
; 00: item is not key item
|
||||||
|
@ -2615,7 +2615,7 @@ TooImportantToTossText:
|
||||||
IsKeyItem_::
|
IsKeyItem_::
|
||||||
ld a, $01
|
ld a, $01
|
||||||
ld [wIsKeyItem], a
|
ld [wIsKeyItem], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp HM01 ; is the item an HM or TM?
|
cp HM01 ; is the item an HM or TM?
|
||||||
jr nc, .checkIfItemIsHM
|
jr nc, .checkIfItemIsHM
|
||||||
; if the item is not an HM or TM
|
; if the item is not an HM or TM
|
||||||
|
@ -2635,7 +2635,7 @@ IsKeyItem_::
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
.checkIfItemIsHM
|
.checkIfItemIsHM
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
ret c
|
ret c
|
||||||
xor a
|
xor a
|
||||||
|
@ -2649,7 +2649,7 @@ SendNewMonToBox:
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc a
|
inc a
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld c, a
|
ld c, a
|
||||||
.loop
|
.loop
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
GetMachinePrice::
|
GetMachinePrice::
|
||||||
; Input: [wcf91] = Item Id of a TM
|
; Input: [wCurItem] = Item ID of a TM
|
||||||
; Output: Stores the TM price at hItemPrice
|
; Output: Stores the TM price at hItemPrice
|
||||||
ld a, [wcf91] ; a contains TM item id
|
ld a, [wCurItem]
|
||||||
sub TM01 ; underflows below 0 for HM items (before TM items)
|
sub TM01 ; underflows below 0 for HM items (before TM items)
|
||||||
ret c ; HMs are priceless
|
ret c ; HMs are priceless
|
||||||
ld d, a
|
ld d, a
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
; tests if mon [wcf91] can learn move [wMoveNum]
|
; tests if mon [wCurPartySpecies] can learn move [wMoveNum]
|
||||||
CanLearnTM:
|
CanLearnTM:
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld hl, wMonHLearnset
|
ld hl, wMonHLearnset
|
||||||
|
|
|
@ -806,7 +806,7 @@ TradeCenter_Trade:
|
||||||
ld e, a
|
ld e, a
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld hl, wEnemyMons
|
ld hl, wEnemyMons
|
||||||
ld a, c
|
ld a, c
|
||||||
ld bc, wEnemyMon2 - wEnemyMon1
|
ld bc, wEnemyMon2 - wEnemyMon1
|
||||||
|
|
|
@ -83,7 +83,7 @@ LeaguePCShowMon:
|
||||||
ld hl, wHallOfFame
|
ld hl, wHallOfFame
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [wHoFMonSpecies], a
|
ld [wHoFMonSpecies], a
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld [wBattleMonSpecies2], a
|
ld [wBattleMonSpecies2], a
|
||||||
ld [wWholeScreenPaletteMonSpecies], a
|
ld [wWholeScreenPaletteMonSpecies], a
|
||||||
|
|
|
@ -8,7 +8,7 @@ AskName:
|
||||||
ld b, 4
|
ld b, 4
|
||||||
ld c, 11
|
ld c, 11
|
||||||
call z, ClearScreenArea ; only if in wild battle
|
call z, ClearScreenArea ; only if in wild battle
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetMonName
|
call GetMonName
|
||||||
ld hl, DoYouWantToNicknameText
|
ld hl, DoYouWantToNicknameText
|
||||||
|
@ -457,7 +457,7 @@ PrintNamingText:
|
||||||
ld de, RivalsTextString
|
ld de, RivalsTextString
|
||||||
dec a
|
dec a
|
||||||
jr z, .notNickname
|
jr z, .notNickname
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wMonPartySpriteSpecies], a
|
ld [wMonPartySpriteSpecies], a
|
||||||
push af
|
push af
|
||||||
farcall WriteMonPartySpriteOAMBySpecies
|
farcall WriteMonPartySpriteOAMBySpecies
|
||||||
|
|
|
@ -225,7 +225,7 @@ PlayerPCToss:
|
||||||
ld a, [wIsKeyItem]
|
ld a, [wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .next
|
jr nz, .next
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
jr c, .next
|
jr c, .next
|
||||||
; if it's not a key item, there can be more than one of the item
|
; if it's not a key item, there can be more than one of the item
|
||||||
|
|
|
@ -404,7 +404,7 @@ ShowPokedexDataInternal:
|
||||||
call GBPalWhiteOut ; zero all palettes
|
call GBPalWhiteOut ; zero all palettes
|
||||||
call ClearScreen
|
call ClearScreen
|
||||||
ld a, [wd11e] ; pokemon ID
|
ld a, [wd11e] ; pokemon ID
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
push af
|
push af
|
||||||
ld b, SET_PAL_POKEDEX
|
ld b, SET_PAL_POKEDEX
|
||||||
call RunPaletteCommand
|
call RunPaletteCommand
|
||||||
|
@ -488,7 +488,7 @@ ShowPokedexDataInternal:
|
||||||
call IsPokemonBitSet
|
call IsPokemonBitSet
|
||||||
pop af
|
pop af
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
pop de
|
pop de
|
||||||
|
|
||||||
|
@ -502,8 +502,8 @@ ShowPokedexDataInternal:
|
||||||
call GetMonHeader ; load pokemon picture location
|
call GetMonHeader ; load pokemon picture location
|
||||||
hlcoord 1, 1
|
hlcoord 1, 1
|
||||||
call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture
|
call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry ; play pokemon cry
|
call PlayCry
|
||||||
|
|
||||||
pop hl
|
pop hl
|
||||||
pop de
|
pop de
|
||||||
|
|
|
@ -166,7 +166,7 @@ StartMenu_Pokemon::
|
||||||
res BIT_SURF_ALLOWED, [hl]
|
res BIT_SURF_ALLOWED, [hl]
|
||||||
jp z, .loop
|
jp z, .loop
|
||||||
ld a, SURFBOARD
|
ld a, SURFBOARD
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
ld [wPseudoItemID], a
|
ld [wPseudoItemID], a
|
||||||
call UseItem
|
call UseItem
|
||||||
ld a, [wActionResultOrTookBattleTurn]
|
ld a, [wActionResultOrTookBattleTurn]
|
||||||
|
@ -194,7 +194,7 @@ StartMenu_Pokemon::
|
||||||
text_end
|
text_end
|
||||||
.dig
|
.dig
|
||||||
ld a, ESCAPE_ROPE
|
ld a, ESCAPE_ROPE
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
ld [wPseudoItemID], a
|
ld [wPseudoItemID], a
|
||||||
call UseItem
|
call UseItem
|
||||||
ld a, [wActionResultOrTookBattleTurn]
|
ld a, [wActionResultOrTookBattleTurn]
|
||||||
|
@ -259,7 +259,7 @@ StartMenu_Pokemon::
|
||||||
ld a, [wPartyAndBillsPCSavedMenuItem]
|
ld a, [wPartyAndBillsPCSavedMenuItem]
|
||||||
push af
|
push af
|
||||||
ld a, POTION
|
ld a, POTION
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
ld [wPseudoItemID], a
|
ld [wPseudoItemID], a
|
||||||
call UseItem
|
call UseItem
|
||||||
pop af
|
pop af
|
||||||
|
@ -337,7 +337,7 @@ StartMenu_Item::
|
||||||
call PlaceUnfilledArrowMenuCursor
|
call PlaceUnfilledArrowMenuCursor
|
||||||
xor a
|
xor a
|
||||||
ld [wMenuItemToSwap], a
|
ld [wMenuItemToSwap], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp BICYCLE
|
cp BICYCLE
|
||||||
jp z, .useOrTossItem
|
jp z, .useOrTossItem
|
||||||
.notBicycle1
|
.notBicycle1
|
||||||
|
@ -364,11 +364,11 @@ StartMenu_Item::
|
||||||
jr z, .useOrTossItem
|
jr z, .useOrTossItem
|
||||||
jp ItemMenuLoop
|
jp ItemMenuLoop
|
||||||
.useOrTossItem ; if the player made the choice to use or toss the item
|
.useOrTossItem ; if the player made the choice to use or toss the item
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetItemName
|
call GetItemName
|
||||||
call CopyToStringBuffer
|
call CopyToStringBuffer
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp BICYCLE
|
cp BICYCLE
|
||||||
jr nz, .notBicycle2
|
jr nz, .notBicycle2
|
||||||
ld a, [wStatusFlags6]
|
ld a, [wStatusFlags6]
|
||||||
|
@ -383,14 +383,14 @@ StartMenu_Item::
|
||||||
jr nz, .tossItem
|
jr nz, .tossItem
|
||||||
; use item
|
; use item
|
||||||
ld [wPseudoItemID], a ; a must be 0 due to above conditional jump
|
ld [wPseudoItemID], a ; a must be 0 due to above conditional jump
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
cp HM01
|
cp HM01
|
||||||
jr nc, .useItem_partyMenu
|
jr nc, .useItem_partyMenu
|
||||||
ld hl, UsableItems_CloseMenu
|
ld hl, UsableItems_CloseMenu
|
||||||
ld de, 1
|
ld de, 1
|
||||||
call IsInArray
|
call IsInArray
|
||||||
jr c, .useItem_closeMenu
|
jr c, .useItem_closeMenu
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld hl, UsableItems_PartyMenu
|
ld hl, UsableItems_PartyMenu
|
||||||
ld de, 1
|
ld de, 1
|
||||||
call IsInArray
|
call IsInArray
|
||||||
|
@ -426,7 +426,7 @@ StartMenu_Item::
|
||||||
ld a, [wIsKeyItem]
|
ld a, [wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .skipAskingQuantity
|
jr nz, .skipAskingQuantity
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
jr c, .skipAskingQuantity
|
jr c, .skipAskingQuantity
|
||||||
call DisplayChooseQuantityMenu
|
call DisplayChooseQuantityMenu
|
||||||
|
|
|
@ -59,7 +59,7 @@ DisplayCreditsMon:
|
||||||
ld hl, CreditsMons
|
ld hl, CreditsMons
|
||||||
add hl, bc ; go that far in the list of monsters and get the next one
|
add hl, bc ; go that far in the list of monsters and get the next one
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
hlcoord 8, 6
|
hlcoord 8, 6
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
|
|
|
@ -2,7 +2,7 @@ EvolveMon:
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
push af
|
push af
|
||||||
ld a, [wd0b5]
|
ld a, [wd0b5]
|
||||||
push af
|
push af
|
||||||
|
@ -25,7 +25,7 @@ EvolveMon:
|
||||||
ld c, 0
|
ld c, 0
|
||||||
call EvolutionSetWholeScreenPalette
|
call EvolutionSetWholeScreenPalette
|
||||||
ld a, [wEvoNewSpecies]
|
ld a, [wEvoNewSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call Evolution_LoadPic
|
call Evolution_LoadPic
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
|
@ -33,7 +33,7 @@ EvolveMon:
|
||||||
ld bc, 7 * 7
|
ld bc, 7 * 7
|
||||||
call CopyVideoData
|
call CopyVideoData
|
||||||
ld a, [wEvoOldSpecies]
|
ld a, [wEvoOldSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call Evolution_LoadPic
|
call Evolution_LoadPic
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
@ -77,7 +77,7 @@ EvolveMon:
|
||||||
pop af
|
pop af
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
pop bc
|
pop bc
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
|
|
|
@ -101,7 +101,7 @@ HoFShowMonOrPlayer:
|
||||||
ld a, $c0
|
ld a, $c0
|
||||||
ldh [hSCX], a
|
ldh [hSCX], a
|
||||||
ld a, [wHoFMonSpecies]
|
ld a, [wHoFMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld [wBattleMonSpecies2], a
|
ld [wBattleMonSpecies2], a
|
||||||
ld [wWholeScreenPaletteMonSpecies], a
|
ld [wWholeScreenPaletteMonSpecies], a
|
||||||
|
|
|
@ -52,7 +52,7 @@ OakSpeech:
|
||||||
predef InitPlayerData2
|
predef InitPlayerData2
|
||||||
ld hl, wNumBoxItems
|
ld hl, wNumBoxItems
|
||||||
ld a, POTION
|
ld a, POTION
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wItemQuantity], a
|
ld [wItemQuantity], a
|
||||||
call AddItemToInventory
|
call AddItemToInventory
|
||||||
|
@ -74,7 +74,7 @@ OakSpeech:
|
||||||
call ClearScreen
|
call ClearScreen
|
||||||
ld a, NIDORINO
|
ld a, NIDORINO
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
hlcoord 6, 4
|
hlcoord 6, 4
|
||||||
call LoadFlippedFrontSpriteByMonIndex
|
call LoadFlippedFrontSpriteByMonIndex
|
||||||
|
|
|
@ -361,7 +361,7 @@ ClearBothBGMaps:
|
||||||
jp FillMemory
|
jp FillMemory
|
||||||
|
|
||||||
LoadTitleMonSprite:
|
LoadTitleMonSprite:
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
hlcoord 5, 10
|
hlcoord 5, 10
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
|
|
|
@ -727,7 +727,7 @@ Trade_CircleOAM3:
|
||||||
|
|
||||||
; a = species
|
; a = species
|
||||||
Trade_LoadMonSprite:
|
Trade_LoadMonSprite:
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld [wWholeScreenPaletteMonSpecies], a
|
ld [wWholeScreenPaletteMonSpecies], a
|
||||||
ld b, SET_PAL_POKEMON_WHOLE_SCREEN
|
ld b, SET_PAL_POKEMON_WHOLE_SCREEN
|
||||||
|
|
|
@ -9,7 +9,7 @@ PrintStrengthText:
|
||||||
UsedStrengthText:
|
UsedStrengthText:
|
||||||
text_far _UsedStrengthText
|
text_far _UsedStrengthText
|
||||||
text_asm
|
text_asm
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
call Delay3
|
call Delay3
|
||||||
jp TextScriptEnd
|
jp TextScriptEnd
|
||||||
|
|
|
@ -21,7 +21,7 @@ _AddPartyMon::
|
||||||
jr nc, .noCarry
|
jr nc, .noCarry
|
||||||
inc d
|
inc d
|
||||||
.noCarry
|
.noCarry
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [de], a ; write species of new mon in party list
|
ld [de], a ; write species of new mon in party list
|
||||||
inc de
|
inc de
|
||||||
ld a, $ff ; terminator
|
ld a, $ff ; terminator
|
||||||
|
@ -64,7 +64,7 @@ _AddPartyMon::
|
||||||
ld e, l
|
ld e, l
|
||||||
ld d, h
|
ld d, h
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld hl, wMonHeader
|
ld hl, wMonHeader
|
||||||
|
@ -80,7 +80,7 @@ _AddPartyMon::
|
||||||
jr nz, .next4
|
jr nz, .next4
|
||||||
|
|
||||||
; If the mon is being added to the player's party, update the pokedex.
|
; If the mon is being added to the player's party, update the pokedex.
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
push de
|
push de
|
||||||
predef IndexToPokedex
|
predef IndexToPokedex
|
||||||
|
@ -275,7 +275,7 @@ AddPartyMon_WriteMovePP:
|
||||||
jr nz, .pploop ; there are still moves to read
|
jr nz, .pploop ; there are still moves to read
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; adds enemy mon [wcf91] (at position [wWhichPokemon] in enemy list) to own party
|
; adds enemy mon [wCurPartySpecies] (at position [wWhichPokemon] in enemy list) to own party
|
||||||
; used in the cable club trade center
|
; used in the cable club trade center
|
||||||
_AddEnemyMonToPlayerParty::
|
_AddEnemyMonToPlayerParty::
|
||||||
ld hl, wPartyCount
|
ld hl, wPartyCount
|
||||||
|
@ -288,7 +288,7 @@ _AddEnemyMonToPlayerParty::
|
||||||
ld c, a
|
ld c, a
|
||||||
ld b, $0
|
ld b, $0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [hli], a ; add mon as last list entry
|
ld [hli], a ; add mon as last list entry
|
||||||
ld [hl], $ff ; write new sentinel
|
ld [hl], $ff ; write new sentinel
|
||||||
ld hl, wPartyMons
|
ld hl, wPartyMons
|
||||||
|
@ -322,7 +322,7 @@ _AddEnemyMonToPlayerParty::
|
||||||
call SkipFixedLengthTextEntries
|
call SkipFixedLengthTextEntries
|
||||||
ld bc, NAME_LENGTH
|
ld bc, NAME_LENGTH
|
||||||
call CopyData ; write new mon's nickname (from an enemy mon)
|
call CopyData ; write new mon's nickname (from an enemy mon)
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
predef IndexToPokedex
|
predef IndexToPokedex
|
||||||
ld a, [wd11e]
|
ld a, [wd11e]
|
||||||
|
@ -371,7 +371,7 @@ _MoveMon::
|
||||||
cp DAYCARE_TO_PARTY
|
cp DAYCARE_TO_PARTY
|
||||||
ld a, [wDayCareMon]
|
ld a, [wDayCareMon]
|
||||||
jr z, .copySpecies
|
jr z, .copySpecies
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
.copySpecies
|
.copySpecies
|
||||||
ld [hli], a ; write new mon ID
|
ld [hli], a ; write new mon ID
|
||||||
ld [hl], $ff ; write new sentinel
|
ld [hl], $ff ; write new sentinel
|
||||||
|
|
|
@ -224,7 +224,7 @@ BillsPCDeposit:
|
||||||
jp c, BillsPCMenu
|
jp c, BillsPCMenu
|
||||||
call DisplayDepositWithdrawMenu
|
call DisplayDepositWithdrawMenu
|
||||||
jp nc, BillsPCMenu
|
jp nc, BillsPCMenu
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call GetCryData
|
call GetCryData
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ld a, PARTY_TO_BOX
|
ld a, PARTY_TO_BOX
|
||||||
|
@ -276,7 +276,7 @@ BillsPCWithdraw:
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld hl, wBoxMonNicks
|
ld hl, wBoxMonNicks
|
||||||
call GetPartyMonName
|
call GetPartyMonName
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call GetCryData
|
call GetCryData
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
xor a ; BOX_TO_PARTY
|
xor a ; BOX_TO_PARTY
|
||||||
|
@ -311,7 +311,7 @@ BillsPCRelease:
|
||||||
ld [wRemoveMonFromBox], a
|
ld [wRemoveMonFromBox], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
ld hl, MonWasReleasedText
|
ld hl, MonWasReleasedText
|
||||||
call PrintText
|
call PrintText
|
||||||
|
|
|
@ -53,13 +53,13 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
push af
|
push af
|
||||||
xor a ; PLAYER_PARTY_DATA
|
xor a ; PLAYER_PARTY_DATA
|
||||||
ld [wMonDataLocation], a
|
ld [wMonDataLocation], a
|
||||||
call LoadMonData
|
call LoadMonData
|
||||||
pop af
|
pop af
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
pop hl
|
pop hl
|
||||||
|
|
||||||
.evoEntryLoop ; loop over evolution entries
|
.evoEntryLoop ; loop over evolution entries
|
||||||
|
@ -95,7 +95,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
.checkItemEvo
|
.checkItemEvo
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld b, a ; evolution item
|
ld b, a ; evolution item
|
||||||
ld a, [wcf91] ; this is supposed to be the last item used, but it is also used to hold species numbers
|
ld a, [wCurItem]
|
||||||
cp b ; was the evolution item in this entry used?
|
cp b ; was the evolution item in this entry used?
|
||||||
jp nz, .nextEvoEntry1 ; if not, go to the next evolution entry
|
jp nz, .nextEvoEntry1 ; if not, go to the next evolution entry
|
||||||
.checkLevel
|
.checkLevel
|
||||||
|
@ -320,7 +320,7 @@ Evolution_ReloadTilesetTilePatterns:
|
||||||
LearnMoveFromLevelUp:
|
LearnMoveFromLevelUp:
|
||||||
ld hl, EvosMovesPointerTable
|
ld hl, EvosMovesPointerTable
|
||||||
ld a, [wd11e] ; species
|
ld a, [wd11e] ; species
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
dec a
|
dec a
|
||||||
ld bc, 0
|
ld bc, 0
|
||||||
ld hl, EvosMovesPointerTable
|
ld hl, EvosMovesPointerTable
|
||||||
|
@ -371,7 +371,7 @@ LearnMoveFromLevelUp:
|
||||||
call CopyToStringBuffer
|
call CopyToStringBuffer
|
||||||
predef LearnMove
|
predef LearnMove
|
||||||
.done
|
.done
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ WriteMonMoves:
|
||||||
push bc
|
push bc
|
||||||
ld hl, EvosMovesPointerTable
|
ld hl, EvosMovesPointerTable
|
||||||
ld b, 0
|
ld b, 0
|
||||||
ld a, [wcf91] ; cur mon ID
|
ld a, [wCurPartySpecies]
|
||||||
dec a
|
dec a
|
||||||
add a
|
add a
|
||||||
rl b
|
rl b
|
||||||
|
|
|
@ -4,11 +4,11 @@ LoadMonData_::
|
||||||
; 1: enemymon
|
; 1: enemymon
|
||||||
; 2: boxmon
|
; 2: boxmon
|
||||||
; 3: daycaremon
|
; 3: daycaremon
|
||||||
; Return monster id at wcf91 and its data at wLoadedMon.
|
; Return monster id at wCurPartySpecies and its data at wLoadedMon.
|
||||||
; Also load base stats at wMonHeader for convenience.
|
; Also load base stats at wMonHeader for convenience.
|
||||||
|
|
||||||
ld a, [wDayCareMonSpecies]
|
ld a, [wDayCareMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, [wMonDataLocation]
|
ld a, [wMonDataLocation]
|
||||||
cp DAYCARE_DATA
|
cp DAYCARE_DATA
|
||||||
jr z, .GetMonHeader
|
jr z, .GetMonHeader
|
||||||
|
@ -18,7 +18,7 @@ LoadMonData_::
|
||||||
callfar GetMonSpecies
|
callfar GetMonSpecies
|
||||||
|
|
||||||
.GetMonHeader
|
.GetMonHeader
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd0b5], a ; input for GetMonHeader
|
ld [wd0b5], a ; input for GetMonHeader
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
|
|
||||||
|
|
|
@ -170,9 +170,9 @@ StatusScreen:
|
||||||
call GBPalNormal
|
call GBPalNormal
|
||||||
hlcoord 1, 0
|
hlcoord 1, 0
|
||||||
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
|
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry ; play Pokémon cry
|
call PlayCry
|
||||||
call WaitForTextScrollButtonPress ; wait for button
|
call WaitForTextScrollButtonPress
|
||||||
pop af
|
pop af
|
||||||
ldh [hTileAnimations], a
|
ldh [hTileAnimations], a
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -4,7 +4,7 @@ GiveItem::
|
||||||
; Return carry on success.
|
; Return carry on success.
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
ld a, c
|
ld a, c
|
||||||
ld [wItemQuantity], a
|
ld [wItemQuantity], a
|
||||||
ld hl, wNumBagItems
|
ld hl, wNumBagItems
|
||||||
|
@ -18,7 +18,7 @@ GiveItem::
|
||||||
GivePokemon::
|
GivePokemon::
|
||||||
; Give the player monster b at level c.
|
; Give the player monster b at level c.
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, c
|
ld a, c
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
xor a ; PLAYER_PARTY_DATA
|
xor a ; PLAYER_PARTY_DATA
|
||||||
|
|
|
@ -28,7 +28,7 @@ RemoveItemFromInventory::
|
||||||
; function to add an item (in varying quantities) to the player's bag or PC box
|
; function to add an item (in varying quantities) to the player's bag or PC box
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
|
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; [wItemQuantity] = item quantity
|
; [wItemQuantity] = item quantity
|
||||||
; sets carry flag if successful, unsets carry flag if unsuccessful
|
; sets carry flag if successful, unsets carry flag if unsuccessful
|
||||||
AddItemToInventory::
|
AddItemToInventory::
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
; uses an item
|
; uses an item
|
||||||
; UseItem is used with dummy items to perform certain other functions as well
|
; UseItem is used with dummy items to perform certain other functions as well
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wActionResultOrTookBattleTurn] = success
|
; [wActionResultOrTookBattleTurn] = success
|
||||||
; 00: unsuccessful
|
; 00: unsuccessful
|
||||||
|
@ -13,7 +13,7 @@ UseItem::
|
||||||
; confirms the item toss and then tosses the item
|
; confirms the item toss and then tosses the item
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; [wWhichPokemon] = index of item within inventory
|
; [wWhichPokemon] = index of item within inventory
|
||||||
; [wItemQuantity] = quantity to toss
|
; [wItemQuantity] = quantity to toss
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
|
@ -33,7 +33,7 @@ TossItem::
|
||||||
|
|
||||||
; checks if an item is a key item
|
; checks if an item is a key item
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wcf91] = item ID
|
; [wCurItem] = item ID
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wIsKeyItem] = result
|
; [wIsKeyItem] = result
|
||||||
; 00: item is not key item
|
; 00: item is not key item
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
GetItemPrice::
|
GetItemPrice::
|
||||||
; Stores item's price as BCD at hItemPrice (3 bytes)
|
; Stores item's price as BCD at hItemPrice (3 bytes)
|
||||||
; Input: [wcf91] = item id
|
; Input: [wCurItem] = item id
|
||||||
ldh a, [hLoadedROMBank]
|
ldh a, [hLoadedROMBank]
|
||||||
push af
|
push af
|
||||||
ld a, [wListMenuID]
|
ld a, [wListMenuID]
|
||||||
|
@ -15,7 +15,7 @@ GetItemPrice::
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
ld a, [wcf91] ; a contains item id
|
ld a, [wCurItem]
|
||||||
cp HM01
|
cp HM01
|
||||||
jr nc, .getTMPrice
|
jr nc, .getTMPrice
|
||||||
ld bc, $3
|
ld bc, $3
|
||||||
|
|
|
@ -124,28 +124,30 @@ DisplayListMenuIDLoop::
|
||||||
ld b, 0
|
ld b, 0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wCurListMenuItem], a
|
||||||
ld a, [wListMenuID]
|
ld a, [wListMenuID]
|
||||||
and a ; PCPOKEMONLISTMENU?
|
and a ; PCPOKEMONLISTMENU?
|
||||||
jr z, .pokemonList
|
jr z, .pokemonList
|
||||||
|
; if it's an item menu
|
||||||
|
assert wCurListMenuItem == wCurItem
|
||||||
push hl
|
push hl
|
||||||
call GetItemPrice
|
call GetItemPrice
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wListMenuID]
|
ld a, [wListMenuID]
|
||||||
cp ITEMLISTMENU
|
cp ITEMLISTMENU
|
||||||
jr nz, .skipGettingQuantity
|
jr nz, .skipGettingQuantity
|
||||||
; if it's an item menu
|
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [hl] ; a = item quantity
|
ld a, [hl] ; a = item quantity
|
||||||
ld [wMaxItemQuantity], a
|
ld [wMaxItemQuantity], a
|
||||||
.skipGettingQuantity
|
.skipGettingQuantity
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld a, BANK(ItemNames)
|
ld a, BANK(ItemNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
call GetName
|
call GetName
|
||||||
jr .storeChosenEntry
|
jr .storeChosenEntry
|
||||||
.pokemonList
|
.pokemonList
|
||||||
|
assert wCurListMenuItem == wCurPartySpecies
|
||||||
ld hl, wPartyCount
|
ld hl, wPartyCount
|
||||||
ld a, [wListPointer]
|
ld a, [wListPointer]
|
||||||
cp l ; is it a list of party pokemon or box pokemon?
|
cp l ; is it a list of party pokemon or box pokemon?
|
||||||
|
@ -413,8 +415,8 @@ PrintListMenuEntries::
|
||||||
push hl
|
push hl
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld de, ItemPrices
|
ld de, ItemPrices
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
call GetItemPrice ; get price
|
call GetItemPrice
|
||||||
pop hl
|
pop hl
|
||||||
ld bc, SCREEN_WIDTH + 5 ; 1 row down and 5 columns right
|
ld bc, SCREEN_WIDTH + 5 ; 1 row down and 5 columns right
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
@ -468,7 +470,7 @@ PrintListMenuEntries::
|
||||||
jr nz, .nextListEntry
|
jr nz, .nextListEntry
|
||||||
.printItemQuantity
|
.printItemQuantity
|
||||||
ld a, [wd11e]
|
ld a, [wd11e]
|
||||||
ld [wcf91], a
|
ld [wCurItem], a
|
||||||
call IsKeyItem ; check if item is unsellable
|
call IsKeyItem ; check if item is unsellable
|
||||||
ld a, [wIsKeyItem]
|
ld a, [wIsKeyItem]
|
||||||
and a ; is the item unsellable?
|
and a ; is the item unsellable?
|
||||||
|
|
|
@ -16,7 +16,7 @@ UncompressMonSprite::
|
||||||
; $4A ≤ index < $74: bank $B ("Pics 3")
|
; $4A ≤ index < $74: bank $B ("Pics 3")
|
||||||
; $74 ≤ index < $99: bank $C ("Pics 4")
|
; $74 ≤ index < $99: bank $C ("Pics 4")
|
||||||
; $99 ≤ index: bank $D ("Pics 5")
|
; $99 ≤ index: bank $D ("Pics 5")
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld b, a
|
ld b, a
|
||||||
cp MEW
|
cp MEW
|
||||||
ld a, BANK(MewPicFront)
|
ld a, BANK(MewPicFront)
|
||||||
|
|
|
@ -77,7 +77,7 @@ DrawHPBar::
|
||||||
; 02: current box
|
; 02: current box
|
||||||
; 03: daycare
|
; 03: daycare
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wcf91] = pokemon ID
|
; [wCurPartySpecies] = pokemon ID
|
||||||
; wLoadedMon = base address of pokemon data
|
; wLoadedMon = base address of pokemon data
|
||||||
; wMonHeader = base address of base stats
|
; wMonHeader = base address of base stats
|
||||||
LoadMonData::
|
LoadMonData::
|
||||||
|
@ -101,7 +101,7 @@ LoadFrontSpriteByMonIndex::
|
||||||
push hl
|
push hl
|
||||||
ld a, [wd11e]
|
ld a, [wd11e]
|
||||||
push af
|
push af
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
predef IndexToPokedex
|
predef IndexToPokedex
|
||||||
ld hl, wd11e
|
ld hl, wd11e
|
||||||
|
@ -115,7 +115,7 @@ LoadFrontSpriteByMonIndex::
|
||||||
jr c, .validDexNumber ; dex >#151 invalid
|
jr c, .validDexNumber ; dex >#151 invalid
|
||||||
.invalidDexNumber
|
.invalidDexNumber
|
||||||
ld a, RHYDON ; $1
|
ld a, RHYDON ; $1
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ret
|
ret
|
||||||
.validDexNumber
|
.validDexNumber
|
||||||
push hl
|
push hl
|
||||||
|
@ -264,7 +264,7 @@ HandlePartyMenuInput::
|
||||||
ld c, a
|
ld c, a
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wBattleMonSpecies2], a
|
ld [wBattleMonSpecies2], a
|
||||||
call BankswitchBack
|
call BankswitchBack
|
||||||
and a
|
and a
|
||||||
|
|
|
@ -1073,7 +1073,10 @@ wUnusedNamePointer:: dw
|
||||||
|
|
||||||
wItemPrices:: dw
|
wItemPrices:: dw
|
||||||
|
|
||||||
wcf91:: db ; used with a lot of things (too much to list here)
|
wCurPartySpecies::
|
||||||
|
wCurItem::
|
||||||
|
wCurListMenuItem::
|
||||||
|
db
|
||||||
|
|
||||||
; which pokemon you selected
|
; which pokemon you selected
|
||||||
wWhichPokemon:: db
|
wWhichPokemon:: db
|
||||||
|
|
|
@ -34,7 +34,7 @@ CeruleanBadgeHouseMiddleAgedManText:
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jr c, .done
|
jr c, .done
|
||||||
ld hl, CeruleanBadgeHouseBadgeTextPointers
|
ld hl, CeruleanBadgeHouseBadgeTextPointers
|
||||||
ld a, [wcf91]
|
ld a, [wCurItem]
|
||||||
sub BOULDERBADGE
|
sub BOULDERBADGE
|
||||||
add a
|
add a
|
||||||
ld d, $0
|
ld d, $0
|
||||||
|
|
|
@ -54,7 +54,7 @@ DaycareGentlemanText:
|
||||||
xor a
|
xor a
|
||||||
ld [wRemoveMonFromBox], a
|
ld [wRemoveMonFromBox], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
ld hl, .ComeSeeMeInAWhileText
|
ld hl, .ComeSeeMeInAWhileText
|
||||||
jp .done
|
jp .done
|
||||||
|
@ -169,7 +169,7 @@ DaycareGentlemanText:
|
||||||
ld [wMoveMonType], a
|
ld [wMoveMonType], a
|
||||||
call MoveMon
|
call MoveMon
|
||||||
ld a, [wDayCareMonSpecies]
|
ld a, [wDayCareMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
dec a
|
dec a
|
||||||
push af
|
push af
|
||||||
|
@ -198,7 +198,7 @@ DaycareGentlemanText:
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
|
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
call PlayCry
|
call PlayCry
|
||||||
ld hl, .GotMonBackText
|
ld hl, .GotMonBackText
|
||||||
jr .done
|
jr .done
|
||||||
|
|
|
@ -239,7 +239,7 @@ FightingDojoHitmonleePokeBallText:
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .done
|
jr nz, .done
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, 30
|
ld c, 30
|
||||||
call GivePokemon
|
call GivePokemon
|
||||||
|
@ -273,7 +273,7 @@ FightingDojoHitmonchanPokeBallText:
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .done
|
jr nz, .done
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, 30
|
ld c, 30
|
||||||
call GivePokemon
|
call GivePokemon
|
||||||
|
|
|
@ -321,7 +321,7 @@ OaksLabRivalChoosesStarterScript:
|
||||||
call Delay3
|
call Delay3
|
||||||
ld a, [wRivalStarterTemp]
|
ld a, [wRivalStarterTemp]
|
||||||
ld [wRivalStarter], a
|
ld [wRivalStarter], a
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetMonName
|
call GetMonName
|
||||||
ld a, OAKSLAB_RIVAL
|
ld a, OAKSLAB_RIVAL
|
||||||
|
@ -824,7 +824,7 @@ OaksLabBulbasaurPokeBallText:
|
||||||
ld b, OAKSLAB_BULBASAUR_POKE_BALL
|
ld b, OAKSLAB_BULBASAUR_POKE_BALL
|
||||||
|
|
||||||
OaksLabSelectedPokeBallScript:
|
OaksLabSelectedPokeBallScript:
|
||||||
ld [wcf91], a
|
ld [wCurPartySpecies], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [wSpriteIndex], a
|
ld [wSpriteIndex], a
|
||||||
|
@ -897,7 +897,7 @@ OaksLabMonChoiceMenu:
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
and a
|
and a
|
||||||
jr nz, OaksLabMonChoiceEnd
|
jr nz, OaksLabMonChoiceEnd
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wPlayerStarter], a
|
ld [wPlayerStarter], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetMonName
|
call GetMonName
|
||||||
|
@ -926,7 +926,7 @@ OaksLabMonChoiceMenu:
|
||||||
ld [wMonDataLocation], a
|
ld [wMonDataLocation], a
|
||||||
ld a, 5
|
ld a, 5
|
||||||
ld [wCurEnemyLevel], a
|
ld [wCurEnemyLevel], a
|
||||||
ld a, [wcf91]
|
ld a, [wCurPartySpecies]
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call AddPartyMon
|
call AddPartyMon
|
||||||
ld hl, wStatusFlags4
|
ld hl, wStatusFlags4
|
||||||
|
|
Loading…
Reference in a new issue