pokered/engine/battle/moveEffects/leech_seed_effect.asm

41 lines
706 B
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
LeechSeedEffect_:
2014-05-22 22:13:20 +00:00
callab MoveHitTest
2015-08-31 02:38:41 +00:00
ld a, [wMoveMissed]
2014-05-22 22:13:20 +00:00
and a
jr nz, .moveMissed
2015-08-31 02:38:41 +00:00
ld hl, wEnemyBattleStatus2
2015-06-11 22:41:33 +00:00
ld de, wEnemyMonType1
ld a, [H_WHOSETURN]
2014-05-22 22:13:20 +00:00
and a
jr z, .leechSeedEffect
2015-08-31 02:38:41 +00:00
ld hl, wPlayerBattleStatus2
2015-06-11 22:41:33 +00:00
ld de, wBattleMonType1
.leechSeedEffect
; miss if the target is grass-type or already seeded
2014-05-22 22:13:20 +00:00
ld a, [de]
cp GRASS
2015-06-11 22:41:33 +00:00
jr z, .moveMissed
2014-05-22 22:13:20 +00:00
inc de
ld a, [de]
cp GRASS
jr z, .moveMissed
bit Seeded, [hl]
jr nz, .moveMissed
set Seeded, [hl]
2015-02-08 00:24:16 +00:00
callab PlayCurrentMoveAnimation
ld hl, WasSeededText
2014-05-22 22:13:20 +00:00
jp PrintText
.moveMissed
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
ld hl, EvadedAttackText
2014-05-22 22:13:20 +00:00
jp PrintText
2016-06-12 00:24:04 +00:00
WasSeededText:
2014-05-22 22:13:20 +00:00
TX_FAR _WasSeededText
db "@"
2016-06-12 00:24:04 +00:00
EvadedAttackText:
2014-05-22 22:13:20 +00:00
TX_FAR _EvadedAttackText
db "@"