summaryrefslogtreecommitdiff
path: root/engine/battle/print_type.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2015-04-01 12:56:42 -0400
committeryenatch <yenatch@gmail.com>2015-04-01 12:56:42 -0400
commitc2efe700ac1c5cca88bac710b98388a99665741e (patch)
treeb30d2f676d5ad0d78b959c8ffcf0f8dcfca13943 /engine/battle/print_type.asm
parent52add272c6bca00d2ea827ef7fa4611a4bc41b47 (diff)
parentce9940a2eb89caa9f53507a6d6071f8eaf85ee48 (diff)
Merge pull request #90 from xCrystal/master
Rename/split battle and move effect files. Battle functions, AI, and attack animations
Diffstat (limited to 'engine/battle/print_type.asm')
-rw-r--r--engine/battle/print_type.asm52
1 files changed, 52 insertions, 0 deletions
diff --git a/engine/battle/print_type.asm b/engine/battle/print_type.asm
new file mode 100644
index 00000000..38c701a8
--- /dev/null
+++ b/engine/battle/print_type.asm
@@ -0,0 +1,52 @@
+; [wd0b5] = pokemon ID
+; hl = dest addr
+PrintMonType: ; 27d6b (9:7d6b)
+ call GetPredefRegisters
+ push hl
+ call GetMonHeader
+ pop hl
+ push hl
+ ld a, [W_MONHTYPE1]
+ call PrintType
+ ld a, [W_MONHTYPE1]
+ ld b, a
+ ld a, [W_MONHTYPE2]
+ cp b
+ pop hl
+ jr z, EraseType2Text
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+
+; a = type
+; hl = dest addr
+PrintType: ; 27d89 (9:7d89)
+ push hl
+ jr PrintType_
+
+; erase "TYPE2/" if the mon only has 1 type
+EraseType2Text: ; 27d8c (9:7d8c)
+ ld a, " "
+ ld bc, $13
+ add hl, bc
+ ld bc, $6
+ jp FillMemory
+
+PrintMoveType: ; 27d98 (9:7d98)
+ call GetPredefRegisters
+ push hl
+ ld a, [W_PLAYERMOVETYPE]
+; fall through
+
+PrintType_: ; 27d9f (9:7d9f)
+ add a
+ ld hl, TypeNames
+ ld e, a
+ ld d, $0
+ add hl, de
+ ld a, [hli]
+ ld e, a
+ ld d, [hl]
+ pop hl
+ jp PlaceString
+
+INCLUDE "text/type_names.asm"