summaryrefslogtreecommitdiff
path: root/engine/types.asm
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 17:47:05 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 17:47:05 -0500
commitb5417fafec7dd37cb4be391f3bd3d4541a2a381e (patch)
treea4e7d08afb2e862186a138e82c8ef4785d82786d /engine/types.asm
parent2f98c2032fd47ada3484bfc37d590992f286d3d4 (diff)
Split battle/ into data/ and engine/ components
Diffstat (limited to 'engine/types.asm')
-rw-r--r--engine/types.asm101
1 files changed, 101 insertions, 0 deletions
diff --git a/engine/types.asm b/engine/types.asm
new file mode 100644
index 000000000..375bfe434
--- /dev/null
+++ b/engine/types.asm
@@ -0,0 +1,101 @@
+PrintMonTypes: ; 5090d
+; Print one or both types of [CurSpecies]
+; on the stats screen at hl.
+
+ push hl
+ call GetBaseData
+ pop hl
+
+ push hl
+ ld a, [BaseType1]
+ call .Print
+
+ ; Single-typed monsters really
+ ; have two of the same type.
+ ld a, [BaseType1]
+ ld b, a
+ ld a, [BaseType2]
+ cp b
+ pop hl
+ jr z, .hide_type_2
+
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+
+.Print:
+ ld b, a
+ jr PrintType
+
+.hide_type_2
+ ; Erase any type name that was here before.
+ ; Seems to be pointless in localized versions.
+ ld a, " "
+ ld bc, SCREEN_WIDTH - 3
+ add hl, bc
+ ld [hl], a
+ inc bc
+ add hl, bc
+ ld bc, 5
+ jp ByteFill
+; 5093a
+
+
+PrintMoveType: ; 5093a
+; Print the type of move b at hl.
+
+ push hl
+ ld a, b
+ dec a
+ ld bc, MOVE_LENGTH
+ ld hl, Moves
+ call AddNTimes
+ ld de, StringBuffer1
+ ld a, BANK(Moves)
+ call FarCopyBytes
+ ld a, [StringBuffer1 + MOVE_TYPE]
+ pop hl
+
+ ld b, a
+
+
+PrintType: ; 50953
+; Print type b at hl.
+
+ ld a, b
+
+ push hl
+ 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
+; 50964
+
+
+GetTypeName: ; 50964
+; Copy the name of type [wd265] to StringBuffer1.
+
+ ld a, [wd265]
+ ld hl, TypeNames
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, StringBuffer1
+ ld bc, 13
+ jp CopyBytes
+; 5097b
+
+
+INCLUDE "data/type_names.asm"
+
+; 50a28