get_trainer_name.asm 397 B

12345678910111213141516171819202122232425
  1. GetTrainerName_:
  2. ld hl, wGrassRate
  3. ld a, [wLinkState]
  4. and a
  5. jr nz, .foundName
  6. ld hl, wRivalName
  7. ld a, [wTrainerClass]
  8. cp SONY1
  9. jr z, .foundName
  10. cp SONY2
  11. jr z, .foundName
  12. cp SONY3
  13. jr z, .foundName
  14. ld [wd0b5], a
  15. ld a, TRAINER_NAME
  16. ld [wNameListType], a
  17. ld a, BANK(TrainerNames)
  18. ld [wPredefBank], a
  19. call GetName
  20. ld hl, wcd6d
  21. .foundName
  22. ld de, wTrainerName
  23. ld bc, $d
  24. jp CopyData