pokecrystal/engine/pokemon/types.asm

93 lines
1.3 KiB
NASM
Raw Normal View History

2018-06-24 14:09:41 +00:00
PrintMonTypes:
2018-01-23 22:39:09 +00:00
; Print one or both types of [wCurSpecies]
; on the stats screen at hl.
push hl
call GetBaseData
pop hl
push hl
2018-01-23 22:39:09 +00:00
ld a, [wBaseType1]
call .Print
; Single-typed monsters really
; have two of the same type.
2018-01-23 22:39:09 +00:00
ld a, [wBaseType1]
ld b, a
2018-01-23 22:39:09 +00:00
ld a, [wBaseType2]
cp b
pop hl
jr z, .hide_type_2
ld bc, SCREEN_WIDTH
add hl, bc
.Print:
ld b, a
jr PrintType
.hide_type_2
; Erase any type name that was here before.
; Seems to be pointless in localized versions.
ld a, " "
ld bc, SCREEN_WIDTH - 3
add hl, bc
ld [hl], a
inc bc
add hl, bc
2018-01-16 23:07:06 +00:00
ld bc, NAME_LENGTH_JAPANESE - 1
jp ByteFill
2018-06-24 14:09:41 +00:00
PrintMoveType:
; Print the type of move b at hl.
push hl
ld a, b
dec a
ld bc, MOVE_LENGTH
ld hl, Moves
call AddNTimes
2018-01-23 22:39:09 +00:00
ld de, wStringBuffer1
ld a, BANK(Moves)
call FarCopyBytes
2018-01-23 22:39:09 +00:00
ld a, [wStringBuffer1 + MOVE_TYPE]
pop hl
ld b, a
2018-06-24 14:09:41 +00:00
PrintType:
; Print type b at hl.
ld a, b
push hl
add a
ld hl, TypeNames
ld e, a
ld d, 0
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
pop hl
jp PlaceString
2018-06-24 14:09:41 +00:00
GetTypeName:
2018-01-23 22:39:09 +00:00
; Copy the name of type [wd265] to wStringBuffer1.
ld a, [wd265]
ld hl, TypeNames
ld e, a
ld d, 0
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
2018-01-23 22:39:09 +00:00
ld de, wStringBuffer1
2018-01-16 23:07:06 +00:00
ld bc, MOVE_NAME_LENGTH
jp CopyBytes
2018-01-11 06:45:27 +00:00
INCLUDE "data/types/names.asm"