2016-06-12 00:24:04 +00:00
|
|
|
DrawHP:
|
2015-04-01 09:23:27 +00:00
|
|
|
; Draws the HP bar in the stats screen
|
|
|
|
call GetPredefRegisters
|
|
|
|
ld a, $1
|
|
|
|
jr DrawHP_
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
DrawHP2:
|
2015-04-01 09:23:27 +00:00
|
|
|
; Draws the HP bar in the party screen
|
|
|
|
call GetPredefRegisters
|
|
|
|
ld a, $2
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
DrawHP_:
|
2015-04-01 09:23:27 +00:00
|
|
|
ld [wHPBarType], a
|
|
|
|
push hl
|
|
|
|
ld a, [wLoadedMonHP]
|
|
|
|
ld b, a
|
|
|
|
ld a, [wLoadedMonHP + 1]
|
|
|
|
ld c, a
|
|
|
|
or b
|
|
|
|
jr nz, .nonzeroHP
|
|
|
|
xor a
|
|
|
|
ld c, a
|
|
|
|
ld e, a
|
|
|
|
ld a, $6
|
|
|
|
ld d, a
|
|
|
|
jp .drawHPBarAndPrintFraction
|
|
|
|
.nonzeroHP
|
|
|
|
ld a, [wLoadedMonMaxHP]
|
|
|
|
ld d, a
|
|
|
|
ld a, [wLoadedMonMaxHP + 1]
|
|
|
|
ld e, a
|
|
|
|
predef HPBarLength
|
|
|
|
ld a, $6
|
|
|
|
ld d, a
|
|
|
|
ld c, a
|
|
|
|
.drawHPBarAndPrintFraction
|
|
|
|
pop hl
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
push hl
|
|
|
|
call DrawHPBar
|
|
|
|
pop hl
|
|
|
|
ld a, [hFlags_0xFFF6]
|
|
|
|
bit 0, a
|
|
|
|
jr z, .printFractionBelowBar
|
|
|
|
ld bc, $9 ; right of bar
|
|
|
|
jr .printFraction
|
|
|
|
.printFractionBelowBar
|
|
|
|
ld bc, SCREEN_WIDTH + 1 ; below bar
|
|
|
|
.printFraction
|
|
|
|
add hl, bc
|
|
|
|
ld de, wLoadedMonHP
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 2, 3
|
2015-04-01 09:23:27 +00:00
|
|
|
call PrintNumber
|
|
|
|
ld a, "/"
|
|
|
|
ld [hli], a
|
|
|
|
ld de, wLoadedMonMaxHP
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 2, 3
|
2015-04-01 09:23:27 +00:00
|
|
|
call PrintNumber
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2014-05-22 22:13:20 +00:00
|
|
|
; Predef 0x37
|
2016-06-12 00:24:04 +00:00
|
|
|
StatusScreen:
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadMonData
|
2015-07-16 03:04:58 +00:00
|
|
|
ld a, [wMonDataLocation]
|
|
|
|
cp BOX_DATA
|
2015-07-03 19:37:53 +00:00
|
|
|
jr c, .DontRecalculate
|
2015-07-16 03:04:58 +00:00
|
|
|
; mon is in a box or daycare
|
2015-02-08 02:37:40 +00:00
|
|
|
ld a, [wLoadedMonBoxLevel]
|
|
|
|
ld [wLoadedMonLevel], a
|
2015-08-31 02:38:41 +00:00
|
|
|
ld [wCurEnemyLVL], a
|
2015-02-08 02:37:40 +00:00
|
|
|
ld hl, wLoadedMonHPExp - 1
|
|
|
|
ld de, wLoadedMonStats
|
2014-05-22 22:13:20 +00:00
|
|
|
ld b, $1
|
|
|
|
call CalcStats ; Recalculate stats
|
|
|
|
.DontRecalculate
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wd72c
|
2014-05-22 22:13:20 +00:00
|
|
|
set 1, [hl]
|
|
|
|
ld a, $33
|
2015-08-09 05:32:44 +00:00
|
|
|
ld [rNR50], a ; Reduce the volume
|
2014-05-22 22:13:20 +00:00
|
|
|
call GBPalWhiteOutWithDelay3
|
|
|
|
call ClearScreen
|
2015-07-03 19:37:53 +00:00
|
|
|
call UpdateSprites
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadHpBarAndStatusTilePatterns
|
2015-07-03 19:37:53 +00:00
|
|
|
ld de, BattleHudTiles1 ; source
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl, vChars2 + $6d0 ; dest
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, BANK(BattleHudTiles1), $03
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyVideoDataDouble ; ·│ :L and halfarrow line end
|
2015-07-03 19:37:53 +00:00
|
|
|
ld de, BattleHudTiles2
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl, vChars2 + $780
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, BANK(BattleHudTiles2), $01
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyVideoDataDouble ; │
|
2015-07-03 19:37:53 +00:00
|
|
|
ld de, BattleHudTiles3
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl, vChars2 + $760
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, BANK(BattleHudTiles3), $02
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyVideoDataDouble ; ─┘
|
|
|
|
ld de, PTile
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl, vChars2 + $720
|
2015-08-10 04:56:20 +00:00
|
|
|
lb bc, BANK(PTile), (PTileEnd - PTile) / $8
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyVideoDataDouble ; P (for PP), inline
|
2014-09-14 18:29:18 +00:00
|
|
|
ld a, [hTilesetType]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
|
|
|
xor a
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType], a
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 19, 1
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 6, 10
|
2014-05-22 22:13:20 +00:00
|
|
|
call DrawLineBox ; Draws the box around name, HP and status
|
2015-08-05 21:20:29 +00:00
|
|
|
ld de, -6
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, de
|
2016-07-18 06:48:34 +00:00
|
|
|
ld [hl], "⠄" ; . after No ("." is a different one)
|
2014-05-22 22:13:20 +00:00
|
|
|
dec hl
|
|
|
|
ld [hl], "№"
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 19, 9
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 8, 6
|
2014-05-22 22:13:20 +00:00
|
|
|
call DrawLineBox ; Draws the box around types, ID No. and OT
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 10, 9
|
2014-05-22 22:13:20 +00:00
|
|
|
ld de, Type1Text
|
|
|
|
call PlaceString ; "TYPE1/"
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 11, 3
|
2015-02-08 06:18:42 +00:00
|
|
|
predef DrawHP
|
2015-08-12 09:16:56 +00:00
|
|
|
ld hl, wStatusScreenHPBarColor
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetHealthBarColor
|
2015-08-12 09:16:56 +00:00
|
|
|
ld b, SET_PAL_STATUS_SCREEN
|
|
|
|
call RunPaletteCommand
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 16, 6
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonStatus
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintStatusCondition
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .StatusWritten
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 16, 6
|
2014-05-22 22:13:20 +00:00
|
|
|
ld de, OKText
|
|
|
|
call PlaceString ; "OK"
|
|
|
|
.StatusWritten
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 6
|
2014-05-22 22:13:20 +00:00
|
|
|
ld de, StatusText
|
|
|
|
call PlaceString ; "STATUS/"
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 14, 2
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintLevel ; Pokémon level
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wMonHIndex]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd11e], a
|
|
|
|
ld [wd0b5], a
|
2014-06-16 20:57:26 +00:00
|
|
|
predef IndexToPokedex
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 3, 7
|
2014-05-26 21:04:56 +00:00
|
|
|
ld de, wd11e
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, LEADING_ZEROES | 1, 3
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintNumber ; Pokémon no.
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 11, 10
|
2015-02-08 00:24:16 +00:00
|
|
|
predef PrintMonType
|
2015-07-03 19:37:53 +00:00
|
|
|
ld hl, NamePointers2
|
2015-07-16 03:04:58 +00:00
|
|
|
call .GetStringPointer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 1
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString ; Pokémon name
|
2015-07-03 19:37:53 +00:00
|
|
|
ld hl, OTPointers
|
2015-07-16 03:04:58 +00:00
|
|
|
call .GetStringPointer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 12, 16
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString ; OT
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 12, 14
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonOTID
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, LEADING_ZEROES | 2, 5
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintNumber ; ID Number
|
|
|
|
ld d, $0
|
|
|
|
call PrintStatsBox
|
|
|
|
call Delay3
|
|
|
|
call GBPalNormal
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 1, 0
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlayCry ; play Pokémon cry
|
|
|
|
call WaitForTextScrollButtonPress ; wait for button
|
|
|
|
pop af
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
2015-07-16 03:04:58 +00:00
|
|
|
|
|
|
|
.GetStringPointer
|
|
|
|
ld a, [wMonDataLocation]
|
2014-05-22 22:13:20 +00:00
|
|
|
add a
|
|
|
|
ld c, a
|
2015-07-16 03:04:58 +00:00
|
|
|
ld b, 0
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-07-16 03:04:58 +00:00
|
|
|
ld a, [wMonDataLocation]
|
|
|
|
cp DAYCARE_DATA
|
2014-05-22 22:13:20 +00:00
|
|
|
ret z
|
|
|
|
ld a, [wWhichPokemon]
|
|
|
|
jp SkipFixedLengthTextEntries
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
OTPointers:
|
2014-06-14 11:12:40 +00:00
|
|
|
dw wPartyMonOT
|
|
|
|
dw wEnemyMonOT
|
|
|
|
dw wBoxMonOT
|
2015-08-31 02:38:41 +00:00
|
|
|
dw wDayCareMonOT
|
2014-05-22 22:13:20 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
NamePointers2:
|
2014-06-14 11:12:40 +00:00
|
|
|
dw wPartyMonNicks
|
|
|
|
dw wEnemyMonNicks
|
|
|
|
dw wBoxMonNicks
|
2015-08-31 02:38:41 +00:00
|
|
|
dw wDayCareMonName
|
2014-05-22 22:13:20 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Type1Text:
|
2014-05-22 22:13:20 +00:00
|
|
|
db "TYPE1/", $4e
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Type2Text:
|
2014-05-22 22:13:20 +00:00
|
|
|
db "TYPE2/", $4e
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
IDNoText:
|
2016-07-18 06:17:03 +00:00
|
|
|
db $73, "№/", $4e
|
2014-05-22 22:13:20 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
OTText:
|
2016-07-18 06:17:03 +00:00
|
|
|
db "OT/"
|
|
|
|
next "@"
|
2014-05-22 22:13:20 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
StatusText:
|
2014-05-22 22:13:20 +00:00
|
|
|
db "STATUS/@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
OKText:
|
2014-05-22 22:13:20 +00:00
|
|
|
db "OK@"
|
|
|
|
|
|
|
|
; Draws a line starting from hl high b and wide c
|
2016-06-12 07:19:19 +00:00
|
|
|
DrawLineBox:
|
2015-08-05 21:20:29 +00:00
|
|
|
ld de, SCREEN_WIDTH ; New line
|
2014-05-22 22:13:20 +00:00
|
|
|
.PrintVerticalLine
|
|
|
|
ld [hl], $78 ; │
|
|
|
|
add hl, de
|
|
|
|
dec b
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .PrintVerticalLine
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hl], $77 ; ┘
|
|
|
|
dec hl
|
|
|
|
.PrintHorizLine
|
|
|
|
ld [hl], $76 ; ─
|
|
|
|
dec hl
|
|
|
|
dec c
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .PrintHorizLine
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hl], $6f ; ← (halfarrow ending)
|
|
|
|
ret
|
|
|
|
|
2016-06-12 06:42:19 +00:00
|
|
|
PTile: ; This is a single 1bpp "P" tile
|
2014-05-22 22:13:20 +00:00
|
|
|
INCBIN "gfx/p_tile.1bpp"
|
2015-08-10 04:56:20 +00:00
|
|
|
PTileEnd:
|
2014-05-22 22:13:20 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
PrintStatsBox:
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, d
|
|
|
|
and a ; a is 0 from the status screen
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .DifferentBox
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 0, 8
|
2016-06-12 04:30:05 +00:00
|
|
|
ld b, 8
|
|
|
|
ld c, 8
|
2014-05-22 22:13:20 +00:00
|
|
|
call TextBoxBorder ; Draws the box
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 1, 9 ; Start printing stats from here
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $0019 ; Number offset
|
2015-07-03 19:37:53 +00:00
|
|
|
jr .PrintStats
|
2014-05-22 22:13:20 +00:00
|
|
|
.DifferentBox
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 2
|
2016-06-12 04:30:05 +00:00
|
|
|
ld b, 8
|
|
|
|
ld c, 9
|
2014-05-22 22:13:20 +00:00
|
|
|
call TextBoxBorder
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 11, 3
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $0018
|
|
|
|
.PrintStats
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld de, StatsText
|
|
|
|
call PlaceString
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
add hl, bc
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonAttack
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 2, 3
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintStat
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonDefense
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintStat
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonSpeed
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintStat
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonSpecial
|
2014-05-22 22:13:20 +00:00
|
|
|
jp PrintNumber
|
2016-06-12 04:30:05 +00:00
|
|
|
PrintStat:
|
2014-05-22 22:13:20 +00:00
|
|
|
push hl
|
|
|
|
call PrintNumber
|
|
|
|
pop hl
|
2015-07-14 07:16:19 +00:00
|
|
|
ld de, SCREEN_WIDTH * 2
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, de
|
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
StatsText:
|
2014-05-22 22:13:20 +00:00
|
|
|
db "ATTACK"
|
|
|
|
next "DEFENSE"
|
|
|
|
next "SPEED"
|
|
|
|
next "SPECIAL@"
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
StatusScreen2:
|
2014-09-14 18:29:18 +00:00
|
|
|
ld a, [hTilesetType]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
|
|
|
xor a
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType], a
|
2015-07-19 03:49:52 +00:00
|
|
|
ld [H_AUTOBGTRANSFERENABLED], a
|
|
|
|
ld bc, NUM_MOVES + 1
|
2015-02-08 08:17:03 +00:00
|
|
|
ld hl, wMoves
|
2014-05-22 22:13:20 +00:00
|
|
|
call FillMemory
|
2015-02-08 02:37:40 +00:00
|
|
|
ld hl, wLoadedMonMoves
|
2015-02-08 08:17:03 +00:00
|
|
|
ld de, wMoves
|
|
|
|
ld bc, NUM_MOVES
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
2015-02-08 08:17:03 +00:00
|
|
|
callab FormatMovesString
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 2
|
2015-07-19 03:49:52 +00:00
|
|
|
lb bc, 5, 10
|
2014-05-22 22:13:20 +00:00
|
|
|
call ClearScreenArea ; Clear under name
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 19, 3
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hl], $78
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 0, 8
|
2015-07-19 03:49:52 +00:00
|
|
|
ld b, 8
|
|
|
|
ld c, 18
|
2014-05-22 22:13:20 +00:00
|
|
|
call TextBoxBorder ; Draw move container
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 2, 9
|
2015-02-08 08:17:03 +00:00
|
|
|
ld de, wMovesString
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString ; Print moves
|
2015-07-15 06:16:06 +00:00
|
|
|
ld a, [wNumMovesMinusOne]
|
2014-05-22 22:13:20 +00:00
|
|
|
inc a
|
|
|
|
ld c, a
|
|
|
|
ld a, $4
|
|
|
|
sub c
|
|
|
|
ld b, a ; Number of moves ?
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 11, 10
|
2015-07-14 07:16:19 +00:00
|
|
|
ld de, SCREEN_WIDTH * 2
|
|
|
|
ld a, $72 ; special P tile id
|
|
|
|
call StatusScreen_PrintPP ; Print "PP"
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, b
|
|
|
|
and a
|
2015-07-03 19:37:53 +00:00
|
|
|
jr z, .InitPP
|
2014-05-22 22:13:20 +00:00
|
|
|
ld c, a
|
|
|
|
ld a, "-"
|
2015-07-14 07:16:19 +00:00
|
|
|
call StatusScreen_PrintPP ; Fill the rest with --
|
2016-06-12 07:19:19 +00:00
|
|
|
.InitPP
|
2015-02-08 02:37:40 +00:00
|
|
|
ld hl, wLoadedMonMoves
|
2015-07-18 20:52:03 +00:00
|
|
|
coord de, 14, 10
|
2015-07-15 06:16:06 +00:00
|
|
|
ld b, 0
|
2016-06-12 07:19:19 +00:00
|
|
|
.PrintPP
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, [hli]
|
|
|
|
and a
|
2015-07-03 19:37:53 +00:00
|
|
|
jr z, .PPDone
|
2014-05-22 22:13:20 +00:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld hl, wCurrentMenuItem
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
ld a, b
|
|
|
|
ld [hl], a
|
|
|
|
push hl
|
|
|
|
callab GetMaxPP
|
|
|
|
pop hl
|
|
|
|
pop af
|
|
|
|
ld [hl], a
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
push hl
|
2015-07-15 06:16:06 +00:00
|
|
|
ld bc, wPartyMon1PP - wPartyMon1Moves - 1
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $3f
|
2015-07-15 06:16:06 +00:00
|
|
|
ld [wStatusScreenCurrentPP], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
push hl
|
2015-07-15 06:16:06 +00:00
|
|
|
ld de, wStatusScreenCurrentPP
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 1, 2
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintNumber
|
|
|
|
ld a, "/"
|
|
|
|
ld [hli], a
|
2015-08-07 12:20:37 +00:00
|
|
|
ld de, wMaxPP
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 1, 2
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintNumber
|
|
|
|
pop hl
|
2015-07-14 07:16:19 +00:00
|
|
|
ld de, SCREEN_WIDTH * 2
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, de
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
inc b
|
|
|
|
ld a, b
|
|
|
|
cp $4
|
2015-07-03 19:37:53 +00:00
|
|
|
jr nz, .PrintPP
|
2014-05-22 22:13:20 +00:00
|
|
|
.PPDone
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 3
|
2015-07-19 03:49:52 +00:00
|
|
|
ld de, StatusScreenExpText
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [wLoadedMonLevel]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
2014-06-10 21:06:30 +00:00
|
|
|
cp MAX_LEVEL
|
2015-07-03 19:37:53 +00:00
|
|
|
jr z, .Level100
|
2014-05-22 22:13:20 +00:00
|
|
|
inc a
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
|
2014-05-22 22:13:20 +00:00
|
|
|
.Level100
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 14, 6
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hl], $70 ; 1-tile "to"
|
|
|
|
inc hl
|
|
|
|
inc hl
|
|
|
|
call PrintLevel
|
|
|
|
pop af
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wLoadedMonLevel], a
|
|
|
|
ld de, wLoadedMonExp
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 12, 4
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 3, 7
|
2014-05-22 22:13:20 +00:00
|
|
|
call PrintNumber ; exp
|
2015-07-19 03:49:52 +00:00
|
|
|
call CalcExpToLevelUp
|
2015-02-08 02:37:40 +00:00
|
|
|
ld de, wLoadedMonExp
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 7, 6
|
2015-07-28 01:48:44 +00:00
|
|
|
lb bc, 3, 7
|
2015-07-19 03:49:52 +00:00
|
|
|
call PrintNumber ; exp needed to level up
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 0
|
2015-07-14 07:16:19 +00:00
|
|
|
call StatusScreen_ClearName
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 1
|
2015-07-14 07:16:19 +00:00
|
|
|
call StatusScreen_ClearName
|
2015-08-31 02:38:41 +00:00
|
|
|
ld a, [wMonHIndex]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd11e], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetMonName
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 9, 1
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString
|
|
|
|
ld a, $1
|
2015-07-19 03:49:52 +00:00
|
|
|
ld [H_AUTOBGTRANSFERENABLED], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call Delay3
|
|
|
|
call WaitForTextScrollButtonPress ; wait for button
|
|
|
|
pop af
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wd72c
|
2014-05-22 22:13:20 +00:00
|
|
|
res 1, [hl]
|
|
|
|
ld a, $77
|
2015-08-09 05:32:44 +00:00
|
|
|
ld [rNR50], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GBPalWhiteOut
|
|
|
|
jp ClearScreen
|
2015-07-19 03:49:52 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
CalcExpToLevelUp:
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [wLoadedMonLevel]
|
2014-06-10 21:06:30 +00:00
|
|
|
cp MAX_LEVEL
|
2015-07-19 03:49:52 +00:00
|
|
|
jr z, .atMaxLevel
|
2014-05-22 22:13:20 +00:00
|
|
|
inc a
|
|
|
|
ld d, a
|
|
|
|
callab CalcExperience
|
2015-02-08 02:37:40 +00:00
|
|
|
ld hl, wLoadedMonExp + 2
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [hExperience + 2]
|
2014-05-22 22:13:20 +00:00
|
|
|
sub [hl]
|
|
|
|
ld [hld], a
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [hExperience + 1]
|
2014-05-22 22:13:20 +00:00
|
|
|
sbc [hl]
|
|
|
|
ld [hld], a
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [hExperience]
|
2014-05-22 22:13:20 +00:00
|
|
|
sbc [hl]
|
|
|
|
ld [hld], a
|
|
|
|
ret
|
2015-07-19 03:49:52 +00:00
|
|
|
.atMaxLevel
|
2015-02-08 02:37:40 +00:00
|
|
|
ld hl, wLoadedMonExp
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
StatusScreenExpText:
|
2015-07-19 03:49:52 +00:00
|
|
|
db "EXP POINTS"
|
|
|
|
next "LEVEL UP@"
|
2014-05-22 22:13:20 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
StatusScreen_ClearName:
|
2015-07-14 07:16:19 +00:00
|
|
|
ld bc, 10
|
|
|
|
ld a, " "
|
2014-05-22 22:13:20 +00:00
|
|
|
jp FillMemory
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
StatusScreen_PrintPP:
|
2015-07-14 07:16:19 +00:00
|
|
|
; print PP or -- c times, going down two rows each time
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hli], a
|
|
|
|
ld [hld], a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
2015-07-14 07:16:19 +00:00
|
|
|
jr nz, StatusScreen_PrintPP
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|