pokered/engine/battle/move_effects/paralyze.asm

48 lines
836 B
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
ParalyzeEffect_:
2015-02-08 00:24:16 +00:00
ld hl, wEnemyMonStatus
2015-08-31 02:38:41 +00:00
ld de, wPlayerMoveType
ldh a, [hWhoseTurn]
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
callfar MoveHitTest
2014-05-22 22:13:20 +00:00
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]
callfar QuarterSpeedDueToParalysis
2015-02-08 00:24:16 +00:00
ld c, 30
2014-05-22 22:13:20 +00:00
call DelayFrames
callfar PlayCurrentMoveAnimation
jpfar PrintMayNotAttackText
2015-02-08 00:24:16 +00:00
.didntAffect
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
jpfar PrintDidntAffectText
2015-02-08 00:24:16 +00:00
.doesntAffect
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
jpfar PrintDoesntAffectText