pokered/engine/battle/moveEffects/conversion_effect.asm

36 lines
671 B
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
ConversionEffect_:
ld hl, wEnemyMonType1
ld de, wBattleMonType1
ld a, [H_WHOSETURN]
and a
2015-08-31 02:38:41 +00:00
ld a, [wEnemyBattleStatus1]
jr z, .conversionEffect
push hl
ld h, d
ld l, e
pop de
2015-08-31 02:38:41 +00:00
ld a, [wPlayerBattleStatus1]
.conversionEffect
2017-12-29 23:59:48 +00:00
bit INVULNERABLE, a ; is mon immune to typical attacks (dig/fly)
jr nz, PrintButItFailedText
2015-06-11 22:41:33 +00:00
; copy target's types to user
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
ld hl, PlayCurrentMoveAnimation
call CallBankF
ld hl, ConvertedTypeText
jp PrintText
2016-06-12 00:24:04 +00:00
ConvertedTypeText:
TX_FAR _ConvertedTypeText
db "@"
2016-06-12 00:24:04 +00:00
PrintButItFailedText:
ld hl, PrintButItFailedText_
2016-06-12 00:24:04 +00:00
CallBankF:
ld b, BANK(PrintButItFailedText_)
jp Bankswitch