Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/battle/move_effects/conversion.asm
1271 views
1
ConversionEffect_:
2
ld hl, wEnemyMonType1
3
ld de, wBattleMonType1
4
ldh a, [hWhoseTurn]
5
and a
6
ld a, [wEnemyBattleStatus1]
7
jr z, .conversionEffect
8
push hl
9
ld h, d
10
ld l, e
11
pop de
12
ld a, [wPlayerBattleStatus1]
13
.conversionEffect
14
bit INVULNERABLE, a ; is mon immune to typical attacks (dig/fly)
15
jr nz, PrintButItFailedText
16
; copy target's types to user
17
ld a, [hli]
18
ld [de], a
19
inc de
20
ld a, [hl]
21
ld [de], a
22
ld hl, PlayCurrentMoveAnimation
23
call CallBankF
24
ld hl, ConvertedTypeText
25
jp PrintText
26
27
ConvertedTypeText:
28
text_far _ConvertedTypeText
29
text_end
30
31
PrintButItFailedText:
32
ld hl, PrintButItFailedText_
33
CallBankF:
34
ld b, BANK(PrintButItFailedText_)
35
jp Bankswitch
36
37