conversion_effect.asm 671 B

123456789101112131415161718192021222324252627282930313233343536
  1. ConversionEffect_:
  2. ld hl, wEnemyMonType1
  3. ld de, wBattleMonType1
  4. ld a, [H_WHOSETURN]
  5. and a
  6. ld a, [wEnemyBattleStatus1]
  7. jr z, .conversionEffect
  8. push hl
  9. ld h, d
  10. ld l, e
  11. pop de
  12. ld a, [wPlayerBattleStatus1]
  13. .conversionEffect
  14. bit INVULNERABLE, a ; is mon immune to typical attacks (dig/fly)
  15. jr nz, PrintButItFailedText
  16. ; copy target's types to user
  17. ld a, [hli]
  18. ld [de], a
  19. inc de
  20. ld a, [hl]
  21. ld [de], a
  22. ld hl, PlayCurrentMoveAnimation
  23. call CallBankF
  24. ld hl, ConvertedTypeText
  25. jp PrintText
  26. ConvertedTypeText:
  27. TX_FAR _ConvertedTypeText
  28. db "@"
  29. PrintButItFailedText:
  30. ld hl, PrintButItFailedText_
  31. CallBankF:
  32. ld b, BANK(PrintButItFailedText_)
  33. jp Bankswitch