pokered/engine/battle/moveEffects/paralyze_effect.asm

54 lines
1,006 B
NASM
Raw Normal View History

2014-05-22 22:13:20 +00:00
ParalyzeEffect_: ; 52601 (14:6601)
2015-02-08 00:24:16 +00:00
ld hl, wEnemyMonStatus
ld de, W_PLAYERMOVETYPE
ld a, [H_WHOSETURN]
2014-05-22 22:13:20 +00:00
and a
2015-02-08 00:24:16 +00:00
jp z, .next
2015-06-11 22:41:33 +00:00
ld hl, wBattleMonStatus
2015-02-08 00:24:16 +00:00
ld de, W_ENEMYMOVETYPE
.next
2014-05-22 22:13:20 +00:00
ld a, [hl]
2015-02-08 00:24:16 +00:00
and a ; does the target already have a status ailment?
jr nz, .didntAffect
; check if the target is immune due to types
2014-05-22 22:13:20 +00:00
ld a, [de]
2015-02-08 00:24:16 +00:00
cp ELECTRIC
jr nz, .hitTest
2014-05-22 22:13:20 +00:00
ld b, h
ld c, l
inc bc
ld a, [bc]
2015-02-08 00:24:16 +00:00
cp GROUND
jr z, .doesntAffect
2014-05-22 22:13:20 +00:00
inc bc
ld a, [bc]
2015-02-08 00:24:16 +00:00
cp GROUND
jr z, .doesntAffect
.hitTest
2014-05-22 22:13:20 +00:00
push hl
callab MoveHitTest
pop hl
2015-06-11 22:41:33 +00:00
ld a, [W_MOVEMISSED]
2014-05-22 22:13:20 +00:00
and a
2015-02-08 00:24:16 +00:00
jr nz, .didntAffect
set PAR, [hl]
2014-08-09 05:39:13 +00:00
callab QuarterSpeedDueToParalysis
2015-02-08 00:24:16 +00:00
ld c, 30
2014-05-22 22:13:20 +00:00
call DelayFrames
2015-02-08 00:24:16 +00:00
callab PlayCurrentMoveAnimation
2014-05-22 22:13:20 +00:00
ld hl, PrintMayNotAttackText
ld b, BANK(PrintMayNotAttackText)
jp Bankswitch
2015-02-08 00:24:16 +00:00
.didntAffect
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
ld hl, PrintDidntAffectText
ld b, BANK(PrintDidntAffectText)
jp Bankswitch
2015-02-08 00:24:16 +00:00
.doesntAffect
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
ld hl, PrintDoesntAffectText
ld b, BANK(PrintDoesntAffectText)
jp Bankswitch