paralyze_effect.asm 830 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ParalyzeEffect_:
  2. ld hl, wEnemyMonStatus
  3. ld de, wPlayerMoveType
  4. ld a, [H_WHOSETURN]
  5. and a
  6. jp z, .next
  7. ld hl, wBattleMonStatus
  8. ld de, wEnemyMoveType
  9. .next
  10. ld a, [hl]
  11. and a ; does the target already have a status ailment?
  12. jr nz, .didntAffect
  13. ; check if the target is immune due to types
  14. ld a, [de]
  15. cp ELECTRIC
  16. jr nz, .hitTest
  17. ld b, h
  18. ld c, l
  19. inc bc
  20. ld a, [bc]
  21. cp GROUND
  22. jr z, .doesntAffect
  23. inc bc
  24. ld a, [bc]
  25. cp GROUND
  26. jr z, .doesntAffect
  27. .hitTest
  28. push hl
  29. callab MoveHitTest
  30. pop hl
  31. ld a, [wMoveMissed]
  32. and a
  33. jr nz, .didntAffect
  34. set PAR, [hl]
  35. callab QuarterSpeedDueToParalysis
  36. ld c, 30
  37. call DelayFrames
  38. callab PlayCurrentMoveAnimation
  39. jpab PrintMayNotAttackText
  40. .didntAffect
  41. ld c, 50
  42. call DelayFrames
  43. jpab PrintDidntAffectText
  44. .doesntAffect
  45. ld c, 50
  46. call DelayFrames
  47. jpab PrintDoesntAffectText