-
Notifications
You must be signed in to change notification settings - Fork 1k
Add caught icon to battle HUD for already‐owned Pokémon
dannye edited this page Oct 11, 2024
·
2 revisions
The battle HUD is drawn in DrawEnemyHUDAndHPBar:
from engine/battle/core.asm.
You can add the "Pokéball" tile to gfx/font/font_battle_extra.png by replacing an unused tile, such as the unused Japanese opening quote tile (looks like an upside-down L); the second tile in the second row. This ends up as tile ID $72 when it is loaded into VRAM. If you replace a different unused tile, then be sure to use the correct tile ID in the code below.
...
DrawEnemyHUDAndHPBar:
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 0, 0
lb bc, 4, 12
call ClearScreenArea
callfar PlaceEnemyHUDTiles
+ push hl
+ ld a, [wEnemyMonSpecies2]
+ ld [wPokedexNum], a
+ callfar IndexToPokedex
+ ld a, [wPokedexNum]
+ dec a
+ ld c, a
+ ld b, FLAG_TEST
+ ld hl, wPokedexOwned
+ predef FlagActionPredef
+ ld a, c
+ and a
+ jr z, .notOwned
+ hlcoord 1, 1
+ ld [hl], $72 ; replace this with your Poké Ball icon or other character
+.notOwned
+ pop hl
ld de, wEnemyMonNick
hlcoord 1, 0
call CenterMonName
call PlaceString
hlcoord 4, 1
push hl
inc hl
...