summaryrefslogtreecommitdiff
path: root/engine/battle/move_effects/conversion.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-07-03 09:38:52 -0400
committerGitHub <noreply@github.com>2020-07-03 09:38:52 -0400
commitc85050497c1bd062e9cd40bf5b32fa3beca366cc (patch)
tree9593ddd3ab820223ab580d5fc0ae133b485b8315 /engine/battle/move_effects/conversion.asm
parent5559d51c863b6fb529ea0494d857950a36fe85b7 (diff)
parent87ef75c173b5d5f227912860487600b6f53d1d1f (diff)
Merge pull request #256 from Rangi42/master
Add subdirectories to engine/ similar to pokecrystal
Diffstat (limited to 'engine/battle/move_effects/conversion.asm')
-rw-r--r--engine/battle/move_effects/conversion.asm35
1 files changed, 35 insertions, 0 deletions
diff --git a/engine/battle/move_effects/conversion.asm b/engine/battle/move_effects/conversion.asm
new file mode 100644
index 00000000..f23c3d70
--- /dev/null
+++ b/engine/battle/move_effects/conversion.asm
@@ -0,0 +1,35 @@
+ConversionEffect_:
+ 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:
+ TX_FAR _ConvertedTypeText
+ db "@"
+
+PrintButItFailedText:
+ ld hl, PrintButItFailedText_
+CallBankF:
+ ld b, BANK(PrintButItFailedText_)
+ jp Bankswitch