summaryrefslogtreecommitdiff
path: root/engine/battle/moveEffects/conversion_effect.asm
blob: 5965f2a8792ce277b52eb251eb7f9b2df66c2724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ConversionEffect_: ; 1396d (4:796d)
	ld hl, wEnemyMonType1
	ld de, wBattleMonType1
	ld a, [H_WHOSETURN]
	and a
	ld a, [wEnemyBattleStatus1]
	jr z, .conversionEffect
	push hl
	ld h, d
	ld l, e
	pop de
	ld a, [wPlayerBattleStatus1]
.conversionEffect
	bit Invulnerable, a ; is mon immune to typical attacks (dig/fly)
	jr nz, PrintButItFailedText
; 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

ConvertedTypeText: ; 13997 (4:7997)
	TX_FAR _ConvertedTypeText
	db "@"

PrintButItFailedText: ; 1399c (4:799c)
	ld hl, PrintButItFailedText_
CallBankF: ; 1399f (4:799f)
	ld b, BANK(PrintButItFailedText_)
	jp Bankswitch