pokered/engine/battle/moveEffects/paralyze_effect.asm

48 lines
848 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
2015-08-31 02:38:41 +00:00
ld de, wPlayerMoveType
2015-02-08 00:24:16 +00:00
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-08-31 02:38:41 +00:00
ld de, wEnemyMoveType
2015-02-08 00:24:16 +00:00
.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-08-31 02:38:41 +00:00
ld a, [wMoveMissed]
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
2015-07-19 18:56:13 +00:00
jpab PrintMayNotAttackText
2015-02-08 00:24:16 +00:00
.didntAffect
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
2015-07-19 18:56:13 +00:00
jpab PrintDidntAffectText
2015-02-08 00:24:16 +00:00
.doesntAffect
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
2015-07-19 18:56:13 +00:00
jpab PrintDoesntAffectText