leech_seed_effect.asm 706 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. LeechSeedEffect_:
  2. callab MoveHitTest
  3. ld a, [wMoveMissed]
  4. and a
  5. jr nz, .moveMissed
  6. ld hl, wEnemyBattleStatus2
  7. ld de, wEnemyMonType1
  8. ld a, [H_WHOSETURN]
  9. and a
  10. jr z, .leechSeedEffect
  11. ld hl, wPlayerBattleStatus2
  12. ld de, wBattleMonType1
  13. .leechSeedEffect
  14. ; miss if the target is grass-type or already seeded
  15. ld a, [de]
  16. cp GRASS
  17. jr z, .moveMissed
  18. inc de
  19. ld a, [de]
  20. cp GRASS
  21. jr z, .moveMissed
  22. bit SEEDED, [hl]
  23. jr nz, .moveMissed
  24. set SEEDED, [hl]
  25. callab PlayCurrentMoveAnimation
  26. ld hl, WasSeededText
  27. jp PrintText
  28. .moveMissed
  29. ld c, 50
  30. call DelayFrames
  31. ld hl, EvadedAttackText
  32. jp PrintText
  33. WasSeededText:
  34. TX_FAR _WasSeededText
  35. db "@"
  36. EvadedAttackText:
  37. TX_FAR _EvadedAttackText
  38. db "@"