2018-06-24 07:09:41 -07:00
|
|
|
GetTrainerClassName:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wRivalName
|
2017-12-11 20:44:29 -08:00
|
|
|
ld a, c
|
|
|
|
cp RIVAL1
|
|
|
|
jr z, .rival
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurSpecies], a
|
2017-12-11 20:44:29 -08:00
|
|
|
ld a, TRAINER_NAME
|
|
|
|
ld [wNamedObjectTypeBuffer], a
|
|
|
|
call GetName
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer1
|
2017-12-11 20:44:29 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.rival
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer1
|
2017-12-11 20:44:29 -08:00
|
|
|
push de
|
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetOTName:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPlayerName
|
2017-12-11 20:44:29 -08:00
|
|
|
ld a, [wLinkMode]
|
|
|
|
and a
|
|
|
|
jr nz, .ok
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wRivalName
|
2017-12-11 20:44:29 -08:00
|
|
|
ld a, c
|
|
|
|
cp RIVAL1
|
|
|
|
jr z, .ok
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurSpecies], a
|
2017-12-11 20:44:29 -08:00
|
|
|
ld a, TRAINER_NAME
|
|
|
|
ld [wNamedObjectTypeBuffer], a
|
|
|
|
call GetName
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer1
|
2017-12-11 20:44:29 -08:00
|
|
|
|
|
|
|
.ok
|
|
|
|
ld bc, TRAINER_CLASS_NAME_LENGTH
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTClassName
|
2017-12-11 20:44:29 -08:00
|
|
|
push de
|
|
|
|
call CopyBytes
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetTrainerAttributes:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTrainerClass]
|
2017-12-11 20:44:29 -08:00
|
|
|
ld c, a
|
|
|
|
call GetOTName
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTrainerClass]
|
2017-12-11 20:44:29 -08:00
|
|
|
dec a
|
|
|
|
ld hl, TrainerClassAttributes + TRNATTR_ITEM1
|
|
|
|
ld bc, NUM_TRAINER_ATTRIBUTES
|
|
|
|
call AddNTimes
|
|
|
|
ld de, wEnemyTrainerItem1
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
ld a, [hl]
|
|
|
|
ld [wEnemyTrainerBaseReward], a
|
|
|
|
ret
|