summaryrefslogtreecommitdiff
path: root/home/pokemon.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/pokemon.asm')
-rw-r--r--home/pokemon.asm73
1 files changed, 45 insertions, 28 deletions
diff --git a/home/pokemon.asm b/home/pokemon.asm
index 4e6e080b..93b536ff 100644
--- a/home/pokemon.asm
+++ b/home/pokemon.asm
@@ -5,7 +5,6 @@ DrawHPBar::
push hl
push de
- push bc
; Left
ld a, $71 ; "HP:"
@@ -61,7 +60,6 @@ DrawHPBar::
add e
ld [hl], a
.done
- pop bc
pop de
pop hl
ret
@@ -125,24 +123,32 @@ LoadFrontSpriteByMonIndex::
ldh a, [hLoadedROMBank]
push af
ld a, BANK(CopyUncompressedPicToHL)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
xor a
ldh [hStartTileID], a
call CopyUncompressedPicToHL
xor a
ld [wSpriteFlipped], a
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- ret
+ jp BankswitchCommon
PlayCry::
; Play monster a's cry.
+ push bc
+ ld b, a
+ ld a, [wLowHealthAlarm]
+ push af
+ xor a
+ ld [wLowHealthAlarm], a
+ ld a, b
call GetCryData
call PlaySound
- jp WaitForSoundToFinish
+ call WaitForSoundToFinish
+ pop af
+ ld [wLowHealthAlarm], a
+ pop bc
+ ret
GetCryData::
; Load cry data for monster a.
@@ -239,12 +245,23 @@ HandlePartyMenuInput::
ld a, $40
ld [wPartyMenuAnimMonEnabled], a
call HandleMenuInput_
- call PlaceUnfilledArrowMenuCursor
- ld b, a
- xor a
+ push af ; save hJoy5 OR wMenuWrapping enabled, if no inputs were selected within a certain period of time
+ bit 1, a ; was B button pressed?
+ ld a, $0
ld [wPartyMenuAnimMonEnabled], a
ld a, [wCurrentMenuItem]
ld [wPartyAndBillsPCSavedMenuItem], a
+ jr nz, .asm_1258
+ ld a, [wCurrentMenuItem]
+ ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_1258
+ call CheckPikachuFollowingPlayer
+ jr nz, .asm_128f
+.asm_1258
+ pop af
+ call PlaceUnfilledArrowMenuCursor
+ ld b, a
ld hl, wd730
res 6, [hl] ; turn on letter printing delay
ld a, [wMenuItemToSwap]
@@ -269,6 +286,14 @@ HandlePartyMenuInput::
call BankswitchBack
and a
ret
+.asm_128f
+ pop af
+ ld hl, PartyMenuText_12cc
+ call PrintText
+ xor a
+ ld [wMenuItemToSwap], a
+ pop af
+ ldh [hTileAnimations], a
.noPokemonChosen
call BankswitchBack
scf
@@ -282,12 +307,16 @@ HandlePartyMenuInput::
ld [wMenuItemToSwap], a
ld [wPartyMenuTypeOrMessageID], a
call RedrawPartyMenu
- jr HandlePartyMenuInput
+ jp HandlePartyMenuInput
.handleSwap
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
farcall SwitchPartyMon
- jr HandlePartyMenuInput
+ jp HandlePartyMenuInput
+
+PartyMenuText_12cc::
+ text_far _SleepingPikachuText1
+ text_end
DrawPartyMenu::
ld hl, DrawPartyMenu_
@@ -325,8 +354,7 @@ PrintStatusCondition::
ret
PrintStatusConditionNotFainted::
- homecall_sf PrintStatusAilment
- ret
+ homejp_sf PrintStatusAilment
; function to print pokemon level, leaving off the ":L" if the level is at least 100
; INPUT:
@@ -376,8 +404,7 @@ GetMonHeader::
ldh a, [hLoadedROMBank]
push af
ld a, BANK(BaseStats)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
push bc
push de
push hl
@@ -396,8 +423,6 @@ GetMonHeader::
ld b, $77 ; size of Aerodactyl fossil sprite
cp FOSSIL_AERODACTYL ; Aerodactyl fossil
jr z, .specialID
- cp MEW
- jr z, .mew
predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number
ld a, [wd11e]
dec a
@@ -415,13 +440,6 @@ GetMonHeader::
ld [hl], e ; write front sprite pointer
inc hl
ld [hl], d
- jr .done
-.mew
- ld hl, MewBaseStats
- ld de, wMonHeader
- ld bc, BASE_DATA_SIZE
- ld a, BANK(MewBaseStats)
- call FarCopyData
.done
ld a, [wd0b5]
ld [wMonHIndex], a
@@ -431,8 +449,7 @@ GetMonHeader::
pop de
pop bc
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; copy party pokemon's name to wcd6d