tmhm.asm 448 B

123456789101112131415161718192021222324252627
  1. ; checks if the mon in [wWhichPokemon] already knows the move in [wMoveNum]
  2. CheckIfMoveIsKnown:
  3. ld a, [wWhichPokemon]
  4. ld hl, wPartyMon1Moves
  5. ld bc, wPartyMon2 - wPartyMon1
  6. call AddNTimes
  7. ld a, [wMoveNum]
  8. ld b, a
  9. ld c, NUM_MOVES
  10. .loop
  11. ld a, [hli]
  12. cp b
  13. jr z, .alreadyKnown ; found a match
  14. dec c
  15. jr nz, .loop
  16. and a
  17. ret
  18. .alreadyKnown
  19. ld hl, AlreadyKnowsText
  20. call PrintText
  21. scf
  22. ret
  23. AlreadyKnowsText:
  24. TX_FAR _AlreadyKnowsText
  25. db "@"