summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/code_8040094.s2
-rw-r--r--asm/code_8045A00.s4
-rw-r--r--asm/code_80521D0.s24
-rw-r--r--asm/code_8057144.s2
-rw-r--r--asm/code_8057824.s36
-rw-r--r--asm/code_80701A4.s2
-rw-r--r--asm/code_8073CF0.s2
-rw-r--r--asm/code_8075BA4.s1931
-rw-r--r--asm/code_807C04C.s1297
-rw-r--r--data/data_80F4468.s1165
-rw-r--r--data/data_80F4DB4.s272
-rw-r--r--data/data_80F4E2C.s881
-rw-r--r--include/constants/move.h2
-rw-r--r--include/dungeon_ai.h2
-rw-r--r--include/dungeon_ai_attack.h4
-rw-r--r--include/dungeon_ai_attack_1.h9
-rw-r--r--include/dungeon_capabilities_1.h2
-rw-r--r--include/dungeon_pokemon_attributes_1.h2
-rw-r--r--include/moves.h5
-rw-r--r--include/status_checks.h2
-rwxr-xr-xld_script.txt6
-rw-r--r--src/dungeon_ai.c16
-rw-r--r--src/dungeon_ai_attack.c332
-rw-r--r--src/dungeon_ai_attack_1.c76
-rw-r--r--src/dungeon_ai_item_weight.c4
-rw-r--r--src/dungeon_ai_items.c2
-rw-r--r--src/dungeon_ai_movement.c2
-rw-r--r--src/dungeon_pokemon_attributes.c6
-rw-r--r--src/dungeon_pokemon_attributes_1.c4
-rw-r--r--src/items.c1
-rw-r--r--src/moves.c14
-rw-r--r--src/moves_1.c8
-rw-r--r--src/status_checks.c4
33 files changed, 2914 insertions, 3207 deletions
diff --git a/asm/code_8040094.s b/asm/code_8040094.s
index 5ea38ec..b057290 100644
--- a/asm/code_8040094.s
+++ b/asm/code_8040094.s
@@ -2501,7 +2501,7 @@ _080414A0:
_080414A4:
adds r0, r4, 0
adds r1, r5, 0
- bl sub_80570AC
+ bl IsChargeMove
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s
index 2792ef7..944744e 100644
--- a/asm/code_8045A00.s
+++ b/asm/code_8045A00.s
@@ -4,7 +4,7 @@
.syntax unified
.text
-
+
thumb_func_start CanSee_2
CanSee_2:
push {r4,r5,lr}
@@ -566,7 +566,7 @@ _08045DF4:
_08045E08:
adds r0, r7, 0
movs r1, 0x1
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
beq _08045E40
diff --git a/asm/code_80521D0.s b/asm/code_80521D0.s
index 648cdec..ad3024b 100644
--- a/asm/code_80521D0.s
+++ b/asm/code_80521D0.s
@@ -2505,7 +2505,7 @@ _080537B0: .4byte gUnknown_80FCD28
_080537B4:
adds r0, r7, 0
mov r1, r8
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
lsls r0, 24
lsrs r0, 24
cmp r0, 0x5
@@ -2831,7 +2831,7 @@ _08053A4C:
movs r4, 0
adds r0, r7, 0
mov r1, r8
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
bne _08053A7E
@@ -5857,7 +5857,7 @@ sub_8055640:
mov r9, r3
ldr r7, [sp, 0x44]
adds r1, r5, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@@ -6114,7 +6114,7 @@ sub_8055864:
adds r5, r2, 0
adds r6, r3, 0
adds r1, r5, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -6521,7 +6521,7 @@ _08055B74:
adds r0, r5, 0
adds r1, r6, 0
str r2, [sp, 0x30]
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
lsrs r4, r0, 24
ldrb r0, [r6, 0x4]
@@ -7148,7 +7148,7 @@ _080560AE:
beq _080560CC
adds r0, r5, 0
adds r1, r7, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
bne _080560CC
@@ -7165,7 +7165,7 @@ _080560CC:
bl sub_80928C0
adds r0, r5, 0
adds r1, r7, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _08056124
@@ -8038,7 +8038,7 @@ _080567EC:
beq _08056820
mov r0, r10
ldr r1, [sp, 0x1C]
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
bne _08056820
@@ -8740,7 +8740,7 @@ _08056D44:
bne _08056D86
adds r0, r5, 0
mov r1, r8
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
lsrs r4, r0, 24
mov r2, r8
@@ -9186,8 +9186,8 @@ _080570A6:
bx r1
thumb_func_end sub_8057088
- thumb_func_start sub_80570AC
-sub_80570AC:
+ thumb_func_start IsChargeMove
+IsChargeMove:
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
@@ -9229,6 +9229,6 @@ _080570EA:
bx r1
.align 2, 0
_080570F0: .4byte gChargeMovesToStatuses
- thumb_func_end sub_80570AC
+ thumb_func_end IsChargeMove
.align 2, 0
diff --git a/asm/code_8057144.s b/asm/code_8057144.s
index 795e7cf..fba13cd 100644
--- a/asm/code_8057144.s
+++ b/asm/code_8057144.s
@@ -932,7 +932,7 @@ _080577C8: .4byte gUnknown_80FD14C
_080577CC:
adds r0, r4, 0
adds r1, r6, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _080577F8
diff --git a/asm/code_8057824.s b/asm/code_8057824.s
index 2856506..6ae62c4 100644
--- a/asm/code_8057824.s
+++ b/asm/code_8057824.s
@@ -1209,7 +1209,7 @@ sub_80582EC:
adds r4, r2, 0
adds r6, r3, 0
adds r1, r4, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _08058328
@@ -1684,7 +1684,7 @@ sub_805867C:
adds r4, r2, 0
adds r6, r3, 0
adds r1, r4, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _080586B8
@@ -2255,7 +2255,7 @@ SkyAttackMoveAction:
mov r8, r0
adds r0, r4, 0
adds r1, r5, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _08058B14
@@ -3847,7 +3847,7 @@ sub_805968C:
beq _080596B6
adds r0, r5, 0
adds r1, r6, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _080596EC
@@ -3972,7 +3972,7 @@ sub_8059790:
adds r4, r2, 0
adds r6, r3, 0
adds r1, r4, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _080597CC
@@ -4077,7 +4077,7 @@ _0805986C: .4byte gUnknown_80FD128
_08059870:
adds r0, r4, 0
adds r1, r5, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _080598A4
@@ -4548,7 +4548,7 @@ _08059BE2:
beq _08059C08
adds r0, r5, 0
adds r1, r4, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
lsls r0, 24
cmp r0, 0
beq _08059C08
@@ -4573,7 +4573,7 @@ _08059C08:
adds r4, r1, r0
ldr r1, [r4]
adds r0, r5, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
adds r1, r7, 0
adds r1, 0x5C
movs r2, 0
@@ -4912,7 +4912,7 @@ _08059E8A:
bne _08059F1A
adds r0, r6, 0
adds r1, r7, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@@ -5002,7 +5002,7 @@ sub_8059F38:
mov r8, r0
adds r0, r4, 0
adds r1, r5, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _08059FA0
@@ -5094,7 +5094,7 @@ _08059FFE:
bne _0805A090
adds r0, r6, 0
adds r1, r7, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@@ -8374,7 +8374,7 @@ SkullBashMoveAction:
adds r4, r2, 0
adds r6, r3, 0
adds r1, r4, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _0805B8EC
@@ -12001,7 +12001,7 @@ _0805D928:
strb r5, [r1, 0x1]
bl GetLeaderEntity
movs r1, 0x1
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
bne _0805D976
@@ -12327,7 +12327,7 @@ _0805DBF4: .4byte 0x00000673
_0805DBF8:
mov r0, r10
movs r1, 0x1
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
beq _0805DC08
@@ -16024,7 +16024,7 @@ _0805F9A0:
bl sub_80073B8
bl GetLeaderEntity
movs r1, 0x1
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
beq _0805F9CC
@@ -30935,7 +30935,7 @@ _0806721C: .4byte gUnknown_80F8BE0
_08067220:
adds r0, r6, 0
movs r1, 0x1
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
beq _08067248
@@ -36863,7 +36863,7 @@ _0806A068:
beq _0806A0FA
mov r0, r8
mov r1, r9
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
lsls r0, 24
lsrs r5, r0, 24
mov r1, r9
@@ -36954,7 +36954,7 @@ sub_806A120:
bne _0806A19C
adds r0, r7, 0
adds r1, r4, 0
- bl GetMoveType_2
+ bl GetMoveTypeForPokemon
lsls r0, 24
lsrs r0, 24
bl sub_8092364
diff --git a/asm/code_80701A4.s b/asm/code_80701A4.s
index 04b317b..ac383ab 100644
--- a/asm/code_80701A4.s
+++ b/asm/code_80701A4.s
@@ -153,7 +153,7 @@ _080702B0:
beq _08070312
adds r0, r7, 0
adds r1, r4, 0
- bl sub_80570AC
+ bl IsChargeMove
lsls r0, 24
cmp r0, 0
beq _08070312
diff --git a/asm/code_8073CF0.s b/asm/code_8073CF0.s
index 7cadcc3..36da354 100644
--- a/asm/code_8073CF0.s
+++ b/asm/code_8073CF0.s
@@ -105,7 +105,7 @@ _08073D80:
_08073D98:
adds r0, r6, 0
movs r1, 0x1
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
beq _08073DC8
diff --git a/asm/code_8075BA4.s b/asm/code_8075BA4.s
index 9d92ce6..def36e3 100644
--- a/asm/code_8075BA4.s
+++ b/asm/code_8075BA4.s
@@ -10245,7 +10245,7 @@ _0807AE32:
_0807AE6A:
adds r0, r5, 0
adds r1, r7, 0
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
beq _0807AE80
@@ -11081,7 +11081,7 @@ _0807B4C8:
mov r10, r1
mov r0, r9
adds r1, r7, 0
- bl ShouldAvoidEnemies_2
+ bl ShouldAvoidEnemiesAndShowEffect
lsls r0, 24
cmp r0, 0
bne _0807B4E4
@@ -11972,1931 +11972,4 @@ sub_807BB78:
bx lr
thumb_func_end sub_807BB78
- thumb_func_start DecideAttack
-DecideAttack:
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x5C
- mov r10, r0
- ldr r0, [r0, 0x70]
- mov r8, r0
- mov r0, r10
- movs r1, 0
- bl CannotAttack
- lsls r0, 24
- cmp r0, 0
- beq _0807BBB6
- b _0807C03A
-_0807BBB6:
- mov r0, r10
- movs r1, 0x1
- bl ShouldAvoidEnemies_2
- lsls r0, 24
- cmp r0, 0
- beq _0807BBC6
- b _0807C03A
-_0807BBC6:
- mov r0, r10
- movs r1, 0x8
- bl HasTactic
- lsls r0, 24
- cmp r0, 0
- beq _0807BBD6
- b _0807C03A
-_0807BBD6:
- mov r0, r8
- adds r0, 0xBC
- ldrb r0, [r0]
- cmp r0, 0x2
- bne _0807BBF2
- ldr r0, _0807BC70
- movs r1, 0
- ldrsh r0, [r0, r1]
- bl RollPercentChance
- lsls r0, 24
- cmp r0, 0
- beq _0807BBF2
- b _0807C03A
-_0807BBF2:
- mov r0, r8
- adds r0, 0xC0
- ldrb r1, [r0]
- str r0, [sp, 0x50]
- cmp r1, 0
- beq _0807BC7C
- movs r5, 0
- movs r4, 0x8C
- lsls r4, 1
- add r4, r8
-_0807BC06:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0807BC74
- mov r0, r10
- adds r1, r4, 0
- bl sub_80570AC
- lsls r0, 24
- cmp r0, 0
- beq _0807BC74
- mov r0, r8
- adds r0, 0xC2
- ldrb r0, [r0]
- cmp r0, r5
- bne _0807BC74
- mov r0, r8
- adds r0, 0x44
- movs r1, 0x15
- bl SetAction
- adds r3, r5, 0
- mov r6, r8
- adds r6, 0x48
- cmp r5, 0
- bgt _0807BC3E
- b _0807C006
-_0807BC3E:
- ldrb r1, [r4]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- bne _0807BC4A
- b _0807C006
-_0807BC4A:
- movs r4, 0x2
- lsls r0, r5, 3
- movs r2, 0x8C
- lsls r2, 1
- adds r0, r2
- mov r7, r8
- adds r2, r0, r7
-_0807BC58:
- subs r2, 0x8
- subs r3, 0x1
- cmp r3, 0
- bgt _0807BC62
- b _0807C006
-_0807BC62:
- ldrb r1, [r2]
- adds r0, r4, 0
- ands r0, r1
- cmp r0, 0
- bne _0807BC58
- b _0807C006
- .align 2, 0
-_0807BC70: .4byte gConfusedAttackChance
-_0807BC74:
- adds r4, 0x8
- adds r5, 0x1
- cmp r5, 0x3
- ble _0807BC06
-_0807BC7C:
- movs r0, 0
- str r0, [sp, 0x44]
- movs r1, 0
- str r1, [sp, 0x40]
- movs r2, 0x8C
- lsls r2, 1
- add r2, r8
- movs r4, 0x1
- movs r3, 0x4
- movs r5, 0x3
-_0807BC90:
- ldrb r1, [r2]
- adds r0, r4, 0
- ands r0, r1
- cmp r0, 0
- beq _0807BCB0
- adds r0, r3, 0
- ands r0, r1
- cmp r0, 0
- beq _0807BCA8
- ldr r7, [sp, 0x40]
- adds r7, 0x1
- str r7, [sp, 0x40]
-_0807BCA8:
- ldrb r0, [r2, 0x4]
- ldr r1, [sp, 0x44]
- adds r1, r0
- str r1, [sp, 0x44]
-_0807BCB0:
- adds r2, 0x8
- subs r5, 0x1
- cmp r5, 0
- bge _0807BC90
- ldr r2, [sp, 0x44]
- cmp r2, 0
- bne _0807BCF8
- add r4, sp, 0x2C
- movs r1, 0xB0
- lsls r1, 1
- adds r0, r4, 0
- bl InitPokemonMove
- mov r0, sp
- mov r1, r10
- adds r2, r4, 0
- bl FindMoveTarget
- mov r0, sp
- ldrb r0, [r0]
- cmp r0, 0
- bne _0807BCDE
- b _0807C03A
-_0807BCDE:
- mov r0, r8
- adds r0, 0x44
- movs r1, 0x17
- bl SetAction
- mov r0, sp
- ldrb r1, [r0, 0x1]
- movs r0, 0x7
- ands r0, r1
- mov r1, r8
- adds r1, 0x46
- strb r0, [r1]
- b _0807C008
-_0807BCF8:
- mov r0, r10
- movs r1, 0xB
- bl HasIQSkill
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x48]
- mov r0, r10
- movs r1, 0x6
- bl HasIQSkill
- lsls r0, 24
- lsrs r0, 24
- negs r1, r0
- orrs r1, r0
- lsrs r1, 31
- str r1, [sp, 0x3C]
- movs r7, 0
- str r7, [sp, 0x44]
- mov r0, sp
- adds r0, 0x28
- str r0, [sp, 0x4C]
- adds r2, r0, 0
- movs r1, 0x1
- adds r0, 0x3
-_0807BD2A:
- strb r1, [r0]
- subs r0, 0x1
- cmp r0, r2
- bge _0807BD2A
- ldr r1, [sp, 0x3C]
- cmp r1, 0
- beq _0807BDC0
- movs r2, 0x63
- movs r4, 0
- movs r5, 0
- movs r3, 0x8C
- lsls r3, 1
- add r3, r8
- b _0807BD98
-_0807BD46:
- cmp r5, 0
- beq _0807BD7A
- ldrb r1, [r3]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- bne _0807BD7A
- adds r0, r4, 0x1
- adds r6, r5, 0x1
- cmp r0, r5
- bge _0807BD74
- cmp r2, 0x1
- bgt _0807BD74
- adds r1, r4, 0
- cmp r1, r5
- bge _0807BD74
- ldr r2, [sp, 0x4C]
- movs r4, 0
-_0807BD6A:
- adds r0, r2, r1
- strb r4, [r0]
- adds r1, 0x1
- cmp r1, r5
- blt _0807BD6A
-_0807BD74:
- ldrb r2, [r3, 0x4]
- adds r4, r5, 0
- b _0807BD86
-_0807BD7A:
- ldrb r1, [r3, 0x4]
- cmp r1, r2
- ble _0807BD82
- adds r1, r2, 0
-_0807BD82:
- adds r2, r1, 0
- adds r6, r5, 0x1
-_0807BD86:
- adds r5, r6, 0
- cmp r5, 0x3
- bgt _0807BDA2
- lsls r0, r5, 3
- movs r7, 0x8C
- lsls r7, 1
- adds r0, r7
- mov r1, r8
- adds r3, r1, r0
-_0807BD98:
- ldrb r1, [r3]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- bne _0807BD46
-_0807BDA2:
- adds r0, r4, 0x1
- cmp r0, r5
- bge _0807BDC0
- cmp r2, 0x1
- bgt _0807BDC0
- adds r1, r4, 0
- cmp r1, r5
- bge _0807BDC0
- ldr r2, [sp, 0x4C]
- movs r3, 0
-_0807BDB6:
- adds r0, r2, r1
- strb r3, [r0]
- adds r1, 0x1
- cmp r1, r5
- blt _0807BDB6
-_0807BDC0:
- movs r5, 0
- movs r2, 0
- str r2, [sp, 0x54]
- add r4, sp, 0x4
- movs r7, 0x8C
- lsls r7, 1
- add r7, r8
- adds r6, r7, 0
- mov r9, sp
- mov r0, sp
- str r0, [sp, 0x58]
-_0807BDD6:
- movs r2, 0
- mov r1, r9
- strb r2, [r1]
- ldrb r1, [r7]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0807BE64
- ldr r1, [sp, 0x4C]
- adds r0, r1, r5
- ldrb r0, [r0]
- cmp r0, 0
- beq _0807BE64
- mov r0, r10
- adds r1, r5, 0
- ldr r2, [sp, 0x3C]
- bl IsMoveUsable
- lsls r0, 24
- cmp r0, 0
- beq _0807BE64
- ldrb r1, [r7]
- movs r0, 0x4
- ands r0, r1
- cmp r0, 0
- beq _0807BE64
- movs r0, 0x1
- mov r2, r9
- strb r0, [r2]
- ldr r1, [sp, 0x50]
- ldrb r0, [r1]
- cmp r0, 0xB
- bne _0807BE38
- ldrh r0, [r7, 0x2]
- cmp r0, 0x80
- bne _0807BE24
- movs r2, 0
- str r2, [r4]
- b _0807BE64
-_0807BE24:
- mov r0, r10
- adds r1, r6, 0
- bl GetMoveType_2
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x5
- beq _0807BE4A
- movs r0, 0x1
- b _0807BE54
-_0807BE38:
- ldr r1, [sp, 0x48]
- cmp r1, 0
- beq _0807BE4A
- ldr r0, [sp, 0x58]
- mov r1, r10
- adds r2, r6, 0
- bl FindMoveTarget
- b _0807BE54
-_0807BE4A:
- adds r0, r6, 0
- bl GetMoveWeight
- lsls r0, 24
- lsrs r0, 24
-_0807BE54:
- str r0, [r4]
- add r0, sp, 0x4
- ldr r2, [sp, 0x54]
- adds r0, r2
- ldr r0, [r0]
- ldr r1, [sp, 0x44]
- adds r1, r0
- str r1, [sp, 0x44]
-_0807BE64:
- ldr r2, [sp, 0x54]
- adds r2, 0x8
- str r2, [sp, 0x54]
- adds r4, 0x8
- adds r7, 0x8
- adds r6, 0x8
- movs r0, 0x8
- add r9, r0
- ldr r1, [sp, 0x58]
- adds r1, 0x8
- str r1, [sp, 0x58]
- adds r5, 0x1
- cmp r5, 0x3
- ble _0807BDD6
- movs r0, 0
- str r0, [sp, 0x24]
- mov r0, r10
- movs r1, 0x17
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- bne _0807BECA
- ldr r2, [sp, 0x50]
- ldrb r0, [r2]
- cmp r0, 0xB
- beq _0807BECA
- add r0, sp, 0x20
- movs r1, 0x1
- strb r1, [r0]
- ldrb r0, [r2]
- cmp r0, 0xB
- bne _0807BEAA
- str r1, [sp, 0x24]
- b _0807BEC2
-_0807BEAA:
- ldr r7, [sp, 0x48]
- cmp r7, 0
- beq _0807BEB4
- movs r0, 0x2
- b _0807BEC0
-_0807BEB4:
- ldr r0, _0807BEE8
- ldr r2, [sp, 0x40]
- lsls r1, r2, 1
- adds r1, r0
- movs r7, 0
- ldrsh r0, [r1, r7]
-_0807BEC0:
- str r0, [sp, 0x24]
-_0807BEC2:
- ldr r0, [sp, 0x24]
- ldr r1, [sp, 0x44]
- adds r1, r0
- str r1, [sp, 0x44]
-_0807BECA:
- ldr r2, [sp, 0x48]
- cmp r2, 0
- beq _0807BF2A
- movs r5, 0
- movs r7, 0
- str r7, [sp, 0x44]
- add r0, sp, 0x4
- adds r3, r0, 0
- mov r2, sp
- movs r4, 0x4
-_0807BEDE:
- ldrb r1, [r2]
- cmp r1, 0
- bne _0807BEEC
- str r1, [r3]
- b _0807BEF4
- .align 2, 0
-_0807BEE8: .4byte gUnknown_80F4E22
-_0807BEEC:
- ldr r1, [r3]
- cmp r5, r1
- bge _0807BEF4
- adds r5, r1, 0
-_0807BEF4:
- adds r3, 0x8
- adds r2, 0x8
- subs r4, 0x1
- cmp r4, 0
- bge _0807BEDE
- movs r4, 0
- movs r6, 0
- adds r1, r0, 0
- adds r3, r1, 0
- mov r2, sp
-_0807BF08:
- ldrb r0, [r2]
- cmp r0, 0
- beq _0807BF1E
- ldr r0, [r1]
- cmp r5, r0
- beq _0807BF16
- str r6, [r1]
-_0807BF16:
- ldr r0, [r3]
- ldr r7, [sp, 0x44]
- adds r7, r0
- str r7, [sp, 0x44]
-_0807BF1E:
- adds r1, 0x8
- adds r3, 0x8
- adds r2, 0x8
- adds r4, 0x1
- cmp r4, 0x4
- ble _0807BF08
-_0807BF2A:
- ldr r0, [sp, 0x44]
- cmp r0, 0
- bne _0807BF32
- b _0807C03A
-_0807BF32:
- bl DungeonRandomCapped
- str r0, [sp, 0x38]
- movs r1, 0
- mov r9, r1
- mov r0, r10
- movs r1, 0x17
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- bne _0807BF5A
- add r1, sp, 0x34
- mov r0, r10
- movs r2, 0x1
- bl TargetRegularAttack
- lsls r0, 24
- lsrs r6, r0, 24
- b _0807BF5E
-_0807BF5A:
- movs r6, 0
- str r6, [sp, 0x34]
-_0807BF5E:
- movs r5, 0
- mov r4, sp
- movs r7, 0
-_0807BF64:
- ldrb r0, [r4]
- cmp r0, 0
- beq _0807C010
- add r0, sp, 0x4
- adds r0, r7
- ldr r0, [r0]
- cmp r0, 0
- beq _0807C010
- add r9, r0
- ldr r2, [sp, 0x38]
- cmp r9, r2
- blt _0807C010
- cmp r5, 0x4
- bne _0807BF9C
- cmp r6, 0
- beq _0807C03A
- mov r0, r8
- adds r0, 0x44
- movs r1, 0x32
- bl SetAction
- ldr r0, [sp, 0x34]
- movs r1, 0x7
- ands r0, r1
- mov r1, r8
- adds r1, 0x46
- strb r0, [r1]
- b _0807C008
-_0807BF9C:
- movs r0, 0x8C
- lsls r0, 1
- mov r9, r0
- adds r2, r7, r0
- add r2, r8
- adds r0, r4, 0
- mov r1, r10
- bl FindMoveTarget
- ldrb r0, [r4]
- cmp r0, 0
- beq _0807C01A
- mov r0, r8
- adds r0, 0x44
- movs r1, 0x15
- bl SetAction
- adds r3, r5, 0
- mov r6, r8
- adds r6, 0x48
- movs r1, 0x46
- add r1, r8
- mov r12, r1
- cmp r5, 0
- ble _0807BFFC
- mov r2, r8
- adds r0, r2, r7
- add r0, r9
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _0807BFFC
- movs r7, 0x2
- lsls r0, r5, 3
- movs r1, 0x8C
- lsls r1, 1
- adds r0, r1
- adds r2, r0, r2
-_0807BFEA:
- subs r2, 0x8
- subs r3, 0x1
- cmp r3, 0
- ble _0807BFFC
- ldrb r1, [r2]
- adds r0, r7, 0
- ands r0, r1
- cmp r0, 0
- bne _0807BFEA
-_0807BFFC:
- ldrb r1, [r4, 0x1]
- movs r0, 0x7
- ands r0, r1
- mov r2, r12
- strb r0, [r2]
-_0807C006:
- strb r3, [r6]
-_0807C008:
- mov r0, r10
- bl TargetTileInFront
- b _0807C03A
-_0807C010:
- adds r4, 0x8
- adds r7, 0x8
- adds r5, 0x1
- cmp r5, 0x4
- ble _0807BF64
-_0807C01A:
- cmp r6, 0
- beq _0807C03A
- mov r0, r8
- adds r0, 0x44
- movs r1, 0x32
- bl SetAction
- ldr r0, [sp, 0x34]
- movs r1, 0x7
- ands r0, r1
- mov r1, r8
- adds r1, 0x46
- strb r0, [r1]
- mov r0, r10
- bl TargetTileInFront
-_0807C03A:
- add sp, 0x5C
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end DecideAttack
-
- thumb_func_start FindMoveTarget
-FindMoveTarget:
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x1C
- str r0, [sp, 0x8]
- adds r6, r1, 0
- mov r10, r2
- movs r0, 0x1
- str r0, [sp, 0x10]
- ldr r4, [r6, 0x70]
- movs r1, 0
- mov r8, r1
- ldr r1, _0807C0C8
- movs r2, 0
- adds r0, r1, 0x7
-_0807C06E:
- strb r2, [r0]
- subs r0, 0x1
- cmp r0, r1
- bge _0807C06E
- adds r0, r6, 0
- mov r1, r10
- movs r2, 0x1
- bl GetTargetingFlags
- lsls r0, 16
- asrs r0, 16
- str r0, [sp, 0xC]
- adds r0, r6, 0
- movs r1, 0x8
- bl HasIQSkill
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x14]
- movs r0, 0
- ldr r2, [sp, 0x8]
- strb r0, [r2]
- adds r0, r4, 0
- adds r0, 0xBC
- ldrb r0, [r0]
- cmp r0, 0x5
- bne _0807C0B0
- mov r0, r10
- bl GetMoveDealsDirectDamage
- lsls r0, 24
- cmp r0, 0
- beq _0807C0C4
-_0807C0B0:
- ldr r3, [sp, 0x14]
- cmp r3, 0
- beq _0807C0CC
- adds r0, r6, 0
- mov r1, r10
- bl CanUseWithStatusChecker
- lsls r0, 24
- cmp r0, 0
- bne _0807C0CC
-_0807C0C4:
- movs r0, 0x1
- b _0807C48C
- .align 2, 0
-_0807C0C8: .4byte gCanAttackInDirection
-_0807C0CC:
- movs r0, 0xF0
- ldr r1, [sp, 0xC]
- ands r0, r1
- cmp r0, 0
- beq _0807C0DE
- cmp r0, 0x10
- beq _0807C0DE
- cmp r0, 0x20
- bne _0807C19C
-_0807C0DE:
- adds r0, r4, 0
- adds r0, 0xE8
- ldrb r1, [r0]
- cmp r1, 0x1
- bne _0807C128
- subs r0, 0xA2
- ldrb r7, [r0]
- ldr r0, _0807C118
- adds r0, r7, r0
- ldrb r3, [r0]
- cmp r3, 0
- beq _0807C0F8
- b _0807C3F6
-_0807C0F8:
- strb r1, [r0]
- ldr r0, _0807C11C
- add r0, r8
- strb r7, [r0]
- ldr r0, _0807C120
- mov r4, r8
- lsls r2, r4, 2
- adds r0, r2, r0
- movs r1, 0x63
- str r1, [r0]
- ldr r0, _0807C124
- adds r2, r0
- str r3, [r2]
- movs r0, 0x1
- add r8, r0
- b _0807C3F6
- .align 2, 0
-_0807C118: .4byte gCanAttackInDirection
-_0807C11C: .4byte gUnknown_202F388
-_0807C120: .4byte gPotentialTargetWeights_2
-_0807C124: .4byte gUnknown_202F3B0
-_0807C128:
- movs r7, 0
- movs r0, 0xF0
- ldr r1, [sp, 0xC]
- ands r0, r1
- lsls r5, r0, 16
-_0807C132:
- movs r2, 0x4
- ldrsh r0, [r6, r2]
- ldr r1, _0807C198
- lsls r2, r7, 2
- adds r2, r1
- movs r3, 0
- ldrsh r1, [r2, r3]
- adds r0, r1
- movs r4, 0x6
- ldrsh r1, [r6, r4]
- movs r3, 0x2
- ldrsh r2, [r2, r3]
- adds r1, r2
- bl GetMapTileAtPosition
- ldr r4, [r0, 0x10]
- cmp r4, 0
- beq _0807C18E
- adds r0, r4, 0
- bl GetEntityType
- cmp r0, 0x1
- bne _0807C18E
- asrs r0, r5, 16
- cmp r0, 0x10
- beq _0807C178
- cmp r0, 0x20
- beq _0807C178
- adds r0, r6, 0
- adds r1, r7, 0
- bl CanAttackInFront
- lsls r0, 24
- cmp r0, 0
- beq _0807C18E
-_0807C178:
- mov r0, r10
- str r0, [sp]
- ldr r1, [sp, 0x14]
- str r1, [sp, 0x4]
- mov r0, r8
- ldr r1, [sp, 0xC]
- adds r2, r6, 0
- adds r3, r4, 0
- bl WeightMoveIfUsable
- mov r8, r0
-_0807C18E:
- adds r7, 0x1
- cmp r7, 0x7
- ble _0807C132
- b _0807C3F6
- .align 2, 0
-_0807C198: .4byte gAdjacentTileOffsets
-_0807C19C:
- cmp r0, 0x30
- bne _0807C1F0
- movs r5, 0
-_0807C1A2:
- ldr r0, _0807C1E8
- ldr r0, [r0]
- lsls r1, r5, 2
- ldr r2, _0807C1EC
- adds r0, r2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl EntityExists
- lsls r0, 24
- cmp r0, 0
- beq _0807C1E0
- adds r0, r6, 0
- adds r1, r4, 0
- bl CanSee
- lsls r0, 24
- cmp r0, 0
- beq _0807C1E0
- mov r3, r10
- str r3, [sp]
- ldr r0, [sp, 0x14]
- str r0, [sp, 0x4]
- mov r0, r8
- ldr r1, [sp, 0xC]
- adds r2, r6, 0
- adds r3, r4, 0
- bl WeightMoveIfUsable
- mov r8, r0
-_0807C1E0:
- adds r5, 0x1
- cmp r5, 0x13
- ble _0807C1A2
- b _0807C3F6
- .align 2, 0
-_0807C1E8: .4byte gDungeonGlobalData
-_0807C1EC: .4byte 0x000135cc
-_0807C1F0:
- cmp r0, 0x40
- bne _0807C2A8
- movs r7, 0
- ldr r1, _0807C2A4
- mov r9, r1
-_0807C1FA:
- movs r2, 0x4
- ldrsh r0, [r6, r2]
- mov r3, r9
- movs r4, 0
- ldrsh r1, [r3, r4]
- adds r0, r1
- movs r2, 0x6
- ldrsh r1, [r6, r2]
- movs r4, 0x2
- ldrsh r2, [r3, r4]
- adds r1, r2
- bl GetMapTileAtPosition
- adds r4, r0, 0
- adds r0, r6, 0
- adds r1, r7, 0
- bl CanAttackInFront
- lsls r0, 24
- cmp r0, 0
- beq _0807C296
- ldr r5, [r4, 0x10]
- cmp r5, 0
- beq _0807C250
- adds r0, r5, 0
- bl GetEntityType
- cmp r0, 0x1
- bne _0807C250
- mov r4, r8
- mov r0, r10
- str r0, [sp]
- ldr r1, [sp, 0x14]
- str r1, [sp, 0x4]
- adds r0, r4, 0
- ldr r1, [sp, 0xC]
- adds r2, r6, 0
- adds r3, r5, 0
- bl WeightMoveIfUsable
- mov r8, r0
- cmp r4, r8
- bne _0807C296
-_0807C250:
- movs r2, 0x4
- ldrsh r0, [r6, r2]
- mov r3, r9
- movs r4, 0
- ldrsh r1, [r3, r4]
- lsls r1, 1
- adds r0, r1
- movs r2, 0x6
- ldrsh r1, [r6, r2]
- movs r4, 0x2
- ldrsh r2, [r3, r4]
- lsls r2, 1
- adds r1, r2
- bl GetMapTileAtPosition
- adds r4, r0, 0
- ldr r5, [r4, 0x10]
- cmp r5, 0
- beq _0807C296
- adds r0, r5, 0
- bl GetEntityType
- cmp r0, 0x1
- bne _0807C296
- mov r0, r10
- str r0, [sp]
- ldr r1, [sp, 0x14]
- str r1, [sp, 0x4]
- mov r0, r8
- ldr r1, [sp, 0xC]
- adds r2, r6, 0
- adds r3, r5, 0
- bl WeightMoveIfUsable
- mov r8, r0
-_0807C296:
- movs r2, 0x4
- add r9, r2
- adds r7, 0x1
- cmp r7, 0x7
- ble _0807C1FA
- b _0807C3F6
- .align 2, 0
-_0807C2A4: .4byte gAdjacentTileOffsets
-_0807C2A8:
- cmp r0, 0x50
- beq _0807C2B0
- cmp r0, 0x80
- bne _0807C394
-_0807C2B0:
- movs r3, 0x1
- str r3, [sp, 0x18]
- cmp r0, 0x50
- bne _0807C2BC
- movs r4, 0xA
- str r4, [sp, 0x18]
-_0807C2BC:
- movs r0, 0
- mov r9, r0
-_0807C2C0:
- ldr r0, _0807C37C
- ldr r0, [r0]
- mov r2, r9
- lsls r1, r2, 2
- ldr r3, _0807C380
- adds r0, r3
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl EntityExists
- lsls r0, 24
- cmp r0, 0
- beq _0807C370
- cmp r6, r4
- beq _0807C370
- adds r1, r4, 0x4
- adds r0, r6, 0x4
- bl CalculateFacingDir
- adds r5, r0, 0
- ldr r0, _0807C384
- adds r7, r5, r0
- ldrb r0, [r7]
- cmp r0, 0
- bne _0807C370
- adds r0, r6, 0
- adds r1, r4, 0
- bl CanSee
- lsls r0, 24
- cmp r0, 0
- beq _0807C370
- adds r0, r6, 0
- adds r1, r4, 0
- ldr r2, [sp, 0x18]
- bl IsTargetInLineRange
- lsls r0, 24
- cmp r0, 0
- beq _0807C370
- ldr r0, [sp, 0x14]
- str r0, [sp]
- ldr r0, [sp, 0xC]
- adds r1, r6, 0
- adds r2, r4, 0
- mov r3, r10
- bl CanUseStatusMove
- lsls r0, 24
- cmp r0, 0
- beq _0807C370
- adds r0, r6, 0
- adds r1, r4, 0
- adds r2, r5, 0
- ldr r3, [sp, 0x18]
- bl IsTargetStraightAhead
- lsls r0, 24
- cmp r0, 0
- beq _0807C370
- movs r0, 0x1
- strb r0, [r7]
- ldr r0, _0807C388
- add r0, r8
- strb r5, [r0]
- adds r0, r6, 0
- mov r1, r10
- bl GetMoveType_2
- adds r3, r0, 0
- lsls r3, 24
- lsrs r3, 24
- adds r0, r6, 0
- ldr r1, [sp, 0xC]
- adds r2, r4, 0
- bl WeightMove
- ldr r1, _0807C38C
- mov r3, r8
- lsls r2, r3, 2
- adds r1, r2, r1
- str r0, [r1]
- ldr r0, _0807C390
- adds r2, r0
- str r4, [r2]
- movs r4, 0x1
- add r8, r4
-_0807C370:
- movs r0, 0x1
- add r9, r0
- mov r1, r9
- cmp r1, 0x13
- ble _0807C2C0
- b _0807C3F6
- .align 2, 0
-_0807C37C: .4byte gDungeonGlobalData
-_0807C380: .4byte 0x000135cc
-_0807C384: .4byte gCanAttackInDirection
-_0807C388: .4byte gUnknown_202F388
-_0807C38C: .4byte gPotentialTargetWeights_2
-_0807C390: .4byte gUnknown_202F3B0
-_0807C394:
- cmp r0, 0x60
- bne _0807C3DC
- movs r5, 0
-_0807C39A:
- ldr r0, _0807C3D4
- ldr r0, [r0]
- lsls r1, r5, 2
- ldr r2, _0807C3D8
- adds r0, r2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl EntityExists
- lsls r0, 24
- cmp r0, 0
- beq _0807C3CA
- mov r3, r10
- str r3, [sp]
- ldr r0, [sp, 0x14]
- str r0, [sp, 0x4]
- mov r0, r8
- ldr r1, [sp, 0xC]
- adds r2, r6, 0
- adds r3, r4, 0
- bl WeightMoveIfUsable
- mov r8, r0
-_0807C3CA:
- adds r5, 0x1
- cmp r5, 0x13
- ble _0807C39A
- b _0807C3F6
- .align 2, 0
-_0807C3D4: .4byte gDungeonGlobalData
-_0807C3D8: .4byte 0x000135cc
-_0807C3DC:
- cmp r0, 0x70
- bne _0807C3F6
- mov r1, r10
- str r1, [sp]
- ldr r2, [sp, 0x14]
- str r2, [sp, 0x4]
- mov r0, r8
- ldr r1, [sp, 0xC]
- adds r2, r6, 0
- adds r3, r6, 0
- bl WeightMoveIfUsable
- mov r8, r0
-_0807C3F6:
- mov r3, r8
- cmp r3, 0
- bne _0807C402
- ldr r4, [sp, 0x8]
- strb r3, [r4]
- b _0807C48A
-_0807C402:
- movs r4, 0
- movs r3, 0
- mov r0, r8
- cmp r0, 0
- ble _0807C420
- ldr r2, _0807C464
- mov r1, r8
-_0807C410:
- ldr r0, [r2]
- cmp r3, r0
- bge _0807C418
- adds r3, r0, 0
-_0807C418:
- adds r2, 0x4
- subs r1, 0x1
- cmp r1, 0
- bne _0807C410
-_0807C420:
- mov r1, r8
- cmp r1, 0
- ble _0807C43A
- movs r5, 0
- ldr r2, _0807C464
-_0807C42A:
- ldr r0, [r2]
- cmp r3, r0
- beq _0807C432
- str r5, [r2]
-_0807C432:
- adds r2, 0x4
- subs r1, 0x1
- cmp r1, 0
- bne _0807C42A
-_0807C43A:
- str r3, [sp, 0x10]
- mov r2, r8
- cmp r2, 0
- ble _0807C450
- ldr r2, _0807C464
- mov r1, r8
-_0807C446:
- ldm r2!, {r0}
- adds r4, r0
- subs r1, 0x1
- cmp r1, 0
- bne _0807C446
-_0807C450:
- adds r0, r4, 0
- bl DungeonRandomCapped
- adds r2, r0, 0
- movs r1, 0
- cmp r1, r8
- bge _0807C478
- ldr r3, _0807C464
- b _0807C470
- .align 2, 0
-_0807C464: .4byte gPotentialTargetWeights_2
-_0807C468:
- adds r3, 0x4
- adds r1, 0x1
- cmp r1, r8
- bge _0807C478
-_0807C470:
- ldr r0, [r3]
- subs r2, r0
- cmp r2, 0
- bge _0807C468
-_0807C478:
- movs r0, 0x1
- ldr r3, [sp, 0x8]
- strb r0, [r3]
- ldr r0, _0807C49C
- adds r0, r1, r0
- ldrb r0, [r0]
- strb r0, [r3, 0x1]
- movs r0, 0x8
- str r0, [r3, 0x4]
-_0807C48A:
- ldr r0, [sp, 0x10]
-_0807C48C:
- add sp, 0x1C
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_0807C49C: .4byte gUnknown_202F388
- thumb_func_end FindMoveTarget
-
- thumb_func_start IsTargetInLineRange
-IsTargetInLineRange:
- push {r4-r7,lr}
- adds r4, r0, 0
- adds r5, r1, 0
- movs r0, 0x4
- ldrsh r1, [r4, r0]
- movs r3, 0x4
- ldrsh r0, [r5, r3]
- subs r3, r1, r0
- cmp r3, 0
- bge _0807C4B6
- negs r3, r3
-_0807C4B6:
- movs r6, 0x6
- ldrsh r1, [r4, r6]
- movs r7, 0x6
- ldrsh r0, [r5, r7]
- subs r1, r0
- cmp r1, 0
- bge _0807C4C6
- negs r1, r1
-_0807C4C6:
- adds r0, r1, 0
- cmp r1, r3
- bge _0807C4CE
- adds r0, r3, 0
-_0807C4CE:
- cmp r0, 0xA
- bgt _0807C578
- cmp r0, r2
- bgt _0807C578
- movs r6, 0x1
- negs r6, r6
- cmp r3, r1
- bne _0807C516
- movs r0, 0x4
- ldrsh r1, [r4, r0]
- movs r2, 0x4
- ldrsh r0, [r5, r2]
- ldrh r2, [r4, 0x4]
- ldrh r3, [r5, 0x4]
- cmp r1, r0
- bge _0807C4FE
- movs r6, 0x6
- ldrsh r1, [r4, r6]
- movs r7, 0x6
- ldrsh r0, [r5, r7]
- cmp r1, r0
- blt _0807C574
- cmp r1, r0
- bgt _0807C574
-_0807C4FE:
- lsls r1, r2, 16
- lsls r0, r3, 16
- movs r6, 0x7
- cmp r1, r0
- ble _0807C570
- movs r0, 0x6
- ldrsh r1, [r4, r0]
- movs r2, 0x6
- ldrsh r0, [r5, r2]
- cmp r1, r0
- ble _0807C570
- b _0807C574
-_0807C516:
- movs r3, 0x4
- ldrsh r1, [r4, r3]
- movs r7, 0x4
- ldrsh r0, [r5, r7]
- ldrh r2, [r4, 0x4]
- ldrh r3, [r5, 0x4]
- cmp r1, r0
- bne _0807C532
- movs r0, 0x6
- ldrsh r1, [r4, r0]
- movs r7, 0x6
- ldrsh r0, [r5, r7]
- cmp r1, r0
- blt _0807C574
-_0807C532:
- lsls r1, r2, 16
- lsls r0, r3, 16
- cmp r1, r0
- bge _0807C546
- movs r0, 0x6
- ldrsh r1, [r4, r0]
- movs r7, 0x6
- ldrsh r0, [r5, r7]
- cmp r1, r0
- beq _0807C574
-_0807C546:
- lsls r1, r2, 16
- lsls r0, r3, 16
- cmp r1, r0
- bne _0807C55A
- movs r0, 0x6
- ldrsh r1, [r4, r0]
- movs r7, 0x6
- ldrsh r0, [r5, r7]
- cmp r1, r0
- bgt _0807C574
-_0807C55A:
- lsls r1, r2, 16
- lsls r0, r3, 16
- cmp r1, r0
- ble _0807C570
- movs r0, 0x6
- ldrsh r1, [r4, r0]
- movs r2, 0x6
- ldrsh r0, [r5, r2]
- cmp r1, r0
- bne _0807C570
- movs r6, 0x6
-_0807C570:
- cmp r6, 0
- blt _0807C578
-_0807C574:
- movs r0, 0x1
- b _0807C57A
-_0807C578:
- movs r0, 0
-_0807C57A:
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end IsTargetInLineRange
-
- thumb_func_start WeightMoveIfUsable
-WeightMoveIfUsable:
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- adds r6, r0, 0
- adds r5, r2, 0
- adds r7, r3, 0
- ldr r0, [sp, 0x28]
- lsls r1, 16
- asrs r1, 16
- mov r9, r1
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- ldr r2, [r5, 0x70]
- ldr r1, [r5, 0x4]
- ldr r0, [r7, 0x4]
- cmp r1, r0
- beq _0807C5BC
- movs r0, 0xF0
- mov r1, r9
- ands r0, r1
- cmp r0, 0x30
- beq _0807C5BC
- cmp r0, 0x60
- beq _0807C5BC
- cmp r0, 0x70
- bne _0807C5C4
-_0807C5BC:
- adds r0, r2, 0
- adds r0, 0x46
- ldrb r4, [r0]
- b _0807C5CE
-_0807C5C4:
- adds r0, r5, 0x4
- adds r1, r7, 0x4
- bl CalculateFacingDir
- adds r4, r0, 0
-_0807C5CE:
- ldr r0, _0807C638
- adds r0, r4
- mov r8, r0
- ldrb r0, [r0]
- cmp r0, 0
- bne _0807C624
- mov r0, r10
- str r0, [sp]
- mov r0, r9
- adds r1, r5, 0
- adds r2, r7, 0
- ldr r3, [sp, 0x24]
- bl CanUseStatusMove
- lsls r0, 24
- cmp r0, 0
- beq _0807C624
- movs r0, 0x1
- mov r1, r8
- strb r0, [r1]
- ldr r0, _0807C63C
- adds r0, r6, r0
- strb r4, [r0]
- adds r0, r5, 0
- ldr r1, [sp, 0x24]
- bl GetMoveType_2
- adds r3, r0, 0
- lsls r3, 24
- lsrs r3, 24
- adds r0, r5, 0
- mov r1, r9
- adds r2, r7, 0
- bl WeightMove
- ldr r1, _0807C640
- lsls r2, r6, 2
- adds r1, r2, r1
- str r0, [r1]
- ldr r0, _0807C644
- adds r2, r0
- str r7, [r2]
- adds r6, 0x1
-_0807C624:
- adds r0, r6, 0
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_0807C638: .4byte gCanAttackInDirection
-_0807C63C: .4byte gUnknown_202F388
-_0807C640: .4byte gPotentialTargetWeights_2
-_0807C644: .4byte gUnknown_202F3B0
- thumb_func_end WeightMoveIfUsable
-
- thumb_func_start CanUseStatusMove
-CanUseStatusMove:
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- adds r5, r1, 0
- adds r4, r2, 0
- mov r8, r3
- ldr r1, [sp, 0x1C]
- lsls r0, 16
- asrs r6, r0, 16
- lsls r1, 24
- lsrs r1, 24
- mov r9, r1
- movs r7, 0
- movs r0, 0xF
- ands r0, r6
- adds r1, r0, 0
- cmp r1, 0
- bne _0807C686
- adds r0, r5, 0
- adds r1, r4, 0
- movs r2, 0
- movs r3, 0x1
- bl CanTarget
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- bne _0807C6E0
- movs r7, 0x1
- b _0807C6E4
-_0807C686:
- cmp r1, 0x1
- beq _0807C6BE
- cmp r1, 0x2
- bne _0807C692
- ldr r1, [r4, 0x70]
- b _0807C69C
-_0807C692:
- cmp r1, 0x5
- bne _0807C6B6
- ldr r1, [r4, 0x70]
- cmp r5, r4
- beq _0807C6B2
-_0807C69C:
- movs r7, 0x1
- ldrb r0, [r1, 0x8]
- cmp r0, 0x1
- beq _0807C6B2
- adds r0, r1, 0
- adds r0, 0xA4
- ldrb r0, [r0]
- cmp r0, 0x4
- beq _0807C6B2
- cmp r0, 0x1
- bne _0807C6E0
-_0807C6B2:
- movs r0, 0
- b _0807C7A0
-_0807C6B6:
- cmp r1, 0x6
- bne _0807C6D4
- cmp r5, r4
- beq _0807C6B2
-_0807C6BE:
- adds r0, r5, 0
- adds r1, r4, 0
- movs r2, 0
- movs r3, 0x1
- bl CanTarget
- lsls r0, 24
- cmp r0, 0
- bne _0807C6E0
- movs r7, 0x1
- b _0807C6E4
-_0807C6D4:
- subs r0, 0x3
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x1
- bhi _0807C6E0
- movs r7, 0x1
-_0807C6E0:
- cmp r7, 0
- beq _0807C79E
-_0807C6E4:
- mov r0, r9
- cmp r0, 0
- beq _0807C77C
- adds r0, r5, 0
- adds r1, r4, 0
- mov r2, r8
- bl CanUseWithStatusChecker_2
- lsls r0, 24
- cmp r0, 0
- beq _0807C6B2
- movs r1, 0xF0
- lsls r1, 4
- ands r1, r6
- movs r0, 0x80
- lsls r0, 1
- cmp r1, r0
- beq _0807C78A
- movs r0, 0x80
- lsls r0, 2
- cmp r1, r0
- beq _0807C76E
- movs r0, 0xC0
- lsls r0, 2
- cmp r1, r0
- bne _0807C720
- adds r0, r4, 0
- bl HasNegativeStatus
- b _0807C774
-_0807C720:
- movs r0, 0x80
- lsls r0, 3
- cmp r1, r0
- bne _0807C730
- adds r0, r4, 0
- bl IsSleeping
- b _0807C774
-_0807C730:
- movs r0, 0xC0
- lsls r0, 3
- cmp r1, r0
- bne _0807C75A
- ldr r1, [r4, 0x70]
- adds r0, r1, 0
- adds r0, 0x5C
- ldrb r0, [r0]
- cmp r0, 0xE
- beq _0807C74E
- adds r0, r1, 0
- adds r0, 0x5D
- ldrb r0, [r0]
- cmp r0, 0xE
- bne _0807C6B2
-_0807C74E:
- adds r0, r1, 0
- adds r0, 0xF5
- ldrb r0, [r0]
- cmp r0, 0
- beq _0807C79E
- b _0807C6B2
-_0807C75A:
- movs r0, 0xA0
- lsls r0, 3
- cmp r1, r0
- bne _0807C79E
- adds r0, r4, 0
- bl HasNegativeStatus
- lsls r0, 24
- cmp r0, 0
- bne _0807C79E
-_0807C76E:
- adds r0, r4, 0
- bl HasQuarterHPOrLess
-_0807C774:
- lsls r0, 24
- cmp r0, 0
- bne _0807C79E
- b _0807C6B2
-_0807C77C:
- movs r0, 0xF0
- lsls r0, 4
- ands r0, r6
- movs r1, 0x80
- lsls r1, 1
- cmp r0, r1
- bne _0807C79E
-_0807C78A:
- mov r0, r8
- movs r1, 0x2
- bl GetMoveAccuracy
- adds r4, r0, 0
- movs r0, 0x64
- bl DungeonRandomCapped
- cmp r0, r4
- bge _0807C6B2
-_0807C79E:
- adds r0, r7, 0
-_0807C7A0:
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end CanUseStatusMove
-
- thumb_func_start WeightMove
-WeightMove:
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- adds r5, r0, 0
- mov r8, r2
- lsls r1, 16
- asrs r1, 16
- lsls r3, 24
- lsrs r3, 24
- mov r9, r3
- movs r6, 0x1
- ldr r4, [r2, 0x70]
- adds r7, r4, 0
- ldrb r0, [r4, 0x6]
- cmp r0, 0
- beq _0807C7D6
- movs r0, 0xF
- ands r0, r1
- cmp r0, 0
- beq _0807C7DA
-_0807C7D6:
- movs r0, 0x1
- b _0807C848
-_0807C7DA:
- adds r0, r5, 0
- movs r1, 0x9
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- beq _0807C804
- ldr r0, _0807C7FC
- ldr r0, [r0]
- movs r2, 0x2
- ldrsh r1, [r4, r2]
- ldr r2, _0807C800
- adds r0, r2
- adds r0, r1
- ldrb r6, [r0]
- b _0807C846
- .align 2, 0
-_0807C7FC: .4byte gDungeonGlobalData
-_0807C800: .4byte 0x0000363c
-_0807C804:
- adds r0, r5, 0
- movs r1, 0xA
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- beq _0807C828
- ldrb r1, [r7, 0xE]
- movs r2, 0xC
- negs r2, r2
- adds r0, r2, 0
- subs r0, r1
- lsls r0, 24
- lsrs r6, r0, 24
- cmp r6, 0
- bne _0807C846
- movs r6, 0x1
- b _0807C846
-_0807C828:
- adds r0, r5, 0
- movs r1, 0xB
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- beq _0807C846
- adds r0, r5, 0
- mov r1, r8
- mov r2, r9
- bl WeightWeakTypePicker
- adds r0, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
-_0807C846:
- adds r0, r6, 0
-_0807C848:
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end WeightMove
-
- thumb_func_start TargetRegularAttack
-TargetRegularAttack:
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x50
- adds r7, r0, 0
- str r1, [sp, 0x40]
- lsls r2, 24
- lsrs r2, 24
- str r2, [sp, 0x44]
- ldr r0, [r7, 0x70]
- movs r1, 0
- mov r8, r1
- adds r1, r0, 0
- adds r1, 0x46
- ldrb r6, [r1]
- adds r0, 0xE8
- ldrb r0, [r0]
- movs r3, 0x8
- mov r10, r3
- cmp r0, 0x1
- bne _0807C886
- movs r0, 0x1
- mov r10, r0
-_0807C886:
- movs r4, 0
- adds r0, r7, 0
- movs r1, 0x9
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- bne _0807C8A4
- adds r0, r7, 0
- movs r1, 0xA
- bl HasIQSkill
- lsls r0, 24
- cmp r0, 0
- beq _0807C8A6
-_0807C8A4:
- movs r4, 0x1
-_0807C8A6:
- str r4, [sp, 0x48]
- adds r0, r7, 0
- movs r1, 0x8
- bl HasIQSkill
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x4C]
- movs r1, 0
- mov r9, r1
- cmp r9, r10
- bge _0807C952
-_0807C8BE:
- movs r0, 0x7
- ands r6, r0
- movs r3, 0x4
- ldrsh r0, [r7, r3]
- ldr r1, _0807C95C
- lsls r2, r6, 2
- adds r2, r1
- movs r3, 0
- ldrsh r1, [r2, r3]
- adds r0, r1
- movs r3, 0x6
- ldrsh r1, [r7, r3]
- movs r3, 0x2
- ldrsh r2, [r2, r3]
- adds r1, r2
- bl GetMapTileAtPosition
- ldr r5, [r0, 0x10]
- cmp r5, 0
- beq _0807C948
- adds r0, r5, 0
- bl GetEntityType
- cmp r0, 0x1
- bne _0807C948
- adds r0, r7, 0
- adds r1, r6, 0
- bl CanAttackInFront
- lsls r0, 24
- cmp r0, 0
- beq _0807C948
- adds r0, r7, 0
- adds r1, r5, 0
- movs r2, 0
- ldr r3, [sp, 0x44]
- bl CanTarget
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- bne _0807C948
- ldr r0, [sp, 0x4C]
- cmp r0, 0
- beq _0807C922
- ldr r0, [r5, 0x70]
- adds r0, 0xB0
- ldrb r0, [r0]
- cmp r0, 0x1
- beq _0807C948
-_0807C922:
- mov r1, r8
- lsls r4, r1, 2
- mov r3, sp
- adds r0, r3, r4
- str r6, [r0]
- adds r0, r7, 0
- movs r1, 0
- adds r2, r5, 0
- movs r3, 0
- bl WeightMove
- add r1, sp, 0x20
- adds r1, r4
- str r0, [r1]
- ldr r0, [sp, 0x48]
- cmp r0, 0
- beq _0807C960
- movs r1, 0x1
- add r8, r1
-_0807C948:
- movs r3, 0x1
- add r9, r3
- adds r6, 0x1
- cmp r9, r10
- blt _0807C8BE
-_0807C952:
- mov r0, r8
- cmp r0, 0
- bne _0807C966
- movs r0, 0
- b _0807C9E8
- .align 2, 0
-_0807C95C: .4byte gAdjacentTileOffsets
-_0807C960:
- ldr r1, [sp, 0x40]
- str r6, [r1]
- b _0807C9E6
-_0807C966:
- movs r4, 0
- movs r3, 0
- mov r0, r8
- cmp r0, 0
- ble _0807C984
- add r1, sp, 0x20
- mov r2, r8
-_0807C974:
- ldr r0, [r1]
- cmp r3, r0
- bge _0807C97C
- adds r3, r0, 0
-_0807C97C:
- adds r1, 0x4
- subs r2, 0x1
- cmp r2, 0
- bne _0807C974
-_0807C984:
- mov r1, r8
- cmp r1, 0
- ble _0807C9A0
- movs r5, 0
- add r1, sp, 0x20
- mov r2, r8
-_0807C990:
- ldr r0, [r1]
- cmp r3, r0
- beq _0807C998
- str r5, [r1]
-_0807C998:
- adds r1, 0x4
- subs r2, 0x1
- cmp r2, 0
- bne _0807C990
-_0807C9A0:
- mov r3, r8
- cmp r3, 0
- ble _0807C9B4
- add r1, sp, 0x20
- mov r2, r8
-_0807C9AA:
- ldm r1!, {r0}
- adds r4, r0
- subs r2, 0x1
- cmp r2, 0
- bne _0807C9AA
-_0807C9B4:
- adds r0, r4, 0
- bl DungeonRandomCapped
- adds r1, r0, 0
- movs r2, 0
- cmp r2, r8
- bge _0807C9DC
- ldr r0, [sp, 0x20]
- subs r1, r0
- cmp r1, 0
- blt _0807C9DC
- add r3, sp, 0x20
-_0807C9CC:
- adds r3, 0x4
- adds r2, 0x1
- cmp r2, r8
- bge _0807C9DC
- ldr r0, [r3]
- subs r1, r0
- cmp r1, 0
- bge _0807C9CC
-_0807C9DC:
- lsls r0, r2, 2
- add r0, sp
- ldr r0, [r0]
- ldr r1, [sp, 0x40]
- str r0, [r1]
-_0807C9E6:
- movs r0, 0x1
-_0807C9E8:
- add sp, 0x50
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end TargetRegularAttack
-
.align 2, 0 \ No newline at end of file
diff --git a/asm/code_807C04C.s b/asm/code_807C04C.s
new file mode 100644
index 0000000..80e75af
--- /dev/null
+++ b/asm/code_807C04C.s
@@ -0,0 +1,1297 @@
+ #include "asm/constants/gba_constants.inc"
+ #include "asm/macros.inc"
+
+ .syntax unified
+
+ .text
+
+ thumb_func_start FindMoveTarget
+FindMoveTarget:
+ push {r4-r7,lr}
+ mov r7, r10
+ mov r6, r9
+ mov r5, r8
+ push {r5-r7}
+ sub sp, 0x1C
+ str r0, [sp, 0x8]
+ adds r6, r1, 0
+ mov r10, r2
+ movs r0, 0x1
+ str r0, [sp, 0x10]
+ ldr r4, [r6, 0x70]
+ movs r1, 0
+ mov r8, r1
+ ldr r1, _0807C0C8
+ movs r2, 0
+ adds r0, r1, 0x7
+_0807C06E:
+ strb r2, [r0]
+ subs r0, 0x1
+ cmp r0, r1
+ bge _0807C06E
+ adds r0, r6, 0
+ mov r1, r10
+ movs r2, 0x1
+ bl GetTargetingFlags
+ lsls r0, 16
+ asrs r0, 16
+ str r0, [sp, 0xC]
+ adds r0, r6, 0
+ movs r1, 0x8
+ bl HasIQSkill
+ lsls r0, 24
+ lsrs r0, 24
+ str r0, [sp, 0x14]
+ movs r0, 0
+ ldr r2, [sp, 0x8]
+ strb r0, [r2]
+ adds r0, r4, 0
+ adds r0, 0xBC
+ ldrb r0, [r0]
+ cmp r0, 0x5
+ bne _0807C0B0
+ mov r0, r10
+ bl GetMoveDealsDirectDamage
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C0C4
+_0807C0B0:
+ ldr r3, [sp, 0x14]
+ cmp r3, 0
+ beq _0807C0CC
+ adds r0, r6, 0
+ mov r1, r10
+ bl CanUseWithStatusChecker
+ lsls r0, 24
+ cmp r0, 0
+ bne _0807C0CC
+_0807C0C4:
+ movs r0, 0x1
+ b _0807C48C
+ .align 2, 0
+_0807C0C8: .4byte gCanAttackInDirection
+_0807C0CC:
+ movs r0, 0xF0
+ ldr r1, [sp, 0xC]
+ ands r0, r1
+ cmp r0, 0
+ beq _0807C0DE
+ cmp r0, 0x10
+ beq _0807C0DE
+ cmp r0, 0x20
+ bne _0807C19C
+_0807C0DE:
+ adds r0, r4, 0
+ adds r0, 0xE8
+ ldrb r1, [r0]
+ cmp r1, 0x1
+ bne _0807C128
+ subs r0, 0xA2
+ ldrb r7, [r0]
+ ldr r0, _0807C118
+ adds r0, r7, r0
+ ldrb r3, [r0]
+ cmp r3, 0
+ beq _0807C0F8
+ b _0807C3F6
+_0807C0F8:
+ strb r1, [r0]
+ ldr r0, _0807C11C
+ add r0, r8
+ strb r7, [r0]
+ ldr r0, _0807C120
+ mov r4, r8
+ lsls r2, r4, 2
+ adds r0, r2, r0
+ movs r1, 0x63
+ str r1, [r0]
+ ldr r0, _0807C124
+ adds r2, r0
+ str r3, [r2]
+ movs r0, 0x1
+ add r8, r0
+ b _0807C3F6
+ .align 2, 0
+_0807C118: .4byte gCanAttackInDirection
+_0807C11C: .4byte gUnknown_202F388
+_0807C120: .4byte gPotentialTargetWeights_2
+_0807C124: .4byte gUnknown_202F3B0
+_0807C128:
+ movs r7, 0
+ movs r0, 0xF0
+ ldr r1, [sp, 0xC]
+ ands r0, r1
+ lsls r5, r0, 16
+_0807C132:
+ movs r2, 0x4
+ ldrsh r0, [r6, r2]
+ ldr r1, _0807C198
+ lsls r2, r7, 2
+ adds r2, r1
+ movs r3, 0
+ ldrsh r1, [r2, r3]
+ adds r0, r1
+ movs r4, 0x6
+ ldrsh r1, [r6, r4]
+ movs r3, 0x2
+ ldrsh r2, [r2, r3]
+ adds r1, r2
+ bl GetMapTileAtPosition
+ ldr r4, [r0, 0x10]
+ cmp r4, 0
+ beq _0807C18E
+ adds r0, r4, 0
+ bl GetEntityType
+ cmp r0, 0x1
+ bne _0807C18E
+ asrs r0, r5, 16
+ cmp r0, 0x10
+ beq _0807C178
+ cmp r0, 0x20
+ beq _0807C178
+ adds r0, r6, 0
+ adds r1, r7, 0
+ bl CanAttackInFront
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C18E
+_0807C178:
+ mov r0, r10
+ str r0, [sp]
+ ldr r1, [sp, 0x14]
+ str r1, [sp, 0x4]
+ mov r0, r8
+ ldr r1, [sp, 0xC]
+ adds r2, r6, 0
+ adds r3, r4, 0
+ bl WeightMoveIfUsable
+ mov r8, r0
+_0807C18E:
+ adds r7, 0x1
+ cmp r7, 0x7
+ ble _0807C132
+ b _0807C3F6
+ .align 2, 0
+_0807C198: .4byte gAdjacentTileOffsets
+_0807C19C:
+ cmp r0, 0x30
+ bne _0807C1F0
+ movs r5, 0
+_0807C1A2:
+ ldr r0, _0807C1E8
+ ldr r0, [r0]
+ lsls r1, r5, 2
+ ldr r2, _0807C1EC
+ adds r0, r2
+ adds r0, r1
+ ldr r4, [r0]
+ adds r0, r4, 0
+ bl EntityExists
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C1E0
+ adds r0, r6, 0
+ adds r1, r4, 0
+ bl CanSee
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C1E0
+ mov r3, r10
+ str r3, [sp]
+ ldr r0, [sp, 0x14]
+ str r0, [sp, 0x4]
+ mov r0, r8
+ ldr r1, [sp, 0xC]
+ adds r2, r6, 0
+ adds r3, r4, 0
+ bl WeightMoveIfUsable
+ mov r8, r0
+_0807C1E0:
+ adds r5, 0x1
+ cmp r5, 0x13
+ ble _0807C1A2
+ b _0807C3F6
+ .align 2, 0
+_0807C1E8: .4byte gDungeonGlobalData
+_0807C1EC: .4byte 0x000135cc
+_0807C1F0:
+ cmp r0, 0x40
+ bne _0807C2A8
+ movs r7, 0
+ ldr r1, _0807C2A4
+ mov r9, r1
+_0807C1FA:
+ movs r2, 0x4
+ ldrsh r0, [r6, r2]
+ mov r3, r9
+ movs r4, 0
+ ldrsh r1, [r3, r4]
+ adds r0, r1
+ movs r2, 0x6
+ ldrsh r1, [r6, r2]
+ movs r4, 0x2
+ ldrsh r2, [r3, r4]
+ adds r1, r2
+ bl GetMapTileAtPosition
+ adds r4, r0, 0
+ adds r0, r6, 0
+ adds r1, r7, 0
+ bl CanAttackInFront
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C296
+ ldr r5, [r4, 0x10]
+ cmp r5, 0
+ beq _0807C250
+ adds r0, r5, 0
+ bl GetEntityType
+ cmp r0, 0x1
+ bne _0807C250
+ mov r4, r8
+ mov r0, r10
+ str r0, [sp]
+ ldr r1, [sp, 0x14]
+ str r1, [sp, 0x4]
+ adds r0, r4, 0
+ ldr r1, [sp, 0xC]
+ adds r2, r6, 0
+ adds r3, r5, 0
+ bl WeightMoveIfUsable
+ mov r8, r0
+ cmp r4, r8
+ bne _0807C296
+_0807C250:
+ movs r2, 0x4
+ ldrsh r0, [r6, r2]
+ mov r3, r9
+ movs r4, 0
+ ldrsh r1, [r3, r4]
+ lsls r1, 1
+ adds r0, r1
+ movs r2, 0x6
+ ldrsh r1, [r6, r2]
+ movs r4, 0x2
+ ldrsh r2, [r3, r4]
+ lsls r2, 1
+ adds r1, r2
+ bl GetMapTileAtPosition
+ adds r4, r0, 0
+ ldr r5, [r4, 0x10]
+ cmp r5, 0
+ beq _0807C296
+ adds r0, r5, 0
+ bl GetEntityType
+ cmp r0, 0x1
+ bne _0807C296
+ mov r0, r10
+ str r0, [sp]
+ ldr r1, [sp, 0x14]
+ str r1, [sp, 0x4]
+ mov r0, r8
+ ldr r1, [sp, 0xC]
+ adds r2, r6, 0
+ adds r3, r5, 0
+ bl WeightMoveIfUsable
+ mov r8, r0
+_0807C296:
+ movs r2, 0x4
+ add r9, r2
+ adds r7, 0x1
+ cmp r7, 0x7
+ ble _0807C1FA
+ b _0807C3F6
+ .align 2, 0
+_0807C2A4: .4byte gAdjacentTileOffsets
+_0807C2A8:
+ cmp r0, 0x50
+ beq _0807C2B0
+ cmp r0, 0x80
+ bne _0807C394
+_0807C2B0:
+ movs r3, 0x1
+ str r3, [sp, 0x18]
+ cmp r0, 0x50
+ bne _0807C2BC
+ movs r4, 0xA
+ str r4, [sp, 0x18]
+_0807C2BC:
+ movs r0, 0
+ mov r9, r0
+_0807C2C0:
+ ldr r0, _0807C37C
+ ldr r0, [r0]
+ mov r2, r9
+ lsls r1, r2, 2
+ ldr r3, _0807C380
+ adds r0, r3
+ adds r0, r1
+ ldr r4, [r0]
+ adds r0, r4, 0
+ bl EntityExists
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C370
+ cmp r6, r4
+ beq _0807C370
+ adds r1, r4, 0x4
+ adds r0, r6, 0x4
+ bl CalculateFacingDir
+ adds r5, r0, 0
+ ldr r0, _0807C384
+ adds r7, r5, r0
+ ldrb r0, [r7]
+ cmp r0, 0
+ bne _0807C370
+ adds r0, r6, 0
+ adds r1, r4, 0
+ bl CanSee
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C370
+ adds r0, r6, 0
+ adds r1, r4, 0
+ ldr r2, [sp, 0x18]
+ bl IsTargetInLineRange
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C370
+ ldr r0, [sp, 0x14]
+ str r0, [sp]
+ ldr r0, [sp, 0xC]
+ adds r1, r6, 0
+ adds r2, r4, 0
+ mov r3, r10
+ bl CanUseStatusMove
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C370
+ adds r0, r6, 0
+ adds r1, r4, 0
+ adds r2, r5, 0
+ ldr r3, [sp, 0x18]
+ bl IsTargetStraightAhead
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C370
+ movs r0, 0x1
+ strb r0, [r7]
+ ldr r0, _0807C388
+ add r0, r8
+ strb r5, [r0]
+ adds r0, r6, 0
+ mov r1, r10
+ bl GetMoveTypeForPokemon
+ adds r3, r0, 0
+ lsls r3, 24
+ lsrs r3, 24
+ adds r0, r6, 0
+ ldr r1, [sp, 0xC]
+ adds r2, r4, 0
+ bl WeightMove
+ ldr r1, _0807C38C
+ mov r3, r8
+ lsls r2, r3, 2
+ adds r1, r2, r1
+ str r0, [r1]
+ ldr r0, _0807C390
+ adds r2, r0
+ str r4, [r2]
+ movs r4, 0x1
+ add r8, r4
+_0807C370:
+ movs r0, 0x1
+ add r9, r0
+ mov r1, r9
+ cmp r1, 0x13
+ ble _0807C2C0
+ b _0807C3F6
+ .align 2, 0
+_0807C37C: .4byte gDungeonGlobalData
+_0807C380: .4byte 0x000135cc
+_0807C384: .4byte gCanAttackInDirection
+_0807C388: .4byte gUnknown_202F388
+_0807C38C: .4byte gPotentialTargetWeights_2
+_0807C390: .4byte gUnknown_202F3B0
+_0807C394:
+ cmp r0, 0x60
+ bne _0807C3DC
+ movs r5, 0
+_0807C39A:
+ ldr r0, _0807C3D4
+ ldr r0, [r0]
+ lsls r1, r5, 2
+ ldr r2, _0807C3D8
+ adds r0, r2
+ adds r0, r1
+ ldr r4, [r0]
+ adds r0, r4, 0
+ bl EntityExists
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C3CA
+ mov r3, r10
+ str r3, [sp]
+ ldr r0, [sp, 0x14]
+ str r0, [sp, 0x4]
+ mov r0, r8
+ ldr r1, [sp, 0xC]
+ adds r2, r6, 0
+ adds r3, r4, 0
+ bl WeightMoveIfUsable
+ mov r8, r0
+_0807C3CA:
+ adds r5, 0x1
+ cmp r5, 0x13
+ ble _0807C39A
+ b _0807C3F6
+ .align 2, 0
+_0807C3D4: .4byte gDungeonGlobalData
+_0807C3D8: .4byte 0x000135cc
+_0807C3DC:
+ cmp r0, 0x70
+ bne _0807C3F6
+ mov r1, r10
+ str r1, [sp]
+ ldr r2, [sp, 0x14]
+ str r2, [sp, 0x4]
+ mov r0, r8
+ ldr r1, [sp, 0xC]
+ adds r2, r6, 0
+ adds r3, r6, 0
+ bl WeightMoveIfUsable
+ mov r8, r0
+_0807C3F6:
+ mov r3, r8
+ cmp r3, 0
+ bne _0807C402
+ ldr r4, [sp, 0x8]
+ strb r3, [r4]
+ b _0807C48A
+_0807C402:
+ movs r4, 0
+ movs r3, 0
+ mov r0, r8
+ cmp r0, 0
+ ble _0807C420
+ ldr r2, _0807C464
+ mov r1, r8
+_0807C410:
+ ldr r0, [r2]
+ cmp r3, r0
+ bge _0807C418
+ adds r3, r0, 0
+_0807C418:
+ adds r2, 0x4
+ subs r1, 0x1
+ cmp r1, 0
+ bne _0807C410
+_0807C420:
+ mov r1, r8
+ cmp r1, 0
+ ble _0807C43A
+ movs r5, 0
+ ldr r2, _0807C464
+_0807C42A:
+ ldr r0, [r2]
+ cmp r3, r0
+ beq _0807C432
+ str r5, [r2]
+_0807C432:
+ adds r2, 0x4
+ subs r1, 0x1
+ cmp r1, 0
+ bne _0807C42A
+_0807C43A:
+ str r3, [sp, 0x10]
+ mov r2, r8
+ cmp r2, 0
+ ble _0807C450
+ ldr r2, _0807C464
+ mov r1, r8
+_0807C446:
+ ldm r2!, {r0}
+ adds r4, r0
+ subs r1, 0x1
+ cmp r1, 0
+ bne _0807C446
+_0807C450:
+ adds r0, r4, 0
+ bl DungeonRandomCapped
+ adds r2, r0, 0
+ movs r1, 0
+ cmp r1, r8
+ bge _0807C478
+ ldr r3, _0807C464
+ b _0807C470
+ .align 2, 0
+_0807C464: .4byte gPotentialTargetWeights_2
+_0807C468:
+ adds r3, 0x4
+ adds r1, 0x1
+ cmp r1, r8
+ bge _0807C478
+_0807C470:
+ ldr r0, [r3]
+ subs r2, r0
+ cmp r2, 0
+ bge _0807C468
+_0807C478:
+ movs r0, 0x1
+ ldr r3, [sp, 0x8]
+ strb r0, [r3]
+ ldr r0, _0807C49C
+ adds r0, r1, r0
+ ldrb r0, [r0]
+ strb r0, [r3, 0x1]
+ movs r0, 0x8
+ str r0, [r3, 0x4]
+_0807C48A:
+ ldr r0, [sp, 0x10]
+_0807C48C:
+ add sp, 0x1C
+ pop {r3-r5}
+ mov r8, r3
+ mov r9, r4
+ mov r10, r5
+ pop {r4-r7}
+ pop {r1}
+ bx r1
+ .align 2, 0
+_0807C49C: .4byte gUnknown_202F388
+ thumb_func_end FindMoveTarget
+
+ thumb_func_start IsTargetInLineRange
+IsTargetInLineRange:
+ push {r4-r7,lr}
+ adds r4, r0, 0
+ adds r5, r1, 0
+ movs r0, 0x4
+ ldrsh r1, [r4, r0]
+ movs r3, 0x4
+ ldrsh r0, [r5, r3]
+ subs r3, r1, r0
+ cmp r3, 0
+ bge _0807C4B6
+ negs r3, r3
+_0807C4B6:
+ movs r6, 0x6
+ ldrsh r1, [r4, r6]
+ movs r7, 0x6
+ ldrsh r0, [r5, r7]
+ subs r1, r0
+ cmp r1, 0
+ bge _0807C4C6
+ negs r1, r1
+_0807C4C6:
+ adds r0, r1, 0
+ cmp r1, r3
+ bge _0807C4CE
+ adds r0, r3, 0
+_0807C4CE:
+ cmp r0, 0xA
+ bgt _0807C578
+ cmp r0, r2
+ bgt _0807C578
+ movs r6, 0x1
+ negs r6, r6
+ cmp r3, r1
+ bne _0807C516
+ movs r0, 0x4
+ ldrsh r1, [r4, r0]
+ movs r2, 0x4
+ ldrsh r0, [r5, r2]
+ ldrh r2, [r4, 0x4]
+ ldrh r3, [r5, 0x4]
+ cmp r1, r0
+ bge _0807C4FE
+ movs r6, 0x6
+ ldrsh r1, [r4, r6]
+ movs r7, 0x6
+ ldrsh r0, [r5, r7]
+ cmp r1, r0
+ blt _0807C574
+ cmp r1, r0
+ bgt _0807C574
+_0807C4FE:
+ lsls r1, r2, 16
+ lsls r0, r3, 16
+ movs r6, 0x7
+ cmp r1, r0
+ ble _0807C570
+ movs r0, 0x6
+ ldrsh r1, [r4, r0]
+ movs r2, 0x6
+ ldrsh r0, [r5, r2]
+ cmp r1, r0
+ ble _0807C570
+ b _0807C574
+_0807C516:
+ movs r3, 0x4
+ ldrsh r1, [r4, r3]
+ movs r7, 0x4
+ ldrsh r0, [r5, r7]
+ ldrh r2, [r4, 0x4]
+ ldrh r3, [r5, 0x4]
+ cmp r1, r0
+ bne _0807C532
+ movs r0, 0x6
+ ldrsh r1, [r4, r0]
+ movs r7, 0x6
+ ldrsh r0, [r5, r7]
+ cmp r1, r0
+ blt _0807C574
+_0807C532:
+ lsls r1, r2, 16
+ lsls r0, r3, 16
+ cmp r1, r0
+ bge _0807C546
+ movs r0, 0x6
+ ldrsh r1, [r4, r0]
+ movs r7, 0x6
+ ldrsh r0, [r5, r7]
+ cmp r1, r0
+ beq _0807C574
+_0807C546:
+ lsls r1, r2, 16
+ lsls r0, r3, 16
+ cmp r1, r0
+ bne _0807C55A
+ movs r0, 0x6
+ ldrsh r1, [r4, r0]
+ movs r7, 0x6
+ ldrsh r0, [r5, r7]
+ cmp r1, r0
+ bgt _0807C574
+_0807C55A:
+ lsls r1, r2, 16
+ lsls r0, r3, 16
+ cmp r1, r0
+ ble _0807C570
+ movs r0, 0x6
+ ldrsh r1, [r4, r0]
+ movs r2, 0x6
+ ldrsh r0, [r5, r2]
+ cmp r1, r0
+ bne _0807C570
+ movs r6, 0x6
+_0807C570:
+ cmp r6, 0
+ blt _0807C578
+_0807C574:
+ movs r0, 0x1
+ b _0807C57A
+_0807C578:
+ movs r0, 0
+_0807C57A:
+ pop {r4-r7}
+ pop {r1}
+ bx r1
+ thumb_func_end IsTargetInLineRange
+
+ thumb_func_start WeightMoveIfUsable
+WeightMoveIfUsable:
+ push {r4-r7,lr}
+ mov r7, r10
+ mov r6, r9
+ mov r5, r8
+ push {r5-r7}
+ sub sp, 0x4
+ adds r6, r0, 0
+ adds r5, r2, 0
+ adds r7, r3, 0
+ ldr r0, [sp, 0x28]
+ lsls r1, 16
+ asrs r1, 16
+ mov r9, r1
+ lsls r0, 24
+ lsrs r0, 24
+ mov r10, r0
+ ldr r2, [r5, 0x70]
+ ldr r1, [r5, 0x4]
+ ldr r0, [r7, 0x4]
+ cmp r1, r0
+ beq _0807C5BC
+ movs r0, 0xF0
+ mov r1, r9
+ ands r0, r1
+ cmp r0, 0x30
+ beq _0807C5BC
+ cmp r0, 0x60
+ beq _0807C5BC
+ cmp r0, 0x70
+ bne _0807C5C4
+_0807C5BC:
+ adds r0, r2, 0
+ adds r0, 0x46
+ ldrb r4, [r0]
+ b _0807C5CE
+_0807C5C4:
+ adds r0, r5, 0x4
+ adds r1, r7, 0x4
+ bl CalculateFacingDir
+ adds r4, r0, 0
+_0807C5CE:
+ ldr r0, _0807C638
+ adds r0, r4
+ mov r8, r0
+ ldrb r0, [r0]
+ cmp r0, 0
+ bne _0807C624
+ mov r0, r10
+ str r0, [sp]
+ mov r0, r9
+ adds r1, r5, 0
+ adds r2, r7, 0
+ ldr r3, [sp, 0x24]
+ bl CanUseStatusMove
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C624
+ movs r0, 0x1
+ mov r1, r8
+ strb r0, [r1]
+ ldr r0, _0807C63C
+ adds r0, r6, r0
+ strb r4, [r0]
+ adds r0, r5, 0
+ ldr r1, [sp, 0x24]
+ bl GetMoveTypeForPokemon
+ adds r3, r0, 0
+ lsls r3, 24
+ lsrs r3, 24
+ adds r0, r5, 0
+ mov r1, r9
+ adds r2, r7, 0
+ bl WeightMove
+ ldr r1, _0807C640
+ lsls r2, r6, 2
+ adds r1, r2, r1
+ str r0, [r1]
+ ldr r0, _0807C644
+ adds r2, r0
+ str r7, [r2]
+ adds r6, 0x1
+_0807C624:
+ adds r0, r6, 0
+ add sp, 0x4
+ pop {r3-r5}
+ mov r8, r3
+ mov r9, r4
+ mov r10, r5
+ pop {r4-r7}
+ pop {r1}
+ bx r1
+ .align 2, 0
+_0807C638: .4byte gCanAttackInDirection
+_0807C63C: .4byte gUnknown_202F388
+_0807C640: .4byte gPotentialTargetWeights_2
+_0807C644: .4byte gUnknown_202F3B0
+ thumb_func_end WeightMoveIfUsable
+
+ thumb_func_start CanUseStatusMove
+CanUseStatusMove:
+ push {r4-r7,lr}
+ mov r7, r9
+ mov r6, r8
+ push {r6,r7}
+ adds r5, r1, 0
+ adds r4, r2, 0
+ mov r8, r3
+ ldr r1, [sp, 0x1C]
+ lsls r0, 16
+ asrs r6, r0, 16
+ lsls r1, 24
+ lsrs r1, 24
+ mov r9, r1
+ movs r7, 0
+ movs r0, 0xF
+ ands r0, r6
+ adds r1, r0, 0
+ cmp r1, 0
+ bne _0807C686
+ adds r0, r5, 0
+ adds r1, r4, 0
+ movs r2, 0
+ movs r3, 0x1
+ bl CanTarget
+ lsls r0, 24
+ lsrs r0, 24
+ cmp r0, 0x1
+ bne _0807C6E0
+ movs r7, 0x1
+ b _0807C6E4
+_0807C686:
+ cmp r1, 0x1
+ beq _0807C6BE
+ cmp r1, 0x2
+ bne _0807C692
+ ldr r1, [r4, 0x70]
+ b _0807C69C
+_0807C692:
+ cmp r1, 0x5
+ bne _0807C6B6
+ ldr r1, [r4, 0x70]
+ cmp r5, r4
+ beq _0807C6B2
+_0807C69C:
+ movs r7, 0x1
+ ldrb r0, [r1, 0x8]
+ cmp r0, 0x1
+ beq _0807C6B2
+ adds r0, r1, 0
+ adds r0, 0xA4
+ ldrb r0, [r0]
+ cmp r0, 0x4
+ beq _0807C6B2
+ cmp r0, 0x1
+ bne _0807C6E0
+_0807C6B2:
+ movs r0, 0
+ b _0807C7A0
+_0807C6B6:
+ cmp r1, 0x6
+ bne _0807C6D4
+ cmp r5, r4
+ beq _0807C6B2
+_0807C6BE:
+ adds r0, r5, 0
+ adds r1, r4, 0
+ movs r2, 0
+ movs r3, 0x1
+ bl CanTarget
+ lsls r0, 24
+ cmp r0, 0
+ bne _0807C6E0
+ movs r7, 0x1
+ b _0807C6E4
+_0807C6D4:
+ subs r0, 0x3
+ lsls r0, 16
+ lsrs r0, 16
+ cmp r0, 0x1
+ bhi _0807C6E0
+ movs r7, 0x1
+_0807C6E0:
+ cmp r7, 0
+ beq _0807C79E
+_0807C6E4:
+ mov r0, r9
+ cmp r0, 0
+ beq _0807C77C
+ adds r0, r5, 0
+ adds r1, r4, 0
+ mov r2, r8
+ bl CanUseWithStatusChecker_2
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C6B2
+ movs r1, 0xF0
+ lsls r1, 4
+ ands r1, r6
+ movs r0, 0x80
+ lsls r0, 1
+ cmp r1, r0
+ beq _0807C78A
+ movs r0, 0x80
+ lsls r0, 2
+ cmp r1, r0
+ beq _0807C76E
+ movs r0, 0xC0
+ lsls r0, 2
+ cmp r1, r0
+ bne _0807C720
+ adds r0, r4, 0
+ bl HasNegativeStatus
+ b _0807C774
+_0807C720:
+ movs r0, 0x80
+ lsls r0, 3
+ cmp r1, r0
+ bne _0807C730
+ adds r0, r4, 0
+ bl IsSleeping
+ b _0807C774
+_0807C730:
+ movs r0, 0xC0
+ lsls r0, 3
+ cmp r1, r0
+ bne _0807C75A
+ ldr r1, [r4, 0x70]
+ adds r0, r1, 0
+ adds r0, 0x5C
+ ldrb r0, [r0]
+ cmp r0, 0xE
+ beq _0807C74E
+ adds r0, r1, 0
+ adds r0, 0x5D
+ ldrb r0, [r0]
+ cmp r0, 0xE
+ bne _0807C6B2
+_0807C74E:
+ adds r0, r1, 0
+ adds r0, 0xF5
+ ldrb r0, [r0]
+ cmp r0, 0
+ beq _0807C79E
+ b _0807C6B2
+_0807C75A:
+ movs r0, 0xA0
+ lsls r0, 3
+ cmp r1, r0
+ bne _0807C79E
+ adds r0, r4, 0
+ bl HasNegativeStatus
+ lsls r0, 24
+ cmp r0, 0
+ bne _0807C79E
+_0807C76E:
+ adds r0, r4, 0
+ bl HasQuarterHPOrLess
+_0807C774:
+ lsls r0, 24
+ cmp r0, 0
+ bne _0807C79E
+ b _0807C6B2
+_0807C77C:
+ movs r0, 0xF0
+ lsls r0, 4
+ ands r0, r6
+ movs r1, 0x80
+ lsls r1, 1
+ cmp r0, r1
+ bne _0807C79E
+_0807C78A:
+ mov r0, r8
+ movs r1, 0x2
+ bl GetMoveAccuracy
+ adds r4, r0, 0
+ movs r0, 0x64
+ bl DungeonRandomCapped
+ cmp r0, r4
+ bge _0807C6B2
+_0807C79E:
+ adds r0, r7, 0
+_0807C7A0:
+ pop {r3,r4}
+ mov r8, r3
+ mov r9, r4
+ pop {r4-r7}
+ pop {r1}
+ bx r1
+ thumb_func_end CanUseStatusMove
+
+ thumb_func_start WeightMove
+WeightMove:
+ push {r4-r7,lr}
+ mov r7, r9
+ mov r6, r8
+ push {r6,r7}
+ adds r5, r0, 0
+ mov r8, r2
+ lsls r1, 16
+ asrs r1, 16
+ lsls r3, 24
+ lsrs r3, 24
+ mov r9, r3
+ movs r6, 0x1
+ ldr r4, [r2, 0x70]
+ adds r7, r4, 0
+ ldrb r0, [r4, 0x6]
+ cmp r0, 0
+ beq _0807C7D6
+ movs r0, 0xF
+ ands r0, r1
+ cmp r0, 0
+ beq _0807C7DA
+_0807C7D6:
+ movs r0, 0x1
+ b _0807C848
+_0807C7DA:
+ adds r0, r5, 0
+ movs r1, 0x9
+ bl HasIQSkill
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C804
+ ldr r0, _0807C7FC
+ ldr r0, [r0]
+ movs r2, 0x2
+ ldrsh r1, [r4, r2]
+ ldr r2, _0807C800
+ adds r0, r2
+ adds r0, r1
+ ldrb r6, [r0]
+ b _0807C846
+ .align 2, 0
+_0807C7FC: .4byte gDungeonGlobalData
+_0807C800: .4byte 0x0000363c
+_0807C804:
+ adds r0, r5, 0
+ movs r1, 0xA
+ bl HasIQSkill
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C828
+ ldrb r1, [r7, 0xE]
+ movs r2, 0xC
+ negs r2, r2
+ adds r0, r2, 0
+ subs r0, r1
+ lsls r0, 24
+ lsrs r6, r0, 24
+ cmp r6, 0
+ bne _0807C846
+ movs r6, 0x1
+ b _0807C846
+_0807C828:
+ adds r0, r5, 0
+ movs r1, 0xB
+ bl HasIQSkill
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C846
+ adds r0, r5, 0
+ mov r1, r8
+ mov r2, r9
+ bl WeightWeakTypePicker
+ adds r0, 0x1
+ lsls r0, 24
+ lsrs r6, r0, 24
+_0807C846:
+ adds r0, r6, 0
+_0807C848:
+ pop {r3,r4}
+ mov r8, r3
+ mov r9, r4
+ pop {r4-r7}
+ pop {r1}
+ bx r1
+ thumb_func_end WeightMove
+
+ thumb_func_start TargetRegularAttack
+TargetRegularAttack:
+ push {r4-r7,lr}
+ mov r7, r10
+ mov r6, r9
+ mov r5, r8
+ push {r5-r7}
+ sub sp, 0x50
+ adds r7, r0, 0
+ str r1, [sp, 0x40]
+ lsls r2, 24
+ lsrs r2, 24
+ str r2, [sp, 0x44]
+ ldr r0, [r7, 0x70]
+ movs r1, 0
+ mov r8, r1
+ adds r1, r0, 0
+ adds r1, 0x46
+ ldrb r6, [r1]
+ adds r0, 0xE8
+ ldrb r0, [r0]
+ movs r3, 0x8
+ mov r10, r3
+ cmp r0, 0x1
+ bne _0807C886
+ movs r0, 0x1
+ mov r10, r0
+_0807C886:
+ movs r4, 0
+ adds r0, r7, 0
+ movs r1, 0x9
+ bl HasIQSkill
+ lsls r0, 24
+ cmp r0, 0
+ bne _0807C8A4
+ adds r0, r7, 0
+ movs r1, 0xA
+ bl HasIQSkill
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C8A6
+_0807C8A4:
+ movs r4, 0x1
+_0807C8A6:
+ str r4, [sp, 0x48]
+ adds r0, r7, 0
+ movs r1, 0x8
+ bl HasIQSkill
+ lsls r0, 24
+ lsrs r0, 24
+ str r0, [sp, 0x4C]
+ movs r1, 0
+ mov r9, r1
+ cmp r9, r10
+ bge _0807C952
+_0807C8BE:
+ movs r0, 0x7
+ ands r6, r0
+ movs r3, 0x4
+ ldrsh r0, [r7, r3]
+ ldr r1, _0807C95C
+ lsls r2, r6, 2
+ adds r2, r1
+ movs r3, 0
+ ldrsh r1, [r2, r3]
+ adds r0, r1
+ movs r3, 0x6
+ ldrsh r1, [r7, r3]
+ movs r3, 0x2
+ ldrsh r2, [r2, r3]
+ adds r1, r2
+ bl GetMapTileAtPosition
+ ldr r5, [r0, 0x10]
+ cmp r5, 0
+ beq _0807C948
+ adds r0, r5, 0
+ bl GetEntityType
+ cmp r0, 0x1
+ bne _0807C948
+ adds r0, r7, 0
+ adds r1, r6, 0
+ bl CanAttackInFront
+ lsls r0, 24
+ cmp r0, 0
+ beq _0807C948
+ adds r0, r7, 0
+ adds r1, r5, 0
+ movs r2, 0
+ ldr r3, [sp, 0x44]
+ bl CanTarget
+ lsls r0, 24
+ lsrs r0, 24
+ cmp r0, 0x1
+ bne _0807C948
+ ldr r0, [sp, 0x4C]
+ cmp r0, 0
+ beq _0807C922
+ ldr r0, [r5, 0x70]
+ adds r0, 0xB0
+ ldrb r0, [r0]
+ cmp r0, 0x1
+ beq _0807C948
+_0807C922:
+ mov r1, r8
+ lsls r4, r1, 2
+ mov r3, sp
+ adds r0, r3, r4
+ str r6, [r0]
+ adds r0, r7, 0
+ movs r1, 0
+ adds r2, r5, 0
+ movs r3, 0
+ bl WeightMove
+ add r1, sp, 0x20
+ adds r1, r4
+ str r0, [r1]
+ ldr r0, [sp, 0x48]
+ cmp r0, 0
+ beq _0807C960
+ movs r1, 0x1
+ add r8, r1
+_0807C948:
+ movs r3, 0x1
+ add r9, r3
+ adds r6, 0x1
+ cmp r9, r10
+ blt _0807C8BE
+_0807C952:
+ mov r0, r8
+ cmp r0, 0
+ bne _0807C966
+ movs r0, 0
+ b _0807C9E8
+ .align 2, 0
+_0807C95C: .4byte gAdjacentTileOffsets
+_0807C960:
+ ldr r1, [sp, 0x40]
+ str r6, [r1]
+ b _0807C9E6
+_0807C966:
+ movs r4, 0
+ movs r3, 0
+ mov r0, r8
+ cmp r0, 0
+ ble _0807C984
+ add r1, sp, 0x20
+ mov r2, r8
+_0807C974:
+ ldr r0, [r1]
+ cmp r3, r0
+ bge _0807C97C
+ adds r3, r0, 0
+_0807C97C:
+ adds r1, 0x4
+ subs r2, 0x1
+ cmp r2, 0
+ bne _0807C974
+_0807C984:
+ mov r1, r8
+ cmp r1, 0
+ ble _0807C9A0
+ movs r5, 0
+ add r1, sp, 0x20
+ mov r2, r8
+_0807C990:
+ ldr r0, [r1]
+ cmp r3, r0
+ beq _0807C998
+ str r5, [r1]
+_0807C998:
+ adds r1, 0x4
+ subs r2, 0x1
+ cmp r2, 0
+ bne _0807C990
+_0807C9A0:
+ mov r3, r8
+ cmp r3, 0
+ ble _0807C9B4
+ add r1, sp, 0x20
+ mov r2, r8
+_0807C9AA:
+ ldm r1!, {r0}
+ adds r4, r0
+ subs r2, 0x1
+ cmp r2, 0
+ bne _0807C9AA
+_0807C9B4:
+ adds r0, r4, 0
+ bl DungeonRandomCapped
+ adds r1, r0, 0
+ movs r2, 0
+ cmp r2, r8
+ bge _0807C9DC
+ ldr r0, [sp, 0x20]
+ subs r1, r0
+ cmp r1, 0
+ blt _0807C9DC
+ add r3, sp, 0x20
+_0807C9CC:
+ adds r3, 0x4
+ adds r2, 0x1
+ cmp r2, r8
+ bge _0807C9DC
+ ldr r0, [r3]
+ subs r1, r0
+ cmp r1, 0
+ bge _0807C9CC
+_0807C9DC:
+ lsls r0, r2, 2
+ add r0, sp
+ ldr r0, [r0]
+ ldr r1, [sp, 0x40]
+ str r0, [r1]
+_0807C9E6:
+ movs r0, 0x1
+_0807C9E8:
+ add sp, 0x50
+ pop {r3-r5}
+ mov r8, r3
+ mov r9, r4
+ mov r10, r5
+ pop {r4-r7}
+ pop {r1}
+ bx r1
+ thumb_func_end TargetRegularAttack
+
+ .align 2, 0 \ No newline at end of file
diff --git a/data/data_80F4468.s b/data/data_80F4468.s
index 073680b..a4ddfba 100644
--- a/data/data_80F4468.s
+++ b/data/data_80F4468.s
@@ -145,1168 +145,3 @@ gUnknown_80F4DAE: @ 80F4DAE
gUnknown_80F4DB0: @ 80F4DB0
@ replacing .incbin "baserom.gba", 0x000f4db0, 0x2
.byte 0x28, 0x00
-
- .global gConfusedAttackChance
-gConfusedAttackChance: @ 80F4DB2
-@ replacing .incbin "baserom.gba", 0x000f4db2, 0x2
- .byte 0x46, 0x00
-
- .global gUnknown_80F4DB4
-gUnknown_80F4DB4: @ 80F4DB4
-@ replacing .incbin "baserom.gba", 0x000f4db4, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4DB6
-gUnknown_80F4DB6: @ 80F4DB6
-@ replacing .incbin "baserom.gba", 0x000f4db6, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DB8
-gUnknown_80F4DB8: @ 80F4DB8
-@ replacing .incbin "baserom.gba", 0x000f4db8, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DBA
-gUnknown_80F4DBA: @ 80F4DBA
-@ replacing .incbin "baserom.gba", 0x000f4dba, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DBC
-gUnknown_80F4DBC: @ 80F4DBC
-@ replacing .incbin "baserom.gba", 0x000f4dbc, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DBE
-gUnknown_80F4DBE: @ 80F4DBE
-@ replacing .incbin "baserom.gba", 0x000f4dbe, 0x2
- .byte 0x12, 0x00
-
- .global gUnknown_80F4DC0
-gUnknown_80F4DC0: @ 80F4DC0
-@ replacing .incbin "baserom.gba", 0x000f4dc0, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DC2
-gUnknown_80F4DC2: @ 80F4DC2
-@ replacing .incbin "baserom.gba", 0x000f4dc2, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4DC4
-gUnknown_80F4DC4: @ 80F4DC4
-@ replacing .incbin "baserom.gba", 0x000f4dc4, 0x2
- .byte 0x28, 0x00
-
- .global gUnknown_80F4DC6
-gUnknown_80F4DC6: @ 80F4DC6
-@ replacing .incbin "baserom.gba", 0x000f4dc6, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DC8
-gUnknown_80F4DC8: @ 80F4DC8
-@ replacing .incbin "baserom.gba", 0x000f4dc8, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4DCA
-gUnknown_80F4DCA: @ 80F4DCA
-@ replacing .incbin "baserom.gba", 0x000f4dca, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4DCC
-gUnknown_80F4DCC: @ 80F4DCC
-@ replacing .incbin "baserom.gba", 0x000f4dcc, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4DCE
-gUnknown_80F4DCE: @ 80F4DCE
-@ replacing .incbin "baserom.gba", 0x000f4dce, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DD0
-gUnknown_80F4DD0: @ 80F4DD0
-@ replacing .incbin "baserom.gba", 0x000f4dd0, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4DD2
-gUnknown_80F4DD2: @ 80F4DD2
-@ replacing .incbin "baserom.gba", 0x000f4dd2, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DD4
-gUnknown_80F4DD4: @ 80F4DD4
-@ replacing .incbin "baserom.gba", 0x000f4dd4, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DD6
-gUnknown_80F4DD6: @ 80F4DD6
-@ replacing .incbin "baserom.gba", 0x000f4dd6, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DD8
-gUnknown_80F4DD8: @ 80F4DD8
-@ replacing .incbin "baserom.gba", 0x000f4dd8, 0x2
- .byte 0x32, 0x00
-
- .global gUnknown_80F4DDA
-gUnknown_80F4DDA: @ 80F4DDA
-@ replacing .incbin "baserom.gba", 0x000f4dda, 0x2
- .byte 0x32, 0x00
-
- .global gUnknown_80F4DDC
-gUnknown_80F4DDC: @ 80F4DDC
-@ replacing .incbin "baserom.gba", 0x000f4ddc, 0x4
- .byte 0x32, 0x00
- .byte 0x32, 0x00
-
- .global gUnknown_80F4DE0
-gUnknown_80F4DE0: @ 80F4DE0
-@ replacing .incbin "baserom.gba", 0x000f4de0, 0x2
- .byte 0x32, 0x00
-
- .global gUnknown_80F4DE2
-gUnknown_80F4DE2: @ 80F4DE2
-@ replacing .incbin "baserom.gba", 0x000f4de2, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DE4
-gUnknown_80F4DE4: @ 80F4DE4
-@ replacing .incbin "baserom.gba", 0x000f4de4, 0x2
- .byte 0x0f, 0x00
-
- .global gUnknown_80F4DE6
-gUnknown_80F4DE6: @ 80F4DE6
-@ replacing .incbin "baserom.gba", 0x000f4de6, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4DE8
-gUnknown_80F4DE8: @ 80F4DE8
-@ replacing .incbin "baserom.gba", 0x000f4de8, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DEA
-gUnknown_80F4DEA: @ 80F4DEA
-@ replacing .incbin "baserom.gba", 0x000f4dea, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DEC
-gUnknown_80F4DEC: @ 80F4DEC
-@ replacing .incbin "baserom.gba", 0x000f4dec, 0x2
- .byte 0x0f, 0x00
-
- .global gUnknown_80F4DEE
-gUnknown_80F4DEE: @ 80F4DEE
-@ replacing .incbin "baserom.gba", 0x000f4dee, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4DF0
-gUnknown_80F4DF0: @ 80F4DF0
-@ replacing .incbin "baserom.gba", 0x000f4df0, 0x2
- .byte 0x19, 0x00
-
- .global gUnknown_80F4DF2
-gUnknown_80F4DF2: @ 80F4DF2
-@ replacing .incbin "baserom.gba", 0x000f4df2, 0x2
- .byte 0x23, 0x00
-
- .global gUnknown_80F4DF4
-gUnknown_80F4DF4: @ 80F4DF4
-@ replacing .incbin "baserom.gba", 0x000f4df4, 0x2
- .byte 0x19, 0x00
-
- .global gUnknown_80F4DF6
-gUnknown_80F4DF6: @ 80F4DF6
-@ replacing .incbin "baserom.gba", 0x000f4df6, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4DF8
-gUnknown_80F4DF8: @ 80F4DF8
-@ replacing .incbin "baserom.gba", 0x000f4df8, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4DFA
-gUnknown_80F4DFA: @ 80F4DFA
-@ replacing .incbin "baserom.gba", 0x000f4dfa, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4DFC
-gUnknown_80F4DFC: @ 80F4DFC
-@ replacing .incbin "baserom.gba", 0x000f4dfc, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4DFE
-gUnknown_80F4DFE: @ 80F4DFE
-@ replacing .incbin "baserom.gba", 0x000f4dfe, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4E00
-gUnknown_80F4E00: @ 80F4E00
-@ replacing .incbin "baserom.gba", 0x000f4e00, 0x2
- .byte 0x28, 0x00
-
- .global gUnknown_80F4E02
-gUnknown_80F4E02: @ 80F4E02
-@ replacing .incbin "baserom.gba", 0x000f4e02, 0x2
- .byte 0x3c, 0x00
-
- .global gUnknown_80F4E04
-gUnknown_80F4E04: @ 80F4E04
-@ replacing .incbin "baserom.gba", 0x000f4e04, 0x2
- .byte 0x3c, 0x00
-
- .global gUnknown_80F4E06
-gUnknown_80F4E06: @ 80F4E06
-@ replacing .incbin "baserom.gba", 0x000f4e06, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4E08
-gUnknown_80F4E08: @ 80F4E08
-@ replacing .incbin "baserom.gba", 0x000f4e08, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4E0A
-gUnknown_80F4E0A: @ 80F4E0A
-@ replacing .incbin "baserom.gba", 0x000f4e0a, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4E0C
-gUnknown_80F4E0C: @ 80F4E0C
-@ replacing .incbin "baserom.gba", 0x000f4e0c, 0x2
- .byte 0x32, 0x00
-
- .global gUnknown_80F4E0E
-gUnknown_80F4E0E: @ 80F4E0E
-@ replacing .incbin "baserom.gba", 0x000f4e0e, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4E10
-gUnknown_80F4E10: @ 80F4E10
-@ replacing .incbin "baserom.gba", 0x000f4e10, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E12
-gUnknown_80F4E12: @ 80F4E12
-@ replacing .incbin "baserom.gba", 0x000f4e12, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E14
-gUnknown_80F4E14: @ 80F4E14
-@ replacing .incbin "baserom.gba", 0x000f4e14, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E16
-gUnknown_80F4E16: @ 80F4E16
-@ replacing .incbin "baserom.gba", 0x000f4e16, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E18
-gUnknown_80F4E18: @ 80F4E18
-@ replacing .incbin "baserom.gba", 0x000f4e18, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E1A
-gUnknown_80F4E1A: @ 80F4E1A
-@ replacing .incbin "baserom.gba", 0x000f4e1a, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E1C
-gUnknown_80F4E1C: @ 80F4E1C
-@ replacing .incbin "baserom.gba", 0x000f4e1c, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E1E
-gUnknown_80F4E1E: @ 80F4E1E
-@ replacing .incbin "baserom.gba", 0x000f4e1e, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E20
-gUnknown_80F4E20: @ 80F4E20
-@ replacing .incbin "baserom.gba", 0x000f4e20, 0x2
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E22
-gUnknown_80F4E22: @ 80F4E22
-@ replacing .incbin "baserom.gba", 0x000f4e22, 0xa
- .byte 0x64, 0x00
- .byte 0x14, 0x00
- .byte 0x1e, 0x00
- .byte 0x28, 0x00
- .byte 0x32, 0x00
-
- .global gUnknown_80F4E2C
-gUnknown_80F4E2C: @ 80F4E2C
-@ replacing .incbin "baserom.gba", 0x000f4e2c, 0x4
- .byte 0x03, 0x00
- .byte 0x05, 0x00
-
- .global gUnknown_80F4E30
-gUnknown_80F4E30: @ 80F4E30
-@ replacing .incbin "baserom.gba", 0x000f4e30, 0x4
- .byte 0x7f, 0x00
- .byte 0x7f, 0x00
-
- .global gUnknown_80F4E34
-gUnknown_80F4E34: @ 80F4E34
-@ replacing .incbin "baserom.gba", 0x000f4e34, 0x4
- .byte 0x7f, 0x00
- .byte 0x7f, 0x00
-
- .global gUnknown_80F4E38
-gUnknown_80F4E38: @ 80F4E38
-@ replacing .incbin "baserom.gba", 0x000f4e38, 0x4
- .byte 0x7f, 0x00
- .byte 0x7f, 0x00
-
- .global gUnknown_80F4E3C
-gUnknown_80F4E3C: @ 80F4E3C
-@ replacing .incbin "baserom.gba", 0x000f4e3c, 0x4
- .byte 0x01, 0x00
- .byte 0x01, 0x00
-
- .global gUnknown_80F4E40
-gUnknown_80F4E40: @ 80F4E40
-@ replacing .incbin "baserom.gba", 0x000f4e40, 0x8
- .byte 0x08, 0x00
- .byte 0x0a, 0x00
- .byte 0x03, 0x00
- .byte 0x04, 0x00
-
- .global gUnknown_80F4E48
-gUnknown_80F4E48: @ 80F4E48
-@ replacing .incbin "baserom.gba", 0x000f4e48, 0x4
- .byte 0x06, 0x00
- .byte 0x08, 0x00
-
- .global gUnknown_80F4E4C
-gUnknown_80F4E4C: @ 80F4E4C
-@ replacing .incbin "baserom.gba", 0x000f4e4c, 0x4
- .byte 0x06, 0x00
- .byte 0x0c, 0x00
-
- .global gUnknown_80F4E50
-gUnknown_80F4E50: @ 80F4E50
-@ replacing .incbin "baserom.gba", 0x000f4e50, 0x4
- .byte 0x01, 0x00
- .byte 0x02, 0x00
-
- .global gUnknown_80F4E54
-gUnknown_80F4E54: @ 80F4E54
-@ replacing .incbin "baserom.gba", 0x000f4e54, 0x4
- .byte 0x02, 0x00
- .byte 0x05, 0x00
-
- .global gUnknown_80F4E58
-gUnknown_80F4E58: @ 80F4E58
-@ replacing .incbin "baserom.gba", 0x000f4e58, 0x4
- .byte 0x03, 0x00
- .byte 0x06, 0x00
-
- .global gUnknown_80F4E5C
-gUnknown_80F4E5C: @ 80F4E5C
-@ replacing .incbin "baserom.gba", 0x000f4e5c, 0x4
- .byte 0x02, 0x00
- .byte 0x05, 0x00
-
- .global gUnknown_80F4E60
-gUnknown_80F4E60: @ 80F4E60
-@ replacing .incbin "baserom.gba", 0x000f4e60, 0x10
- .byte 0x0f, 0x00
- .byte 0x1e, 0x00
- .byte 0x02, 0x00
- .byte 0x03, 0x00
- .byte 0x02, 0x00
- .byte 0x06, 0x00
- .byte 0x0a, 0x00
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4E70
-gUnknown_80F4E70: @ 80F4E70
-@ replacing .incbin "baserom.gba", 0x000f4e70, 0x4
- .byte 0x01, 0x00
- .byte 0x01, 0x00
-
- .global gUnknown_80F4E74
-gUnknown_80F4E74: @ 80F4E74
-@ replacing .incbin "baserom.gba", 0x000f4e74, 0x4
- .byte 0x03, 0x00
- .byte 0x07, 0x00
-
- .global gUnknown_80F4E78
-gUnknown_80F4E78: @ 80F4E78
-@ replacing .incbin "baserom.gba", 0x000f4e78, 0x4
-.byte 0x04, 0x00
-.byte 0x08, 0x00
-
- .global gUnknown_80F4E7C
-gUnknown_80F4E7C: @ 80F4E7C
-@ replacing .incbin "baserom.gba", 0x000f4e7c, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4E80
-gUnknown_80F4E80: @ 80F4E80
-@ replacing .incbin "baserom.gba", 0x000f4e80, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4E84
-gUnknown_80F4E84: @ 80F4E84
-@ replacing .incbin "baserom.gba", 0x000f4e84, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4E88
-gUnknown_80F4E88: @ 80F4E88
-@ replacing .incbin "baserom.gba", 0x000f4e88, 0x4
-.byte 0x0f, 0x00
-.byte 0x14, 0x00
-
- .global gUnknown_80F4E8C
-gUnknown_80F4E8C: @ 80F4E8C
-@ replacing .incbin "baserom.gba", 0x000f4e8c, 0x4
-.byte 0x0a, 0x00
-.byte 0x0e, 0x00
-
- .global gUnknown_80F4E90
-gUnknown_80F4E90: @ 80F4E90
-@ replacing .incbin "baserom.gba", 0x000f4e90, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4E94
-gUnknown_80F4E94: @ 80F4E94
-@ replacing .incbin "baserom.gba", 0x000f4e94, 0x4
-.byte 0x02, 0x00
-.byte 0x04, 0x00
-
- .global gUnknown_80F4E98
-gUnknown_80F4E98: @ 80F4E98
-@ replacing .incbin "baserom.gba", 0x000f4e98, 0x4
-.byte 0x06, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4E9C
-gUnknown_80F4E9C: @ 80F4E9C
-@ replacing .incbin "baserom.gba", 0x000f4e9c, 0x4
-.byte 0x03, 0x00
-.byte 0x05, 0x00
-
- .global gUnknown_80F4EA0
-gUnknown_80F4EA0: @ 80F4EA0
-@ replacing .incbin "baserom.gba", 0x000f4ea0, 0x4
-.byte 0x04, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4EA4
-gUnknown_80F4EA4: @ 80F4EA4
-@ replacing .incbin "baserom.gba", 0x000f4ea4, 0x4
-.byte 0x03, 0x00
-.byte 0x05, 0x00
-
- .global gUnknown_80F4EA8
-gUnknown_80F4EA8: @ 80F4EA8
-@ replacing .incbin "baserom.gba", 0x000f4ea8, 0x4
-.byte 0x03, 0x00
-.byte 0x05, 0x00
-
- .global gUnknown_80F4EAC
-gUnknown_80F4EAC: @ 80F4EAC
-@ replacing .incbin "baserom.gba", 0x000f4eac, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EB0
-gUnknown_80F4EB0: @ 80F4EB0
-@ replacing .incbin "baserom.gba", 0x000f4eb0, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EB4
-gUnknown_80F4EB4: @ 80F4EB4
-@ replacing .incbin "baserom.gba", 0x000f4eb4, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EB8
-gUnknown_80F4EB8: @ 80F4EB8
-@ replacing .incbin "baserom.gba", 0x000f4eb8, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EBC
-gUnknown_80F4EBC: @ 80F4EBC
-@ replacing .incbin "baserom.gba", 0x000f4ebc, 0x4
-.byte 0x14, 0x00
-.byte 0x1e, 0x00
-
- .global gUnknown_80F4EC0
-gUnknown_80F4EC0: @ 80F4EC0
-@ replacing .incbin "baserom.gba", 0x000f4ec0, 0x4
-.byte 0x7f, 0x00
-.byte 0x7f, 0x00
-
- .global gUnknown_80F4EC4
-gUnknown_80F4EC4: @ 80F4EC4
-@ replacing .incbin "baserom.gba", 0x000f4ec4, 0x4
-.byte 0x02, 0x00
-.byte 0x04, 0x00
-
- .global gUnknown_80F4EC8
-gUnknown_80F4EC8: @ 80F4EC8
-@ replacing .incbin "baserom.gba", 0x000f4ec8, 0x4
-.byte 0x02, 0x00
-.byte 0x04, 0x00
-
- .global gUnknown_80F4ECC
-gUnknown_80F4ECC: @ 80F4ECC
-@ replacing .incbin "baserom.gba", 0x000f4ecc, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4ED0
-gUnknown_80F4ED0: @ 80F4ED0
-@ replacing .incbin "baserom.gba", 0x000f4ed0, 0x4
-.byte 0x14, 0x00
-.byte 0x32, 0x00
-
- .global gUnknown_80F4ED4
-gUnknown_80F4ED4: @ 80F4ED4
-@ replacing .incbin "baserom.gba", 0x000f4ed4, 0x4
-.byte 0x02, 0x00
-.byte 0x06, 0x00
-
- .global gUnknown_80F4ED8
-gUnknown_80F4ED8: @ 80F4ED8
-@ replacing .incbin "baserom.gba", 0x000f4ed8, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EDC
-gUnknown_80F4EDC: @ 80F4EDC
-@ replacing .incbin "baserom.gba", 0x000f4edc, 0x4
-.byte 0x01, 0x00
-.byte 0x06, 0x00
-
- .global gUnknown_80F4EE0
-gUnknown_80F4EE0: @ 80F4EE0
-@ replacing .incbin "baserom.gba", 0x000f4ee0, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EE4
-gUnknown_80F4EE4: @ 80F4EE4
-@ replacing .incbin "baserom.gba", 0x000f4ee4, 0x4
-.byte 0x0a, 0x00
-.byte 0x14, 0x00
-
- .global gUnknown_80F4EE8
-gUnknown_80F4EE8: @ 80F4EE8
-@ replacing .incbin "baserom.gba", 0x000f4ee8, 0x4
-.byte 0x0a, 0x00
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4EEC
-gUnknown_80F4EEC: @ 80F4EEC
-@ replacing .incbin "baserom.gba", 0x000f4eec, 0x4
-.byte 0x03, 0x00
-.byte 0x03, 0x00
-
- .global gUnknown_80F4EF0
-gUnknown_80F4EF0: @ 80F4EF0
-@ replacing .incbin "baserom.gba", 0x000f4ef0, 0x4
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4EF4
-gUnknown_80F4EF4: @ 80F4EF4
-@ replacing .incbin "baserom.gba", 0x000f4ef4, 0x4
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4EF8
-gUnknown_80F4EF8: @ 80F4EF8
-@ replacing .incbin "baserom.gba", 0x000f4ef8, 0x4
-.byte 0x03, 0x00
-.byte 0x05, 0x00
-
- .global gUnknown_80F4EFC
-gUnknown_80F4EFC: @ 80F4EFC
-@ replacing .incbin "baserom.gba", 0x000f4efc, 0x4
-.byte 0x7f, 0x00
-.byte 0x7f, 0x00
-
- .global gUnknown_80F4F00
-gUnknown_80F4F00: @ 80F4F00
-@ replacing .incbin "baserom.gba", 0x000f4f00, 0x4
-.byte 0x04, 0x00
-.byte 0x06, 0x00
-
- .global gUnknown_80F4F04
-gUnknown_80F4F04: @ 80F4F04
-@ replacing .incbin "baserom.gba", 0x000f4f04, 0x4
-.byte 0x7f, 0x00
-.byte 0x7f, 0x00
-
- .global gUnknown_80F4F08
-gUnknown_80F4F08: @ 80F4F08
-@ replacing .incbin "baserom.gba", 0x000f4f08, 0x4
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F0C
-gUnknown_80F4F0C: @ 80F4F0C
-@ replacing .incbin "baserom.gba", 0x000f4f0c, 0x4
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F10
-gUnknown_80F4F10: @ 80F4F10
-@ replacing .incbin "baserom.gba", 0x000f4f10, 0x8
-.byte 0x7f, 0x00
-.byte 0x7f, 0x00
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F18
-gUnknown_80F4F18: @ 80F4F18
-@ replacing .incbin "baserom.gba", 0x000f4f18, 0x4
-.byte 0x02, 0x00
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F1C
-gUnknown_80F4F1C: @ 80F4F1C
-@ replacing .incbin "baserom.gba", 0x000f4f1c, 0x4
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F20
-gUnknown_80F4F20: @ 80F4F20
-@ replacing .incbin "baserom.gba", 0x000f4f20, 0x4
-.byte 0x0a, 0x00
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F24
-gUnknown_80F4F24: @ 80F4F24
-@ replacing .incbin "baserom.gba", 0x000f4f24, 0x4
-.byte 0x0f, 0x00
-.byte 0x14, 0x00
-
- .global gUnknown_80F4F28
-gUnknown_80F4F28: @ 80F4F28
-@ replacing .incbin "baserom.gba", 0x000f4f28, 0x4
-.byte 0x02, 0x00
-.byte 0x02, 0x00
-
- .global gUnknown_80F4F2C
-gUnknown_80F4F2C: @ 80F4F2C
-@ replacing .incbin "baserom.gba", 0x000f4f2c, 0x4
-.byte 0x04, 0x00
-.byte 0x08, 0x00
-
- .global gUnknown_80F4F30
-gUnknown_80F4F30: @ 80F4F30
-@ replacing .incbin "baserom.gba", 0x000f4f30, 0x2
-.byte 0xfa, 0x00
-
- .global gUnknown_80F4F32
-gUnknown_80F4F32: @ 80F4F32
-@ replacing .incbin "baserom.gba", 0x000f4f32, 0x2
-.byte 0x14, 0x00
-
- .global gUnknown_80F4F34
-gUnknown_80F4F34: @ 80F4F34
-@ replacing .incbin "baserom.gba", 0x000f4f34, 0x2
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F36
-gUnknown_80F4F36: @ 80F4F36
-@ replacing .incbin "baserom.gba", 0x000f4f36, 0x2
-.byte 0x02, 0x00
-
- .global gUnknown_80F4F38
-gUnknown_80F4F38: @ 80F4F38
-@ replacing .incbin "baserom.gba", 0x000f4f38, 0x2
-.byte 0x02, 0x00
-
- .global gUnknown_80F4F3A
-gUnknown_80F4F3A: @ 80F4F3A
-@ replacing .incbin "baserom.gba", 0x000f4f3a, 0x2
-.byte 0x02, 0x00
-
- .global gUnknown_80F4F3C
-gUnknown_80F4F3C: @ 80F4F3C
-@ replacing .incbin "baserom.gba", 0x000f4f3c, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F3E
-gUnknown_80F4F3E: @ 80F4F3E
-@ replacing .incbin "baserom.gba", 0x000f4f3e, 0x2
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F40
-gUnknown_80F4F40: @ 80F4F40
-@ replacing .incbin "baserom.gba", 0x000f4f40, 0x2
-.byte 0x02, 0x00
-
- .global gUnknown_80F4F42
-gUnknown_80F4F42: @ 80F4F42
-@ replacing .incbin "baserom.gba", 0x000f4f42, 0x4
-.byte 0x14, 0x00
-.byte 0x5f, 0x00
-
- .global gUnknown_80F4F46
-gUnknown_80F4F46: @ 80F4F46
-@ replacing .incbin "baserom.gba", 0x000f4f46, 0x2
-.byte 0x0c, 0x00
-
- .global gUnknown_80F4F48
-gUnknown_80F4F48: @ 80F4F48
-@ replacing .incbin "baserom.gba", 0x000f4f48, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F4C
-gUnknown_80F4F4C: @ 80F4F4C
-@ replacing .incbin "baserom.gba", 0x000f4f4c, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F50
-gUnknown_80F4F50: @ 80F4F50
-@ replacing .incbin "baserom.gba", 0x000f4f50, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F54
-gUnknown_80F4F54: @ 80F4F54
-@ replacing .incbin "baserom.gba", 0x000f4f54, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F58
-gUnknown_80F4F58: @ 80F4F58
-@ replacing .incbin "baserom.gba", 0x000f4f58, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F5C
-gUnknown_80F4F5C: @ 80F4F5C
-@ replacing .incbin "baserom.gba", 0x000f4f5c, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F60
-gUnknown_80F4F60: @ 80F4F60
-@ replacing .incbin "baserom.gba", 0x000f4f60, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F64
-gUnknown_80F4F64: @ 80F4F64
-@ replacing .incbin "baserom.gba", 0x000f4f64, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F68
-gUnknown_80F4F68: @ 80F4F68
-@ replacing .incbin "baserom.gba", 0x000f4f68, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F6C
-gUnknown_80F4F6C: @ 80F4F6C
-@ replacing .incbin "baserom.gba", 0x000f4f6c, 0x4
-.byte 0x00, 0x02
-.byte 0x00, 0x00
-
- .global gUnknown_80F4F70
-gUnknown_80F4F70: @ 80F4F70
-@ replacing .incbin "baserom.gba", 0x000f4f70, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F72
-gUnknown_80F4F72: @ 80F4F72
-@ replacing .incbin "baserom.gba", 0x000f4f72, 0x2
-.byte 0x04, 0x00
-
- .global gUnknown_80F4F74
-gUnknown_80F4F74: @ 80F4F74
-@ replacing .incbin "baserom.gba", 0x000f4f74, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F76
-gUnknown_80F4F76: @ 80F4F76
-@ replacing .incbin "baserom.gba", 0x000f4f76, 0x2
-.byte 0x06, 0x00
-
- .global gUnknown_80F4F78
-gUnknown_80F4F78: @ 80F4F78
-@ replacing .incbin "baserom.gba", 0x000f4f78, 0x2
-.byte 0x08, 0x00
-
- .global gUnknown_80F4F7A
-gUnknown_80F4F7A: @ 80F4F7A
-@ replacing .incbin "baserom.gba", 0x000f4f7a, 0x2
-.byte 0xe7, 0x03
-
- .global gUnknown_80F4F7C
-gUnknown_80F4F7C: @ 80F4F7C
-@ replacing .incbin "baserom.gba", 0x000f4f7c, 0x2
-.byte 0x37, 0x00
-
- .global gUnknown_80F4F7E
-gUnknown_80F4F7E: @ 80F4F7E
-@ replacing .incbin "baserom.gba", 0x000f4f7e, 0x2
-.byte 0x41, 0x00
-
- .global gUnknown_80F4F80
-gUnknown_80F4F80: @ 80F4F80
-@ replacing .incbin "baserom.gba", 0x000f4f80, 0x2
-.byte 0x23, 0x00
-
- .global gUnknown_80F4F82
-gUnknown_80F4F82: @ 80F4F82
-@ replacing .incbin "baserom.gba", 0x000f4f82, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F84
-gUnknown_80F4F84: @ 80F4F84
-@ replacing .incbin "baserom.gba", 0x000f4f84, 0x2
-.byte 0x14, 0x00
-
- .global gUnknown_80F4F86
-gUnknown_80F4F86: @ 80F4F86
-@ replacing .incbin "baserom.gba", 0x000f4f86, 0x4
-.byte 0x0a, 0x00
-.byte 0x0f, 0x00
-
- .global gUnknown_80F4F8A
-gUnknown_80F4F8A: @ 80F4F8A
-@ replacing .incbin "baserom.gba", 0x000f4f8a, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F8C
-gUnknown_80F4F8C: @ 80F4F8C
-@ replacing .incbin "baserom.gba", 0x000f4f8c, 0x2
-.byte 0x23, 0x00
-
- .global gUnknown_80F4F8E
-gUnknown_80F4F8E: @ 80F4F8E
-@ replacing .incbin "baserom.gba", 0x000f4f8e, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F90
-gUnknown_80F4F90: @ 80F4F90
-@ replacing .incbin "baserom.gba", 0x000f4f90, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F4F92
-gUnknown_80F4F92: @ 80F4F92
-@ replacing .incbin "baserom.gba", 0x000f4f92, 0x2
-.byte 0x0a, 0x00
-
- .global gUnknown_80F4F94
-gUnknown_80F4F94: @ 80F4F94
-@ replacing .incbin "baserom.gba", 0x000f4f94, 0xe
- .byte 0x05, 0x00
- .byte 0x0a, 0x00
- .byte 0x0f, 0x00
- .byte 0x19, 0x00
- .byte 0x1e, 0x00
- .byte 0x23, 0x00
- .byte 0x28, 0x00
-
- .global gUnknown_80F4FA2
-gUnknown_80F4FA2: @ 80F4FA2
-@ replacing .incbin "baserom.gba", 0x000f4fa2, 0x2
-.byte 0x5a, 0x00
-
- .global gUnknown_80F4FA4
-gUnknown_80F4FA4: @ 80F4FA4
-@ replacing .incbin "baserom.gba", 0x000f4fa4, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F4FA6
-gUnknown_80F4FA6: @ 80F4FA6
-@ replacing .incbin "baserom.gba", 0x000f4fa6, 0x2
- .byte 0x2d, 0x00
-
- .global gUnknown_80F4FA8
-gUnknown_80F4FA8: @ 80F4FA8
-@ replacing .incbin "baserom.gba", 0x000f4fa8, 0x2
- .byte 0x0f, 0x00
-
- .global gUnknown_80F4FAA
-gUnknown_80F4FAA: @ 80F4FAA
-@ replacing .incbin "baserom.gba", 0x000f4faa, 0x2
- .byte 0x1e, 0x00
-
- .global gUnknown_80F4FAC
-gUnknown_80F4FAC: @ 80F4FAC
-@ replacing .incbin "baserom.gba", 0x000f4fac, 0x2
- .byte 0x01, 0x00
-
- .global gUnknown_80F4FAE
-gUnknown_80F4FAE: @ 80F4FAE
-@ replacing .incbin "baserom.gba", 0x000f4fae, 0x4
- .byte 0x02, 0x00
- .byte 0x19, 0x00
-
- .global gUnknown_80F4FB2
-gUnknown_80F4FB2: @ 80F4FB2
-@ replacing .incbin "baserom.gba", 0x000f4fb2, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4FB4
-gUnknown_80F4FB4: @ 80F4FB4
-@ replacing .incbin "baserom.gba", 0x000f4fb4, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4FB6
-gUnknown_80F4FB6: @ 80F4FB6
-@ replacing .incbin "baserom.gba", 0x000f4fb6, 0x2
- .byte 0x64, 0x00
-
- .global gUnknown_80F4FB8
-gUnknown_80F4FB8: @ 80F4FB8
-@ replacing .incbin "baserom.gba", 0x000f4fb8, 0x2
- .byte 0x00, 0x00
-
- .global gUnknown_80F4FBA
-gUnknown_80F4FBA: @ 80F4FBA
-@ replacing .incbin "baserom.gba", 0x000f4fba, 0x2
- .byte 0x64, 0x00
-
- .global gUnknown_80F4FBC
-gUnknown_80F4FBC: @ 80F4FBC
-@ replacing .incbin "baserom.gba", 0x000f4fbc, 0x2
- .byte 0x02, 0x00
-
- .global gUnknown_80F4FBE
-gUnknown_80F4FBE: @ 80F4FBE
-@ replacing .incbin "baserom.gba", 0x000f4fbe, 0x2
- .byte 0x03, 0x00
-
- .global gUnknown_80F4FC0
-gUnknown_80F4FC0: @ 80F4FC0
-@ replacing .incbin "baserom.gba", 0x000f4fc0, 0x2
- .byte 0x24, 0xff
-
- .global gUnknown_80F4FC2
-gUnknown_80F4FC2: @ 80F4FC2
-@ replacing .incbin "baserom.gba", 0x000f4fc2, 0x2
- .byte 0x6a, 0xff
-
- .global gUnknown_80F4FC4
-gUnknown_80F4FC4: @ 80F4FC4
-@ replacing .incbin "baserom.gba", 0x000f4fc4, 0x2
- .byte 0x9c, 0xff
-
- .global gUnknown_80F4FC6
-gUnknown_80F4FC6: @ 80F4FC6
-@ replacing .incbin "baserom.gba", 0x000f4fc6, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F4FC8
-gUnknown_80F4FC8: @ 80F4FC8
- .incbin "baserom.gba", 0xF4FC8, 0x3C
-
- .global gUnknown_80F5004
-gUnknown_80F5004: @ 80F5004
-@ replacing .incbin "baserom.gba", 0x000f5004, 0x2
-.byte 0x03, 0x00
-
- .global gUnknown_80F5006
-gUnknown_80F5006: @ 80F5006
-@ replacing .incbin "baserom.gba", 0x000f5006, 0x2
-.byte 0x02, 0x00
-
- .global gUnknown_80F5008
-gUnknown_80F5008: @ 80F5008
-@ replacing .incbin "baserom.gba", 0x000f5008, 0x2
-.byte 0x64, 0x00
-
- .global gUnknown_80F500A
-gUnknown_80F500A: @ 80F500A
-@ replacing .incbin "baserom.gba", 0x000f500a, 0x10
-.byte 0x32, 0x00, 0x50, 0x00, 0x1e, 0x00, 0x28, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00
-
- .global gUnknown_80F501A
-gUnknown_80F501A: @ 80F501A
-@ replacing .incbin "baserom.gba", 0x000f501a, 0x10
-.byte 0x32, 0x00, 0x50, 0x00, 0x1e, 0x00, 0x28, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00
-
- .global gUnknown_80F502A
-gUnknown_80F502A: @ 80F502A
-@ replacing .incbin "baserom.gba", 0x000f502a, 0x10
-.byte 0x32, 0x00, 0x50, 0x00, 0x1e, 0x00, 0x28, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00
-
- .global gUnknown_80F503A
-gUnknown_80F503A: @ 80F503A
-@ replacing .incbin "baserom.gba", 0x000f503a, 0x2
-.byte 0x01, 0x00
-
- .global gUnknown_80F503C
-gUnknown_80F503C: @ 80F503C
-@ replacing .incbin "baserom.gba", 0x000f503c, 0x2
-.byte 0x05, 0x00
-
- .global gUnknown_80F503E
-gUnknown_80F503E: @ 80F503E
-@ replacing .incbin "baserom.gba", 0x000f503e, 0x2
-.byte 0x06, 0x00
-
- .global gUnknown_80F5040
-gUnknown_80F5040: @ 80F5040
-@ replacing .incbin "baserom.gba", 0x000f5040, 0x2
-.byte 0x07, 0x00
-
- .global gUnknown_80F5042
-gUnknown_80F5042: @ 80F5042
-@ replacing .incbin "baserom.gba", 0x000f5042, 0x2
-.byte 0x08, 0x00
-
- .global gUnknown_80F5044
-gUnknown_80F5044: @ 80F5044
-@ replacing .incbin "baserom.gba", 0x000f5044, 0x2
-.byte 0x09, 0x00
-
- .global gUnknown_80F5046
-gUnknown_80F5046: @ 80F5046
-@ replacing .incbin "baserom.gba", 0x000f5046, 0x2
-.byte 0x14, 0x00
-
- .global gUnknown_80F5048
-gUnknown_80F5048: @ 80F5048
-@ replacing .incbin "baserom.gba", 0x000f5048, 0x4
-.byte 0x0f, 0x00, 0x00, 0x00
-
- .global gUnknown_80F504C
-gUnknown_80F504C: @ 80F504C
- .incbin "baserom.gba", 0xF504C, 0x54
-
- .global gUnknown_80F50A0
-gUnknown_80F50A0: @ 80F50A0
- .incbin "baserom.gba", 0xF50A0, 0x54
-
- .global gUnknown_80F50F4
-gUnknown_80F50F4: @ 80F50F4
- .incbin "baserom.gba", 0xF50F4, 0xA8
-
- .global gUnknown_80F519C
-gUnknown_80F519C: @ 80F519C
-@ replacing .incbin "baserom.gba", 0x000f519c, 0x4
-.byte 0x1e, 0x00, 0x00, 0x00
-
- .global gUnknown_80F51A0
-gUnknown_80F51A0: @ 80F51A0
-@ replacing .incbin "baserom.gba", 0x000f51a0, 0x4
-.byte 0x1e, 0x00, 0x00, 0x00
-
- .global gUnknown_80F51A4
-gUnknown_80F51A4: @ 80F51A4
-@ replacing .incbin "baserom.gba", 0x000f51a4, 0x10
-.byte 0x00, 0x08, 0x00, 0x00
-.byte 0x00, 0x04, 0x00, 0x00
-.byte 0x00, 0x02, 0x00, 0x00
-.byte 0x00, 0x01, 0x00, 0x00
-
- .global gUnknown_80F51B4
-gUnknown_80F51B4: @ 80F51B4
-@ replacing .incbin "baserom.gba", 0x000f51b4, 0x10
-.byte 0x19, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
-
- .global gUnknown_80F51C4
-gUnknown_80F51C4: @ 80F51C4
-@ replacing .incbin "baserom.gba", 0x000f51c4, 0x10
-.byte 0x19, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
-
- .global gUnknown_80F51D4
-gUnknown_80F51D4: @ 80F51D4
-@ replacing .incbin "baserom.gba", 0x000f51d4, 0x10
-.byte 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00
-
- .global gUnknown_80F51E4
-gUnknown_80F51E4: @ 80F51E4
-@ replacing .incbin "baserom.gba", 0x000f51e4, 0x8
-.byte 0x01, 0x02, 0x0d, 0x01, 0x03, 0x06, 0x03, 0x06
-
- .global gUnknown_80F51EC
-gUnknown_80F51EC: @ 80F51EC
- .incbin "baserom.gba", 0xF51EC, 0x20
-
- .global gUnknown_80F520C
-gUnknown_80F520C: @ 80F520C
- .incbin "baserom.gba", 0xF520C, 0x20
-
- .global gTypeEffectivenessChart
-gTypeEffectivenessChart: @ 80F522C
- .incbin "baserom.gba", 0xF522C, 0x288
-
- .global gUnknown_80F54B4
-gUnknown_80F54B4: @ 80F54B4
- .incbin "baserom.gba", 0xF54B4, 0x40
-
- .global gUnknown_80F54F4
-gUnknown_80F54F4: @ 80F54F4
- .incbin "baserom.gba", 0xF54F4, 0xA0
-
- .global gWarpScarfActivationChances
-gWarpScarfActivationChances: @ 80F5594
-@ replacing .incbin "baserom.gba", 0xF5594, 0x28
- .2byte 0, 6, 12, 30, 50, 70, 90, 110, 130, 150, 170, 190, 210, 230, 250, 270, 290, 310, 999, 0
-
- .global gUnknown_80F55BC
-gUnknown_80F55BC: @ 80F55BC
- .incbin "baserom.gba", 0xF55BC, 0x30
-
- .global gUnknown_80F55EC
-gUnknown_80F55EC: @ 80F55EC
- .incbin "baserom.gba", 0xF55EC, 0x30
-
- .global gDungeonCamouflageTypes
-gDungeonCamouflageTypes: @ 80F561C
- .incbin "baserom.gba", 0xF561C, 0x4C
-
- .global gDungeonMusic
-gDungeonMusic: @ 80F5668
- .incbin "baserom.gba", 0xF5668, 0x98
-
- .global gUnknown_80F5700
-gUnknown_80F5700: @ 80F5700
- .incbin "baserom.gba", 0xF5700, 0xCA
-
- .global gUnknown_80F57CA
-gUnknown_80F57CA: @ 80F57CA
-@ replacing .incbin "baserom.gba", 0x000f57ca, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F57CC
-gUnknown_80F57CC: @ 80F57CC
-@ replacing .incbin "baserom.gba", 0x000f57cc, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F57CE
-gUnknown_80F57CE: @ 80F57CE
-@ replacing .incbin "baserom.gba", 0x000f57ce, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F57D0
-gUnknown_80F57D0: @ 80F57D0
-@ replacing .incbin "baserom.gba", 0x000f57d0, 0x2
- .byte 0x14, 0x00
-
- .global gUnknown_80F57D2
-gUnknown_80F57D2: @ 80F57D2
-@ replacing .incbin "baserom.gba", 0x000f57d2, 0x2
- .byte 0x0a, 0x00
-
- .global gUnknown_80F57D4
-gUnknown_80F57D4: @ 80F57D4
- .incbin "baserom.gba", 0xF57D4, 0x120
-
- .global gUnknown_80F58F4
-gUnknown_80F58F4: @ 80F58F4
- .incbin "baserom.gba", 0xF58F4, 0x84
-
- .global gUnknown_80F5978
-gUnknown_80F5978: @ 80F5978
- .incbin "baserom.gba", 0xF5978, 0x4C
diff --git a/data/data_80F4DB4.s b/data/data_80F4DB4.s
new file mode 100644
index 0000000..4a9b5cb
--- /dev/null
+++ b/data/data_80F4DB4.s
@@ -0,0 +1,272 @@
+ .section .rodata
+
+ .global gUnknown_80F4DB4
+gUnknown_80F4DB4: @ 80F4DB4
+@ replacing .incbin "baserom.gba", 0x000f4db4, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4DB6
+gUnknown_80F4DB6: @ 80F4DB6
+@ replacing .incbin "baserom.gba", 0x000f4db6, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DB8
+gUnknown_80F4DB8: @ 80F4DB8
+@ replacing .incbin "baserom.gba", 0x000f4db8, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DBA
+gUnknown_80F4DBA: @ 80F4DBA
+@ replacing .incbin "baserom.gba", 0x000f4dba, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DBC
+gUnknown_80F4DBC: @ 80F4DBC
+@ replacing .incbin "baserom.gba", 0x000f4dbc, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DBE
+gUnknown_80F4DBE: @ 80F4DBE
+@ replacing .incbin "baserom.gba", 0x000f4dbe, 0x2
+ .byte 0x12, 0x00
+
+ .global gUnknown_80F4DC0
+gUnknown_80F4DC0: @ 80F4DC0
+@ replacing .incbin "baserom.gba", 0x000f4dc0, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DC2
+gUnknown_80F4DC2: @ 80F4DC2
+@ replacing .incbin "baserom.gba", 0x000f4dc2, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4DC4
+gUnknown_80F4DC4: @ 80F4DC4
+@ replacing .incbin "baserom.gba", 0x000f4dc4, 0x2
+ .byte 0x28, 0x00
+
+ .global gUnknown_80F4DC6
+gUnknown_80F4DC6: @ 80F4DC6
+@ replacing .incbin "baserom.gba", 0x000f4dc6, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DC8
+gUnknown_80F4DC8: @ 80F4DC8
+@ replacing .incbin "baserom.gba", 0x000f4dc8, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4DCA
+gUnknown_80F4DCA: @ 80F4DCA
+@ replacing .incbin "baserom.gba", 0x000f4dca, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4DCC
+gUnknown_80F4DCC: @ 80F4DCC
+@ replacing .incbin "baserom.gba", 0x000f4dcc, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4DCE
+gUnknown_80F4DCE: @ 80F4DCE
+@ replacing .incbin "baserom.gba", 0x000f4dce, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DD0
+gUnknown_80F4DD0: @ 80F4DD0
+@ replacing .incbin "baserom.gba", 0x000f4dd0, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4DD2
+gUnknown_80F4DD2: @ 80F4DD2
+@ replacing .incbin "baserom.gba", 0x000f4dd2, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DD4
+gUnknown_80F4DD4: @ 80F4DD4
+@ replacing .incbin "baserom.gba", 0x000f4dd4, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DD6
+gUnknown_80F4DD6: @ 80F4DD6
+@ replacing .incbin "baserom.gba", 0x000f4dd6, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DD8
+gUnknown_80F4DD8: @ 80F4DD8
+@ replacing .incbin "baserom.gba", 0x000f4dd8, 0x2
+ .byte 0x32, 0x00
+
+ .global gUnknown_80F4DDA
+gUnknown_80F4DDA: @ 80F4DDA
+@ replacing .incbin "baserom.gba", 0x000f4dda, 0x2
+ .byte 0x32, 0x00
+
+ .global gUnknown_80F4DDC
+gUnknown_80F4DDC: @ 80F4DDC
+@ replacing .incbin "baserom.gba", 0x000f4ddc, 0x4
+ .byte 0x32, 0x00
+ .byte 0x32, 0x00
+
+ .global gUnknown_80F4DE0
+gUnknown_80F4DE0: @ 80F4DE0
+@ replacing .incbin "baserom.gba", 0x000f4de0, 0x2
+ .byte 0x32, 0x00
+
+ .global gUnknown_80F4DE2
+gUnknown_80F4DE2: @ 80F4DE2
+@ replacing .incbin "baserom.gba", 0x000f4de2, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DE4
+gUnknown_80F4DE4: @ 80F4DE4
+@ replacing .incbin "baserom.gba", 0x000f4de4, 0x2
+ .byte 0x0f, 0x00
+
+ .global gUnknown_80F4DE6
+gUnknown_80F4DE6: @ 80F4DE6
+@ replacing .incbin "baserom.gba", 0x000f4de6, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4DE8
+gUnknown_80F4DE8: @ 80F4DE8
+@ replacing .incbin "baserom.gba", 0x000f4de8, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DEA
+gUnknown_80F4DEA: @ 80F4DEA
+@ replacing .incbin "baserom.gba", 0x000f4dea, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DEC
+gUnknown_80F4DEC: @ 80F4DEC
+@ replacing .incbin "baserom.gba", 0x000f4dec, 0x2
+ .byte 0x0f, 0x00
+
+ .global gUnknown_80F4DEE
+gUnknown_80F4DEE: @ 80F4DEE
+@ replacing .incbin "baserom.gba", 0x000f4dee, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4DF0
+gUnknown_80F4DF0: @ 80F4DF0
+@ replacing .incbin "baserom.gba", 0x000f4df0, 0x2
+ .byte 0x19, 0x00
+
+ .global gUnknown_80F4DF2
+gUnknown_80F4DF2: @ 80F4DF2
+@ replacing .incbin "baserom.gba", 0x000f4df2, 0x2
+ .byte 0x23, 0x00
+
+ .global gUnknown_80F4DF4
+gUnknown_80F4DF4: @ 80F4DF4
+@ replacing .incbin "baserom.gba", 0x000f4df4, 0x2
+ .byte 0x19, 0x00
+
+ .global gUnknown_80F4DF6
+gUnknown_80F4DF6: @ 80F4DF6
+@ replacing .incbin "baserom.gba", 0x000f4df6, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4DF8
+gUnknown_80F4DF8: @ 80F4DF8
+@ replacing .incbin "baserom.gba", 0x000f4df8, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4DFA
+gUnknown_80F4DFA: @ 80F4DFA
+@ replacing .incbin "baserom.gba", 0x000f4dfa, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4DFC
+gUnknown_80F4DFC: @ 80F4DFC
+@ replacing .incbin "baserom.gba", 0x000f4dfc, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4DFE
+gUnknown_80F4DFE: @ 80F4DFE
+@ replacing .incbin "baserom.gba", 0x000f4dfe, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4E00
+gUnknown_80F4E00: @ 80F4E00
+@ replacing .incbin "baserom.gba", 0x000f4e00, 0x2
+ .byte 0x28, 0x00
+
+ .global gUnknown_80F4E02
+gUnknown_80F4E02: @ 80F4E02
+@ replacing .incbin "baserom.gba", 0x000f4e02, 0x2
+ .byte 0x3c, 0x00
+
+ .global gUnknown_80F4E04
+gUnknown_80F4E04: @ 80F4E04
+@ replacing .incbin "baserom.gba", 0x000f4e04, 0x2
+ .byte 0x3c, 0x00
+
+ .global gUnknown_80F4E06
+gUnknown_80F4E06: @ 80F4E06
+@ replacing .incbin "baserom.gba", 0x000f4e06, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4E08
+gUnknown_80F4E08: @ 80F4E08
+@ replacing .incbin "baserom.gba", 0x000f4e08, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4E0A
+gUnknown_80F4E0A: @ 80F4E0A
+@ replacing .incbin "baserom.gba", 0x000f4e0a, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4E0C
+gUnknown_80F4E0C: @ 80F4E0C
+@ replacing .incbin "baserom.gba", 0x000f4e0c, 0x2
+ .byte 0x32, 0x00
+
+ .global gUnknown_80F4E0E
+gUnknown_80F4E0E: @ 80F4E0E
+@ replacing .incbin "baserom.gba", 0x000f4e0e, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4E10
+gUnknown_80F4E10: @ 80F4E10
+@ replacing .incbin "baserom.gba", 0x000f4e10, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E12
+gUnknown_80F4E12: @ 80F4E12
+@ replacing .incbin "baserom.gba", 0x000f4e12, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E14
+gUnknown_80F4E14: @ 80F4E14
+@ replacing .incbin "baserom.gba", 0x000f4e14, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E16
+gUnknown_80F4E16: @ 80F4E16
+@ replacing .incbin "baserom.gba", 0x000f4e16, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E18
+gUnknown_80F4E18: @ 80F4E18
+@ replacing .incbin "baserom.gba", 0x000f4e18, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E1A
+gUnknown_80F4E1A: @ 80F4E1A
+@ replacing .incbin "baserom.gba", 0x000f4e1a, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E1C
+gUnknown_80F4E1C: @ 80F4E1C
+@ replacing .incbin "baserom.gba", 0x000f4e1c, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E1E
+gUnknown_80F4E1E: @ 80F4E1E
+@ replacing .incbin "baserom.gba", 0x000f4e1e, 0x2
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E20
+gUnknown_80F4E20: @ 80F4E20
+@ replacing .incbin "baserom.gba", 0x000f4e20, 0x2
+ .byte 0x0c, 0x00
diff --git a/data/data_80F4E2C.s b/data/data_80F4E2C.s
new file mode 100644
index 0000000..9bf1e1a
--- /dev/null
+++ b/data/data_80F4E2C.s
@@ -0,0 +1,881 @@
+ .section .rodata
+
+ .global gUnknown_80F4E2C
+gUnknown_80F4E2C: @ 80F4E2C
+@ replacing .incbin "baserom.gba", 0x000f4e2c, 0x4
+ .byte 0x03, 0x00
+ .byte 0x05, 0x00
+
+ .global gUnknown_80F4E30
+gUnknown_80F4E30: @ 80F4E30
+@ replacing .incbin "baserom.gba", 0x000f4e30, 0x4
+ .byte 0x7f, 0x00
+ .byte 0x7f, 0x00
+
+ .global gUnknown_80F4E34
+gUnknown_80F4E34: @ 80F4E34
+@ replacing .incbin "baserom.gba", 0x000f4e34, 0x4
+ .byte 0x7f, 0x00
+ .byte 0x7f, 0x00
+
+ .global gUnknown_80F4E38
+gUnknown_80F4E38: @ 80F4E38
+@ replacing .incbin "baserom.gba", 0x000f4e38, 0x4
+ .byte 0x7f, 0x00
+ .byte 0x7f, 0x00
+
+ .global gUnknown_80F4E3C
+gUnknown_80F4E3C: @ 80F4E3C
+@ replacing .incbin "baserom.gba", 0x000f4e3c, 0x4
+ .byte 0x01, 0x00
+ .byte 0x01, 0x00
+
+ .global gUnknown_80F4E40
+gUnknown_80F4E40: @ 80F4E40
+@ replacing .incbin "baserom.gba", 0x000f4e40, 0x8
+ .byte 0x08, 0x00
+ .byte 0x0a, 0x00
+ .byte 0x03, 0x00
+ .byte 0x04, 0x00
+
+ .global gUnknown_80F4E48
+gUnknown_80F4E48: @ 80F4E48
+@ replacing .incbin "baserom.gba", 0x000f4e48, 0x4
+ .byte 0x06, 0x00
+ .byte 0x08, 0x00
+
+ .global gUnknown_80F4E4C
+gUnknown_80F4E4C: @ 80F4E4C
+@ replacing .incbin "baserom.gba", 0x000f4e4c, 0x4
+ .byte 0x06, 0x00
+ .byte 0x0c, 0x00
+
+ .global gUnknown_80F4E50
+gUnknown_80F4E50: @ 80F4E50
+@ replacing .incbin "baserom.gba", 0x000f4e50, 0x4
+ .byte 0x01, 0x00
+ .byte 0x02, 0x00
+
+ .global gUnknown_80F4E54
+gUnknown_80F4E54: @ 80F4E54
+@ replacing .incbin "baserom.gba", 0x000f4e54, 0x4
+ .byte 0x02, 0x00
+ .byte 0x05, 0x00
+
+ .global gUnknown_80F4E58
+gUnknown_80F4E58: @ 80F4E58
+@ replacing .incbin "baserom.gba", 0x000f4e58, 0x4
+ .byte 0x03, 0x00
+ .byte 0x06, 0x00
+
+ .global gUnknown_80F4E5C
+gUnknown_80F4E5C: @ 80F4E5C
+@ replacing .incbin "baserom.gba", 0x000f4e5c, 0x4
+ .byte 0x02, 0x00
+ .byte 0x05, 0x00
+
+ .global gUnknown_80F4E60
+gUnknown_80F4E60: @ 80F4E60
+@ replacing .incbin "baserom.gba", 0x000f4e60, 0x10
+ .byte 0x0f, 0x00
+ .byte 0x1e, 0x00
+ .byte 0x02, 0x00
+ .byte 0x03, 0x00
+ .byte 0x02, 0x00
+ .byte 0x06, 0x00
+ .byte 0x0a, 0x00
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4E70
+gUnknown_80F4E70: @ 80F4E70
+@ replacing .incbin "baserom.gba", 0x000f4e70, 0x4
+ .byte 0x01, 0x00
+ .byte 0x01, 0x00
+
+ .global gUnknown_80F4E74
+gUnknown_80F4E74: @ 80F4E74
+@ replacing .incbin "baserom.gba", 0x000f4e74, 0x4
+ .byte 0x03, 0x00
+ .byte 0x07, 0x00
+
+ .global gUnknown_80F4E78
+gUnknown_80F4E78: @ 80F4E78
+@ replacing .incbin "baserom.gba", 0x000f4e78, 0x4
+.byte 0x04, 0x00
+.byte 0x08, 0x00
+
+ .global gUnknown_80F4E7C
+gUnknown_80F4E7C: @ 80F4E7C
+@ replacing .incbin "baserom.gba", 0x000f4e7c, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4E80
+gUnknown_80F4E80: @ 80F4E80
+@ replacing .incbin "baserom.gba", 0x000f4e80, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4E84
+gUnknown_80F4E84: @ 80F4E84
+@ replacing .incbin "baserom.gba", 0x000f4e84, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4E88
+gUnknown_80F4E88: @ 80F4E88
+@ replacing .incbin "baserom.gba", 0x000f4e88, 0x4
+.byte 0x0f, 0x00
+.byte 0x14, 0x00
+
+ .global gUnknown_80F4E8C
+gUnknown_80F4E8C: @ 80F4E8C
+@ replacing .incbin "baserom.gba", 0x000f4e8c, 0x4
+.byte 0x0a, 0x00
+.byte 0x0e, 0x00
+
+ .global gUnknown_80F4E90
+gUnknown_80F4E90: @ 80F4E90
+@ replacing .incbin "baserom.gba", 0x000f4e90, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4E94
+gUnknown_80F4E94: @ 80F4E94
+@ replacing .incbin "baserom.gba", 0x000f4e94, 0x4
+.byte 0x02, 0x00
+.byte 0x04, 0x00
+
+ .global gUnknown_80F4E98
+gUnknown_80F4E98: @ 80F4E98
+@ replacing .incbin "baserom.gba", 0x000f4e98, 0x4
+.byte 0x06, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4E9C
+gUnknown_80F4E9C: @ 80F4E9C
+@ replacing .incbin "baserom.gba", 0x000f4e9c, 0x4
+.byte 0x03, 0x00
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4EA0
+gUnknown_80F4EA0: @ 80F4EA0
+@ replacing .incbin "baserom.gba", 0x000f4ea0, 0x4
+.byte 0x04, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4EA4
+gUnknown_80F4EA4: @ 80F4EA4
+@ replacing .incbin "baserom.gba", 0x000f4ea4, 0x4
+.byte 0x03, 0x00
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4EA8
+gUnknown_80F4EA8: @ 80F4EA8
+@ replacing .incbin "baserom.gba", 0x000f4ea8, 0x4
+.byte 0x03, 0x00
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4EAC
+gUnknown_80F4EAC: @ 80F4EAC
+@ replacing .incbin "baserom.gba", 0x000f4eac, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EB0
+gUnknown_80F4EB0: @ 80F4EB0
+@ replacing .incbin "baserom.gba", 0x000f4eb0, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EB4
+gUnknown_80F4EB4: @ 80F4EB4
+@ replacing .incbin "baserom.gba", 0x000f4eb4, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EB8
+gUnknown_80F4EB8: @ 80F4EB8
+@ replacing .incbin "baserom.gba", 0x000f4eb8, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EBC
+gUnknown_80F4EBC: @ 80F4EBC
+@ replacing .incbin "baserom.gba", 0x000f4ebc, 0x4
+.byte 0x14, 0x00
+.byte 0x1e, 0x00
+
+ .global gUnknown_80F4EC0
+gUnknown_80F4EC0: @ 80F4EC0
+@ replacing .incbin "baserom.gba", 0x000f4ec0, 0x4
+.byte 0x7f, 0x00
+.byte 0x7f, 0x00
+
+ .global gUnknown_80F4EC4
+gUnknown_80F4EC4: @ 80F4EC4
+@ replacing .incbin "baserom.gba", 0x000f4ec4, 0x4
+.byte 0x02, 0x00
+.byte 0x04, 0x00
+
+ .global gUnknown_80F4EC8
+gUnknown_80F4EC8: @ 80F4EC8
+@ replacing .incbin "baserom.gba", 0x000f4ec8, 0x4
+.byte 0x02, 0x00
+.byte 0x04, 0x00
+
+ .global gUnknown_80F4ECC
+gUnknown_80F4ECC: @ 80F4ECC
+@ replacing .incbin "baserom.gba", 0x000f4ecc, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4ED0
+gUnknown_80F4ED0: @ 80F4ED0
+@ replacing .incbin "baserom.gba", 0x000f4ed0, 0x4
+.byte 0x14, 0x00
+.byte 0x32, 0x00
+
+ .global gUnknown_80F4ED4
+gUnknown_80F4ED4: @ 80F4ED4
+@ replacing .incbin "baserom.gba", 0x000f4ed4, 0x4
+.byte 0x02, 0x00
+.byte 0x06, 0x00
+
+ .global gUnknown_80F4ED8
+gUnknown_80F4ED8: @ 80F4ED8
+@ replacing .incbin "baserom.gba", 0x000f4ed8, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EDC
+gUnknown_80F4EDC: @ 80F4EDC
+@ replacing .incbin "baserom.gba", 0x000f4edc, 0x4
+.byte 0x01, 0x00
+.byte 0x06, 0x00
+
+ .global gUnknown_80F4EE0
+gUnknown_80F4EE0: @ 80F4EE0
+@ replacing .incbin "baserom.gba", 0x000f4ee0, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EE4
+gUnknown_80F4EE4: @ 80F4EE4
+@ replacing .incbin "baserom.gba", 0x000f4ee4, 0x4
+.byte 0x0a, 0x00
+.byte 0x14, 0x00
+
+ .global gUnknown_80F4EE8
+gUnknown_80F4EE8: @ 80F4EE8
+@ replacing .incbin "baserom.gba", 0x000f4ee8, 0x4
+.byte 0x0a, 0x00
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4EEC
+gUnknown_80F4EEC: @ 80F4EEC
+@ replacing .incbin "baserom.gba", 0x000f4eec, 0x4
+.byte 0x03, 0x00
+.byte 0x03, 0x00
+
+ .global gUnknown_80F4EF0
+gUnknown_80F4EF0: @ 80F4EF0
+@ replacing .incbin "baserom.gba", 0x000f4ef0, 0x4
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4EF4
+gUnknown_80F4EF4: @ 80F4EF4
+@ replacing .incbin "baserom.gba", 0x000f4ef4, 0x4
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4EF8
+gUnknown_80F4EF8: @ 80F4EF8
+@ replacing .incbin "baserom.gba", 0x000f4ef8, 0x4
+.byte 0x03, 0x00
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4EFC
+gUnknown_80F4EFC: @ 80F4EFC
+@ replacing .incbin "baserom.gba", 0x000f4efc, 0x4
+.byte 0x7f, 0x00
+.byte 0x7f, 0x00
+
+ .global gUnknown_80F4F00
+gUnknown_80F4F00: @ 80F4F00
+@ replacing .incbin "baserom.gba", 0x000f4f00, 0x4
+.byte 0x04, 0x00
+.byte 0x06, 0x00
+
+ .global gUnknown_80F4F04
+gUnknown_80F4F04: @ 80F4F04
+@ replacing .incbin "baserom.gba", 0x000f4f04, 0x4
+.byte 0x7f, 0x00
+.byte 0x7f, 0x00
+
+ .global gUnknown_80F4F08
+gUnknown_80F4F08: @ 80F4F08
+@ replacing .incbin "baserom.gba", 0x000f4f08, 0x4
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F0C
+gUnknown_80F4F0C: @ 80F4F0C
+@ replacing .incbin "baserom.gba", 0x000f4f0c, 0x4
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F10
+gUnknown_80F4F10: @ 80F4F10
+@ replacing .incbin "baserom.gba", 0x000f4f10, 0x8
+.byte 0x7f, 0x00
+.byte 0x7f, 0x00
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F18
+gUnknown_80F4F18: @ 80F4F18
+@ replacing .incbin "baserom.gba", 0x000f4f18, 0x4
+.byte 0x02, 0x00
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F1C
+gUnknown_80F4F1C: @ 80F4F1C
+@ replacing .incbin "baserom.gba", 0x000f4f1c, 0x4
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F20
+gUnknown_80F4F20: @ 80F4F20
+@ replacing .incbin "baserom.gba", 0x000f4f20, 0x4
+.byte 0x0a, 0x00
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F24
+gUnknown_80F4F24: @ 80F4F24
+@ replacing .incbin "baserom.gba", 0x000f4f24, 0x4
+.byte 0x0f, 0x00
+.byte 0x14, 0x00
+
+ .global gUnknown_80F4F28
+gUnknown_80F4F28: @ 80F4F28
+@ replacing .incbin "baserom.gba", 0x000f4f28, 0x4
+.byte 0x02, 0x00
+.byte 0x02, 0x00
+
+ .global gUnknown_80F4F2C
+gUnknown_80F4F2C: @ 80F4F2C
+@ replacing .incbin "baserom.gba", 0x000f4f2c, 0x4
+.byte 0x04, 0x00
+.byte 0x08, 0x00
+
+ .global gUnknown_80F4F30
+gUnknown_80F4F30: @ 80F4F30
+@ replacing .incbin "baserom.gba", 0x000f4f30, 0x2
+.byte 0xfa, 0x00
+
+ .global gUnknown_80F4F32
+gUnknown_80F4F32: @ 80F4F32
+@ replacing .incbin "baserom.gba", 0x000f4f32, 0x2
+.byte 0x14, 0x00
+
+ .global gUnknown_80F4F34
+gUnknown_80F4F34: @ 80F4F34
+@ replacing .incbin "baserom.gba", 0x000f4f34, 0x2
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F36
+gUnknown_80F4F36: @ 80F4F36
+@ replacing .incbin "baserom.gba", 0x000f4f36, 0x2
+.byte 0x02, 0x00
+
+ .global gUnknown_80F4F38
+gUnknown_80F4F38: @ 80F4F38
+@ replacing .incbin "baserom.gba", 0x000f4f38, 0x2
+.byte 0x02, 0x00
+
+ .global gUnknown_80F4F3A
+gUnknown_80F4F3A: @ 80F4F3A
+@ replacing .incbin "baserom.gba", 0x000f4f3a, 0x2
+.byte 0x02, 0x00
+
+ .global gUnknown_80F4F3C
+gUnknown_80F4F3C: @ 80F4F3C
+@ replacing .incbin "baserom.gba", 0x000f4f3c, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F3E
+gUnknown_80F4F3E: @ 80F4F3E
+@ replacing .incbin "baserom.gba", 0x000f4f3e, 0x2
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F40
+gUnknown_80F4F40: @ 80F4F40
+@ replacing .incbin "baserom.gba", 0x000f4f40, 0x2
+.byte 0x02, 0x00
+
+ .global gUnknown_80F4F42
+gUnknown_80F4F42: @ 80F4F42
+@ replacing .incbin "baserom.gba", 0x000f4f42, 0x4
+.byte 0x14, 0x00
+.byte 0x5f, 0x00
+
+ .global gUnknown_80F4F46
+gUnknown_80F4F46: @ 80F4F46
+@ replacing .incbin "baserom.gba", 0x000f4f46, 0x2
+.byte 0x0c, 0x00
+
+ .global gUnknown_80F4F48
+gUnknown_80F4F48: @ 80F4F48
+@ replacing .incbin "baserom.gba", 0x000f4f48, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F4C
+gUnknown_80F4F4C: @ 80F4F4C
+@ replacing .incbin "baserom.gba", 0x000f4f4c, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F50
+gUnknown_80F4F50: @ 80F4F50
+@ replacing .incbin "baserom.gba", 0x000f4f50, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F54
+gUnknown_80F4F54: @ 80F4F54
+@ replacing .incbin "baserom.gba", 0x000f4f54, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F58
+gUnknown_80F4F58: @ 80F4F58
+@ replacing .incbin "baserom.gba", 0x000f4f58, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F5C
+gUnknown_80F4F5C: @ 80F4F5C
+@ replacing .incbin "baserom.gba", 0x000f4f5c, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F60
+gUnknown_80F4F60: @ 80F4F60
+@ replacing .incbin "baserom.gba", 0x000f4f60, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F64
+gUnknown_80F4F64: @ 80F4F64
+@ replacing .incbin "baserom.gba", 0x000f4f64, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F68
+gUnknown_80F4F68: @ 80F4F68
+@ replacing .incbin "baserom.gba", 0x000f4f68, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F6C
+gUnknown_80F4F6C: @ 80F4F6C
+@ replacing .incbin "baserom.gba", 0x000f4f6c, 0x4
+.byte 0x00, 0x02
+.byte 0x00, 0x00
+
+ .global gUnknown_80F4F70
+gUnknown_80F4F70: @ 80F4F70
+@ replacing .incbin "baserom.gba", 0x000f4f70, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F72
+gUnknown_80F4F72: @ 80F4F72
+@ replacing .incbin "baserom.gba", 0x000f4f72, 0x2
+.byte 0x04, 0x00
+
+ .global gUnknown_80F4F74
+gUnknown_80F4F74: @ 80F4F74
+@ replacing .incbin "baserom.gba", 0x000f4f74, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F76
+gUnknown_80F4F76: @ 80F4F76
+@ replacing .incbin "baserom.gba", 0x000f4f76, 0x2
+.byte 0x06, 0x00
+
+ .global gUnknown_80F4F78
+gUnknown_80F4F78: @ 80F4F78
+@ replacing .incbin "baserom.gba", 0x000f4f78, 0x2
+.byte 0x08, 0x00
+
+ .global gUnknown_80F4F7A
+gUnknown_80F4F7A: @ 80F4F7A
+@ replacing .incbin "baserom.gba", 0x000f4f7a, 0x2
+.byte 0xe7, 0x03
+
+ .global gUnknown_80F4F7C
+gUnknown_80F4F7C: @ 80F4F7C
+@ replacing .incbin "baserom.gba", 0x000f4f7c, 0x2
+.byte 0x37, 0x00
+
+ .global gUnknown_80F4F7E
+gUnknown_80F4F7E: @ 80F4F7E
+@ replacing .incbin "baserom.gba", 0x000f4f7e, 0x2
+.byte 0x41, 0x00
+
+ .global gUnknown_80F4F80
+gUnknown_80F4F80: @ 80F4F80
+@ replacing .incbin "baserom.gba", 0x000f4f80, 0x2
+.byte 0x23, 0x00
+
+ .global gUnknown_80F4F82
+gUnknown_80F4F82: @ 80F4F82
+@ replacing .incbin "baserom.gba", 0x000f4f82, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F84
+gUnknown_80F4F84: @ 80F4F84
+@ replacing .incbin "baserom.gba", 0x000f4f84, 0x2
+.byte 0x14, 0x00
+
+ .global gUnknown_80F4F86
+gUnknown_80F4F86: @ 80F4F86
+@ replacing .incbin "baserom.gba", 0x000f4f86, 0x4
+.byte 0x0a, 0x00
+.byte 0x0f, 0x00
+
+ .global gUnknown_80F4F8A
+gUnknown_80F4F8A: @ 80F4F8A
+@ replacing .incbin "baserom.gba", 0x000f4f8a, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F8C
+gUnknown_80F4F8C: @ 80F4F8C
+@ replacing .incbin "baserom.gba", 0x000f4f8c, 0x2
+.byte 0x23, 0x00
+
+ .global gUnknown_80F4F8E
+gUnknown_80F4F8E: @ 80F4F8E
+@ replacing .incbin "baserom.gba", 0x000f4f8e, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F90
+gUnknown_80F4F90: @ 80F4F90
+@ replacing .incbin "baserom.gba", 0x000f4f90, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F4F92
+gUnknown_80F4F92: @ 80F4F92
+@ replacing .incbin "baserom.gba", 0x000f4f92, 0x2
+.byte 0x0a, 0x00
+
+ .global gUnknown_80F4F94
+gUnknown_80F4F94: @ 80F4F94
+@ replacing .incbin "baserom.gba", 0x000f4f94, 0xe
+ .byte 0x05, 0x00
+ .byte 0x0a, 0x00
+ .byte 0x0f, 0x00
+ .byte 0x19, 0x00
+ .byte 0x1e, 0x00
+ .byte 0x23, 0x00
+ .byte 0x28, 0x00
+
+ .global gUnknown_80F4FA2
+gUnknown_80F4FA2: @ 80F4FA2
+@ replacing .incbin "baserom.gba", 0x000f4fa2, 0x2
+.byte 0x5a, 0x00
+
+ .global gUnknown_80F4FA4
+gUnknown_80F4FA4: @ 80F4FA4
+@ replacing .incbin "baserom.gba", 0x000f4fa4, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F4FA6
+gUnknown_80F4FA6: @ 80F4FA6
+@ replacing .incbin "baserom.gba", 0x000f4fa6, 0x2
+ .byte 0x2d, 0x00
+
+ .global gUnknown_80F4FA8
+gUnknown_80F4FA8: @ 80F4FA8
+@ replacing .incbin "baserom.gba", 0x000f4fa8, 0x2
+ .byte 0x0f, 0x00
+
+ .global gUnknown_80F4FAA
+gUnknown_80F4FAA: @ 80F4FAA
+@ replacing .incbin "baserom.gba", 0x000f4faa, 0x2
+ .byte 0x1e, 0x00
+
+ .global gUnknown_80F4FAC
+gUnknown_80F4FAC: @ 80F4FAC
+@ replacing .incbin "baserom.gba", 0x000f4fac, 0x2
+ .byte 0x01, 0x00
+
+ .global gUnknown_80F4FAE
+gUnknown_80F4FAE: @ 80F4FAE
+@ replacing .incbin "baserom.gba", 0x000f4fae, 0x4
+ .byte 0x02, 0x00
+ .byte 0x19, 0x00
+
+ .global gUnknown_80F4FB2
+gUnknown_80F4FB2: @ 80F4FB2
+@ replacing .incbin "baserom.gba", 0x000f4fb2, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4FB4
+gUnknown_80F4FB4: @ 80F4FB4
+@ replacing .incbin "baserom.gba", 0x000f4fb4, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4FB6
+gUnknown_80F4FB6: @ 80F4FB6
+@ replacing .incbin "baserom.gba", 0x000f4fb6, 0x2
+ .byte 0x64, 0x00
+
+ .global gUnknown_80F4FB8
+gUnknown_80F4FB8: @ 80F4FB8
+@ replacing .incbin "baserom.gba", 0x000f4fb8, 0x2
+ .byte 0x00, 0x00
+
+ .global gUnknown_80F4FBA
+gUnknown_80F4FBA: @ 80F4FBA
+@ replacing .incbin "baserom.gba", 0x000f4fba, 0x2
+ .byte 0x64, 0x00
+
+ .global gUnknown_80F4FBC
+gUnknown_80F4FBC: @ 80F4FBC
+@ replacing .incbin "baserom.gba", 0x000f4fbc, 0x2
+ .byte 0x02, 0x00
+
+ .global gUnknown_80F4FBE
+gUnknown_80F4FBE: @ 80F4FBE
+@ replacing .incbin "baserom.gba", 0x000f4fbe, 0x2
+ .byte 0x03, 0x00
+
+ .global gUnknown_80F4FC0
+gUnknown_80F4FC0: @ 80F4FC0
+@ replacing .incbin "baserom.gba", 0x000f4fc0, 0x2
+ .byte 0x24, 0xff
+
+ .global gUnknown_80F4FC2
+gUnknown_80F4FC2: @ 80F4FC2
+@ replacing .incbin "baserom.gba", 0x000f4fc2, 0x2
+ .byte 0x6a, 0xff
+
+ .global gUnknown_80F4FC4
+gUnknown_80F4FC4: @ 80F4FC4
+@ replacing .incbin "baserom.gba", 0x000f4fc4, 0x2
+ .byte 0x9c, 0xff
+
+ .global gUnknown_80F4FC6
+gUnknown_80F4FC6: @ 80F4FC6
+@ replacing .incbin "baserom.gba", 0x000f4fc6, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F4FC8
+gUnknown_80F4FC8: @ 80F4FC8
+ .incbin "baserom.gba", 0xF4FC8, 0x3C
+
+ .global gUnknown_80F5004
+gUnknown_80F5004: @ 80F5004
+@ replacing .incbin "baserom.gba", 0x000f5004, 0x2
+.byte 0x03, 0x00
+
+ .global gUnknown_80F5006
+gUnknown_80F5006: @ 80F5006
+@ replacing .incbin "baserom.gba", 0x000f5006, 0x2
+.byte 0x02, 0x00
+
+ .global gUnknown_80F5008
+gUnknown_80F5008: @ 80F5008
+@ replacing .incbin "baserom.gba", 0x000f5008, 0x2
+.byte 0x64, 0x00
+
+ .global gUnknown_80F500A
+gUnknown_80F500A: @ 80F500A
+@ replacing .incbin "baserom.gba", 0x000f500a, 0x10
+.byte 0x32, 0x00, 0x50, 0x00, 0x1e, 0x00, 0x28, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00
+
+ .global gUnknown_80F501A
+gUnknown_80F501A: @ 80F501A
+@ replacing .incbin "baserom.gba", 0x000f501a, 0x10
+.byte 0x32, 0x00, 0x50, 0x00, 0x1e, 0x00, 0x28, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00
+
+ .global gUnknown_80F502A
+gUnknown_80F502A: @ 80F502A
+@ replacing .incbin "baserom.gba", 0x000f502a, 0x10
+.byte 0x32, 0x00, 0x50, 0x00, 0x1e, 0x00, 0x28, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x00
+
+ .global gUnknown_80F503A
+gUnknown_80F503A: @ 80F503A
+@ replacing .incbin "baserom.gba", 0x000f503a, 0x2
+.byte 0x01, 0x00
+
+ .global gUnknown_80F503C
+gUnknown_80F503C: @ 80F503C
+@ replacing .incbin "baserom.gba", 0x000f503c, 0x2
+.byte 0x05, 0x00
+
+ .global gUnknown_80F503E
+gUnknown_80F503E: @ 80F503E
+@ replacing .incbin "baserom.gba", 0x000f503e, 0x2
+.byte 0x06, 0x00
+
+ .global gUnknown_80F5040
+gUnknown_80F5040: @ 80F5040
+@ replacing .incbin "baserom.gba", 0x000f5040, 0x2
+.byte 0x07, 0x00
+
+ .global gUnknown_80F5042
+gUnknown_80F5042: @ 80F5042
+@ replacing .incbin "baserom.gba", 0x000f5042, 0x2
+.byte 0x08, 0x00
+
+ .global gUnknown_80F5044
+gUnknown_80F5044: @ 80F5044
+@ replacing .incbin "baserom.gba", 0x000f5044, 0x2
+.byte 0x09, 0x00
+
+ .global gUnknown_80F5046
+gUnknown_80F5046: @ 80F5046
+@ replacing .incbin "baserom.gba", 0x000f5046, 0x2
+.byte 0x14, 0x00
+
+ .global gUnknown_80F5048
+gUnknown_80F5048: @ 80F5048
+@ replacing .incbin "baserom.gba", 0x000f5048, 0x4
+.byte 0x0f, 0x00, 0x00, 0x00
+
+ .global gUnknown_80F504C
+gUnknown_80F504C: @ 80F504C
+ .incbin "baserom.gba", 0xF504C, 0x54
+
+ .global gUnknown_80F50A0
+gUnknown_80F50A0: @ 80F50A0
+ .incbin "baserom.gba", 0xF50A0, 0x54
+
+ .global gUnknown_80F50F4
+gUnknown_80F50F4: @ 80F50F4
+ .incbin "baserom.gba", 0xF50F4, 0xA8
+
+ .global gUnknown_80F519C
+gUnknown_80F519C: @ 80F519C
+@ replacing .incbin "baserom.gba", 0x000f519c, 0x4
+.byte 0x1e, 0x00, 0x00, 0x00
+
+ .global gUnknown_80F51A0
+gUnknown_80F51A0: @ 80F51A0
+@ replacing .incbin "baserom.gba", 0x000f51a0, 0x4
+.byte 0x1e, 0x00, 0x00, 0x00
+
+ .global gUnknown_80F51A4
+gUnknown_80F51A4: @ 80F51A4
+@ replacing .incbin "baserom.gba", 0x000f51a4, 0x10
+.byte 0x00, 0x08, 0x00, 0x00
+.byte 0x00, 0x04, 0x00, 0x00
+.byte 0x00, 0x02, 0x00, 0x00
+.byte 0x00, 0x01, 0x00, 0x00
+
+ .global gUnknown_80F51B4
+gUnknown_80F51B4: @ 80F51B4
+@ replacing .incbin "baserom.gba", 0x000f51b4, 0x10
+.byte 0x19, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
+
+ .global gUnknown_80F51C4
+gUnknown_80F51C4: @ 80F51C4
+@ replacing .incbin "baserom.gba", 0x000f51c4, 0x10
+.byte 0x19, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
+
+ .global gUnknown_80F51D4
+gUnknown_80F51D4: @ 80F51D4
+@ replacing .incbin "baserom.gba", 0x000f51d4, 0x10
+.byte 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00
+
+ .global gUnknown_80F51E4
+gUnknown_80F51E4: @ 80F51E4
+@ replacing .incbin "baserom.gba", 0x000f51e4, 0x8
+.byte 0x01, 0x02, 0x0d, 0x01, 0x03, 0x06, 0x03, 0x06
+
+ .global gUnknown_80F51EC
+gUnknown_80F51EC: @ 80F51EC
+ .incbin "baserom.gba", 0xF51EC, 0x20
+
+ .global gUnknown_80F520C
+gUnknown_80F520C: @ 80F520C
+ .incbin "baserom.gba", 0xF520C, 0x20
+
+ .global gTypeEffectivenessChart
+gTypeEffectivenessChart: @ 80F522C
+ .incbin "baserom.gba", 0xF522C, 0x288
+
+ .global gUnknown_80F54B4
+gUnknown_80F54B4: @ 80F54B4
+ .incbin "baserom.gba", 0xF54B4, 0x40
+
+ .global gUnknown_80F54F4
+gUnknown_80F54F4: @ 80F54F4
+ .incbin "baserom.gba", 0xF54F4, 0xA0
+
+ .global gWarpScarfActivationChances
+gWarpScarfActivationChances: @ 80F5594
+@ replacing .incbin "baserom.gba", 0xF5594, 0x28
+ .2byte 0, 6, 12, 30, 50, 70, 90, 110, 130, 150, 170, 190, 210, 230, 250, 270, 290, 310, 999, 0
+
+ .global gUnknown_80F55BC
+gUnknown_80F55BC: @ 80F55BC
+ .incbin "baserom.gba", 0xF55BC, 0x30
+
+ .global gUnknown_80F55EC
+gUnknown_80F55EC: @ 80F55EC
+ .incbin "baserom.gba", 0xF55EC, 0x30
+
+ .global gDungeonCamouflageTypes
+gDungeonCamouflageTypes: @ 80F561C
+ .incbin "baserom.gba", 0xF561C, 0x4C
+
+ .global gDungeonMusic
+gDungeonMusic: @ 80F5668
+ .incbin "baserom.gba", 0xF5668, 0x98
+
+ .global gUnknown_80F5700
+gUnknown_80F5700: @ 80F5700
+ .incbin "baserom.gba", 0xF5700, 0xCA
+
+ .global gUnknown_80F57CA
+gUnknown_80F57CA: @ 80F57CA
+@ replacing .incbin "baserom.gba", 0x000f57ca, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F57CC
+gUnknown_80F57CC: @ 80F57CC
+@ replacing .incbin "baserom.gba", 0x000f57cc, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F57CE
+gUnknown_80F57CE: @ 80F57CE
+@ replacing .incbin "baserom.gba", 0x000f57ce, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F57D0
+gUnknown_80F57D0: @ 80F57D0
+@ replacing .incbin "baserom.gba", 0x000f57d0, 0x2
+ .byte 0x14, 0x00
+
+ .global gUnknown_80F57D2
+gUnknown_80F57D2: @ 80F57D2
+@ replacing .incbin "baserom.gba", 0x000f57d2, 0x2
+ .byte 0x0a, 0x00
+
+ .global gUnknown_80F57D4
+gUnknown_80F57D4: @ 80F57D4
+ .incbin "baserom.gba", 0xF57D4, 0x120
+
+ .global gUnknown_80F58F4
+gUnknown_80F58F4: @ 80F58F4
+ .incbin "baserom.gba", 0xF58F4, 0x84
+
+ .global gUnknown_80F5978
+gUnknown_80F5978: @ 80F5978
+ .incbin "baserom.gba", 0xF5978, 0x4C
diff --git a/include/constants/move.h b/include/constants/move.h
index 4e3396b..8148ab5 100644
--- a/include/constants/move.h
+++ b/include/constants/move.h
@@ -44,7 +44,7 @@ struct PokemonMove
u8 moveFlags;
bool8 sealed;
u16 moveID;
- u8 pp;
+ u8 PP;
u8 powerBoost; // How much the move is boosted by Ginsengs.
};
diff --git a/include/dungeon_ai.h b/include/dungeon_ai.h
index e02da08..e3f7a37 100644
--- a/include/dungeon_ai.h
+++ b/include/dungeon_ai.h
@@ -5,5 +5,7 @@
// 0x71494
bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon);
+// 0x71518
+bool8 ShouldAvoidEnemiesAndShowEffect(struct DungeonEntity *pokemon, bool8 showRunAwayEffect);
#endif
diff --git a/include/dungeon_ai_attack.h b/include/dungeon_ai_attack.h
index 75abcab..77b53fc 100644
--- a/include/dungeon_ai_attack.h
+++ b/include/dungeon_ai_attack.h
@@ -3,7 +3,7 @@
#include "dungeon_entity.h"
-// 0x7C9F8
-bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange);
+// 0x7BB94
+void DecideAttack(struct DungeonEntity *pokemon);
#endif
diff --git a/include/dungeon_ai_attack_1.h b/include/dungeon_ai_attack_1.h
new file mode 100644
index 0000000..89a1f0d
--- /dev/null
+++ b/include/dungeon_ai_attack_1.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_DUNGEON_AI_ATTACK_1_H
+#define GUARD_DUNGEON_AI_ATTACK_1_H
+
+#include "dungeon_entity.h"
+
+// 0x7C9F8
+bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange);
+
+#endif
diff --git a/include/dungeon_capabilities_1.h b/include/dungeon_capabilities_1.h
index c19391b..1319230 100644
--- a/include/dungeon_capabilities_1.h
+++ b/include/dungeon_capabilities_1.h
@@ -7,6 +7,8 @@
bool8 CannotUseItems(struct DungeonEntity *pokemon);
// 0x70CD0
bool8 CannotAct(struct DungeonEntity *pokemon);
+// 0x70d04
+bool8 CannotAttack(struct DungeonEntity *pokemon, bool8 skipSleep);
// 0x70D6C
bool8 CanMoveInDirection(struct DungeonEntity *pokemon, u32 facingDir);
diff --git a/include/dungeon_pokemon_attributes_1.h b/include/dungeon_pokemon_attributes_1.h
index cdfa989..c81c4b9 100644
--- a/include/dungeon_pokemon_attributes_1.h
+++ b/include/dungeon_pokemon_attributes_1.h
@@ -12,7 +12,7 @@ bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill);
void LoadIQSkills(struct DungeonEntity *pokemon);
bool8 CanSeeTeammate(struct DungeonEntity * pokemon);
-u8 GetMoveType_2(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
+u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
// 0x71A44
s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
diff --git a/include/moves.h b/include/moves.h
index bba50b3..847f167 100644
--- a/include/moves.h
+++ b/include/moves.h
@@ -3,6 +3,11 @@
#include "constants/move.h"
+// 0x92A88
+void InitPokemonMove(struct PokemonMove *move, u16 moveID);
+// 0x92B90
+u8 GetMoveWeight(struct PokemonMove *move);
+// 0x92BF4
u32 GetMoveMaxPP(struct PokemonMove *move);
#endif
diff --git a/include/status_checks.h b/include/status_checks.h
index 086711d..5bc80eb 100644
--- a/include/status_checks.h
+++ b/include/status_checks.h
@@ -3,6 +3,8 @@
#include "dungeon_entity.h"
+extern const s16 gConfusedAttackChance;
+
// 0x7001C
bool8 HasStatusAffectingActions(struct DungeonEntity *pokemon);
diff --git a/ld_script.txt b/ld_script.txt
index 4390af2..6e1b901 100755
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -232,6 +232,8 @@ SECTIONS {
src/dungeon_ai_movement.o(.text);
asm/code_8075BA4.o(.text);
src/dungeon_ai_attack.o(.text);
+ asm/code_807C04C.o(.text);
+ src/dungeon_ai_attack_1.o(.text);
asm/code_807CABC.o(.text);
src/dungeon_range.o(.text);
asm/code_808333C.o(.text);
@@ -400,6 +402,10 @@ SECTIONS {
data/data_80F4278.o(.rodata);
src/dungeon_util.o(.rodata);
data/data_80F4468.o(.rodata);
+ src/status_checks.o(.rodata);
+ data/data_80F4DB4.o(.rodata);
+ src/dungeon_ai_attack.o(.rodata);
+ data/data_80F4E2C.o(.rodata);
src/dungeon_pokemon_attributes_1.o(.rodata);
data/data_80F59C8.o(.rodata);
src/charge_move.o(.rodata);
diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c
index 5776bfa..263ef16 100644
--- a/src/dungeon_ai.c
+++ b/src/dungeon_ai.c
@@ -7,13 +7,13 @@
#include "dungeon_pokemon_attributes_1.h"
#include "dungeon_util.h"
-extern void CheckRunAwayVisualFlag(struct DungeonEntity *, u8 r1);
+extern void CheckRunAwayVisualFlag(struct DungeonEntity *, bool8 showRunAwayEffect);
bool8 ShouldAvoidFirstHit(struct DungeonEntity *pokemon, bool8 forceAvoid)
{
- if(!HasTactic(pokemon, TACTIC_AVOID_THE_FIRST_HIT))
+ if (!HasTactic(pokemon, TACTIC_AVOID_THE_FIRST_HIT))
return FALSE;
- if(!forceAvoid)
+ if (!forceAvoid)
return FALSE;
return TRUE;
}
@@ -43,8 +43,8 @@ bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon)
return TRUE;
}
}
- if (HasTactic(pokemon, TACTIC_GET_AWAY)
- || (HasTactic(pokemon, TACTIC_AVOID_TROUBLE) && pokemonData->HP <= pokemonData->maxHP / 2))
+ if (HasTactic(pokemon, TACTIC_GET_AWAY) ||
+ (HasTactic(pokemon, TACTIC_AVOID_TROUBLE) && pokemonData->HP <= pokemonData->maxHP / 2))
{
return TRUE;
}
@@ -52,11 +52,11 @@ bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon)
}
}
-bool8 ShouldAvoidEnemies_2(struct DungeonEntity *pokemon, u8 r1)
+bool8 ShouldAvoidEnemiesAndShowEffect(struct DungeonEntity *pokemon, bool8 showRunAwayEffect)
{
- if(ShouldAvoidEnemies(pokemon))
+ if (ShouldAvoidEnemies(pokemon))
{
- CheckRunAwayVisualFlag(pokemon, r1);
+ CheckRunAwayVisualFlag(pokemon, showRunAwayEffect);
return TRUE;
}
return FALSE;
diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c
index 5794038..e695422 100644
--- a/src/dungeon_ai_attack.c
+++ b/src/dungeon_ai_attack.c
@@ -1,76 +1,322 @@
#include "global.h"
#include "dungeon_ai_attack.h"
+#include "constants/direction.h"
+#include "constants/dungeon_action.h"
#include "constants/iq_skill.h"
-#include "dungeon_global_data.h"
-#include "dungeon_map_access.h"
+#include "constants/move_id.h"
+#include "constants/status.h"
+#include "constants/tactic.h"
+#include "constants/type.h"
+#include "dungeon_action.h"
+#include "dungeon_ai.h"
+#include "dungeon_capabilities_1.h"
+#include "dungeon_pokemon_attributes.h"
#include "dungeon_pokemon_attributes_1.h"
-#include "dungeon_util.h"
+#include "dungeon_random.h"
+#include "dungeon_random_1.h"
+#include "moves.h"
+#include "status_checks.h"
-bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange)
+#define REGULAR_ATTACK_INDEX 4
+
+const s16 gRegularAttackWeights[] = {100, 20, 30, 40, 50};
+
+struct MoveTargetResults
+{
+ bool8 moveUsable;
+ u8 targetDir;
+ s32 moveWeight;
+};
+
+extern bool8 IsChargeMove(struct DungeonEntity*, struct PokemonMove*);
+extern void TargetTileInFront(struct DungeonEntity*);
+extern s32 FindMoveTarget(struct MoveTargetResults*, struct DungeonEntity*, struct PokemonMove*);
+extern bool8 IsMoveUsable(struct DungeonEntity*, s32, bool8);
+extern bool8 TargetRegularAttack(struct DungeonEntity*, u32*, bool8);
+
+void DecideAttack(struct DungeonEntity *pokemon)
{
- s32 posDiffX = pokemon->posWorld.x - targetPokemon->posWorld.x;
- s32 effectiveMaxRange;
- if (posDiffX < 0)
+ struct DungeonEntityData *pokemonData = pokemon->entityData;
+ s32 i;
+ s32 chargeStatus = CHARGING_STATUS_CHARGE;
+ struct MoveTargetResults moveTargetResults[MAX_MON_MOVES + 1];
+ bool8 willNotUnlinkMove[MAX_MON_MOVES];
+ s32 randomWeight;
+ bool8 hasPPChecker;
+ s32 numUsableMoves;
+ s32 total;
+ s32 weightCounter;
+ bool8 hasWeakTypePicker;
+ s32 regularAttackTargetDir;
+ bool8 canTargetRegularAttack;
+ s32 maxWeight;
+ if (CannotAttack(pokemon, FALSE) ||
+ ShouldAvoidEnemiesAndShowEffect(pokemon, TRUE) ||
+ HasTactic(pokemon, TACTIC_KEEP_YOUR_DISTANCE) ||
+ (pokemonData->volatileStatus == VOLATILE_STATUS_CONFUSED && RollPercentChance(gConfusedAttackChance)))
{
- posDiffX = -posDiffX;
+ return;
}
- effectiveMaxRange = pokemon->posWorld.y - targetPokemon->posWorld.y;
- if (effectiveMaxRange < 0)
+ if (pokemonData->chargingStatus != CHARGING_STATUS_NONE)
{
- effectiveMaxRange = -effectiveMaxRange;
+ for (i = 0; i < MAX_MON_MOVES; i++)
+ {
+ if (pokemonData->moves[i].moveFlags & MOVE_FLAG_EXISTS &&
+ IsChargeMove(pokemon, &pokemonData->moves[i]) &&
+ pokemonData->chargingStatusMoveIndex == i)
+ {
+ s32 chosenMoveIndex;
+ SetAction(&pokemonData->action, DUNGEON_ACTION_USE_MOVE_AI);
+ chosenMoveIndex = i;
+ if (i > 0 && pokemonData->moves[i].moveFlags & MOVE_FLAG_LINKED)
+ {
+ while (--chosenMoveIndex > 0)
+ {
+ if (!(pokemonData->moves[chosenMoveIndex].moveFlags & MOVE_FLAG_LINKED))
+ {
+ break;
+ }
+ }
+ }
+ pokemonData->action.actionUseIndex = chosenMoveIndex;
+ TargetTileInFront(pokemon);
+ return;
+ }
+ }
}
- if (effectiveMaxRange < posDiffX)
+ total = 0;
+ numUsableMoves = 0;
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
- effectiveMaxRange = posDiffX;
+ struct PokemonMove *move = &pokemonData->moves[i];
+ if (pokemonData->moves[i].moveFlags & MOVE_FLAG_EXISTS)
+ {
+ if (pokemonData->moves[i].moveFlags & MOVE_FLAG_ENABLED)
+ {
+ numUsableMoves++;
+ }
+ total += move->PP;
+ }
+ }
+ if (total == 0)
+ {
+ struct PokemonMove struggle;
+ InitPokemonMove(&struggle, MOVE_STRUGGLE);
+ FindMoveTarget(&moveTargetResults[0], pokemon, &struggle);
+ if (moveTargetResults[0].moveUsable)
+ {
+ SetAction(&pokemonData->action, DUNGEON_ACTION_STRUGGLE);
+ pokemonData->action.facingDir = moveTargetResults[0].targetDir & DIRECTION_MASK;
+ TargetTileInFront(pokemon);
+ }
+ return;
}
- if (effectiveMaxRange > maxRange)
+ hasWeakTypePicker = HasIQSkill(pokemon, IQ_SKILL_WEAK_TYPE_PICKER);
+ hasPPChecker = HasIQSkill(pokemon, IQ_SKILL_PP_CHECKER) != FALSE;
+ total = 0;
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
- effectiveMaxRange = maxRange;
+ willNotUnlinkMove[i] = TRUE;
}
- if (!HasIQSkill(pokemon, IQ_SKILL_COURSE_CHECKER))
+ if (hasPPChecker)
{
- // BUG: effectiveMaxRange is already capped at maxRange, so this condition always evaluates to TRUE.
- // The AI also has range checks elsewhere, so this doesn't become an issue in most cases.
- // If the AI has the Long Toss or Pierce statuses and Course Checker is disabled,
- // this incorrect check causes the AI to throw items at targets further than 10 tiles away.
- if (effectiveMaxRange <= maxRange)
+ s32 minPP = 99;
+ s32 linkedMoveStartIndex = 0;
+ // Linked moves unlink if any move in the chain runs out of PP.
+ // With PP Checker, the AI avoids this by not using linked moves if any move in the chain has 1 PP left.
+ // This requires a separate check from the 0-PP check used for unlinked moves.
+ for (i = 0; i < MAX_MON_MOVES; i++)
{
- return TRUE;
+ struct PokemonMove *move = &pokemonData->moves[i];
+ if (!(move->moveFlags & MOVE_FLAG_EXISTS))
+ {
+ break;
+ }
+ if (i != 0 && !(move->moveFlags & MOVE_FLAG_LINKED))
+ {
+ if (linkedMoveStartIndex + 1 < i && minPP <= 1 && linkedMoveStartIndex + 1 <= i)
+ {
+ s32 j;
+ for (j = linkedMoveStartIndex; j < i; j++)
+ {
+ willNotUnlinkMove[j] = FALSE;
+ }
+ }
+ minPP = move->PP;
+ linkedMoveStartIndex = i;
+ }
+ else
+ {
+ s32 newMinPP = move->PP;
+ if (newMinPP > minPP)
+ {
+ newMinPP = minPP;
+ }
+ minPP = newMinPP;
+ }
+ }
+ if (linkedMoveStartIndex + 1 < i && minPP <= 1 && linkedMoveStartIndex + 1 <= i)
+ {
+ s32 j;
+ for (j = linkedMoveStartIndex; j < i; j++)
+ {
+ willNotUnlinkMove[j] = FALSE;
+ }
}
}
- else
+ for (i = 0; i < MAX_MON_MOVES; i++)
+ {
+ struct PokemonMove *move;
+ moveTargetResults[i].moveUsable = FALSE;
+ move = &pokemonData->moves[i];
+ if (move->moveFlags & MOVE_FLAG_EXISTS &&
+ willNotUnlinkMove[i] &&
+ IsMoveUsable(pokemon, i, hasPPChecker) &&
+ move->moveFlags & MOVE_FLAG_ENABLED)
+ {
+ moveTargetResults[i].moveUsable = TRUE;
+ if (pokemonData->chargingStatus == chargeStatus)
+ {
+ if (move->moveID == MOVE_CHARGE)
+ {
+ moveTargetResults[i].moveWeight = 0;
+ continue;
+ }
+ else if (GetMoveTypeForPokemon(pokemon, move) == TYPE_ELECTRIC)
+ {
+ moveTargetResults[i].moveWeight = GetMoveWeight(move);
+ }
+ else
+ {
+ moveTargetResults[i].moveWeight = 1;
+ }
+ }
+ else if (hasWeakTypePicker)
+ {
+ struct MoveTargetResults *results = &moveTargetResults[i];
+ results->moveWeight = FindMoveTarget(results, pokemon, move);
+ }
+ else
+ {
+ moveTargetResults[i].moveWeight = GetMoveWeight(move);
+ }
+ total += moveTargetResults[i].moveWeight;
+ }
+ }
+ moveTargetResults[REGULAR_ATTACK_INDEX].moveWeight = 0;
+ if (!HasIQSkill(pokemon, IQ_SKILL_EXCLUSIVE_MOVE_USER) && pokemonData->chargingStatus != chargeStatus)
+ {
+ moveTargetResults[REGULAR_ATTACK_INDEX].moveUsable = TRUE;
+ if (pokemonData->chargingStatus == chargeStatus)
+ {
+ // Never reached? Charge already skips the regular attack in the outer block.
+ moveTargetResults[REGULAR_ATTACK_INDEX].moveWeight = 1;
+ }
+ else if (hasWeakTypePicker)
+ {
+ moveTargetResults[REGULAR_ATTACK_INDEX].moveWeight = 2;
+ }
+ else
+ {
+ moveTargetResults[REGULAR_ATTACK_INDEX].moveWeight = gRegularAttackWeights[numUsableMoves];
+ }
+ total += moveTargetResults[REGULAR_ATTACK_INDEX].moveWeight;
+ }
+ if (hasWeakTypePicker)
{
- s32 currentPosX = pokemon->posWorld.x;
- s32 currentPosY = pokemon->posWorld.y;
- s32 adjacentTileOffsetX = gAdjacentTileOffsets[facingDir].x;
- s32 adjacentTileOffsetY = gAdjacentTileOffsets[facingDir].y;
s32 i;
- for (i = 0; i <= effectiveMaxRange; i++)
+ maxWeight = 0;
+ total = 0;
+ for (i = 0; i < MAX_MON_MOVES + 1; i++)
{
- struct MapTile *mapTile;
- currentPosX += adjacentTileOffsetX;
- currentPosY += adjacentTileOffsetY;
- if (currentPosX <= 0 || currentPosY <= 0 ||
- currentPosX >= DUNGEON_MAX_SIZE_X - 1 || currentPosY >= DUNGEON_MAX_SIZE_Y - 1)
+ if (!moveTargetResults[i].moveUsable)
{
- break;
+ moveTargetResults[i].moveWeight = 0;
}
- while (0); // Extra label needed to swap branch locations in ASM.
- mapTile = GetMapTileAtPosition(currentPosX, currentPosY);
- if (!(mapTile->tileType & (TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)))
+ else if (maxWeight < moveTargetResults[i].moveWeight)
{
- break;
+ maxWeight = moveTargetResults[i].moveWeight;
}
- if (mapTile->pokemon == targetPokemon)
+ }
+ for (i = 0; i < MAX_MON_MOVES + 1; i++)
+ {
+ if (moveTargetResults[i].moveUsable)
{
- return TRUE;
+ if (maxWeight != moveTargetResults[i].moveWeight)
+ {
+ moveTargetResults[i].moveWeight = 0;
+ }
+ total += moveTargetResults[i].moveWeight;
}
- if (mapTile->pokemon != NULL)
+ }
+ }
+ if (total == 0)
+ {
+ return;
+ }
+ randomWeight = DungeonRandomCapped(total);
+ weightCounter = 0;
+ if (!HasIQSkill(pokemon, IQ_SKILL_EXCLUSIVE_MOVE_USER))
+ {
+ canTargetRegularAttack = TargetRegularAttack(pokemon, &regularAttackTargetDir, TRUE);
+ }
+ else
+ {
+ canTargetRegularAttack = FALSE;
+ regularAttackTargetDir = DIRECTION_SOUTH;
+ }
+ for (i = 0; i <= REGULAR_ATTACK_INDEX; i++)
+ {
+ if (moveTargetResults[i].moveUsable && moveTargetResults[i].moveWeight != 0)
+ {
+ weightCounter += moveTargetResults[i].moveWeight;
+ if (weightCounter >= randomWeight)
{
- break;
+ if (i == REGULAR_ATTACK_INDEX)
+ {
+ if (canTargetRegularAttack)
+ {
+ SetAction(&pokemonData->action, DUNGEON_ACTION_REGULAR_ATTACK);
+ pokemonData->action.facingDir = regularAttackTargetDir & DIRECTION_MASK;
+ TargetTileInFront(pokemon);
+ }
+ }
+ else
+ {
+ FindMoveTarget(&moveTargetResults[i], pokemon, &pokemonData->moves[i]);
+ if (moveTargetResults[i].moveUsable)
+ {
+ s32 chosenMoveIndex;
+ SetAction(&pokemonData->action, DUNGEON_ACTION_USE_MOVE_AI);
+ chosenMoveIndex = i;
+ if (i > 0 && pokemonData->moves[i].moveFlags & MOVE_FLAG_LINKED)
+ {
+ while (--chosenMoveIndex > 0)
+ {
+ if (!(pokemonData->moves[chosenMoveIndex].moveFlags & MOVE_FLAG_LINKED))
+ {
+ break;
+ }
+ }
+ }
+ pokemonData->action.facingDir = moveTargetResults[i].targetDir & DIRECTION_MASK;
+ pokemonData->action.actionUseIndex = chosenMoveIndex;
+ TargetTileInFront(pokemon);
+ }
+ else
+ {
+ break;
+ }
+ }
+ return;
}
}
}
- return FALSE;
+ if (canTargetRegularAttack)
+ {
+ SetAction(&pokemonData->action, DUNGEON_ACTION_REGULAR_ATTACK);
+ pokemonData->action.facingDir = regularAttackTargetDir & DIRECTION_MASK;
+ TargetTileInFront(pokemon);
+ }
}
diff --git a/src/dungeon_ai_attack_1.c b/src/dungeon_ai_attack_1.c
new file mode 100644
index 0000000..e846b4b
--- /dev/null
+++ b/src/dungeon_ai_attack_1.c
@@ -0,0 +1,76 @@
+#include "global.h"
+#include "dungeon_ai_attack_1.h"
+
+#include "constants/iq_skill.h"
+#include "dungeon_global_data.h"
+#include "dungeon_map_access.h"
+#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_util.h"
+
+bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange)
+{
+ s32 posDiffX = pokemon->posWorld.x - targetPokemon->posWorld.x;
+ s32 effectiveMaxRange;
+ if (posDiffX < 0)
+ {
+ posDiffX = -posDiffX;
+ }
+ effectiveMaxRange = pokemon->posWorld.y - targetPokemon->posWorld.y;
+ if (effectiveMaxRange < 0)
+ {
+ effectiveMaxRange = -effectiveMaxRange;
+ }
+ if (effectiveMaxRange < posDiffX)
+ {
+ effectiveMaxRange = posDiffX;
+ }
+ if (effectiveMaxRange > maxRange)
+ {
+ effectiveMaxRange = maxRange;
+ }
+ if (!HasIQSkill(pokemon, IQ_SKILL_COURSE_CHECKER))
+ {
+ // BUG: effectiveMaxRange is already capped at maxRange, so this condition always evaluates to TRUE.
+ // The AI also has range checks elsewhere, so this doesn't become an issue in most cases.
+ // If the AI has the Long Toss or Pierce statuses and Course Checker is disabled,
+ // this incorrect check causes the AI to throw items at targets further than 10 tiles away.
+ if (effectiveMaxRange <= maxRange)
+ {
+ return TRUE;
+ }
+ }
+ else
+ {
+ s32 currentPosX = pokemon->posWorld.x;
+ s32 currentPosY = pokemon->posWorld.y;
+ s32 adjacentTileOffsetX = gAdjacentTileOffsets[facingDir].x;
+ s32 adjacentTileOffsetY = gAdjacentTileOffsets[facingDir].y;
+ s32 i;
+ for (i = 0; i <= effectiveMaxRange; i++)
+ {
+ struct MapTile *mapTile;
+ currentPosX += adjacentTileOffsetX;
+ currentPosY += adjacentTileOffsetY;
+ if (currentPosX <= 0 || currentPosY <= 0 ||
+ currentPosX >= DUNGEON_MAX_SIZE_X - 1 || currentPosY >= DUNGEON_MAX_SIZE_Y - 1)
+ {
+ break;
+ }
+ while (0); // Extra label needed to swap branch locations in ASM.
+ mapTile = GetMapTileAtPosition(currentPosX, currentPosY);
+ if (!(mapTile->tileType & (TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)))
+ {
+ break;
+ }
+ if (mapTile->pokemon == targetPokemon)
+ {
+ return TRUE;
+ }
+ if (mapTile->pokemon != NULL)
+ {
+ break;
+ }
+ }
+ }
+ return FALSE;
+}
diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c
index 6c9669b..829bc2d 100644
--- a/src/dungeon_ai_item_weight.c
+++ b/src/dungeon_ai_item_weight.c
@@ -85,11 +85,11 @@ u32 EvaluateItem(struct DungeonEntity *targetPokemon, struct ItemSlot *item, u32
{
if (move->moveFlags & MOVE_FLAG_EXISTS)
{
- if (move->pp == 0)
+ if (move->PP == 0)
{
itemWeight += 30;
}
- if (move->pp != GetMoveMaxPP(move2))
+ if (move->PP != GetMoveMaxPP(move2))
{
itemWeight += 6;
}
diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c
index d515ebb..2b1bb71 100644
--- a/src/dungeon_ai_items.c
+++ b/src/dungeon_ai_items.c
@@ -7,7 +7,7 @@
#include "constants/targeting.h"
#include "dungeon_action.h"
#include "dungeon_ai_1.h"
-#include "dungeon_ai_attack.h"
+#include "dungeon_ai_attack_1.h"
#include "dungeon_ai_item_weight.h"
#include "dungeon_ai_items.h"
#include "dungeon_capabilities.h"
diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c
index bc109eb..88ed8cb 100644
--- a/src/dungeon_ai_movement.c
+++ b/src/dungeon_ai_movement.c
@@ -8,6 +8,7 @@
#include "constants/targeting.h"
#include "code_80521D0.h"
#include "dungeon_action.h"
+#include "dungeon_ai_attack.h"
#include "dungeon_ai_items.h"
#include "dungeon_capabilities_1.h"
#include "dungeon_global_data.h"
@@ -27,7 +28,6 @@ extern char *gPtrItsaMonsterHouseMessage;
extern void SendImmobilizeEndMessage(struct DungeonEntity*, struct DungeonEntity*);
extern void SetMessageArgument(char[], struct DungeonEntity*, u32);
extern void ResetAction(u16*);
-extern void DecideAttack(struct DungeonEntity*);
extern void MoveIfPossible(struct DungeonEntity*, bool8);
extern u8 sub_8044B28(void);
extern void sub_807AB38(struct DungeonEntity *, u32);
diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c
index c70d4ff..9f01c2b 100644
--- a/src/dungeon_pokemon_attributes.c
+++ b/src/dungeon_pokemon_attributes.c
@@ -51,7 +51,7 @@ bool8 sub_80717A4(struct DungeonEntity *param_1, u16 moveID)
{
struct DungeonEntityData * entityData;
s32 iVar3;
-
+
entityData = param_1->entityData;
if ((entityData->sleepStatus != SLEEP_STATUS_SLEEP) && (entityData->sleepStatus != SLEEP_STATUS_NAPPING) && (entityData->sleepStatus != SLEEP_STATUS_NIGHTMARE)) {
return FALSE;
@@ -66,10 +66,10 @@ bool8 sub_80717A4(struct DungeonEntity *param_1, u16 moveID)
for(iVar3 = 0, pokeMove = entityData->moves, pokeMove2 = pokeMove; iVar3 < MAX_MON_MOVES; pokeMove++, pokeMove2++, iVar3++)
{
if (((pokeMove->moveFlags & MOVE_FLAG_EXISTS) != 0) && (entityData->isLeader || ((pokeMove->moveFlags & MOVE_FLAG_ENABLED) != 0)))
- if((sub_805744C(param_1, pokeMove2, 1) != '\0') && (pokeMove->pp != 0))
+ if((sub_805744C(param_1, pokeMove2, 1) != '\0') && (pokeMove->PP != 0))
if(pokeMove->moveID == moveID)
return TRUE;
- }
+ }
return FALSE;
}
}
diff --git a/src/dungeon_pokemon_attributes_1.c b/src/dungeon_pokemon_attributes_1.c
index 93d8d4a..c7d3a13 100644
--- a/src/dungeon_pokemon_attributes_1.c
+++ b/src/dungeon_pokemon_attributes_1.c
@@ -113,9 +113,9 @@ bool8 CanSeeTeammate(struct DungeonEntity * pokemon)
}
}
-u8 GetMoveType_2(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove)
+u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove)
{
- if(pokeMove->moveID == MOVE_HIDDEN_POWER)
+ if (pokeMove->moveID == MOVE_HIDDEN_POWER)
return pokemon->entityData->hiddenPowerType;
else
return GetMoveType(pokeMove);
diff --git a/src/items.c b/src/items.c
index a19b71b..999fd7d 100644
--- a/src/items.c
+++ b/src/items.c
@@ -39,7 +39,6 @@ extern void ExpandPlaceholdersBuffer(u8 *, const u8 *, ...);
extern s32 sub_8090FEC(s32 a1, u8* a2, u8 a3);
extern void sub_80073B8(u32);
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
-extern void InitPokemonMove(void*, u16); // first arg is some struct
extern void sub_80078A4(u32, u32, u32, u32, u32);
extern u32 GetMoveType(void*);
extern u8* GetUnformattedTypeString(s16);
diff --git a/src/moves.c b/src/moves.c
index f2e334c..54927d8 100644
--- a/src/moves.c
+++ b/src/moves.c
@@ -99,7 +99,7 @@ void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0
ExpandPlaceholdersBuffer
(buffer,gUnknown_81098EC,uVar2,move->moveFlags & MOVE_FLAG_SET ? gUnknown_8109908 : gUnknown_810990C,
gMovesData[move->moveID].namePointer,localBuffer,param_3->unk4,
- move->pp,maxPP);
+ move->PP,maxPP);
break;
case 2:
@@ -107,7 +107,7 @@ void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0
ExpandPlaceholdersBuffer
(buffer,gUnknown_8109910,uVar2,move->moveFlags & MOVE_FLAG_SET ? gUnknown_8109908 : gUnknown_810990C,
gMovesData[move->moveID].namePointer,localBuffer,param_3->unk4,
- move->pp,maxPP);
+ move->PP,maxPP);
break;
case 3:
@@ -115,7 +115,7 @@ void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0
ExpandPlaceholdersBuffer
(buffer,gUnknown_81098EC,uVar2,move->moveFlags & MOVE_FLAG_ENABLED ? gUnknown_8109928 : gUnknown_810990C,
gMovesData[move->moveID].namePointer,localBuffer,param_3->unk4,
- move->pp,maxPP);
+ move->PP,maxPP);
break;
case 4:
@@ -123,7 +123,7 @@ void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0
ExpandPlaceholdersBuffer
(buffer,gUnknown_8109910,uVar2, move->moveFlags & MOVE_FLAG_ENABLED ? gUnknown_8109928 : gUnknown_810990C,
gMovesData[move->moveID].namePointer,localBuffer,param_3->unk4,
- move->pp,maxPP);
+ move->PP,maxPP);
break;
}
}
@@ -133,7 +133,7 @@ void InitPokemonMove(struct PokemonMove *move, u16 moveID)
move->moveFlags = MOVE_FLAG_ENABLED | MOVE_FLAG_EXISTS;
move->sealed = FALSE;
move->moveID = moveID;
- move->pp = GetMoveMaxPP(move);
+ move->PP = GetMoveMaxPP(move);
move->powerBoost = 0;
}
@@ -146,7 +146,7 @@ void sub_8092AA8(struct PokemonMove *move, u16 moveID)
move->moveFlags = MOVE_FLAG_ENABLED | MOVE_FLAG_EXISTS;
move->sealed = FALSE;
move->moveID = moveID;
- move->pp = GetMoveMaxPP(move);
+ move->PP = GetMoveMaxPP(move);
move->powerBoost = 0;
}
}
@@ -155,7 +155,7 @@ void InitZeroedPPPokemonMove(struct PokemonMove *move, u16 moveID)
{
move->moveFlags = MOVE_FLAG_ENABLED | MOVE_FLAG_EXISTS;
move->moveID = moveID;
- move->pp = 0;
+ move->PP = 0;
}
s16 GetMoveTargetingFlags(struct PokemonMove *move, u32 r1)
diff --git a/src/moves_1.c b/src/moves_1.c
index db84d41..5a7bf6b 100644
--- a/src/moves_1.c
+++ b/src/moves_1.c
@@ -7,14 +7,14 @@ void SavePokemonMove(struct unkStruct_8094924 *r0, struct PokemonMove *move)
{
SaveIntegerBits(r0, &move->moveFlags, 4);
SaveIntegerBits(r0, &move->moveID, 9);
- SaveIntegerBits(r0, &move->pp, 7);
+ SaveIntegerBits(r0, &move->PP, 7);
}
void RestorePokemonMove(struct unkStruct_8094924 *r0, struct PokemonMove *move)
{
RestoreIntegerBits(r0, &move->moveFlags, 4);
RestoreIntegerBits(r0, &move->moveID, 9);
- RestoreIntegerBits(r0, &move->pp, 7);
+ RestoreIntegerBits(r0, &move->PP, 7);
}
void SavePokemonMoves(struct unkStruct_8094924 *r0, struct PokemonMove *moveSet)
@@ -40,7 +40,7 @@ void sub_8094148(struct unkStruct_8094924 *r0, struct PokemonMove *move)
SaveIntegerBits(r0, &move->moveFlags, 4);
SaveIntegerBits(r0, &move->sealed, 1);
SaveIntegerBits(r0, &move->moveID, 9);
- SaveIntegerBits(r0, &move->pp, 7);
+ SaveIntegerBits(r0, &move->PP, 7);
SaveIntegerBits(r0, &move->powerBoost, 7);
}
@@ -61,7 +61,7 @@ void sub_80941B0(struct unkStruct_8094924 *r0, struct PokemonMove *move)
RestoreIntegerBits(r0, &move->moveFlags, 4);
RestoreIntegerBits(r0, &move->sealed, 1);
RestoreIntegerBits(r0, &move->moveID, 9);
- RestoreIntegerBits(r0, &move->pp, 7);
+ RestoreIntegerBits(r0, &move->PP, 7);
RestoreIntegerBits(r0, &move->powerBoost, 7);
}
diff --git a/src/status_checks.c b/src/status_checks.c
index b371934..12889b5 100644
--- a/src/status_checks.c
+++ b/src/status_checks.c
@@ -6,9 +6,12 @@
#include "constants/status.h"
#include "code_80521D0.h"
#include "dungeon_action.h"
+#include "dungeon_ai_attack.h"
#include "dungeon_capabilities_1.h"
#include "dungeon_random.h"
+const s16 gConfusedAttackChance = 70;
+
extern char *gPtrFrozenMessage;
extern char *gPtrWrappedAroundMessage;
extern char *gPtrWrappedByMessage;
@@ -18,7 +21,6 @@ extern char *gPtrInfatuatedMessage;
extern char gAvailablePokemonNames[];
extern void SetMessageArgument(char[], struct DungeonEntity*, u32);
-extern void DecideAttack(struct DungeonEntity*);
bool8 HasStatusAffectingActions(struct DungeonEntity *pokemon)
{